@bysages/solid 0.3.0 → 0.4.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 (273) hide show
  1. package/dist/{ai-response-ClGGptX3.mjs → ai-response-D2uINBIi.mjs} +17 -7
  2. package/dist/chevron-BHQrYKPM.mjs +8 -0
  3. package/dist/components/accordion/index.d.mts +22 -2
  4. package/dist/components/accordion/index.mjs +68 -2
  5. package/dist/components/affix/index.d.mts +3 -1
  6. package/dist/components/affix/index.mjs +5 -4
  7. package/dist/components/ai/index.d.mts +1 -1
  8. package/dist/components/ai/index.mjs +14 -16
  9. package/dist/components/ai-action/index.d.mts +3 -1
  10. package/dist/components/ai-action/index.mjs +3 -2
  11. package/dist/components/ai-attachments/index.d.mts +8 -4
  12. package/dist/components/ai-attachments/index.mjs +41 -37
  13. package/dist/components/ai-message/index.d.mts +3 -1
  14. package/dist/components/ai-message/index.mjs +3 -2
  15. package/dist/components/ai-prompt-input/index.d.mts +3 -1
  16. package/dist/components/ai-prompt-input/index.mjs +59 -46
  17. package/dist/components/ai-reasoning/index.d.mts +3 -1
  18. package/dist/components/ai-reasoning/index.mjs +4 -3
  19. package/dist/components/ai-response/index.d.mts +3 -1
  20. package/dist/components/ai-response/index.mjs +1 -1
  21. package/dist/components/ai-source/index.d.mts +6 -2
  22. package/dist/components/ai-source/index.mjs +5 -4
  23. package/dist/components/ai-suggestion/index.d.mts +3 -1
  24. package/dist/components/ai-suggestion/index.mjs +3 -2
  25. package/dist/components/ai-tool/index.d.mts +3 -1
  26. package/dist/components/ai-tool/index.mjs +4 -3
  27. package/dist/components/alert/index.mjs +31 -34
  28. package/dist/components/angle-slider/index.d.mts +1 -1
  29. package/dist/components/angle-slider/index.mjs +13 -5
  30. package/dist/components/aspect-ratio/index.d.mts +3 -1
  31. package/dist/components/aspect-ratio/index.mjs +3 -2
  32. package/dist/components/autocomplete/index.d.mts +4 -1
  33. package/dist/components/autocomplete/index.mjs +15 -2
  34. package/dist/components/avatar/index.d.mts +1 -1
  35. package/dist/components/avatar/index.mjs +10 -1
  36. package/dist/components/avatar-group/index.d.mts +3 -1
  37. package/dist/components/avatar-group/index.mjs +3 -2
  38. package/dist/components/back-top/index.d.mts +3 -1
  39. package/dist/components/back-top/index.mjs +9 -5
  40. package/dist/components/badge/index.d.mts +3 -1
  41. package/dist/components/badge/index.mjs +3 -2
  42. package/dist/components/banner/index.mjs +9 -3
  43. package/dist/components/block-ui/index.d.mts +3 -1
  44. package/dist/components/block-ui/index.mjs +3 -2
  45. package/dist/components/breadcrumb/index.mjs +5 -5
  46. package/dist/components/button/index.d.mts +3 -1
  47. package/dist/components/button/index.mjs +3 -2
  48. package/dist/components/calendar/index.d.mts +3 -1
  49. package/dist/components/calendar/index.mjs +29 -21
  50. package/dist/components/carousel/index.d.mts +5 -1
  51. package/dist/components/carousel/index.mjs +13 -1
  52. package/dist/components/cascade-select/index.d.mts +3 -1
  53. package/dist/components/cascade-select/index.mjs +82 -74
  54. package/dist/components/checkbox/index.d.mts +1 -1
  55. package/dist/components/checkbox/index.mjs +13 -5
  56. package/dist/components/checkbox-group/index.d.mts +4 -9
  57. package/dist/components/checkbox-group/index.mjs +65 -68
  58. package/dist/components/chip/index.d.mts +3 -1
  59. package/dist/components/chip/index.mjs +3 -2
  60. package/dist/components/client-only/index.d.mts +7 -2
  61. package/dist/components/client-only/index.mjs +8 -1
  62. package/dist/components/clipboard/index.d.mts +1 -1
  63. package/dist/components/clipboard/index.mjs +13 -5
  64. package/dist/components/collapsible/index.d.mts +15 -1
  65. package/dist/components/collapsible/index.mjs +39 -2
  66. package/dist/components/color-picker/index.d.mts +13 -2
  67. package/dist/components/color-picker/index.mjs +95 -8
  68. package/dist/components/combobox/index.d.mts +24 -1
  69. package/dist/components/combobox/index.mjs +129 -8
  70. package/dist/components/command/index.d.mts +4 -1
  71. package/dist/components/command/index.mjs +24 -4
  72. package/dist/components/comment/index.d.mts +3 -1
  73. package/dist/components/comment/index.mjs +3 -2
  74. package/dist/components/config-provider/index.d.mts +7 -2
  75. package/dist/components/config-provider/index.mjs +6 -3
  76. package/dist/components/container/index.d.mts +3 -1
  77. package/dist/components/container/index.mjs +3 -2
  78. package/dist/components/data-view/index.d.mts +3 -1
  79. package/dist/components/data-view/index.mjs +13 -8
  80. package/dist/components/date-input/index.d.mts +1 -1
  81. package/dist/components/date-input/index.mjs +13 -5
  82. package/dist/components/date-picker/index.d.mts +1 -1
  83. package/dist/components/date-picker/index.mjs +13 -5
  84. package/dist/components/deferred-content/index.d.mts +3 -1
  85. package/dist/components/deferred-content/index.mjs +3 -2
  86. package/dist/components/descriptions/index.d.mts +7 -0
  87. package/dist/components/descriptions/index.mjs +21 -2
  88. package/dist/components/dialog/index.d.mts +17 -1
  89. package/dist/components/dialog/index.mjs +84 -2
  90. package/dist/components/download-trigger/index.d.mts +7 -2
  91. package/dist/components/download-trigger/index.mjs +8 -1
  92. package/dist/components/drawer/index.d.mts +17 -1
  93. package/dist/components/drawer/index.mjs +83 -2
  94. package/dist/components/dynamic-input/index.d.mts +3 -1
  95. package/dist/components/dynamic-input/index.mjs +15 -7
  96. package/dist/components/editable/index.d.mts +1 -1
  97. package/dist/components/editable/index.mjs +13 -5
  98. package/dist/components/ellipsis/index.d.mts +3 -1
  99. package/dist/components/ellipsis/index.mjs +3 -2
  100. package/dist/components/field/index.d.mts +5 -1
  101. package/dist/components/field/index.mjs +13 -1
  102. package/dist/components/fieldset/index.d.mts +5 -1
  103. package/dist/components/fieldset/index.mjs +13 -1
  104. package/dist/components/file-upload/index.d.mts +1 -1
  105. package/dist/components/file-upload/index.mjs +24 -6
  106. package/dist/components/float-button/index.mjs +3 -1
  107. package/dist/components/floating-panel/index.d.mts +5 -1
  108. package/dist/components/floating-panel/index.mjs +13 -1
  109. package/dist/components/focus-trap/index.d.mts +7 -2
  110. package/dist/components/focus-trap/index.mjs +8 -1
  111. package/dist/components/form/index.d.mts +1 -1
  112. package/dist/components/form/index.mjs +10 -4
  113. package/dist/components/frame/index.d.mts +6 -1
  114. package/dist/components/frame/index.mjs +10 -1
  115. package/dist/components/grid/index.d.mts +3 -1
  116. package/dist/components/grid/index.mjs +3 -2
  117. package/dist/components/highlight/index.d.mts +3 -1
  118. package/dist/components/highlight/index.mjs +2 -1
  119. package/dist/components/hover-card/index.d.mts +19 -1
  120. package/dist/components/hover-card/index.mjs +91 -2
  121. package/dist/components/icon/index.d.mts +8 -7
  122. package/dist/components/icon/index.mjs +4 -3
  123. package/dist/components/image/index.d.mts +8 -2
  124. package/dist/components/image/index.mjs +40 -33
  125. package/dist/components/image-cropper/index.d.mts +5 -1
  126. package/dist/components/image-cropper/index.mjs +13 -1
  127. package/dist/components/image-viewer/index.d.mts +2 -19
  128. package/dist/components/image-viewer/index.mjs +3 -151
  129. package/dist/components/input/index.d.mts +3 -1
  130. package/dist/components/input/index.mjs +1 -1
  131. package/dist/components/json-tree-view/index.d.mts +5 -1
  132. package/dist/components/json-tree-view/index.mjs +22 -2
  133. package/dist/components/kbd/index.d.mts +3 -1
  134. package/dist/components/kbd/index.mjs +3 -2
  135. package/dist/components/layout/index.mjs +8 -4
  136. package/dist/components/link/index.d.mts +3 -1
  137. package/dist/components/link/index.mjs +3 -2
  138. package/dist/components/list/index.d.mts +2 -1
  139. package/dist/components/list/index.mjs +35 -26
  140. package/dist/components/listbox/index.d.mts +1 -1
  141. package/dist/components/listbox/index.mjs +13 -5
  142. package/dist/components/marquee/index.d.mts +5 -1
  143. package/dist/components/marquee/index.mjs +13 -1
  144. package/dist/components/masonry/index.d.mts +3 -1
  145. package/dist/components/masonry/index.mjs +3 -2
  146. package/dist/components/media-player/index.d.mts +2 -0
  147. package/dist/components/media-player/index.mjs +2 -0
  148. package/dist/components/mentions/index.d.mts +1 -1
  149. package/dist/components/mentions/index.mjs +2 -2
  150. package/dist/components/menu/index.d.mts +21 -1
  151. package/dist/components/menu/index.mjs +62 -5
  152. package/dist/components/menubar/index.d.mts +3 -1
  153. package/dist/components/menubar/index.mjs +31 -9
  154. package/dist/components/navigation-menu/index.d.mts +5 -1
  155. package/dist/components/navigation-menu/index.mjs +13 -1
  156. package/dist/components/number-input/index.d.mts +1 -1
  157. package/dist/components/number-input/index.mjs +13 -5
  158. package/dist/components/order-list/index.d.mts +3 -1
  159. package/dist/components/order-list/index.mjs +79 -67
  160. package/dist/components/pagination/index.d.mts +1 -1
  161. package/dist/components/pagination/index.mjs +13 -5
  162. package/dist/components/password-input/index.d.mts +1 -1
  163. package/dist/components/password-input/index.mjs +13 -5
  164. package/dist/components/pin-input/index.d.mts +1 -1
  165. package/dist/components/pin-input/index.mjs +13 -5
  166. package/dist/components/popconfirm/index.d.mts +3 -1
  167. package/dist/components/popconfirm/index.mjs +16 -8
  168. package/dist/components/popover/index.d.mts +19 -1
  169. package/dist/components/popover/index.mjs +91 -2
  170. package/dist/components/presence/index.d.mts +10 -2
  171. package/dist/components/presence/index.mjs +9 -1
  172. package/dist/components/progress/index.d.mts +1 -1
  173. package/dist/components/progress/index.mjs +13 -5
  174. package/dist/components/progress-group/index.d.mts +3 -1
  175. package/dist/components/progress-group/index.mjs +4 -3
  176. package/dist/components/qr-code/index.d.mts +5 -1
  177. package/dist/components/qr-code/index.mjs +13 -1
  178. package/dist/components/radio-group/index.d.mts +1 -1
  179. package/dist/components/radio-group/index.mjs +13 -5
  180. package/dist/components/rating-group/index.d.mts +2 -2
  181. package/dist/components/rating-group/index.mjs +13 -5
  182. package/dist/components/result/index.d.mts +1 -1
  183. package/dist/components/result/index.mjs +5 -3
  184. package/dist/components/scroll-area/index.d.mts +5 -1
  185. package/dist/components/scroll-area/index.mjs +13 -1
  186. package/dist/components/segment-group/index.d.mts +1 -1
  187. package/dist/components/segment-group/index.mjs +11 -6
  188. package/dist/components/select/index.d.mts +2 -2
  189. package/dist/components/select/index.mjs +1 -1
  190. package/dist/components/separator/index.d.mts +3 -1
  191. package/dist/components/separator/index.mjs +3 -2
  192. package/dist/components/signature-pad/index.d.mts +5 -1
  193. package/dist/components/signature-pad/index.mjs +13 -1
  194. package/dist/components/skeleton/index.d.mts +3 -1
  195. package/dist/components/skeleton/index.mjs +3 -2
  196. package/dist/components/slider/index.d.mts +1 -1
  197. package/dist/components/slider/index.mjs +13 -5
  198. package/dist/components/spinner/index.d.mts +3 -1
  199. package/dist/components/spinner/index.mjs +6 -3
  200. package/dist/components/split-button/index.d.mts +3 -1
  201. package/dist/components/split-button/index.mjs +19 -4
  202. package/dist/components/splitter/index.d.mts +5 -1
  203. package/dist/components/splitter/index.mjs +13 -1
  204. package/dist/components/spotlight/index.d.mts +3 -1
  205. package/dist/components/spotlight/index.mjs +3 -2
  206. package/dist/components/stack/index.d.mts +3 -1
  207. package/dist/components/stack/index.mjs +6 -5
  208. package/dist/components/steps/index.d.mts +25 -3
  209. package/dist/components/steps/index.mjs +73 -8
  210. package/dist/components/swap/index.d.mts +5 -1
  211. package/dist/components/swap/index.mjs +13 -1
  212. package/dist/components/switch/index.d.mts +1 -1
  213. package/dist/components/switch/index.mjs +13 -5
  214. package/dist/components/table/index.d.mts +3 -1
  215. package/dist/components/table/index.mjs +194 -164
  216. package/dist/components/tabs/index.d.mts +20 -2
  217. package/dist/components/tabs/index.mjs +59 -3
  218. package/dist/components/tags-input/index.d.mts +1 -1
  219. package/dist/components/tags-input/index.mjs +13 -5
  220. package/dist/components/terminal/index.d.mts +3 -1
  221. package/dist/components/terminal/index.mjs +6 -3
  222. package/dist/components/textarea/index.d.mts +3 -1
  223. package/dist/components/textarea/index.mjs +3 -2
  224. package/dist/components/timer/index.d.mts +5 -1
  225. package/dist/components/timer/index.mjs +13 -1
  226. package/dist/components/toast/index.d.mts +8 -2
  227. package/dist/components/toast/index.mjs +14 -2
  228. package/dist/components/toc/index.d.mts +5 -1
  229. package/dist/components/toc/index.mjs +1 -9
  230. package/dist/components/toggle/index.d.mts +5 -1
  231. package/dist/components/toggle/index.mjs +13 -1
  232. package/dist/components/toggle-group/index.d.mts +1 -1
  233. package/dist/components/toggle-group/index.mjs +13 -5
  234. package/dist/components/toolbar/index.d.mts +3 -1
  235. package/dist/components/toolbar/index.mjs +3 -2
  236. package/dist/components/tooltip/index.d.mts +16 -1
  237. package/dist/components/tooltip/index.mjs +55 -2
  238. package/dist/components/tour/index.d.mts +16 -3
  239. package/dist/components/tour/index.mjs +74 -9
  240. package/dist/components/transfer/index.d.mts +3 -1
  241. package/dist/components/transfer/index.mjs +68 -54
  242. package/dist/components/tree-select/index.d.mts +3 -1
  243. package/dist/components/tree-select/index.mjs +45 -35
  244. package/dist/components/tree-view/index.d.mts +1 -1
  245. package/dist/components/tree-view/index.mjs +26 -5
  246. package/dist/components/user/index.d.mts +3 -1
  247. package/dist/components/user/index.mjs +8 -2
  248. package/dist/components/virtual-list/index.d.mts +3 -1
  249. package/dist/components/virtual-list/index.mjs +14 -9
  250. package/dist/components/watermark/index.d.mts +3 -1
  251. package/dist/components/watermark/index.mjs +4 -3
  252. package/dist/element-dGIhOTJ6.mjs +16 -0
  253. package/dist/family-Cmd8HEyK.mjs +11 -0
  254. package/dist/icon-DTqmJCd5.mjs +48 -0
  255. package/dist/id-2ygNzPHF.mjs +12 -0
  256. package/dist/image-viewer-B9A5lXsk.mjs +228 -0
  257. package/dist/{index-B1xiJ5ki.d.mts → index-B1-quIrl.d.mts} +6 -2
  258. package/dist/{index-DDX7x8aT.d.mts → index-DEArHiFI.d.mts} +16 -7
  259. package/dist/index-DhripUtf.d.mts +39 -0
  260. package/dist/{index-YPUiqD3n.d.mts → index-ID48LCMU.d.mts} +28 -2
  261. package/dist/{index-IfofF-SW.d.mts → index-nFXK_8hJ.d.mts} +53 -23
  262. package/dist/index-wW28BYf1.d.mts +124 -0
  263. package/dist/index.d.mts +22 -21
  264. package/dist/index.mjs +14 -13
  265. package/dist/{input-DoFQ7RXh.mjs → input-CPAJdwDb.mjs} +3 -2
  266. package/dist/media-player-BC8D_d29.mjs +796 -0
  267. package/dist/{mentions-f5Js_2W7.mjs → mentions-CeG5u8Qm.mjs} +67 -51
  268. package/dist/select-7YjMSBGx.mjs +292 -0
  269. package/dist/toc-DYKaKQ_X.mjs +31 -0
  270. package/dist/use-component-messages-C4SCVYjD.mjs +17 -0
  271. package/package.json +3 -3
  272. package/dist/chevron-D5RzcayK.mjs +0 -9
  273. package/dist/select-CHaXbzLX.mjs +0 -115
