jenosize-ui 0.1.0

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 (182) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +100 -0
  3. package/THIRD-PARTY-NOTICES.md +163 -0
  4. package/dist/Button-Bt7pzM4R.d.ts +82 -0
  5. package/dist/PaymentInput-CKPIPNWH.d.ts +141 -0
  6. package/dist/Select-CVbEQ2Ep.d.ts +118 -0
  7. package/dist/TagInput-CTJYOB4J.d.ts +90 -0
  8. package/dist/avatar.d.ts +161 -0
  9. package/dist/avatar.js +11 -0
  10. package/dist/badge.d.ts +109 -0
  11. package/dist/badge.js +10 -0
  12. package/dist/breadcrumb.d.ts +58 -0
  13. package/dist/breadcrumb.js +7 -0
  14. package/dist/button.d.ts +54 -0
  15. package/dist/button.js +14 -0
  16. package/dist/calendar.d.ts +368 -0
  17. package/dist/calendar.js +21 -0
  18. package/dist/callout.d.ts +70 -0
  19. package/dist/callout.js +16 -0
  20. package/dist/card-nWicloNi.d.ts +80 -0
  21. package/dist/card.d.ts +2 -0
  22. package/dist/card.js +7 -0
  23. package/dist/checkbox.d.ts +133 -0
  24. package/dist/checkbox.js +11 -0
  25. package/dist/chunk-24TO7E32.js +42 -0
  26. package/dist/chunk-3Y5X7B5C.js +146 -0
  27. package/dist/chunk-4OLULPQG.js +202 -0
  28. package/dist/chunk-4P2NBLBW.js +103 -0
  29. package/dist/chunk-52IFGFTL.js +11 -0
  30. package/dist/chunk-5FATN5YD.js +115 -0
  31. package/dist/chunk-5NOBSXJN.js +297 -0
  32. package/dist/chunk-5RAPA22E.js +106 -0
  33. package/dist/chunk-7EUAMHMU.js +16 -0
  34. package/dist/chunk-7EWQKTNQ.js +1336 -0
  35. package/dist/chunk-7HOIZ3UO.js +110 -0
  36. package/dist/chunk-7IU5TMFL.js +452 -0
  37. package/dist/chunk-7JBNLEJ7.js +29 -0
  38. package/dist/chunk-7S2TBALK.js +23 -0
  39. package/dist/chunk-BJUZVYQC.js +188 -0
  40. package/dist/chunk-BVJWBYIG.js +66 -0
  41. package/dist/chunk-CME4DIML.js +65 -0
  42. package/dist/chunk-CYPPEUX5.js +73 -0
  43. package/dist/chunk-D5BTFSL7.js +71 -0
  44. package/dist/chunk-D6TPWNRK.js +387 -0
  45. package/dist/chunk-DJSXIAFH.js +66 -0
  46. package/dist/chunk-DRZCJCBO.js +46 -0
  47. package/dist/chunk-DWKILXHE.js +17 -0
  48. package/dist/chunk-E7ZSWBAK.js +70 -0
  49. package/dist/chunk-EDSK6FEH.js +8 -0
  50. package/dist/chunk-F2K7VJUV.js +114 -0
  51. package/dist/chunk-F6NLE6XJ.js +40 -0
  52. package/dist/chunk-FHHAPGCR.js +32 -0
  53. package/dist/chunk-FXIBGTS5.js +14 -0
  54. package/dist/chunk-GCVA3OIV.js +72 -0
  55. package/dist/chunk-GFOAJVW5.js +336 -0
  56. package/dist/chunk-GRLSUQQE.js +136 -0
  57. package/dist/chunk-GTHJWR3Q.js +77 -0
  58. package/dist/chunk-HMUZE6EK.js +67 -0
  59. package/dist/chunk-I7WU4GTY.js +503 -0
  60. package/dist/chunk-J2BCKBHC.js +151 -0
  61. package/dist/chunk-J36M3KRX.js +1315 -0
  62. package/dist/chunk-J7ZQQFPT.js +113 -0
  63. package/dist/chunk-JP26LPCY.js +234 -0
  64. package/dist/chunk-JTNFJLIY.js +1046 -0
  65. package/dist/chunk-JVJRHBTD.js +50 -0
  66. package/dist/chunk-JYGR44ZC.js +133 -0
  67. package/dist/chunk-KDLPXXD2.js +173 -0
  68. package/dist/chunk-KMSYEE23.js +224 -0
  69. package/dist/chunk-KNYKWUYX.js +52 -0
  70. package/dist/chunk-LME57Z6J.js +138 -0
  71. package/dist/chunk-MFJP5FA7.js +20 -0
  72. package/dist/chunk-MKC5HNA7.js +1692 -0
  73. package/dist/chunk-MQGD2OUF.js +39 -0
  74. package/dist/chunk-MUFHLP4S.js +566 -0
  75. package/dist/chunk-O2LG3PNI.js +74 -0
  76. package/dist/chunk-O4GRKO3I.js +66 -0
  77. package/dist/chunk-OHUFNYGN.js +791 -0
  78. package/dist/chunk-PWKWNDBS.js +243 -0
  79. package/dist/chunk-QA74ITR4.js +103 -0
  80. package/dist/chunk-R6RGJF4L.js +170 -0
  81. package/dist/chunk-S7NNXWIN.js +7 -0
  82. package/dist/chunk-SV56BSUQ.js +162 -0
  83. package/dist/chunk-T7FCG7XV.js +435 -0
  84. package/dist/chunk-THC2ISYP.js +57 -0
  85. package/dist/chunk-VWC72TR3.js +115 -0
  86. package/dist/chunk-W46K56XU.js +216 -0
  87. package/dist/chunk-W5GGOUUI.js +75 -0
  88. package/dist/chunk-WEUJYDCV.js +269 -0
  89. package/dist/chunk-WFY7DKQD.js +279 -0
  90. package/dist/chunk-WZQFC7ZN.js +448 -0
  91. package/dist/chunk-Z3ETJN5G.js +136 -0
  92. package/dist/chunk-ZOOX3TUB.js +192 -0
  93. package/dist/chunk-ZSNJ6UA3.js +42 -0
  94. package/dist/chunk-ZZA2LUTL.js +130 -0
  95. package/dist/chunk-ZZT2E5VT.js +24 -0
  96. package/dist/color-CtSxc1Rh.d.ts +6 -0
  97. package/dist/combobox.d.ts +184 -0
  98. package/dist/combobox.js +21 -0
  99. package/dist/date-input.d.ts +83 -0
  100. package/dist/date-input.js +16 -0
  101. package/dist/date-picker.d.ts +249 -0
  102. package/dist/date-picker.js +29 -0
  103. package/dist/date-utils-7hTFTXNK.d.ts +34 -0
  104. package/dist/date-vMJBKAFK.d.ts +22 -0
  105. package/dist/dialog.d.ts +86 -0
  106. package/dist/dialog.js +15 -0
  107. package/dist/drawer.d.ts +77 -0
  108. package/dist/drawer.js +14 -0
  109. package/dist/dropdown-menu.d.ts +218 -0
  110. package/dist/dropdown-menu.js +10 -0
  111. package/dist/file-trigger.d.ts +42 -0
  112. package/dist/file-trigger.js +3 -0
  113. package/dist/form.d.ts +487 -0
  114. package/dist/form.js +1179 -0
  115. package/dist/header-navigation.d.ts +74 -0
  116. package/dist/header-navigation.js +23 -0
  117. package/dist/icons/app.d.ts +48 -0
  118. package/dist/icons/app.js +282 -0
  119. package/dist/icons/flag.d.ts +817 -0
  120. package/dist/icons/flag.js +58336 -0
  121. package/dist/icons/integration.d.ts +36 -0
  122. package/dist/icons/integration.js +531 -0
  123. package/dist/icons/payment.d.ts +116 -0
  124. package/dist/icons/payment.js +2418 -0
  125. package/dist/icons.d.ts +2013 -0
  126. package/dist/icons.js +2012 -0
  127. package/dist/illustration.d.ts +48 -0
  128. package/dist/illustration.js +4 -0
  129. package/dist/index.d.ts +68 -0
  130. package/dist/index.js +73 -0
  131. package/dist/indicator.d.ts +51 -0
  132. package/dist/indicator.js +7 -0
  133. package/dist/input.d.ts +66 -0
  134. package/dist/input.js +15 -0
  135. package/dist/multi-value-CJb_tnvi.d.ts +8 -0
  136. package/dist/nav-Bla0o_-1.d.ts +98 -0
  137. package/dist/number-input.d.ts +80 -0
  138. package/dist/number-input.js +15 -0
  139. package/dist/options-CPEIgjtd.d.ts +68 -0
  140. package/dist/overflow-Df0h42Oi.d.ts +29 -0
  141. package/dist/pagination.d.ts +77 -0
  142. package/dist/pagination.js +17 -0
  143. package/dist/payment-input.d.ts +7 -0
  144. package/dist/payment-input.js +15 -0
  145. package/dist/popover.d.ts +60 -0
  146. package/dist/popover.js +14 -0
  147. package/dist/progress.d.ts +87 -0
  148. package/dist/progress.js +5 -0
  149. package/dist/radio.d.ts +77 -0
  150. package/dist/radio.js +12 -0
  151. package/dist/select.d.ts +68 -0
  152. package/dist/select.js +24 -0
  153. package/dist/shared-BNXAdgh2.d.ts +9 -0
  154. package/dist/shared-BYXJPnsN.d.ts +11 -0
  155. package/dist/shared-Dc-GgA16.d.ts +42 -0
  156. package/dist/sidebar-navigation.d.ts +129 -0
  157. package/dist/sidebar-navigation.js +15 -0
  158. package/dist/styles.css +2 -0
  159. package/dist/switch.d.ts +23 -0
  160. package/dist/switch.js +7 -0
  161. package/dist/table.d.ts +692 -0
  162. package/dist/table.js +44 -0
  163. package/dist/tabs.d.ts +111 -0
  164. package/dist/tabs.js +8 -0
  165. package/dist/tag-input.d.ts +12 -0
  166. package/dist/tag-input.js +19 -0
  167. package/dist/tag.d.ts +98 -0
  168. package/dist/tag.js +9 -0
  169. package/dist/textarea.d.ts +40 -0
  170. package/dist/textarea.js +12 -0
  171. package/dist/theme-script.d.ts +29 -0
  172. package/dist/theme-script.js +15 -0
  173. package/dist/theme.css +929 -0
  174. package/dist/theme.d.ts +71 -0
  175. package/dist/theme.js +15 -0
  176. package/dist/toast.d.ts +242 -0
  177. package/dist/toast.js +15 -0
  178. package/dist/tooltip.d.ts +70 -0
  179. package/dist/tooltip.js +6 -0
  180. package/dist/tree.d.ts +308 -0
  181. package/dist/tree.js +11 -0
  182. package/package.json +352 -0
