@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,22 +1,22 @@
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";
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { Button as t } from "./Button.js";
3
+ import { useTheme as n } from "../theme/ThemeProvider.js";
4
4
  import { createComponent as r, insert as i, mergeProps as a, spread as o, template as s } from "solid-js/web";
5
5
  import { Show as c, splitProps as l } from "solid-js";
6
- //#region src/primitives/Status.tsx
6
+ // src/primitives/Status.tsx
7
7
  var u = /*#__PURE__*/ s("<span>");
8
- function d(e) {
9
- let [n, r] = l(e, [
8
+ function d(t) {
9
+ let [n, r] = l(t, [
10
10
  "class",
11
11
  "tone",
12
12
  "variant",
13
13
  "size"
14
14
  ]);
15
15
  return (() => {
16
- var e = u();
17
- return o(e, a(r, {
16
+ var t = u();
17
+ return o(t, a(r, {
18
18
  get class() {
19
- return t("sheen-badge", n.class);
19
+ return e("sheen-badge", n.class);
20
20
  },
21
21
  get "data-tone"() {
22
22
  return n.tone ?? "neutral";
@@ -27,11 +27,11 @@ function d(e) {
27
27
  get "data-size"() {
28
28
  return n.size ?? "sm";
29
29
  }
30
- }), !1, !1), e;
30
+ }), !1, !1), t;
31
31
  })();
32
32
  }
33
33
  function f(o) {
34
- let s = e(), [f, p] = l(o, [
34
+ let s = n(), [f, p] = l(o, [
35
35
  "class",
36
36
  "label",
37
37
  "children",
@@ -41,7 +41,7 @@ function f(o) {
41
41
  ]);
42
42
  return r(d, a(p, {
43
43
  get class() {
44
- return t("sheen-tag", f.class);
44
+ return e("sheen-tag", f.class);
45
45
  },
46
46
  get "data-disabled"() {
47
47
  return f.disabled || void 0;
@@ -55,7 +55,8 @@ function f(o) {
55
55
  return f.onRemove;
56
56
  },
57
57
  get children() {
58
- return r(n, {
58
+ return r(t, {
59
+ variant: "ghost",
59
60
  class: "sheen-tag-remove",
60
61
  size: "xs",
61
62
  get disabled() {
@@ -74,5 +75,4 @@ function f(o) {
74
75
  }
75
76
  }));
76
77
  }
77
- //#endregion
78
78
  export { d as Badge, f as Tag };
@@ -1,44 +1,46 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { Button as n } from "./Button.js";
4
- import { Link as r } from "./Link.js";
5
- import { createComponent as i, effect as a, insert as o, mergeProps as s, setAttribute as c, spread as l, template as u, use as d } from "solid-js/web";
6
- import { For as f, Show as p, createMemo as m, splitProps as h } from "solid-js";
7
- //#region src/primitives/Stepper.tsx
8
- var g = /*#__PURE__*/ u("<strong>"), _ = /*#__PURE__*/ u("<nav><progress class=sheen-stepper-progress></progress><ol class=sheen-stepper-list>"), v = /*#__PURE__*/ u("<li class=sheen-stepper-step><span class=sheen-workflow-marker aria-hidden=true></span><div class=sheen-stepper-copy><span class=sheen-workflow-state>"), y = /*#__PURE__*/ u("<span class=sheen-stepper-description>");
9
- function b(e) {
1
+ import { Glyph as e } from "./Glyph.js";
2
+ import { useTheme as t } from "../theme/ThemeProvider.js";
3
+ import { cn as n } from "../utils/cn.js";
4
+ import { Button as r } from "./Button.js";
5
+ import { Link as i } from "./Link.js";
6
+ import { createComponent as a, effect as o, insert as s, mergeProps as c, setAttribute as l, spread as u, template as d, use as f } from "solid-js/web";
7
+ import { For as p, Show as m, createMemo as h, splitProps as g } from "solid-js";
8
+ // src/primitives/Stepper.tsx
9
+ var _ = /*#__PURE__*/ d("<strong>"), v = /*#__PURE__*/ d("<nav><progress class=\"sheen-stepper-progress sheen-sr-only\"></progress><ol class=sheen-stepper-list>"), y = /*#__PURE__*/ d("<li class=sheen-stepper-step><span class=sheen-workflow-marker aria-hidden=true></span><div class=sheen-stepper-copy><span class=sheen-workflow-state>"), b = /*#__PURE__*/ d("<span class=sheen-stepper-description>");
10
+ function x(e) {
10
11
  let t = () => {
11
12
  let t = e.step();
12
13
  return t.kind === "link" ? t.href : "";
13
- }, a = () => {
14
+ }, n = () => {
14
15
  let t = e.step();
15
16
  return t.kind === "action" && !!t.disabled;
16
- }, s = () => {
17
+ }, o = () => {
17
18
  let t = e.step();
18
19
  t.kind === "action" && !t.disabled && t.onSelect();
19
20
  };
20
- return i(p, {
21
+ return a(m, {
21
22
  get when() {
22
23
  return e.step().kind === "link";
23
24
  },
24
25
  get fallback() {
25
- return i(p, {
26
+ return a(m, {
26
27
  get when() {
27
28
  return e.step().kind === "action";
28
29
  },
29
30
  get fallback() {
30
31
  return (() => {
31
- var t = g();
32
- return o(t, () => e.step().label), t;
32
+ var t = _();
33
+ return s(t, () => e.step().label), t;
33
34
  })();
34
35
  },
35
36
  get children() {
36
- return i(n, {
37
- variant: "link",
37
+ return a(r, {
38
+ variant: "ghost",
39
+ class: "sheen-stepper-action",
38
40
  get disabled() {
39
- return a();
41
+ return n();
40
42
  },
41
- onClick: s,
43
+ onClick: o,
42
44
  get children() {
43
45
  return e.step().label;
44
46
  }
@@ -47,7 +49,8 @@ function b(e) {
47
49
  });
48
50
  },
49
51
  get children() {
50
- return i(r, {
52
+ return a(i, {
53
+ variant: "quiet",
51
54
  get href() {
52
55
  return t();
53
56
  },
@@ -58,8 +61,8 @@ function b(e) {
58
61
  }
59
62
  });
60
63
  }
61
- function x(n) {
62
- let r = e(), [u, g] = h(n, [
64
+ function S(r) {
65
+ let i = t(), [d, _] = g(r, [
63
66
  "ref",
64
67
  "class",
65
68
  "label",
@@ -68,9 +71,9 @@ function x(n) {
68
71
  "density",
69
72
  "refreshing",
70
73
  "aria-label"
71
- ]), x = m(() => {
74
+ ]), S = h(() => {
72
75
  let e = /* @__PURE__ */ new Map(), t = 0;
73
- for (let n of u.steps) {
76
+ for (let n of d.steps) {
74
77
  if (!n.id.trim()) throw Error("Stepper: step IDs must be nonempty");
75
78
  if (e.has(n.id)) throw Error(`Stepper: duplicate step ID ${JSON.stringify(n.id)}`);
76
79
  if (!n.label.trim()) throw Error(`Stepper: label must be nonempty for ${JSON.stringify(n.id)}`);
@@ -79,53 +82,53 @@ function x(n) {
79
82
  }
80
83
  if (t > 1) throw Error("Stepper: only one step may be current");
81
84
  return e;
82
- }), S = m(() => [...x().keys()]), C = m(() => [...x().values()].filter((e) => e.state === "completed").length), w = (e) => e === "completed" ? r.messages().workflowCompleted : e === "current" ? r.messages().workflowCurrent : e === "error" ? r.messages().workflowError : r.messages().workflowUpcoming, T = (e, t) => e === "completed" ? "✓" : e === "current" ? "●" : e === "error" ? "!" : String(t + 1);
85
+ }), C = h(() => [...S().keys()]), w = h(() => [...S().values()].filter((e) => e.state === "completed").length), T = (e) => e === "completed" ? i.messages().workflowCompleted : e === "current" ? i.messages().workflowCurrent : e === "error" ? i.messages().workflowError : i.messages().workflowUpcoming, E = (t, n) => t === "completed" ? a(e, { name: "check" }) : t === "error" ? a(e, { name: "alert" }) : String(n + 1);
83
86
  return (() => {
84
- var e = _(), n = e.firstChild, m = n.nextSibling;
85
- return d((e) => {
86
- typeof u.ref == "function" && u.ref(e);
87
- }, e), l(e, s(g, {
87
+ var e = v(), t = e.firstChild, r = t.nextSibling;
88
+ return f((e) => {
89
+ typeof d.ref == "function" && d.ref(e);
90
+ }, e), u(e, c(_, {
88
91
  get class() {
89
- return t("sheen-stepper", u.class);
92
+ return n("sheen-stepper", d.class);
90
93
  },
91
94
  get "aria-label"() {
92
- return u["aria-label"] ?? u.label;
95
+ return d["aria-label"] ?? d.label;
93
96
  },
94
97
  get "aria-busy"() {
95
- return u.refreshing || void 0;
98
+ return d.refreshing || void 0;
96
99
  },
97
100
  get "data-orientation"() {
98
- return u.orientation ?? "horizontal";
101
+ return d.orientation ?? "horizontal";
99
102
  },
100
103
  get "data-density"() {
101
- return u.density ?? "default";
104
+ return d.density ?? "default";
102
105
  },
103
106
  get "data-refreshing"() {
104
- return u.refreshing || void 0;
107
+ return d.refreshing || void 0;
105
108
  }
106
- }), !1, !0), o(m, i(f, {
109
+ }), !1, !0), s(r, a(p, {
107
110
  get each() {
108
- return S();
111
+ return C();
109
112
  },
110
113
  children: (e, t) => {
111
- let n = () => x().get(e);
112
- return i(p, {
114
+ let n = () => S().get(e);
115
+ return a(m, {
113
116
  get when() {
114
117
  return n();
115
118
  },
116
119
  children: (n) => (() => {
117
- var r = v(), s = r.firstChild, l = s.nextSibling, u = l.firstChild;
118
- return c(r, "data-step-id", e), o(s, () => T(n().state, t())), o(l, i(b, { step: n }), u), o(u, () => w(n().state)), o(l, i(p, {
120
+ var r = y(), i = r.firstChild, c = i.nextSibling, u = c.firstChild;
121
+ return l(r, "data-step-id", e), s(i, () => E(n().state, t())), s(c, a(x, { step: n }), u), s(u, () => T(n().state)), s(c, a(m, {
119
122
  get when() {
120
123
  return n().description;
121
124
  },
122
125
  children: (e) => (() => {
123
- var t = y();
124
- return o(t, e), t;
126
+ var t = b();
127
+ return s(t, e), t;
125
128
  })()
126
- }), null), a((e) => {
127
- var t = n().state, i = n().state === "current" ? "step" : void 0, a = n().state;
128
- return t !== e.e && c(r, "data-state", e.e = t), i !== e.t && c(r, "aria-current", e.t = i), a !== e.a && c(s, "data-state", e.a = a), e;
129
+ }), null), o((e) => {
130
+ var t = n().state, a = n().state === "current" ? "step" : void 0, o = n().state;
131
+ return t !== e.e && l(r, "data-state", e.e = t), a !== e.t && l(r, "aria-current", e.t = a), o !== e.a && l(i, "data-state", e.a = o), e;
129
132
  }, {
130
133
  e: void 0,
131
134
  t: void 0,
@@ -134,14 +137,13 @@ function x(n) {
134
137
  })()
135
138
  });
136
139
  }
137
- })), a((e) => {
138
- var t = Math.max(1, S().length), i = r.messages().stepperProgress.replaceAll("{label}", u.label);
139
- return t !== e.e && c(n, "max", e.e = t), i !== e.t && c(n, "aria-label", e.t = i), e;
140
+ })), o((e) => {
141
+ var n = Math.max(1, C().length), r = i.messages().stepperProgress.replaceAll("{label}", d.label);
142
+ return n !== e.e && l(t, "max", e.e = n), r !== e.t && l(t, "aria-label", e.t = r), e;
140
143
  }, {
141
144
  e: void 0,
142
145
  t: void 0
143
- }), a(() => n.value = C()), e;
146
+ }), o(() => t.value = w()), e;
144
147
  })();
145
148
  }
146
- //#endregion
147
- export { x as Stepper };
149
+ export { S as Stepper };
@@ -0,0 +1,12 @@
1
+ import type { JSX } from "solid-js";
2
+ export interface StreamingTextProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "ref"> {
3
+ ref?: HTMLDivElement | ((element: HTMLDivElement) => void);
4
+ text: string;
5
+ streaming?: boolean;
6
+ completeLabel?: string;
7
+ }
8
+ /**
9
+ * Plain text that grows while a response streams. Blank lines separate paragraphs; each paragraph keeps its element and text node,
10
+ * so an append rewrites only the final paragraph's text. Assistive technology hears one polite completion instead of every token.
11
+ */
12
+ export declare function StreamingText(props: StreamingTextProps): JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { useTheme as e } from "../theme/ThemeProvider.js";
2
+ import { cn as t } from "../utils/cn.js";
3
+ import { createComponent as n, insert as r, mergeProps as i, spread as a, template as o, use as s } from "solid-js/web";
4
+ import { Index as c, createEffect as l, createMemo as u, createSignal as d, on as f, splitProps as p } from "solid-js";
5
+ // src/primitives/StreamingText.tsx
6
+ var m = /*#__PURE__*/ o("<div><div class=sheen-streaming-text-content></div><span class=sheen-streaming-text-status role=status>"), h = /*#__PURE__*/ o("<p>");
7
+ function g(o) {
8
+ let g = e(), [_, v] = p(o, [
9
+ "ref",
10
+ "text",
11
+ "streaming",
12
+ "completeLabel",
13
+ "class"
14
+ ]), y = u(() => _.text === "" ? [] : _.text.split(/\n{2,}/u)), b = () => _.streaming === !0, [x, S] = d("");
15
+ return l(f(b, (e, t) => {
16
+ e ? S("") : t && S(_.completeLabel ?? g.messages().responseComplete);
17
+ }, { defer: !0 })), (() => {
18
+ var e = m(), o = e.firstChild, l = o.nextSibling;
19
+ return s((e) => {
20
+ typeof _.ref == "function" && _.ref(e);
21
+ }, e), a(e, i(v, {
22
+ get class() {
23
+ return t("sheen-streaming-text", _.class);
24
+ },
25
+ get "data-streaming"() {
26
+ return b() || void 0;
27
+ },
28
+ get "aria-busy"() {
29
+ return b() || void 0;
30
+ }
31
+ }), !1, !0), r(o, n(c, {
32
+ get each() {
33
+ return y();
34
+ },
35
+ children: (e) => (() => {
36
+ var t = h();
37
+ return r(t, e), t;
38
+ })()
39
+ })), r(l, x), e;
40
+ })();
41
+ }
42
+ export { g as StreamingText };
@@ -1,7 +1,7 @@
1
1
  import { cn as e } from "../utils/cn.js";
2
2
  import { createComponent as t, mergeProps as n, spread as r, template as i } from "solid-js/web";
3
3
  import { splitProps as a } from "solid-js";
4
- //#region src/primitives/Surface.tsx
4
+ // src/primitives/Surface.tsx
5
5
  var o = /*#__PURE__*/ i("<div>");
6
6
  function s(t) {
7
7
  let [i, s] = a(t, [
@@ -54,5 +54,4 @@ function c(r) {
54
54
  }
55
55
  }));
56
56
  }
57
- //#endregion
58
57
  export { c as Card, s as Surface };
@@ -1,7 +1,6 @@
1
1
  import { createNativeBooleanControl as e } from "./Checkbox.js";
2
- //#region src/primitives/Switch.tsx
2
+ // src/primitives/Switch.tsx
3
3
  function t(t) {
4
4
  return e(t, "switch");
5
5
  }
6
- //#endregion
7
6
  export { t as Switch };
@@ -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 { splitProps as i } from "solid-js";
4
- //#region src/primitives/Table.tsx
4
+ // src/primitives/Table.tsx
5
5
  var a = /*#__PURE__*/ r("<table>"), o = /*#__PURE__*/ r("<caption>"), s = /*#__PURE__*/ r("<thead>"), c = /*#__PURE__*/ r("<tbody>"), l = /*#__PURE__*/ r("<tfoot>"), u = /*#__PURE__*/ r("<tr>"), d = /*#__PURE__*/ r("<th>"), f = /*#__PURE__*/ r("<td>");
6
6
  function p(r) {
7
7
  let [o, s] = i(r, ["class", "striped"]);
@@ -97,5 +97,4 @@ function b(r) {
97
97
  }), !1, !1), r;
98
98
  })();
99
99
  }
100
- //#endregion
101
100
  export { p as Table, g as TableBody, m as TableCaption, b as TableCell, _ as TableFoot, h as TableHead, y as TableHeaderCell, v as TableRow };
@@ -1,37 +1,38 @@
1
- import { cn as e } from "../utils/cn.js";
2
- import { Button as t } from "./Button.js";
1
+ import { Button as e } from "./Button.js";
2
+ import { cn as t } from "../utils/cn.js";
3
3
  import { createComponent as n, effect as r, insert as i, mergeProps as a, setAttribute as o, template as s } from "solid-js/web";
4
4
  import { For as c, createEffect as l, createMemo as u, createSignal as d, createUniqueId as f, onCleanup as p, splitProps as m } from "solid-js";
5
5
  import * as h from "#sheen-kobalte/tabs";
6
- //#region src/primitives/Tabs.tsx
6
+ // src/primitives/Tabs.tsx
7
7
  var g = /*#__PURE__*/ s("<div role=tabpanel tabindex=0 class=sheen-tabs-panel>");
8
- function _(e) {
9
- let r = h.useTabsContext(), i = () => e.disabled ? -1 : (r.listState().selectionManager().focusedKey() ?? (e.selected ? e.value : void 0)) === e.value ? 0 : -1;
8
+ function _(t) {
9
+ let r = h.useTabsContext(), i = () => t.disabled ? -1 : (r.listState().selectionManager().focusedKey() ?? (t.selected ? t.value : void 0)) === t.value ? 0 : -1;
10
10
  return n(h.Trigger, {
11
- as: t,
11
+ as: e,
12
+ variant: "ghost",
12
13
  get value() {
13
- return e.value;
14
+ return t.value;
14
15
  },
15
16
  get id() {
16
- return `${e.id}-tab`;
17
+ return `${t.id}-tab`;
17
18
  },
18
19
  get "aria-controls"() {
19
- return `${e.id}-panel`;
20
+ return `${t.id}-panel`;
20
21
  },
21
22
  get disabled() {
22
- return e.disabled;
23
+ return t.disabled;
23
24
  },
24
25
  get tabIndex() {
25
26
  return i();
26
27
  },
27
28
  class: "sheen-tabs-trigger",
28
29
  get children() {
29
- return e.label;
30
+ return t.label;
30
31
  }
31
32
  });
32
33
  }
33
- function v(t) {
34
- let [s, v] = m(t, [
34
+ function v(e) {
35
+ let [s, v] = m(e, [
35
36
  "label",
36
37
  "items",
37
38
  "value",
@@ -88,7 +89,7 @@ function v(t) {
88
89
  return b();
89
90
  },
90
91
  get class() {
91
- return e("sheen-tabs", s.class);
92
+ return t("sheen-tabs", s.class);
92
93
  },
93
94
  get value() {
94
95
  return encodeURIComponent(O() ?? "");
@@ -110,7 +111,7 @@ function v(t) {
110
111
  },
111
112
  class: "sheen-tabs-list",
112
113
  get children() {
113
- return n(c, {
114
+ return [n(c, {
114
115
  get each() {
115
116
  return [...w().keys()];
116
117
  },
@@ -131,7 +132,10 @@ function v(t) {
131
132
  return O() === e;
132
133
  }
133
134
  })
134
- });
135
+ }), n(h.Indicator, {
136
+ class: "sheen-tabs-indicator",
137
+ "aria-hidden": "true"
138
+ })];
135
139
  }
136
140
  }), n(c, {
137
141
  get each() {
@@ -153,5 +157,4 @@ function v(t) {
153
157
  }
154
158
  }));
155
159
  }
156
- //#endregion
157
160
  export { v as Tabs };
@@ -3,7 +3,7 @@ import { cn as t } from "../utils/cn.js";
3
3
  import { Button as n } from "./Button.js";
4
4
  import { createComponent as r, delegateEvents as i, effect as a, insert as o, memo as s, mergeProps as c, setAttribute as l, spread as u, template as d, use as f } from "solid-js/web";
5
5
  import { For as p, Show as m, createEffect as h, createSignal as g, createUniqueId as _, onCleanup as v, onMount as y, splitProps as b } from "solid-js";
6
- //#region src/primitives/TagInput.tsx
6
+ // src/primitives/TagInput.tsx
7
7
  var x = /*#__PURE__*/ d("<span aria-hidden=true> *"), ee = /*#__PURE__*/ d("<span class=sheen-field-description>"), te = /*#__PURE__*/ d("<div><label class=sheen-field-label></label><div class=sheen-tag-input-control><ul class=sheen-tag-input-values></ul><input type=text class=sheen-tag-input-editor autocomplete=off></div><select class=sheen-select-native aria-hidden=true tabindex=-1 multiple></select><span class=sheen-tag-input-instructions></span><span class=sheen-tag-input-announcer role=status aria-live=polite aria-atomic=true>"), ne = /*#__PURE__*/ d("<li class=sheen-tag-input-value><span class=sheen-tag-input-value-label>"), re = /*#__PURE__*/ d("<option selected>"), ie = /*#__PURE__*/ d("<span class=sheen-field-error role=alert>");
8
8
  function S(e, t) {
9
9
  let n = /* @__PURE__ */ new Set();
@@ -51,7 +51,7 @@ function w(i) {
51
51
  T.error || F() ? `${w}-error` : "",
52
52
  T["aria-describedby"]
53
53
  ].filter(Boolean).join(" ") || void 0, K = (e) => {
54
- S(e, "TagInput value"), !C(e, G()) && (T.value === void 0 && ae([...e]), T.onValueChange?.([...e]));
54
+ S(e, "TagInput value"), C(e, G()) || (T.value === void 0 && ae([...e]), T.onValueChange?.([...e]));
55
55
  }, q = () => {
56
56
  H += 1, U?.abort(), U = void 0, P(!1);
57
57
  }, J = (e) => {
@@ -113,11 +113,8 @@ function w(i) {
113
113
  q(), I(void 0), A(e.currentTarget.value);
114
114
  }, le = (e) => {
115
115
  if (!(e.isComposing || j())) {
116
- if ((T.commitKeys ?? ["Enter", ","]).includes(e.key)) {
117
- k().trim() && e.preventDefault(), se();
118
- return;
119
- }
120
- if (e.key === "Backspace" && !k() && G().length > 0) {
116
+ if ((T.commitKeys ?? ["Enter", ","]).includes(e.key)) k().trim() && e.preventDefault(), se();
117
+ else if (e.key === "Backspace" && !k() && G().length > 0) {
121
118
  let e = G().at(-1);
122
119
  e && X(e, !1);
123
120
  } else if (e.key === "ArrowLeft" && !k()) {
@@ -149,7 +146,7 @@ function w(i) {
149
146
  let r = /* @__PURE__ */ new Set(), i = (t) => {
150
147
  if (t.target !== B?.form && t.target !== e.form) return;
151
148
  let i = n.setTimeout(() => {
152
- r.delete(i), !(V || t.defaultPrevented) && (q(), I(void 0), J(""), T.value === void 0 && K(D), Q());
149
+ r.delete(i), V || t.defaultPrevented || (q(), I(void 0), J(""), T.value === void 0 && K(D), Q());
153
150
  }, 0);
154
151
  r.add(i);
155
152
  };
@@ -200,6 +197,7 @@ function w(i) {
200
197
  children: (e) => (v(() => W.delete(e)), (() => {
201
198
  var t = ne(), i = t.firstChild;
202
199
  return l(t, "data-tag-value", e), o(i, e), o(t, r(n, {
200
+ variant: "ghost",
203
201
  ref: (t) => W.set(e, t),
204
202
  class: "sheen-tag-input-remove",
205
203
  size: "xs",
@@ -284,5 +282,4 @@ i([
284
282
  "input",
285
283
  "keydown"
286
284
  ]);
287
- //#endregion
288
285
  export { w as TagInput };
@@ -1,12 +1,13 @@
1
- import { useTheme as e } from "../theme/ThemeProvider.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { Field as n } from "./Field.js";
4
- import { createComponent as r, insert as i, isServer as a, memo as o, mergeProps as s, spread as c, template as l, use as u } from "solid-js/web";
5
- import { createEffect as d, onCleanup as f, onMount as p, splitProps as m } from "solid-js";
6
- //#region src/primitives/Textarea.tsx
7
- var h = /*#__PURE__*/ l("<textarea>");
8
- function g(l) {
9
- let g = e(), [_, v] = m(l, [
1
+ import { Field as e } from "./Field.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, insert as a, isServer as o, memo as s, mergeProps as c, spread as l, template as u, use as d } from "solid-js/web";
6
+ import { createEffect as f, splitProps as p } from "solid-js";
7
+ // src/primitives/Textarea.tsx
8
+ var m = /*#__PURE__*/ u("<textarea>");
9
+ function h(u) {
10
+ let h = t(), [g, _] = p(u, [
10
11
  "label",
11
12
  "id",
12
13
  "class",
@@ -21,86 +22,59 @@ function g(l) {
21
22
  "ref",
22
23
  "value",
23
24
  "rows"
24
- ]), y, b = !1, x, S = !1, C = "", w = () => {
25
- if (x = void 0, y && b) {
26
- if (!_.autoResize) {
27
- S && (y.style.blockSize = C), S = !1;
28
- return;
29
- }
30
- y.getClientRects().length && (S || (C = y.style.blockSize), S = !0, y.style.blockSize = "auto", y.style.blockSize = `${y.scrollHeight + y.offsetHeight - y.clientHeight}px`);
31
- }
32
- }, T = () => {
33
- b && y && x === void 0 && (x = y.ownerDocument.defaultView?.requestAnimationFrame(w));
34
- };
35
- p(() => {
36
- if (!y) return;
37
- b = !0;
38
- let e = y, t = -1, n = new ResizeObserver((e) => {
39
- let n = e[0]?.contentRect.width;
40
- n !== void 0 && n !== t && (t = n, T());
41
- });
42
- n.observe(e);
43
- let r = e.ownerDocument.fonts;
44
- r.ready.then(T), r.addEventListener("loadingdone", T);
45
- let i = (t) => {
46
- t.target === e.form && T();
47
- };
48
- e.ownerDocument.addEventListener("reset", i, !0), T(), f(() => {
49
- b = !1, n.disconnect(), r.removeEventListener("loadingdone", T), e.ownerDocument.removeEventListener("reset", i, !0), x !== void 0 && e.ownerDocument.defaultView?.cancelAnimationFrame(x);
50
- });
51
- }), d(() => {
52
- _.value, _.rows, _.autoResize, g.state(), T();
25
+ ]), v, y = r(() => v, () => g.autoResize === !0);
26
+ f(() => {
27
+ g.value, g.rows, g.autoResize, h.state(), y();
53
28
  });
54
- let E = (e) => {
55
- let t = _.onInput;
56
- typeof t == "function" ? t(e) : t && t[0](t[1], e), T();
57
- }, D = () => _.value === void 0 ? void 0 : `\n${_.value}`;
58
- return r(n, {
29
+ let b = (e) => {
30
+ let t = g.onInput;
31
+ typeof t == "function" ? t(e) : t && t[0](t[1], e), y();
32
+ }, x = () => g.value === void 0 ? void 0 : `\n${g.value}`;
33
+ return i(e, {
59
34
  get label() {
60
- return _.label;
35
+ return g.label;
61
36
  },
62
37
  get controlId() {
63
- return _.id;
38
+ return g.id;
64
39
  },
65
40
  get description() {
66
- return _.description;
41
+ return g.description;
67
42
  },
68
43
  get error() {
69
- return _.error;
44
+ return g.error;
70
45
  },
71
46
  get required() {
72
- return _.required;
47
+ return g.required;
73
48
  },
74
49
  get disabled() {
75
- return _.disabled;
50
+ return g.disabled;
76
51
  },
77
52
  children: (e) => (() => {
78
- var n = h();
79
- return u((e) => {
80
- y = e, typeof _.ref == "function" && _.ref(e);
81
- }, n), c(n, s(v, e, {
53
+ var t = m();
54
+ return d((e) => {
55
+ v = e, typeof g.ref == "function" && g.ref(e);
56
+ }, t), l(t, c(_, e, {
82
57
  get value() {
83
- return a ? void 0 : _.value;
58
+ return o ? void 0 : g.value;
84
59
  },
85
60
  get rows() {
86
- return _.rows ?? 3;
61
+ return g.rows ?? 3;
87
62
  },
88
63
  get "data-autoresize"() {
89
- return _.autoResize || void 0;
64
+ return g.autoResize || void 0;
90
65
  },
91
- onInput: E,
66
+ onInput: b,
92
67
  get "aria-describedby"() {
93
- return [e["aria-describedby"], _["aria-describedby"]].filter(Boolean).join(" ") || void 0;
68
+ return [e["aria-describedby"], g["aria-describedby"]].filter(Boolean).join(" ") || void 0;
94
69
  },
95
70
  get "aria-invalid"() {
96
- return o(() => !!_.error)() ? !0 : _["aria-invalid"];
71
+ return s(() => !!g.error)() ? !0 : g["aria-invalid"];
97
72
  },
98
73
  get class() {
99
- return t("sheen-input sheen-textarea", _.class);
74
+ return n("sheen-input sheen-textarea", g.class);
100
75
  }
101
- }), !1, !0), i(n, () => a ? D() : void 0), n;
76
+ }), !1, !0), a(t, () => o ? x() : void 0), t;
102
77
  })()
103
78
  });
104
79
  }
105
- //#endregion
106
- export { g as Textarea };
80
+ export { h as Textarea };