@yomologic/react-ui 0.4.1 → 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/index.js CHANGED
@@ -103,10 +103,9 @@ var Button = import_react.default.forwardRef(
103
103
  leftIcon,
104
104
  rightIcon,
105
105
  children,
106
- disabled,
107
106
  ...props
108
107
  }, ref) => {
109
- 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";
108
+ 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";
110
109
  const variants = {
111
110
  primary: "bg-[var(--color-primary)] text-[var(--button-primary-text)] hover:brightness-90 active:brightness-75",
112
111
  secondary: "bg-[var(--color-secondary)] text-[var(--button-secondary-text)] hover:brightness-90 active:brightness-75",
@@ -126,81 +125,105 @@ var Button = import_react.default.forwardRef(
126
125
  };
127
126
  const radiusStyle = "[border-radius:var(--button-radius)]";
128
127
  const fontWeightStyle = "[font-weight:var(--button-font-weight)]";
129
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
128
+ const classNames = cn(
129
+ baseStyles,
130
+ variants[variant],
131
+ sizes[size],
132
+ radiusStyle,
133
+ fontWeightStyle,
134
+ className
135
+ );
136
+ const handleMouseEnter = (e) => {
137
+ if (variant === "ghost") {
138
+ e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.08)";
139
+ } else if (variant === "outline") {
140
+ e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.12)";
141
+ }
142
+ };
143
+ const handleMouseLeave = (e) => {
144
+ if (variant === "ghost" || variant === "outline") {
145
+ e.currentTarget.style.backgroundColor = "";
146
+ }
147
+ };
148
+ const handleMouseDown = (e) => {
149
+ if (variant === "ghost") {
150
+ e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.16)";
151
+ } else if (variant === "outline") {
152
+ e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.24)";
153
+ }
154
+ };
155
+ const handleMouseUp = (e) => {
156
+ if (variant === "ghost") {
157
+ e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.08)";
158
+ } else if (variant === "outline") {
159
+ e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.12)";
160
+ }
161
+ };
162
+ const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
163
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
164
+ "svg",
165
+ {
166
+ className: "animate-spin h-4 w-4",
167
+ xmlns: "http://www.w3.org/2000/svg",
168
+ fill: "none",
169
+ viewBox: "0 0 24 24",
170
+ children: [
171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
172
+ "circle",
173
+ {
174
+ className: "opacity-25",
175
+ cx: "12",
176
+ cy: "12",
177
+ r: "10",
178
+ stroke: "currentColor",
179
+ strokeWidth: "4"
180
+ }
181
+ ),
182
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
183
+ "path",
184
+ {
185
+ className: "opacity-75",
186
+ fill: "currentColor",
187
+ 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"
188
+ }
189
+ )
190
+ ]
191
+ }
192
+ ),
193
+ !isLoading && leftIcon && leftIcon,
194
+ children,
195
+ !isLoading && rightIcon && rightIcon
196
+ ] });
197
+ if ("href" in props && props.href) {
198
+ const { href, ...rest2 } = props;
199
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
200
+ "a",
201
+ {
202
+ ref,
203
+ href,
204
+ className: classNames,
205
+ onMouseEnter: handleMouseEnter,
206
+ onMouseLeave: handleMouseLeave,
207
+ onMouseDown: handleMouseDown,
208
+ onMouseUp: handleMouseUp,
209
+ ...rest2,
210
+ children: content
211
+ }
212
+ );
213
+ }
214
+ const { disabled, ...rest } = props;
215
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
216
  "button",
