@bysages/svelte 0.2.3 → 0.3.1

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 (173) hide show
  1. package/README.md +16 -2
  2. package/dist/{ai-BOUoSSjw.mjs → AiLoader-BEiPYOfW.mjs} +13 -40
  3. package/dist/{FileUploadRoot-IVcTAZp-.mjs → FileUploadTrigger-BgAcpLXx.mjs} +39 -3
  4. package/dist/Input-CZhcEeFU.mjs +75 -0
  5. package/dist/JsonTreeViewTree-CqRP_PwV.mjs +71 -0
  6. package/dist/{spinner-EpUWE3Hu.mjs → Spinner-DGAzGJ_8.mjs} +7 -9
  7. package/dist/{StepsRoot-Dg_3-lRb.mjs → StepsRoot-C_FYfShw.mjs} +27 -1
  8. package/dist/{TabsRoot-BMMO3B77.mjs → TabsRoot-DXd41HqW.mjs} +5 -1
  9. package/dist/TocIndicator-DPnZxTJ2.mjs +30 -0
  10. package/dist/TreeViewRoot-RBynRAly.mjs +108 -0
  11. package/dist/{ai-attachments-Y0Tf6UFL.mjs → ai-attachments-C0YVIKUc.mjs} +6 -2
  12. package/dist/{ai-prompt-input-BmyKyadu.mjs → ai-prompt-input-vh89e9EX.mjs} +67 -50
  13. package/dist/{ai-response-D5IkRFMN.mjs → ai-response-BPQPjMlC.mjs} +7 -3
  14. package/dist/{autocomplete-D7ZZ7Xpb.mjs → autocomplete-Dhuhqp-6.mjs} +10 -7
  15. package/dist/{avatar-BHYqgq4d.mjs → avatar-LR0CZ1Iz.mjs} +5 -1
  16. package/dist/{banner-LEPWtGlY.mjs → banner-Bj3FFB-O.mjs} +7 -4
  17. package/dist/bento-BTvt7gsB.mjs +73 -0
  18. package/dist/block-ui-CxsMoEoa.mjs +50 -0
  19. package/dist/{breadcrumb-C01pAq93.mjs → breadcrumb-CtBjVdxv.mjs} +6 -3
  20. package/dist/browser-gmPTH6mJ.mjs +146 -0
  21. package/dist/{calendar-0tSnHuLj.mjs → calendar-BMXmRdwJ.mjs} +1 -1
  22. package/dist/{cascade-select-C-eBcN_4.mjs → cascade-select-CfvWchiN.mjs} +32 -18
  23. package/dist/{command-fZuTfbz4.mjs → command-CZRC1T-6.mjs} +14 -8
  24. package/dist/components/ai/index.d.mts +3 -2
  25. package/dist/components/ai/index.mjs +27 -2
  26. package/dist/components/ai-action/index.d.mts +1 -1
  27. package/dist/components/ai-action/index.mjs +1 -1
  28. package/dist/components/ai-attachments/index.mjs +1 -1
  29. package/dist/components/ai-message/index.d.mts +1 -1
  30. package/dist/components/ai-message/index.mjs +1 -1
  31. package/dist/components/ai-prompt-input/index.d.mts +1 -1
  32. package/dist/components/ai-prompt-input/index.mjs +2 -2
  33. package/dist/components/ai-reasoning/index.d.mts +1 -1
  34. package/dist/components/ai-reasoning/index.mjs +1 -1
  35. package/dist/components/ai-response/index.d.mts +1 -1
  36. package/dist/components/ai-response/index.mjs +2 -2
  37. package/dist/components/ai-source/index.d.mts +1 -1
  38. package/dist/components/ai-source/index.mjs +1 -1
  39. package/dist/components/ai-suggestion/index.d.mts +1 -1
  40. package/dist/components/ai-suggestion/index.mjs +1 -1
  41. package/dist/components/ai-tool/index.d.mts +1 -1
  42. package/dist/components/ai-tool/index.mjs +1 -1
  43. package/dist/components/autocomplete/index.mjs +1 -1
  44. package/dist/components/avatar/index.d.mts +1 -1
  45. package/dist/components/avatar/index.mjs +1 -1
  46. package/dist/components/banner/index.mjs +1 -1
  47. package/dist/components/bento/index.d.mts +2 -0
  48. package/dist/components/bento/index.mjs +2 -0
  49. package/dist/components/block-ui/index.d.mts +2 -0
  50. package/dist/components/block-ui/index.mjs +2 -0
  51. package/dist/components/breadcrumb/index.mjs +1 -1
  52. package/dist/components/browser/index.d.mts +9 -0
  53. package/dist/components/browser/index.mjs +2 -0
  54. package/dist/components/calendar/index.mjs +1 -1
  55. package/dist/components/cascade-select/index.mjs +1 -1
  56. package/dist/components/command/index.mjs +1 -1
  57. package/dist/components/config-provider/index.d.mts +1 -1
  58. package/dist/components/config-provider/index.mjs +2 -1
  59. package/dist/components/data-view/index.d.mts +2 -0
  60. package/dist/components/data-view/index.mjs +2 -0
  61. package/dist/components/deferred-content/index.d.mts +2 -0
  62. package/dist/components/deferred-content/index.mjs +2 -0
  63. package/dist/components/descriptions/index.d.mts +1 -1
  64. package/dist/components/descriptions/index.mjs +1 -1
  65. package/dist/components/dock/index.d.mts +2 -0
  66. package/dist/components/dock/index.mjs +2 -0
  67. package/dist/components/dynamic-input/index.mjs +1 -1
  68. package/dist/components/file-upload/index.d.mts +3 -2
  69. package/dist/components/file-upload/index.mjs +3 -2
  70. package/dist/components/float-button/index.mjs +1 -1
  71. package/dist/components/form/index.d.mts +2 -2
  72. package/dist/components/form/index.mjs +2 -2
  73. package/dist/components/icon/index.d.mts +1 -1
  74. package/dist/components/icon/index.mjs +1 -1
  75. package/dist/components/image/index.d.mts +1 -1
  76. package/dist/components/image/index.mjs +1 -1
  77. package/dist/components/image-viewer/index.d.mts +1 -1
  78. package/dist/components/image-viewer/index.mjs +1 -1
  79. package/dist/components/input/index.d.mts +1 -1
  80. package/dist/components/input/index.mjs +1 -1
  81. package/dist/components/json-tree-view/index.d.mts +4 -4
  82. package/dist/components/json-tree-view/index.mjs +5 -1
  83. package/dist/components/layout/index.mjs +1 -1
  84. package/dist/components/list/index.mjs +1 -1
  85. package/dist/components/menubar/index.mjs +1 -1
  86. package/dist/components/order-list/index.d.mts +2 -0
  87. package/dist/components/order-list/index.mjs +2 -0
  88. package/dist/components/result/index.d.mts +12 -0
  89. package/dist/components/result/index.mjs +2 -0
  90. package/dist/components/select/index.d.mts +2 -7
  91. package/dist/components/select/index.mjs +2 -14
  92. package/dist/components/spinner/index.mjs +6 -1
  93. package/dist/components/split-button/index.mjs +1 -1
  94. package/dist/components/spotlight/index.d.mts +2 -0
  95. package/dist/components/spotlight/index.mjs +2 -0
  96. package/dist/components/steps/index.d.mts +3 -2
  97. package/dist/components/steps/index.mjs +3 -2
  98. package/dist/components/table/index.mjs +1 -1
  99. package/dist/components/tabs/index.d.mts +1 -1
  100. package/dist/components/tabs/index.mjs +1 -1
  101. package/dist/components/terminal/index.d.mts +2 -0
  102. package/dist/components/terminal/index.mjs +2 -0
  103. package/dist/components/timeline/index.d.mts +1 -1
  104. package/dist/components/timeline/index.mjs +1 -1
  105. package/dist/components/toc/index.d.mts +4 -1
  106. package/dist/components/toc/index.mjs +5 -1
  107. package/dist/components/toolbar/index.d.mts +2 -0
  108. package/dist/components/toolbar/index.mjs +2 -0
  109. package/dist/components/transfer/index.mjs +1 -1
  110. package/dist/components/tree-select/index.mjs +1 -1
  111. package/dist/components/tree-view/index.d.mts +1 -1
  112. package/dist/components/tree-view/index.mjs +4 -2
  113. package/dist/components/user/index.d.mts +2 -0
  114. package/dist/components/user/index.mjs +2 -0
  115. package/dist/components/virtual-list/index.d.mts +2 -0
  116. package/dist/components/virtual-list/index.mjs +2 -0
  117. package/dist/{config-provider-DW5wVzFr.mjs → config-provider-CZJyd3MX.mjs} +6 -14
  118. package/dist/context-Da-QMQRq.mjs +14 -0
  119. package/dist/data-view-BORK23XZ.mjs +179 -0
  120. package/dist/deferred-content-CO9YsKMQ.mjs +65 -0
  121. package/dist/{descriptions-Cv3x5qLW.mjs → descriptions-DgkA_9B-.mjs} +14 -8
  122. package/dist/dock-CKGRnXWu.mjs +84 -0
  123. package/dist/{dynamic-input-B3IBAoLs.mjs → dynamic-input-D1a-5vy-.mjs} +6 -1
  124. package/dist/{float-button-CZAda2SI.mjs → float-button-BLIHnw2u.mjs} +3 -1
  125. package/dist/{form-De-ZwM1P.mjs → form-BTL9S1gn.mjs} +4 -4
  126. package/dist/{icon-B6_cYYzO.mjs → icon-D7AeDq0M.mjs} +7 -6
  127. package/dist/{image-1Lgj8xhS.mjs → image-u_H4LtAC.mjs} +4 -0
  128. package/dist/{image-viewer-Dv3_Iyu8.mjs → image-viewer-DzoEcVSn.mjs} +20 -4
  129. package/dist/index-0k-VxNRm.d.mts +15 -0
  130. package/dist/{index-NJ21Q4f4.d.mts → index-BEfqqxjl.d.mts} +11 -1
  131. package/dist/{index-D6PrX-hf.d.mts → index-BJvo4qep.d.mts} +4 -2
  132. package/dist/{index-DTAcdUAd.d.mts → index-BkGvErBJ.d.mts} +5 -1
  133. package/dist/index-BmFfkztS.d.mts +14 -0
  134. package/dist/{index-BgLAlGbg.d.mts → index-BoR_54C_.d.mts} +3 -0
  135. package/dist/index-BolxaoaW.d.mts +18 -0
  136. package/dist/index-CAb_-2Bn.d.mts +21 -0
  137. package/dist/{index-Cd5VU1DI.d.mts → index-CV1LSzq5.d.mts} +3 -0
  138. package/dist/index-CmskeLd_.d.mts +23 -0
  139. package/dist/index-CnrohEXe.d.mts +24 -0
  140. package/dist/{index-BjVEomHj.d.mts → index-CtbGSRNw.d.mts} +719 -3781
  141. package/dist/{index-Nt0a2iYy.d.mts → index-D1U7Svy2.d.mts} +2 -2
  142. package/dist/{index-DAesWvpj.d.mts → index-D1tQgtT0.d.mts} +4 -0
  143. package/dist/index-D6eYSdmD.d.mts +28 -0
  144. package/dist/index-D9UBDdoA.d.mts +17 -0
  145. package/dist/index-DBbjFiDd.d.mts +20 -0
  146. package/dist/{index-CiHanb4T.d.mts → index-DG4OAuIf.d.mts} +4 -0
  147. package/dist/index-DGOBhwXN.d.mts +18 -0
  148. package/dist/{index-DrXCIscJ.d.mts → index-DjaHpB21.d.mts} +3 -0
  149. package/dist/index-KoqiUxmN.d.mts +20 -0
  150. package/dist/{index-BnvnT-GQ.d.mts → index-_kQsvJKo.d.mts} +6 -2
  151. package/dist/index-mshFOd-j.d.mts +20 -0
  152. package/dist/index.d.mts +28 -14
  153. package/dist/index.mjs +45 -30
  154. package/dist/{layout-WRo4P9-_.mjs → layout-GfxGYYhg.mjs} +7 -4
  155. package/dist/{list-B23lA_sc.mjs → list-BgEM9H3z.mjs} +2 -1
  156. package/dist/{menubar-Crrkg2tZ.mjs → menubar-2MPo9w5z.mjs} +1 -0
  157. package/dist/messages-DNzA55pH.mjs +17 -0
  158. package/dist/order-list-D3EhH7EX.mjs +129 -0
  159. package/dist/result-4Oee2ndu.mjs +159 -0
  160. package/dist/select-8ume4i2e.mjs +99 -0
  161. package/dist/{split-button-CGjPB9DQ.mjs → split-button-DnmVc_J0.mjs} +5 -3
  162. package/dist/spotlight-DMC5E1eS.mjs +51 -0
  163. package/dist/{table-C0AcH5Dw.mjs → table-BsdqRuvj.mjs} +63 -44
  164. package/dist/terminal-Dgw5JEz4.mjs +80 -0
  165. package/dist/{timeline-BV4eahUx.mjs → timeline-1yPOTbtY.mjs} +4 -2
  166. package/dist/toolbar-SNwuRrJr.mjs +68 -0
  167. package/dist/{transfer-0IAuhFCe.mjs → transfer-C0FLA8W1.mjs} +16 -5
  168. package/dist/{tree-select-aHymj8Zu.mjs → tree-select-CSYSYZDN.mjs} +72 -71
  169. package/dist/user-BjJSjDYV.mjs +100 -0
  170. package/dist/virtual-list-_10ypBUP.mjs +60 -0
  171. package/package.json +28 -7
  172. package/dist/Input-Biz4J1B6.mjs +0 -39
  173. package/dist/TreeViewRoot-ConQj9TX.mjs +0 -37
