@bysages/react 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 (92) hide show
  1. package/README.md +16 -2
  2. package/dist/{ai-response-jZy-0Tvv.mjs → ai-response-BfKTmtCt.mjs} +8 -4
  3. package/dist/components/ai/index.d.mts +2 -2
  4. package/dist/components/ai/index.mjs +32 -17
  5. package/dist/components/ai-attachments/index.mjs +3 -1
  6. package/dist/components/ai-prompt-input/index.d.mts +1 -1
  7. package/dist/components/ai-prompt-input/index.mjs +8 -4
  8. package/dist/components/ai-response/index.d.mts +4 -2
  9. package/dist/components/ai-response/index.mjs +1 -1
  10. package/dist/components/autocomplete/index.mjs +3 -1
  11. package/dist/components/avatar/index.d.mts +4 -1
  12. package/dist/components/avatar/index.mjs +3 -2
  13. package/dist/components/banner/index.mjs +21 -17
  14. package/dist/components/bento/index.d.mts +26 -0
  15. package/dist/components/bento/index.mjs +41 -0
  16. package/dist/components/block-ui/index.d.mts +12 -0
  17. package/dist/components/block-ui/index.mjs +24 -0
  18. package/dist/components/breadcrumb/index.d.mts +3 -8
  19. package/dist/components/breadcrumb/index.mjs +11 -1
  20. package/dist/components/browser/index.d.mts +23 -0
  21. package/dist/components/browser/index.mjs +70 -0
  22. package/dist/components/cascade-select/index.mjs +15 -5
  23. package/dist/components/command/index.mjs +9 -3
  24. package/dist/components/config-provider/index.d.mts +5 -2
  25. package/dist/components/config-provider/index.mjs +3 -2
  26. package/dist/components/data-view/index.d.mts +18 -0
  27. package/dist/components/data-view/index.mjs +66 -0
  28. package/dist/components/deferred-content/index.d.mts +16 -0
  29. package/dist/components/deferred-content/index.mjs +34 -0
  30. package/dist/components/descriptions/index.d.mts +13 -5
  31. package/dist/components/descriptions/index.mjs +20 -2
  32. package/dist/components/dock/index.d.mts +25 -0
  33. package/dist/components/dock/index.mjs +51 -0
  34. package/dist/components/dynamic-input/index.mjs +4 -2
  35. package/dist/components/file-upload/index.d.mts +8 -1
  36. package/dist/components/file-upload/index.mjs +20 -1
  37. package/dist/components/float-button/index.mjs +3 -1
  38. package/dist/components/form/index.mjs +1 -1
  39. package/dist/components/icon/index.d.mts +10 -5
  40. package/dist/components/icon/index.mjs +7 -7
  41. package/dist/components/image/index.d.mts +7 -1
  42. package/dist/components/image/index.mjs +3 -1
  43. package/dist/components/image-viewer/index.d.mts +7 -1
  44. package/dist/components/image-viewer/index.mjs +8 -4
  45. package/dist/components/input/index.d.mts +4 -1
  46. package/dist/components/input/index.mjs +1 -20
  47. package/dist/components/json-tree-view/index.d.mts +3 -3
  48. package/dist/components/json-tree-view/index.mjs +17 -4
  49. package/dist/components/layout/index.mjs +3 -1
  50. package/dist/components/list/index.d.mts +5 -4
  51. package/dist/components/list/index.mjs +10 -1
  52. package/dist/components/menubar/index.mjs +1 -0
  53. package/dist/components/order-list/index.d.mts +21 -0
  54. package/dist/components/order-list/index.mjs +161 -0
  55. package/dist/components/result/index.d.mts +31 -0
  56. package/dist/components/result/index.mjs +59 -0
  57. package/dist/components/select/index.d.mts +2 -17
  58. package/dist/components/select/index.mjs +2 -18
  59. package/dist/components/spinner/index.mjs +3 -1
  60. package/dist/components/split-button/index.mjs +3 -1
  61. package/dist/components/spotlight/index.d.mts +12 -0
  62. package/dist/components/spotlight/index.mjs +33 -0
  63. package/dist/components/steps/index.d.mts +5 -1
  64. package/dist/components/steps/index.mjs +10 -1
  65. package/dist/components/table/index.mjs +19 -15
  66. package/dist/components/tabs/index.d.mts +3 -1
  67. package/dist/components/tabs/index.mjs +3 -2
  68. package/dist/components/terminal/index.d.mts +17 -0
  69. package/dist/components/terminal/index.mjs +68 -0
  70. package/dist/components/timeline/index.d.mts +13 -11
  71. package/dist/components/timeline/index.mjs +11 -1
  72. package/dist/components/toc/index.d.mts +7 -1
  73. package/dist/components/toc/index.mjs +13 -1
  74. package/dist/components/toolbar/index.d.mts +17 -0
  75. package/dist/components/toolbar/index.mjs +29 -0
  76. package/dist/components/transfer/index.mjs +7 -5
  77. package/dist/components/tree-select/index.mjs +5 -3
  78. package/dist/components/tree-view/index.d.mts +10 -1
  79. package/dist/components/tree-view/index.mjs +22 -1
  80. package/dist/components/user/index.d.mts +20 -0
  81. package/dist/components/user/index.mjs +42 -0
  82. package/dist/components/virtual-list/index.d.mts +17 -0
  83. package/dist/components/virtual-list/index.mjs +53 -0
  84. package/dist/glyph-VI989p8H.mjs +14 -0
  85. package/dist/{index-DaAbbSz9.d.mts → index-Dn5mHf1g.d.mts} +738 -3786
  86. package/dist/index-Iy8m0Qev.d.mts +42 -0
  87. package/dist/index.d.mts +16 -3
  88. package/dist/index.mjs +28 -15
  89. package/dist/input-2oezH-dY.mjs +58 -0
  90. package/dist/messages-1jJWtaYU.mjs +16 -0
  91. package/dist/select-eAHutw56.mjs +70 -0
  92. package/package.json +30 -9
