@gemologic/sheen 0.2.1 → 0.4.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 (226) 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 +27 -5
  11. package/dist/index.js +87 -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/overlays.d.ts +2 -0
  17. package/dist/overlays.js +9 -8
  18. package/dist/primitives/Accordion.js +9 -9
  19. package/dist/primitives/ActivityTimeline.js +57 -49
  20. package/dist/primitives/AlertDialog.js +1 -2
  21. package/dist/primitives/Avatar.js +16 -17
  22. package/dist/primitives/Board.d.ts +39 -0
  23. package/dist/primitives/Board.js +471 -0
  24. package/dist/primitives/Breadcrumb.js +1 -2
  25. package/dist/primitives/Button.js +38 -27
  26. package/dist/primitives/ButtonGroup.js +1 -2
  27. package/dist/primitives/Checkbox.d.ts +16 -2
  28. package/dist/primitives/Checkbox.js +46 -36
  29. package/dist/primitives/CheckboxGroup.js +11 -12
  30. package/dist/primitives/Collapsible.js +6 -6
  31. package/dist/primitives/Combobox.js +203 -201
  32. package/dist/primitives/CommandPalette.d.ts +4 -0
  33. package/dist/primitives/CommandPalette.js +138 -116
  34. package/dist/primitives/ConfirmDialog.js +5 -6
  35. package/dist/primitives/ContextMenu.js +7 -8
  36. package/dist/primitives/Conversation.d.ts +17 -0
  37. package/dist/primitives/Conversation.js +107 -0
  38. package/dist/primitives/DescriptionList.js +1 -2
  39. package/dist/primitives/Dialog.js +101 -68
  40. package/dist/primitives/Drawer.js +12 -13
  41. package/dist/primitives/DropdownMenu.js +163 -157
  42. package/dist/primitives/EditableTextField.js +3 -8
  43. package/dist/primitives/EmptyState.js +1 -2
  44. package/dist/primitives/Field.js +1 -2
  45. package/dist/primitives/FileDropzone.js +19 -18
  46. package/dist/primitives/Form.d.ts +23 -0
  47. package/dist/primitives/Form.js +76 -0
  48. package/dist/primitives/Glyph.d.ts +40 -0
  49. package/dist/primitives/Glyph.js +65 -0
  50. package/dist/primitives/IconButton.js +5 -6
  51. package/dist/primitives/Input.js +1 -2
  52. package/dist/primitives/InputGroup.js +8 -9
  53. package/dist/primitives/Link.d.ts +9 -1
  54. package/dist/primitives/Link.js +23 -17
  55. package/dist/primitives/LinkTooltip.js +6 -7
  56. package/dist/primitives/List.d.ts +34 -0
  57. package/dist/primitives/List.js +135 -0
  58. package/dist/primitives/Message.d.ts +13 -0
  59. package/dist/primitives/Message.js +75 -0
  60. package/dist/primitives/NavList.js +15 -16
  61. package/dist/primitives/Notice.d.ts +15 -1
  62. package/dist/primitives/Notice.js +91 -43
  63. package/dist/primitives/NumberField.js +81 -81
  64. package/dist/primitives/NumberText.d.ts +4 -0
  65. package/dist/primitives/NumberText.js +50 -25
  66. package/dist/primitives/Pagination.js +81 -60
  67. package/dist/primitives/Popover.d.ts +1 -0
  68. package/dist/primitives/Popover.js +65 -57
  69. package/dist/primitives/Progress.js +1 -2
  70. package/dist/primitives/PromptInput.d.ts +23 -0
  71. package/dist/primitives/PromptInput.js +135 -0
  72. package/dist/primitives/RadioGroup.js +12 -17
  73. package/dist/primitives/Resizable.js +1 -2
  74. package/dist/primitives/ScrollArea.js +1 -2
  75. package/dist/primitives/SearchInput.js +45 -38
  76. package/dist/primitives/SegmentedControl.d.ts +2 -0
  77. package/dist/primitives/SegmentedControl.js +92 -78
  78. package/dist/primitives/Select.js +105 -100
  79. package/dist/primitives/Separator.js +1 -2
  80. package/dist/primitives/ShortcutPending.js +11 -12
  81. package/dist/primitives/ShortcutProvider.d.ts +5 -0
  82. package/dist/primitives/ShortcutProvider.js +71 -65
  83. package/dist/primitives/ShortcutScope.js +8 -9
  84. package/dist/primitives/ShortcutSheet.js +30 -24
  85. package/dist/primitives/Skeleton.js +1 -2
  86. package/dist/primitives/Slider.js +1 -2
  87. package/dist/primitives/SortableList.d.ts +19 -0
  88. package/dist/primitives/SortableList.js +235 -0
  89. package/dist/primitives/Spinner.js +1 -2
  90. package/dist/primitives/Status.js +14 -14
  91. package/dist/primitives/Stepper.js +54 -52
  92. package/dist/primitives/StreamingText.d.ts +12 -0
  93. package/dist/primitives/StreamingText.js +42 -0
  94. package/dist/primitives/Surface.js +1 -2
  95. package/dist/primitives/Switch.d.ts +2 -2
  96. package/dist/primitives/Switch.js +1 -2
  97. package/dist/primitives/Table.js +1 -2
  98. package/dist/primitives/Tabs.js +20 -17
  99. package/dist/primitives/TagInput.js +6 -9
  100. package/dist/primitives/Textarea.js +37 -63
  101. package/dist/primitives/Toast.js +42 -41
  102. package/dist/primitives/Toaster.js +27 -28
  103. package/dist/primitives/Tooltip.js +32 -32
  104. package/dist/primitives/TooltipTrigger.d.ts +18 -0
  105. package/dist/primitives/TooltipTrigger.js +76 -0
  106. package/dist/primitives/Tree.js +1 -2
  107. package/dist/primitives/Typography.d.ts +6 -2
  108. package/dist/primitives/Typography.js +20 -12
  109. package/dist/primitives/boolean-input-state.js +3 -8
  110. package/dist/primitives/button-variants.js +2 -3
  111. package/dist/primitives/choice-options.js +1 -2
  112. package/dist/primitives/create-confirm.js +1 -2
  113. package/dist/primitives/create-toaster.js +1 -2
  114. package/dist/primitives/link-focus.js +1 -2
  115. package/dist/primitives/menu-focus.js +1 -2
  116. package/dist/primitives/sortable-core.d.ts +70 -0
  117. package/dist/primitives/sortable-core.js +109 -0
  118. package/dist/primitives/sortable-drag.d.ts +29 -0
  119. package/dist/primitives/sortable-drag.js +50 -0
  120. package/dist/primitives/tooltip-layer.js +26 -27
  121. package/dist/sortable.d.ts +6 -0
  122. package/dist/sortable.js +4 -0
  123. package/dist/theme/ThemeProvider.d.ts +6 -1
  124. package/dist/theme/ThemeProvider.js +65 -58
  125. package/dist/theme/intl.js +1 -2
  126. package/dist/theme/keyboard-script.js +1 -2
  127. package/dist/theme/layers.js +1 -2
  128. package/dist/theme/messages.d.ts +26 -0
  129. package/dist/theme/messages.js +9 -2
  130. package/dist/theme/number-format-cache.js +1 -2
  131. package/dist/theme/script.d.ts +1 -0
  132. package/dist/theme/script.js +3 -3
  133. package/dist/theme/state.d.ts +4 -4
  134. package/dist/theme/state.js +12 -13
  135. package/dist/utils/auto-resize.d.ts +6 -0
  136. package/dist/utils/auto-resize.js +31 -0
  137. package/dist/utils/browser-status.js +1 -2
  138. package/dist/utils/change-motion.d.ts +8 -0
  139. package/dist/utils/change-motion.js +19 -0
  140. package/dist/utils/cn.js +1 -2
  141. package/dist/utils/media-query.d.ts +10 -0
  142. package/dist/utils/media-query.js +16 -0
  143. package/dist/utils/optimistic.js +1 -2
  144. package/dist/utils/shortcut-platform.js +1 -2
  145. package/dist/utils/shortcut-registry.d.ts +5 -0
  146. package/dist/utils/shortcut-registry.js +61 -51
  147. package/dist/vite.js +3 -4
  148. package/package.json +23 -5
  149. package/src/ai.ts +8 -0
  150. package/src/core.ts +11 -4
  151. package/src/forms.ts +2 -0
  152. package/src/index.ts +27 -5
  153. package/src/navigation.ts +2 -1
  154. package/src/overlays.ts +2 -0
  155. package/src/primitives/Accordion.tsx +1 -1
  156. package/src/primitives/ActivityTimeline.tsx +12 -7
  157. package/src/primitives/Board.tsx +406 -0
  158. package/src/primitives/Button.tsx +15 -4
  159. package/src/primitives/Checkbox.tsx +14 -7
  160. package/src/primitives/Collapsible.tsx +1 -1
  161. package/src/primitives/Combobox.tsx +2 -1
  162. package/src/primitives/CommandPalette.tsx +13 -4
  163. package/src/primitives/Conversation.tsx +108 -0
  164. package/src/primitives/Dialog.tsx +5 -1
  165. package/src/primitives/DropdownMenu.tsx +12 -6
  166. package/src/primitives/FileDropzone.tsx +2 -2
  167. package/src/primitives/Form.tsx +58 -0
  168. package/src/primitives/Glyph.tsx +55 -0
  169. package/src/primitives/Link.tsx +15 -6
  170. package/src/primitives/List.tsx +68 -0
  171. package/src/primitives/Message.tsx +40 -0
  172. package/src/primitives/Notice.tsx +45 -12
  173. package/src/primitives/NumberField.tsx +3 -2
  174. package/src/primitives/NumberText.tsx +31 -4
  175. package/src/primitives/Pagination.tsx +6 -5
  176. package/src/primitives/Popover.tsx +7 -5
  177. package/src/primitives/PromptInput.tsx +116 -0
  178. package/src/primitives/SearchInput.tsx +4 -3
  179. package/src/primitives/SegmentedControl.tsx +29 -4
  180. package/src/primitives/Select.tsx +3 -2
  181. package/src/primitives/ShortcutProvider.tsx +14 -1
  182. package/src/primitives/ShortcutSheet.tsx +1 -1
  183. package/src/primitives/SortableList.tsx +208 -0
  184. package/src/primitives/Status.tsx +1 -1
  185. package/src/primitives/Stepper.tsx +7 -7
  186. package/src/primitives/StreamingText.tsx +32 -0
  187. package/src/primitives/Switch.tsx +2 -2
  188. package/src/primitives/Tabs.tsx +2 -1
  189. package/src/primitives/TagInput.tsx +1 -1
  190. package/src/primitives/Textarea.tsx +3 -47
  191. package/src/primitives/Toast.tsx +2 -1
  192. package/src/primitives/Tooltip.tsx +4 -2
  193. package/src/primitives/TooltipTrigger.tsx +60 -0
  194. package/src/primitives/Typography.tsx +11 -2
  195. package/src/primitives/button-variants.ts +1 -1
  196. package/src/primitives/sortable-core.ts +139 -0
  197. package/src/primitives/sortable-drag.ts +75 -0
  198. package/src/sortable.ts +6 -0
  199. package/src/styles/ai.css +57 -0
  200. package/src/styles/core.css +321 -0
  201. package/src/styles/forms.css +263 -0
  202. package/src/styles/navigation.css +137 -0
  203. package/src/styles/overlays.css +107 -0
  204. package/src/styles/sortable.css +87 -0
  205. package/src/styles.css +5 -658
  206. package/src/theme/ThemeProvider.tsx +20 -8
  207. package/src/theme/messages.ts +20 -1
  208. package/src/theme/script.ts +2 -2
  209. package/src/theme/state.ts +5 -5
  210. package/src/utils/auto-resize.ts +58 -0
  211. package/src/utils/change-motion.ts +28 -0
  212. package/src/utils/media-query.ts +26 -0
  213. package/src/utils/shortcut-registry.ts +19 -2
  214. package/src/vite.ts +3 -3
  215. package/vendor/integrity.json +13 -13
  216. package/vendor/kobalte-core/chunk/3D6FM2PJ.js +7 -1
  217. package/vendor/kobalte-core/chunk/G3KI2B4X.js +2 -1
  218. package/vendor/kobalte-core/chunk/KEL2LLJM.jsx +2 -1
  219. package/vendor/kobalte-core/chunk/RFN6X5VH.jsx +7 -1
  220. package/vendor/origins.json +4 -4
  221. package/vendor/solid-web/dev.cjs +21 -17
  222. package/vendor/solid-web/dev.js +21 -17
  223. package/vendor/solid-web/server.cjs +1 -1
  224. package/vendor/solid-web/server.js +1 -1
  225. package/vendor/solid-web/web.cjs +21 -17
  226. package/vendor/solid-web/web.js +21 -17
