@gemologic/sheen 0.1.0-rc.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 (271) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +32 -0
  3. package/dist/core.d.ts +52 -0
  4. package/dist/core.js +29 -0
  5. package/dist/formisch.d.ts +5 -0
  6. package/dist/formisch.js +22 -0
  7. package/dist/forms.d.ts +34 -0
  8. package/dist/forms.js +18 -0
  9. package/dist/index.d.ts +144 -0
  10. package/dist/index.js +75 -0
  11. package/dist/layout/Layout.d.ts +28 -0
  12. package/dist/layout/Layout.js +121 -0
  13. package/dist/metadata.d.ts +46 -0
  14. package/dist/metadata.js +47 -0
  15. package/dist/navigation.d.ts +30 -0
  16. package/dist/navigation.js +16 -0
  17. package/dist/overlays.d.ts +28 -0
  18. package/dist/overlays.js +15 -0
  19. package/dist/primitives/Accordion.d.ts +16 -0
  20. package/dist/primitives/Accordion.js +223 -0
  21. package/dist/primitives/ActivityTimeline.d.ts +20 -0
  22. package/dist/primitives/ActivityTimeline.js +104 -0
  23. package/dist/primitives/AlertDialog.d.ts +7 -0
  24. package/dist/primitives/AlertDialog.js +8 -0
  25. package/dist/primitives/Avatar.d.ts +22 -0
  26. package/dist/primitives/Avatar.js +115 -0
  27. package/dist/primitives/Breadcrumb.d.ts +11 -0
  28. package/dist/primitives/Breadcrumb.js +66 -0
  29. package/dist/primitives/Button.d.ts +11 -0
  30. package/dist/primitives/Button.js +59 -0
  31. package/dist/primitives/ButtonGroup.d.ts +7 -0
  32. package/dist/primitives/ButtonGroup.js +33 -0
  33. package/dist/primitives/Checkbox.d.ts +22 -0
  34. package/dist/primitives/Checkbox.js +93 -0
  35. package/dist/primitives/CheckboxGroup.d.ts +18 -0
  36. package/dist/primitives/CheckboxGroup.js +122 -0
  37. package/dist/primitives/Collapsible.d.ts +9 -0
  38. package/dist/primitives/Collapsible.js +72 -0
  39. package/dist/primitives/Combobox.d.ts +41 -0
  40. package/dist/primitives/Combobox.js +684 -0
  41. package/dist/primitives/CommandPalette.d.ts +42 -0
  42. package/dist/primitives/CommandPalette.js +319 -0
  43. package/dist/primitives/ConfirmDialog.d.ts +11 -0
  44. package/dist/primitives/ConfirmDialog.js +42 -0
  45. package/dist/primitives/ContextMenu.d.ts +16 -0
  46. package/dist/primitives/ContextMenu.js +132 -0
  47. package/dist/primitives/DescriptionList.d.ts +11 -0
  48. package/dist/primitives/DescriptionList.js +44 -0
  49. package/dist/primitives/Dialog.d.ts +21 -0
  50. package/dist/primitives/Dialog.js +141 -0
  51. package/dist/primitives/Drawer.d.ts +9 -0
  52. package/dist/primitives/Drawer.js +21 -0
  53. package/dist/primitives/DropdownMenu.d.ts +59 -0
  54. package/dist/primitives/DropdownMenu.js +441 -0
  55. package/dist/primitives/EditableTextField.d.ts +11 -0
  56. package/dist/primitives/EditableTextField.js +126 -0
  57. package/dist/primitives/EmptyState.d.ts +7 -0
  58. package/dist/primitives/EmptyState.js +45 -0
  59. package/dist/primitives/Field.d.ts +18 -0
  60. package/dist/primitives/Field.js +72 -0
  61. package/dist/primitives/FileDropzone.d.ts +40 -0
  62. package/dist/primitives/FileDropzone.js +261 -0
  63. package/dist/primitives/IconButton.d.ts +8 -0
  64. package/dist/primitives/IconButton.js +34 -0
  65. package/dist/primitives/Input.d.ts +7 -0
  66. package/dist/primitives/Input.js +55 -0
  67. package/dist/primitives/InputGroup.d.ts +7 -0
  68. package/dist/primitives/InputGroup.js +73 -0
  69. package/dist/primitives/Link.d.ts +7 -0
  70. package/dist/primitives/Link.js +35 -0
  71. package/dist/primitives/LinkTooltip.d.ts +11 -0
  72. package/dist/primitives/LinkTooltip.js +88 -0
  73. package/dist/primitives/NavList.d.ts +17 -0
  74. package/dist/primitives/NavList.js +143 -0
  75. package/dist/primitives/Notice.d.ts +8 -0
  76. package/dist/primitives/Notice.js +64 -0
  77. package/dist/primitives/NumberField.d.ts +22 -0
  78. package/dist/primitives/NumberField.js +177 -0
  79. package/dist/primitives/Pagination.d.ts +12 -0
  80. package/dist/primitives/Pagination.js +127 -0
  81. package/dist/primitives/Popover.d.ts +12 -0
  82. package/dist/primitives/Popover.js +103 -0
  83. package/dist/primitives/Progress.d.ts +17 -0
  84. package/dist/primitives/Progress.js +98 -0
  85. package/dist/primitives/RadioGroup.d.ts +19 -0
  86. package/dist/primitives/RadioGroup.js +173 -0
  87. package/dist/primitives/Resizable.d.ts +36 -0
  88. package/dist/primitives/Resizable.js +196 -0
  89. package/dist/primitives/ScrollArea.d.ts +6 -0
  90. package/dist/primitives/ScrollArea.js +178 -0
  91. package/dist/primitives/SearchInput.d.ts +12 -0
  92. package/dist/primitives/SearchInput.js +89 -0
  93. package/dist/primitives/SegmentedControl.d.ts +25 -0
  94. package/dist/primitives/SegmentedControl.js +188 -0
  95. package/dist/primitives/Select.d.ts +24 -0
  96. package/dist/primitives/Select.js +320 -0
  97. package/dist/primitives/Separator.d.ts +6 -0
  98. package/dist/primitives/Separator.js +31 -0
  99. package/dist/primitives/ShortcutPending.d.ts +6 -0
  100. package/dist/primitives/ShortcutPending.js +40 -0
  101. package/dist/primitives/ShortcutProvider.d.ts +32 -0
  102. package/dist/primitives/ShortcutProvider.js +172 -0
  103. package/dist/primitives/ShortcutScope.d.ts +6 -0
  104. package/dist/primitives/ShortcutScope.js +29 -0
  105. package/dist/primitives/ShortcutSheet.d.ts +5 -0
  106. package/dist/primitives/ShortcutSheet.js +87 -0
  107. package/dist/primitives/Skeleton.d.ts +5 -0
  108. package/dist/primitives/Skeleton.js +23 -0
  109. package/dist/primitives/Slider.d.ts +35 -0
  110. package/dist/primitives/Slider.js +210 -0
  111. package/dist/primitives/Spinner.d.ts +7 -0
  112. package/dist/primitives/Spinner.js +44 -0
  113. package/dist/primitives/Status.d.ts +15 -0
  114. package/dist/primitives/Status.js +78 -0
  115. package/dist/primitives/Stepper.d.ts +32 -0
  116. package/dist/primitives/Stepper.js +147 -0
  117. package/dist/primitives/Surface.d.ts +11 -0
  118. package/dist/primitives/Surface.js +58 -0
  119. package/dist/primitives/Switch.d.ts +4 -0
  120. package/dist/primitives/Switch.js +7 -0
  121. package/dist/primitives/Table.d.ts +23 -0
  122. package/dist/primitives/Table.js +101 -0
  123. package/dist/primitives/Tabs.d.ts +17 -0
  124. package/dist/primitives/Tabs.js +157 -0
  125. package/dist/primitives/TagInput.d.ts +33 -0
  126. package/dist/primitives/TagInput.js +288 -0
  127. package/dist/primitives/Textarea.d.ts +8 -0
  128. package/dist/primitives/Textarea.js +106 -0
  129. package/dist/primitives/Toast.d.ts +10 -0
  130. package/dist/primitives/Toast.js +78 -0
  131. package/dist/primitives/Toaster.d.ts +9 -0
  132. package/dist/primitives/Toaster.js +183 -0
  133. package/dist/primitives/Tooltip.d.ts +13 -0
  134. package/dist/primitives/Tooltip.js +84 -0
  135. package/dist/primitives/Tree.d.ts +23 -0
  136. package/dist/primitives/Tree.js +275 -0
  137. package/dist/primitives/Typography.d.ts +16 -0
  138. package/dist/primitives/Typography.js +82 -0
  139. package/dist/primitives/boolean-input-state.d.ts +14 -0
  140. package/dist/primitives/boolean-input-state.js +39 -0
  141. package/dist/primitives/button-variants.d.ts +9 -0
  142. package/dist/primitives/button-variants.js +7 -0
  143. package/dist/primitives/choice-options.d.ts +7 -0
  144. package/dist/primitives/choice-options.js +35 -0
  145. package/dist/primitives/create-confirm.d.ts +15 -0
  146. package/dist/primitives/create-confirm.js +49 -0
  147. package/dist/primitives/create-toaster.d.ts +51 -0
  148. package/dist/primitives/create-toaster.js +87 -0
  149. package/dist/primitives/link-focus.d.ts +2 -0
  150. package/dist/primitives/link-focus.js +38 -0
  151. package/dist/primitives/menu-focus.d.ts +3 -0
  152. package/dist/primitives/menu-focus.js +32 -0
  153. package/dist/primitives/tooltip-layer.d.ts +14 -0
  154. package/dist/primitives/tooltip-layer.js +84 -0
  155. package/dist/theme/ThemeProvider.d.ts +59 -0
  156. package/dist/theme/ThemeProvider.js +239 -0
  157. package/dist/theme/intl.d.ts +6 -0
  158. package/dist/theme/intl.js +13 -0
  159. package/dist/theme/keyboard-script.d.ts +2 -0
  160. package/dist/theme/keyboard-script.js +6 -0
  161. package/dist/theme/layers.d.ts +7 -0
  162. package/dist/theme/layers.js +23 -0
  163. package/dist/theme/messages.d.ts +235 -0
  164. package/dist/theme/messages.js +115 -0
  165. package/dist/theme/script.d.ts +9 -0
  166. package/dist/theme/script.js +49 -0
  167. package/dist/theme/state.d.ts +27 -0
  168. package/dist/theme/state.js +55 -0
  169. package/dist/utils/browser-status.d.ts +5 -0
  170. package/dist/utils/browser-status.js +22 -0
  171. package/dist/utils/cn.d.ts +3 -0
  172. package/dist/utils/cn.js +7 -0
  173. package/dist/utils/optimistic.d.ts +6 -0
  174. package/dist/utils/optimistic.js +16 -0
  175. package/dist/utils/polymorphic.d.ts +1 -0
  176. package/dist/utils/shortcut-platform.d.ts +2 -0
  177. package/dist/utils/shortcut-platform.js +10 -0
  178. package/dist/utils/shortcut-registry.d.ts +61 -0
  179. package/dist/utils/shortcut-registry.js +186 -0
  180. package/package.json +100 -0
  181. package/src/core.ts +55 -0
  182. package/src/formisch.ts +28 -0
  183. package/src/forms.ts +34 -0
  184. package/src/index.ts +144 -0
  185. package/src/layout/Layout.tsx +43 -0
  186. package/src/metadata.d.ts +46 -0
  187. package/src/metadata.ts +66 -0
  188. package/src/navigation.ts +30 -0
  189. package/src/overlays.ts +28 -0
  190. package/src/primitives/Accordion.tsx +145 -0
  191. package/src/primitives/ActivityTimeline.tsx +72 -0
  192. package/src/primitives/AlertDialog.tsx +8 -0
  193. package/src/primitives/Avatar.tsx +85 -0
  194. package/src/primitives/Breadcrumb.tsx +41 -0
  195. package/src/primitives/Button.tsx +27 -0
  196. package/src/primitives/ButtonGroup.tsx +18 -0
  197. package/src/primitives/Checkbox.tsx +51 -0
  198. package/src/primitives/CheckboxGroup.tsx +73 -0
  199. package/src/primitives/Collapsible.tsx +43 -0
  200. package/src/primitives/Combobox.tsx +402 -0
  201. package/src/primitives/CommandPalette.tsx +234 -0
  202. package/src/primitives/ConfirmDialog.tsx +25 -0
  203. package/src/primitives/ContextMenu.tsx +100 -0
  204. package/src/primitives/DescriptionList.tsx +26 -0
  205. package/src/primitives/Dialog.tsx +81 -0
  206. package/src/primitives/Drawer.tsx +26 -0
  207. package/src/primitives/DropdownMenu.tsx +221 -0
  208. package/src/primitives/EditableTextField.tsx +91 -0
  209. package/src/primitives/EmptyState.tsx +21 -0
  210. package/src/primitives/Field.tsx +38 -0
  211. package/src/primitives/FileDropzone.tsx +189 -0
  212. package/src/primitives/IconButton.tsx +22 -0
  213. package/src/primitives/Input.tsx +17 -0
  214. package/src/primitives/InputGroup.tsx +23 -0
  215. package/src/primitives/Link.tsx +19 -0
  216. package/src/primitives/LinkTooltip.tsx +31 -0
  217. package/src/primitives/NavList.tsx +58 -0
  218. package/src/primitives/Notice.tsx +25 -0
  219. package/src/primitives/NumberField.tsx +168 -0
  220. package/src/primitives/Pagination.tsx +64 -0
  221. package/src/primitives/Popover.tsx +44 -0
  222. package/src/primitives/Progress.tsx +62 -0
  223. package/src/primitives/RadioGroup.tsx +104 -0
  224. package/src/primitives/Resizable.tsx +170 -0
  225. package/src/primitives/ScrollArea.tsx +115 -0
  226. package/src/primitives/SearchInput.tsx +98 -0
  227. package/src/primitives/SegmentedControl.tsx +140 -0
  228. package/src/primitives/Select.tsx +171 -0
  229. package/src/primitives/Separator.tsx +13 -0
  230. package/src/primitives/ShortcutPending.tsx +21 -0
  231. package/src/primitives/ShortcutProvider.tsx +179 -0
  232. package/src/primitives/ShortcutScope.tsx +17 -0
  233. package/src/primitives/ShortcutSheet.tsx +35 -0
  234. package/src/primitives/Skeleton.tsx +12 -0
  235. package/src/primitives/Slider.tsx +153 -0
  236. package/src/primitives/Spinner.tsx +19 -0
  237. package/src/primitives/Status.tsx +33 -0
  238. package/src/primitives/Stepper.tsx +106 -0
  239. package/src/primitives/Surface.tsx +21 -0
  240. package/src/primitives/Switch.tsx +9 -0
  241. package/src/primitives/Table.tsx +57 -0
  242. package/src/primitives/Tabs.tsx +96 -0
  243. package/src/primitives/TagInput.tsx +282 -0
  244. package/src/primitives/Textarea.tsx +77 -0
  245. package/src/primitives/Toast.tsx +36 -0
  246. package/src/primitives/Toaster.tsx +175 -0
  247. package/src/primitives/Tooltip.tsx +41 -0
  248. package/src/primitives/Tree.tsx +256 -0
  249. package/src/primitives/Typography.tsx +39 -0
  250. package/src/primitives/boolean-input-state.ts +65 -0
  251. package/src/primitives/button-variants.ts +20 -0
  252. package/src/primitives/choice-options.ts +39 -0
  253. package/src/primitives/create-confirm.tsx +56 -0
  254. package/src/primitives/create-toaster.ts +128 -0
  255. package/src/primitives/link-focus.ts +38 -0
  256. package/src/primitives/menu-focus.ts +43 -0
  257. package/src/primitives/tooltip-layer.tsx +53 -0
  258. package/src/styles.css +655 -0
  259. package/src/theme/ThemeProvider.tsx +215 -0
  260. package/src/theme/intl.ts +14 -0
  261. package/src/theme/keyboard-script.ts +4 -0
  262. package/src/theme/layers.ts +16 -0
  263. package/src/theme/messages.ts +157 -0
  264. package/src/theme/script.ts +70 -0
  265. package/src/theme/state.ts +48 -0
  266. package/src/utils/browser-status.ts +36 -0
  267. package/src/utils/cn.ts +5 -0
  268. package/src/utils/optimistic.ts +22 -0
  269. package/src/utils/polymorphic.ts +1 -0
  270. package/src/utils/shortcut-platform.ts +4 -0
  271. package/src/utils/shortcut-registry.ts +216 -0
