@adea-ai/ui 0.108.0 → 0.109.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.
Files changed (74) hide show
  1. package/dist/NOTICE +13 -0
  2. package/dist/components/composites/update-dialog/update-dialog.js +1 -1
  3. package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -1
  4. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +45 -35
  5. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  6. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.d.ts +12 -0
  7. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.d.ts.map +1 -0
  8. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +36 -0
  9. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -0
  10. package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
  11. package/dist/components/ui/alert-dialog/alert-dialog.js +2 -6
  12. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  13. package/dist/components/ui/annotation-surface/annotation-surface.css +27 -0
  14. package/dist/components/ui/annotation-surface/annotation-surface.d.ts +66 -0
  15. package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -0
  16. package/dist/components/ui/annotation-surface/annotation-surface.js +244 -0
  17. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -0
  18. package/dist/components/ui/annotation-surface/geometry.d.ts +10 -0
  19. package/dist/components/ui/annotation-surface/geometry.d.ts.map +1 -0
  20. package/dist/components/ui/annotation-surface/geometry.js +19 -0
  21. package/dist/components/ui/annotation-surface/geometry.js.map +1 -0
  22. package/dist/components/ui/annotation-surface/index.d.ts +4 -0
  23. package/dist/components/ui/annotation-surface/index.d.ts.map +1 -0
  24. package/dist/components/ui/annotation-surface/index.js +2 -0
  25. package/dist/components/ui/board/board.js +1 -1
  26. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  27. package/dist/components/ui/dialog/dialog.js +2 -6
  28. package/dist/components/ui/dialog/dialog.js.map +1 -1
  29. package/dist/components/ui/item/item.d.ts +1 -1
  30. package/dist/components/ui/sheet/sheet.d.ts +1 -1
  31. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  32. package/dist/components/ui/sheet/sheet.js +2 -5
  33. package/dist/components/ui/sheet/sheet.js.map +1 -1
  34. package/dist/components/ui/typography/typography.d.ts.map +1 -1
  35. package/dist/components/ui/typography/typography.js +2 -2
  36. package/dist/components/ui/typography/typography.js.map +1 -1
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +3 -2
  40. package/dist/lib/overlay.d.ts +5 -0
  41. package/dist/lib/overlay.d.ts.map +1 -1
  42. package/dist/lib/overlay.js +6 -1
  43. package/dist/lib/overlay.js.map +1 -1
  44. package/dist/r/alert-dialog.json +0 -1
  45. package/dist/r/annotation-surface.json +32 -0
  46. package/dist/r/contextual-sidebar.json +5 -0
  47. package/dist/r/dialog.json +0 -1
  48. package/dist/r/registry.json +37 -3
  49. package/dist/r/sheet.json +0 -1
  50. package/dist/r/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +41 -16
  51. package/dist/r/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +28 -0
  52. package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +8 -8
  53. package/dist/r/src/components/ui/annotation-surface/annotation-surface.css +27 -0
  54. package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +316 -0
  55. package/dist/r/src/components/ui/annotation-surface/geometry.ts +31 -0
  56. package/dist/r/src/components/ui/annotation-surface/index.ts +13 -0
  57. package/dist/r/src/components/ui/dialog/dialog.tsx +8 -8
  58. package/dist/r/src/components/ui/sheet/sheet.tsx +2 -7
  59. package/dist/r/src/components/ui/typography/typography.tsx +3 -2
  60. package/dist/r/src/lib/overlay.ts +6 -0
  61. package/package.json +3 -2
  62. package/registry.json +37 -3
  63. package/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +41 -16
  64. package/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +28 -0
  65. package/src/components/ui/alert-dialog/alert-dialog.tsx +8 -8
  66. package/src/components/ui/annotation-surface/annotation-surface.css +27 -0
  67. package/src/components/ui/annotation-surface/annotation-surface.tsx +316 -0
  68. package/src/components/ui/annotation-surface/geometry.ts +31 -0
  69. package/src/components/ui/annotation-surface/index.ts +13 -0
  70. package/src/components/ui/dialog/dialog.tsx +8 -8
  71. package/src/components/ui/sheet/sheet.tsx +2 -7
  72. package/src/components/ui/typography/typography.tsx +3 -2
  73. package/src/index.ts +1 -0
  74. package/src/lib/overlay.ts +6 -0
