@nurix/ui-component-library 1.1.3-stage.89 → 1.1.3-stage.91
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/README.md +1 -1
- package/dist/index.d.mts +561 -71
- package/dist/index.d.ts +561 -71
- package/dist/index.js +1460 -26
- package/dist/index.mjs +1428 -26
- package/dist/styles.css +538 -42
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -41,16 +41,38 @@ __export(index_exports, {
|
|
|
41
41
|
Button: () => Button,
|
|
42
42
|
Checkbox: () => Checkbox,
|
|
43
43
|
DEFAULT_THEME: () => DEFAULT_THEME,
|
|
44
|
+
Dialog: () => Dialog,
|
|
45
|
+
DialogBody: () => DialogBody,
|
|
46
|
+
DialogFooter: () => DialogFooter,
|
|
47
|
+
DialogHeader: () => DialogHeader,
|
|
44
48
|
DialogHeaderNavigation: () => DialogHeaderNavigation,
|
|
49
|
+
DialogIcon: () => DialogIcon,
|
|
50
|
+
EmptyState: () => EmptyState,
|
|
45
51
|
FileInput: () => FileInput,
|
|
46
52
|
Input: () => Input,
|
|
47
53
|
InputGroup: () => InputGroup,
|
|
48
54
|
LegoLandWrapper: () => LegoLandWrapper,
|
|
55
|
+
List: () => List,
|
|
49
56
|
NumberBadge: () => NumberBadge,
|
|
50
57
|
NurixThemeProvider: () => NurixThemeProvider,
|
|
58
|
+
PlaySelect: () => PlaySelect,
|
|
59
|
+
PlaybackControl: () => PlaybackControl,
|
|
51
60
|
RadioGroup: () => RadioGroup,
|
|
52
61
|
RadioGroupItem: () => RadioGroupItem,
|
|
62
|
+
Select: () => Select,
|
|
63
|
+
SelectContent: () => SelectContent,
|
|
64
|
+
SelectFormLabel: () => SelectFormLabel,
|
|
65
|
+
SelectGroup: () => SelectGroup,
|
|
66
|
+
SelectItem: () => SelectItem,
|
|
67
|
+
SelectLabel: () => SelectLabel,
|
|
68
|
+
SelectScrollDownButton: () => SelectScrollDownButton,
|
|
69
|
+
SelectScrollUpButton: () => SelectScrollUpButton,
|
|
70
|
+
SelectSeparator: () => SelectSeparator,
|
|
71
|
+
SelectTrigger: () => SelectTrigger,
|
|
72
|
+
SelectValue: () => SelectValue,
|
|
53
73
|
ShadowDOMWrapper: () => ShadowDOMWrapper,
|
|
74
|
+
Stepper: () => Stepper,
|
|
75
|
+
StepperBar: () => StepperBar,
|
|
54
76
|
Switch: () => Switch,
|
|
55
77
|
Tabs: () => Tabs,
|
|
56
78
|
TabsContent: () => TabsContent,
|
|
@@ -58,6 +80,16 @@ __export(index_exports, {
|
|
|
58
80
|
TabsTrigger: () => TabsTrigger,
|
|
59
81
|
Textarea: () => Textarea,
|
|
60
82
|
ThemeProvider: () => ThemeProvider,
|
|
83
|
+
Toast: () => Toast,
|
|
84
|
+
Toaster: () => Toaster,
|
|
85
|
+
Tooltip: () => Tooltip,
|
|
86
|
+
TooltipContent: () => TooltipContent,
|
|
87
|
+
TooltipProvider: () => TooltipProvider,
|
|
88
|
+
TooltipTrigger: () => TooltipTrigger,
|
|
89
|
+
Typography: () => Typography,
|
|
90
|
+
showToast: () => showToast,
|
|
91
|
+
usePlaySelect: () => usePlaySelect,
|
|
92
|
+
useSelect: () => useSelect,
|
|
61
93
|
useTheme: () => useTheme
|
|
62
94
|
});
|
|
63
95
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -416,7 +448,7 @@ var DEFAULT_THEME = {
|
|
|
416
448
|
background: "#f5f5f5",
|
|
417
449
|
foreground: "#0a0a0a",
|
|
418
450
|
border: "#e5e5e5",
|
|
419
|
-
destructive: "#
|
|
451
|
+
destructive: "#ef4444",
|
|
420
452
|
secondary: "#e5e5e5",
|
|
421
453
|
mutedForeground: "#737373",
|
|
422
454
|
muted: "#f5f5f5",
|
|
@@ -450,7 +482,9 @@ var DEFAULT_THEME = {
|
|
|
450
482
|
semanticForeground: "#ffffff",
|
|
451
483
|
disabled: "#d4d4d4",
|
|
452
484
|
primary10: "#1d488519",
|
|
453
|
-
success: "#
|
|
485
|
+
success: "#10b981",
|
|
486
|
+
warning: "#fef3c7",
|
|
487
|
+
warningForeground: "#78350f",
|
|
454
488
|
switchTrack: "#e5e5e5"
|
|
455
489
|
},
|
|
456
490
|
darkMode: {
|
|
@@ -472,7 +506,7 @@ var DEFAULT_THEME = {
|
|
|
472
506
|
chart4: "#0d74ce",
|
|
473
507
|
chart1: "#5eb1ef",
|
|
474
508
|
chart5: "#113264",
|
|
475
|
-
card: "#
|
|
509
|
+
card: "#262626",
|
|
476
510
|
cardForeground: "#fafafa",
|
|
477
511
|
popover: "#262626",
|
|
478
512
|
popoverForeground: "#fafafa",
|
|
@@ -492,6 +526,8 @@ var DEFAULT_THEME = {
|
|
|
492
526
|
disabled: "#404040",
|
|
493
527
|
primary10: "#e6f1ff1a",
|
|
494
528
|
success: "#a7f3d0",
|
|
529
|
+
warning: "#fde68a",
|
|
530
|
+
warningForeground: "#78350f",
|
|
495
531
|
switchTrack: "#ffffff"
|
|
496
532
|
}
|
|
497
533
|
},
|
|
@@ -517,24 +553,25 @@ var DEFAULT_THEME = {
|
|
|
517
553
|
// src/button/variables.ts
|
|
518
554
|
var _a, _b;
|
|
519
555
|
var BUTTON_TOKENS = {
|
|
520
|
-
base: "relative inline-flex items-center justify-center gap-
|
|
556
|
+
base: "relative inline-flex items-center justify-center gap-[10px] whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none [&>svg]:size-6 cursor-pointer",
|
|
521
557
|
hoverOverlay: "overflow-hidden after:content-[''] after:absolute after:inset-0 after:pointer-events-none after:rounded-[inherit] after:bg-black/10 after:opacity-0 after:transition-opacity hover:after:opacity-100",
|
|
522
558
|
variant: {
|
|
523
559
|
primary: "bg-primary text-primary-foreground disabled:bg-disabled disabled:text-primary-foreground disabled:opacity-100",
|
|
524
|
-
secondary: "bg-secondary text-secondary-foreground disabled:bg-
|
|
560
|
+
secondary: "bg-secondary text-secondary-foreground disabled:bg-disabled disabled:text-primary-foreground disabled:opacity-100",
|
|
525
561
|
destructive: "bg-destructive text-destructive-foreground disabled:bg-disabled disabled:text-primary-foreground disabled:opacity-100",
|
|
526
|
-
outline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-
|
|
527
|
-
link: "bg-transparent text-
|
|
562
|
+
outline: "border border-sidebar-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-sidebar-border disabled:text-disabled disabled:opacity-100",
|
|
563
|
+
link: "bg-transparent text-primary disabled:text-muted-foreground disabled:opacity-100",
|
|
528
564
|
// Icon-only variants (pair with size `icon` / `iconSm`)
|
|
529
565
|
iconPrimary: "bg-primary text-primary-foreground disabled:bg-disabled disabled:text-primary-foreground disabled:opacity-100",
|
|
530
|
-
iconSecondary: "bg-secondary text-secondary-foreground disabled:bg-
|
|
531
|
-
iconOutline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-
|
|
566
|
+
iconSecondary: "bg-secondary text-secondary-foreground disabled:bg-disabled disabled:text-primary-foreground disabled:opacity-100",
|
|
567
|
+
iconOutline: "border border-sidebar-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-sidebar-border disabled:text-disabled disabled:opacity-100"
|
|
532
568
|
},
|
|
533
569
|
size: {
|
|
534
|
-
default: "h-
|
|
570
|
+
default: "h-[var(--button-height,40px)] px-[var(--px-4,16px)] py-[var(--py-2,8px)]",
|
|
535
571
|
sm: "h-9 px-3",
|
|
536
572
|
lg: "h-10 px-8",
|
|
537
|
-
|
|
573
|
+
link: "h-9 px-0",
|
|
574
|
+
icon: "h-[var(--button-height,40px)] w-10",
|
|
538
575
|
iconSm: "h-9 w-9"
|
|
539
576
|
},
|
|
540
577
|
radius: {
|
|
@@ -610,8 +647,8 @@ var INPUT_TOKENS = {
|
|
|
610
647
|
root: "flex w-full flex-col gap-1",
|
|
611
648
|
labelRow: "flex items-center gap-1 text-xs font-medium leading-4 tracking-normal text-foreground",
|
|
612
649
|
mandatory: "text-destructive",
|
|
613
|
-
field: "flex h-
|
|
614
|
-
fieldBase: "border border-transparent focus-within:border-
|
|
650
|
+
field: "flex h-[var(--input-height,48px)] w-full items-center gap-2 overflow-hidden bg-input pl-[var(--input-padding-horizontal,16px)] pr-3 py-1 text-sm shadow-none",
|
|
651
|
+
fieldBase: "border border-transparent focus-within:border-primary disabled:pointer-events-none",
|
|
615
652
|
fieldDisabled: "opacity-50",
|
|
616
653
|
fieldInvalid: "border-destructive focus-within:ring-destructive",
|
|
617
654
|
input: "w-full bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-100",
|
|
@@ -793,8 +830,8 @@ var INPUT_GROUP_TOKENS = {
|
|
|
793
830
|
mandatory: "text-destructive",
|
|
794
831
|
supportingText: "text-xs font-normal leading-4 text-muted-foreground",
|
|
795
832
|
supportingTextError: "text-destructive",
|
|
796
|
-
field: "flex h-
|
|
797
|
-
fieldBase: "border border-transparent focus-within:border-
|
|
833
|
+
field: "flex h-[var(--input-height,48px)] w-full items-center gap-2 overflow-hidden bg-input pl-[var(--input-padding-horizontal,16px)] pr-3 py-1 text-sm shadow-none",
|
|
834
|
+
fieldBase: "border border-transparent focus-within:border-primary disabled:pointer-events-none",
|
|
798
835
|
fieldInvalid: "border-destructive focus-within:border-destructive",
|
|
799
836
|
fieldDisabled: "opacity-50",
|
|
800
837
|
// Inner input area
|
|
@@ -803,7 +840,7 @@ var INPUT_GROUP_TOKENS = {
|
|
|
803
840
|
segment: "shrink-0 h-9 flex items-center text-sm font-medium text-foreground px-4",
|
|
804
841
|
segmentDivider: "h-9 border-border",
|
|
805
842
|
// Textarea
|
|
806
|
-
textareaField: "w-full bg-input
|
|
843
|
+
textareaField: "w-full bg-input pl-[var(--input-padding-horizontal,16px)] pr-3 py-1 text-sm border border-transparent focus-visible:outline-none focus-visible:border-primary disabled:pointer-events-none shadow-none",
|
|
807
844
|
textareaDisabled: "opacity-50",
|
|
808
845
|
radius: {
|
|
809
846
|
none: `${DEFAULT_THEME.radius.mode1.roundedNone}px`,
|
|
@@ -1725,7 +1762,8 @@ var BADGE_TOKENS = {
|
|
|
1725
1762
|
secondary: "bg-secondary text-secondary-foreground",
|
|
1726
1763
|
destructive: "bg-destructive text-primary-foreground",
|
|
1727
1764
|
outline: "border border-border bg-transparent text-foreground",
|
|
1728
|
-
success: "bg-success text-primary-foreground"
|
|
1765
|
+
success: "bg-success text-primary-foreground",
|
|
1766
|
+
warning: "bg-warning text-warning-foreground"
|
|
1729
1767
|
},
|
|
1730
1768
|
// Icon styles
|
|
1731
1769
|
icon: "[&>svg]:h-3 [&>svg]:w-3",
|
|
@@ -1813,6 +1851,109 @@ var NumberBadge = React15.forwardRef(
|
|
|
1813
1851
|
);
|
|
1814
1852
|
NumberBadge.displayName = "NumberBadge";
|
|
1815
1853
|
|
|
1854
|
+
// src/select/select.tsx
|
|
1855
|
+
var React18 = __toESM(require("react"));
|
|
1856
|
+
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
1857
|
+
var import_lucide_react5 = require("lucide-react");
|
|
1858
|
+
|
|
1859
|
+
// src/select/variables.ts
|
|
1860
|
+
var SELECT_TOKENS = {
|
|
1861
|
+
// Main select container
|
|
1862
|
+
container: {
|
|
1863
|
+
// Figma: trigger uses rounded-lg (8px), padding pl-16 pr-12 py-4
|
|
1864
|
+
default: "bg-input rounded-[var(--rounded-lg,8px)] data-[state=open]:rounded-b-none flex items-center justify-between pl-[var(--input-padding-horizontal,16px)] pr-3 py-1 disabled:opacity-50 disabled:pointer-events-none disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1865
|
+
singleLineRegular: "h-[var(--input-height,48px)]",
|
|
1866
|
+
singleLineLarge: "h-[var(--input-height-large,64px)]",
|
|
1867
|
+
doubleLine: "h-[var(--input-height-large,64px)]",
|
|
1868
|
+
open: "flex-col gap-1 items-start rounded-[var(--rounded-2xl,16px)] w-full"
|
|
1869
|
+
},
|
|
1870
|
+
// Select button (when open, top part)
|
|
1871
|
+
selectButton: {
|
|
1872
|
+
base: "bg-input rounded-[var(--input-radius,16px)] flex items-center justify-between pl-[var(--input-padding-horizontal,16px)] pr-3 py-1 w-full shrink-0",
|
|
1873
|
+
singleLineRegular: "h-12",
|
|
1874
|
+
singleLineLarge: "h-16"
|
|
1875
|
+
},
|
|
1876
|
+
// Content wrapper
|
|
1877
|
+
contentWrap: {
|
|
1878
|
+
base: "flex gap-2 shrink-0",
|
|
1879
|
+
default: "items-center",
|
|
1880
|
+
doubleLine: "items-start"
|
|
1881
|
+
},
|
|
1882
|
+
// Lead icon
|
|
1883
|
+
leadIcon: "shrink-0 size-6",
|
|
1884
|
+
// Text wrapper
|
|
1885
|
+
textWrap: {
|
|
1886
|
+
base: "flex shrink-0",
|
|
1887
|
+
default: "items-center",
|
|
1888
|
+
doubleLine: "flex-col gap-[2px] items-start justify-center"
|
|
1889
|
+
},
|
|
1890
|
+
// Text styles
|
|
1891
|
+
text: {
|
|
1892
|
+
placeholder: "text-sm leading-5 text-muted-foreground font-normal tracking-normal",
|
|
1893
|
+
placeholderSubtext: "text-xs leading-4 text-muted-foreground",
|
|
1894
|
+
value: "text-sm leading-5 text-accent-foreground font-normal tracking-normal",
|
|
1895
|
+
valueSubtext: "text-xs leading-4 text-muted-foreground"
|
|
1896
|
+
},
|
|
1897
|
+
// Chevron icon
|
|
1898
|
+
chevron: "size-6 shrink-0",
|
|
1899
|
+
// Dropdown container — Figma: rounded-[--input/radius,16px], gap-8px, p-8px
|
|
1900
|
+
dropdown: {
|
|
1901
|
+
base: "bg-input flex flex-col gap-2 items-center p-2 rounded-[var(--input-radius,16px)] shrink-0 w-[var(--radix-select-trigger-width)]"
|
|
1902
|
+
},
|
|
1903
|
+
// Search input — Figma: h-48px, rounded-[--input/radius,16px], icon 24px
|
|
1904
|
+
search: {
|
|
1905
|
+
container: "bg-input flex h-[var(--input-height,48px)] items-center gap-2 pl-[var(--input-padding-horizontal,16px)] pr-3 py-1 rounded-[var(--input-radius,16px)] border border-border shrink-0 w-full",
|
|
1906
|
+
iconWrap: "flex items-center shrink-0",
|
|
1907
|
+
icon: "size-6 shrink-0",
|
|
1908
|
+
inputWrap: "flex flex-1 h-9 items-center min-h-px min-w-px pl-2 pr-3 py-1",
|
|
1909
|
+
input: "text-sm leading-5 text-muted-foreground font-normal tracking-normal shrink-0"
|
|
1910
|
+
},
|
|
1911
|
+
// Menu items — Figma: px-8px py-6px, rounded-sm (4px)
|
|
1912
|
+
menu: {
|
|
1913
|
+
container: "flex flex-col items-start shrink-0 w-full",
|
|
1914
|
+
sectionLabel: "flex h-8 items-center px-2 py-[var(--spacing-py-1-5,6px)] rounded-[var(--rounded-md,6px)] shrink-0 w-full",
|
|
1915
|
+
sectionText: "text-xs leading-4 text-muted-foreground font-normal tracking-normal shrink-0",
|
|
1916
|
+
item: {
|
|
1917
|
+
base: "flex items-center justify-between px-2 py-[var(--spacing-py-1-5,6px)] rounded-[var(--rounded-sm,4px)] shrink-0 w-full",
|
|
1918
|
+
singleLine: "h-8",
|
|
1919
|
+
doubleLine: "min-h-[50px]",
|
|
1920
|
+
hover: "bg-foreground/10",
|
|
1921
|
+
default: ""
|
|
1922
|
+
},
|
|
1923
|
+
itemContent: {
|
|
1924
|
+
base: "flex flex-1 gap-2 items-center min-h-px min-w-px"
|
|
1925
|
+
},
|
|
1926
|
+
itemTextWrap: {
|
|
1927
|
+
base: "flex flex-1 min-h-px min-w-px",
|
|
1928
|
+
singleLine: "items-center",
|
|
1929
|
+
doubleLine: "flex-col gap-1 items-start justify-center"
|
|
1930
|
+
},
|
|
1931
|
+
itemText: "text-sm leading-5 text-accent-foreground font-normal tracking-normal flex-1 min-h-px min-w-0 truncate",
|
|
1932
|
+
itemSubtext: "text-xs leading-4 text-muted-foreground font-normal tracking-normal flex-1 min-h-px min-w-0 truncate",
|
|
1933
|
+
checkIcon: {
|
|
1934
|
+
wrap: "flex items-center justify-end pl-2 shrink-0 relative",
|
|
1935
|
+
slot: "size-6 shrink-0",
|
|
1936
|
+
indicator: "absolute inset-0 flex items-center justify-center",
|
|
1937
|
+
icon: "size-6 shrink-0 text-primary"
|
|
1938
|
+
}
|
|
1939
|
+
},
|
|
1940
|
+
// Label component
|
|
1941
|
+
label: {
|
|
1942
|
+
container: "flex font-medium text-xs leading-4 tracking-normal items-center",
|
|
1943
|
+
text: "text-foreground shrink-0",
|
|
1944
|
+
asterisk: "text-destructive shrink-0"
|
|
1945
|
+
},
|
|
1946
|
+
// Select group (label + select)
|
|
1947
|
+
group: {
|
|
1948
|
+
container: "flex flex-col gap-1 items-start"
|
|
1949
|
+
},
|
|
1950
|
+
// Spec card (for storybook)
|
|
1951
|
+
specCard: "bg-background border border-border flex flex-col gap-10 items-start p-14 rounded-3xl size-full",
|
|
1952
|
+
sectionDivider: "flex flex-col h-[18px] items-start justify-center py-2 shrink-0 w-full",
|
|
1953
|
+
dividerLine: "border-border border-t flex-1 h-px min-h-px min-w-px",
|
|
1954
|
+
sectionTitle: "font-medium text-xl leading-7 text-foreground tracking-normal min-w-full shrink-0 w-[min-content] whitespace-pre-wrap"
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1816
1957
|
// src/theme/theme-context.tsx
|
|
1817
1958
|
var React16 = __toESM(require("react"));
|
|
1818
1959
|
|
|
@@ -1907,13 +2048,15 @@ var UI_TO_CSS_VAR = {
|
|
|
1907
2048
|
accentForeground: "--accent-foreground",
|
|
1908
2049
|
destructive: "--destructive",
|
|
1909
2050
|
destructiveForeground: "--destructive-foreground",
|
|
2051
|
+
warning: "--warning",
|
|
2052
|
+
warningForeground: "--warning-foreground",
|
|
1910
2053
|
card: "--card",
|
|
1911
2054
|
cardForeground: "--card-foreground",
|
|
1912
2055
|
popover: "--popover",
|
|
1913
2056
|
popoverForeground: "--popover-foreground"
|
|
1914
2057
|
};
|
|
1915
2058
|
function themeJsonToCssVars(theme, mode) {
|
|
1916
|
-
var _a5, _b4;
|
|
2059
|
+
var _a5, _b4, _c, _d, _e;
|
|
1917
2060
|
const ui = (_b4 = (_a5 = theme.uIColors) == null ? void 0 : _a5[mode]) != null ? _b4 : {};
|
|
1918
2061
|
const out = {};
|
|
1919
2062
|
for (const [uiKey, cssVar] of Object.entries(UI_TO_CSS_VAR)) {
|
|
@@ -1922,6 +2065,30 @@ function themeJsonToCssVars(theme, mode) {
|
|
|
1922
2065
|
const hsl = val.startsWith("#") ? hexToHslChannels(val) : null;
|
|
1923
2066
|
out[cssVar] = hsl != null ? hsl : val;
|
|
1924
2067
|
}
|
|
2068
|
+
const radius = (_c = theme.radius) == null ? void 0 : _c.mode1;
|
|
2069
|
+
if (radius) {
|
|
2070
|
+
out["--rounded-sm"] = `${radius.roundedSm}px`;
|
|
2071
|
+
out["--rounded-md"] = `${radius.roundedMd}px`;
|
|
2072
|
+
out["--rounded-2xl"] = `${radius.rounded2xl}px`;
|
|
2073
|
+
out["--rounded-full"] = `${radius.roundedFull}px`;
|
|
2074
|
+
}
|
|
2075
|
+
const components = (_d = theme.components) == null ? void 0 : _d.mode1;
|
|
2076
|
+
if (components) {
|
|
2077
|
+
out["--input-radius"] = `${components.inputRadius}px`;
|
|
2078
|
+
out["--input-height"] = `${components.inputHeight}px`;
|
|
2079
|
+
out["--input-height-large"] = `${components.inputHeightLarge}px`;
|
|
2080
|
+
out["--input-padding-horizontal"] = `${components.inputPaddingHorizontal}px`;
|
|
2081
|
+
}
|
|
2082
|
+
const padding = (_e = theme.twPadding) == null ? void 0 : _e.mode1;
|
|
2083
|
+
if (padding) {
|
|
2084
|
+
out["--spacing-pl-2"] = `${padding.px2}px`;
|
|
2085
|
+
out["--spacing-pr-3"] = `${padding.px3}px`;
|
|
2086
|
+
out["--spacing-py-1"] = `${padding.px1}px`;
|
|
2087
|
+
out["--spacing-py-1-5"] = `${padding.px15}px`;
|
|
2088
|
+
out["--spacing-gap-1"] = `${padding.px1}px`;
|
|
2089
|
+
out["--spacing-gap-2"] = `${padding.px2}px`;
|
|
2090
|
+
out["--spacing-gap-4"] = `${padding.px4}px`;
|
|
2091
|
+
}
|
|
1925
2092
|
return out;
|
|
1926
2093
|
}
|
|
1927
2094
|
|
|
@@ -1975,10 +2142,1245 @@ var useTheme = () => {
|
|
|
1975
2142
|
return context;
|
|
1976
2143
|
};
|
|
1977
2144
|
|
|
1978
|
-
// src/
|
|
2145
|
+
// src/typography/typography.tsx
|
|
1979
2146
|
var React17 = __toESM(require("react"));
|
|
1980
|
-
var
|
|
2147
|
+
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
2148
|
+
|
|
2149
|
+
// src/typography/variables.ts
|
|
2150
|
+
var TYPOGRAPHY_TOKENS = {
|
|
2151
|
+
base: "tracking-normal",
|
|
2152
|
+
tone: {
|
|
2153
|
+
default: "text-foreground",
|
|
2154
|
+
muted: "text-muted-foreground",
|
|
2155
|
+
inherit: "text-inherit"
|
|
2156
|
+
},
|
|
2157
|
+
variant: {
|
|
2158
|
+
h1: "text-4xl leading-10 font-semibold",
|
|
2159
|
+
h2: "text-2xl leading-8 font-bold",
|
|
2160
|
+
h3: "text-xl leading-7 font-bold",
|
|
2161
|
+
h4: "text-base leading-6 font-bold",
|
|
2162
|
+
h5: "text-sm leading-5 font-bold",
|
|
2163
|
+
h6: "text-xs leading-4 font-bold",
|
|
2164
|
+
p1: "text-lg leading-7 font-normal",
|
|
2165
|
+
p2: "text-sm leading-5 font-normal",
|
|
2166
|
+
p3: "text-xs leading-4 font-normal"
|
|
2167
|
+
}
|
|
2168
|
+
};
|
|
2169
|
+
|
|
2170
|
+
// src/typography/typography.tsx
|
|
1981
2171
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2172
|
+
var DEFAULT_TAG_BY_VARIANT = {
|
|
2173
|
+
h1: "h1",
|
|
2174
|
+
h2: "h2",
|
|
2175
|
+
h3: "h3",
|
|
2176
|
+
h4: "h4",
|
|
2177
|
+
h5: "h5",
|
|
2178
|
+
h6: "h6",
|
|
2179
|
+
p1: "p",
|
|
2180
|
+
p2: "p",
|
|
2181
|
+
p3: "p"
|
|
2182
|
+
};
|
|
2183
|
+
var Typography = React17.forwardRef(
|
|
2184
|
+
({
|
|
2185
|
+
variant = "p2",
|
|
2186
|
+
tone = "default",
|
|
2187
|
+
asChild = false,
|
|
2188
|
+
as,
|
|
2189
|
+
className,
|
|
2190
|
+
children,
|
|
2191
|
+
...props
|
|
2192
|
+
}, ref) => {
|
|
2193
|
+
const Comp = asChild ? import_react_slot2.Slot : as != null ? as : DEFAULT_TAG_BY_VARIANT[variant];
|
|
2194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2195
|
+
Comp,
|
|
2196
|
+
{
|
|
2197
|
+
ref,
|
|
2198
|
+
className: cn(
|
|
2199
|
+
TYPOGRAPHY_TOKENS.base,
|
|
2200
|
+
TYPOGRAPHY_TOKENS.variant[variant],
|
|
2201
|
+
TYPOGRAPHY_TOKENS.tone[tone],
|
|
2202
|
+
className
|
|
2203
|
+
),
|
|
2204
|
+
...props,
|
|
2205
|
+
children
|
|
2206
|
+
}
|
|
2207
|
+
);
|
|
2208
|
+
}
|
|
2209
|
+
);
|
|
2210
|
+
Typography.displayName = "Typography";
|
|
2211
|
+
|
|
2212
|
+
// src/select/select.tsx
|
|
2213
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2214
|
+
var Select = SelectPrimitive.Root;
|
|
2215
|
+
var SelectGroup = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2216
|
+
SelectPrimitive.Group,
|
|
2217
|
+
{
|
|
2218
|
+
ref,
|
|
2219
|
+
className: cn("flex flex-col gap-0", className),
|
|
2220
|
+
...props
|
|
2221
|
+
}
|
|
2222
|
+
));
|
|
2223
|
+
SelectGroup.displayName = SelectPrimitive.Group.displayName;
|
|
2224
|
+
var SelectValue = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2225
|
+
SelectPrimitive.Value,
|
|
2226
|
+
{
|
|
2227
|
+
ref,
|
|
2228
|
+
className: cn(
|
|
2229
|
+
// Size/weight per Figma (Text-sm/Regular)
|
|
2230
|
+
"text-sm leading-5 font-normal tracking-normal",
|
|
2231
|
+
// Default value color; placeholder handled by trigger group selector
|
|
2232
|
+
"text-accent-foreground",
|
|
2233
|
+
className
|
|
2234
|
+
),
|
|
2235
|
+
...props
|
|
2236
|
+
}
|
|
2237
|
+
));
|
|
2238
|
+
SelectValue.displayName = "SelectValue";
|
|
2239
|
+
var SelectTrigger = React18.forwardRef(({ className, children, showLead = false, leadIcon, leadIconSize = "sm", size = "regular", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2240
|
+
SelectPrimitive.Trigger,
|
|
2241
|
+
{
|
|
2242
|
+
ref,
|
|
2243
|
+
className: cn(
|
|
2244
|
+
SELECT_TOKENS.container.default,
|
|
2245
|
+
size === "large" ? SELECT_TOKENS.container.singleLineLarge : SELECT_TOKENS.container.singleLineRegular,
|
|
2246
|
+
// Provide placeholder styling hook and consistent typography inheritance
|
|
2247
|
+
"group",
|
|
2248
|
+
"w-full",
|
|
2249
|
+
className
|
|
2250
|
+
),
|
|
2251
|
+
...props,
|
|
2252
|
+
children: [
|
|
2253
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn(SELECT_TOKENS.contentWrap.base, SELECT_TOKENS.contentWrap.default), children: [
|
|
2254
|
+
showLead && leadIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2255
|
+
"span",
|
|
2256
|
+
{
|
|
2257
|
+
className: cn(
|
|
2258
|
+
"shrink-0 text-muted-foreground",
|
|
2259
|
+
leadIconSize === "xs" ? "size-4" : SELECT_TOKENS.leadIcon
|
|
2260
|
+
),
|
|
2261
|
+
children: leadIcon
|
|
2262
|
+
}
|
|
2263
|
+
),
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2265
|
+
Typography,
|
|
2266
|
+
{
|
|
2267
|
+
as: "span",
|
|
2268
|
+
variant: "p2",
|
|
2269
|
+
tone: "inherit",
|
|
2270
|
+
className: cn(
|
|
2271
|
+
SELECT_TOKENS.textWrap.base,
|
|
2272
|
+
SELECT_TOKENS.textWrap.default,
|
|
2273
|
+
// Match Figma: muted placeholder when empty
|
|
2274
|
+
"text-accent-foreground group-data-[placeholder]:text-muted-foreground"
|
|
2275
|
+
),
|
|
2276
|
+
children
|
|
2277
|
+
}
|
|
2278
|
+
)
|
|
2279
|
+
] }),
|
|
2280
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.ChevronDown, { className: SELECT_TOKENS.chevron }) })
|
|
2281
|
+
]
|
|
2282
|
+
}
|
|
2283
|
+
));
|
|
2284
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
2285
|
+
var SelectScrollUpButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2286
|
+
SelectPrimitive.ScrollUpButton,
|
|
2287
|
+
{
|
|
2288
|
+
ref,
|
|
2289
|
+
className: cn(
|
|
2290
|
+
"flex cursor-default items-center justify-center py-1",
|
|
2291
|
+
className
|
|
2292
|
+
),
|
|
2293
|
+
...props,
|
|
2294
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.ChevronDown, { className: "h-4 w-4 rotate-180" })
|
|
2295
|
+
}
|
|
2296
|
+
));
|
|
2297
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
2298
|
+
var SelectScrollDownButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2299
|
+
SelectPrimitive.ScrollDownButton,
|
|
2300
|
+
{
|
|
2301
|
+
ref,
|
|
2302
|
+
className: cn(
|
|
2303
|
+
"flex cursor-default items-center justify-center py-1",
|
|
2304
|
+
className
|
|
2305
|
+
),
|
|
2306
|
+
...props,
|
|
2307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.ChevronDown, { className: "h-4 w-4" })
|
|
2308
|
+
}
|
|
2309
|
+
));
|
|
2310
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
2311
|
+
function filterItemsBySearch(items, query) {
|
|
2312
|
+
if (!query.trim()) return items;
|
|
2313
|
+
const q = query.toLowerCase().trim();
|
|
2314
|
+
return items.filter(
|
|
2315
|
+
(item) => {
|
|
2316
|
+
var _a5, _b4;
|
|
2317
|
+
return item.label.toLowerCase().includes(q) || ((_b4 = (_a5 = item.subtext) == null ? void 0 : _a5.toLowerCase().includes(q)) != null ? _b4 : false);
|
|
2318
|
+
}
|
|
2319
|
+
);
|
|
2320
|
+
}
|
|
2321
|
+
var SelectContent = React18.forwardRef(({ className, children, position = "popper", items, sectionLabel = "Section", showSearch = false, searchPlaceholder = "Search...", side = "bottom", sideOffset = 0, ...props }, ref) => {
|
|
2322
|
+
const { theme } = useTheme();
|
|
2323
|
+
const themeClass = theme === "dark" ? "dark" : "light";
|
|
2324
|
+
const [searchQuery, setSearchQuery] = React18.useState("");
|
|
2325
|
+
const container = React18.useMemo(
|
|
2326
|
+
() => {
|
|
2327
|
+
var _a5;
|
|
2328
|
+
return typeof document !== "undefined" ? (_a5 = document.querySelector(".lego-land")) != null ? _a5 : void 0 : void 0;
|
|
2329
|
+
},
|
|
2330
|
+
[]
|
|
2331
|
+
);
|
|
2332
|
+
const filteredItems = React18.useMemo(
|
|
2333
|
+
() => items ? filterItemsBySearch(items, searchQuery) : [],
|
|
2334
|
+
[items, searchQuery]
|
|
2335
|
+
);
|
|
2336
|
+
const handleSearchKeyDown = React18.useCallback((e) => {
|
|
2337
|
+
e.stopPropagation();
|
|
2338
|
+
}, []);
|
|
2339
|
+
const content = items ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(SelectGroup, { children: [
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectLabel, { children: sectionLabel }),
|
|
2341
|
+
filteredItems.map((item) => {
|
|
2342
|
+
var _a5;
|
|
2343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2344
|
+
SelectItem,
|
|
2345
|
+
{
|
|
2346
|
+
value: item.value,
|
|
2347
|
+
type: item.subtext ? "double" : "single",
|
|
2348
|
+
subtext: item.subtext,
|
|
2349
|
+
leadIcon: item.leadIcon,
|
|
2350
|
+
leadIconSize: (_a5 = item.leadIconSize) != null ? _a5 : "sm",
|
|
2351
|
+
children: item.label
|
|
2352
|
+
},
|
|
2353
|
+
item.value
|
|
2354
|
+
);
|
|
2355
|
+
})
|
|
2356
|
+
] }) : children;
|
|
2357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectPrimitive.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: cn(!container && "lego-land", !container && themeClass), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2358
|
+
SelectPrimitive.Content,
|
|
2359
|
+
{
|
|
2360
|
+
ref,
|
|
2361
|
+
side,
|
|
2362
|
+
sideOffset,
|
|
2363
|
+
className: cn(
|
|
2364
|
+
SELECT_TOKENS.dropdown.base,
|
|
2365
|
+
"relative z-50 overflow-hidden",
|
|
2366
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2367
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2368
|
+
"data-[side=bottom]:rounded-t-none",
|
|
2369
|
+
className
|
|
2370
|
+
),
|
|
2371
|
+
position,
|
|
2372
|
+
...props,
|
|
2373
|
+
children: [
|
|
2374
|
+
showSearch && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: SELECT_TOKENS.search.container, children: [
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.Search, { className: SELECT_TOKENS.search.icon }),
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2377
|
+
"input",
|
|
2378
|
+
{
|
|
2379
|
+
type: "search",
|
|
2380
|
+
role: "searchbox",
|
|
2381
|
+
"aria-label": "Search options",
|
|
2382
|
+
value: searchQuery,
|
|
2383
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
2384
|
+
onKeyDown: handleSearchKeyDown,
|
|
2385
|
+
placeholder: searchPlaceholder,
|
|
2386
|
+
className: cn(
|
|
2387
|
+
"flex-1 min-w-0 h-9 bg-transparent pl-2 pr-3 py-1 text-sm leading-5 font-normal tracking-normal text-accent-foreground placeholder:text-muted-foreground outline-none border-0"
|
|
2388
|
+
)
|
|
2389
|
+
}
|
|
2390
|
+
)
|
|
2391
|
+
] }),
|
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2393
|
+
SelectPrimitive.Viewport,
|
|
2394
|
+
{
|
|
2395
|
+
className: cn(
|
|
2396
|
+
"max-h-[300px] overflow-y-auto w-full",
|
|
2397
|
+
position === "popper" && "min-w-[var(--radix-select-trigger-width)]"
|
|
2398
|
+
),
|
|
2399
|
+
children: content
|
|
2400
|
+
}
|
|
2401
|
+
)
|
|
2402
|
+
]
|
|
2403
|
+
}
|
|
2404
|
+
) }) });
|
|
2405
|
+
});
|
|
2406
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2407
|
+
var SelectLabel = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2408
|
+
SelectPrimitive.Label,
|
|
2409
|
+
{
|
|
2410
|
+
ref,
|
|
2411
|
+
className: cn(SELECT_TOKENS.menu.sectionLabel, className),
|
|
2412
|
+
...props,
|
|
2413
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { as: "span", variant: "p3", tone: "muted", className: SELECT_TOKENS.menu.sectionText, children: props.children })
|
|
2414
|
+
}
|
|
2415
|
+
));
|
|
2416
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2417
|
+
var SelectItem = React18.forwardRef(({ className, children, subtext, type = "single", leadIcon, leadIconSize = "sm", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2418
|
+
SelectPrimitive.Item,
|
|
2419
|
+
{
|
|
2420
|
+
ref,
|
|
2421
|
+
className: cn(
|
|
2422
|
+
SELECT_TOKENS.menu.item.base,
|
|
2423
|
+
type === "single" ? SELECT_TOKENS.menu.item.singleLine : SELECT_TOKENS.menu.item.doubleLine,
|
|
2424
|
+
"cursor-pointer outline-none",
|
|
2425
|
+
"hover:bg-foreground/10 focus-visible:bg-foreground/10 data-[state=checked]:bg-foreground/10",
|
|
2426
|
+
className
|
|
2427
|
+
),
|
|
2428
|
+
...props,
|
|
2429
|
+
children: [
|
|
2430
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn(SELECT_TOKENS.menu.itemContent.base), children: [
|
|
2431
|
+
leadIcon ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2432
|
+
"span",
|
|
2433
|
+
{
|
|
2434
|
+
className: cn(
|
|
2435
|
+
"shrink-0 text-muted-foreground",
|
|
2436
|
+
leadIconSize === "xs" && "size-4",
|
|
2437
|
+
leadIconSize === "md" && "size-8",
|
|
2438
|
+
(leadIconSize === "sm" || !leadIconSize) && SELECT_TOKENS.leadIcon
|
|
2439
|
+
),
|
|
2440
|
+
children: leadIcon
|
|
2441
|
+
}
|
|
2442
|
+
) : null,
|
|
2443
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn(
|
|
2444
|
+
SELECT_TOKENS.menu.itemTextWrap.base,
|
|
2445
|
+
type === "single" ? SELECT_TOKENS.menu.itemTextWrap.singleLine : SELECT_TOKENS.menu.itemTextWrap.doubleLine,
|
|
2446
|
+
"min-w-0 flex-1"
|
|
2447
|
+
), children: [
|
|
2448
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectPrimitive.ItemText, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2449
|
+
Typography,
|
|
2450
|
+
{
|
|
2451
|
+
as: "p",
|
|
2452
|
+
variant: "p2",
|
|
2453
|
+
tone: "inherit",
|
|
2454
|
+
className: cn(SELECT_TOKENS.menu.itemText, "text-accent-foreground"),
|
|
2455
|
+
children
|
|
2456
|
+
}
|
|
2457
|
+
) }),
|
|
2458
|
+
subtext && type === "double" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2459
|
+
Typography,
|
|
2460
|
+
{
|
|
2461
|
+
as: "p",
|
|
2462
|
+
variant: "p3",
|
|
2463
|
+
tone: "muted",
|
|
2464
|
+
className: SELECT_TOKENS.menu.itemSubtext,
|
|
2465
|
+
children: subtext
|
|
2466
|
+
}
|
|
2467
|
+
)
|
|
2468
|
+
] })
|
|
2469
|
+
] }),
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: SELECT_TOKENS.menu.checkIcon.wrap, children: [
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: SELECT_TOKENS.menu.checkIcon.slot, "aria-hidden": true }),
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectPrimitive.ItemIndicator, { className: SELECT_TOKENS.menu.checkIcon.indicator, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.Check, { className: SELECT_TOKENS.menu.checkIcon.icon }) })
|
|
2473
|
+
] })
|
|
2474
|
+
]
|
|
2475
|
+
}
|
|
2476
|
+
));
|
|
2477
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2478
|
+
var SelectSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2479
|
+
SelectPrimitive.Separator,
|
|
2480
|
+
{
|
|
2481
|
+
ref,
|
|
2482
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
2483
|
+
...props
|
|
2484
|
+
}
|
|
2485
|
+
));
|
|
2486
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
2487
|
+
function SelectFormLabel({ className, label = "Title", mandatory = true }) {
|
|
2488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn(SELECT_TOKENS.label.container, className), children: [
|
|
2489
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: SELECT_TOKENS.label.text, children: label }),
|
|
2490
|
+
mandatory && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: SELECT_TOKENS.label.asterisk, children: "*" })
|
|
2491
|
+
] });
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
// src/select/play-select.tsx
|
|
2495
|
+
var React21 = __toESM(require("react"));
|
|
2496
|
+
|
|
2497
|
+
// src/select/playback-control.tsx
|
|
2498
|
+
var React19 = __toESM(require("react"));
|
|
2499
|
+
var import_lucide_react6 = require("lucide-react");
|
|
2500
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2501
|
+
var PlaybackControl = React19.forwardRef(
|
|
2502
|
+
({ state, playing, ...props }, ref) => {
|
|
2503
|
+
const showPause = state ? state === "pause" : !!playing;
|
|
2504
|
+
const Icon2 = showPause ? import_lucide_react6.Pause : import_lucide_react6.Play;
|
|
2505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2506
|
+
Button,
|
|
2507
|
+
{
|
|
2508
|
+
ref,
|
|
2509
|
+
variant: "iconOutline",
|
|
2510
|
+
size: "icon",
|
|
2511
|
+
button_border_radius: "rounded",
|
|
2512
|
+
"aria-label": showPause ? "Pause" : "Play",
|
|
2513
|
+
showLeadingIcon: false,
|
|
2514
|
+
showTrailingIcon: false,
|
|
2515
|
+
...props,
|
|
2516
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon2, { className: cn("size-5", !showPause && "ml-0.5") })
|
|
2517
|
+
}
|
|
2518
|
+
);
|
|
2519
|
+
}
|
|
2520
|
+
);
|
|
2521
|
+
PlaybackControl.displayName = "PlaybackControl";
|
|
2522
|
+
|
|
2523
|
+
// src/select/use-play-select.ts
|
|
2524
|
+
var React20 = __toESM(require("react"));
|
|
2525
|
+
function usePlaySelect({
|
|
2526
|
+
value,
|
|
2527
|
+
defaultValue,
|
|
2528
|
+
onValueChange,
|
|
2529
|
+
onPlayClick,
|
|
2530
|
+
onSelectValue,
|
|
2531
|
+
onCloseDropdown
|
|
2532
|
+
}) {
|
|
2533
|
+
const [internalValue, setInternalValue] = React20.useState(defaultValue);
|
|
2534
|
+
const [playingUrl, setPlayingUrl] = React20.useState(null);
|
|
2535
|
+
const audioRef = React20.useRef(null);
|
|
2536
|
+
const currentValue = value !== void 0 ? value : internalValue;
|
|
2537
|
+
React20.useEffect(() => {
|
|
2538
|
+
if (value === void 0 && defaultValue !== void 0) {
|
|
2539
|
+
setInternalValue(defaultValue);
|
|
2540
|
+
}
|
|
2541
|
+
}, [defaultValue, value]);
|
|
2542
|
+
const pauseAudio = React20.useCallback(() => {
|
|
2543
|
+
var _a5;
|
|
2544
|
+
(_a5 = audioRef.current) == null ? void 0 : _a5.pause();
|
|
2545
|
+
setPlayingUrl(null);
|
|
2546
|
+
}, []);
|
|
2547
|
+
const handleValueChange = React20.useCallback(
|
|
2548
|
+
(newValue) => {
|
|
2549
|
+
if (value === void 0) {
|
|
2550
|
+
setInternalValue(newValue);
|
|
2551
|
+
}
|
|
2552
|
+
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
2553
|
+
onSelectValue == null ? void 0 : onSelectValue(newValue);
|
|
2554
|
+
},
|
|
2555
|
+
[value, onValueChange, onSelectValue]
|
|
2556
|
+
);
|
|
2557
|
+
const handleOpenChange = React20.useCallback(
|
|
2558
|
+
(open) => {
|
|
2559
|
+
if (!open) {
|
|
2560
|
+
pauseAudio();
|
|
2561
|
+
onCloseDropdown == null ? void 0 : onCloseDropdown();
|
|
2562
|
+
}
|
|
2563
|
+
},
|
|
2564
|
+
[pauseAudio, onCloseDropdown]
|
|
2565
|
+
);
|
|
2566
|
+
const handlePlay = React20.useCallback(
|
|
2567
|
+
(url, item) => {
|
|
2568
|
+
const audio = audioRef.current;
|
|
2569
|
+
if (!audio) return;
|
|
2570
|
+
if (playingUrl === url) {
|
|
2571
|
+
audio.pause();
|
|
2572
|
+
setPlayingUrl(null);
|
|
2573
|
+
} else {
|
|
2574
|
+
audio.src = url;
|
|
2575
|
+
audio.play();
|
|
2576
|
+
setPlayingUrl(url);
|
|
2577
|
+
}
|
|
2578
|
+
onPlayClick == null ? void 0 : onPlayClick(url, item);
|
|
2579
|
+
},
|
|
2580
|
+
[playingUrl, onPlayClick]
|
|
2581
|
+
);
|
|
2582
|
+
const stopEvent = React20.useCallback((e) => {
|
|
2583
|
+
e.stopPropagation();
|
|
2584
|
+
e.preventDefault();
|
|
2585
|
+
}, []);
|
|
2586
|
+
const createPlayHandler = React20.useCallback(
|
|
2587
|
+
(item) => (e) => {
|
|
2588
|
+
e.stopPropagation();
|
|
2589
|
+
e.preventDefault();
|
|
2590
|
+
handlePlay(item.url, item);
|
|
2591
|
+
},
|
|
2592
|
+
[handlePlay]
|
|
2593
|
+
);
|
|
2594
|
+
React20.useEffect(() => {
|
|
2595
|
+
const audio = audioRef.current;
|
|
2596
|
+
if (!audio) return;
|
|
2597
|
+
const onEnded = () => setPlayingUrl(null);
|
|
2598
|
+
audio.addEventListener("ended", onEnded);
|
|
2599
|
+
return () => audio.removeEventListener("ended", onEnded);
|
|
2600
|
+
}, []);
|
|
2601
|
+
return {
|
|
2602
|
+
value: currentValue,
|
|
2603
|
+
playingUrl,
|
|
2604
|
+
audioRef,
|
|
2605
|
+
handleValueChange,
|
|
2606
|
+
handleOpenChange,
|
|
2607
|
+
handlePlay,
|
|
2608
|
+
stopEvent,
|
|
2609
|
+
createPlayHandler,
|
|
2610
|
+
pauseAudio
|
|
2611
|
+
};
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
// src/select/play-select.tsx
|
|
2615
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2616
|
+
var PlaySelect = React21.forwardRef(
|
|
2617
|
+
({
|
|
2618
|
+
dropdownListItems,
|
|
2619
|
+
label = "Title",
|
|
2620
|
+
placeholder = "Select audio",
|
|
2621
|
+
showSearch = true,
|
|
2622
|
+
searchPlaceholder = "Search...",
|
|
2623
|
+
value: controlledValue,
|
|
2624
|
+
defaultValue,
|
|
2625
|
+
onValueChange,
|
|
2626
|
+
onPlayClick,
|
|
2627
|
+
onSelectValue,
|
|
2628
|
+
onCloseDropdown,
|
|
2629
|
+
disabled = false,
|
|
2630
|
+
size = "regular",
|
|
2631
|
+
triggerLeadIcon,
|
|
2632
|
+
className,
|
|
2633
|
+
minWidth = "196px"
|
|
2634
|
+
}, ref) => {
|
|
2635
|
+
const {
|
|
2636
|
+
value,
|
|
2637
|
+
playingUrl,
|
|
2638
|
+
audioRef,
|
|
2639
|
+
handleValueChange,
|
|
2640
|
+
handleOpenChange,
|
|
2641
|
+
createPlayHandler,
|
|
2642
|
+
stopEvent
|
|
2643
|
+
} = usePlaySelect({
|
|
2644
|
+
value: controlledValue,
|
|
2645
|
+
defaultValue,
|
|
2646
|
+
onValueChange,
|
|
2647
|
+
onPlayClick,
|
|
2648
|
+
onSelectValue,
|
|
2649
|
+
onCloseDropdown
|
|
2650
|
+
});
|
|
2651
|
+
const items = React21.useMemo(
|
|
2652
|
+
() => dropdownListItems.map((item) => {
|
|
2653
|
+
const isPlaying = playingUrl === item.url;
|
|
2654
|
+
return {
|
|
2655
|
+
value: item.value,
|
|
2656
|
+
label: item.label,
|
|
2657
|
+
subtext: item.subtext,
|
|
2658
|
+
leadIconSize: "md",
|
|
2659
|
+
leadIcon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2660
|
+
"div",
|
|
2661
|
+
{
|
|
2662
|
+
className: "shrink-0 flex items-center justify-center",
|
|
2663
|
+
role: "presentation",
|
|
2664
|
+
onPointerDown: stopEvent,
|
|
2665
|
+
onPointerUp: createPlayHandler(item),
|
|
2666
|
+
onMouseDown: stopEvent,
|
|
2667
|
+
onClick: stopEvent,
|
|
2668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2669
|
+
PlaybackControl,
|
|
2670
|
+
{
|
|
2671
|
+
size: "iconSm",
|
|
2672
|
+
className: "h-8 w-8 border-foreground [&>svg]:size-4",
|
|
2673
|
+
state: isPlaying ? "pause" : "play",
|
|
2674
|
+
"aria-label": isPlaying ? `Pause ${item.label}` : `Play ${item.label}`
|
|
2675
|
+
}
|
|
2676
|
+
)
|
|
2677
|
+
}
|
|
2678
|
+
)
|
|
2679
|
+
};
|
|
2680
|
+
}),
|
|
2681
|
+
[dropdownListItems, playingUrl, stopEvent, createPlayHandler]
|
|
2682
|
+
);
|
|
2683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col gap-2", className), style: minWidth ? { minWidth } : void 0, children: [
|
|
2684
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("audio", { ref: audioRef, className: "sr-only" }),
|
|
2685
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectFormLabel, { label, mandatory: true }),
|
|
2686
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2687
|
+
Select,
|
|
2688
|
+
{
|
|
2689
|
+
value,
|
|
2690
|
+
onValueChange: handleValueChange,
|
|
2691
|
+
onOpenChange: handleOpenChange,
|
|
2692
|
+
disabled,
|
|
2693
|
+
children: [
|
|
2694
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectTrigger, { ref, showLead: true, leadIcon: triggerLeadIcon, size, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectValue, { placeholder }) }),
|
|
2695
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2696
|
+
SelectContent,
|
|
2697
|
+
{
|
|
2698
|
+
items,
|
|
2699
|
+
sectionLabel: "Audio",
|
|
2700
|
+
showSearch,
|
|
2701
|
+
searchPlaceholder
|
|
2702
|
+
}
|
|
2703
|
+
)
|
|
2704
|
+
]
|
|
2705
|
+
}
|
|
2706
|
+
),
|
|
2707
|
+
playingUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-xs text-muted-foreground", children: "Playing audio..." })
|
|
2708
|
+
] });
|
|
2709
|
+
}
|
|
2710
|
+
);
|
|
2711
|
+
PlaySelect.displayName = "PlaySelect";
|
|
2712
|
+
|
|
2713
|
+
// src/select/use-select.ts
|
|
2714
|
+
var React22 = __toESM(require("react"));
|
|
2715
|
+
function useSelect({ value, defaultValue, onValueChange }) {
|
|
2716
|
+
const [internalValue, setInternalValue] = React22.useState(defaultValue);
|
|
2717
|
+
const currentValue = value !== void 0 ? value : internalValue;
|
|
2718
|
+
React22.useEffect(() => {
|
|
2719
|
+
if (value === void 0 && defaultValue !== void 0) {
|
|
2720
|
+
setInternalValue(defaultValue);
|
|
2721
|
+
}
|
|
2722
|
+
}, [defaultValue, value]);
|
|
2723
|
+
const handleValueChange = React22.useCallback(
|
|
2724
|
+
(newValue) => {
|
|
2725
|
+
if (value === void 0) {
|
|
2726
|
+
setInternalValue(newValue);
|
|
2727
|
+
}
|
|
2728
|
+
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
2729
|
+
},
|
|
2730
|
+
[value, onValueChange]
|
|
2731
|
+
);
|
|
2732
|
+
return {
|
|
2733
|
+
value: currentValue,
|
|
2734
|
+
setValue: setInternalValue,
|
|
2735
|
+
handleValueChange
|
|
2736
|
+
};
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
// src/empty-state/empty-state.tsx
|
|
2740
|
+
var React23 = __toESM(require("react"));
|
|
2741
|
+
|
|
2742
|
+
// src/empty-state/variables.ts
|
|
2743
|
+
var EMPTY_STATE_TOKENS = {
|
|
2744
|
+
/** Outer container: centered column layout with gap-24px, p-24px, rounded-sm */
|
|
2745
|
+
container: "flex flex-col gap-6 items-center justify-center p-6 rounded-[var(--rounded-sm,4px)]",
|
|
2746
|
+
/** Inner content wrapper: illustration + text block */
|
|
2747
|
+
content: "flex flex-col gap-4 items-center shrink-0",
|
|
2748
|
+
/** Illustration area: 120×120 */
|
|
2749
|
+
illustration: "shrink-0 size-[120px]",
|
|
2750
|
+
/** Text wrapper: title + description */
|
|
2751
|
+
textWrap: "flex flex-col gap-2 items-center shrink-0 tracking-normal",
|
|
2752
|
+
/** Title: text-base/regular, foreground */
|
|
2753
|
+
title: "text-base leading-6 font-normal text-foreground",
|
|
2754
|
+
/** Description: text-sm/regular, muted-foreground, centered, max-width ~351px */
|
|
2755
|
+
description: "text-sm leading-5 font-normal text-muted-foreground text-center max-w-[351px]"
|
|
2756
|
+
};
|
|
2757
|
+
|
|
2758
|
+
// src/empty-state/empty-state.tsx
|
|
2759
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2760
|
+
var EmptyState = React23.forwardRef(
|
|
2761
|
+
({ className, illustration, title, description, action, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2762
|
+
"div",
|
|
2763
|
+
{
|
|
2764
|
+
ref,
|
|
2765
|
+
className: cn(EMPTY_STATE_TOKENS.container, className),
|
|
2766
|
+
...props,
|
|
2767
|
+
children: [
|
|
2768
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: EMPTY_STATE_TOKENS.content, children: [
|
|
2769
|
+
illustration && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: EMPTY_STATE_TOKENS.illustration, children: illustration }),
|
|
2770
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: EMPTY_STATE_TOKENS.textWrap, children: [
|
|
2771
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: EMPTY_STATE_TOKENS.title, children: title }),
|
|
2772
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: EMPTY_STATE_TOKENS.description, children: description })
|
|
2773
|
+
] })
|
|
2774
|
+
] }),
|
|
2775
|
+
action
|
|
2776
|
+
]
|
|
2777
|
+
}
|
|
2778
|
+
)
|
|
2779
|
+
);
|
|
2780
|
+
EmptyState.displayName = "EmptyState";
|
|
2781
|
+
|
|
2782
|
+
// src/list-card/list-card.tsx
|
|
2783
|
+
var React24 = __toESM(require("react"));
|
|
2784
|
+
|
|
2785
|
+
// src/list-card/variables.ts
|
|
2786
|
+
var LIST_TOKENS = {
|
|
2787
|
+
base: "overflow-hidden transition-colors cursor-pointer relative after:content-[''] after:absolute after:inset-0 after:pointer-events-none after:rounded-[inherit] after:bg-black/10 after:opacity-0 after:transition-opacity hover:after:opacity-100",
|
|
2788
|
+
type: {
|
|
2789
|
+
card: "flex flex-col gap-4 items-start p-6",
|
|
2790
|
+
list: "flex gap-4 items-center py-4 px-6"
|
|
2791
|
+
},
|
|
2792
|
+
variant: {
|
|
2793
|
+
card: {
|
|
2794
|
+
default: "bg-card",
|
|
2795
|
+
outline: "bg-card border border-border px-6",
|
|
2796
|
+
muted: "bg-background"
|
|
2797
|
+
},
|
|
2798
|
+
list: {
|
|
2799
|
+
default: "",
|
|
2800
|
+
outline: "border border-border px-4",
|
|
2801
|
+
muted: "bg-background"
|
|
2802
|
+
}
|
|
2803
|
+
},
|
|
2804
|
+
radius: {
|
|
2805
|
+
none: `${DEFAULT_THEME.radius.mode1.roundedNone}px`,
|
|
2806
|
+
soft: `${DEFAULT_THEME.radius.mode1.roundedMd}px`,
|
|
2807
|
+
rounded: `${DEFAULT_THEME.radius.mode1.rounded2xl}px`
|
|
2808
|
+
}
|
|
2809
|
+
};
|
|
2810
|
+
|
|
2811
|
+
// src/list-card/list-card.tsx
|
|
2812
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2813
|
+
var List = React24.forwardRef(
|
|
2814
|
+
({
|
|
2815
|
+
type = "card",
|
|
2816
|
+
variant = "default",
|
|
2817
|
+
list_border_radius: list_border_radiusProp,
|
|
2818
|
+
className,
|
|
2819
|
+
style,
|
|
2820
|
+
children,
|
|
2821
|
+
...props
|
|
2822
|
+
}, ref) => {
|
|
2823
|
+
const list_border_radius = list_border_radiusProp != null ? list_border_radiusProp : type === "card" ? "rounded" : "soft";
|
|
2824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2825
|
+
"div",
|
|
2826
|
+
{
|
|
2827
|
+
ref,
|
|
2828
|
+
className: cn(
|
|
2829
|
+
LIST_TOKENS.base,
|
|
2830
|
+
LIST_TOKENS.type[type],
|
|
2831
|
+
LIST_TOKENS.variant[type][variant],
|
|
2832
|
+
className
|
|
2833
|
+
),
|
|
2834
|
+
style: {
|
|
2835
|
+
borderRadius: LIST_TOKENS.radius[list_border_radius],
|
|
2836
|
+
...style
|
|
2837
|
+
},
|
|
2838
|
+
...props,
|
|
2839
|
+
children
|
|
2840
|
+
}
|
|
2841
|
+
);
|
|
2842
|
+
}
|
|
2843
|
+
);
|
|
2844
|
+
List.displayName = "List";
|
|
2845
|
+
|
|
2846
|
+
// src/tooltip/tooltip.tsx
|
|
2847
|
+
var React25 = __toESM(require("react"));
|
|
2848
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
2849
|
+
|
|
2850
|
+
// src/tooltip/variables.ts
|
|
2851
|
+
var TOOLTIP_TOKENS = {
|
|
2852
|
+
content: {
|
|
2853
|
+
base: "z-50 overflow-hidden rounded-md px-3 py-2 text-xs leading-4",
|
|
2854
|
+
bg: "bg-primary text-primary-foreground",
|
|
2855
|
+
shadow: "shadow-md"
|
|
2856
|
+
},
|
|
2857
|
+
arrow: "fill-primary",
|
|
2858
|
+
shortcut: {
|
|
2859
|
+
base: "ml-2 inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1 text-xs leading-4 font-normal",
|
|
2860
|
+
bg: "bg-muted",
|
|
2861
|
+
text: "text-muted-foreground"
|
|
2862
|
+
}
|
|
2863
|
+
};
|
|
2864
|
+
|
|
2865
|
+
// src/tooltip/tooltip.tsx
|
|
2866
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2867
|
+
var useTooltipContainer = () => {
|
|
2868
|
+
const [container, setContainer] = React25.useState(void 0);
|
|
2869
|
+
React25.useEffect(() => {
|
|
2870
|
+
if (typeof document === "undefined") return;
|
|
2871
|
+
const el = document.querySelector(".lego-land");
|
|
2872
|
+
setContainer(el != null ? el : void 0);
|
|
2873
|
+
}, []);
|
|
2874
|
+
return container;
|
|
2875
|
+
};
|
|
2876
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2877
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
2878
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2879
|
+
var TooltipContent = React25.forwardRef(({ className, sideOffset = 6, shortcut, children, ...props }, ref) => {
|
|
2880
|
+
const container = useTooltipContainer();
|
|
2881
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2882
|
+
TooltipPrimitive.Content,
|
|
2883
|
+
{
|
|
2884
|
+
ref,
|
|
2885
|
+
sideOffset,
|
|
2886
|
+
className: cn(
|
|
2887
|
+
TOOLTIP_TOKENS.content.base,
|
|
2888
|
+
TOOLTIP_TOKENS.content.bg,
|
|
2889
|
+
TOOLTIP_TOKENS.content.shadow,
|
|
2890
|
+
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2891
|
+
className
|
|
2892
|
+
),
|
|
2893
|
+
...props,
|
|
2894
|
+
children: [
|
|
2895
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center", children: [
|
|
2896
|
+
children,
|
|
2897
|
+
shortcut && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2898
|
+
"span",
|
|
2899
|
+
{
|
|
2900
|
+
className: cn(
|
|
2901
|
+
TOOLTIP_TOKENS.shortcut.base,
|
|
2902
|
+
TOOLTIP_TOKENS.shortcut.bg,
|
|
2903
|
+
TOOLTIP_TOKENS.shortcut.text
|
|
2904
|
+
),
|
|
2905
|
+
children: shortcut
|
|
2906
|
+
}
|
|
2907
|
+
)
|
|
2908
|
+
] }),
|
|
2909
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipPrimitive.Arrow, { className: TOOLTIP_TOKENS.arrow })
|
|
2910
|
+
]
|
|
2911
|
+
}
|
|
2912
|
+
);
|
|
2913
|
+
return container ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipPrimitive.Portal, { container, children: content }) : content;
|
|
2914
|
+
});
|
|
2915
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2916
|
+
|
|
2917
|
+
// src/dialog/dialog.tsx
|
|
2918
|
+
var React26 = __toESM(require("react"));
|
|
2919
|
+
var import_lucide_react7 = require("lucide-react");
|
|
2920
|
+
|
|
2921
|
+
// src/dialog/variables.ts
|
|
2922
|
+
var DIALOG_TOKENS = {
|
|
2923
|
+
overlay: "fixed inset-0 z-50 flex items-center justify-center bg-black/30",
|
|
2924
|
+
container: "bg-card border border-border rounded-lg shadow-lg overflow-hidden flex flex-col",
|
|
2925
|
+
size: {
|
|
2926
|
+
sm: "w-[400px]",
|
|
2927
|
+
default: "w-[512px]",
|
|
2928
|
+
wide: "w-[960px]"
|
|
2929
|
+
},
|
|
2930
|
+
icon: {
|
|
2931
|
+
wrapper: "bg-primary/10 rounded-full p-6 self-center mx-6 mt-6 shrink-0"
|
|
2932
|
+
},
|
|
2933
|
+
header: {
|
|
2934
|
+
wrapper: "flex flex-col shrink-0",
|
|
2935
|
+
row: "flex items-center gap-[10px] px-6 py-6",
|
|
2936
|
+
title: "flex-1 text-lg font-semibold leading-7 text-foreground",
|
|
2937
|
+
closeBtn: "size-9 flex items-center justify-center rounded-md text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
2938
|
+
divider: "h-px bg-border"
|
|
2939
|
+
},
|
|
2940
|
+
body: {
|
|
2941
|
+
base: "flex flex-col gap-4 px-6 py-4",
|
|
2942
|
+
scrollable: "flex-1 overflow-y-auto max-h-[507px]"
|
|
2943
|
+
},
|
|
2944
|
+
footer: {
|
|
2945
|
+
wrapper: "flex flex-col shrink-0",
|
|
2946
|
+
divider: "h-px bg-border",
|
|
2947
|
+
row: "flex gap-2 items-center justify-end px-6 py-4"
|
|
2948
|
+
}
|
|
2949
|
+
};
|
|
2950
|
+
|
|
2951
|
+
// src/dialog/dialog.tsx
|
|
2952
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2953
|
+
var DialogContext = React26.createContext({ close: () => {
|
|
2954
|
+
} });
|
|
2955
|
+
var Dialog = React26.forwardRef(
|
|
2956
|
+
({
|
|
2957
|
+
open,
|
|
2958
|
+
onOpenChange,
|
|
2959
|
+
type = "default",
|
|
2960
|
+
size = "default",
|
|
2961
|
+
title,
|
|
2962
|
+
icon,
|
|
2963
|
+
children,
|
|
2964
|
+
cancelLabel = "Cancel",
|
|
2965
|
+
confirmLabel = "Continue",
|
|
2966
|
+
showCancel = true,
|
|
2967
|
+
onCancel,
|
|
2968
|
+
onConfirm,
|
|
2969
|
+
className
|
|
2970
|
+
}, ref) => {
|
|
2971
|
+
const close = React26.useCallback(() => onOpenChange(false), [onOpenChange]);
|
|
2972
|
+
React26.useEffect(() => {
|
|
2973
|
+
if (!open) return;
|
|
2974
|
+
const handler = (e) => {
|
|
2975
|
+
if (e.key === "Escape") close();
|
|
2976
|
+
};
|
|
2977
|
+
document.addEventListener("keydown", handler);
|
|
2978
|
+
return () => document.removeEventListener("keydown", handler);
|
|
2979
|
+
}, [open, close]);
|
|
2980
|
+
if (!open) return null;
|
|
2981
|
+
const isScrollable = type === "scrollable" || type === "scrollable-fixed";
|
|
2982
|
+
const hasFixedDividers = type === "scrollable-fixed";
|
|
2983
|
+
const hasIcon = type === "icon";
|
|
2984
|
+
const showClose = !hasIcon;
|
|
2985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DialogContext.Provider, { value: { close }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: DIALOG_TOKENS.overlay, onClick: close, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2986
|
+
"div",
|
|
2987
|
+
{
|
|
2988
|
+
ref,
|
|
2989
|
+
role: "dialog",
|
|
2990
|
+
"aria-modal": "true",
|
|
2991
|
+
"aria-labelledby": title ? "dialog-title" : void 0,
|
|
2992
|
+
className: cn(
|
|
2993
|
+
DIALOG_TOKENS.container,
|
|
2994
|
+
DIALOG_TOKENS.size[size],
|
|
2995
|
+
className
|
|
2996
|
+
),
|
|
2997
|
+
onClick: (e) => e.stopPropagation(),
|
|
2998
|
+
children: [
|
|
2999
|
+
hasIcon && icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: DIALOG_TOKENS.icon.wrapper, children: icon }),
|
|
3000
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: DIALOG_TOKENS.header.wrapper, children: [
|
|
3001
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: DIALOG_TOKENS.header.row, children: [
|
|
3002
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { id: "dialog-title", className: DIALOG_TOKENS.header.title, children: title }),
|
|
3003
|
+
showClose && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3004
|
+
"button",
|
|
3005
|
+
{
|
|
3006
|
+
type: "button",
|
|
3007
|
+
onClick: close,
|
|
3008
|
+
className: DIALOG_TOKENS.header.closeBtn,
|
|
3009
|
+
"aria-label": "Close dialog",
|
|
3010
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.X, { className: "size-[18px]" })
|
|
3011
|
+
}
|
|
3012
|
+
)
|
|
3013
|
+
] }),
|
|
3014
|
+
hasFixedDividers && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: DIALOG_TOKENS.header.divider })
|
|
3015
|
+
] }),
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3017
|
+
"div",
|
|
3018
|
+
{
|
|
3019
|
+
className: cn(
|
|
3020
|
+
DIALOG_TOKENS.body.base,
|
|
3021
|
+
isScrollable && DIALOG_TOKENS.body.scrollable
|
|
3022
|
+
),
|
|
3023
|
+
children
|
|
3024
|
+
}
|
|
3025
|
+
),
|
|
3026
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: DIALOG_TOKENS.footer.wrapper, children: [
|
|
3027
|
+
hasFixedDividers && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: DIALOG_TOKENS.footer.divider }),
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: DIALOG_TOKENS.footer.row, children: [
|
|
3029
|
+
showCancel && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3030
|
+
Button,
|
|
3031
|
+
{
|
|
3032
|
+
variant: "outline",
|
|
3033
|
+
button_border_radius: "rounded",
|
|
3034
|
+
onClick: onCancel != null ? onCancel : close,
|
|
3035
|
+
children: cancelLabel
|
|
3036
|
+
}
|
|
3037
|
+
),
|
|
3038
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3039
|
+
Button,
|
|
3040
|
+
{
|
|
3041
|
+
variant: "primary",
|
|
3042
|
+
button_border_radius: "rounded",
|
|
3043
|
+
onClick: onConfirm,
|
|
3044
|
+
children: confirmLabel
|
|
3045
|
+
}
|
|
3046
|
+
)
|
|
3047
|
+
] })
|
|
3048
|
+
] })
|
|
3049
|
+
]
|
|
3050
|
+
}
|
|
3051
|
+
) }) });
|
|
3052
|
+
}
|
|
3053
|
+
);
|
|
3054
|
+
Dialog.displayName = "Dialog";
|
|
3055
|
+
var DialogIcon = React26.forwardRef(
|
|
3056
|
+
({ children, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref, className: cn(DIALOG_TOKENS.icon.wrapper, className), children })
|
|
3057
|
+
);
|
|
3058
|
+
DialogIcon.displayName = "DialogIcon";
|
|
3059
|
+
var DialogHeader = React26.forwardRef(
|
|
3060
|
+
({ title, showClose = true, showDivider = false, className }, ref) => {
|
|
3061
|
+
const { close } = React26.useContext(DialogContext);
|
|
3062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { ref, className: cn(DIALOG_TOKENS.header.wrapper, className), children: [
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: DIALOG_TOKENS.header.row, children: [
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: DIALOG_TOKENS.header.title, children: title }),
|
|
3065
|
+
showClose && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3066
|
+
"button",
|
|
3067
|
+
{
|
|
3068
|
+
type: "button",
|
|
3069
|
+
onClick: close,
|
|
3070
|
+
className: DIALOG_TOKENS.header.closeBtn,
|
|
3071
|
+
"aria-label": "Close dialog",
|
|
3072
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.X, { className: "size-[18px]" })
|
|
3073
|
+
}
|
|
3074
|
+
)
|
|
3075
|
+
] }),
|
|
3076
|
+
showDivider && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: DIALOG_TOKENS.header.divider })
|
|
3077
|
+
] });
|
|
3078
|
+
}
|
|
3079
|
+
);
|
|
3080
|
+
DialogHeader.displayName = "DialogHeader";
|
|
3081
|
+
var DialogBody = React26.forwardRef(
|
|
3082
|
+
({ children, scrollable = false, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3083
|
+
"div",
|
|
3084
|
+
{
|
|
3085
|
+
ref,
|
|
3086
|
+
className: cn(
|
|
3087
|
+
DIALOG_TOKENS.body.base,
|
|
3088
|
+
scrollable && DIALOG_TOKENS.body.scrollable,
|
|
3089
|
+
className
|
|
3090
|
+
),
|
|
3091
|
+
children
|
|
3092
|
+
}
|
|
3093
|
+
)
|
|
3094
|
+
);
|
|
3095
|
+
DialogBody.displayName = "DialogBody";
|
|
3096
|
+
var DialogFooter = React26.forwardRef(
|
|
3097
|
+
({
|
|
3098
|
+
cancelLabel = "Cancel",
|
|
3099
|
+
confirmLabel = "Continue",
|
|
3100
|
+
showCancel = true,
|
|
3101
|
+
onCancel,
|
|
3102
|
+
onConfirm,
|
|
3103
|
+
showDivider = false,
|
|
3104
|
+
className
|
|
3105
|
+
}, ref) => {
|
|
3106
|
+
const { close } = React26.useContext(DialogContext);
|
|
3107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { ref, className: cn(DIALOG_TOKENS.footer.wrapper, className), children: [
|
|
3108
|
+
showDivider && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: DIALOG_TOKENS.footer.divider }),
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: DIALOG_TOKENS.footer.row, children: [
|
|
3110
|
+
showCancel && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3111
|
+
Button,
|
|
3112
|
+
{
|
|
3113
|
+
variant: "outline",
|
|
3114
|
+
button_border_radius: "rounded",
|
|
3115
|
+
onClick: onCancel != null ? onCancel : close,
|
|
3116
|
+
children: cancelLabel
|
|
3117
|
+
}
|
|
3118
|
+
),
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3120
|
+
Button,
|
|
3121
|
+
{
|
|
3122
|
+
variant: "primary",
|
|
3123
|
+
button_border_radius: "rounded",
|
|
3124
|
+
onClick: onConfirm,
|
|
3125
|
+
children: confirmLabel
|
|
3126
|
+
}
|
|
3127
|
+
)
|
|
3128
|
+
] })
|
|
3129
|
+
] });
|
|
3130
|
+
}
|
|
3131
|
+
);
|
|
3132
|
+
DialogFooter.displayName = "DialogFooter";
|
|
3133
|
+
|
|
3134
|
+
// src/toast/toast.tsx
|
|
3135
|
+
var React27 = __toESM(require("react"));
|
|
3136
|
+
var import_sonner = require("sonner");
|
|
3137
|
+
var import_lucide_react8 = require("lucide-react");
|
|
3138
|
+
|
|
3139
|
+
// src/toast/variables.ts
|
|
3140
|
+
var TOAST_TOKENS = {
|
|
3141
|
+
root: "relative bg-background border border-border rounded-lg overflow-hidden flex items-center gap-3 px-4 py-3 w-full",
|
|
3142
|
+
icon: {
|
|
3143
|
+
success: "text-success shrink-0",
|
|
3144
|
+
error: "text-destructive shrink-0",
|
|
3145
|
+
default: "text-foreground shrink-0"
|
|
3146
|
+
},
|
|
3147
|
+
content: "flex flex-col gap-0.5 flex-1 min-w-0",
|
|
3148
|
+
title: {
|
|
3149
|
+
success: "text-success text-sm font-medium leading-5",
|
|
3150
|
+
error: "text-destructive text-sm font-medium leading-5",
|
|
3151
|
+
default: "text-foreground text-sm font-medium leading-5"
|
|
3152
|
+
},
|
|
3153
|
+
subtextRow: "flex items-center gap-1",
|
|
3154
|
+
subtextIcon: "size-4 text-muted-foreground shrink-0",
|
|
3155
|
+
subtext: "text-muted-foreground text-sm font-light leading-5",
|
|
3156
|
+
// Cancel button on the right
|
|
3157
|
+
cancelBtn: "size-10 shrink-0 flex items-center justify-center border border-border rounded-full text-foreground hover:bg-muted transition-colors cursor-pointer",
|
|
3158
|
+
// Thin progress bar pinned to the bottom (track + fill overlay)
|
|
3159
|
+
progress: {
|
|
3160
|
+
wrapper: "absolute bottom-0 left-0 right-0 h-1 overflow-hidden rounded-b-lg",
|
|
3161
|
+
track: "absolute inset-0 h-full w-full bg-muted",
|
|
3162
|
+
fill: {
|
|
3163
|
+
base: "absolute left-0 top-0 bottom-0 h-full transition-[width] ease-out",
|
|
3164
|
+
success: "bg-success",
|
|
3165
|
+
error: "bg-destructive",
|
|
3166
|
+
default: "bg-primary"
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
};
|
|
3170
|
+
|
|
3171
|
+
// src/toast/toast.tsx
|
|
3172
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3173
|
+
var Toaster = ({
|
|
3174
|
+
position = "bottom-right",
|
|
3175
|
+
...props
|
|
3176
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3177
|
+
import_sonner.Toaster,
|
|
3178
|
+
{
|
|
3179
|
+
position,
|
|
3180
|
+
toastOptions: { unstyled: true, classNames: { toast: "w-[360px]" } },
|
|
3181
|
+
...props
|
|
3182
|
+
}
|
|
3183
|
+
);
|
|
3184
|
+
Toaster.displayName = "Toaster";
|
|
3185
|
+
var TOAST_ICON = {
|
|
3186
|
+
success: import_lucide_react8.CircleCheck,
|
|
3187
|
+
error: import_lucide_react8.CircleAlert,
|
|
3188
|
+
default: import_lucide_react8.ThumbsUp
|
|
3189
|
+
};
|
|
3190
|
+
var Toast = React27.forwardRef(
|
|
3191
|
+
({
|
|
3192
|
+
variant = "default",
|
|
3193
|
+
title,
|
|
3194
|
+
subtext,
|
|
3195
|
+
showCancel = false,
|
|
3196
|
+
onCancel,
|
|
3197
|
+
showProgress = false,
|
|
3198
|
+
progress = 0,
|
|
3199
|
+
className,
|
|
3200
|
+
style
|
|
3201
|
+
}, ref) => {
|
|
3202
|
+
const Icon2 = TOAST_ICON[variant];
|
|
3203
|
+
const clampedProgress = Math.min(100, Math.max(0, progress));
|
|
3204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3205
|
+
"div",
|
|
3206
|
+
{
|
|
3207
|
+
ref,
|
|
3208
|
+
className: cn(TOAST_TOKENS.root, className),
|
|
3209
|
+
style,
|
|
3210
|
+
children: [
|
|
3211
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon2, { className: cn("size-6", TOAST_TOKENS.icon[variant]) }),
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: TOAST_TOKENS.content, children: [
|
|
3213
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: TOAST_TOKENS.title[variant], children: title }),
|
|
3214
|
+
subtext && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: TOAST_TOKENS.subtextRow, children: [
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react8.CircleCheck, { className: TOAST_TOKENS.subtextIcon }),
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: TOAST_TOKENS.subtext, children: subtext })
|
|
3217
|
+
] })
|
|
3218
|
+
] }),
|
|
3219
|
+
showCancel && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3220
|
+
"button",
|
|
3221
|
+
{
|
|
3222
|
+
type: "button",
|
|
3223
|
+
onClick: onCancel,
|
|
3224
|
+
className: TOAST_TOKENS.cancelBtn,
|
|
3225
|
+
"aria-label": "Dismiss",
|
|
3226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react8.ChevronRight, { className: "size-5" })
|
|
3227
|
+
}
|
|
3228
|
+
),
|
|
3229
|
+
showProgress && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: TOAST_TOKENS.progress.wrapper, children: [
|
|
3230
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: TOAST_TOKENS.progress.track }),
|
|
3231
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3232
|
+
"div",
|
|
3233
|
+
{
|
|
3234
|
+
className: cn(
|
|
3235
|
+
TOAST_TOKENS.progress.fill.base,
|
|
3236
|
+
TOAST_TOKENS.progress.fill[variant]
|
|
3237
|
+
),
|
|
3238
|
+
style: { width: `${clampedProgress}%` }
|
|
3239
|
+
}
|
|
3240
|
+
)
|
|
3241
|
+
] })
|
|
3242
|
+
]
|
|
3243
|
+
}
|
|
3244
|
+
);
|
|
3245
|
+
}
|
|
3246
|
+
);
|
|
3247
|
+
Toast.displayName = "Toast";
|
|
3248
|
+
var showToast = ({
|
|
3249
|
+
duration,
|
|
3250
|
+
...props
|
|
3251
|
+
}) => {
|
|
3252
|
+
return import_sonner.toast.custom(
|
|
3253
|
+
(id) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3254
|
+
Toast,
|
|
3255
|
+
{
|
|
3256
|
+
...props,
|
|
3257
|
+
onCancel: props.showCancel ? () => import_sonner.toast.dismiss(id) : void 0
|
|
3258
|
+
}
|
|
3259
|
+
),
|
|
3260
|
+
{ duration }
|
|
3261
|
+
);
|
|
3262
|
+
};
|
|
3263
|
+
|
|
3264
|
+
// src/stepper/stepper.tsx
|
|
3265
|
+
var React28 = __toESM(require("react"));
|
|
3266
|
+
var import_lucide_react9 = require("lucide-react");
|
|
3267
|
+
|
|
3268
|
+
// src/stepper/variables.ts
|
|
3269
|
+
var STEPPER_TOKENS = {
|
|
3270
|
+
// --- StepperBar ---
|
|
3271
|
+
bar: {
|
|
3272
|
+
root: "flex gap-1 items-center w-full",
|
|
3273
|
+
segment: {
|
|
3274
|
+
base: "flex-1 h-1 rounded-sm",
|
|
3275
|
+
active: "bg-primary",
|
|
3276
|
+
inactive: "bg-border"
|
|
3277
|
+
}
|
|
3278
|
+
},
|
|
3279
|
+
// --- Stepper ---
|
|
3280
|
+
stepper: {
|
|
3281
|
+
root: "flex items-center w-full",
|
|
3282
|
+
connector: "flex-1 h-px bg-border min-w-2",
|
|
3283
|
+
step: {
|
|
3284
|
+
wrapper: "flex gap-2 items-center shrink-0",
|
|
3285
|
+
indicator: {
|
|
3286
|
+
base: "size-6 rounded-full flex items-center justify-center shrink-0",
|
|
3287
|
+
incomplete: "bg-neutral-300",
|
|
3288
|
+
active: "bg-primary",
|
|
3289
|
+
complete: "bg-primary"
|
|
3290
|
+
},
|
|
3291
|
+
number: {
|
|
3292
|
+
incomplete: "text-muted-foreground text-xs font-medium leading-4",
|
|
3293
|
+
active: "text-primary-foreground text-xs font-medium leading-4"
|
|
3294
|
+
},
|
|
3295
|
+
checkIcon: "size-3.5 text-primary-foreground stroke-2",
|
|
3296
|
+
label: {
|
|
3297
|
+
base: "text-xs leading-4",
|
|
3298
|
+
incomplete: "text-muted-foreground font-normal",
|
|
3299
|
+
active: "text-foreground font-medium",
|
|
3300
|
+
complete: "text-muted-foreground font-normal"
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
}
|
|
3304
|
+
};
|
|
3305
|
+
|
|
3306
|
+
// src/stepper/stepper.tsx
|
|
3307
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3308
|
+
var StepperBar = React28.forwardRef(
|
|
3309
|
+
({ totalSteps = 4, currentStep, className, style }, ref) => {
|
|
3310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3311
|
+
"div",
|
|
3312
|
+
{
|
|
3313
|
+
ref,
|
|
3314
|
+
className: cn(STEPPER_TOKENS.bar.root, className),
|
|
3315
|
+
style,
|
|
3316
|
+
children: Array.from({ length: totalSteps }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3317
|
+
"div",
|
|
3318
|
+
{
|
|
3319
|
+
className: cn(
|
|
3320
|
+
STEPPER_TOKENS.bar.segment.base,
|
|
3321
|
+
index < currentStep ? STEPPER_TOKENS.bar.segment.active : STEPPER_TOKENS.bar.segment.inactive
|
|
3322
|
+
)
|
|
3323
|
+
},
|
|
3324
|
+
index
|
|
3325
|
+
))
|
|
3326
|
+
}
|
|
3327
|
+
);
|
|
3328
|
+
}
|
|
3329
|
+
);
|
|
3330
|
+
StepperBar.displayName = "StepperBar";
|
|
3331
|
+
var Stepper = React28.forwardRef(
|
|
3332
|
+
({ steps, className, style }, ref) => {
|
|
3333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3334
|
+
"div",
|
|
3335
|
+
{
|
|
3336
|
+
ref,
|
|
3337
|
+
className: cn(STEPPER_TOKENS.stepper.root, className),
|
|
3338
|
+
style,
|
|
3339
|
+
children: steps.map((step, index) => {
|
|
3340
|
+
var _a5;
|
|
3341
|
+
const state = (_a5 = step.state) != null ? _a5 : "incomplete";
|
|
3342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(React28.Fragment, { children: [
|
|
3343
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: STEPPER_TOKENS.stepper.step.wrapper, children: [
|
|
3344
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3345
|
+
"div",
|
|
3346
|
+
{
|
|
3347
|
+
className: cn(
|
|
3348
|
+
STEPPER_TOKENS.stepper.step.indicator.base,
|
|
3349
|
+
STEPPER_TOKENS.stepper.step.indicator[state]
|
|
3350
|
+
),
|
|
3351
|
+
children: state === "complete" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.Check, { className: STEPPER_TOKENS.stepper.step.checkIcon }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3352
|
+
"span",
|
|
3353
|
+
{
|
|
3354
|
+
className: state === "active" ? STEPPER_TOKENS.stepper.step.number.active : STEPPER_TOKENS.stepper.step.number.incomplete,
|
|
3355
|
+
children: index + 1
|
|
3356
|
+
}
|
|
3357
|
+
)
|
|
3358
|
+
}
|
|
3359
|
+
),
|
|
3360
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3361
|
+
"span",
|
|
3362
|
+
{
|
|
3363
|
+
className: cn(
|
|
3364
|
+
STEPPER_TOKENS.stepper.step.label.base,
|
|
3365
|
+
STEPPER_TOKENS.stepper.step.label[state]
|
|
3366
|
+
),
|
|
3367
|
+
children: step.label
|
|
3368
|
+
}
|
|
3369
|
+
)
|
|
3370
|
+
] }),
|
|
3371
|
+
index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: STEPPER_TOKENS.stepper.connector })
|
|
3372
|
+
] }, index);
|
|
3373
|
+
})
|
|
3374
|
+
}
|
|
3375
|
+
);
|
|
3376
|
+
}
|
|
3377
|
+
);
|
|
3378
|
+
Stepper.displayName = "Stepper";
|
|
3379
|
+
|
|
3380
|
+
// src/shadow-dom-wrapper.tsx
|
|
3381
|
+
var React29 = __toESM(require("react"));
|
|
3382
|
+
var import_react_dom = require("react-dom");
|
|
3383
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1982
3384
|
var ShadowDOMWrapper = ({
|
|
1983
3385
|
children,
|
|
1984
3386
|
styles,
|
|
@@ -1986,10 +3388,10 @@ var ShadowDOMWrapper = ({
|
|
|
1986
3388
|
additionalStyles = "",
|
|
1987
3389
|
copyCSSVariables = true
|
|
1988
3390
|
}) => {
|
|
1989
|
-
const containerRef =
|
|
1990
|
-
const shadowRootRef =
|
|
1991
|
-
const [shadowRoot, setShadowRoot] =
|
|
1992
|
-
|
|
3391
|
+
const containerRef = React29.useRef(null);
|
|
3392
|
+
const shadowRootRef = React29.useRef(null);
|
|
3393
|
+
const [shadowRoot, setShadowRoot] = React29.useState(null);
|
|
3394
|
+
React29.useEffect(() => {
|
|
1993
3395
|
if (!containerRef.current) return;
|
|
1994
3396
|
if (!shadowRootRef.current) {
|
|
1995
3397
|
shadowRootRef.current = containerRef.current.attachShadow({ mode });
|
|
@@ -2078,8 +3480,8 @@ var ShadowDOMWrapper = ({
|
|
|
2078
3480
|
return () => {
|
|
2079
3481
|
};
|
|
2080
3482
|
}, [styles, mode, additionalStyles, copyCSSVariables]);
|
|
2081
|
-
return /* @__PURE__ */ (0,
|
|
2082
|
-
/* @__PURE__ */ (0,
|
|
3483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
3484
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref: containerRef }),
|
|
2083
3485
|
shadowRoot && (0, import_react_dom.createPortal)(children, shadowRoot)
|
|
2084
3486
|
] });
|
|
2085
3487
|
};
|
|
@@ -2097,16 +3499,38 @@ ShadowDOMWrapper.displayName = "ShadowDOMWrapper";
|
|
|
2097
3499
|
Button,
|
|
2098
3500
|
Checkbox,
|
|
2099
3501
|
DEFAULT_THEME,
|
|
3502
|
+
Dialog,
|
|
3503
|
+
DialogBody,
|
|
3504
|
+
DialogFooter,
|
|
3505
|
+
DialogHeader,
|
|
2100
3506
|
DialogHeaderNavigation,
|
|
3507
|
+
DialogIcon,
|
|
3508
|
+
EmptyState,
|
|
2101
3509
|
FileInput,
|
|
2102
3510
|
Input,
|
|
2103
3511
|
InputGroup,
|
|
2104
3512
|
LegoLandWrapper,
|
|
3513
|
+
List,
|
|
2105
3514
|
NumberBadge,
|
|
2106
3515
|
NurixThemeProvider,
|
|
3516
|
+
PlaySelect,
|
|
3517
|
+
PlaybackControl,
|
|
2107
3518
|
RadioGroup,
|
|
2108
3519
|
RadioGroupItem,
|
|
3520
|
+
Select,
|
|
3521
|
+
SelectContent,
|
|
3522
|
+
SelectFormLabel,
|
|
3523
|
+
SelectGroup,
|
|
3524
|
+
SelectItem,
|
|
3525
|
+
SelectLabel,
|
|
3526
|
+
SelectScrollDownButton,
|
|
3527
|
+
SelectScrollUpButton,
|
|
3528
|
+
SelectSeparator,
|
|
3529
|
+
SelectTrigger,
|
|
3530
|
+
SelectValue,
|
|
2109
3531
|
ShadowDOMWrapper,
|
|
3532
|
+
Stepper,
|
|
3533
|
+
StepperBar,
|
|
2110
3534
|
Switch,
|
|
2111
3535
|
Tabs,
|
|
2112
3536
|
TabsContent,
|
|
@@ -2114,5 +3538,15 @@ ShadowDOMWrapper.displayName = "ShadowDOMWrapper";
|
|
|
2114
3538
|
TabsTrigger,
|
|
2115
3539
|
Textarea,
|
|
2116
3540
|
ThemeProvider,
|
|
3541
|
+
Toast,
|
|
3542
|
+
Toaster,
|
|
3543
|
+
Tooltip,
|
|
3544
|
+
TooltipContent,
|
|
3545
|
+
TooltipProvider,
|
|
3546
|
+
TooltipTrigger,
|
|
3547
|
+
Typography,
|
|
3548
|
+
showToast,
|
|
3549
|
+
usePlaySelect,
|
|
3550
|
+
useSelect,
|
|
2117
3551
|
useTheme
|
|
2118
3552
|
});
|