@gemologic/sheen 0.2.0 → 0.3.0

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 (214) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/ai.d.ts +8 -0
  4. package/dist/ai.js +5 -0
  5. package/dist/core.d.ts +11 -4
  6. package/dist/core.js +32 -28
  7. package/dist/formisch.js +1 -2
  8. package/dist/forms.d.ts +2 -0
  9. package/dist/forms.js +16 -15
  10. package/dist/index.d.ts +25 -5
  11. package/dist/index.js +86 -76
  12. package/dist/layout/Layout.js +1 -2
  13. package/dist/metadata.js +1 -2
  14. package/dist/navigation.d.ts +2 -1
  15. package/dist/navigation.js +16 -16
  16. package/dist/primitives/Accordion.js +9 -9
  17. package/dist/primitives/ActivityTimeline.js +57 -49
  18. package/dist/primitives/AlertDialog.js +1 -2
  19. package/dist/primitives/Avatar.js +16 -17
  20. package/dist/primitives/Board.d.ts +39 -0
  21. package/dist/primitives/Board.js +471 -0
  22. package/dist/primitives/Breadcrumb.js +1 -2
  23. package/dist/primitives/Button.js +38 -27
  24. package/dist/primitives/ButtonGroup.js +1 -2
  25. package/dist/primitives/Checkbox.js +1 -2
  26. package/dist/primitives/CheckboxGroup.js +11 -12
  27. package/dist/primitives/Collapsible.js +6 -6
  28. package/dist/primitives/Combobox.js +203 -201
  29. package/dist/primitives/CommandPalette.js +2 -4
  30. package/dist/primitives/ConfirmDialog.js +5 -6
  31. package/dist/primitives/ContextMenu.js +7 -8
  32. package/dist/primitives/Conversation.d.ts +17 -0
  33. package/dist/primitives/Conversation.js +107 -0
  34. package/dist/primitives/DescriptionList.js +1 -2
  35. package/dist/primitives/Dialog.js +101 -68
  36. package/dist/primitives/Drawer.js +12 -13
  37. package/dist/primitives/DropdownMenu.js +163 -157
  38. package/dist/primitives/EditableTextField.js +3 -8
  39. package/dist/primitives/EmptyState.js +1 -2
  40. package/dist/primitives/Field.js +1 -2
  41. package/dist/primitives/FileDropzone.js +19 -18
  42. package/dist/primitives/Form.d.ts +23 -0
  43. package/dist/primitives/Form.js +76 -0
  44. package/dist/primitives/Glyph.d.ts +40 -0
  45. package/dist/primitives/Glyph.js +65 -0
  46. package/dist/primitives/IconButton.js +5 -6
  47. package/dist/primitives/Input.js +1 -2
  48. package/dist/primitives/InputGroup.js +8 -9
  49. package/dist/primitives/Link.d.ts +9 -1
  50. package/dist/primitives/Link.js +23 -17
  51. package/dist/primitives/LinkTooltip.js +6 -7
  52. package/dist/primitives/List.d.ts +34 -0
  53. package/dist/primitives/List.js +135 -0
  54. package/dist/primitives/Message.d.ts +13 -0
  55. package/dist/primitives/Message.js +75 -0
  56. package/dist/primitives/NavList.js +15 -16
  57. package/dist/primitives/Notice.d.ts +15 -1
  58. package/dist/primitives/Notice.js +91 -43
  59. package/dist/primitives/NumberField.js +81 -81
  60. package/dist/primitives/NumberText.d.ts +4 -0
  61. package/dist/primitives/NumberText.js +50 -25
  62. package/dist/primitives/Pagination.js +81 -60
  63. package/dist/primitives/Popover.js +57 -57
  64. package/dist/primitives/Progress.js +1 -2
  65. package/dist/primitives/PromptInput.d.ts +23 -0
  66. package/dist/primitives/PromptInput.js +135 -0
  67. package/dist/primitives/RadioGroup.js +12 -17
  68. package/dist/primitives/Resizable.js +1 -2
  69. package/dist/primitives/ScrollArea.js +1 -2
  70. package/dist/primitives/SearchInput.js +45 -38
  71. package/dist/primitives/SegmentedControl.d.ts +2 -0
  72. package/dist/primitives/SegmentedControl.js +92 -78
  73. package/dist/primitives/Select.js +105 -100
  74. package/dist/primitives/Separator.js +1 -2
  75. package/dist/primitives/ShortcutPending.js +11 -12
  76. package/dist/primitives/ShortcutProvider.d.ts +5 -0
  77. package/dist/primitives/ShortcutProvider.js +71 -65
  78. package/dist/primitives/ShortcutScope.js +8 -9
  79. package/dist/primitives/ShortcutSheet.js +30 -24
  80. package/dist/primitives/Skeleton.js +1 -2
  81. package/dist/primitives/Slider.js +1 -2
  82. package/dist/primitives/SortableList.d.ts +19 -0
  83. package/dist/primitives/SortableList.js +235 -0
  84. package/dist/primitives/Spinner.js +1 -2
  85. package/dist/primitives/Status.js +14 -14
  86. package/dist/primitives/Stepper.js +54 -52
  87. package/dist/primitives/StreamingText.d.ts +12 -0
  88. package/dist/primitives/StreamingText.js +42 -0
  89. package/dist/primitives/Surface.js +1 -2
  90. package/dist/primitives/Switch.js +1 -2
  91. package/dist/primitives/Table.js +1 -2
  92. package/dist/primitives/Tabs.js +20 -17
  93. package/dist/primitives/TagInput.js +6 -9
  94. package/dist/primitives/Textarea.js +37 -63
  95. package/dist/primitives/Toast.js +42 -41
  96. package/dist/primitives/Toaster.js +27 -28
  97. package/dist/primitives/Tooltip.js +32 -32
  98. package/dist/primitives/Tree.js +1 -2
  99. package/dist/primitives/Typography.d.ts +6 -2
  100. package/dist/primitives/Typography.js +20 -12
  101. package/dist/primitives/boolean-input-state.js +3 -8
  102. package/dist/primitives/button-variants.js +2 -3
  103. package/dist/primitives/choice-options.js +1 -2
  104. package/dist/primitives/create-confirm.js +1 -2
  105. package/dist/primitives/create-toaster.js +1 -2
  106. package/dist/primitives/link-focus.js +1 -2
  107. package/dist/primitives/menu-focus.js +1 -2
  108. package/dist/primitives/sortable-core.d.ts +70 -0
  109. package/dist/primitives/sortable-core.js +109 -0
  110. package/dist/primitives/sortable-drag.d.ts +29 -0
  111. package/dist/primitives/sortable-drag.js +50 -0
  112. package/dist/primitives/tooltip-layer.js +26 -27
  113. package/dist/sortable.d.ts +6 -0
  114. package/dist/sortable.js +4 -0
  115. package/dist/theme/ThemeProvider.d.ts +6 -1
  116. package/dist/theme/ThemeProvider.js +65 -58
  117. package/dist/theme/intl.js +1 -2
  118. package/dist/theme/keyboard-script.js +1 -2
  119. package/dist/theme/layers.js +1 -2
  120. package/dist/theme/messages.d.ts +26 -0
  121. package/dist/theme/messages.js +9 -2
  122. package/dist/theme/number-format-cache.js +1 -2
  123. package/dist/theme/script.d.ts +1 -0
  124. package/dist/theme/script.js +3 -3
  125. package/dist/theme/state.d.ts +4 -4
  126. package/dist/theme/state.js +12 -13
  127. package/dist/utils/auto-resize.d.ts +6 -0
  128. package/dist/utils/auto-resize.js +31 -0
  129. package/dist/utils/browser-status.js +1 -2
  130. package/dist/utils/change-motion.d.ts +8 -0
  131. package/dist/utils/change-motion.js +19 -0
  132. package/dist/utils/cn.js +1 -2
  133. package/dist/utils/media-query.d.ts +10 -0
  134. package/dist/utils/media-query.js +16 -0
  135. package/dist/utils/optimistic.js +1 -2
  136. package/dist/utils/shortcut-platform.js +1 -2
  137. package/dist/utils/shortcut-registry.d.ts +5 -0
  138. package/dist/utils/shortcut-registry.js +61 -51
  139. package/dist/vite.js +3 -4
  140. package/package.json +23 -5
  141. package/src/ai.ts +8 -0
  142. package/src/core.ts +11 -4
  143. package/src/forms.ts +2 -0
  144. package/src/index.ts +25 -5
  145. package/src/navigation.ts +2 -1
  146. package/src/primitives/Accordion.tsx +1 -1
  147. package/src/primitives/ActivityTimeline.tsx +12 -7
  148. package/src/primitives/Board.tsx +406 -0
  149. package/src/primitives/Button.tsx +15 -4
  150. package/src/primitives/Collapsible.tsx +1 -1
  151. package/src/primitives/Combobox.tsx +2 -1
  152. package/src/primitives/CommandPalette.tsx +2 -2
  153. package/src/primitives/Conversation.tsx +108 -0
  154. package/src/primitives/Dialog.tsx +5 -1
  155. package/src/primitives/DropdownMenu.tsx +12 -6
  156. package/src/primitives/FileDropzone.tsx +2 -2
  157. package/src/primitives/Form.tsx +58 -0
  158. package/src/primitives/Glyph.tsx +55 -0
  159. package/src/primitives/Link.tsx +15 -6
  160. package/src/primitives/List.tsx +68 -0
  161. package/src/primitives/Message.tsx +40 -0
  162. package/src/primitives/Notice.tsx +45 -12
  163. package/src/primitives/NumberField.tsx +3 -2
  164. package/src/primitives/NumberText.tsx +31 -4
  165. package/src/primitives/Pagination.tsx +6 -5
  166. package/src/primitives/Popover.tsx +2 -1
  167. package/src/primitives/PromptInput.tsx +116 -0
  168. package/src/primitives/SearchInput.tsx +4 -3
  169. package/src/primitives/SegmentedControl.tsx +29 -4
  170. package/src/primitives/Select.tsx +3 -2
  171. package/src/primitives/ShortcutProvider.tsx +14 -1
  172. package/src/primitives/ShortcutSheet.tsx +1 -1
  173. package/src/primitives/SortableList.tsx +208 -0
  174. package/src/primitives/Status.tsx +1 -1
  175. package/src/primitives/Stepper.tsx +7 -7
  176. package/src/primitives/StreamingText.tsx +32 -0
  177. package/src/primitives/Tabs.tsx +2 -1
  178. package/src/primitives/TagInput.tsx +1 -1
  179. package/src/primitives/Textarea.tsx +3 -47
  180. package/src/primitives/Toast.tsx +2 -1
  181. package/src/primitives/Tooltip.tsx +4 -2
  182. package/src/primitives/Typography.tsx +11 -2
  183. package/src/primitives/button-variants.ts +1 -1
  184. package/src/primitives/sortable-core.ts +139 -0
  185. package/src/primitives/sortable-drag.ts +75 -0
  186. package/src/sortable.ts +6 -0
  187. package/src/styles/ai.css +57 -0
  188. package/src/styles/core.css +321 -0
  189. package/src/styles/forms.css +261 -0
  190. package/src/styles/navigation.css +137 -0
  191. package/src/styles/overlays.css +104 -0
  192. package/src/styles/sortable.css +87 -0
  193. package/src/styles.css +5 -658
  194. package/src/theme/ThemeProvider.tsx +20 -8
  195. package/src/theme/messages.ts +20 -1
  196. package/src/theme/script.ts +2 -2
  197. package/src/theme/state.ts +5 -5
  198. package/src/utils/auto-resize.ts +58 -0
  199. package/src/utils/change-motion.ts +28 -0
  200. package/src/utils/media-query.ts +26 -0
  201. package/src/utils/shortcut-registry.ts +19 -2
  202. package/src/vite.ts +3 -3
  203. package/vendor/integrity.json +13 -13
  204. package/vendor/kobalte-core/chunk/3D6FM2PJ.js +7 -1
  205. package/vendor/kobalte-core/chunk/G3KI2B4X.js +2 -1
  206. package/vendor/kobalte-core/chunk/KEL2LLJM.jsx +2 -1
  207. package/vendor/kobalte-core/chunk/RFN6X5VH.jsx +7 -1
  208. package/vendor/origins.json +4 -4
  209. package/vendor/solid-web/dev.cjs +21 -17
  210. package/vendor/solid-web/dev.js +21 -17
  211. package/vendor/solid-web/server.cjs +1 -1
  212. package/vendor/solid-web/server.js +1 -1
  213. package/vendor/solid-web/web.cjs +21 -17
  214. package/vendor/solid-web/web.js +21 -17