@@ -1,13 +1,22 @@
1
+ import { n as withSelfRoot } from "./family-Cmd8HEyK.mjs";
2
+ import { n as iconHtml } from "./icon-DTqmJCd5.mjs";
3
+ import { n as useComponentMessages } from "./use-component-messages-C4SCVYjD.mjs";
1
4
  import { injectComponentStyle } from "@bysages/core";
2
5
  import { ref, spread, template } from "@solidjs/web";
3
6
  import { createEffect, createMemo, onMount, splitProps } from "solid-js";
4
7
  import { renderHtml } from "@tanstack/markdown/html";
5
8
  //#region src/components/ai-response/code-copy.ts
6
- /** The two glyphs a copy affordance needs: the stamp and its
9
+ /** The two icons a copy affordance needs: the stamp and its
7
10
  * confirmation. Inline SVG keeps the enhancement framework-agnostic —
8
11
  * it lives beside the renderer's generated code HTML. */
9
- const COPY_CODE_ICON = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`;
10
- const COPIED_CODE_ICON = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>`;
12
+ const COPY_CODE_ICON = iconHtml("copy", {
13
+ width: "14",
14
+ height: "14"
15
+ });
16
+ const COPIED_CODE_ICON = iconHtml("check", {
17
+ width: "14",
18
+ height: "14"
19
+ });
11
20
  /** How long the confirmation stays before the stamp returns. */