131
217
  {
132
218
  ref,
133
- className: cn(
134
- baseStyles,
135
- variants[variant],
136
- sizes[size],
137
- radiusStyle,
138
- fontWeightStyle,
139
- className
140
- ),
141
- onMouseEnter: (e) => {
142
- if (variant === "ghost") {
143
- e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.08)";
144
- } else if (variant === "outline") {
145
- e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.12)";
146
- }
147
- },
148
- onMouseLeave: (e) => {
149
- if (variant === "ghost" || variant === "outline") {
150
- e.currentTarget.style.backgroundColor = "";
151
- }
152
- },
153
- onMouseDown: (e) => {
154
- if (variant === "ghost") {
155
- e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.16)";
156
- } else if (variant === "outline") {
157
- e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.24)";
158
- }
159
- },
160
- onMouseUp: (e) => {
161
- if (variant === "ghost") {
162
- e.currentTarget.style.backgroundColor = "rgba(99, 102, 241, 0.08)";
163
- } else if (variant === "outline") {
164
- e.currentTarget.style.backgroundColor = "rgba(59, 130, 246, 0.12)";
165
- }
166
- },
219
+ className: classNames,
220
+ onMouseEnter: handleMouseEnter,
221
+ onMouseLeave: handleMouseLeave,
222
+ onMouseDown: handleMouseDown,
223
+ onMouseUp: handleMouseUp,
167
224
  disabled: disabled || isLoading,
168
- ...props,
169
- children: [
170
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
171
- "svg",
172
- {
173
- className: "animate-spin h-4 w-4",
174
- xmlns: "http://www.w3.org/2000/svg",
175
- fill: "none",
176
- viewBox: "0 0 24 24",
177
- children: [
178
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
179
- "circle",
180
- {
181
- className: "opacity-25",
182
- cx: "12",
183
- cy: "12",
184
- r: "10",
185
- stroke: "currentColor",
186
- strokeWidth: "4"
187
- }
188
- ),
189
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
190
- "path",
191
- {
192
- className: "opacity-75",
193
- fill: "currentColor",
194
- 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"
195
- }
196
- )
197
- ]
198
- }
199
- ),
200
- !isLoading && leftIcon && leftIcon,
201
- children,
202
- !isLoading && rightIcon && rightIcon
203
- ]
225
+ ...rest,
226
+ children: content
204
227
  }
205
228
  );
206
229
  }
