Skip to content

Commit 9d7a353

Browse files
Update to latest Headless UI insiders release (#1823)
* Remove as=div from dialogs * Explicitly specifiy `as` for a few types These have changed in Headless UI v2 * Update to insiders build of Headless UI v2 isn’t tagged yet but this is pretty close * Remove unncessary `as=“div”` for tab groups * Use a stable scrollbar gutter on supported browsers * Manually offset sidebar on Safari when scroll locked * Revert "Manually offset sidebar on Safari when scroll locked" This reverts commit f22c48f. Safari users generally have overlay scrollbars and it’ll eventually gain support for stable scrollbar gutters so this seems fine. * Move prop * Switch away from as=“div” for Transition Transitions default to fragments now and the more idiomatic way to do this is to just put the div inside the transition. * Remove `as` prop from comobobx demo * Update listbox element types
1 parent 223db0d commit 9d7a353

File tree

9 files changed

+285
-63
lines changed

9 files changed

+285
-63
lines changed

package-lock.json

Lines changed: 240 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@badrap/bar-of-progress": "^0.1.1",
1616
"@docsearch/react": "^3.3.3",
17-
"@headlessui/react": "^1.7.18",
17+
"@headlessui/react": "^0.0.0-insiders.4acf9e2",
1818
"@heroicons/react": "^2.1.1",
1919
"@mdx-js/loader": "^2.3.0",
2020
"@mdx-js/react": "^2.3.0",

src/components/ColorPaletteReference.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ function ColorPalette({ name, value }) {
7979
</div>
8080
</div>
8181
<Transition
82-
className="absolute bottom-full left-1/2 mb-3.5 pb-1 -translate-x-1/2"
8382
show={state === 'copied'}
8483
enter="transform ease-out duration-200 transition origin-bottom"
8584
enterFrom="scale-95 translate-y-0.5 opacity-0"
@@ -88,22 +87,24 @@ function ColorPalette({ name, value }) {
8887
leaveFrom="opacity-100"
8988
leaveTo="opacity-0"
9089
>
91-
<div className="relative bg-sky-500 text-white font-mono text-[0.625rem] leading-6 font-medium px-1.5 rounded-lg">
92-
Copied
93-
<svg
94-
aria-hidden="true"
95-
width="16"
96-
height="6"
97-
viewBox="0 0 16 6"
98-
className="text-sky-500 absolute top-full left-1/2 -mt-px -ml-2"
99-
>
100-
<path
101-
fillRule="evenodd"
102-
clipRule="evenodd"
103-
d="M15 0H1V1.00366V1.00366V1.00371H1.01672C2.72058 1.0147 4.24225 2.74704 5.42685 4.72928C6.42941 6.40691 9.57154 6.4069 10.5741 4.72926C11.7587 2.74703 13.2803 1.0147 14.9841 1.00371H15V0Z"
104-
fill="currentColor"
105-
/>
106-
</svg>
90+
<div className="absolute bottom-full left-1/2 mb-3.5 pb-1 -translate-x-1/2">
91+
<div className="relative bg-sky-500 text-white font-mono text-[0.625rem] leading-6 font-medium px-1.5 rounded-lg">
92+
Copied
93+
<svg
94+
aria-hidden="true"
95+
width="16"
96+
height="6"
97+
viewBox="0 0 16 6"
98+
className="text-sky-500 absolute top-full left-1/2 -mt-px -ml-2"
99+
>
100+
<path
101+
fillRule="evenodd"
102+
clipRule="evenodd"
103+
d="M15 0H1V1.00366V1.00366V1.00371H1.01672C2.72058 1.0147 4.24225 2.74704 5.42685 4.72928C6.42941 6.40691 9.57154 6.4069 10.5741 4.72926C11.7587 2.74703 13.2803 1.0147 14.9841 1.00371H15V0Z"
104+
fill="currentColor"
105+
/>
106+
</svg>
107+
</div>
107108
</div>
108109
</Transition>
109110
</div>

src/components/Header.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,7 @@ export function NavPopover({ display = 'md:hidden', className, ...props }) {
7676
/>
7777
</svg>
7878
</button>
79-
<Dialog
80-
as="div"
81-
className={clsx('fixed z-50 inset-0', display)}
82-
open={isOpen}
83-
onClose={setIsOpen}
84-
>
79+
<Dialog open={isOpen} onClose={setIsOpen} className={clsx('fixed z-50 inset-0', display)}>
8580
<Dialog.Overlay className="fixed inset-0 bg-black/20 backdrop-blur-sm dark:bg-slate-900/80" />
8681
<div className="fixed top-4 right-4 w-full max-w-xs bg-white rounded-lg shadow-lg p-6 text-base font-semibold text-slate-900 dark:bg-slate-800 dark:text-slate-400 dark:highlight-white/5">
8782
<button

src/components/SnippetGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function SnippetGroup({ children, style = 'plain', actions, ...props }) {
111111

112112
return (
113113
<Wrapper {...props}>
114-
<Tab.Group as="div" onChange={setSelectedIndex}>
114+
<Tab.Group onChange={setSelectedIndex}>
115115
<div className="flex">
116116
<Tab.List className="flex text-slate-400 text-xs leading-6 overflow-hidden rounded-tl-xl pt-2">
117117
{children.map((child, tabIndex) => (

0 commit comments

Comments
 (0)