@techsio/ui-kit 0.43.0 → 0.44.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.
@@ -0,0 +1,508 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { createContext, createElement, useContext, useEffect, useId, useMemo, useState } from "react";
3
+ import { collection as cascade_select_collection, connect, machine } from "@zag-js/cascade-select";
4
+ import { Portal, mergeProps, normalizeProps, useMachine } from "@zag-js/react";
5
+ import { ActionIcon } from "../atoms/action-icon.js";
6
+ import { Button } from "../atoms/button.js";
7
+ import { Icon } from "../atoms/icon.js";
8
+ import { Label } from "../atoms/label.js";
9
+ import { StatusText } from "../atoms/status-text.js";
10
+ import { tv } from "../utils.js";
11
+ const toControlSize = (size)=>"xs" === size ? "sm" : size;
12
+ const controlGlyphClass = {
13
+ sm: "text-icon-control-sm",
14
+ md: "text-icon-control-md",
15
+ lg: "text-icon-control-lg"
16
+ };
17
+ const cascadeSelectVariants = tv({
18
+ slots: {
19
+ root: "relative flex w-full flex-col gap-cascade-select",
20
+ control: "relative flex w-full items-center justify-between",
21
+ positioner: "isolate",
22
+ trigger: [
23
+ "form-control-base group w-full",
24
+ "flex items-center justify-between gap-0",
25
+ "border-cascade-select-trigger-border",
26
+ "text-left font-normal",
27
+ "hover:border-cascade-select-trigger-border-hover",
28
+ "hover:bg-cascade-select-trigger-bg-hover",
29
+ "focus:border-cascade-select-trigger-border-focus",
30
+ "focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width)",
31
+ "focus-visible:outline-cascade-select-ring",
32
+ "focus-visible:outline-offset-(length:--default-ring-offset)",
33
+ "data-disabled:cursor-not-allowed",
34
+ "data-disabled:border-cascade-select-border-disabled",
35
+ "data-disabled:bg-cascade-select-bg-disabled",
36
+ "data-disabled:text-cascade-select-fg-disabled",
37
+ "data-[validation=error]:border-(length:--border-width-validation)",
38
+ "data-[validation=error]:border-cascade-select-border-error data-[validation=error]:outline-cascade-select-border-error",
39
+ "data-[validation=error]:outline-(style:--default-ring-style) data-[validation=error]:outline-(length:--default-ring-width)",
40
+ "data-[validation=error]:outline-offset-(length:--default-ring-offset)",
41
+ "data-[validation=success]:border-(length:--border-width-validation)",
42
+ "data-[validation=success]:border-cascade-select-border-success data-[validation=success]:outline-cascade-select-border-success",
43
+ "data-[validation=success]:outline-(style:--default-ring-style) data-[validation=success]:outline-(length:--default-ring-width)",
44
+ "data-[validation=success]:outline-offset-(length:--default-ring-offset)",
45
+ "data-[validation=warning]:border-(length:--border-width-validation)",
46
+ "data-[validation=warning]:border-cascade-select-border-warning data-[validation=warning]:outline-cascade-select-border-warning",
47
+ "data-[validation=warning]:outline-(style:--default-ring-style) data-[validation=warning]:outline-(length:--default-ring-width)",
48
+ "data-[validation=warning]:outline-offset-(length:--default-ring-offset)",
49
+ "transition-colors duration-200 motion-reduce:transition-none"
50
+ ],
51
+ clearTrigger: "-translate-y-1/2 absolute top-1/2 right-cascade-select-right data-readonly:hidden",
52
+ content: [
53
+ "popup-surface-base flex w-max min-w-(--reference-width) max-w-(--available-width) overflow-x-auto",
54
+ "duration-200 ease-out motion-safe:transition-[opacity,display,translate,scale]",
55
+ "transition-discrete",
56
+ "starting:scale-98 starting:opacity-0",
57
+ "data-[state=open]:starting:scale-98 data-[state=open]:starting:opacity-0",
58
+ "data-[state=open]:scale-100 data-[state=open]:opacity-100",
59
+ "data-[state=closed]:scale-98 data-[state=closed]:opacity-0"
60
+ ],
61
+ list: "min-w-cascade-select-column grow basis-0",
62
+ item: [
63
+ "popup-item-base",
64
+ "hover:bg-popup-item-bg-hover",
65
+ "data-highlighted:bg-popup-item-bg-hover",
66
+ "data-[state=checked]:bg-popup-item-bg-selected",
67
+ "data-[state=checked]:text-popup-item-fg-selected",
68
+ "data-disabled:cursor-not-allowed data-disabled:text-popup-item-fg-disabled",
69
+ "transition-colors duration-200 motion-reduce:transition-none"
70
+ ],
71
+ itemText: "min-w-0 flex-grow truncate",
72
+ branchIndicator: [
73
+ "last:-me-(--size-popup-indicator) flex size-(--size-popup-indicator) shrink-0 items-center justify-center",
74
+ "rtl:rotate-180"
75
+ ],
76
+ itemIndicator: [
77
+ "last:-me-(--size-popup-indicator) flex size-(--size-popup-indicator) shrink-0 items-center justify-center",
78
+ "text-popup-item-fg-selected"
79
+ ],
80
+ valueText: [
81
+ "min-w-0 flex-grow truncate font-normal",
82
+ "data-placeholder:text-cascade-select-placeholder"
83
+ ],
84
+ indicator: [
85
+ "shrink-0 text-cascade-select-trigger-fg-base group-hover:text-cascade-select-trigger-fg-hover",
86
+ "data-[state=open]:rotate-180",
87
+ "motion-safe:transition-[transform,color] motion-safe:duration-200 motion-reduce:transition-none"
88
+ ]
89
+ },
90
+ variants: {
91
+ size: {
92
+ xs: {
93
+ trigger: "p-cascade-select-trigger-sm text-cascade-select-trigger-xs",
94
+ content: "popup-size-xs text-cascade-select-item-xs",
95
+ valueText: "text-cascade-select-value-xs"
96
+ },
97
+ sm: {
98
+ trigger: "h-form-control-sm rounded-cascade-select-sm p-cascade-select-trigger-sm text-cascade-select-trigger-sm",
99
+ content: "popup-size-sm text-cascade-select-item-sm",
100
+ valueText: "text-cascade-select-value-sm"
101
+ },
102
+ md: {
103
+ trigger: "h-form-control-md rounded-cascade-select-md p-cascade-select-trigger-md text-cascade-select-trigger-md",
104
+ content: "popup-size-md text-cascade-select-item-md",
105
+ valueText: "text-cascade-select-value-md"
106
+ },
107
+ lg: {
108
+ trigger: "p-cascade-select-trigger-md text-cascade-select-trigger-lg",
109
+ content: "popup-size-lg text-cascade-select-item-lg",
110
+ valueText: "text-cascade-select-value-lg"
111
+ }
112
+ }
113
+ },
114
+ defaultVariants: {
115
+ size: "md"
116
+ }
117
+ });
118
+ const pathsMatch = (api, selectedItems)=>selectedItems.length === api.value.length && selectedItems.every((items, pathIndex)=>items.length === api.value[pathIndex]?.length && items.every((item, itemIndex)=>api.collection.getNodeValue(item) === api.value[pathIndex]?.[itemIndex]));
119
+ const resolveSelectedItems = (api)=>{
120
+ if (pathsMatch(api, api.selectedItems)) return api.selectedItems;
121
+ return api.value.map((valuePath)=>{
122
+ const indexPath = api.collection.getIndexPath(valuePath);
123
+ return indexPath.map((_, index)=>api.collection.at(indexPath.slice(0, index + 1))).filter((item)=>void 0 !== item);
124
+ });
125
+ };
126
+ const formatSelectedItems = (api, selectedItems)=>{
127
+ const stringify = (item)=>api.collection.stringifyNode(item) ?? api.collection.getNodeValue(item);
128
+ if (api.multiple) return selectedItems.map((path)=>path.at(-1)).filter((item)=>void 0 !== item).map(stringify).join(", ");
129
+ return selectedItems.map((path)=>path.map(stringify).join(" / ")).join(", ");
130
+ };
131
+ const CascadeSelectContext = /*#__PURE__*/ createContext(null);
132
+ const CascadeSelectItemContext = /*#__PURE__*/ createContext(null);
133
+ function useCascadeSelectContext() {
134
+ const context = useContext(CascadeSelectContext);
135
+ if (!context) throw new Error("CascadeSelect parts must be used within CascadeSelect");
136
+ return context;
137
+ }
138
+ function useCascadeSelectItemContext() {
139
+ const context = useContext(CascadeSelectItemContext);
140
+ if (!context) throw new Error("CascadeSelect item parts must be used within CascadeSelect.Item");
141
+ return context;
142
+ }
143
+ function CascadeSelect({ children, className, id: providedId, items, ref, required = false, size = "md", validateStatus = "default", ...machineProps }) {
144
+ const generatedId = useId();
145
+ const id = providedId || generatedId;
146
+ const [statusTextIds, setStatusTextIds] = useState([]);
147
+ const collection = useMemo(()=>cascade_select_collection({
148
+ rootNode: {
149
+ children: items,
150
+ label: "",
151
+ value: "__cascade-select-root__"
152
+ },
153
+ isNodeDisabled: (item)=>item.disabled ?? false,
154
+ nodeToChildren: (item)=>item.children ?? [],
155
+ nodeToString: (item)=>item.label,
156
+ nodeToValue: (item)=>item.value
157
+ }), [
158
+ items
159
+ ]);
160
+ const service = useMachine(machine, {
161
+ ...machineProps,
162
+ collection,
163
+ id,
164
+ invalid: "error" === validateStatus,
165
+ positioning: {
166
+ fitViewport: true,
167
+ placement: "bottom-start",
168
+ ...machineProps.positioning
169
+ },
170
+ required
171
+ });
172
+ const api = connect(service, normalizeProps);
173
+ const styles = cascadeSelectVariants({
174
+ size
175
+ });
176
+ return /*#__PURE__*/ jsx(CascadeSelectContext.Provider, {
177
+ value: {
178
+ api,
179
+ formatValue: machineProps.formatValue,
180
+ required,
181
+ size,
182
+ statusTextIds,
183
+ setStatusTextIds,
184
+ validateStatus
185
+ },
186
+ children: /*#__PURE__*/ jsxs("div", {
187
+ ...api.getRootProps(),
188
+ className: styles.root({
189
+ className
190
+ }),
191
+ ref: ref,
192
+ children: [
193
+ /*#__PURE__*/ jsx("input", {
194
+ ...api.getHiddenInputProps()
195
+ }),
196
+ children
197
+ ]
198
+ })
199
+ });
200
+ }
201
+ CascadeSelect.Label = function({ children, ...props }) {
202
+ const { api, required } = useCascadeSelectContext();
203
+ return /*#__PURE__*/ jsx(Label, {
204
+ ...mergeProps(api.getLabelProps(), props),
205
+ disabled: api.disabled,
206
+ required: required,
207
+ children: children
208
+ });
209
+ };
210
+ CascadeSelect.Control = function({ className, ref, ...props }) {
211
+ const { api, size } = useCascadeSelectContext();
212
+ const styles = cascadeSelectVariants({
213
+ size
214
+ });
215
+ return /*#__PURE__*/ jsx("div", {
216
+ ...mergeProps(api.getControlProps(), props),
217
+ className: styles.control({
218
+ className
219
+ }),
220
+ ref: ref
221
+ });
222
+ };
223
+ CascadeSelect.Trigger = function({ className, ref, ...props }) {
224
+ const { api, size, statusTextIds, validateStatus } = useCascadeSelectContext();
225
+ const styles = cascadeSelectVariants({
226
+ size
227
+ });
228
+ const triggerProps = mergeProps(api.getTriggerProps(), props);
229
+ const ariaDescribedBy = [
230
+ triggerProps["aria-describedby"],
231
+ ...statusTextIds
232
+ ].filter(Boolean).join(" ") || void 0;
233
+ return /*#__PURE__*/ jsx(Button, {
234
+ ...triggerProps,
235
+ "aria-describedby": ariaDescribedBy,
236
+ className: styles.trigger({
237
+ className
238
+ }),
239
+ "data-validation": "default" === validateStatus ? void 0 : validateStatus,
240
+ ref: ref,
241
+ size: "current",
242
+ theme: "unstyled"
243
+ });
244
+ };
245
+ CascadeSelect.ValueText = function({ children, className, placeholder = "Select an option", ref, ...props }) {
246
+ const { api, formatValue, size } = useCascadeSelectContext();
247
+ const styles = cascadeSelectVariants({
248
+ size
249
+ });
250
+ const selectedItems = resolveSelectedItems(api);
251
+ const valueText = selectedItems === api.selectedItems ? api.valueAsString : formatValue?.(selectedItems) ?? formatSelectedItems(api, selectedItems);
252
+ const hasValue = api.hasSelectedItems;
253
+ let content = hasValue ? valueText : placeholder;
254
+ if (hasValue && "function" == typeof children) content = children(selectedItems);
255
+ else if (hasValue && void 0 !== children && "function" != typeof children) content = children;
256
+ return /*#__PURE__*/ jsx("span", {
257
+ ...mergeProps(api.getValueTextProps(), props),
258
+ className: styles.valueText({
259
+ className
260
+ }),
261
+ "data-placeholder": hasValue ? void 0 : "",
262
+ ref: ref,
263
+ children: content
264
+ });
265
+ };
266
+ CascadeSelect.Indicator = function({ children, className, iconSize = "current", ref, ...props }) {
267
+ const { api, size } = useCascadeSelectContext();
268
+ const styles = cascadeSelectVariants({
269
+ size
270
+ });
271
+ return /*#__PURE__*/ jsx("span", {
272
+ ...mergeProps(api.getIndicatorProps(), props),
273
+ className: styles.indicator({
274
+ className: `${controlGlyphClass[toControlSize(size)]} ${className ?? ""}`
275
+ }),
276
+ ref: ref,
277
+ children: children ?? /*#__PURE__*/ jsx(Icon, {
278
+ icon: "token-icon-cascade-select-indicator",
279
+ size: iconSize
280
+ })
281
+ });
282
+ };
283
+ CascadeSelect.ClearTrigger = function({ "aria-label": ariaLabel = "Clear selection", className, ref, ...props }) {
284
+ const { api, size } = useCascadeSelectContext();
285
+ const styles = cascadeSelectVariants({
286
+ size
287
+ });
288
+ return /*#__PURE__*/ jsx(ActionIcon, {
289
+ ...mergeProps(api.getClearTriggerProps(), props),
290
+ "aria-label": ariaLabel,
291
+ className: styles.clearTrigger({
292
+ className
293
+ }),
294
+ icon: "token-icon-cascade-select-clear",
295
+ ref: ref,
296
+ size: toControlSize(size),
297
+ tone: "neutral"
298
+ });
299
+ };
300
+ CascadeSelect.Positioner = function({ className, ref, ...props }) {
301
+ const { api, size } = useCascadeSelectContext();
302
+ const styles = cascadeSelectVariants({
303
+ size
304
+ });
305
+ return /*#__PURE__*/ jsx(Portal, {
306
+ children: /*#__PURE__*/ jsx("div", {
307
+ ...mergeProps(api.getPositionerProps(), props),
308
+ className: styles.positioner({
309
+ className
310
+ }),
311
+ ref: ref
312
+ })
313
+ });
314
+ };
315
+ CascadeSelect.Content = function({ className, ref, ...props }) {
316
+ const { api, size } = useCascadeSelectContext();
317
+ const styles = cascadeSelectVariants({
318
+ size
319
+ });
320
+ return /*#__PURE__*/ jsx("div", {
321
+ ...mergeProps(api.getContentProps(), props),
322
+ className: styles.content({
323
+ className
324
+ }),
325
+ ref: ref
326
+ });
327
+ };
328
+ CascadeSelect.List = function({ className, indexPath, item, ref, value, ...props }) {
329
+ const { api, size } = useCascadeSelectContext();
330
+ const styles = cascadeSelectVariants({
331
+ size
332
+ });
333
+ const itemProps = {
334
+ indexPath,
335
+ item,
336
+ value
337
+ };
338
+ return /*#__PURE__*/ jsx("ul", {
339
+ ...mergeProps(api.getListProps(itemProps), props),
340
+ className: styles.list({
341
+ className
342
+ }),
343
+ ref: ref
344
+ });
345
+ };
346
+ CascadeSelect.Item = function({ children, className, indexPath, item, ref, value, ...props }) {
347
+ const { api, size } = useCascadeSelectContext();
348
+ const styles = cascadeSelectVariants({
349
+ size
350
+ });
351
+ const itemProps = {
352
+ indexPath,
353
+ item,
354
+ value
355
+ };
356
+ const itemState = api.getItemState(itemProps);
357
+ return /*#__PURE__*/ jsx(CascadeSelectItemContext.Provider, {
358
+ value: {
359
+ itemProps,
360
+ itemState
361
+ },
362
+ children: /*#__PURE__*/ jsx("li", {
363
+ ...mergeProps(api.getItemProps(itemProps), props),
364
+ className: styles.item({
365
+ className
366
+ }),
367
+ ref: ref,
368
+ children: children
369
+ })
370
+ });
371
+ };
372
+ CascadeSelect.ItemText = function({ children, className, ref, ...props }) {
373
+ const { api, size } = useCascadeSelectContext();
374
+ const { itemProps } = useCascadeSelectItemContext();
375
+ const styles = cascadeSelectVariants({
376
+ size
377
+ });
378
+ return /*#__PURE__*/ jsx("span", {
379
+ ...mergeProps(api.getItemTextProps(itemProps), props),
380
+ className: styles.itemText({
381
+ className
382
+ }),
383
+ ref: ref,
384
+ children: children ?? itemProps.item.label
385
+ });
386
+ };
387
+ CascadeSelect.BranchIndicator = function({ children, className, iconSize = "current", ref, ...props }) {
388
+ const { size } = useCascadeSelectContext();
389
+ const { itemState } = useCascadeSelectItemContext();
390
+ const styles = cascadeSelectVariants({
391
+ size
392
+ });
393
+ if (!itemState.hasChildren) return null;
394
+ return /*#__PURE__*/ jsx("span", {
395
+ "aria-hidden": "true",
396
+ className: styles.branchIndicator({
397
+ className
398
+ }),
399
+ ref: ref,
400
+ ...props,
401
+ children: children ?? /*#__PURE__*/ jsx(Icon, {
402
+ icon: "token-icon-cascade-select-branch",
403
+ size: iconSize
404
+ })
405
+ });
406
+ };
407
+ CascadeSelect.ItemIndicator = function({ children, className, iconSize = "current", ref, ...props }) {
408
+ const { api, size } = useCascadeSelectContext();
409
+ const { itemProps } = useCascadeSelectItemContext();
410
+ const styles = cascadeSelectVariants({
411
+ size
412
+ });
413
+ return /*#__PURE__*/ jsx("span", {
414
+ ...mergeProps(api.getItemIndicatorProps(itemProps), props),
415
+ className: styles.itemIndicator({
416
+ className
417
+ }),
418
+ ref: ref,
419
+ children: children ?? /*#__PURE__*/ jsx(Icon, {
420
+ icon: "token-icon-cascade-select-check",
421
+ size: iconSize
422
+ })
423
+ });
424
+ };
425
+ function CascadeSelectTreeNode({ indexPath, node, value }) {
426
+ const { api } = useCascadeSelectContext();
427
+ const nodeProps = {
428
+ indexPath,
429
+ item: node,
430
+ value
431
+ };
432
+ const nodeState = api.getItemState(nodeProps);
433
+ const children = api.collection.getNodeChildren(node);
434
+ const highlightedChild = nodeState.highlightedChild;
435
+ return /*#__PURE__*/ jsxs(Fragment, {
436
+ children: [
437
+ /*#__PURE__*/ jsx(CascadeSelect.List, {
438
+ ...nodeProps,
439
+ children: children.map((item, index)=>{
440
+ const itemValue = api.collection.getNodeValue(item);
441
+ const itemProps = {
442
+ indexPath: [
443
+ ...indexPath,
444
+ index
445
+ ],
446
+ item,
447
+ value: [
448
+ ...value,
449
+ itemValue
450
+ ]
451
+ };
452
+ return /*#__PURE__*/ createElement(CascadeSelect.Item, {
453
+ ...itemProps,
454
+ key: itemValue,
455
+ children: [
456
+ /*#__PURE__*/ jsx(CascadeSelect.ItemText, {}, "text"),
457
+ /*#__PURE__*/ jsx(CascadeSelect.ItemIndicator, {}, "item-indicator"),
458
+ /*#__PURE__*/ jsx(CascadeSelect.BranchIndicator, {}, "branch-indicator")
459
+ ]
460
+ });
461
+ })
462
+ }),
463
+ highlightedChild && api.collection.isBranchNode(highlightedChild) && /*#__PURE__*/ jsx(CascadeSelectTreeNode, {
464
+ indexPath: [
465
+ ...indexPath,
466
+ nodeState.highlightedIndex
467
+ ],
468
+ node: highlightedChild,
469
+ value: [
470
+ ...value,
471
+ api.collection.getNodeValue(highlightedChild)
472
+ ]
473
+ })
474
+ ]
475
+ });
476
+ }
477
+ CascadeSelect.Node = function({ indexPath = [], node, value = [] }) {
478
+ const { api } = useCascadeSelectContext();
479
+ return /*#__PURE__*/ jsx(CascadeSelectTreeNode, {
480
+ indexPath: indexPath,
481
+ node: node ?? api.collection.rootNode,
482
+ value: value
483
+ });
484
+ };
485
+ CascadeSelect.StatusText = function({ id: providedId, size: sizeProp, status: statusProp, ...props }) {
486
+ const { setStatusTextIds, size, validateStatus } = useCascadeSelectContext();
487
+ const generatedId = useId();
488
+ const id = providedId || generatedId;
489
+ const effectiveSize = sizeProp ?? size;
490
+ useEffect(()=>{
491
+ setStatusTextIds((ids)=>[
492
+ ...ids,
493
+ id
494
+ ]);
495
+ return ()=>setStatusTextIds((ids)=>ids.filter((statusId)=>statusId !== id));
496
+ }, [
497
+ id,
498
+ setStatusTextIds
499
+ ]);
500
+ return /*#__PURE__*/ jsx(StatusText, {
501
+ ...props,
502
+ id: id,
503
+ size: "xs" === effectiveSize ? "sm" : effectiveSize,
504
+ status: statusProp ?? validateStatus
505
+ });
506
+ };
507
+ CascadeSelect.displayName = "CascadeSelect";
508
+ export { CascadeSelect, cascadeSelectVariants, useCascadeSelectContext };
@@ -0,0 +1,231 @@
1
+ /**
2
+ * CascadeSelect — @techsio/ui-kit molecule.
3
+ *
4
+ * @component CascadeSelect
5
+ * @componentVersion v1.0.1
6
+ * @skill cascade-select-usage
7
+ * @changelog libs/ui/stories/changelog/changelog.stories.tsx
8
+ *
9
+ * Versioning is enforced at commit by scripts/check-skill-sync.mjs: @componentVersion must match
10
+ * the cascade-select-usage skill's component_version and a changelog entry. Bump all three together.
11
+ */
12
+ import { type Api as ZagCascadeSelectApi, type ItemProps as ZagCascadeSelectItemProps, type Props as ZagCascadeSelectProps } from "@zag-js/cascade-select";
13
+ import { type PropTypes } from "@zag-js/react";
14
+ import { type ComponentPropsWithoutRef, type Dispatch, type ReactNode, type Ref, type SetStateAction } from "react";
15
+ import type { VariantProps } from "tailwind-variants";
16
+ import { type ActionIconProps } from "../atoms/action-icon.js";
17
+ import { type IconProps } from "../atoms/icon.js";
18
+ import { Label } from "../atoms/label.js";
19
+ import { type StatusTextProps } from "../atoms/status-text.js";
20
+ export type CascadeSelectSize = "xs" | "sm" | "md" | "lg";
21
+ export type CascadeSelectValidateStatus = "default" | "error" | "success" | "warning";
22
+ export type CascadeSelectItem = {
23
+ label: string;
24
+ value: string;
25
+ children?: CascadeSelectItem[];
26
+ disabled?: boolean;
27
+ };
28
+ export declare const cascadeSelectVariants: import("tailwind-variants").TVReturnType<{
29
+ size: {
30
+ xs: {
31
+ trigger: string;
32
+ content: string;
33
+ valueText: string;
34
+ };
35
+ sm: {
36
+ trigger: string;
37
+ content: string;
38
+ valueText: string;
39
+ };
40
+ md: {
41
+ trigger: string;
42
+ content: string;
43
+ valueText: string;
44
+ };
45
+ lg: {
46
+ trigger: string;
47
+ content: string;
48
+ valueText: string;
49
+ };
50
+ };
51
+ }, {
52
+ root: string;
53
+ control: string;
54
+ positioner: string;
55
+ trigger: string[];
56
+ clearTrigger: string;
57
+ content: string[];
58
+ list: string;
59
+ item: string[];
60
+ itemText: string;
61
+ branchIndicator: string[];
62
+ itemIndicator: string[];
63
+ valueText: string[];
64
+ indicator: string[];
65
+ }, undefined, {
66
+ size: {
67
+ xs: {
68
+ trigger: string;
69
+ content: string;
70
+ valueText: string;
71
+ };
72
+ sm: {
73
+ trigger: string;
74
+ content: string;
75
+ valueText: string;
76
+ };
77
+ md: {
78
+ trigger: string;
79
+ content: string;
80
+ valueText: string;
81
+ };
82
+ lg: {
83
+ trigger: string;
84
+ content: string;
85
+ valueText: string;
86
+ };
87
+ };
88
+ }, {
89
+ root: string;
90
+ control: string;
91
+ positioner: string;
92
+ trigger: string[];
93
+ clearTrigger: string;
94
+ content: string[];
95
+ list: string;
96
+ item: string[];
97
+ itemText: string;
98
+ branchIndicator: string[];
99
+ itemIndicator: string[];
100
+ valueText: string[];
101
+ indicator: string[];
102
+ }, import("tailwind-variants").TVReturnType<{
103
+ size: {
104
+ xs: {
105
+ trigger: string;
106
+ content: string;
107
+ valueText: string;
108
+ };
109
+ sm: {
110
+ trigger: string;
111
+ content: string;
112
+ valueText: string;
113
+ };
114
+ md: {
115
+ trigger: string;
116
+ content: string;
117
+ valueText: string;
118
+ };
119
+ lg: {
120
+ trigger: string;
121
+ content: string;
122
+ valueText: string;
123
+ };
124
+ };
125
+ }, {
126
+ root: string;
127
+ control: string;
128
+ positioner: string;
129
+ trigger: string[];
130
+ clearTrigger: string;
131
+ content: string[];
132
+ list: string;
133
+ item: string[];
134
+ itemText: string;
135
+ branchIndicator: string[];
136
+ itemIndicator: string[];
137
+ valueText: string[];
138
+ indicator: string[];
139
+ }, undefined, unknown, unknown, undefined>>;
140
+ type CascadeSelectApi = ZagCascadeSelectApi<PropTypes, CascadeSelectItem>;
141
+ type CascadeSelectContextValue = {
142
+ api: CascadeSelectApi;
143
+ formatValue?: (selectedItems: CascadeSelectItem[][]) => string;
144
+ required: boolean;
145
+ size: CascadeSelectSize;
146
+ statusTextIds: string[];
147
+ setStatusTextIds: Dispatch<SetStateAction<string[]>>;
148
+ validateStatus: CascadeSelectValidateStatus;
149
+ };
150
+ export declare function useCascadeSelectContext(): CascadeSelectContextValue;
151
+ export type CascadeSelectProps = VariantProps<typeof cascadeSelectVariants> & Omit<ZagCascadeSelectProps<CascadeSelectItem>, "collection" | "id" | "invalid"> & {
152
+ children: ReactNode;
153
+ className?: string;
154
+ id?: string;
155
+ items: CascadeSelectItem[];
156
+ ref?: Ref<HTMLDivElement>;
157
+ validateStatus?: CascadeSelectValidateStatus;
158
+ };
159
+ export declare function CascadeSelect({ children, className, id: providedId, items, ref, required, size, validateStatus, ...machineProps }: CascadeSelectProps): import("react/jsx-runtime").JSX.Element;
160
+ export declare namespace CascadeSelect {
161
+ var Label: ({ children, ...props }: CascadeSelectLabelProps) => import("react/jsx-runtime").JSX.Element;
162
+ var Control: ({ className, ref, ...props }: CascadeSelectControlProps) => import("react/jsx-runtime").JSX.Element;
163
+ var Trigger: ({ className, ref, ...props }: CascadeSelectTriggerProps) => import("react/jsx-runtime").JSX.Element;
164
+ var ValueText: ({ children, className, placeholder, ref, ...props }: CascadeSelectValueTextProps) => import("react/jsx-runtime").JSX.Element;
165
+ var Indicator: ({ children, className, iconSize, ref, ...props }: CascadeSelectIndicatorProps) => import("react/jsx-runtime").JSX.Element;
166
+ var ClearTrigger: ({ "aria-label": ariaLabel, className, ref, ...props }: CascadeSelectClearTriggerProps) => import("react/jsx-runtime").JSX.Element;
167
+ var Positioner: ({ className, ref, ...props }: CascadeSelectPositionerProps) => import("react/jsx-runtime").JSX.Element;
168
+ var Content: ({ className, ref, ...props }: CascadeSelectContentProps) => import("react/jsx-runtime").JSX.Element;
169
+ var List: ({ className, indexPath, item, ref, value, ...props }: CascadeSelectListProps) => import("react/jsx-runtime").JSX.Element;
170
+ var Item: ({ children, className, indexPath, item, ref, value, ...props }: CascadeSelectItemProps) => import("react/jsx-runtime").JSX.Element;
171
+ var ItemText: ({ children, className, ref, ...props }: CascadeSelectItemTextProps) => import("react/jsx-runtime").JSX.Element;
172
+ var BranchIndicator: ({ children, className, iconSize, ref, ...props }: CascadeSelectBranchIndicatorProps) => import("react/jsx-runtime").JSX.Element | null;
173
+ var ItemIndicator: ({ children, className, iconSize, ref, ...props }: CascadeSelectItemIndicatorProps) => import("react/jsx-runtime").JSX.Element;
174
+ var Node: ({ indexPath, node, value, }: CascadeSelectNodeProps) => import("react/jsx-runtime").JSX.Element;
175
+ var StatusText: ({ id: providedId, size: sizeProp, status: statusProp, ...props }: CascadeSelectStatusTextProps) => import("react/jsx-runtime").JSX.Element;
176
+ var displayName: string;
177
+ }
178
+ type CascadeSelectLabelProps = Omit<ComponentPropsWithoutRef<typeof Label>, "disabled" | "required">;
179
+ type CascadeSelectControlProps = ComponentPropsWithoutRef<"div"> & {
180
+ ref?: Ref<HTMLDivElement>;
181
+ };
182
+ type CascadeSelectTriggerProps = ComponentPropsWithoutRef<"button"> & {
183
+ ref?: Ref<HTMLButtonElement>;
184
+ };
185
+ type CascadeSelectValueTextProps = Omit<ComponentPropsWithoutRef<"span">, "children"> & {
186
+ children?: ReactNode | ((selectedItems: CascadeSelectItem[][]) => ReactNode);
187
+ placeholder?: ReactNode;
188
+ ref?: Ref<HTMLSpanElement>;
189
+ };
190
+ type CascadeSelectIndicatorProps = ComponentPropsWithoutRef<"span"> & {
191
+ iconSize?: IconProps["size"];
192
+ ref?: Ref<HTMLSpanElement>;
193
+ };
194
+ type CascadeSelectClearTriggerProps = Omit<ActionIconProps, "icon" | "size" | "tone"> & {
195
+ ref?: Ref<HTMLButtonElement>;
196
+ };
197
+ type CascadeSelectPositionerProps = ComponentPropsWithoutRef<"div"> & {
198
+ ref?: Ref<HTMLDivElement>;
199
+ };
200
+ type CascadeSelectContentProps = ComponentPropsWithoutRef<"div"> & {
201
+ ref?: Ref<HTMLDivElement>;
202
+ };
203
+ type CascadeSelectNodePartProps = ZagCascadeSelectItemProps<CascadeSelectItem>;
204
+ type CascadeSelectListProps = Omit<ComponentPropsWithoutRef<"ul">, keyof CascadeSelectNodePartProps> & CascadeSelectNodePartProps & {
205
+ ref?: Ref<HTMLUListElement>;
206
+ };
207
+ type CascadeSelectItemProps = Omit<ComponentPropsWithoutRef<"li">, keyof CascadeSelectNodePartProps> & CascadeSelectNodePartProps & {
208
+ ref?: Ref<HTMLLIElement>;
209
+ };
210
+ type CascadeSelectItemTextProps = ComponentPropsWithoutRef<"span"> & {
211
+ ref?: Ref<HTMLSpanElement>;
212
+ };
213
+ type CascadeSelectBranchIndicatorProps = ComponentPropsWithoutRef<"span"> & {
214
+ iconSize?: IconProps["size"];
215
+ ref?: Ref<HTMLSpanElement>;
216
+ };
217
+ type CascadeSelectItemIndicatorProps = ComponentPropsWithoutRef<"span"> & {
218
+ iconSize?: IconProps["size"];
219
+ ref?: Ref<HTMLSpanElement>;
220
+ };
221
+ type CascadeSelectNodeProps = {
222
+ indexPath?: number[];
223
+ node?: CascadeSelectItem;
224
+ value?: string[];
225
+ };
226
+ type CascadeSelectStatusTextProps = Omit<StatusTextProps, "size" | "status"> & {
227
+ size?: CascadeSelectSize;
228
+ status?: CascadeSelectValidateStatus;
229
+ };
230
+ export {};
231
+ //# sourceMappingURL=cascade-select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cascade-select.d.ts","sourceRoot":"","sources":["../../../src/molecules/cascade-select.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAIL,KAAK,GAAG,IAAI,mBAAmB,EAC/B,KAAK,SAAS,IAAI,yBAAyB,EAE3C,KAAK,KAAK,IAAI,qBAAqB,EAEpC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAIL,KAAK,SAAS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zag-js/cascade-select";
3
4
  export type * as Checkbox from "@zag-js/checkbox";