12
21
  const REVERT_MS = 1500;
13
22
  /** Make sure every fenced block under `host` carries its copy stamp.
@@ -103,7 +112,7 @@ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
103
112
  /** Markdown set on the paper. Rendering goes through
104
113
  * `@tanstack/markdown`, whose defaults leave raw HTML and executable
105
114
  * links inert — streaming-safe by construction. */
106
- function Response(props) {
115
+ const Response = withSelfRoot(function Response(props) {
107
116
  injectComponentStyle("ai");
108
117
  const [own, rest] = splitProps(props, [
109
118
  "content",
@@ -111,15 +120,16 @@ function Response(props) {
111
120
  "copyLabel",
112
121
  "copiedLabel"
113
122
  ]);
123
+ const messages = useComponentMessages();
114
124
  const html = createMemo(() => renderHtml(own.content, own.highlighter ? { highlighter: own.highlighter } : void 0));
115
125
  let root;
116
126
  onMount(() => createEffect(() => {
117
127
  html();
118
- if (root) decorateCodeCopy(root, own.copyLabel ?? "Copy code");
128
+ if (root) decorateCodeCopy(root, own.copyLabel ?? messages().ai.copyCode);
119
129
  if (root) wrapResponseTables(root);
120
130
  }));
121
131
  const onClick = (event) => {
122
- clickCodeCopy(event, own.copyLabel ?? "Copy code", own.copiedLabel ?? "Copied");
132
+ clickCodeCopy(event, own.copyLabel ?? messages().ai.copyCode, own.copiedLabel ?? messages().ai.copied);
123
133
  };
124
134
  var _el$ = _tmpl$();
125
135
  ref(() => {
@@ -134,6 +144,6 @@ function Response(props) {
134
144
  }
135
145
  }], false);
136
146
  return _el$;
137
- }
147
+ });
138
148
  //#endregion
