@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,7 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { InputProps } from "./Input.tsx";
3
+ export interface InputGroupProps extends InputProps {
4
+ startContent?: JSX.Element;
5
+ endContent?: JSX.Element;
6
+ }
7
+ export declare function InputGroup(props: InputGroupProps): JSX.Element;
@@ -0,0 +1,73 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { Field as t } from "./Field.js";
3
+ import { createComponent as n, insert as r, memo as i, mergeProps as a, spread as o, template as s } from "solid-js/web";
4
+ import { Show as c, children as l, splitProps as u } from "solid-js";
5
+ //#region src/primitives/InputGroup.tsx
6
+ var d = /*#__PURE__*/ s("<span class=sheen-input-addon>"), f = /*#__PURE__*/ s("<div class=sheen-input-group><input>");
7
+ function p(s) {
8
+ let [p, m] = u(s, [
9
+ "label",
10
+ "id",
11
+ "class",
12
+ "description",
13
+ "error",
14
+ "required",
15
+ "disabled",
16
+ "aria-describedby",
17
+ "aria-invalid",
18
+ "startContent",
19
+ "endContent"
20
+ ]), h = l(() => p.startContent), g = l(() => p.endContent);
21
+ return n(t, {
22
+ get label() {
23
+ return p.label;
24
+ },
25
+ get controlId() {
26
+ return p.id;
27
+ },
28
+ get description() {
29
+ return p.description;
30
+ },
31
+ get error() {
32
+ return p.error;
33
+ },
34
+ get required() {
35
+ return p.required;
36
+ },
37
+ get disabled() {
38
+ return p.disabled;
39
+ },
40
+ children: (t) => (() => {
41
+ var s = f(), l = s.firstChild;
42
+ return r(s, n(c, {
43
+ get when() {
44
+ return h() != null;
45
+ },
46
+ get children() {
47
+ var e = d();
48
+ return r(e, h), e;
49
+ }
50
+ }), l), o(l, a(m, t, {
51
+ get "aria-describedby"() {
52
+ return [t["aria-describedby"], p["aria-describedby"]].filter(Boolean).join(" ") || void 0;
53
+ },
54
+ get "aria-invalid"() {
55
+ return i(() => !!p.error)() ? !0 : p["aria-invalid"];
56
+ },
57
+ get class() {
58
+ return e("sheen-input", p.class);
59
+ }
60
+ }), !1, !1), r(s, n(c, {
61
+ get when() {
62
+ return g() != null;
63
+ },
64
+ get children() {
65
+ var e = d();
66
+ return r(e, g), e;
67
+ }
68
+ }), null), s;
69
+ })()
70
+ });
71
+ }
72
+ //#endregion
73
+ export { p as InputGroup };
@@ -0,0 +1,7 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface LinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
3
+ href: string;
4
+ variant?: "text" | "button";
5
+ }
6
+ /** A destination, even when styled like an action. Browser navigation stays native. */
7
+ export declare function Link(props: LinkProps): JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { buttonVariants as t } from "./button-variants.js";
3
+ import { insert as n, mergeProps as r, spread as i, template as a } from "solid-js/web";
4
+ import { splitProps as o } from "solid-js";
5
+ //#region src/primitives/Link.tsx
6
+ var s = /*#__PURE__*/ a("<a>");
7
+ function c(a) {
8
+ let [c, l] = o(a, [
9
+ "variant",
10
+ "class",
11
+ "children"
12
+ ]);
13
+ return (() => {
14
+ var a = s();
15
+ return i(a, r(l, {
16
+ get class() {
17
+ return e("sheen-link", c.variant === "button" && t(), c.class);
18
+ },
19
+ get "data-link-variant"() {
20
+ return c.variant ?? "text";
21
+ },
22
+ get "data-variant"() {
23
+ return c.variant === "button" ? "ghost" : void 0;
24
+ },
25
+ get "data-tone"() {
26
+ return c.variant === "button" ? "neutral" : void 0;
27
+ },
28
+ get "data-size"() {
29
+ return c.variant === "button" ? "md" : void 0;
30
+ }
31
+ }), !1, !0), n(a, () => c.children), a;
32
+ })();
33
+ }
34
+ //#endregion
35
+ export { c as Link };
@@ -0,0 +1,11 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface LinkTooltipProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
3
+ href: string;
4
+ content: string;
5
+ tooltipDisabled?: boolean;
6
+ placement?: "top" | "bottom" | "left" | "right";
7
+ openDelay?: number;
8
+ closeDelay?: number;
9
+ }
10
+ /** Native navigation with contextual help; disabling the tooltip never disables the link. */
11
+ export declare function LinkTooltip(props: LinkTooltipProps): JSX.Element;
@@ -0,0 +1,88 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { TooltipLayer as t, createTooltipLayer as n } from "./tooltip-layer.js";
3
+ import { createComponent as r, mergeProps as i, spread as a, template as o } from "solid-js/web";
4
+ import { splitProps as s } from "solid-js";
5
+ import * as c from "@kobalte/core/tooltip";
6
+ //#region src/primitives/LinkTooltip.tsx
7
+ var l = /*#__PURE__*/ o("<a>");
8
+ function u(o) {
9
+ let [u, d] = s(o, [
10
+ "content",
11
+ "tooltipDisabled",
12
+ "placement",
13
+ "openDelay",
14
+ "closeDelay",
15
+ "children",
16
+ "ref",
17
+ "class",
18
+ "aria-describedby",
19
+ "type"
20
+ ]), f = (e) => (() => {
21
+ var t = l();
22
+ return a(t, i(e, { get type() {
23
+ return u.type;
24
+ } }), !1, !1), t;
25
+ })(), p, m = n(() => p, () => u.tooltipDisabled ?? !1);
26
+ return r(c.Root, {
27
+ get open() {
28
+ return m.open();
29
+ },
30
+ get onOpenChange() {
31
+ return m.change;
32
+ },
33
+ get disabled() {
34
+ return u.tooltipDisabled ?? !1;
35
+ },
36
+ get placement() {
37
+ return u.placement ?? "top";
38
+ },
39
+ get openDelay() {
40
+ return u.openDelay ?? 500;
41
+ },
42
+ get closeDelay() {
43
+ return u.closeDelay ?? 100;
44
+ },
45
+ gutter: 6,
46
+ get children() {
47
+ return [r(c.Trigger, i({ as: f }, d, {
48
+ get class() {
49
+ return e("sheen-link-tooltip", u.class);
50
+ },
51
+ get "aria-describedby"() {
52
+ return [u["aria-describedby"], m.open() ? `${m.id}-content` : void 0].filter(Boolean).join(" ") || void 0;
53
+ },
54
+ get onClick() {
55
+ return d.onClick ?? (() => {});
56
+ },
57
+ get onFocus() {
58
+ return d.onFocus ?? (() => {});
59
+ },
60
+ get onBlur() {
61
+ return d.onBlur ?? (() => {});
62
+ },
63
+ get onPointerDown() {
64
+ return d.onPointerDown ?? (() => {});
65
+ },
66
+ get onPointerEnter() {
67
+ return d.onPointerEnter ?? (() => {});
68
+ },
69
+ get onPointerLeave() {
70
+ return d.onPointerLeave ?? (() => {});
71
+ },
72
+ ref: (e) => {
73
+ p = e, typeof u.ref == "function" && u.ref(e);
74
+ },
75
+ get children() {
76
+ return u.children;
77
+ }
78
+ })), r(t, {
79
+ state: m,
80
+ get content() {
81
+ return u.content;
82
+ }
83
+ })];
84
+ }
85
+ });
86
+ }
87
+ //#endregion
88
+ export { u as LinkTooltip };
@@ -0,0 +1,17 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface NavListProps extends JSX.HTMLAttributes<HTMLElement> {
3
+ label: string;
4
+ }
5
+ export interface NavItemProps extends Omit<JSX.AnchorHTMLAttributes<HTMLAnchorElement>, "children" | "aria-current"> {
6
+ href: string;
7
+ label: string;
8
+ current?: boolean;
9
+ icon?: JSX.Element;
10
+ badge?: JSX.Element;
11
+ tooltip?: string;
12
+ tooltipDisabled?: boolean;
13
+ /** Optional sibling controls. Interactive content is never nested inside the destination link. */
14
+ actions?: JSX.Element;
15
+ }
16
+ export declare function NavList(props: NavListProps): JSX.Element;
17
+ export declare function NavItem(props: NavItemProps): JSX.Element;
@@ -0,0 +1,143 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { LinkTooltip as t } from "./LinkTooltip.js";
3
+ import { createLinkFocusRecovery as n } from "./link-focus.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 { Show as d, children as f, createContext as p, createMemo as m, splitProps as h, useContext as g } from "solid-js";
6
+ //#region src/primitives/NavList.tsx
7
+ var _ = /*#__PURE__*/ l("<nav><ul>"), v = /*#__PURE__*/ l("<span class=sheen-nav-item-icon aria-hidden=true>"), y = /*#__PURE__*/ l("<span class=sheen-nav-item-label>"), b = /*#__PURE__*/ l("<span class=sheen-nav-item-badge>"), x = /*#__PURE__*/ l("<span class=sheen-nav-item-actions>"), S = /*#__PURE__*/ l("<li class=sheen-nav-item-row>"), C = /*#__PURE__*/ l("<a>"), w = p(!1);
8
+ function T(t) {
9
+ let [i, s] = h(t, [
10
+ "label",
11
+ "class",
12
+ "children",
13
+ "ref"
14
+ ]), l;
15
+ n(() => l);
16
+ let d = m(() => {
17
+ if (!i.label.trim()) throw Error("NavList requires a nonempty accessible label");
18
+ return i.label;
19
+ });
20
+ return (() => {
21
+ var t = _(), n = t.firstChild;
22
+ return u((e) => {
23
+ l = e, typeof i.ref == "function" && i.ref(e);
24
+ }, t), c(t, o(s, {
25
+ get tabIndex() {
26
+ return s.tabIndex ?? -1;
27
+ },
28
+ get "aria-label"() {
29
+ return d();
30
+ },
31
+ get class() {
32
+ return e("sheen-nav-list", i.class);
33
+ }
34
+ }), !1, !0), a(n, r(w.Provider, {
35
+ value: !0,
36
+ get children() {
37
+ return i.children;
38
+ }
39
+ })), t;
40
+ })();
41
+ }
42
+ function E(n) {
43
+ if (!g(w)) throw Error("NavItem requires a NavList owner");
44
+ let [l, u] = h(n, [
45
+ "href",
46
+ "label",
47
+ "current",
48
+ "class",
49
+ "icon",
50
+ "badge",
51
+ "tooltip",
52
+ "tooltipDisabled",
53
+ "actions"
54
+ ]), p = f(() => l.icon), _ = f(() => l.badge), T = f(() => l.actions), E = m(() => {
55
+ if (!l.href.trim() || !l.label.trim()) throw Error("NavItem requires nonempty href and label");
56
+ return l.href;
57
+ }), D = f(() => [
58
+ r(d, {
59
+ get when() {
60
+ return p();
61
+ },
62
+ get children() {
63
+ var e = v();
64
+ return a(e, p), e;
65
+ }
66
+ }),
67
+ (() => {
68
+ var e = y();
69
+ return a(e, () => l.label), e;
70
+ })(),
71
+ r(d, {
72
+ get when() {
73
+ return _();
74
+ },
75
+ get children() {
76
+ var e = b();
77
+ return a(e, _), e;
78
+ }
79
+ })
80
+ ]);
81
+ return (() => {
82
+ var n = S();
83
+ return a(n, r(d, {
84
+ get when() {
85
+ return l.tooltip !== void 0;
86
+ },
87
+ get fallback() {
88
+ return (() => {
89
+ var t = C();
90
+ return c(t, o(u, {
91
+ get href() {
92
+ return E();
93
+ },
94
+ get "aria-current"() {
95
+ return l.current ? "page" : void 0;
96
+ },
97
+ get class() {
98
+ return e("sheen-nav-item", l.class);
99
+ }
100
+ }), !1, !0), a(t, D), t;
101
+ })();
102
+ },
103
+ get children() {
104
+ return r(t, o(u, {
105
+ get href() {
106
+ return E();
107
+ },
108
+ get content() {
109
+ return l.tooltip ?? "";
110
+ },
111
+ get tooltipDisabled() {
112
+ return l.tooltipDisabled ?? !1;
113
+ },
114
+ get "aria-current"() {
115
+ return l.current ? "page" : void 0;
116
+ },
117
+ get class() {
118
+ return e("sheen-nav-item", l.class);
119
+ },
120
+ get children() {
121
+ return D();
122
+ }
123
+ }));
124
+ }
125
+ }), null), a(n, r(d, {
126
+ get when() {
127
+ return T() != null;
128
+ },
129
+ get children() {
130
+ var e = x();
131
+ return a(e, T), e;
132
+ }
133
+ }), null), i((e) => {
134
+ var t = l.current || void 0, r = T() != null || void 0;
135
+ return t !== e.e && s(n, "data-current", e.e = t), r !== e.t && s(n, "data-has-actions", e.t = r), e;
136
+ }, {
137
+ e: void 0,
138
+ t: void 0
139
+ }), n;
140
+ })();
141
+ }
142
+ //#endregion
143
+ export { E as NavItem, T as NavList };
@@ -0,0 +1,8 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface CalloutProps extends JSX.HTMLAttributes<HTMLDivElement> {
3
+ tone?: "info" | "success" | "warning" | "danger";
4
+ heading?: string;
5
+ }
6
+ export type AlertProps = CalloutProps;
7
+ export declare function Callout(props: CalloutProps): JSX.Element;
8
+ export declare function Alert(props: AlertProps): JSX.Element;
@@ -0,0 +1,64 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { createComponent as t, insert as n, mergeProps as r, spread as i, template as a } from "solid-js/web";
3
+ import { Show as o, splitProps as s } from "solid-js";
4
+ //#region src/primitives/Notice.tsx
5
+ var c = /*#__PURE__*/ a("<strong class=sheen-notice-heading>"), l = /*#__PURE__*/ a("<div><div class=sheen-notice-content>");
6
+ function u(a) {
7
+ let [u, d] = s(a, [
8
+ "class",
9
+ "tone",
10
+ "heading",
11
+ "children"
12
+ ]);
13
+ return (() => {
14
+ var a = l(), s = a.firstChild;
15
+ return i(a, r(d, {
16
+ get class() {
17
+ return e("sheen-notice", u.class);
18
+ },
19
+ get "data-tone"() {
20
+ return u.tone ?? "info";
21
+ },
22
+ role: "note"
23
+ }), !1, !0), n(a, t(o, {
24
+ get when() {
25
+ return u.heading;
26
+ },
27
+ get children() {
28
+ var e = c();
29
+ return n(e, () => u.heading), e;
30
+ }
31
+ }), s), n(s, () => u.children), a;
32
+ })();
33
+ }
34
+ function d(a) {
35
+ let [u, d] = s(a, [
36
+ "class",
37
+ "tone",
38
+ "heading",
39
+ "children"
40
+ ]);
41
+ return (() => {
42
+ var a = l(), s = a.firstChild;
43
+ return i(a, r(d, {
44
+ get class() {
45
+ return e("sheen-notice", u.class);
46
+ },
47
+ get "data-tone"() {
48
+ return u.tone ?? "danger";
49
+ },
50
+ role: "alert",
51
+ "aria-atomic": "true"
52
+ }), !1, !0), n(a, t(o, {
53
+ get when() {
54
+ return u.heading;
55
+ },
56
+ get children() {
57
+ var e = c();
58
+ return n(e, () => u.heading), e;
59
+ }
60
+ }), s), n(s, () => u.children), a;
61
+ })();
62
+ }
63
+ //#endregion
64
+ export { d as Alert, u as Callout };
@@ -0,0 +1,22 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface NumberFieldProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "onChange"> {
3
+ label: string;
4
+ value?: number | null;
5
+ defaultValue?: number | null;
6
+ onValueChange?: (value: number | null) => void;
7
+ min?: number;
8
+ max?: number;
9
+ step?: number;
10
+ largeStep?: number;
11
+ formatOptions?: Intl.NumberFormatOptions;
12
+ name?: string;
13
+ form?: string;
14
+ description?: string;
15
+ error?: string;
16
+ disabled?: boolean;
17
+ readOnly?: boolean;
18
+ required?: boolean;
19
+ inputRef?: HTMLInputElement | ((element: HTMLInputElement) => void);
20
+ }
21
+ /** A locale-aware spinbutton with numeric app state and raw native form submission. */
22
+ export declare function NumberField(props: NumberFieldProps): JSX.Element;
@@ -0,0 +1,177 @@
1
+ import { useTheme as e } from "../theme/ThemeProvider.js";
2
+ import { cn as t } from "../utils/cn.js";
3
+ import { delegateEvents as n, effect as r, insert as i, memo as a, mergeProps as o, setAttribute as s, spread as c, template as l, use as u } from "solid-js/web";
4
+ import { createSignal as d, createUniqueId as f, onMount as p, splitProps as m } from "solid-js";
5
+ //#region src/primitives/NumberField.tsx
6
+ var h = /*#__PURE__*/ l("<div><label class=sheen-field-label></label><div class=sheen-number-field-control><input class=\"sheen-input sheen-number-field-input\"type=text role=spinbutton inputmode=decimal><div class=sheen-number-field-steps><button type=button class=sheen-number-field-step><span aria-hidden=true>−</span></button><button type=button class=sheen-number-field-step><span aria-hidden=true>+"), g = /*#__PURE__*/ l("<span aria-hidden=true> *"), _ = /*#__PURE__*/ l("<input type=hidden>"), v = /*#__PURE__*/ l("<p class=sheen-field-description>"), y = /*#__PURE__*/ l("<p class=sheen-field-error>");
7
+ function b(e, t, n, r) {
8
+ if (!Number.isFinite(e) || !Number.isFinite(t) || e >= t) throw Error("NumberField min and max must be finite and increasing");
9
+ if (!Number.isFinite(n) || n <= 0) throw Error("NumberField step must be positive and finite");
10
+ if (r !== void 0 && (!Number.isFinite(r) || r <= 0)) throw Error("NumberField largeStep must be positive and finite");
11
+ }
12
+ function x(e, t) {
13
+ return e.replace("{label}", t);
14
+ }
15
+ function S(e) {
16
+ let t = e.toString().match(/(?:\.(\d+))?(?:e-([0-9]+))?$/iu);
17
+ return Math.min(12, Math.max(t?.[1]?.length ?? 0, Number(t?.[2] ?? 0)));
18
+ }
19
+ function C(e, t, n, r, i) {
20
+ let a = 10 ** Math.max(S(i), S(n)), o = Math.round((e + t) * a) / a;
21
+ return Math.min(r, Math.max(n, o));
22
+ }
23
+ function w(e, t) {
24
+ let n = new Intl.NumberFormat(e, t), r = new Intl.NumberFormat(e, { useGrouping: !1 }), i = Array.from({ length: 10 }, (e, t) => r.format(t)), a = [], o = ".", s = "-", c = "+";
25
+ for (let e of n.formatToParts(-12345.6)) e.type === "decimal" ? o = e.value : e.type === "minusSign" ? s = e.value : e.type === "plusSign" ? c = e.value : e.type !== "integer" && e.type !== "fraction" && a.push(e.value);
26
+ let l = t?.style === "percent";
27
+ return (e) => {
28
+ let t = e.trim();
29
+ if (!t) return null;
30
+ if (i.forEach((e, n) => {
31
+ t = t.replaceAll(e, String(n));
32
+ }), a.forEach((e) => {
33
+ t = t.replaceAll(e, "");
34
+ }), t = t.replaceAll(o, ".").replaceAll(s, "-").replaceAll("−", "-").replaceAll(c, "+").replaceAll(" ", ""), !t || t === "-" || t === "+" || t === "." || t === "-." || t === "+.") return;
35
+ let n = Number(t);
36
+ return Number.isFinite(n) ? n / (l ? 100 : 1) : void 0;
37
+ };
38
+ }
39
+ function T(n) {
40
+ let [l, S] = m(n, [
41
+ "id",
42
+ "class",
43
+ "label",
44
+ "value",
45
+ "defaultValue",
46
+ "onValueChange",
47
+ "min",
48
+ "max",
49
+ "step",
50
+ "largeStep",
51
+ "formatOptions",
52
+ "name",
53
+ "form",
54
+ "description",
55
+ "error",
56
+ "disabled",
57
+ "readOnly",
58
+ "required",
59
+ "inputRef"
60
+ ]), T = e(), E = f(), D = () => l.id ?? E, O = () => `${D()}-input`, k = () => `${D()}-label`, A = () => `${D()}-description`, j = () => `${D()}-error`, M = () => [l.description ? A() : void 0, l.error ? j() : void 0].filter((e) => e !== void 0).join(" ") || void 0, N = () => l.min ?? -(2 ** 53 - 1), P = () => l.max ?? 2 ** 53 - 1, F = () => l.step ?? 1, I = () => new Intl.NumberFormat(T.state().locale, l.formatOptions), L = () => w(T.state().locale, l.formatOptions), [R, z] = d(l.defaultValue ?? null), B = () => l.value === void 0 ? R() : l.value, V = (e) => e === null ? "" : I().format(e), [H, U] = d(V(B())), [W, G] = d(!1), K, q;
61
+ (() => {
62
+ if (!l.label.trim()) throw Error("NumberField label must be nonempty");
63
+ b(N(), P(), F(), l.largeStep);
64
+ for (let [e, t] of [["value", l.value], ["defaultValue", l.defaultValue]]) if (t != null && (!Number.isFinite(t) || t < N() || t > P())) throw Error(`NumberField ${e} must be finite and within range`);
65
+ })();
66
+ let J = () => W() ? H() : V(B()), Y = (e, t) => {
67
+ l.value === void 0 && z(e), l.onValueChange?.(e), t && U(V(B()));
68
+ }, X = (e) => e === null ? !l.required : e !== void 0 && e >= N() && e <= P(), Z = () => {
69
+ let e = (q ?? L())(H());
70
+ X(e) ? Y(e, !0) : U(V(B()));
71
+ }, Q = (e) => {
72
+ if (l.disabled || l.readOnly) return;
73
+ let t = B() ?? Math.min(P(), Math.max(N(), 0));
74
+ Y(C(t, e, N(), P(), F()), !0);
75
+ }, $ = (e) => {
76
+ K = e, typeof l.inputRef == "function" && l.inputRef(e);
77
+ };
78
+ return p(() => {
79
+ if (!K) return;
80
+ let e = K.ownerDocument.activeElement === K;
81
+ if (G(e), e && (q = L()), K.value !== V(B())) {
82
+ U(K.value);
83
+ let e = L()(K.value);
84
+ X(e) && Y(e, !1);
85
+ }
86
+ }), (() => {
87
+ var e = h(), n = e.firstChild, d = n.nextSibling.firstChild, f = d.nextSibling.firstChild, p = f.nextSibling;
88
+ return c(e, o(S, {
89
+ get id() {
90
+ return D();
91
+ },
92
+ get class() {
93
+ return t("sheen-field sheen-number-field", l.class);
94
+ },
95
+ role: "group",
96
+ get "data-invalid"() {
97
+ return l.error ? "" : void 0;
98
+ },
99
+ get "data-disabled"() {
100
+ return l.disabled ? "" : void 0;
101
+ }
102
+ }), !1, !0), i(n, () => l.label, null), i(n, (() => {
103
+ var e = a(() => !!l.required);
104
+ return () => e() ? g() : null;
105
+ })(), null), d.$$keydown = (e) => {
106
+ if (e.key === "Enter") e.preventDefault(), Z();
107
+ else if (e.key === "Escape") e.preventDefault(), U(V(B())), e.currentTarget.select();
108
+ else if (e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "PageUp" || e.key === "PageDown") {
109
+ if (l.readOnly) return;
110
+ e.preventDefault();
111
+ let t = e.key.startsWith("Page") ? l.largeStep ?? F() * 10 : F();
112
+ Q(e.key === "ArrowDown" || e.key === "PageDown" ? -t : t);
113
+ } else e.key === "Home" && !l.readOnly ? (e.preventDefault(), Y(N(), !0)) : e.key === "End" && !l.readOnly && (e.preventDefault(), Y(P(), !0));
114
+ }, d.addEventListener("blur", () => {
115
+ G(!1), Z(), q = void 0;
116
+ }), d.$$input = (e) => {
117
+ U(e.currentTarget.value);
118
+ let t = (q ?? L())(e.currentTarget.value);
119
+ X(t) && Y(t, !1);
120
+ }, d.addEventListener("focus", () => {
121
+ q = L(), G(!0);
122
+ }), u($, d), f.$$click = () => Q(-F()), p.$$click = () => Q(F()), i(e, (() => {
123
+ var e = a(() => !!l.name);
124
+ return () => e() ? (() => {
125
+ var e = _();
126
+ return r((t) => {
127
+ var n = l.name, r = l.form;
128
+ return n !== t.e && s(e, "name", t.e = n), r !== t.t && s(e, "form", t.t = r), t;
129
+ }, {
130
+ e: void 0,
131
+ t: void 0
132
+ }), r(() => e.value = B() ?? ""), e;
133
+ })() : null;
134
+ })(), null), i(e, (() => {
135
+ var e = a(() => !!l.description);
136
+ return () => e() ? (() => {
137
+ var e = v();
138
+ return i(e, () => l.description), r(() => s(e, "id", A())), e;
139
+ })() : null;
140
+ })(), null), i(e, (() => {
141
+ var e = a(() => !!l.error);
142
+ return () => e() ? (() => {
143
+ var e = y();
144
+ return i(e, () => l.error), r(() => s(e, "id", j())), e;
145
+ })() : null;
146
+ })(), null), r((e) => {
147
+ var t = k(), r = O(), i = O(), a = k(), o = M(), c = N(), u = P(), m = B() ?? void 0, h = B() === null ? void 0 : V(B()), g = l.error ? "true" : void 0, _ = l.required, v = l.disabled, y = l.readOnly, b = l.form, S = x(T.messages().decreaseValue, l.label), C = l.disabled || l.readOnly, w = x(T.messages().increaseValue, l.label), E = l.disabled || l.readOnly;
148
+ return t !== e.e && s(n, "id", e.e = t), r !== e.t && s(n, "for", e.t = r), i !== e.a && s(d, "id", e.a = i), a !== e.o && s(d, "aria-labelledby", e.o = a), o !== e.i && s(d, "aria-describedby", e.i = o), c !== e.n && s(d, "aria-valuemin", e.n = c), u !== e.s && s(d, "aria-valuemax", e.s = u), m !== e.h && s(d, "aria-valuenow", e.h = m), h !== e.r && s(d, "aria-valuetext", e.r = h), g !== e.d && s(d, "aria-invalid", e.d = g), _ !== e.l && (d.required = e.l = _), v !== e.u && (d.disabled = e.u = v), y !== e.c && (d.readOnly = e.c = y), b !== e.w && s(d, "form", e.w = b), S !== e.m && s(f, "aria-label", e.m = S), C !== e.f && (f.disabled = e.f = C), w !== e.y && s(p, "aria-label", e.y = w), E !== e.g && (p.disabled = e.g = E), e;
149
+ }, {
150
+ e: void 0,
151
+ t: void 0,
152
+ a: void 0,
153
+ o: void 0,
154
+ i: void 0,
155
+ n: void 0,
156
+ s: void 0,
157
+ h: void 0,
158
+ r: void 0,
159
+ d: void 0,
160
+ l: void 0,
161
+ u: void 0,
162
+ c: void 0,
163
+ w: void 0,
164
+ m: void 0,
165
+ f: void 0,
166
+ y: void 0,
167
+ g: void 0
168
+ }), r(() => d.value = J()), e;
169
+ })();
170
+ }
171
+ n([
172
+ "input",
173
+ "keydown",
174
+ "click"
175
+ ]);
176
+ //#endregion
177
+ export { T as NumberField };
@@ -0,0 +1,12 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface PaginationProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "children" | "onChange"> {
3
+ pageIndex: number;
4
+ pageCount: number;
5
+ onPageChange: (pageIndex: number) => void;
6
+ pending?: boolean;
7
+ /** Disable page requests without claiming that a request is still in progress. */
8
+ disabled?: boolean;
9
+ label?: string;
10
+ }
11
+ /** Controlled accepted-page state; requesting a page does not optimistically announce it. */
12
+ export declare function Pagination(props: PaginationProps): JSX.Element;