@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,13 +1,14 @@
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 { createComponent as r, effect as i, insert as a, mergeProps as o, setAttribute as s, spread as c, template as l, use as u } from "solid-js/web";
5
- import { For as d, Show as f, createEffect as p, createMemo as m, createSignal as h, createUniqueId as g, onCleanup as _, onMount as v, splitProps as y, untrack as b } from "solid-js";
6
- import * as x from "#sheen-kobalte/select";
7
- //#region src/primitives/Select.tsx
8
- var S = /*#__PURE__*/ l("<button>"), C = /*#__PURE__*/ l("<span aria-hidden=true> *"), w = /*#__PURE__*/ l("<label class=sheen-field-label>"), T = /*#__PURE__*/ l("<span>"), E = /*#__PURE__*/ l("<span aria-hidden=true>▾"), D = /*#__PURE__*/ l("<select class=sheen-select-native aria-hidden=true tabindex=-1><option value>"), O = /*#__PURE__*/ l("<span class=sheen-field-description>"), ee = /*#__PURE__*/ l("<span class=sheen-field-error>"), te = /*#__PURE__*/ l("<option>"), k = /*#__PURE__*/ l("<p class=sheen-select-empty>");
9
- function A(l) {
10
- let [A, j] = y(l, [
3
+ import { Glyph as n } from "./Glyph.js";
4
+ import { useShortcutKeyboardOwner as r } from "./ShortcutProvider.js";
5
+ import { createComponent as i, effect as a, insert as o, mergeProps as s, setAttribute as c, spread as l, template as u, use as d } from "solid-js/web";
6
+ import { For as f, Show as p, createEffect as m, createMemo as h, createSignal as g, createUniqueId as _, onCleanup as v, onMount as y, splitProps as b, untrack as x } from "solid-js";
7
+ import * as S from "#sheen-kobalte/select";
8
+ // src/primitives/Select.tsx
9
+ var C = /*#__PURE__*/ u("<button>"), w = /*#__PURE__*/ u("<span aria-hidden=true> *"), T = /*#__PURE__*/ u("<label class=sheen-field-label>"), ee = /*#__PURE__*/ u("<span>"), E = /*#__PURE__*/ u("<select class=sheen-select-native aria-hidden=true tabindex=-1><option value>"), D = /*#__PURE__*/ u("<span class=sheen-field-description>"), O = /*#__PURE__*/ u("<span class=sheen-field-error>"), k = /*#__PURE__*/ u("<option>"), te = /*#__PURE__*/ u("<p class=sheen-select-empty>");
10
+ function A(u) {
11
+ let [A, j] = b(u, [
11
12
  "id",
12
13
  "class",
13
14
  "label",
@@ -23,70 +24,70 @@ function A(l) {
23
24
  "disabled",
24
25
  "readOnly",
25
26
  "required"
26
- ]), M = e(), N = g(), P = A.defaultValue ?? null, [ne, F] = h(P), [I, L] = h(!1), R = () => A.value === void 0 ? ne() : A.value, [z, B] = h(), [V, H] = h();
27
- n(z, () => !0), n(V, I);
28
- let U, W, G = !1, K = !1;
29
- _(() => {
30
- G = !0;
27
+ ]), M = e(), N = _(), P = A.defaultValue ?? null, [ne, re] = g(P), [F, I] = g(!1), L = () => A.value === void 0 ? ne() : A.value, [R, z] = g(), [B, V] = g();
28
+ r(R, () => !0), r(B, F);
29
+ let H, U, W = !1, G = !1;
30
+ v(() => {
31
+ W = !0;
31
32
  });
32
- let q = m(() => {
33
+ let K = h(() => {
33
34
  let e = /* @__PURE__ */ new Map();
34
35
  for (let t of A.options) {
35
36
  if (!t.value) throw Error("Select: option values must be nonempty");
36
37
  if (e.has(t.value)) throw Error(`Select: duplicate option value ${JSON.stringify(t.value)}`);
37
38
  e.set(t.value, t);
38
39
  }
39
- return W && (K = !0, W.ownerDocument.defaultView?.queueMicrotask(() => {
40
- K = !1;
40
+ return U && (G = !0, U.ownerDocument.defaultView?.queueMicrotask(() => {
41
+ G = !1;
41
42
  })), e;
42
- }), J = [], Y = m(() => {
43
- let e = [...q().keys()], t = W, n = t?.querySelector("[role=option]:focus");
43
+ }), q = [], J = h(() => {
44
+ let e = [...K().keys()], t = U, n = t?.querySelector("[role=option]:focus");
44
45
  if (t && n) {
45
- let e = n.dataset.key, r = J.indexOf(e ?? "");
46
+ let e = n.dataset.key, r = q.indexOf(e ?? "");
46
47
  t.ownerDocument.defaultView?.queueMicrotask(() => {
47
- if (G || !t.isConnected) return;
48
+ if (W || !t.isConnected) return;
48
49
  let i = t.ownerDocument.activeElement;
49
50
  if (i !== t.ownerDocument.body && i !== n && i !== t) return;
50
51
  let a = [...t.querySelectorAll("[role=option]")], o = (e) => e.getAttribute("aria-disabled") !== "true", s = a.find((t) => t.dataset.key === e && o(t)), c = Math.max(0, r), l = a.slice(c).find(o) ?? a.slice(0, c).reverse().find(o);
51
52
  (s ?? l ?? t).focus({ preventScroll: !0 });
52
53
  });
53
54
  }
54
- return J = e, e;
55
- }), X = () => q().get(R() ?? ""), re = () => [A.description ? `${N}-description` : "", A.error ? `${N}-error` : ""].filter(Boolean).join(" ") || void 0, Z = (e) => {
56
- e !== R() && (A.value === void 0 && F(e), A.onValueChange?.(e));
55
+ return q = e, e;
56
+ }), Y = () => K().get(L() ?? ""), X = () => [A.description ? `${N}-description` : "", A.error ? `${N}-error` : ""].filter(Boolean).join(" ") || void 0, Z = (e) => {
57
+ e !== L() && (A.value === void 0 && re(e), A.onValueChange?.(e));
57
58
  }, Q = (e) => {
58
- !K && e && (A.disabled || A.readOnly || e && q().get(e)?.disabled || (L(!1), Z(e || null)));
59
+ !G && e && (A.disabled || A.readOnly || e && K().get(e)?.disabled || (I(!1), Z(e || null)));
59
60
  }, $ = () => {
60
- U && (U.value = X()?.value ?? "");
61
+ H && (H.value = Y()?.value ?? "");
61
62
  };
62
- p(() => {
63
- q(), R(), $();
64
- }), p(() => {
65
- I() && _(M.layers.register(N));
66
- }), p(() => {
67
- A.disabled && L(!1);
68
- }), v(() => {
69
- let e = U?.ownerDocument, t = e?.defaultView;
63
+ m(() => {
64
+ K(), L(), $();
65
+ }), m(() => {
66
+ F() && v(M.layers.register(N));
67
+ }), m(() => {
68
+ A.disabled && I(!1);
69
+ }), y(() => {
70
+ let e = H?.ownerDocument, t = e?.defaultView;
70
71
  if (!e || !t) return;
71
72
  let n = /* @__PURE__ */ new Set(), r = (e) => {
72
- if (e.target !== U?.form) return;
73
+ if (e.target !== H?.form) return;
73
74
  let r = t.setTimeout(() => {
74
- n.delete(r), !e.defaultPrevented && (A.value === void 0 && Z(P), $());
75
+ n.delete(r), e.defaultPrevented || (A.value === void 0 && Z(P), $());
75
76
  }, 0);
76
77
  n.add(r);
77
78
  };
78
- e.addEventListener("reset", r, !0), _(() => {
79
+ e.addEventListener("reset", r, !0), v(() => {
79
80
  e.removeEventListener("reset", r, !0);
80
81
  for (let e of n) t.clearTimeout(e);
81
82
  });
82
83
  });
83
84
  function ie(e) {
84
85
  return (() => {
85
- var t = S();
86
- return c(t, o(e, {
86
+ var t = C();
87
+ return l(t, s(e, {
87
88
  "aria-labelledby": `${N}-label ${N}-value`,
88
89
  get "aria-describedby"() {
89
- return re();
90
+ return X();
90
91
  },
91
92
  get "aria-invalid"() {
92
93
  return A.error ? !0 : void 0;
@@ -94,7 +95,7 @@ function A(l) {
94
95
  }), !1, !1), t;
95
96
  })();
96
97
  }
97
- return r(x.Root, o(j, {
98
+ return i(S.Root, s(j, {
98
99
  get id() {
99
100
  return A.id ?? `${N}-root`;
100
101
  },
@@ -103,24 +104,24 @@ function A(l) {
103
104
  return t("sheen-field sheen-select", A.class);
104
105
  },
105
106
  get options() {
106
- return Y();
107
+ return J();
107
108
  },
108
109
  optionValue: (e) => e,
109
- optionTextValue: (e) => q().get(e)?.label ?? e,
110
- optionDisabled: (e) => q().get(e)?.disabled ?? !1,
110
+ optionTextValue: (e) => K().get(e)?.label ?? e,
111
+ optionDisabled: (e) => K().get(e)?.disabled ?? !1,
111
112
  get value() {
112
- return R();
113
+ return L();
113
114
  },
114
115
  get defaultValue() {
115
- return R() ?? "";
116
+ return L() ?? "";
116
117
  },
117
118
  onChange: Q,
118
119
  closeOnSelection: !1,
119
120
  disallowEmptySelection: !0,
120
121
  get open() {
121
- return I();
122
+ return F();
122
123
  },
123
- onOpenChange: (e) => L(e && !A.disabled),
124
+ onOpenChange: (e) => I(e && !A.disabled),
124
125
  get disabled() {
125
126
  return A.disabled ?? !1;
126
127
  },
@@ -140,60 +141,63 @@ function A(l) {
140
141
  get children() {
141
142
  return [
142
143
  (() => {
143
- var e = w();
144
- return s(e, "id", `${N}-label`), s(e, "for", `${N}-trigger`), a(e, () => A.label, null), a(e, r(f, {
144
+ var e = T();
145
+ return c(e, "id", `${N}-label`), c(e, "for", `${N}-trigger`), o(e, () => A.label, null), o(e, i(p, {
145
146
  get when() {
146
147
  return A.required;
147
148
  },
148
149
  get children() {
149
- return C();
150
+ return w();
150
151
  }
151
152
  }), null), e;
152
153
  })(),
153
- r(x.Trigger, {
154
+ i(S.Trigger, {
154
155
  as: ie,
155
156
  "data-sheen-select-trigger": "",
156
157
  id: `${N}-trigger`,
157
- ref: B,
158
+ ref: z,
158
159
  get form() {
159
160
  return A.form;
160
161
  },
161
162
  class: "sheen-input sheen-select-trigger",
162
163
  onClick: (e) => {
163
- !A.disabled && (!e.currentTarget.dataset.pointerType || e.detail === 0) && L((e) => !e);
164
+ A.disabled || e.currentTarget.dataset.pointerType && e.detail !== 0 || I((e) => !e);
164
165
  },
165
166
  get children() {
166
167
  return [(() => {
167
- var e = T();
168
- return s(e, "id", `${N}-value`), a(e, () => X()?.label ?? A.placeholder ?? M.messages().selectOption), i(() => s(e, "data-placeholder", !X() || void 0)), e;
169
- })(), E()];
168
+ var e = ee();
169
+ return c(e, "id", `${N}-value`), o(e, () => Y()?.label ?? A.placeholder ?? M.messages().selectOption), a(() => c(e, "data-placeholder", !Y() || void 0)), e;
170
+ })(), i(n, {
171
+ name: "chevron-down",
172
+ class: "sheen-select-chevron"
173
+ })];
170
174
  }
171
175
  }),
172
176
  (() => {
173
- var e = D(), t = e.firstChild;
177
+ var e = E(), t = e.firstChild;
174
178
  e.addEventListener("change", (e) => {
175
179
  Q(e.currentTarget.value || null), $();
176
180
  }), e.addEventListener("invalid", (e) => {
177
- e.preventDefault(), z()?.focus();
181
+ e.preventDefault(), R()?.focus();
178
182
  });
179
- var n = U;
180
- return typeof n == "function" ? u(n, e) : U = e, s(e, "id", `${N}-native`), a(e, r(d, {
183
+ var n = H;
184
+ return typeof n == "function" ? d(n, e) : H = e, c(e, "id", `${N}-native`), o(e, i(f, {
181
185
  get each() {
182
- return Y();
186
+ return J();
183
187
  },
184
188
  children: (e) => (() => {
185
- var t = te();
186
- return t.value = e, a(t, () => q().get(e)?.label), i((n) => {
187
- var r = q().get(e)?.disabled, i = R() === e;
189
+ var t = k();
190
+ return t.value = e, o(t, () => K().get(e)?.label), a((n) => {
191
+ var r = K().get(e)?.disabled, i = L() === e;
188
192
  return r !== n.e && (t.disabled = n.e = r), i !== n.t && (t.selected = n.t = i), n;
189
193
  }, {
190
194
  e: void 0,
191
195
  t: void 0
192
196
  }), t;
193
197
  })()
194
- }), null), i((n) => {
195
- var r = A.name, i = A.form, a = A.required, o = A.disabled, c = A.label, l = !X();
196
- return r !== n.e && s(e, "name", n.e = r), i !== n.t && s(e, "form", n.t = i), a !== n.a && (e.required = n.a = a), o !== n.o && (e.disabled = n.o = o), c !== n.i && s(e, "aria-label", n.i = c), l !== n.n && (t.selected = n.n = l), n;
198
+ }), null), a((n) => {
199
+ var r = A.name, i = A.form, a = A.required, o = A.disabled, s = A.label, l = !Y();
200
+ return r !== n.e && c(e, "name", n.e = r), i !== n.t && c(e, "form", n.t = i), a !== n.a && (e.required = n.a = a), o !== n.o && (e.disabled = n.o = o), s !== n.i && c(e, "aria-label", n.i = s), l !== n.n && (t.selected = n.n = l), n;
197
201
  }, {
198
202
  e: void 0,
199
203
  t: void 0,
@@ -203,50 +207,50 @@ function A(l) {
203
207
  n: void 0
204
208
  }), e;
205
209
  })(),
206
- r(f, {
210
+ i(p, {
207
211
  get when() {
208
212
  return A.description;
209
213
  },
210
214
  get children() {
211
- var e = O();
212
- return s(e, "id", `${N}-description`), a(e, () => A.description), e;
215
+ var e = D();
216
+ return c(e, "id", `${N}-description`), o(e, () => A.description), e;
213
217
  }
214
218
  }),
215
- r(f, {
219
+ i(p, {
216
220
  get when() {
217
221
  return A.error;
218
222
  },
219
223
  get children() {
220
- var e = ee();
221
- return s(e, "id", `${N}-error`), a(e, () => A.error), e;
224
+ var e = O();
225
+ return c(e, "id", `${N}-error`), o(e, () => A.error), e;
222
226
  }
223
227
  }),
224
- r(f, {
228
+ i(p, {
225
229
  get when() {
226
230
  return M.portal();
227
231
  },
228
- children: (e) => r(x.Portal, {
232
+ children: (e) => i(S.Portal, {
229
233
  get mount() {
230
234
  return e();
231
235
  },
232
236
  get children() {
233
- return r(x.Content, {
234
- ref: H,
237
+ return i(S.Content, {
238
+ ref: V,
235
239
  "data-kb-top-layer": "true",
236
240
  get "aria-hidden"() {
237
- return !I() || void 0;
241
+ return !F() || void 0;
238
242
  },
239
243
  get inert() {
240
- return !I();
244
+ return !F();
241
245
  },
242
246
  class: "sheen-select-content",
243
247
  get style() {
244
248
  return { "z-index": M.layers.zIndex(N) };
245
249
  },
246
250
  get children() {
247
- return [r(x.Listbox, {
251
+ return [i(S.Listbox, {
248
252
  ref: (e) => {
249
- W = e;
253
+ U = e;
250
254
  },
251
255
  class: "sheen-select-listbox",
252
256
  "aria-labelledby": `${N}-label`,
@@ -254,57 +258,59 @@ function A(l) {
254
258
  e.target === e.currentTarget && e.currentTarget.querySelector("[role=option][data-highlighted]:not([data-disabled])")?.focus({ preventScroll: !0 });
255
259
  },
256
260
  scrollToItem: (e) => {
257
- let t = [...W?.querySelectorAll("[role=option]") ?? []].find((t) => t.dataset.key === e);
261
+ let t = [...U?.querySelectorAll("[role=option]") ?? []].find((t) => t.dataset.key === e);
258
262
  t?.focus({ preventScroll: !0 }), t?.scrollIntoView({
259
263
  block: "nearest",
260
264
  inline: "nearest"
261
265
  });
262
266
  },
263
- children: (e) => r(d, {
267
+ children: (e) => i(f, {
264
268
  get each() {
265
- return Y();
269
+ return J();
266
270
  },
267
271
  children: (t) => {
268
- let n = b(() => e().getItem(t));
269
- if (!n) throw Error(`Select: missing collection item ${JSON.stringify(t)}`);
270
- return r(x.Item, {
272
+ let r = x(() => e().getItem(t));
273
+ if (!r) throw Error(`Select: missing collection item ${JSON.stringify(t)}`);
274
+ return i(S.Item, {
271
275
  get item() {
272
- return e().getItem(t) ?? n;
276
+ return e().getItem(t) ?? r;
273
277
  },
274
278
  class: "sheen-select-option",
275
279
  get children() {
276
280
  return [
277
- r(x.ItemLabel, { get children() {
278
- return q().get(t)?.label;
281
+ i(S.ItemLabel, { get children() {
282
+ return K().get(t)?.label;
279
283
  } }),
280
- r(f, {
284
+ i(p, {
281
285
  get when() {
282
- return q().get(t)?.description;
286
+ return K().get(t)?.description;
283
287
  },
284
- children: (e) => r(x.ItemDescription, {
288
+ children: (e) => i(S.ItemDescription, {
285
289
  class: "sheen-select-option-description",
286
290
  get children() {
287
291
  return e();
288
292
  }
289
293
  })
290
294
  }),
291
- r(x.ItemIndicator, {
295
+ i(S.ItemIndicator, {
292
296
  class: "sheen-select-indicator",
293
297
  "aria-hidden": "true",
294
- children: "✓"
298
+ get children() {
299
+ return i(n, { name: "check" });
300
+ }
295
301
  })
296
302
  ];
297
303
  }
298
304
  });
299
305
  }
300
306
  })
301
- }), r(f, {
307
+ }), i(p, {
302
308
  get when() {
303
- return !Y().length;
309
+ return !J().length;
304
310
  },
305
311
  get children() {
306
- var e = k();
307
- return a(e, () => M.messages().noResults), e;
312
+ var e = te();
313
+ return o(e, () => M.messages().noResults), e;
308
314
  }
309
315
  })];
310
316
  }
@@ -316,5 +322,4 @@ function A(l) {
316
322
  }
317
323
  }));
318
324
  }
319
- //#endregion
320
325
  export { A as Select };
@@ -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/Separator.tsx
4
+ // src/primitives/Separator.tsx
5
5
  var a = /*#__PURE__*/ r("<hr>");
6
6
  function o(r) {
7
7
  let [o, s] = i(r, [
@@ -27,5 +27,4 @@ function o(r) {
27
27
  }), !1, !1), r;
28
28
  })();
29
29
  }
30
- //#endregion
31
30
  export { o as Separator };
@@ -1,18 +1,18 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { usePendingShortcut as n } from "./ShortcutProvider.js";
4
- import { Kbd as r } from "./Typography.js";
1
+ import { usePendingShortcut as e } from "./ShortcutProvider.js";
2
+ import { Kbd as t } from "./Typography.js";
3
+ import { useTheme as n } from "../theme/ThemeProvider.js";
4
+ import { cn as r } from "../utils/cn.js";
5
5
  import { createComponent as i, insert as a, mergeProps as o, spread as s, template as c } from "solid-js/web";
6
6
  import { For as l, splitProps as u } from "solid-js";
7
- //#region src/primitives/ShortcutPending.tsx
7
+ // src/primitives/ShortcutPending.tsx
8
8
  var d = /*#__PURE__*/ c("<div>"), f = /*#__PURE__*/ c("<span>: ");
9
9
  function p(c) {
10
- let [p, m] = u(c, ["label", "class"]), h = n(), g = e();
10
+ let [p, m] = u(c, ["label", "class"]), h = e(), g = n();
11
11
  return (() => {
12
12
  var e = d();
13
13
  return s(e, o(m, {
14
14
  get class() {
15
- return t("sheen-shortcut-pending", p.class);
15
+ return r("sheen-shortcut-pending", p.class);
16
16
  },
17
17
  role: "status",
18
18
  "aria-live": "polite",
@@ -27,14 +27,13 @@ function p(c) {
27
27
  get each() {
28
28
  return h();
29
29
  },
30
- children: (e, t) => (() => {
31
- var n = f(), o = n.firstChild;
32
- return a(n, i(r, { get children() {
30
+ children: (e, n) => (() => {
31
+ var r = f(), o = r.firstChild;
32
+ return a(r, i(t, { get children() {
33
33
  return e.displayKeys;
34
- } }), o), a(n, () => e.label, null), a(n, () => t() < h().length - 1 ? "; " : "", null), n;
34
+ } }), o), a(r, () => e.label, null), a(r, () => n() < h().length - 1 ? "; " : "", null), r;
35
35
  })()
36
36
  })), e;
37
37
  })();
38
38
  }
39
- //#endregion
40
39
  export { p as ShortcutPending };
@@ -10,6 +10,11 @@ export interface ShortcutProviderProps {
10
10
  }
11
11
  /** One provider per document. Dialogs override application-owned base scopes while open. */
12
12
  export declare function ShortcutProvider(props: ShortcutProviderProps): JSX.Element;
13
+ /**
14
+ * Platform display text for a shortcut definition (`mod+k` → `Ctrl+K`, or `⌘+K` on Apple platforms).
15
+ * Server markup and the first client frame use the non-Apple form; the platform resolves after mount.
16
+ */
17
+ export declare function useShortcutLabel(keys: Accessor<string | undefined>): Accessor<string | undefined>;
13
18
  /** Register in the nearest provider and release the binding with its Solid owner. */
14
19
  export declare function useShortcut(definition: ShortcutDefinition): void;
15
20
  /** Internal control binding. Outside a provider the control remains usable without a shortcut. */