139
149
  export { Response as t };
@@ -0,0 +1,8 @@
1
+ import { r as iconNode } from "./icon-DTqmJCd5.mjs";
2
+ //#region src/components/ai/chevron.tsx
3
+ /** The folding chevron the shared indicator turns. */
4
+ function chevron() {
5
+ return iconNode("chevron-right");
6
+ }
7
+ //#endregion
8
+ export { chevron as t };
@@ -1,7 +1,27 @@
1
- import { Accordion as Accordion$1 } from "@ark-ui/solid/accordion";
1
+ import { Accordion as Accordion$1, AccordionRootProps } from "@ark-ui/solid/accordion";
2
2
  //#region src/components/accordion/index.d.ts
3
3
  /** Ark's Accordion, dressed in the paper-and-ink system: a ruled sheet
4
4
  * folded by quiet rows, unfolding with a spring-chevoned dissolve. The
5
5
  * API is Ark's own — Root, Item, ItemTrigger, ItemContent, ItemIndicator. */
6
- export declare const Accordion: typeof Accordion$1;
6
+ declare function AccordionRoot(props: AccordionRootProps): import("solid-js").JSX.Element;
7
+ export type AccordionItem = {
8
+ value: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export interface AccordionFacadeProps {
13
+ value?: string[];
14
+ defaultValue?: string[];
15
+ items: AccordionItem[];
16
+ multiple?: boolean;
17
+ collapsible?: boolean;
18
+ disabled?: boolean;
19
+ orientation?: "horizontal" | "vertical";
20
+ onValueChange?: (value: string[]) => void;
21
+ }
22
+ declare function AccordionFacade(props: AccordionFacadeProps): import("solid-js").JSX.Element;
23
+ type AccordionParts = Omit<typeof Accordion$1, "Root"> & {
24
+ Root: typeof AccordionRoot;
25
+ };
26
+ export declare const Accordion: typeof AccordionFacade & AccordionParts;
7
27
  //#endregion
@@ -1,10 +1,76 @@
1
+ import { t as defineFamily } from "../../family-Cmd8HEyK.mjs";
2
+ import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
3
+ import { t as useElementId } from "../../id-2ygNzPHF.mjs";
1
4
  import { injectComponentStyle } from "@bysages/core";
5
+ import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
2
6
  import { Accordion as Accordion$1 } from "@ark-ui/solid/accordion";
3
- //#region src/components/accordion/index.ts
7
+ import { For } from "solid-js";
8
+ //#region src/components/accordion/index.tsx
9
+ var _tmpl$ = /* @__PURE__ */ template(`<p>`);
4
10
  /** Ark's Accordion, dressed in the paper-and-ink system: a ruled sheet
5
11
  * folded by quiet rows, unfolding with a spring-chevoned dissolve. The
6
12
  * API is Ark's own — Root, Item, ItemTrigger, ItemContent, ItemIndicator. */
7
- const Accordion = Accordion$1;
13
+ function AccordionRoot(props) {
14
+ const id = useElementId("accordion", () => props.id);
15
+ return createComponent(Accordion$1.Root, mergeProps(props, { get id() {
16
+ return id();
17
+ } }));
18
+ }
19
+ function AccordionFacade(props) {
20
+ injectComponentStyle("accordion");
21
+ return createComponent(AccordionRoot, mergeProps({
22
+ get disabled() {
23
+ return props.disabled;
24
+ },
25
+ get multiple() {
26
+ return props.multiple;
27
+ },
28
+ get collapsible() {
29
+ return props.collapsible;
30
+ },
31
+ get orientation() {
32
+ return props.orientation ?? "vertical";
33
+ },
34
+ get defaultValue() {
35
+ return props.defaultValue;
36
+ }
37
+ }, () => {
38
+ return props.value === void 0 ? {} : { value: props.value };
39
+ }, {
40
+ onValueChange: (details) => props.onValueChange?.(details.value),
41
+ get children() {
42
+ return createComponent(For, {
43
+ get each() {
44
+ return props.items;
45
+ },
46
+ children: (item) => createComponent(Accordion$1.Item, {
47
+ get value() {
48
+ return item.value;
49
+ },
50
+ get children() {
51
+ return [createComponent(Accordion$1.ItemTrigger, { get children() {
52
+ return [memo(() => {
53
+ return item.title;
54
+ }), createComponent(Accordion$1.ItemIndicator, { get children() {
55
+ return iconNode("chevron-down");
56
+ } })];
57
+ } }), createComponent(Accordion$1.ItemContent, { get children() {
58
+ var _el$ = _tmpl$();
59
+ insert(_el$, () => {
60
+ return item.content;
61
+ });
62
+ return _el$;
63
+ } })];
64
+ }
65
+ })
66
+ });
67
+ }
68
+ }));
69
+ }
70
+ const Accordion = defineFamily(AccordionFacade, {
71
+ ...Accordion$1,
72
+ Root: AccordionRoot
73
+ });
8
74
  injectComponentStyle("accordion");
9
75
  //#endregion
10
76
  export { Accordion };
@@ -16,5 +16,7 @@ export interface AffixProps extends JSX.HTMLAttributes<HTMLDivElement> {
16
16
  * `overflow: hidden` clips the pin. Both offsets may be given: the
17
17
  * content then holds its place inside that band.
18
18
  */
19
- export declare function Affix(props: AffixProps): JSX.Element;
19
+ export declare const Affix: ((props: AffixProps) => JSX.Element) & {
20
+ Root: (props: AffixProps) => JSX.Element;
21
+ };
20
22
  //#endregion
@@ -1,3 +1,4 @@
1
+ import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { spread, template } from "@solidjs/web";
3
4
  import { splitProps } from "solid-js";
@@ -12,7 +13,7 @@ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
12
13
  * `overflow: hidden` clips the pin. Both offsets may be given: the
13
14
  * content then holds its place inside that band.
14
15
  */
15
- function Affix(props) {
16
+ const Affix = withSelfRoot(function Affix(props) {
16
17
  injectComponentStyle("affix");
17
18
  const [own, rest] = splitProps(props, ["offsetTop", "offsetBottom"]);
18
19
  var _el$ = _tmpl$();
@@ -20,14 +21,14 @@ function Affix(props) {
20
21
  get style() {
21
22
  return {
22
23
  ...rest.style,
23
- top: own.offsetTop ?? "0px",
24
- bottom: own.offsetBottom ?? "0px"
24
+ "--bs-affix-top": own.offsetTop ?? "0px",
25
+ "--bs-affix-bottom": own.offsetBottom ?? "0px"
25
26
  };
26
27
  },
27
28
  "data-scope": "affix",
28
29
  "data-part": "root"
29
30
  }], false);
30
31
  return _el$;
31
- }
32
+ });
32
33
  //#endregion