@@ -459,7 +482,7 @@ function FormControl({
459
482
  asChild = false
460
483
  }) {
461
484
  const autoId = (0, import_react3.useId)();
462
- const stableFieldId = (0, import_react3.useRef)();
485
+ const stableFieldId = (0, import_react3.useRef)(void 0);
463
486
  if (!stableFieldId.current) {
464
487
  stableFieldId.current = name ? `field-${name}` : `field-${autoId}`;
465
488
  }
@@ -603,17 +626,18 @@ function FormControl({
603
626
  if (asChild) {
604
627
  const child = import_react3.Children.only(children);
605
628
  if ((0, import_react3.isValidElement)(child)) {
629
+ const childProps = child.props;
606
630
  return (0, import_react3.cloneElement)(child, {
607
631
  ...fieldProps,
608
- ...child.props,
632
+ ...childProps,
609
633
  // Merge onChange handlers
610
634
  onChange: (e) => {
611
635
  fieldProps.onChange(e);
612
- child.props.onChange?.(e);
636
+ childProps.onChange?.(e);
613
637
  },
614
638
  onBlur: () => {
615
639
  fieldProps.onBlur();
616
- child.props.onBlur?.();
640
+ childProps.onBlur?.();
617
641
  }
618
642
  });
619
643
  }
@@ -647,8 +671,8 @@ function FormControl({
647
671
  "p",
648
672
  {
649
673
  className: cn(
650
- "text-xs",
651
- currentError ? "text-red-600" : "text-(--color-muted-foreground)"
674
+ "text-small",
675
+ currentError ? "text-error" : "text-(--color-muted-foreground)"
652
676
  ),
653
677
  id: `${fieldId}-message`,
654
678
  role: currentError ? "alert" : void 0,
@@ -719,8 +743,8 @@ function FormHelperText({
719
743
  "p",
720
744
  {
721
745
  className: cn(
722
- "text-xs",
723
- isError ? "text-red-600" : "text-(--color-muted-foreground)",
746
+ "text-small",
747
+ isError ? "text-error" : "text-(--color-muted-foreground)",
724
748
  className
725
749
  ),
726
750
  role: isError ? "alert" : void 0,
@@ -758,7 +782,7 @@ var Input = import_react4.default.forwardRef(
758
782
  const formControl = useFormControl();
759
783
  const internalRef = (0, import_react4.useRef)(null);
760
784
  const [validationError, setValidationError] = (0, import_react4.useState)();
761
- const stableId = (0, import_react4.useRef)();
785
+ const stableId = (0, import_react4.useRef)(void 0);
762
786
  if (!stableId.current) {
763
787
  stableId.current = id || formControl?.fieldId || `input-${autoId}`;
764
788
  }
@@ -972,7 +996,7 @@ var Input = import_react4.default.forwardRef(
972
996
  "text-(--color-muted-foreground) placeholder-gray-400",
973
997
  "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
974
998
  "disabled:bg-(--color-muted) disabled:cursor-not-allowed disabled:text-(--color-muted-foreground)",
975
- inputError ? "border-red-500 focus:ring-red-500" : "border-(--color-border)",
999
+ inputError ? "border-error focus:ring-error" : "border-(--color-border)",
976
1000
  leftIcon && "pl-10",
977
1001
  rightIcon && "pr-10",
978
1002
  className
@@ -995,7 +1019,7 @@ var Input = import_react4.default.forwardRef(
995
1019
  shouldRenderError && inputError && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
996
1020
  "p",
997
1021
  {
998
- className: "text-caption text-red-600",
1022
+ className: "text-small text-error",
999
1023
  id: `${inputId}-error`,
1000
1024
  role: "alert",
1001
1025
  suppressHydrationWarning: true,
@@ -1005,7 +1029,7 @@ var Input = import_react4.default.forwardRef(
1005
1029
  helperText && !inputError && !formControl && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1006
1030
  "p",
1007
1031
  {
1008
- className: "text-caption text-(--color-muted-foreground)",
1032
+ className: "text-small text-(--color-muted-foreground)",
1009
1033
  id: `${inputId}-helper`,
1010
1034
  suppressHydrationWarning: true,
1011
1035
  children: helperText
@@ -1028,6 +1052,7 @@ var Card = import_react5.default.forwardRef(
1028
1052
  variant = "default",
1029
1053
  padding = "md",
1030
1054
  hoverable = false,
1055
+ accentColor,
1031
1056
  children,
1032
1057
  ...props
1033
1058
  }, ref) => {
@@ -1035,7 +1060,8 @@ var Card = import_react5.default.forwardRef(
1035
1060
  const variants = {
1036
1061
  default: "border border-(--color-border)",
1037
1062
  bordered: "border-2 border-(--color-border)",
1038
- elevated: "shadow-md"
1063
+ elevated: "shadow-md",
1064
+ accent: "border border-(--color-border) hover:border-(--color-primary) active:border-(--color-primary) transition-all duration-300 relative overflow-hidden group"
1039
1065
  };
1040
1066
  const paddings = {
1041
1067
  none: "",
@@ -1044,7 +1070,7 @@ var Card = import_react5.default.forwardRef(
1044
1070
  lg: "p-6"
1045
1071
  };
1046
1072
  const hoverStyles = hoverable ? "hover:shadow-lg transition-shadow cursor-pointer" : "";
1047
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1073
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1048
1074
  "div",
1049
1075
  {
1050
1076
  ref,
@@ -1055,8 +1081,20 @@ var Card = import_react5.default.forwardRef(
1055
1081
  hoverStyles,
1056
1082
  className
1057
1083
  ),
1084
+ style: variant === "accent" && accentColor ? {
1085
+ "--card-accent-color": accentColor
1086
+ } : void 0,
1058
1087
  ...props,
1059
- children
1088
+ children: [
1089
+ variant === "accent" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1090
+ "div",
1091
+ {
1092
+ 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",
1093
+ style: accentColor ? { color: accentColor } : { color: "var(--color-primary)" }
1094
+ }
1095
+ ),
1096
+ children
1097
+ ]
1060
1098
  }
1061
1099
  );
1062
1100
  }
@@ -1111,6 +1149,7 @@ var CardMedia = import_react5.default.forwardRef(
1111
1149
  component = "div",
1112
1150
  aspectRatio = "16/9",
1113
1151
  alt = "",
1152
+ objectFit = "cover",
1114
1153
  style,
1115
1154
  ...props
1116
1155
  }, ref) => {
@@ -1118,6 +1157,7 @@ var CardMedia = import_react5.default.forwardRef(
1118
1157
  aspectRatio,
1119
1158
  ...style
1120
1159
  };
1160
+ const objectFitClass = objectFit === "cover" ? "object-cover" : objectFit === "contain" ? "object-contain" : objectFit === "fill" ? "object-fill" : objectFit === "none" ? "object-none" : "object-scale-down";
1121
1161
  if (component === "img" && image) {
1122
1162
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1123
1163
  "img",
@@ -1125,7 +1165,7 @@ var CardMedia = import_react5.default.forwardRef(
1125
1165
  ref,
1126
1166
  src: image,
1127
1167
  alt,
1128
- className: cn("w-full object-cover", className),
1168
+ className: cn("w-full h-full", objectFitClass, className),
1129
1169
  style: aspectRatioStyle,
1130
1170
  ...props
1131
1171
  }
@@ -1137,7 +1177,7 @@ var CardMedia = import_react5.default.forwardRef(
1137
1177
  {
1138
1178
  ref,
1139
1179
  src: video,
1140
- className: cn("w-full object-cover", className),
1180
+ className: cn("w-full", objectFitClass, className),
1141
1181
  style: aspectRatioStyle,
1142
1182
  ...props
1143
1183
  }
@@ -1161,18 +1201,31 @@ var CardMedia = import_react5.default.forwardRef(
1161
1201
  );
1162
1202
  CardMedia.displayName = "CardMedia";
1163
1203
  var CardActions = import_react5.default.forwardRef(
1164
- ({ className, disableSpacing = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1165
- "div",
1166
- {
1167
- ref,
1168
- className: cn(
1169
- "flex items-center",
1170
- !disableSpacing && "gap-2 p-4",
1171
- className
1172
- ),
1173
- ...props
1174
- }
1175
- )
1204
+ ({ className, disableSpacing = false, position = "left", ...props }, ref) => {
1205
+ const justifyContent = {
1206
+ left: "justify-start",
1207
+ center: "justify-center",
1208
+ right: "justify-end"
1209
+ }[position];
1210
+ const padding = {
1211
+ left: "pl-4 pr-4 py-4",
1212
+ center: "px-4 py-4",
1213
+ right: "pl-4 pr-4 py-4"
1214
+ }[position];
1215
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1216
+ "div",
1217
+ {
1218
+ ref,
1219
+ className: cn(
1220
+ "flex items-center",
1221
+ justifyContent,
1222
+ !disableSpacing && `gap-2 ${padding}`,
1223
+ className
1224
+ ),
1225
+ ...props
1226
+ }
1227
+ );
1228
+ }
1176
1229
  );
1177
1230
  CardActions.displayName = "CardActions";
1178
1231
  var CardActionArea = import_react5.default.forwardRef(
@@ -1302,7 +1355,7 @@ function Checkbox({
1302
1355
  }) {
1303
1356
  const form = useForm();
1304
1357
  const autoId = (0, import_react7.useId)();
1305
- const stableId = (0, import_react7.useRef)();
1358
+ const stableId = (0, import_react7.useRef)(void 0);
1306
1359
  if (!stableId.current) {
1307
1360
  stableId.current = id || `checkbox-${autoId}`;
1308
1361
  }
@@ -1372,75 +1425,68 @@ function Checkbox({
1372
1425
  lg: "gap-2",
1373
1426
  xl: "gap-2"
1374
1427
  };
1375
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1376
- "div",
1377
- {
1378
- className: cn("flex flex-col", className),
1379
- style: { marginBottom: "var(--form-control-spacing)" },
1380
- children: [
1381
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("flex items-center", containerGapStyles[size]), children: [
1382
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative group/checkbox flex items-center shrink-0", children: [
1383
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1384
- "div",
1385
- {
1386
- className: "rounded-full scale-0 group-hover/checkbox:scale-100 group-active/checkbox:scale-100 transition-transform duration-200 ease-out",
1387
- style: {
1388
- width: size === "xs" ? "1.75rem" : size === "sm" ? "2rem" : size === "lg" ? "2.5rem" : size === "xl" ? "3rem" : "2.25rem",
1389
- height: size === "xs" ? "1.75rem" : size === "sm" ? "2rem" : size === "lg" ? "2.5rem" : size === "xl" ? "3rem" : "2.25rem",
1390
- backgroundColor: "var(--checkbox-hover-bg)"
1391
- }
1392
- }
1393
- ) }),
1394
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1395
- "input",
1396
- {
1397
- type: "checkbox",
1398
- id: checkboxId,
1399
- checked,
1400
- onChange: handleChange,
1401
- disabled,
1402
- suppressHydrationWarning: true,
1403
- className: cn(
1404
- "rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 transition-all relative z-10",
1405
- disabled && "cursor-not-allowed"
1406
- ),
1407
- style: {
1408
- 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)",
1409
- 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)",
1410
- borderColor: "var(--color-border)",
1411
- backgroundColor: "var(--color-muted)",
1412
- accentColor: "var(--color-primary)",
1413
- opacity: disabled ? "var(--checkbox-disabled-opacity)" : void 0
1414
- }
1415
- }
1416
- )
1417
- ] }),
1418
- label && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1419
- "label",
1420
- {
1421
- htmlFor: checkboxId,
1422
- className: cn(
1423
- "font-medium",
1424
- disabled && "cursor-not-allowed",
1425
- !disabled && "cursor-pointer"
1426
- ),
1427
- suppressHydrationWarning: true,
1428
- style: {
1429
- 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)",
1430
- color: "var(--color-muted-foreground)",
1431
- opacity: disabled ? "var(--checkbox-disabled-opacity)" : void 0
1432
- },
1433
- children: [
1434
- label,
1435
- required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ml-1", children: "*" })
1436
- ]
1428
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("flex flex-col", className), children: [
1429
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("flex items-center", containerGapStyles[size]), children: [
1430
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative group/checkbox flex items-center shrink-0", children: [
1431
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1432
+ "div",
1433
+ {
1434
+ className: "rounded-full scale-0 group-hover/checkbox:scale-100 group-active/checkbox:scale-100 transition-transform duration-200 ease-out",
1435
+ style: {
1436
+ width: size === "xs" ? "1.75rem" : size === "sm" ? "2rem" : size === "lg" ? "2.5rem" : size === "xl" ? "3rem" : "2.25rem",
1437
+ height: size === "xs" ? "1.75rem" : size === "sm" ? "2rem" : size === "lg" ? "2.5rem" : size === "xl" ? "3rem" : "2.25rem",
1438
+ backgroundColor: "var(--checkbox-hover-bg)"
1437
1439
  }
1438
- )
1439
- ] }),
1440
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "h-5 mt-1.5", children: displayError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-caption text-red-600", role: "alert", children: displayError }) })
1441
- ]
1442
- }
1443
- );
1440
+ }
1441
+ ) }),
1442
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1443
+ "input",
1444
+ {
1445
+ type: "checkbox",
1446
+ id: checkboxId,
1447
+ checked,
1448
+ onChange: handleChange,
1449
+ disabled,
1450
+ suppressHydrationWarning: true,
1451
+ className: cn(
1452
+ "rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 transition-all relative z-10",
1453
+ disabled && "cursor-not-allowed"
1454
+ ),
1455
+ style: {
1456
+ 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)",
1457
+ 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)",
1458
+ borderColor: "var(--color-border)",
1459
+ backgroundColor: "var(--color-muted)",
1460
+ accentColor: "var(--color-primary)",
1461
+ opacity: disabled ? "var(--checkbox-disabled-opacity)" : void 0
1462
+ }
1463
+ }
1464
+ )
1465
+ ] }),
1466
+ label && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1467
+ "label",
1468
+ {
1469
+ htmlFor: checkboxId,
1470
+ className: cn(
1471
+ "font-medium",
1472
+ disabled && "cursor-not-allowed",
1473
+ !disabled && "cursor-pointer"
1474
+ ),
1475
+ suppressHydrationWarning: true,
1476
+ style: {
1477
+ 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)",
1478
+ color: "var(--color-muted-foreground)",
1479
+ opacity: disabled ? "var(--checkbox-disabled-opacity)" : void 0
1480
+ },
1481
+ children: [
1482
+ label,
1483
+ required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ml-1", children: "*" })
1484
+ ]
1485
+ }
1486
+ )
1487
+ ] }),
1488
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "h-5 mt-1.5", children: displayError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-small text-error", role: "alert", children: displayError }) })
1489
+ ] });
1444
1490
  }