package/README.md CHANGED
@@ -4,11 +4,11 @@
4
4
  ![npm downloads](https://img.shields.io/npm/dw/@bysages/svelte)
5
5
  ![npm license](https://img.shields.io/npm/l/@bysages/svelte)
6
6
 
7
- > By Sages Elements for Svelte — 90+ accessible component families, headless by construction, dressed by the paper-and-ink style layer.
7
+ > By Sages Elements for Svelte — 140+ accessible component families, headless by construction, dressed by the paper-and-ink style layer.
8
8
 
9
9
  ## Features
10
10
 
11
- - 🧩 **90+ families** — actions, forms, overlays, navigation, data, layout, and an AI conversation family on ai-sdk formats
11
+ - 🧩 **140+ families** — actions, forms, overlays, navigation, data, layout, an AI conversation family on ai-sdk formats, and a full generative vocabulary
12
12
  - 🏛️ **Headless inside** — interaction, state, ARIA, and positioning come from proven headless state machines; wrappers add API narrowing and style injection, no DOM of their own
13
13
  - 🎨 **Token-styled** — every visual value is a CSS custom property from `@bysages/core`; light/dark, accent pigments, contrast and density tiers are data, never hardcoded styles
14
14
  - 📦 **Container-driven** — components respond to `@container`, not the viewport; the same component composes in a sidebar, a card, or a page
@@ -65,6 +65,20 @@ mount(App, { target: document.getElementById("app")! });
65
65
  </Dialog.Root>
66
66
  ```
67
67
 
68
+ ## Generative UI
69
+
70
+ Every family carries a generative face — a zod-typed catalog entry that
71
+ lives beside the component. The faces compose into a
72
+ [json-render](https://json-render.dev) catalog and render through the
73
+ same package:
74
+
75
+ ```ts
76
+ import { catalog } from "@bysages/svelte/generative";
77
+ ```
78
+
79
+ Point an AI SDK stream at the renderer and a prompt becomes real,
80
+ on-brand components — constrained to the families you registered.
81
+
68
82
  ## Documentation
69
83
 
70
84
  The [documentation site](https://elements.bysages.com) carries every family with live demos and props tables.
@@ -1,11 +1,4 @@
1
- import { t as AiAction } from "./ai-action-DKsvxilp.mjs";
2
- import { t as AiMessage } from "./ai-message-DBs1fdFm.mjs";
3
- import { t as AiPromptInput } from "./ai-prompt-input-BmyKyadu.mjs";
4
- import { t as AiReasoning } from "./ai-reasoning-C4YsB2hQ.mjs";
5
- import { t as AiResponse } from "./ai-response-D5IkRFMN.mjs";
6
- import { n as AiSources, t as AiSource } from "./ai-source-CvglcFw1.mjs";
7
- import { t as AiSuggestion } from "./ai-suggestion-zGAQ1kkf.mjs";
8
- import { t as AiTool } from "./ai-tool-DY_iNbMk.mjs";
1
+ import { n as useComponentMessages } from "./messages-DNzA55pH.mjs";
9
2
  import { injectComponentStyle } from "@bysages/core";
10
3
  import "svelte/internal/disclose-version";
11
4
  import * as $ from "svelte/internal/client";
@@ -14,21 +7,23 @@ var rest_excludes$3 = /* @__PURE__ */ new Set([
14
7
  "$$slots",
15
8
  "$$events",
16
9
  "$$legacy",
10
+ "aria-label",
17
11
  "children"
18
12
  ]);
19
13
  var root$3 = $.from_html(`<div><!></div>`);
20
- function Ai$1($$anchor, $$props) {
14
+ function Ai($$anchor, $$props) {
21
15
  $.push($$props, true);
22
16
  injectComponentStyle("ai");
23
17
  let rest = $.rest_props($$props, rest_excludes$3);
18
+ const messages = useComponentMessages();
24
19
  var div = root$3();
25
- $.attribute_effect(div, () => ({
20
+ $.attribute_effect(div, ($0) => ({
26
21
  ...rest,
27
22
  role: "log",
28
- "aria-label": "Conversation",
23
+ "aria-label": $0,
29
24
  "data-scope": "ai",
30
25
  "data-part": "conversation"
31
- }));
26
+ }), [() => $$props["aria-label"] ?? messages().ai.conversation]);
32
27
  var node = $.child(div);
33
28
  $.snippet(node, () => $$props.children ?? $.noop);
34
29
  $.reset(div);
@@ -91,6 +86,7 @@ var rest_excludes = /* @__PURE__ */ new Set([
91
86
  "$$slots",
92
87
  "$$events",
93
88
  "$$legacy",
89
+ "aria-label",
94
90
  "children"
95
91
  ]);
96
92
  var root = $.from_html(`<span><!></span>`);
@@ -98,14 +94,15 @@ function AiLoader($$anchor, $$props) {
98
94
  $.push($$props, true);
99
95
  injectComponentStyle("ai");
100
96
  let rest = $.rest_props($$props, rest_excludes);
97
+ const messages = useComponentMessages();
101
98
  var span = root();
102
- $.attribute_effect(span, () => ({
99
+ $.attribute_effect(span, ($0) => ({
103
100
  ...rest,
104
101
  role: "status",
105
- "aria-label": "Loading",
102
+ "aria-label": $0,
106
103
  "data-scope": "ai",
107
104
  "data-part": "loader"
108
- }));
105
+ }), [() => $$props["aria-label"] ?? messages().ai.loading]);
109
106
  var node = $.child(span);
110
107
  $.snippet(node, () => $$props.children ?? $.noop);
111
108
  $.reset(span);
@@ -113,28 +110,4 @@ function AiLoader($$anchor, $$props) {
113
110
  $.pop();
114
111
  }
115
112
  //#endregion
116
- //#region src/components/ai/index.ts
117
- /** A conversation column: Root is the log, Message carries a role, and
118
- * the speaking parts — Response, Reasoning, Tool, Sources — part the
119
- * stream. The interactive folds are the shared Collapsible wearing a
120
- * `data-ai` marker, the prompt vessel the shared Field, so the machine
121
- * work is never ours. Parts stay agnostic of any client; consumers map
122
- * their message format (e.g. the `UIMessage` parts re-exported below)
123
- * onto these primitives. */
124
- const Ai = Object.assign(Ai$1, {
125
- Conversation: Ai$1,
126
- Content: AiContent,
127
- Message: AiMessage,
128
- Response: AiResponse,
129
- Reasoning: AiReasoning,
130
- Tool: AiTool,
131
- Sources: AiSources,
132
- Source: AiSource,
133
- Actions: AiActions,
134
- Action: AiAction,
135
- Suggestion: AiSuggestion,
136
- PromptInput: AiPromptInput,
137
- Loader: AiLoader
138
- });
139
- //#endregion
140
- export { Ai as t };
113
+ export { Ai as i, AiContent as n, AiActions as r, AiLoader as t };
@@ -3,7 +3,7 @@ import "svelte/internal/disclose-version";
3
3
  import * as $ from "svelte/internal/client";
4
4
  import { FileUpload } from "@ark-ui/svelte/file-upload";
5
5
  //#region src/components/file-upload/FileUploadRoot.svelte
6
- var rest_excludes = /* @__PURE__ */ new Set([
6
+ var rest_excludes$1 = /* @__PURE__ */ new Set([
7
7
  "$$slots",
8
8
  "$$events",
9
9
  "$$legacy",
@@ -13,7 +13,7 @@ var rest_excludes = /* @__PURE__ */ new Set([
13
13
  function FileUploadRoot($$anchor, $$props) {
14
14
  $.push($$props, true);
15
15
  injectComponentStyle("file-upload");
16
- let size = $.prop($$props, "size", 3, "md"), rest = $.rest_props($$props, rest_excludes);
16
+ let size = $.prop($$props, "size", 3, "md"), rest = $.rest_props($$props, rest_excludes$1);
17
17
  var fragment = $.comment();
18
18
  var node = $.first_child(fragment);
19
19
  $.component(node, () => FileUpload.Root, ($$anchor, ArkFileUpload_Root) => {
@@ -34,4 +34,40 @@ function FileUploadRoot($$anchor, $$props) {
34
34
  $.pop();
35
35
  }
36
36
  //#endregion
37
- export { FileUploadRoot as t };
37
+ //#region src/components/file-upload/FileUploadTrigger.svelte
38
+ var rest_excludes = /* @__PURE__ */ new Set([
39
+ "$$slots",
40
+ "$$events",
41
+ "$$legacy",
42
+ "children"
43
+ ]);
44
+ var root = $.from_html(`<span><!></span>`);
45
+ function FileUploadTrigger($$anchor, $$props) {
46
+ let rest = $.rest_props($$props, rest_excludes);
47
+ var fragment = $.comment();
48
+ var node = $.first_child(fragment);
49
+ {
50
+ const asChild = ($$anchor, triggerProps = $.noop) => {
51
+ var span = root();
52
+ $.attribute_effect(span, ($0) => ({
53
+ ...$0,
54
+ "data-scope": "file-upload",
55
+ "data-part": "trigger",
56
+ "aria-hidden": "true"
57
+ }), [() => triggerProps()()]);
58
+ var node_1 = $.child(span);
59
+ $.snippet(node_1, () => $$props.children ?? $.noop);
60
+ $.reset(span);
61
+ $.append($$anchor, span);
62
+ };
63
+ $.component(node, () => FileUpload.Trigger, ($$anchor, ArkFileUpload_Trigger) => {
64
+ ArkFileUpload_Trigger($$anchor, $.spread_props(() => rest, {
65
+ asChild,
66
+ $$slots: { asChild: true }
67
+ }));
68
+ });
69
+ }
70
+ $.append($$anchor, fragment);
71
+ }
72
+ //#endregion
73
+ export { FileUploadRoot as n, FileUploadTrigger as t };
@@ -0,0 +1,75 @@
1
+ import { injectComponentStyle } from "@bysages/core";
2
+ import "svelte/internal/disclose-version";
3
+ import * as $ from "svelte/internal/client";
4
+ import { useFieldContext } from "@ark-ui/svelte/field";
5
+ //#region src/components/input/mask.ts
6
+ function accepts(slot, ch) {
7
+ if (slot === "9") return /\d/.test(ch);
8
+ if (slot === "a") return /[a-zA-Z]/.test(ch);
9
+ return /[\da-zA-Z]/.test(ch);
10
+ }
11
+ /** Apply the entry mask: `9` takes a digit, `a` a letter, `*` either;
12
+ * every other character is literal. A literal already typed is consumed,
13
+ * not duplicated; a literal met out of place holds the walk and lets its
14
+ * own slot claim it — so deleting through the middle reflows the shape
15
+ * instead of corrupting it. */
16
+ function applyMask(raw, mask) {
17
+ const literals = new Set(mask.split("").filter((s) => s !== "9" && s !== "a" && s !== "*"));
18
+ let out = "";
19
+ let at = 0;
20
+ slots: for (const slot of mask) {
21
+ if (at >= raw.length) break;
22
+ if (slot === "9" || slot === "a" || slot === "*") {
23
+ let ch = raw[at];
24
+ while (ch !== void 0 && !accepts(slot, ch)) {
25
+ if (literals.has(ch)) continue slots;
26
+ at += 1;
27
+ ch = raw[at];
28
+ }
29
+ if (ch === void 0) break;
30
+ out += ch;
31
+ at += 1;
32
+ } else if (raw[at] === slot) {
33
+ at += 1;
34
+ out += slot;
35
+ } else out += slot;
36
+ }
37
+ return out;
38
+ }
39
+ //#endregion
40
+ //#region src/components/input/Input.svelte
41
+ var rest_excludes = /* @__PURE__ */ new Set([
42
+ "$$slots",
43
+ "$$events",
44
+ "$$legacy",
45
+ "value",
46
+ "size",
47
+ "invalid",
48
+ "mask"
49
+ ]);
50
+ var root = $.from_html(`<input/>`);
51
+ function Input($$anchor, $$props) {
52
+ $.push($$props, true);
53
+ injectComponentStyle("input");
54
+ let value = $.prop($$props, "value", 15), size = $.prop($$props, "size", 3, "md"), invalid = $.prop($$props, "invalid", 3, false), rest = $.rest_props($$props, rest_excludes);
55
+ const field = useFieldContext();
56
+ const fieldProps = $.derived(() => field?.()?.getInputProps() ?? {});
57
+ var input = root();
58
+ var event_handler = (event) => {
59
+ value($$props.mask ? applyMask(event.currentTarget.value, $$props.mask) : event.currentTarget.value);
60
+ };
61
+ $.attribute_effect(input, () => ({
62
+ ...$.get(fieldProps),
63
+ ...rest,
64
+ "data-scope": "input",
65
+ "data-part": "root",
66
+ "data-size": size(),
67
+ "data-invalid": invalid() || $.get(fieldProps)["data-invalid"] != null ? "" : void 0,
68
+ oninput: event_handler
69
+ }), void 0, void 0, void 0, void 0, true);
70
+ $.bind_value(input, value);
71
+ $.append($$anchor, input);
72
+ $.pop();
73
+ }
74
+ //#endregion
75
+ export { Input as t };
@@ -0,0 +1,71 @@
1
+ import "svelte/internal/disclose-version";
2
+ import * as $ from "svelte/internal/client";
3
+ import { JsonTreeView } from "@ark-ui/svelte/json-tree-view";
4
+ import { chevron_right } from "@bysages/icons";
5
+ //#region src/components/json-tree-view/JsonTreeViewTree.svelte
6
+ const defaultArrow = ($$anchor) => {
7
+ var svg = root();
8
+ $.html(svg, () => chevron_right.body, true);
9
+ $.reset(svg);
10
+ $.template_effect(() => $.set_attribute(svg, "viewBox", `0 0 ${chevron_right.width ?? ""} ${chevron_right.height ?? ""}`));
11
+ $.append($$anchor, svg);
12
+ };
13
+ var rest_excludes = /* @__PURE__ */ new Set([
14
+ "$$slots",
15
+ "$$events",
16
+ "$$legacy",
17
+ "arrow",
18
+ "indentGuide",
19
+ "renderValue"
20
+ ]);
21
+ var root = $.from_svg(`<svg aria-hidden="true"></svg>`);
22
+ function JsonTreeViewTree($$anchor, $$props) {
23
+ $.push($$props, true);
24
+ let rest = $.rest_props($$props, rest_excludes);
25
+ var fragment = $.comment();
26
+ var node = $.first_child(fragment);
27
+ var consequent = ($$anchor) => {
28
+ var fragment_1 = $.comment();
29
+ var node_1 = $.first_child(fragment_1);
30
+ $.component(node_1, () => JsonTreeView.Tree, ($$anchor, ArkJsonTreeView_Tree) => {
31
+ ArkJsonTreeView_Tree($$anchor, $.spread_props(() => rest, {
32
+ get arrow() {
33
+ return $$props.arrow;
34
+ },
35
+ get indentGuide() {
36
+ return $$props.indentGuide;
37
+ },
38
+ get renderValue() {
39
+ return $$props.renderValue;
40
+ }
41
+ }));
42
+ });
43
+ $.append($$anchor, fragment_1);
44
+ };
45
+ var alternate = ($$anchor) => {
46
+ var fragment_2 = $.comment();
47
+ var node_2 = $.first_child(fragment_2);
48
+ $.component(node_2, () => JsonTreeView.Tree, ($$anchor, ArkJsonTreeView_Tree_1) => {
49
+ ArkJsonTreeView_Tree_1($$anchor, $.spread_props(() => rest, {
50
+ get indentGuide() {
51
+ return $$props.indentGuide;
52
+ },
53
+ get renderValue() {
54
+ return $$props.renderValue;
55
+ },
56
+ get arrow() {
57
+ return defaultArrow;
58
+ }
59
+ }));
60
+ });
61
+ $.append($$anchor, fragment_2);
62
+ };
63
+ $.if(node, ($$render) => {
64
+ if ($$props.arrow) $$render(consequent);
65
+ else $$render(alternate, -1);
66
+ });
67
+ $.append($$anchor, fragment);
68
+ $.pop();
69
+ }
70
+ //#endregion
71
+ export { JsonTreeViewTree as t };
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages } from "./messages-DNzA55pH.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import "svelte/internal/disclose-version";
3
4
  import * as $ from "svelte/internal/client";
@@ -7,22 +8,24 @@ var rest_excludes = /* @__PURE__ */ new Set([
7
8
  "$$events",
8
9
  "$$legacy",
9
10
  "size",
11
+ "aria-label",
10
12
  "children"
11
13
  ]);
12
14
  var root = $.from_html(`<span><svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="9" stroke="currentColor" stroke-opacity="0.2" stroke-width="2.5"></circle><path d="M21 12a9 9 0 0 0-9-9" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"></path></svg> <!></span>`);
13
- function Spinner$1($$anchor, $$props) {
15
+ function Spinner($$anchor, $$props) {
14
16
  $.push($$props, true);
15
17
  injectComponentStyle("spinner");
16
18
  let size = $.prop($$props, "size", 3, "md"), rest = $.rest_props($$props, rest_excludes);
19
+ const messages = useComponentMessages();
17
20
  var span = root();
18
- $.attribute_effect(span, () => ({
21
+ $.attribute_effect(span, ($0) => ({
19
22
  ...rest,
20
23
  role: "status",
21
- "aria-label": rest["aria-label"] ?? "Loading",
24
+ "aria-label": $0,
22
25
  "data-scope": "spinner",
23
26
  "data-part": "root",
24
27
  "data-size": size()
25
- }));
28
+ }), [() => $$props["aria-label"] ?? messages().spinner.loading]);
26
29
  var node = $.sibling($.child(span), 2);
27
30
  $.snippet(node, () => $$props.children ?? $.noop);
28
31
  $.reset(span);
@@ -30,9 +33,4 @@ function Spinner$1($$anchor, $$props) {
30
33
  $.pop();
31
34
  }
32
35
  //#endregion
33
- //#region src/components/spinner/index.ts
34
- /** A wheel of waiting: one arc of ink turning about its center. Quiet by
35
- * default — it reports progress without claiming attention. */
36
- const Spinner = Spinner$1;
37
- //#endregion
38
36
  export { Spinner as t };
@@ -2,6 +2,32 @@ import { injectComponentStyle } from "@bysages/core";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as $ from "svelte/internal/client";
4
4
  import { Steps } from "@ark-ui/svelte/steps";
5
+ //#region src/components/steps/StepsItem.svelte
6
+ var rest_excludes$1 = /* @__PURE__ */ new Set([
7
+ "$$slots",
8
+ "$$events",
9
+ "$$legacy",
10
+ "children"
11
+ ]);
12
+ function StepsItem($$anchor, $$props) {
13
+ let rest = $.rest_props($$props, rest_excludes$1);
14
+ var fragment = $.comment();
15
+ var node = $.first_child(fragment);
16
+ $.component(node, () => Steps.Item, ($$anchor, ArkSteps_Item) => {
17
+ ArkSteps_Item($$anchor, $.spread_props(() => rest, {
18
+ role: "presentation",
19
+ children: ($$anchor, $$slotProps) => {
20
+ var fragment_1 = $.comment();
21
+ var node_1 = $.first_child(fragment_1);
22
+ $.snippet(node_1, () => $$props.children ?? $.noop);
23
+ $.append($$anchor, fragment_1);
24
+ },
25
+ $$slots: { default: true }
26
+ }));
27
+ });
28
+ $.append($$anchor, fragment);
29
+ }
30
+ //#endregion
5
31
  //#region src/components/steps/StepsRoot.svelte
6
32
  var rest_excludes = /* @__PURE__ */ new Set([
7
33
  "$$slots",
@@ -34,4 +60,4 @@ function StepsRoot($$anchor, $$props) {
34
60
  $.pop();
35
61
  }
36
62
  //#endregion
37
- export { StepsRoot as t };
63
+ export { StepsItem as n, StepsRoot as t };
@@ -8,12 +8,13 @@ var rest_excludes = /* @__PURE__ */ new Set([
8
8
  "$$events",
9
9
  "$$legacy",
10
10
  "size",
11
+ "variant",
11
12
  "children"
12
13
  ]);
13
14
  function TabsRoot($$anchor, $$props) {
14
15
  $.push($$props, true);
15
16
  injectComponentStyle("tabs");
16
- let size = $.prop($$props, "size", 3, "md"), rest = $.rest_props($$props, rest_excludes);
17
+ let size = $.prop($$props, "size", 3, "md"), variant = $.prop($$props, "variant", 3, "line"), rest = $.rest_props($$props, rest_excludes);
17
18
  var fragment = $.comment();
18
19
  var node = $.first_child(fragment);
19
20
  $.component(node, () => Tabs.Root, ($$anchor, ArkTabs_Root) => {
@@ -21,6 +22,9 @@ function TabsRoot($$anchor, $$props) {
21
22
  get "data-size"() {
22
23
  return size();
23
24
  },
25
+ get "data-variant"() {
26
+ return variant();
27
+ },
24
28
  children: ($$anchor, $$slotProps) => {
25
29
  var fragment_1 = $.comment();
26
30
  var node_1 = $.first_child(fragment_1);
@@ -0,0 +1,30 @@
1
+ import "svelte/internal/disclose-version";
2
+ import * as $ from "svelte/internal/client";
3
+ import { Toc } from "@ark-ui/svelte/toc";
4
+ //#region src/components/toc/TocIndicator.svelte
5
+ var rest_excludes = /* @__PURE__ */ new Set([
6
+ "$$slots",
7
+ "$$events",
8
+ "$$legacy",
9
+ "children"
10
+ ]);
11
+ function TocIndicator($$anchor, $$props) {
12
+ let rest = $.rest_props($$props, rest_excludes);
13
+ var fragment = $.comment();
14
+ var node = $.first_child(fragment);
15
+ $.component(node, () => Toc.Indicator, ($$anchor, ArkToc_Indicator) => {
16
+ ArkToc_Indicator($$anchor, $.spread_props(() => rest, {
17
+ "aria-hidden": "true",
18
+ children: ($$anchor, $$slotProps) => {
19
+ var fragment_1 = $.comment();
20
+ var node_1 = $.first_child(fragment_1);
21
+ $.snippet(node_1, () => $$props.children ?? $.noop);
22
+ $.append($$anchor, fragment_1);
23
+ },
24
+ $$slots: { default: true }
25
+ }));
26
+ });
27
+ $.append($$anchor, fragment);
28
+ }
29
+ //#endregion
30
+ export { TocIndicator as t };
@@ -0,0 +1,108 @@
1
+ import { injectComponentStyle } from "@bysages/core";
2
+ import "svelte/internal/disclose-version";
3
+ import * as $ from "svelte/internal/client";
4
+ import { chevron_right } from "@bysages/icons";
5
+ import { TreeView } from "@ark-ui/svelte/tree-view";
6
+ //#region src/components/tree-view/TreeViewBranchIndicator.svelte
7
+ var rest_excludes$2 = /* @__PURE__ */ new Set([
8
+ "$$slots",
9
+ "$$events",
10
+ "$$legacy",
11
+ "children"
12
+ ]);
13
+ var root = $.from_svg(`<svg aria-hidden="true"></svg>`);
14
+ function TreeViewBranchIndicator($$anchor, $$props) {
15
+ $.push($$props, true);
16
+ let rest = $.rest_props($$props, rest_excludes$2);
17
+ var fragment = $.comment();
18
+ var node = $.first_child(fragment);
19
+ $.component(node, () => TreeView.BranchIndicator, ($$anchor, ArkTreeView_BranchIndicator) => {
20
+ ArkTreeView_BranchIndicator($$anchor, $.spread_props(() => rest, {
21
+ children: ($$anchor, $$slotProps) => {
22
+ var fragment_1 = $.comment();
23
+ var node_1 = $.first_child(fragment_1);
24
+ var consequent = ($$anchor) => {
25
+ var fragment_2 = $.comment();
26
+ var node_2 = $.first_child(fragment_2);
27
+ $.snippet(node_2, () => $$props.children);
28
+ $.append($$anchor, fragment_2);
29
+ };
30
+ var alternate = ($$anchor) => {
31
+ var svg = root();
32
+ $.html(svg, () => chevron_right.body, true);
33
+ $.reset(svg);
34
+ $.template_effect(() => $.set_attribute(svg, "viewBox", `0 0 ${chevron_right.width ?? ""} ${chevron_right.height ?? ""}`));
35
+ $.append($$anchor, svg);
36
+ };
37
+ $.if(node_1, ($$render) => {
38
+ if ($$props.children) $$render(consequent);
39
+ else $$render(alternate, -1);
40
+ });
41
+ $.append($$anchor, fragment_1);
42
+ },
43
+ $$slots: { default: true }
44
+ }));
45
+ });
46
+ $.append($$anchor, fragment);
47
+ $.pop();
48
+ }
49
+ //#endregion
50
+ //#region src/components/tree-view/TreeViewNodeCheckbox.svelte
51
+ var rest_excludes$1 = /* @__PURE__ */ new Set([
52
+ "$$slots",
53
+ "$$events",
54
+ "$$legacy",
55
+ "children"
56
+ ]);
57
+ function TreeViewNodeCheckbox($$anchor, $$props) {
58
+ let rest = $.rest_props($$props, rest_excludes$1);
59
+ var fragment = $.comment();
60
+ var node = $.first_child(fragment);
61
+ $.component(node, () => TreeView.NodeCheckbox, ($$anchor, ArkTreeView_NodeCheckbox) => {
62
+ ArkTreeView_NodeCheckbox($$anchor, $.spread_props(() => rest, {
63
+ "aria-hidden": "true",
64
+ children: ($$anchor, $$slotProps) => {
65
+ var fragment_1 = $.comment();
66
+ var node_1 = $.first_child(fragment_1);
67
+ $.snippet(node_1, () => $$props.children ?? $.noop);
68
+ $.append($$anchor, fragment_1);
69
+ },
70
+ $$slots: { default: true }
71
+ }));
72
+ });
73
+ $.append($$anchor, fragment);
74
+ }
75
+ //#endregion
76
+ //#region src/components/tree-view/TreeViewRoot.svelte
77
+ var rest_excludes = /* @__PURE__ */ new Set([
78
+ "$$slots",
79
+ "$$events",
80
+ "$$legacy",
81
+ "size",
82
+ "children"
83
+ ]);
84
+ function TreeViewRoot($$anchor, $$props) {
85
+ $.push($$props, true);
86
+ injectComponentStyle("tree-view");
87
+ let size = $.prop($$props, "size", 3, "md"), rest = $.rest_props($$props, rest_excludes);
88
+ var fragment = $.comment();
89
+ var node = $.first_child(fragment);
90
+ $.component(node, () => TreeView.Root, ($$anchor, ArkTreeView_Root) => {
91
+ ArkTreeView_Root($$anchor, $.spread_props(() => rest, {
92
+ get "data-size"() {
93
+ return size();
94
+ },
95
+ children: ($$anchor, $$slotProps) => {
96
+ var fragment_1 = $.comment();
97
+ var node_1 = $.first_child(fragment_1);
98
+ $.snippet(node_1, () => $$props.children ?? $.noop);
99
+ $.append($$anchor, fragment_1);
100
+ },
101
+ $$slots: { default: true }
102
+ }));
103
+ });
104
+ $.append($$anchor, fragment);
105
+ $.pop();
106
+ }
107
+ //#endregion
108
+ export { TreeViewNodeCheckbox as n, TreeViewBranchIndicator as r, TreeViewRoot as t };
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages, t as formatMessage } from "./messages-DNzA55pH.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import "svelte/internal/disclose-version";
3
4
  import * as $ from "svelte/internal/client";
@@ -9,7 +10,8 @@ var rest_excludes$1 = /* @__PURE__ */ new Set([
9
10
  "name",
10
11
  "size",
11
12
  "status",
12
- "onRemove"
13
+ "onRemove",
14
+ "aria-label"
13
15
  ]);
14
16
  var root$1 = $.from_svg(`<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"></circle></svg>`);
15
17
  var root_1 = $.from_svg(`<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"></path></svg>`);
@@ -46,6 +48,8 @@ function Attachment$1($$anchor, $$props) {
46
48
  return `${value.toFixed(1)} ${units[unit]}`;
47
49
  };
48
50
  let status = $.prop($$props, "status", 3, "ready"), rest = $.rest_props($$props, rest_excludes$1);
51
+ const messages = useComponentMessages();
52
+ const removeLabel = $.derived(() => $$props["aria-label"] ?? formatMessage(messages().ai.removeAttachment, { name: $$props.name }));
49
53
  var span = root_3();
50
54
  $.attribute_effect(span, () => ({
51
55
  ...rest,
@@ -83,7 +87,7 @@ function Attachment$1($$anchor, $$props) {
83
87
  $.reset(span);
84
88
  $.template_effect(() => {
85
89
  $.set_text(text, $$props.name);
86
- $.set_attribute(button, "aria-label", `Remove ${$$props.name}`);
90
+ $.set_attribute(button, "aria-label", $.get(removeLabel));
87
91
  });
88
92
  $.delegated("click", button, () => $$props.onRemove?.());
89
93
  $.append($$anchor, span);