33
34
  export { Affix };
@@ -1,2 +1,2 @@
1
- import { a as AiLoader, c as ReasoningUIPart, d as StepStartUIPart, f as TextUIPart, h as UIMessagePart, i as AiConversation, l as SourceDocumentUIPart, m as UIMessage, n as AiActions, o as DataUIPart, p as ToolUIPart, r as AiContent, s as FileUIPart, t as Ai, u as SourceUrlUIPart } from "../../index-IfofF-SW.mjs";
1
+ import { a as AiLoader, c as ReasoningUIPart, d as StepStartUIPart, f as TextUIPart, h as UIMessagePart, i as AiConversation, l as SourceDocumentUIPart, m as UIMessage, n as AiActions, o as DataUIPart, p as ToolUIPart, r as AiContent, s as FileUIPart, t as Ai, u as SourceUrlUIPart } from "../../index-nFXK_8hJ.mjs";
2
2
  export { Ai, AiActions, AiContent, AiConversation, AiLoader, type DataUIPart, type FileUIPart, type ReasoningUIPart, type SourceDocumentUIPart, type SourceUrlUIPart, type StepStartUIPart, type TextUIPart, type ToolUIPart, type UIMessage, type UIMessagePart };
@@ -1,8 +1,10 @@
1
+ import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
1
2
  import { Action } from "../ai-action/index.mjs";
