@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
@@ -1,16 +1,16 @@
1
- import { createShortcutRegistry as e } from "../utils/shortcut-registry.js";
2
- import { resolveShortcutPlatform as t } from "../utils/shortcut-platform.js";
3
- import { createComponent as n } from "solid-js/web";
4
- import { createContext as r, createEffect as i, createMemo as a, createSignal as o, getOwner as s, onCleanup as c, onMount as l, useContext as u } from "solid-js";
5
- //#region src/primitives/ShortcutProvider.tsx
6
- var d = r();
7
- function f(r) {
8
- if (u(d)) throw Error("ShortcutProvider cannot be nested; use shared scope IDs");
9
- let s = (e) => {
10
- r.onError ? r.onError(e) : queueMicrotask(() => {
1
+ import { createShortcutRegistry as e, formatShortcut as t } from "../utils/shortcut-registry.js";
2
+ import { resolveShortcutPlatform as n } from "../utils/shortcut-platform.js";
3
+ import { createComponent as r } from "solid-js/web";
4
+ import { createContext as i, createEffect as a, createMemo as o, createSignal as s, getOwner as c, onCleanup as l, onMount as u, useContext as d } from "solid-js";
5
+ // src/primitives/ShortcutProvider.tsx
6
+ var f = i();
7
+ function p(t) {
8
+ if (d(f)) throw Error("ShortcutProvider cannot be nested; use shared scope IDs");
9
+ let i = (e) => {
10
+ t.onError ? t.onError(e) : queueMicrotask(() => {
11
11
  throw e;
12
12
  });
13
- }, [f, p] = o([]), [m, h] = o([]), g = a(() => r.activeScopes ?? ["global"]), [_, v] = o([]), y = 0, b = a(() => {
13
+ }, [c, p] = s([]), [m, h] = s([]), g = o(() => t.activeScopes ?? ["global"]), [_, v] = s([]), y = 0, b = o(() => {
14
14
  let e = _().at(-1);
15
15
  return e ? [e.scope] : g();
16
16
  }), x = (e) => {
@@ -27,18 +27,18 @@ function f(r) {
27
27
  return () => {
28
28
  n || (n = !0, v((e) => e.filter((e) => e.id !== t)));
29
29
  };
30
- }, S = a(() => r.characterShortcuts !== !1), C = r.development, w = (t) => e({
30
+ }, S = o(() => t.characterShortcuts !== !1), C = t.development, w = (t) => e({
31
31
  platform: t,
32
32
  development: C,
33
- onError: s,
33
+ onError: i,
34
34
  onPending: (e) => p(e),
35
35
  onChange: (e) => h(e)
36
- }), [T, E] = o(r.platform === void 0 ? void 0 : w(r.platform)), D = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new WeakSet();
37
- return i(() => {
36
+ }), [T, E] = s(t.platform === void 0 ? void 0 : w(t.platform)), D = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new WeakSet();
37
+ return a(() => {
38
38
  b(), S(), T()?.cancelPending();
39
- }), c(() => T()?.dispose()), l(() => {
40
- T() || E(w(t(navigator.platform)));
41
- let e = () => T()?.cancelPending(), n = (t) => {
39
+ }), l(() => T()?.dispose()), u(() => {
40
+ T() || E(w(n(navigator.platform)));
41
+ let e = () => T()?.cancelPending(), t = (t) => {
42
42
  if (t.defaultPrevented || t.getModifierState("AltGraph")) {
43
43
  e();
44
44
  return;
@@ -51,7 +51,7 @@ function f(r) {
51
51
  let r = n.flatMap((e) => {
52
52
  let t = D.get(e);
53
53
  return t ? [t] : [];
54
- }).reverse(), i = _().length ? b() : [.../* @__PURE__ */ new Set([...b().filter((e) => !r.includes(e)), ...r])], a = n.some((e) => e instanceof HTMLElement && (e.matches("input, textarea, select, [role=textbox]") || e.isContentEditable));
54
+ }).reverse(), a = _().length ? b() : [.../* @__PURE__ */ new Set([...b().filter((e) => !r.includes(e)), ...r])], o = n.some((e) => e instanceof HTMLElement && (e.matches("input, textarea, select, [role=textbox]") || e.isContentEditable));
55
55
  try {
56
56
  T()?.dispatch({
57
57
  key: t.key,
@@ -59,22 +59,22 @@ function f(r) {
59
59
  metaKey: t.metaKey,
60
60
  altKey: t.altKey,
61
61
  shiftKey: t.shiftKey,
62
- editing: a,
62
+ editing: o,
63
63
  characterShortcuts: S(),
64
64
  composing: t.isComposing || t.key === "Process",
65
65
  repeat: t.repeat
66
- }, i, () => t.preventDefault());
66
+ }, a, () => t.preventDefault());
67
67
  } catch (e) {
68
- s(e);
68
+ i(e);
69
69
  }
70
70
  };
71
- document.addEventListener("keydown", n), document.addEventListener("focusin", e), document.addEventListener("pointerdown", e, !0), document.addEventListener("compositionstart", e), window.addEventListener("blur", e), c(() => {
72
- document.removeEventListener("keydown", n), document.removeEventListener("focusin", e), document.removeEventListener("pointerdown", e, !0), document.removeEventListener("compositionstart", e), window.removeEventListener("blur", e);
71
+ document.addEventListener("keydown", t), document.addEventListener("focusin", e), document.addEventListener("pointerdown", e, !0), document.addEventListener("compositionstart", e), window.addEventListener("blur", e), l(() => {
72
+ document.removeEventListener("keydown", t), document.removeEventListener("focusin", e), document.removeEventListener("pointerdown", e, !0), document.removeEventListener("compositionstart", e), window.removeEventListener("blur", e);
73
73
  });
74
- }), n(d.Provider, {
74
+ }), r(f.Provider, {
75
75
  value: {
76
76
  registry: T,
77
- pending: f,
77
+ pending: c,
78
78
  bindings: m,
79
79
  characterShortcuts: S,
80
80
  acquireModal: x,
@@ -92,24 +92,31 @@ function f(r) {
92
92
  })
93
93
  },
94
94
  get children() {
95
- return r.children;
95
+ return t.children;
96
96
  }
97
97
  });
98
98
  }
99
- function p(e) {
100
- let t = u(d);
101
- if (!t || !s()) throw Error("useShortcut requires an owned ShortcutProvider context");
102
- i(() => {
99
+ function m(e) {
100
+ let [r, i] = s("other");
101
+ return u(() => i(n(navigator.platform))), () => {
102
+ let n = e();
103
+ return n === void 0 ? void 0 : t(n, r());
104
+ };
105
+ }
106
+ function h(e) {
107
+ let t = d(f);
108
+ if (!t || !c()) throw Error("useShortcut requires an owned ShortcutProvider context");
109
+ a(() => {
103
110
  let n = t.registry();
104
- n && c(n.register({ ...e }));
111
+ n && l(n.register({ ...e }));
105
112
  });
106
113
  }
107
- function m(e, t) {
108
- if (!s()) throw Error("shortcut actions require an owned component context");
109
- let n = u(d);
110
- return n ? (i(() => {
114
+ function g(e, t) {
115
+ if (!c()) throw Error("shortcut actions require an owned component context");
116
+ let n = d(f);
117
+ return n ? (a(() => {
111
118
  let r = n.registry(), i = e();
112
- r && i && c(r.register({
119
+ r && i && l(r.register({
113
120
  keys: i.keys,
114
121
  label: i.label,
115
122
  group: i.group,
@@ -117,56 +124,55 @@ function m(e, t) {
117
124
  ...i.developmentOnly === void 0 ? {} : { developmentOnly: i.developmentOnly },
118
125
  run: t
119
126
  }));
120
- }), a(() => {
127
+ }), o(() => {
121
128
  let t = e();
122
129
  if (!t) return;
123
130
  let r = t.scope ?? "global";
124
131
  return n.bindings().findLast((e) => e.keys === t.keys && e.scope === r && e.label === t.label && e.group === t.group);
125
132
  })) : () => void 0;
126
133
  }
127
- function h() {
128
- let e = u(d);
129
- if (!e || !s()) throw Error("usePendingShortcut requires an owned ShortcutProvider context");
134
+ function _() {
135
+ let e = d(f);
136
+ if (!e || !c()) throw Error("usePendingShortcut requires an owned ShortcutProvider context");
130
137
  return e.pending;
131
138
  }
132
- function g() {
133
- let e = u(d);
134
- if (!e || !s()) throw Error("useShortcutBindings requires an owned ShortcutProvider context");
139
+ function v() {
140
+ let e = d(f);
141
+ if (!e || !c()) throw Error("useShortcutBindings requires an owned ShortcutProvider context");
135
142
  return e.bindings;
136
143
  }
137
- function _() {
138
- let e = u(d);
139
- if (!e || !s()) throw Error("useShortcutCommands requires an owned ShortcutProvider context");
144
+ function y() {
145
+ let e = d(f);
146
+ if (!e || !c()) throw Error("useShortcutCommands requires an owned ShortcutProvider context");
140
147
  return {
141
148
  bindings: e.bindings,
142
149
  run: (t) => e.registry()?.run(t) ?? !1
143
150
  };
144
151
  }
145
- function v() {
146
- let e = u(d);
147
- if (!e || !s()) throw Error("useCharacterShortcuts requires an owned ShortcutProvider context");
152
+ function b() {
153
+ let e = d(f);
154
+ if (!e || !c()) throw Error("useCharacterShortcuts requires an owned ShortcutProvider context");
148
155
  return e.characterShortcuts;
149
156
  }
150
- function y(e, t) {
151
- let n = u(d);
152
- n && i(() => {
153
- t() && c(n.acquireModal(e()));
157
+ function x(e, t) {
158
+ let n = d(f);
159
+ n && a(() => {
160
+ t() && l(n.acquireModal(e()));
154
161
  });
155
162
  }
156
- function b(e, t) {
157
- let n = u(d);
158
- if (!n || !s()) throw Error("ShortcutScope requires an owned ShortcutProvider context");
159
- i(() => {
163
+ function S(e, t) {
164
+ let n = d(f);
165
+ if (!n || !c()) throw Error("ShortcutScope requires an owned ShortcutProvider context");
166
+ a(() => {
160
167
  let r = t();
161
- r && c(n.acquireFocusScope(r, e()));
168
+ r && l(n.acquireFocusScope(r, e()));
162
169
  });
163
170
  }
164
- function x(e, t) {
165
- let n = u(d);
166
- n && i(() => {
171
+ function C(e, t) {
172
+ let n = d(f);
173
+ n && a(() => {
167
174
  let r = e();
168
- t() && r && c(n.acquireKeyboardOwner(r));
175
+ t() && r && l(n.acquireKeyboardOwner(r));
169
176
  });
170
177
  }
171
- //#endregion
172
- export { f as ShortcutProvider, v as useCharacterShortcuts, b as useFocusShortcutScope, y as useModalShortcutScope, h as usePendingShortcut, p as useShortcut, m as useShortcutAction, g as useShortcutBindings, _ as useShortcutCommands, x as useShortcutKeyboardOwner };
178
+ export { p as ShortcutProvider, b as useCharacterShortcuts, S as useFocusShortcutScope, x as useModalShortcutScope, _ as usePendingShortcut, h as useShortcut, g as useShortcutAction, v as useShortcutBindings, y as useShortcutCommands, C as useShortcutKeyboardOwner, m as useShortcutLabel };
@@ -1,8 +1,8 @@
1
- import { cn as e } from "../utils/cn.js";
2
- import { useFocusShortcutScope as t } from "./ShortcutProvider.js";
1
+ import { useFocusShortcutScope as e } from "./ShortcutProvider.js";
2
+ import { cn as t } from "../utils/cn.js";
3
3
  import { insert as n, mergeProps as r, spread as i, template as a, use as o } from "solid-js/web";
4
4
  import { createSignal as s, splitProps as c } from "solid-js";
5
- //#region src/primitives/ShortcutScope.tsx
5
+ // src/primitives/ShortcutScope.tsx
6
6
  var l = /*#__PURE__*/ a("<div>");
7
7
  function u(a) {
8
8
  let [u, d] = c(a, [
@@ -11,19 +11,18 @@ function u(a) {
11
11
  "class",
12
12
  "children"
13
13
  ]), [f, p] = s();
14
- return t(() => u.scope, f), (() => {
15
- var t = l();
14
+ return e(() => u.scope, f), (() => {
15
+ var e = l();
16
16
  return o((e) => {
17
17
  p(e), typeof u.ref == "function" && u.ref(e);
18
- }, t), i(t, r(d, {
18
+ }, e), i(e, r(d, {
19
19
  get class() {
20
- return e("sheen-shortcut-scope", u.class);
20
+ return t("sheen-shortcut-scope", u.class);
21
21
  },
22
22
  get "data-sheen-shortcut-scope"() {
23
23
  return u.scope;
24
24
  }
25
- }), !1, !0), n(t, () => u.children), t;
25
+ }), !1, !0), n(e, () => u.children), e;
26
26
  })();
27
27
  }
28
- //#endregion
29
28
  export { u as ShortcutScope };
@@ -1,22 +1,22 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { useCharacterShortcuts as t, useShortcutBindings as n } from "./ShortcutProvider.js";
3
- import { Dialog as r } from "./Dialog.js";
4
- import { Heading as i, Kbd as a, Text as o } from "./Typography.js";
1
+ import { Dialog as e } from "./Dialog.js";
2
+ import { Heading as t, Kbd as n, Text as r } from "./Typography.js";
3
+ import { useCharacterShortcuts as i, useShortcutBindings as a } from "./ShortcutProvider.js";
4
+ import { useTheme as o } from "../theme/ThemeProvider.js";
5
5
  import { createComponent as s, insert as c, memo as l, mergeProps as u, template as d } from "solid-js/web";
6
6
  import { For as f, Show as p, createMemo as m } from "solid-js";
7
- //#region src/primitives/ShortcutSheet.tsx
7
+ // src/primitives/ShortcutSheet.tsx
8
8
  var h = /*#__PURE__*/ d("<section><dl class=sheen-shortcut-bindings>"), g = /*#__PURE__*/ d("<div><dt></dt><dd>");
9
9
  function _(d) {
10
- let _ = n(), v = t(), y = e(), b = m(() => new Map(_().map((e) => [e.id, e]))), x = m(() => [...new Set(_().map((e) => e.group))]);
11
- return s(r, u(d, { get children() {
12
- return [s(o, { get children() {
10
+ let _ = a(), v = i(), y = o(), b = m(() => new Map(_().map((e) => [e.id, e]))), x = m(() => [...new Set(_().map((e) => e.group))]);
11
+ return s(e, u(d, { get children() {
12
+ return [s(r, { get children() {
13
13
  return y.messages().shortcutInventory;
14
14
  } }), s(p, {
15
15
  get when() {
16
16
  return _().length;
17
17
  },
18
18
  get fallback() {
19
- return s(o, { get children() {
19
+ return s(r, { get children() {
20
20
  return y.messages().noResults;
21
21
  } });
22
22
  },
@@ -26,11 +26,11 @@ function _(d) {
26
26
  return x();
27
27
  },
28
28
  children: (e) => (() => {
29
- var t = h(), n = t.firstChild;
30
- return c(t, s(i, {
29
+ var i = h(), a = i.firstChild;
30
+ return c(i, s(t, {
31
31
  level: 3,
32
32
  children: e
33
- }), n), c(n, s(f, {
33
+ }), a), c(a, s(f, {
34
34
  get each() {
35
35
  return _().filter((t) => t.group === e).map((e) => e.id);
36
36
  },
@@ -39,34 +39,41 @@ function _(d) {
39
39
  return b().get(e);
40
40
  },
41
41
  children: (e) => (() => {
42
- var t = g(), n = t.firstChild, r = n.nextSibling;
43
- return c(n, s(o, { get children() {
42
+ var t = g(), i = t.firstChild, a = i.nextSibling;
43
+ return c(i, s(r, { get children() {
44
44
  return e().label;
45
- } }), null), c(n, s(o, {
46
- tone: "muted",
45
+ } }), null), c(i, s(p, {
46
+ get when() {
47
+ return e().scope !== "global";
48
+ },
47
49
  get children() {
48
- return e().scope;
50
+ return s(r, {
51
+ tone: "muted",
52
+ get children() {
53
+ return e().scope;
54
+ }
55
+ });
49
56
  }
50
- }), null), c(r, s(a, { get children() {
57
+ }), null), c(a, s(n, { get children() {
51
58
  return e().displayKeys;
52
- } }), null), c(r, s(p, {
59
+ } }), null), c(a, s(p, {
53
60
  get when() {
54
61
  return e().shadowed;
55
62
  },
56
63
  get children() {
57
- return s(o, {
64
+ return s(r, {
58
65
  tone: "muted",
59
66
  get children() {
60
67
  return y.messages().shortcutShadowed;
61
68
  }
62
69
  });
63
70
  }
64
- }), null), c(r, s(p, {
71
+ }), null), c(a, s(p, {
65
72
  get when() {
66
73
  return l(() => !!e().characterOnly)() && !v();
67
74
  },
68
75
  get children() {
69
- return s(o, {
76
+ return s(r, {
70
77
  tone: "muted",
71
78
  get children() {
72
79
  return y.messages().shortcutDisabled;
@@ -76,12 +83,11 @@ function _(d) {
76
83
  }), null), t;
77
84
  })()
78
85
  })
79
- })), t;
86
+ })), i;
80
87
  })()
81
88
  });
82
89
  }
83
90
  })];
84
91
  } }));
85
92
  }
86
- //#endregion
87
93
  export { _ as ShortcutSheet };
@@ -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/Skeleton.tsx
4
+ // src/primitives/Skeleton.tsx
5
5
  var a = /*#__PURE__*/ r("<span>");
6
6
  function o(r) {
7
7
  let [o, s] = i(r, ["class", "shape"]);
@@ -19,5 +19,4 @@ function o(r) {
19
19
  }), !1, !1), r;
20
20
  })();
21
21
  }
22
- //#endregion
23
22
  export { o as Skeleton };
@@ -2,7 +2,7 @@ import { useTheme as e } from "../theme/ThemeProvider.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
3
  import { createComponent as n, delegateEvents 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 } from "solid-js/web";
4
4
  import { createSignal as f, createUniqueId as p, splitProps as m } from "solid-js";
5
- //#region src/primitives/Slider.tsx
5
+ // src/primitives/Slider.tsx
6
6
  var h = /*#__PURE__*/ d("<div><div class=sheen-slider-heading><span class=sheen-slider-label></span><span class=sheen-slider-value></span></div><div class=sheen-slider-track><span class=sheen-slider-fill>"), g = /*#__PURE__*/ d("<span aria-hidden=true> *"), _ = /*#__PURE__*/ d("<input class=sheen-slider-input type=range role=slider>"), v = /*#__PURE__*/ d("<p class=sheen-slider-description>"), y = /*#__PURE__*/ d("<p class=sheen-slider-error>");
7
7
  function b(e, t, n, r, i, a) {
8
8
  if (!e.trim()) throw Error("Slider label must be nonempty");
@@ -206,5 +206,4 @@ function T(t) {
206
206
  }));
207
207
  }
208
208
  r(["input"]);
209
- //#endregion
210
209
  export { T as RangeSlider, w as Slider };
@@ -0,0 +1,19 @@
1
+ import type { Accessor, JSX } from "solid-js";
2
+ import type { SortableItem, SortableMessages, SortableOrientation, SortableReorder } from "./sortable-core.ts";
3
+ export type SortableListProps<Item extends SortableItem> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "ref" | "onDrop"> & {
4
+ ref?: HTMLDivElement | ((element: HTMLDivElement) => void);
5
+ /** Owner-ordered items with stable, unique ids. Item nodes are keyed by id and survive refreshes and reorders. */
6
+ items: readonly Item[];
7
+ children: (item: Accessor<Item>, index: Accessor<number>) => JSX.Element;
8
+ /** Proposes a new order. The list is controlled: nothing moves until the owner passes reordered items back. */
9
+ onReorder: (reorder: SortableReorder) => void;
10
+ /** Accessible name for the list. */
11
+ label: string;
12
+ orientation?: SortableOrientation;
13
+ /** Render a grip button that owns pointer and keyboard dragging. Without it the whole item drags and takes focus. */
14
+ handle?: boolean;
15
+ disabled?: boolean;
16
+ messages?: Partial<SortableMessages>;
17
+ };
18
+ /** A controlled reorderable list with pointer dragging, auto-scroll, and an announced keyboard model. */
19
+ export declare function SortableList<Item extends SortableItem>(props: SortableListProps<Item>): JSX.Element;
@@ -0,0 +1,235 @@
1
+ import { useTheme as e } from "../theme/ThemeProvider.js";
2
+ import { useNumberFormatter as t } from "../theme/intl.js";
3
+ import { cn as n } from "../utils/cn.js";
4
+ import { closestEdge as r, dropIndex as i, edgeField as a, formatMessage as o, isRtl as s, keyIntent as c, moveId as l, resolveSortableMessages as u, scrollContainers as d, stringField as f, validateIds as ee } from "./sortable-core.js";
5
+ import { bindDraggable as te, bindDropTarget as ne, bindMonitor as re } from "./sortable-drag.js";
6
+ import { Glyph as ie } from "./Glyph.js";
7
+ import { createComponent as p, delegateEvents as m, effect as h, insert as g, mergeProps as ae, setAttribute as _, spread as oe, template as v, use as y } from "solid-js/web";
8
+ import { For as se, Show as ce, batch as le, createEffect as ue, createMemo as b, createSignal as x, createUniqueId as de, onCleanup as S, onMount as fe, splitProps as pe } from "solid-js";
9
+ // src/primitives/SortableList.tsx
10
+ var me = /*#__PURE__*/ v("<div><ul class=sheen-sortable-list role=list></ul><span class=sheen-sortable-hidden></span><span class=sheen-sortable-hidden role=status aria-live=assertive aria-atomic=true>"), he = /*#__PURE__*/ v("<button type=button class=sheen-sortable-handle>"), C = /*#__PURE__*/ v("<li class=sheen-sortable-item><div class=sheen-sortable-content>");
11
+ function ge(e, t) {
12
+ return e?.id === t?.id && e?.edge === t?.edge;
13
+ }
14
+ function w(m) {
15
+ let v = e(), w = t(), T = de(), E = Symbol("SortableList"), [D, _e] = pe(m, [
16
+ "ref",
17
+ "class",
18
+ "items",
19
+ "children",
20
+ "onReorder",
21
+ "label",
22
+ "orientation",
23
+ "handle",
24
+ "disabled",
25
+ "messages",
26
+ "aria-describedby"
27
+ ]), O = b(() => u(v.messages(), D.messages)), k = b(() => (ee(D.items.map((e) => e.id), "SortableList"), new Map(D.items.map((e) => [e.id, e])))), A = b(() => [...k().keys()]), [ve, j] = x(), [M, N] = x(), [P, F] = x(), [ye, I] = x(""), L = b(() => {
28
+ let e = ve();
29
+ return e && k().has(e.id) ? e : void 0;
30
+ }), R = b(() => {
31
+ let e = L();
32
+ return e ? l(A(), e.id, e.target) : A();
33
+ }), z = () => D.orientation ?? "vertical", B = `${T}-instructions`, V, H = !1, U = !1;
34
+ S(() => {
35
+ U = !0;
36
+ });
37
+ let W = (e) => !!(D.disabled || k().get(e)?.disabled), G = (e) => e.sortableInstance === E, K = (e) => {
38
+ let t = [...V?.querySelectorAll(".sheen-sortable-item") ?? []].find((t) => t.dataset.sortableId === e);
39
+ return D.handle ? t?.querySelector(".sheen-sortable-handle") ?? void 0 : t;
40
+ }, q = (e, t, n) => {
41
+ let r = {
42
+ label: k().get(t)?.label ?? t,
43
+ position: w().format(n + 1),
44
+ count: w().format(R().length)
45
+ };
46
+ I(""), queueMicrotask(() => {
47
+ U || I(o(e, r));
48
+ });
49
+ }, J = (e, t) => {
50
+ H = !0;
51
+ try {
52
+ t();
53
+ } finally {
54
+ let t = K(e);
55
+ t && t.ownerDocument.activeElement !== t && t.focus(), H = !1;
56
+ }
57
+ }, Y = (e, t, n) => {
58
+ t === n || t < 0 || D.onReorder({
59
+ id: e,
60
+ fromIndex: t,
61
+ toIndex: n,
62
+ ids: l(A(), e, n)
63
+ });
64
+ }, X = () => {
65
+ let e = L();
66
+ j(void 0), e && q(O().sortableCancelled, e.id, e.origin);
67
+ }, Z = (e, t, n) => {
68
+ if (t.target !== n || t.altKey || t.ctrlKey || t.metaKey) return;
69
+ let r = c(t.key, s(n)), i = L();
70
+ if (!r) return;
71
+ if (!i) {
72
+ if (r.kind !== "toggle" || W(e)) return;
73
+ t.preventDefault();
74
+ let n = A().indexOf(e);
75
+ j({
76
+ id: e,
77
+ origin: n,
78
+ target: n
79
+ }), q(O().sortableLifted, e, n);
80
+ return;
81
+ }
82
+ if (i.id !== e) return;
83
+ if (t.preventDefault(), r.kind === "toggle") {
84
+ J(e, () => le(() => {
85
+ Y(e, i.origin, i.target), j(void 0);
86
+ })), q(O().sortableDropped, e, i.target);
87
+ return;
88
+ }
89
+ if (r.kind === "cancel") {
90
+ J(e, X);
91
+ return;
92
+ }
93
+ if (r.kind === "step" && r.axis !== z()) return;
94
+ let a = R().length - 1, o = r.kind === "edge" ? r.to === "start" ? 0 : a : Math.max(0, Math.min(a, i.target + r.delta));
95
+ o !== i.target && (J(e, () => j({
96
+ ...i,
97
+ target: o
98
+ })), q(O().sortableMoved, e, o));
99
+ }, Q = (e, t, n) => {
100
+ H || L()?.id !== e || t.relatedTarget instanceof Node && n.contains(t.relatedTarget) || X();
101
+ }, $ = (e, t) => {
102
+ let n = f(e, "sortableId"), r = t ? f(t, "sortableId") : void 0, o = t ? a(t) : void 0;
103
+ if (!n || !r || !o) return;
104
+ let s = R().indexOf(n);
105
+ return {
106
+ sourceId: n,
107
+ targetId: r,
108
+ edge: o,
109
+ from: s,
110
+ to: i(s, R().indexOf(r), o)
111
+ };
112
+ };
113
+ return fe(() => {
114
+ if (!V) return;
115
+ let e = V;
116
+ S(re({
117
+ accepts: G,
118
+ scrollers: () => d(e),
119
+ onDrag: (e, t) => {
120
+ let n = $(e, t), r = n && n.to !== n.from ? {
121
+ id: n.targetId,
122
+ edge: n.edge
123
+ } : void 0;
124
+ ge(M(), r) || N(r);
125
+ },
126
+ onDrop: (e, t) => {
127
+ N(void 0);
128
+ let n = $(e, t);
129
+ n && n.to !== n.from && (Y(n.sourceId, n.from, n.to), q(O().sortableDropped, n.sourceId, n.to));
130
+ }
131
+ }));
132
+ }), (() => {
133
+ var e = me(), t = e.firstChild, i = t.nextSibling, a = i.nextSibling;
134
+ return y((e) => {
135
+ V = e, typeof D.ref == "function" && D.ref(e);
136
+ }, e), oe(e, ae(_e, {
137
+ get class() {
138
+ return n("sheen-sortable", D.class);
139
+ },
140
+ get "data-orientation"() {
141
+ return z();
142
+ },
143
+ get "data-disabled"() {
144
+ return D.disabled ? "" : void 0;
145
+ },
146
+ get "data-active"() {
147
+ return L() || P() ? "" : void 0;
148
+ }
149
+ }), !1, !0), g(t, p(se, {
150
+ get each() {
151
+ return R();
152
+ },
153
+ children: (e, t) => {
154
+ let n = k().get(e);
155
+ if (!n) throw Error(`SortableList: missing item ${JSON.stringify(e)}`);
156
+ let i = n, a = () => {
157
+ let t = k().get(e);
158
+ return t && (i = t), i;
159
+ }, s = () => W(e), c = () => L()?.id === e, l = () => !D.handle, u, d;
160
+ return ue(() => {
161
+ if (!u) return;
162
+ let t = u, n = D.handle ? d : void 0, i = [te({
163
+ element: t,
164
+ handle: n,
165
+ canDrag: () => !s() && !L(),
166
+ data: () => ({
167
+ sortableInstance: E,
168
+ sortableId: e
169
+ }),
170
+ onStart: () => F(e),
171
+ onEnd: () => F(void 0)
172
+ }), ne({
173
+ element: t,
174
+ accepts: G,
175
+ data: (n) => ({
176
+ sortableId: e,
177
+ edge: r(t, n, z())
178
+ })
179
+ })];
180
+ S(() => {
181
+ for (let e of i) e();
182
+ });
183
+ }), (() => {
184
+ var n = C(), r = n.firstChild;
185
+ n.$$focusout = (t) => {
186
+ l() && Q(e, t, t.currentTarget);
187
+ }, n.$$keydown = (t) => {
188
+ l() && Z(e, t, t.currentTarget);
189
+ };
190
+ var i = u;
191
+ return typeof i == "function" ? y(i, n) : u = n, _(n, "data-sortable-id", e), g(n, p(ce, {
192
+ get when() {
193
+ return D.handle;
194
+ },
195
+ get children() {
196
+ var t = he();
197
+ t.$$focusout = (t) => Q(e, t, t.currentTarget), t.$$keydown = (t) => Z(e, t, t.currentTarget);
198
+ var n = d;
199
+ return typeof n == "function" ? y(n, t) : d = t, _(t, "aria-describedby", B), g(t, p(ie, {
200
+ class: "sheen-sortable-grip",
201
+ name: "grip"
202
+ })), h((e) => {
203
+ var n = o(O().sortableHandle, { label: a().label }), r = c() ? "true" : "false", i = s();
204
+ return n !== e.e && _(t, "aria-label", e.e = n), r !== e.t && _(t, "aria-pressed", e.t = r), i !== e.a && (t.disabled = e.a = i), e;
205
+ }, {
206
+ e: void 0,
207
+ t: void 0,
208
+ a: void 0
209
+ }), t;
210
+ }
211
+ }), r), g(r, () => D.children(a, t)), h((t) => {
212
+ var r = s() ? "" : void 0, i = c() ? "" : void 0, a = P() === e ? "" : void 0, o = M()?.id === e ? M()?.edge : void 0, u = l() && !s() ? 0 : void 0, d = l() ? B : void 0, f = l() && s() ? "true" : void 0;
213
+ return r !== t.e && _(n, "data-disabled", t.e = r), i !== t.t && _(n, "data-lifted", t.t = i), a !== t.a && _(n, "data-dragging", t.a = a), o !== t.o && _(n, "data-drop-edge", t.o = o), u !== t.i && _(n, "tabindex", t.i = u), d !== t.n && _(n, "aria-describedby", t.n = d), f !== t.s && _(n, "aria-disabled", t.s = f), t;
214
+ }, {
215
+ e: void 0,
216
+ t: void 0,
217
+ a: void 0,
218
+ o: void 0,
219
+ i: void 0,
220
+ n: void 0,
221
+ s: void 0
222
+ }), n;
223
+ })();
224
+ }
225
+ })), _(i, "id", B), g(i, () => O().sortableInstructions), g(a, ye), h((e) => {
226
+ var n = D.label, r = [B, D["aria-describedby"]].filter(Boolean).join(" ");
227
+ return n !== e.e && _(t, "aria-label", e.e = n), r !== e.t && _(t, "aria-describedby", e.t = r), e;
228
+ }, {
229
+ e: void 0,
230
+ t: void 0
231
+ }), e;
232
+ })();
233
+ }
234
+ m(["keydown", "focusout"]);
235
+ export { w as SortableList };
@@ -2,7 +2,7 @@ import { useTheme as e } from "../theme/ThemeProvider.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
3
  import { createComponent as n, insert as r, mergeProps as i, spread as a, template as o } from "solid-js/web";
4
4
  import { Show as s, splitProps as c } from "solid-js";
5
- //#region src/primitives/Spinner.tsx
5
+ // src/primitives/Spinner.tsx
6
6
  var l = /*#__PURE__*/ o("<span class=sheen-spinner-label>"), u = /*#__PURE__*/ o("<span><span class=sheen-spinner-mark aria-hidden=true>");
7
7
  function d(o) {
8
8
  let d = e(), [f, p] = c(o, [
@@ -40,5 +40,4 @@ function d(o) {
40
40
  }), null), e;
41
41
  })();
42
42
  }
43
- //#endregion
44
43
  export { d as Spinner };