@@ -0,0 +1,244 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { clampSurfaceFraction, normalizedSurfacePoint } from "./geometry.js";
3
+ import { className, createComponent, delegateEvents, effect, insert, memo, setAttribute, template, use } from "solid-js/web";
4
+ import { Show, createEffect, createSignal, createUniqueId, onCleanup, splitProps } from "solid-js";
5
+ import "./annotation-surface.css";
6
+ //#region src/components/ui/annotation-surface/annotation-surface.tsx
7
+ var _tmpl$ = /*#__PURE__*/ template(`<span class="dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground">`);
8
+ var _tmpl$2 = /*#__PURE__*/ template(`<div role=application aria-roledescription="annotation surface"tabindex=0>`);
9
+ var _tmpl$3 = /*#__PURE__*/ template(`<svg class="dev-annotation-surface__region pointer-events-none absolute inset-0 size-full"viewBox="0 0 10000 10000"preserveAspectRatio=none aria-hidden=true><rect class="fill-primary-subtle stroke-primary"stroke-width=1.5 vector-effect=non-scaling-stroke>`);
10
+ function pointFrom(event, target) {
11
+ const bounds = target.getBoundingClientRect();
12
+ return normalizedSurfacePoint(event.clientX, event.clientY, bounds);
13
+ }
14
+ /**
15
+ * AnnotationSurface.
16
+ *
17
+ * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an
18
+ * annotation domain. It renders normalized region geometry and idle guidance,
19
+ * captures region drags, and reports normalized points without reading or
20
+ * rendering screenshot pixels. The host keeps tool policy, domain geometry,
21
+ * persistence and capture commands.
22
+ *
23
+ * This bespoke application widget is necessary because a generic button or
24
+ * slider cannot represent a two-dimensional drawing viewport. Its keyboard
25
+ * behavior is supplied by the host and forwarded as a native key event. Space
26
+ * creates a centered region or places a point at the center; Escape is left to
27
+ * the host first, which can prevent the default gesture cancellation while it
28
+ * applies its own draft and mode rules.
29
+ */
30
+ function AnnotationSurface(props) {
31
+ const [local] = splitProps(props, [
32
+ "id",
33
+ "aria-describedby",
34
+ "label",
35
+ "tool",
36
+ "region",
37
+ "hint",
38
+ "interactive",
39
+ "resetKey",
40
+ "onPoint",
41
+ "onDragChange",
42
+ "onKeyDown",
43
+ "ref",
44
+ "class"
45
+ ]);
46
+ const [dragging, setDragging] = createSignal(false);
47
+ const hintId = createUniqueId();
48
+ let activeDrag;
49
+ let previousResetKey = local.resetKey;
50
+ let previousTool = local.tool;
51
+ const isInteractive = () => local.interactive ?? true;
52
+ function releaseCapture(drag) {
53
+ try {
54
+ if (drag.target.hasPointerCapture(drag.pointerId)) drag.target.releasePointerCapture(drag.pointerId);
55
+ } catch {}
56
+ }
57
+ function cancelDrag(event, release = true) {
58
+ const drag = activeDrag;
59
+ if (!drag) return;
60
+ activeDrag = void 0;
61
+ setDragging(false);
62
+ if (release) releaseCapture(drag);
63
+ local.onDragChange?.(void 0, "cancel", event);
64
+ }
65
+ createEffect(() => {
66
+ const resetKey = local.resetKey;
67
+ const tool = local.tool;
68
+ const interactive = isInteractive();
69
+ if (activeDrag && (resetKey !== previousResetKey || tool !== previousTool || !interactive)) cancelDrag();
70
+ previousResetKey = resetKey;
71
+ previousTool = tool;
72
+ });
73
+ onCleanup(() => cancelDrag());
74
+ function handlePointerDown(event) {
75
+ if (!isInteractive() || !event.isPrimary || event.button !== 0) return;
76
+ event.preventDefault();
77
+ event.currentTarget.focus({ preventScroll: true });
78
+ const point = pointFrom(event, event.currentTarget);
79
+ if (activeDrag) return;
80
+ if (local.tool === "point") {
81
+ local.onPoint?.(point, event);
82
+ return;
83
+ }
84
+ try {
85
+ event.currentTarget.setPointerCapture(event.pointerId);
86
+ } catch {
87
+ return;
88
+ }
89
+ activeDrag = {
90
+ pointerId: event.pointerId,
91
+ target: event.currentTarget,
92
+ start: point,
93
+ current: point
94
+ };
95
+ setDragging(true);
96
+ local.onDragChange?.({
97
+ start: point,
98
+ current: point
99
+ }, "start", event);
100
+ }
101
+ function handlePointerMove(event) {
102
+ const drag = activeDrag;
103
+ if (!drag || drag.pointerId !== event.pointerId) return;
104
+ const current = pointFrom(event, event.currentTarget);
105
+ activeDrag = {
106
+ ...drag,
107
+ current
108
+ };
109
+ local.onDragChange?.({
110
+ start: drag.start,
111
+ current
112
+ }, "move", event);
113
+ }
114
+ function handlePointerUp(event) {
115
+ const drag = activeDrag;
116
+ if (!drag || drag.pointerId !== event.pointerId) return;
117
+ const current = pointFrom(event, event.currentTarget);
118
+ activeDrag = void 0;
119
+ setDragging(false);
120
+ releaseCapture(drag);
121
+ local.onDragChange?.({
122
+ start: drag.start,
123
+ current
124
+ }, "end", event);
125
+ }
126
+ function handlePointerCancel(event) {
127
+ if (activeDrag?.pointerId === event.pointerId) cancelDrag(event);
128
+ }
129
+ function handleLostPointerCapture(event) {
130
+ if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false);
131
+ }
132
+ function handleKeyDown(event) {
133
+ local.onKeyDown?.(event);
134
+ if (event.key === "Escape") {
135
+ if (!event.defaultPrevented) cancelDrag();
136
+ return;
137
+ }
138
+ if (event.defaultPrevented || !isInteractive() || event.key !== " " || event.repeat || event.isComposing || event.altKey || event.ctrlKey || event.metaKey || activeDrag) return;
139
+ event.preventDefault();
140
+ if (local.tool === "point") {
141
+ local.onPoint?.({
142
+ x: .5,
143
+ y: .5
144
+ }, event);
145
+ return;
146
+ }
147
+ local.onDragChange?.({
148
+ start: {
149
+ x: .25,
150
+ y: .25
151
+ },
152
+ current: {
153
+ x: .75,
154
+ y: .75
155
+ }
156
+ }, "keyboard", event);
157
+ }
158
+ const visibleRegion = () => {
159
+ const region = local.region;
160
+ if (!region) return void 0;
161
+ const x = clampSurfaceFraction(region.x);
162
+ const y = clampSurfaceFraction(region.y);
163
+ return {
164
+ x,
165
+ y,
166
+ width: Math.min(clampSurfaceFraction(region.width), 1 - x),
167
+ height: Math.min(clampSurfaceFraction(region.height), 1 - y)
168
+ };
169
+ };
170
+ const describedBy = () => [local["aria-describedby"], local.hint && !visibleRegion() ? hintId : void 0].filter(Boolean).join(" ") || void 0;
171
+ return (() => {
172
+ var _el$ = _tmpl$2();
173
+ _el$.$$keydown = handleKeyDown;
174
+ _el$.addEventListener("lostpointercapture", handleLostPointerCapture);
175
+ _el$.addEventListener("pointercancel", handlePointerCancel);
176
+ _el$.$$pointerup = handlePointerUp;
177
+ _el$.$$pointermove = handlePointerMove;
178
+ _el$.$$pointerdown = handlePointerDown;
179
+ use((element) => local.ref?.(element), _el$);
180
+ insert(_el$, createComponent(Show, {
181
+ get when() {
182
+ return visibleRegion();
183
+ },
184
+ children: (region) => (() => {
185
+ var _el$3 = _tmpl$3(), _el$4 = _el$3.firstChild;
186
+ effect((_p$) => {
187
+ var _v$8 = region().x * 1e4, _v$9 = region().y * 1e4, _v$0 = region().width * 1e4, _v$1 = region().height * 1e4;
188
+ _v$8 !== _p$.e && setAttribute(_el$4, "x", _p$.e = _v$8);
189
+ _v$9 !== _p$.t && setAttribute(_el$4, "y", _p$.t = _v$9);
190
+ _v$0 !== _p$.a && setAttribute(_el$4, "width", _p$.a = _v$0);
191
+ _v$1 !== _p$.o && setAttribute(_el$4, "height", _p$.o = _v$1);
192
+ return _p$;
193
+ }, {
194
+ e: void 0,
195
+ t: void 0,
196
+ a: void 0,
197
+ o: void 0
198
+ });
199
+ return _el$3;
200
+ })()
201
+ }), null);
202
+ insert(_el$, createComponent(Show, {
203
+ get when() {
204
+ return memo(() => !!local.hint)() && !visibleRegion();
205
+ },
206
+ get children() {
207
+ var _el$2 = _tmpl$();
208
+ setAttribute(_el$2, "id", hintId);
209
+ insert(_el$2, () => local.hint);
210
+ return _el$2;
211
+ }
212
+ }), null);
213
+ effect((_p$) => {
214
+ var _v$ = local.id, _v$2 = describedBy(), _v$3 = local.label, _v$4 = isInteractive() ? void 0 : "true", _v$5 = local.tool, _v$6 = dragging() ? "true" : "false", _v$7 = cn("dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", local.class);
215
+ _v$ !== _p$.e && setAttribute(_el$, "id", _p$.e = _v$);
216
+ _v$2 !== _p$.t && setAttribute(_el$, "aria-describedby", _p$.t = _v$2);
217
+ _v$3 !== _p$.a && setAttribute(_el$, "aria-label", _p$.a = _v$3);
218
+ _v$4 !== _p$.o && setAttribute(_el$, "aria-disabled", _p$.o = _v$4);
219
+ _v$5 !== _p$.i && setAttribute(_el$, "data-tool", _p$.i = _v$5);
220
+ _v$6 !== _p$.n && setAttribute(_el$, "data-dragging", _p$.n = _v$6);
221
+ _v$7 !== _p$.s && className(_el$, _p$.s = _v$7);
222
+ return _p$;
223
+ }, {
224
+ e: void 0,
225
+ t: void 0,
226
+ a: void 0,
227
+ o: void 0,
228
+ i: void 0,
229
+ n: void 0,
230
+ s: void 0
231
+ });
232
+ return _el$;
233
+ })();
234
+ }
235
+ delegateEvents([
236
+ "pointerdown",
237
+ "pointermove",
238
+ "pointerup",
239
+ "keydown"
240
+ ]);
241
+ //#endregion
242
+ export { AnnotationSurface };
243
+
244
+ //# sourceMappingURL=annotation-surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation-surface.js","names":["createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","JSX","cn","clampSurfaceFraction","normalizedSurfacePoint","AnnotationSurfacePoint","AnnotationSurfaceRegion","Readonly","x","y","width","height","AnnotationSurfaceDrag","start","current","AnnotationSurfaceTool","AnnotationSurfaceDragPhase","AnnotationSurfacePointerEvent","PointerEvent","currentTarget","HTMLDivElement","AnnotationSurfaceKeyboardEvent","KeyboardEvent","AnnotationSurfaceInputEvent","SurfaceElementProps","Pick","HTMLAttributes","AnnotationSurfaceProps","label","tool","region","hint","Element","interactive","resetKey","onPoint","point","event","onDragChange","drag","phase","onKeyDown","ref","element","class","ActiveDrag","pointerId","target","pointFrom","bounds","getBoundingClientRect","clientX","clientY","AnnotationSurface","props","local","dragging","setDragging","hintId","activeDrag","previousResetKey","previousTool","isInteractive","releaseCapture","hasPointerCapture","releasePointerCapture","cancelDrag","release","undefined","handlePointerDown","isPrimary","button","preventDefault","focus","preventScroll","setPointerCapture","handlePointerMove","handlePointerUp","handlePointerCancel","handleLostPointerCapture","handleKeyDown","key","defaultPrevented","repeat","isComposing","altKey","ctrlKey","metaKey","visibleRegion","Math","min","describedBy","filter","Boolean","join","_el$","_tmpl$2","$$keydown","addEventListener","$$pointerup","$$pointermove","$$pointerdown","_$use","_$insert","_$createComponent","when","children","_el$3","_tmpl$3","_el$4","firstChild","_$effect","_p$","_v$8","_v$9","_v$0","_v$1","e","_$setAttribute","t","a","o","_$memo","_el$2","_tmpl$","_v$","id","_v$2","_v$3","_v$4","_v$5","_v$6","_v$7","i","n","s","_$className","_$delegateEvents","_$createComponent","_$setAttribute","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"sourcesContent":["import {\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport './annotation-surface.css'\nimport {\n clampSurfaceFraction,\n normalizedSurfacePoint,\n type AnnotationSurfacePoint,\n} from './geometry'\n\nexport type AnnotationSurfaceRegion = Readonly<{\n x: number\n y: number\n width: number\n height: number\n}>\n\nexport type AnnotationSurfaceDrag = Readonly<{\n start: AnnotationSurfacePoint\n current: AnnotationSurfacePoint\n}>\n\nexport type AnnotationSurfaceTool = 'region' | 'point'\nexport type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard'\nexport type AnnotationSurfacePointerEvent = PointerEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceKeyboardEvent = KeyboardEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceInputEvent =\n | AnnotationSurfacePointerEvent\n | AnnotationSurfaceKeyboardEvent\n\ntype SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>\n\nexport type AnnotationSurfaceProps = SurfaceElementProps & {\n /** Accessible instructions for the keyboard-operated surface. */\n label: string\n /** Region draws a captured drag; point reports a single placement point. */\n tool: AnnotationSurfaceTool\n /** Normalized 0..1 geometry supplied by the host; absent means no region. */\n region?: AnnotationSurfaceRegion\n /** Visible idle guidance. It is hidden while a region is present. */\n hint?: JSX.Element\n /** Disable new drawing while the host is busy. Defaults to true. */\n interactive?: boolean\n /** Changing this value cancels an in-flight drag owned by the host context. */\n resetKey?: string | number\n /** Receives one normalized point in point mode. */\n onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void\n /** Receives drag phases; cancel has no drag and fires at most once per capture. */\n onDragChange?: (\n drag: AnnotationSurfaceDrag | undefined,\n phase: AnnotationSurfaceDragPhase,\n event?: AnnotationSurfaceInputEvent\n ) => void\n /** Domain keyboard policy stays with the host and receives the native event. */\n onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void\n /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */\n ref?: (element: HTMLDivElement) => void\n /** Layout only; appearance remains owned by the shared component. */\n class?: string\n}\n\ntype ActiveDrag = AnnotationSurfaceDrag & {\n pointerId: number\n target: HTMLDivElement\n}\n\nfunction pointFrom(event: PointerEvent, target: HTMLDivElement): AnnotationSurfacePoint {\n const bounds = target.getBoundingClientRect()\n return normalizedSurfacePoint(event.clientX, event.clientY, bounds)\n}\n\n/**\n * AnnotationSurface.\n *\n * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an\n * annotation domain. It renders normalized region geometry and idle guidance,\n * captures region drags, and reports normalized points without reading or\n * rendering screenshot pixels. The host keeps tool policy, domain geometry,\n * persistence and capture commands.\n *\n * This bespoke application widget is necessary because a generic button or\n * slider cannot represent a two-dimensional drawing viewport. Its keyboard\n * behavior is supplied by the host and forwarded as a native key event. Space\n * creates a centered region or places a point at the center; Escape is left to\n * the host first, which can prevent the default gesture cancellation while it\n * applies its own draft and mode rules.\n */\nexport function AnnotationSurface(props: AnnotationSurfaceProps) {\n const [local] = splitProps(props, [\n 'id',\n 'aria-describedby',\n 'label',\n 'tool',\n 'region',\n 'hint',\n 'interactive',\n 'resetKey',\n 'onPoint',\n 'onDragChange',\n 'onKeyDown',\n 'ref',\n 'class',\n ])\n\n const [dragging, setDragging] = createSignal(false)\n const hintId = createUniqueId()\n let activeDrag: ActiveDrag | undefined\n let previousResetKey = local.resetKey\n let previousTool = local.tool\n\n const isInteractive = () => local.interactive ?? true\n\n function releaseCapture(drag: ActiveDrag): void {\n try {\n if (drag.target.hasPointerCapture(drag.pointerId))\n drag.target.releasePointerCapture(drag.pointerId)\n } catch {\n // The browser may release capture while a host reset or unmount is running.\n }\n }\n\n function cancelDrag(event?: AnnotationSurfaceInputEvent, release = true): void {\n const drag = activeDrag\n if (!drag) return\n\n activeDrag = undefined\n setDragging(false)\n if (release) releaseCapture(drag)\n local.onDragChange?.(undefined, 'cancel', event)\n }\n\n createEffect(() => {\n const resetKey = local.resetKey\n const tool = local.tool\n const interactive = isInteractive()\n if (activeDrag && (resetKey !== previousResetKey || tool !== previousTool || !interactive)) {\n cancelDrag()\n }\n previousResetKey = resetKey\n previousTool = tool\n })\n\n onCleanup(() => cancelDrag())\n\n function handlePointerDown(event: AnnotationSurfacePointerEvent): void {\n if (!isInteractive() || !event.isPrimary || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n const point = pointFrom(event, event.currentTarget)\n if (activeDrag) return\n\n if (local.tool === 'point') {\n local.onPoint?.(point, event)\n return\n }\n\n try {\n event.currentTarget.setPointerCapture(event.pointerId)\n } catch {\n // A drag without real pointer capture can lose its final coordinates.\n return\n }\n\n const drag: ActiveDrag = {\n pointerId: event.pointerId,\n target: event.currentTarget,\n start: point,\n current: point,\n }\n activeDrag = drag\n setDragging(true)\n local.onDragChange?.({ start: point, current: point }, 'start', event)\n }\n\n function handlePointerMove(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = { ...drag, current }\n local.onDragChange?.({ start: drag.start, current }, 'move', event)\n }\n\n function handlePointerUp(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = undefined\n setDragging(false)\n releaseCapture(drag)\n local.onDragChange?.({ start: drag.start, current }, 'end', event)\n }\n\n function handlePointerCancel(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event)\n }\n\n function handleLostPointerCapture(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false)\n }\n\n function handleKeyDown(event: AnnotationSurfaceKeyboardEvent): void {\n local.onKeyDown?.(event)\n if (event.key === 'Escape') {\n if (!event.defaultPrevented) cancelDrag()\n return\n }\n if (\n event.defaultPrevented ||\n !isInteractive() ||\n event.key !== ' ' ||\n event.repeat ||\n event.isComposing ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n activeDrag\n )\n return\n\n event.preventDefault()\n if (local.tool === 'point') {\n local.onPoint?.({ x: 0.5, y: 0.5 }, event)\n return\n }\n\n local.onDragChange?.(\n {\n start: { x: 0.25, y: 0.25 },\n current: { x: 0.75, y: 0.75 },\n },\n 'keyboard',\n event\n )\n }\n\n const visibleRegion = (): AnnotationSurfaceRegion | undefined => {\n const region = local.region\n if (!region) return undefined\n const x = clampSurfaceFraction(region.x)\n const y = clampSurfaceFraction(region.y)\n return {\n x,\n y,\n width: Math.min(clampSurfaceFraction(region.width), 1 - x),\n height: Math.min(clampSurfaceFraction(region.height), 1 - y),\n }\n }\n\n const describedBy = () =>\n [local['aria-describedby'], local.hint && !visibleRegion() ? hintId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabIndex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={local.hint && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {local.hint}\n </span>\n </Show>\n </div>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AAC0C,eAAA;CAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
@@ -0,0 +1,10 @@
1
+ export type AnnotationSurfacePoint = Readonly<{
2
+ x: number;
3
+ y: number;
4
+ }>;
5
+ type SurfaceBounds = Readonly<Pick<DOMRectReadOnly, 'left' | 'top' | 'width' | 'height'>>;
6
+ /** Pointer coordinates normalized to the surface; degenerate bounds resolve to the origin. */
7
+ export declare function normalizedSurfacePoint(clientX: number, clientY: number, bounds: SurfaceBounds): AnnotationSurfacePoint;
8
+ export declare function clampSurfaceFraction(value: number): number;
9
+ export {};
10
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/annotation-surface/geometry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEvE,KAAK,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAA;AAczF,8FAA8F;AAC9F,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,GACpB,sBAAsB,CAKxB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,19 @@
1
+ //#region src/components/ui/annotation-surface/geometry.ts
2
+ function fraction(client, start, length) {
3
+ if (!Number.isFinite(client) || !Number.isFinite(start) || !Number.isFinite(length) || length <= 0) return 0;
4
+ return Math.min(1, Math.max(0, (client - start) / length));
5
+ }
6
+ /** Pointer coordinates normalized to the surface; degenerate bounds resolve to the origin. */
7
+ function normalizedSurfacePoint(clientX, clientY, bounds) {
8
+ return {
9
+ x: fraction(clientX, bounds.left, bounds.width),
10
+ y: fraction(clientY, bounds.top, bounds.height)
11
+ };
12
+ }
13
+ function clampSurfaceFraction(value) {
14
+ return Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0;
15
+ }
16
+ //#endregion
17
+ export { clampSurfaceFraction, normalizedSurfacePoint };
18
+
19
+ //# sourceMappingURL=geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.js","names":[],"sources":["../../../../src/components/ui/annotation-surface/geometry.ts"],"sourcesContent":["export type AnnotationSurfacePoint = Readonly<{ x: number; y: number }>\n\ntype SurfaceBounds = Readonly<Pick<DOMRectReadOnly, 'left' | 'top' | 'width' | 'height'>>\n\nfunction fraction(client: number, start: number, length: number): number {\n if (\n !Number.isFinite(client) ||\n !Number.isFinite(start) ||\n !Number.isFinite(length) ||\n length <= 0\n )\n return 0\n\n return Math.min(1, Math.max(0, (client - start) / length))\n}\n\n/** Pointer coordinates normalized to the surface; degenerate bounds resolve to the origin. */\nexport function normalizedSurfacePoint(\n clientX: number,\n clientY: number,\n bounds: SurfaceBounds\n): AnnotationSurfacePoint {\n return {\n x: fraction(clientX, bounds.left, bounds.width),\n y: fraction(clientY, bounds.top, bounds.height),\n }\n}\n\nexport function clampSurfaceFraction(value: number): number {\n return Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0\n}\n"],"mappings":";AAIA,SAAS,SAAS,QAAgB,OAAe,QAAwB;CACvE,IACE,CAAC,OAAO,SAAS,MAAM,KACvB,CAAC,OAAO,SAAS,KAAK,KACtB,CAAC,OAAO,SAAS,MAAM,KACvB,UAAU,GAEV,OAAO;CAET,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,SAAS,SAAS,MAAM,CAAC;AAC3D;;AAGA,SAAgB,uBACd,SACA,SACA,QACwB;CACxB,OAAO;EACL,GAAG,SAAS,SAAS,OAAO,MAAM,OAAO,KAAK;EAC9C,GAAG,SAAS,SAAS,OAAO,KAAK,OAAO,MAAM;CAChD;AACF;AAEA,SAAgB,qBAAqB,OAAuB;CAC1D,OAAO,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,IAAI;AACpE"}
@@ -0,0 +1,4 @@
1
+ /** Keyboard-operable normalized drawing surface; hosts retain domain geometry and actions. */
2
+ export { AnnotationSurface, type AnnotationSurfaceDrag, type AnnotationSurfaceDragPhase, type AnnotationSurfaceInputEvent, type AnnotationSurfaceKeyboardEvent, type AnnotationSurfacePointerEvent, type AnnotationSurfaceProps, type AnnotationSurfaceRegion, type AnnotationSurfaceTool, } from './annotation-surface';
3
+ export type { AnnotationSurfacePoint } from './geometry';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/annotation-surface/index.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { AnnotationSurface } from "./annotation-surface.js";
2
+ export { AnnotationSurface };
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { cva } from "../../../lib/variants.js";
3
- import { headingVariants, textVariants } from "../typography/typography.js";
4
3
  import { badgeVariants } from "../badge/badge.js";
