@bysages/solid 0.3.0 → 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 (49) hide show
  1. package/dist/{ai-response-ClGGptX3.mjs → ai-response-slzE03wh.mjs} +4 -2
  2. package/dist/components/ai/index.mjs +11 -14
  3. package/dist/components/ai-attachments/index.mjs +3 -1
  4. package/dist/components/ai-prompt-input/index.mjs +12 -3
  5. package/dist/components/ai-response/index.mjs +1 -1
  6. package/dist/components/autocomplete/index.mjs +5 -1
  7. package/dist/components/banner/index.mjs +3 -1
  8. package/dist/components/breadcrumb/index.mjs +5 -5
  9. package/dist/components/cascade-select/index.mjs +10 -3
  10. package/dist/components/command/index.mjs +11 -3
  11. package/dist/components/config-provider/index.d.mts +4 -1
  12. package/dist/components/config-provider/index.mjs +3 -1
  13. package/dist/components/data-view/index.mjs +8 -2
  14. package/dist/components/dynamic-input/index.mjs +5 -1
  15. package/dist/components/file-upload/index.d.mts +7 -1
  16. package/dist/components/file-upload/index.mjs +11 -1
  17. package/dist/components/float-button/index.mjs +3 -1
  18. package/dist/components/image/index.d.mts +4 -0
  19. package/dist/components/image/index.mjs +9 -3
  20. package/dist/components/image-viewer/index.d.mts +4 -0
  21. package/dist/components/image-viewer/index.mjs +15 -7
  22. package/dist/components/json-tree-view/index.d.mts +5 -2
  23. package/dist/components/json-tree-view/index.mjs +25 -2
  24. package/dist/components/layout/index.mjs +8 -4
  25. package/dist/components/list/index.d.mts +2 -1
  26. package/dist/components/list/index.mjs +35 -26
  27. package/dist/components/menubar/index.mjs +1 -0
  28. package/dist/components/order-list/index.mjs +22 -14
  29. package/dist/components/select/index.mjs +1 -1
  30. package/dist/components/spinner/index.mjs +3 -1
  31. package/dist/components/split-button/index.mjs +5 -1
  32. package/dist/components/steps/index.d.mts +6 -1
  33. package/dist/components/steps/index.mjs +7 -1
  34. package/dist/components/table/index.mjs +33 -21
  35. package/dist/components/terminal/index.mjs +3 -1
  36. package/dist/components/toc/index.d.mts +2 -7
  37. package/dist/components/toc/index.mjs +1 -9
  38. package/dist/components/transfer/index.mjs +14 -4
  39. package/dist/components/tree-select/index.mjs +9 -6
  40. package/dist/components/tree-view/index.d.mts +8 -1
  41. package/dist/components/tree-view/index.mjs +28 -2
  42. package/dist/components/virtual-list/index.mjs +1 -0
  43. package/dist/index-DdsnfV4f.d.mts +16 -0
  44. package/dist/index.d.mts +1 -1
  45. package/dist/index.mjs +4 -4
  46. package/dist/{select-CHaXbzLX.mjs → select-CX6OuQlU.mjs} +9 -1
  47. package/dist/toc-CZmYEaQR.mjs +21 -0
  48. package/dist/use-component-messages-C4SCVYjD.mjs +17 -0
  49. package/package.json +3 -3
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages } from "./use-component-messages-C4SCVYjD.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { ref, spread, template } from "@solidjs/web";
3
4
  import { createEffect, createMemo, onMount, splitProps } from "solid-js";
@@ -111,15 +112,16 @@ function Response(props) {
111
112
  "copyLabel",
112
113
  "copiedLabel"
113
114
  ]);
115
+ const messages = useComponentMessages();
114
116
  const html = createMemo(() => renderHtml(own.content, own.highlighter ? { highlighter: own.highlighter } : void 0));
115
117
  let root;
116
118
  onMount(() => createEffect(() => {
117
119
  html();
118
- if (root) decorateCodeCopy(root, own.copyLabel ?? "Copy code");
120
+ if (root) decorateCodeCopy(root, own.copyLabel ?? messages().ai.copyCode);
119
121
  if (root) wrapResponseTables(root);
120
122
  }));
