@bysages/solid 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 (154) hide show
  1. package/README.md +16 -2
  2. package/dist/{ai-response-B_586r27.mjs → ai-response-slzE03wh.mjs} +19 -17
  3. package/dist/chevron-D5RzcayK.mjs +9 -0
  4. package/dist/components/affix/index.mjs +15 -17
  5. package/dist/components/ai/index.d.mts +1 -1
  6. package/dist/components/ai/index.mjs +21 -22
  7. package/dist/components/ai-action/index.mjs +2 -2
  8. package/dist/components/ai-attachments/index.mjs +52 -38
  9. package/dist/components/ai-message/index.mjs +11 -13
  10. package/dist/components/ai-prompt-input/index.mjs +81 -55
  11. package/dist/components/ai-reasoning/index.mjs +10 -6
  12. package/dist/components/ai-response/index.mjs +1 -1
  13. package/dist/components/ai-source/index.mjs +23 -23
  14. package/dist/components/ai-suggestion/index.mjs +1 -1
  15. package/dist/components/ai-tool/index.mjs +29 -17
  16. package/dist/components/alert/index.mjs +37 -42
  17. package/dist/components/angle-slider/index.mjs +2 -2
  18. package/dist/components/aspect-ratio/index.mjs +14 -16
  19. package/dist/components/autocomplete/index.mjs +8 -3
  20. package/dist/components/avatar/index.d.mts +3 -0
  21. package/dist/components/avatar/index.mjs +10 -5
  22. package/dist/components/avatar-group/index.mjs +11 -13
  23. package/dist/components/back-top/index.mjs +31 -27
  24. package/dist/components/badge/index.mjs +14 -16
  25. package/dist/components/banner/index.mjs +26 -28
  26. package/dist/components/bento/index.d.mts +24 -0
  27. package/dist/components/bento/index.mjs +51 -0
  28. package/dist/components/block-ui/index.d.mts +12 -0
  29. package/dist/components/block-ui/index.mjs +43 -0
  30. package/dist/components/breadcrumb/index.mjs +12 -10
  31. package/dist/components/browser/index.d.mts +21 -0
  32. package/dist/components/browser/index.mjs +87 -0
  33. package/dist/components/button/index.mjs +27 -29
  34. package/dist/components/button-group/index.mjs +18 -20
  35. package/dist/components/calendar/index.mjs +141 -129
  36. package/dist/components/card/index.mjs +2 -2
  37. package/dist/components/cascade-select/index.mjs +167 -121
  38. package/dist/components/checkbox/index.mjs +2 -2
  39. package/dist/components/checkbox-group/index.mjs +53 -55
  40. package/dist/components/chip/index.mjs +22 -20
  41. package/dist/components/clipboard/index.mjs +2 -2
  42. package/dist/components/color-picker/index.mjs +2 -2
  43. package/dist/components/combobox/index.mjs +2 -2
  44. package/dist/components/command/index.mjs +83 -59
  45. package/dist/components/comment/index.mjs +77 -62
  46. package/dist/components/config-provider/index.d.mts +4 -1
  47. package/dist/components/config-provider/index.mjs +13 -9
  48. package/dist/components/container/index.mjs +14 -16
  49. package/dist/components/data-view/index.d.mts +18 -0
  50. package/dist/components/data-view/index.mjs +116 -0
  51. package/dist/components/date-input/index.mjs +2 -2
  52. package/dist/components/date-picker/index.mjs +2 -2
  53. package/dist/components/deferred-content/index.d.mts +16 -0
  54. package/dist/components/deferred-content/index.mjs +52 -0
  55. package/dist/components/descriptions/index.d.mts +9 -1
  56. package/dist/components/descriptions/index.mjs +43 -16
  57. package/dist/components/dock/index.d.mts +22 -0
  58. package/dist/components/dock/index.mjs +64 -0
  59. package/dist/components/dynamic-input/index.mjs +75 -68
  60. package/dist/components/editable/index.mjs +2 -2
  61. package/dist/components/ellipsis/index.mjs +17 -19
  62. package/dist/components/empty/index.mjs +2 -2
  63. package/dist/components/file-upload/index.d.mts +7 -1
  64. package/dist/components/file-upload/index.mjs +13 -3
  65. package/dist/components/float-button/index.mjs +42 -39
  66. package/dist/components/form/index.d.mts +1 -1
  67. package/dist/components/form/index.mjs +52 -37
  68. package/dist/components/grid/index.mjs +19 -21
  69. package/dist/components/icon/index.d.mts +9 -4
  70. package/dist/components/icon/index.mjs +37 -36
  71. package/dist/components/image/index.d.mts +4 -0
  72. package/dist/components/image/index.mjs +50 -43
  73. package/dist/components/image-viewer/index.d.mts +4 -0
  74. package/dist/components/image-viewer/index.mjs +54 -37
  75. package/dist/components/input/index.d.mts +3 -0
  76. package/dist/components/input/index.mjs +1 -41
  77. package/dist/components/input-group/index.mjs +14 -18
  78. package/dist/components/json-tree-view/index.d.mts +5 -2
  79. package/dist/components/json-tree-view/index.mjs +25 -2
  80. package/dist/components/kbd/index.mjs +8 -10
  81. package/dist/components/layout/index.mjs +81 -77
  82. package/dist/components/link/index.mjs +12 -13
  83. package/dist/components/list/index.d.mts +2 -1
  84. package/dist/components/list/index.mjs +62 -48
  85. package/dist/components/listbox/index.mjs +2 -2
  86. package/dist/components/masonry/index.mjs +15 -17
  87. package/dist/components/mentions/index.mjs +1 -1
  88. package/dist/components/menu/index.mjs +2 -2
  89. package/dist/components/menubar/index.mjs +59 -57
  90. package/dist/components/meter/index.mjs +41 -41
  91. package/dist/components/number-input/index.mjs +2 -2
  92. package/dist/components/order-list/index.d.mts +21 -0
  93. package/dist/components/order-list/index.mjs +168 -0
  94. package/dist/components/page-header/index.mjs +2 -2
  95. package/dist/components/pagination/index.mjs +2 -2
  96. package/dist/components/password-input/index.mjs +2 -2
  97. package/dist/components/pin-input/index.mjs +2 -2
  98. package/dist/components/popconfirm/index.mjs +19 -12
  99. package/dist/components/progress/index.mjs +2 -2
  100. package/dist/components/progress-group/index.mjs +65 -58
  101. package/dist/components/radio-group/index.mjs +2 -2
  102. package/dist/components/rating-group/index.mjs +2 -2
  103. package/dist/components/result/index.d.mts +22 -0
  104. package/dist/components/result/index.mjs +66 -0
  105. package/dist/components/select/index.d.mts +2 -17
  106. package/dist/components/select/index.mjs +2 -18
  107. package/dist/components/separator/index.mjs +17 -19
  108. package/dist/components/skeleton/index.mjs +8 -10
  109. package/dist/components/slider/index.mjs +2 -2
  110. package/dist/components/spinner/index.mjs +17 -17
  111. package/dist/components/split-button/index.mjs +88 -83
  112. package/dist/components/spotlight/index.d.mts +11 -0
  113. package/dist/components/spotlight/index.mjs +38 -0
  114. package/dist/components/stack/index.mjs +20 -22
  115. package/dist/components/stat/index.mjs +12 -14
  116. package/dist/components/steps/index.d.mts +6 -1
  117. package/dist/components/steps/index.mjs +9 -3
  118. package/dist/components/switch/index.mjs +2 -2
  119. package/dist/components/table/index.mjs +323 -214
  120. package/dist/components/tabs/index.d.mts +2 -0
  121. package/dist/components/tabs/index.mjs +10 -5
  122. package/dist/components/tags-input/index.mjs +2 -2
  123. package/dist/components/terminal/index.d.mts +17 -0
  124. package/dist/components/terminal/index.mjs +86 -0
  125. package/dist/components/textarea/index.mjs +8 -8
  126. package/dist/components/timeline/index.d.mts +9 -3
  127. package/dist/components/timeline/index.mjs +18 -3
  128. package/dist/components/toc/index.d.mts +2 -7
  129. package/dist/components/toc/index.mjs +1 -9
  130. package/dist/components/toggle-group/index.mjs +2 -2
  131. package/dist/components/toolbar/index.d.mts +17 -0
  132. package/dist/components/toolbar/index.mjs +46 -0
  133. package/dist/components/transfer/index.mjs +126 -107
  134. package/dist/components/tree-select/index.mjs +36 -25
  135. package/dist/components/tree-view/index.d.mts +8 -1
  136. package/dist/components/tree-view/index.mjs +29 -3
  137. package/dist/components/typography/index.mjs +2 -2
  138. package/dist/components/user/index.d.mts +19 -0
  139. package/dist/components/user/index.mjs +68 -0
  140. package/dist/components/virtual-list/index.d.mts +17 -0
  141. package/dist/components/virtual-list/index.mjs +72 -0
  142. package/dist/components/watermark/index.mjs +19 -13
  143. package/dist/index-DdsnfV4f.d.mts +16 -0
  144. package/dist/{index-B4XS2n2y.d.mts → index-IfofF-SW.d.mts} +718 -3773
  145. package/dist/index-YPUiqD3n.d.mts +42 -0
  146. package/dist/index.d.mts +17 -4
  147. package/dist/index.mjs +22 -9
  148. package/dist/input-DoFQ7RXh.mjs +78 -0
  149. package/dist/{mentions-xbI6vJAP.mjs → mentions-f5Js_2W7.mjs} +76 -70
  150. package/dist/select-CX6OuQlU.mjs +123 -0
  151. package/dist/toc-CZmYEaQR.mjs +21 -0
  152. package/dist/use-component-messages-C4SCVYjD.mjs +17 -0
  153. package/package.json +28 -7
  154. package/dist/chevron-GWEoEYdO.mjs +0 -9
