@webdevarif/dashui 1.2.3 → 1.2.4
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.mts +82 -1
- package/dist/index.d.ts +82 -1
- package/dist/index.js +382 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +379 -39
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -3720,10 +3720,347 @@ function ToolbarButton({
|
|
|
3720
3720
|
);
|
|
3721
3721
|
}
|
|
3722
3722
|
|
|
3723
|
+
// src/components/cms/theme-builder.tsx
|
|
3724
|
+
import { useState as useState12, useCallback as useCallback3, useRef as useRef7 } from "react";
|
|
3725
|
+
import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3726
|
+
function ThemeBuilder({ theme, onSave, onPreviewUpdate, previewUrl }) {
|
|
3727
|
+
const [sidebarTab, setSidebarTab] = useState12("variables");
|
|
3728
|
+
const [iframeLoaded, setIframeLoaded] = useState12(false);
|
|
3729
|
+
const iframeRef = useRef7(null);
|
|
3730
|
+
const handleSave = useCallback3(() => {
|
|
3731
|
+
onSave(theme);
|
|
3732
|
+
}, [theme, onSave]);
|
|
3733
|
+
const handlePreviewReload = useCallback3(() => {
|
|
3734
|
+
if (iframeRef.current) {
|
|
3735
|
+
iframeRef.current.src = previewUrl || "about:blank";
|
|
3736
|
+
}
|
|
3737
|
+
}, [previewUrl]);
|
|
3738
|
+
return /* @__PURE__ */ jsxs39("div", { className: "flex h-screen bg-[#0f1117] text-white overflow-hidden", children: [
|
|
3739
|
+
/* @__PURE__ */ jsxs39("div", { className: "w-11 bg-[#010409] border-r border-white/10 flex flex-col items-center py-4 gap-6", children: [
|
|
3740
|
+
/* @__PURE__ */ jsx56(
|
|
3741
|
+
"button",
|
|
3742
|
+
{
|
|
3743
|
+
onClick: () => setSidebarTab("ai"),
|
|
3744
|
+
title: "AI Assistant",
|
|
3745
|
+
className: `p-2 rounded transition-colors ${sidebarTab === "ai" ? "bg-[#287f71]/20 text-[#287f71]" : "text-white/40 hover:text-white/60"}`,
|
|
3746
|
+
children: /* @__PURE__ */ jsx56("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx56("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z" }) })
|
|
3747
|
+
}
|
|
3748
|
+
),
|
|
3749
|
+
/* @__PURE__ */ jsx56(
|
|
3750
|
+
"button",
|
|
3751
|
+
{
|
|
3752
|
+
onClick: () => setSidebarTab("variables"),
|
|
3753
|
+
title: "Variables",
|
|
3754
|
+
className: `p-2 rounded transition-colors ${sidebarTab === "variables" ? "bg-[#287f71]/20 text-[#287f71]" : "text-white/40 hover:text-white/60"}`,
|
|
3755
|
+
children: /* @__PURE__ */ jsxs39("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
3756
|
+
/* @__PURE__ */ jsx56("circle", { cx: "6", cy: "6", r: "2" }),
|
|
3757
|
+
/* @__PURE__ */ jsx56("circle", { cx: "12", cy: "12", r: "2" }),
|
|
3758
|
+
/* @__PURE__ */ jsx56("circle", { cx: "18", cy: "18", r: "2" }),
|
|
3759
|
+
/* @__PURE__ */ jsx56("path", { d: "M8 8l8 8M6 18l12-12" })
|
|
3760
|
+
] })
|
|
3761
|
+
}
|
|
3762
|
+
),
|
|
3763
|
+
/* @__PURE__ */ jsx56(
|
|
3764
|
+
"button",
|
|
3765
|
+
{
|
|
3766
|
+
onClick: () => setSidebarTab("styles"),
|
|
3767
|
+
title: "Styles",
|
|
3768
|
+
className: `p-2 rounded transition-colors ${sidebarTab === "styles" ? "bg-[#287f71]/20 text-[#287f71]" : "text-white/40 hover:text-white/60"}`,
|
|
3769
|
+
children: /* @__PURE__ */ jsx56("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx56("path", { d: "M3 6h18M3 12h18M3 18h18" }) })
|
|
3770
|
+
}
|
|
3771
|
+
)
|
|
3772
|
+
] }),
|
|
3773
|
+
/* @__PURE__ */ jsxs39("div", { className: "w-80 bg-[#13151e] border-r border-white/10 overflow-y-auto p-4", children: [
|
|
3774
|
+
sidebarTab === "variables" && /* @__PURE__ */ jsxs39("div", { className: "space-y-6", children: [
|
|
3775
|
+
/* @__PURE__ */ jsx56("h2", { className: "text-lg font-semibold", children: "Theme Variables" }),
|
|
3776
|
+
/* @__PURE__ */ jsx56("div", { className: "text-sm text-white/50 p-4 bg-white/5 rounded", children: "\u{1F4A1} Variables panel component \u2014 render color schema, typography, page layout sections here" }),
|
|
3777
|
+
/* @__PURE__ */ jsx56(
|
|
3778
|
+
"button",
|
|
3779
|
+
{
|
|
3780
|
+
onClick: handleSave,
|
|
3781
|
+
className: "w-full px-4 py-2 bg-[#287f71] text-white rounded-lg hover:bg-[#287f71]/80 transition-colors font-medium",
|
|
3782
|
+
children: "Save Changes"
|
|
3783
|
+
}
|
|
3784
|
+
)
|
|
3785
|
+
] }),
|
|
3786
|
+
sidebarTab === "ai" && /* @__PURE__ */ jsxs39("div", { className: "space-y-4", children: [
|
|
3787
|
+
/* @__PURE__ */ jsx56("h2", { className: "text-lg font-semibold", children: "AI Assistant" }),
|
|
3788
|
+
/* @__PURE__ */ jsx56("div", { className: "text-sm text-white/50 p-4 bg-white/5 rounded", children: "\u{1F916} AI chat component \u2014 connect to OpenAI/Anthropic API" })
|
|
3789
|
+
] }),
|
|
3790
|
+
sidebarTab === "styles" && /* @__PURE__ */ jsxs39("div", { className: "space-y-4", children: [
|
|
3791
|
+
/* @__PURE__ */ jsx56("h2", { className: "text-lg font-semibold", children: "Style Classes" }),
|
|
3792
|
+
/* @__PURE__ */ jsx56("div", { className: "text-sm text-white/50 p-4 bg-white/5 rounded", children: "\u{1F3A8} Style Classes editor \u2014 coming soon" })
|
|
3793
|
+
] })
|
|
3794
|
+
] }),
|
|
3795
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex-1 flex flex-col bg-[#161b22]", children: [
|
|
3796
|
+
/* @__PURE__ */ jsxs39("div", { className: "h-12 bg-[#0d1117] border-b border-white/10 flex items-center justify-between px-4", children: [
|
|
3797
|
+
/* @__PURE__ */ jsx56("h1", { className: "text-sm font-medium", children: "Preview" }),
|
|
3798
|
+
/* @__PURE__ */ jsx56(
|
|
3799
|
+
"button",
|
|
3800
|
+
{
|
|
3801
|
+
onClick: handlePreviewReload,
|
|
3802
|
+
className: "px-3 py-1 text-xs bg-white/10 hover:bg-white/20 rounded transition-colors",
|
|
3803
|
+
children: "Reload"
|
|
3804
|
+
}
|
|
3805
|
+
)
|
|
3806
|
+
] }),
|
|
3807
|
+
/* @__PURE__ */ jsx56(
|
|
3808
|
+
"iframe",
|
|
3809
|
+
{
|
|
3810
|
+
ref: iframeRef,
|
|
3811
|
+
src: previewUrl || "about:blank",
|
|
3812
|
+
onLoad: () => setIframeLoaded(true),
|
|
3813
|
+
className: "flex-1 border-0",
|
|
3814
|
+
title: "Theme preview"
|
|
3815
|
+
}
|
|
3816
|
+
)
|
|
3817
|
+
] })
|
|
3818
|
+
] });
|
|
3819
|
+
}
|
|
3820
|
+
|
|
3821
|
+
// src/components/cms/color-schema-panel.tsx
|
|
3822
|
+
import { useState as useState13 } from "react";
|
|
3823
|
+
import { jsx as jsx57, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3824
|
+
function ColorSchemaPanel({
|
|
3825
|
+
schemas = [],
|
|
3826
|
+
activeSchemaId,
|
|
3827
|
+
onSchemaSelect,
|
|
3828
|
+
onSchemaSave,
|
|
3829
|
+
onSchemaCreate
|
|
3830
|
+
}) {
|
|
3831
|
+
const [showCreate, setShowCreate] = useState13(false);
|
|
3832
|
+
const [newName, setNewName] = useState13("");
|
|
3833
|
+
const activeSchema = schemas.find((s) => s.id === activeSchemaId);
|
|
3834
|
+
const handleCreate = () => {
|
|
3835
|
+
if (newName.trim()) {
|
|
3836
|
+
onSchemaCreate(newName);
|
|
3837
|
+
setNewName("");
|
|
3838
|
+
setShowCreate(false);
|
|
3839
|
+
}
|
|
3840
|
+
};
|
|
3841
|
+
return /* @__PURE__ */ jsxs40("div", { className: "space-y-4", children: [
|
|
3842
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between", children: [
|
|
3843
|
+
/* @__PURE__ */ jsx57("h3", { className: "text-sm font-semibold text-white", children: "Color Schemas" }),
|
|
3844
|
+
/* @__PURE__ */ jsx57(
|
|
3845
|
+
"button",
|
|
3846
|
+
{
|
|
3847
|
+
onClick: () => setShowCreate(!showCreate),
|
|
3848
|
+
className: "text-xs px-2 py-1 bg-[#287f71] text-white rounded hover:bg-[#287f71]/80 transition-colors",
|
|
3849
|
+
children: "+ New"
|
|
3850
|
+
}
|
|
3851
|
+
)
|
|
3852
|
+
] }),
|
|
3853
|
+
showCreate && /* @__PURE__ */ jsxs40("div", { className: "flex gap-2 p-3 bg-white/5 rounded-lg", children: [
|
|
3854
|
+
/* @__PURE__ */ jsx57(
|
|
3855
|
+
Input,
|
|
3856
|
+
{
|
|
3857
|
+
value: newName,
|
|
3858
|
+
onChange: (e) => setNewName(e.target.value),
|
|
3859
|
+
placeholder: "Schema name",
|
|
3860
|
+
className: "h-8 text-xs bg-white/10 border-white/20 text-white placeholder:text-white/30"
|
|
3861
|
+
}
|
|
3862
|
+
),
|
|
3863
|
+
/* @__PURE__ */ jsx57(
|
|
3864
|
+
"button",
|
|
3865
|
+
{
|
|
3866
|
+
onClick: handleCreate,
|
|
3867
|
+
className: "px-3 py-1 text-xs bg-[#287f71] text-white rounded hover:bg-[#287f71]/80",
|
|
3868
|
+
children: "Create"
|
|
3869
|
+
}
|
|
3870
|
+
),
|
|
3871
|
+
/* @__PURE__ */ jsx57(
|
|
3872
|
+
"button",
|
|
3873
|
+
{
|
|
3874
|
+
onClick: () => setShowCreate(false),
|
|
3875
|
+
className: "px-3 py-1 text-xs bg-white/10 text-white/70 rounded hover:bg-white/20",
|
|
3876
|
+
children: "Cancel"
|
|
3877
|
+
}
|
|
3878
|
+
)
|
|
3879
|
+
] }),
|
|
3880
|
+
/* @__PURE__ */ jsx57("div", { className: "space-y-2", children: schemas.map((schema) => /* @__PURE__ */ jsxs40(
|
|
3881
|
+
"button",
|
|
3882
|
+
{
|
|
3883
|
+
onClick: () => onSchemaSelect(schema.id),
|
|
3884
|
+
className: `w-full p-3 rounded-lg border-2 transition-colors text-left ${activeSchemaId === schema.id ? "border-[#287f71] bg-[#287f71]/10" : "border-white/10 bg-white/5 hover:border-white/20"}`,
|
|
3885
|
+
children: [
|
|
3886
|
+
/* @__PURE__ */ jsx57("p", { className: "text-sm font-medium text-white", children: schema.name }),
|
|
3887
|
+
/* @__PURE__ */ jsxs40("p", { className: "text-xs text-white/50", children: [
|
|
3888
|
+
Object.keys(schema.light).length,
|
|
3889
|
+
" tokens"
|
|
3890
|
+
] })
|
|
3891
|
+
]
|
|
3892
|
+
},
|
|
3893
|
+
schema.id
|
|
3894
|
+
)) }),
|
|
3895
|
+
activeSchema && /* @__PURE__ */ jsxs40("div", { className: "p-3 bg-white/5 rounded-lg border border-white/10 space-y-3", children: [
|
|
3896
|
+
/* @__PURE__ */ jsx57("h4", { className: "text-xs font-semibold text-white", children: "Light Mode" }),
|
|
3897
|
+
/* @__PURE__ */ jsx57("div", { className: "grid grid-cols-4 gap-2", children: Object.entries(activeSchema.light).slice(0, 8).map(([key, color]) => /* @__PURE__ */ jsx57(
|
|
3898
|
+
"div",
|
|
3899
|
+
{
|
|
3900
|
+
className: "rounded border border-white/10 overflow-hidden",
|
|
3901
|
+
title: key,
|
|
3902
|
+
children: /* @__PURE__ */ jsx57(
|
|
3903
|
+
"div",
|
|
3904
|
+
{
|
|
3905
|
+
className: "h-6",
|
|
3906
|
+
style: { backgroundColor: color }
|
|
3907
|
+
}
|
|
3908
|
+
)
|
|
3909
|
+
},
|
|
3910
|
+
key
|
|
3911
|
+
)) }),
|
|
3912
|
+
/* @__PURE__ */ jsx57("h4", { className: "text-xs font-semibold text-white mt-3", children: "Dark Mode" }),
|
|
3913
|
+
/* @__PURE__ */ jsx57("div", { className: "grid grid-cols-4 gap-2", children: Object.entries(activeSchema.dark).slice(0, 8).map(([key, color]) => /* @__PURE__ */ jsx57(
|
|
3914
|
+
"div",
|
|
3915
|
+
{
|
|
3916
|
+
className: "rounded border border-white/10 overflow-hidden",
|
|
3917
|
+
title: key,
|
|
3918
|
+
children: /* @__PURE__ */ jsx57(
|
|
3919
|
+
"div",
|
|
3920
|
+
{
|
|
3921
|
+
className: "h-6",
|
|
3922
|
+
style: { backgroundColor: color }
|
|
3923
|
+
}
|
|
3924
|
+
)
|
|
3925
|
+
},
|
|
3926
|
+
key
|
|
3927
|
+
)) })
|
|
3928
|
+
] })
|
|
3929
|
+
] });
|
|
3930
|
+
}
|
|
3931
|
+
|
|
3932
|
+
// src/components/cms/typography-panel.tsx
|
|
3933
|
+
import { useState as useState14 } from "react";
|
|
3934
|
+
import { jsx as jsx58, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3935
|
+
function TypographyPanel({
|
|
3936
|
+
typography,
|
|
3937
|
+
onSave
|
|
3938
|
+
}) {
|
|
3939
|
+
const [expanded, setExpanded] = useState14("body");
|
|
3940
|
+
const handleFontChange = (role, font) => {
|
|
3941
|
+
const updated = {
|
|
3942
|
+
...typography,
|
|
3943
|
+
fonts: { ...typography.fonts, [role]: font }
|
|
3944
|
+
};
|
|
3945
|
+
onSave(updated);
|
|
3946
|
+
};
|
|
3947
|
+
const handlePresetChange = (presetKey, field, value) => {
|
|
3948
|
+
const isHeading = presetKey.startsWith("h");
|
|
3949
|
+
const updated = isHeading ? {
|
|
3950
|
+
...typography,
|
|
3951
|
+
headings: {
|
|
3952
|
+
...typography.headings,
|
|
3953
|
+
[presetKey]: { ...typography.headings[presetKey], [field]: value }
|
|
3954
|
+
}
|
|
3955
|
+
} : {
|
|
3956
|
+
...typography,
|
|
3957
|
+
body: { ...typography.body, [field]: value }
|
|
3958
|
+
};
|
|
3959
|
+
onSave(updated);
|
|
3960
|
+
};
|
|
3961
|
+
return /* @__PURE__ */ jsxs41("div", { className: "space-y-4", children: [
|
|
3962
|
+
/* @__PURE__ */ jsx58("h3", { className: "text-sm font-semibold text-white", children: "Typography" }),
|
|
3963
|
+
/* @__PURE__ */ jsxs41("div", { className: "space-y-2 border-b border-white/10 pb-4", children: [
|
|
3964
|
+
/* @__PURE__ */ jsx58("h4", { className: "text-xs font-medium text-white/70 uppercase", children: "Fonts" }),
|
|
3965
|
+
Object.entries(typography.fonts || {}).map(([role, font]) => /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-1", children: [
|
|
3966
|
+
/* @__PURE__ */ jsx58(Label2, { className: "text-xs text-white/60", children: role }),
|
|
3967
|
+
/* @__PURE__ */ jsx58(
|
|
3968
|
+
Input,
|
|
3969
|
+
{
|
|
3970
|
+
value: font,
|
|
3971
|
+
onChange: (e) => handleFontChange(role, e.target.value),
|
|
3972
|
+
placeholder: "Font name",
|
|
3973
|
+
className: "h-8 text-xs bg-white/10 border-white/20 text-white placeholder:text-white/30"
|
|
3974
|
+
}
|
|
3975
|
+
)
|
|
3976
|
+
] }, role))
|
|
3977
|
+
] }),
|
|
3978
|
+
/* @__PURE__ */ jsxs41("div", { className: "space-y-2", children: [
|
|
3979
|
+
/* @__PURE__ */ jsx58("h4", { className: "text-xs font-medium text-white/70 uppercase", children: "Text Styles" }),
|
|
3980
|
+
/* @__PURE__ */ jsxs41(
|
|
3981
|
+
"button",
|
|
3982
|
+
{
|
|
3983
|
+
onClick: () => setExpanded(expanded === "body" ? null : "body"),
|
|
3984
|
+
className: "w-full text-left p-2 rounded hover:bg-white/5 transition-colors",
|
|
3985
|
+
children: [
|
|
3986
|
+
/* @__PURE__ */ jsx58("span", { className: "text-sm font-medium text-white", children: "Body Text" }),
|
|
3987
|
+
/* @__PURE__ */ jsx58(
|
|
3988
|
+
"svg",
|
|
3989
|
+
{
|
|
3990
|
+
className: `w-3 h-3 inline ml-2 transition-transform ${expanded === "body" ? "rotate-180" : ""}`,
|
|
3991
|
+
viewBox: "0 0 24 24",
|
|
3992
|
+
fill: "none",
|
|
3993
|
+
stroke: "currentColor",
|
|
3994
|
+
strokeWidth: "2",
|
|
3995
|
+
children: /* @__PURE__ */ jsx58("path", { d: "m6 9 6 6 6-6" })
|
|
3996
|
+
}
|
|
3997
|
+
)
|
|
3998
|
+
]
|
|
3999
|
+
}
|
|
4000
|
+
),
|
|
4001
|
+
expanded === "body" && /* @__PURE__ */ jsxs41("div", { className: "ml-2 space-y-2 p-2 bg-white/5 rounded", children: [
|
|
4002
|
+
/* @__PURE__ */ jsxs41("div", { children: [
|
|
4003
|
+
/* @__PURE__ */ jsx58(Label2, { className: "text-xs text-white/60", children: "Size" }),
|
|
4004
|
+
/* @__PURE__ */ jsx58(
|
|
4005
|
+
Input,
|
|
4006
|
+
{
|
|
4007
|
+
type: "number",
|
|
4008
|
+
value: typography.body?.size?.desktop || 16,
|
|
4009
|
+
onChange: (e) => handlePresetChange("body", "size", { desktop: +e.target.value }),
|
|
4010
|
+
className: "h-8 text-xs bg-white/10 border-white/20 text-white"
|
|
4011
|
+
}
|
|
4012
|
+
)
|
|
4013
|
+
] }),
|
|
4014
|
+
/* @__PURE__ */ jsxs41("div", { children: [
|
|
4015
|
+
/* @__PURE__ */ jsx58(Label2, { className: "text-xs text-white/60", children: "Line Height" }),
|
|
4016
|
+
/* @__PURE__ */ jsx58(
|
|
4017
|
+
Input,
|
|
4018
|
+
{
|
|
4019
|
+
value: typography.body?.lineHeight || "1.5",
|
|
4020
|
+
onChange: (e) => handlePresetChange("body", "lineHeight", e.target.value),
|
|
4021
|
+
className: "h-8 text-xs bg-white/10 border-white/20 text-white"
|
|
4022
|
+
}
|
|
4023
|
+
)
|
|
4024
|
+
] })
|
|
4025
|
+
] }),
|
|
4026
|
+
["h1", "h2", "h3", "h4", "h5", "h6"].map((heading) => /* @__PURE__ */ jsxs41(
|
|
4027
|
+
"button",
|
|
4028
|
+
{
|
|
4029
|
+
onClick: () => setExpanded(expanded === heading ? null : heading),
|
|
4030
|
+
className: "w-full text-left p-2 rounded hover:bg-white/5 transition-colors",
|
|
4031
|
+
children: [
|
|
4032
|
+
/* @__PURE__ */ jsx58("span", { className: "text-sm font-medium text-white uppercase", children: heading }),
|
|
4033
|
+
/* @__PURE__ */ jsx58(
|
|
4034
|
+
"svg",
|
|
4035
|
+
{
|
|
4036
|
+
className: `w-3 h-3 inline ml-2 transition-transform ${expanded === heading ? "rotate-180" : ""}`,
|
|
4037
|
+
viewBox: "0 0 24 24",
|
|
4038
|
+
fill: "none",
|
|
4039
|
+
stroke: "currentColor",
|
|
4040
|
+
strokeWidth: "2",
|
|
4041
|
+
children: /* @__PURE__ */ jsx58("path", { d: "m6 9 6 6 6-6" })
|
|
4042
|
+
}
|
|
4043
|
+
)
|
|
4044
|
+
]
|
|
4045
|
+
},
|
|
4046
|
+
heading
|
|
4047
|
+
))
|
|
4048
|
+
] }),
|
|
4049
|
+
/* @__PURE__ */ jsx58(
|
|
4050
|
+
"button",
|
|
4051
|
+
{
|
|
4052
|
+
onClick: () => onSave(typography),
|
|
4053
|
+
className: "w-full px-4 py-2 bg-[#287f71] text-white rounded-lg hover:bg-[#287f71]/80 transition-colors font-medium text-sm mt-4",
|
|
4054
|
+
children: "Save Typography"
|
|
4055
|
+
}
|
|
4056
|
+
)
|
|
4057
|
+
] });
|
|
4058
|
+
}
|
|
4059
|
+
|
|
3723
4060
|
// src/hooks/index.ts
|
|
3724
|
-
import { useState as
|
|
4061
|
+
import { useState as useState15 } from "react";
|
|
3725
4062
|
function useDisclosure(initial = false) {
|
|
3726
|
-
const [isOpen, setIsOpen] =
|
|
4063
|
+
const [isOpen, setIsOpen] = useState15(initial);
|
|
3727
4064
|
return {
|
|
3728
4065
|
isOpen,
|
|
3729
4066
|
open: () => setIsOpen(true),
|
|
@@ -3733,15 +4070,15 @@ function useDisclosure(initial = false) {
|
|
|
3733
4070
|
};
|
|
3734
4071
|
}
|
|
3735
4072
|
function usePagination(total, pageSize = 20) {
|
|
3736
|
-
const [page, setPage] =
|
|
4073
|
+
const [page, setPage] = useState15(1);
|
|
3737
4074
|
const totalPages = Math.ceil(total / pageSize);
|
|
3738
4075
|
return { page, setPage, pageSize, total, totalPages };
|
|
3739
4076
|
}
|
|
3740
4077
|
|
|
3741
4078
|
// src/components/auth/AuthShell.tsx
|
|
3742
|
-
import { jsx as
|
|
4079
|
+
import { jsx as jsx59, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3743
4080
|
function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
3744
|
-
return /* @__PURE__ */
|
|
4081
|
+
return /* @__PURE__ */ jsxs42(
|
|
3745
4082
|
"div",
|
|
3746
4083
|
{
|
|
3747
4084
|
style: {
|
|
@@ -3756,7 +4093,7 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3756
4093
|
overflow: "hidden"
|
|
3757
4094
|
},
|
|
3758
4095
|
children: [
|
|
3759
|
-
pattern === "dots" && /* @__PURE__ */
|
|
4096
|
+
pattern === "dots" && /* @__PURE__ */ jsx59(
|
|
3760
4097
|
"div",
|
|
3761
4098
|
{
|
|
3762
4099
|
"aria-hidden": true,
|
|
@@ -3770,7 +4107,7 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3770
4107
|
}
|
|
3771
4108
|
}
|
|
3772
4109
|
),
|
|
3773
|
-
pattern === "grid" && /* @__PURE__ */
|
|
4110
|
+
pattern === "grid" && /* @__PURE__ */ jsx59(
|
|
3774
4111
|
"div",
|
|
3775
4112
|
{
|
|
3776
4113
|
"aria-hidden": true,
|
|
@@ -3784,16 +4121,16 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3784
4121
|
}
|
|
3785
4122
|
}
|
|
3786
4123
|
),
|
|
3787
|
-
/* @__PURE__ */
|
|
4124
|
+
/* @__PURE__ */ jsx59("div", { style: { position: "relative", zIndex: 1, width: "100%", maxWidth }, children })
|
|
3788
4125
|
]
|
|
3789
4126
|
}
|
|
3790
4127
|
);
|
|
3791
4128
|
}
|
|
3792
4129
|
|
|
3793
4130
|
// src/components/auth/AuthCard.tsx
|
|
3794
|
-
import { jsx as
|
|
4131
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3795
4132
|
function AuthCard({ children, padding = "24px 28px" }) {
|
|
3796
|
-
return /* @__PURE__ */
|
|
4133
|
+
return /* @__PURE__ */ jsx60(
|
|
3797
4134
|
"div",
|
|
3798
4135
|
{
|
|
3799
4136
|
style: {
|
|
@@ -3810,10 +4147,10 @@ function AuthCard({ children, padding = "24px 28px" }) {
|
|
|
3810
4147
|
}
|
|
3811
4148
|
|
|
3812
4149
|
// src/components/auth/AuthLogo.tsx
|
|
3813
|
-
import { jsx as
|
|
4150
|
+
import { jsx as jsx61, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3814
4151
|
function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }) {
|
|
3815
|
-
return /* @__PURE__ */
|
|
3816
|
-
imageUrl ? /* @__PURE__ */
|
|
4152
|
+
return /* @__PURE__ */ jsxs43("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: "10px", marginBottom: "28px" }, children: [
|
|
4153
|
+
imageUrl ? /* @__PURE__ */ jsx61(
|
|
3817
4154
|
"img",
|
|
3818
4155
|
{
|
|
3819
4156
|
src: imageUrl,
|
|
@@ -3822,7 +4159,7 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3822
4159
|
height: size,
|
|
3823
4160
|
style: { borderRadius: "calc(var(--radius, 0.5rem) * 1.2)", flexShrink: 0, display: "block" }
|
|
3824
4161
|
}
|
|
3825
|
-
) : /* @__PURE__ */
|
|
4162
|
+
) : /* @__PURE__ */ jsx61(
|
|
3826
4163
|
"div",
|
|
3827
4164
|
{
|
|
3828
4165
|
style: {
|
|
@@ -3841,7 +4178,7 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3841
4178
|
children: letter
|
|
3842
4179
|
}
|
|
3843
4180
|
),
|
|
3844
|
-
/* @__PURE__ */
|
|
4181
|
+
/* @__PURE__ */ jsx61(
|
|
3845
4182
|
"span",
|
|
3846
4183
|
{
|
|
3847
4184
|
style: {
|
|
@@ -3857,10 +4194,10 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3857
4194
|
}
|
|
3858
4195
|
|
|
3859
4196
|
// src/components/auth/AuthHeader.tsx
|
|
3860
|
-
import { jsx as
|
|
4197
|
+
import { jsx as jsx62, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3861
4198
|
function AuthHeader({ title, description }) {
|
|
3862
|
-
return /* @__PURE__ */
|
|
3863
|
-
/* @__PURE__ */
|
|
4199
|
+
return /* @__PURE__ */ jsxs44("div", { style: { marginBottom: "24px", textAlign: "center" }, children: [
|
|
4200
|
+
/* @__PURE__ */ jsx62(
|
|
3864
4201
|
"h1",
|
|
3865
4202
|
{
|
|
3866
4203
|
style: {
|
|
@@ -3873,7 +4210,7 @@ function AuthHeader({ title, description }) {
|
|
|
3873
4210
|
children: title
|
|
3874
4211
|
}
|
|
3875
4212
|
),
|
|
3876
|
-
description && /* @__PURE__ */
|
|
4213
|
+
description && /* @__PURE__ */ jsx62(
|
|
3877
4214
|
"p",
|
|
3878
4215
|
{
|
|
3879
4216
|
style: {
|
|
@@ -3889,12 +4226,12 @@ function AuthHeader({ title, description }) {
|
|
|
3889
4226
|
}
|
|
3890
4227
|
|
|
3891
4228
|
// src/components/auth/AuthField.tsx
|
|
3892
|
-
import { jsx as
|
|
4229
|
+
import { jsx as jsx63, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
3893
4230
|
function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
3894
4231
|
const fieldId = id ?? label.toLowerCase().replace(/\s+/g, "-");
|
|
3895
|
-
return /* @__PURE__ */
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
4232
|
+
return /* @__PURE__ */ jsxs45("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
4233
|
+
/* @__PURE__ */ jsxs45("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
4234
|
+
/* @__PURE__ */ jsx63(
|
|
3898
4235
|
"label",
|
|
3899
4236
|
{
|
|
3900
4237
|
htmlFor: fieldId,
|
|
@@ -3906,9 +4243,9 @@ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
|
3906
4243
|
children: label
|
|
3907
4244
|
}
|
|
3908
4245
|
),
|
|
3909
|
-
rightLabel && /* @__PURE__ */
|
|
4246
|
+
rightLabel && /* @__PURE__ */ jsx63("span", { style: { fontSize: "0.8125rem" }, children: rightLabel })
|
|
3910
4247
|
] }),
|
|
3911
|
-
/* @__PURE__ */
|
|
4248
|
+
/* @__PURE__ */ jsx63(
|
|
3912
4249
|
"input",
|
|
3913
4250
|
{
|
|
3914
4251
|
id: fieldId,
|
|
@@ -3938,13 +4275,13 @@ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
|
3938
4275
|
...props
|
|
3939
4276
|
}
|
|
3940
4277
|
),
|
|
3941
|
-
error && /* @__PURE__ */
|
|
3942
|
-
hint && !error && /* @__PURE__ */
|
|
4278
|
+
error && /* @__PURE__ */ jsx63("p", { style: { fontSize: "0.8rem", color: "var(--destructive)", margin: 0 }, children: error }),
|
|
4279
|
+
hint && !error && /* @__PURE__ */ jsx63("p", { style: { fontSize: "0.8rem", color: "var(--muted-foreground)", margin: 0 }, children: hint })
|
|
3943
4280
|
] });
|
|
3944
4281
|
}
|
|
3945
4282
|
|
|
3946
4283
|
// src/components/auth/AuthButton.tsx
|
|
3947
|
-
import { Fragment as Fragment4, jsx as
|
|
4284
|
+
import { Fragment as Fragment4, jsx as jsx64, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
3948
4285
|
function AuthButton({
|
|
3949
4286
|
loading,
|
|
3950
4287
|
variant = "primary",
|
|
@@ -3987,7 +4324,7 @@ function AuthButton({
|
|
|
3987
4324
|
color: "var(--foreground)"
|
|
3988
4325
|
}
|
|
3989
4326
|
};
|
|
3990
|
-
return /* @__PURE__ */
|
|
4327
|
+
return /* @__PURE__ */ jsx64(
|
|
3991
4328
|
"button",
|
|
3992
4329
|
{
|
|
3993
4330
|
disabled: loading || disabled,
|
|
@@ -3999,8 +4336,8 @@ function AuthButton({
|
|
|
3999
4336
|
e.currentTarget.style.filter = "none";
|
|
4000
4337
|
},
|
|
4001
4338
|
...props,
|
|
4002
|
-
children: loading ? /* @__PURE__ */
|
|
4003
|
-
/* @__PURE__ */
|
|
4339
|
+
children: loading ? /* @__PURE__ */ jsxs46(Fragment4, { children: [
|
|
4340
|
+
/* @__PURE__ */ jsx64(
|
|
4004
4341
|
"span",
|
|
4005
4342
|
{
|
|
4006
4343
|
style: {
|
|
@@ -4021,19 +4358,19 @@ function AuthButton({
|
|
|
4021
4358
|
}
|
|
4022
4359
|
|
|
4023
4360
|
// src/components/auth/AuthDivider.tsx
|
|
4024
|
-
import { jsx as
|
|
4361
|
+
import { jsx as jsx65, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4025
4362
|
function AuthDivider({ label = "or" }) {
|
|
4026
|
-
return /* @__PURE__ */
|
|
4027
|
-
/* @__PURE__ */
|
|
4028
|
-
/* @__PURE__ */
|
|
4029
|
-
/* @__PURE__ */
|
|
4363
|
+
return /* @__PURE__ */ jsxs47("div", { style: { display: "flex", alignItems: "center", gap: "12px", margin: "20px 0" }, children: [
|
|
4364
|
+
/* @__PURE__ */ jsx65("div", { style: { flex: 1, height: 1, background: "var(--border)" } }),
|
|
4365
|
+
/* @__PURE__ */ jsx65("span", { style: { fontSize: "0.75rem", color: "var(--muted-foreground)", userSelect: "none" }, children: label }),
|
|
4366
|
+
/* @__PURE__ */ jsx65("div", { style: { flex: 1, height: 1, background: "var(--border)" } })
|
|
4030
4367
|
] });
|
|
4031
4368
|
}
|
|
4032
4369
|
|
|
4033
4370
|
// src/components/auth/AuthFootnote.tsx
|
|
4034
|
-
import { jsx as
|
|
4371
|
+
import { jsx as jsx66, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4035
4372
|
function AuthFootnote({ text, linkText, linkHref }) {
|
|
4036
|
-
return /* @__PURE__ */
|
|
4373
|
+
return /* @__PURE__ */ jsxs48("p", { style: {
|
|
4037
4374
|
textAlign: "center",
|
|
4038
4375
|
marginTop: "20px",
|
|
4039
4376
|
fontSize: "0.8125rem",
|
|
@@ -4041,7 +4378,7 @@ function AuthFootnote({ text, linkText, linkHref }) {
|
|
|
4041
4378
|
}, children: [
|
|
4042
4379
|
text,
|
|
4043
4380
|
" ",
|
|
4044
|
-
/* @__PURE__ */
|
|
4381
|
+
/* @__PURE__ */ jsx66(
|
|
4045
4382
|
"a",
|
|
4046
4383
|
{
|
|
4047
4384
|
href: linkHref,
|
|
@@ -4088,6 +4425,7 @@ export {
|
|
|
4088
4425
|
ColorPickerHue,
|
|
4089
4426
|
ColorPickerOutput,
|
|
4090
4427
|
ColorPickerSelection,
|
|
4428
|
+
ColorSchemaPanel,
|
|
4091
4429
|
ConfirmDialog,
|
|
4092
4430
|
DEVICES,
|
|
4093
4431
|
DEVICE_ICONS,
|
|
@@ -4167,6 +4505,7 @@ export {
|
|
|
4167
4505
|
TabsList,
|
|
4168
4506
|
TabsTrigger,
|
|
4169
4507
|
Textarea,
|
|
4508
|
+
ThemeBuilder,
|
|
4170
4509
|
ThemeProvider,
|
|
4171
4510
|
ThemeToggle,
|
|
4172
4511
|
TiptapEditor,
|
|
@@ -4175,6 +4514,7 @@ export {
|
|
|
4175
4514
|
TooltipProvider,
|
|
4176
4515
|
TooltipTrigger,
|
|
4177
4516
|
TopBar,
|
|
4517
|
+
TypographyPanel,
|
|
4178
4518
|
UploadProgressPanel,
|
|
4179
4519
|
UploadZone,
|
|
4180
4520
|
badgeVariants,
|