@@ -13,7 +13,11 @@ declare function StepsRoot({ size, ...rest }: StepsRootProps): import("react").J
13
13
  * PrevTrigger, NextTrigger, Progress. Indicator and Separator carry
14
14
  * data-complete / data-current / data-incomplete.
15
15
  */
16
- export declare const Steps: Omit<typeof Steps$1, "Root"> & {
16
+ /** The machine wraps each tab in an item div; presentation keeps the
17
+ * tablist owned children legal while the tab itself keeps its role. */
18
+ declare function StepsItem(props: ComponentProps<typeof Steps$1.Item>): import("react").JSX.Element;
19
+ export declare const Steps: Omit<typeof Steps$1, "Root" | "Item"> & {
17
20
  Root: typeof StepsRoot;
21
+ Item: typeof StepsItem;
18
22
  };
19
23
  //#endregion
@@ -15,9 +15,18 @@ function StepsRoot({ size = "md", ...rest }) {
15
15
  * PrevTrigger, NextTrigger, Progress. Indicator and Separator carry
16
16
  * data-complete / data-current / data-incomplete.
17
17
  */
18
+ /** The machine wraps each tab in an item div; presentation keeps the
19
+ * tablist owned children legal while the tab itself keeps its role. */
20
+ function StepsItem(props) {
21
+ return /* @__PURE__ */ jsx(Steps$1.Item, {
22
+ ...props,
23
+ role: "presentation"
24
+ });
25
+ }
18
26
  const Steps = {
19
27
  ...Steps$1,
20
- Root: StepsRoot
28
+ Root: StepsRoot,
29
+ Item: StepsItem
21
30
  };
22
31
  injectComponentStyle("steps");
23
32
  //#endregion
@@ -1,5 +1,6 @@
1
+ import { n as useComponentMessages, t as formatMessage } from "../../messages-1jJWtaYU.mjs";
1
2
  import { Pagination } from "../pagination/index.mjs";
2
- import { Select as Select$1 } from "../select/index.mjs";
3
+ import { t as Select$1 } from "../../select-eAHutw56.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { useEffect, useLayoutEffect, useMemo, useReducer, useRef } from "react";
@@ -121,8 +122,10 @@ function DataTable(rawProps) {
121
122
  10,
122
123
  20,
123
124
  50
124
- ], globalFilterPlaceholder = "Filter rows", emptyText = "No rows", reorderable = false } = props;
125
+ ], globalFilterPlaceholder, emptyText, reorderable = false } = props;
125
126
  const merge = props.merge;
127
+ const messages = useComponentMessages();
128
+ const globalFilterText = globalFilterPlaceholder ?? messages.table.filterAll;
126
129
  const virtual = virtualProp && !merge;
127
130
  const mergeMode = !virtualProp && !!merge;
