@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,46 @@
1
+ /** Build-time documentation data. Never imported by the component runtime entry point. */
2
+ export interface PropMetadata {
3
+ readonly description: string;
4
+ readonly default?: string | number | boolean | null;
5
+ readonly control?: {
6
+ readonly kind: "boolean" | "text";
7
+ } | {
8
+ readonly kind: "select";
9
+ readonly values: readonly (string | number | boolean | null)[];
10
+ };
11
+ }
12
+ export type ComposerMetadataParentRegion = "root" | "topbar" | "sidebar" | "page-header" | "toolbar" | "main-grid" | "details-panel" | "status-bar" | "overlays";
13
+ export interface ComposerMetadata {
14
+ readonly allowedParentRegions: readonly ComposerMetadataParentRegion[];
15
+ readonly acceptedChildRegions: readonly string[];
16
+ readonly editableSafeProps: readonly string[];
17
+ readonly fixtureFactory: string;
18
+ readonly codeGenerationAdapter: string;
19
+ }
20
+ export interface ComponentMetadata {
21
+ readonly name: string;
22
+ readonly package: string;
23
+ readonly category: string;
24
+ readonly summary: string;
25
+ readonly props: Readonly<Record<string, PropMetadata>>;
26
+ readonly tokens: readonly string[];
27
+ readonly a11y: {
28
+ readonly role: string;
29
+ readonly keyboard: readonly string[];
30
+ };
31
+ readonly examples: readonly {
32
+ readonly title: string;
33
+ readonly code: string;
34
+ readonly imports?: string;
35
+ readonly setup?: string;
36
+ }[];
37
+ readonly guidance: {
38
+ readonly do: readonly string[];
39
+ readonly dont: readonly string[];
40
+ };
41
+ readonly composer?: ComposerMetadata;
42
+ }
43
+ export declare function defineMeta<Props>(metadata: Omit<ComponentMetadata, "props"> & {
44
+ readonly props: Partial<Record<keyof Props, PropMetadata>>;
45
+ }): ComponentMetadata;
46
+ export declare function isComponentMetadata(value: unknown): value is ComponentMetadata;
@@ -0,0 +1,47 @@
1
+ //#region src/metadata.ts
2
+ var e = [
3
+ "root",
4
+ "topbar",
5
+ "sidebar",
6
+ "page-header",
7
+ "toolbar",
8
+ "main-grid",
9
+ "details-panel",
10
+ "status-bar",
11
+ "overlays"
12
+ ];
13
+ function t(t) {
14
+ return a(t) && t.every((t) => e.some((e) => e === t));
15
+ }
16
+ function n(e) {
17
+ if (!s(e)) throw Error("Invalid component metadata");
18
+ return Object.freeze(e);
19
+ }
20
+ function r(e) {
21
+ return typeof e == "object" && !!e && !Array.isArray(e);
22
+ }
23
+ function i(e) {
24
+ return typeof e == "string" && e.trim().length > 0;
25
+ }
26
+ function a(e) {
27
+ return Array.isArray(e) && e.every(i);
28
+ }
29
+ function o(e) {
30
+ return e === null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e);
31
+ }
32
+ function s(e) {
33
+ if (!r(e) || !i(e.name) || !i(e.package) || !i(e.category) || !i(e.summary) || !r(e.props)) return !1;
34
+ for (let t of Object.values(e.props)) {
35
+ if (!r(t) || !i(t.description) || "default" in t && !o(t.default)) return !1;
36
+ if (t.control !== void 0) {
37
+ if (!r(t.control)) return !1;
38
+ if (t.control.kind === "select") {
39
+ if (!Array.isArray(t.control.values) || !t.control.values.length || !t.control.values.every(o)) return !1;
40
+ } else if (t.control.kind !== "text" && t.control.kind !== "boolean") return !1;
41
+ }
42
+ }
43
+ let n = e.composer;
44
+ return (n === void 0 || r(n) && t(n.allowedParentRegions) && n.allowedParentRegions.length > 0 && a(n.acceptedChildRegions) && a(n.editableSafeProps) && i(n.fixtureFactory) && i(n.codeGenerationAdapter)) && a(e.tokens) && r(e.a11y) && i(e.a11y.role) && a(e.a11y.keyboard) && Array.isArray(e.examples) && e.examples.length > 0 && e.examples.every((e) => r(e) && i(e.title) && i(e.code) && (e.imports === void 0 || typeof e.imports == "string") && (e.setup === void 0 || typeof e.setup == "string")) && r(e.guidance) && a(e.guidance.do) && a(e.guidance.dont);
45
+ }
46
+ //#endregion
47
+ export { n as defineMeta, s as isComponentMetadata };
@@ -0,0 +1,30 @@
1
+ export { createShortcutRegistry } from "./utils/shortcut-registry.ts";
2
+ export type { PendingShortcut, ShortcutAction, ShortcutBinding, ShortcutDefinition, ShortcutInput, ShortcutRegistryOptions } from "./utils/shortcut-registry.ts";
3
+ export { ShortcutProvider, useShortcut, usePendingShortcut, useShortcutBindings, useShortcutCommands } from "./primitives/ShortcutProvider.tsx";
4
+ export type { ShortcutProviderProps } from "./primitives/ShortcutProvider.tsx";
5
+ export { ShortcutSheet } from "./primitives/ShortcutSheet.tsx";
6
+ export type { ShortcutSheetProps } from "./primitives/ShortcutSheet.tsx";
7
+ export { ShortcutPending } from "./primitives/ShortcutPending.tsx";
8
+ export type { ShortcutPendingProps } from "./primitives/ShortcutPending.tsx";
9
+ export { ShortcutScope } from "./primitives/ShortcutScope.tsx";
10
+ export type { ShortcutScopeProps } from "./primitives/ShortcutScope.tsx";
11
+ export { Breadcrumb } from "./primitives/Breadcrumb.tsx";
12
+ export type { BreadcrumbProps, BreadcrumbEntry } from "./primitives/Breadcrumb.tsx";
13
+ export { Collapsible } from "./primitives/Collapsible.tsx";
14
+ export type { CollapsibleProps } from "./primitives/Collapsible.tsx";
15
+ export { Accordion, AccordionItem } from "./primitives/Accordion.tsx";
16
+ export type { AccordionProps, AccordionItemProps } from "./primitives/Accordion.tsx";
17
+ export { Tabs } from "./primitives/Tabs.tsx";
18
+ export type { TabsProps, TabOption } from "./primitives/Tabs.tsx";
19
+ export { NavList, NavItem } from "./primitives/NavList.tsx";
20
+ export type { NavListProps, NavItemProps } from "./primitives/NavList.tsx";
21
+ export { ScrollArea } from "./primitives/ScrollArea.tsx";
22
+ export type { ScrollAreaProps } from "./primitives/ScrollArea.tsx";
23
+ export { Pagination } from "./primitives/Pagination.tsx";
24
+ export type { PaginationProps } from "./primitives/Pagination.tsx";
25
+ export { Tree, TreeItem } from "./primitives/Tree.tsx";
26
+ export type { TreeProps, TreeItemProps, TreeSelectionMode } from "./primitives/Tree.tsx";
27
+ export { Resizable, ResizablePanel, ResizableHandle } from "./primitives/Resizable.tsx";
28
+ export type { ResizableProps, ResizablePanelProps, ResizableHandleProps, ResizablePersistence } from "./primitives/Resizable.tsx";
29
+ export { Stepper } from "./primitives/Stepper.tsx";
30
+ export type { StepperProps, StepperStep, StepperStatusStep, StepperLinkStep, StepperActionStep } from "./primitives/Stepper.tsx";
@@ -0,0 +1,16 @@
1
+ import { createShortcutRegistry as e } from "./utils/shortcut-registry.js";
2
+ import { ShortcutProvider as t, usePendingShortcut as n, useShortcut as r, useShortcutBindings as i, useShortcutCommands as a } from "./primitives/ShortcutProvider.js";
3
+ import { ShortcutSheet as o } from "./primitives/ShortcutSheet.js";
4
+ import { ShortcutPending as s } from "./primitives/ShortcutPending.js";
5
+ import { ShortcutScope as c } from "./primitives/ShortcutScope.js";
6
+ import { Stepper as l } from "./primitives/Stepper.js";
7
+ import { Breadcrumb as u } from "./primitives/Breadcrumb.js";
8
+ import { Collapsible as d } from "./primitives/Collapsible.js";
9
+ import { Accordion as f, AccordionItem as p } from "./primitives/Accordion.js";
10
+ import { Tabs as m } from "./primitives/Tabs.js";
11
+ import { NavItem as h, NavList as g } from "./primitives/NavList.js";
12
+ import { ScrollArea as _ } from "./primitives/ScrollArea.js";
13
+ import { Pagination as v } from "./primitives/Pagination.js";
14
+ import { Tree as y, TreeItem as b } from "./primitives/Tree.js";
15
+ import { Resizable as x, ResizableHandle as S, ResizablePanel as C } from "./primitives/Resizable.js";
16
+ export { f as Accordion, p as AccordionItem, u as Breadcrumb, d as Collapsible, h as NavItem, g as NavList, v as Pagination, x as Resizable, S as ResizableHandle, C as ResizablePanel, _ as ScrollArea, s as ShortcutPending, t as ShortcutProvider, c as ShortcutScope, o as ShortcutSheet, l as Stepper, m as Tabs, y as Tree, b as TreeItem, e as createShortcutRegistry, n as usePendingShortcut, r as useShortcut, i as useShortcutBindings, a as useShortcutCommands };
@@ -0,0 +1,28 @@
1
+ export { Dialog } from "./primitives/Dialog.tsx";
2
+ export type { DialogProps } from "./primitives/Dialog.tsx";
3
+ export { Drawer, Sheet } from "./primitives/Drawer.tsx";
4
+ export type { DrawerProps, DrawerSide, SheetProps } from "./primitives/Drawer.tsx";
5
+ export { AlertDialog } from "./primitives/AlertDialog.tsx";
6
+ export type { AlertDialogProps } from "./primitives/AlertDialog.tsx";
7
+ export { ConfirmDialog } from "./primitives/ConfirmDialog.tsx";
8
+ export type { ConfirmDialogProps } from "./primitives/ConfirmDialog.tsx";
9
+ export { createConfirm } from "./primitives/create-confirm.tsx";
10
+ export type { ConfirmController, ConfirmOptions } from "./primitives/create-confirm.tsx";
11
+ export { Tooltip } from "./primitives/Tooltip.tsx";
12
+ export type { TooltipProps } from "./primitives/Tooltip.tsx";
13
+ export { LinkTooltip } from "./primitives/LinkTooltip.tsx";
14
+ export type { LinkTooltipProps } from "./primitives/LinkTooltip.tsx";
15
+ export { Popover } from "./primitives/Popover.tsx";
16
+ export type { PopoverProps } from "./primitives/Popover.tsx";
17
+ export { DropdownMenu } from "./primitives/DropdownMenu.tsx";
18
+ export type { DropdownMenuProps, MenuItem, MenuAction, MenuCheckbox, MenuRadioGroup, MenuRadioOption, MenuSubmenu, MenuSeparator } from "./primitives/DropdownMenu.tsx";
19
+ export { ContextMenu } from "./primitives/ContextMenu.tsx";
20
+ export type { ContextMenuProps } from "./primitives/ContextMenu.tsx";
21
+ export { CommandPalette, commandPaletteFilter } from "./primitives/CommandPalette.tsx";
22
+ export type { CommandPaletteProps, CommandPaletteCommand, CommandPaletteSource, CommandPaletteStaticSource, CommandPaletteRemoteSource, CommandPaletteRecents } from "./primitives/CommandPalette.tsx";
23
+ export { createToaster } from "./primitives/create-toaster.ts";
24
+ export { Toast } from "./primitives/Toast.tsx";
25
+ export type { ToastProps } from "./primitives/Toast.tsx";
26
+ export { Toaster } from "./primitives/Toaster.tsx";
27
+ export type { ToasterProps } from "./primitives/Toaster.tsx";
28
+ export type { ToastId, ToastAction, ToastOptions, ToastNotification, ToastActionResult, ToastController } from "./primitives/create-toaster.ts";
@@ -0,0 +1,15 @@
1
+ import { Dialog as e } from "./primitives/Dialog.js";
2
+ import { Drawer as t, Sheet as n } from "./primitives/Drawer.js";
3
+ import { AlertDialog as r } from "./primitives/AlertDialog.js";
4
+ import { ConfirmDialog as i } from "./primitives/ConfirmDialog.js";
5
+ import { createConfirm as a } from "./primitives/create-confirm.js";
6
+ import { Tooltip as o } from "./primitives/Tooltip.js";
7
+ import { LinkTooltip as s } from "./primitives/LinkTooltip.js";
8
+ import { Popover as c } from "./primitives/Popover.js";
9
+ import { DropdownMenu as l } from "./primitives/DropdownMenu.js";
10
+ import { ContextMenu as u } from "./primitives/ContextMenu.js";
11
+ import { CommandPalette as d, commandPaletteFilter as f } from "./primitives/CommandPalette.js";
12
+ import { createToaster as p } from "./primitives/create-toaster.js";
13
+ import { Toast as m } from "./primitives/Toast.js";
14
+ import { Toaster as h } from "./primitives/Toaster.js";
15
+ export { r as AlertDialog, d as CommandPalette, i as ConfirmDialog, u as ContextMenu, e as Dialog, t as Drawer, l as DropdownMenu, s as LinkTooltip, c as Popover, n as Sheet, m as Toast, h as Toaster, o as Tooltip, f as commandPaletteFilter, a as createConfirm, p as createToaster };
@@ -0,0 +1,16 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface AccordionProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onChange"> {
3
+ value?: string[];
4
+ defaultValue?: string[];
5
+ onValueChange?: (value: string[]) => void;
6
+ multiple?: boolean;
7
+ collapsible?: boolean;
8
+ }
9
+ export interface AccordionItemProps extends JSX.HTMLAttributes<HTMLDivElement> {
10
+ value: string;
11
+ label: string;
12
+ disabled?: boolean;
13
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
14
+ }
15
+ export declare function Accordion(props: AccordionProps): JSX.Element;
16
+ export declare function AccordionItem(props: AccordionItemProps): JSX.Element;
@@ -0,0 +1,223 @@
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, memo as a, mergeProps as o, setAttribute as s, spread as c, template as l, use as u } from "solid-js/web";
4
+ import { createContext as d, createEffect as f, createMemo as p, createSignal as m, createUniqueId as h, onCleanup as g, onMount as _, splitProps as v, useContext as y } from "solid-js";
5
+ import * as b from "@kobalte/core/accordion";
6
+ //#region src/primitives/Accordion.tsx
7
+ var x = /*#__PURE__*/ l("<div>"), S = /*#__PURE__*/ l("<span class=sheen-collapsible-indicator aria-hidden=true>"), C = /*#__PURE__*/ l("<div class=sheen-collapsible-content><div class=sheen-collapsible-clip><div class=sheen-collapsible-body>"), w = d();
8
+ function T(e) {
9
+ let t = y(w), [n, r] = v(e, ["onKeyDown", "ref"]), i, a = (e) => [...e.querySelectorAll("[data-sheen-accordion-trigger]")].filter((t) => t.closest("[data-sheen-accordion]") === e);
10
+ _(() => {
11
+ let e = i;
12
+ if (!e) return;
13
+ let t = a(e), n, r = () => {
14
+ let t = e.ownerDocument.activeElement;
15
+ n = t instanceof HTMLElement && e.contains(t) ? t : void 0;
16
+ };
17
+ r(), e.ownerDocument.addEventListener("focusin", r);
18
+ let o = new MutationObserver(() => {
19
+ let r = a(e), i = e.ownerDocument.activeElement, o = n;
20
+ if (e.isConnected && o && i === e.ownerDocument.body) {
21
+ let n = (e) => e.isConnected && !e.matches(":disabled") && !e.closest("[inert], [hidden]") && e.getClientRects().length > 0, i = e.contains(o) && n(o) ? o : void 0, a = t.findIndex((e) => e.closest(".sheen-accordion-item")?.contains(o));
22
+ if (a >= 0) {
23
+ let t = Math.min(a, r.length), o = r.slice(t).find(n) ?? r.slice(0, t).reverse().find(n);
24
+ (i ?? o ?? e).focus({ preventScroll: !0 });
25
+ }
26
+ }
27
+ t = r;
28
+ });
29
+ o.observe(e, {
30
+ childList: !0,
31
+ subtree: !0,
32
+ attributes: !0,
33
+ attributeFilter: [
34
+ "disabled",
35
+ "hidden",
36
+ "inert"
37
+ ]
38
+ }), g(() => {
39
+ o.disconnect(), e.ownerDocument.removeEventListener("focusin", r);
40
+ });
41
+ });
42
+ let s = (e) => {
43
+ let n = t?.onKeyDown();
44
+ if (typeof n == "function" ? n(e) : n && n[0](n[1], e), e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
45
+ let r = e.target;
46
+ if (!(r instanceof HTMLButtonElement) || !r.hasAttribute("data-sheen-accordion-trigger") || r.closest("[data-sheen-accordion]") !== e.currentTarget) return;
47
+ let i = a(e.currentTarget).filter((e) => !e.disabled), o = i.indexOf(r);
48
+ if (o < 0) return;
49
+ let s;
50
+ switch (e.key) {
51
+ case "ArrowDown":
52
+ s = i[(o + 1) % i.length];
53
+ break;
54
+ case "ArrowUp":
55
+ s = i[(o + i.length - 1) % i.length];
56
+ break;
57
+ case "Home":
58
+ s = i[0];
59
+ break;
60
+ case "End":
61
+ s = i.at(-1);
62
+ break;
63
+ default: return;
64
+ }
65
+ e.preventDefault(), s?.focus();
66
+ };
67
+ return (() => {
68
+ var e = x();
69
+ return u((e) => {
70
+ i = e, typeof n.ref == "function" && n.ref(e);
71
+ }, e), c(e, o(r, {
72
+ get tabIndex() {
73
+ return r.tabIndex ?? -1;
74
+ },
75
+ "data-sheen-accordion": "",
76
+ onKeyDown: s
77
+ }), !1, !1), e;
78
+ })();
79
+ }
80
+ function E(t) {
81
+ let [r, i] = v(t, [
82
+ "value",
83
+ "defaultValue",
84
+ "onValueChange",
85
+ "multiple",
86
+ "collapsible",
87
+ "class",
88
+ "id",
89
+ "ref",
90
+ "onKeyDown",
91
+ "onMouseDown",
92
+ "onFocusIn",
93
+ "onFocusOut"
94
+ ]), a = h(), [s, c] = m(r.defaultValue ?? []), l = p(() => {
95
+ let e = r.value ?? s();
96
+ if (!r.multiple && e.length > 1) throw Error("Accordion single mode accepts at most one expanded value");
97
+ if (new Set(e).size !== e.length) throw Error("Accordion expanded values must be unique");
98
+ return e;
99
+ }), u = {
100
+ multiple: () => r.multiple ?? !1,
101
+ collapsible: () => r.collapsible ?? !0,
102
+ values: /* @__PURE__ */ new Set(),
103
+ onKeyDown: () => r.onKeyDown
104
+ }, d = () => ({
105
+ ...r.ref === void 0 ? {} : { ref: r.ref },
106
+ ...r.onMouseDown === void 0 ? {} : { onMouseDown: r.onMouseDown },
107
+ ...r.onFocusIn === void 0 ? {} : { onFocusIn: r.onFocusIn },
108
+ ...r.onFocusOut === void 0 ? {} : { onFocusOut: r.onFocusOut }
109
+ });
110
+ return n(w.Provider, {
111
+ value: u,
112
+ get children() {
113
+ return n(b.Root, o({ as: T }, i, d, {
114
+ get id() {
115
+ return r.id ?? `sheen-accordion-${a}`;
116
+ },
117
+ get class() {
118
+ return e("sheen-accordion", r.class);
119
+ },
120
+ get value() {
121
+ return l();
122
+ },
123
+ onChange: (e) => {
124
+ r.value === void 0 && c(e), r.onValueChange?.(e);
125
+ },
126
+ get multiple() {
127
+ return u.multiple();
128
+ },
129
+ get collapsible() {
130
+ return u.collapsible();
131
+ }
132
+ }));
133
+ }
134
+ });
135
+ }
136
+ function D(c) {
137
+ let l = b.useAccordionContext(), d = y(w);
138
+ if (!d) throw Error("AccordionItem requires a sheen Accordion owner");
139
+ let [m, _] = v(c, [
140
+ "value",
141
+ "label",
142
+ "disabled",
143
+ "headingLevel",
144
+ "class",
145
+ "id",
146
+ "children"
147
+ ]), x = h(), T = () => m.id ?? `sheen-accordion-item-${x}`, E = () => l.listState().selectionManager().isSelected(m.value);
148
+ p(() => {
149
+ let e = m.value;
150
+ if (!e.trim() || !m.label.trim()) throw Error("AccordionItem requires nonempty values and labels");
151
+ if (d.values.has(e)) throw Error(`Accordion duplicate item value: ${e}`);
152
+ d.values.add(e), g(() => d.values.delete(e));
153
+ });
154
+ let D, O, k = () => {
155
+ switch (m.headingLevel) {
156
+ case 2: return "h2";
157
+ case 4: return "h4";
158
+ case 5: return "h5";
159
+ case 6: return "h6";
160
+ default: return "h3";
161
+ }
162
+ };
163
+ return f(() => {
164
+ !E() && O?.contains(O.ownerDocument.activeElement) && D?.focus({ preventScroll: !0 });
165
+ }), n(b.Item, o(_, {
166
+ get id() {
167
+ return T();
168
+ },
169
+ get value() {
170
+ return m.value;
171
+ },
172
+ get disabled() {
173
+ return m.disabled ?? !1;
174
+ },
175
+ get class() {
176
+ return e("sheen-accordion-item", m.class);
177
+ },
178
+ get children() {
179
+ return [n(b.Header, {
180
+ get as() {
181
+ return k();
182
+ },
183
+ class: "sheen-accordion-heading",
184
+ get children() {
185
+ return n(b.Trigger, {
186
+ as: t,
187
+ ref(e) {
188
+ var t = D;
189
+ typeof t == "function" ? t(e) : D = e;
190
+ },
191
+ "data-sheen-accordion-trigger": "",
192
+ get id() {
193
+ return `${T()}-trigger`;
194
+ },
195
+ get "aria-controls"() {
196
+ return `${T()}-content`;
197
+ },
198
+ get "aria-disabled"() {
199
+ return a(() => !(!E() || d.multiple()))() && !d.collapsible() || void 0;
200
+ },
201
+ class: "sheen-collapsible-trigger",
202
+ get children() {
203
+ return [S(), a(() => m.label)];
204
+ }
205
+ });
206
+ }
207
+ }), (() => {
208
+ var e = C(), t = e.firstChild.firstChild, n = O;
209
+ return typeof n == "function" ? u(n, e) : O = e, i(t, () => m.children), r((t) => {
210
+ var n = `${T()}-content`, r = E(), i = !E() || void 0, a = !E();
211
+ return n !== t.e && s(e, "id", t.e = n), r !== t.t && s(e, "data-open", t.t = r), i !== t.a && s(e, "aria-hidden", t.a = i), a !== t.o && (e.inert = t.o = a), t;
212
+ }, {
213
+ e: void 0,
214
+ t: void 0,
215
+ a: void 0,
216
+ o: void 0
217
+ }), e;
218
+ })()];
219
+ }
220
+ }));
221
+ }
222
+ //#endregion
223
+ export { E as Accordion, D as AccordionItem };
@@ -0,0 +1,20 @@
1
+ import type { JSX } from "solid-js";
2
+ export type WorkflowState = "completed" | "current" | "upcoming" | "error";
3
+ export interface ActivityTimelineItem {
4
+ readonly id: string;
5
+ readonly title: string;
6
+ readonly description?: string;
7
+ readonly actor?: string;
8
+ readonly timestamp?: string;
9
+ readonly timeLabel?: string;
10
+ readonly state: WorkflowState;
11
+ }
12
+ export interface ActivityTimelineProps extends Omit<JSX.OlHTMLAttributes<HTMLOListElement>, "children" | "ref"> {
13
+ ref?: HTMLOListElement | ((element: HTMLOListElement) => void);
14
+ label: string;
15
+ items: readonly ActivityTimelineItem[];
16
+ density?: "compact" | "default";
17
+ refreshing?: boolean;
18
+ }
19
+ /** A stable-ID chronological activity list with explicit non-color state labels. */
20
+ export declare function ActivityTimeline(props: ActivityTimelineProps): JSX.Element;
@@ -0,0 +1,104 @@
1
+ import { useTheme as e } from "../theme/ThemeProvider.js";
2
+ import { cn as t } from "../utils/cn.js";
3
+ import { createComponent 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 { For as d, Show as f, createMemo as p, splitProps as m } from "solid-js";
5
+ //#region src/primitives/ActivityTimeline.tsx
6
+ var h = /*#__PURE__*/ l("<ol>"), g = /*#__PURE__*/ l("<time>"), _ = /*#__PURE__*/ l("<li class=sheen-activity-timeline-item><span class=sheen-workflow-marker aria-hidden=true></span><article class=sheen-activity-timeline-content><header><strong></strong><span class=sheen-workflow-state>"), v = /*#__PURE__*/ l("<p>"), y = /*#__PURE__*/ l("<span class=sheen-activity-timeline-actor>");
7
+ function b(e, t) {
8
+ return e === "completed" ? t.workflowCompleted : e === "current" ? t.workflowCurrent : e === "error" ? t.workflowError : t.workflowUpcoming;
9
+ }
10
+ function x(e) {
11
+ return e === "completed" ? "✓" : e === "current" ? "●" : e === "error" ? "!" : "○";
12
+ }
13
+ function S(l) {
14
+ let S = e(), [C, w] = m(l, [
15
+ "ref",
16
+ "class",
17
+ "label",
18
+ "items",
19
+ "density",
20
+ "refreshing",
21
+ "aria-label"
22
+ ]), T = p(() => {
23
+ let e = /* @__PURE__ */ new Map();
24
+ for (let t of C.items) {
25
+ if (!t.id.trim()) throw Error("ActivityTimeline: item IDs must be nonempty");
26
+ if (e.has(t.id)) throw Error(`ActivityTimeline: duplicate item ID ${JSON.stringify(t.id)}`);
27
+ if (!t.title.trim()) throw Error(`ActivityTimeline: title must be nonempty for ${JSON.stringify(t.id)}`);
28
+ if (t.timestamp === void 0 != (t.timeLabel === void 0) || t.timestamp !== void 0 && (!t.timestamp.trim() || !t.timeLabel?.trim())) throw Error(`ActivityTimeline: timestamp and timeLabel must be supplied together for ${JSON.stringify(t.id)}`);
29
+ e.set(t.id, t);
30
+ }
31
+ return e;
32
+ }), E = p(() => [...T().keys()]);
33
+ return (() => {
34
+ var e = h();
35
+ return u((e) => {
36
+ typeof C.ref == "function" && C.ref(e);
37
+ }, e), c(e, o(w, {
38
+ get class() {
39
+ return t("sheen-activity-timeline", C.class);
40
+ },
41
+ get "aria-label"() {
42
+ return C["aria-label"] ?? C.label;
43
+ },
44
+ get "aria-busy"() {
45
+ return C.refreshing || void 0;
46
+ },
47
+ get "data-density"() {
48
+ return C.density ?? "default";
49
+ },
50
+ get "data-refreshing"() {
51
+ return C.refreshing || void 0;
52
+ }
53
+ }), !1, !0), i(e, n(d, {
54
+ get each() {
55
+ return E();
56
+ },
57
+ children: (e) => {
58
+ let t = () => T().get(e);
59
+ return n(f, {
60
+ get when() {
61
+ return t();
62
+ },
63
+ children: (t) => (() => {
64
+ var o = _(), c = o.firstChild, l = c.nextSibling, u = l.firstChild.firstChild, d = u.nextSibling;
65
+ return s(o, "data-activity-id", e), i(c, () => x(t().state)), i(u, () => t().title), i(d, () => b(t().state, S.messages())), i(l, n(f, {
66
+ get when() {
67
+ return t().description;
68
+ },
69
+ children: (e) => (() => {
70
+ var t = v();
71
+ return i(t, e), t;
72
+ })()
73
+ }), null), i(l, n(f, {
74
+ get when() {
75
+ return t().actor;
76
+ },
77
+ children: (e) => (() => {
78
+ var t = y();
79
+ return i(t, e), t;
80
+ })()
81
+ }), null), i(l, n(f, {
82
+ get when() {
83
+ return a(() => !!t().timestamp)() && t().timeLabel;
84
+ },
85
+ get children() {
86
+ var e = g();
87
+ return i(e, () => t().timeLabel), r(() => s(e, "datetime", t().timestamp)), e;
88
+ }
89
+ }), null), r((e) => {
90
+ var n = t().state, r = t().state === "current" ? "true" : void 0, i = t().state;
91
+ return n !== e.e && s(o, "data-state", e.e = n), r !== e.t && s(o, "aria-current", e.t = r), i !== e.a && s(c, "data-state", e.a = i), e;
92
+ }, {
93
+ e: void 0,
94
+ t: void 0,
95
+ a: void 0
96
+ }), o;
97
+ })()
98
+ });
99
+ }
100
+ })), e;
101
+ })();
102
+ }
103
+ //#endregion
104
+ export { S as ActivityTimeline };
@@ -0,0 +1,7 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DialogProps } from "./Dialog.tsx";
3
+ export interface AlertDialogProps extends DialogProps {
4
+ description: string;
5
+ }
6
+ /** Requires an explicit dismissal and initially focuses the safe close action. */
7
+ export declare function AlertDialog(props: AlertDialogProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ModalFrame as e } from "./Dialog.js";
2
+ import { createComponent as t, mergeProps as n } from "solid-js/web";
3
+ //#region src/primitives/AlertDialog.tsx
4
+ function r(r) {
5
+ return t(e, n(r, { alert: !0 }));
6
+ }
7
+ //#endregion
8
+ export { r as AlertDialog };
@@ -0,0 +1,22 @@
1
+ import type { JSX } from "solid-js";
2
+ export type AvatarSize = "sm" | "md" | "lg";
3
+ export interface AvatarProps extends Omit<JSX.HTMLAttributes<HTMLSpanElement>, "children"> {
4
+ label: string;
5
+ src?: string;
6
+ fallback?: string;
7
+ size?: AvatarSize;
8
+ }
9
+ export declare function Avatar(props: AvatarProps): JSX.Element;
10
+ export interface AvatarItem {
11
+ readonly id: string;
12
+ readonly label: string;
13
+ readonly src?: string;
14
+ readonly fallback?: string;
15
+ }
16
+ export interface AvatarGroupProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
17
+ label: string;
18
+ avatars: readonly AvatarItem[];
19
+ max?: number;
20
+ size?: AvatarSize;
21
+ }
22
+ export declare function AvatarGroup(props: AvatarGroupProps): JSX.Element;