4
+ import { headingVariants, textVariants } from "../typography/typography.js";
5
5
  import { className, createComponent, delegateEvents, effect, insert, mergeProps, setAttribute, spread, template, use } from "solid-js/web";
6
6
  import { For, Index, Show, createEffect, createMemo, createSignal, onCleanup, splitProps } from "solid-js";
7
7
  //#region src/components/ui/board/board.ts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,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAGxF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAGlF"}
@@ -1,6 +1,5 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
- import { overlayMotion, overlayPositioner, overlayScrim, overlaySurface } from "../../../lib/overlay.js";
3
- import { headingVariants } from "../typography/typography.js";
2
+ import { overlayMotion, overlayPositioner, overlayScrim, overlaySurface, overlayTitle } from "../../../lib/overlay.js";
4
3
  import { className, createComponent, effect, insert, memo, mergeProps, spread, template } from "solid-js/web";
5
4
  import { X } from "lucide-solid";
6
5
  import { Show, createRenderEffect, onCleanup, splitProps } from "solid-js";
@@ -216,10 +215,7 @@ function DialogFooter(props) {
216
215
  function DialogTitle(props) {
217
216
  const [local, rest] = splitProps(props, ["class"]);
218
217
  return createComponent(Dialog.Title, mergeProps({ get ["class"]() {
219
- return cn(headingVariants({
220
- size: "card",
221
- leading: "none"
222
- }), local.class);
218
+ return cn(overlayTitle, local.class);
223
219
  } }, rest));
224
220
  }
225
221
  function DialogDescription(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","Overlay","KobalteDialogOverlay","X","Accessor","ComponentProps","JSX","createRenderEffect","onCleanup","Show","splitProps","overlayMotion","overlayPositioner","overlayScrim","overlaySurface","cn","headingVariants","FocusCycle","content","HTMLElement","opener","openerEligible","closed","focusMovedOutside","closeAutoFocusScheduled","frame","fallbackTimer","observer","MutationObserver","onFocusIn","event","FocusEvent","canRestoreFocus","target","isConnected","document","body","documentElement","closest","matches","getClientRects","length","hasOtherOverlay","querySelectorAll","some","overlay","contains","DialogFocusRestorationOptions","open","restoreFocusRef","onOpenAutoFocus","onCloseAutoFocus","createDialogFocusRestoration","callerOnOpenAutoFocus","callerOnCloseAutoFocus","focusCycles","WeakMap","activeFocusCycle","pendingOpener","pendingOpenerEligible","active","activeElement","finishFocusCycle","cycle","undefined","window","cancelAnimationFrame","clearTimeout","disconnect","removeEventListener","scheduleFocusRestore","requestAnimationFrame","focusIsAvailable","Node","focus","preventScroll","Event","element","currentTarget","openerWasCaptured","focusEvent","set","addEventListener","get","defaultPrevented","observe","attributes","attributeFilter","childList","subtree","queueMicrotask","setTimeout","props","_$createComponent","DialogTrigger","Trigger","DialogPortal","Portal","DialogOverlay","local","rest","_$mergeProps","class","DialogContentProps","closeButton","Element","positioner","DialogContent","children","_el$","_tmpl$","_$insert","_$memo","when","CloseButton","_$effect","_$className","DialogHeader","_el$2","_tmpl$2","_$spread","DialogFooter","_el$3","_tmpl$3","DialogTitle","Title","size","leading","DialogDescription","Description","DialogCloseButton","DialogClose","Dialog","_$createComponent","KobalteDialog","KobalteDialogOverlay","_$mergeProps","KobalteDialogContent","_$memo","_$className"],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n Overlay as KobalteDialogOverlay,\n} from '@kobalte/core/dialog'\n// AlertDialog assigns to the shared DialogRoot.Content object, so these named exports stay role-stable.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { createRenderEffect, onCleanup, Show, splitProps } from 'solid-js'\nimport { overlayMotion, overlayPositioner, overlayScrim, overlaySurface } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\ntype FocusCycle = {\n content: HTMLElement\n opener: HTMLElement | null\n openerEligible: boolean\n closed: boolean\n focusMovedOutside: boolean\n closeAutoFocusScheduled: boolean\n frame?: number\n fallbackTimer?: number\n observer?: MutationObserver\n onFocusIn: (event: FocusEvent) => void\n}\n\nfunction canRestoreFocus(target: HTMLElement): boolean {\n return (\n target.isConnected &&\n target !== document.body &&\n target !== document.documentElement &&\n !target.closest('[inert], [aria-hidden=\"true\"]') &&\n !target.matches(':disabled') &&\n target.getClientRects().length > 0\n )\n}\n\nfunction hasOtherOverlay(content: HTMLElement, opener: HTMLElement): boolean {\n return [...document.querySelectorAll<HTMLElement>('[role=\"dialog\"], [role=\"alertdialog\"]')].some(\n (overlay) =>\n overlay !== content &&\n !content.contains(overlay) &&\n !overlay.contains(opener) &&\n !overlay.closest('[aria-hidden=\"true\"], [inert]') &&\n overlay.getClientRects().length > 0\n )\n}\n\ntype DialogFocusRestorationOptions = {\n open: Accessor<boolean>\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n onOpenAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onOpenAutoFocus']\n onCloseAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onCloseAutoFocus']\n}\n\n/**\n * Adds guarded opener capture and restoration to a Kobalte dialog content.\n * Composed surfaces use this internal helper; it is omitted from the public\n * dialog barrel so the restoration policy stays with the dialog components.\n */\nexport function createDialogFocusRestoration({\n open,\n restoreFocusRef,\n onOpenAutoFocus: callerOnOpenAutoFocus,\n onCloseAutoFocus: callerOnCloseAutoFocus,\n}: DialogFocusRestorationOptions) {\n const focusCycles = new WeakMap<HTMLElement, FocusCycle>()\n let activeFocusCycle: FocusCycle | undefined\n let pendingOpener: HTMLElement | null = null\n let pendingOpenerEligible = false\n\n createRenderEffect(() => {\n if (!open() || typeof document === 'undefined') {\n pendingOpener = null\n pendingOpenerEligible = false\n return\n }\n const active = restoreFocusRef?.() ?? document.activeElement\n pendingOpener = active instanceof HTMLElement ? active : null\n pendingOpenerEligible = active instanceof HTMLElement && canRestoreFocus(active)\n })\n\n const finishFocusCycle = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) window.cancelAnimationFrame(cycle.frame)\n if (cycle.fallbackTimer !== undefined) window.clearTimeout(cycle.fallbackTimer)\n cycle.observer?.disconnect()\n document.removeEventListener('focusin', cycle.onFocusIn)\n if (activeFocusCycle === cycle) activeFocusCycle = undefined\n }\n\n const scheduleFocusRestore = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) return\n cycle.frame = window.requestAnimationFrame(() => {\n cycle.frame = undefined\n const opener = cycle.opener\n const active = document.activeElement\n const focusIsAvailable =\n active === document.body ||\n active === document.documentElement ||\n active === cycle.content ||\n (active instanceof Node && cycle.content.contains(active))\n if (\n activeFocusCycle !== cycle ||\n !cycle.closed ||\n cycle.focusMovedOutside ||\n !opener ||\n !opener.isConnected ||\n opener.matches(':disabled') ||\n opener.getClientRects().length === 0 ||\n !focusIsAvailable ||\n hasOtherOverlay(cycle.content, opener)\n ) {\n finishFocusCycle(cycle)\n return\n }\n\n // Inert and aria-hidden are removed by the dialog's containment cleanup.\n // Wait for that cleanup before returning focus to the original control.\n if (opener.closest('[inert], [aria-hidden=\"true\"]')) return\n if (cycle.openerEligible && canRestoreFocus(opener)) {\n opener.focus({ preventScroll: true })\n }\n finishFocusCycle(cycle)\n })\n }\n\n const onOpenAutoFocus = (event: Event) => {\n const element = event.currentTarget\n if (element instanceof HTMLElement) {\n if (activeFocusCycle) finishFocusCycle(activeFocusCycle)\n\n const openerWasCaptured = pendingOpener !== null\n const opener = pendingOpener ?? document.activeElement\n const openerEligible = openerWasCaptured\n ? pendingOpenerEligible\n : opener instanceof HTMLElement && canRestoreFocus(opener)\n pendingOpener = null\n pendingOpenerEligible = false\n const cycle: FocusCycle = {\n content: element,\n opener: opener instanceof HTMLElement ? opener : null,\n openerEligible,\n closed: false,\n focusMovedOutside: false,\n closeAutoFocusScheduled: false,\n onFocusIn: (focusEvent) => {\n const target = focusEvent.target\n if (\n !(target instanceof HTMLElement) ||\n target === document.body ||\n target === document.documentElement\n ) {\n return\n }\n if (\n target === element ||\n element.contains(target) ||\n target === (opener instanceof HTMLElement ? opener : null)\n ) {\n if (!cycle.closed) cycle.focusMovedOutside = false\n return\n }\n cycle.focusMovedOutside = true\n },\n }\n focusCycles.set(element, cycle)\n activeFocusCycle = cycle\n document.addEventListener('focusin', cycle.onFocusIn)\n }\n callerOnOpenAutoFocus?.(event)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n const element = event.currentTarget\n const cycle = element instanceof HTMLElement ? focusCycles.get(element) : undefined\n callerOnCloseAutoFocus?.(event)\n\n if (!cycle) return\n cycle.closed = true\n\n // A caller that prevents Kobalte's close autofocus owns the focus decision.\n if (event.defaultPrevented) {\n finishFocusCycle(cycle)\n return\n }\n\n if (cycle.fallbackTimer !== undefined) {\n window.clearTimeout(cycle.fallbackTimer)\n cycle.fallbackTimer = undefined\n }\n cycle.closeAutoFocusScheduled = true\n cycle.observer = new MutationObserver(() => scheduleFocusRestore(cycle))\n cycle.observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['aria-hidden', 'inert'],\n childList: true,\n subtree: true,\n })\n scheduleFocusRestore(cycle)\n }\n\n onCleanup(() => {\n const cycle = activeFocusCycle\n if (!cycle) return\n cycle.closed = true\n\n // Kobalte dispatches unmount autofocus from a timer. This fallback only\n // releases the scoped focus listener if the content did not dispatch it.\n queueMicrotask(() => {\n if (cycle.closeAutoFocusScheduled) return\n cycle.fallbackTimer = window.setTimeout(() => {\n cycle.fallbackTimer = undefined\n if (!cycle.closeAutoFocusScheduled) finishFocusCycle(cycle)\n }, 0)\n })\n })\n\n return { onOpenAutoFocus, onCloseAutoFocus }\n}\n\n/**\n * Dialog.\n *\n * A modal surface for a decision or a short task. `Dialog.Portal` keeps the\n * panel out of the app's stacking and overflow contexts, `Dialog.Overlay`\n * dims what is behind it, and Kobalte handles the focus trap, the escape key,\n * scroll locking and returning focus to the trigger on close.\n *\n * The close button is part of the content rather than optional, because every\n * modal needs a way out that is not the keyboard. A dialog whose only exit is\n * Escape is a trap for anyone using a pointer.\n */\nexport function Dialog(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function DialogPortal(props: ComponentProps<typeof KobalteDialog.Portal>) {\n return <KobalteDialog.Portal {...props} />\n}\n\nexport function DialogOverlay(props: ComponentProps<typeof KobalteDialogOverlay>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialogOverlay\n class={cn(\n overlayScrim,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DialogContentProps = ComponentProps<typeof KobalteDialogContent> & {\n /**\n * Replaces the default close button. Pass `false` to remove it — only for a\n * dialog that cannot be dismissed (an update that must finish); anything the\n * user can escape from needs the button.\n */\n closeButton?: JSX.Element | false\n /** Use a 1rem inset as the positioner bounds for tall, viewport-filling surfaces. */\n positioner?: 'default' | 'inset'\n}\n\nexport function DialogContent(props: DialogContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'closeButton', 'positioner'])\n\n return (\n <KobalteDialog.Portal>\n <DialogOverlay />\n <div class={cn(overlayPositioner, local.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}>\n <KobalteDialogContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'relative grid w-full max-w-lg gap-4 p-5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n <KobalteDialog.CloseButton\n aria-label=\"Close\"\n class={cn(\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground',\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none'\n )}\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </KobalteDialogContent>\n </div>\n </KobalteDialog.Portal>\n )\n}\n\nexport function DialogHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-header\"\n class={cn('flex flex-col gap-1.5 pe-6 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-footer\"\n class={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Title\n class={cn(headingVariants({ size: 'card', leading: 'none' }), local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function DialogCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n\n/**\n * The close control, unstyled and polymorphic — for a footer's text \"Cancel\" or\n * \"Close\", which is a different control from the corner icon `DialogCloseButton`\n * draws. Take it as `as={Button}` so it carries the button's variants rather than\n * a copied class string.\n */\nexport function DialogClose(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n"],"mappings":";;;;;;;;;;;AA0BA,SAASmC,gBAAgBC,QAA8B;CACrD,OACEA,OAAOC,eACPD,WAAWE,SAASC,QACpBH,WAAWE,SAASE,mBACpB,CAACJ,OAAOK,QAAQ,iCAA+B,KAC/C,CAACL,OAAOM,QAAQ,WAAW,KAC3BN,OAAOO,eAAe,CAAC,CAACC,SAAS;AAErC;AAEA,SAASC,gBAAgBxB,SAAsBE,QAA8B;CAC3E,OAAO,CAAC,GAAGe,SAASQ,iBAA8B,2CAAuC,CAAC,CAAC,CAACC,MACzFC,YACCA,YAAY3B,WACZ,CAACA,QAAQ4B,SAASD,OAAO,KACzB,CAACA,QAAQC,SAAS1B,MAAM,KACxB,CAACyB,QAAQP,QAAQ,iCAA+B,KAChDO,QAAQ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AAWkF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBAAQ/F,OAAcoH,aAAWb,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQtF,GAAG,cAAcoF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAClF;;;;;;;AAQA,SAAgB+B,YAAYvC,OAAyD;CACnF,MAAM,CAACO,OAAOC,QAAQ1F,WAAWkF,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAC,gBAAQ/F,OAAcoH,aAAWb,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQtF,GAAG,cAAcoF,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AAClF"}
