pxengine 0.1.56 → 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.d.cts CHANGED
@@ -326,6 +326,12 @@ interface TableAtomType extends BaseAtom {
326
326
  type: "table";
327
327
  headers: string[];
328
328
  rows: any[][];
329
+ headerTextColor?: string;
330
+ headerBgColor?: string;
331
+ rowTextColor?: string;
332
+ rowBgColor?: string;
333
+ hoverBgColor?: string;
334
+ borderColor?: string;
329
335
  }
330
336
  interface CarouselAtomType extends BaseAtom {
331
337
  type: "carousel";
@@ -492,6 +498,7 @@ interface ChartAtomType extends BaseAtom {
492
498
  showTooltip?: boolean;
493
499
  showLegend?: boolean;
494
500
  stacked?: boolean;
501
+ seriesColors?: string[];
495
502
  }
496
503
  type UIAtom = ButtonAtomType | InputAtomType | ToggleAtomType | TextAtomType | LayoutAtomType | CardAtomType | TabsAtomType | AccordionAtomType | SeparatorAtomType | ScrollAreaAtomType | AspectRatioAtomType | CollapsibleAtomType | AvatarAtomType | BadgeAtomType | ProgressAtomType | TableAtomType | CarouselAtomType | AlertAtomType | TooltipAtomType | PopoverAtomType | DialogAtomType | SheetAtomType | AlertDialogAtomType | SkeletonAtomType | SpinnerAtomType | BreadcrumbAtomType | CalendarAtomType | PaginationAtomType | CommandAtomType | FormInputAtomType | FormSelectAtomType | FormTextareaAtomType | CheckboxAtomType | SwitchAtomType | LabelAtomType | SliderAtomType | RadioGroupAtomType | RadioAtomType | DropdownMenuAtomType | ContextMenuAtomType | DrawerAtomType | InputOTPAtomType | KbdAtomType | ResizableAtomType | RatingAtomType | TimelineAtomType | VideoAtomType | ChartAtomType | IconAtomType | ArrowToggleAtomType;
497
504
 
package/dist/index.d.ts CHANGED
@@ -326,6 +326,12 @@ interface TableAtomType extends BaseAtom {
326
326
  type: "table";
327
327
  headers: string[];
328
328
  rows: any[][];
329
+ headerTextColor?: string;
330
+ headerBgColor?: string;
331
+ rowTextColor?: string;
332
+ rowBgColor?: string;
333
+ hoverBgColor?: string;
334
+ borderColor?: string;
329
335
  }
330
336
  interface CarouselAtomType extends BaseAtom {
331
337
  type: "carousel";
@@ -492,6 +498,7 @@ interface ChartAtomType extends BaseAtom {
492
498
  showTooltip?: boolean;
493
499
  showLegend?: boolean;
494
500
  stacked?: boolean;
501
+ seriesColors?: string[];
495
502
  }
496
503
  type UIAtom = ButtonAtomType | InputAtomType | ToggleAtomType | TextAtomType | LayoutAtomType | CardAtomType | TabsAtomType | AccordionAtomType | SeparatorAtomType | ScrollAreaAtomType | AspectRatioAtomType | CollapsibleAtomType | AvatarAtomType | BadgeAtomType | ProgressAtomType | TableAtomType | CarouselAtomType | AlertAtomType | TooltipAtomType | PopoverAtomType | DialogAtomType | SheetAtomType | AlertDialogAtomType | SkeletonAtomType | SpinnerAtomType | BreadcrumbAtomType | CalendarAtomType | PaginationAtomType | CommandAtomType | FormInputAtomType | FormSelectAtomType | FormTextareaAtomType | CheckboxAtomType | SwitchAtomType | LabelAtomType | SliderAtomType | RadioGroupAtomType | RadioAtomType | DropdownMenuAtomType | ContextMenuAtomType | DrawerAtomType | InputOTPAtomType | KbdAtomType | ResizableAtomType | RatingAtomType | TimelineAtomType | VideoAtomType | ChartAtomType | IconAtomType | ArrowToggleAtomType;
497
504
 
package/dist/index.mjs CHANGED
@@ -25794,33 +25794,62 @@ var TableAtom = ({
25794
25794
  headers,
25795
25795
  rows,
25796
25796
  className,
25797
- style
25797
+ style,
25798
+ headerTextColor = "#9ca3af",
25799
+ headerBgColor = "#f9fafb",
25800
+ rowTextColor = "#374151",
25801
+ rowBgColor = "#ffffff",
25802
+ hoverBgColor = "#faf5ff",
25803
+ borderColor = "#f3f4f6"
25798
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
+ }
25799
25817
  return /* @__PURE__ */ jsx35(
25800
25818
  "div",
25801
25819
  {
25802
25820
  className: cn(
25803
- "rounded-2xl border border-gray-100 overflow-hidden bg-white",
25821
+ "rounded-2xl border overflow-hidden",
25804
25822
  className
25805
25823
  ),
25806
- style,
25824
+ style: {
25825
+ ...style,
25826
+ borderColor
25827
+ },
25807
25828
  children: /* @__PURE__ */ jsxs12(Table3, { children: [
25808
- /* @__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(
25809
25830
  TableHead,
25810
25831
  {
25811
- 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 },
25812
25834
  children: header
25813
25835
  },
25814
25836
  i
25815
25837
  )) }) }),
25816
- /* @__PURE__ */ jsx35(TableBody, { children: rows.map((row, i) => /* @__PURE__ */ jsx35(
25838
+ /* @__PURE__ */ jsx35(TableBody, { children: safeRows.map((row, i) => /* @__PURE__ */ jsx35(
25817
25839
  TableRow,
25818
25840
  {
25819
- className: "hover:bg-purple-50/30 transition-colors border-gray-50",
25820
- 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(
25821
25849
  TableCell,
25822
25850
  {
25823
- 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 },
25824
25853
  children: cell
25825
25854
  },
25826
25855
  j
@@ -33040,6 +33069,7 @@ import {
33040
33069
  AreaChart,
33041
33070
  Pie,
33042
33071
  PieChart,
33072
+ Cell,
33043
33073
  Radar as Radar2,
33044
33074
  RadarChart,
33045
33075
  RadialBar,
@@ -33060,9 +33090,23 @@ var ChartAtom = ({
33060
33090
  showLegend = true,
33061
33091
  stacked = false,
33062
33092
  className,
33063
- style
33093
+ style,
33094
+ // Chart color customization props
33095
+ seriesColors
33064
33096
  }) => {
33065
- 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) : {};
33066
33110
  const renderChart = () => {
33067
33111
  switch (chartType) {
33068
33112
  case "bar":
@@ -33154,7 +33198,14 @@ var ChartAtom = ({
33154
33198
  dataKey: YAxisKey || "value",
33155
33199
  nameKey: XAxisKey || "name",
33156
33200
  innerRadius: 60,
33157
- 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
+ ))
33158
33209
  }
33159
33210
  )
33160
33211
  ] });
@@ -33189,7 +33240,15 @@ var ChartAtom = ({
33189
33240
  content: /* @__PURE__ */ jsx85(ChartTooltipContent, { hideLabel: true, nameKey: XAxisKey })
33190
33241
  }
33191
33242
  ),
33192
- /* @__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
+ ))
33193
33252
  ]
33194
33253
  }
33195
33254
  );