4
5
  export type * as Combobox from "@zag-js/combobox";
5
6
  export type * as Dialog from "@zag-js/dialog";
@@ -1 +1 @@
1
- {"version":3,"file":"zag.d.ts","sourceRoot":"","sources":["../../../src/types/zag.ts"],"names":[],"mappings":"AAAA,YAAY,KAAK,SAAS,MAAM,mBAAmB,CAAA;AACnD,YAAY,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AACjD,YAAY,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AACjD,YAAY,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AACjD,YAAY,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAC7C,YAAY,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAC7C,YAAY,KAAK,UAAU,MAAM,qBAAqB,CAAA;AACtD,YAAY,KAAK,IAAI,MAAM,cAAc,CAAA;AACzC,YAAY,KAAK,WAAW,MAAM,sBAAsB,CAAA;AACxD,YAAY,KAAK,UAAU,MAAM,oBAAoB,CAAA;AACrD,YAAY,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC/C,YAAY,KAAK,UAAU,MAAM,qBAAqB,CAAA;AACtD,YAAY,KAAK,WAAW,MAAM,sBAAsB,CAAA;AACxD,YAAY,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAC7C,YAAY,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAC7C,YAAY,KAAK,KAAK,MAAM,eAAe,CAAA;AAC3C,YAAY,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAC7C,YAAY,KAAK,IAAI,MAAM,cAAc,CAAA;AACzC,YAAY,KAAK,KAAK,MAAM,eAAe,CAAA;AAC3C,YAAY,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC/C,YAAY,KAAK,QAAQ,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"zag.d.ts","sourceRoot":"","sources":["../../../src/types/zag.ts"],"names":[],"mappings":"AAAA,YAAY,KAAK,SA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A;AAED,eAAe,IAAI,CAAA;AAEnB,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,SAAS,CAAM,CAAA"}
1
+ {"version":3,"file":"changelog.stories.d.ts","sourceRoot":"","sources":["../../../stories/changelog/changelog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AA+LtD,iBAAS,SAAS,4CAUjB;AAED,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAKhC,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,SAAS,CAAM,CAAA"}
@@ -0,0 +1,254 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ import { CascadeSelect } from "../../src/molecules/cascade-select.js";
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof CascadeSelect;
6
+ parameters: {
7
+ layout: string;
8
+ docs: {
9
+ description: {
10
+ component: string;
11
+ };
12
+ };
13
+ };
14
+ tags: string[];
15
+ argTypes: {
16
+ size: {
17
+ control: "select";
18
+ options: string[];
19
+ description: string;
20
+ table: {
21
+ defaultValue: {
22
+ summary: string;
23
+ };
24
+ };
25
+ };
26
+ validateStatus: {
27
+ control: "select";
28
+ options: string[];
29
+ description: string;
30
+ table: {
31
+ defaultValue: {
32
+ summary: string;
33
+ };
34
+ };
35
+ };
36
+ disabled: {
37
+ control: "boolean";
38
+ };
39
+ readOnly: {
40
+ control: "boolean";
41
+ };
42
+ required: {
43
+ control: "boolean";
44
+ };
45
+ multiple: {
46
+ control: "boolean";
47
+ };
48
+ highlightTrigger: {
49
+ control: "inline-radio";
50
+ options: string[];
51
+ };
52
+ closeOnSelect: {
53
+ control: "boolean";
54
+ };
55
+ allowParentSelection: {
56
+ control: "boolean";
57
+ };
58
+ loopFocus: {
59
+ control: "boolean";
60
+ };
61
+ dir: {
62
+ control: "inline-radio";
63
+ options: string[];
64
+ };
65
+ children: {
66
+ readonly control: false;
67
+ readonly table: {
68
+ readonly disable: true;
69
+ };
70
+ };
71
+ className: {
72
+ readonly control: false;
73
+ readonly table: {
74
+ readonly disable: true;
75
+ };
76
+ };
77
+ id: {
78
+ readonly control: false;
79
+ readonly table: {
80
+ readonly disable: true;
81
+ };
82
+ };
83
+ ref: {
84
+ readonly control: false;
85
+ readonly table: {
86
+ readonly disable: true;
87
+ };
88
+ };
89
+ items: {
90
+ readonly control: false;
91
+ readonly table: {
92
+ readonly disable: true;
93
+ };
94
+ };
95
+ value: {
96
+ readonly control: false;
97
+ readonly table: {
98
+ readonly disable: true;
99
+ };
100
+ };
101
+ defaultValue: {
102
+ readonly control: false;
103
+ readonly table: {
104
+ readonly disable: true;
105
+ };
106
+ };
107
+ open: {
108
+ readonly control: false;
109
+ readonly table: {
110
+ readonly disable: true;
111
+ };
112
+ };
113
+ defaultOpen: {
114
+ readonly control: false;
115
+ readonly table: {
116
+ readonly disable: true;
117
+ };
118
+ };
119
+ highlightedValue: {
120
+ readonly control: false;
121
+ readonly table: {
122
+ readonly disable: true;
123
+ };
124
+ };
125
+ defaultHighlightedValue: {
126
+ readonly control: false;
127
+ readonly table: {
128
+ readonly disable: true;
129
+ };
130
+ };
131
+ positioning: {
132
+ readonly control: false;
133
+ readonly table: {
134
+ readonly disable: true;
135
+ };
136
+ };
137
+ formatValue: {
138
+ readonly control: false;
139
+ readonly table: {
140
+ readonly disable: true;
141
+ };
142
+ };
143
+ name: {
144
+ readonly control: false;
145
+ readonly table: {
146
+ readonly disable: true;
147
+ };
148
+ };
149
+ form: {
150
+ readonly control: false;
151
+ readonly table: {
152
+ readonly disable: true;
153
+ };
154
+ };
155
+ ids: {
156
+ readonly control: false;
157
+ readonly table: {
158
+ readonly disable: true;
159
+ };
160
+ };
161
+ getRootNode: {
162
+ readonly control: false;
163
+ readonly table: {
164
+ readonly disable: true;
165
+ };
166
+ };
167
+ scrollToIndexFn: {
168
+ readonly control: false;
169
+ readonly table: {
170
+ readonly disable: true;
171
+ };
172
+ };
173
+ onFocusOutside: {
174
+ readonly control: false;
175
+ readonly table: {
176
+ readonly disable: true;
177
+ };
178
+ };
179
+ onInteractOutside: {
180
+ readonly control: false;
181
+ readonly table: {
182
+ readonly disable: true;
183
+ };
184
+ };
185
+ onPointerDownOutside: {
186
+ readonly control: false;
187
+ readonly table: {
188
+ readonly disable: true;
189
+ };
190
+ };
191
+ onValueChange: {
192
+ readonly control: false;
193
+ readonly table: {
194
+ readonly disable: true;
195
+ };
196
+ };
197
+ onOpenChange: {
198
+ readonly control: false;
199
+ readonly table: {
200
+ readonly disable: true;
201
+ };
202
+ };
203
+ onHighlightChange: {
204
+ readonly control: false;
205
+ readonly table: {
206
+ readonly disable: true;
207
+ };
208
+ };
209
+ };
210
+ args: {
211
+ children: null;
212
+ items: {
213
+ label: string;
214
+ value: string;
215
+ children: ({
216
+ label: string;
217
+ value: string;
218
+ disabled?: undefined;
219
+ } | {
220
+ label: string;
221
+ value: string;
222
+ disabled: true;
223
+ })[];
224
+ }[];
225
+ size: "md";
226
+ validateStatus: "default";
227
+ disabled: false;
228
+ readOnly: false;
229
+ required: false;
230
+ multiple: false;
231
+ highlightTrigger: "click";
232
+ closeOnSelect: true;
233
+ allowParentSelection: false;
234
+ loopFocus: false;
235
+ dir: "ltr";
236
+ onValueChange: import("storybook/test").Mock<(...args: any[]) => any>;
237
+ onOpenChange: import("storybook/test").Mock<(...args: any[]) => any>;
238
+ onHighlightChange: import("storybook/test").Mock<(...args: any[]) => any>;
239
+ };
240
+ };
241
+ export default meta;
242
+ type Story = StoryObj<typeof meta>;
243
+ export declare const Playground: Story;
244
+ export declare const Sizes: Story;
245
+ export declare const States: Story;
246
+ export declare const OpenHierarchy: Story;
247
+ export declare const NavigationModes: Story;
248
+ export declare const MultipleSelection: Story;
249
+ export declare const ParentSelection: Story;
250
+ export declare const Controlled: Story;
251
+ export declare const WithinForm: Story;
252
+ export declare const AccessibleStatusText: Story;
253
+ export declare const CustomValueFormatting: Story;
254
+ //# sourceMappingURL=cascade-select.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cascade-select.stories.d.ts","sourceRoot":"","sources":["../../../stories/molecules/cascade-select.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAKtD,OAAO,EACL,aAAa,EAEd,MAAM,oCAAoC,CAAA;AAwK3C,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiF4B,CAAA;AAEtC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,UAAU,EAAE,KASxB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAqCnB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAwDpB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAU3B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAqB7B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAe/B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAW7B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAExB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAExB,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAUlC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KAgBnC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cascade-select.behavior.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cascade-select.behavior.spec.d.ts","sourceRoot":"","sources":["../../test/cascade-select.behavior.spec.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techsio/ui-kit",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -100,6 +100,7 @@
100
100
  "@tanstack/react-virtual": "^3.14.8",
101
101
  "@zag-js/accordion": "1.43.3",
102
102
  "@zag-js/carousel": "1.43.3",
103
+ "@zag-js/cascade-select": "1.43.3",
103
104
  "@zag-js/checkbox": "1.43.3",
104
105
  "@zag-js/combobox": "1.43.3",
105
106
  "@zag-js/dialog": "1.43.3",
@@ -19,6 +19,7 @@
19
19
  @import "./molecules/_accordion.css";
20
20
  @import "./molecules/_breadcrumb.css";
21
21
  @import "./molecules/_carousel.css";
22
+ @import "./molecules/_cascade-select.css";
22
23
  @import "./molecules/_chart.css";
23
24
  @import "./molecules/_color-select.css";
24
25
  @import "./molecules/_combobox.css";
@@ -0,0 +1,66 @@
1
+ /* CascadeSelect inherits Select controls and the shared popup contract. */
2
+ @theme static {
3
+ /* === COLORS === */
4
+ --color-cascade-select-trigger-bg-hover: var(--color-select-trigger-bg-hover);
5
+ --color-cascade-select-trigger-fg-base: var(--color-select-trigger-fg-base);
6
+ --color-cascade-select-trigger-fg-hover: var(--color-select-trigger-fg-hover);
7
+ --color-cascade-select-trigger-border: var(--color-select-trigger-border);
8
+ --color-cascade-select-trigger-border-hover: var(
9
+ --color-select-trigger-border-hover
10
+ );
11
+ --color-cascade-select-trigger-border-focus: var(
12
+ --color-select-trigger-border-focus
13
+ );
14
+ --color-cascade-select-bg-disabled: var(--color-select-bg-disabled);
15
+ --color-cascade-select-fg-disabled: var(--color-select-fg-disabled);
16
+ --color-cascade-select-border-disabled: var(--color-select-border-disabled);
17
+ --color-cascade-select-border-error: var(--color-select-border-error);
18
+ --color-cascade-select-border-success: var(--color-select-border-success);
19
+ --color-cascade-select-border-warning: var(--color-select-border-warning);
20
+ --color-cascade-select-placeholder: var(--color-select-placeholder);
21
+ --color-cascade-select-ring: var(--color-select-ring);
22
+
23
+ /* === SPACING === */
24
+ --spacing-cascade-select: var(--spacing-select);
25
+ --spacing-cascade-select-right: var(--spacing-select-right);
26
+ --padding-cascade-select-trigger-sm: var(--padding-select-trigger-sm);
27
+ --padding-cascade-select-trigger-md: var(--padding-select-trigger-md);
28
+
29
+ /* === SIZING === */
30
+ --container-cascade-select-column: var(--container-3xs);
31
+
32
+ /* === TYPOGRAPHY === */
33
+ --text-cascade-select-trigger-xs: var(--text-select-trigger-xs);
34
+ --text-cascade-select-trigger-sm: var(--text-select-trigger-sm);
35
+ --text-cascade-select-trigger-md: var(--text-select-trigger-md);
36
+ --text-cascade-select-trigger-lg: var(--text-select-trigger-lg);
37
+ --text-cascade-select-value-xs: var(--text-select-value-xs);
38
+ --text-cascade-select-value-sm: var(--text-select-value-sm);
39
+ --text-cascade-select-value-md: var(--text-select-value-md);
40
+ --text-cascade-select-value-lg: var(--text-select-value-lg);
41
+ --text-cascade-select-item-xs: var(--text-select-item-xs);
42
+ --text-cascade-select-item-sm: var(--text-select-item-sm);
43
+ --text-cascade-select-item-md: var(--text-select-item-md);
44
+ --text-cascade-select-item-lg: var(--text-select-item-lg);
45
+
46
+ /* === RADIUS === */
47
+ --radius-cascade-select-sm: var(--radius-select-sm);
48
+ --radius-cascade-select-md: var(--radius-select-md);
49
+ }
50
+
51
+ /* === ICONS === */
52
+ @utility token-icon-cascade-select-indicator {
53
+ @apply token-icon-select-indicator;
54
+ }
55
+
56
+ @utility token-icon-cascade-select-clear {
57
+ @apply token-icon-select-clear;
58
+ }
59
+
60
+ @utility token-icon-cascade-select-branch {
61
+ @apply token-icon-chevron-right;
62
+ }
63
+
64
+ @utility token-icon-cascade-select-check {
65
+ @apply token-icon-check;
66
+ }