package/dist/tree.d.ts ADDED
@@ -0,0 +1,308 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import * as React from 'react';
3
+
4
+ /** What a slot function is told about the row it is rendering into. */
5
+ interface TreeNodeState {
6
+ expanded: boolean;
7
+ selected: boolean;
8
+ depth: number;
9
+ isBranch: boolean;
10
+ /** True only while `loadChildren` is in flight for this node. */
11
+ loading: boolean;
12
+ }
13
+ /**
14
+ * A slot is a node, OR a function of the row's live state.
15
+ *
16
+ * The function form is what makes an open/closed folder glyph possible without the component
17
+ * guessing that "a branch" means "a folder". It is DATA → NODE — the same category `docs/api-policy.md`
18
+ * already licenses for `column.cell` and `TabItem.content` — so it is structural freedom for nobody:
19
+ * the caller chooses what the slot SAYS, never how the tree is BUILT.
20
+ *
21
+ * Deliberately NOT generic over `Id`. {@link TreeNodeState} carries no id, so a type parameter here
22
+ * would be provably dead — and a dead generic is the same dishonesty as a loose prop type: it
23
+ * advertises a guarantee it cannot keep.
24
+ */
25
+ type TreeSlot = React.ReactNode | ((state: TreeNodeState) => React.ReactNode);
26
+ interface TreeNode<Id extends string = string> {
27
+ /** Stable identity. REQUIRED — expansion, selection and moves are all keyed by it. */
28
+ id: Id;
29
+ label: React.ReactNode;
30
+ /** Nested nodes. Recursive — a child may own children of its own. */
31
+ children?: readonly TreeNode<Id>[];
32
+ /**
33
+ * Force branch-ness when `children` has not been loaded yet.
34
+ *
35
+ * isBranch = hasChildren ?? children != null
36
+ *
37
+ * So `children: []` is an **empty branch** — it keeps its chevron and expands to `emptyMessage`.
38
+ * Conflating that with a leaf is a real bug the Table tree already shipped once: a branch whose
39
+ * fetch resolved to nothing rendered as a leaf, and a user who had checked it could never tell.
40
+ */
41
+ hasChildren?: boolean;
42
+ leading?: TreeSlot;
43
+ trailing?: TreeSlot;
44
+ /**
45
+ * Override the row's composed accessible name. Wins whenever set.
46
+ *
47
+ * The composed name is `label` plus whatever the slots announce, and adjacent inline text runs
48
+ * together: a row with a count chip reads **"Documents12"**. That is correct — the count is real
49
+ * information a slot must not `aria-hidden` away (AGENTS §4) — but it reads poorly, so the host
50
+ * offers the override rather than the slot silently dropping the chip. Same contract, same
51
+ * spelling, as `TabItem.ariaLabel`.
52
+ */
53
+ ariaLabel?: string;
54
+ /** Inert: no focus, no selection, no drag, faded. Its children stay reachable. */
55
+ disabled?: boolean;
56
+ /** Layout/spacing for this row only, merged via `cn()`. */
57
+ className?: string;
58
+ }
59
+ /** Where a moved node lands relative to its target. */
60
+ type TreeMovePosition = "before" | "after" | "child";
61
+ interface TreeMove<Id extends string = string> {
62
+ /** The node being moved. */
63
+ id: Id;
64
+ /** The reference node it is moved relative to. */
65
+ target: Id;
66
+ position: TreeMovePosition;
67
+ }
68
+ /**
69
+ * `hasChildren ?? children != null` — the ONE place branch-ness is decided.
70
+ *
71
+ * Every other question (does it get a chevron, can it be dropped into, does `→` expand it) reads
72
+ * this, so the three answers can never disagree.
73
+ */
74
+ declare function isBranch<Id extends string>(node: TreeNode<Id>): boolean;
75
+ /**
76
+ * Depth-first pre-order walk. `visit` returning `false` prunes that subtree — returning
77
+ * `undefined` (the common case) does not, so a plain side-effecting visitor needs no `return true`.
78
+ */
79
+ declare function walkTree<Id extends string>(nodes: readonly TreeNode<Id>[], visit: (node: TreeNode<Id>, depth: number, parentId: Id | null) => boolean | void): void;
80
+ /** Root-first ancestor ids of `id`, excluding `id` itself. Empty for a root or an unknown id. */
81
+ declare function ancestorIds<Id extends string>(nodes: readonly TreeNode<Id>[], id: Id): readonly Id[];
82
+ /**
83
+ * Is `candidate` inside `id`'s subtree — **including `id` itself**?
84
+ *
85
+ * Self-inclusive on purpose: it is the predicate `canMove` needs, and "dropping a node onto itself"
86
+ * and "dropping a node into its own child" are the same refusal. Making the self case true here is
87
+ * what lets that rule be one line instead of two that can drift apart.
88
+ */
89
+ declare function isDescendant<Id extends string>(nodes: readonly TreeNode<Id>[], id: Id, candidate: Id): boolean;
90
+ /**
91
+ * Apply a move and return a NEW node list. Pure — no hook required, because the caller owns
92
+ * their data and therefore owns applying the move:
93
+ *
94
+ * reorder: { onMove: (m) => setNodes((n) => applyTreeMove(n, m)) }
95
+ *
96
+ * A structurally impossible move (unknown id, unknown target, target inside the moved subtree)
97
+ * **dev-warns and returns `nodes` unchanged**. It does not throw: this runs inside a drop handler
98
+ * and a keydown, and a throw there takes the app down over a gesture the user can simply repeat.
99
+ * `useTree`'s `canMove` already refuses all three before `onMove` fires, so reaching this is a
100
+ * caller applying a move by hand — the warning is what tells them.
101
+ */
102
+ declare function applyTreeMove<Id extends string>(nodes: readonly TreeNode<Id>[], move: TreeMove<Id>): readonly TreeNode<Id>[];
103
+ /**
104
+ * Return a new node list with `children` attached to `id`. Pure; a no-op for an unknown id.
105
+ *
106
+ * The companion to `loadChildren`: the hook fetches and reports, the caller merges. Three lines at
107
+ * the call site is the whole cost of keeping `nodes` the only source of truth.
108
+ *
109
+ * onChildrenLoaded: (id, children) => setNodes((n) => attachChildren(n, id, children))
110
+ */
111
+ declare function attachChildren<Id extends string>(nodes: readonly TreeNode<Id>[], id: Id, children: readonly TreeNode<Id>[]): readonly TreeNode<Id>[];
112
+
113
+ type TreeSelectionMode = "none" | "single" | "multiple";
114
+ /**
115
+ * What starts a pointer drag.
116
+ *
117
+ * ONE union, not a `dragHandle?: boolean` — the two answers are mutually exclusive, and the member
118
+ * owns EVERY behaviour derived from it in one table (AGENTS §4):
119
+ *
120
+ * row the whole row drags, and the GRAB CURSOR on that whole box is the affordance. No grip
121
+ * glyph: the grip marks the place you drag FROM, and here that place is the entire row, so a
122
+ * 16px mark inside it points at the one spot that is no more draggable than the rest.
123
+ * grip only the grip drags, so the glyph is present and always visible: hiding the sole
124
+ * affordance would hide the feature, and on a touch device forever. Leaves the row's own
125
+ * pointer events entirely to selection and activation.
126
+ *
127
+ * It lives HERE rather than on `<Tree>` because a `handle` prop on the view would be silently dead
128
+ * whenever `reorder` is `false` — a switch and its settings travel as ONE object (AGENTS §11).
129
+ */
130
+ type TreeDragHandle = "row" | "grip";
131
+ interface TreeReorderOptions<Id extends string = string> {
132
+ /** Apply the move to your own data — `(m) => setNodes((n) => applyTreeMove(n, m))`. */
133
+ onMove: (move: TreeMove<Id>) => void;
134
+ /** Extra veto, on top of the structural checks the hook always applies. */
135
+ canMove?: (move: TreeMove<Id>) => boolean;
136
+ /** @default "row" */
137
+ handle?: TreeDragHandle;
138
+ }
139
+ interface UseTreeOptions<Id extends string = string> {
140
+ /** The hierarchy. The ONE data channel — `<Tree>` has none. */
141
+ nodes: readonly TreeNode<Id>[];
142
+ /** Controlled expansion. A `Set` or an array — both are accepted. */
143
+ expanded?: ReadonlySet<NoInfer<Id>> | readonly NoInfer<Id>[];
144
+ /** Uncontrolled seed, read once. */
145
+ defaultExpanded?: readonly NoInfer<Id>[];
146
+ onExpandedChange?: (ids: ReadonlySet<Id>) => void;
147
+ /** @default "none" */
148
+ selection?: TreeSelectionMode;
149
+ /**
150
+ * Cascading tri-state checkboxes, where a checked branch means its whole subtree.
151
+ *
152
+ * Ignored unless `selection="multiple"`.
153
+ */
154
+ checkboxes?: boolean;
155
+ selected?: ReadonlySet<NoInfer<Id>> | readonly NoInfer<Id>[];
156
+ defaultSelected?: readonly NoInfer<Id>[];
157
+ onSelectedChange?: (ids: ReadonlySet<Id>) => void;
158
+ /** Activation is NOT selection — `Enter`, a double-click, or a second click on a selected node. */
159
+ onActivate?: (node: TreeNode<Id>) => void;
160
+ /** Fetch a branch's children on its first expand. The result reaches you via `onChildrenLoaded`. */
161
+ loadChildren?: (node: TreeNode<Id>) => Promise<readonly TreeNode<Id>[]>;
162
+ /** Merge the result into your own data — `(id, kids) => setNodes((n) => attachChildren(n, id, kids))`. */
163
+ onChildrenLoaded?: (id: Id, children: readonly TreeNode<Id>[]) => void;
164
+ /** Narrow to matches plus the paths that reach them. Your own search box's state. */
165
+ filter?: string;
166
+ /** Override matching. Default: case-insensitive substring on a **string** `label`. */
167
+ match?: (node: TreeNode<Id>, query: string) => boolean;
168
+ /** @default 150 */
169
+ filterDelay?: number;
170
+ /**
171
+ * Drag-and-drop plus `Alt`+arrow moves. Absent or `false` is off; an options object is on.
172
+ *
173
+ * NOT `AtLeastOne<…>` — deliberately, and this is the one place in the library where that helper
174
+ * would make a config WEAKER. `AtLeastOne` exists to reject `{}` for an all-optional group
175
+ * (`paginate`), and it does that by requiring one key while making **every other key optional** —
176
+ * including a genuinely required one. `AtLeastOne<TreeReorderOptions>` therefore admits
177
+ * `{ canMove }` with no `onMove`: a reorder that vetoes moves and can never apply one.
178
+ *
179
+ * `onMove` being required does the whole job on its own: `{}` is already a type error because the
180
+ * field is missing, which is the same rejection for a better reason. Both cases are probed in
181
+ * `Tree.test-d.tsx`, since `state:check` only compares top-level names and cannot see in here.
182
+ */
183
+ reorder?: false | TreeReorderOptions<Id>;
184
+ /** Rows the caller renders as non-interactive, on top of each node's own `disabled`. */
185
+ disabledNodes?: (node: TreeNode<Id>) => boolean;
186
+ }
187
+ /** One row of the flattened, expansion- and filter-applied list the view and the keyboard share. */
188
+ interface VisibleTreeNode<Id extends string = string> {
189
+ node: TreeNode<Id>;
190
+ depth: number;
191
+ parentId: Id | null;
192
+ /** Position among its RENDERED siblings — what `*` and a drop position count against. */
193
+ index: number;
194
+ siblingCount: number;
195
+ }
196
+ type TreeCheckedState = "checked" | "unchecked" | "mixed";
197
+ /** How a selection toggle behaves. `range` extends from the anchor; `additive` keeps the rest. */
198
+ interface TreeToggleOptions {
199
+ range?: boolean;
200
+ additive?: boolean;
201
+ }
202
+ interface UseTreeResult<Id extends string = string> {
203
+ /** Echoed back — the view never gets a second data channel (AGENTS §11). */
204
+ nodes: readonly TreeNode<Id>[];
205
+ /**
206
+ * Pre-order flattened, expansion- and filter-applied. THE list that drives roving focus, ↑↓,
207
+ * Home/End and typeahead. Derived once here so the view and the keyboard model can never
208
+ * disagree about what "the next node" means.
209
+ */
210
+ visible: readonly VisibleTreeNode<Id>[];
211
+ expanded: ReadonlySet<Id>;
212
+ toggleExpanded: (id: Id) => void;
213
+ expand: (id: Id) => void;
214
+ collapse: (id: Id) => void;
215
+ /** Every branch whose children are LOADED. Fires zero fetches — see the note on the impl. */
216
+ expandAll: () => void;
217
+ collapseAll: () => void;
218
+ /** Expand `id` and every RENDERED sibling at its level — the `*` key. ONE commit. */
219
+ expandSiblings: (id: Id) => void;
220
+ /** Expand every ancestor of `id` so it becomes visible. Does NOT expand `id` itself. */
221
+ revealNode: (id: Id) => void;
222
+ selection: TreeSelectionMode;
223
+ checkboxes: boolean;
224
+ /** The stored set. Under cascade a BRANCH id means its whole subtree. */
225
+ selected: ReadonlySet<Id>;
226
+ checkedState: (id: Id) => TreeCheckedState;
227
+ /** Concrete LOADED leaf ids implied by `selected`. A form should submit `selected`, not this. */
228
+ checkedLeaves: ReadonlySet<Id>;
229
+ toggleSelected: (id: Id, opts?: TreeToggleOptions) => void;
230
+ clearSelected: () => void;
231
+ loading: ReadonlySet<Id>;
232
+ failed: ReadonlySet<Id>;
233
+ retryLoad: (id: Id) => void;
234
+ isFiltering: boolean;
235
+ /** The nodes that actually MATCHED — never the ancestors kept alongside them. */
236
+ matches: ReadonlySet<Id>;
237
+ /** The DEBOUNCED query, so a highlight can never lag the rows it marks. */
238
+ query: string;
239
+ reorderEnabled: boolean;
240
+ /** Echoed for the view, which draws the grip. `"row"` when reorder is off — nothing reads it. */
241
+ reorderHandle: TreeDragHandle;
242
+ canMove: (move: TreeMove<Id>) => boolean;
243
+ move: (move: TreeMove<Id>) => void;
244
+ isDisabled: (id: Id) => boolean;
245
+ isBranch: (id: Id) => boolean;
246
+ nodeById: (id: Id) => TreeNode<Id> | undefined;
247
+ parentOf: (id: Id) => Id | null;
248
+ onActivate?: (node: TreeNode<Id>) => void;
249
+ }
250
+ declare function useTree<const Id extends string>(options: UseTreeOptions<Id>): UseTreeResult<Id>;
251
+
252
+ /**
253
+ * The row ladder.
254
+ *
255
+ * Both steps came from the reference's own density, and only the NAMES shift so that **the default
256
+ * size is always called `md`** across the whole library — the same re-keying the toggle family got
257
+ * (AGENTS §4). `sm` stays unclaimed: don't mint a tighter step without a reason.
258
+ */
259
+ type TreeSize = "md" | "lg";
260
+ /**
261
+ * How a nested level is marked beside it.
262
+ *
263
+ * One question with mutually exclusive answers, so ONE union rather than a `guideLine`/`guideDots`
264
+ * pair that could contradict each other (AGENTS §4). All three share the same 20px indent and the
265
+ * same axis, so **no row's chevron or label moves when you switch** — that invariant is asserted
266
+ * numerically in `Tree.test.tsx`.
267
+ *
268
+ * line a rule per ancestor level, ending in a rounded ELBOW into the last child of each level
269
+ * dot a bullet in the row's OWN chevron column, so only a leaf can carry one
270
+ * none nothing but the indent
271
+ */
272
+ type TreeGuide = "line" | "dot" | "none";
273
+ interface TreeProps<Id extends string = string> extends Omit<React.ComponentPropsWithoutRef<"ul">, "children"> {
274
+ /**
275
+ * The engine. REQUIRED, and the ONLY data channel — there is no self-managed mode.
276
+ *
277
+ * See `docs/api-policy.md` § one state owner: a second channel means props that are silently dead
278
+ * and duplicates that can disagree.
279
+ */
280
+ tree: UseTreeResult<Id>;
281
+ /** @default "md" */
282
+ size?: TreeSize;
283
+ /**
284
+ * How a nested level is marked in the gutter. Purely the mark — all three share the same indent
285
+ * and the same axis, so switching moves nothing. @default "line"
286
+ */
287
+ guide?: TreeGuide;
288
+ /** Shown when the tree has no visible nodes, and inside an expanded empty branch. */
289
+ emptyMessage?: React.ReactNode;
290
+ render?: useRender.RenderProp<React.ComponentProps<"ul">>;
291
+ /** Layout/spacing for the `<ul>` only, merged via `cn()`. Cannot restyle rows. */
292
+ className?: string;
293
+ }
294
+ /**
295
+ * A content hierarchy — folders and files, an org chart, a permission tree — rendered from the
296
+ * `useTree()` instance you hand it.
297
+ *
298
+ * A pure VIEW: it owns no state and builds no engine, so a tree's data and behaviour are configured
299
+ * in exactly one place, and the invariants live in one place (expansion surviving a reload, a
300
+ * checked branch adopting children that arrive later, focus recovering when its node is filtered
301
+ * away).
302
+ */
303
+ declare function Tree<Id extends string = string>(props: TreeProps<Id>): React.JSX.Element;
304
+ declare namespace Tree {
305
+ var displayName: string;
306
+ }
307
+
308
+ export { Tree, type TreeCheckedState, type TreeDragHandle, type TreeGuide, type TreeMove, type TreeMovePosition, type TreeNode, type TreeNodeState, type TreeProps, type TreeReorderOptions, type TreeSelectionMode, type TreeSize, type TreeSlot, type TreeToggleOptions, type UseTreeOptions, type UseTreeResult, type VisibleTreeNode, ancestorIds, applyTreeMove, attachChildren, isBranch, isDescendant, useTree, walkTree };
package/dist/tree.js ADDED
@@ -0,0 +1,11 @@
1
+ "use client";export { Tree, ancestorIds, applyTreeMove, attachChildren, isBranch, isDescendant, useTree, walkTree } from './chunk-7EWQKTNQ.js';
2
+ import './chunk-KMSYEE23.js';
3
+ import './chunk-FXIBGTS5.js';
4
+ import './chunk-F6NLE6XJ.js';
5
+ import './chunk-52IFGFTL.js';
6
+ import './chunk-EDSK6FEH.js';
7
+ import './chunk-24TO7E32.js';
8
+ import './chunk-GCVA3OIV.js';
9
+ import './chunk-ZSNJ6UA3.js';
10
+ //# sourceMappingURL=tree.js.map
11
+ //# sourceMappingURL=tree.js.map
package/package.json ADDED
@@ -0,0 +1,352 @@
1
+ {
2
+ "name": "jenosize-ui",
3
+ "version": "0.1.0",
4
+ "description": "Opinionated React component library — styled-on-headless on Base UI.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Jenosize",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+ssh://git@gitlab.jenosize.io/package/jenosize-ui.git"
11
+ },
12
+ "homepage": "https://www.jenosize.com",
13
+ "bugs": {
14
+ "url": "https://gitlab.jenosize.io/package/jenosize-ui/-/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "keywords": [
20
+ "react",
21
+ "components",
22
+ "ui",
23
+ "design-system",
24
+ "base-ui",
25
+ "tailwindcss",
26
+ "typescript"
27
+ ],
28
+ "engines": {
29
+ "node": ">=22",
30
+ "pnpm": ">=10"
31
+ },
32
+ "packageManager": "pnpm@10.25.0",
33
+ "sideEffects": [
34
+ "*.css"
35
+ ],
36
+ "files": [
37
+ "dist",
38
+ "!dist/**/*.map",
39
+ "LICENSE",
40
+ "THIRD-PARTY-NOTICES.md"
41
+ ],
42
+ "exports": {
43
+ ".": {
44
+ "types": "./dist/index.d.ts",
45
+ "import": "./dist/index.js"
46
+ },
47
+ "./form": {
48
+ "types": "./dist/form.d.ts",
49
+ "import": "./dist/form.js"
50
+ },
51
+ "./theme": {
52
+ "types": "./dist/theme.d.ts",
53
+ "import": "./dist/theme.js"
54
+ },
55
+ "./theme-script": {
56
+ "types": "./dist/theme-script.d.ts",
57
+ "import": "./dist/theme-script.js"
58
+ },
59
+ "./button": {
60
+ "types": "./dist/button.d.ts",
61
+ "import": "./dist/button.js"
62
+ },
63
+ "./input": {
64
+ "types": "./dist/input.d.ts",
65
+ "import": "./dist/input.js"
66
+ },
67
+ "./number-input": {
68
+ "types": "./dist/number-input.d.ts",
69
+ "import": "./dist/number-input.js"
70
+ },
71
+ "./textarea": {
72
+ "types": "./dist/textarea.d.ts",
73
+ "import": "./dist/textarea.js"
74
+ },
75
+ "./select": {
76
+ "types": "./dist/select.d.ts",
77
+ "import": "./dist/select.js"
78
+ },
79
+ "./combobox": {
80
+ "types": "./dist/combobox.d.ts",
81
+ "import": "./dist/combobox.js"
82
+ },
83
+ "./checkbox": {
84
+ "types": "./dist/checkbox.d.ts",
85
+ "import": "./dist/checkbox.js"
86
+ },
87
+ "./radio": {
88
+ "types": "./dist/radio.d.ts",
89
+ "import": "./dist/radio.js"
90
+ },
91
+ "./switch": {
92
+ "types": "./dist/switch.d.ts",
93
+ "import": "./dist/switch.js"
94
+ },
95
+ "./file-trigger": {
96
+ "types": "./dist/file-trigger.d.ts",
97
+ "import": "./dist/file-trigger.js"
98
+ },
99
+ "./payment-input": {
100
+ "types": "./dist/payment-input.d.ts",
101
+ "import": "./dist/payment-input.js"
102
+ },
103
+ "./date-input": {
104
+ "types": "./dist/date-input.d.ts",
105
+ "import": "./dist/date-input.js"
106
+ },
107
+ "./tag-input": {
108
+ "types": "./dist/tag-input.d.ts",
109
+ "import": "./dist/tag-input.js"
110
+ },
111
+ "./breadcrumb": {
112
+ "types": "./dist/breadcrumb.d.ts",
113
+ "import": "./dist/breadcrumb.js"
114
+ },
115
+ "./dialog": {
116
+ "types": "./dist/dialog.d.ts",
117
+ "import": "./dist/dialog.js"
118
+ },
119
+ "./popover": {
120
+ "types": "./dist/popover.d.ts",
121
+ "import": "./dist/popover.js"
122
+ },
123
+ "./drawer": {
124
+ "types": "./dist/drawer.d.ts",
125
+ "import": "./dist/drawer.js"
126
+ },
127
+ "./sidebar-navigation": {
128
+ "types": "./dist/sidebar-navigation.d.ts",
129
+ "import": "./dist/sidebar-navigation.js"
130
+ },
131
+ "./header-navigation": {
132
+ "types": "./dist/header-navigation.d.ts",
133
+ "import": "./dist/header-navigation.js"
134
+ },
135
+ "./dropdown-menu": {
136
+ "types": "./dist/dropdown-menu.d.ts",
137
+ "import": "./dist/dropdown-menu.js"
138
+ },
139
+ "./tooltip": {
140
+ "types": "./dist/tooltip.d.ts",
141
+ "import": "./dist/tooltip.js"
142
+ },
143
+ "./tabs": {
144
+ "types": "./dist/tabs.d.ts",
145
+ "import": "./dist/tabs.js"
146
+ },
147
+ "./tag": {
148
+ "types": "./dist/tag.d.ts",
149
+ "import": "./dist/tag.js"
150
+ },
151
+ "./badge": {
152
+ "types": "./dist/badge.d.ts",
153
+ "import": "./dist/badge.js"
154
+ },
155
+ "./avatar": {
156
+ "types": "./dist/avatar.d.ts",
157
+ "import": "./dist/avatar.js"
158
+ },
159
+ "./indicator": {
160
+ "types": "./dist/indicator.d.ts",
161
+ "import": "./dist/indicator.js"
162
+ },
163
+ "./progress": {
164
+ "types": "./dist/progress.d.ts",
165
+ "import": "./dist/progress.js"
166
+ },
167
+ "./toast": {
168
+ "types": "./dist/toast.d.ts",
169
+ "import": "./dist/toast.js"
170
+ },
171
+ "./table": {
172
+ "types": "./dist/table.d.ts",
173
+ "import": "./dist/table.js"
174
+ },
175
+ "./tree": {
176
+ "types": "./dist/tree.d.ts",
177
+ "import": "./dist/tree.js"
178
+ },
179
+ "./calendar": {
180
+ "types": "./dist/calendar.d.ts",
181
+ "import": "./dist/calendar.js"
182
+ },
183
+ "./date-picker": {
184
+ "types": "./dist/date-picker.d.ts",
185
+ "import": "./dist/date-picker.js"
186
+ },
187
+ "./pagination": {
188
+ "types": "./dist/pagination.d.ts",
189
+ "import": "./dist/pagination.js"
190
+ },
191
+ "./illustration": {
192
+ "types": "./dist/illustration.d.ts",
193
+ "import": "./dist/illustration.js"
194
+ },
195
+ "./callout": {
196
+ "types": "./dist/callout.d.ts",
197
+ "import": "./dist/callout.js"
198
+ },
199
+ "./card": {
200
+ "types": "./dist/card.d.ts",
201
+ "import": "./dist/card.js"
202
+ },
203
+ "./icons": {
204
+ "types": "./dist/icons.d.ts",
205
+ "import": "./dist/icons.js"
206
+ },
207
+ "./icons/payment": {
208
+ "types": "./dist/icons/payment.d.ts",
209
+ "import": "./dist/icons/payment.js"
210
+ },
211
+ "./icons/app": {
212
+ "types": "./dist/icons/app.d.ts",
213
+ "import": "./dist/icons/app.js"
214
+ },
215
+ "./icons/integration": {
216
+ "types": "./dist/icons/integration.d.ts",
217
+ "import": "./dist/icons/integration.js"
218
+ },
219
+ "./icons/flag": {
220
+ "types": "./dist/icons/flag.d.ts",
221
+ "import": "./dist/icons/flag.js"
222
+ },
223
+ "./theme.css": "./dist/theme.css",
224
+ "./styles.css": "./dist/styles.css"
225
+ },
226
+ "scripts": {
227
+ "build": "node scripts/clean-dist.mjs && tsup && pnpm build:css",
228
+ "build:css": "tailwindcss -i src/styles/styles.css -o dist/styles.css --minify",
229
+ "typecheck": "tsc --noEmit",
230
+ "dev": "vite",
231
+ "preview": "vite preview",
232
+ "test": "vitest",
233
+ "test:run": "vitest run",
234
+ "coverage": "vitest run --coverage",
235
+ "test:visual": "playwright test",
236
+ "test:visual:update": "playwright test --update-snapshots",
237
+ "lint": "eslint .",
238
+ "lint:fix": "eslint . --fix",
239
+ "format": "prettier --write .",
240
+ "format:check": "prettier --check .",
241
+ "check": "pnpm typecheck && pnpm lint && pnpm format:check",
242
+ "gates": "node scripts/run-gates.mjs",
243
+ "ref:uui": "node scripts/sync-uui-ref.mjs",
244
+ "gen:component": "node scripts/gen-component.mjs",
245
+ "check:component": "node scripts/check-component.mjs",
246
+ "check:components": "node scripts/check-component.mjs --all",
247
+ "catalog": "node scripts/build-catalog.mjs",
248
+ "catalog:check": "node scripts/build-catalog.mjs --check",
249
+ "api": "node scripts/api-snapshot.mjs",
250
+ "api:check": "node scripts/api-snapshot.mjs --check",
251
+ "contrast": "node scripts/check-contrast.mjs",
252
+ "tokens": "node scripts/build-tokens.mjs",
253
+ "tokens:check": "node scripts/build-tokens.mjs --check",
254
+ "typography:audit": "node scripts/check-type-steps.mjs",
255
+ "typography:check": "node scripts/check-type-steps.mjs --check",
256
+ "graph": "node scripts/build-graph.mjs",
257
+ "graph:check": "node scripts/build-graph.mjs --check",
258
+ "docs:props": "node scripts/check-docs-props.mjs",
259
+ "docs:check": "node scripts/check-docs-props.mjs --check",
260
+ "docs:index": "node scripts/check-docs-index.mjs",
261
+ "index:check": "node scripts/check-docs-index.mjs --check",
262
+ "play:audit": "node scripts/check-playground-code.mjs",
263
+ "play:check": "node scripts/check-playground-code.mjs --check",
264
+ "snippet:audit": "node scripts/check-playground-snippets.mjs",
265
+ "snippet:check": "node scripts/check-playground-snippets.mjs --check",
266
+ "surface:audit": "node scripts/check-playground-surfaces.mjs",
267
+ "surface:check": "node scripts/check-playground-surfaces.mjs --check",
268
+ "compound:audit": "node scripts/check-compound-api.mjs",
269
+ "compound:check": "node scripts/check-compound-api.mjs --check",
270
+ "slots:audit": "node scripts/check-slots.mjs",
271
+ "slots:check": "node scripts/check-slots.mjs --check",
272
+ "seamless:audit": "node scripts/check-seamless.mjs",
273
+ "seamless:check": "node scripts/check-seamless.mjs --check",
274
+ "props:audit": "node scripts/check-prop-types.mjs",
275
+ "props:check": "node scripts/check-prop-types.mjs --check",
276
+ "state:audit": "node scripts/check-state-owner.mjs",
277
+ "state:check": "node scripts/check-state-owner.mjs --check",
278
+ "styles:audit": "node scripts/check-styles.mjs",
279
+ "styles:check": "node scripts/check-styles.mjs --check",
280
+ "boundary:check": "node scripts/check-client-boundary.mjs",
281
+ "pack:audit": "node scripts/check-package.mjs",
282
+ "pack:check": "node scripts/check-package.mjs --check",
283
+ "license:audit": "node scripts/check-licenses.mjs",
284
+ "license:check": "node scripts/check-licenses.mjs --check",
285
+ "field:audit": "node scripts/check-field-parity.mjs",
286
+ "field:check": "node scripts/check-field-parity.mjs --check",
287
+ "gen:icons": "node scripts/gen-icons.mjs",
288
+ "treeshake:check": "node scripts/check-icon-treeshake.mjs",
289
+ "icons:audit": "node scripts/check-icons.mjs",
290
+ "icons:check": "node scripts/check-icons.mjs --check",
291
+ "release": "node scripts/release.mjs",
292
+ "hooks:install": "node scripts/setup-hooks.mjs",
293
+ "gallery": "node scripts/capture-gallery.mjs",
294
+ "mcp": "node scripts/mcp-server.mjs"
295
+ },
296
+ "dependencies": {
297
+ "@date-fns/tz": "^1.5.0",
298
+ "@tanstack/react-table": "^8.21.3",
299
+ "clsx": "^2.1.1",
300
+ "date-fns": "^4.4.0",
301
+ "lucide-react": "^1.29.0",
302
+ "react-day-picker": "^10.0.1",
303
+ "react-hook-form": "^7.80.0",
304
+ "tailwind-merge": "^3.0.0"
305
+ },
306
+ "peerDependencies": {
307
+ "@base-ui/react": ">=1",
308
+ "react": ">=19",
309
+ "react-dom": ">=19",
310
+ "tailwindcss": ">=4"
311
+ },
312
+ "devDependencies": {
313
+ "@base-ui/react": "^1.6.0",
314
+ "@modelcontextprotocol/sdk": "^1.29.0",
315
+ "@playwright/test": "^1.61.1",
316
+ "@tailwindcss/cli": "^4.0.0",
317
+ "@tailwindcss/vite": "^4.0.0",
318
+ "@testing-library/dom": "^10.4.1",
319
+ "@testing-library/jest-dom": "^6.9.1",
320
+ "@testing-library/react": "^16.3.2",
321
+ "@testing-library/user-event": "^14.6.1",
322
+ "@types/node": "^22.0.0",
323
+ "@types/react": "^19.0.0",
324
+ "@types/react-dom": "^19.0.0",
325
+ "@vitejs/plugin-react": "^4.3.0",
326
+ "@vitest/coverage-v8": "^4.1.10",
327
+ "axe-core": "^4.12.1",
328
+ "eslint": "^10.6.0",
329
+ "eslint-config-prettier": "^10.1.8",
330
+ "eslint-import-resolver-typescript": "^4.4.5",
331
+ "eslint-plugin-import-x": "^4.17.1",
332
+ "eslint-plugin-react-hooks": "^7.1.1",
333
+ "eslint-plugin-unicorn": "^69.0.0",
334
+ "eslint-plugin-unused-imports": "^4.4.1",
335
+ "flag-icons": "7.5.0",
336
+ "globals": "^17.7.0",
337
+ "jsdom": "^29.1.1",
338
+ "prettier": "^3.9.3",
339
+ "prettier-plugin-tailwindcss": "^0.8.0",
340
+ "react": "^19.0.0",
341
+ "react-dom": "^19.0.0",
342
+ "react-element-to-jsx-string": "^17.0.1",
343
+ "tailwindcss": "4.3.1",
344
+ "tsup": "^8.3.0",
345
+ "typescript": "^5.6.0",
346
+ "typescript-eslint": "^8.62.0",
347
+ "vite": "^6.0.0",
348
+ "vitest": "^4.1.10",
349
+ "vitest-axe": "^0.1.0",
350
+ "zod": "^4.4.3"
351
+ }
352
+ }