pxengine 0.1.55 → 0.1.57

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.mjs CHANGED
@@ -85,19 +85,30 @@ var TextAtom = ({
85
85
  markdown = false
86
86
  }) => {
87
87
  const baseStyles = {
88
- h1: "scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl text-gray900",
89
- h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0 text-gray900",
90
- h3: "scroll-m-20 text-2xl font-semibold tracking-tight text-gray900",
91
- h4: "scroll-m-20 text-xl font-semibold tracking-tight text-gray900",
92
- p: "leading-7 [&:not(:first-child)]:mt-6 text-gray700",
93
- small: "text-sm font-medium leading-none text-gray600",
94
- muted: "text-sm text-muted-foreground",
95
- label: "text-[10px] font-bold text-gray400 uppercase tracking-widest pl-1"
88
+ h1: "scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",
89
+ h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0",
90
+ h3: "scroll-m-20 text-2xl font-semibold tracking-tight",
91
+ h4: "scroll-m-20 text-xl font-semibold tracking-tight",
92
+ p: "leading-7 [&:not(:first-child)]:mt-6",
93
+ small: "text-sm font-medium leading-none",
94
+ muted: "text-sm",
95
+ label: "text-[10px] font-bold uppercase tracking-widest pl-1"
96
+ };
97
+ const defaultColors = {
98
+ h1: "var(--gray900)",
99
+ h2: "var(--gray900)",
100
+ h3: "var(--gray900)",
101
+ h4: "var(--gray900)",
102
+ p: "var(--gray700)",
103
+ small: "var(--gray600)",
104
+ muted: "hsl(var(--muted-foreground))",
105
+ label: "var(--gray400)"
96
106
  };
97
107
  const Component2 = variant === "small" || variant === "muted" || variant === "label" ? "p" : variant;
98
108
  const wrapperStyles = {
99
- ...style,
100
- ...backgroundColor && { backgroundColor }
109
+ color: `var(--px-text-color, ${defaultColors[variant] ?? "inherit"})`,
110
+ ...backgroundColor && { backgroundColor },
111
+ ...style
101
112
  };
102
113
  if (markdown) {
103
114
  return /* @__PURE__ */ jsx(
@@ -24550,6 +24561,7 @@ var IconAtom = ({
24550
24561
  size = 20,
24551
24562
  color,
24552
24563
  strokeWidth,
24564
+ textColor = "text-dark",
24553
24565
  className,
24554
24566
  style
24555
24567
  }) => {
@@ -24564,7 +24576,7 @@ var IconAtom = ({
24564
24576
  size,
24565
24577
  color,
24566
24578
  strokeWidth,
24567
- className: cn("shrink-0 text-black", className),
24579
+ className: cn("shrink-0", textColor, className),
24568
24580
  style
24569
24581
  }
24570
24582
  );
@@ -25081,17 +25093,43 @@ var InputAtom = ({
25081
25093
  disabled,
25082
25094
  options,
25083
25095
  config,
25096
+ labelColor,
25084
25097
  className,
25085
25098
  style
25086
25099
  }) => {
25087
25100
  const containerClass = cn("flex flex-col gap-2 w-full", className);
25101
+ const getAlignmentClass = (textAlign2) => {
25102
+ switch (textAlign2) {
25103
+ case "center":
25104
+ return "items-center";
25105
+ case "right":
25106
+ return "items-end";
25107
+ default:
25108
+ return "items-start";
25109
+ }
25110
+ };
25111
+ const alignmentClass = getAlignmentClass(style?.textAlign);
25112
+ const alignedContainerClass = cn(containerClass, alignmentClass);
25113
+ const { textAlign, ...remainingStyle } = style || {};
25114
+ const labelBaseStyle = {
25115
+ color: labelColor,
25116
+ backgroundColor: "transparent",
25117
+ background: "none"
25118
+ };
25088
25119
  const renderLabel = () => {
25089
25120
  if (!label) return null;
25090
- return /* @__PURE__ */ jsxs6(Label, { className: "text-sm font-semibold text-foreground/80 pl-0.5", children: [
25091
- label,
25092
- " ",
25093
- required && /* @__PURE__ */ jsx17("span", { className: "text-destructive", children: "*" })
25094
- ] });
25121
+ return /* @__PURE__ */ jsxs6(
25122
+ Label,
25123
+ {
25124
+ style: labelBaseStyle,
25125
+ className: "text-sm font-semibold text-foreground/80 pl-0.5 border-none shadow-none",
25126
+ children: [
25127
+ label,
25128
+ " ",
25129
+ required && /* @__PURE__ */ jsx17("span", { className: "text-destructive", children: "*" })
25130
+ ]
25131
+ }
25132
+ );
25095
25133
  };
25096
25134
  const renderInput = () => {
25097
25135
  const commonProps = {
@@ -25101,10 +25139,10 @@ var InputAtom = ({
25101
25139
  required,
25102
25140
  readOnly: true,
25103
25141
  className: cn(
25104
- "rounded-xl border-border bg-background focus:ring-primary shadow-sm",
25142
+ "rounded-xl border-border bg-transparent focus:ring-primary shadow-none",
25105
25143
  className
25106
25144
  ),
25107
- style
25145
+ style: remainingStyle
25108
25146
  };
25109
25147
  switch (inputType) {
25110
25148
  case "textarea":
@@ -25114,18 +25152,15 @@ var InputAtom = ({
25114
25152
  /* @__PURE__ */ jsx17(
25115
25153
  SelectTrigger,
25116
25154
  {
25117
- className: cn(
25118
- "rounded-xl border-border bg-background shadow-sm",
25119
- className
25120
- ),
25121
- style,
25155
+ className: cn("rounded-xl border-border bg-transparent shadow-none", className),
25156
+ style: remainingStyle,
25122
25157
  children: /* @__PURE__ */ jsx17(SelectValue, { placeholder: placeholder || "Select option" })
25123
25158
  }
25124
25159
  ),
25125
25160
  /* @__PURE__ */ jsx17(SelectContent, { className: "rounded-xl border-border shadow-xl", children: options?.map((opt) => /* @__PURE__ */ jsx17(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
25126
25161
  ] });
25127
25162
  case "slider":
25128
- return /* @__PURE__ */ jsx17("div", { className: "pt-2 pb-1", style, children: /* @__PURE__ */ jsx17(
25163
+ return /* @__PURE__ */ jsx17("div", { className: "pt-2 pb-1 w-full bg-transparent", style: remainingStyle, children: /* @__PURE__ */ jsx17(
25129
25164
  Slider,
25130
25165
  {
25131
25166
  value: [defaultValue || config?.min || 0],
@@ -25137,86 +25172,69 @@ var InputAtom = ({
25137
25172
  }
25138
25173
  ) });
25139
25174
  case "checkbox":
25140
- return /* @__PURE__ */ jsxs6(
25141
- "div",
25142
- {
25143
- className: cn(
25144
- "flex items-center space-x-3 py-1.5 px-0.5 group cursor-pointer",
25145
- className
25146
- ),
25147
- style,
25148
- children: [
25149
- /* @__PURE__ */ jsx17(
25150
- Checkbox,
25151
- {
25152
- id: label,
25153
- checked: defaultValue,
25154
- disabled,
25155
- className: "rounded-[6px] border-border data-[state=checked]:bg-primary shadow-sm"
25156
- }
25157
- ),
25158
- /* @__PURE__ */ jsx17(
25159
- "label",
25160
- {
25161
- htmlFor: label,
25162
- className: "text-sm font-medium leading-none cursor-pointer text-foreground/90 group-hover:text-foreground transition-colors",
25163
- children: label
25164
- }
25165
- )
25166
- ]
25167
- }
25168
- );
25175
+ return /* @__PURE__ */ jsxs6("div", { className: "flex items-center space-x-3 py-1.5 px-0.5 group cursor-pointer bg-transparent", style: remainingStyle, children: [
25176
+ /* @__PURE__ */ jsx17(
25177
+ Checkbox,
25178
+ {
25179
+ id: label,
25180
+ checked: defaultValue,
25181
+ disabled,
25182
+ className: "rounded-[6px] border-border data-[state=checked]:bg-primary"
25183
+ }
25184
+ ),
25185
+ /* @__PURE__ */ jsx17(
25186
+ "label",
25187
+ {
25188
+ htmlFor: label,
25189
+ style: labelBaseStyle,
25190
+ className: "text-sm font-medium leading-none cursor-pointer text-foreground/90 group-hover:text-foreground transition-colors",
25191
+ children: label
25192
+ }
25193
+ )
25194
+ ] });
25169
25195
  case "switch":
25170
- return /* @__PURE__ */ jsxs6(
25171
- "div",
25172
- {
25173
- className: cn(
25174
- "flex items-center justify-between py-1.5 px-0.5",
25175
- className
25176
- ),
25177
- style,
25178
- children: [
25179
- /* @__PURE__ */ jsx17(
25180
- Label,
25181
- {
25182
- htmlFor: label,
25183
- className: "cursor-pointer text-foreground/90",
25184
- children: label
25185
- }
25186
- ),
25187
- /* @__PURE__ */ jsx17(
25188
- Switch,
25189
- {
25190
- id: label,
25191
- checked: defaultValue,
25192
- disabled,
25193
- className: "data-[state=checked]:bg-primary shadow-sm"
25194
- }
25195
- )
25196
- ]
25197
- }
25198
- );
25196
+ return /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between py-1.5 px-0.5 bg-transparent", style: remainingStyle, children: [
25197
+ /* @__PURE__ */ jsx17(
25198
+ Label,
25199
+ {
25200
+ htmlFor: label,
25201
+ style: labelBaseStyle,
25202
+ className: "cursor-pointer text-foreground/90",
25203
+ children: label
25204
+ }
25205
+ ),
25206
+ /* @__PURE__ */ jsx17(
25207
+ Switch,
25208
+ {
25209
+ id: label,
25210
+ checked: defaultValue,
25211
+ disabled,
25212
+ className: "data-[state=checked]:bg-primary"
25213
+ }
25214
+ )
25215
+ ] });
25199
25216
  case "radio":
25200
25217
  return /* @__PURE__ */ jsx17(
25201
25218
  RadioGroup,
25202
25219
  {
25203
25220
  value: defaultValue,
25204
25221
  disabled,
25205
- className: cn("gap-2.5", className),
25206
- style,
25207
- children: options?.map((opt) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center space-x-3", children: [
25222
+ className: cn("gap-2.5 bg-transparent", className),
25223
+ style: remainingStyle,
25224
+ children: options?.map((opt) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center space-x-3 bg-transparent", children: [
25208
25225
  /* @__PURE__ */ jsx17(
25209
25226
  RadioGroupItem,
25210
25227
  {
25211
25228
  value: opt.value,
25212
25229
  id: `${label}-${opt.value}`,
25213
- className: "border-border text-primary shadow-sm"
25230
+ className: "border-border text-primary"
25214
25231
  }
25215
25232
  ),
25216
25233
  /* @__PURE__ */ jsx17(
25217
25234
  Label,
25218
25235
  {
25219
25236
  htmlFor: `${label}-${opt.value}`,
25237
+ style: labelBaseStyle,
25220
25238
  className: "cursor-pointer text-foreground/80 font-medium",
25221
25239
  children: opt.label
25222
25240
  }
@@ -25225,44 +25243,27 @@ var InputAtom = ({
25225
25243
  }
25226
25244
  );
25227
25245
  case "otp":
25228
- return /* @__PURE__ */ jsx17(
25229
- "div",
25246
+ return /* @__PURE__ */ jsx17("div", { className: "flex justify-center py-2 bg-transparent", style: remainingStyle, children: /* @__PURE__ */ jsx17(InputOTP, { maxLength: config?.maxLength || 6, disabled, value: defaultValue, children: /* @__PURE__ */ jsx17(InputOTPGroup, { className: "gap-2 bg-transparent", children: Array.from({ length: config?.maxLength || 6 }).map((_, i) => /* @__PURE__ */ jsx17(
25247
+ InputOTPSlot,
25230
25248
  {
25231
- className: cn("flex justify-center py-2", className),
25232
- style,
25233
- children: /* @__PURE__ */ jsx17(
25234
- InputOTP,
25235
- {
25236
- maxLength: config?.maxLength || 6,
25237
- disabled,
25238
- value: defaultValue,
25239
- children: /* @__PURE__ */ jsx17(InputOTPGroup, { className: "gap-2", children: Array.from({ length: config?.maxLength || 6 }).map((_, i) => /* @__PURE__ */ jsx17(
25240
- InputOTPSlot,
25241
- {
25242
- index: i,
25243
- className: "rounded-xl border border-border bg-background shadow-sm"
25244
- },
25245
- i
25246
- )) })
25247
- }
25248
- )
25249
- }
25250
- );
25249
+ index: i,
25250
+ className: "rounded-xl border border-border bg-transparent"
25251
+ },
25252
+ i
25253
+ )) }) }) });
25251
25254
  default:
25252
25255
  return /* @__PURE__ */ jsx17(
25253
25256
  Input,
25254
25257
  {
25255
25258
  ...commonProps,
25256
25259
  type: inputType,
25257
- className: cn(
25258
- "rounded-xl border-border bg-background focus:ring-primary shadow-sm h-11",
25259
- className
25260
- )
25260
+ className: cn("rounded-xl border-border bg-transparent focus:ring-primary h-11 shadow-none", className)
25261
25261
  }
25262
25262
  );
25263
25263
  }
25264
25264
  };
25265
- return /* @__PURE__ */ jsxs6("div", { className: containerClass, style, children: [
25265
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
25266
+ return /* @__PURE__ */ jsxs6("div", { className: alignedContainerClass, style: remainingStyle, "data-px-styled": hasPxVars ? "" : void 0, children: [
25266
25267
  inputType !== "checkbox" && inputType !== "switch" && renderLabel(),
25267
25268
  renderInput()
25268
25269
  ] });
@@ -25300,13 +25301,20 @@ var BadgeAtom = ({
25300
25301
  className,
25301
25302
  style
25302
25303
  }) => {
25304
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
25303
25305
  const customVariants = {
25304
- purple: "bg-primary/10 text-primary border-primary/20 hover:bg-primary/20",
25305
- green: "bg-emerald-500/10 text-emerald-500 border-emerald-500/20 hover:bg-emerald-500/20"
25306
+ purple: "border-primary/20 hover:bg-primary/20",
25307
+ green: "border-emerald-500/20 hover:bg-emerald-500/20"
25306
25308
  };
25307
25309
  const isCustom = ["purple", "green"].includes(variant || "");
25308
25310
  const shadcnVariant = isCustom ? "outline" : variant;
25309
25311
  const customClass = isCustom ? customVariants[variant] : "";
25312
+ const resolvedStyle = {
25313
+ backgroundColor: "var(--px-bg-color, transparent)",
25314
+ color: "var(--px-text-color, inherit)",
25315
+ borderColor: "var(--px-border-color, currentColor)",
25316
+ ...style
25317
+ };
25310
25318
  return /* @__PURE__ */ jsx19(
25311
25319
  Badge2,
25312
25320
  {
@@ -25316,7 +25324,8 @@ var BadgeAtom = ({
25316
25324
  customClass,
25317
25325
  className
25318
25326
  ),
25319
- style,
25327
+ style: resolvedStyle,
25328
+ "data-px-styled": hasPxVars ? "" : void 0,
25320
25329
  children: label
25321
25330
  }
25322
25331
  );
@@ -25535,9 +25544,11 @@ Progress.displayName = ProgressPrimitive.Root.displayName;
25535
25544
  import { jsx as jsx27 } from "react/jsx-runtime";
25536
25545
  var ProgressAtom = ({
25537
25546
  value,
25538
- className
25547
+ className,
25548
+ style
25539
25549
  }) => {
25540
- return /* @__PURE__ */ jsx27("div", { className: cn("w-full py-2", className), children: /* @__PURE__ */ jsx27(Progress, { value, className: "h-2 bg-gray-100" }) });
25550
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
25551
+ return /* @__PURE__ */ jsx27("div", { className: cn("w-full py-2", className), style, "data-px-styled": hasPxVars ? "" : void 0, children: /* @__PURE__ */ jsx27(Progress, { value, className: "h-2 bg-gray-100" }) });
25541
25552
  };
25542
25553
 
25543
25554
  // src/components/ui/skeleton.tsx
@@ -25783,33 +25794,62 @@ var TableAtom = ({
25783
25794
  headers,
25784
25795
  rows,
25785
25796
  className,
25786
- style
25797
+ style,
25798
+ headerTextColor = "#9ca3af",
25799
+ headerBgColor = "#f9fafb",
25800
+ rowTextColor = "#374151",
25801
+ rowBgColor = "#ffffff",
25802
+ hoverBgColor = "#faf5ff",
25803
+ borderColor = "#f3f4f6"
25787
25804
  }) => {
25805
+ const safeHeaders = Array.isArray(headers) ? headers : [];
25806
+ const safeRows = Array.isArray(rows) ? rows : [];
25807
+ if (safeHeaders.length === 0 && safeRows.length === 0) {
25808
+ return /* @__PURE__ */ jsx35(
25809
+ "div",
25810
+ {
25811
+ className: cn("rounded-2xl border overflow-hidden p-4 text-center text-sm text-muted-foreground", className),
25812
+ style: { ...style, borderColor },
25813
+ children: "No table data"
25814
+ }
25815
+ );
25816
+ }
25788
25817
  return /* @__PURE__ */ jsx35(
25789
25818
  "div",
25790
25819
  {
25791
25820
  className: cn(
25792
- "rounded-2xl border border-gray-100 overflow-hidden bg-white",
25821
+ "rounded-2xl border overflow-hidden",
25793
25822
  className
25794
25823
  ),
25795
- style,
25824
+ style: {
25825
+ ...style,
25826
+ borderColor
25827
+ },
25796
25828
  children: /* @__PURE__ */ jsxs12(Table3, { children: [
25797
- /* @__PURE__ */ jsx35(TableHeader, { className: "bg-gray-50/50", children: /* @__PURE__ */ jsx35(TableRow, { children: headers.map((header, i) => /* @__PURE__ */ jsx35(
25829
+ /* @__PURE__ */ jsx35(TableHeader, { style: { backgroundColor: headerBgColor }, children: /* @__PURE__ */ jsx35(TableRow, { children: safeHeaders.map((header, i) => /* @__PURE__ */ jsx35(
25798
25830
  TableHead,
25799
25831
  {
25800
- className: "text-xs font-bold text-gray-400 uppercase tracking-widest px-6 py-4",
25832
+ className: "text-xs font-bold uppercase tracking-widest px-6 py-4",
25833
+ style: { color: headerTextColor },
25801
25834
  children: header
25802
25835
  },
25803
25836
  i
25804
25837
  )) }) }),
25805
- /* @__PURE__ */ jsx35(TableBody, { children: rows.map((row, i) => /* @__PURE__ */ jsx35(
25838
+ /* @__PURE__ */ jsx35(TableBody, { children: safeRows.map((row, i) => /* @__PURE__ */ jsx35(
25806
25839
  TableRow,
25807
25840
  {
25808
- className: "hover:bg-purple-50/30 transition-colors border-gray-50",
25809
- children: row.map((cell, j) => /* @__PURE__ */ jsx35(
25841
+ className: "transition-colors",
25842
+ style: {
25843
+ backgroundColor: rowBgColor,
25844
+ borderColor
25845
+ },
25846
+ onMouseEnter: (e) => e.currentTarget.style.backgroundColor = hoverBgColor,
25847
+ onMouseLeave: (e) => e.currentTarget.style.backgroundColor = rowBgColor,
25848
+ children: (Array.isArray(row) ? row : []).map((cell, j) => /* @__PURE__ */ jsx35(
25810
25849
  TableCell,
25811
25850
  {
25812
- className: "text-sm text-gray-700 px-6 py-4 font-medium",
25851
+ className: "text-sm px-6 py-4 font-medium",
25852
+ style: { color: rowTextColor },
25813
25853
  children: cell
25814
25854
  },
25815
25855
  j
@@ -26710,7 +26750,8 @@ var BreadcrumbAtom = ({
26710
26750
  import { jsx as jsx54 } from "react/jsx-runtime";
26711
26751
  var SpinnerAtom = ({
26712
26752
  size = "md",
26713
- className
26753
+ className,
26754
+ style
26714
26755
  }) => {
26715
26756
  const sizeMap = {
26716
26757
  sm: "h-4 w-4",
@@ -26718,14 +26759,21 @@ var SpinnerAtom = ({
26718
26759
  lg: "h-8 w-8",
26719
26760
  xl: "h-12 w-12"
26720
26761
  };
26762
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
26763
+ const resolvedStyle = {
26764
+ color: "var(--px-text-color, #a855f7)",
26765
+ ...style
26766
+ };
26721
26767
  return /* @__PURE__ */ jsx54(
26722
26768
  LoaderCircle,
26723
26769
  {
26724
26770
  className: cn(
26725
- "animate-spin text-purple500",
26771
+ "animate-spin",
26726
26772
  sizeMap[size] || sizeMap.md,
26727
26773
  className
26728
- )
26774
+ ),
26775
+ style: resolvedStyle,
26776
+ "data-px-styled": hasPxVars ? "" : void 0
26729
26777
  }
26730
26778
  );
26731
26779
  };
@@ -31900,51 +31948,71 @@ var FormTextareaAtom = ({
31900
31948
 
31901
31949
  // src/atoms/CheckboxAtom.tsx
31902
31950
  import { jsx as jsx65, jsxs as jsxs35 } from "react/jsx-runtime";
31903
- var CheckboxAtom = ({ id, label, checked, disabled, className, onCheckedChange }) => {
31904
- return /* @__PURE__ */ jsxs35("div", { className: cn("flex items-center space-x-2", className), children: [
31905
- /* @__PURE__ */ jsx65(
31906
- Checkbox,
31907
- {
31908
- id,
31909
- checked,
31910
- disabled,
31911
- onCheckedChange,
31912
- className: "rounded border-purple-300 text-purple-600 focus:ring-purple-500"
31913
- }
31914
- ),
31915
- label && /* @__PURE__ */ jsx65(
31916
- Label,
31917
- {
31918
- htmlFor: id,
31919
- className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",
31920
- children: label
31921
- }
31922
- )
31923
- ] });
31951
+ var CheckboxAtom = ({ id, label, checked, disabled, className, style, onCheckedChange }) => {
31952
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
31953
+ return /* @__PURE__ */ jsxs35(
31954
+ "div",
31955
+ {
31956
+ className: cn("flex items-center space-x-2", className),
31957
+ style,
31958
+ "data-px-styled": hasPxVars ? "" : void 0,
31959
+ children: [
31960
+ /* @__PURE__ */ jsx65(
31961
+ Checkbox,
31962
+ {
31963
+ id,
31964
+ checked,
31965
+ disabled,
31966
+ onCheckedChange,
31967
+ className: "rounded"
31968
+ }
31969
+ ),
31970
+ label && /* @__PURE__ */ jsx65(
31971
+ Label,
31972
+ {
31973
+ htmlFor: id,
31974
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",
31975
+ style: { color: "var(--px-label-color, inherit)" },
31976
+ children: label
31977
+ }
31978
+ )
31979
+ ]
31980
+ }
31981
+ );
31924
31982
  };
31925
31983
 
31926
31984
  // src/atoms/SwitchAtom.tsx
31927
31985
  import { jsx as jsx66, jsxs as jsxs36 } from "react/jsx-runtime";
31928
- var SwitchAtom = ({ id, label, checked, disabled, className, onCheckedChange }) => {
31929
- return /* @__PURE__ */ jsxs36("div", { className: cn("flex items-center space-x-2", className), children: [
31930
- /* @__PURE__ */ jsx66(
31931
- Switch,
31932
- {
31933
- id,
31934
- checked,
31935
- disabled,
31936
- onCheckedChange
31937
- }
31938
- ),
31939
- label && /* @__PURE__ */ jsx66(
31940
- Label,
31941
- {
31942
- htmlFor: id,
31943
- className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",
31944
- children: label
31945
- }
31946
- )
31947
- ] });
31986
+ var SwitchAtom = ({ id, label, checked, disabled, className, style, onCheckedChange }) => {
31987
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
31988
+ return /* @__PURE__ */ jsxs36(
31989
+ "div",
31990
+ {
31991
+ className: cn("flex items-center space-x-2", className),
31992
+ style,
31993
+ "data-px-styled": hasPxVars ? "" : void 0,
31994
+ children: [
31995
+ /* @__PURE__ */ jsx66(
31996
+ Switch,
31997
+ {
31998
+ id,
31999
+ checked,
32000
+ disabled,
32001
+ onCheckedChange
32002
+ }
32003
+ ),
32004
+ label && /* @__PURE__ */ jsx66(
32005
+ Label,
32006
+ {
32007
+ htmlFor: id,
32008
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",
32009
+ style: { color: "var(--px-label-color, inherit)" },
32010
+ children: label
32011
+ }
32012
+ )
32013
+ ]
32014
+ }
32015
+ );
31948
32016
  };
31949
32017
 
31950
32018
  // src/atoms/LabelAtom.tsx
@@ -31955,12 +32023,16 @@ var LabelAtom = ({
31955
32023
  className,
31956
32024
  style
31957
32025
  }) => {
32026
+ const resolvedStyle = {
32027
+ color: "var(--px-text-color, inherit)",
32028
+ ...style
32029
+ };
31958
32030
  return /* @__PURE__ */ jsx67(
31959
32031
  Label,
31960
32032
  {
31961
32033
  htmlFor,
31962
32034
  className: cn("text-sm font-semibold", className),
31963
- style,
32035
+ style: resolvedStyle,
31964
32036
  children: content
31965
32037
  }
31966
32038
  );
@@ -32045,6 +32117,7 @@ var ToggleAtom = ({
32045
32117
  style,
32046
32118
  onPressedChange
32047
32119
  }) => {
32120
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
32048
32121
  return /* @__PURE__ */ jsx70(
32049
32122
  Toggle,
32050
32123
  {
@@ -32055,6 +32128,7 @@ var ToggleAtom = ({
32055
32128
  onPressedChange,
32056
32129
  className: cn(className),
32057
32130
  style,
32131
+ "data-px-styled": hasPxVars ? "" : void 0,
32058
32132
  children: label
32059
32133
  }
32060
32134
  );
@@ -32069,18 +32143,28 @@ var SliderAtom = ({
32069
32143
  step = 1,
32070
32144
  disabled,
32071
32145
  className,
32146
+ style,
32072
32147
  onValueChange
32073
32148
  }) => {
32149
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
32074
32150
  return /* @__PURE__ */ jsx71(
32075
- Slider,
32151
+ "div",
32076
32152
  {
32077
- defaultValue,
32078
- max: max2,
32079
- min: min2,
32080
- step,
32081
- disabled,
32082
- onValueChange,
32083
- className: cn("w-full py-4", className)
32153
+ style,
32154
+ "data-px-styled": hasPxVars ? "" : void 0,
32155
+ className: "w-full py-4",
32156
+ children: /* @__PURE__ */ jsx71(
32157
+ Slider,
32158
+ {
32159
+ defaultValue,
32160
+ max: max2,
32161
+ min: min2,
32162
+ step,
32163
+ disabled,
32164
+ onValueChange,
32165
+ className: cn("w-full", className)
32166
+ }
32167
+ )
32084
32168
  }
32085
32169
  );
32086
32170
  };
@@ -32088,6 +32172,7 @@ var SliderAtom = ({
32088
32172
  // src/atoms/RadioGroupAtom.tsx
32089
32173
  import { jsx as jsx72, jsxs as jsxs38 } from "react/jsx-runtime";
32090
32174
  var RadioGroupAtom = ({ options, defaultValue, disabled, className, style, onValueChange }) => {
32175
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
32091
32176
  return /* @__PURE__ */ jsx72(
32092
32177
  RadioGroup,
32093
32178
  {
@@ -32096,6 +32181,7 @@ var RadioGroupAtom = ({ options, defaultValue, disabled, className, style, onVal
32096
32181
  onValueChange,
32097
32182
  className: cn("grid gap-2", className),
32098
32183
  style,
32184
+ "data-px-styled": hasPxVars ? "" : void 0,
32099
32185
  children: options.map((option) => /* @__PURE__ */ jsxs38("div", { className: "flex items-center space-x-2", children: [
32100
32186
  /* @__PURE__ */ jsx72(
32101
32187
  RadioGroupItem,
@@ -32122,6 +32208,7 @@ var RadioGroupAtom = ({ options, defaultValue, disabled, className, style, onVal
32122
32208
  // src/atoms/RadioAtom.tsx
32123
32209
  import { jsx as jsx73, jsxs as jsxs39 } from "react/jsx-runtime";
32124
32210
  var RadioAtom = ({ id, label, value, checked, disabled, className, style, onValueChange }) => {
32211
+ const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
32125
32212
  return /* @__PURE__ */ jsxs39(
32126
32213
  RadioGroup,
32127
32214
  {
@@ -32134,6 +32221,7 @@ var RadioAtom = ({ id, label, value, checked, disabled, className, style, onValu
32134
32221
  className
32135
32222
  ),
32136
32223
  style,
32224
+ "data-px-styled": hasPxVars ? "" : void 0,
32137
32225
  children: [
32138
32226
  /* @__PURE__ */ jsx73(
32139
32227
  RadioGroupItem,
@@ -32151,7 +32239,7 @@ var RadioAtom = ({ id, label, value, checked, disabled, className, style, onValu
32151
32239
  "cursor-pointer text-sm transition-colors",
32152
32240
  checked ? "text-primary font-semibold" : "text-muted-foreground"
32153
32241
  ),
32154
- style: { color: "inherit" },
32242
+ style: { color: "var(--px-label-color, inherit)" },
32155
32243
  children: label
32156
32244
  }
32157
32245
  )
@@ -32981,6 +33069,7 @@ import {
32981
33069
  AreaChart,
32982
33070
  Pie,
32983
33071
  PieChart,
33072
+ Cell,
32984
33073
  Radar as Radar2,
32985
33074
  RadarChart,
32986
33075
  RadialBar,
@@ -33001,9 +33090,23 @@ var ChartAtom = ({
33001
33090
  showLegend = true,
33002
33091
  stacked = false,
33003
33092
  className,
33004
- style
33093
+ style,
33094
+ // Chart color customization props
33095
+ seriesColors
33005
33096
  }) => {
33006
- const safeConfig = config ?? {};
33097
+ const buildConfigWithColors = (baseConfig) => {
33098
+ if (!seriesColors) return baseConfig;
33099
+ const coloredConfig = {};
33100
+ const seriesKeys = Object.keys(baseConfig);
33101
+ seriesKeys.forEach((key, index) => {
33102
+ coloredConfig[key] = {
33103
+ ...baseConfig[key],
33104
+ color: seriesColors[index] || baseConfig[key]?.color
33105
+ };
33106
+ });
33107
+ return coloredConfig;
33108
+ };
33109
+ const safeConfig = config ? buildConfigWithColors(config) : {};
33007
33110
  const renderChart = () => {
33008
33111
  switch (chartType) {
33009
33112
  case "bar":
@@ -33095,7 +33198,14 @@ var ChartAtom = ({
33095
33198
  dataKey: YAxisKey || "value",
33096
33199
  nameKey: XAxisKey || "name",
33097
33200
  innerRadius: 60,
33098
- strokeWidth: 5
33201
+ strokeWidth: 5,
33202
+ children: data.map((_, index) => /* @__PURE__ */ jsx85(
33203
+ Cell,
33204
+ {
33205
+ fill: seriesColors?.[index] || `var(--color-${Object.keys(safeConfig)[index] || "default"})`
33206
+ },
33207
+ `cell-${index}`
33208
+ ))
33099
33209
  }
33100
33210
  )
33101
33211
  ] });
@@ -33130,7 +33240,15 @@ var ChartAtom = ({
33130
33240
  content: /* @__PURE__ */ jsx85(ChartTooltipContent, { hideLabel: true, nameKey: XAxisKey })
33131
33241
  }
33132
33242
  ),
33133
- /* @__PURE__ */ jsx85(RadialBar, { dataKey: YAxisKey || "value", background: true })
33243
+ Object.keys(safeConfig).map((key, idx) => /* @__PURE__ */ jsx85(
33244
+ RadialBar,
33245
+ {
33246
+ dataKey: key,
33247
+ fill: seriesColors?.[idx] || `var(--color-${key})`,
33248
+ background: true
33249
+ },
33250
+ key
33251
+ ))
33134
33252
  ]
33135
33253
  }
33136
33254
  );