@gemologic/sheen 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/ai.d.ts +8 -0
  4. package/dist/ai.js +5 -0
  5. package/dist/core.d.ts +11 -4
  6. package/dist/core.js +32 -28
  7. package/dist/formisch.js +1 -2
  8. package/dist/forms.d.ts +2 -0
  9. package/dist/forms.js +16 -15
  10. package/dist/index.d.ts +25 -5
  11. package/dist/index.js +86 -76
  12. package/dist/layout/Layout.js +1 -2
  13. package/dist/metadata.js +1 -2
  14. package/dist/navigation.d.ts +2 -1
  15. package/dist/navigation.js +16 -16
  16. package/dist/primitives/Accordion.js +9 -9
  17. package/dist/primitives/ActivityTimeline.js +57 -49
  18. package/dist/primitives/AlertDialog.js +1 -2
  19. package/dist/primitives/Avatar.js +16 -17
  20. package/dist/primitives/Board.d.ts +39 -0
  21. package/dist/primitives/Board.js +471 -0
  22. package/dist/primitives/Breadcrumb.js +1 -2
  23. package/dist/primitives/Button.js +38 -27
  24. package/dist/primitives/ButtonGroup.js +1 -2
  25. package/dist/primitives/Checkbox.js +1 -2
  26. package/dist/primitives/CheckboxGroup.js +11 -12
  27. package/dist/primitives/Collapsible.js +6 -6
  28. package/dist/primitives/Combobox.js +203 -201
  29. package/dist/primitives/CommandPalette.js +2 -4
  30. package/dist/primitives/ConfirmDialog.js +5 -6
  31. package/dist/primitives/ContextMenu.js +7 -8
  32. package/dist/primitives/Conversation.d.ts +17 -0
  33. package/dist/primitives/Conversation.js +107 -0
  34. package/dist/primitives/DescriptionList.js +1 -2
  35. package/dist/primitives/Dialog.js +101 -68
  36. package/dist/primitives/Drawer.js +12 -13
  37. package/dist/primitives/DropdownMenu.js +163 -157
  38. package/dist/primitives/EditableTextField.js +3 -8
  39. package/dist/primitives/EmptyState.js +1 -2
  40. package/dist/primitives/Field.js +1 -2
  41. package/dist/primitives/FileDropzone.js +19 -18
  42. package/dist/primitives/Form.d.ts +23 -0
  43. package/dist/primitives/Form.js +76 -0
  44. package/dist/primitives/Glyph.d.ts +40 -0
  45. package/dist/primitives/Glyph.js +65 -0
  46. package/dist/primitives/IconButton.js +5 -6
  47. package/dist/primitives/Input.js +1 -2
  48. package/dist/primitives/InputGroup.js +8 -9
  49. package/dist/primitives/Link.d.ts +9 -1
  50. package/dist/primitives/Link.js +23 -17
  51. package/dist/primitives/LinkTooltip.js +6 -7
  52. package/dist/primitives/List.d.ts +34 -0
  53. package/dist/primitives/List.js +135 -0
  54. package/dist/primitives/Message.d.ts +13 -0
  55. package/dist/primitives/Message.js +75 -0
  56. package/dist/primitives/NavList.js +15 -16
  57. package/dist/primitives/Notice.d.ts +15 -1
  58. package/dist/primitives/Notice.js +91 -43
  59. package/dist/primitives/NumberField.js +81 -81
  60. package/dist/primitives/NumberText.d.ts +4 -0
  61. package/dist/primitives/NumberText.js +50 -25
  62. package/dist/primitives/Pagination.js +81 -60
  63. package/dist/primitives/Popover.js +57 -57
  64. package/dist/primitives/Progress.js +1 -2
  65. package/dist/primitives/PromptInput.d.ts +23 -0
  66. package/dist/primitives/PromptInput.js +135 -0
  67. package/dist/primitives/RadioGroup.js +12 -17
  68. package/dist/primitives/Resizable.js +1 -2
  69. package/dist/primitives/ScrollArea.js +1 -2
  70. package/dist/primitives/SearchInput.js +45 -38
  71. package/dist/primitives/SegmentedControl.d.ts +2 -0
  72. package/dist/primitives/SegmentedControl.js +92 -78
  73. package/dist/primitives/Select.js +105 -100
  74. package/dist/primitives/Separator.js +1 -2
  75. package/dist/primitives/ShortcutPending.js +11 -12
  76. package/dist/primitives/ShortcutProvider.d.ts +5 -0
  77. package/dist/primitives/ShortcutProvider.js +71 -65
  78. package/dist/primitives/ShortcutScope.js +8 -9
  79. package/dist/primitives/ShortcutSheet.js +30 -24
  80. package/dist/primitives/Skeleton.js +1 -2
  81. package/dist/primitives/Slider.js +1 -2
  82. package/dist/primitives/SortableList.d.ts +19 -0
  83. package/dist/primitives/SortableList.js +235 -0
  84. package/dist/primitives/Spinner.js +1 -2
  85. package/dist/primitives/Status.js +14 -14
  86. package/dist/primitives/Stepper.js +54 -52
  87. package/dist/primitives/StreamingText.d.ts +12 -0
  88. package/dist/primitives/StreamingText.js +42 -0
  89. package/dist/primitives/Surface.js +1 -2
  90. package/dist/primitives/Switch.js +1 -2
  91. package/dist/primitives/Table.js +1 -2
  92. package/dist/primitives/Tabs.js +20 -17
  93. package/dist/primitives/TagInput.js +6 -9
  94. package/dist/primitives/Textarea.js +37 -63
  95. package/dist/primitives/Toast.js +42 -41
  96. package/dist/primitives/Toaster.js +27 -28
  97. package/dist/primitives/Tooltip.js +32 -32
  98. package/dist/primitives/Tree.js +1 -2
  99. package/dist/primitives/Typography.d.ts +6 -2
  100. package/dist/primitives/Typography.js +20 -12
  101. package/dist/primitives/boolean-input-state.js +3 -8
  102. package/dist/primitives/button-variants.js +2 -3
  103. package/dist/primitives/choice-options.js +1 -2
  104. package/dist/primitives/create-confirm.js +1 -2
  105. package/dist/primitives/create-toaster.js +1 -2
  106. package/dist/primitives/link-focus.js +1 -2
  107. package/dist/primitives/menu-focus.js +1 -2
  108. package/dist/primitives/sortable-core.d.ts +70 -0
  109. package/dist/primitives/sortable-core.js +109 -0
  110. package/dist/primitives/sortable-drag.d.ts +29 -0
  111. package/dist/primitives/sortable-drag.js +50 -0
  112. package/dist/primitives/tooltip-layer.js +26 -27
  113. package/dist/sortable.d.ts +6 -0
  114. package/dist/sortable.js +4 -0
  115. package/dist/theme/ThemeProvider.d.ts +6 -1
  116. package/dist/theme/ThemeProvider.js +65 -58
  117. package/dist/theme/intl.js +1 -2
  118. package/dist/theme/keyboard-script.js +1 -2
  119. package/dist/theme/layers.js +1 -2
  120. package/dist/theme/messages.d.ts +26 -0
  121. package/dist/theme/messages.js +9 -2
  122. package/dist/theme/number-format-cache.js +1 -2
  123. package/dist/theme/script.d.ts +1 -0
  124. package/dist/theme/script.js +3 -3
  125. package/dist/theme/state.d.ts +4 -4
  126. package/dist/theme/state.js +12 -13
  127. package/dist/utils/auto-resize.d.ts +6 -0
  128. package/dist/utils/auto-resize.js +31 -0
  129. package/dist/utils/browser-status.js +1 -2
  130. package/dist/utils/change-motion.d.ts +8 -0
  131. package/dist/utils/change-motion.js +19 -0
  132. package/dist/utils/cn.js +1 -2
  133. package/dist/utils/media-query.d.ts +10 -0
  134. package/dist/utils/media-query.js +16 -0
  135. package/dist/utils/optimistic.js +1 -2
  136. package/dist/utils/shortcut-platform.js +1 -2
  137. package/dist/utils/shortcut-registry.d.ts +5 -0
  138. package/dist/utils/shortcut-registry.js +61 -51
  139. package/dist/vite.js +3 -4
  140. package/package.json +23 -5
  141. package/src/ai.ts +8 -0
  142. package/src/core.ts +11 -4
  143. package/src/forms.ts +2 -0
  144. package/src/index.ts +25 -5
  145. package/src/navigation.ts +2 -1
  146. package/src/primitives/Accordion.tsx +1 -1
  147. package/src/primitives/ActivityTimeline.tsx +12 -7
  148. package/src/primitives/Board.tsx +406 -0
  149. package/src/primitives/Button.tsx +15 -4
  150. package/src/primitives/Collapsible.tsx +1 -1
  151. package/src/primitives/Combobox.tsx +2 -1
  152. package/src/primitives/CommandPalette.tsx +2 -2
  153. package/src/primitives/Conversation.tsx +108 -0
  154. package/src/primitives/Dialog.tsx +5 -1
  155. package/src/primitives/DropdownMenu.tsx +12 -6
  156. package/src/primitives/FileDropzone.tsx +2 -2
  157. package/src/primitives/Form.tsx +58 -0
  158. package/src/primitives/Glyph.tsx +55 -0
  159. package/src/primitives/Link.tsx +15 -6
  160. package/src/primitives/List.tsx +68 -0
  161. package/src/primitives/Message.tsx +40 -0
  162. package/src/primitives/Notice.tsx +45 -12
  163. package/src/primitives/NumberField.tsx +3 -2
  164. package/src/primitives/NumberText.tsx +31 -4
  165. package/src/primitives/Pagination.tsx +6 -5
  166. package/src/primitives/Popover.tsx +2 -1
  167. package/src/primitives/PromptInput.tsx +116 -0
  168. package/src/primitives/SearchInput.tsx +4 -3
  169. package/src/primitives/SegmentedControl.tsx +29 -4
  170. package/src/primitives/Select.tsx +3 -2
  171. package/src/primitives/ShortcutProvider.tsx +14 -1
  172. package/src/primitives/ShortcutSheet.tsx +1 -1
  173. package/src/primitives/SortableList.tsx +208 -0
  174. package/src/primitives/Status.tsx +1 -1
  175. package/src/primitives/Stepper.tsx +7 -7
  176. package/src/primitives/StreamingText.tsx +32 -0
  177. package/src/primitives/Tabs.tsx +2 -1
  178. package/src/primitives/TagInput.tsx +1 -1
  179. package/src/primitives/Textarea.tsx +3 -47
  180. package/src/primitives/Toast.tsx +2 -1
  181. package/src/primitives/Tooltip.tsx +4 -2
  182. package/src/primitives/Typography.tsx +11 -2
  183. package/src/primitives/button-variants.ts +1 -1
  184. package/src/primitives/sortable-core.ts +139 -0
  185. package/src/primitives/sortable-drag.ts +75 -0
  186. package/src/sortable.ts +6 -0
  187. package/src/styles/ai.css +57 -0
  188. package/src/styles/core.css +321 -0
  189. package/src/styles/forms.css +261 -0
  190. package/src/styles/navigation.css +137 -0
  191. package/src/styles/overlays.css +104 -0
  192. package/src/styles/sortable.css +87 -0
  193. package/src/styles.css +5 -658
  194. package/src/theme/ThemeProvider.tsx +20 -8
  195. package/src/theme/messages.ts +20 -1
  196. package/src/theme/script.ts +2 -2
  197. package/src/theme/state.ts +5 -5
  198. package/src/utils/auto-resize.ts +58 -0
  199. package/src/utils/change-motion.ts +28 -0
  200. package/src/utils/media-query.ts +26 -0
  201. package/src/utils/shortcut-registry.ts +19 -2
  202. package/src/vite.ts +3 -3
  203. package/vendor/integrity.json +13 -13
  204. package/vendor/kobalte-core/chunk/3D6FM2PJ.js +7 -1
  205. package/vendor/kobalte-core/chunk/G3KI2B4X.js +2 -1
  206. package/vendor/kobalte-core/chunk/KEL2LLJM.jsx +2 -1
  207. package/vendor/kobalte-core/chunk/RFN6X5VH.jsx +7 -1
  208. package/vendor/origins.json +4 -4
  209. package/vendor/solid-web/dev.cjs +21 -17
  210. package/vendor/solid-web/dev.js +21 -17
  211. package/vendor/solid-web/server.cjs +1 -1
  212. package/vendor/solid-web/server.js +1 -1
  213. package/vendor/solid-web/web.cjs +21 -17
  214. package/vendor/solid-web/web.js +21 -17