1
+ {"version":3,"file":"dialog.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","Overlay","KobalteDialogOverlay","X","Accessor","ComponentProps","JSX","createRenderEffect","onCleanup","Show","splitProps","overlayMotion","overlayPositioner","overlayScrim","overlaySurface","overlayTitle","cn","FocusCycle","content","HTMLElement","opener","openerEligible","closed","focusMovedOutside","closeAutoFocusScheduled","frame","fallbackTimer","observer","MutationObserver","onFocusIn","event","FocusEvent","canRestoreFocus","target","isConnected","document","body","documentElement","closest","matches","getClientRects","length","hasOtherOverlay","querySelectorAll","some","overlay","contains","DialogFocusRestorationOptions","open","restoreFocusRef","onOpenAutoFocus","onCloseAutoFocus","createDialogFocusRestoration","callerOnOpenAutoFocus","callerOnCloseAutoFocus","focusCycles","WeakMap","activeFocusCycle","pendingOpener","pendingOpenerEligible","active","activeElement","finishFocusCycle","cycle","undefined","window","cancelAnimationFrame","clearTimeout","disconnect","removeEventListener","scheduleFocusRestore","requestAnimationFrame","focusIsAvailable","Node","focus","preventScroll","Event","element","currentTarget","openerWasCaptured","focusEvent","set","addEventListener","get","defaultPrevented","observe","attributes","attributeFilter","childList","subtree","queueMicrotask","setTimeout","props","_$createComponent","DialogTrigger","Trigger","DialogPortal","Portal","DialogOverlay","local","rest","_$mergeProps","class","DialogContentProps","closeButton","Element","positioner","DialogContent","children","_el$","_tmpl$","_$insert","_$memo","when","CloseButton","_$effect","_$className","DialogHeader","_el$2","_tmpl$2","_$spread","DialogFooter","_el$3","_tmpl$3","DialogTitle","Title","DialogDescription","Description","DialogCloseButton","DialogClose","Dialog","_$createComponent","KobalteDialog","KobalteDialogOverlay","_$mergeProps","KobalteDialogContent","_$memo","_$className"],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n Overlay as KobalteDialogOverlay,\n} from '@kobalte/core/dialog'\n// AlertDialog assigns to the shared DialogRoot.Content object, so these named exports stay role-stable.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { createRenderEffect, onCleanup, Show, splitProps } from 'solid-js'\nimport {\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlaySurface,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\ntype FocusCycle = {\n content: HTMLElement\n opener: HTMLElement | null\n openerEligible: boolean\n closed: boolean\n focusMovedOutside: boolean\n closeAutoFocusScheduled: boolean\n frame?: number\n fallbackTimer?: number\n observer?: MutationObserver\n onFocusIn: (event: FocusEvent) => void\n}\n\nfunction canRestoreFocus(target: HTMLElement): boolean {\n return (\n target.isConnected &&\n target !== document.body &&\n target !== document.documentElement &&\n !target.closest('[inert], [aria-hidden=\"true\"]') &&\n !target.matches(':disabled') &&\n target.getClientRects().length > 0\n )\n}\n\nfunction hasOtherOverlay(content: HTMLElement, opener: HTMLElement): boolean {\n return [...document.querySelectorAll<HTMLElement>('[role=\"dialog\"], [role=\"alertdialog\"]')].some(\n (overlay) =>\n overlay !== content &&\n !content.contains(overlay) &&\n !overlay.contains(opener) &&\n !overlay.closest('[aria-hidden=\"true\"], [inert]') &&\n overlay.getClientRects().length > 0\n )\n}\n\ntype DialogFocusRestorationOptions = {\n open: Accessor<boolean>\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n onOpenAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onOpenAutoFocus']\n onCloseAutoFocus?: ComponentProps<typeof KobalteDialogContent>['onCloseAutoFocus']\n}\n\n/**\n * Adds guarded opener capture and restoration to a Kobalte dialog content.\n * Composed surfaces use this internal helper; it is omitted from the public\n * dialog barrel so the restoration policy stays with the dialog components.\n */\nexport function createDialogFocusRestoration({\n open,\n restoreFocusRef,\n onOpenAutoFocus: callerOnOpenAutoFocus,\n onCloseAutoFocus: callerOnCloseAutoFocus,\n}: DialogFocusRestorationOptions) {\n const focusCycles = new WeakMap<HTMLElement, FocusCycle>()\n let activeFocusCycle: FocusCycle | undefined\n let pendingOpener: HTMLElement | null = null\n let pendingOpenerEligible = false\n\n createRenderEffect(() => {\n if (!open() || typeof document === 'undefined') {\n pendingOpener = null\n pendingOpenerEligible = false\n return\n }\n const active = restoreFocusRef?.() ?? document.activeElement\n pendingOpener = active instanceof HTMLElement ? active : null\n pendingOpenerEligible = active instanceof HTMLElement && canRestoreFocus(active)\n })\n\n const finishFocusCycle = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) window.cancelAnimationFrame(cycle.frame)\n if (cycle.fallbackTimer !== undefined) window.clearTimeout(cycle.fallbackTimer)\n cycle.observer?.disconnect()\n document.removeEventListener('focusin', cycle.onFocusIn)\n if (activeFocusCycle === cycle) activeFocusCycle = undefined\n }\n\n const scheduleFocusRestore = (cycle: FocusCycle) => {\n if (cycle.frame !== undefined) return\n cycle.frame = window.requestAnimationFrame(() => {\n cycle.frame = undefined\n const opener = cycle.opener\n const active = document.activeElement\n const focusIsAvailable =\n active === document.body ||\n active === document.documentElement ||\n active === cycle.content ||\n (active instanceof Node && cycle.content.contains(active))\n if (\n activeFocusCycle !== cycle ||\n !cycle.closed ||\n cycle.focusMovedOutside ||\n !opener ||\n !opener.isConnected ||\n opener.matches(':disabled') ||\n opener.getClientRects().length === 0 ||\n !focusIsAvailable ||\n hasOtherOverlay(cycle.content, opener)\n ) {\n finishFocusCycle(cycle)\n return\n }\n\n // Inert and aria-hidden are removed by the dialog's containment cleanup.\n // Wait for that cleanup before returning focus to the original control.\n if (opener.closest('[inert], [aria-hidden=\"true\"]')) return\n if (cycle.openerEligible && canRestoreFocus(opener)) {\n opener.focus({ preventScroll: true })\n }\n finishFocusCycle(cycle)\n })\n }\n\n const onOpenAutoFocus = (event: Event) => {\n const element = event.currentTarget\n if (element instanceof HTMLElement) {\n if (activeFocusCycle) finishFocusCycle(activeFocusCycle)\n\n const openerWasCaptured = pendingOpener !== null\n const opener = pendingOpener ?? document.activeElement\n const openerEligible = openerWasCaptured\n ? pendingOpenerEligible\n : opener instanceof HTMLElement && canRestoreFocus(opener)\n pendingOpener = null\n pendingOpenerEligible = false\n const cycle: FocusCycle = {\n content: element,\n opener: opener instanceof HTMLElement ? opener : null,\n openerEligible,\n closed: false,\n focusMovedOutside: false,\n closeAutoFocusScheduled: false,\n onFocusIn: (focusEvent) => {\n const target = focusEvent.target\n if (\n !(target instanceof HTMLElement) ||\n target === document.body ||\n target === document.documentElement\n ) {\n return\n }\n if (\n target === element ||\n element.contains(target) ||\n target === (opener instanceof HTMLElement ? opener : null)\n ) {\n if (!cycle.closed) cycle.focusMovedOutside = false\n return\n }\n cycle.focusMovedOutside = true\n },\n }\n focusCycles.set(element, cycle)\n activeFocusCycle = cycle\n document.addEventListener('focusin', cycle.onFocusIn)\n }\n callerOnOpenAutoFocus?.(event)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n const element = event.currentTarget\n const cycle = element instanceof HTMLElement ? focusCycles.get(element) : undefined\n callerOnCloseAutoFocus?.(event)\n\n if (!cycle) return\n cycle.closed = true\n\n // A caller that prevents Kobalte's close autofocus owns the focus decision.\n if (event.defaultPrevented) {\n finishFocusCycle(cycle)\n return\n }\n\n if (cycle.fallbackTimer !== undefined) {\n window.clearTimeout(cycle.fallbackTimer)\n cycle.fallbackTimer = undefined\n }\n cycle.closeAutoFocusScheduled = true\n cycle.observer = new MutationObserver(() => scheduleFocusRestore(cycle))\n cycle.observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['aria-hidden', 'inert'],\n childList: true,\n subtree: true,\n })\n scheduleFocusRestore(cycle)\n }\n\n onCleanup(() => {\n const cycle = activeFocusCycle\n if (!cycle) return\n cycle.closed = true\n\n // Kobalte dispatches unmount autofocus from a timer. This fallback only\n // releases the scoped focus listener if the content did not dispatch it.\n queueMicrotask(() => {\n if (cycle.closeAutoFocusScheduled) return\n cycle.fallbackTimer = window.setTimeout(() => {\n cycle.fallbackTimer = undefined\n if (!cycle.closeAutoFocusScheduled) finishFocusCycle(cycle)\n }, 0)\n })\n })\n\n return { onOpenAutoFocus, onCloseAutoFocus }\n}\n\n/**\n * Dialog.\n *\n * A modal surface for a decision or a short task. `Dialog.Portal` keeps the\n * panel out of the app's stacking and overflow contexts, `Dialog.Overlay`\n * dims what is behind it, and Kobalte handles the focus trap, the escape key,\n * scroll locking and returning focus to the trigger on close.\n *\n * The close button is part of the content rather than optional, because every\n * modal needs a way out that is not the keyboard. A dialog whose only exit is\n * Escape is a trap for anyone using a pointer.\n */\nexport function Dialog(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function DialogTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function DialogPortal(props: ComponentProps<typeof KobalteDialog.Portal>) {\n return <KobalteDialog.Portal {...props} />\n}\n\nexport function DialogOverlay(props: ComponentProps<typeof KobalteDialogOverlay>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialogOverlay\n class={cn(\n overlayScrim,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type DialogContentProps = ComponentProps<typeof KobalteDialogContent> & {\n /**\n * Replaces the default close button. Pass `false` to remove it — only for a\n * dialog that cannot be dismissed (an update that must finish); anything the\n * user can escape from needs the button.\n */\n closeButton?: JSX.Element | false\n /** Use a 1rem inset as the positioner bounds for tall, viewport-filling surfaces. */\n positioner?: 'default' | 'inset'\n}\n\nexport function DialogContent(props: DialogContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'closeButton', 'positioner'])\n\n return (\n <KobalteDialog.Portal>\n <DialogOverlay />\n <div class={cn(overlayPositioner, local.positioner === 'inset' && 'inset-4 grid-rows-1 p-0')}>\n <KobalteDialogContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'relative grid w-full max-w-lg gap-4 p-5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n <KobalteDialog.CloseButton\n aria-label=\"Close\"\n class={cn(\n 'absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground',\n 'transition-colors ease-out hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none'\n )}\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </KobalteDialogContent>\n </div>\n </KobalteDialog.Portal>\n )\n}\n\nexport function DialogHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-header\"\n class={cn('flex flex-col gap-1.5 pe-6 text-start', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"dialog-footer\"\n class={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DialogTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function DialogDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function DialogCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n\n/**\n * The close control, unstyled and polymorphic — for a footer's text \"Cancel\" or\n * \"Close\", which is a different control from the corner icon `DialogCloseButton`\n * draws. Take it as `as={Button}` so it carries the button's variants rather than\n * a copied class string.\n */\nexport function DialogClose(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn('focus-ring', local.class)} {...rest} />\n}\n"],"mappings":";;;;;;;;;;AA+BA,SAASmC,gBAAgBC,QAA8B;CACrD,OACEA,OAAOC,eACPD,WAAWE,SAASC,QACpBH,WAAWE,SAASE,mBACpB,CAACJ,OAAOK,QAAQ,iCAA+B,KAC/C,CAACL,OAAOM,QAAQ,WAAW,KAC3BN,OAAOO,eAAe,CAAC,CAACC,SAAS;AAErC;AAEA,SAASC,gBAAgBxB,SAAsBE,QAA8B;CAC3E,OAAO,CAAC,GAAGe,SAASQ,iBAA8B,2CAAuC,CAAC,CAAC,CAACC,MACzFC,YACCA,YAAY3B,WACZ,CAACA,QAAQ4B,SAASD,OAAO,KACzB,CAACA,QAAQC,SAAS1B,MAAM,KACxB,CAACyB,QAAQP,QAAQ,iCAA+B,KAChDO,QAAQL,eAAe,CAAC,CAACC,SAAS,CACtC;AACF;;;;;;AAcA,SAAgBW,6BAA6B,EAC3CJ,MACAC,iBACAC,iBAAiBG,uBACjBF,kBAAkBG,0BACc;CAChC,MAAMC,8BAAc,IAAIC,QAAiC;CACzD,IAAIC;CACJ,IAAIC,gBAAoC;CACxC,IAAIC,wBAAwB;CAE5BpD,yBAAyB;EACvB,IAAI,CAACyC,KAAK,KAAK,OAAOb,aAAa,aAAa;GAC9CuB,gBAAgB;GAChBC,wBAAwB;GACxB;EACF;EACA,MAAMC,SAAS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CAAC,EAAA,GAAMF,IAAI,CAAA;AAClF"}
@@ -19,7 +19,7 @@ import { type VariantProps } from '#lib/variants';
19
19
  * actually has are "does this need an edge" and "is it on the canvas or inset".
