Skip to content

Commit 347d105

Browse files
authored
chore: update headless ui (#4393)
1 parent 2620b7e commit 347d105

File tree

7 files changed

+156
-31
lines changed

7 files changed

+156
-31
lines changed

package-lock.json

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

web/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@codemirror/legacy-modes": "^6.4.0",
2424
"@codemirror/state": "^6.4.1",
2525
"@codemirror/view": "^6.28.1",
26-
"@headlessui/react": "^1.7.17",
26+
"@headlessui/react": "^2.0.0",
2727
"@heroicons/react": "^2.0.18",
2828
"@lit/react": "^1.0.6",
2929
"@radix-ui/react-context-menu": "^2.1.4",

web/client/src/library/components/editor/EditorPreview.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Suspense, lazy, useEffect, useMemo, useState } from 'react'
2-
import { Tab } from '@headlessui/react'
1+
import { Fragment, Suspense, lazy, useEffect, useMemo, useState } from 'react'
2+
import { TabGroup, TabPanel, TabPanels } from '@headlessui/react'
33
import clsx from 'clsx'
44
import { includes, isArrayEmpty, isFalse, isNotNil } from '~/utils'
55
import { type EditorTab, useStoreEditor } from '~/context/editor'
@@ -155,7 +155,8 @@ export default function EditorPreview({
155155
<h3 className="text-md">No Data To Preview</h3>
156156
</div>
157157
) : (
158-
<Tab.Group
158+
<TabGroup
159+
as={Fragment}
159160
key={tab.id}
160161
onChange={setActiveTabIndex}
161162
selectedIndex={activeTabIndex}
@@ -186,20 +187,20 @@ export default function EditorPreview({
186187
</Button>
187188
</div>
188189
</TabList>
189-
<Tab.Panels className="h-full w-full overflow-hidden">
190+
<TabPanels className="h-full w-full overflow-hidden">
190191
{isNotNil(previewTable) && (
191-
<Tab.Panel
192+
<TabPanel
192193
unmount={false}
193194
className={clsx(
194195
'w-full h-full pt-4 relative px-2',
195196
'ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2',
196197
)}
197198
>
198199
<Table data={previewTable} />
199-
</Tab.Panel>
200+
</TabPanel>
200201
)}
201202
{isNotNil(previewQuery) && tab.file.isRemote && (
202-
<Tab.Panel
203+
<TabPanel
203204
unmount={false}
204205
className="w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 p-2"
205206
>
@@ -211,10 +212,11 @@ export default function EditorPreview({
211212
className="text-xs"
212213
/>
213214
</div>
214-
</Tab.Panel>
215+
</TabPanel>
215216
)}
216217
{showLineage && (
217-
<Tab.Panel
218+
<TabPanel
219+
as="div"
218220
unmount={false}
219221
className={clsx(
220222
'w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2',
@@ -227,10 +229,11 @@ export default function EditorPreview({
227229
>
228230
<ModelLineage model={model} />
229231
</Suspense>
230-
</Tab.Panel>
232+
</TabPanel>
231233
)}
232234
{isNotNil(previewDiff?.row_diff) && (
233-
<Tab.Panel
235+
<TabPanel
236+
as="div"
234237
unmount={false}
235238
className={clsx(
236239
'w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 py-2',
@@ -240,10 +243,10 @@ export default function EditorPreview({
240243
key={tab.id}
241244
diff={previewDiff}
242245
/>
243-
</Tab.Panel>
246+
</TabPanel>
244247
)}
245248
{showErrors && (
246-
<Tab.Panel
249+
<TabPanel
247250
unmount={false}
248251
className="w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 py-2"
249252
>
@@ -262,10 +265,10 @@ export default function EditorPreview({
262265
</li>
263266
))}
264267
</ul>
265-
</Tab.Panel>
268+
</TabPanel>
266269
)}
267-
</Tab.Panels>
268-
</Tab.Group>
270+
</TabPanels>
271+
</TabGroup>
269272
)}
270273
</div>
271274
)

web/client/src/library/components/graph/ModelLineage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ function GraphControls({ nodes = [] }: { nodes: Node[] }): JSX.Element {
442442
<div className="px-2 flex items-center text-xs text-neutral-400 @container">
443443
<div className="contents">
444444
<Popover
445+
as="div"
445446
className="flex @lg:hidden bg-none border-none"
446447
aria-label="Show lineage node details"
447448
>

web/client/src/library/components/plan/PlanActions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export default function PlanActions({
163163
leaveFrom="opacity-100 scale-100"
164164
leaveTo="opacity-0 scale-95"
165165
className="trasition-all duration-300 ease-in-out"
166+
as="div"
166167
>
167168
{showPlanActionButton && (
168169
<Button

web/client/src/library/components/plan/PlanApplyStageTracker.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export default function PlanApplyStageTracker(): JSX.Element {
7373
leaveFrom="opacity-100 scale-100"
7474
leaveTo="opacity-0 scale-95"
7575
className={clsx('my-2 rounded-xl', isFailed && 'bg-danger-5')}
76+
as="div"
7677
>
7778
{showFailedMessage ? (
7879
<Banner
@@ -728,6 +729,7 @@ function Stage({
728729
leaveFrom="opacity-100 scale-100"
729730
leaveTo="opacity-0 scale-95"
730731
className="my-2"
732+
as="div"
731733
>
732734
<Disclosure>
733735
<Banner
@@ -802,6 +804,7 @@ function Stage({
802804
leaveFrom="opacity-100 scale-100"
803805
leaveTo="opacity-0 scale-95"
804806
className="trasition-all duration-300 ease-in-out"
807+
as="div"
805808
>
806809
<Disclosure.Panel
807810
static

web/client/src/library/components/tasksOverview/TasksOverview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ function TasksDetails({
169169
leaveFrom="opacity-100 scale-100"
170170
leaveTo="opacity-0 scale-95"
171171
className="trasition-all duration-300 ease-in-out"
172+
as="div"
172173
>
173174
<div className="px-4 pt-3 pb-2 mt-4 shadow-lg rounded-lg">
174175
<Title text="Currently in proccess" />

0 commit comments

Comments
 (0)