@@ -1,68 +1,69 @@
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, memo as a, mergeProps as o, template as s } from "solid-js/web";
5
- import { Show as c, createEffect as l, createMemo as u, createSignal as d, createUniqueId as f, onCleanup as p } from "solid-js";
6
- import * as m from "#sheen-kobalte/popover";
7
- //#region src/primitives/Popover.tsx
8
- var h = /*#__PURE__*/ s("<div class=sheen-dialog-header>"), g = /*#__PURE__*/ s("<div class=sheen-dialog-body>"), _ = /*#__PURE__*/ s("<div class=sheen-dialog-footer>");
9
- function v(e) {
10
- let t = m.usePopoverContext();
11
- return r(n, o({
1
+ import { Button as e } from "./Button.js";
2
+ import { useTheme as t } from "../theme/ThemeProvider.js";
3
+ import { cn as n } from "../utils/cn.js";
4
+ import { Glyph as r } from "./Glyph.js";
5
+ import { createComponent as i, insert as a, memo as o, mergeProps as s, template as c } from "solid-js/web";
6
+ import { Show as l, createEffect as u, createMemo as d, createSignal as f, createUniqueId as p, onCleanup as m } from "solid-js";
7
+ import * as h from "#sheen-kobalte/popover";
8
+ // src/primitives/Popover.tsx
9
+ var g = /*#__PURE__*/ c("<div class=sheen-dialog-header>"), _ = /*#__PURE__*/ c("<div class=sheen-dialog-body>");
10
+ function v(t) {
11
+ let n = h.usePopoverContext();
12
+ return i(e, s({
12
13
  ref(e) {
13
- var n = t.setTriggerRef;
14
- typeof n == "function" ? n(e) : t.setTriggerRef = e;
14
+ var t = n.setTriggerRef;
15
+ typeof t == "function" ? t(e) : n.setTriggerRef = e;
15
16
  },
16
17
  variant: "outline",
17
18
  "data-sheen-popover-trigger": "",
18
19
  "aria-haspopup": "dialog",
19
20
  get "aria-expanded"() {
20
- return t.isOpen();
21
+ return n.isOpen();
21
22
  },
22
23
  get "aria-controls"() {
23
- return a(() => !!t.isOpen())() ? t.contentId() : void 0;
24
+ return o(() => !!n.isOpen())() ? n.contentId() : void 0;
24
25
  },
25
26
  onPointerDown: (e) => {
26
27
  e.pointerType === "mouse" && e.preventDefault();
27
28
  },
28
- onClick: () => t.toggle()
29
- }, () => t.dataset(), { get children() {
30
- return e.children;
29
+ onClick: () => n.toggle()
30
+ }, () => n.dataset(), { get children() {
31
+ return t.children;
31
32
  } }));
32
33
  }
33
- function y(a) {
34
- let o = e(), s = f(), [y, b] = d(a.defaultOpen ?? !1), x = () => a.open === void 0 ? y() : a.open, S = (e) => {
35
- e !== x() && (a.open === void 0 && b(e), a.onOpenChange?.(e));
34
+ function y(o) {
35
+ let s = t(), c = p(), [y, b] = f(o.defaultOpen ?? !1), x = () => o.open === void 0 ? y() : o.open, S = (e) => {
36
+ e !== x() && (o.open === void 0 && b(e), o.onOpenChange?.(e));
36
37
  };
37
- l(() => {
38
- x() && p(o.layers.register(s));
38
+ u(() => {
39
+ x() && m(s.layers.register(c));
39
40
  });
40
- let C = u((e) => x() ? o.layers.zIndex(s) : e ?? 100);
41
- return r(m.Root, {
41
+ let C = d((e) => x() ? s.layers.zIndex(c) : e ?? 100);
42
+ return i(h.Root, {
42
43
  get open() {
43
44
  return x();
44
45
  },
45
46
  onOpenChange: S,
46
47
  get placement() {
47
- return a.placement ?? "bottom";
48
+ return o.placement ?? "bottom";
48
49
  },
49
50
  gutter: 6,
50
51
  get children() {
51
- return [r(v, { get children() {
52
- return a.trigger;
53
- } }), r(c, {
52
+ return [i(v, { get children() {
53
+ return o.trigger;
54
+ } }), i(l, {
54
55
  get when() {
55
- return o.portal();
56
+ return s.portal();
56
57
  },
57
- children: (e) => r(m.Portal, {
58
+ children: (t) => i(h.Portal, {
58
59
  get mount() {
59
- return e();
60
+ return t();
60
61
  },
61
62
  get children() {
62
- return r(m.Content, {
63
+ return i(h.Content, {
63
64
  "data-kb-top-layer": "true",
64
65
  get class() {
65
- return t("sheen-popover", a.class);
66
+ return n("sheen-popover", o.class);
66
67
  },
67
68
  get "aria-hidden"() {
68
69
  return !x() || void 0;
@@ -74,41 +75,41 @@ function y(a) {
74
75
  return { "z-index": C() };
75
76
  },
76
77
  onEscapeKeyDown: (e) => {
77
- o.layers.isTop(s) || e.preventDefault();
78
+ s.layers.isTop(c) || e.preventDefault();
78
79
  },
79
80
  get children() {
80
81
  return [
81
82
  (() => {
82
- var e = h();
83
- return i(e, r(m.Title, { get children() {
84
- return a.title;
85
- } }), null), i(e, r(c, {
83
+ var e = g();
84
+ return a(e, i(h.Title, { get children() {
85
+ return o.title;
86
+ } }), null), a(e, i(l, {
86
87
  get when() {
87
- return a.description;
88
+ return o.description;
88
89
  },
89
90
  get children() {
90
- return r(m.Description, { get children() {
91
- return a.description;
91
+ return i(h.Description, { get children() {
92
+ return o.description;
92
93
  } });
93
94
  }
94
95
  }), null), e;
95
96
  })(),
96
- (() => {
97
- var e = g();
98
- return i(e, () => a.children), e;
99
- })(),
100
97
  (() => {
101
98
  var e = _();
102
- return i(e, r(m.CloseButton, {
103
- as: n,
104
- get "aria-label"() {
105
- return o.messages().close;
106
- },
107
- get children() {
108
- return o.messages().close;
109
- }
110
- })), e;
111
- })()
99
+ return a(e, () => o.children), e;
100
+ })(),
101
+ i(h.CloseButton, {
102
+ as: e,
103
+ variant: "ghost",
104
+ class: "sheen-dialog-close",
105
+ size: "sm",
106
+ get "aria-label"() {
107
+ return s.messages().close;
108
+ },
109
+ get children() {
110
+ return i(r, { name: "close" });
111
+ }
112
+ })
112
113
  ];
113
114
  }
114
115
  });
@@ -118,5 +119,4 @@ function y(a) {
118
119
  }
119
120
  });
120
121
  }
121
- //#endregion
122
122
  export { y as Popover };
@@ -1,7 +1,7 @@
1
1
  import { cn as e } from "../utils/cn.js";
2
2
  import { mergeProps as t, spread as n, template as r } from "solid-js/web";
3
3
  import { createMemo as i, splitProps as a } from "solid-js";
4
- //#region src/primitives/Progress.tsx
4
+ // src/primitives/Progress.tsx
5
5
  var o = /*#__PURE__*/ r("<progress>"), s = /*#__PURE__*/ r("<meter>");
6
6
  function c(r) {
7
7
  let [i, s] = a(r, [
@@ -94,5 +94,4 @@ function u(r) {
94
94
  }), !1, !1), r;
95
95
  })();
96
96
  }
97
- //#endregion
98
97
  export { u as Meter, c as Progress };
@@ -0,0 +1,23 @@
1
+ import type { JSX } from "solid-js";
2
+ export type PromptInputStatus = "idle" | "streaming";
3
+ export interface PromptInputProps extends Omit<JSX.FormHTMLAttributes<HTMLFormElement>, "onSubmit" | "children" | "name" | "ref"> {
4
+ ref?: HTMLFormElement | ((element: HTMLFormElement) => void);
5
+ value?: string;
6
+ defaultValue?: string;
7
+ onValueChange?: (value: string) => void;
8
+ onSubmit: (value: string) => void;
9
+ onStop?: () => void;
10
+ status?: PromptInputStatus;
11
+ label?: string;
12
+ placeholder?: string;
13
+ name?: string;
14
+ disabled?: boolean;
15
+ maxRows?: number;
16
+ leading?: JSX.Element;
17
+ trailing?: JSX.Element;
18
+ submitLabel?: string;
19
+ stopLabel?: string;
20
+ textareaRef?: (element: HTMLTextAreaElement) => void;
21
+ }
22
+ /** A chat composer: an auto-growing textarea whose single action sends the draft or stops the streaming response. */
23
+ export declare function PromptInput(props: PromptInputProps): JSX.Element;
@@ -0,0 +1,135 @@
1
+ import { Button as e } from "./Button.js";
2
+ import { useTheme as t } from "../theme/ThemeProvider.js";
3
+ import { cn as n } from "../utils/cn.js";
4
+ import { createAutoResize as r } from "../utils/auto-resize.js";
5
+ import { createComponent as i, delegateEvents as a, effect as o, insert as s, isServer as c, mergeProps as l, setAttribute as u, setStyleProperty as d, spread as f, template as p, use as m } from "solid-js/web";
6
+ import { Show as h, children as g, createEffect as _, createMemo as v, createSignal as y, onMount as b, splitProps as x } from "solid-js";
7
+ // src/primitives/PromptInput.tsx
8
+ var S = /*#__PURE__*/ p("<div class=sheen-prompt-input-leading>"), C = /*#__PURE__*/ p("<svg><rect x=4 y=4 width=8 height=8 rx=1.5></svg>", !1, !0, !1), w = /*#__PURE__*/ p("<svg class=sheen-prompt-input-glyph viewBox=\"0 0 16 16\"aria-hidden=true fill=currentColor>"), T = /*#__PURE__*/ p("<form><textarea class=sheen-prompt-input-textarea rows=1></textarea><div class=sheen-prompt-input-toolbar><div class=sheen-prompt-input-trailing>"), E = /*#__PURE__*/ p("<svg><path d=\"M8 2.5 13 7.5l-1.06 1.06-3.19-3.19V13.5h-1.5V5.37L4.06 8.56 3 7.5z\"></svg>", !1, !0, !1);
9
+ function D(a) {
10
+ let p = t(), [D, O] = x(a, [
11
+ "ref",
12
+ "value",
13
+ "defaultValue",
14
+ "onValueChange",
15
+ "onSubmit",
16
+ "onStop",
17
+ "status",
18
+ "label",
19
+ "placeholder",
20
+ "name",
21
+ "disabled",
22
+ "maxRows",
23
+ "leading",
24
+ "trailing",
25
+ "submitLabel",
26
+ "stopLabel",
27
+ "textareaRef",
28
+ "class"
29
+ ]), k = g(() => D.leading), A = g(() => D.trailing), [j, M] = y(D.defaultValue ?? ""), N = () => D.value ?? j(), [P, F] = y(!1), I = () => D.status === "streaming", L = v(() => {
30
+ let e = D.maxRows ?? 8;
31
+ if (!Number.isSafeInteger(e) || e < 1) throw Error("PromptInput: maxRows must be a positive integer");
32
+ return e;
33
+ }), R, z = r(() => R, () => !0);
34
+ _(() => {
35
+ N(), L(), p.state(), z();
36
+ });
37
+ let B = (e) => {
38
+ D.value === void 0 && M(e), D.onValueChange?.(e);
39
+ }, V = () => {
40
+ R && !P() && R.value !== N() && (R.value = N());
41
+ }, H = () => !D.disabled && !I() && !P() && N().trim().length > 0, U = () => !D.disabled && I() && D.onStop !== void 0, W = () => {
42
+ if (!H()) return;
43
+ let e = N();
44
+ D.value === void 0 && M(""), D.onSubmit(e), V();
45
+ };
46
+ b(() => {
47
+ R && R.value !== N() && (B(R.value), V());
48
+ });
49
+ let G = (e) => {
50
+ e.key !== "Enter" || e.shiftKey || e.isComposing || e.keyCode === 229 || P() || (e.preventDefault(), W());
51
+ }, K = (e) => {
52
+ e.preventDefault(), I() ? U() && D.onStop?.() : W();
53
+ }, q = () => I() ? D.stopLabel ?? p.messages().stopResponse : D.submitLabel ?? p.messages().sendMessage, J = () => `\n${N()}`;
54
+ return (() => {
55
+ var t = T(), r = t.firstChild, a = r.nextSibling, g = a.firstChild;
56
+ return m((e) => {
57
+ typeof D.ref == "function" && D.ref(e);
58
+ }, t), f(t, l(O, {
59
+ get class() {
60
+ return n("sheen-prompt-input", D.class);
61
+ },
62
+ get "data-status"() {
63
+ return I() ? "streaming" : "idle";
64
+ },
65
+ get "data-disabled"() {
66
+ return D.disabled || void 0;
67
+ },
68
+ onSubmit: (e) => {
69
+ e.preventDefault(), W();
70
+ }
71
+ }), !1, !0), r.$$keydown = G, r.addEventListener("compositionend", () => {
72
+ F(!1), V();
73
+ }), r.addEventListener("compositionstart", () => F(!0)), r.$$input = (e) => {
74
+ B(e.currentTarget.value), V(), z();
75
+ }, m((e) => {
76
+ R = e, D.textareaRef?.(e);
77
+ }, r), s(r, () => c ? J() : void 0), s(a, i(h, {
78
+ get when() {
79
+ return k.toArray().length > 0;
80
+ },
81
+ get children() {
82
+ var e = S();
83
+ return s(e, k), e;
84
+ }
85
+ }), g), s(g, A, null), s(g, i(e, {
86
+ class: "sheen-prompt-input-action",
87
+ get type() {
88
+ return I() ? "button" : "submit";
89
+ },
90
+ variant: "solid",
91
+ get tone() {
92
+ return I() ? "neutral" : "accent";
93
+ },
94
+ size: "sm",
95
+ get disabled() {
96
+ return D.disabled;
97
+ },
98
+ get "aria-disabled"() {
99
+ return !D.disabled && !(I() ? U() : H()) ? "true" : void 0;
100
+ },
101
+ get "aria-label"() {
102
+ return q();
103
+ },
104
+ get "data-action"() {
105
+ return I() ? "stop" : "send";
106
+ },
107
+ onClick: K,
108
+ get children() {
109
+ var e = w();
110
+ return s(e, i(h, {
111
+ get when() {
112
+ return I();
113
+ },
114
+ get fallback() {
115
+ return E();
116
+ },
117
+ get children() {
118
+ return C();
119
+ }
120
+ })), e;
121
+ }
122
+ }), null), o((e) => {
123
+ var t = D.name, n = D.placeholder, i = D.disabled, a = D.label ?? p.messages().promptInput, o = String(L());
124
+ return t !== e.e && u(r, "name", e.e = t), n !== e.t && u(r, "placeholder", e.t = n), i !== e.a && (r.disabled = e.a = i), a !== e.o && u(r, "aria-label", e.o = a), o !== e.i && d(r, "--sheen-prompt-input-max-rows", e.i = o), e;
125
+ }, {
126
+ e: void 0,
127
+ t: void 0,
128
+ a: void 0,
129
+ o: void 0,
130
+ i: void 0
131
+ }), o(() => r.value = c ? void 0 : N()), t;
132
+ })();
133
+ }
134
+ a(["input", "keydown"]);
135
+ export { D as PromptInput };
@@ -1,8 +1,8 @@
1
- import { cn as e } from "../utils/cn.js";
2
- import { createChoiceOptions as t } from "./choice-options.js";
1
+ import { createChoiceOptions as e } from "./choice-options.js";
2
+ import { cn as t } from "../utils/cn.js";
3
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
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
5
+ // src/primitives/RadioGroup.tsx
6
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
7
  function E(r) {
8
8
  let l = h(), [E, D] = v(r, [
@@ -28,7 +28,7 @@ function E(r) {
28
28
  g(() => {
29
29
  N = !0;
30
30
  });
31
- let { byValue: P, keys: F } = t(() => {
31
+ let { byValue: P, keys: F } = e(() => {
32
32
  if (!E.name.trim()) throw Error("RadioGroup: name must be nonempty for native grouping");
33
33
  if (E.options.some((e) => !e.value)) throw Error("RadioGroup: option values must be nonempty; use null for no selection");
34
34
  return E.options;
@@ -40,11 +40,7 @@ function E(r) {
40
40
  }, R = () => {
41
41
  if (!N) for (let e of M?.querySelectorAll("input[type=radio]") ?? []) e.checked = e.value === j();
42
42
  }, z = (e) => {
43
- if (E.disabled || E.readOnly || P().get(e)?.disabled) {
44
- R();
45
- return;
46
- }
47
- L(e || null), R();
43
+ E.disabled || E.readOnly || P().get(e)?.disabled || L(e || null), R();
48
44
  };
49
45
  _(() => {
50
46
  let e = M, t = e?.ownerDocument.defaultView;
@@ -54,7 +50,7 @@ function E(r) {
54
50
  let r = /* @__PURE__ */ new Set(), i = (n) => {
55
51
  if (n.target !== e.form) return;
56
52
  let i = t.setTimeout(() => {
57
- r.delete(i), !n.defaultPrevented && (E.value === void 0 && L(O), R());
53
+ r.delete(i), n.defaultPrevented || (E.value === void 0 && L(O), R());
58
54
  }, 0);
59
55
  r.add(i);
60
56
  };
@@ -69,10 +65,10 @@ function E(r) {
69
65
  E["aria-describedby"]
70
66
  ].filter(Boolean).join(" ") || void 0;
71
67
  return (() => {
72
- var t = C(), r = t.firstChild, p = r.nextSibling;
68
+ var e = C(), r = e.firstChild, p = r.nextSibling;
73
69
  return u((e) => {
74
70
  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"] }, {
71
+ }, e), c(e, o(D, () => E["aria-label"] === void 0 ? {} : { "aria-label": E["aria-label"] }, {
76
72
  get "aria-labelledby"() {
77
73
  return E["aria-labelledby"] ?? `${l}-label`;
78
74
  },
@@ -98,7 +94,7 @@ function E(r) {
98
94
  return E.id ?? l;
99
95
  },
100
96
  get class() {
101
- return e("sheen-radio-group", E.class);
97
+ return t("sheen-radio-group", E.class);
102
98
  },
103
99
  get disabled() {
104
100
  return E.disabled ?? !1;
@@ -113,7 +109,7 @@ function E(r) {
113
109
  get children() {
114
110
  return b();
115
111
  }
116
- }), null), a(t, n(f, {
112
+ }), null), a(e, n(f, {
117
113
  get when() {
118
114
  return E.description;
119
115
  },
@@ -157,7 +153,7 @@ function E(r) {
157
153
  }), i(() => l.checked = j() === e), t;
158
154
  })();
159
155
  }
160
- })), a(t, n(f, {
156
+ })), a(e, n(f, {
161
157
  get when() {
162
158
  return E.error;
163
159
  },
@@ -165,9 +161,8 @@ function E(r) {
165
161
  var e = S();
166
162
  return s(e, "id", `${l}-error`), a(e, () => E.error), e;
167
163
  }
168
- }), null), t;
164
+ }), null), e;
169
165
  })();
170
166
  }
171
167
  r(["click"]);
172
- //#endregion
173
168
  export { E as RadioGroup };
@@ -2,7 +2,7 @@ import { cn as e } from "../utils/cn.js";
2
2
  import { createComponent as t, mergeProps as n, template as r } from "solid-js/web";
3
3
  import { createContext as i, createMemo as a, createSignal as o, splitProps as s, useContext as c } from "solid-js";
4
4
  import l from "@corvu/resizable";
5
- //#region src/primitives/Resizable.tsx
5
+ // src/primitives/Resizable.tsx
6
6
  var u = /*#__PURE__*/ r("<span aria-hidden=true>"), d = i();
7
7
  function f(e, t) {
8
8
  if (e.length < 2) throw Error(`${t} requires at least two panel sizes`);
@@ -192,5 +192,4 @@ function _(r) {
192
192
  }
193
193
  }));
194
194
  }
195
- //#endregion
196
195
  export { h as Resizable, _ as ResizableHandle, g as ResizablePanel };
@@ -1,7 +1,7 @@
1
1
  import { cn as e } from "../utils/cn.js";
2
2
  import { createComponent as t, delegateEvents as n, effect as r, insert as i, mergeProps as a, setAttribute as o, setStyleProperty as s, spread as c, template as l, use as u } from "solid-js/web";
3
3
  import { Show as d, createEffect as f, createMemo as p, createSignal as m, onCleanup as h, onMount as g, splitProps as _ } from "solid-js";
4
- //#region src/primitives/ScrollArea.tsx
4
+ // src/primitives/ScrollArea.tsx
5
5
  var v = /*#__PURE__*/ l("<div aria-hidden=true class=sheen-scroll-track data-axis=y><div class=sheen-scroll-thumb>"), y = /*#__PURE__*/ l("<div aria-hidden=true class=sheen-scroll-track data-axis=x><div class=sheen-scroll-thumb>"), b = /*#__PURE__*/ l("<div class=sheen-scroll-frame><div role=region><div class=sheen-scroll-content>");
6
6
  function x(n) {
7
7
  let [l, x] = _(n, [
@@ -174,5 +174,4 @@ n([
174
174
  "pointermove",
175
175
  "pointerup"
176
176
  ]);
177
- //#endregion
178
177
  export { x as ScrollArea };
@@ -1,14 +1,15 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { useShortcutAction as n } from "./ShortcutProvider.js";
4
- import { Button as r } from "./Button.js";
5
- import { InputGroup as i } from "./InputGroup.js";
6
- import { createComponent as a, mergeProps as o, template as s } from "solid-js/web";
7
- import { createSignal as c, onCleanup as l, onMount as u, splitProps as d } from "solid-js";
8
- //#region src/primitives/SearchInput.tsx
9
- var f = /*#__PURE__*/ s("<span class=sheen-search-input-indicator aria-hidden=true>");
10
- function p(s) {
11
- let p = e(), [m, h] = d(s, [
1
+ import { Glyph as e } from "./Glyph.js";
2
+ import { Button as t } from "./Button.js";
3
+ import { InputGroup as n } from "./InputGroup.js";
4
+ import { useTheme as r } from "../theme/ThemeProvider.js";
5
+ import { cn as i } from "../utils/cn.js";
6
+ import { useShortcutAction as a } from "./ShortcutProvider.js";
7
+ import { createComponent as o, insert as s, mergeProps as c, template as l } from "solid-js/web";
8
+ import { createSignal as u, onCleanup as d, onMount as f, splitProps as p } from "solid-js";
9
+ // src/primitives/SearchInput.tsx
10
+ var m = /*#__PURE__*/ l("<span class=sheen-sr-only>");
11
+ function h(l) {
12
+ let h = r(), [g, _] = p(l, [
12
13
  "value",
13
14
  "defaultValue",
14
15
  "onValueChange",
@@ -19,71 +20,77 @@ function p(s) {
19
20
  "onCompositionEnd",
20
21
  "ref",
21
22
  "class"
22
- ]), g = m.defaultValue ?? "", [_, v] = c(g), y = () => m.value ?? _(), [b, x] = c(), S = () => b() ?? y(), C, w = (e) => {
23
- m.value === void 0 && v(e), m.onValueChange?.(e);
24
- }, T = n(() => m.shortcut, () => C?.focus({ preventScroll: !0 }));
25
- return u(() => {
26
- let e = C;
23
+ ]), v = g.defaultValue ?? "", [y, b] = u(v), x = () => g.value ?? y(), [S, C] = u(), w = () => S() ?? x(), T, E = (e) => {
24
+ g.value === void 0 && b(e), g.onValueChange?.(e);
25
+ }, D = a(() => g.shortcut, () => T?.focus({ preventScroll: !0 }));
26
+ return f(() => {
27
+ let e = T;
27
28
  if (!e) return;
28
- e.value !== y() && (w(e.value), e.value !== y() && (e.value = y()));
29
+ e.value !== x() && (E(e.value), e.value !== x() && (e.value = x()));
29
30
  let t = e.ownerDocument.defaultView;
30
31
  if (!t) return;
31
32
  let n = !1, r = /* @__PURE__ */ new Set(), i = (i) => {
32
33
  if (i.target !== e.form) return;
33
34
  let a = t.setTimeout(() => {
34
- r.delete(a), !(n || i.defaultPrevented) && (x(void 0), m.value === void 0 && _() !== g && w(g), e.value !== y() && (e.value = y()));
35
+ r.delete(a), n || i.defaultPrevented || (C(void 0), g.value === void 0 && y() !== v && E(v), e.value !== x() && (e.value = x()));
35
36
  }, 0);
36
37
  r.add(a);
37
38
  };
38
- e.ownerDocument.addEventListener("reset", i, !0), l(() => {
39
+ e.ownerDocument.addEventListener("reset", i, !0), d(() => {
39
40
  n = !0;
40
41
  for (let e of r) t.clearTimeout(e);
41
42
  r.clear(), e.ownerDocument.removeEventListener("reset", i, !0);
42
43
  });
43
- }), a(i, o(h, {
44
+ }), o(n, c(_, {
44
45
  type: "search",
45
46
  get class() {
46
- return t("sheen-search-input", m.class);
47
+ return i("sheen-search-input", g.class);
47
48
  },
48
49
  get "data-sheen-shortcut"() {
49
- return T()?.displayKeys;
50
+ return D()?.displayKeys;
50
51
  },
51
52
  get value() {
52
- return S();
53
+ return w();
53
54
  },
54
55
  onInput: (e) => {
55
- (e.isComposing || b() !== void 0) && x(e.currentTarget.value), w(e.currentTarget.value);
56
- let t = m.onInput;
57
- typeof t == "function" ? t(e) : t && t[0](t[1], e), b() === void 0 && !e.isComposing && e.currentTarget.value !== y() && (e.currentTarget.value = y());
56
+ (e.isComposing || S() !== void 0) && C(e.currentTarget.value), E(e.currentTarget.value);
57
+ let t = g.onInput;
58
+ typeof t == "function" ? t(e) : t && t[0](t[1], e), S() === void 0 && !e.isComposing && e.currentTarget.value !== x() && (e.currentTarget.value = x());
58
59
  },
59
60
  onCompositionStart: (e) => {
60
- x(e.currentTarget.value);
61
- let t = m.onCompositionStart;
61
+ C(e.currentTarget.value);
62
+ let t = g.onCompositionStart;
62
63
  typeof t == "function" ? t(e) : t && t[0](t[1], e);
63
64
  },
64
65
  onCompositionEnd: (e) => {
65
- let t = m.onCompositionEnd;
66
- typeof t == "function" ? t(e) : t && t[0](t[1], e), x(void 0), e.currentTarget.value !== y() && (e.currentTarget.value = y());
66
+ let t = g.onCompositionEnd;
67
+ typeof t == "function" ? t(e) : t && t[0](t[1], e), C(void 0), e.currentTarget.value !== x() && (e.currentTarget.value = x());
67
68
  },
68
69
  ref: (e) => {
69
- C = e, typeof m.ref == "function" && m.ref(e);
70
+ T = e, typeof g.ref == "function" && g.ref(e);
70
71
  },
71
72
  get endContent() {
72
- return [a(r, {
73
+ return [o(t, {
74
+ variant: "ghost",
73
75
  class: "sheen-search-input-clear",
74
76
  type: "button",
75
77
  get disabled() {
76
- return h.disabled || h.readOnly || h.readonly || b() !== void 0 || !y();
78
+ return _.disabled || _.readOnly || _.readonly || S() !== void 0 || !x();
77
79
  },
78
80
  onClick: () => {
79
- h.disabled || h.readOnly || h.readonly || b() !== void 0 || !y() || (w(""), C && C.value !== y() && (C.value = y()), C?.focus());
81
+ _.disabled || _.readOnly || _.readonly || S() !== void 0 || !x() || (E(""), T && T.value !== x() && (T.value = x()), T?.focus());
80
82
  },
81
83
  get children() {
82
- return m.clearLabel ?? p.messages().clearSearch;
84
+ return [o(e, { name: "close" }), (() => {
85
+ var e = m();
86
+ return s(e, () => g.clearLabel ?? h.messages().clearSearch), e;
87
+ })()];
83
88
  }
84
- }), f()];
89
+ }), o(e, {
90
+ class: "sheen-search-input-indicator",
91
+ name: "search"
92
+ })];
85
93
  }
86
94
  }));
87
95
  }
88
- //#endregion
89
- export { p as SearchInput };
96
+ export { h as SearchInput };
@@ -20,6 +20,8 @@ export interface SegmentedControlProps extends Omit<JSX.FieldsetHTMLAttributes<H
20
20
  orientation?: "horizontal" | "vertical";
21
21
  size?: "sm" | "md";
22
22
  overflowBehavior?: "scroll" | "wrap";
23
+ /** Stretch segments to share the container width equally, for short exclusive choices such as Buy/Sell. */
24
+ fullWidth?: boolean;
23
25
  }
24
26
  /** A compact, native-radio single-selection control with roving focus. */
25
27
  export declare function SegmentedControl(props: SegmentedControlProps): JSX.Element;