20
20
  */
21
21
  export declare const itemVariants: (props?: ({
22
- variant?: "default" | "muted" | "outline" | null | undefined;
22
+ variant?: "default" | "outline" | "muted" | null | undefined;
23
23
  size?: "sm" | "md" | "lg" | null | undefined;
24
24
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
25
25
  type ItemVariantProps = VariantProps<typeof itemVariants>;
@@ -32,7 +32,7 @@ import { type VariantProps } from '#lib/variants';
32
32
  * sheet opens.
33
33
  */
34
34
  declare const sheetVariants: (props?: ({
35
- side?: "end" | "start" | "bottom" | "top" | null | undefined;
35
+ side?: "top" | "bottom" | "start" | "end" | null | undefined;
36
36
  variant?: "inset" | "edge" | null | undefined;
37
37
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
38
38
  export type SheetContentProps = ComponentProps<typeof KobalteDialogContent> & VariantProps<typeof sheetVariants> & {
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,aAAa,EACvB,OAAO,IAAI,oBAAoB,EAEhC,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAKtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,QAAA,MAAM,aAAa;;;8EAuClB,CAAA;AAQD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,oBAAoB,CAAC,GACzE,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;IACjC,+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,MAAM,aAAa;;;8EAuClB,CAAA;AAQD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,oBAAoB,CAAC,GACzE,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;IACjC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sFAAsF;IACtF,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;CACpD,CAAA;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA0DpD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,eAEhE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,eAE/E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAGvF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAYvD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASrD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAYvD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,eAG3E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,eAKvF;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { cva } from "../../../lib/variants.js";
3
- import { headingVariants } from "../typography/typography.js";
3
+ import { overlayTitle } from "../../../lib/overlay.js";
4
4
  import { DialogOverlay, createDialogFocusRestoration } from "../dialog/dialog.js";
5
5
  import { createComponent, memo, mergeProps, spread, template } from "solid-js/web";
6
6
  import { X } from "lucide-solid";
@@ -194,10 +194,7 @@ function SheetFooter(props) {
194
194
  function SheetTitle(props) {
195
195
  const [local, rest] = splitProps(props, ["class"]);
196
196
  return createComponent(Dialog.Title, mergeProps({ get ["class"]() {
197
- return cn(headingVariants({
198
- size: "card",
199
- leading: "none"
200
- }), local.class);
197
+ return cn(overlayTitle, local.class);
201
198
  } }, rest));
202
199
  }
203
200
  function SheetDescription(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","useDialogContext","X","Accessor","ComponentProps","JSX","Show","splitProps","cva","VariantProps","cn","createDialogFocusRestoration","DialogOverlay","headingVariants","sheetVariants","variants","side","top","bottom","start","end","variant","edge","inset","compoundVariants","class","defaultVariants","sheetVariantFor","SheetContentProps","closeButton","Element","closeLabel","restoreFocusRef","HTMLElement","SheetContent","props","local","rest","dialog","focusRestoration","open","isOpen","onOpenAutoFocus","onCloseAutoFocus","_$createComponent","Portal","children","when","_$mergeProps","data-variant","_$memo","CloseButton","aria-label","tabindex","Sheet","SheetTrigger","Trigger","SheetCloseButton","SheetHeader","_el$","_tmpl$","_$spread","SheetBody","_el$2","_tmpl$2","SheetFooter","_el$3","_tmpl$3","SheetTitle","Title","size","leading","SheetDescription","Description","_$createComponent","KobalteDialog","KobalteDialogContent","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n useDialogContext,\n} from '@kobalte/core/dialog'\n// AlertDialog shares DialogRoot.Content; Sheet uses the stable named primitive.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { createDialogFocusRestoration, DialogOverlay } from '../dialog/dialog'\nimport { headingVariants } from '../typography'\n\n/**\n * Sheet.\n *\n * A dialog anchored to an edge of the window rather than centred. Use it when\n * the content is a *panel beside* the work — a details inspector, a filter rail,\n * a settings flyout — so the user keeps the context it belongs to in view.\n * A centred dialog interrupts; a sheet is inspected.\n *\n * `side` decides which edge; the panel is a full-height column for `start` and\n * `end`, and a full-width row for `top` and `bottom`. The slide-in direction\n * follows from the side, so a caller never pairs them by hand.\n *\n * `variant` decides how it meets that edge. `inset` — the default for `end` —\n * docks the panel inside the main view: below the top bar, one equal gap from\n * the top bar, the end edge and the bottom, with no scrim, so the work it edits\n * stays visible and the top bar stays reachable. It is the shape for editing one\n * thing beside its context (appearance settings, a task, a record). `edge` runs\n * edge to edge over a scrim — the shape of a navigation drawer, and the default\n * for every other side.\n *\n * Its parts read alike everywhere: `SheetHeader` holds a heading, a description\n * and a full-width rule beneath, with the close button in the corner;\n * `SheetBody` scrolls on its own; `SheetFooter` is a full-width tinted band that\n * holds the decision.\n *\n * Controlled sheets opened from outside a `SheetTrigger` restore focus to the\n * element focused before opening. Pass `restoreFocusRef` when a stable external\n * opener must be used instead, such as when another layer closes before the\n * sheet opens.\n */\n// `overflow-clip`, not `overflow-hidden`: a hidden overflow can still be\n// scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the\n// pinned footer out of view. Only SheetBody scrolls.\nconst sheetVariants = cva(\n 'bg-popover text-popover-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',\n {\n variants: {\n side: {\n top: 'data-expanded:slide-in-from-top data-closed:slide-out-to-top',\n bottom: 'data-expanded:slide-in-from-bottom data-closed:slide-out-to-bottom',\n start: 'data-expanded:slide-in-from-left data-closed:slide-out-to-left',\n end: 'data-expanded:slide-in-from-right data-closed:slide-out-to-right',\n },\n variant: {\n edge: '',\n inset: 'panel-dialog-inset w-lg rounded-xl border',\n },\n },\n compoundVariants: [\n {\n side: 'top',\n variant: 'edge',\n class: 'inset-x-0 top-0 h-auto max-h-[85vh] rounded-b-xl border-b',\n },\n {\n side: 'bottom',\n variant: 'edge',\n class: 'inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-xl border-t',\n },\n {\n side: 'start',\n variant: 'edge',\n class: 'inset-y-0 start-0 h-full w-80 max-w-[85vw] rounded-e-xl border-e',\n },\n {\n side: 'end',\n variant: 'edge',\n class: 'inset-y-0 end-0 h-full w-80 max-w-[85vw] rounded-s-xl border-s',\n },\n ],\n defaultVariants: { side: 'end', variant: 'edge' },\n }\n)\n\n/** `inset` for the end edge, `edge` for every other side, unless the caller says. */\nconst sheetVariantFor = (\n side: SheetContentProps['side'],\n variant: SheetContentProps['variant']\n): 'edge' | 'inset' => variant ?? ((side ?? 'end') === 'end' ? 'inset' : 'edge')\n\nexport type SheetContentProps = ComponentProps<typeof KobalteDialogContent> &\n VariantProps<typeof sheetVariants> & {\n closeButton?: JSX.Element | false\n /** The close button's accessible name. Defaults to \"Close\". */\n closeLabel?: string\n /** Supplies the stable external element to focus when the controlled sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n }\n\nexport function SheetContent(props: SheetContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'side',\n 'variant',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const dialog = useDialogContext()\n const focusRestoration = createDialogFocusRestoration({\n open: dialog.isOpen,\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: local.onOpenAutoFocus,\n onCloseAutoFocus: local.onCloseAutoFocus,\n })\n\n const variant = () => sheetVariantFor(local.side, local.variant)\n\n return (\n <KobalteDialog.Portal>\n {/* An inset panel is beside the work, so the work stays in view: no scrim.\n It is still modal — focus stays inside and an outside click dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogOverlay />\n </Show>\n <KobalteDialogContent\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: local.side, variant: variant() }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n local.class\n )}\n {...rest}\n onOpenAutoFocus={focusRestoration.onOpenAutoFocus}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <KobalteDialog.CloseButton\n aria-label={local.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class=\"absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground transition-colors ease-out outline-none hover:bg-surface-hover hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </KobalteDialogContent>\n </KobalteDialog.Portal>\n )\n}\n\nexport function Sheet(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function SheetTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function SheetCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn(local.class)} {...rest} />\n}\n\nexport function SheetHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function SheetFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Title\n class={cn(headingVariants({ size: 'card', leading: 'none' }), local.class)}\n {...rest}\n />\n )\n}\n\nexport function SheetDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAMiB,gBAAgBN,IACpB,+GACA;CACEO,UAAU;EACRC,MAAM;GACJC,KAAK;GACLC,QAAQ;GACRC,OAAO;GACPC,KAAK;EACP;EACAC,SAAS;GACPC,MAAM;GACNC,OAAO;EACT;CACF;CACAC,kBAAkB;EAChB;GACER,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;CAAC;CAEHC,iBAAiB;EAAEV,MAAM;EAAOK,SAAS;CAAO;AAClD,CACF;;AAGA,IAAMM,mBACJX,MACAK,YACqBA,aAAaL,QAAQ,WAAW,QAAQ,UAAU;AAWzE,SAAgBkB,aAAaC,OAA0B;CACrD,MAAM,CAACC,OAAOC,QAAQ9B,WAAW4B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAkB,CACnB;CACD,MAAMG,SAASrC,iBAAiB;CAChC,MAAMsC,mBAAmB5B,6BAA6B;EACpD6B,MAAMF,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6B;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,WAAWjC,OAAmD;CAC5E,MAAM,CAACC,OAAOC,QAAQ9B,WAAW4B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAS,gBACG9C,OAAcuE,OAAKrB,WAAA,EAAA,KAAA,WAAA;EAAA,OACXtC,GAAGG,gBAAgB;GAAEyD,MAAM;GAAQC,SAAS;EAAO,CAAC,GAAGnC,MAAMX,KAAK;CAAC,EAAA,GACtEY,IAAI,CAAA;AAGd;AAEA,SAAgBmC,iBAAiBrC,OAAyD;CACxF,MAAM,CAACC,OAAOC,QAAQ9B,WAAW4B,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAS,gBACG9C,OAAc2E,aAAWzB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQtC,GAAG,iCAAiC0B,MAAMX,KAAK;CAAC,EAAA,GAAMY,IAAI,CAAA;AAEhG"}
1
+ {"version":3,"file":"sheet.js","names":["Dialog","KobalteDialog","Content","KobalteDialogContent","useDialogContext","X","Accessor","ComponentProps","JSX","Show","splitProps","cva","VariantProps","overlayTitle","cn","createDialogFocusRestoration","DialogOverlay","sheetVariants","variants","side","top","bottom","start","end","variant","edge","inset","compoundVariants","class","defaultVariants","sheetVariantFor","SheetContentProps","closeButton","Element","closeLabel","restoreFocusRef","HTMLElement","SheetContent","props","local","rest","dialog","focusRestoration","open","isOpen","onOpenAutoFocus","onCloseAutoFocus","_$createComponent","Portal","children","when","_$mergeProps","data-variant","_$memo","CloseButton","aria-label","tabindex","Sheet","SheetTrigger","Trigger","SheetCloseButton","SheetHeader","_el$","_tmpl$","_$spread","SheetBody","_el$2","_tmpl$2","SheetFooter","_el$3","_tmpl$3","SheetTitle","Title","SheetDescription","Description","_$createComponent","KobalteDialog","KobalteDialogContent","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/sheet/sheet.tsx"],"sourcesContent":["import {\n Dialog as KobalteDialog,\n Content as KobalteDialogContent,\n useDialogContext,\n} from '@kobalte/core/dialog'\n// AlertDialog shares DialogRoot.Content; Sheet uses the stable named primitive.\nimport { X } from 'lucide-solid'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { overlayTitle } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createDialogFocusRestoration, DialogOverlay } from '../dialog/dialog'\n\n/**\n * Sheet.\n *\n * A dialog anchored to an edge of the window rather than centred. Use it when\n * the content is a *panel beside* the work — a details inspector, a filter rail,\n * a settings flyout — so the user keeps the context it belongs to in view.\n * A centred dialog interrupts; a sheet is inspected.\n *\n * `side` decides which edge; the panel is a full-height column for `start` and\n * `end`, and a full-width row for `top` and `bottom`. The slide-in direction\n * follows from the side, so a caller never pairs them by hand.\n *\n * `variant` decides how it meets that edge. `inset` — the default for `end` —\n * docks the panel inside the main view: below the top bar, one equal gap from\n * the top bar, the end edge and the bottom, with no scrim, so the work it edits\n * stays visible and the top bar stays reachable. It is the shape for editing one\n * thing beside its context (appearance settings, a task, a record). `edge` runs\n * edge to edge over a scrim — the shape of a navigation drawer, and the default\n * for every other side.\n *\n * Its parts read alike everywhere: `SheetHeader` holds a heading, a description\n * and a full-width rule beneath, with the close button in the corner;\n * `SheetBody` scrolls on its own; `SheetFooter` is a full-width tinted band that\n * holds the decision.\n *\n * Controlled sheets opened from outside a `SheetTrigger` restore focus to the\n * element focused before opening. Pass `restoreFocusRef` when a stable external\n * opener must be used instead, such as when another layer closes before the\n * sheet opens.\n */\n// `overflow-clip`, not `overflow-hidden`: a hidden overflow can still be\n// scrolled programmatically (focus, scrollIntoView, scrollTop), which slid the\n// pinned footer out of view. Only SheetBody scrolls.\nconst sheetVariants = cva(\n 'bg-popover text-popover-foreground fixed z-(--z-dialog) flex flex-col overflow-clip border-border shadow-lg',\n {\n variants: {\n side: {\n top: 'data-expanded:slide-in-from-top data-closed:slide-out-to-top',\n bottom: 'data-expanded:slide-in-from-bottom data-closed:slide-out-to-bottom',\n start: 'data-expanded:slide-in-from-left data-closed:slide-out-to-left',\n end: 'data-expanded:slide-in-from-right data-closed:slide-out-to-right',\n },\n variant: {\n edge: '',\n inset: 'panel-dialog-inset w-lg rounded-xl border',\n },\n },\n compoundVariants: [\n {\n side: 'top',\n variant: 'edge',\n class: 'inset-x-0 top-0 h-auto max-h-[85vh] rounded-b-xl border-b',\n },\n {\n side: 'bottom',\n variant: 'edge',\n class: 'inset-x-0 bottom-0 h-auto max-h-[85vh] rounded-t-xl border-t',\n },\n {\n side: 'start',\n variant: 'edge',\n class: 'inset-y-0 start-0 h-full w-80 max-w-[85vw] rounded-e-xl border-e',\n },\n {\n side: 'end',\n variant: 'edge',\n class: 'inset-y-0 end-0 h-full w-80 max-w-[85vw] rounded-s-xl border-s',\n },\n ],\n defaultVariants: { side: 'end', variant: 'edge' },\n }\n)\n\n/** `inset` for the end edge, `edge` for every other side, unless the caller says. */\nconst sheetVariantFor = (\n side: SheetContentProps['side'],\n variant: SheetContentProps['variant']\n): 'edge' | 'inset' => variant ?? ((side ?? 'end') === 'end' ? 'inset' : 'edge')\n\nexport type SheetContentProps = ComponentProps<typeof KobalteDialogContent> &\n VariantProps<typeof sheetVariants> & {\n closeButton?: JSX.Element | false\n /** The close button's accessible name. Defaults to \"Close\". */\n closeLabel?: string\n /** Supplies the stable external element to focus when the controlled sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n }\n\nexport function SheetContent(props: SheetContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'side',\n 'variant',\n 'children',\n 'closeButton',\n 'closeLabel',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const dialog = useDialogContext()\n const focusRestoration = createDialogFocusRestoration({\n open: dialog.isOpen,\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: local.onOpenAutoFocus,\n onCloseAutoFocus: local.onCloseAutoFocus,\n })\n\n const variant = () => sheetVariantFor(local.side, local.variant)\n\n return (\n <KobalteDialog.Portal>\n {/* An inset panel is beside the work, so the work stays in view: no scrim.\n It is still modal — focus stays inside and an outside click dismisses. */}\n <Show when={variant() === 'edge'}>\n <DialogOverlay />\n </Show>\n <KobalteDialogContent\n data-variant={variant()}\n class={cn(\n sheetVariants({ side: local.side, variant: variant() }),\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:duration-200',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:duration-150',\n local.class\n )}\n {...rest}\n onOpenAutoFocus={focusRestoration.onOpenAutoFocus}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n {local.children}\n <Show when={local.closeButton !== false}>\n {/* The close action opts into the tab order explicitly. Engines that\n derive tabbability from the DOM instead of the host (Playwright's\n WebKit walks only explicit tabindex and form controls) would skip\n an implicitly-tabbable button and jump past the sheet's end. */}\n <KobalteDialog.CloseButton\n aria-label={local.closeLabel ?? 'Close'}\n tabindex=\"0\"\n class=\"absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground transition-colors ease-out outline-none hover:bg-surface-hover hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n {local.closeButton ?? <X class=\"size-4\" />}\n </KobalteDialog.CloseButton>\n </Show>\n </KobalteDialogContent>\n </KobalteDialog.Portal>\n )\n}\n\nexport function Sheet(props: ComponentProps<typeof KobalteDialog>) {\n return <KobalteDialog {...props} />\n}\n\nexport function SheetTrigger(props: ComponentProps<typeof KobalteDialog.Trigger>) {\n return <KobalteDialog.Trigger {...props} />\n}\n\nexport function SheetCloseButton(props: ComponentProps<typeof KobalteDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.CloseButton class={cn(local.class)} {...rest} />\n}\n\nexport function SheetHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-header\"\n class={cn(\n 'flex shrink-0 flex-col gap-1.5 border-b border-border p-4 pe-12 text-start',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetBody(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-body\"\n class={cn('min-h-0 flex-1 overflow-y-auto p-4', local.class)}\n {...rest}\n />\n )\n}\n\nexport function SheetFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"sheet-footer\"\n class={cn(\n 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border bg-background px-4 py-3',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function SheetTitle(props: ComponentProps<typeof KobalteDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function SheetDescription(props: ComponentProps<typeof KobalteDialog.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteDialog.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport { sheetVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAMiB,gBAAgBN,IACpB,+GACA;CACEO,UAAU;EACRC,MAAM;GACJC,KAAK;GACLC,QAAQ;GACRC,OAAO;GACPC,KAAK;EACP;EACAC,SAAS;GACPC,MAAM;GACNC,OAAO;EACT;CACF;CACAC,kBAAkB;EAChB;GACER,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;EACA;GACET,MAAM;GACNK,SAAS;GACTI,OAAO;EACT;CAAC;CAEHC,iBAAiB;EAAEV,MAAM;EAAOK,SAAS;CAAO;AAClD,CACF;;AAGA,IAAMM,mBACJX,MACAK,YACqBA,aAAaL,QAAQ,WAAW,QAAQ,UAAU;AAWzE,SAAgBkB,aAAaC,OAA0B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