2
3
  import { AiMessage as Message } from "../ai-message/index.mjs";
4
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
3
5
  import { AiPromptInput as PromptInput } from "../ai-prompt-input/index.mjs";
4
6
  import { AiReasoning as Reasoning } from "../ai-reasoning/index.mjs";
5
- import { t as Response } from "../../ai-response-ClGGptX3.mjs";
7
+ import { t as Response } from "../../ai-response-D2uINBIi.mjs";
6
8
  import { AiSource as Source, AiSources as Sources } from "../ai-source/index.mjs";
7
9
  import { AiSuggestion as Suggestion } from "../ai-suggestion/index.mjs";
8
10
  import { AiTool as Tool } from "../ai-tool/index.mjs";
@@ -10,17 +12,13 @@ import { injectComponentStyle } from "@bysages/core";
10
12
  import { spread, template } from "@solidjs/web";
11
13
  //#region src/components/ai/index.tsx
12
14
  var _tmpl$ = /* @__PURE__ */ template(`<div>`);
13
- /** A conversation column: Root is the log, Message carries a role, and
14
- * the speaking parts — Response, Reasoning, Tool, Sources — part the
15
- * stream. The interactive folds are the shared Collapsible wearing a
16
- * `data-ai` marker, so the machine work is never ours. Parts stay
17
- * agnostic of any client; consumers map their message format (e.g. the
18
- * `UIMessage` parts re-exported here) onto these primitives. */
19
15
  function part(name, extra = {}) {
20
16
  function Component(props) {
17
+ const messages = useComponentMessages();
18
+ const partExtra = typeof extra === "function" ? extra(messages()) : extra;
21
19
  var _el$ = _tmpl$();
22
20
  spread(_el$, [
23
- extra,
21
+ partExtra,
24
22
  props,
25
23
  {
26
24
  "data-scope": "ai",
@@ -35,20 +33,20 @@ function part(name, extra = {}) {
35
33
  }
36
34
  /** The log itself: the column every stroke lands in, a landmark to
37
35
  * screen readers. */
38
- const AiConversation = part("Conversation", {
36
+ const AiConversation = part("Conversation", (messages) => ({
39
37
  role: "log",
40
- "aria-label": "Conversation"
41
- });
38
+ "aria-label": messages.ai.conversation
39
+ }));
42
40
  /** The bubble's inner measure — content that belongs to neither side
43
41
  * specifically. */
44
- const AiContent = part("Content");
42
+ const AiContent = withSelfRoot(part("Content"));
45
43
  /** The quiet row under a message — copy, retry, feedback. */
46
- const AiActions = part("Actions");
44
+ const AiActions = withSelfRoot(part("Actions"));
47
45
  /** The while-it-works whisper for the in-flight turns. */
48
- const AiLoader = part("Loader", {
46
+ const AiLoader = withSelfRoot(part("Loader", (messages) => ({
49
47
  role: "status",
50
- "aria-label": "Loading"
51
- });
48
+ "aria-label": messages.ai.loading
49
+ })));
52
50
  /** The whole family under one handle — `Ai.Conversation`,
53
51
  * `Ai.MessageContent`, and the rest. */
54
52
  const Ai = Object.assign(AiConversation, {
@@ -8,6 +8,8 @@ export interface ActionProps extends JSX.HTMLAttributes<HTMLButtonElement> {
8
8
  /** A quiet icon button — copy, retry, thumbs. The label names it to
9
9
  * assistive tech and as the hover title. The control itself is the
10
10
  * shared Button in its ghost register. */
11
- export declare function Action(props: ActionProps): JSX.Element;
11
+ export declare const Action: ((props: ActionProps) => JSX.Element) & {
12
+ Root: (props: ActionProps) => JSX.Element;
13
+ };
12
14
  //#endregion
13
15
  export { Action as AiAction };
@@ -1,3 +1,4 @@
1
+ import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
1
2
  import { Button } from "../button/index.mjs";
2
3
  import { injectComponentStyle } from "@bysages/core";
3
4
  import { createComponent, mergeProps } from "@solidjs/web";
@@ -6,7 +7,7 @@ import { splitProps } from "solid-js";
6
7
  /** A quiet icon button — copy, retry, thumbs. The label names it to
7
8
  * assistive tech and as the hover title. The control itself is the
8
9
  * shared Button in its ghost register. */
9
- function Action(props) {
10
+ const Action = withSelfRoot(function Action(props) {
10
11
  injectComponentStyle("ai");
11
12
  const [own, rest] = splitProps(props, ["label", "children"]);
12
13
  return createComponent(Button, mergeProps({
@@ -22,6 +23,6 @@ function Action(props) {
22
23
  }, rest, { get children() {
23
24
  return own.children;
24
25
  } }));
25
- }
26
+ });
26
27
  //#endregion
27
28
  export { Action, Action as AiAction };
@@ -2,7 +2,7 @@ import { JSX } from "solid-js";
2
2
  //#region src/components/ai-attachments/index.d.ts
3
3
  export type AttachmentStatus = "uploading" | "ready" | "error";
4
4
  export interface AttachmentProps extends JSX.HTMLAttributes<HTMLSpanElement> {
5
- /** The file's name — it picks the glyph by extension. */
5
+ /** The file's name — it picks the icon by extension. */
6
6
  name: string;
7
7
  /** The file's size in bytes, when known — rendered human. */
8
8
  size?: number;
@@ -10,11 +10,15 @@ export interface AttachmentProps extends JSX.HTMLAttributes<HTMLSpanElement> {
10
10
  status?: AttachmentStatus;
11
11
  onRemove?: () => void;
12
12
  }
13
- /** One file riding the prompt: its glyph by extension, its name and
13
+ /** One file riding the prompt: its icon by extension, its name and
14
14
  * human size, and a quiet way to take it back off. Uploading reads as
15
15
  * a dashed ghost, error as danger ink. */
16
- export declare function Attachment(props: AttachmentProps): JSX.Element;
16
+ export declare const Attachment: ((props: AttachmentProps) => JSX.Element) & {
17
+ Root: (props: AttachmentProps) => JSX.Element;
18
+ };
17
19
  /** The row the files ride in — a wrapping line of chips. */
18
- export declare function Attachments(props: JSX.HTMLAttributes<HTMLSpanElement>): JSX.Element;
20
+ export declare const Attachments: ((props: JSX.HTMLAttributes<HTMLSpanElement>) => JSX.Element) & {
21
+ Root: (props: JSX.HTMLAttributes<HTMLSpanElement>) => JSX.Element;
22
+ };
19
23
  //#endregion
20
24
  export { Attachment as AiAttachment, Attachments as AiAttachments };
@@ -1,20 +1,23 @@
1
+ import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
2
+ import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
3
+ import { n as useComponentMessages, t as formatComponentMessage } from "../../use-component-messages-C4SCVYjD.mjs";
1
4
  import { injectComponentStyle } from "@bysages/core";
2
5
  import { delegateEvents, effect, insert, memo, setAttribute, spread, template } from "@solidjs/web";
3
6
  import { splitProps } from "solid-js";
4
7
  //#region src/components/ai-attachments/index.tsx
5
- var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 16 16"aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><rect x=2.5 y=3.5 width=11 height=9></rect><path d="M2.5 10.5 6 7l3 3 2-1.5 2.5 2"></path><circle cx=6 cy=6 r=0.75 fill=currentColor stroke=none>`);
6
- var _tmpl$2 = /* @__PURE__ */ template(`<svg viewBox="0 0 16 16"aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M4 2.5h5l3 3V13.5H4z"></path><path d="M9 2.5v3h3">`);
7
- var _tmpl$3 = /* @__PURE__ */ template(`<svg viewBox="0 0 16 16"width=12 height=12 aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M4 4l8 8M12 4l-8 8">`);
8
- var _tmpl$4 = /* @__PURE__ */ template(`<span><span></span><button type=button data-remove>`);
9
- var _tmpl$5 = /* @__PURE__ */ template(`<span>`);
10
- function imageGlyph() {
11
- return _tmpl$();
8
+ var _tmpl$ = /* @__PURE__ */ template(`<span><span></span><button type=button data-remove>`);
9
+ var _tmpl$2 = /* @__PURE__ */ template(`<span>`);
10
+ function imageIcon() {
11
+ return iconNode("image");
12
12
  }
13
- function fileGlyph() {
14
- return _tmpl$2();
13
+ function fileIcon() {
14
+ return iconNode("file");
15
15
  }
16
- function removeGlyph() {
17
- return _tmpl$3();
16
+ function removeIcon() {
17
+ return iconNode("x", {
18
+ width: "12",
19
+ height: "12"
20
+ });
18
21
  }
19
22
  const IMAGE_EXTS = [
20
23
  "png",
@@ -43,10 +46,10 @@ const humanSize = (bytes) => {
43
46
  } while (value >= 1024 && unit < units.length - 1);
44
47
  return `${value.toFixed(1)} ${units[unit]}`;
45
48
  };
46
- /** One file riding the prompt: its glyph by extension, its name and
49
+ /** One file riding the prompt: its icon by extension, its name and
47
50
  * human size, and a quiet way to take it back off. Uploading reads as
48
51
  * a dashed ghost, error as danger ink. */
49
- function Attachment(props) {
52
+ const Attachment = withSelfRoot(function Attachment(props) {
50
53
  injectComponentStyle("ai");
51
54
  const [own, rest] = splitProps(props, [
52
55
  "name",
@@ -54,57 +57,58 @@ function Attachment(props) {
54
57
  "status",
55
58
  "onRemove"
56
59
  ]);
57
- var _el$4 = _tmpl$4();
58
- var _el$5 = _el$4.firstChild;
59
- var _el$6 = _el$5.nextSibling;
60
- spread(_el$4, [rest, {
60
+ const messages = useComponentMessages();
61
+ var _el$ = _tmpl$();
62
+ var _el$2 = _el$.firstChild;
63
+ var _el$3 = _el$2.nextSibling;
64
+ spread(_el$, [rest, {
61
65
  "data-scope": "ai",
62
66
  "data-part": "attachment",
63
67
  get "data-status"() {
64
68
  return own.status ?? "ready";
65
69
  }
66
70
  }], true);
67
- insert(_el$4, (() => {
71
+ insert(_el$, (() => {
68
72
  var _c$ = memo(() => {
69
73
  return !!isImage(own.name);
70
74
  });
71
75
  return () => {
72
- return _c$() ? imageGlyph() : fileGlyph();
76
+ return _c$() ? imageIcon() : fileIcon();
73
77
  };
74
- })(), _el$5);
75
- insert(_el$5, () => {
78
+ })(), _el$2);
79
+ insert(_el$2, () => {
76
80
  return own.name;
77
81
  });
78
- insert(_el$4, (() => {
82
+ insert(_el$, (() => {
79
83
  var _c$2 = memo(() => {
80
84
  return own.size !== void 0;
81
85
  });
82
86
  return () => {
83
87
  return _c$2() ? (() => {
84
- var _el$7 = _tmpl$5();
85
- insert(_el$7, () => {
88
+ var _el$4 = _tmpl$2();
89
+ insert(_el$4, () => {
86
90
  return humanSize(own.size);
87
91
  });
88
- return _el$7;
92
+ return _el$4;
89
93
  })() : null;
90
94
  };
91
- })(), _el$6);
92
- _el$6._$$click = () => own.onRemove?.();
93
- insert(_el$6, removeGlyph);
94
- effect(() => `Remove ${own.name}`, (_v$) => {
95
- setAttribute(_el$6, "aria-label", _v$);
95
+ })(), _el$3);
96
+ _el$3._$$click = () => own.onRemove?.();
97
+ insert(_el$3, removeIcon);
98
+ effect(() => formatComponentMessage(messages().ai.removeAttachment, { name: own.name }), (_v$) => {
99
+ setAttribute(_el$3, "aria-label", _v$);
96
100
  });
97
- return _el$4;
98
- }
101
+ return _el$;
102
+ });
99
103
  /** The row the files ride in — a wrapping line of chips. */
100
- function Attachments(props) {
101
- var _el$8 = _tmpl$5();
102
- spread(_el$8, [props, {
104
+ const Attachments = withSelfRoot(function Attachments(props) {
105
+ var _el$5 = _tmpl$2();
106
+ spread(_el$5, [props, {
103
107
  "data-scope": "ai",
104
108
  "data-part": "attachments"
105
109
  }], false);
106
- return _el$8;
107
- }
110
+ return _el$5;
111
+ });
108
112
  delegateEvents(["click"]);
109
113
  //#endregion
110
114
  export { Attachment as AiAttachment, Attachment, Attachments as AiAttachments, Attachments };
@@ -8,6 +8,8 @@ export interface MessageProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "rol
8
8
  }
9
9
  /** Whose stroke this is — the user's words sit in a recessed bubble,
10
10
  * the assistant speaks flat on the paper. */
11
- export declare function Message(props: MessageProps): JSX.Element;
11
+ export declare const Message: ((props: MessageProps) => JSX.Element) & {
12
+ Root: (props: MessageProps) => JSX.Element;
13
+ };
12
14
  //#endregion
13
15
  export { Message as AiMessage };
@@ -1,3 +1,4 @@
1
+ import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { spread, template } from "@solidjs/web";
3
4
  import { splitProps } from "solid-js";
@@ -5,7 +6,7 @@ import { splitProps } from "solid-js";
5
6
  var _tmpl$ = /* @__PURE__ */ template(`<article>`);
6
7
  /** Whose stroke this is — the user's words sit in a recessed bubble,
7
8
  * the assistant speaks flat on the paper. */
8
- function Message(props) {
9
+ const Message = withSelfRoot(function Message(props) {
9
10
  injectComponentStyle("ai");
10
11
  const [own, rest] = splitProps(props, ["role"]);
11
12
  var _el$ = _tmpl$();
@@ -17,6 +18,6 @@ function Message(props) {
17
18
  }
18
19
  }], false);
19
20
  return _el$;
20
- }
21
+ });
21
22
  //#endregion
22
23
  export { Message as AiMessage, Message };
@@ -40,6 +40,8 @@ export interface PromptInputProps extends Omit<JSX.HTMLAttributes<HTMLFormElemen
40
40
  * and take the text on `onSubmit`. Enter sends; Shift+Enter breaks the
41
41
  * line. While `busy` the seal becomes a stop seal and Enter holds its
42
42
  * breath. */
43
- export declare function PromptInput(props: PromptInputProps): JSX.Element;
43
+ export declare const PromptInput: ((props: PromptInputProps) => JSX.Element) & {
44
+ Root: (props: PromptInputProps) => JSX.Element;
45
+ };
44
46
  //#endregion
45
47
  export { PromptInput as AiPromptInput };