@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,14 +1,15 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { useShortcutKeyboardOwner as n } from "./ShortcutProvider.js";
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
4
  import { Button as r } from "./Button.js";
5
- import { Tag as i } from "./Status.js";
6
- import { createComponent as a, effect as o, insert as s, memo as c, mergeProps as l, setAttribute as u, template as d, use as f } from "solid-js/web";
7
- import { For as p, Show as m, createEffect as h, createMemo as g, createSignal as _, createUniqueId as v, onCleanup as y, onMount as b, splitProps as x } from "solid-js";
8
- import * as S from "#sheen-kobalte/combobox";
9
- //#region src/primitives/Combobox.tsx
10
- var C = /*#__PURE__*/ d("<p class=sheen-combobox-status role=status aria-live=polite>"), w = /*#__PURE__*/ d("<p class=sheen-select-empty>"), T = /*#__PURE__*/ d("<div class=sheen-combobox-results-error role=alert><span>"), E = /*#__PURE__*/ d("<span aria-hidden=true> *"), D = /*#__PURE__*/ d("<label class=sheen-field-label>"), O = /*#__PURE__*/ d("<select class=sheen-select-native aria-hidden=true tabindex=-1><option value>"), k = /*#__PURE__*/ d("<option>"), A = /*#__PURE__*/ d("<select class=sheen-select-native aria-hidden=true tabindex=-1 multiple>");
11
- function j(e, t) {
5
+ import { useShortcutKeyboardOwner as i } from "./ShortcutProvider.js";
6
+ import { Tag as a } from "./Status.js";
7
+ import { createComponent as o, effect as s, insert as c, memo as l, mergeProps as u, setAttribute as d, template as f, use as p } from "solid-js/web";
8
+ import { For as m, Show as h, createEffect as g, createMemo as _, createSignal as v, createUniqueId as y, onCleanup as b, onMount as x, splitProps as S } from "solid-js";
9
+ import * as C from "#sheen-kobalte/combobox";
10
+ // src/primitives/Combobox.tsx
11
+ var w = /*#__PURE__*/ f("<p class=sheen-combobox-status role=status aria-live=polite>"), T = /*#__PURE__*/ f("<p class=sheen-select-empty>"), E = /*#__PURE__*/ f("<div class=sheen-combobox-results-error role=alert><span>"), D = /*#__PURE__*/ f("<span aria-hidden=true> *"), O = /*#__PURE__*/ f("<label class=sheen-field-label>"), k = /*#__PURE__*/ f("<select class=sheen-select-native aria-hidden=true tabindex=-1><option value>"), A = /*#__PURE__*/ f("<option>"), j = /*#__PURE__*/ f("<select class=sheen-select-native aria-hidden=true tabindex=-1 multiple>");
12
+ function M(e, t) {
12
13
  let n = /* @__PURE__ */ new Map();
13
14
  for (let r of e) {
14
15
  if (!r.value) throw Error(`${t}: option values must be nonempty`);
@@ -21,9 +22,9 @@ function j(e, t) {
21
22
  map: n
22
23
  };
23
24
  }
24
- function M(e, t, n) {
25
- let r, i = /* @__PURE__ */ new Map(), a = g(() => {
26
- let a = j(e(), n);
25
+ function N(e, t, n) {
26
+ let r, i = /* @__PURE__ */ new Map(), a = _(() => {
27
+ let a = M(e(), n);
27
28
  if (t() && r) return {
28
29
  snapshot: r,
29
30
  retained: !0
@@ -34,7 +35,7 @@ function M(e, t, n) {
34
35
  snapshot: a,
35
36
  retained: !1
36
37
  };
37
- }), o = g(() => a().snapshot), s = (e, t) => {
38
+ }), o = _(() => a().snapshot), s = (e, t) => {
38
39
  o();
39
40
  let n = i.get(e);
40
41
  if (!n) throw Error(`${t}: selected value ${JSON.stringify(e)} has not appeared in options`);
@@ -51,7 +52,7 @@ function M(e, t, n) {
51
52
  }
52
53
  };
53
54
  }
54
- function N(e, t) {
55
+ function P(e, t) {
55
56
  let n = /* @__PURE__ */ new Set();
56
57
  for (let r of e) {
57
58
  if (!r) throw Error(`${t}: selected values must be nonempty`);
@@ -59,21 +60,21 @@ function N(e, t) {
59
60
  n.add(r);
60
61
  }
61
62
  }
62
- function P(e, t) {
63
+ function F(e, t) {
63
64
  return e.normalize("NFKD").replaceAll(/\p{M}/gu, "").toLocaleLowerCase(t);
64
65
  }
65
- function F(e, t, n) {
66
+ function ee(e, t, n) {
66
67
  return (r, i) => {
67
68
  if (!e.includesAccepted(r.value)) return !1;
68
69
  if (t() === !1) return !0;
69
- let a = P(r.label, n()), o = P(i, n());
70
+ let a = F(r.label, n()), o = F(i, n());
70
71
  return t() === "startsWith" ? a.startsWith(o) : t() === "endsWith" ? a.endsWith(o) : a.includes(o);
71
72
  };
72
73
  }
73
- function ee(e) {
74
- return a(S.Item, {
74
+ function te(t) {
75
+ return o(C.Item, {
75
76
  get item() {
76
- return e.item;
77
+ return t.item;
77
78
  },
78
79
  class: "sheen-select-option sheen-combobox-option",
79
80
  onPointerDown: (e) => {
@@ -81,102 +82,104 @@ function ee(e) {
81
82
  },
82
83
  get children() {
83
84
  return [
84
- a(S.ItemLabel, { get children() {
85
- return e.item.rawValue.label;
85
+ o(C.ItemLabel, { get children() {
86
+ return t.item.rawValue.label;
86
87
  } }),
87
- a(m, {
88
+ o(h, {
88
89
  get when() {
89
- return e.item.rawValue.description;
90
+ return t.item.rawValue.description;
90
91
  },
91
- children: (e) => a(S.ItemDescription, {
92
+ children: (e) => o(C.ItemDescription, {
92
93
  class: "sheen-select-option-description",
93
94
  get children() {
94
95
  return e();
95
96
  }
96
97
  })
97
98
  }),
98
- a(S.ItemIndicator, {
99
+ o(C.ItemIndicator, {
99
100
  class: "sheen-select-indicator",
100
101
  "aria-hidden": "true",
101
- children: "✓"
102
+ get children() {
103
+ return o(e, { name: "check" });
104
+ }
102
105
  })
103
106
  ];
104
107
  }
105
108
  });
106
109
  }
107
- function te(t) {
108
- let n = e();
109
- return a(m, {
110
+ function I(e) {
111
+ let n = t();
112
+ return o(h, {
110
113
  get when() {
111
114
  return n.portal();
112
115
  },
113
- children: (e) => a(S.Portal, {
116
+ children: (t) => o(C.Portal, {
114
117
  get mount() {
115
- return e();
118
+ return t();
116
119
  },
117
120
  get children() {
118
- return a(S.Content, {
119
- ref(e) {
120
- var n = t.setContent;
121
- typeof n == "function" ? n(e) : t.setContent = e;
121
+ return o(C.Content, {
122
+ ref(t) {
123
+ var n = e.setContent;
124
+ typeof n == "function" ? n(t) : e.setContent = t;
122
125
  },
123
126
  "data-kb-top-layer": "true",
124
127
  get "aria-hidden"() {
125
- return !t.open() || void 0;
128
+ return !e.open() || void 0;
126
129
  },
127
130
  get inert() {
128
- return !t.open();
131
+ return !e.open();
129
132
  },
130
133
  class: "sheen-select-content sheen-combobox-content",
131
134
  get style() {
132
- return { "z-index": n.layers.zIndex(t.id) };
135
+ return { "z-index": n.layers.zIndex(e.id) };
133
136
  },
134
137
  get children() {
135
138
  return [
136
- a(S.Listbox, {
139
+ o(C.Listbox, {
137
140
  class: "sheen-select-listbox sheen-combobox-listbox",
138
141
  get "aria-label"() {
139
- return `${t.label} Suggestions`;
142
+ return `${e.label} Suggestions`;
140
143
  },
141
144
  get inert() {
142
- return t.pending();
145
+ return e.pending();
143
146
  },
144
147
  get "aria-disabled"() {
145
- return t.pending() || void 0;
148
+ return e.pending() || void 0;
146
149
  }
147
150
  }),
148
- a(m, {
151
+ o(h, {
149
152
  get when() {
150
- return t.pending();
153
+ return e.pending();
151
154
  },
152
155
  get children() {
153
- var e = C();
154
- return s(e, (() => {
155
- var e = c(() => !!t.state().retained);
156
- return () => e() ? n.messages().refreshing ?? n.messages().loading : n.messages().loading;
157
- })()), e;
156
+ var t = w();
157
+ return c(t, (() => {
158
+ var t = l(() => !!e.state().retained);
159
+ return () => t() ? n.messages().refreshing ?? n.messages().loading : n.messages().loading;
160
+ })()), t;
158
161
  }
159
162
  }),
160
- a(m, {
163
+ o(h, {
161
164
  get when() {
162
- return c(() => !(t.pending() || t.state().snapshot.list.length))() && !t.resultsError();
165
+ return l(() => !(e.pending() || e.state().snapshot.list.length))() && !e.resultsError();
163
166
  },
164
167
  get children() {
165
- var e = w();
166
- return s(e, () => n.messages().noResults), e;
168
+ var e = T();
169
+ return c(e, () => n.messages().noResults), e;
167
170
  }
168
171
  }),
169
- a(m, {
172
+ o(h, {
170
173
  get when() {
171
- return t.resultsError();
174
+ return e.resultsError();
172
175
  },
173
- children: (e) => (() => {
174
- var i = T(), o = i.firstChild;
175
- return s(o, e), s(i, a(m, {
176
+ children: (t) => (() => {
177
+ var i = E(), a = i.firstChild;
178
+ return c(a, t), c(i, o(h, {
176
179
  get when() {
177
- return t.onRetry();
180
+ return e.onRetry();
178
181
  },
179
- children: (e) => a(r, {
182
+ children: (e) => o(r, {
180
183
  size: "sm",
181
184
  onClick: () => e()(),
182
185
  get children() {
@@ -193,9 +196,9 @@ function te(t) {
193
196
  })
194
197
  });
195
198
  }
196
- function I(e) {
197
- let t = S.useComboboxContext(), n = !1;
198
- return h(() => {
199
+ function L(e) {
200
+ let t = C.useComboboxContext(), n = !1;
201
+ return g(() => {
199
202
  if (e.snapshot(), !n) {
200
203
  n = !0;
201
204
  return;
@@ -207,13 +210,13 @@ function I(e) {
207
210
  });
208
211
  }), null;
209
212
  }
210
- function L(e) {
211
- return [a(m, {
213
+ function R(e) {
214
+ return [o(h, {
212
215
  get when() {
213
216
  return e.description;
214
217
  },
215
218
  get children() {
216
- return a(S.Description, {
219
+ return o(C.Description, {
217
220
  get id() {
218
221
  return `${e.id}-description`;
219
222
  },
@@ -223,12 +226,12 @@ function L(e) {
223
226
  }
224
227
  });
225
228
  }
226
- }), a(m, {
229
+ }), o(h, {
227
230
  get when() {
228
231
  return e.error;
229
232
  },
230
233
  get children() {
231
- return a(S.ErrorMessage, {
234
+ return o(C.ErrorMessage, {
232
235
  get id() {
233
236
  return `${e.id}-error`;
234
237
  },
@@ -240,11 +243,11 @@ function L(e) {
240
243
  }
241
244
  })];
242
245
  }
243
- function R(e, t, n) {
246
+ function z(e, t, n) {
244
247
  return [t ? `${e}-description` : "", n ? `${e}-error` : ""].filter(Boolean).join(" ") || void 0;
245
248
  }
246
- function z(r) {
247
- let [i, c] = x(r, [
249
+ function B(e) {
250
+ let [r, a] = S(e, [
248
251
  "id",
249
252
  "class",
250
253
  "label",
@@ -266,7 +269,7 @@ function z(r) {
266
269
  "resultsError",
267
270
  "onRetry",
268
271
  "inputRef"
269
- ]), d = e(), C = v(), w = i.defaultValue ?? null, [T, A] = _(w), [j, N] = _(!1), [P, z] = _(), [B, V] = _(), [H, U] = _(""), [W, G] = _(!1), K, q = () => i.value === void 0 ? T() : i.value, J = M(() => i.options, () => i.pending ?? !1, "Combobox"), Y = () => {
272
+ ]), l = t(), f = y(), w = r.defaultValue ?? null, [T, E] = v(w), [j, M] = v(!1), [P, F] = v(), [B, V] = v(), [H, U] = v(""), [W, G] = v(!1), K, q = () => r.value === void 0 ? T() : r.value, J = N(() => r.options, () => r.pending ?? !1, "Combobox"), Y = () => {
270
273
  let e = q();
271
274
  if (e === "") throw Error("Combobox: selected values must be nonempty");
272
275
  return e === null ? [] : [e];
@@ -274,44 +277,44 @@ function z(r) {
274
277
  let e = q();
275
278
  if (e === "") throw Error("Combobox: selected values must be nonempty");
276
279
  return e === null ? null : J.resolve(e, "Combobox");
277
- }, Z = g(() => J.rootOptions(Y())), ne = F(J, () => i.filter ?? "contains", () => d.state().locale);
278
- n(P, () => !0), n(B, j);
280
+ }, Z = _(() => J.rootOptions(Y())), ne = ee(J, () => r.filter ?? "contains", () => l.state().locale);
281
+ i(P, () => !0), i(B, j);
279
282
  let Q = (e) => {
280
- if (i.disabled || i.readOnly || i.pending) return;
283
+ if (r.disabled || r.readOnly || r.pending) return;
281
284
  let t = e?.value ?? null;
282
- t !== q() && (G(!1), i.value === void 0 && A(t), i.onValueChange?.(t));
285
+ t !== q() && (G(!1), r.value === void 0 && E(t), r.onValueChange?.(t));
283
286
  }, $ = () => {
284
287
  K && (K.value = q() ?? "");
285
288
  };
286
- return h(() => {
289
+ return g(() => {
287
290
  q(), Z(), $();
288
- }), b(() => {
291
+ }), x(() => {
289
292
  let e = K?.ownerDocument, t = e?.defaultView;
290
293
  if (!e || !t) return;
291
- let n = /* @__PURE__ */ new Set(), r = (e) => {
294
+ let n = /* @__PURE__ */ new Set(), i = (e) => {
292
295
  if (e.target !== K?.form) return;
293
- let r = t.setTimeout(() => {
294
- n.delete(r), !e.defaultPrevented && (i.value === void 0 && Q(w === null ? null : J.resolve(w, "Combobox defaultValue")), $());
296
+ let i = t.setTimeout(() => {
297
+ n.delete(i), e.defaultPrevented || (r.value === void 0 && Q(w === null ? null : J.resolve(w, "Combobox defaultValue")), $());
295
298
  }, 0);
296
- n.add(r);
299
+ n.add(i);
297
300
  };
298
- e.addEventListener("reset", r, !0), y(() => {
299
- e.removeEventListener("reset", r, !0);
301
+ e.addEventListener("reset", i, !0), b(() => {
302
+ e.removeEventListener("reset", i, !0);
300
303
  for (let e of n) t.clearTimeout(e);
301
304
  });
302
- }), h(() => {
303
- j() && y(d.layers.register(C));
304
- }), a(S.Root, l(c, {
305
+ }), g(() => {
306
+ j() && b(l.layers.register(f));
307
+ }), o(C.Root, u(a, {
305
308
  get id() {
306
- return i.id ?? `${C}-root`;
309
+ return r.id ?? `${f}-root`;
307
310
  },
308
- "aria-labelledby": `${C}-label`,
311
+ "aria-labelledby": `${f}-label`,
309
312
  multiple: !1,
310
313
  get class() {
311
- return t("sheen-field sheen-combobox", i.class);
314
+ return n("sheen-field sheen-combobox", r.class);
312
315
  },
313
316
  get "data-previous-results"() {
314
- return i.pending && J.state().retained ? "" : void 0;
317
+ return r.pending && J.state().retained ? "" : void 0;
315
318
  },
316
319
  get options() {
317
320
  return Z();
@@ -320,7 +323,7 @@ function z(r) {
320
323
  optionTextValue: (e) => e.label,
321
324
  optionLabel: (e) => e.label,
322
325
  optionDisabled: (e) => !!e.disabled,
323
- itemComponent: ee,
326
+ itemComponent: te,
324
327
  get value() {
325
328
  return X();
326
329
  }
@@ -334,19 +337,19 @@ function z(r) {
334
337
  return j();
335
338
  },
336
339
  onOpenChange: (e) => {
337
- N(e && !i.disabled), e || G(!1);
340
+ M(e && !r.disabled), e || G(!1);
338
341
  },
339
342
  get disabled() {
340
- return i.disabled ?? !1;
343
+ return r.disabled ?? !1;
341
344
  },
342
345
  get readOnly() {
343
- return i.readOnly ?? !1;
346
+ return r.readOnly ?? !1;
344
347
  },
345
348
  get required() {
346
- return i.required ?? !1;
349
+ return r.required ?? !1;
347
350
  },
348
351
  get validationState() {
349
- return i.error ? "invalid" : "valid";
352
+ return r.error ? "invalid" : "valid";
350
353
  },
351
354
  placement: "bottom-start",
352
355
  sameWidth: !0,
@@ -354,44 +357,44 @@ function z(r) {
354
357
  get children() {
355
358
  return [
356
359
  (() => {
357
- var e = D();
358
- return u(e, "id", `${C}-label`), u(e, "for", `${C}-input`), s(e, () => i.label, null), s(e, a(m, {
360
+ var e = O();
361
+ return d(e, "id", `${f}-label`), d(e, "for", `${f}-input`), c(e, () => r.label, null), c(e, o(h, {
359
362
  get when() {
360
- return i.required;
363
+ return r.required;
361
364
  },
362
365
  get children() {
363
- return E();
366
+ return D();
364
367
  }
365
368
  }), null), e;
366
369
  })(),
367
- a(S.Control, {
370
+ o(C.Control, {
368
371
  class: "sheen-combobox-control",
369
372
  get children() {
370
- return a(S.Input, {
371
- id: `${C}-input`,
372
- "aria-labelledby": `${C}-label`,
373
+ return o(C.Input, {
374
+ id: `${f}-input`,
375
+ "aria-labelledby": `${f}-label`,
373
376
  get "aria-describedby"() {
374
- return R(C, i.description, i.error);
377
+ return z(f, r.description, r.error);
375
378
  },
376
379
  ref: (e) => {
377
- z(e), i.inputRef?.(e);
380
+ F(e), r.inputRef?.(e);
378
381
  },
379
382
  class: "sheen-input sheen-combobox-input",
380
383
  get placeholder() {
381
- return i.placeholder;
384
+ return r.placeholder;
382
385
  },
383
386
  get "aria-busy"() {
384
- return i.pending || void 0;
387
+ return r.pending || void 0;
385
388
  },
386
389
  onInput: () => {
387
390
  let e = P()?.value ?? "";
388
- U(e), G(!0), i.onInputChange?.(e);
391
+ U(e), G(!0), r.onInputChange?.(e);
389
392
  }
390
393
  });
391
394
  }
392
395
  }),
393
396
  (() => {
394
- var e = O();
397
+ var e = k();
395
398
  e.firstChild, e.addEventListener("change", (e) => {
396
399
  let t = e.currentTarget.value;
397
400
  Q(t === "" ? null : J.resolve(t, "Combobox native value")), $();
@@ -399,23 +402,23 @@ function z(r) {
399
402
  e.preventDefault(), P()?.focus();
400
403
  });
401
404
  var t = K;
402
- return typeof t == "function" ? f(t, e) : K = e, u(e, "id", `${C}-native`), s(e, a(p, {
405
+ return typeof t == "function" ? p(t, e) : K = e, d(e, "id", `${f}-native`), c(e, o(m, {
403
406
  get each() {
404
407
  return Z();
405
408
  },
406
409
  children: (e) => (() => {
407
- var t = k();
408
- return s(t, () => e.label), o((n) => {
410
+ var t = A();
411
+ return c(t, () => e.label), s((n) => {
409
412
  var r = e.disabled, i = q() === e.value;
410
413
  return r !== n.e && (t.disabled = n.e = r), i !== n.t && (t.selected = n.t = i), n;
411
414
  }, {
412
415
  e: void 0,
413
416
  t: void 0
414
- }), o(() => t.value = e.value), t;
417
+ }), s(() => t.value = e.value), t;
415
418
  })()
416
- }), null), o((t) => {
417
- var n = i.name, r = i.form, a = i.required, o = !!(i.disabled || q() === null && !i.required), s = i.label;
418
- return n !== t.e && u(e, "name", t.e = n), r !== t.t && u(e, "form", t.t = r), a !== t.a && (e.required = t.a = a), o !== t.o && (e.disabled = t.o = o), s !== t.i && u(e, "aria-label", t.i = s), t;
419
+ }), null), s((t) => {
420
+ var n = r.name, i = r.form, a = r.required, o = !!(r.disabled || q() === null && !r.required), s = r.label;
421
+ return n !== t.e && d(e, "name", t.e = n), i !== t.t && d(e, "form", t.t = i), a !== t.a && (e.required = t.a = a), o !== t.o && (e.disabled = t.o = o), s !== t.i && d(e, "aria-label", t.i = s), t;
419
422
  }, {
420
423
  e: void 0,
421
424
  t: void 0,
@@ -424,40 +427,40 @@ function z(r) {
424
427
  i: void 0
425
428
  }), e;
426
429
  })(),
427
- a(I, {
430
+ o(L, {
428
431
  snapshot: () => J.state().snapshot,
429
432
  active: () => j() && W() && P()?.ownerDocument.activeElement === P(),
430
433
  inputValue: H
431
434
  }),
432
- a(L, {
433
- id: C,
435
+ o(R, {
436
+ id: f,
434
437
  get description() {
435
- return i.description;
438
+ return r.description;
436
439
  },
437
440
  get error() {
438
- return i.error;
441
+ return r.error;
439
442
  }
440
443
  }),
441
- a(te, {
442
- id: C,
444
+ o(I, {
445
+ id: f,
443
446
  get label() {
444
- return i.label;
447
+ return r.label;
445
448
  },
446
449
  open: j,
447
450
  get state() {
448
451
  return J.state;
449
452
  },
450
- pending: () => i.pending ?? !1,
451
- resultsError: () => i.resultsError,
452
- onRetry: () => i.onRetry,
453
+ pending: () => r.pending ?? !1,
454
+ resultsError: () => r.resultsError,
455
+ onRetry: () => r.onRetry,
453
456
  setContent: V
454
457
  })
455
458
  ];
456
459
  }
457
460
  }));
458
461
  }
459
- function B(r) {
460
- let [d, C] = x(r, [
462
+ function V(e) {
463
+ let [r, f] = S(e, [
461
464
  "id",
462
465
  "class",
463
466
  "label",
@@ -479,54 +482,54 @@ function B(r) {
479
482
  "resultsError",
480
483
  "onRetry",
481
484
  "inputRef"
482
- ]), w = e(), T = v(), O = [...d.defaultValue ?? []];
483
- N(O, "MultiCombobox defaultValue");
484
- let [j, P] = _(O), [I, z] = _(!1), [B, V] = _(), [H, U] = _(), W, G = () => {
485
- let e = d.value === void 0 ? j() : d.value;
486
- return N(e, "MultiCombobox value"), e;
487
- }, K = M(() => d.options, () => d.pending ?? !1, "MultiCombobox"), q = g(() => G().map((e) => K.resolve(e, "MultiCombobox"))), J = g(() => K.rootOptions(G())), Y = F(K, () => d.filter ?? "contains", () => w.state().locale);
488
- n(B, () => !0), n(H, I);
485
+ ]), w = t(), T = y(), E = [...r.defaultValue ?? []];
486
+ P(E, "MultiCombobox defaultValue");
487
+ let [k, M] = v(E), [F, L] = v(!1), [B, V] = v(), [H, U] = v(), W, G = () => {
488
+ let e = r.value === void 0 ? k() : r.value;
489
+ return P(e, "MultiCombobox value"), e;
490
+ }, K = N(() => r.options, () => r.pending ?? !1, "MultiCombobox"), q = _(() => G().map((e) => K.resolve(e, "MultiCombobox"))), J = _(() => K.rootOptions(G())), Y = ee(K, () => r.filter ?? "contains", () => w.state().locale);
491
+ i(B, () => !0), i(H, F);
489
492
  let X = (e) => {
490
- if (d.disabled || d.readOnly) return;
491
- N(e, "MultiCombobox value");
493
+ if (r.disabled || r.readOnly) return;
494
+ P(e, "MultiCombobox value");
492
495
  let t = G();
493
- t.length === e.length && t.every((t, n) => t === e[n]) || (d.value === void 0 && P([...e]), d.onValueChange?.([...e]));
496
+ t.length === e.length && t.every((t, n) => t === e[n]) || (r.value === void 0 && M([...e]), r.onValueChange?.([...e]));
494
497
  }, Z = (e) => {
495
- d.pending || X(e.map((e) => e.value));
498
+ r.pending || X(e.map((e) => e.value));
496
499
  }, ne = (e) => X(G().filter((t) => t !== e)), Q = () => {
497
500
  if (!W) return;
498
501
  let e = new Set(G());
499
502
  for (let t of W.options) t.selected = e.has(t.value);
500
503
  };
501
- return h(() => {
504
+ return g(() => {
502
505
  G(), J(), Q();
503
- }), b(() => {
506
+ }), x(() => {
504
507
  let e = W?.ownerDocument, t = e?.defaultView;
505
508
  if (!e || !t) return;
506
- let n = /* @__PURE__ */ new Set(), r = (e) => {
509
+ let n = /* @__PURE__ */ new Set(), i = (e) => {
507
510
  if (e.target !== W?.form) return;
508
- let r = t.setTimeout(() => {
509
- n.delete(r), !e.defaultPrevented && (d.value === void 0 && X(O), Q());
511
+ let i = t.setTimeout(() => {
512
+ n.delete(i), e.defaultPrevented || (r.value === void 0 && X(E), Q());
510
513
  }, 0);
511
- n.add(r);
514
+ n.add(i);
512
515
  };
513
- e.addEventListener("reset", r, !0), y(() => {
514
- e.removeEventListener("reset", r, !0);
516
+ e.addEventListener("reset", i, !0), b(() => {
517
+ e.removeEventListener("reset", i, !0);
515
518
  for (let e of n) t.clearTimeout(e);
516
519
  });
517
- }), h(() => {
518
- I() && y(w.layers.register(T));
519
- }), a(S.Root, l(C, {
520
+ }), g(() => {
521
+ F() && b(w.layers.register(T));
522
+ }), o(C.Root, u(f, {
520
523
  get id() {
521
- return d.id ?? `${T}-root`;
524
+ return r.id ?? `${T}-root`;
522
525
  },
523
526
  "aria-labelledby": `${T}-label`,
524
527
  multiple: !0,
525
528
  get class() {
526
- return t("sheen-field sheen-combobox sheen-multi-combobox", d.class);
529
+ return n("sheen-field sheen-combobox sheen-multi-combobox", r.class);
527
530
  },
528
531
  get "data-previous-results"() {
529
- return d.pending && K.state().retained ? "" : void 0;
532
+ return r.pending && K.state().retained ? "" : void 0;
530
533
  },
531
534
  get options() {
532
535
  return J();
@@ -534,13 +537,13 @@ function B(r) {
534
537
  optionValue: (e) => e.value,
535
538
  optionTextValue: (e) => e.label,
536
539
  optionLabel: (e) => e.label,
537
- optionDisabled: (e) => !!(d.pending || e.disabled),
538
- itemComponent: ee,
540
+ optionDisabled: (e) => !!(r.pending || e.disabled),
541
+ itemComponent: te,
539
542
  get value() {
540
543
  return q();
541
544
  },
542
545
  get defaultValue() {
543
- return O.map((e) => K.resolve(e, "MultiCombobox defaultValue"));
546
+ return E.map((e) => K.resolve(e, "MultiCombobox defaultValue"));
544
547
  },
545
548
  onChange: Z,
546
549
  defaultFilter: Y,
@@ -549,20 +552,20 @@ function B(r) {
549
552
  removeOnBackspace: !0,
550
553
  selectionBehavior: "toggle",
551
554
  get open() {
552
- return I();
555
+ return F();
553
556
  },
554
- onOpenChange: (e) => z(e && !d.disabled),
557
+ onOpenChange: (e) => L(e && !r.disabled),
555
558
  get disabled() {
556
- return d.disabled ?? !1;
559
+ return r.disabled ?? !1;
557
560
  },
558
561
  get readOnly() {
559
- return d.readOnly ?? !1;
562
+ return r.readOnly ?? !1;
560
563
  },
561
564
  get required() {
562
- return d.required ?? !1;
565
+ return r.required ?? !1;
563
566
  },
564
567
  get validationState() {
565
- return d.error ? "invalid" : "valid";
568
+ return r.error ? "invalid" : "valid";
566
569
  },
567
570
  placement: "bottom-start",
568
571
  sameWidth: !0,
@@ -570,81 +573,81 @@ function B(r) {
570
573
  get children() {
571
574
  return [
572
575
  (() => {
573
- var e = D();
574
- return u(e, "id", `${T}-label`), u(e, "for", `${T}-input`), s(e, () => d.label, null), s(e, a(m, {
576
+ var e = O();
577
+ return d(e, "id", `${T}-label`), d(e, "for", `${T}-input`), c(e, () => r.label, null), c(e, o(h, {
575
578
  get when() {
576
- return d.required;
579
+ return r.required;
577
580
  },
578
581
  get children() {
579
- return E();
582
+ return D();
580
583
  }
581
584
  }), null), e;
582
585
  })(),
583
- a(S.Control, {
586
+ o(C.Control, {
584
587
  class: "sheen-input sheen-combobox-control sheen-multi-combobox-control",
585
588
  get children() {
586
- return [a(p, {
589
+ return [o(m, {
587
590
  get each() {
588
591
  return q();
589
592
  },
590
- children: (e) => a(i, {
593
+ children: (e) => o(a, {
591
594
  get label() {
592
595
  return e.label;
593
596
  },
594
597
  get disabled() {
595
- return !!(d.disabled || d.readOnly);
598
+ return !!(r.disabled || r.readOnly);
596
599
  },
597
600
  onRemove: () => ne(e.value)
598
601
  })
599
- }), a(S.Input, {
602
+ }), o(C.Input, {
600
603
  id: `${T}-input`,
601
604
  "aria-labelledby": `${T}-label`,
602
605
  get "aria-describedby"() {
603
- return R(T, d.description, d.error);
606
+ return z(T, r.description, r.error);
604
607
  },
605
608
  get "aria-required"() {
606
- return d.required || void 0;
609
+ return r.required || void 0;
607
610
  },
608
611
  required: !1,
609
612
  ref: (e) => {
610
- V(e), d.inputRef?.(e);
613
+ V(e), r.inputRef?.(e);
611
614
  },
612
615
  class: "sheen-combobox-input sheen-multi-combobox-input",
613
616
  get placeholder() {
614
- return c(() => !q().length)() ? d.placeholder : void 0;
617
+ return l(() => !q().length)() ? r.placeholder : void 0;
615
618
  },
616
619
  get "aria-busy"() {
617
- return d.pending || void 0;
620
+ return r.pending || void 0;
618
621
  },
619
- onInput: () => d.onInputChange?.(B()?.value ?? "")
622
+ onInput: () => r.onInputChange?.(B()?.value ?? "")
620
623
  })];
621
624
  }
622
625
  }),
623
626
  (() => {
624
- var e = A();
627
+ var e = j();
625
628
  e.addEventListener("change", (e) => {
626
629
  X([...e.currentTarget.selectedOptions].map((e) => e.value)), Q();
627
630
  }), e.addEventListener("invalid", (e) => {
628
631
  e.preventDefault(), B()?.focus();
629
632
  });
630
633
  var t = W;
631
- return typeof t == "function" ? f(t, e) : W = e, s(e, a(p, {
634
+ return typeof t == "function" ? p(t, e) : W = e, c(e, o(m, {
632
635
  get each() {
633
636
  return J();
634
637
  },
635
638
  children: (e) => (() => {
636
- var t = k();
637
- return s(t, () => e.label), o((n) => {
639
+ var t = A();
640
+ return c(t, () => e.label), s((n) => {
638
641
  var r = e.disabled, i = G().includes(e.value);
639
642
  return r !== n.e && (t.disabled = n.e = r), i !== n.t && (t.selected = n.t = i), n;
640
643
  }, {
641
644
  e: void 0,
642
645
  t: void 0
643
- }), o(() => t.value = e.value), t;
646
+ }), s(() => t.value = e.value), t;
644
647
  })()
645
- })), o((t) => {
646
- var n = d.name, r = d.form, i = d.required, a = d.disabled, o = d.label;
647
- return n !== t.e && u(e, "name", t.e = n), r !== t.t && u(e, "form", t.t = r), i !== t.a && (e.required = t.a = i), a !== t.o && (e.disabled = t.o = a), o !== t.i && u(e, "aria-label", t.i = o), t;
648
+ })), s((t) => {
649
+ var n = r.name, i = r.form, a = r.required, o = r.disabled, s = r.label;
650
+ return n !== t.e && d(e, "name", t.e = n), i !== t.t && d(e, "form", t.t = i), a !== t.a && (e.required = t.a = a), o !== t.o && (e.disabled = t.o = o), s !== t.i && d(e, "aria-label", t.i = s), t;
648
651
  }, {
649
652
  e: void 0,
650
653
  t: void 0,
@@ -653,32 +656,31 @@ function B(r) {
653
656
  i: void 0
654
657
  }), e;
655
658
  })(),
656
- a(L, {
659
+ o(R, {
657
660
  id: T,
658
661
  get description() {
659
- return d.description;
662
+ return r.description;
660
663
  },
661
664
  get error() {
662
- return d.error;
665
+ return r.error;
663
666
  }
664
667
  }),
665
- a(te, {
668
+ o(I, {
666
669
  id: T,
667
670
  get label() {
668
- return d.label;
671
+ return r.label;
669
672
  },
670
- open: I,
673
+ open: F,
671
674
  get state() {
672
675
  return K.state;
673
676
  },
674
- pending: () => d.pending ?? !1,
675
- resultsError: () => d.resultsError,
676
- onRetry: () => d.onRetry,
677
+ pending: () => r.pending ?? !1,
678
+ resultsError: () => r.resultsError,
679
+ onRetry: () => r.onRetry,
677
680
  setContent: U
678
681
  })
679
682
  ];
680
683
  }
681
684
  }));
682
685
  }
683
- //#endregion
684
- export { z as Combobox, B as MultiCombobox };
686
+ export { B as Combobox, V as MultiCombobox };