1445
1491
  function CheckboxGroup({
1446
1492
  label,
@@ -1589,7 +1635,7 @@ function CheckboxGroup({
1589
1635
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "h-5 mt-1.5", children: (error || helperText) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1590
1636
  "p",
1591
1637
  {
1592
- className: `text-caption ${error ? "text-red-600" : "text-(--color-muted-foreground)"}`,
1638
+ className: `text-small ${error ? "text-error" : "text-(--color-muted-foreground)"}`,
1593
1639
  role: error ? "alert" : void 0,
1594
1640
  children: error || helperText
1595
1641
  }
@@ -1768,7 +1814,7 @@ function RadioGroup({
1768
1814
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "h-5 mt-1.5", children: (displayError || helperText) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1769
1815
  "p",
1770
1816
  {
1771
- className: `text-caption ${displayError ? "text-red-600" : "text-(--color-muted-foreground)"}`,
1817
+ className: `text-small ${displayError ? "text-error" : "text-(--color-muted-foreground)"}`,
1772
1818
  role: displayError ? "alert" : void 0,
1773
1819
  children: displayError || helperText
1774
1820
  }
@@ -1922,7 +1968,7 @@ function Select({
1922
1968
  w-full ${sizeStyles[size]} text-left bg-(--color-background) border rounded-(--dropdown-radius)
1923
1969
  flex items-center justify-between
1924
1970
  transition-all duration-200
1925
- ${displayError ? "border-red-500 focus:ring-2 focus:ring-red-200 focus:border-red-500" : "border-(--color-border) focus:ring-2 focus:ring-[color-mix(in_srgb,var(--color-primary)_30%,transparent)] focus:border-(--color-primary)"}
1971
+ ${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)"}
1926
1972
  ${disabled ? "bg-(--color-muted) cursor-not-allowed opacity-60" : "hover:border-(--color-border)"}
1927
1973
  ${!value ? "text-(--color-placeholder)" : "text-(--color-foreground)"}
1928
1974
  `,
@@ -2006,7 +2052,7 @@ function Select({
2006
2052
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-5 mt-1.5", children: (helperText || displayError) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2007
2053
  "p",
2008
2054
  {
2009
- className: `text-caption ${displayError ? "text-red-600" : "text-(--color-muted-foreground)"}`,
2055
+ className: `text-small ${displayError ? "text-error" : "text-(--color-muted-foreground)"}`,
2010
2056
  children: displayError || helperText
2011
2057
  }
2012
2058
  ) })
@@ -2080,9 +2126,8 @@ var Spinner = import_react10.default.forwardRef(
2080
2126
  Spinner.displayName = "Spinner";
2081
2127
 
2082
2128
  // src/ui/code-snippet.tsx
2129
+ var import_prism_react_renderer = require("prism-react-renderer");
2083
2130
  var import_react11 = require("react");
2084
- var import_react_syntax_highlighter = require("react-syntax-highlighter");
2085
- var import_prism = require("react-syntax-highlighter/dist/esm/styles/prism");
2086
2131
  var import_jsx_runtime11 = require("react/jsx-runtime");
2087
2132
  function CodeSnippet({
2088
2133
  code,
@@ -2173,20 +2218,32 @@ function CodeSnippet({
2173
2218
  {
2174
2219
  className: `rounded-lg overflow-x-auto border border-[#1f2937] ${fontSizeClassMap[fontSize]} code-snippet-${fontSize}`,
2175
2220
  children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2176
- import_react_syntax_highlighter.Prism,
2221
+ import_prism_react_renderer.Highlight,
2177
2222
  {
2223
+ theme: import_prism_react_renderer.themes.vsDark,
2224
+ code,
2178
2225
  language,
2179
- style: import_prism.vscDarkPlus,
2180
- customStyle: {
2181
- margin: 0,
2182
- padding: "1rem 3.5rem 1rem 1rem",
2183
- lineHeight: "1.5",
2184
- background: "#1a1b26"
2185
- },
2186
- wrapLines: wrap,
2187
- wrapLongLines: wrap,
2188
- showLineNumbers: false,
2189
- children: code
2226
+ children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2227
+ "pre",
2228
+ {
2229
+ style: {
2230
+ ...style,
2231
+ margin: 0,
2232
+ padding: "1rem 3.5rem 1rem 1rem",
2233
+ lineHeight: "1.5",
2234
+ background: "#1a1b26",
2235
+ whiteSpace: wrap ? "pre-wrap" : "pre",
2236
+ wordBreak: wrap ? "break-word" : "normal"
2237
+ },
2238
+ children: tokens.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...getLineProps({ line }), children: line.map((token, key) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2239
+ "span",
2240
+ {
2241
+ ...getTokenProps({ token })
2242
+ },
2243
+ key
2244
+ )) }, i))
2245
+ }
2246
+ )
2190
2247
  }
2191
2248
  )
2192
2249
  }
@@ -2423,7 +2480,7 @@ var Divider = ({
2423
2480
  const orientationClasses = isVertical ? "inline-block min-h-[1rem]" : "block w-full";
2424
2481
  const flexClasses = flexItem && isVertical ? "self-stretch !h-auto" : "";
2425
2482
  const textStyles = {
2426
- fontSize: "var(--text-sm, 0.875rem)",
2483
+ fontSize: "var(--typography-small, 0.75rem)",
2427
2484
  color: "var(--color-muted-foreground, #6b7280)"
2428
2485
  };
2429
2486
  if (children) {
@@ -3574,12 +3631,12 @@ var Nav = import_react19.default.forwardRef(
3574
3631
  const variantItemStyles = {
3575
3632
  primary: "rounded-md hover:bg-(--color-primary)/10 hover:text-(--color-primary) transition-colors duration-150",
3576
3633
  secondary: "rounded-md hover:bg-(--color-muted) transition-colors duration-150",
3577
- ghost: "rounded-md hover:bg-(--color-muted) transition-colors duration-150"
3634
+ ghost: "rounded-md hover:bg-(--color-primary)/5 transition-colors duration-150"
3578
3635
  };
3579
3636
  const activeItemStyles = {
3580
3637
  primary: "bg-(--color-primary) text-white hover:bg-(--color-primary) hover:text-white",
3581
3638
  secondary: "bg-(--color-muted) text-(--color-foreground) font-semibold",
3582
- ghost: "bg-(--color-muted) text-(--color-foreground) font-semibold"
3639
+ ghost: "text-(--color-primary) font-medium"
3583
3640
  };
3584
3641
  const breakpointClasses = {
3585
3642
  sm: "sm:hidden",
@@ -3920,10 +3977,9 @@ function Drawer({
3920
3977
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3921
3978
  "h1",
3922
3979
  {
3923
- className: "font-bold",
3980
+ className: "font-bold text-h5",
3924
3981
  style: {
3925
- color: "var(--color-foreground)",
3926
- fontSize: "var(--typography-h5)"
3982
+ color: "var(--color-foreground)"
3927
3983
  },
3928
3984
  children: title
3929
3985
  }
@@ -3931,9 +3987,9 @@ function Drawer({
3931
3987
  subtitle && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3932
3988
  "p",
3933
3989
  {
3990
+ className: "text-caption",
3934
3991
  style: {
3935
- color: "var(--color-muted-foreground)",
3936
- fontSize: "var(--typography-caption)"
3992
+ color: "var(--color-muted-foreground)"
3937
3993
  },
3938
3994
  children: subtitle
3939
3995
  }
@@ -3975,16 +4031,15 @@ function Drawer({
3975
4031
  className: "hidden lg:block px-6 py-5",
3976
4032
  style: {
3977
4033
  borderBottom: "1px solid var(--color-border)",
3978
- background: "var(--color-muted)"
4034
+ background: "var(--color-surface-elevated)"
3979
4035
  },
3980
4036
  children: [
3981
4037
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3982
4038
  "h1",
3983
4039
  {
3984
- className: "font-bold",
4040
+ className: "font-bold text-h5",
3985
4041
  style: {
3986
- color: "var(--color-foreground)",
3987
- fontSize: "var(--typography-h5)"
4042
+ color: "var(--color-foreground)"
3988
4043
  },
3989
4044
  children: title
3990
4045
  }
@@ -3992,10 +4047,9 @@ function Drawer({
3992
4047
  subtitle && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3993
4048
  "p",
3994
4049
  {
3995
- className: "mt-0.5",
4050
+ className: "mt-0.5 text-caption",
3996
4051
  style: {
3997
- color: "var(--color-muted-foreground)",
3998
- fontSize: "var(--typography-caption)"
4052
+ color: "var(--color-muted-foreground)"
3999
4053
  },
4000
4054
  children: subtitle
4001
4055
  }
@@ -4013,10 +4067,9 @@ function Drawer({
4013
4067
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4014
4068
  "h1",
4015
4069
  {
4016
- className: "font-bold",
4070
+ className: "font-bold text-h5",
4017
4071
  style: {
4018
- color: "var(--color-foreground)",
4019
- fontSize: "var(--typography-h5)"
4072
+ color: "var(--color-foreground)"
4020
4073
  },
4021
4074
  children: title
4022
4075
  }
@@ -4024,10 +4077,9 @@ function Drawer({
4024
4077
  subtitle && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4025
4078
  "p",
4026
4079
  {
4027
- className: "mt-1",
4080
+ className: "mt-1 text-caption",
4028
4081
  style: {
4029
- color: "var(--color-muted-foreground)",
4030
- fontSize: "var(--typography-caption)"
4082
+ color: "var(--color-muted-foreground)"
4031
4083
  },
4032
4084
  children: subtitle
4033
4085
  }
@@ -4058,11 +4110,10 @@ function Drawer({
4058
4110
  section.title && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4059
4111
  "h3",
4060
4112
  {
4061
- className: "font-semibold uppercase tracking-wide",
4113
+ className: "font-semibold uppercase tracking-wide text-caption",
4062
4114
  style: {
4063
4115
  marginBottom: "var(--drawer-title-margin-bottom)",
4064
4116
  color: "var(--color-muted-foreground)",
4065
- fontSize: "var(--typography-caption)",
4066
4117
  padding: "0 0.75rem"
4067
4118
  },
4068
4119
  children: section.title
@@ -4080,7 +4131,7 @@ function Drawer({
4080
4131
  "button",
4081
4132
  {
4082
4133
  onClick: () => handleItemClick(item.id),
4083
- className: "w-full flex items-center gap-3 rounded-lg font-medium transition-all duration-200",
4134
+ className: "w-full flex items-center gap-3 rounded-lg font-medium transition-all duration-200 text-small",
4084
4135
  onMouseOver: (e) => {
4085
4136
  if (activeItem !== item.id) {
4086
4137
  e.currentTarget.style.background = "var(--color-muted)";
@@ -4098,7 +4149,6 @@ function Drawer({
4098
4149
  paddingRight: "var(--drawer-item-padding-x)",
4099
4150
  paddingTop: "var(--drawer-item-padding-y)",
4100
4151
  paddingBottom: "var(--drawer-item-padding-y)",
4101
- fontSize: "var(--drawer-font-size)",
4102
4152
  borderRadius: "var(--drawer-border-radius)",
4103
4153
  background: activeItem === item.id ? "var(--color-primary)" : "transparent",
4104
4154
  color: activeItem === item.id ? "var(--color-background)" : "var(--color-muted-foreground)",
@@ -4511,11 +4561,11 @@ var light_default = {
4511
4561
  };
4512
4562
 
4513
4563
  // src/themes/index.ts
4514
- var themes = {
4564
+ var themes2 = {
4515
4565
  light: light_default,
4516
4566
  dark: dark_default
4517
4567
  };
4518
- var themes_default = themes;
4568
+ var themes_default = themes2;
4519
4569
 
4520
4570
  // src/contexts/ThemeProvider.tsx
4521
4571
  var import_jsx_runtime25 = require("react/jsx-runtime");
@@ -4557,6 +4607,9 @@ function ThemeProvider({
4557
4607
  if (theme.showcase) {
4558
4608
  Object.entries(theme.showcase).forEach(([key, value]) => {
4559
4609
  setCSSVariable(`--showcase-${key}`, value);
4610
+ if (key === "surface" || key === "surface-elevated") {
4611
+ setCSSVariable(`--color-${key}`, value);
4612
+ }
4560
4613
  });
4561
4614
  }
4562
4615
  if (theme.semanticColors) {