Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

Commit 7548b82

Browse files
committed
Merge branch 'master' into upgrade
2 parents c3e3d35 + 9da36a0 commit 7548b82

File tree

20 files changed

+1253
-196
lines changed

20 files changed

+1253
-196
lines changed

src/components/Header.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Link from 'next/link'
22

3-
function TailwindMark({ className }) {
3+
export function TailwindMark({ className }) {
44
return (
55
<svg className={className} fill="none" viewBox="0 0 55 33">
66
<path fill="#fff" d="M0 0h55v33H0z" />
@@ -14,7 +14,7 @@ function TailwindMark({ className }) {
1414
)
1515
}
1616

17-
function TailwindLogo({ className }) {
17+
export function TailwindLogo({ className }) {
1818
return (
1919
<svg className={className} fill="none" viewBox="0 0 285 33">
2020
<path
@@ -47,7 +47,10 @@ export default function Header() {
4747
</Link>
4848
</div>
4949
<div className="text-base leading-5">
50-
<a href="https://tailwindcss.com/docs" className="font-medium text-gray-500 hover:text-gray-700">
50+
<a
51+
href="https://tailwindcss.com/docs"
52+
className="font-medium text-gray-500 hover:text-gray-700"
53+
>
5154
Documentation &rarr;
5255
</a>
5356
</div>

src/components/Post.js

Lines changed: 220 additions & 108 deletions
Large diffs are not rendered by default.

src/getAllPostPreviews.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
function importAll(r) {
2-
return r
3-
.keys()
4-
.map((fileName) => ({
5-
link: fileName.substr(1).replace(/\/index\.mdx$/, ''),
6-
module: r(fileName),
7-
}))
2+
return r.keys().map((fileName) => ({
3+
link: fileName.substr(1).replace(/\/index\.mdx$/, ''),
4+
module: r(fileName),
5+
}))
86
}
97

108
function dateSortDesc(a, b) {
@@ -14,13 +12,13 @@ function dateSortDesc(a, b) {
1412
}
1513

1614
export default function getAllPostPreviews() {
17-
return importAll(require.context('./pages/?preview', true, /\.mdx$/)).sort((a, b) =>
18-
dateSortDesc(a.module.meta.date, b.module.meta.date)
19-
)
15+
return importAll(require.context('./pages/?preview', true, /\.mdx$/))
16+
.filter((p) => p.module.meta.private !== true)
17+
.sort((a, b) => dateSortDesc(a.module.meta.date, b.module.meta.date))
2018
}
2119

2220
export function getAllPosts() {
23-
return importAll(require.context('./pages/?rss', true, /\.mdx$/)).sort((a, b) =>
24-
dateSortDesc(a.module.meta.date, b.module.meta.date)
25-
)
21+
return importAll(require.context('./pages/?rss', true, /\.mdx$/))
22+
.filter((p) => p.module.meta.private !== true)
23+
.sort((a, b) => dateSortDesc(a.module.meta.date, b.module.meta.date))
2624
}

src/img/twitter-card-small.jpg

35.3 KB
Loading

src/pages/_app.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import '@/css/tailwind.css'
22
import Head from 'next/head'
3-
import Header from '@/components/Header'
4-
import SectionContainer from '@/components/SectionContainer'
53

64
export default function App({ Component, pageProps }) {
75
return (
@@ -18,14 +16,7 @@ export default function App({ Component, pageProps }) {
1816
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="/atom.xml" />
1917
<link rel="alternate" type="application/json" title="JSON Feed" href="/feed.json" />
2018
</Head>
21-
<SectionContainer>
22-
<Header />
23-
</SectionContainer>
24-
<SectionContainer>
25-
<main>
26-
<Component {...pageProps} />
27-
</main>
28-
</SectionContainer>
19+
<Component {...pageProps} />
2920
</div>
3021
)
3122
}

src/pages/building-react-and-vue-support-for-tailwind-ui/index.mdx

Lines changed: 436 additions & 0 deletions
Large diffs are not rendered by default.
Loading

src/pages/headless-ui-v1/.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 80,
3+
"singleQuote": true,
4+
"semi": false
5+
}

src/pages/headless-ui-v1/card.jpg

27.5 KB
Loading

src/pages/headless-ui-v1/index.mdx

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
import { adamwathan } from '@/authors'
2+
import card from './card.jpg'
3+
4+
export const meta = {
5+
title: 'Headless UI v1.0',
6+
description: `Last fall we announced Headless UI, a library of completely unstyled, fully accessible UI components, designed to pair perfectly with Tailwind CSS. Today we’re super excited to release Headless UI v1.0, which more than doubles the amount of included components for both React and Vue.`,
7+
date: '2021-04-14T16:00:00.000Z',
8+
authors: [adamwathan],
9+
image: card,
10+
footer: `
11+
<p>
12+
Want to try it out?
13+
<a href="https://headlessui.dev" class="font-medium text-teal-500 hover:text-teal-600">
14+
Visit the Headless UI website →
15+
</a>
16+
</p>
17+
`,
18+
}
19+
20+
Last fall we announced [Headless UI](https://blog.tailwindcss.com/headless-ui-unstyled-accessible-ui-components), a library of completely unstyled, fully accessible UI components, designed to pair perfectly with Tailwind CSS.
21+
22+
Today we’re super excited to release [Headless UI v1.0](https://headlessui.dev), which more than doubles the amount of included components for both React and Vue.
23+
24+
<!--more-->
25+
26+
<a href="https://headlessui.dev">
27+
<img src={card} alt="Headless UI" />
28+
</a>
29+
30+
## What’s new
31+
32+
We’ve added four new components to the React library, and five new components for Vue.
33+
34+
### Dialog (modal)
35+
36+
Headless UI now includes a robust dialog implementation you can use to build traditional modal dialogs, mobile slide-out menus, or any other take-over-style UI that needs to capture the focus of the entire page.
37+
38+
```jsx
39+
import { useState } from 'react'
40+
import { Dialog } from '@headlessui/react'
41+
42+
function MyDialog() {
43+
let [isOpen, setIsOpen] = useState(true)
44+
45+
return (
46+
<Dialog open={isOpen} onClose={setIsOpen}>
47+
<Dialog.Overlay />
48+
49+
<Dialog.Title>Deactivate account</Dialog.Title>
50+
<Dialog.Description>
51+
This will permanently deactivate your account
52+
</Dialog.Description>
53+
54+
<p>
55+
Are you sure you want to deactivate your account? All of your data will
56+
be permanently removed. This action cannot be undone.
57+
</p>
58+
59+
<button onClick={() => setIsOpen(false)}>Deactivate</button>
60+
<button onClick={() => setIsOpen(false)}>Cancel</button>
61+
</Dialog>
62+
)
63+
}
64+
```
65+
66+
### Disclosure
67+
68+
We’ve added a new `Disclosure` component that makes it easy to show/hide inline content accessibly. This is useful for things like collapsible FAQ questions, "show more" interfaces, or even hamburger menus that open up and push the rest of the page content away.
69+
70+
```html
71+
<template>
72+
<Disclosure>
73+
<DisclosureButton> Is team pricing available? </DisclosureButton>
74+
<DisclosurePanel>
75+
Yes! You can purchase a license that you can share with your entire team.
76+
</DisclosurePanel>
77+
</Disclosure>
78+
</template>
79+
80+
<script>
81+
import {
82+
Disclosure,
83+
DisclosureButton,
84+
DisclosurePanel,
85+
} from '@headlessui/vue'
86+
87+
export default {
88+
components: { Disclosure, DisclosureButton, DisclosurePanel },
89+
}
90+
</script>
91+
```
92+
93+
### Radio Group
94+
95+
There’s now a `RadioGroup` component that you can use to build totally custom radio button UIs, like when you want to use fancy cards or something instead of a simple little radio circle.
96+
97+
```jsx
98+
import { useState } from 'react'
99+
import { RadioGroup } from '@headlessui/react'
100+
101+
function MyRadioGroup() {
102+
let [plan, setPlan] = useState('startup')
103+
104+
return (
105+
<RadioGroup value={plan} onChange={setPlan}>
106+
<RadioGroup.Label>Plan</RadioGroup.Label>
107+
<RadioGroup.Option value="startup">
108+
{({ checked }) => (
109+
<span className={checked ? 'bg-blue-200' : ''}>Startup</span>
110+
)}
111+
</RadioGroup.Option>
112+
<RadioGroup.Option value="business">
113+
{({ checked }) => (
114+
<span className={checked ? 'bg-blue-200' : ''}>Business</span>
115+
)}
116+
</RadioGroup.Option>
117+
<RadioGroup.Option value="enterprise">
118+
{({ checked }) => (
119+
<span className={checked ? 'bg-blue-200' : ''}>Enterprise</span>
120+
)}
121+
</RadioGroup.Option>
122+
</RadioGroup>
123+
)
124+
}
125+
```
126+
127+
### Popover
128+
129+
The new `Popover` component lets you build custom dropdown UIs that don’t have any content restrictions like a regular `Menu` component would. Great for fly-out menus on marketing sites, dropdowns that have form fields in them, and tons more.
130+
131+
```html
132+
<template>
133+
<Popover class="relative">
134+
<PopoverButton>Solutions</PopoverButton>
135+
136+
<PopoverPanel class="absolute z-10">
137+
<div>
138+
<a href="/analytics">Analytics</a>
139+
<a href="/engagement">Engagement</a>
140+
<a href="/security">Security</a>
141+
<a href="/integrations">Integrations</a>
142+
</div>
143+
144+
<img src="/solutions.jpg" alt="" />
145+
</PopoverPanel>
146+
</Popover>
147+
</template>
148+
149+
<script>
150+
import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'
151+
152+
export default {
153+
components: { Popover, PopoverButton, PopoverPanel },
154+
}
155+
</script>
156+
```
157+
158+
### TransitionRoot and TransitionChild (for Vue)
159+
160+
Headless UI already had a `Transition` component for React, but we’ve always recommended the native `<transition>` that already ships with Vue for Vue users. There are some limitations to the native transition though, and things can get complicated when trying to co-ordinate nested transitions that are supposed to run in parallel.
161+
162+
Headless UI v1.0 brings our React `Transition` component to Vue as well, which makes it a lot easier to transition things like modal dialogs.
163+
164+
```html
165+
<template>
166+
<!— This `show` prop controls all nested `Transition.Child` components. —>
167+
<TransitionRoot :show="isOpen">
168+
<!— Background overlay —>
169+
<TransitionChild
170+
enter="transition-opacity"
171+
ease-linear
172+
duration-300"
173+
enter-from="opacity-0"
174+
enter-to="opacity-100"
175+
leave="transition-opacity"
176+
ease-linear
177+
duration-300"
178+
leave-from="opacity-100"
179+
leave-to="opacity-0"
180+
>
181+
<!— … —>
182+
</TransitionChild>
183+
184+
<!— Sliding sidebar —>
185+
<TransitionChild
186+
enter="transition"
187+
ease-in-out
188+
duration-300
189+
transform"
190+
enter-from="-translate-x-full"
191+
enter-to="translate-x-0"
192+
leave="transition"
193+
ease-in-out
194+
duration-300
195+
transform"
196+
leave-from="translate-x-0"
197+
leave-to="-translate-x-full"
198+
>
199+
<!— … —>
200+
</TransitionChild>
201+
</TransitionRoot>
202+
</template>
203+
204+
<script>
205+
import { ref } from "vue";
206+
import { Transition, TransitionChild } from "@headlessui/vue";
207+
208+
export default {
209+
components: { TransitionRoot: Transition, TransitionChild },
210+
211+
setup() {
212+
const isShowing = ref(true);
213+
214+
return {
215+
isShowing,
216+
};
217+
},
218+
};
219+
</script>
220+
```
221+
222+
## Try it out
223+
224+
Head over to our [brand new documentation website](https://headlessui.dev) to pull Headless UI into your projects and play with it! It’s MIT licensed and open-source, so if you’d like to poke around the code or you need to report an issue, [visit the GitHub repository](https://github.com/tailwindlabs/headlessui).

src/pages/heroicons-v1/.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 80,
3+
"singleQuote": true,
4+
"semi": false
5+
}

src/pages/heroicons-v1/card.jpg

71.7 KB
Loading

src/pages/heroicons-v1/index.mdx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { adamwathan } from '@/authors'
2+
import card from './card.jpg'
3+
4+
export const meta = {
5+
title: 'Heroicons v1.0',
6+
description: `Today we're releasing Heroicons v1.0, which includes over 450+ free icons in two styles, official React and Vue libraries, and Figma assets.`,
7+
date: '2021-03-29T19:00:00.000Z',
8+
authors: [adamwathan],
9+
image: card,
10+
footer: `
11+
<p>
12+
Want to start playing with it?
13+
<a href="https://heroicons.com" class="font-medium text-teal-500 hover:text-teal-600">
14+
Visit the Heroicons website →
15+
</a>
16+
</p>
17+
`,
18+
}
19+
20+
Just over a year ago we released the very first version of [Heroicons](https://heroicons.com), which is a set of beautiful UI icons we designed alongside Tailwind UI. Since then we've added tons of new icons, and designed and launched a dedicated web experience.
21+
22+
Today we're excited to finally release Heroicons v1.0, which includes over 450+ free icons in two styles, official React and Vue libraries, and Figma assets.
23+
24+
<!--more-->
25+
26+
<a href="https://heroicons.com">
27+
<img src={card} alt="Heroicons" />
28+
</a>
29+
30+
## React + Vue Libraries
31+
32+
In addition to grabbing the icons you need directly from the website, you can now install our official React and Vue libraries for quick and easy access to each icon as a dedicated component.
33+
34+
Here's what it looks like with React for example:
35+
36+
```js
37+
import { BeakerIcon } from '@heroicons/react/solid'
38+
39+
function MyComponent() {
40+
return (
41+
<div>
42+
<BeakerIcon className="h-5 w-5 text-blue-500" />
43+
<p>...</p>
44+
</div>
45+
)
46+
}
47+
```
48+
49+
[Check out the documentation](https://github.com/tailwindlabs/heroicons) on GitHub to learn more.
50+
51+
## Figma Assets
52+
53+
We've also published an official [Heroicons Figma file](https://www.figma.com/community/file/958423903283802665/heroicons) on our new Figma Community page!
54+
55+
It includes all the icons from Heroicons as individual Figma components so you can easily use them in your projects without having to manually import each SVG.

0 commit comments

Comments
 (0)