@@ -9,6 +9,8 @@ import { Tabs as Tabs$1, TabsRootProps } from "@ark-ui/solid/tabs";
9
9
  type TabsOwnProps = {
10
10
  /** One rung of the control-height ladder for the tab rows. */
11
11
  size?: "sm" | "md" | "lg";
12
+ /** The register: a ruled line (default), or each tab its own card. */
13
+ variant?: "line" | "card";
12
14
  };
13
15
  declare function TabsRoot(props: TabsRootProps & TabsOwnProps): import("solid-js").JSX.Element;
14
16
  export declare const Tabs: Omit<typeof Tabs$1, "Root"> & {
@@ -1,13 +1,18 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { createComponent, mergeProps } from "solid-js/web";
2
+ import { createComponent, mergeProps } from "@solidjs/web";
3
3
  import { splitProps } from "solid-js";
4
4
  import { Tabs as Tabs$1 } from "@ark-ui/solid/tabs";
5
5
  //#region src/components/tabs/index.tsx
6
6
  function TabsRoot(props) {
7
- const [own, rest] = splitProps(props, ["size"]);
8
- return createComponent(Tabs$1.Root, mergeProps(rest, { get ["data-size"]() {
9
- return own.size ?? "md";
10
- } }));
7
+ const [own, rest] = splitProps(props, ["size", "variant"]);
8
+ return createComponent(Tabs$1.Root, mergeProps(rest, {
9
+ get "data-size"() {
10
+ return own.size ?? "md";
11
+ },
12
+ get "data-variant"() {
13
+ return own.variant ?? "line";
14
+ }
15
+ }));
11
16
  }
12
17
  const Tabs = {
13
18
  ...Tabs$1,
@@ -1,11 +1,11 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { createComponent, mergeProps } from "solid-js/web";
2
+ import { createComponent, mergeProps } from "@solidjs/web";
3
3
  import { splitProps } from "solid-js";
4
4
  import { TagsInput as TagsInput$1 } from "@ark-ui/solid/tags-input";
5
5
  //#region src/components/tags-input/index.tsx
6
6
  function TagsInputRoot(props) {
7
7
  const [own, rest] = splitProps(props, ["size"]);
8
- return createComponent(TagsInput$1.Root, mergeProps(rest, { get ["data-size"]() {
8
+ return createComponent(TagsInput$1.Root, mergeProps(rest, { get "data-size"() {
9
9
  return own.size ?? "md";
10
10
  } }));
11
11
  }
@@ -0,0 +1,17 @@
1
+ import { JSX } from "solid-js";
2
+ //#region src/components/terminal/index.d.ts
3
+ export interface TerminalProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onCommand"> {
4
+ /** The transcript, oldest line first. */
5
+ lines?: string[];
6
+ /** The sigil at the head of the entry line. */
7
+ prompt?: string;
8
+ placeholder?: string;
9
+ label?: string;
10
+ onCommand?: (text: string) => void;
11
+ }
12
+ /** A quiet console: the transcript above, the prompt line below. The
13
+ * component owns only the reading and the caret — each entered line
14
+ * leaves as an event, and the caller answers through the lines prop,
15
+ * so history stays theirs to shape. */
16
+ export declare function Terminal(props: TerminalProps): JSX.Element;
17
+ //#endregion
@@ -0,0 +1,86 @@
1
+ import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
2
+ import { injectComponentStyle } from "@bysages/core";
3
+ import { createComponent, delegateEvents, effect, insert, ref, setAttribute, spread, template } from "@solidjs/web";
4
+ import { For, createEffect, createSignal, onMount, splitProps } from "solid-js";
5
+ //#region src/components/terminal/index.tsx
6
+ var _tmpl$ = /* @__PURE__ */ template(`<div><div data-scope=terminal data-part=scroll></div><div data-scope=terminal data-part=entry><span data-scope=terminal data-part=sigil aria-hidden=true></span><input data-scope=terminal data-part=input autocomplete=off>`);
7
+ var _tmpl$2 = /* @__PURE__ */ template(`<div data-scope=terminal data-part=line>`);
8
+ /** A quiet console: the transcript above, the prompt line below. The
9
+ * component owns only the reading and the caret — each entered line
10
+ * leaves as an event, and the caller answers through the lines prop,
11
+ * so history stays theirs to shape. */
12
+ function Terminal(props) {
13
+ const messages = useComponentMessages();
14
+ injectComponentStyle("terminal");
15
+ const [own, rest] = splitProps(props, [
16
+ "lines",
17
+ "prompt",
18
+ "placeholder",
19
+ "label",
20
+ "onCommand"
21
+ ]);
22
+ const [draft, setDraft] = createSignal("");
23
+ const [scroll, setScroll] = createSignal(null);
24
+ onMount(() => {
25
+ createEffect(() => {
26
+ if (own.lines?.length === void 0) return;
27
+ scroll()?.scrollTo({ top: scroll()?.scrollHeight });
28
+ });
29
+ });
30
+ function submit() {
31
+ const text = draft().trim();
32
+ if (!text) return;
33
+ setDraft("");
34
+ own.onCommand?.(text);
35
+ }
36
+ var _el$ = _tmpl$();
37
+ var _el$2 = _el$.firstChild;
38
+ var _el$4 = _el$2.nextSibling.firstChild;
39
+ var _el$5 = _el$4.nextSibling;
40
+ spread(_el$, [rest, {
41
+ role: "log",
42
+ get "aria-label"() {
43
+ return own.label;
44
+ },
45
+ "data-scope": "terminal",
46
+ "data-part": "root"
47
+ }], true);
48
+ ref(() => {
49
+ return setScroll;
50
+ }, _el$2);
51
+ insert(_el$2, createComponent(For, {
52
+ get each() {
53
+ return own.lines;
54
+ },
55
+ children: (line) => (() => {
56
+ var _el$6 = _tmpl$2();
57
+ insert(_el$6, line);
58
+ return _el$6;
59
+ })()
60
+ }));
61
+ insert(_el$4, () => {
62
+ return own.prompt ?? "$";
63
+ });
64
+ _el$5._$$keydown = (event) => {
65
+ if (event.key === "Enter") {
66
+ event.preventDefault();
67
+ submit();
68
+ }
69
+ };
70
+ _el$5._$$input = (event) => setDraft(event.currentTarget.value);
71
+ effect(() => {
72
+ return {
73
+ e: draft(),
74
+ t: own.placeholder,
75
+ a: own.label ?? messages().terminal.commandLine
76
+ };
77
+ }, ({ e, t, a }, _p$) => {
78
+ _el$5.value = e ?? "";
79
+ t !== _p$?.t && setAttribute(_el$5, "placeholder", t);
80
+ a !== _p$?.a && setAttribute(_el$5, "aria-label", a);
81
+ });
82
+ return _el$;
83
+ }
84
+ delegateEvents(["input", "keydown"]);
85
+ //#endregion
86
+ export { Terminal };
@@ -1,9 +1,9 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { mergeProps, spread, template } from "solid-js/web";
2
+ import { spread, template } from "@solidjs/web";
3
3
  import { mergeProps as mergeProps$1, splitProps } from "solid-js";
4
4
  import { useFieldContext } from "@ark-ui/solid/field";
5
5
  //#region src/components/textarea/index.tsx
6
- var _tmpl$ = /*#__PURE__*/ template(`<textarea>`);
6
+ var _tmpl$ = /* @__PURE__ */ template(`<textarea>`);
7
7
  /** The bare multi-line input: the field recipe on a `<textarea>`, sized
8
8
  * by rows and resizable in the block direction. Standing alone it styles
9
9
  * itself from the `invalid` prop; inside a `Field.Root` it consumes the
@@ -17,9 +17,9 @@ function Textarea(props) {
17
17
  "invalid",
18
18
  "onValueChange"
19
19
  ]);
20
- return (() => {
21
- var _el$ = _tmpl$();
22
- spread(_el$, mergeProps(() => mergeProps$1(() => field?.().getTextareaProps() ?? {}, rest, {
20
+ var _el$ = _tmpl$();
21
+ spread(_el$, () => {
22
+ return mergeProps$1(() => field?.().getTextareaProps() ?? {}, rest, {
23
23
  get value() {
24
24
  return own.value;
25
25
  },
@@ -29,9 +29,9 @@ function Textarea(props) {
29
29
  return own.invalid || field?.().getTextareaProps()["data-invalid"] != null ? "" : void 0;
30
30
  },
31
31
  onInput: (event) => own.onValueChange?.(event.currentTarget.value)
32
- })), false, false);
33
- return _el$;
34
- })();
32
+ });
33
+ }, false);
34
+ return _el$;
35
35
  }
36
36
  //#endregion
37
37
  export { Textarea };
@@ -1,7 +1,13 @@
1
- import { Component } from "solid-js";
1
+ import { Component, JSX } from "solid-js";
2
2
  //#region src/components/timeline/index.d.ts
3
- export declare const Timeline: Component<Record<string, unknown>> & {
4
- Root: Component<Record<string, unknown>>;
3
+ declare function Root(props: JSX.HTMLAttributes<HTMLOListElement> & {
4
+ orientation?: "vertical" | "horizontal";
5
+ }): JSX.Element;
6
+ declare namespace Root {
7
+ var displayName: string;
8
+ }
9
+ export declare const Timeline: typeof Root & {
10
+ Root: typeof Root;
5
11
  Item: Component<Record<string, unknown>>;
6
12
  Marker: Component<Record<string, unknown>>;
7
13
  Content: Component<Record<string, unknown>>;
@@ -1,6 +1,8 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { createComponent, mergeProps } from "solid-js/web";
2
+ import { createComponent, mergeProps, spread, template } from "@solidjs/web";
3
+ import { splitProps } from "solid-js";
3
4
  //#region src/components/timeline/index.tsx
5
+ var _tmpl$ = /* @__PURE__ */ template(`<ol>`);
4
6
  /** A line of moments: Root is the ordered thread, Item one moment on it,
5
7
  * Marker the point where the thread passes, Content what the moment
6
8
  * holds. The hairline between markers is drawn by the stylesheet. */
@@ -8,13 +10,26 @@ function part(name, tag) {
8
10
  return ((props) => {
9
11
  return createComponent(tag, mergeProps(props, {
10
12
  "data-scope": "timeline",
11
- get ["data-part"]() {
13
+ get "data-part"() {
12
14
  return name.toLowerCase();
13
15
  }
14
16
  }));
15
17
  });
16
18
  }
17
- const Root = part("Root", "ol");
19
+ function Root(props) {
20
+ injectComponentStyle("timeline");
21
+ const [own, rest] = splitProps(props, ["orientation"]);
22
+ var _el$ = _tmpl$();
23
+ spread(_el$, [rest, {
24
+ "data-scope": "timeline",
25
+ "data-part": "root",
26
+ get "data-orientation"() {
27
+ return own.orientation ?? "vertical";
28
+ }
29
+ }], false);
30
+ return _el$;
31
+ }
32
+ Root.displayName = "TimelineRoot";
18
33
  const Item = part("Item", "li");
19
34
  const Marker = part("Marker", "span");
20
35
  const Content = part("Content", "div");
@@ -1,7 +1,2 @@
1
- import { Toc as Toc$1 } from "@ark-ui/solid/toc";
2
- //#region src/components/toc/index.d.ts
3
- /** Ark's Toc, dressed in the paper-and-ink system: a quiet rail of links
4
- * beside the scroll, one stroke of primary ink marking where the reader
5
- * stands. The API is Ark's own — Root, Title, List, Item, Link, Indicator. */
6
- export declare const Toc: typeof Toc$1;
7
- //#endregion
1
+ import { t as Toc } from "../../index-DdsnfV4f.mjs";
2
+ export { Toc };
@@ -1,10 +1,2 @@
1
- import { injectComponentStyle } from "@bysages/core";
2
- import { Toc as Toc$1 } from "@ark-ui/solid/toc";
3
- //#region src/components/toc/index.ts
4
- /** Ark's Toc, dressed in the paper-and-ink system: a quiet rail of links
5
- * beside the scroll, one stroke of primary ink marking where the reader
6
- * stands. The API is Ark's own — Root, Title, List, Item, Link, Indicator. */
7
- const Toc = Toc$1;
8
- injectComponentStyle("toc");
9
- //#endregion
1
+ import { t as Toc } from "../../toc-CZmYEaQR.mjs";
10
2
  export { Toc };
@@ -1,11 +1,11 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { createComponent, mergeProps } from "solid-js/web";
2
+ import { createComponent, mergeProps } from "@solidjs/web";
3
3
  import { splitProps } from "solid-js";
4
4
  import { ToggleGroup as ToggleGroup$1 } from "@ark-ui/solid/toggle-group";
5
5
  //#region src/components/toggle-group/index.tsx
6
6
  function ToggleGroupRoot(props) {
7
7
  const [own, rest] = splitProps(props, ["size"]);
8
- return createComponent(ToggleGroup$1.Root, mergeProps(rest, { get ["data-size"]() {
8
+ return createComponent(ToggleGroup$1.Root, mergeProps(rest, { get "data-size"() {
9
9
  return own.size ?? "md";
10
10
  } }));
11
11
  }
@@ -0,0 +1,17 @@
1
+ import { JSX } from "solid-js";
2
+ //#region src/components/toolbar/index.d.ts
3
+ export interface ToolbarProps extends JSX.HTMLAttributes<HTMLDivElement> {
4
+ /** Accessible name when more than one toolbar shares a page. */
5
+ label?: string;
6
+ /** Tools at the leading edge; `children` land here when no start is
7
+ * given. */
8
+ start?: JSX.Element;
9
+ /** Tools at the trailing edge. */
10
+ end?: JSX.Element;
11
+ children?: JSX.Element;
12
+ }
13
+ /** A workbench rail: the start tools at the leading edge, the end tools
14
+ * at the trailing, the rail itself carrying the toolbar role so
15
+ * assistive tech reads it as one group of commands. */
16
+ export declare function Toolbar(props: ToolbarProps): JSX.Element;
17
+ //#endregion
@@ -0,0 +1,46 @@
1
+ import { injectComponentStyle } from "@bysages/core";
2
+ import { createComponent, insert, spread, template } from "@solidjs/web";
3
+ import { Show, splitProps } from "solid-js";
4
+ //#region src/components/toolbar/index.tsx
5
+ var _tmpl$ = /* @__PURE__ */ template(`<div data-scope=toolbar data-part=group data-edge=end>`);
6
+ var _tmpl$2 = /* @__PURE__ */ template(`<div><div data-scope=toolbar data-part=group data-edge=start>`);
7
+ /** A workbench rail: the start tools at the leading edge, the end tools
8
+ * at the trailing, the rail itself carrying the toolbar role so
9
+ * assistive tech reads it as one group of commands. */
10
+ function Toolbar(props) {
11
+ injectComponentStyle("toolbar");
12
+ const [own, rest] = splitProps(props, [
13
+ "label",
14
+ "start",
15
+ "end",
16
+ "children"
17
+ ]);
18
+ var _el$ = _tmpl$2();
19
+ var _el$2 = _el$.firstChild;
20
+ spread(_el$, [rest, {
21
+ role: "toolbar",
22
+ get "aria-label"() {
23
+ return own.label;
24
+ },
25
+ "data-scope": "toolbar",
26
+ "data-part": "root"
27
+ }], true);
28
+ insert(_el$2, () => {
29
+ return own.start ?? own.children;
30
+ });
31
+ insert(_el$, createComponent(Show, {
32
+ get when() {
33
+ return own.end;
34
+ },
35
+ get children() {
36
+ var _el$3 = _tmpl$();
37
+ insert(_el$3, () => {
38
+ return own.end;
39
+ });
40
+ return _el$3;
41
+ }
42
+ }), null);
43
+ return _el$;
44
+ }
45
+ //#endregion
46
+ export { Toolbar };
@@ -1,25 +1,25 @@
1
1
  import { Button } from "../button/index.mjs";
2
- import { Input } from "../input/index.mjs";
2
+ import { n as useComponentMessages, t as formatComponentMessage } from "../../use-component-messages-C4SCVYjD.mjs";
3
+ import { t as Input } from "../../input-DoFQ7RXh.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core";
4
- import { createComponent, insert, mergeProps, setAttribute, spread, template } from "solid-js/web";
5
+ import { createComponent, insert, setAttribute, spread, template } from "@solidjs/web";
5
6
  import { For, Show, createSignal, splitProps } from "solid-js";
6
7
  import { Checkbox } from "@ark-ui/solid/checkbox";
7
8
  //#region src/components/transfer/index.tsx
8
- var _tmpl$ = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
9
- var _tmpl$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.75 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
10
- var _tmpl$3 = /*#__PURE__*/ template(`<div data-scope=transfer data-part=search>`);
11
- var _tmpl$4 = /*#__PURE__*/ template(`<div data-scope=transfer data-part=panel><div data-scope=transfer data-part=head><span data-scope=transfer data-part=title></span><span data-scope=transfer data-part=count></span></div><div data-scope=transfer data-part=list>`);
12
- var _tmpl$5 = /*#__PURE__*/ template(`<p data-scope=transfer data-part=empty>Nothing here`);
13
- var _tmpl$6 = /*#__PURE__*/ template(`<div><div data-scope=transfer data-part=operations>`);
9
+ var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
10
+ var _tmpl$2 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.75 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
11
+ var _tmpl$3 = /* @__PURE__ */ template(`<div data-scope=transfer data-part=search>`);
12
+ var _tmpl$4 = /* @__PURE__ */ template(`<div data-scope=transfer data-part=panel><div data-scope=transfer data-part=head><span data-scope=transfer data-part=title></span><span data-scope=transfer data-part=count></span></div><div data-scope=transfer data-part=list>`);
13
+ var _tmpl$5 = /* @__PURE__ */ template(`<p data-scope=transfer data-part=empty>Nothing here`);
14
+ var _tmpl$6 = /* @__PURE__ */ template(`<div><div data-scope=transfer data-part=operations><!><!></div><!>`);
14
15
  function checkGlyph() {
15
16
  return _tmpl$();
16
17
  }
17
18
  function arrowGlyph(direction) {
18
- return (() => {
19
- var _el$2 = _tmpl$2(), _el$3 = _el$2.firstChild;
20
- setAttribute(_el$3, "d", direction === "right" ? "M5 12h14m-6-6 6 6-6 6" : "M19 12H5m6-6-6 6 6 6");
21
- return _el$2;
22
- })();
19
+ var _el$2 = _tmpl$2();
20
+ var _el$3 = _el$2.firstChild;
21
+ setAttribute(_el$3, "d", direction === "right" ? "M5 12h14m-6-6 6 6-6 6" : "M19 12H5m6-6-6 6 6 6");
22
+ return _el$2;
23
23
  }
24
24
  /**
25
25
  * Two ledgers and a crossing: items sit in the source column until the
@@ -29,6 +29,7 @@ function arrowGlyph(direction) {
29
29
  * panel.
30
30
  */
31
31
  function Transfer(props) {
32
+ const messages = useComponentMessages();
32
33
  injectComponentStyle("transfer");
33
34
  injectComponentStyle("checkbox");
34
35
  const [own, rest] = splitProps(props, [
@@ -61,106 +62,124 @@ function Transfer(props) {
61
62
  own.onValueChange?.(next);
62
63
  }
63
64
  function panel(side, title, query, setQuery, checked, setChecked, items) {
64
- return (() => {
65
- var _el$4 = _tmpl$4(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
66
- setAttribute(_el$4, "data-side", side);
67
- insert(_el$6, title);
68
- insert(_el$7, () => String(items.length));
69
- insert(_el$4, createComponent(Show, {
70
- get when() {
71
- return own.searchable;
72
- },
73
- get children() {
74
- var _el$8 = _tmpl$3();
75
- insert(_el$8, createComponent(Input, {
76
- size: "sm",
77
- get value() {
78
- return query();
79
- },
80
- onValueChange: setQuery,
81
- placeholder: "Filter…",
82
- "aria-label": `Filter ${title}`
83
- }));
84
- return _el$8;
85
- }
86
- }), _el$9);
87
- insert(_el$9, createComponent(Show, {
88
- get when() {
89
- return items.length > 0;
90
- },
91
- get fallback() {
92
- return _tmpl$5();
93
- },
94
- get children() {
95
- return createComponent(For, {
96
- each: items,
97
- children: (item) => createComponent(Checkbox.Root, {
98
- get checked() {
99
- return checked().has(item.value);
100
- },
101
- get disabled() {
102
- return own.disabled || item.disabled === true;
103
- },
104
- onCheckedChange: () => toggle(checked(), item.value, setChecked),
105
- get children() {
106
- return [
107
- createComponent(Checkbox.Control, { get children() {
108
- return createComponent(Checkbox.Indicator, { get children() {
109
- return checkGlyph();
110
- } });
111
- } }),
112
- createComponent(Checkbox.Label, {
113
- "data-part": "label",
114
- get children() {
115
- return item.label;
116
- }
117
- }),
118
- createComponent(Checkbox.HiddenInput, {})
119
- ];
120
- }
121
- })
122
- });
123
- }
124
- }));
125
- return _el$4;
126
- })();
127
- }
128
- return (() => {
129
- var _el$1 = _tmpl$6(), _el$10 = _el$1.firstChild;
130
- spread(_el$1, mergeProps(rest, {
131
- "data-scope": "transfer",
132
- "data-part": "root"
133
- }), false, true);
134
- insert(_el$1, () => panel("source", own.titles?.[0] ?? "Source", sourceQuery, setSourceQuery, checkedSource, setCheckedSource, panelItems(own.data, false, sourceQuery())), _el$10);
135
- insert(_el$10, createComponent(Button, {
136
- variant: "outline",
137
- size: "sm",
138
- square: true,
139
- get disabled() {
140
- return checkedSource().size === 0 || own.disabled;
65
+ var _el$4 = _tmpl$4();
66
+ var _el$5 = _el$4.firstChild;
67
+ var _el$6 = _el$5.firstChild;
68
+ var _el$7 = _el$6.nextSibling;
69
+ var _el$9 = _el$5.nextSibling;
70
+ setAttribute(_el$4, "data-side", side);
71
+ insert(_el$6, title);
72
+ insert(_el$7, () => {
73
+ return String(items.length);
74
+ });
75
+ insert(_el$4, createComponent(Show, {
76
+ get when() {
77
+ return own.searchable;
141
78
  },
142
- "aria-label": "Move right",
143
- onClick: () => move(true),
144
79
  get children() {
145
- return arrowGlyph("right");
80
+ var _el$8 = _tmpl$3();
81
+ insert(_el$8, createComponent(Input, {
82
+ size: "sm",
83
+ get value() {
84
+ return query();
85
+ },
86
+ onValueChange: setQuery,
87
+ get placeholder() {
88
+ return formatComponentMessage(messages().transfer.filter, { name: title });
89
+ },
90
+ get "aria-label"() {
91
+ return formatComponentMessage(messages().transfer.filter, { name: title });
92
+ }
93
+ }));
94
+ return _el$8;
146
95
  }
147
- }), null);
148
- insert(_el$10, createComponent(Button, {
149
- variant: "outline",
150
- size: "sm",
151
- square: true,
152
- get disabled() {
153
- return checkedTarget().size === 0 || own.disabled;
96
+ }), _el$9);
97
+ insert(_el$9, createComponent(Show, {
98
+ get when() {
99
+ return items.length > 0;
100
+ },
101
+ get fallback() {
102
+ return _tmpl$5();
154
103
  },
155
- "aria-label": "Move left",
156
- onClick: () => move(false),
157
104
  get children() {
158
- return arrowGlyph("left");
105
+ return createComponent(For, {
106
+ each: items,
107
+ children: (item) => createComponent(Checkbox.Root, {
108
+ get checked() {
109
+ return checked().has(item.value);
110
+ },
111
+ get disabled() {
112
+ return own.disabled || item.disabled === true;
113
+ },
114
+ onCheckedChange: () => toggle(checked(), item.value, setChecked),
115
+ get children() {
116
+ return [
117
+ createComponent(Checkbox.Control, { get children() {
118
+ return createComponent(Checkbox.Indicator, { get children() {
119
+ return checkGlyph();
120
+ } });
121
+ } }),
122
+ createComponent(Checkbox.Label, {
123
+ "data-part": "label",
124
+ get children() {
125
+ return item.label;
126
+ }
127
+ }),
128
+ createComponent(Checkbox.HiddenInput, {})
129
+ ];
130
+ }
131
+ })
132
+ });
159
133
  }
160
- }), null);
161
- insert(_el$1, () => panel("target", own.titles?.[1] ?? "Target", targetQuery, setTargetQuery, checkedTarget, setCheckedTarget, panelItems(own.data, true, targetQuery())), null);
162
- return _el$1;
163
- })();
134
+ }));
135
+ return _el$4;
136
+ }
137
+ var _el$11 = _tmpl$6();
138
+ var _el$12 = _el$11.firstChild;
139
+ var _el$13 = _el$12.firstChild;
140
+ var _el$14 = _el$13.nextSibling;
141
+ var _el$15 = _el$12.nextSibling;
142
+ spread(_el$11, [rest, {
143
+ "data-scope": "transfer",
144
+ "data-part": "root"
145
+ }], true);
146
+ insert(_el$11, () => {
147
+ return panel("source", own.titles?.[0] ?? "Source", sourceQuery, setSourceQuery, checkedSource, setCheckedSource, panelItems(own.data, false, sourceQuery()));
148
+ }, _el$12);
149
+ insert(_el$12, createComponent(Button, {
150
+ variant: "outline",
151
+ size: "sm",
152
+ square: true,
153
+ get disabled() {
154
+ return checkedSource().size === 0 || own.disabled;
155
+ },
156
+ get "aria-label"() {
157
+ return messages().transfer.moveRight;
158
+ },
159
+ onClick: () => move(true),
160
+ get children() {
161
+ return arrowGlyph("right");
162
+ }
163
+ }), _el$13);
164
+ insert(_el$12, createComponent(Button, {
165
+ variant: "outline",
166
+ size: "sm",
167
+ square: true,
168
+ get disabled() {
169
+ return checkedTarget().size === 0 || own.disabled;
170
+ },
171
+ get "aria-label"() {
172
+ return messages().transfer.moveLeft;
173
+ },
174
+ onClick: () => move(false),
175
+ get children() {
176
+ return arrowGlyph("left");
177
+ }
178
+ }), _el$14);
179
+ insert(_el$11, () => {
180
+ return panel("target", own.titles?.[1] ?? "Target", targetQuery, setTargetQuery, checkedTarget, setCheckedTarget, panelItems(own.data, true, targetQuery()));
181
+ }, _el$15);
182
+ return _el$11;
164
183
  }
165
184
  //#endregion
166
185
  export { Transfer };