128
131
  /** Features follow the construction-time switches: sorting, selection,
@@ -435,7 +438,7 @@ function DataTable(rawProps) {
435
438
  checked: row.getIsSelected(),
436
439
  indeterminate: false,
437
440
  onToggle: () => row.toggleSelected(!row.getIsSelected()),
438
- label: "Select row"
441
+ label: messages.table.selectRow
439
442
  });
440
443
  else if (isExpandHost) content = /* @__PURE__ */ jsxs("div", {
441
444
  "data-scope": "table",
@@ -447,7 +450,7 @@ function DataTable(rawProps) {
447
450
  "data-part": "expander",
448
451
  "data-expanded": row.getIsExpanded() || void 0,
449
452
  "data-leaf": !row.getCanExpand() || void 0,
450
- "aria-label": row.getIsExpanded() ? "Collapse row" : "Expand row",
453
+ "aria-label": row.getIsExpanded() ? messages.table.collapseRow : messages.table.expandRow,
451
454
  onClick: () => row.toggleExpanded(),
452
455
  children: /* @__PURE__ */ jsx(ChevronGlyph, {})
453
456
  }), /* @__PURE__ */ jsx(FlexRender, { cell })]
@@ -492,9 +495,9 @@ function DataTable(rawProps) {
492
495
  type: "text",
493
496
  "data-scope": "table",
494
497
  "data-part": "header-filter",
495
- "aria-label": `Filter ${column.id}`,
498
+ "aria-label": formatMessage(messages.table.filterColumn, { name: column.id }),
496
499
  value: column.getFilterValue() ?? "",
497
- placeholder: "Filter",
500
+ placeholder: messages.command.filter,
498
501
  draggable: false,
499
502
  onClick: (e) => e.stopPropagation(),
500
503
  onDragStart: (e) => e.stopPropagation(),
@@ -548,7 +551,7 @@ function DataTable(rawProps) {
548
551
  checked: all,
549
552
  indeterminate: table.getIsSomeRowsSelected() && !all,
550
553
  onToggle: () => table.toggleAllRowsSelected(!all),
551
- label: "Select all rows"
554
+ label: messages.table.selectAllRows
552
555
  })
553
556
  }, column.id);
554
557
  }
@@ -568,7 +571,7 @@ function DataTable(rawProps) {
568
571
  children: [virtual ? virtualRows.map((_, index) => renderRow(rows[index], index)) : rows.map((row) => renderRow(row, -1)), rows.length === 0 ? /* @__PURE__ */ jsx("div", {
569
572
  "data-scope": "table",
570
573
  "data-part": "empty",
571
- children: emptyText
574
+ children: emptyText ?? messages.table.empty
572
575
  }) : null]
573
576
  });
574
577
  const hasFooters = table.getFooterGroups().some((group) => group.headers.some((header) => header.column.columnDef.footer));