@@ -6,7 +6,7 @@ import { createComponent as s, insert as c, mergeProps as l, template as u } fro
6
6
  import { For as d, Show as f, createEffect as p, createMemo as m, createSignal as h, createUniqueId as g, onCleanup as _, splitProps as v } from "solid-js";
7
7
  import * as y from "#sheen-kobalte/dialog";
8
8
  import { Command as b } from "#sheen-cmdk";
9
- //#region src/primitives/CommandPalette.tsx
9
+ // src/primitives/CommandPalette.tsx
10
10
  var x = /*#__PURE__*/ u("<span>"), S = /*#__PURE__*/ u("<div role=alert>");
11
11
  function C(e, t) {
12
12
  let n = e.trim();
@@ -96,7 +96,7 @@ function O(u) {
96
96
  }
97
97
  }), _(() => r.abort());
98
98
  });
99
- let q = m(() => T.bindings().filter((e) => !e.shadowed).map((e) => Object.freeze({
99
+ let q = m(() => T.bindings().filter((e) => !e.shadowed && (e.keys !== "mod+k" || e.label !== C.messages().openCommandPalette)).map((e) => Object.freeze({
100
100
  id: `shortcut:${e.id}`,
101
101
  label: e.label,
102
102
  group: e.group,
@@ -105,7 +105,6 @@ function O(u) {
105
105
  e.displayKeys,
106
106
  e.scope
107
107
  ],
108
- disabled: e.keys === "mod+k" && e.label === C.messages().openCommandPalette,
109
108
  run: () => {
110
109
  T.run(e.id);
111
110
  }
@@ -315,5 +314,4 @@ function O(u) {
315
314
  }
316
315
  });
317
316
  }
318
- //#endregion
319
317
  export { O as CommandPalette, E as commandPaletteFilter };
@@ -1,11 +1,11 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
1
+ import { AlertDialog as e } from "./AlertDialog.js";
2
2
  import { Button as t } from "./Button.js";
3
- import { AlertDialog as n } from "./AlertDialog.js";
3
+ import { useTheme as n } from "../theme/ThemeProvider.js";
4
4
  import { createComponent as r, mergeProps as i } from "solid-js/web";
5
- //#region src/primitives/ConfirmDialog.tsx
5
+ // src/primitives/ConfirmDialog.tsx
6
6
  function a(a) {
7
- let o = e();
8
- return r(n, i({
7
+ let o = n();
8
+ return r(e, i({
9
9
  get title() {
10
10
  return a.title;
11
11
  },
@@ -38,5 +38,4 @@ function a(a) {
38
38
  }
39
39
  }));
40
40
  }
41
- //#endregion
42
41
  export { a as ConfirmDialog };
@@ -1,13 +1,13 @@
1
1
  import { useTheme as e } from "../theme/ThemeProvider.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
- import { useShortcutKeyboardOwner as n } from "./ShortcutProvider.js";
4
- import { createMenuFocusRecovery as r } from "./menu-focus.js";
5
- import { MenuItems as i, validateMenuTree as a } from "./DropdownMenu.js";
3
+ import { MenuItems as n, validateMenuTree as r } from "./DropdownMenu.js";
4
+ import { createMenuFocusRecovery as i } from "./menu-focus.js";
5
+ import { useShortcutKeyboardOwner as a } from "./ShortcutProvider.js";
6
6
  import { createComponent as o, memo as s, mergeProps as c } from "solid-js/web";
7
7
  import { Show as l, createEffect as u, createMemo as d, createSignal as f, createUniqueId as p, onCleanup as m, splitProps as h } from "solid-js";
8
8
  import { MenuContent as g, MenuPortal as _, MenuRoot as v } from "#sheen-kobalte/menu";
9
9
  import { Polymorphic as y } from "#sheen-kobalte/polymorphic";
10
- //#region src/primitives/ContextMenu.tsx
10
+ // src/primitives/ContextMenu.tsx
11
11
  function b(e, t) {
12
12
  typeof e == "function" ? e(t) : Array.isArray(e) && typeof e[0] == "function" && e[0](e[1], t);
13
13
  }
@@ -19,13 +19,13 @@ function x(x) {
19
19
  "onOpenChange",
20
20
  "menuClass",
21
21
  "children"
22
- ]), E = d(() => (a(w.items), w.items)), D = () => w.disabled === !0 || E().length === 0, [O, k] = f(!1), [A, j] = f({
22
+ ]), E = d(() => (r(w.items), w.items)), D = () => w.disabled === !0 || E().length === 0, [O, k] = f(!1), [A, j] = f({
23
23
  x: 0,
24
24
  y: 0
25
25
  }), M = (e) => {
26
26
  e === O() || e && D() || (k(e), w.onOpenChange?.(e));
27
27
  }, [N, P] = f();
28
- n(N, O), r(N, O), u(() => {
28
+ a(N, O), i(N, O), u(() => {
29
29
  O() && m(S.layers.register(C));
30
30
  });
31
31
  let F = d((e) => O() ? S.layers.zIndex(C) : e ?? 100), I = () => T.id ?? `${C}-trigger`;
@@ -117,7 +117,7 @@ function x(x) {
117
117
  S.layers.isTop(C) ? L() : e.preventDefault();
118
118
  },
119
119
  get children() {
120
- return o(i, { get items() {
120
+ return o(n, { get items() {
121
121
  return E();
122
122
  } });
123
123
  }
@@ -128,5 +128,4 @@ function x(x) {
128
128
  }
129
129
  });
130
130
  }
131
- //#endregion
132
131
  export { x as ContextMenu };
@@ -0,0 +1,17 @@
1
+ import type { Accessor, JSX } from "solid-js";
2
+ export interface ConversationItem {
3
+ readonly id: string;
4
+ }
5
+ export type ConversationProps<Item extends ConversationItem> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "ref" | "role"> & {
6
+ ref?: HTMLDivElement | ((element: HTMLDivElement) => void);
7
+ items: readonly Item[];
8
+ children: (item: Accessor<Item>) => JSX.Element;
9
+ label?: string;
10
+ stickToBottom?: boolean;
11
+ jumpLabel?: string;
12
+ };
13
+ /**
14
+ * A scrolling message log keyed by stable item IDs. Existing message nodes survive appends and content updates.
15
+ * While the reader is at the end, growth keeps the newest content in view; scrolling away stops that until they return.
16
+ */
17
+ export declare function Conversation<Item extends ConversationItem>(props: ConversationProps<Item>): JSX.Element;
@@ -0,0 +1,107 @@
1
+ import { Button as e } from "./Button.js";
2
+ import { useTheme as t } from "../theme/ThemeProvider.js";
3
+ import { cn as n } from "../utils/cn.js";
4
+ import { createComponent as r, effect as i, insert as a, memo as o, mergeProps as s, setAttribute as c, spread as l, style as u, template as d, use as f } from "solid-js/web";
5
+ import { For as p, Show as m, createMemo as h, createSignal as g, onCleanup as _, onMount as v, splitProps as y } from "solid-js";
6
+ // src/primitives/Conversation.tsx
7
+ var b = /*#__PURE__*/ d("<div><div class=sheen-conversation-scroller role=log tabindex=0><div class=sheen-conversation-content>"), x = /*#__PURE__*/ d("<div class=sheen-conversation-item>"), S = 4, C = 6;
8
+ function w(d) {
9
+ let w = t(), [T, E] = y(d, [
10
+ "ref",
11
+ "items",
12
+ "children",
13
+ "label",
14
+ "stickToBottom",
15
+ "jumpLabel",
16
+ "class"
17
+ ]), D = h(() => {
18
+ let e = /* @__PURE__ */ new Map();
19
+ for (let t of T.items) {
20
+ if (!t.id) throw Error("Conversation: item ids must be nonempty");
21
+ if (e.has(t.id)) throw Error(`Conversation: duplicate item id "${t.id}"`);
22
+ e.set(t.id, t);
23
+ }
24
+ return e;
25
+ }), O = h(() => [...D().keys()]), [k, A] = g(!0), j = () => T.stickToBottom !== !1, M, N, P = !1, F = 0, I = !1, L = 0, R = (e) => e.scrollHeight - e.scrollTop - e.clientHeight <= S, z = () => {
26
+ M && (M.scrollTop = M.scrollHeight, L = M.scrollTop);
27
+ }, B = (e) => {
28
+ let t = e.scrollTop;
29
+ t < L - S ? A(!1) : R(e) && A(!0), L = t;
30
+ };
31
+ v(() => {
32
+ if (P = !0, !M || !N) return;
33
+ let e = M;
34
+ j() && z(), A(R(e)), L = e.scrollTop;
35
+ let t = new ResizeObserver(() => {
36
+ j() && k() ? z() : (L = e.scrollTop, A(R(e)));
37
+ });
38
+ t.observe(N), t.observe(e), _(() => t.disconnect());
39
+ });
40
+ let V = () => {
41
+ if (P) return I || (I = !0, queueMicrotask(() => {
42
+ F = 0, I = !1;
43
+ })), Math.min(F++, C);
44
+ };
45
+ return (() => {
46
+ var t = b(), d = t.firstChild, h = d.firstChild;
47
+ f((e) => {
48
+ typeof T.ref == "function" && T.ref(e);
49
+ }, t), l(t, s(E, {
50
+ get class() {
51
+ return n("sheen-conversation", T.class);
52
+ },
53
+ get "data-stuck"() {
54
+ return k() || void 0;
55
+ }
56
+ }), !1, !0), d.addEventListener("wheel", (e) => {
57
+ let t = e.currentTarget;
58
+ e.deltaY < 0 && t.scrollTop > 0 && A(!1);
59
+ }), d.addEventListener("scroll", (e) => B(e.currentTarget));
60
+ var _ = M;
61
+ typeof _ == "function" ? f(_, d) : M = d;
62
+ var v = N;
63
+ return typeof v == "function" ? f(v, h) : N = h, a(h, r(p, {
64
+ get each() {
65
+ return O();
66
+ },
67
+ children: (e) => {
68
+ let t = V(), [n, o] = g(t !== void 0);
69
+ return r(m, {
70
+ get when() {
71
+ return D().get(e);
72
+ },
73
+ children: (r) => (() => {
74
+ var s = x();
75
+ return s.addEventListener("animationend", (e) => {
76
+ e.target === e.currentTarget && o(!1);
77
+ }), c(s, "data-id", e), a(s, () => T.children(r)), i((e) => {
78
+ var r = n() || void 0, i = t === void 0 ? void 0 : { "--sheen-conversation-stagger": String(t) };
79
+ return r !== e.e && c(s, "data-entering", e.e = r), e.t = u(s, i, e.t), e;
80
+ }, {
81
+ e: void 0,
82
+ t: void 0
83
+ }), s;
84
+ })()
85
+ });
86
+ }
87
+ })), a(t, r(m, {
88
+ get when() {
89
+ return o(() => !!j())() && !k();
90
+ },
91
+ get children() {
92
+ return r(e, {
93
+ class: "sheen-conversation-jump",
94
+ variant: "outline",
95
+ size: "sm",
96
+ onClick: () => {
97
+ z(), A(!0), M?.focus({ preventScroll: !0 });
98
+ },
99
+ get children() {
100
+ return T.jumpLabel ?? w.messages().jumpToLatest;
101
+ }
102
+ });
103
+ }
104
+ }), null), i(() => c(d, "aria-label", T.label ?? w.messages().conversation)), t;
105
+ })();
106
+ }
107
+ export { w as Conversation };
@@ -1,7 +1,7 @@
1
1
  import { cn as e } from "../utils/cn.js";
2
2
  import { mergeProps as t, spread as n, template as r } from "solid-js/web";
3
3
  import { splitProps as i } from "solid-js";
4
- //#region src/primitives/DescriptionList.tsx
4
+ // src/primitives/DescriptionList.tsx
5
5
  var a = /*#__PURE__*/ r("<dl>"), o = /*#__PURE__*/ r("<dt>"), s = /*#__PURE__*/ r("<dd>");
6
6
  function c(r) {
7
7
  let [o, s] = i(r, ["class", "layout"]);
@@ -40,5 +40,4 @@ function u(r) {
40
40
  }), !1, !1), r;
41
41
  })();
42
42
  }
43
- //#endregion
44
43
  export { u as DescriptionDetails, c as DescriptionList, l as DescriptionTerm };
@@ -1,130 +1,164 @@
1
1
  import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { cn as t } from "../utils/cn.js";
2
+ import { Button as t } from "./Button.js";
3
3
  import { buttonVariants as n } from "./button-variants.js";
4
- import { useModalShortcutScope as r } from "./ShortcutProvider.js";
5
- import { Button as i } from "./Button.js";
6
- import { createComponent as a, insert as o, mergeProps as s, template as c } from "solid-js/web";
7
- import { Show as l, createEffect as u, createMemo as d, createSignal as f, createUniqueId as p, onCleanup as m } from "solid-js";
8
- import * as h from "#sheen-kobalte/dialog";
9
- //#region src/primitives/Dialog.tsx
10
- var g = /*#__PURE__*/ c("<div class=sheen-dialog-header>"), _ = /*#__PURE__*/ c("<div class=sheen-dialog-body>"), v = /*#__PURE__*/ c("<div class=sheen-dialog-footer>");
11
- function y(c) {
12
- let y = e(), [b, x] = f(c.defaultOpen ?? !1), S = () => c.open === void 0 ? b() : c.open, C = () => c.dismissible ?? !0, w = (e) => {
13
- (e || C()) && e !== S() && (c.open === void 0 && x(e), c.onOpenChange?.(e));
14
- }, T = p();
15
- r(() => c.shortcutScope ?? `dialog:${T}`, S);
16
- let E, D;
17
- u(() => {
18
- S() && m(y.layers.register(T));
4
+ import { cn as r } from "../utils/cn.js";
5
+ import { Glyph as i } from "./Glyph.js";
6
+ import { useModalShortcutScope as a } from "./ShortcutProvider.js";
7
+ import { createComponent as o, insert as s, mergeProps as c, template as l } from "solid-js/web";
8
+ import { Show as u, createEffect as d, createMemo as f, createSignal as p, createUniqueId as m, onCleanup as h } from "solid-js";
9
+ import * as g from "#sheen-kobalte/dialog";
10
+ // src/primitives/Dialog.tsx
11
+ var _ = /*#__PURE__*/ l("<div class=sheen-dialog-header>"), v = /*#__PURE__*/ l("<div class=sheen-dialog-body>"), y = /*#__PURE__*/ l("<div class=sheen-dialog-footer>");
12
+ function b(l) {
13
+ let b = e(), [x, S] = p(l.defaultOpen ?? !1), C = () => l.open === void 0 ? x() : l.open, w = () => l.dismissible ?? !0, T = (e) => {
14
+ (e || w()) && e !== C() && (l.open === void 0 && S(e), l.onOpenChange?.(e));
15
+ }, E = m();
16
+ a(() => l.shortcutScope ?? `dialog:${E}`, C);
17
+ let D, O, k = () => !!l.alert || l.closeLabel !== void 0;
18
+ d(() => {
19
+ C() && h(b.layers.register(E));
19
20
  });
20
- let O = d((e) => S() ? y.layers.zIndex(T) : e ?? 100);
21
- return a(h.Root, {
21
+ let A = f((e) => C() ? b.layers.zIndex(E) : e ?? 100);
22
+ return o(g.Root, {
22
23
  get open() {
23
- return S();
24
+ return C();
24
25
  },
25
- onOpenChange: w,
26
+ onOpenChange: T,
26
27
  get children() {
27
- return [a(l, {
28
+ return [o(u, {
28
29
  get when() {
29
- return c.trigger;
30
+ return l.trigger;
30
31
  },
31
32
  get children() {
32
- return a(h.Trigger, {
33
+ return o(g.Trigger, {
33
34
  get class() {
34
35
  return n({ variant: "outline" });
35
36
  },
36
37
  "data-variant": "outline",
37
38
  get children() {
38
- return c.trigger;
39
+ return l.trigger;
39
40
  }
40
41
  });
41
42
  }
42
- }), a(l, {
43
+ }), o(u, {
43
44
  get when() {
44
- return y.portal();
45
+ return b.portal();
45
46
  },
46
- children: (e) => a(h.Portal, {
47
+ children: (e) => o(g.Portal, {
47
48
  get mount() {
48
49
  return e();
49
50
  },
50
51
  get children() {
51
- return [a(h.Overlay, {
52
+ return [o(g.Overlay, {
52
53
  class: "sheen-dialog-overlay",
53
54
  get style() {
54
- return { "z-index": O() };
55
+ return { "z-index": A() };
55
56
  }
56
- }), a(h.Content, s(() => c.contentId === void 0 ? {} : { id: c.contentId }, {
57
+ }), o(g.Content, c(() => l.contentId === void 0 ? {} : { id: l.contentId }, {
57
58
  ref: (e) => {
58
- E = e;
59
+ D = e;
59
60
  },
60
61
  get role() {
61
- return c.alert ? "alertdialog" : "dialog";
62
+ return l.alert ? "alertdialog" : "dialog";
62
63
  },
63
64
  get "aria-hidden"() {
64
- return !S() || void 0;
65
+ return !C() || void 0;
65
66
  },
66
67
  get inert() {
67
- return !S();
68
+ return !C();
68
69
  },
69
70
  get class() {
70
- return t("sheen-dialog", c.class);
71
+ return r("sheen-dialog", l.class);
71
72
  },
72
73
  get style() {
73
- return { "z-index": O() + 1 };
74
+ return { "z-index": A() + 1 };
74
75
  },
75
76
  onEscapeKeyDown: (e) => {
76
- (!y.layers.isTop(T) || !C()) && e.preventDefault();
77
+ b.layers.isTop(E) && w() || e.preventDefault();
77
78
  },
78
79
  onPointerDownOutside: (e) => {
79
- (c.alert || !C() || !y.layers.isTop(T)) && e.preventDefault();
80
+ !l.alert && w() && b.layers.isTop(E) || e.preventDefault();
80
81
  },
81
82
  onOpenAutoFocus: (e) => {
82
- let t = c.initialFocus?.() ?? (c.alert ? D : void 0);
83
- t?.isConnected && E?.contains(t) && !t.matches(":disabled,[inert]") && (t.focus({ preventScroll: !0 }), t.ownerDocument.activeElement === t && e.preventDefault());
83
+ let t = l.initialFocus?.() ?? (l.alert ? O : void 0);
84
+ t?.isConnected && D?.contains(t) && !t.matches(":disabled,[inert]") && (t.focus({ preventScroll: !0 }), t.ownerDocument.activeElement === t && e.preventDefault());
84
85
  },
85
86
  onCloseAutoFocus: (e) => {
86
- let t = c.returnFocus?.();
87
+ let t = l.returnFocus?.();
87
88
  t?.isConnected && !t.matches(":disabled,[inert]") && (t.focus({ preventScroll: !0 }), t.ownerDocument.activeElement === t && e.preventDefault());
88
89
  },
89
90
  get children() {
90
91
  return [
91
92
  (() => {
92
- var e = g();
93
- return o(e, a(h.Title, { get children() {
94
- return c.title;
95
- } }), null), o(e, a(l, {
93
+ var e = _();
94
+ return s(e, o(g.Title, { get children() {
95
+ return l.title;
96
+ } }), null), s(e, o(u, {
96
97
  get when() {
97
- return c.description;
98
+ return l.description;
98
99
  },
99
100
  get children() {
100
- return a(h.Description, { get children() {
101
- return c.description;
101
+ return o(g.Description, { get children() {
102
+ return l.description;
102
103
  } });
103
104
  }
104
105
  }), null), e;
105
106
  })(),
106
107
  (() => {
107
- var e = _();
108
- return o(e, () => c.children), e;
108
+ var e = v();
109
+ return s(e, () => l.children), e;
109
110
  })(),
110
111
  (() => {
111
- var e = v();
112
- return o(e, a(h.CloseButton, {
113
- as: i,
114
- ref: (e) => {
115
- D = e;
116
- },
117
- get disabled() {
118
- return !C();
119
- },
120
- get "aria-label"() {
121
- return c.closeLabel ?? y.messages().close;
112
+ var e = y();
113
+ return s(e, o(u, {
114
+ get when() {
115
+ return k();
122
116
  },
123
117
  get children() {
124
- return c.closeLabel ?? y.messages().close;
118
+ return o(g.CloseButton, {
119
+ as: t,
120
+ variant: "ghost",
121
+ ref: (e) => {
122
+ O = e;
123
+ },
124
+ get disabled() {
125
+ return !w();
126
+ },
127
+ get "aria-label"() {
128
+ return l.closeLabel ?? b.messages().close;
129
+ },
130
+ get children() {
131
+ return l.closeLabel ?? b.messages().close;
132
+ }
133
+ });
125
134
  }
126
- }), null), o(e, () => c.footer, null), e;
127
- })()
135
+ }), null), s(e, () => l.footer, null), e;
136
+ })(),
137
+ o(u, {
138
+ get when() {
139
+ return !k();
140
+ },
141
+ get children() {
142
+ return o(g.CloseButton, {
143
+ as: t,
144
+ variant: "ghost",
145
+ class: "sheen-dialog-close",
146
+ size: "sm",
147
+ ref: (e) => {
148
+ O = e;
149
+ },
150
+ get disabled() {
151
+ return !w();
152
+ },
153
+ get "aria-label"() {
154
+ return b.messages().close;
155
+ },
156
+ get children() {
157
+ return o(i, { name: "close" });
158
+ }
159
+ });
160
+ }
161
+ })
128
162
  ];
129
163
  }
130
164
  }))];
@@ -134,8 +168,7 @@ function y(c) {
134
168
  }
135
169
  });
136
170
  }
137
- function b(e) {
138
- return a(y, e);
171
+ function x(e) {
172
+ return o(b, e);
139
173
  }
140
- //#endregion
141
- export { b as Dialog, y as ModalFrame };
174
+ export { x as Dialog, b as ModalFrame };
@@ -1,21 +1,20 @@
1
- import { cn as e } from "../utils/cn.js";
2
- import { ModalFrame as t } from "./Dialog.js";
1
+ import { ModalFrame as e } from "./Dialog.js";
2
+ import { cn as t } from "../utils/cn.js";
3
3
  import { createComponent as n, mergeProps as r } from "solid-js/web";
4
- //#region src/primitives/Drawer.tsx
5
- function i(t, n) {
4
+ // src/primitives/Drawer.tsx
5
+ function i(e, n) {
6
6
  let r = n.side ?? "end";
7
- if (r !== "start" && r !== "end") throw Error(`${t} side must be start or end`);
8
- return e("sheen-drawer", `sheen-drawer-${r}`, `sheen-${t}`, n.class);
7
+ if (r !== "start" && r !== "end") throw Error(`${e} side must be start or end`);
8
+ return t("sheen-drawer", `sheen-drawer-${r}`, `sheen-${e}`, n.class);
9
9
  }
10
- function a(e) {
11
- return n(t, r(e, { get class() {
12
- return i("drawer", e);
10
+ function a(t) {
11
+ return n(e, r(t, { get class() {
12
+ return i("drawer", t);
13
13
  } }));
14
14
  }
15
- function o(e) {
16
- return n(t, r(e, { get class() {
17
- return i("sheet", e);
15
+ function o(t) {
16
+ return n(e, r(t, { get class() {
17
+ return i("sheet", t);
18
18
  } }));
19
19
  }
20
- //#endregion
21
20
  export { a as Drawer, o as Sheet };