@@ -1,9 +1,9 @@
1
- import { cn as e } from "../utils/cn.js";
2
- import { Button as t } from "./Button.js";
1
+ import { Button as e } from "./Button.js";
2
+ import { cn as t } from "../utils/cn.js";
3
3
  import { createComponent as n, effect as r, insert as i, memo as a, mergeProps as o, setAttribute as s, spread as c, template as l, use as u } from "solid-js/web";
4
4
  import { createContext as d, createEffect as f, createMemo as p, createSignal as m, createUniqueId as h, onCleanup as g, onMount as _, splitProps as v, useContext as y } from "solid-js";
5
5
  import * as b from "#sheen-kobalte/accordion";
6
- //#region src/primitives/Accordion.tsx
6
+ // src/primitives/Accordion.tsx
7
7
  var x = /*#__PURE__*/ l("<div>"), S = /*#__PURE__*/ l("<span class=sheen-collapsible-indicator aria-hidden=true>"), C = /*#__PURE__*/ l("<div class=sheen-collapsible-content><div class=sheen-collapsible-clip><div class=sheen-collapsible-body>"), w = d();
8
8
  function T(e) {
9
9
  let t = y(w), [n, r] = v(e, ["onKeyDown", "ref"]), i, a = (e) => [...e.querySelectorAll("[data-sheen-accordion-trigger]")].filter((t) => t.closest("[data-sheen-accordion]") === e);
@@ -77,8 +77,8 @@ function T(e) {
77
77
  }), !1, !1), e;
