pxengine 0.1.11 → 0.1.13
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.cjs +205 -120
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +205 -120
- package/dist/registry.json +1200 -288
- package/package.json +9 -4
- package/config/tailwind-preset.js +0 -106
- package/src/atoms/AccordionAtom.tsx +0 -44
- package/src/atoms/AlertAtom.tsx +0 -46
- package/src/atoms/AlertDialogAtom.tsx +0 -66
- package/src/atoms/AspectRatioAtom.tsx +0 -27
- package/src/atoms/AvatarAtom.tsx +0 -20
- package/src/atoms/BadgeAtom.tsx +0 -33
- package/src/atoms/BreadcrumbAtom.tsx +0 -36
- package/src/atoms/ButtonAtom.tsx +0 -63
- package/src/atoms/CalendarAtom.tsx +0 -24
- package/src/atoms/CardAtom.tsx +0 -64
- package/src/atoms/CarouselAtom.tsx +0 -40
- package/src/atoms/ChartAtom.tsx +0 -190
- package/src/atoms/CheckboxAtom.tsx +0 -33
- package/src/atoms/CollapsibleAtom.tsx +0 -44
- package/src/atoms/CommandAtom.tsx +0 -46
- package/src/atoms/ContextMenuAtom.tsx +0 -49
- package/src/atoms/DialogAtom.tsx +0 -68
- package/src/atoms/DrawerAtom.tsx +0 -49
- package/src/atoms/DropdownMenuAtom.tsx +0 -49
- package/src/atoms/FormInputAtom.tsx +0 -101
- package/src/atoms/FormSelectAtom.tsx +0 -110
- package/src/atoms/FormTextareaAtom.tsx +0 -93
- package/src/atoms/InputAtom.tsx +0 -188
- package/src/atoms/InputOTPAtom.tsx +0 -49
- package/src/atoms/KbdAtom.tsx +0 -25
- package/src/atoms/LabelAtom.tsx +0 -23
- package/src/atoms/LayoutAtom.tsx +0 -45
- package/src/atoms/PaginationAtom.tsx +0 -49
- package/src/atoms/PopoverAtom.tsx +0 -40
- package/src/atoms/ProgressAtom.tsx +0 -15
- package/src/atoms/RadioGroupAtom.tsx +0 -31
- package/src/atoms/RatingAtom.tsx +0 -37
- package/src/atoms/ResizableAtom.tsx +0 -51
- package/src/atoms/ScrollAreaAtom.tsx +0 -31
- package/src/atoms/SeparatorAtom.tsx +0 -16
- package/src/atoms/SheetAtom.tsx +0 -72
- package/src/atoms/SkeletonAtom.tsx +0 -22
- package/src/atoms/SliderAtom.tsx +0 -32
- package/src/atoms/SpinnerAtom.tsx +0 -26
- package/src/atoms/SwitchAtom.tsx +0 -32
- package/src/atoms/TableAtom.tsx +0 -58
- package/src/atoms/TabsAtom.tsx +0 -40
- package/src/atoms/TextAtom.tsx +0 -35
- package/src/atoms/TextareaAtom.tsx +0 -42
- package/src/atoms/TimelineAtom.tsx +0 -77
- package/src/atoms/ToggleAtom.tsx +0 -36
- package/src/atoms/TooltipAtom.tsx +0 -39
- package/src/atoms/VideoAtom.tsx +0 -34
- package/src/atoms/index.ts +0 -49
- package/src/components/index.ts +0 -178
- package/src/components/ui/accordion.tsx +0 -56
- package/src/components/ui/alert-dialog.tsx +0 -139
- package/src/components/ui/alert.tsx +0 -59
- package/src/components/ui/aspect-ratio.tsx +0 -5
- package/src/components/ui/avatar.tsx +0 -50
- package/src/components/ui/badge.tsx +0 -36
- package/src/components/ui/breadcrumb.tsx +0 -115
- package/src/components/ui/button-group.tsx +0 -83
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/calendar.tsx +0 -213
- package/src/components/ui/card.tsx +0 -79
- package/src/components/ui/carousel.tsx +0 -260
- package/src/components/ui/chart.tsx +0 -367
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/collapsible.tsx +0 -11
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/context-menu.tsx +0 -198
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/drawer.tsx +0 -116
- package/src/components/ui/dropdown-menu.tsx +0 -200
- package/src/components/ui/empty.tsx +0 -104
- package/src/components/ui/field.tsx +0 -244
- package/src/components/ui/form.tsx +0 -176
- package/src/components/ui/hover-card.tsx +0 -27
- package/src/components/ui/index.ts +0 -54
- package/src/components/ui/input-group.tsx +0 -168
- package/src/components/ui/input-otp.tsx +0 -69
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/item.tsx +0 -193
- package/src/components/ui/kbd.tsx +0 -28
- package/src/components/ui/label.tsx +0 -26
- package/src/components/ui/menubar.tsx +0 -254
- package/src/components/ui/navigation-menu.tsx +0 -128
- package/src/components/ui/pagination.tsx +0 -117
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/progress.tsx +0 -28
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/resizable.tsx +0 -44
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -160
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/sheet.tsx +0 -140
- package/src/components/ui/sidebar.tsx +0 -771
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/slider.tsx +0 -26
- package/src/components/ui/sonner.tsx +0 -45
- package/src/components/ui/spinner.tsx +0 -16
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -117
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle-group.tsx +0 -61
- package/src/components/ui/toggle.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -30
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/index.ts +0 -24
- package/src/lib/countries.ts +0 -203
- package/src/lib/index.ts +0 -2
- package/src/lib/utils.ts +0 -15
- package/src/lib/validators/index.ts +0 -1
- package/src/lib/validators/theme.ts +0 -148
- package/src/molecules/creator-discovery/AudienceDemographicsCard/AudienceDemographicsCard.tsx +0 -44
- package/src/molecules/creator-discovery/AudienceDemographicsCard/index.ts +0 -1
- package/src/molecules/creator-discovery/AudienceMetricCard/AudienceMetricCard.tsx +0 -50
- package/src/molecules/creator-discovery/AudienceMetricCard/index.ts +0 -1
- package/src/molecules/creator-discovery/BrandAffinityGroup/BrandAffinityGroup.tsx +0 -36
- package/src/molecules/creator-discovery/BrandAffinityGroup/index.ts +0 -1
- package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx +0 -123
- package/src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.types.ts +0 -13
- package/src/molecules/creator-discovery/CampaignSeedCard/index.ts +0 -2
- package/src/molecules/creator-discovery/ContentPreviewGallery/ContentPreviewGallery.tsx +0 -41
- package/src/molecules/creator-discovery/ContentPreviewGallery/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorActionHeader/CreatorActionHeader.tsx +0 -77
- package/src/molecules/creator-discovery/CreatorActionHeader/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorGridCard/CreatorGridCard.tsx +0 -104
- package/src/molecules/creator-discovery/CreatorGridCard/index.ts +0 -1
- package/src/molecules/creator-discovery/CreatorProfileSummary/CreatorProfileSummary.tsx +0 -65
- package/src/molecules/creator-discovery/CreatorProfileSummary/index.ts +0 -1
- package/src/molecules/creator-discovery/GrowthChartCard/GrowthChartCard.tsx +0 -58
- package/src/molecules/creator-discovery/GrowthChartCard/index.ts +0 -1
- package/src/molecules/creator-discovery/MCQCard/MCQCard.tsx +0 -165
- package/src/molecules/creator-discovery/MCQCard/MCQCard.types.ts +0 -71
- package/src/molecules/creator-discovery/MCQCard/index.ts +0 -2
- package/src/molecules/creator-discovery/PlatformIconGroup/PlatformIconGroup.tsx +0 -72
- package/src/molecules/creator-discovery/PlatformIconGroup/index.ts +0 -1
- package/src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx +0 -334
- package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx +0 -111
- package/src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.types.ts +0 -18
- package/src/molecules/creator-discovery/SearchSpecCard/index.ts +0 -3
- package/src/molecules/creator-discovery/TopPostsGrid/TopPostsGrid.tsx +0 -49
- package/src/molecules/creator-discovery/TopPostsGrid/index.ts +0 -1
- package/src/molecules/creator-discovery/index.ts +0 -13
- package/src/molecules/generic/ActionButton/ActionButton.tsx +0 -137
- package/src/molecules/generic/ActionButton/ActionButton.types.ts +0 -68
- package/src/molecules/generic/ActionButton/index.ts +0 -2
- package/src/molecules/generic/DataGrid/DataGrid.tsx +0 -102
- package/src/molecules/generic/DataGrid/index.ts +0 -1
- package/src/molecules/generic/EditableField/EditableField.tsx +0 -229
- package/src/molecules/generic/EditableField/EditableField.types.ts +0 -73
- package/src/molecules/generic/EditableField/index.ts +0 -2
- package/src/molecules/generic/EmptyState/EmptyState.tsx +0 -61
- package/src/molecules/generic/EmptyState/index.ts +0 -1
- package/src/molecules/generic/FileUpload/FileUpload.tsx +0 -62
- package/src/molecules/generic/FileUpload/index.ts +0 -1
- package/src/molecules/generic/FilterBar/FilterBar.tsx +0 -54
- package/src/molecules/generic/FilterBar/index.ts +0 -1
- package/src/molecules/generic/FormCard/FormCard.tsx +0 -136
- package/src/molecules/generic/FormCard/FormCard.types.ts +0 -93
- package/src/molecules/generic/FormCard/index.ts +0 -2
- package/src/molecules/generic/LoadingOverlay/LoadingOverlay.tsx +0 -39
- package/src/molecules/generic/LoadingOverlay/index.ts +0 -1
- package/src/molecules/generic/NotificationList/NotificationList.tsx +0 -80
- package/src/molecules/generic/NotificationList/index.ts +0 -1
- package/src/molecules/generic/StatsGrid/StatsGrid.tsx +0 -80
- package/src/molecules/generic/StatsGrid/index.ts +0 -1
- package/src/molecules/generic/StepWizard/StepWizard.tsx +0 -67
- package/src/molecules/generic/StepWizard/index.ts +0 -1
- package/src/molecules/generic/TagCloud/TagCloud.tsx +0 -32
- package/src/molecules/generic/TagCloud/index.ts +0 -1
- package/src/molecules/generic/index.ts +0 -12
- package/src/molecules/index.ts +0 -2
- package/src/render/PXEngineRenderer.tsx +0 -416
- package/src/render/index.ts +0 -1
- package/src/styles/globals.css +0 -146
- package/src/types/atoms.ts +0 -449
- package/src/types/common.ts +0 -116
- package/src/types/index.ts +0 -3
- package/src/types/molecules.ts +0 -279
- package/src/types/schema.ts +0 -12
package/dist/index.cjs
CHANGED
|
@@ -31808,7 +31808,8 @@ var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
|
31808
31808
|
var TextAtom = ({
|
|
31809
31809
|
content,
|
|
31810
31810
|
variant = "p",
|
|
31811
|
-
className
|
|
31811
|
+
className,
|
|
31812
|
+
style
|
|
31812
31813
|
}) => {
|
|
31813
31814
|
const baseStyles = {
|
|
31814
31815
|
h1: "scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl text-gray900",
|
|
@@ -31821,7 +31822,7 @@ var TextAtom = ({
|
|
|
31821
31822
|
label: "text-[10px] font-bold text-gray400 uppercase tracking-widest pl-1"
|
|
31822
31823
|
};
|
|
31823
31824
|
const Component2 = variant === "small" || variant === "muted" || variant === "label" ? "p" : variant;
|
|
31824
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Component2, { className: cn(baseStyles[variant], className), children: content });
|
|
31825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Component2, { className: cn(baseStyles[variant], className), style, children: content });
|
|
31825
31826
|
};
|
|
31826
31827
|
|
|
31827
31828
|
// src/atoms/ButtonAtom.tsx
|
|
@@ -31834,7 +31835,8 @@ var ButtonAtom = ({
|
|
|
31834
31835
|
disabled = false,
|
|
31835
31836
|
isLoading = false,
|
|
31836
31837
|
onAction,
|
|
31837
|
-
className
|
|
31838
|
+
className,
|
|
31839
|
+
style
|
|
31838
31840
|
}) => {
|
|
31839
31841
|
const handleClick = (e) => {
|
|
31840
31842
|
e.preventDefault();
|
|
@@ -31857,6 +31859,7 @@ var ButtonAtom = ({
|
|
|
31857
31859
|
disabled: disabled || isLoading,
|
|
31858
31860
|
onClick: handleClick,
|
|
31859
31861
|
className: cn("rounded-full font-semibold", customClass, className),
|
|
31862
|
+
style,
|
|
31860
31863
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
31861
31864
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
31862
31865
|
label
|
|
@@ -31901,6 +31904,7 @@ var CardAtom = ({
|
|
|
31901
31904
|
children,
|
|
31902
31905
|
footer,
|
|
31903
31906
|
className,
|
|
31907
|
+
style,
|
|
31904
31908
|
renderComponent
|
|
31905
31909
|
}) => {
|
|
31906
31910
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
@@ -31910,6 +31914,7 @@ var CardAtom = ({
|
|
|
31910
31914
|
"rounded-[32px] border border-border/50 bg-card/80 text-card-foreground shadow-[0_8px_30px_rgb(0,0,0,0.04)] overflow-hidden backdrop-blur-xl ring-1 ring-border/5",
|
|
31911
31915
|
className
|
|
31912
31916
|
),
|
|
31917
|
+
style,
|
|
31913
31918
|
children: [
|
|
31914
31919
|
(title || description) && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(CardHeader, { children: [
|
|
31915
31920
|
title && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CardTitle, { className: "text-xl font-bold text-gray900", children: title }),
|
|
@@ -31933,7 +31938,8 @@ var InputAtom = ({
|
|
|
31933
31938
|
disabled,
|
|
31934
31939
|
options,
|
|
31935
31940
|
config,
|
|
31936
|
-
className
|
|
31941
|
+
className,
|
|
31942
|
+
style
|
|
31937
31943
|
}) => {
|
|
31938
31944
|
const containerClass = cn("flex flex-col gap-2 w-full", className);
|
|
31939
31945
|
const renderLabel = () => {
|
|
@@ -31945,82 +31951,116 @@ var InputAtom = ({
|
|
|
31945
31951
|
] });
|
|
31946
31952
|
};
|
|
31947
31953
|
const renderInput = () => {
|
|
31954
|
+
const commonProps = {
|
|
31955
|
+
placeholder,
|
|
31956
|
+
value: defaultValue,
|
|
31957
|
+
disabled,
|
|
31958
|
+
required,
|
|
31959
|
+
readOnly: true,
|
|
31960
|
+
className: cn(
|
|
31961
|
+
"rounded-xl border-border bg-background focus:ring-primary shadow-sm",
|
|
31962
|
+
className
|
|
31963
|
+
),
|
|
31964
|
+
style
|
|
31965
|
+
};
|
|
31948
31966
|
switch (inputType) {
|
|
31949
31967
|
case "textarea":
|
|
31950
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
31951
|
-
Textarea,
|
|
31952
|
-
{
|
|
31953
|
-
className: "rounded-xl border-border bg-background focus:ring-primary shadow-sm",
|
|
31954
|
-
placeholder,
|
|
31955
|
-
defaultValue,
|
|
31956
|
-
disabled,
|
|
31957
|
-
rows: config?.rows || 3
|
|
31958
|
-
}
|
|
31959
|
-
);
|
|
31968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Textarea, { ...commonProps, rows: config?.rows || 3 });
|
|
31960
31969
|
case "select":
|
|
31961
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Select, { defaultValue, disabled, children: [
|
|
31962
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
31970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Select, { value: defaultValue, disabled, children: [
|
|
31971
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
31972
|
+
SelectTrigger,
|
|
31973
|
+
{
|
|
31974
|
+
className: cn(
|
|
31975
|
+
"rounded-xl border-border bg-background shadow-sm",
|
|
31976
|
+
className
|
|
31977
|
+
),
|
|
31978
|
+
style,
|
|
31979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectValue, { placeholder: placeholder || "Select option" })
|
|
31980
|
+
}
|
|
31981
|
+
),
|
|
31963
31982
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectContent, { className: "rounded-xl border-border shadow-xl", children: options?.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
|
|
31964
31983
|
] });
|
|
31965
31984
|
case "slider":
|
|
31966
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "pt-2 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
31985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "pt-2 pb-1", style, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
31967
31986
|
Slider,
|
|
31968
31987
|
{
|
|
31969
|
-
|
|
31988
|
+
value: [defaultValue || config?.min || 0],
|
|
31970
31989
|
max: config?.max || 100,
|
|
31971
31990
|
min: config?.min || 0,
|
|
31972
31991
|
step: config?.step || 1,
|
|
31973
31992
|
disabled,
|
|
31974
|
-
className: "py-4"
|
|
31993
|
+
className: cn("py-4", className)
|
|
31975
31994
|
}
|
|
31976
31995
|
) });
|
|
31977
31996
|
case "checkbox":
|
|
31978
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
31979
|
-
|
|
31980
|
-
|
|
31981
|
-
|
|
31982
|
-
|
|
31983
|
-
|
|
31984
|
-
|
|
31985
|
-
|
|
31986
|
-
|
|
31987
|
-
|
|
31988
|
-
|
|
31989
|
-
|
|
31990
|
-
|
|
31991
|
-
|
|
31992
|
-
|
|
31993
|
-
|
|
31994
|
-
|
|
31995
|
-
|
|
31996
|
-
|
|
31997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
31998
|
+
"div",
|
|
31999
|
+
{
|
|
32000
|
+
className: cn(
|
|
32001
|
+
"flex items-center space-x-3 py-1.5 px-0.5 group cursor-pointer",
|
|
32002
|
+
className
|
|
32003
|
+
),
|
|
32004
|
+
style,
|
|
32005
|
+
children: [
|
|
32006
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32007
|
+
Checkbox,
|
|
32008
|
+
{
|
|
32009
|
+
id: label,
|
|
32010
|
+
checked: defaultValue,
|
|
32011
|
+
disabled,
|
|
32012
|
+
className: "rounded-[6px] border-border data-[state=checked]:bg-primary shadow-sm"
|
|
32013
|
+
}
|
|
32014
|
+
),
|
|
32015
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32016
|
+
"label",
|
|
32017
|
+
{
|
|
32018
|
+
htmlFor: label,
|
|
32019
|
+
className: "text-sm font-medium leading-none cursor-pointer text-foreground/90 group-hover:text-foreground transition-colors",
|
|
32020
|
+
children: label
|
|
32021
|
+
}
|
|
32022
|
+
)
|
|
32023
|
+
]
|
|
32024
|
+
}
|
|
32025
|
+
);
|
|
31997
32026
|
case "switch":
|
|
31998
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
31999
|
-
|
|
32000
|
-
|
|
32001
|
-
|
|
32002
|
-
|
|
32003
|
-
className
|
|
32004
|
-
|
|
32005
|
-
|
|
32006
|
-
|
|
32007
|
-
|
|
32008
|
-
|
|
32009
|
-
|
|
32010
|
-
|
|
32011
|
-
|
|
32012
|
-
|
|
32013
|
-
|
|
32014
|
-
|
|
32015
|
-
|
|
32016
|
-
|
|
32027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
32028
|
+
"div",
|
|
32029
|
+
{
|
|
32030
|
+
className: cn(
|
|
32031
|
+
"flex items-center justify-between py-1.5 px-0.5",
|
|
32032
|
+
className
|
|
32033
|
+
),
|
|
32034
|
+
style,
|
|
32035
|
+
children: [
|
|
32036
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32037
|
+
Label,
|
|
32038
|
+
{
|
|
32039
|
+
htmlFor: label,
|
|
32040
|
+
className: "cursor-pointer text-foreground/90",
|
|
32041
|
+
children: label
|
|
32042
|
+
}
|
|
32043
|
+
),
|
|
32044
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32045
|
+
Switch,
|
|
32046
|
+
{
|
|
32047
|
+
id: label,
|
|
32048
|
+
checked: defaultValue,
|
|
32049
|
+
disabled,
|
|
32050
|
+
className: "data-[state=checked]:bg-primary shadow-sm"
|
|
32051
|
+
}
|
|
32052
|
+
)
|
|
32053
|
+
]
|
|
32054
|
+
}
|
|
32055
|
+
);
|
|
32017
32056
|
case "radio":
|
|
32018
32057
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32019
32058
|
RadioGroup,
|
|
32020
32059
|
{
|
|
32021
|
-
defaultValue,
|
|
32060
|
+
value: defaultValue,
|
|
32022
32061
|
disabled,
|
|
32023
|
-
className: "gap-2.5",
|
|
32062
|
+
className: cn("gap-2.5", className),
|
|
32063
|
+
style,
|
|
32024
32064
|
children: options?.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
32025
32065
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32026
32066
|
RadioGroupItem,
|
|
@@ -32042,37 +32082,44 @@ var InputAtom = ({
|
|
|
32042
32082
|
}
|
|
32043
32083
|
);
|
|
32044
32084
|
case "otp":
|
|
32045
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32046
|
-
|
|
32085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32086
|
+
"div",
|
|
32047
32087
|
{
|
|
32048
|
-
|
|
32049
|
-
|
|
32050
|
-
|
|
32051
|
-
|
|
32052
|
-
InputOTPSlot,
|
|
32088
|
+
className: cn("flex justify-center py-2", className),
|
|
32089
|
+
style,
|
|
32090
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32091
|
+
InputOTP,
|
|
32053
32092
|
{
|
|
32054
|
-
|
|
32055
|
-
|
|
32056
|
-
|
|
32057
|
-
|
|
32058
|
-
|
|
32093
|
+
maxLength: config?.maxLength || 6,
|
|
32094
|
+
disabled,
|
|
32095
|
+
value: defaultValue,
|
|
32096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(InputOTPGroup, { className: "gap-2", children: Array.from({ length: config?.maxLength || 6 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32097
|
+
InputOTPSlot,
|
|
32098
|
+
{
|
|
32099
|
+
index: i,
|
|
32100
|
+
className: "rounded-xl border border-border bg-background shadow-sm"
|
|
32101
|
+
},
|
|
32102
|
+
i
|
|
32103
|
+
)) })
|
|
32104
|
+
}
|
|
32105
|
+
)
|
|
32059
32106
|
}
|
|
32060
|
-
)
|
|
32107
|
+
);
|
|
32061
32108
|
default:
|
|
32062
32109
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
32063
32110
|
Input,
|
|
32064
32111
|
{
|
|
32112
|
+
...commonProps,
|
|
32065
32113
|
type: inputType,
|
|
32066
|
-
|
|
32067
|
-
|
|
32068
|
-
|
|
32069
|
-
|
|
32070
|
-
className: "rounded-xl border-border bg-background focus:ring-primary shadow-sm h-11"
|
|
32114
|
+
className: cn(
|
|
32115
|
+
"rounded-xl border-border bg-background focus:ring-primary shadow-sm h-11",
|
|
32116
|
+
className
|
|
32117
|
+
)
|
|
32071
32118
|
}
|
|
32072
32119
|
);
|
|
32073
32120
|
}
|
|
32074
32121
|
};
|
|
32075
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: containerClass, children: [
|
|
32122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: containerClass, style, children: [
|
|
32076
32123
|
inputType !== "checkbox" && inputType !== "switch" && renderLabel(),
|
|
32077
32124
|
renderInput()
|
|
32078
32125
|
] });
|
|
@@ -32083,7 +32130,8 @@ var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
|
32083
32130
|
var BadgeAtom = ({
|
|
32084
32131
|
label,
|
|
32085
32132
|
variant = "default",
|
|
32086
|
-
className
|
|
32133
|
+
className,
|
|
32134
|
+
style
|
|
32087
32135
|
}) => {
|
|
32088
32136
|
const customVariants = {
|
|
32089
32137
|
purple: "bg-primary/10 text-primary border-primary/20 hover:bg-primary/20",
|
|
@@ -32101,6 +32149,7 @@ var BadgeAtom = ({
|
|
|
32101
32149
|
customClass,
|
|
32102
32150
|
className
|
|
32103
32151
|
),
|
|
32152
|
+
style,
|
|
32104
32153
|
children: label
|
|
32105
32154
|
}
|
|
32106
32155
|
);
|
|
@@ -32112,9 +32161,10 @@ var AvatarAtom = ({
|
|
|
32112
32161
|
src,
|
|
32113
32162
|
fallback,
|
|
32114
32163
|
alt,
|
|
32115
|
-
className
|
|
32164
|
+
className,
|
|
32165
|
+
style
|
|
32116
32166
|
}) => {
|
|
32117
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Avatar, { className: cn("h-10 w-10", className), children: [
|
|
32167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Avatar, { className: cn("h-10 w-10", className), style, children: [
|
|
32118
32168
|
src && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AvatarImage, { src, alt }),
|
|
32119
32169
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AvatarFallback, { className: "bg-purple50 text-purple600 font-bold uppercase", children: fallback })
|
|
32120
32170
|
] });
|
|
@@ -32201,7 +32251,8 @@ var AlertAtom = ({
|
|
|
32201
32251
|
title,
|
|
32202
32252
|
description,
|
|
32203
32253
|
variant = "default",
|
|
32204
|
-
className
|
|
32254
|
+
className,
|
|
32255
|
+
style
|
|
32205
32256
|
}) => {
|
|
32206
32257
|
const IconMap = {
|
|
32207
32258
|
default: Info,
|
|
@@ -32223,6 +32274,7 @@ var AlertAtom = ({
|
|
|
32223
32274
|
{
|
|
32224
32275
|
variant: shadcnVariant,
|
|
32225
32276
|
className: cn("rounded-2xl", customClass, className),
|
|
32277
|
+
style,
|
|
32226
32278
|
children: [
|
|
32227
32279
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon3, { className: "h-4 w-4" }),
|
|
32228
32280
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AlertTitle, { className: "font-bold", children: title }),
|
|
@@ -32252,7 +32304,8 @@ var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
|
32252
32304
|
var TableAtom = ({
|
|
32253
32305
|
headers,
|
|
32254
32306
|
rows,
|
|
32255
|
-
className
|
|
32307
|
+
className,
|
|
32308
|
+
style
|
|
32256
32309
|
}) => {
|
|
32257
32310
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
32258
32311
|
"div",
|
|
@@ -32261,6 +32314,7 @@ var TableAtom = ({
|
|
|
32261
32314
|
"rounded-2xl border border-gray-100 overflow-hidden bg-white",
|
|
32262
32315
|
className
|
|
32263
32316
|
),
|
|
32317
|
+
style,
|
|
32264
32318
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Table3, { children: [
|
|
32265
32319
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TableHeader, { className: "bg-gray-50/50", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TableRow, { children: headers.map((header, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
32266
32320
|
TableHead,
|
|
@@ -33357,7 +33411,8 @@ var ChartAtom = ({
|
|
|
33357
33411
|
showTooltip = true,
|
|
33358
33412
|
showLegend = true,
|
|
33359
33413
|
stacked = false,
|
|
33360
|
-
className
|
|
33414
|
+
className,
|
|
33415
|
+
style
|
|
33361
33416
|
}) => {
|
|
33362
33417
|
const renderChart = () => {
|
|
33363
33418
|
switch (chartType) {
|
|
@@ -33498,6 +33553,7 @@ var ChartAtom = ({
|
|
|
33498
33553
|
{
|
|
33499
33554
|
config,
|
|
33500
33555
|
className: cn("min-h-[200px] w-full", className),
|
|
33556
|
+
style,
|
|
33501
33557
|
children: renderChart()
|
|
33502
33558
|
}
|
|
33503
33559
|
);
|
|
@@ -37514,7 +37570,50 @@ var renderNotFoundError = (componentName, key) => {
|
|
|
37514
37570
|
};
|
|
37515
37571
|
var normalizeProps = (props) => {
|
|
37516
37572
|
const normalized = {};
|
|
37573
|
+
const dynamicStyle = {};
|
|
37517
37574
|
Object.entries(props).forEach(([key, value]) => {
|
|
37575
|
+
if (key === "className" && typeof value === "string") {
|
|
37576
|
+
const classes = value.match(/(?:[^\s\[]|\[[^\]]*\])+/g) || [];
|
|
37577
|
+
classes.forEach((cls) => {
|
|
37578
|
+
const hexMatch = cls.match(
|
|
37579
|
+
/^(bg|text|border)-\[#([0-9a-fA-F]{3,6})(?:\/(\d+))?\]$/
|
|
37580
|
+
);
|
|
37581
|
+
if (hexMatch) {
|
|
37582
|
+
const [, type, hex, opacity] = hexMatch;
|
|
37583
|
+
const color = `#${hex}${opacity ? Math.round(parseInt(opacity) / 100 * 255).toString(16).padStart(2, "0") : ""}`;
|
|
37584
|
+
if (type === "bg") dynamicStyle.backgroundColor = color;
|
|
37585
|
+
if (type === "text") dynamicStyle.color = color;
|
|
37586
|
+
if (type === "border") dynamicStyle.borderColor = color;
|
|
37587
|
+
}
|
|
37588
|
+
const roundedMatch = cls.match(/^rounded-\[(.+)\]$/);
|
|
37589
|
+
if (roundedMatch) {
|
|
37590
|
+
dynamicStyle.borderRadius = roundedMatch[1].replace(/_/g, " ");
|
|
37591
|
+
}
|
|
37592
|
+
const paddingMatch = cls.match(/^(p|px|py)-\[(.+)\]$/);
|
|
37593
|
+
if (paddingMatch) {
|
|
37594
|
+
const [, type, val] = paddingMatch;
|
|
37595
|
+
const cssVal = val.replace(/_/g, " ");
|
|
37596
|
+
if (type === "p") dynamicStyle.padding = cssVal;
|
|
37597
|
+
if (type === "px") {
|
|
37598
|
+
dynamicStyle.paddingLeft = cssVal;
|
|
37599
|
+
dynamicStyle.paddingRight = cssVal;
|
|
37600
|
+
}
|
|
37601
|
+
if (type === "py") {
|
|
37602
|
+
dynamicStyle.paddingTop = cssVal;
|
|
37603
|
+
dynamicStyle.paddingBottom = cssVal;
|
|
37604
|
+
}
|
|
37605
|
+
}
|
|
37606
|
+
const shadowMatch = cls.match(/^shadow-\[(.+)\]$/);
|
|
37607
|
+
if (shadowMatch) {
|
|
37608
|
+
dynamicStyle.boxShadow = shadowMatch[1].replace(/_/g, " ");
|
|
37609
|
+
}
|
|
37610
|
+
});
|
|
37611
|
+
normalized[key] = value;
|
|
37612
|
+
return;
|
|
37613
|
+
}
|
|
37614
|
+
if (["type", "component", "name"].includes(key)) {
|
|
37615
|
+
return;
|
|
37616
|
+
}
|
|
37518
37617
|
if (value === "true") {
|
|
37519
37618
|
normalized[key] = true;
|
|
37520
37619
|
return;
|
|
@@ -37523,15 +37622,13 @@ var normalizeProps = (props) => {
|
|
|
37523
37622
|
normalized[key] = false;
|
|
37524
37623
|
return;
|
|
37525
37624
|
}
|
|
37526
|
-
if (typeof value === "string" && value.trim() !== "" && !isNaN(Number(value)) &&
|
|
37527
|
-
// A simple heuristic: if it's a small integer or a float, it's likely a prop number
|
|
37528
|
-
(value.includes(".") || value.length < 10 && !value.startsWith("0") || value === "0")) {
|
|
37625
|
+
if (typeof value === "string" && value.trim() !== "" && !isNaN(Number(value)) && (value.includes(".") || value.length < 10 && !value.startsWith("0") || value === "0")) {
|
|
37529
37626
|
normalized[key] = Number(value);
|
|
37530
37627
|
return;
|
|
37531
37628
|
}
|
|
37532
37629
|
normalized[key] = value;
|
|
37533
37630
|
});
|
|
37534
|
-
return normalized;
|
|
37631
|
+
return { normalized, dynamicStyle };
|
|
37535
37632
|
};
|
|
37536
37633
|
var PXEngineRenderer = ({
|
|
37537
37634
|
schema,
|
|
@@ -37559,29 +37656,11 @@ var PXEngineRenderer = ({
|
|
|
37559
37656
|
const componentName = name || type || componentType;
|
|
37560
37657
|
if (!componentName || typeof componentName !== "string") return null;
|
|
37561
37658
|
const rawProps = { ...remainingProps, ...props };
|
|
37562
|
-
const finalProps = normalizeProps(rawProps);
|
|
37563
|
-
if (process.env.NODE_ENV === "development") {
|
|
37564
|
-
const propTypes = Object.fromEntries(
|
|
37565
|
-
Object.entries(finalProps).map(([k, v]) => [k, typeof v])
|
|
37566
|
-
);
|
|
37567
|
-
console.log(
|
|
37568
|
-
`[PXEngineRenderer] Final props for ${componentName}:`,
|
|
37569
|
-
finalProps,
|
|
37570
|
-
"Types:",
|
|
37571
|
-
propTypes
|
|
37572
|
-
);
|
|
37573
|
-
}
|
|
37659
|
+
const { normalized: finalProps, dynamicStyle } = normalizeProps(rawProps);
|
|
37574
37660
|
if (id && !finalProps.id) {
|
|
37575
37661
|
finalProps.id = id;
|
|
37576
37662
|
}
|
|
37577
37663
|
const uniqueKey = id || `${componentName}-${index || Math.random().toString(36).substr(2, 9)}`;
|
|
37578
|
-
if (process.env.NODE_ENV === "development") {
|
|
37579
|
-
console.log(`[PXEngineRenderer] Rendering ${componentName}`, {
|
|
37580
|
-
id,
|
|
37581
|
-
props: finalProps,
|
|
37582
|
-
childrenCount: Array.isArray(children) ? children.length : children ? 1 : 0
|
|
37583
|
-
});
|
|
37584
|
-
}
|
|
37585
37664
|
const normalizedName = componentName.charAt(0).toUpperCase() + componentName.slice(1);
|
|
37586
37665
|
const resolveComponent = (identifier) => {
|
|
37587
37666
|
const normalized = identifier.charAt(0).toUpperCase() + identifier.slice(1);
|
|
@@ -37605,11 +37684,6 @@ var PXEngineRenderer = ({
|
|
|
37605
37684
|
}
|
|
37606
37685
|
if (!TargetComponent) {
|
|
37607
37686
|
if (CONTEXT_DEPENDENT_COMPONENTS.has(normalizedName)) {
|
|
37608
|
-
if (process.env.NODE_ENV === "development") {
|
|
37609
|
-
console.error(
|
|
37610
|
-
`[PXEngineRenderer] Cannot render context-dependent component: ${componentName}. Use ${COMPONENT_SUGGESTIONS[normalizedName] || `${componentName}Atom`} instead.`
|
|
37611
|
-
);
|
|
37612
|
-
}
|
|
37613
37687
|
return renderContextDependentError(
|
|
37614
37688
|
componentName,
|
|
37615
37689
|
normalizedName,
|
|
@@ -37622,20 +37696,31 @@ var PXEngineRenderer = ({
|
|
|
37622
37696
|
return renderNotFoundError(componentName, uniqueKey);
|
|
37623
37697
|
}
|
|
37624
37698
|
}
|
|
37625
|
-
if (process.env.NODE_ENV === "development") {
|
|
37626
|
-
console.log(
|
|
37627
|
-
`[PXEngineRenderer] Resolved ${componentName} to component`,
|
|
37628
|
-
TargetComponent.displayName || TargetComponent.name || "Anonymous"
|
|
37629
|
-
);
|
|
37630
|
-
}
|
|
37631
37699
|
const resolvedNormalized = resolvedIdentifier.charAt(0).toUpperCase() + resolvedIdentifier.slice(1);
|
|
37632
37700
|
const atomName = resolvedNormalized.endsWith("Atom") ? resolvedNormalized : `${resolvedNormalized}Atom`;
|
|
37633
|
-
const
|
|
37701
|
+
const ATOMS_WITH_RENDER = /* @__PURE__ */ new Set([
|
|
37702
|
+
"LayoutAtom",
|
|
37703
|
+
"CardAtom",
|
|
37704
|
+
"TabsAtom",
|
|
37705
|
+
"AccordionAtom",
|
|
37706
|
+
"ScrollAreaAtom",
|
|
37707
|
+
"CarouselAtom",
|
|
37708
|
+
"AspectRatioAtom",
|
|
37709
|
+
"CollapsibleAtom",
|
|
37710
|
+
"TooltipAtom",
|
|
37711
|
+
"PopoverAtom",
|
|
37712
|
+
"DialogAtom",
|
|
37713
|
+
"SheetAtom",
|
|
37714
|
+
"ResizableAtom"
|
|
37715
|
+
]);
|
|
37716
|
+
const isAtomWithRenderProp = ATOMS_WITH_RENDER.has(atomName);
|
|
37717
|
+
const finalStyle = { ...dynamicStyle, ...finalProps.style || {} };
|
|
37634
37718
|
if (isAtomWithRenderProp) {
|
|
37635
37719
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
37636
37720
|
TargetComponent,
|
|
37637
37721
|
{
|
|
37638
37722
|
...finalProps,
|
|
37723
|
+
style: finalStyle,
|
|
37639
37724
|
onAction,
|
|
37640
37725
|
renderComponent: renderRecursive,
|
|
37641
37726
|
children
|
|
@@ -37643,7 +37728,7 @@ var PXEngineRenderer = ({
|
|
|
37643
37728
|
uniqueKey
|
|
37644
37729
|
);
|
|
37645
37730
|
} else {
|
|
37646
|
-
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(TargetComponent, { ...finalProps, children: Array.isArray(children) ? children.map((child, idx) => renderRecursive(child, idx)) : children }, uniqueKey);
|
|
37731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(TargetComponent, { ...finalProps, style: finalStyle, children: Array.isArray(children) ? children.map((child, idx) => renderRecursive(child, idx)) : children }, uniqueKey);
|
|
37647
37732
|
}
|
|
37648
37733
|
};
|
|
37649
37734
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "px-engine-root relative w-full h-full", children: renderRecursive(root) });
|
package/dist/index.d.cts
CHANGED