@viglet/viglet-design-system 2026.3.11 → 2026.3.12

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.
package/dist/bento.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { t as e } from "./utils-Fk5jmzzb.js";
3
- import { a as t, c as n, d as r, g as i, o as a, p as o, u as s } from "./badge-locale-DxDp8Q3S.js";
4
- import { A as c, C as l, D as u, E as d, L as f, M as p, O as m, R as h, S as g, T as _, _ as v, a as y, c as b, d as x, f as S, h as C, i as w, j as T, l as E, n as D, p as O, r as k, u as A, w as j, x as M, z as N } from "./user.context-Cr3GAQ_r.js";
5
- import { r as ee, t as te } from "./loading-provider-ClDkFPuv.js";
3
+ import { a as t, c as n, d as r, g as i, o as a, p as o, u as s } from "./badge-locale-Bx7m7tg2.js";
4
+ import { A as c, C as l, D as u, E as d, L as f, M as p, O as m, R as h, S as g, T as _, _ as v, a as y, c as b, d as x, f as S, h as C, i as w, j as T, l as E, n as D, p as O, r as k, u as A, w as j, x as M, z as N } from "./user.context-BXQ7lgg5.js";
5
+ import { r as ee, t as te } from "./loading-provider-D-_5G-08.js";
6
6
  import { Children as P, Fragment as ne, isValidElement as re, useEffect as F, useId as I, useMemo as L, useRef as R, useState as z, useSyncExternalStore as ie } from "react";
7
7
  import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
8
8
  import { useTranslation as U } from "react-i18next";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viglet/viglet-design-system",
3
- "version": "2026.3.11",
3
+ "version": "2026.3.12",
4
4
  "generatedBy": "scripts/emit-catalogue.mjs",
