@yomologic/react-ui 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.css +41 -10
- package/dist/index.d.mts +1006 -0
- package/dist/index.d.ts +17 -5
- package/dist/index.js +269 -216
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +354 -301
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +162 -52
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.mts +2 -0
- package/package.json +6 -7
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ function cn(...inputs) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
// src/ui/button.tsx
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
var Button = React.forwardRef(
|
|
15
15
|
({
|
|
16
16
|
className,
|
|
@@ -20,10 +20,9 @@ var Button = React.forwardRef(
|
|
|
20
20
|
leftIcon,
|
|
21
21
|
rightIcon,
|
|
22
22
|
children,
|
|
23
|
-
disabled,
|
|
24
23
|
...props
|
|
25
24
|
}, ref) => {
|
|
26
|
-
const baseStyles = "inline-flex items-center justify-center cursor-pointer transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:brightness-100";
|
|
25
|
+
const baseStyles = "inline-flex items-center justify-center cursor-pointer transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:brightness-100 no-underline";
|
|
27
26
|
const variants = {
|
|
28
27
|
primary: "bg-[var(--color-primary)] text-[var(--button-primary-text)] hover:brightness-90 active:brightness-75",
|
|
29
28
|
secondary: "bg-[var(--color-secondary)] text-[var(--button-secondary-text)] hover:brightness-90 active:brightness-75",
|
|
@@ -43,81 +42,105 @@ var Button = React.forwardRef(
|
|
|
43
42
|
};
|
|
44
43
|
const radiusStyle = "[border-radius:var(--button-radius)]";
|
|
45
44
|
const fontWeightStyle = "[font-weight:var(--button-font-weight)]";
|
|
46
|
-
|
|
45
|
+
const classNames = cn(
|
|
46
|
+
baseStyles,
|
|
47
|
+
variants[variant],
|
|
48
|
+
sizes[size],
|
|
49
|
+
radiusStyle,
|
|
50
|
+
fontWeightStyle,
|
|
51
|
+
className
|
|
52
|
+
);
|
|
53
|
+
const handleMouseEnter = (e) => {
|
|
54
|
+
if (variant === "ghost") {
|
|
55
|
+
e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.08)";
|
|
56
|
+
} else if (variant === "outline") {
|
|
57
|
+
e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.12)";
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const handleMouseLeave = (e) => {
|
|
61
|
+
if (variant === "ghost" || variant === "outline") {
|
|
62
|
+
e.currentTarget.style.backgroundColor = "";
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const handleMouseDown = (e) => {
|
|
66
|
+
if (variant === "ghost") {
|
|
67
|
+
e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.16)";
|
|
68
|
+
} else if (variant === "outline") {
|
|
69
|
+
e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.24)";
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const handleMouseUp = (e) => {
|
|
73
|
+
if (variant === "ghost") {
|
|
74
|
+
e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.08)";
|
|
75
|
+
} else if (variant === "outline") {
|
|
76
|
+
e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.12)";
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
+
isLoading && /* @__PURE__ */ jsxs(
|
|
81
|
+
"svg",
|
|
82
|
+
{
|
|
83
|
+
className: "animate-spin h-4 w-4",
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
85
|
+
fill: "none",
|
|
86
|
+
viewBox: "0 0 24 24",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
"circle",
|
|
90
|
+
{
|
|
91
|
+
className: "opacity-25",
|
|
92
|
+
cx: "12",
|
|
93
|
+
cy: "12",
|
|
94
|
+
r: "10",
|
|
95
|
+
stroke: "currentColor",
|
|
96
|
+
strokeWidth: "4"
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
"path",
|
|
101
|
+
{
|
|
102
|
+
className: "opacity-75",
|
|
103
|
+
fill: "currentColor",
|
|
104
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
!isLoading && leftIcon && leftIcon,
|
|
111
|
+
children,
|
|
112
|
+
!isLoading && rightIcon && rightIcon
|
|
113
|
+
] });
|
|
114
|
+
if ("href" in props && props.href) {
|
|
115
|
+
const { href, ...rest2 } = props;
|
|
116
|
+
return /* @__PURE__ */ jsx(
|
|
117
|
+
"a",
|
|
118
|
+
{
|
|
119
|
+
ref,
|
|
120
|
+
href,
|
|
121
|
+
className: classNames,
|
|
122
|
+
onMouseEnter: handleMouseEnter,
|
|
123
|
+
onMouseLeave: handleMouseLeave,
|
|
124
|
+
onMouseDown: handleMouseDown,
|
|
125
|
+
onMouseUp: handleMouseUp,
|
|
126
|
+
...rest2,
|
|
127
|
+
children: content
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
const { disabled, ...rest } = props;
|
|
132
|
+
return /* @__PURE__ */ jsx(
|
|
47
133
|
"button",
|
|
48
134
|
{
|
|
49
135
|
ref,
|
|
50
|
-
className:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
fontWeightStyle,
|
|
56
|
-
className
|
|
57
|
-
),
|
|
58
|
-
onMouseEnter: (e) => {
|
|
59
|
-
if (variant === "ghost") {
|
|
60
|
-
e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.08)";
|
|
61
|
-
} else if (variant === "outline") {
|
|
62
|
-
e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.12)";
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
onMouseLeave: (e) => {
|
|
66
|
-
if (variant === "ghost" || variant === "outline") {
|
|
67
|
-
e.currentTarget.style.backgroundColor = "";
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
onMouseDown: (e) => {
|
|
71
|
-
if (variant === "ghost") {
|
|
72
|
-
e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.16)";
|
|
73
|
-
} else if (variant === "outline") {
|
|
74
|
-
e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.24)";
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
onMouseUp: (e) => {
|
|
78
|
-
if (variant === "ghost") {
|
|
79
|
-
e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.08)";
|
|
80
|
-
} else if (variant === "outline") {
|
|
81
|
-
e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.12)";
|
|
82
|
-
}
|
|
83
|
-
},
|
|
136
|
+
className: classNames,
|
|
137
|
+
onMouseEnter: handleMouseEnter,
|
|
138
|
+
onMouseLeave: handleMouseLeave,
|
|
139
|
+
onMouseDown: handleMouseDown,
|
|
140
|
+
onMouseUp: handleMouseUp,
|
|
84
141
|
disabled: disabled || isLoading,
|
|
85
|
-
...
|
|
86
|
-
children:
|
|
87
|
-
isLoading && /* @__PURE__ */ jsxs(
|
|
88
|
-
"svg",
|
|
89
|
-
{
|
|
90
|
-
className: "animate-spin h-4 w-4",
|
|
91
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
92
|
-
fill: "none",
|
|
93
|
-
viewBox: "0 0 24 24",
|
|
94
|
-
children: [
|
|
95
|
-
/* @__PURE__ */ jsx(
|
|
96
|
-
"circle",
|
|
97
|
-
{
|
|
98
|
-
className: "opacity-25",
|
|
99
|
-
cx: "12",
|
|
100
|
-
cy: "12",
|
|
101
|
-
r: "10",
|
|
102
|
-
stroke: "currentColor",
|
|
103
|
-
strokeWidth: "4"
|
|
104
|
-
}
|
|
105
|
-
),
|
|
106
|
-
/* @__PURE__ */ jsx(
|
|
107
|
-
"path",
|
|
108
|
-
{
|
|
109
|
-
className: "opacity-75",
|
|
110
|
-
fill: "currentColor",
|
|
111
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
!isLoading && leftIcon && leftIcon,
|
|
118
|
-
children,
|
|
119
|
-
!isLoading && rightIcon && rightIcon
|
|
120
|
-
]
|
|
142
|
+
...rest,
|
|
143
|
+
children: content
|
|
121
144
|
}
|
|
122
145
|
);
|
|
123
146
|
}
|
|
@@ -391,7 +414,7 @@ function FormControl({
|
|
|
391
414
|
asChild = false
|
|
392
415
|
}) {
|
|
393
416
|
const autoId = useId();
|
|
394
|
-
const stableFieldId = useRef();
|
|
417
|
+
const stableFieldId = useRef(void 0);
|
|
395
418
|
if (!stableFieldId.current) {
|
|
396
419
|
stableFieldId.current = name ? `field-${name}` : `field-${autoId}`;
|
|
397
420
|
}
|
|
@@ -535,17 +558,18 @@ function FormControl({
|
|
|
535
558
|
if (asChild) {
|
|
536
559
|
const child = Children.only(children);
|
|
537
560
|
if (isValidElement(child)) {
|
|
561
|
+
const childProps = child.props;
|
|
538
562
|
return cloneElement(child, {
|
|
539
563
|
...fieldProps,
|
|
540
|
-
...
|
|
564
|
+
...childProps,
|
|
541
565
|
// Merge onChange handlers
|
|
542
566
|
onChange: (e) => {
|
|
543
567
|
fieldProps.onChange(e);
|
|
544
|
-
|
|
568
|
+
childProps.onChange?.(e);
|
|
545
569
|
},
|
|
546
570
|
onBlur: () => {
|
|
547
571
|
fieldProps.onBlur();
|
|
548
|
-
|
|
572
|
+
childProps.onBlur?.();
|
|
549
573
|
}
|
|
550
574
|
});
|
|
551
575
|
}
|
|
@@ -579,8 +603,8 @@ function FormControl({
|
|
|
579
603
|
"p",
|
|
580
604
|
{
|
|
581
605
|
className: cn(
|
|
582
|
-
"text-
|
|
583
|
-
currentError ? "text-
|
|
606
|
+
"text-small",
|
|
607
|
+
currentError ? "text-error" : "text-(--color-muted-foreground)"
|
|
584
608
|
),
|
|
585
609
|
id: `${fieldId}-message`,
|
|
586
610
|
role: currentError ? "alert" : void 0,
|
|
@@ -651,8 +675,8 @@ function FormHelperText({
|
|
|
651
675
|
"p",
|
|
652
676
|
{
|
|
653
677
|
className: cn(
|
|
654
|
-
"text-
|
|
655
|
-
isError ? "text-
|
|
678
|
+
"text-small",
|
|
679
|
+
isError ? "text-error" : "text-(--color-muted-foreground)",
|
|
656
680
|
className
|
|
657
681
|
),
|
|
658
682
|
role: isError ? "alert" : void 0,
|
|
@@ -690,7 +714,7 @@ var Input = React2.forwardRef(
|
|
|
690
714
|
const formControl = useFormControl();
|
|
691
715
|
const internalRef = useRef2(null);
|
|
692
716
|
const [validationError, setValidationError] = useState3();
|
|
693
|
-
const stableId = useRef2();
|
|
717
|
+
const stableId = useRef2(void 0);
|
|
694
718
|
if (!stableId.current) {
|
|
695
719
|
stableId.current = id || formControl?.fieldId || `input-${autoId}`;
|
|
696
720
|
}
|
|
@@ -904,7 +928,7 @@ var Input = React2.forwardRef(
|
|
|
904
928
|
"text-(--color-muted-foreground) placeholder-gray-400",
|
|
905
929
|
"focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
|
|
906
930
|
"disabled:bg-(--color-muted) disabled:cursor-not-allowed disabled:text-(--color-muted-foreground)",
|
|
907
|
-
inputError ? "border-
|
|
931
|
+
inputError ? "border-error focus:ring-error" : "border-(--color-border)",
|
|
908
932
|
leftIcon && "pl-10",
|
|
909
933
|
rightIcon && "pr-10",
|
|
910
934
|
className
|
|
@@ -927,7 +951,7 @@ var Input = React2.forwardRef(
|
|
|
927
951
|
shouldRenderError && inputError && /* @__PURE__ */ jsx4(
|
|
928
952
|
"p",
|
|
929
953
|
{
|
|
930
|
-
className: "text-
|
|
954
|
+
className: "text-small text-error",
|
|
931
955
|
id: `${inputId}-error`,
|
|
932
956
|
role: "alert",
|
|
933
957
|
suppressHydrationWarning: true,
|
|
@@ -937,7 +961,7 @@ var Input = React2.forwardRef(
|
|
|
937
961
|
helperText && !inputError && !formControl && /* @__PURE__ */ jsx4(
|
|
938
962
|
"p",
|
|
939
963
|
{
|
|
940
|
-
className: "text-
|
|
964
|
+
className: "text-small text-(--color-muted-foreground)",
|
|
941
965
|
id: `${inputId}-helper`,
|
|
942
966
|
suppressHydrationWarning: true,
|
|
943
967
|
children: helperText
|
|
@@ -953,13 +977,14 @@ Input.displayName = "Input";
|
|
|
953
977
|
|
|
954
978
|
// src/ui/card.tsx
|
|
955
979
|
import React3 from "react";
|
|
956
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
980
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
957
981
|
var Card = React3.forwardRef(
|
|
958
982
|
({
|
|
959
983
|
className,
|
|
960
984
|
variant = "default",
|
|
961
985
|
padding = "md",
|
|
962
986
|
hoverable = false,
|
|
987
|
+
accentColor,
|
|
963
988
|
children,
|
|
964
989
|
...props
|
|
965
990
|
}, ref) => {
|
|
@@ -967,7 +992,8 @@ var Card = React3.forwardRef(
|
|
|
967
992
|
const variants = {
|
|
968
993
|
default: "border border-(--color-border)",
|
|
969
994
|
bordered: "border-2 border-(--color-border)",
|
|
970
|
-
elevated: "shadow-md"
|
|
995
|
+
elevated: "shadow-md",
|
|
996
|
+
accent: "border border-(--color-border) hover:border-(--color-primary) active:border-(--color-primary) transition-all duration-300 relative overflow-hidden group"
|
|
971
997
|
};
|
|
972
998
|
const paddings = {
|
|
973
999
|
none: "",
|
|
@@ -976,7 +1002,7 @@ var Card = React3.forwardRef(
|
|
|
976
1002
|
lg: "p-6"
|
|
977
1003
|
};
|
|
978
1004
|
const hoverStyles = hoverable ? "hover:shadow-lg transition-shadow cursor-pointer" : "";
|
|
979
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ jsxs4(
|
|
980
1006
|
"div",
|
|
981
1007
|
{
|
|
982
1008
|
ref,
|
|
@@ -987,8 +1013,20 @@ var Card = React3.forwardRef(
|
|
|
987
1013
|
hoverStyles,
|
|
988
1014
|
className
|
|
989
1015
|
),
|
|
1016
|
+
style: variant === "accent" && accentColor ? {
|
|
1017
|
+
"--card-accent-color": accentColor
|
|
1018
|
+
} : void 0,
|
|
990
1019
|
...props,
|
|
991
|
-
children
|
|
1020
|
+
children: [
|
|
1021
|
+
variant === "accent" && /* @__PURE__ */ jsx5(
|
|
1022
|
+
"div",
|
|
1023
|
+
{
|
|
1024
|
+
className: "absolute top-0 left-0 w-full h-1 bg-linear-to-r from-transparent via-current to-transparent opacity-0 group-hover:opacity-100 group-active:opacity-100 transition-opacity",
|
|
1025
|
+
style: accentColor ? { color: accentColor } : { color: "var(--color-primary)" }
|
|
1026
|
+
}
|
|
1027
|
+
),
|
|
1028
|
+
children
|
|
1029
|
+
]
|
|
992
1030
|
}
|
|
993
1031
|
);
|
|
994
1032
|
}
|
|
@@ -1043,6 +1081,7 @@ var CardMedia = React3.forwardRef(
|
|
|
1043
1081
|
component = "div",
|
|
1044
1082
|
aspectRatio = "16/9",
|
|
1045
1083
|
alt = "",
|
|
1084
|
+
objectFit = "cover",
|
|
1046
1085
|
style,
|
|
1047
1086
|
...props
|
|
1048
1087
|
}, ref) => {
|
|
@@ -1050,6 +1089,7 @@ var CardMedia = React3.forwardRef(
|
|
|
1050
1089
|
aspectRatio,
|
|
1051
1090
|
...style
|
|
1052
1091
|
};
|
|
1092
|
+
const objectFitClass = objectFit === "cover" ? "object-cover" : objectFit === "contain" ? "object-contain" : objectFit === "fill" ? "object-fill" : objectFit === "none" ? "object-none" : "object-scale-down";
|
|
1053
1093
|
if (component === "img" && image) {
|
|
1054
1094
|
return /* @__PURE__ */ jsx5(
|
|
1055
1095
|
"img",
|
|
@@ -1057,7 +1097,7 @@ var CardMedia = React3.forwardRef(
|
|
|
1057
1097
|
ref,
|
|
1058
1098
|
src: image,
|
|
1059
1099
|
alt,
|
|
1060
|
-
className: cn("w-full
|
|
1100
|
+
className: cn("w-full h-full", objectFitClass, className),
|
|
1061
1101
|
style: aspectRatioStyle,
|
|
1062
1102
|
...props
|
|
1063
1103
|
}
|
|
@@ -1069,7 +1109,7 @@ var CardMedia = React3.forwardRef(
|
|
|
1069
1109
|
{
|
|
1070
1110
|
ref,
|
|
1071
1111
|
src: video,
|
|
1072
|
-
className: cn("w-full
|
|
1112
|
+
className: cn("w-full", objectFitClass, className),
|
|
1073
1113
|
style: aspectRatioStyle,
|
|
1074
1114
|
...props
|
|
1075
1115
|
}
|
|
@@ -1093,18 +1133,31 @@ var CardMedia = React3.forwardRef(
|
|
|
1093
1133
|
);
|
|
1094
1134
|
CardMedia.displayName = "CardMedia";
|
|
1095
1135
|
var CardActions = React3.forwardRef(
|
|
1096
|
-
({ className, disableSpacing = false, ...props }, ref) =>
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1136
|
+
({ className, disableSpacing = false, position = "left", ...props }, ref) => {
|
|
1137
|
+
const justifyContent = {
|
|
1138
|
+
left: "justify-start",
|
|
1139
|
+
center: "justify-center",
|
|
1140
|
+
right: "justify-end"
|
|
1141
|
+
}[position];
|
|
1142
|
+
const padding = {
|
|
1143
|
+
left: "pl-4 pr-4 py-4",
|
|
1144
|
+
center: "px-4 py-4",
|
|
1145
|
+
right: "pl-4 pr-4 py-4"
|
|
1146
|
+
}[position];
|
|
1147
|
+
return /* @__PURE__ */ jsx5(
|
|
1148
|
+
"div",
|
|
1149
|
+
{
|
|
1150
|
+
ref,
|
|
1151
|
+
className: cn(
|
|
1152
|
+
"flex items-center",
|
|
1153
|
+
justifyContent,
|
|
1154
|
+
!disableSpacing && `gap-2 ${padding}`,
|
|
1155
|
+
className
|
|
1156
|
+
),
|
|
1157
|
+
...props
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
}
|
|
1108
1161
|
);
|
|
1109
1162
|
CardActions.displayName = "CardActions";
|
|
1110
1163
|
var CardActionArea = React3.forwardRef(
|
|
@@ -1131,7 +1184,7 @@ CardActionArea.displayName = "CardActionArea";
|
|
|
1131
1184
|
|
|
1132
1185
|
// src/ui/badge.tsx
|
|
1133
1186
|
import React4 from "react";
|
|
1134
|
-
import { jsx as jsx6, jsxs as
|
|
1187
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1135
1188
|
var Badge = React4.forwardRef(
|
|
1136
1189
|
({
|
|
1137
1190
|
className,
|
|
@@ -1179,7 +1232,7 @@ var Badge = React4.forwardRef(
|
|
|
1179
1232
|
lg: "w-4 h-4",
|
|
1180
1233
|
xl: "w-5 h-5"
|
|
1181
1234
|
};
|
|
1182
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ jsxs5(
|
|
1183
1236
|
"span",
|
|
1184
1237
|
{
|
|
1185
1238
|
ref,
|
|
@@ -1217,7 +1270,7 @@ Badge.displayName = "Badge";
|
|
|
1217
1270
|
|
|
1218
1271
|
// src/ui/checkbox.tsx
|
|
1219
1272
|
import React5, { useId as useId3, useState as useState4, useRef as useRef3, useEffect as useEffect2 } from "react";
|
|
1220
|
-
import { jsx as jsx7, jsxs as
|
|
1273
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1221
1274
|
function Checkbox({
|
|
1222
1275
|
label,
|
|
1223
1276
|
name,
|
|
@@ -1234,7 +1287,7 @@ function Checkbox({
|
|
|
1234
1287
|
}) {
|
|
1235
1288
|
const form = useForm();
|
|
1236
1289
|
const autoId = useId3();
|
|
1237
|
-
const stableId = useRef3();
|
|
1290
|
+
const stableId = useRef3(void 0);
|
|
1238
1291
|
if (!stableId.current) {
|
|
1239
1292
|
stableId.current = id || `checkbox-${autoId}`;
|
|
1240
1293
|
}
|
|
@@ -1304,75 +1357,68 @@ function Checkbox({
|
|
|
1304
1357
|
lg: "gap-2",
|
|
1305
1358
|
xl: "gap-2"
|
|
1306
1359
|
};
|
|
1307
|
-
return /* @__PURE__ */
|
|
1308
|
-
"div",
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
"
|
|
1317
|
-
|
|
1318
|
-
className: "rounded-full scale-0 group-hover/checkbox:scale-100 group-active/checkbox:scale-100 transition-transform duration-200 ease-out",
|
|
1319
|
-
style: {
|
|
1320
|
-
width: size === "xs" ? "1.75rem" : size === "sm" ? "2rem" : size === "lg" ? "2.5rem" : size === "xl" ? "3rem" : "2.25rem",
|
|
1321
|
-
height: size === "xs" ? "1.75rem" : size === "sm" ? "2rem" : size === "lg" ? "2.5rem" : size === "xl" ? "3rem" : "2.25rem",
|
|
1322
|
-
backgroundColor: "var(--checkbox-hover-bg)"
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
) }),
|
|
1326
|
-
/* @__PURE__ */ jsx7(
|
|
1327
|
-
"input",
|
|
1328
|
-
{
|
|
1329
|
-
type: "checkbox",
|
|
1330
|
-
id: checkboxId,
|
|
1331
|
-
checked,
|
|
1332
|
-
onChange: handleChange,
|
|
1333
|
-
disabled,
|
|
1334
|
-
suppressHydrationWarning: true,
|
|
1335
|
-
className: cn(
|
|
1336
|
-
"rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 transition-all relative z-10",
|
|
1337
|
-
disabled && "cursor-not-allowed"
|
|
1338
|
-
),
|
|
1339
|
-
style: {
|
|
1340
|
-
width: size === "xs" ? "var(--checkbox-size-xs)" : size === "sm" ? "var(--checkbox-size-sm)" : size === "lg" ? "var(--checkbox-size-lg)" : size === "xl" ? "var(--checkbox-size-xl)" : "var(--checkbox-size-md)",
|
|
1341
|
-
height: size === "xs" ? "var(--checkbox-size-xs)" : size === "sm" ? "var(--checkbox-size-sm)" : size === "lg" ? "var(--checkbox-size-lg)" : size === "xl" ? "var(--checkbox-size-xl)" : "var(--checkbox-size-md)",
|
|
1342
|
-
borderColor: "var(--color-border)",
|
|
1343
|
-
backgroundColor: "var(--color-muted)",
|
|
1344
|
-
accentColor: "var(--color-primary)",
|
|
1345
|
-
opacity: disabled ? "var(--checkbox-disabled-opacity)" : void 0
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
)
|
|
1349
|
-
] }),
|
|
1350
|
-
label && /* @__PURE__ */ jsxs5(
|
|
1351
|
-
"label",
|
|
1352
|
-
{
|
|
1353
|
-
htmlFor: checkboxId,
|
|
1354
|
-
className: cn(
|
|
1355
|
-
"font-medium",
|
|
1356
|
-
disabled && "cursor-not-allowed",
|
|
1357
|
-
!disabled && "cursor-pointer"
|
|
1358
|
-
),
|
|
1359
|
-
suppressHydrationWarning: true,
|
|
1360
|
-
style: {
|
|
1361
|
-
fontSize: size === "xs" ? "var(--checkbox-label-font-size-xs)" : size === "sm" ? "var(--checkbox-label-font-size-sm)" : size === "lg" ? "var(--checkbox-label-font-size-lg)" : size === "xl" ? "var(--checkbox-label-font-size-xl)" : "var(--checkbox-label-font-size-md)",
|
|
1362
|
-
color: "var(--color-muted-foreground)",
|
|
1363
|
-
opacity: disabled ? "var(--checkbox-disabled-opacity)" : void 0
|
|
1364
|
-
},
|
|
1365
|
-
children: [
|
|
1366
|
-
label,
|
|
1367
|
-
required && /* @__PURE__ */ jsx7("span", { className: "ml-1", children: "*" })
|
|
1368
|
-
]
|
|
1360
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn("flex flex-col", className), children: [
|
|
1361
|
+
/* @__PURE__ */ jsxs6("div", { className: cn("flex items-center", containerGapStyles[size]), children: [
|
|
1362
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative group/checkbox flex items-center shrink-0", children: [
|
|
1363
|
+
/* @__PURE__ */ jsx7("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ jsx7(
|
|
1364
|
+
"div",
|
|
1365
|
+
{
|
|
1366
|
+
className: "rounded-full scale-0 group-hover/checkbox:scale-100 group-active/checkbox:scale-100 transition-transform duration-200 ease-out",
|
|
1367
|
+
style: {
|
|
1368
|
+
width: size === "xs" ? "1.75rem" : size === "sm" ? "2rem" : size === "lg" ? "2.5rem" : size === "xl" ? "3rem" : "2.25rem",
|
|
1369
|
+
height: size === "xs" ? "1.75rem" : size === "sm" ? "2rem" : size === "lg" ? "2.5rem" : size === "xl" ? "3rem" : "2.25rem",
|
|
1370
|
+
backgroundColor: "var(--checkbox-hover-bg)"
|
|
1369
1371
|
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
/* @__PURE__ */ jsx7(
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1372
|
+
}
|
|
1373
|
+
) }),
|
|
1374
|
+
/* @__PURE__ */ jsx7(
|
|
1375
|
+
"input",
|
|
1376
|
+
{
|
|
1377
|
+
type: "checkbox",
|
|
1378
|
+
id: checkboxId,
|
|
1379
|
+
checked,
|
|
1380
|
+
onChange: handleChange,
|
|
1381
|
+
disabled,
|
|
1382
|
+
suppressHydrationWarning: true,
|
|
1383
|
+
className: cn(
|
|
1384
|
+
"rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 transition-all relative z-10",
|
|
1385
|
+
disabled && "cursor-not-allowed"
|
|
1386
|
+
),
|
|
1387
|
+
style: {
|
|
1388
|
+
width: size === "xs" ? "var(--checkbox-size-xs)" : size === "sm" ? "var(--checkbox-size-sm)" : size === "lg" ? "var(--checkbox-size-lg)" : size === "xl" ? "var(--checkbox-size-xl)" : "var(--checkbox-size-md)",
|
|
1389
|
+
height: size === "xs" ? "var(--checkbox-size-xs)" : size === "sm" ? "var(--checkbox-size-sm)" : size === "lg" ? "var(--checkbox-size-lg)" : size === "xl" ? "var(--checkbox-size-xl)" : "var(--checkbox-size-md)",
|
|
1390
|
+
borderColor: "var(--color-border)",
|
|
1391
|
+
backgroundColor: "var(--color-muted)",
|
|
1392
|
+
accentColor: "var(--color-primary)",
|
|
1393
|
+
opacity: disabled ? "var(--checkbox-disabled-opacity)" : void 0
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
)
|
|
1397
|
+
] }),
|
|
1398
|
+
label && /* @__PURE__ */ jsxs6(
|
|
1399
|
+
"label",
|
|
1400
|
+
{
|
|
1401
|
+
htmlFor: checkboxId,
|
|
1402
|
+
className: cn(
|
|
1403
|
+
"font-medium",
|
|
1404
|
+
disabled && "cursor-not-allowed",
|
|
1405
|
+
!disabled && "cursor-pointer"
|
|
1406
|
+
),
|
|
1407
|
+
suppressHydrationWarning: true,
|
|
1408
|
+
style: {
|
|
1409
|
+
fontSize: size === "xs" ? "var(--checkbox-label-font-size-xs)" : size === "sm" ? "var(--checkbox-label-font-size-sm)" : size === "lg" ? "var(--checkbox-label-font-size-lg)" : size === "xl" ? "var(--checkbox-label-font-size-xl)" : "var(--checkbox-label-font-size-md)",
|
|
1410
|
+
color: "var(--color-muted-foreground)",
|
|
1411
|
+
opacity: disabled ? "var(--checkbox-disabled-opacity)" : void 0
|
|
1412
|
+
},
|
|
1413
|
+
children: [
|
|
1414
|
+
label,
|
|
1415
|
+
required && /* @__PURE__ */ jsx7("span", { className: "ml-1", children: "*" })
|
|
1416
|
+
]
|
|
1417
|
+
}
|
|
1418
|
+
)
|
|
1419
|
+
] }),
|
|
1420
|
+
/* @__PURE__ */ jsx7("div", { className: "h-5 mt-1.5", children: displayError && /* @__PURE__ */ jsx7("p", { className: "text-small text-error", role: "alert", children: displayError }) })
|
|
1421
|
+
] });
|
|
1376
1422
|
}
|
|
1377
1423
|
function CheckboxGroup({
|
|
1378
1424
|
label,
|
|
@@ -1421,13 +1467,13 @@ function CheckboxGroup({
|
|
|
1421
1467
|
lg: "gap-2",
|
|
1422
1468
|
xl: "gap-2"
|
|
1423
1469
|
};
|
|
1424
|
-
return /* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ jsxs6(
|
|
1425
1471
|
"div",
|
|
1426
1472
|
{
|
|
1427
1473
|
className,
|
|
1428
1474
|
style: { marginBottom: "var(--form-control-spacing)" },
|
|
1429
1475
|
children: [
|
|
1430
|
-
label && /* @__PURE__ */
|
|
1476
|
+
label && /* @__PURE__ */ jsxs6(
|
|
1431
1477
|
"label",
|
|
1432
1478
|
{
|
|
1433
1479
|
className: "block text-small font-semibold mb-1",
|
|
@@ -1446,7 +1492,7 @@ function CheckboxGroup({
|
|
|
1446
1492
|
),
|
|
1447
1493
|
children: options.map((option) => {
|
|
1448
1494
|
const isDisabled = disabled || option.disabled;
|
|
1449
|
-
return /* @__PURE__ */
|
|
1495
|
+
return /* @__PURE__ */ jsxs6(
|
|
1450
1496
|
"div",
|
|
1451
1497
|
{
|
|
1452
1498
|
className: cn(
|
|
@@ -1454,7 +1500,7 @@ function CheckboxGroup({
|
|
|
1454
1500
|
containerGapStyles[size]
|
|
1455
1501
|
),
|
|
1456
1502
|
children: [
|
|
1457
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative group/checkbox flex items-center shrink-0", children: [
|
|
1458
1504
|
/* @__PURE__ */ jsx7("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ jsx7(
|
|
1459
1505
|
"div",
|
|
1460
1506
|
{
|
|
@@ -1521,7 +1567,7 @@ function CheckboxGroup({
|
|
|
1521
1567
|
/* @__PURE__ */ jsx7("div", { className: "h-5 mt-1.5", children: (error || helperText) && /* @__PURE__ */ jsx7(
|
|
1522
1568
|
"p",
|
|
1523
1569
|
{
|
|
1524
|
-
className: `text-
|
|
1570
|
+
className: `text-small ${error ? "text-error" : "text-(--color-muted-foreground)"}`,
|
|
1525
1571
|
role: error ? "alert" : void 0,
|
|
1526
1572
|
children: error || helperText
|
|
1527
1573
|
}
|
|
@@ -1533,7 +1579,7 @@ function CheckboxGroup({
|
|
|
1533
1579
|
|
|
1534
1580
|
// src/ui/radio.tsx
|
|
1535
1581
|
import { useState as useState5, useEffect as useEffect3 } from "react";
|
|
1536
|
-
import { jsx as jsx8, jsxs as
|
|
1582
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1537
1583
|
function RadioGroup({
|
|
1538
1584
|
label,
|
|
1539
1585
|
name,
|
|
@@ -1602,13 +1648,13 @@ function RadioGroup({
|
|
|
1602
1648
|
lg: "gap-2",
|
|
1603
1649
|
xl: "gap-2"
|
|
1604
1650
|
};
|
|
1605
|
-
return /* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ jsxs7(
|
|
1606
1652
|
"div",
|
|
1607
1653
|
{
|
|
1608
1654
|
className,
|
|
1609
1655
|
style: { marginBottom: "var(--form-control-spacing)" },
|
|
1610
1656
|
children: [
|
|
1611
|
-
label && /* @__PURE__ */
|
|
1657
|
+
label && /* @__PURE__ */ jsxs7(
|
|
1612
1658
|
"label",
|
|
1613
1659
|
{
|
|
1614
1660
|
className: "block text-small font-semibold mb-1",
|
|
@@ -1628,7 +1674,7 @@ function RadioGroup({
|
|
|
1628
1674
|
),
|
|
1629
1675
|
children: options.map((option) => {
|
|
1630
1676
|
const isDisabled = disabled || option.disabled;
|
|
1631
|
-
return /* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ jsxs7(
|
|
1632
1678
|
"div",
|
|
1633
1679
|
{
|
|
1634
1680
|
className: cn(
|
|
@@ -1636,7 +1682,7 @@ function RadioGroup({
|
|
|
1636
1682
|
containerGapStyles[size]
|
|
1637
1683
|
),
|
|
1638
1684
|
children: [
|
|
1639
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ jsxs7("div", { className: "relative group/radio flex items-center shrink-0", children: [
|
|
1640
1686
|
/* @__PURE__ */ jsx8("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ jsx8(
|
|
1641
1687
|
"div",
|
|
1642
1688
|
{
|
|
@@ -1700,7 +1746,7 @@ function RadioGroup({
|
|
|
1700
1746
|
/* @__PURE__ */ jsx8("div", { className: "h-5 mt-1.5", children: (displayError || helperText) && /* @__PURE__ */ jsx8(
|
|
1701
1747
|
"p",
|
|
1702
1748
|
{
|
|
1703
|
-
className: `text-
|
|
1749
|
+
className: `text-small ${displayError ? "text-error" : "text-(--color-muted-foreground)"}`,
|
|
1704
1750
|
role: displayError ? "alert" : void 0,
|
|
1705
1751
|
children: displayError || helperText
|
|
1706
1752
|
}
|
|
@@ -1713,7 +1759,7 @@ function RadioGroup({
|
|
|
1713
1759
|
// src/ui/select.tsx
|
|
1714
1760
|
import { ChevronDown, X } from "lucide-react";
|
|
1715
1761
|
import { useState as useState6, useRef as useRef4, useEffect as useEffect4 } from "react";
|
|
1716
|
-
import { jsx as jsx9, jsxs as
|
|
1762
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1717
1763
|
function Select({
|
|
1718
1764
|
name,
|
|
1719
1765
|
label,
|
|
@@ -1825,13 +1871,13 @@ function Select({
|
|
|
1825
1871
|
setIsOpen(false);
|
|
1826
1872
|
}
|
|
1827
1873
|
};
|
|
1828
|
-
return /* @__PURE__ */
|
|
1874
|
+
return /* @__PURE__ */ jsxs8(
|
|
1829
1875
|
"div",
|
|
1830
1876
|
{
|
|
1831
1877
|
className: `w-full ${className}`,
|
|
1832
1878
|
style: { marginBottom: "var(--form-control-spacing)" },
|
|
1833
1879
|
children: [
|
|
1834
|
-
label && /* @__PURE__ */
|
|
1880
|
+
label && /* @__PURE__ */ jsxs8(
|
|
1835
1881
|
"label",
|
|
1836
1882
|
{
|
|
1837
1883
|
className: "block text-small font-semibold mb-1",
|
|
@@ -1842,8 +1888,8 @@ function Select({
|
|
|
1842
1888
|
]
|
|
1843
1889
|
}
|
|
1844
1890
|
),
|
|
1845
|
-
/* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ jsxs8("div", { ref: dropdownRef, className: "relative", children: [
|
|
1892
|
+
/* @__PURE__ */ jsxs8(
|
|
1847
1893
|
"button",
|
|
1848
1894
|
{
|
|
1849
1895
|
type: "button",
|
|
@@ -1854,13 +1900,13 @@ function Select({
|
|
|
1854
1900
|
w-full ${sizeStyles[size]} text-left bg-(--color-background) border rounded-(--dropdown-radius)
|
|
1855
1901
|
flex items-center justify-between
|
|
1856
1902
|
transition-all duration-200
|
|
1857
|
-
${displayError ? "border-
|
|
1903
|
+
${displayError ? "border-error focus:ring-2 focus:ring-error focus:border-error" : "border-(--color-border) focus:ring-2 focus:ring-[color-mix(in_srgb,var(--color-primary)_30%,transparent)] focus:border-(--color-primary)"}
|
|
1858
1904
|
${disabled ? "bg-(--color-muted) cursor-not-allowed opacity-60" : "hover:border-(--color-border)"}
|
|
1859
1905
|
${!value ? "text-(--color-placeholder)" : "text-(--color-foreground)"}
|
|
1860
1906
|
`,
|
|
1861
1907
|
children: [
|
|
1862
1908
|
/* @__PURE__ */ jsx9("span", { className: "truncate", children: getSelectedLabel() }),
|
|
1863
|
-
/* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-1 ml-2", children: [
|
|
1864
1910
|
value && /* @__PURE__ */ jsx9(
|
|
1865
1911
|
"div",
|
|
1866
1912
|
{
|
|
@@ -1897,7 +1943,7 @@ function Select({
|
|
|
1897
1943
|
/* @__PURE__ */ jsx9("div", { onClick: () => setIsOpen(false), children })
|
|
1898
1944
|
) : (
|
|
1899
1945
|
// Standard options
|
|
1900
|
-
/* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ jsxs8("ul", { children: [
|
|
1901
1947
|
/* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9(
|
|
1902
1948
|
"button",
|
|
1903
1949
|
{
|
|
@@ -1938,7 +1984,7 @@ function Select({
|
|
|
1938
1984
|
/* @__PURE__ */ jsx9("div", { className: "h-5 mt-1.5", children: (helperText || displayError) && /* @__PURE__ */ jsx9(
|
|
1939
1985
|
"p",
|
|
1940
1986
|
{
|
|
1941
|
-
className: `text-
|
|
1987
|
+
className: `text-small ${displayError ? "text-error" : "text-(--color-muted-foreground)"}`,
|
|
1942
1988
|
children: displayError || helperText
|
|
1943
1989
|
}
|
|
1944
1990
|
) })
|
|
@@ -1949,7 +1995,7 @@ function Select({
|
|
|
1949
1995
|
|
|
1950
1996
|
// src/ui/spinner.tsx
|
|
1951
1997
|
import React6 from "react";
|
|
1952
|
-
import { jsx as jsx10, jsxs as
|
|
1998
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1953
1999
|
var Spinner = React6.forwardRef(
|
|
1954
2000
|
({ className, size = "md", color = "primary", label, ...props }, ref) => {
|
|
1955
2001
|
const sizes = {
|
|
@@ -1963,7 +2009,7 @@ var Spinner = React6.forwardRef(
|
|
|
1963
2009
|
secondary: "text-(--color-muted-foreground)",
|
|
1964
2010
|
white: "text-white"
|
|
1965
2011
|
};
|
|
1966
|
-
return /* @__PURE__ */
|
|
2012
|
+
return /* @__PURE__ */ jsxs9(
|
|
1967
2013
|
"div",
|
|
1968
2014
|
{
|
|
1969
2015
|
ref,
|
|
@@ -1973,7 +2019,7 @@ var Spinner = React6.forwardRef(
|
|
|
1973
2019
|
),
|
|
1974
2020
|
...props,
|
|
1975
2021
|
children: [
|
|
1976
|
-
/* @__PURE__ */
|
|
2022
|
+
/* @__PURE__ */ jsxs9(
|
|
1977
2023
|
"svg",
|
|
1978
2024
|
{
|
|
1979
2025
|
className: cn("animate-spin", sizes[size], colors[color]),
|
|
@@ -2012,10 +2058,9 @@ var Spinner = React6.forwardRef(
|
|
|
2012
2058
|
Spinner.displayName = "Spinner";
|
|
2013
2059
|
|
|
2014
2060
|
// src/ui/code-snippet.tsx
|
|
2061
|
+
import { Highlight, themes } from "prism-react-renderer";
|
|
2015
2062
|
import { useState as useState7 } from "react";
|
|
2016
|
-
import {
|
|
2017
|
-
import { vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
2018
|
-
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2063
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2019
2064
|
function CodeSnippet({
|
|
2020
2065
|
code,
|
|
2021
2066
|
language = "tsx",
|
|
@@ -2038,8 +2083,8 @@ function CodeSnippet({
|
|
|
2038
2083
|
console.error("Failed to copy:", err);
|
|
2039
2084
|
}
|
|
2040
2085
|
};
|
|
2041
|
-
return /* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ jsxs10("div", { className: "relative group w-full", children: [
|
|
2087
|
+
/* @__PURE__ */ jsxs10("div", { className: "absolute right-3 top-3 [z-index:var(--z-index-code-button)]", children: [
|
|
2043
2088
|
/* @__PURE__ */ jsx11(
|
|
2044
2089
|
"button",
|
|
2045
2090
|
{
|
|
@@ -2091,11 +2136,11 @@ function CodeSnippet({
|
|
|
2091
2136
|
)
|
|
2092
2137
|
}
|
|
2093
2138
|
),
|
|
2094
|
-
showTooltip && !copied && /* @__PURE__ */
|
|
2139
|
+
showTooltip && !copied && /* @__PURE__ */ jsxs10("div", { className: "absolute right-0 top-full mt-2 px-2 py-1 bg-[#1f2937] text-white text-caption rounded shadow-lg whitespace-nowrap border border-[#374151]", children: [
|
|
2095
2140
|
"Copy code",
|
|
2096
2141
|
/* @__PURE__ */ jsx11("div", { className: "absolute -top-1 right-3 w-2 h-2 bg-[#1f2937] border-l border-t border-[#374151] transform rotate-45" })
|
|
2097
2142
|
] }),
|
|
2098
|
-
copied && /* @__PURE__ */
|
|
2143
|
+
copied && /* @__PURE__ */ jsxs10("div", { className: "absolute right-0 top-full mt-2 px-2 py-1 bg-green-600 text-white text-caption rounded shadow-lg whitespace-nowrap", children: [
|
|
2099
2144
|
"Copied!",
|
|
2100
2145
|
/* @__PURE__ */ jsx11("div", { className: "absolute -top-1 right-3 w-2 h-2 bg-green-600 transform rotate-45" })
|
|
2101
2146
|
] })
|
|
@@ -2105,20 +2150,32 @@ function CodeSnippet({
|
|
|
2105
2150
|
{
|
|
2106
2151
|
className: `rounded-lg overflow-x-auto border border-[#1f2937] ${fontSizeClassMap[fontSize]} code-snippet-${fontSize}`,
|
|
2107
2152
|
children: /* @__PURE__ */ jsx11(
|
|
2108
|
-
|
|
2153
|
+
Highlight,
|
|
2109
2154
|
{
|
|
2155
|
+
theme: themes.vsDark,
|
|
2156
|
+
code,
|
|
2110
2157
|
language,
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2158
|
+
children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ jsx11(
|
|
2159
|
+
"pre",
|
|
2160
|
+
{
|
|
2161
|
+
style: {
|
|
2162
|
+
...style,
|
|
2163
|
+
margin: 0,
|
|
2164
|
+
padding: "1rem 3.5rem 1rem 1rem",
|
|
2165
|
+
lineHeight: "1.5",
|
|
2166
|
+
background: "#1a1b26",
|
|
2167
|
+
whiteSpace: wrap ? "pre-wrap" : "pre",
|
|
2168
|
+
wordBreak: wrap ? "break-word" : "normal"
|
|
2169
|
+
},
|
|
2170
|
+
children: tokens.map((line, i) => /* @__PURE__ */ jsx11("div", { ...getLineProps({ line }), children: line.map((token, key) => /* @__PURE__ */ jsx11(
|
|
2171
|
+
"span",
|
|
2172
|
+
{
|
|
2173
|
+
...getTokenProps({ token })
|
|
2174
|
+
},
|
|
2175
|
+
key
|
|
2176
|
+
)) }, i))
|
|
2177
|
+
}
|
|
2178
|
+
)
|
|
2122
2179
|
}
|
|
2123
2180
|
)
|
|
2124
2181
|
}
|
|
@@ -2129,7 +2186,7 @@ function CodeSnippet({
|
|
|
2129
2186
|
// src/ui/rating.tsx
|
|
2130
2187
|
import { Star } from "lucide-react";
|
|
2131
2188
|
import React7, { useId as useId4 } from "react";
|
|
2132
|
-
import { jsx as jsx12, jsxs as
|
|
2189
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2133
2190
|
var Rating = ({
|
|
2134
2191
|
value,
|
|
2135
2192
|
max = 5,
|
|
@@ -2171,7 +2228,7 @@ var Rating = ({
|
|
|
2171
2228
|
const isHalf = displayValue >= i - 0.5 && displayValue < i;
|
|
2172
2229
|
const isEmpty = displayValue < i - 0.5;
|
|
2173
2230
|
stars.push(
|
|
2174
|
-
/* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ jsxs11(
|
|
2175
2232
|
"span",
|
|
2176
2233
|
{
|
|
2177
2234
|
onClick: () => handleStarClick(i),
|
|
@@ -2222,7 +2279,7 @@ var Rating = ({
|
|
|
2222
2279
|
style: { position: "absolute", left: 0, top: 0 }
|
|
2223
2280
|
}
|
|
2224
2281
|
),
|
|
2225
|
-
isHalf && /* @__PURE__ */
|
|
2282
|
+
isHalf && /* @__PURE__ */ jsxs11(
|
|
2226
2283
|
"svg",
|
|
2227
2284
|
{
|
|
2228
2285
|
width: displaySize,
|
|
@@ -2230,7 +2287,7 @@ var Rating = ({
|
|
|
2230
2287
|
viewBox: `0 0 ${displaySize} ${displaySize}`,
|
|
2231
2288
|
style: { position: "absolute", left: 0, top: 0 },
|
|
2232
2289
|
children: [
|
|
2233
|
-
/* @__PURE__ */ jsx12("defs", { children: /* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ jsx12("defs", { children: /* @__PURE__ */ jsxs11(
|
|
2234
2291
|
"linearGradient",
|
|
2235
2292
|
{
|
|
2236
2293
|
id: `half-${uniqueId}-${i}`,
|
|
@@ -2263,7 +2320,7 @@ var Rating = ({
|
|
|
2263
2320
|
}
|
|
2264
2321
|
const valueText = valueFormat === "fraction" ? `${value.toFixed(1)}/${max}` : value.toFixed(1);
|
|
2265
2322
|
if (showValue && valuePosition === "bottom") {
|
|
2266
|
-
return /* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ jsxs11(
|
|
2267
2324
|
"div",
|
|
2268
2325
|
{
|
|
2269
2326
|
className,
|
|
@@ -2300,7 +2357,7 @@ var Rating = ({
|
|
|
2300
2357
|
}
|
|
2301
2358
|
);
|
|
2302
2359
|
}
|
|
2303
|
-
return /* @__PURE__ */
|
|
2360
|
+
return /* @__PURE__ */ jsxs11(
|
|
2304
2361
|
"div",
|
|
2305
2362
|
{
|
|
2306
2363
|
className,
|
|
@@ -2331,7 +2388,7 @@ var Rating = ({
|
|
|
2331
2388
|
};
|
|
2332
2389
|
|
|
2333
2390
|
// src/ui/divider.tsx
|
|
2334
|
-
import { jsx as jsx13, jsxs as
|
|
2391
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2335
2392
|
var Divider = ({
|
|
2336
2393
|
variant = "fullWidth",
|
|
2337
2394
|
orientation = "horizontal",
|
|
@@ -2355,13 +2412,13 @@ var Divider = ({
|
|
|
2355
2412
|
const orientationClasses = isVertical ? "inline-block min-h-[1rem]" : "block w-full";
|
|
2356
2413
|
const flexClasses = flexItem && isVertical ? "self-stretch !h-auto" : "";
|
|
2357
2414
|
const textStyles = {
|
|
2358
|
-
fontSize: "var(--
|
|
2415
|
+
fontSize: "var(--typography-small, 0.75rem)",
|
|
2359
2416
|
color: "var(--color-muted-foreground, #6b7280)"
|
|
2360
2417
|
};
|
|
2361
2418
|
if (children) {
|
|
2362
2419
|
const leftLineClasses = textAlign === "left" ? `${baseClasses} ${orientationClasses}` : `flex-1 ${baseClasses} ${orientationClasses}`;
|
|
2363
2420
|
const rightLineClasses = textAlign === "right" ? `${baseClasses} ${orientationClasses}` : `flex-1 ${baseClasses} ${orientationClasses}`;
|
|
2364
|
-
return /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ jsxs12(
|
|
2365
2422
|
"div",
|
|
2366
2423
|
{
|
|
2367
2424
|
role: "presentation",
|
|
@@ -2408,7 +2465,7 @@ var Divider = ({
|
|
|
2408
2465
|
|
|
2409
2466
|
// src/ui/slider.tsx
|
|
2410
2467
|
import { useState as useState8, useRef as useRef5, useEffect as useEffect5 } from "react";
|
|
2411
|
-
import { jsx as jsx14, jsxs as
|
|
2468
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2412
2469
|
var Slider = ({
|
|
2413
2470
|
value: controlledValue,
|
|
2414
2471
|
defaultValue = 0,
|
|
@@ -2646,7 +2703,7 @@ var Slider = ({
|
|
|
2646
2703
|
const showLabelAlways = valueLabelDisplay === "on";
|
|
2647
2704
|
const showLabelOnActiveOrHover = valueLabelDisplay === "auto";
|
|
2648
2705
|
const thumbStyle = isVertical ? { bottom: `${percent}%` } : { left: `${percent}%` };
|
|
2649
|
-
return /* @__PURE__ */
|
|
2706
|
+
return /* @__PURE__ */ jsxs13(
|
|
2650
2707
|
"div",
|
|
2651
2708
|
{
|
|
2652
2709
|
className: `absolute ${isVertical ? "left-1/2 -translate-x-1/2" : "top-1/2 -translate-y-1/2"} cursor-pointer ${disabled ? "cursor-not-allowed opacity-50" : ""} group/thumb z-20`,
|
|
@@ -2660,7 +2717,7 @@ var Slider = ({
|
|
|
2660
2717
|
className: `absolute left-0 top-0 -translate-x-1/2 -translate-y-1/2 ${isActive ? currentSizeStyles.thumbActive : currentSizeStyles.thumb} ${currentColorStyles.thumb} ${!isActive && currentColorStyles.thumbHover} rounded-full shadow-md transition-all ${isActive ? `${currentSizeStyles.ringActive} ${currentColorStyles.thumbRing}` : `group-hover/thumb:shadow-lg ${currentSizeStyles.ringHover} ${currentColorStyles.thumbRingHover}`} ${disabled ? "pointer-events-none" : ""}`
|
|
2661
2718
|
}
|
|
2662
2719
|
),
|
|
2663
|
-
showLabelAlways && /* @__PURE__ */
|
|
2720
|
+
showLabelAlways && /* @__PURE__ */ jsxs13(
|
|
2664
2721
|
"div",
|
|
2665
2722
|
{
|
|
2666
2723
|
className: `absolute ${isVertical ? "left-6" : "-top-10"} ${isVertical ? "top-1/2 -translate-y-1/2" : "left-1/2 -translate-x-1/2"} px-2 py-1 text-caption font-semibold text-white ${color === "primary" ? "bg-(--color-primary)" : "bg-purple-500"} rounded shadow-lg whitespace-nowrap z-(--z-index-tooltip)`,
|
|
@@ -2675,7 +2732,7 @@ var Slider = ({
|
|
|
2675
2732
|
]
|
|
2676
2733
|
}
|
|
2677
2734
|
),
|
|
2678
|
-
showLabelOnActiveOrHover && /* @__PURE__ */
|
|
2735
|
+
showLabelOnActiveOrHover && /* @__PURE__ */ jsxs13(
|
|
2679
2736
|
"div",
|
|
2680
2737
|
{
|
|
2681
2738
|
className: `absolute ${isVertical ? "left-6" : "-top-10"} ${isVertical ? "top-1/2 -translate-y-1/2" : "left-1/2 -translate-x-1/2"} px-2 py-1 text-caption font-semibold text-white ${color === "primary" ? "bg-(--color-primary)" : "bg-purple-500"} rounded shadow-lg whitespace-nowrap opacity-0 scale-90 ${isActive ? "opacity-100 scale-100" : "group-hover/thumb:opacity-100 group-hover/thumb:scale-100"} transition-all duration-300 ease-out pointer-events-none z-(--z-index-tooltip)`,
|
|
@@ -2699,13 +2756,13 @@ var Slider = ({
|
|
|
2699
2756
|
const hasMarkLabels = marksList.some((mark) => mark.label);
|
|
2700
2757
|
const containerClasses = isVertical ? "flex flex-col items-center py-4" : `flex items-center w-full px-2 ${hasMarkLabels ? "pb-6" : ""}`;
|
|
2701
2758
|
const railClasses = isVertical ? `${currentSizeStyles.rail} relative overflow-visible` : `w-full ${currentSizeStyles.rail} relative overflow-visible`;
|
|
2702
|
-
return /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ jsxs13(
|
|
2703
2760
|
"div",
|
|
2704
2761
|
{
|
|
2705
2762
|
className: `${containerClasses} ${className}`,
|
|
2706
2763
|
style: isVertical ? { minHeight: "200px", height: "200px" } : void 0,
|
|
2707
2764
|
children: [
|
|
2708
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ jsxs13(
|
|
2709
2766
|
"div",
|
|
2710
2767
|
{
|
|
2711
2768
|
ref: sliderRef,
|
|
@@ -2752,7 +2809,7 @@ var Slider = ({
|
|
|
2752
2809
|
}
|
|
2753
2810
|
const markColor = isInSelectedRange ? "bg-(--color-background) shadow-sm group-hover/mark:bg-(--color-background) group-hover/mark:shadow-md" : "bg-[#4b5563] group-hover/mark:bg-[#1f2937]";
|
|
2754
2811
|
const labelColor = isInSelectedRange ? currentColorStyles.labelSelected : currentColorStyles.labelUnselected;
|
|
2755
|
-
return /* @__PURE__ */
|
|
2812
|
+
return /* @__PURE__ */ jsxs13(
|
|
2756
2813
|
"div",
|
|
2757
2814
|
{
|
|
2758
2815
|
className: `group/mark absolute ${isVertical ? "left-1/2 -translate-x-1/2" : "top-1/2 -translate-y-1/2"} z-30`,
|
|
@@ -2771,7 +2828,7 @@ var Slider = ({
|
|
|
2771
2828
|
children: mark.label
|
|
2772
2829
|
}
|
|
2773
2830
|
),
|
|
2774
|
-
showMarkLabelsOnHover && !mark.label && /* @__PURE__ */
|
|
2831
|
+
showMarkLabelsOnHover && !mark.label && /* @__PURE__ */ jsxs13(
|
|
2775
2832
|
"div",
|
|
2776
2833
|
{
|
|
2777
2834
|
className: `absolute ${isVertical ? "left-6 top-1/2 -translate-y-1/2" : "-top-8 left-1/2 -translate-x-1/2"} px-2 py-1 text-caption font-semibold text-white ${color === "primary" ? "bg-(--color-primary)" : "bg-purple-500"} rounded shadow-lg whitespace-nowrap opacity-0 scale-90 group-hover/mark:opacity-100 group-hover/mark:scale-100 transition-all duration-300 ease-out pointer-events-none z-(--z-index-tooltip)`,
|
|
@@ -2811,7 +2868,7 @@ var Slider = ({
|
|
|
2811
2868
|
|
|
2812
2869
|
// src/ui/switch.tsx
|
|
2813
2870
|
import { useState as useState9, useEffect as useEffect6 } from "react";
|
|
2814
|
-
import { Fragment, jsx as jsx15, jsxs as
|
|
2871
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2815
2872
|
function Switch({
|
|
2816
2873
|
checked: controlledChecked,
|
|
2817
2874
|
onChange,
|
|
@@ -2938,7 +2995,7 @@ function Switch({
|
|
|
2938
2995
|
)
|
|
2939
2996
|
}
|
|
2940
2997
|
);
|
|
2941
|
-
const content = !label ? /* @__PURE__ */
|
|
2998
|
+
const content = !label ? /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
2942
2999
|
switchElement,
|
|
2943
3000
|
name && /* @__PURE__ */ jsx15(
|
|
2944
3001
|
"input",
|
|
@@ -2952,7 +3009,7 @@ function Switch({
|
|
|
2952
3009
|
required
|
|
2953
3010
|
}
|
|
2954
3011
|
)
|
|
2955
|
-
] }) : /* @__PURE__ */
|
|
3012
|
+
] }) : /* @__PURE__ */ jsxs14(
|
|
2956
3013
|
"label",
|
|
2957
3014
|
{
|
|
2958
3015
|
className: cn(
|
|
@@ -2963,7 +3020,7 @@ function Switch({
|
|
|
2963
3020
|
),
|
|
2964
3021
|
children: [
|
|
2965
3022
|
switchElement,
|
|
2966
|
-
/* @__PURE__ */
|
|
3023
|
+
/* @__PURE__ */ jsxs14(
|
|
2967
3024
|
"span",
|
|
2968
3025
|
{
|
|
2969
3026
|
className: cn(
|
|
@@ -3006,7 +3063,7 @@ function Switch({
|
|
|
3006
3063
|
|
|
3007
3064
|
// src/ui/dialog.tsx
|
|
3008
3065
|
import React9, { useEffect as useEffect7 } from "react";
|
|
3009
|
-
import { jsx as jsx16, jsxs as
|
|
3066
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3010
3067
|
var Dialog = ({
|
|
3011
3068
|
open,
|
|
3012
3069
|
onClose,
|
|
@@ -3064,7 +3121,7 @@ var Dialog = ({
|
|
|
3064
3121
|
onClick: handleBackdropClick,
|
|
3065
3122
|
role: "dialog",
|
|
3066
3123
|
"aria-modal": "true",
|
|
3067
|
-
children: /* @__PURE__ */
|
|
3124
|
+
children: /* @__PURE__ */ jsxs15(
|
|
3068
3125
|
"div",
|
|
3069
3126
|
{
|
|
3070
3127
|
className: cn(
|
|
@@ -3224,7 +3281,7 @@ DialogFooter.displayName = "DialogFooter";
|
|
|
3224
3281
|
|
|
3225
3282
|
// src/feedback/alert.tsx
|
|
3226
3283
|
import React10 from "react";
|
|
3227
|
-
import { jsx as jsx17, jsxs as
|
|
3284
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3228
3285
|
var Alert = React10.forwardRef(
|
|
3229
3286
|
({
|
|
3230
3287
|
className,
|
|
@@ -3306,9 +3363,9 @@ var Alert = React10.forwardRef(
|
|
|
3306
3363
|
className: cn("relative border rounded-lg p-4", className),
|
|
3307
3364
|
role: "alert",
|
|
3308
3365
|
...props,
|
|
3309
|
-
children: /* @__PURE__ */
|
|
3366
|
+
children: /* @__PURE__ */ jsxs16("div", { className: "flex items-start gap-3", children: [
|
|
3310
3367
|
/* @__PURE__ */ jsx17("div", { className: "shrink-0", style: iconStyles[variant], children: icon || defaultIcons[variant] }),
|
|
3311
|
-
/* @__PURE__ */
|
|
3368
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex-1", children: [
|
|
3312
3369
|
title && /* @__PURE__ */ jsx17("h5", { className: "font-semibold mb-1", children: title }),
|
|
3313
3370
|
/* @__PURE__ */ jsx17("div", { className: "text-sm", children })
|
|
3314
3371
|
] }),
|
|
@@ -3404,13 +3461,13 @@ Container.displayName = "Container";
|
|
|
3404
3461
|
|
|
3405
3462
|
// src/layout/section-layout.tsx
|
|
3406
3463
|
import React12 from "react";
|
|
3407
|
-
import { Fragment as
|
|
3464
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3408
3465
|
function SectionLayout({
|
|
3409
3466
|
children,
|
|
3410
3467
|
hasStickyPreview = false
|
|
3411
3468
|
}) {
|
|
3412
3469
|
if (!hasStickyPreview) {
|
|
3413
|
-
return /* @__PURE__ */ jsx19(
|
|
3470
|
+
return /* @__PURE__ */ jsx19(Fragment3, { children });
|
|
3414
3471
|
}
|
|
3415
3472
|
const childArray = React12.Children.toArray(children);
|
|
3416
3473
|
if (childArray.length === 0) {
|
|
@@ -3418,7 +3475,7 @@ function SectionLayout({
|
|
|
3418
3475
|
}
|
|
3419
3476
|
const stickyPreview = childArray[0];
|
|
3420
3477
|
const scrollableContent = childArray.slice(1);
|
|
3421
|
-
return /* @__PURE__ */
|
|
3478
|
+
return /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
3422
3479
|
stickyPreview,
|
|
3423
3480
|
scrollableContent.length > 0 && /* @__PURE__ */ jsx19("div", { className: "space-y-8", children: scrollableContent })
|
|
3424
3481
|
] });
|
|
@@ -3427,7 +3484,7 @@ function SectionLayout({
|
|
|
3427
3484
|
// src/layout/nav.tsx
|
|
3428
3485
|
import { Menu, X as X2, ChevronDown as ChevronDown2 } from "lucide-react";
|
|
3429
3486
|
import React13, { useState as useState10, useEffect as useEffect8, useRef as useRef6 } from "react";
|
|
3430
|
-
import { Fragment as
|
|
3487
|
+
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3431
3488
|
var Nav = React13.forwardRef(
|
|
3432
3489
|
({
|
|
3433
3490
|
className,
|
|
@@ -3506,12 +3563,12 @@ var Nav = React13.forwardRef(
|
|
|
3506
3563
|
const variantItemStyles = {
|
|
3507
3564
|
primary: "rounded-md hover:bg-(--color-primary)/10 hover:text-(--color-primary) transition-colors duration-150",
|
|
3508
3565
|
secondary: "rounded-md hover:bg-(--color-muted) transition-colors duration-150",
|
|
3509
|
-
ghost: "rounded-md hover:bg-(--color-
|
|
3566
|
+
ghost: "rounded-md hover:bg-(--color-primary)/5 transition-colors duration-150"
|
|
3510
3567
|
};
|
|
3511
3568
|
const activeItemStyles = {
|
|
3512
3569
|
primary: "bg-(--color-primary) text-white hover:bg-(--color-primary) hover:text-white",
|
|
3513
3570
|
secondary: "bg-(--color-muted) text-(--color-foreground) font-semibold",
|
|
3514
|
-
ghost: "
|
|
3571
|
+
ghost: "text-(--color-primary) font-medium"
|
|
3515
3572
|
};
|
|
3516
3573
|
const breakpointClasses = {
|
|
3517
3574
|
sm: "sm:hidden",
|
|
@@ -3566,7 +3623,7 @@ var Nav = React13.forwardRef(
|
|
|
3566
3623
|
orientation === "vertical" && "w-full",
|
|
3567
3624
|
item.disabled && "opacity-50 cursor-not-allowed"
|
|
3568
3625
|
);
|
|
3569
|
-
const content = /* @__PURE__ */
|
|
3626
|
+
const content = /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
3570
3627
|
item.icon && /* @__PURE__ */ jsx20("span", { className: "flex-shrink-0", children: item.icon }),
|
|
3571
3628
|
/* @__PURE__ */ jsx20("span", { children: item.label }),
|
|
3572
3629
|
item.badge && /* @__PURE__ */ jsx20("span", { className: "ml-auto inline-flex items-center rounded-full bg-(--color-primary) px-2 py-0.5 text-caption font-medium text-white", children: item.badge }),
|
|
@@ -3581,7 +3638,7 @@ var Nav = React13.forwardRef(
|
|
|
3581
3638
|
)
|
|
3582
3639
|
] });
|
|
3583
3640
|
if (hasChildren) {
|
|
3584
|
-
return /* @__PURE__ */
|
|
3641
|
+
return /* @__PURE__ */ jsxs18("div", { className: "relative", ref: dropdownRef, children: [
|
|
3585
3642
|
/* @__PURE__ */ jsx20(
|
|
3586
3643
|
"button",
|
|
3587
3644
|
{
|
|
@@ -3598,7 +3655,7 @@ var Nav = React13.forwardRef(
|
|
|
3598
3655
|
"absolute left-0 mt-[var(--nav-gap)] min-w-[200px] bg-(--color-background) border border-(--color-border) rounded-[var(--nav-border-radius)] shadow-xl [z-index:var(--z-index-dropdown)] animate-in fade-in-0 zoom-in-95 duration-200",
|
|
3599
3656
|
orientation === "vertical" && "left-full top-0 ml-2 mt-0"
|
|
3600
3657
|
),
|
|
3601
|
-
children: /* @__PURE__ */ jsx20("div", { className: "py-1", children: item.children.map((child) => /* @__PURE__ */
|
|
3658
|
+
children: /* @__PURE__ */ jsx20("div", { className: "py-1", children: item.children.map((child) => /* @__PURE__ */ jsxs18(
|
|
3602
3659
|
"button",
|
|
3603
3660
|
{
|
|
3604
3661
|
onClick: () => handleItemClick(child),
|
|
@@ -3666,7 +3723,7 @@ var Nav = React13.forwardRef(
|
|
|
3666
3723
|
},
|
|
3667
3724
|
[ref]
|
|
3668
3725
|
);
|
|
3669
|
-
return /* @__PURE__ */
|
|
3726
|
+
return /* @__PURE__ */ jsxs18(
|
|
3670
3727
|
"nav",
|
|
3671
3728
|
{
|
|
3672
3729
|
ref: setRefs,
|
|
@@ -3677,7 +3734,7 @@ var Nav = React13.forwardRef(
|
|
|
3677
3734
|
),
|
|
3678
3735
|
...props,
|
|
3679
3736
|
children: [
|
|
3680
|
-
/* @__PURE__ */
|
|
3737
|
+
/* @__PURE__ */ jsxs18("div", { className: containerStyles, children: [
|
|
3681
3738
|
logo && /* @__PURE__ */ jsx20("div", { className: "shrink-0", children: logo }),
|
|
3682
3739
|
desktopNav,
|
|
3683
3740
|
actions && /* @__PURE__ */ jsx20("div", { className: "shrink-0 flex items-center gap-2", children: actions }),
|
|
@@ -3706,7 +3763,7 @@ var Nav = React13.forwardRef(
|
|
|
3706
3763
|
children: /* @__PURE__ */ jsx20("div", { className: "space-y-1 px-2 py-2", children: items.map((item) => renderNavItem(item, true)) })
|
|
3707
3764
|
}
|
|
3708
3765
|
),
|
|
3709
|
-
mobileMenuDirection !== "top" && /* @__PURE__ */
|
|
3766
|
+
mobileMenuDirection !== "top" && /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
3710
3767
|
isMobileMenuOpen && /* @__PURE__ */ jsx20(
|
|
3711
3768
|
"div",
|
|
3712
3769
|
{
|
|
@@ -3748,7 +3805,7 @@ Nav.displayName = "Nav";
|
|
|
3748
3805
|
// src/layout/drawer.tsx
|
|
3749
3806
|
import { Menu as Menu2, X as X3 } from "lucide-react";
|
|
3750
3807
|
import { useState as useState11, useEffect as useEffect9 } from "react";
|
|
3751
|
-
import { Fragment as
|
|
3808
|
+
import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3752
3809
|
function Drawer({
|
|
3753
3810
|
title,
|
|
3754
3811
|
subtitle,
|
|
@@ -3790,7 +3847,7 @@ function Drawer({
|
|
|
3790
3847
|
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
3791
3848
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
3792
3849
|
}, [lastScrollY, autoHideOnScroll]);
|
|
3793
|
-
return /* @__PURE__ */
|
|
3850
|
+
return /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
3794
3851
|
/* @__PURE__ */ jsx21(
|
|
3795
3852
|
"div",
|
|
3796
3853
|
{
|
|
@@ -3799,12 +3856,12 @@ function Drawer({
|
|
|
3799
3856
|
background: "var(--color-background)",
|
|
3800
3857
|
borderBottom: "1px solid var(--color-border)"
|
|
3801
3858
|
},
|
|
3802
|
-
children: /* @__PURE__ */
|
|
3859
|
+
children: /* @__PURE__ */ jsxs19(
|
|
3803
3860
|
"div",
|
|
3804
3861
|
{
|
|
3805
3862
|
className: `flex items-center ${isLeft ? "justify-between" : "justify-between flex-row-reverse"}`,
|
|
3806
3863
|
children: [
|
|
3807
|
-
/* @__PURE__ */
|
|
3864
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
|
|
3808
3865
|
homeUrl && /* @__PURE__ */ jsx21(
|
|
3809
3866
|
"a",
|
|
3810
3867
|
{
|
|
@@ -3848,14 +3905,13 @@ function Drawer({
|
|
|
3848
3905
|
)
|
|
3849
3906
|
] }),
|
|
3850
3907
|
headerActions && /* @__PURE__ */ jsx21("div", { className: "flex items-center", children: headerActions }),
|
|
3851
|
-
/* @__PURE__ */
|
|
3908
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
3852
3909
|
/* @__PURE__ */ jsx21(
|
|
3853
3910
|
"h1",
|
|
3854
3911
|
{
|
|
3855
|
-
className: "font-bold",
|
|
3912
|
+
className: "font-bold text-h5",
|
|
3856
3913
|
style: {
|
|
3857
|
-
color: "var(--color-foreground)"
|
|
3858
|
-
fontSize: "var(--typography-h5)"
|
|
3914
|
+
color: "var(--color-foreground)"
|
|
3859
3915
|
},
|
|
3860
3916
|
children: title
|
|
3861
3917
|
}
|
|
@@ -3863,9 +3919,9 @@ function Drawer({
|
|
|
3863
3919
|
subtitle && /* @__PURE__ */ jsx21(
|
|
3864
3920
|
"p",
|
|
3865
3921
|
{
|
|
3922
|
+
className: "text-caption",
|
|
3866
3923
|
style: {
|
|
3867
|
-
color: "var(--color-muted-foreground)"
|
|
3868
|
-
fontSize: "var(--typography-caption)"
|
|
3924
|
+
color: "var(--color-muted-foreground)"
|
|
3869
3925
|
},
|
|
3870
3926
|
children: subtitle
|
|
3871
3927
|
}
|
|
@@ -3884,7 +3940,7 @@ function Drawer({
|
|
|
3884
3940
|
onClick: () => setMobileMenuOpen(false)
|
|
3885
3941
|
}
|
|
3886
3942
|
),
|
|
3887
|
-
/* @__PURE__ */
|
|
3943
|
+
/* @__PURE__ */ jsxs19(
|
|
3888
3944
|
"aside",
|
|
3889
3945
|
{
|
|
3890
3946
|
className: `
|
|
@@ -3901,22 +3957,21 @@ function Drawer({
|
|
|
3901
3957
|
...mobileMenuOpen && typeof window !== "undefined" && window.innerWidth < 1024 ? { zIndex: 9999 } : {}
|
|
3902
3958
|
},
|
|
3903
3959
|
children: [
|
|
3904
|
-
/* @__PURE__ */
|
|
3960
|
+
/* @__PURE__ */ jsxs19(
|
|
3905
3961
|
"div",
|
|
3906
3962
|
{
|
|
3907
3963
|
className: "hidden lg:block px-6 py-5",
|
|
3908
3964
|
style: {
|
|
3909
3965
|
borderBottom: "1px solid var(--color-border)",
|
|
3910
|
-
background: "var(--color-
|
|
3966
|
+
background: "var(--color-surface-elevated)"
|
|
3911
3967
|
},
|
|
3912
3968
|
children: [
|
|
3913
3969
|
/* @__PURE__ */ jsx21(
|
|
3914
3970
|
"h1",
|
|
3915
3971
|
{
|
|
3916
|
-
className: "font-bold",
|
|
3972
|
+
className: "font-bold text-h5",
|
|
3917
3973
|
style: {
|
|
3918
|
-
color: "var(--color-foreground)"
|
|
3919
|
-
fontSize: "var(--typography-h5)"
|
|
3974
|
+
color: "var(--color-foreground)"
|
|
3920
3975
|
},
|
|
3921
3976
|
children: title
|
|
3922
3977
|
}
|
|
@@ -3924,10 +3979,9 @@ function Drawer({
|
|
|
3924
3979
|
subtitle && /* @__PURE__ */ jsx21(
|
|
3925
3980
|
"p",
|
|
3926
3981
|
{
|
|
3927
|
-
className: "mt-0.5",
|
|
3982
|
+
className: "mt-0.5 text-caption",
|
|
3928
3983
|
style: {
|
|
3929
|
-
color: "var(--color-muted-foreground)"
|
|
3930
|
-
fontSize: "var(--typography-caption)"
|
|
3984
|
+
color: "var(--color-muted-foreground)"
|
|
3931
3985
|
},
|
|
3932
3986
|
children: subtitle
|
|
3933
3987
|
}
|
|
@@ -3935,20 +3989,19 @@ function Drawer({
|
|
|
3935
3989
|
]
|
|
3936
3990
|
}
|
|
3937
3991
|
),
|
|
3938
|
-
/* @__PURE__ */
|
|
3992
|
+
/* @__PURE__ */ jsxs19(
|
|
3939
3993
|
"div",
|
|
3940
3994
|
{
|
|
3941
3995
|
className: "lg:hidden p-4 flex items-center justify-between",
|
|
3942
3996
|
style: { borderBottom: "1px solid var(--color-border)" },
|
|
3943
3997
|
children: [
|
|
3944
|
-
/* @__PURE__ */
|
|
3998
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
3945
3999
|
/* @__PURE__ */ jsx21(
|
|
3946
4000
|
"h1",
|
|
3947
4001
|
{
|
|
3948
|
-
className: "font-bold",
|
|
4002
|
+
className: "font-bold text-h5",
|
|
3949
4003
|
style: {
|
|
3950
|
-
color: "var(--color-foreground)"
|
|
3951
|
-
fontSize: "var(--typography-h5)"
|
|
4004
|
+
color: "var(--color-foreground)"
|
|
3952
4005
|
},
|
|
3953
4006
|
children: title
|
|
3954
4007
|
}
|
|
@@ -3956,10 +4009,9 @@ function Drawer({
|
|
|
3956
4009
|
subtitle && /* @__PURE__ */ jsx21(
|
|
3957
4010
|
"p",
|
|
3958
4011
|
{
|
|
3959
|
-
className: "mt-1",
|
|
4012
|
+
className: "mt-1 text-caption",
|
|
3960
4013
|
style: {
|
|
3961
|
-
color: "var(--color-muted-foreground)"
|
|
3962
|
-
fontSize: "var(--typography-caption)"
|
|
4014
|
+
color: "var(--color-muted-foreground)"
|
|
3963
4015
|
},
|
|
3964
4016
|
children: subtitle
|
|
3965
4017
|
}
|
|
@@ -3980,7 +4032,7 @@ function Drawer({
|
|
|
3980
4032
|
]
|
|
3981
4033
|
}
|
|
3982
4034
|
),
|
|
3983
|
-
/* @__PURE__ */ jsx21("nav", { className: "px-3 py-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */
|
|
4035
|
+
/* @__PURE__ */ jsx21("nav", { className: "px-3 py-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */ jsxs19(
|
|
3984
4036
|
"div",
|
|
3985
4037
|
{
|
|
3986
4038
|
style: {
|
|
@@ -3990,11 +4042,10 @@ function Drawer({
|
|
|
3990
4042
|
section.title && /* @__PURE__ */ jsx21(
|
|
3991
4043
|
"h3",
|
|
3992
4044
|
{
|
|
3993
|
-
className: "font-semibold uppercase tracking-wide",
|
|
4045
|
+
className: "font-semibold uppercase tracking-wide text-caption",
|
|
3994
4046
|
style: {
|
|
3995
4047
|
marginBottom: "var(--drawer-title-margin-bottom)",
|
|
3996
4048
|
color: "var(--color-muted-foreground)",
|
|
3997
|
-
fontSize: "var(--typography-caption)",
|
|
3998
4049
|
padding: "0 0.75rem"
|
|
3999
4050
|
},
|
|
4000
4051
|
children: section.title
|
|
@@ -4008,11 +4059,11 @@ function Drawer({
|
|
|
4008
4059
|
flexDirection: "column",
|
|
4009
4060
|
gap: "var(--drawer-item-spacing)"
|
|
4010
4061
|
},
|
|
4011
|
-
children: section.items.map((item) => /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */
|
|
4062
|
+
children: section.items.map((item) => /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsxs19(
|
|
4012
4063
|
"button",
|
|
4013
4064
|
{
|
|
4014
4065
|
onClick: () => handleItemClick(item.id),
|
|
4015
|
-
className: "w-full flex items-center gap-3 rounded-lg font-medium transition-all duration-200",
|
|
4066
|
+
className: "w-full flex items-center gap-3 rounded-lg font-medium transition-all duration-200 text-small",
|
|
4016
4067
|
onMouseOver: (e) => {
|
|
4017
4068
|
if (activeItem !== item.id) {
|
|
4018
4069
|
e.currentTarget.style.background = "var(--color-muted)";
|
|
@@ -4030,7 +4081,6 @@ function Drawer({
|
|
|
4030
4081
|
paddingRight: "var(--drawer-item-padding-x)",
|
|
4031
4082
|
paddingTop: "var(--drawer-item-padding-y)",
|
|
4032
4083
|
paddingBottom: "var(--drawer-item-padding-y)",
|
|
4033
|
-
fontSize: "var(--drawer-font-size)",
|
|
4034
4084
|
borderRadius: "var(--drawer-border-radius)",
|
|
4035
4085
|
background: activeItem === item.id ? "var(--color-primary)" : "transparent",
|
|
4036
4086
|
color: activeItem === item.id ? "var(--color-background)" : "var(--color-muted-foreground)",
|
|
@@ -4106,7 +4156,7 @@ function Header({
|
|
|
4106
4156
|
// src/layout/sidebar-nav.tsx
|
|
4107
4157
|
import { Menu as Menu3, X as X4 } from "lucide-react";
|
|
4108
4158
|
import { useState as useState13 } from "react";
|
|
4109
|
-
import { Fragment as
|
|
4159
|
+
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4110
4160
|
function SidebarNav({
|
|
4111
4161
|
title,
|
|
4112
4162
|
subtitle,
|
|
@@ -4124,8 +4174,8 @@ function SidebarNav({
|
|
|
4124
4174
|
setMobileMenuOpen(false);
|
|
4125
4175
|
};
|
|
4126
4176
|
const useSections = sections || (items ? [{ title: "", items }] : []);
|
|
4127
|
-
return /* @__PURE__ */
|
|
4128
|
-
/* @__PURE__ */ jsx23("div", { className: "lg:hidden fixed top-0 left-0 right-0 [z-index:var(--z-index-nav)] bg-(--color-background) border-b border-(--color-border) px-4 py-3", children: /* @__PURE__ */
|
|
4177
|
+
return /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
4178
|
+
/* @__PURE__ */ jsx23("div", { className: "lg:hidden fixed top-0 left-0 right-0 [z-index:var(--z-index-nav)] bg-(--color-background) border-b border-(--color-border) px-4 py-3", children: /* @__PURE__ */ jsxs20(
|
|
4129
4179
|
"div",
|
|
4130
4180
|
{
|
|
4131
4181
|
className: `flex items-center ${isLeft ? "justify-between" : "justify-between flex-row-reverse"}`,
|
|
@@ -4139,7 +4189,7 @@ function SidebarNav({
|
|
|
4139
4189
|
children: mobileMenuOpen ? /* @__PURE__ */ jsx23(X4, { className: "w-6 h-6 text-(--color-muted-foreground)" }) : /* @__PURE__ */ jsx23(Menu3, { className: "w-6 h-6 text-(--color-muted-foreground)" })
|
|
4140
4190
|
}
|
|
4141
4191
|
),
|
|
4142
|
-
/* @__PURE__ */
|
|
4192
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
4143
4193
|
/* @__PURE__ */ jsx23("h1", { className: "text-h4 font-bold text-(--color-foreground)", children: title }),
|
|
4144
4194
|
subtitle && /* @__PURE__ */ jsx23("p", { className: "text-caption text-(--color-muted-foreground)", children: subtitle })
|
|
4145
4195
|
] })
|
|
@@ -4154,7 +4204,7 @@ function SidebarNav({
|
|
|
4154
4204
|
onClick: () => setMobileMenuOpen(false)
|
|
4155
4205
|
}
|
|
4156
4206
|
),
|
|
4157
|
-
/* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsxs20(
|
|
4158
4208
|
"aside",
|
|
4159
4209
|
{
|
|
4160
4210
|
className: `
|
|
@@ -4165,18 +4215,18 @@ function SidebarNav({
|
|
|
4165
4215
|
${mobileMenuOpen ? "translate-x-0" : `${isLeft ? "-translate-x-full" : "translate-x-full"} lg:translate-x-0`}
|
|
4166
4216
|
`,
|
|
4167
4217
|
children: [
|
|
4168
|
-
/* @__PURE__ */
|
|
4218
|
+
/* @__PURE__ */ jsxs20("div", { className: "hidden lg:block p-6 border-b border-(--color-border)", children: [
|
|
4169
4219
|
/* @__PURE__ */ jsx23("h1", { className: "text-h3 font-bold text-(--color-foreground)", children: title }),
|
|
4170
4220
|
subtitle && /* @__PURE__ */ jsx23("p", { className: "text-caption text-(--color-muted-foreground) mt-1", children: subtitle })
|
|
4171
4221
|
] }),
|
|
4172
4222
|
/* @__PURE__ */ jsx23("div", { className: "lg:hidden h-[57px]", "aria-hidden": "true" }),
|
|
4173
|
-
/* @__PURE__ */ jsx23("nav", { className: "p-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */
|
|
4223
|
+
/* @__PURE__ */ jsx23("nav", { className: "p-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */ jsxs20(
|
|
4174
4224
|
"div",
|
|
4175
4225
|
{
|
|
4176
4226
|
className: sectionIndex > 0 ? "mt-6" : "",
|
|
4177
4227
|
children: [
|
|
4178
4228
|
section.title && /* @__PURE__ */ jsx23("h3", { className: "px-4 mb-2 text-caption font-semibold text-(--color-muted-foreground) uppercase tracking-wider", children: section.title }),
|
|
4179
|
-
/* @__PURE__ */ jsx23("ul", { className: "space-y-1", children: section.items.map((item) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */
|
|
4229
|
+
/* @__PURE__ */ jsx23("ul", { className: "space-y-1", children: section.items.map((item) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs20(
|
|
4180
4230
|
"button",
|
|
4181
4231
|
{
|
|
4182
4232
|
onClick: () => handleItemClick(item.id),
|
|
@@ -4203,10 +4253,10 @@ function SidebarNav({
|
|
|
4203
4253
|
|
|
4204
4254
|
// src/shared/empty-state.tsx
|
|
4205
4255
|
import React17 from "react";
|
|
4206
|
-
import { jsx as jsx24, jsxs as
|
|
4256
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4207
4257
|
var EmptyState = React17.forwardRef(
|
|
4208
4258
|
({ className, icon, title, description, action, ...props }, ref) => {
|
|
4209
|
-
return /* @__PURE__ */
|
|
4259
|
+
return /* @__PURE__ */ jsxs21(
|
|
4210
4260
|
"div",
|
|
4211
4261
|
{
|
|
4212
4262
|
ref,
|
|
@@ -4448,11 +4498,11 @@ var light_default = {
|
|
|
4448
4498
|
};
|
|
4449
4499
|
|
|
4450
4500
|
// src/themes/index.ts
|
|
4451
|
-
var
|
|
4501
|
+
var themes2 = {
|
|
4452
4502
|
light: light_default,
|
|
4453
4503
|
dark: dark_default
|
|
4454
4504
|
};
|
|
4455
|
-
var themes_default =
|
|
4505
|
+
var themes_default = themes2;
|
|
4456
4506
|
|
|
4457
4507
|
// src/contexts/ThemeProvider.tsx
|
|
4458
4508
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
@@ -4494,6 +4544,9 @@ function ThemeProvider({
|
|
|
4494
4544
|
if (theme.showcase) {
|
|
4495
4545
|
Object.entries(theme.showcase).forEach(([key, value]) => {
|
|
4496
4546
|
setCSSVariable(`--showcase-${key}`, value);
|
|
4547
|
+
if (key === "surface" || key === "surface-elevated") {
|
|
4548
|
+
setCSSVariable(`--color-${key}`, value);
|
|
4549
|
+
}
|
|
4497
4550
|
});
|
|
4498
4551
|
}
|
|
4499
4552
|
if (theme.semanticColors) {
|