@a4ui/core 0.38.0 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/ui/AlertDialog.tsx +6 -3
- package/src/ui/Command.tsx +6 -3
- package/src/ui/Drawer.tsx +6 -3
- package/src/ui/Image.tsx +6 -3
- package/src/ui/Modal.tsx +6 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const A4UI_VERSION = "0.38.
|
|
1
|
+
export declare const A4UI_VERSION = "0.38.1";
|
|
2
2
|
export { cn } from './lib/cn';
|
|
3
3
|
export { useTheme, toggleTheme, setTheme, storedTheme, applyTheme, toggled, type Theme } from './lib/theme';
|
|
4
4
|
export { useEffects, isCalm, setEffects } from './lib/effects';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Dynamic as me, Portal as he, addEventListener as ge, classList as _e, c
|
|
|
5
5
|
import { Accordion as ve } from "@kobalte/core/accordion";
|
|
6
6
|
import { Activity as ye, ArrowDown as be, ArrowDownLeft as xe, ArrowLeft as Se, ArrowRight as Ce, ArrowUp as we, ArrowUpRight as Te, Banknote as Ee, Bell as De, Bookmark as Oe, Brain as ke, CalendarDays as Ae, Check as Y, ChevronDown as je, ChevronLeft as Me, ChevronRight as X, ChevronUp as Ne, ChevronsLeft as Pe, ChevronsLeftRight as Fe, ChevronsRight as Ie, ChevronsUpDown as Le, Circle as Re, CircleCheck as ze, CircleX as Be, Clock as Ve, Compass as He, Copy as Ue, CreditCard as We, Crosshair as Ge, Dumbbell as Ke, Eraser as qe, File as Je, GripVertical as Ye, Hash as Xe, Heart as Ze, Inbox as Qe, Info as $e, Leaf as et, Lightbulb as tt, Loader2 as nt, Lock as rt, Mail as it, MapPin as at, Maximize as ot, Menu as st, Minus as ct, Moon as lt, PanelLeft as ut, Paperclip as dt, Pause as ft, Phone as pt, PictureInPicture2 as mt, Plane as ht, Play as gt, Plus as _t, Satellite as vt, Search as yt, SendHorizontal as bt, ServerCrash as xt, Smile as St, Sparkles as Ct, Star as wt, Sun as Tt, Trash2 as Et, TrendingDown as Dt, TrendingUp as Ot, TriangleAlert as kt, Undo2 as At, Unlock as jt, UploadCloud as Mt, Users as Nt, Utensils as Pt, Volume2 as Ft, VolumeX as It, X as Z, ZoomIn as Lt } from "lucide-solid";
|
|
7
7
|
import { Progress as Rt } from "@kobalte/core/progress";
|
|
8
|
-
import
|
|
8
|
+
import * as Q from "@kobalte/core/dialog";
|
|
9
9
|
import { DropdownMenu as zt } from "@kobalte/core/dropdown-menu";
|
|
10
10
|
import { createVirtualizer as Bt } from "@tanstack/solid-virtual";
|
|
11
11
|
import { Tabs as Vt } from "@kobalte/core/tabs";
|
|
@@ -26,7 +26,7 @@ import { SegmentedControl as nn } from "@kobalte/core/segmented-control";
|
|
|
26
26
|
import { Breadcrumbs as rn } from "@kobalte/core/breadcrumbs";
|
|
27
27
|
import { Menubar as $ } from "@kobalte/core/menubar";
|
|
28
28
|
import { NavigationMenu as an } from "@kobalte/core/navigation-menu";
|
|
29
|
-
import
|
|
29
|
+
import * as on from "@kobalte/core/alert-dialog";
|
|
30
30
|
import { ContextMenu as sn } from "@kobalte/core/context-menu";
|
|
31
31
|
import { Combobox as cn } from "@kobalte/core/combobox";
|
|
32
32
|
// src/lib/theme.ts
|
|
@@ -1653,7 +1653,7 @@ var la = /*#__PURE__*/ q("<p class=\"text-[12px] text-muted-foreground\">"), ua
|
|
|
1653
1653
|
};
|
|
1654
1654
|
function pa(e) {
|
|
1655
1655
|
let t = () => fa[e.side ?? "right"];
|
|
1656
|
-
return L(Q, {
|
|
1656
|
+
return L(Q.Root, {
|
|
1657
1657
|
get open() {
|
|
1658
1658
|
return e.open;
|
|
1659
1659
|
},
|
|
@@ -2094,7 +2094,7 @@ function qa(e) {
|
|
|
2094
2094
|
}
|
|
2095
2095
|
function Ja(e) {
|
|
2096
2096
|
let t = () => e.variant === "center";
|
|
2097
|
-
return L(Q, {
|
|
2097
|
+
return L(Q.Root, {
|
|
2098
2098
|
get open() {
|
|
2099
2099
|
return e.open;
|
|
2100
2100
|
},
|
|
@@ -3440,7 +3440,7 @@ R(["keydown"]);
|
|
|
3440
3440
|
// src/ui/AlertDialog.tsx
|
|
3441
3441
|
var Ks = /*#__PURE__*/ q("<div class=p-6>"), qs = /*#__PURE__*/ q("<div class=\"fixed inset-0 z-50 flex items-center justify-center p-4\">");
|
|
3442
3442
|
function Js(e) {
|
|
3443
|
-
return L(on, {
|
|
3443
|
+
return L(on.Root, {
|
|
3444
3444
|
get open() {
|
|
3445
3445
|
return e.open;
|
|
3446
3446
|
},
|
|
@@ -5429,7 +5429,7 @@ function ld(e) {
|
|
|
5429
5429
|
n && s(n);
|
|
5430
5430
|
}
|
|
5431
5431
|
};
|
|
5432
|
-
return L(Q, {
|
|
5432
|
+
return L(Q.Root, {
|
|
5433
5433
|
get open() {
|
|
5434
5434
|
return e.open;
|
|
5435
5435
|
},
|
|
@@ -6099,7 +6099,7 @@ function Mf(t) {
|
|
|
6099
6099
|
return [(() => {
|
|
6100
6100
|
var e = kf();
|
|
6101
6101
|
return e.$$click = () => r(!0), B(e, u), z(() => U(e, "aria-label", t.alt)), e;
|
|
6102
|
-
})(), L(Q, {
|
|
6102
|
+
})(), L(Q.Root, {
|
|
6103
6103
|
get open() {
|
|
6104
6104
|
return n();
|
|
6105
6105
|
},
|
|
@@ -17541,5 +17541,5 @@ function VD() {
|
|
|
17541
17541
|
BD(e && ND(e) || CD);
|
|
17542
17542
|
}
|
|
17543
17543
|
// src/index.ts
|
|
17544
|
-
var HD = "0.38.
|
|
17544
|
+
var HD = "0.38.1";
|
|
17545
17545
|
export { HD as A4UI_VERSION, jn as Accordion, xD as ActionBar, MS as ActivityFeed, Cf as Affix, Uo as Alert, Js as AlertDialog, Cd as Anchor, Zg as AnimatedBeam, Xo as AnnouncementBar, zT as AppShell, yh as ArtifactPanel, Vn as AspectRatio, Km as Attachment, Qm as AttachmentAction, Zm as AttachmentActions, Jm as AttachmentContent, Xm as AttachmentDescription, $m as AttachmentGroup, qm as AttachmentMedia, Ym as AttachmentTitle, Ky as AudioWaveform, WE as Aurora, lx as AvailabilityPicker, Zo as Avatar, Du as AvatarGroup, gd as BackToTop, b as Badge, wC as BalanceCard, Ql as BeforeAfter, Vg as BentoCard, Bg as BentoGrid, rw as BlockEditor, r_ as BorderBeam, zf as BottomNavigation, ds as Breadcrumb, D as Button, Ln as ButtonGroup, zn as ButtonGroupSeparator, Rn as ButtonGroupText, vu as Calendar, rm as CalendarHeatmap, X_ as Callout, g as Card, E as CardContent, te as CardHeader, gg as CardSpread, _ as CardTitle, ec as Carousel, Eg as Carousel3D, mp as Cascader, qS as CategoryStrip, Bm as ChatMarker, Cm as ChatThread, S as Checkbox, aD as ChristmasBackground, lh as Citation, ym as Clock, Cb as CodeEditor, VS as CodeTabs, ne as Collapse, zp as ColorPicker, Xs as Combobox, ld as Command, Gp as Comment, Ov as Confetti, fu as Configurator, Ol as ContactSection, Ys as ContextMenu, NS as CopyButton, yf as Countdown, xy as CouponField, ml as CtaBanner, jv as CursorTrail, Fw as Curtain, Xf as DataGrid, hC as DataView, yr as DateField, Gr as DateRangePicker, Lr as DateTimeField, ju as Descriptions, P_ as DiffViewer, qg as Dock, pa as Drawer, ma as Dropdown, _a as Dropzone, En as EASE, lD as EffectsToggle, Lb as EmojiPicker, gu as Empty, $b as EventScheduler, dT as Expandable, fl as Faq, $c as FeatureGrid, Ci as Field, wi as FieldContent, Di as FieldDescription, ki as FieldError, Si as FieldGroup, Ti as FieldLabel, xi as FieldLegend, Oi as FieldSeparator, bi as FieldSet, Ei as FieldTitle, ea as FileUpload, Vw as FillText, bd as FloatingActionButton, Ch as FloatingToolbar, cg as FocusBlurGroup, Zy as FollowingPointer, ei as FormControl, ti as FormDescription, ni as FormError, Qr as FormField, $r as FormLabel, ty as GanttChart, uv as Globe, CT as GradientText, Kc as Hero, Dd as Highlight, hw as HoldToConfirm, zo as HoverCard, Gh as IconMorphButton, Mf as Image, Mh as InlineSelect, ba as Input, Fi as InputGroup, Li as InputGroupAddon, Bi as InputGroupButton, Hi as InputGroupInput, Ri as InputGroupText, Ui as InputGroupTextarea, Tx as InteractiveMap, Gd as Item, $d as ItemActions, Xd as ItemContent, Qd as ItemDescription, tf as ItemFooter, Kd as ItemGroup, ef as ItemHeader, Yd as ItemMedia, qd as ItemSeparator, Zd as ItemTitle, nS as JsonViewer, Rv as Kanban, ms as Kbd, zC as KpiBlock, Wn as Label, Jy as Lamp, Ay as Lightbox, eg as LikeButton, Nd as List, yw as LoadingDots, kx as LocationPicker, IS as LockButton, Gf as LogoWall, yT as Magnetic, tl as Marquee, gb as MaskedInput, ZS as MasterDetail, yp as Mentions, ys as Menubar, Cs as MenubarCheckboxItem, Ss as MenubarItem, Os as MenubarLabel, bs as MenubarMenu, ws as MenubarRadioGroup, Ts as MenubarRadioItem, Ds as MenubarSeparator, Es as MenubarSub, Pm as Message, Fm as MessageGroup, u_ as Meteors, ns as Meter, Rh as MicroButton, Ja as Modal, z_ as ModelPicker, UC as MoneyActionButton, ca as MultiSelect, Zw as MultiStateBadge, FS as MuteButton, qn as NativeSelect, dD as NavGroup, zs as NavigationMenu, Us as NavigationMenuContent, Vs as NavigationMenuItem, Ws as NavigationMenuLink, Gs as NavigationMenuPanelLink, Hs as NavigationMenuTrigger, Pp as NotificationCenter, qw as NotificationStack, oT as NowPlaying, ee as NumberInput, gy as OnboardingChecklist, lb as OtpInput, to as PageHeader, Oh as PageTransition, ro as Pagination, Lw as Parallax, WS as PillSearch, dy as PivotTable, PS as PlayPauseButton, Ro as Popover, im as Portal, yS as PresenceAvatars, Tc as PricingTable, Gi as Progress, _h as PromptComposer, Xn as Prose, Bx as QueryBuilder, Ra as Questionnaire, Io as RadioGroup, T as Rating, Ku as RatingsSummary, p_ as ReasoningTrace, Qu as Result, md as RingProgress, w as Ripple, Dn as SPRING, cw as ScrambleText, af as ScrollArea, xT as ScrollProgress, _C as ScrollScene, hD as Section, ss as SegmentedControl, oo as Select, es as Separator, ob as SheetSnap, QC as SideRail, hE as Sidebar, xE as SidebarContent, bE as SidebarFooter, CE as SidebarGroup, TE as SidebarGroupAction, EE as SidebarGroupContent, wE as SidebarGroupLabel, yE as SidebarHeader, vE as SidebarInset, DE as SidebarMenu, NE as SidebarMenuAction, PE as SidebarMenuBadge, ME as SidebarMenuButton, OE as SidebarMenuItem, RE as SidebarMenuSkeleton, FE as SidebarMenuSub, LE as SidebarMenuSubButton, IE as SidebarMenuSubItem, mE as SidebarProvider, _E as SidebarRail, gE as SidebarTrigger, Eb as SignaturePad, Vl as SiteFooter, Mc as SiteNav, $o as Skeleton, rC as SlashMenu, og as SlideArrowButton, is as Slider, ev as Snippet, QE as SnowScenery, lm as Sortable, uh as SourceList, PT as SpaceBackground, qC as Spaces, Iu as SpecSheet, If as SpeedDial, co as Spinner, ed as Splitter, v as Spotlight, fS as SpreadsheetGrid, po as Stat, cc as Stepper, xC as StickyReveal, nh as StreamingText, K_ as SuggestionChips, Fo as Switch, SD as TOKEN_ORDER, bo as Table, So as TableBody, To as TableCell, xo as TableHead, wo as TableHeadCell, Co as TableRow, ko as Tabs, fd as TagInput, ql as TeamGrid, ul as Testimonials, pw as TextReveal, Ca as Textarea, LS as ThemeMorphButton, sD as ThemeToggle, JE as ThemedScenery, C as TiltCard, Mr as TimeField, Ig as TimeMachineStack, hc as Timeline, Po as Toaster, as as Toggle, os as ToggleGroup, x_ as ToolCallTimeline, Lo as Tooltip, wp as Tour, PC as TransactionFeed, Df as Transfer, wu as Tree, op as TreeSelect, oy as TreeTable, _T as Typewriter, H_ as UsageMeter, Ry as VideoPlayerShell, Oo as VirtualList, wv as WorldMap, LD as activeTheme, m as animate, l as animateIn, pn as applyTheme, zD as applyThemeDefinition, y as attachSpotlight, re as attachTilt, kD as christmas, i as cn, f as createCountUp, On as createLinkedSelection, Cn as createOptimistic, wD as dino, TD as doctor, Dv as fireConfetti, wT as flyToCart, o as inView, VD as initTheme, d as isCalm, e as motionReduced, u as prefersReducedMotion, Sn as remeasureAfterLayout, p as revealOnScroll, ED as scientist, t as scroll, BD as selectTheme, c as setEffects, s as setMotionForced, mn as setTheme, OD as snow, DD as soccer, CD as space, x as spawnRipple, h as spring, n as stagger, Tn as startViewTransition, fn as storedTheme, FD as themeToCss, ID as themeToJson, AD as themes, No as toast, bn as toggleTheme, hn as toggled, a as useEffects, xn as useMediaQuery, r as useMotionForced, dE as useSidebar, yn as useTheme };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// import '@a4ui/core/styles.css'
|
|
9
9
|
// import { Button, Card, Modal } from '@a4ui/core'
|
|
10
10
|
|
|
11
|
-
export const A4UI_VERSION = '0.38.
|
|
11
|
+
export const A4UI_VERSION = '0.38.1'
|
|
12
12
|
|
|
13
13
|
// Helpers (src/lib) — generic, framework-level utilities.
|
|
14
14
|
export { cn } from './lib/cn'
|
package/src/ui/AlertDialog.tsx
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// Confirmation dialog on Kobalte's AlertDialog primitive — centered modal,
|
|
2
2
|
// reuses the modal-overlay/modal-content keyframes from styles.css.
|
|
3
|
-
import
|
|
3
|
+
// Namespace import on purpose: Kobalte's `AlertDialog` is built with Object.assign on the
|
|
4
|
+
// same `DialogRoot` function as `Dialog`, so `AlertDialog.Content` depends on module load order (#118).
|
|
5
|
+
// The named exports (`Root`, `Content`, ...) are not affected.
|
|
6
|
+
import * as KAlertDialog from '@kobalte/core/alert-dialog'
|
|
4
7
|
import type { JSX, ParentProps } from 'solid-js'
|
|
5
8
|
import { Show } from 'solid-js'
|
|
6
9
|
|
|
@@ -30,7 +33,7 @@ interface AlertDialogProps extends ParentProps {
|
|
|
30
33
|
*/
|
|
31
34
|
export function AlertDialog(props: AlertDialogProps): JSX.Element {
|
|
32
35
|
return (
|
|
33
|
-
<KAlertDialog open={props.open} onOpenChange={props.onOpenChange}>
|
|
36
|
+
<KAlertDialog.Root open={props.open} onOpenChange={props.onOpenChange}>
|
|
34
37
|
<KAlertDialog.Portal>
|
|
35
38
|
<KAlertDialog.Overlay class="modal-overlay fixed inset-0 z-40 bg-background/80 backdrop-blur-sm" />
|
|
36
39
|
<div class="fixed inset-0 z-50 flex items-center justify-center p-4">
|
|
@@ -53,6 +56,6 @@ export function AlertDialog(props: AlertDialogProps): JSX.Element {
|
|
|
53
56
|
</KAlertDialog.Content>
|
|
54
57
|
</div>
|
|
55
58
|
</KAlertDialog.Portal>
|
|
56
|
-
</KAlertDialog>
|
|
59
|
+
</KAlertDialog.Root>
|
|
57
60
|
)
|
|
58
61
|
}
|
package/src/ui/Command.tsx
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
// handles fuzzy filtering (label + hint + group), keyboard navigation
|
|
4
4
|
// (↑/↓/Enter), optional grouping, and query reset on close. Theme-agnostic:
|
|
5
5
|
// every color comes from a semantic token, never a literal.
|
|
6
|
-
import
|
|
6
|
+
// Namespace import on purpose: Kobalte's `AlertDialog` is built with Object.assign on the
|
|
7
|
+
// same `DialogRoot` function as `Dialog`, so `Dialog.Content` depends on module load order (#118).
|
|
8
|
+
// The named exports (`Root`, `Content`, ...) are not affected.
|
|
9
|
+
import * as Dialog from '@kobalte/core/dialog'
|
|
7
10
|
import { createEffect, createMemo, createSignal, For, Show, type JSX } from 'solid-js'
|
|
8
11
|
|
|
9
12
|
import { cn } from '../lib/cn'
|
|
@@ -93,7 +96,7 @@ export function Command(props: CommandProps): JSX.Element {
|
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
return (
|
|
96
|
-
<Dialog open={props.open} onOpenChange={props.onOpenChange}>
|
|
99
|
+
<Dialog.Root open={props.open} onOpenChange={props.onOpenChange}>
|
|
97
100
|
<Dialog.Portal>
|
|
98
101
|
<Dialog.Overlay class="modal-overlay fixed inset-0 z-40 bg-background/80 backdrop-blur-sm" />
|
|
99
102
|
<div class="fixed inset-x-0 top-[14vh] z-50 mx-auto w-full max-w-lg px-4">
|
|
@@ -153,6 +156,6 @@ export function Command(props: CommandProps): JSX.Element {
|
|
|
153
156
|
</Dialog.Content>
|
|
154
157
|
</div>
|
|
155
158
|
</Dialog.Portal>
|
|
156
|
-
</Dialog>
|
|
159
|
+
</Dialog.Root>
|
|
157
160
|
)
|
|
158
161
|
}
|
package/src/ui/Drawer.tsx
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
// slide-in/out keyframes in styles.css off Kobalte's data-expanded/data-closed.
|
|
4
4
|
// Pass a `title` for the sticky glass header, or omit it and render your own
|
|
5
5
|
// inside `children`.
|
|
6
|
-
import
|
|
6
|
+
// Namespace import on purpose: Kobalte's `AlertDialog` is built with Object.assign on the
|
|
7
|
+
// same `DialogRoot` function as `Dialog`, so `Dialog.Content` depends on module load order (#118).
|
|
8
|
+
// The named exports (`Root`, `Content`, ...) are not affected.
|
|
9
|
+
import * as Dialog from '@kobalte/core/dialog'
|
|
7
10
|
import { X } from 'lucide-solid'
|
|
8
11
|
import type { JSX, ParentProps } from 'solid-js'
|
|
9
12
|
import { Show } from 'solid-js'
|
|
@@ -67,7 +70,7 @@ export type { DrawerProps }
|
|
|
67
70
|
export function Drawer(props: DrawerProps): JSX.Element {
|
|
68
71
|
const side = (): (typeof SIDE)[DrawerSide] => SIDE[props.side ?? 'right']
|
|
69
72
|
return (
|
|
70
|
-
<Dialog open={props.open} onOpenChange={props.onOpenChange}>
|
|
73
|
+
<Dialog.Root open={props.open} onOpenChange={props.onOpenChange}>
|
|
71
74
|
<Dialog.Portal>
|
|
72
75
|
<Dialog.Overlay class="modal-overlay fixed inset-0 z-40 bg-black/50 backdrop-blur-[2px]" />
|
|
73
76
|
<div class={cn('fixed inset-0 z-50 flex', side().wrap)}>
|
|
@@ -100,6 +103,6 @@ export function Drawer(props: DrawerProps): JSX.Element {
|
|
|
100
103
|
</Dialog.Content>
|
|
101
104
|
</div>
|
|
102
105
|
</Dialog.Portal>
|
|
103
|
-
</Dialog>
|
|
106
|
+
</Dialog.Root>
|
|
104
107
|
)
|
|
105
108
|
}
|
package/src/ui/Image.tsx
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// Dialog primitive. The thumbnail lazy-loads; when `preview` is on it becomes a
|
|
3
3
|
// button that opens a dimmed, backdrop-blurred overlay with an enlarged copy of
|
|
4
4
|
// the image and a corner close button (focus trap/portal handled by Kobalte).
|
|
5
|
-
import
|
|
5
|
+
// Namespace import on purpose: Kobalte's `AlertDialog` is built with Object.assign on the
|
|
6
|
+
// same `DialogRoot` function as `Dialog`, so `Dialog.Content` depends on module load order (#118).
|
|
7
|
+
// The named exports (`Root`, `Content`, ...) are not affected.
|
|
8
|
+
import * as Dialog from '@kobalte/core/dialog'
|
|
6
9
|
import { X } from 'lucide-solid'
|
|
7
10
|
import type { JSX } from 'solid-js'
|
|
8
11
|
import { createSignal, Show } from 'solid-js'
|
|
@@ -69,7 +72,7 @@ export function Image(props: ImageProps): JSX.Element {
|
|
|
69
72
|
<button type="button" class="cursor-zoom-in" aria-label={props.alt} onClick={() => setOpen(true)}>
|
|
70
73
|
{img}
|
|
71
74
|
</button>
|
|
72
|
-
<Dialog open={open()} onOpenChange={setOpen}>
|
|
75
|
+
<Dialog.Root open={open()} onOpenChange={setOpen}>
|
|
73
76
|
<Dialog.Portal>
|
|
74
77
|
<Dialog.Overlay class="fixed inset-0 z-40 bg-background/80 backdrop-blur-sm" />
|
|
75
78
|
<div class="fixed inset-0 z-50 flex items-center justify-center p-4">
|
|
@@ -88,7 +91,7 @@ export function Image(props: ImageProps): JSX.Element {
|
|
|
88
91
|
</Dialog.Content>
|
|
89
92
|
</div>
|
|
90
93
|
</Dialog.Portal>
|
|
91
|
-
</Dialog>
|
|
94
|
+
</Dialog.Root>
|
|
92
95
|
</Show>
|
|
93
96
|
)
|
|
94
97
|
}
|
package/src/ui/Modal.tsx
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
// yes/no) where a full-height drawer would be overkill.
|
|
6
6
|
// The .drawer-content / .modal-content classes drive the slide/scale keyframes
|
|
7
7
|
// (styles.css) off Kobalte's data-expanded/data-closed presence tracking.
|
|
8
|
-
import
|
|
8
|
+
// Namespace import on purpose: Kobalte's `AlertDialog` is built with Object.assign on the
|
|
9
|
+
// same `DialogRoot` function as `Dialog`, so `Dialog.Content` depends on module load order (#118).
|
|
10
|
+
// The named exports (`Root`, `Content`, ...) are not affected.
|
|
11
|
+
import * as Dialog from '@kobalte/core/dialog'
|
|
9
12
|
import { X } from 'lucide-solid'
|
|
10
13
|
import type { JSX, ParentProps } from 'solid-js'
|
|
11
14
|
import { Show } from 'solid-js'
|
|
@@ -75,7 +78,7 @@ function keepForFloating(e: Event): void {
|
|
|
75
78
|
export function Modal(props: ModalProps): JSX.Element {
|
|
76
79
|
const isCenter = () => props.variant === 'center'
|
|
77
80
|
return (
|
|
78
|
-
<Dialog open={props.open} onOpenChange={props.onOpenChange}>
|
|
81
|
+
<Dialog.Root open={props.open} onOpenChange={props.onOpenChange}>
|
|
79
82
|
<Dialog.Portal>
|
|
80
83
|
<Dialog.Overlay class="modal-overlay fixed inset-0 z-40 bg-background/80 backdrop-blur-sm" />
|
|
81
84
|
<Show
|
|
@@ -137,6 +140,6 @@ export function Modal(props: ModalProps): JSX.Element {
|
|
|
137
140
|
</div>
|
|
138
141
|
</Show>
|
|
139
142
|
</Dialog.Portal>
|
|
140
|
-
</Dialog>
|
|
143
|
+
</Dialog.Root>
|
|
141
144
|
)
|
|
142
145
|
}
|