5
5
  "components": [
6
6
  {
@@ -2973,7 +2973,7 @@
2973
2973
  "deprecated": null,
2974
2974
  "example": null,
2975
2975
  "props": [],
2976
- "inheritedProps": 19,
2976
+ "inheritedProps": 20,
2977
2977
  "rules": []
2978
2978
  },
2979
2979
  {
@@ -4948,6 +4948,72 @@
4948
4948
  "inheritedProps": 291,
4949
4949
  "rules": []
4950
4950
  },
4951
+ {
4952
+ "name": "Tree",
4953
+ "specifier": "@viglet/viglet-design-system",
4954
+ "summary": "A hierarchy of named nodes, drawn the way an editor draws a working tree: folders that open and close, one tab stop, and the arrow keys moving between rows.",
4955
+ "description": "A hierarchy of named nodes, drawn the way an editor draws a working tree: folders that open\nand close, one tab stop, and the arrow keys moving between rows.\n\n**It takes nodes and never paths.** Splitting a string into segments is a platform question,\nand a package that picked a separator would be wrong on the consumer that does not use it.\n`treeFromPaths` is here for callers whose data really is a list of strings.\n\n**What a row says beyond its name is the caller's**, through `renderAfter` — a publish state,\na count, a badge. This owns the branching and none of the meaning.\n\nKeyboard, as the `tree` pattern asks: up and down move between visible rows, right opens a\nclosed folder and then steps into it, left closes an open one and then steps out to its\nparent, Home and End reach the ends, and Enter or Space selects.",
4956
+ "deprecated": null,
4957
+ "example": "<Tree label=\"Files\" nodes={treeFromPaths([\"src/app.ts\", \"src/lib/fs.ts\"])} />",
4958
+ "props": [
4959
+ {
4960
+ "name": "label",
4961
+ "type": "string",
4962
+ "optional": false,
4963
+ "summary": "What the tree is, for a screen reader."
4964
+ },
4965
+ {
4966
+ "name": "nodes",
4967
+ "type": "readonly TreeNode[]",
4968
+ "optional": false,
4969
+ "summary": ""
4970
+ },
4971
+ {
4972
+ "name": "compact",
4973
+ "type": "boolean | undefined",
4974
+ "optional": true,
4975
+ "summary": "Fold a run of folders that never branches into one row, `a/b/c`, the way an editor does."
4976
+ },
4977
+ {
4978
+ "name": "defaultExpanded",
4979
+ "type": "readonly string[] | undefined",
4980
+ "optional": true,
4981
+ "summary": ""
4982
+ },
4983
+ {
4984
+ "name": "expanded",
4985
+ "type": "readonly string[] | undefined",
4986
+ "optional": true,
4987
+ "summary": "The keys that are open."
4988
+ },
4989
+ {
4990
+ "name": "onExpandedChange",
4991
+ "type": "((next: readonly string[]) => void) | undefined",
4992
+ "optional": true,
4993
+ "summary": ""
4994
+ },
4995
+ {
4996
+ "name": "onSelect",
4997
+ "type": "((key: string, node: TreeNode) => void) | undefined",
4998
+ "optional": true,
4999
+ "summary": ""
5000
+ },
5001
+ {
5002
+ "name": "renderAfter",
5003
+ "type": "((node: TreeNode, key: string) => ReactNode) | undefined",
5004
+ "optional": true,
5005
+ "summary": "What a row shows after its name — a count, a state, a badge."
5006
+ },
5007
+ {
5008
+ "name": "selected",
5009
+ "type": "string | undefined",
5010
+ "optional": true,
5011
+ "summary": "The key that is current."
5012
+ }
5013
+ ],
5014
+ "inheritedProps": 277,
5015
+ "rules": []
5016
+ },
4951
5017
  {
4952
5018
  "name": "UserAvatar",
4953
5019
  "specifier": "@viglet/viglet-design-system",
@@ -6,7 +6,7 @@ import * as React from "react";
6
6
  * The react-hook-form provider around a form's fields. Spread `useForm()` into it
7
7
  * and build each field from `FormField`.
8
8
  */
9
- declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
9
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getErrors, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
10
10
  /**
11
11
  * One react-hook-form field: its `name` and `control`, and a `render` of
12
12
  * `FormItem`, `FormLabel`, `FormControl` and `FormMessage`.
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAA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tE;AAED,OAAO,EACL,IAAI,EAAE,WAAW,EACjB,eAAe,EAAE,SAAS,EAAE,QAAQ,EACpC,SAAS,EAAE,WAAW,EAAE,YAAY,EACrC,CAAA"}
@@ -34,6 +34,7 @@ export { Skeleton } from './skeleton';
34
34
  export { StickySaveBar } from './sticky-save-bar';
35
35
  export type { StickySaveBarProps, StickySaveBarVariant } from './sticky-save-bar';
36
36
  export { Slider } from './slider';
37
+ export { Tree, treeFromPaths, type TreeNode, type TreeProps } from './tree';
37
38
  export { toast, Toaster } from './sonner';
38
39
  export { Stepper } from './stepper';
39
40
  export { Switch } from './switch';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnJ,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC3G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtK,OAAO,EAAE,MAA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AC/F,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,60 @@
1
+ import * as React from "react";
2
+ /**
3
+ * One node of a `Tree`: a name, and the nodes under it where it has any.
4
+ *
5
+ * `id` is the node's own segment and has to be unique among its siblings. A node is addressed
6
+ * by the chain of ids from the root, joined with `/`, which is the key `expanded`, `selected`
7
+ * and every callback speak in — so for a tree built from paths the key *is* the path.
8
+ */
9
+ export interface TreeNode {
10
+ readonly id: string;
11
+ readonly label: React.ReactNode;
12
+ /** Absent or empty makes it a leaf. An empty array still draws as a leaf, not an empty folder. */
13
+ readonly children?: readonly TreeNode[];
14
+ }
15
+ export interface TreeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
16
+ readonly nodes: readonly TreeNode[];
17
+ /**
18
+ * What the tree is, for a screen reader. Required rather than optional: a `tree` with no
19
+ * name is announced as an unlabelled group, and there is no sensible default for it.
20
+ */
21
+ readonly label: string;
22
+ /** The keys that are open. Given, the tree is controlled; omitted, it keeps its own. */
23
+ readonly expanded?: readonly string[];
24
+ readonly defaultExpanded?: readonly string[];
25
+ readonly onExpandedChange?: (next: readonly string[]) => void;
26
+ /** The key that is current. Drawn as selected and announced as such. */
27
+ readonly selected?: string;
28
+ readonly onSelect?: (key: string, node: TreeNode) => void;
29
+ /** What a row shows after its name — a count, a state, a badge. The product's to decide. */
30
+ readonly renderAfter?: (node: TreeNode, key: string) => React.ReactNode;
31
+ /**
32
+ * Fold a run of folders that never branches into one row, `a/b/c`, the way an editor does.
33
+ * On by default: a project four folders deep is otherwise four rows of indentation before
34
+ * the first name anybody came to read.
35
+ */
36
+ readonly compact?: boolean;
37
+ }
38
+ /**
39
+ * A hierarchy of named nodes, drawn the way an editor draws a working tree: folders that open
40
+ * and close, one tab stop, and the arrow keys moving between rows.
41
+ *
42
+ * **It takes nodes and never paths.** Splitting a string into segments is a platform question,
43
+ * and a package that picked a separator would be wrong on the consumer that does not use it.
44
+ * `treeFromPaths` is here for callers whose data really is a list of strings.
45
+ *
46
+ * **What a row says beyond its name is the caller's**, through `renderAfter` — a publish state,
47
+ * a count, a badge. This owns the branching and none of the meaning.
48
+ *
49
+ * Keyboard, as the `tree` pattern asks: up and down move between visible rows, right opens a
50
+ * closed folder and then steps into it, left closes an open one and then steps out to its
51
+ * parent, Home and End reach the ends, and Enter or Space selects.
52
+ *
53
+ * @example
54
+ * <Tree label="Files" nodes={treeFromPaths(["src/app.ts", "src/lib/fs.ts"])} />
55
+ */
56
+ export declare function Tree({ nodes, label, expanded, defaultExpanded, onExpandedChange, selected, onSelect, renderAfter, compact, className, ...rest }: TreeProps): React.JSX.Element;
57
+ export declare function treeFromPaths(paths: readonly string[], options?: {
58
+ readonly separator?: string;
59
+ }): TreeNode[];
60
+ //# sourceMappingURL=tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tree.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,kGAAkG;IAClG,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACzC;AAYD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;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scripts/emit-exports.mjs",
5
5
  "entries": {
6
6
  ".": {
@@ -196,6 +196,7 @@
196
196
  "TooltipContent",
197
197
  "TooltipProvider",
198
198
  "TooltipTrigger",
199
+ "Tree",
199
200
  "UserAvatar",
200
201
  "UserMenu",
201
202
  "UserProvider",
@@ -219,6 +220,7 @@
219
220
  "setupAxiosInterceptors",
220
221
  "toast",
221
222
  "toggleVariants",
223
+ "treeFromPaths",
222
224
  "truncateMiddle",
223
225
  "useAssistantNotifications",
224
226
  "useBackendStatus",
@@ -255,6 +257,8 @@
255
257
  "StartupFirstStepsProps",
256
258
  "StickySaveBarProps",
257
259
  "StickySaveBarVariant",
260
+ "TreeNode",
261
+ "TreeProps",
258
262
  "UserAvatarProps",
259
263
  "UserMenuProps",
260
264
  "UserMenuUser",
@@ -480,6 +484,8 @@
480
484
  "TooltipContent": "components/ui/tooltip",
481
485
  "TooltipProvider": "components/ui/tooltip",
482
486
  "TooltipTrigger": "components/ui/tooltip",
487
+ "Tree": "components/ui/tree",
488
+ "treeFromPaths": "components/ui/tree",
483
489
  "truncateMiddle": "lib/utils",
484
490
  "useAssistantNotifications": "hooks/use-assistant-notifications",
485
491
  "useBackendStatus": "components/backend-status",