78
78
  })();
79
79
  }
80
- function E(t) {
81
- let [r, i] = v(t, [
80
+ function E(e) {
81
+ let [r, i] = v(e, [
82
82
  "value",
83
83
  "defaultValue",
84
84
  "onValueChange",
@@ -115,7 +115,7 @@ function E(t) {
115
115
  return r.id ?? `sheen-accordion-${a}`;
116
116
  },
117
117
  get class() {
118
- return e("sheen-accordion", r.class);
118
+ return t("sheen-accordion", r.class);
119
119
  },
120
120
  get value() {
121
121
  return l();
@@ -173,7 +173,7 @@ function D(c) {
173
173
  return m.disabled ?? !1;
174
174
  },
175
175
  get class() {
176
- return e("sheen-accordion-item", m.class);
176
+ return t("sheen-accordion-item", m.class);
177
177
  },
178
178
  get children() {
179
179
  return [n(b.Header, {
@@ -183,7 +183,8 @@ function D(c) {
183
183
  class: "sheen-accordion-heading",
184
184
  get children() {
185
185
  return n(b.Trigger, {
186
- as: t,
186
+ as: e,
187
+ variant: "ghost",
187
188
  ref(e) {
188
189
  var t = D;
189
190
  typeof t == "function" ? t(e) : D = e;
@@ -219,5 +220,4 @@ function D(c) {
219
220
  }
220
221
  }));
221
222
  }
222
- //#endregion
223
223
  export { E as Accordion, D as AccordionItem };
@@ -1,17 +1,18 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { createComponent as n, effect as r, insert as i, memo as a, mergeProps as o, setAttribute as s, spread as c, template as l, use as u } from "solid-js/web";
4
- import { For as d, Show as f, createMemo as p, splitProps as m } from "solid-js";
5
- //#region src/primitives/ActivityTimeline.tsx
6
- var h = /*#__PURE__*/ l("<ol>"), g = /*#__PURE__*/ l("<time>"), _ = /*#__PURE__*/ l("<li class=sheen-activity-timeline-item><span class=sheen-workflow-marker aria-hidden=true></span><article class=sheen-activity-timeline-content><header><strong></strong><span class=sheen-workflow-state>"), v = /*#__PURE__*/ l("<p>"), y = /*#__PURE__*/ l("<span class=sheen-activity-timeline-actor>");
7
- function b(e, t) {
1
+ import { Glyph as e } from "./Glyph.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, template as u, use as d } from "solid-js/web";
5
+ import { For as f, Show as p, createMemo as m, splitProps as h } from "solid-js";
6
+ // src/primitives/ActivityTimeline.tsx
7
+ var g = /*#__PURE__*/ u("<ol>"), _ = /*#__PURE__*/ u("<time>"), v = /*#__PURE__*/ u("<div class=sheen-activity-timeline-meta>"), y = /*#__PURE__*/ u("<li class=sheen-activity-timeline-item><span class=sheen-workflow-marker aria-hidden=true></span><article class=sheen-activity-timeline-content><header><strong></strong><span class=sheen-workflow-state>"), b = /*#__PURE__*/ u("<p>"), x = /*#__PURE__*/ u("<span class=sheen-activity-timeline-actor>");
8
+ function S(e, t) {
8
9
  return e === "completed" ? t.workflowCompleted : e === "current" ? t.workflowCurrent : e === "error" ? t.workflowError : t.workflowUpcoming;
9
10
  }
10
- function x(e) {
11
- return e === "completed" ? "✓" : e === "current" ? "●" : e === "error" ? "!" : "○";
11
+ function C(t) {
12
+ return t === "completed" ? r(e, { name: "check" }) : t === "current" ? r(e, { name: "dot" }) : t === "error" ? r(e, { name: "alert" }) : "";
12
13
  }
13
- function S(l) {
14
- let S = e(), [C, w] = m(l, [
14
+ function w(e) {
15
+ let u = t(), [w, T] = h(e, [
15
16
  "ref",
16
17
  "class",
17
18
  "label",
@@ -19,9 +20,9 @@ function S(l) {
19
20
  "density",
20
21
  "refreshing",
21
22
  "aria-label"
22
- ]), T = p(() => {
23
+ ]), E = m(() => {
23
24
  let e = /* @__PURE__ */ new Map();
24
- for (let t of C.items) {
25
+ for (let t of w.items) {
25
26
  if (!t.id.trim()) throw Error("ActivityTimeline: item IDs must be nonempty");
26
27
  if (e.has(t.id)) throw Error(`ActivityTimeline: duplicate item ID ${JSON.stringify(t.id)}`);
27
28
  if (!t.title.trim()) throw Error(`ActivityTimeline: title must be nonempty for ${JSON.stringify(t.id)}`);
@@ -29,76 +30,83 @@ function S(l) {
29
30
  e.set(t.id, t);
30
31
  }
31
32
  return e;
32
- }), E = p(() => [...T().keys()]);
33
+ }), D = m(() => [...E().keys()]);
33
34
  return (() => {
34
- var e = h();
35
- return u((e) => {
36
- typeof C.ref == "function" && C.ref(e);
37
- }, e), c(e, o(w, {
35
+ var e = g();
36
+ return d((e) => {
37
+ typeof w.ref == "function" && w.ref(e);
38
+ }, e), l(e, s(T, {
38
39
  get class() {
39
- return t("sheen-activity-timeline", C.class);
40
+ return n("sheen-activity-timeline", w.class);
40
41
  },
41
42
  get "aria-label"() {
42
- return C["aria-label"] ?? C.label;
43
+ return w["aria-label"] ?? w.label;
43
44
  },
44
45
  get "aria-busy"() {
45
- return C.refreshing || void 0;
46
+ return w.refreshing || void 0;
46
47
  },
47
48
  get "data-density"() {
48
- return C.density ?? "default";
49
+ return w.density ?? "default";
49
50
  },
50
51
  get "data-refreshing"() {
51
- return C.refreshing || void 0;
52
+ return w.refreshing || void 0;
52
53
  }
53
- }), !1, !0), i(e, n(d, {
54
+ }), !1, !0), a(e, r(f, {
54
55
  get each() {
55
- return E();
56
+ return D();
56
57
  },
57
58
  children: (e) => {
58
- let t = () => T().get(e);
59
- return n(f, {
59
+ let t = () => E().get(e);
60
+ return r(p, {
60
61
  get when() {
61
62
  return t();
62
63
  },
63
64
  children: (t) => (() => {
64
- var o = _(), c = o.firstChild, l = c.nextSibling, u = l.firstChild.firstChild, d = u.nextSibling;
65
- return s(o, "data-activity-id", e), i(c, () => x(t().state)), i(u, () => t().title), i(d, () => b(t().state, S.messages())), i(l, n(f, {
65
+ var n = y(), s = n.firstChild, l = s.nextSibling, d = l.firstChild.firstChild, f = d.nextSibling;
66
+ return c(n, "data-activity-id", e), a(s, () => C(t().state)), a(d, () => t().title), a(f, () => S(t().state, u.messages())), a(l, r(p, {
66
67
  get when() {
67
68
  return t().description;
68
69
  },
69
70
  children: (e) => (() => {
70
- var t = v();
71
- return i(t, e), t;
71
+ var t = b();
72
+ return a(t, e), t;
72
73
  })()
73
- }), null), i(l, n(f, {
74
+ }), null), a(l, r(p, {
74
75
  get when() {
75
- return t().actor;
76
- },
77
- children: (e) => (() => {
78
- var t = y();
79
- return i(t, e), t;
80
- })()
81
- }), null), i(l, n(f, {
82
- get when() {
83
- return a(() => !!t().timestamp)() && t().timeLabel;
76
+ return t().actor || t().timestamp && t().timeLabel;
84
77
  },
85
78
  get children() {
86
- var e = g();
87
- return i(e, () => t().timeLabel), r(() => s(e, "datetime", t().timestamp)), e;
79
+ var e = v();
80
+ return a(e, r(p, {
81
+ get when() {
82
+ return t().actor;
83
+ },
84
+ children: (e) => (() => {
85
+ var t = x();
86
+ return a(t, e), t;
87
+ })()
88
+ }), null), a(e, r(p, {
89
+ get when() {
90
+ return o(() => !!t().timestamp)() && t().timeLabel;
91
+ },
92
+ get children() {
93
+ var e = _();
94
+ return a(e, () => t().timeLabel), i(() => c(e, "datetime", t().timestamp)), e;
95
+ }
96
+ }), null), e;
88
97
  }
89
- }), null), r((e) => {
90
- var n = t().state, r = t().state === "current" ? "true" : void 0, i = t().state;
91
- return n !== e.e && s(o, "data-state", e.e = n), r !== e.t && s(o, "aria-current", e.t = r), i !== e.a && s(c, "data-state", e.a = i), e;
98
+ }), null), i((e) => {
99
+ var r = t().state, i = t().state === "current" ? "true" : void 0, a = t().state;
100
+ return r !== e.e && c(n, "data-state", e.e = r), i !== e.t && c(n, "aria-current", e.t = i), a !== e.a && c(s, "data-state", e.a = a), e;
92
101
  }, {
93
102
  e: void 0,
94
103
  t: void 0,
95
104
  a: void 0
96
- }), o;
105
+ }), n;
97
106
  })()
98
107
  });
99
108
  }
100
109
  })), e;
101
110
  })();
102
111
  }
103
- //#endregion
104
- export { S as ActivityTimeline };
112
+ export { w as ActivityTimeline };
@@ -1,8 +1,7 @@
1
1
  import { ModalFrame as e } from "./Dialog.js";
2
2
  import { createComponent as t, mergeProps as n } from "solid-js/web";
3
- //#region src/primitives/AlertDialog.tsx
3
+ // src/primitives/AlertDialog.tsx
4
4
  function r(r) {
5
5
  return t(e, n(r, { alert: !0 }));
6
6
  }
7
- //#endregion
8
7
  export { r as AlertDialog };
@@ -1,9 +1,9 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { useNumberFormatter as n } from "../theme/intl.js";
1
+ import { useNumberFormatter as e } from "../theme/intl.js";
2
+ import { useTheme as t } from "../theme/ThemeProvider.js";
3
+ import { cn as n } from "../utils/cn.js";
4
4
  import { createComponent as r, effect as i, insert as a, memo as o, mergeProps as s, setAttribute as c, spread as l, template as u, use as d } from "solid-js/web";
5
5
  import { For as f, Show as p, createEffect as m, createMemo as h, createSignal as g, on as _, onMount as v, splitProps as y } from "solid-js";
6
- //#region src/primitives/Avatar.tsx
6
+ // src/primitives/Avatar.tsx
7
7
  var b = /*#__PURE__*/ u("<img class=sheen-avatar-image alt>"), x = /*#__PURE__*/ u("<span><span class=sheen-avatar-fallback aria-hidden=true>"), S = /*#__PURE__*/ u("<div>"), C = /*#__PURE__*/ u("<span class=\"sheen-avatar sheen-avatar-overflow\">+");
8
8
  function w(e, t) {
9
9
  if (t !== void 0) {
@@ -13,45 +13,45 @@ function w(e, t) {
13
13
  return e.trim().split(/\s+/u).slice(0, 2).map((e) => Array.from(e)[0] ?? "").join("").toUpperCase();
14
14
  }
15
15
  function T(e) {
16
- let [n, u] = y(e, [
16
+ let [t, u] = y(e, [
17
17
  "label",
18
18
  "src",
19
19
  "fallback",
20
20
  "size",
21
21
  "class"
22
22
  ]);
23
- if (!n.label?.trim()) throw Error("Avatar requires a nonempty label");
23
+ if (!t.label?.trim()) throw Error("Avatar requires a nonempty label");
24
24
  let f = () => {
25
- let e = n.size ?? "md";
25
+ let e = t.size ?? "md";
26
26
  if (e !== "sm" && e !== "md" && e !== "lg") throw Error("Avatar size is invalid");
27
27
  return e;
28
28
  }, [S, C] = g(!1), T;
29
- m(_(() => n.src, () => C(!1), { defer: !0 })), v(() => {
29
+ m(_(() => t.src, () => C(!1), { defer: !0 })), v(() => {
30
30
  T?.complete && T.naturalWidth === 0 && C(!0);
31
31
  });
32
- let E = h(() => w(n.label, n.fallback));
32
+ let E = h(() => w(t.label, t.fallback));
33
33
  return (() => {
34
34
  var e = x(), m = e.firstChild;
35
35
  return l(e, s(u, {
36
36
  get class() {
37
- return t("sheen-avatar", n.class);
37
+ return n("sheen-avatar", t.class);
38
38
  },
39
39
  role: "img",
40
40
  get "aria-label"() {
41
- return n.label;
41
+ return t.label;
42
42
  },
43
43
  get "data-size"() {
44
44
  return f();
45
45
  }
46
46
  }), !1, !0), a(m, E), a(e, r(p, {
47
47
  get when() {
48
- return o(() => !!n.src)() && !S();
48
+ return o(() => !!t.src)() && !S();
49
49
  },
50
50
  get children() {
51
51
  var e = b();
52
52
  e.addEventListener("error", () => C(!0));
53
- var t = T;
54
- return typeof t == "function" ? d(t, e) : T = e, c(e, "draggable", !1), i(() => c(e, "src", n.src)), e;
53
+ var n = T;
54
+ return typeof n == "function" ? d(n, e) : T = e, c(e, "draggable", !1), i(() => c(e, "src", t.src)), e;
55
55
  }
56
56
  }), null), e;
57
57
  })();
@@ -65,7 +65,7 @@ function E(o) {
65
65
  "class"
66
66
  ]);
67
67
  if (!u.label?.trim()) throw Error("AvatarGroup requires a nonempty label");
68
- let m = e(), g = n(), _ = h(() => {
68
+ let m = t(), g = e(), _ = h(() => {
69
69
  let e = /* @__PURE__ */ new Set();
70
70
  for (let t of u.avatars) {
71
71
  if (!t.id?.trim() || e.has(t.id)) throw Error("AvatarGroup IDs must be unique nonempty strings");
@@ -81,7 +81,7 @@ function E(o) {
81
81
  var e = S();
82
82
  return l(e, s(d, {
83
83
  get class() {
84
- return t("sheen-avatar-group", u.class);
84
+ return n("sheen-avatar-group", u.class);
85
85
  },
86
86
  role: "group",
87
87
  get "aria-label"() {
@@ -111,5 +111,4 @@ function E(o) {
111
111
  }), null), e;
112
112
  })();
113
113
  }
114
- //#endregion
115
114
  export { T as Avatar, E as AvatarGroup };
@@ -0,0 +1,39 @@
1
+ import type { Accessor, JSX } from "solid-js";
2
+ import type { SortableItem, SortableMessages, SortableReorder } from "./sortable-core.ts";
3
+ export interface BoardColumn<Card extends SortableItem = SortableItem> {
4
+ readonly id: string;
5
+ /** Column title, used by the default header and in announcements. */
6
+ readonly label: string;
7
+ readonly cards: readonly Card[];
8
+ /** A disabled column neither accepts cards nor lets its cards or itself be picked up. */
9
+ readonly disabled?: boolean;
10
+ }
11
+ export interface BoardMove {
12
+ readonly id: string;
13
+ readonly fromColumn: string;
14
+ readonly fromIndex: number;
15
+ readonly toColumn: string;
16
+ /** Final index in `toColumn`, measured after the card leaves its original position. */
17
+ readonly index: number;
18
+ }
19
+ export type BoardCardOf<Column extends BoardColumn> = Column["cards"][number];
20
+ export type BoardProps<Column extends BoardColumn> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "ref" | "onDrop"> & {
21
+ ref?: HTMLDivElement | ((element: HTMLDivElement) => void);
22
+ /** Owner-ordered columns. Column and card ids are stable and unique across the board. */
23
+ columns: readonly Column[];
24
+ children: (card: Accessor<BoardCardOf<Column>>, column: Accessor<Column>) => JSX.Element;
25
+ /** Replaces the default title and count inside each column header. The reorder handle stays Sheen-owned. */
26
+ columnHeader?: (column: Accessor<Column>, count: Accessor<number>) => JSX.Element;
27
+ /** Proposes a card move. The board is controlled: nothing moves until the owner passes updated columns back. */
28
+ onMove: (move: BoardMove) => void;
29
+ /** Enables column reordering through each header's handle. */
30
+ onColumnReorder?: (reorder: SortableReorder) => void;
31
+ /** Accessible name for the board. */
32
+ label: string;
33
+ /** Render a grip button on each card that owns pointer and keyboard dragging. Without it the whole card drags and takes focus. */
34
+ handle?: boolean;
35
+ disabled?: boolean;
36
+ messages?: Partial<SortableMessages>;
37
+ };
38
+ /** A controlled Kanban board: cards move within and between columns, and columns optionally reorder. */
39
+ export declare function Board<Column extends BoardColumn>(props: BoardProps<Column>): JSX.Element;