@@ -581,7 +584,7 @@ function DataTable(rawProps) {
581
584
  "data-scope": "table",
582
585
  "data-part": "row",
583
586
  children: group.headers.map((header) => /* @__PURE__ */ jsx("div", {
584
- role: "columnheader",
587
+ role: "cell",
585
588
  "data-scope": "table",
586
589
  "data-part": "footer-cell",
587
590
  "data-numeric": header.column.columnDef.meta?.numeric ? "" : void 0,
@@ -596,7 +599,7 @@ function DataTable(rawProps) {
596
599
  const pagination = table.atoms.pagination.get();
597
600
  const rowCount = table.getRowCount();
598
601
  const sizeItems = createListCollection({ items: pageSizeOptions.map((size) => ({
599
- label: `${size} / page`,
602
+ label: formatMessage(messages.table.perPage, { size }),
600
603
  value: String(size)
601
604
  })) });
602
605
  const pageSize = /* @__PURE__ */ jsxs(Select$1.Root, {
@@ -605,7 +608,7 @@ function DataTable(rawProps) {
605
608
  onValueChange: (details) => table.setPageSize(Number(details.value[0])),
606
609
  positioning: { placement: "top-start" },
607
610
  children: [/* @__PURE__ */ jsx(Select$1.Control, { children: /* @__PURE__ */ jsxs(Select$1.Trigger, {
608
- "aria-label": "Rows per page",
611
+ "aria-label": messages.table.rowsPerPage,
609
612
  children: [/* @__PURE__ */ jsx(Select$1.ValueText, {}), /* @__PURE__ */ jsx(Select$1.Indicator, { children: chevronDownGlyph() })]
610
613
  }) }), /* @__PURE__ */ jsx(Select$1.Positioner, { children: /* @__PURE__ */ jsx(Select$1.Content, { children: sizeItems.items.map((item) => /* @__PURE__ */ jsxs(Select$1.Item, {
611
614
  item,
@@ -630,10 +633,10 @@ function DataTable(rawProps) {
630
633
  return /* @__PURE__ */ jsxs("div", {
631
634
  "data-scope": "table",
632
635
  "data-part": "pagination",
633
- children: [/* @__PURE__ */ jsxs("span", {
636
+ children: [/* @__PURE__ */ jsx("span", {
634
637
  "data-scope": "table",
635
638
  "data-part": "page-status",
636
- children: [rowCount, " rows"]
639
+ children: formatMessage(messages.table.rowsCount, { count: rowCount })
637
640
  }), /* @__PURE__ */ jsxs("div", {
638
641
  "data-scope": "table",
639
642
  "data-part": "page-nav",
@@ -648,8 +651,8 @@ function DataTable(rawProps) {
648
651
  type: "search",
649
652
  "data-scope": "table",
650
653
  "data-part": "global-filter",
651
- "aria-label": "Filter all columns",
652
- placeholder: globalFilterPlaceholder,
654
+ "aria-label": messages.table.filterAll,
655
+ placeholder: globalFilterText,
653
656
  value: table.atoms.globalFilter.get() ?? "",
654
657
  onInput: (e) => table.setGlobalFilter(e.target.value)
655
658
  })
@@ -668,6 +671,7 @@ function DataTable(rawProps) {
668
671
  "data-scope": "table",
669
672
  "data-part": "viewport",
670
673
  ref: viewport,
674
+ tabIndex: 0,
671
675
  children: /* @__PURE__ */ jsxs("div", {
672
676
  role: "table",
673
677
  "data-scope": "table",
@@ -4,8 +4,10 @@ import { Tabs as Tabs$1 } from "@ark-ui/react/tabs";
4
4
  type TabsRootProps = ComponentProps<typeof Tabs$1.Root> & {
5
5
  /** One rung of the control-height ladder for the tab rows. */
6
6
  size?: "sm" | "md" | "lg";
7
+ /** The register: a ruled line (default), or each tab its own card. */
8
+ variant?: "line" | "card";
7
9
  };
8
- declare function TabsRoot({ size, ...rest }: TabsRootProps): import("react").JSX.Element;
10
+ declare function TabsRoot({ size, variant, ...rest }: TabsRootProps): import("react").JSX.Element;
9
11
  /**
10
12
  * Tabs — tabbed navigation.
11
13
  *
@@ -2,10 +2,11 @@ import { injectComponentStyle } from "@bysages/core";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { Tabs as Tabs$1 } from "@ark-ui/react/tabs";
4
4
  //#region src/components/tabs/index.tsx
5
- function TabsRoot({ size = "md", ...rest }) {
5
+ function TabsRoot({ size = "md", variant = "line", ...rest }) {
6
6
  return /* @__PURE__ */ jsx(Tabs$1.Root, {
7
7
  ...rest,
8
- "data-size": size
8
+ "data-size": size,
9
+ "data-variant": variant
9
10
  });
10
11
  }
11
12
  /**
@@ -0,0 +1,17 @@
1
+ import { HTMLAttributes } from "react";
2
+ //#region src/components/terminal/index.d.ts
3
+ export interface TerminalProps extends HTMLAttributes<HTMLDivElement> {
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({ lines, prompt, placeholder, label, onCommand, ...rest }: TerminalProps): import("react").JSX.Element;
17
+ //#endregion
@@ -0,0 +1,68 @@
1
+ import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
2
+ import { injectComponentStyle } from "@bysages/core";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useEffect, useRef, useState } from "react";
5
+ //#region src/components/terminal/index.tsx
6
+ /** A quiet console: the transcript above, the prompt line below. The
7
+ * component owns only the reading and the caret — each entered line
8
+ * leaves as an event, and the caller answers through the lines prop,
9
+ * so history stays theirs to shape. */
10
+ function Terminal({ lines = [], prompt = "$", placeholder, label, onCommand, ...rest }) {
11
+ injectComponentStyle("terminal");
12
+ const messages = useComponentMessages();
13
+ const commandLineLabel = label ?? messages.terminal.commandLine;
14
+ const [draft, setDraft] = useState("");
15
+ const scroll = useRef(null);
16
+ useEffect(() => {
17
+ scroll.current?.scrollTo({ top: scroll.current.scrollHeight });
18
+ }, [lines.length]);
19
+ function submit() {
20
+ const text = draft.trim();
21
+ if (!text) return;
22
+ setDraft("");
23
+ onCommand?.(text);
24
+ }
25
+ return /* @__PURE__ */ jsxs("div", {
26
+ ...rest,
27
+ role: "log",
28
+ "aria-label": commandLineLabel,
29
+ "data-scope": "terminal",
30
+ "data-part": "root",
31
+ children: [/* @__PURE__ */ jsx("div", {
32
+ ref: scroll,
33
+ "data-scope": "terminal",
34
+ "data-part": "scroll",
35
+ children: lines.map((line, index) => /* @__PURE__ */ jsx("div", {
36
+ "data-scope": "terminal",
37
+ "data-part": "line",
38
+ children: line
39
+ }, index))
40
+ }), /* @__PURE__ */ jsxs("div", {
41
+ "data-scope": "terminal",
42
+ "data-part": "entry",
43
+ children: [/* @__PURE__ */ jsx("span", {
44
+ "data-scope": "terminal",
45
+ "data-part": "sigil",
46
+ "aria-hidden": "true",
47
+ children: prompt
48
+ }), /* @__PURE__ */ jsx("input", {
49
+ "data-scope": "terminal",
50
+ "data-part": "input",
51
+ value: draft,
52
+ placeholder,
53
+ "aria-label": commandLineLabel,
54
+ spellCheck: false,
55
+ autoComplete: "off",
56
+ onInput: (event) => setDraft(event.target.value),
57
+ onKeyDown: (event) => {
58
+ if (event.key === "Enter") {
59
+ event.preventDefault();
60
+ submit();
61
+ }
62
+ }
63
+ })]
64
+ })]
65
+ });
66
+ }
67
+ //#endregion
68
+ export { Terminal };
@@ -1,23 +1,25 @@
1
+ import * as React from "react";
1
2
  import { HTMLAttributes } from "react";
2
3
  //#region src/components/timeline/index.d.ts
3
- export declare const Timeline: {
4
- ({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
5
- displayName: string;
6
- } & {
7
- Root: {
8
- ({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
9
- displayName: string;
10
- };
4
+ declare function Root({ orientation, children, ...rest }: HTMLAttributes<HTMLElement> & {
5
+ children?: React.ReactNode;
6
+ orientation?: "vertical" | "horizontal";
7
+ }): React.JSX.Element;
8
+ declare namespace Root {
9
+ var displayName: string;
10
+ }
11
+ export declare const Timeline: typeof Root & {
12
+ Root: typeof Root;
11
13
  Item: {
12
- ({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
14
+ ({ children, ...rest }: HTMLAttributes<HTMLElement>): React.JSX.Element;
13
15
  displayName: string;
14
16
  };
15
17
  Marker: {
16
- ({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
18
+ ({ children, ...rest }: HTMLAttributes<HTMLElement>): React.JSX.Element;
17
19
  displayName: string;
18
20
  };
19
21
  Content: {
20
- ({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
22
+ ({ children, ...rest }: HTMLAttributes<HTMLElement>): React.JSX.Element;
21
23
  displayName: string;
22
24
  };
23
25
  };
@@ -15,7 +15,17 @@ function part(name, tag) {
15
15
  Component.displayName = "Timeline" + name;
16
16
  return Component;
17
17
  }
18
- const Root = part("Root", "ol");
18
+ function Root({ orientation = "vertical", children, ...rest }) {
19
+ injectComponentStyle("timeline");
20
+ return /* @__PURE__ */ jsx("ol", {
21
+ ...rest,
22
+ "data-scope": "timeline",
23
+ "data-part": "root",
24
+ "data-orientation": orientation,
25
+ children
26
+ });
27
+ }
28
+ Root.displayName = "TimelineRoot";
19
29
  const Item = part("Item", "li");
20
30
  const Marker = part("Marker", "span");
21
31
  const Content = part("Content", "div");
@@ -1,7 +1,13 @@
1
+ import { ComponentProps } from "react";
1
2
  import { Toc as Toc$1 } from "@ark-ui/react/toc";
2
3
  //#region src/components/toc/index.d.ts
3
4
  /** Ark's Toc, dressed in the paper-and-ink system: a quiet rail of links
4
5
  * beside the scroll, one stroke of primary ink marking where the reader
5
6
  * stands. The API is Ark's own — Root, Title, List, Item, Link, Indicator. */
6
- export declare const Toc: typeof Toc$1;
7
+ /** The active stroke is decoration; hidden so the list reads as links
8
+ * alone. */
9
+ declare function TocIndicator(props: ComponentProps<typeof Toc$1.Indicator>): import("react").JSX.Element;
10
+ export declare const Toc: Omit<typeof Toc$1, "Indicator"> & {
11
+ Indicator: typeof TocIndicator;
12
+ };
7
13
  //#endregion
@@ -1,10 +1,22 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
+ import { jsx } from "react/jsx-runtime";
2
3
  import { Toc as Toc$1 } from "@ark-ui/react/toc";
3
4
  //#region src/components/toc/index.tsx
4
5
  /** Ark's Toc, dressed in the paper-and-ink system: a quiet rail of links
5
6
  * beside the scroll, one stroke of primary ink marking where the reader
6
7
  * stands. The API is Ark's own — Root, Title, List, Item, Link, Indicator. */
7
- const Toc = Toc$1;
8
+ /** The active stroke is decoration; hidden so the list reads as links
9
+ * alone. */
10
+ function TocIndicator(props) {
11
+ return /* @__PURE__ */ jsx(Toc$1.Indicator, {
12
+ ...props,
13
+ "aria-hidden": "true"
14
+ });
15
+ }
16
+ const Toc = {
17
+ ...Toc$1,
18
+ Indicator: TocIndicator
19
+ };
8
20
  injectComponentStyle("toc");
9
21
  //#endregion
10
22
  export { Toc };
@@ -0,0 +1,17 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ //#region src/components/toolbar/index.d.ts
3
+ export interface ToolbarProps extends 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?: ReactNode;
9
+ /** Tools at the trailing edge. */
10
+ end?: ReactNode;
11
+ children?: ReactNode;
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({ label, start, end, children, ...rest }: ToolbarProps): import("react").JSX.Element;
17
+ //#endregion
@@ -0,0 +1,29 @@
1
+ import { injectComponentStyle } from "@bysages/core";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/toolbar/index.tsx
4
+ /** A workbench rail: the start tools at the leading edge, the end tools
5
+ * at the trailing, the rail itself carrying the toolbar role so
6
+ * assistive tech reads it as one group of commands. */
7
+ function Toolbar({ label, start, end, children, ...rest }) {
8
+ injectComponentStyle("toolbar");
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ ...rest,
11
+ role: "toolbar",
12
+ "aria-label": label ?? void 0,
13
+ "data-scope": "toolbar",
14
+ "data-part": "root",
15
+ children: [/* @__PURE__ */ jsx("div", {
16
+ "data-scope": "toolbar",
17
+ "data-part": "group",
18
+ "data-edge": "start",
19
+ children: start ?? children
20
+ }), end ? /* @__PURE__ */ jsx("div", {
21
+ "data-scope": "toolbar",
22
+ "data-part": "group",
23
+ "data-edge": "end",
24
+ children: end
25
+ }) : null]
26
+ });
27
+ }
28
+ //#endregion
29
+ export { Toolbar };
@@ -1,5 +1,6 @@
1
+ import { n as useComponentMessages, t as formatMessage } from "../../messages-1jJWtaYU.mjs";
1
2
  import { Button } from "../button/index.mjs";
2
- import { Input } from "../input/index.mjs";
3
+ import { t as Input } from "../../input-2oezH-dY.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { useState } from "react";
@@ -36,6 +37,7 @@ function arrowGlyph(direction) {
36
37
  function Transfer({ value = [], data, titles = ["Source", "Target"], searchable = false, disabled = false, onValueChange, ...rest }) {
37
38
  injectComponentStyle("transfer");
38
39
  injectComponentStyle("checkbox");
40
+ const messages = useComponentMessages();
39
41
  const [checkedSource, setCheckedSource] = useState(() => /* @__PURE__ */ new Set());
40
42
  const [checkedTarget, setCheckedTarget] = useState(() => /* @__PURE__ */ new Set());
41
43
  const [sourceQuery, setSourceQuery] = useState("");
@@ -86,8 +88,8 @@ function Transfer({ value = [], data, titles = ["Source", "Target"], searchable
86
88
  size: "sm",
87
89
  value: query,
88
90
  onValueChange: onQuery,
89
- placeholder: "Filter…",
90
- "aria-label": `Filter ${title}`
91
+ placeholder: messages.transfer.filter,
92
+ "aria-label": formatMessage(messages.transfer.filter, { name: title })
91
93
  })
92
94
  }) : null,
93
95
  /* @__PURE__ */ jsx("div", {
@@ -133,7 +135,7 @@ function Transfer({ value = [], data, titles = ["Source", "Target"], searchable
133
135
  size: "sm",
134
136
  square: true,
135
137
  disabled: checkedSource.size === 0 || disabled,
136
- "aria-label": "Move right",
138
+ "aria-label": messages.transfer.moveRight,
137
139
  onClick: () => move(true),
138
140
  children: arrowGlyph("right")
139
141
  }), /* @__PURE__ */ jsx(Button, {
@@ -141,7 +143,7 @@ function Transfer({ value = [], data, titles = ["Source", "Target"], searchable
141
143
  size: "sm",
142
144
  square: true,
143
145
  disabled: checkedTarget.size === 0 || disabled,
144
- "aria-label": "Move left",
146
+ "aria-label": messages.transfer.moveLeft,
145
147
  onClick: () => move(false),
146
148
  children: arrowGlyph("left")
147
149
  })]
@@ -1,4 +1,5 @@
1
- import { Input } from "../input/index.mjs";
1
+ import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
2
+ import { t as Input } from "../../input-2oezH-dY.mjs";
2
3
  import { injectComponentStyle } from "@bysages/core";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { useMemo, useState } from "react";
@@ -44,6 +45,7 @@ function TreeSelectRow({ node, indexPath }) {
44
45
  function TreeSelect({ value, data, placeholder = "Select…", filterable = false, disabled = false, size = "md", onValueChange, ...rest }) {
45
46
  injectComponentStyle("tree-select");
46
47
  injectComponentStyle("tree-view");
48
+ const messages = useComponentMessages();
47
49
  const [open, setOpen] = useState(false);
48
50
  const [query, setQuery] = useState("");
49
51
  const filterFns = useFilter({ sensitivity: "base" });
@@ -128,8 +130,8 @@ function TreeSelect({ value, data, placeholder = "Select…", filterable = false
128
130
  size: "sm",
129
131
  value: query,
130
132
  onValueChange: setQuery,
131
- placeholder: "Filter…",
132
- "aria-label": "Filter options"
133
+ placeholder: messages.select.filter,
134
+ "aria-label": messages.select.filter
133
135
  })
134
136
  }) : null, /* @__PURE__ */ jsx("div", {
135
137
  "data-scope": "tree-select",
@@ -1,3 +1,4 @@
1
+ import { ComponentProps } from "react";
1
2
  import { CollectionItem } from "@ark-ui/react/collection";
2
3
  import { TreeView as TreeView$1, TreeViewRootComponentProps } from "@ark-ui/react/tree-view";
3
4
  //#region src/components/tree-view/index.d.ts
@@ -13,7 +14,15 @@ type TreeViewOwnProps = {
13
14
  size?: "sm" | "md" | "lg";
14
15
  };
15
16
  declare function TreeViewRoot<T extends CollectionItem>(props: TreeViewRootComponentProps<T, TreeViewOwnProps>): import("react").JSX.Element;
16
- export declare const TreeView: Omit<typeof TreeView$1, "Root"> & {
17
+ /** The node checkbox rides inside the branch control; the branch
18
+ * itself answers the keyboard, so the checkbox stays visual only. */
19
+ declare function TreeViewNodeCheckbox(props: ComponentProps<typeof TreeView$1.NodeCheckbox>): import("react").JSX.Element;
20
+ /** A branch is born with its chevron — the indicator stays a consumer's
21
+ * children to override, never a chore to remember. */
22
+ declare function TreeViewBranchIndicator(props: ComponentProps<typeof TreeView$1.BranchIndicator>): import("react").JSX.Element;
23
+ export declare const TreeView: Omit<typeof TreeView$1, "Root" | "NodeCheckbox" | "BranchIndicator"> & {
17
24
  Root: typeof TreeViewRoot;
25
+ NodeCheckbox: typeof TreeViewNodeCheckbox;
26
+ BranchIndicator: typeof TreeViewBranchIndicator;
18
27
  };
19
28
  //#endregion
@@ -1,5 +1,7 @@
1
+ import { t as glyphNode } from "../../glyph-VI989p8H.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { jsx } from "react/jsx-runtime";
4
+ import { chevron_right } from "@bysages/icons";
3
5
  import { TreeView as TreeView$1 } from "@ark-ui/react/tree-view";
4
6
  //#region src/components/tree-view/index.tsx
5
7
  function TreeViewRoot(props) {
@@ -9,9 +11,28 @@ function TreeViewRoot(props) {
9
11
  "data-size": size
10
12
  });
11
13
  }
14
+ /** The node checkbox rides inside the branch control; the branch
15
+ * itself answers the keyboard, so the checkbox stays visual only. */
16
+ function TreeViewNodeCheckbox(props) {
17
+ return /* @__PURE__ */ jsx(TreeView$1.NodeCheckbox, {
18
+ ...props,
19
+ "aria-hidden": "true"
20
+ });
21
+ }
22
+ /** A branch is born with its chevron — the indicator stays a consumer's
23
+ * children to override, never a chore to remember. */
24
+ function TreeViewBranchIndicator(props) {
25
+ const { children = glyphNode(chevron_right), ...rest } = props;
26
+ return /* @__PURE__ */ jsx(TreeView$1.BranchIndicator, {
27
+ ...rest,
28
+ children
29
+ });
30
+ }
12
31
  const TreeView = {
13
32
  ...TreeView$1,
14
- Root: TreeViewRoot
33
+ Root: TreeViewRoot,
34
+ NodeCheckbox: TreeViewNodeCheckbox,
35
+ BranchIndicator: TreeViewBranchIndicator
15
36
  };
16
37
  injectComponentStyle("tree-view");
17
38
  //#endregion
@@ -0,0 +1,20 @@
1
+ import { AvatarSize } from "../avatar/index.mjs";
2
+ import { HTMLAttributes, ReactNode } from "react";
3
+ //#region src/components/user/index.d.ts
4
+ export interface UserProps extends HTMLAttributes<HTMLDivElement> {
5
+ /** The person's name — the loud line. */
6
+ name: string;
7
+ /** The quiet echo beneath the name: a role, a title, an address. */
8
+ description?: string;
9
+ /** Seal diameter: one rung of the Avatar's own ladder. */
10
+ size?: AvatarSize;
11
+ src?: string;
12
+ shape?: "circle" | "square";
13
+ children?: ReactNode;
14
+ }
15
+ /** A person on one line: the seal before the words, the name and its
16
+ * quiet echo beneath. The mark is the Avatar itself — one component
17
+ * renders it here, so every size and shape the Avatar knows the user
18
+ * inherits; this row only lays the words out beside it. */
19
+ export declare function User({ name, description, size, src, shape, children, ...rest }: UserProps): import("react").JSX.Element;
20
+ //#endregion
@@ -0,0 +1,42 @@
1
+ import { Avatar } from "../avatar/index.mjs";
2
+ import { injectComponentStyle } from "@bysages/core";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/user/index.tsx
5
+ function initialsOf(name) {
6
+ return name.split(/\s+/).filter(Boolean).slice(0, 2).map((word) => word[0]?.toUpperCase() ?? "").join("");
7
+ }
8
+ /** A person on one line: the seal before the words, the name and its
9
+ * quiet echo beneath. The mark is the Avatar itself — one component
10
+ * renders it here, so every size and shape the Avatar knows the user
11
+ * inherits; this row only lays the words out beside it. */
12
+ function User({ name, description, size, src, shape = "circle", children, ...rest }) {
13
+ injectComponentStyle("user");
14
+ return /* @__PURE__ */ jsxs("div", {
15
+ ...rest,
16
+ "data-scope": "user",
17
+ "data-part": "root",
18
+ children: [/* @__PURE__ */ jsxs(Avatar.Root, {
19
+ size,
20
+ shape,
21
+ children: [src ? /* @__PURE__ */ jsx(Avatar.Image, { src }) : null, /* @__PURE__ */ jsx(Avatar.Fallback, { children: initialsOf(name) })]
22
+ }), /* @__PURE__ */ jsxs("div", {
23
+ "data-scope": "user",
24
+ "data-part": "meta",
25
+ children: [
26
+ /* @__PURE__ */ jsx("span", {
27
+ "data-scope": "user",
28
+ "data-part": "name",
29
+ children: name
30
+ }),
31
+ description ? /* @__PURE__ */ jsx("span", {
32
+ "data-scope": "user",
33
+ "data-part": "description",
34
+ children: description
35
+ }) : null,
36
+ children
37
+ ]
38
+ })]
39
+ });
40
+ }
41
+ //#endregion
42
+ export { User };
@@ -0,0 +1,17 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ //#region src/components/virtual-list/index.d.ts
3
+ export interface VirtualListProps extends HTMLAttributes<HTMLDivElement> {
4
+ items: unknown[];
5
+ /** The height every row occupies — fixed rows keep it simple. */
6
+ itemHeight?: number;
7
+ /** The viewport height the ledger scrolls within. */
8
+ height?: number | string;
9
+ /** Renders one record into its positioned row. */
10
+ renderItem?: (item: unknown, index: number) => ReactNode;
11
+ }
12
+ /** A ledger that only mounts the rows on stage: the viewport keeps its
13
+ * scroll length by a spacer sized from the row height, the rows
14
+ * themselves are positioned against it — a ten-thousand-row list
15
+ * costs the DOM a window, not the ledger. */
16
+ export declare function VirtualList({ items, itemHeight, height, renderItem, ...rest }: VirtualListProps): import("react").JSX.Element;
17
+ //#endregion