@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,127 @@
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 { useNumberFormatter as r } from "../theme/intl.js";
5
+ import { createComponent as i, insert as a, mergeProps as o, spread as s, template as c, use as l } from "solid-js/web";
6
+ import { For as u, createMemo as d, onCleanup as f, onMount as p, splitProps as m } from "solid-js";
7
+ //#region src/primitives/Pagination.tsx
8
+ var h = /*#__PURE__*/ c("<nav><output aria-live=polite aria-atomic=true>");
9
+ function g(c) {
10
+ let [g, _] = m(c, [
11
+ "pageIndex",
12
+ "pageCount",
13
+ "onPageChange",
14
+ "pending",
15
+ "disabled",
16
+ "label",
17
+ "class",
18
+ "ref"
19
+ ]), v;
20
+ p(() => {
21
+ let e = v;
22
+ if (!e) return;
23
+ let t = e.ownerDocument, n, r = () => {
24
+ n = e.contains(t.activeElement) ? t.activeElement ?? void 0 : void 0;
25
+ };
26
+ r(), t.addEventListener("focusin", r);
27
+ let i = new MutationObserver(() => {
28
+ if (!n || e.contains(n) || t.activeElement !== t.body || !e.isConnected) return;
29
+ let r = e.querySelector("[aria-current=\"page\"]") ?? e.querySelector("button");
30
+ r && !r.closest("[inert], [hidden]") && r.getClientRects().length && r.focus({ preventScroll: !0 });
31
+ });
32
+ i.observe(e, {
33
+ childList: !0,
34
+ subtree: !0
35
+ }), f(() => {
36
+ i.disconnect(), t.removeEventListener("focusin", r);
37
+ });
38
+ });
39
+ let y = e(), b = r(), x = d(() => {
40
+ if (!Number.isSafeInteger(g.pageCount) || g.pageCount < 0) throw Error("Pagination pageCount must be a nonnegative safe integer");
41
+ if (!Number.isSafeInteger(g.pageIndex) || g.pageIndex < 0 || g.pageIndex >= Math.max(1, g.pageCount)) throw Error("Pagination pageIndex must identify an accepted page, or zero for empty results");
42
+ return {
43
+ index: g.pageIndex,
44
+ count: g.pageCount
45
+ };
46
+ }), S = d(() => {
47
+ let { index: e, count: t } = x(), n = Math.max(0, Math.min(e - 2, t - 5));
48
+ return Array.from({ length: Math.min(5, t) }, (e, t) => n + t);
49
+ }), C = (e) => g.pending || g.disabled || e < 0 || e >= x().count || e === x().index, w = (e) => {
50
+ C(e) || g.onPageChange(e);
51
+ }, T = (e) => y.messages().pageLabel.replaceAll("{page}", b().format(e + 1)), E = () => y.messages().pageStatus.replaceAll("{page}", b().format(x().count ? x().index + 1 : 0)).replaceAll("{pages}", b().format(x().count));
52
+ return (() => {
53
+ var e = h(), r = e.firstChild;
54
+ return l((e) => {
55
+ v = e, typeof g.ref == "function" && g.ref(e);
56
+ }, e), s(e, o(_, {
57
+ get class() {
58
+ return t("sheen-pagination", g.class);
59
+ },
60
+ get "aria-label"() {
61
+ return g.label ?? y.messages().pagination;
62
+ },
63
+ get "aria-busy"() {
64
+ return g.pending || void 0;
65
+ },
66
+ get "aria-disabled"() {
67
+ return g.disabled || void 0;
68
+ },
69
+ get "data-pending"() {
70
+ return g.pending ? "" : void 0;
71
+ }
72
+ }), !1, !0), a(e, i(n, {
73
+ get "aria-disabled"() {
74
+ return C(0) || void 0;
75
+ },
76
+ onClick: () => w(0),
77
+ get children() {
78
+ return y.messages().firstPage;
79
+ }
80
+ }), r), a(e, i(n, {
81
+ get "aria-disabled"() {
82
+ return C(x().index - 1) || void 0;
83
+ },
84
+ onClick: () => w(x().index - 1),
85
+ get children() {
86
+ return y.messages().previousPage;
87
+ }
88
+ }), r), a(e, i(u, {
89
+ get each() {
90
+ return S();
91
+ },
92
+ children: (e) => i(n, {
93
+ get "aria-label"() {
94
+ return T(e);
95
+ },
96
+ get "aria-current"() {
97
+ return e === x().index ? "page" : void 0;
98
+ },
99
+ get "aria-disabled"() {
100
+ return C(e) || void 0;
101
+ },
102
+ onClick: () => w(e),
103
+ get children() {
104
+ return b().format(e + 1);
105
+ }
106
+ })
107
+ }), r), a(e, i(n, {
108
+ get "aria-disabled"() {
109
+ return C(x().index + 1) || void 0;
110
+ },
111
+ onClick: () => w(x().index + 1),
112
+ get children() {
113
+ return y.messages().nextPage;
114
+ }
115
+ }), r), a(e, i(n, {
116
+ get "aria-disabled"() {
117
+ return C(x().count - 1) || void 0;
118
+ },
119
+ onClick: () => w(x().count - 1),
120
+ get children() {
121
+ return y.messages().lastPage;
122
+ }
123
+ }), r), a(r, E), e;
124
+ })();
125
+ }
126
+ //#endregion
127
+ export { g as Pagination };
@@ -0,0 +1,12 @@
1
+ import type { JSX, ParentProps } from "solid-js";
2
+ export interface PopoverProps extends ParentProps {
3
+ trigger: JSX.Element;
4
+ title: string;
5
+ description?: string;
6
+ open?: boolean;
7
+ defaultOpen?: boolean;
8
+ onOpenChange?: (open: boolean) => void;
9
+ placement?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "right";
10
+ class?: string;
11
+ }
12
+ export declare function Popover(props: PopoverProps): JSX.Element;
@@ -0,0 +1,103 @@
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, template as a } from "solid-js/web";
5
+ import { Show as o, createEffect as s, createMemo as c, createSignal as l, createUniqueId as u, onCleanup as d } from "solid-js";
6
+ import * as f from "@kobalte/core/popover";
7
+ //#region src/primitives/Popover.tsx
8
+ var p = /*#__PURE__*/ a("<div class=sheen-dialog-header>"), m = /*#__PURE__*/ a("<div class=sheen-dialog-body>"), h = /*#__PURE__*/ a("<div class=sheen-dialog-footer>");
9
+ function g(a) {
10
+ let g = e(), _ = u(), [v, y] = l(a.defaultOpen ?? !1), b = () => a.open === void 0 ? v() : a.open, x = (e) => {
11
+ e !== b() && (a.open === void 0 && y(e), a.onOpenChange?.(e));
12
+ };
13
+ s(() => {
14
+ b() && d(g.layers.register(_));
15
+ });
16
+ let S = c((e) => b() ? g.layers.zIndex(_) : e ?? 100);
17
+ return r(f.Root, {
18
+ get open() {
19
+ return b();
20
+ },
21
+ onOpenChange: x,
22
+ get placement() {
23
+ return a.placement ?? "bottom";
24
+ },
25
+ gutter: 6,
26
+ get children() {
27
+ return [r(f.Trigger, {
28
+ as: n,
29
+ variant: "outline",
30
+ "data-sheen-popover-trigger": "",
31
+ get children() {
32
+ return a.trigger;
33
+ }
34
+ }), r(o, {
35
+ get when() {
36
+ return g.portal();
37
+ },
38
+ children: (e) => r(f.Portal, {
39
+ get mount() {
40
+ return e();
41
+ },
42
+ get children() {
43
+ return r(f.Content, {
44
+ "data-kb-top-layer": "true",
45
+ get class() {
46
+ return t("sheen-popover", a.class);
47
+ },
48
+ get "aria-hidden"() {
49
+ return !b() || void 0;
50
+ },
51
+ get inert() {
52
+ return !b();
53
+ },
54
+ get style() {
55
+ return { "z-index": S() };
56
+ },
57
+ onEscapeKeyDown: (e) => {
58
+ g.layers.isTop(_) || e.preventDefault();
59
+ },
60
+ get children() {
61
+ return [
62
+ (() => {
63
+ var e = p();
64
+ return i(e, r(f.Title, { get children() {
65
+ return a.title;
66
+ } }), null), i(e, r(o, {
67
+ get when() {
68
+ return a.description;
69
+ },
70
+ get children() {
71
+ return r(f.Description, { get children() {
72
+ return a.description;
73
+ } });
74
+ }
75
+ }), null), e;
76
+ })(),
77
+ (() => {
78
+ var e = m();
79
+ return i(e, () => a.children), e;
80
+ })(),
81
+ (() => {
82
+ var e = h();
83
+ return i(e, r(f.CloseButton, {
84
+ as: n,
85
+ get "aria-label"() {
86
+ return g.messages().close;
87
+ },
88
+ get children() {
89
+ return g.messages().close;
90
+ }
91
+ })), e;
92
+ })()
93
+ ];
94
+ }
95
+ });
96
+ }
97
+ })
98
+ })];
99
+ }
100
+ });
101
+ }
102
+ //#endregion
103
+ export { g as Popover };
@@ -0,0 +1,17 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface ProgressProps extends Omit<JSX.ProgressHTMLAttributes<HTMLProgressElement>, "children" | "max" | "value"> {
3
+ label: string;
4
+ max?: number;
5
+ value?: number;
6
+ }
7
+ export declare function Progress(props: ProgressProps): JSX.Element;
8
+ export interface MeterProps extends Omit<JSX.MeterHTMLAttributes<HTMLMeterElement>, "children" | "high" | "low" | "max" | "min" | "optimum" | "value"> {
9
+ label: string;
10
+ value: number;
11
+ min?: number;
12
+ max?: number;
13
+ low?: number;
14
+ high?: number;
15
+ optimum?: number;
16
+ }
17
+ export declare function Meter(props: MeterProps): JSX.Element;
@@ -0,0 +1,98 @@
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 { createMemo as i, splitProps as a } from "solid-js";
4
+ //#region src/primitives/Progress.tsx
5
+ var o = /*#__PURE__*/ r("<progress>"), s = /*#__PURE__*/ r("<meter>");
6
+ function c(r) {
7
+ let [i, s] = a(r, [
8
+ "label",
9
+ "max",
10
+ "value",
11
+ "class"
12
+ ]);
13
+ if (!i.label?.trim()) throw Error("Progress requires a nonempty label");
14
+ let c = () => {
15
+ let e = i.max ?? 1;
16
+ if (!Number.isFinite(e) || e <= 0) throw Error("Progress max is invalid");
17
+ if (i.value !== void 0 && (!Number.isFinite(i.value) || i.value < 0 || i.value > e)) throw Error("Progress value is invalid");
18
+ return i.value;
19
+ };
20
+ return (() => {
21
+ var r = o();
22
+ return n(r, t(s, {
23
+ get max() {
24
+ return i.max;
25
+ },
26
+ get value() {
27
+ return c();
28
+ },
29
+ get class() {
30
+ return e("sheen-progress", i.class);
31
+ },
32
+ get "aria-label"() {
33
+ return i.label;
34
+ }
35
+ }), !1, !1), r;
36
+ })();
37
+ }
38
+ function l(e, t, n, r) {
39
+ if (t !== void 0 && (typeof t != "number" || !Number.isFinite(t) || t < n || t > r)) throw Error(`Meter ${e} is invalid`);
40
+ }
41
+ function u(r) {
42
+ let [o, c] = a(r, [
43
+ "label",
44
+ "value",
45
+ "min",
46
+ "max",
47
+ "low",
48
+ "high",
49
+ "optimum",
50
+ "class"
51
+ ]);
52
+ if (!o.label?.trim()) throw Error("Meter requires a nonempty label");
53
+ let u = i(() => {
54
+ let e = o.min ?? 0, t = o.max ?? 1;
55
+ if (!Number.isFinite(e) || !Number.isFinite(t) || e >= t) throw Error("Meter range is invalid");
56
+ if (!Number.isFinite(o.value) || o.value < e || o.value > t) throw Error("Meter value must be finite and within range");
57
+ if (l("low", o.low, e, t), l("high", o.high, e, t), l("optimum", o.optimum, e, t), o.low !== void 0 && o.high !== void 0 && o.low > o.high) throw Error("Meter low exceeds high");
58
+ let n = o.low ?? e, r = o.high ?? t, i = o.optimum ?? (e + t) / 2, a;
59
+ return a = i < n ? o.value <= n ? "optimum" : o.value <= r ? "suboptimum" : "critical" : i > r ? o.value >= r ? "optimum" : o.value >= n ? "suboptimum" : "critical" : o.value >= n && o.value <= r ? "optimum" : "suboptimum", {
60
+ value: o.value,
61
+ state: a
62
+ };
63
+ });
64
+ return (() => {
65
+ var r = s();
66
+ return n(r, t(c, {
67
+ get value() {
68
+ return u().value;
69
+ },
70
+ get min() {
71
+ return o.min;
72
+ },
73
+ get max() {
74
+ return o.max;
75
+ },
76
+ get low() {
77
+ return o.low;
78
+ },
79
+ get high() {
80
+ return o.high;
81
+ },
82
+ get optimum() {
83
+ return o.optimum;
84
+ },
85
+ get "data-meter-state"() {
86
+ return u().state;
87
+ },
88
+ get class() {
89
+ return e("sheen-meter", o.class);
90
+ },
91
+ get "aria-label"() {
92
+ return o.label;
93
+ }
94
+ }), !1, !1), r;
95
+ })();
96
+ }
97
+ //#endregion
98
+ export { u as Meter, c as Progress };
@@ -0,0 +1,19 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { CheckboxOption } from "./CheckboxGroup.tsx";
3
+ export type RadioOption = CheckboxOption;
4
+ export interface RadioGroupProps extends Omit<JSX.FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" | "onChange" | "id" | "ref" | "name"> {
5
+ id?: string;
6
+ ref?: HTMLFieldSetElement | ((element: HTMLFieldSetElement) => void);
7
+ name: string;
8
+ label: string;
9
+ options: readonly RadioOption[];
10
+ value?: string | null;
11
+ defaultValue?: string | null;
12
+ onValueChange?: (value: string | null) => void;
13
+ description?: string;
14
+ error?: string;
15
+ readOnly?: boolean;
16
+ required?: boolean;
17
+ orientation?: "horizontal" | "vertical";
18
+ }
19
+ export declare function RadioGroup(props: RadioGroupProps): JSX.Element;
@@ -0,0 +1,173 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { createChoiceOptions as t } from "./choice-options.js";
3
+ import { createComponent as n, delegateEvents 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";
4
+ import { For as d, Show as f, createMemo as p, createSignal as m, createUniqueId as h, onCleanup as g, onMount as _, splitProps as v, untrack as y } from "solid-js";
5
+ //#region src/primitives/RadioGroup.tsx
6
+ var b = /*#__PURE__*/ l("<span aria-hidden=true> *"), x = /*#__PURE__*/ l("<p class=sheen-radio-group-description>"), S = /*#__PURE__*/ l("<p class=sheen-radio-group-error>"), C = /*#__PURE__*/ l("<fieldset role=radiogroup><legend class=sheen-radio-group-label></legend><div class=sheen-radio-group-options>"), w = /*#__PURE__*/ l("<p class=sheen-radio-description>"), T = /*#__PURE__*/ l("<div class=sheen-radio-item><div class=sheen-radio-row><input type=radio class=sheen-radio-input><span class=sheen-radio-control aria-hidden=true><span class=sheen-radio-indicator></span></span><label class=sheen-radio-label>");
7
+ function E(r) {
8
+ let l = h(), [E, D] = v(r, [
9
+ "id",
10
+ "ref",
11
+ "class",
12
+ "name",
13
+ "label",
14
+ "options",
15
+ "value",
16
+ "defaultValue",
17
+ "onValueChange",
18
+ "description",
19
+ "error",
20
+ "disabled",
21
+ "readOnly",
22
+ "required",
23
+ "orientation",
24
+ "aria-label",
25
+ "aria-labelledby",
26
+ "aria-describedby"
27
+ ]), O = E.defaultValue ?? null, [k, A] = m(O), j = () => E.value === void 0 ? k() : E.value, M, N = !1;
28
+ g(() => {
29
+ N = !0;
30
+ });
31
+ let { byValue: P, keys: F } = t(() => {
32
+ if (!E.name.trim()) throw Error("RadioGroup: name must be nonempty for native grouping");
33
+ if (E.options.some((e) => !e.value)) throw Error("RadioGroup: option values must be nonempty; use null for no selection");
34
+ return E.options;
35
+ }, () => M, "RadioGroup"), I = p(() => {
36
+ let e = j();
37
+ return e !== null && P().has(e) && !P().get(e)?.disabled ? e : F().find((e) => !P().get(e)?.disabled);
38
+ }), L = (e) => {
39
+ e !== j() && (E.value === void 0 && A(e), E.onValueChange?.(e));
40
+ }, R = () => {
41
+ if (!N) for (let e of M?.querySelectorAll("input[type=radio]") ?? []) e.checked = e.value === j();
42
+ }, z = (e) => {
43
+ if (E.disabled || E.readOnly || P().get(e)?.disabled) {
44
+ R();
45
+ return;
46
+ }
47
+ L(e || null), R();
48
+ };
49
+ _(() => {
50
+ let e = M, t = e?.ownerDocument.defaultView;
51
+ if (!e || !t) return;
52
+ let n = e.querySelector("input[type=radio]:checked");
53
+ !E.disabled && !E.readOnly && n && !n.disabled && L(n.value), R();
54
+ let r = /* @__PURE__ */ new Set(), i = (n) => {
55
+ if (n.target !== e.form) return;
56
+ let i = t.setTimeout(() => {
57
+ r.delete(i), !n.defaultPrevented && (E.value === void 0 && L(O), R());
58
+ }, 0);
59
+ r.add(i);
60
+ };
61
+ e.ownerDocument.addEventListener("reset", i, !0), g(() => {
62
+ e.ownerDocument.removeEventListener("reset", i, !0);
63
+ for (let e of r) t.clearTimeout(e);
64
+ });
65
+ });
66
+ let B = () => [
67
+ E.description ? `${l}-description` : "",
68
+ E.error ? `${l}-error` : "",
69
+ E["aria-describedby"]
70
+ ].filter(Boolean).join(" ") || void 0;
71
+ return (() => {
72
+ var t = C(), r = t.firstChild, p = r.nextSibling;
73
+ return u((e) => {
74
+ M = e, typeof E.ref == "function" && E.ref(e);
75
+ }, t), c(t, o(D, () => E["aria-label"] === void 0 ? {} : { "aria-label": E["aria-label"] }, {
76
+ get "aria-labelledby"() {
77
+ return E["aria-labelledby"] ?? `${l}-label`;
78
+ },
79
+ get "aria-describedby"() {
80
+ return B();
81
+ },
82
+ get "aria-invalid"() {
83
+ return E.error ? "true" : void 0;
84
+ },
85
+ get "aria-readonly"() {
86
+ return E.readOnly || void 0;
87
+ },
88
+ get "aria-orientation"() {
89
+ return E.orientation ?? "vertical";
90
+ },
91
+ get "data-invalid"() {
92
+ return E.error ? "" : void 0;
93
+ },
94
+ get "data-readonly"() {
95
+ return E.readOnly || void 0;
96
+ },
97
+ get id() {
98
+ return E.id ?? l;
99
+ },
100
+ get class() {
101
+ return e("sheen-radio-group", E.class);
102
+ },
103
+ get disabled() {
104
+ return E.disabled ?? !1;
105
+ },
106
+ get tabIndex() {
107
+ return D.tabIndex ?? -1;
108
+ }
109
+ }), !1, !0), s(r, "id", `${l}-label`), a(r, () => E.label, null), a(r, n(f, {
110
+ get when() {
111
+ return E.required;
112
+ },
113
+ get children() {
114
+ return b();
115
+ }
116
+ }), null), a(t, n(f, {
117
+ get when() {
118
+ return E.description;
119
+ },
120
+ get children() {
121
+ var e = x();
122
+ return s(e, "id", `${l}-description`), a(e, () => E.description), e;
123
+ }
124
+ }), p), a(p, n(d, {
125
+ get each() {
126
+ return F();
127
+ },
128
+ children: (e) => {
129
+ let t = y(() => P().get(e));
130
+ if (!t) throw Error("RadioGroup: missing option during creation");
131
+ let r = () => P().get(e) ?? t, o = h(), c;
132
+ return (() => {
133
+ var t = T(), l = t.firstChild.firstChild, d = l.nextSibling, p = d.nextSibling;
134
+ l.addEventListener("change", () => z(e));
135
+ var m = c;
136
+ return typeof m == "function" ? u(m, l) : c = l, s(l, "id", `${o}-input`), l.value = e, s(l, "aria-labelledby", `${o}-label`), d.$$click = () => c?.click(), s(p, "id", `${o}-label`), s(p, "for", `${o}-input`), a(p, () => r().label), a(t, n(f, {
137
+ get when() {
138
+ return r().description;
139
+ },
140
+ get children() {
141
+ var e = w();
142
+ return s(e, "id", `${o}-description`), a(e, () => r().description), e;
143
+ }
144
+ }), null), i((n) => {
145
+ var i = E.disabled || r().disabled || void 0, a = E.name, c = E.required, u = E.disabled || r().disabled, d = E.readOnly, f = [r().description ? `${o}-description` : "", B()].filter(Boolean).join(" ") || void 0, p = D.form, m = j() === e ? "" : void 0, h = !E.disabled && I() === e ? 0 : -1;
146
+ return i !== n.e && s(t, "data-disabled", n.e = i), a !== n.t && s(l, "name", n.t = a), c !== n.a && (l.required = n.a = c), u !== n.o && (l.disabled = n.o = u), d !== n.i && (l.readOnly = n.i = d), f !== n.n && s(l, "aria-describedby", n.n = f), p !== n.s && s(l, "form", n.s = p), m !== n.h && s(l, "data-checked", n.h = m), h !== n.r && s(l, "tabindex", n.r = h), n;
147
+ }, {
148
+ e: void 0,
149
+ t: void 0,
150
+ a: void 0,
151
+ o: void 0,
152
+ i: void 0,
153
+ n: void 0,
154
+ s: void 0,
155
+ h: void 0,
156
+ r: void 0
157
+ }), i(() => l.checked = j() === e), t;
158
+ })();
159
+ }
160
+ })), a(t, n(f, {
161
+ get when() {
162
+ return E.error;
163
+ },
164
+ get children() {
165
+ var e = S();
166
+ return s(e, "id", `${l}-error`), a(e, () => E.error), e;
167
+ }
168
+ }), null), t;
169
+ })();
170
+ }
171
+ r(["click"]);
172
+ //#endregion
173
+ export { E as RadioGroup };
@@ -0,0 +1,36 @@
1
+ import { type JSX } from "solid-js";
2
+ export interface ResizablePersistence {
3
+ readonly initialSizes: readonly number[];
4
+ readonly save: (sizes: readonly number[]) => void | Promise<void>;
5
+ readonly onError: (error: unknown) => void;
6
+ }
7
+ export interface ResizableProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "onChange"> {
8
+ readonly children: JSX.Element;
9
+ readonly orientation?: "horizontal" | "vertical";
10
+ readonly sizes?: readonly number[];
11
+ readonly defaultSizes?: readonly number[];
12
+ readonly onSizesChange?: (sizes: readonly number[]) => void;
13
+ readonly keyboardStep?: number;
14
+ readonly persistence?: ResizablePersistence;
15
+ }
16
+ export interface ResizablePanelProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "onResize"> {
17
+ readonly children: JSX.Element;
18
+ readonly index: number;
19
+ readonly panelId?: string;
20
+ readonly initialSize?: number;
21
+ readonly minSize?: number;
22
+ readonly maxSize?: number;
23
+ readonly collapsible?: boolean;
24
+ readonly collapsedSize?: number;
25
+ readonly collapseThreshold?: number;
26
+ readonly onResize?: (size: number) => void;
27
+ readonly onCollapse?: (size: number) => void;
28
+ readonly onExpand?: (size: number) => void;
29
+ }
30
+ export interface ResizableHandleProps extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
31
+ readonly label: string;
32
+ readonly index: number;
33
+ }
34
+ export declare function Resizable(props: ResizableProps): JSX.Element;
35
+ export declare function ResizablePanel(props: ResizablePanelProps): JSX.Element;
36
+ export declare function ResizableHandle(props: ResizableHandleProps): JSX.Element;