121
123
  const onClick = (event) => {
122
- clickCodeCopy(event, own.copyLabel ?? "Copy code", own.copiedLabel ?? "Copied");
124
+ clickCodeCopy(event, own.copyLabel ?? messages().ai.copyCode, own.copiedLabel ?? messages().ai.copied);
123
125
  };
124
126
  var _el$ = _tmpl$();
125
127
  ref(() => {
@@ -1,8 +1,9 @@
1
1
  import { Action } from "../ai-action/index.mjs";
2
2
  import { AiMessage as Message } from "../ai-message/index.mjs";
3
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
3
4
  import { AiPromptInput as PromptInput } from "../ai-prompt-input/index.mjs";
4
5
  import { AiReasoning as Reasoning } from "../ai-reasoning/index.mjs";
5
- import { t as Response } from "../../ai-response-ClGGptX3.mjs";
6
+ import { t as Response } from "../../ai-response-slzE03wh.mjs";
6
7
  import { AiSource as Source, AiSources as Sources } from "../ai-source/index.mjs";
7
8
  import { AiSuggestion as Suggestion } from "../ai-suggestion/index.mjs";
8
9
  import { AiTool as Tool } from "../ai-tool/index.mjs";
@@ -10,17 +11,13 @@ import { injectComponentStyle } from "@bysages/core";
10
11
  import { spread, template } from "@solidjs/web";
11
12
  //#region src/components/ai/index.tsx
12
13
  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
14
  function part(name, extra = {}) {
20
15
  function Component(props) {
16
+ const messages = useComponentMessages();
17
+ const partExtra = typeof extra === "function" ? extra(messages()) : extra;
21
18
  var _el$ = _tmpl$();
22
19
  spread(_el$, [
23
- extra,
20
+ partExtra,
24
21
  props,
25
22
  {
26
23
  "data-scope": "ai",
@@ -35,20 +32,20 @@ function part(name, extra = {}) {
35
32
  }
36
33
  /** The log itself: the column every stroke lands in, a landmark to
37
34
  * screen readers. */
38
- const AiConversation = part("Conversation", {
35
+ const AiConversation = part("Conversation", (messages) => ({
39
36
  role: "log",
40
- "aria-label": "Conversation"
41
- });
37
+ "aria-label": messages.ai.conversation
38
+ }));
42
39
  /** The bubble's inner measure — content that belongs to neither side
43
40
  * specifically. */
44
41
  const AiContent = part("Content");
45
42
  /** The quiet row under a message — copy, retry, feedback. */
46
43
  const AiActions = part("Actions");
47
44
  /** The while-it-works whisper for the in-flight turns. */
48
- const AiLoader = part("Loader", {
45
+ const AiLoader = part("Loader", (messages) => ({
49
46
  role: "status",
50
- "aria-label": "Loading"
51
- });
47
+ "aria-label": messages.ai.loading
48
+ }));
52
49
  /** The whole family under one handle — `Ai.Conversation`,
53
50
  * `Ai.MessageContent`, and the rest. */
54
51
  const Ai = Object.assign(AiConversation, {
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages, t as formatComponentMessage } from "../../use-component-messages-C4SCVYjD.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { delegateEvents, effect, insert, memo, setAttribute, spread, template } from "@solidjs/web";
3
4
  import { splitProps } from "solid-js";
@@ -54,6 +55,7 @@ function Attachment(props) {
54
55
  "status",
55
56
  "onRemove"
56
57
  ]);
58
+ const messages = useComponentMessages();
57
59
  var _el$4 = _tmpl$4();
58
60
  var _el$5 = _el$4.firstChild;
59
61
  var _el$6 = _el$5.nextSibling;
@@ -91,7 +93,7 @@ function Attachment(props) {
91
93
  })(), _el$6);
92
94
  _el$6._$$click = () => own.onRemove?.();
93
95
  insert(_el$6, removeGlyph);
94
- effect(() => `Remove ${own.name}`, (_v$) => {
96
+ effect(() => formatComponentMessage(messages().ai.removeAttachment, { name: own.name }), (_v$) => {
95
97
  setAttribute(_el$6, "aria-label", _v$);
96
98
  });
97
99
  return _el$4;
@@ -1,4 +1,5 @@
1
1
  import { Button } from "../button/index.mjs";
2
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
2
3
  import { Field } from "../field/index.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core";
4
5
  import { claimElement, createComponent, insert, setAttribute, spread, template } from "@solidjs/web";
@@ -43,6 +44,7 @@ function PromptInput(props) {
43
44
  "footer",
44
45
  "footerEnd"
45
46
  ]);
47
+ const messages = useComponentMessages();
46
48
  const send = () => {
47
49
  const value = (own.value ?? "").trim();
48
50
  if (!value || own.disabled || own.busy) return;
@@ -60,7 +62,9 @@ function PromptInput(props) {
60
62
  size: "sm",
61
63
  square: true,
62
64
  type: "button",
63
- "aria-label": "Stop",
65
+ get "aria-label"() {
66
+ return messages().ai.stop;
67
+ },
64
68
  get disabled() {
65
69
  return own.disabled;
66
70
  },
@@ -73,7 +77,9 @@ function PromptInput(props) {
73
77
  size: "sm",
74
78
  square: true,
75
79
  type: "submit",
76
- "aria-label": "Send",
80
+ get "aria-label"() {
81
+ return messages().ai.send;
82
+ },
77
83
  get disabled() {
78
84
  return own.disabled || !(own.value ?? "").trim();
79
85
  },
@@ -111,7 +117,10 @@ function PromptInput(props) {
111
117
  return own.value ?? "";
112
118
  },
113
119
  get placeholder() {
114
- return own.placeholder ?? "Send a message";
120
+ return own.placeholder ?? messages().ai.send;
121
+ },
122
+ get "aria-label"() {
123
+ return messages().ai.conversation;
115
124
  },
116
125
  get disabled() {
117
126
  return own.disabled;
@@ -1,2 +1,2 @@
1
- import { t as Response } from "../../ai-response-ClGGptX3.mjs";
1
+ import { t as Response } from "../../ai-response-slzE03wh.mjs";
2
2
  export { Response as AiResponse, Response };
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { createComponent, mergeProps } from "@solidjs/web";
3
4
  import { For, splitProps } from "solid-js";
@@ -14,6 +15,7 @@ import { Portal } from "solid-js/web";
14
15
  * otherwise.
15
16
  */
16
17
  function AutoComplete(props) {
18
+ const messages = useComponentMessages();
17
19
  injectComponentStyle("combobox");
18
20
  const [own, rest] = splitProps(props, [
19
21
  "value",
@@ -55,7 +57,9 @@ function AutoComplete(props) {
55
57
  } }), createComponent(Portal, { get children() {
56
58
  return createComponent(Combobox.Positioner, { get children() {
57
59
  return createComponent(Combobox.Content, { get children() {
58
- return [createComponent(Combobox.Empty, { children: "No matches" }), createComponent(For, {
60
+ return [createComponent(Combobox.Empty, { get children() {
61
+ return messages().command.noMatches;
62
+ } }), createComponent(For, {
59
63
  get each() {
60
64
  return collection().items;
61
65
  },
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { createComponent, mergeProps, spread, template } from "@solidjs/web";
3
4
  import { splitProps } from "solid-js";
@@ -40,13 +41,14 @@ const Actions = part("Actions", "div");
40
41
  * consumer's state. */
41
42
  function Close(props) {
42
43
  const [own, rest] = splitProps(props, ["type"]);
44
+ const messages = useComponentMessages();
43
45
  var _el$2 = _tmpl$2();
44
46
  spread(_el$2, [rest, {
45
47
  get type() {
46
48
  return own.type ?? "button";
47
49
  },
48
50
  get "aria-label"() {
49
- return rest["aria-label"] ?? "Dismiss";
51
+ return rest["aria-label"] ?? messages().banner.dismiss;
50
52
  },
51
53
  "data-scope": "banner",
52
54
  "data-part": "close"
@@ -1,14 +1,14 @@
1
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { createComponent, mergeProps, spread, template } from "@solidjs/web";
3
4
  import { mergeProps as mergeProps$1 } from "solid-js";
4
5
  //#region src/components/breadcrumb/index.tsx
5
6
  var _tmpl$ = /* @__PURE__ */ template(`<span>`);
6
- /** A trail of waymarks: Root wraps the nav, List the ordered trail, and
7
- * each Item carries a Link — or the Current page — parted by a quiet
8
- * Separator. Links take href and the rest through attributes. */
9
7
  function part(name, tag, extra = {}) {
10
8
  return ((props) => {
11
- return createComponent(tag, mergeProps(extra, props, {
9
+ const messages = useComponentMessages();
10
+ const partExtra = typeof extra === "function" ? extra(messages()) : extra;
11
+ return createComponent(tag, mergeProps(partExtra, props, {
12
12
  "data-scope": "breadcrumb",
13
13
  get "data-part"() {
14
14
  return name.toLowerCase();
@@ -16,7 +16,7 @@ function part(name, tag, extra = {}) {
16
16
  }));
17
17
  });
18
18
  }
19
- const Root = part("Root", "nav", { "aria-label": "Breadcrumb" });
19
+ const Root = part("Root", "nav", (messages) => ({ "aria-label": messages.breadcrumb.label }));
20
20
  const List = part("List", "ol");
21
21
  const Item = part("Item", "li");
22
22
  const Link = part("Link", "a");
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
1
2
  import { t as Input } from "../../input-DoFQ7RXh.mjs";
2
3
  import { injectComponentStyle } from "@bysages/core";
3
4
  import { createComponent, delegateEvents, effect, insert, setAttribute, spread, template } from "@solidjs/web";
@@ -38,6 +39,7 @@ function checkGlyph() {
38
39
  * runs — each hit still reads as its full route.
39
40
  */
40
41
  function CascadeSelect(props) {
42
+ const messages = useComponentMessages();
41
43
  injectComponentStyle("cascade-select");
42
44
  const [own, rest] = splitProps(props, [
43
45
  "value",
@@ -207,6 +209,7 @@ function CascadeSelect(props) {
207
209
  }, true);
208
210
  spread(_el$11, () => {
209
211
  return mergeProps$1(() => api().getTriggerProps(), {
212
+ "aria-labelledby": id + ":value-text",
210
213
  get disabled() {
211
214
  return own.disabled || void 0;
212
215
  },
@@ -217,7 +220,7 @@ function CascadeSelect(props) {
217
220
  });
218
221
  }, true);
219
222
  spread(_el$12, () => {
220
- return mergeProps$1(() => api().getValueTextProps());
223
+ return mergeProps$1(() => api().getValueTextProps(), { id: id + ":value-text" });
221
224
  }, true);
222
225
  insert(_el$12, () => {
223
226
  return display() ?? own.placeholder ?? "Select…";
@@ -250,8 +253,12 @@ function CascadeSelect(props) {
250
253
  return query();
251
254
  },
252
255
  onValueChange: setQuery,
253
- placeholder: "Filter…",
254
- "aria-label": "Filter options"
256
+ get placeholder() {
257
+ return messages().select.filter;
258
+ },
259
+ get "aria-label"() {
260
+ return messages().select.filter;
261
+ }
255
262
  }));
256
263
  return _el$16;
257
264
  }
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { createComponent, insert, mergeProps, spread, template } from "@solidjs/web";
3
4
  import { For, Show, createEffect, createSignal, splitProps } from "solid-js";
@@ -66,6 +67,7 @@ function Row(props) {
66
67
  function Command(props) {
67
68
  injectComponentStyle("command");
68
69
  injectComponentStyle("dialog");
70
+ const messages = useComponentMessages();
69
71
  const [own, rest] = splitProps(props, [
70
72
  "items",
71
73
  "placeholder",
@@ -132,7 +134,10 @@ function Command(props) {
132
134
  var _el$7 = _tmpl$4();
133
135
  spread(_el$7, [contentProps, {
134
136
  "data-scope": "command",
135
- "data-part": "content"
137
+ "data-part": "content",
138
+ get "aria-label"() {
139
+ return messages().command.palette;
140
+ }
136
141
  }], true);
137
142
  insert(_el$7, createComponent(Combobox.Root, {
138
143
  get collection() {
@@ -164,7 +169,10 @@ function Command(props) {
164
169
  spread(_el$8, [inputProps, {
165
170
  type: "text",
166
171
  get placeholder() {
167
- return own.placeholder;
172
+ return own.placeholder ?? messages().command.search;
173
+ },
174
+ get "aria-label"() {
175
+ return messages().command.search;
168
176
  },
169
177
  "data-scope": "command",
170
178
  "data-part": "input"
@@ -232,7 +240,7 @@ function Command(props) {
232
240
  get children() {
233
241
  var _el$11 = _tmpl$6();
234
242
  insert(_el$11, () => {
235
- return own.emptyText ?? "No matching commands";
243
+ return own.emptyText ?? messages().command.noMatches;
236
244
  });
237
245
  return _el$11;
238
246
  }
@@ -1,4 +1,4 @@
1
- import { ThemeScene } from "@bysages/core";
1
+ import { ComponentMessagesOverride, ThemeScene } from "@bysages/core";
2
2
  import { JSX } from "solid-js";
3
3
  //#region src/components/config-provider/index.d.ts
4
4
  /** The four density tiers the token layer's `[data-density]` selectors
@@ -22,6 +22,8 @@ export interface ConfigContext {
22
22
  dir?: "ltr" | "rtl";
23
23
  /** BCP-47 locale, landing as the native `lang` attribute. */
24
24
  locale?: string;
25
+ /** Wrapper-owned copy, resolved with `locale` and merged over its locale defaults leaf by leaf. */
26
+ messages?: ComponentMessagesOverride;
25
27
  }
26
28
  /** Solid context for the provider's snapshot — a custom part reads it
27
29
  * with `useContext(ConfigContextKey)`. */
@@ -36,6 +38,7 @@ export interface ConfigProviderProps extends JSX.HTMLAttributes<HTMLDivElement>
36
38
  accent?: string;
37
39
  dir?: "ltr" | "rtl";
38
40
  locale?: string;
41
+ messages?: ComponentMessagesOverride;
39
42
  }
40
43
  /**
41
44
  * The declarative host for global configuration: one element that both
@@ -25,6 +25,7 @@ function ConfigProvider(props) {
25
25
  "accent",
26
26
  "dir",
27
27
  "locale",
28
+ "messages",
28
29
  "children"
29
30
  ]);
30
31
  return createComponent(ConfigContextKey.Provider, {
@@ -33,7 +34,8 @@ function ConfigProvider(props) {
33
34
  scene: own.scene,
34
35
  accent: own.accent,
35
36
  dir: own.dir,
36
- locale: own.locale
37
+ locale: own.locale,
38
+ messages: own.messages
37
39
  }),
38
40
  get children() {
39
41
  var _el$ = _tmpl$();
@@ -1,3 +1,4 @@
1
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
1
2
  import { Pagination } from "../pagination/index.mjs";
2
3
  import { injectComponentStyle } from "@bysages/core";
3
4
  import { createComponent, effect, insert, memo, setAttribute, spread, template } from "@solidjs/web";
@@ -20,6 +21,7 @@ function DataView(props) {
20
21
  "renderItem",
21
22
  "header"
22
23
  ]);
24
+ const messages = useComponentMessages();
23
25
  const [page, setPage] = createSignal(1);
24
26
  const pageCount = () => own.pageSize ? Math.max(1, Math.ceil(own.items.length / own.pageSize)) : 1;
25
27
  const visible = () => own.pageSize ? own.items.slice((page() - 1) * own.pageSize, page() * own.pageSize) : own.items;
@@ -69,7 +71,9 @@ function DataView(props) {
69
71
  get children() {
70
72
  return [
71
73
  createComponent(Pagination.PrevTrigger, {
72
- "aria-label": "Previous page",
74
+ get "aria-label"() {
75
+ return messages().pagination.previous;
76
+ },
73
77
  children: "‹"
74
78
  }),
75
79
  createComponent(Pagination.Context, { children: (pagination) => createComponent(For, {
@@ -92,7 +96,9 @@ function DataView(props) {
92
96
  })
93
97
  }) }),
94
98
  createComponent(Pagination.NextTrigger, {
95
- "aria-label": "Next page",
99
+ get "aria-label"() {
100
+ return messages().pagination.next;
101
+ },
96
102
  children: "›"
97
103
  })
98
104
  ];
@@ -1,4 +1,5 @@
1
1
  import { Button } from "../button/index.mjs";
2
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
2
3
  import { t as Input } from "../../input-DoFQ7RXh.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core";
4
5
  import { createComponent, insert, memo, spread, template } from "@solidjs/web";
@@ -16,6 +17,7 @@ var _tmpl$3 = /* @__PURE__ */ template(`<svg width=16 height=16 viewBox="0 0 24
16
17
  * emptied itself would leave the reader no place to type.
17
18
  */
18
19
  function DynamicInput(props) {
20
+ const messages = useComponentMessages();
19
21
  injectComponentStyle("dynamic-input");
20
22
  const [own, rest] = splitProps(props, [
21
23
  "value",
@@ -85,7 +87,9 @@ function DynamicInput(props) {
85
87
  get disabled() {
86
88
  return own.disabled || !canRemove();
87
89
  },
88
- "aria-label": `Remove entry ${index + 1}`,
90
+ get "aria-label"() {
91
+ return `${messages().dynamicEntry.remove} ${index + 1}`;
92
+ },
89
93
  onClick: () => remove(index),
90
94
  get children() {
91
95
  return crossIcon();
@@ -1,5 +1,10 @@
1
+ import { ComponentProps } from "solid-js";
1
2
  import { FileUpload as FileUpload$1, FileUploadRootProps } from "@ark-ui/solid/file-upload";
2
3
  //#region src/components/file-upload/index.d.ts
4
+ /** The inner trigger repeats the click binding the dropzone already
5
+ * owns: keyboard users enter through the dropzone, so the button
6
+ * leaves the tab order and the semantic tree entirely. */
7
+ declare function FileUploadTrigger(props: ComponentProps<typeof FileUpload$1.Trigger>): import("solid-js").JSX.Element;
3
8
  /** Ark's FileUpload, dressed in the paper-and-ink system: a dashed
4
9
  * dropzone that floods with subtle light on drag-over, and accepted files
5
10
  * as loose hairline slips. The API is Ark's own — Root, Label, Trigger,
@@ -11,7 +16,8 @@ type FileUploadOwnProps = {
11
16
  size?: "sm" | "md" | "lg";
12
17
  };
13
18
  declare function FileUploadRoot(props: FileUploadRootProps & FileUploadOwnProps): import("solid-js").JSX.Element;
14
- export declare const FileUpload: Omit<typeof FileUpload$1, "Root"> & {
19
+ export declare const FileUpload: Omit<typeof FileUpload$1, "Root" | "Trigger"> & {
15
20
  Root: typeof FileUploadRoot;
21
+ Trigger: typeof FileUploadTrigger;
16
22
  };
17
23
  //#endregion
@@ -3,6 +3,15 @@ import { createComponent, mergeProps } from "@solidjs/web";
3
3
  import { splitProps } from "solid-js";
4
4
  import { FileUpload as FileUpload$1 } from "@ark-ui/solid/file-upload";
5
5
  //#region src/components/file-upload/index.tsx
6
+ /** The inner trigger repeats the click binding the dropzone already
7
+ * owns: keyboard users enter through the dropzone, so the button
8
+ * leaves the tab order and the semantic tree entirely. */
9
+ function FileUploadTrigger(props) {
10
+ return createComponent(FileUpload$1.Trigger, mergeProps(props, {
11
+ tabindex: -1,
12
+ "aria-hidden": "true"
13
+ }));
14
+ }
6
15
  function FileUploadRoot(props) {
7
16
  const [own, rest] = splitProps(props, ["size"]);
8
17
  return createComponent(FileUpload$1.Root, mergeProps(rest, { get "data-size"() {
@@ -11,7 +20,8 @@ function FileUploadRoot(props) {
11
20
  }
12
21
  const FileUpload = {
13
22
  ...FileUpload$1,
14
- Root: FileUploadRoot
23
+ Root: FileUploadRoot,
24
+ Trigger: FileUploadTrigger
15
25
  };
16
26
  injectComponentStyle("file-upload");
17
27
  //#endregion
@@ -1,4 +1,5 @@
1
1
  import { Button } from "../button/index.mjs";
2
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
2
3
  import { injectComponentStyle } from "@bysages/core";
3
4
  import { createComponent, insert, mergeProps, spread, template } from "@solidjs/web";
4
5
  import { createContext, createSignal, splitProps, useContext } from "solid-js";
@@ -62,6 +63,7 @@ const STEP_DOWN = {
62
63
  function FloatButtonTrigger(props) {
63
64
  const [own, rest] = splitProps(props, ["label", "children"]);
64
65
  const context = useContext(FloatButtonContextKey);
66
+ const messages = useComponentMessages();
65
67
  return createComponent(Button, mergeProps(rest, {
66
68
  variant: "solid",
67
69
  square: true,
@@ -70,7 +72,7 @@ function FloatButtonTrigger(props) {
70
72
  },
71
73
  onClick: () => context?.toggle(),
72
74
  get "aria-label"() {
73
- return own.label || "Actions";
75
+ return own.label || messages().floatButton.actions;
74
76
  },
75
77
  get "aria-expanded"() {
76
78
  return context?.open() ?? false;
@@ -8,6 +8,10 @@ import { JSX } from "solid-js";
8
8
  export interface ImageProps extends JSX.HTMLAttributes<HTMLElement> {
9
9
  src: string;
10
10
  alt?: string;
11
+ /** Intrinsic dimensions for the image element, reserving the layout
12
+ * box before bytes arrive. */
13
+ width?: number | string;
14
+ height?: number | string;
11
15
  fit?: "cover" | "contain" | "fill" | "none";
12
16
  loading?: "lazy" | "eager";
13
17
  /** What a broken source leaves instead of the picture. */
@@ -21,6 +21,8 @@ function Image(props) {
21
21
  const [own, rest] = splitProps(props, [
22
22
  "src",
23
23
  "alt",
24
+ "width",
25
+ "height",
24
26
  "fit",
25
27
  "loading",
26
28
  "fallback"
@@ -57,12 +59,16 @@ function Image(props) {
57
59
  return {
58
60
  e: own.src,
59
61
  t: own.alt ?? "",
60
- a: own.loading ?? "lazy"
62
+ a: own.width,
63
+ o: own.height,
64
+ i: own.loading ?? "lazy"
61
65
  };
62
- }, ({ e, t, a }, _p$) => {
66
+ }, ({ e, t, a, o, i }, _p$) => {
63
67
  e !== _p$?.e && setAttribute(_el$5, "src", e);
64
68
  t !== _p$?.t && setAttribute(_el$5, "alt", t);
65
- a !== _p$?.a && setAttribute(_el$5, "loading", a);
69
+ a !== _p$?.a && setAttribute(_el$5, "width", a);
70
+ o !== _p$?.o && setAttribute(_el$5, "height", o);
71
+ i !== _p$?.i && setAttribute(_el$5, "loading", i);
66
72
  });
67
73
  return _el$4;
68
74
  }
@@ -10,6 +10,10 @@ import { JSX } from "solid-js";
10
10
  export interface ImageViewerProps {
11
11
  src: string;
12
12
  alt?: string;
13
+ /** Intrinsic dimensions for the image element, reserving the layout
14
+ * box before bytes arrive. */
15
+ width?: number | string;
16
+ height?: number | string;
13
17
  open?: boolean;
14
18
  zoomable?: boolean;
15
19
  /** The openness changed — from the scrim, Escape or the toolbar. */
@@ -1,4 +1,5 @@
1
1
  import { Button } from "../button/index.mjs";
2
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
2
3
  import { ButtonGroup } from "../button-group/index.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core";
4
5
  import { createComponent, effect, insert, memo, setAttribute, setStyleProperty, template } from "@solidjs/web";
@@ -41,10 +42,13 @@ function ImageViewer(props) {
41
42
  const [own] = splitProps(props, [
42
43
  "src",
43
44
  "alt",
45
+ "width",
46
+ "height",
44
47
  "open",
45
48
  "zoomable",
46
49
  "onOpenChange"
47
50
  ]);
51
+ const messages = useComponentMessages();
48
52
  const [localOpen, setLocalOpen] = createSignal(false);
49
53
  const [scale, setScale] = createSignal(1);
50
54
  const [rotation, setRotation] = createSignal(0);
@@ -106,12 +110,16 @@ function ImageViewer(props) {
106
110
  return {
107
111
  e: own.src,
108
112
  t: own.alt ?? "",
109
- a: `scale(${scale()}) rotate(${rotation()}deg)`
113
+ a: own.width,
114
+ o: own.height,
115
+ i: `scale(${scale()}) rotate(${rotation()}deg)`
110
116
  };
111
- }, ({ e, t, a }, _p$) => {
117
+ }, ({ e, t, a, o, i }, _p$) => {
112
118
  e !== _p$?.e && setAttribute(_el$13, "src", e);
113
119
  t !== _p$?.t && setAttribute(_el$13, "alt", t);
114
- a !== _p$?.a && setStyleProperty(_el$13, "transform", a);
120
+ a !== _p$?.a && setAttribute(_el$13, "width", a);
121
+ o !== _p$?.o && setAttribute(_el$13, "height", o);
122
+ i !== _p$?.i && setStyleProperty(_el$13, "transform", i);
115
123
  });
116
124
  return _el$13;
117
125
  })(), (() => {
@@ -124,17 +132,17 @@ function ImageViewer(props) {
124
132
  },
125
133
  get children() {
126
134
  return [memo(() => {
127
- return toolButton("Zoom in", TOOL_GLYPHS.zoomIn, () => zoom(SCALE_STEP));
135
+ return toolButton(messages().imageViewer.zoomIn, TOOL_GLYPHS.zoomIn, () => zoom(SCALE_STEP));
128
136
  }), memo(() => {
129
- return toolButton("Zoom out", TOOL_GLYPHS.zoomOut, () => zoom(-.25));
137
+ return toolButton(messages().imageViewer.zoomOut, TOOL_GLYPHS.zoomOut, () => zoom(-.25));
130
138
  })];
131
139
  }
132
140
  }),
133
141
  memo(() => {
134
- return toolButton("Rotate 90 degrees", TOOL_GLYPHS.rotate, rotate);
142
+ return toolButton(messages().imageViewer.rotate, TOOL_GLYPHS.rotate, rotate);
135
143
  }),
136
144
  memo(() => {
137
- return toolButton("Close", TOOL_GLYPHS.close, () => setOpen(false));
145
+ return toolButton(messages().imageViewer.close, TOOL_GLYPHS.close, () => setOpen(false));
138
146
  })
139
147
  ];
140
148
  } }));
@@ -1,7 +1,10 @@
1
- import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/solid/json-tree-view";
1
+ import { JsonTreeView as JsonTreeView$1, JsonTreeViewTreeProps } from "@ark-ui/solid/json-tree-view";
2
2
  //#region src/components/json-tree-view/index.d.ts
3
3
  /** Ark's JsonTreeView, dressed in the paper-and-ink system: the tree-view
4
4
  * recipes re-scoped, with value nodes reading as tabular data. The API is
5
5
  * Ark's own — Root, Tree, plus createJsonTreeCollection. */
6
- export declare const JsonTreeView: typeof JsonTreeView$1;
6
+ declare function JsonTreeViewTree(props: JsonTreeViewTreeProps): import("solid-js").JSX.Element;
7
+ export declare const JsonTreeView: Omit<typeof JsonTreeView$1, "Tree"> & {
8
+ Tree: typeof JsonTreeViewTree;
9
+ };
7
10
  //#endregion
@@ -1,10 +1,33 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
+ import { createComponent, effect, mergeProps, setAttribute, template } from "@solidjs/web";
2
3
  import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/solid/json-tree-view";
3
- //#region src/components/json-tree-view/index.ts
4
+ import { chevron_right } from "@bysages/icons";
5
+ //#region src/components/json-tree-view/index.tsx
6
+ var _tmpl$ = /* @__PURE__ */ template(`<svg aria-hidden=true>`);
4
7
  /** Ark's JsonTreeView, dressed in the paper-and-ink system: the tree-view
5
8
  * recipes re-scoped, with value nodes reading as tabular data. The API is
6
9
  * Ark's own — Root, Tree, plus createJsonTreeCollection. */
7
- const JsonTreeView = JsonTreeView$1;
10
+ function JsonTreeViewTree(props) {
11
+ return createComponent(JsonTreeView$1.Tree, mergeProps(props, { get arrow() {
12
+ return props.arrow ?? (() => {
13
+ var _el$ = _tmpl$();
14
+ effect(() => {
15
+ return {
16
+ e: `0 0 ${chevron_right.width} ${chevron_right.height}`,
17
+ t: chevron_right.body
18
+ };
19
+ }, ({ e, t }, _p$) => {
20
+ e !== _p$?.e && setAttribute(_el$, "viewBox", e);
21
+ t !== _p$?.t && (_el$.innerHTML = t);
22
+ });
23
+ return _el$;
24
+ })();
25
+ } }));
26
+ }
27
+ const JsonTreeView = {
28
+ ...JsonTreeView$1,
29
+ Tree: JsonTreeViewTree
30
+ };
8
31
  injectComponentStyle("json-tree-view");
9
32
  //#endregion
10
33
  export { JsonTreeView };