@@ -0,0 +1,78 @@
1
+ import { useTheme as e } from "../theme/ThemeProvider.js";
2
+ import { cn as t } from "../utils/cn.js";
3
+ import { Button as n } from "./Button.js";
4
+ import { createComponent as r, insert as i, mergeProps as a, spread as o, template as s } from "solid-js/web";
5
+ import { Show as c, splitProps as l } from "solid-js";
6
+ //#region src/primitives/Status.tsx
7
+ var u = /*#__PURE__*/ s("<span>");
8
+ function d(e) {
9
+ let [n, r] = l(e, [
10
+ "class",
11
+ "tone",
12
+ "variant",
13
+ "size"
14
+ ]);
15
+ return (() => {
16
+ var e = u();
17
+ return o(e, a(r, {
18
+ get class() {
19
+ return t("sheen-badge", n.class);
20
+ },
21
+ get "data-tone"() {
22
+ return n.tone ?? "neutral";
23
+ },
24
+ get "data-variant"() {
25
+ return n.variant ?? "soft";
26
+ },
27
+ get "data-size"() {
28
+ return n.size ?? "sm";
29
+ }
30
+ }), !1, !1), e;
31
+ })();
32
+ }
33
+ function f(o) {
34
+ let s = e(), [f, p] = l(o, [
35
+ "class",
36
+ "label",
37
+ "children",
38
+ "onRemove",
39
+ "removeLabel",
40
+ "disabled"
41
+ ]);
42
+ return r(d, a(p, {
43
+ get class() {
44
+ return t("sheen-tag", f.class);
45
+ },
46
+ get "data-disabled"() {
47
+ return f.disabled || void 0;
48
+ },
49
+ get children() {
50
+ return [(() => {
51
+ var e = u();
52
+ return i(e, () => f.children ?? f.label), e;
53
+ })(), r(c, {
54
+ get when() {
55
+ return f.onRemove;
56
+ },
57
+ get children() {
58
+ return r(n, {
59
+ class: "sheen-tag-remove",
60
+ size: "xs",
61
+ get disabled() {
62
+ return f.disabled;
63
+ },
64
+ get "aria-label"() {
65
+ return f.removeLabel ?? `${s.messages().remove} ${f.label}`;
66
+ },
67
+ onClick: () => f.onRemove?.(),
68
+ get children() {
69
+ return s.messages().remove;
70
+ }
71
+ });
72
+ }
73
+ })];
74
+ }
75
+ }));
76
+ }
77
+ //#endregion
78
+ export { d as Badge, f as Tag };
@@ -0,0 +1,32 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { WorkflowState } from "./ActivityTimeline.tsx";
3
+ interface StepperStepBase {
4
+ readonly id: string;
5
+ readonly label: string;
6
+ readonly description?: string;
7
+ readonly state: WorkflowState;
8
+ }
9
+ export interface StepperStatusStep extends StepperStepBase {
10
+ readonly kind: "status";
11
+ }
12
+ export interface StepperLinkStep extends StepperStepBase {
13
+ readonly kind: "link";
14
+ readonly href: string;
15
+ }
16
+ export interface StepperActionStep extends StepperStepBase {
17
+ readonly kind: "action";
18
+ readonly onSelect: () => void;
19
+ readonly disabled?: boolean;
20
+ }
21
+ export type StepperStep = StepperStatusStep | StepperLinkStep | StepperActionStep;
22
+ export interface StepperProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "children" | "ref"> {
23
+ ref?: HTMLElement | ((element: HTMLElement) => void);
24
+ label: string;
25
+ steps: readonly StepperStep[];
26
+ orientation?: "horizontal" | "vertical";
27
+ density?: "compact" | "default";
28
+ refreshing?: boolean;
29
+ }
30
+ /** A semantic workflow progress list with native link and action variants. */
31
+ export declare function Stepper(props: StepperProps): JSX.Element;
32
+ export {};
@@ -0,0 +1,147 @@
1
+ import { useTheme as e } from "../theme/ThemeProvider.js";
2
+ import { cn as t } from "../utils/cn.js";
3
+ import { Button as n } from "./Button.js";
4
+ import { Link as r } from "./Link.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, createMemo as m, splitProps as h } from "solid-js";
7
+ //#region src/primitives/Stepper.tsx
8
+ var g = /*#__PURE__*/ u("<strong>"), _ = /*#__PURE__*/ u("<nav><progress class=sheen-stepper-progress></progress><ol class=sheen-stepper-list>"), v = /*#__PURE__*/ u("<li class=sheen-stepper-step><span class=sheen-workflow-marker aria-hidden=true></span><div class=sheen-stepper-copy><span class=sheen-workflow-state>"), y = /*#__PURE__*/ u("<span class=sheen-stepper-description>");
9
+ function b(e) {
10
+ let t = () => {
11
+ let t = e.step();
12
+ return t.kind === "link" ? t.href : "";
13
+ }, a = () => {
14
+ let t = e.step();
15
+ return t.kind === "action" && !!t.disabled;
16
+ }, s = () => {
17
+ let t = e.step();
18
+ t.kind === "action" && !t.disabled && t.onSelect();
19
+ };
20
+ return i(p, {
21
+ get when() {
22
+ return e.step().kind === "link";
23
+ },
24
+ get fallback() {
25
+ return i(p, {
26
+ get when() {
27
+ return e.step().kind === "action";
28
+ },
29
+ get fallback() {
30
+ return (() => {
31
+ var t = g();
32
+ return o(t, () => e.step().label), t;
33
+ })();
34
+ },
35
+ get children() {
36
+ return i(n, {
37
+ variant: "link",
38
+ get disabled() {
39
+ return a();
40
+ },
41
+ onClick: s,
42
+ get children() {
43
+ return e.step().label;
44
+ }
45
+ });
46
+ }
47
+ });
48
+ },
49
+ get children() {
50
+ return i(r, {
51
+ get href() {
52
+ return t();
53
+ },
54
+ get children() {
55
+ return e.step().label;
56
+ }
57
+ });
58
+ }
59
+ });
60
+ }
61
+ function x(n) {
62
+ let r = e(), [u, g] = h(n, [
63
+ "ref",
64
+ "class",
65
+ "label",
66
+ "steps",
67
+ "orientation",
68
+ "density",
69
+ "refreshing",
70
+ "aria-label"
71
+ ]), x = m(() => {
72
+ let e = /* @__PURE__ */ new Map(), t = 0;
73
+ for (let n of u.steps) {
74
+ if (!n.id.trim()) throw Error("Stepper: step IDs must be nonempty");
75
+ if (e.has(n.id)) throw Error(`Stepper: duplicate step ID ${JSON.stringify(n.id)}`);
76
+ if (!n.label.trim()) throw Error(`Stepper: label must be nonempty for ${JSON.stringify(n.id)}`);
77
+ if (n.state === "current" && (t += 1), n.kind === "link" && !n.href.trim()) throw Error(`Stepper: href must be nonempty for ${JSON.stringify(n.id)}`);
78
+ e.set(n.id, n);
79
+ }
80
+ if (t > 1) throw Error("Stepper: only one step may be current");
81
+ return e;
82
+ }), S = m(() => [...x().keys()]), C = m(() => [...x().values()].filter((e) => e.state === "completed").length), w = (e) => e === "completed" ? r.messages().workflowCompleted : e === "current" ? r.messages().workflowCurrent : e === "error" ? r.messages().workflowError : r.messages().workflowUpcoming, T = (e, t) => e === "completed" ? "✓" : e === "current" ? "●" : e === "error" ? "!" : String(t + 1);
83
+ return (() => {
84
+ var e = _(), n = e.firstChild, m = n.nextSibling;
85
+ return d((e) => {
86
+ typeof u.ref == "function" && u.ref(e);
87
+ }, e), l(e, s(g, {
88
+ get class() {
89
+ return t("sheen-stepper", u.class);
90
+ },
91
+ get "aria-label"() {
92
+ return u["aria-label"] ?? u.label;
93
+ },
94
+ get "aria-busy"() {
95
+ return u.refreshing || void 0;
96
+ },
97
+ get "data-orientation"() {
98
+ return u.orientation ?? "horizontal";
99
+ },
100
+ get "data-density"() {
101
+ return u.density ?? "default";
102
+ },
103
+ get "data-refreshing"() {
104
+ return u.refreshing || void 0;
105
+ }
106
+ }), !1, !0), o(m, i(f, {
107
+ get each() {
108
+ return S();
109
+ },
110
+ children: (e, t) => {
111
+ let n = () => x().get(e);
112
+ return i(p, {
113
+ get when() {
114
+ return n();
115
+ },
116
+ children: (n) => (() => {
117
+ var r = v(), s = r.firstChild, l = s.nextSibling, u = l.firstChild;
118
+ return c(r, "data-step-id", e), o(s, () => T(n().state, t())), o(l, i(b, { step: n }), u), o(u, () => w(n().state)), o(l, i(p, {
119
+ get when() {
120
+ return n().description;
121
+ },
122
+ children: (e) => (() => {
123
+ var t = y();
124
+ return o(t, e), t;
125
+ })()
126
+ }), null), a((e) => {
127
+ var t = n().state, i = n().state === "current" ? "step" : void 0, a = n().state;
128
+ return t !== e.e && c(r, "data-state", e.e = t), i !== e.t && c(r, "aria-current", e.t = i), a !== e.a && c(s, "data-state", e.a = a), e;
129
+ }, {
130
+ e: void 0,
131
+ t: void 0,
132
+ a: void 0
133
+ }), r;
134
+ })()
135
+ });
136
+ }
137
+ })), a((e) => {
138
+ var t = Math.max(1, S().length), i = r.messages().stepperProgress.replaceAll("{label}", u.label);
139
+ return t !== e.e && c(n, "max", e.e = t), i !== e.t && c(n, "aria-label", e.t = i), e;
140
+ }, {
141
+ e: void 0,
142
+ t: void 0
143
+ }), a(() => n.value = C()), e;
144
+ })();
145
+ }
146
+ //#endregion
147
+ export { x as Stepper };
@@ -0,0 +1,11 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { Spacing } from "../layout/Layout.tsx";
3
+ export interface SurfaceProps extends JSX.HTMLAttributes<HTMLDivElement> {
4
+ variant?: "base" | "subtle" | "raised" | "inset";
5
+ padding?: Spacing;
6
+ bordered?: boolean;
7
+ elevated?: boolean;
8
+ }
9
+ export declare function Surface(props: SurfaceProps): JSX.Element;
10
+ export type CardProps = SurfaceProps;
11
+ export declare function Card(props: CardProps): JSX.Element;
@@ -0,0 +1,58 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { createComponent as t, mergeProps as n, spread as r, template as i } from "solid-js/web";
3
+ import { splitProps as a } from "solid-js";
4
+ //#region src/primitives/Surface.tsx
5
+ var o = /*#__PURE__*/ i("<div>");
6
+ function s(t) {
7
+ let [i, s] = a(t, [
8
+ "class",
9
+ "variant",
10
+ "padding",
11
+ "bordered",
12
+ "elevated"
13
+ ]);
14
+ return (() => {
15
+ var t = o();
16
+ return r(t, n(s, {
17
+ get class() {
18
+ return e("sheen-layout sheen-surface", i.class);
19
+ },
20
+ get "data-surface"() {
21
+ return i.variant ?? "base";
22
+ },
23
+ get "data-gap"() {
24
+ return i.padding ?? "none";
25
+ },
26
+ get "data-bordered"() {
27
+ return i.bordered || void 0;
28
+ },
29
+ get "data-elevated"() {
30
+ return i.elevated || void 0;
31
+ }
32
+ }), !1, !1), t;
33
+ })();
34
+ }
35
+ function c(r) {
36
+ let [i, o] = a(r, [
37
+ "class",
38
+ "variant",
39
+ "padding",
40
+ "bordered"
41
+ ]);
42
+ return t(s, n(o, {
43
+ get class() {
44
+ return e("sheen-card", i.class);
45
+ },
46
+ get variant() {
47
+ return i.variant ?? "raised";
48
+ },
49
+ get padding() {
50
+ return i.padding ?? "lg";
51
+ },
52
+ get bordered() {
53
+ return i.bordered ?? !0;
54
+ }
55
+ }));
56
+ }
57
+ //#endregion
58
+ export { c as Card, s as Surface };
@@ -0,0 +1,4 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { CheckboxProps } from "./Checkbox.tsx";
3
+ export type SwitchProps = Omit<CheckboxProps, "indeterminate">;
4
+ export declare function Switch(props: SwitchProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { createNativeBooleanControl as e } from "./Checkbox.js";
2
+ //#region src/primitives/Switch.tsx
3
+ function t(t) {
4
+ return e(t, "switch");
5
+ }
6
+ //#endregion
7
+ export { t as Switch };
@@ -0,0 +1,23 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface TableProps extends JSX.HTMLAttributes<HTMLTableElement> {
3
+ striped?: boolean;
4
+ }
5
+ export declare function Table(props: TableProps): JSX.Element;
6
+ export type TableCaptionProps = JSX.HTMLAttributes<HTMLTableCaptionElement>;
7
+ export declare function TableCaption(props: TableCaptionProps): JSX.Element;
8
+ export type TableHeadProps = JSX.HTMLAttributes<HTMLTableSectionElement>;
9
+ export declare function TableHead(props: TableHeadProps): JSX.Element;
10
+ export type TableBodyProps = JSX.HTMLAttributes<HTMLTableSectionElement>;
11
+ export declare function TableBody(props: TableBodyProps): JSX.Element;
12
+ export type TableFootProps = JSX.HTMLAttributes<HTMLTableSectionElement>;
13
+ export declare function TableFoot(props: TableFootProps): JSX.Element;
14
+ export type TableRowProps = JSX.HTMLAttributes<HTMLTableRowElement>;
15
+ export declare function TableRow(props: TableRowProps): JSX.Element;
16
+ export interface TableHeaderCellProps extends JSX.ThHTMLAttributes<HTMLTableCellElement> {
17
+ numeric?: boolean;
18
+ }
19
+ export declare function TableHeaderCell(props: TableHeaderCellProps): JSX.Element;
20
+ export interface TableCellProps extends JSX.TdHTMLAttributes<HTMLTableCellElement> {
21
+ numeric?: boolean;
22
+ }
23
+ export declare function TableCell(props: TableCellProps): JSX.Element;
@@ -0,0 +1,101 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { mergeProps as t, spread as n, template as r } from "solid-js/web";
3
+ import { splitProps as i } from "solid-js";
4
+ //#region src/primitives/Table.tsx
5
+ var a = /*#__PURE__*/ r("<table>"), o = /*#__PURE__*/ r("<caption>"), s = /*#__PURE__*/ r("<thead>"), c = /*#__PURE__*/ r("<tbody>"), l = /*#__PURE__*/ r("<tfoot>"), u = /*#__PURE__*/ r("<tr>"), d = /*#__PURE__*/ r("<th>"), f = /*#__PURE__*/ r("<td>");
6
+ function p(r) {
7
+ let [o, s] = i(r, ["class", "striped"]);
8
+ return (() => {
9
+ var r = a();
10
+ return n(r, t(s, {
11
+ get class() {
12
+ return e("sheen-table", o.class);
13
+ },
14
+ get "data-striped"() {
15
+ return o.striped || void 0;
16
+ }
17
+ }), !1, !1), r;
18
+ })();
19
+ }
20
+ function m(r) {
21
+ let [a, s] = i(r, ["class"]);
22
+ return (() => {
23
+ var r = o();
24
+ return n(r, t(s, { get class() {
25
+ return e("sheen-table-caption", a.class);
26
+ } }), !1, !1), r;
27
+ })();
28
+ }
29
+ function h(r) {
30
+ let [a, o] = i(r, ["class"]);
31
+ return (() => {
32
+ var r = s();
33
+ return n(r, t(o, { get class() {
34
+ return e("sheen-table-thead", a.class);
35
+ } }), !1, !1), r;
36
+ })();
37
+ }
38
+ function g(r) {
39
+ let [a, o] = i(r, ["class"]);
40
+ return (() => {
41
+ var r = c();
42
+ return n(r, t(o, { get class() {
43
+ return e("sheen-table-tbody", a.class);
44
+ } }), !1, !1), r;
45
+ })();
46
+ }
47
+ function _(r) {
48
+ let [a, o] = i(r, ["class"]);
49
+ return (() => {
50
+ var r = l();
51
+ return n(r, t(o, { get class() {
52
+ return e("sheen-table-tfoot", a.class);
53
+ } }), !1, !1), r;
54
+ })();
55
+ }
56
+ function v(r) {
57
+ let [a, o] = i(r, ["class"]);
58
+ return (() => {
59
+ var r = u();
60
+ return n(r, t(o, { get class() {
61
+ return e("sheen-table-tr", a.class);
62
+ } }), !1, !1), r;
63
+ })();
64
+ }
65
+ function y(r) {
66
+ let [a, o] = i(r, [
67
+ "class",
68
+ "numeric",
69
+ "scope"
70
+ ]);
71
+ return (() => {
72
+ var r = d();
73
+ return n(r, t(o, {
74
+ get class() {
75
+ return e("sheen-table-th", a.class);
76
+ },
77
+ get scope() {
78
+ return a.scope ?? "col";
79
+ },
80
+ get "data-numeric"() {
81
+ return a.numeric || void 0;
82
+ }
83
+ }), !1, !1), r;
84
+ })();
85
+ }
86
+ function b(r) {
87
+ let [a, o] = i(r, ["class", "numeric"]);
88
+ return (() => {
89
+ var r = f();
90
+ return n(r, t(o, {
91
+ get class() {
92
+ return e("sheen-table-td", a.class);
93
+ },
94
+ get "data-numeric"() {
95
+ return a.numeric || void 0;
96
+ }
97
+ }), !1, !1), r;
98
+ })();
99
+ }
100
+ //#endregion
101
+ export { p as Table, g as TableBody, m as TableCaption, b as TableCell, _ as TableFoot, h as TableHead, y as TableHeaderCell, v as TableRow };
@@ -0,0 +1,17 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface TabOption {
3
+ readonly value: string;
4
+ readonly label: string;
5
+ readonly disabled?: boolean;
6
+ }
7
+ export interface TabsProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "onChange"> {
8
+ label: string;
9
+ items: readonly TabOption[];
10
+ value?: string;
11
+ defaultValue?: string;
12
+ onValueChange?: (value: string) => void;
13
+ orientation?: "horizontal" | "vertical";
14
+ activationMode?: "automatic" | "manual";
15
+ children: (value: string) => JSX.Element;
16
+ }
17
+ export declare function Tabs(props: TabsProps): JSX.Element;
@@ -0,0 +1,157 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { Button as t } from "./Button.js";
3
+ import { createComponent as n, effect as r, insert as i, mergeProps as a, setAttribute as o, template as s } from "solid-js/web";
4
+ import { For as c, createEffect as l, createMemo as u, createSignal as d, createUniqueId as f, onCleanup as p, splitProps as m } from "solid-js";
5
+ import * as h from "@kobalte/core/tabs";
6
+ //#region src/primitives/Tabs.tsx
7
+ var g = /*#__PURE__*/ s("<div role=tabpanel tabindex=0 class=sheen-tabs-panel>");
8
+ function _(e) {
9
+ let r = h.useTabsContext(), i = () => e.disabled ? -1 : (r.listState().selectionManager().focusedKey() ?? (e.selected ? e.value : void 0)) === e.value ? 0 : -1;
10
+ return n(h.Trigger, {
11
+ as: t,
12
+ get value() {
13
+ return e.value;
14
+ },
15
+ get id() {
16
+ return `${e.id}-tab`;
17
+ },
18
+ get "aria-controls"() {
19
+ return `${e.id}-panel`;
20
+ },
21
+ get disabled() {
22
+ return e.disabled;
23
+ },
24
+ get tabIndex() {
25
+ return i();
26
+ },
27
+ class: "sheen-tabs-trigger",
28
+ get children() {
29
+ return e.label;
30
+ }
31
+ });
32
+ }
33
+ function v(t) {
34
+ let [s, v] = m(t, [
35
+ "label",
36
+ "items",
37
+ "value",
38
+ "defaultValue",
39
+ "onValueChange",
40
+ "orientation",
41
+ "activationMode",
42
+ "children",
43
+ "class",
44
+ "id",
45
+ "ref"
46
+ ]), y = f(), b = () => s.id ?? `sheen-tabs-${y}`, x, S = !1;
47
+ p(() => {
48
+ S = !0;
49
+ });
50
+ let C = () => {
51
+ let e = x, t = e?.ownerDocument.activeElement;
52
+ e && t instanceof HTMLElement && e.contains(t) && e.ownerDocument.defaultView?.queueMicrotask(() => {
53
+ if (S || !e.isConnected) return;
54
+ let n = e.ownerDocument.activeElement;
55
+ if (n !== e.ownerDocument.body && n !== t) return;
56
+ let r = (e) => e.isConnected && !e.matches(":disabled") && !e.closest("[hidden], [inert]"), i = e.contains(t) && r(t) ? t : void 0, a = [...e.querySelectorAll("[role=\"tab\"][aria-selected=\"true\"]")].find((t) => t.closest(".sheen-tabs") === e && r(t));
57
+ (i ?? a ?? e).focus({ preventScroll: !0 });
58
+ });
59
+ }, w = u(() => {
60
+ if (!s.label.trim()) throw Error("Tabs requires a nonempty accessible label");
61
+ let e = /* @__PURE__ */ new Map();
62
+ for (let t of s.items) {
63
+ if (!t.value.trim() || !t.label.trim()) throw Error("Tabs requires nonempty item values and labels");
64
+ if (e.has(t.value)) throw Error(`Tabs duplicate item value: ${t.value}`);
65
+ e.set(t.value, t);
66
+ }
67
+ return e;
68
+ }), [T, E] = d(s.defaultValue), D = [], O = u(() => {
69
+ C();
70
+ let e = w(), t = [...e.keys()], n = s.value ?? T(), r = Math.max(0, n === void 0 ? 0 : D.indexOf(n));
71
+ if (D = t, s.value !== void 0 && (!e.has(s.value) || e.get(s.value)?.disabled)) throw Error("Tabs controlled value must identify an enabled item");
72
+ if (n !== void 0 && e.has(n) && !e.get(n)?.disabled) return n;
73
+ let i = (t) => !e.get(t)?.disabled;
74
+ return t.slice(r).find(i) ?? t.slice(0, r).reverse().find(i);
75
+ });
76
+ return l(() => {
77
+ if (s.value !== void 0) return;
78
+ let e = T(), t = O();
79
+ e !== t && (E(t), e !== void 0 && t !== void 0 && s.onValueChange?.(t));
80
+ }), n(h.Root, a(v, {
81
+ ref: (e) => {
82
+ x = e, typeof s.ref == "function" && s.ref(e);
83
+ },
84
+ get tabIndex() {
85
+ return v.tabIndex ?? -1;
86
+ },
87
+ get id() {
88
+ return b();
89
+ },
90
+ get class() {
91
+ return e("sheen-tabs", s.class);
92
+ },
93
+ get value() {
94
+ return encodeURIComponent(O() ?? "");
95
+ },
96
+ onChange: (e) => {
97
+ let t = decodeURIComponent(e);
98
+ w().has(t) && !w().get(t)?.disabled && t !== O() && (s.value === void 0 && E(t), s.onValueChange?.(t));
99
+ },
100
+ get orientation() {
101
+ return s.orientation ?? "horizontal";
102
+ },
103
+ get activationMode() {
104
+ return s.activationMode ?? "automatic";
105
+ },
106
+ get children() {
107
+ return [n(h.List, {
108
+ get "aria-label"() {
109
+ return s.label;
110
+ },
111
+ class: "sheen-tabs-list",
112
+ get children() {
113
+ return n(c, {
114
+ get each() {
115
+ return [...w().keys()];
116
+ },
117
+ children: (e) => n(_, {
118
+ get value() {
119
+ return encodeURIComponent(e);
120
+ },
121
+ get id() {
122
+ return `${b()}-${encodeURIComponent(e)}`;
123
+ },
124
+ get label() {
125
+ return w().get(e)?.label ?? "";
126
+ },
127
+ get disabled() {
128
+ return w().get(e)?.disabled ?? !1;
129
+ },
130
+ get selected() {
131
+ return O() === e;
132
+ }
133
+ })
134
+ });
135
+ }
136
+ }), n(c, {
137
+ get each() {
138
+ return [...w().keys()];
139
+ },
140
+ children: (e) => (() => {
141
+ var t = g();
142
+ return i(t, () => s.children(e)), r((n) => {
143
+ var r = `${b()}-${encodeURIComponent(e)}-panel`, i = `${b()}-${encodeURIComponent(e)}-tab`, a = O() !== e, s = O() !== e;
144
+ return r !== n.e && o(t, "id", n.e = r), i !== n.t && o(t, "aria-labelledby", n.t = i), a !== n.a && (t.hidden = n.a = a), s !== n.o && (t.inert = n.o = s), n;
145
+ }, {
146
+ e: void 0,
147
+ t: void 0,
148
+ a: void 0,
149
+ o: void 0
150
+ }), t;
151
+ })()
152
+ })];
153
+ }
154
+ }));
155
+ }
156
+ //#endregion
157
+ export { v as Tabs };
@@ -0,0 +1,33 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface TagInputValidationContext {
3
+ readonly values: readonly string[];
4
+ }
5
+ export type TagInputValidationResult = {
6
+ readonly kind: "accepted";
7
+ readonly value?: string;
8
+ } | {
9
+ readonly kind: "rejected";
10
+ readonly message: string;
11
+ };
12
+ export interface TagInputProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "onInput" | "ref"> {
13
+ ref?: HTMLDivElement | ((element: HTMLDivElement) => void);
14
+ inputRef?: HTMLInputElement | ((element: HTMLInputElement) => void);
15
+ label: string;
16
+ name?: string;
17
+ form?: string;
18
+ value?: readonly string[];
19
+ defaultValue?: readonly string[];
20
+ onValueChange?: (value: readonly string[]) => void;
21
+ validate?: (candidate: string, context: TagInputValidationContext, signal: AbortSignal) => TagInputValidationResult | Promise<TagInputValidationResult>;
22
+ onValidationError?: (error: unknown) => void;
23
+ normalize?: (draft: string) => string;
24
+ placeholder?: string;
25
+ description?: string;
26
+ error?: string;
27
+ disabled?: boolean;
28
+ readOnly?: boolean;
29
+ required?: boolean;
30
+ commitKeys?: readonly string[];
31
+ }
32
+ /** An ordered free-form tag editor with native multi-value form projection. */
33
+ export declare function TagInput(props: TagInputProps): JSX.Element;