@trops/dash-core 0.1.568 → 0.1.570
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/electron/index.js +24 -0
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +263 -67
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +262 -65
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28898,6 +28898,29 @@ function classFor(prefix, type, shade, channelValue) {
|
|
|
28898
28898
|
}
|
|
28899
28899
|
return "".concat(h).concat(prefix, "-").concat(channelValue, "-").concat(shade);
|
|
28900
28900
|
}
|
|
28901
|
+
|
|
28902
|
+
/**
|
|
28903
|
+
* CSS color value (hex literal or `var(...)` reference) for the same
|
|
28904
|
+
* (type, shade, channelValue) tuple `classFor` resolves to a Tailwind
|
|
28905
|
+
* className. Inline-style consumers read these via
|
|
28906
|
+
* `currentTheme.cssValue[tokenName]` — see PRD US-007.
|
|
28907
|
+
*
|
|
28908
|
+
* Named channels look up the hex from TAILWIND_PALETTE. Hex channels
|
|
28909
|
+
* produce a `var(--{type}-{shade})` reference that resolves against
|
|
28910
|
+
* the CSS custom properties ThemePreviewProvider writes to :root.
|
|
28911
|
+
*
|
|
28912
|
+
* Returns null for unknown named-color families or shades — caller
|
|
28913
|
+
* falls back to className-only reactivity for that token.
|
|
28914
|
+
*/
|
|
28915
|
+
function cssValueFor(type, shade, channelValue) {
|
|
28916
|
+
if (DashReact.isHexColor(channelValue)) {
|
|
28917
|
+
return "var(--".concat(type, "-").concat(shade, ")");
|
|
28918
|
+
}
|
|
28919
|
+
var family = DashReact.TAILWIND_PALETTE && DashReact.TAILWIND_PALETTE[channelValue];
|
|
28920
|
+
if (!family) return null;
|
|
28921
|
+
var hex = family[shade] || family[String(shade)];
|
|
28922
|
+
return hex || null;
|
|
28923
|
+
}
|
|
28901
28924
|
function gradientFor(direction, type, fromShade, viaShade, toShade, channelValue) {
|
|
28902
28925
|
if (DashReact.isHexColor(channelValue)) {
|
|
28903
28926
|
return "bg-gradient-to-".concat(direction, " from-[var(--").concat(type, "-").concat(fromShade, ")] via-[var(--").concat(type, "-").concat(viaShade, ")] to-[var(--").concat(type, "-").concat(toShade, ")]");
|
|
@@ -28960,17 +28983,26 @@ var ThemeModel = function ThemeModel() {
|
|
|
28960
28983
|
if (variant in theme === false) {
|
|
28961
28984
|
theme[variant] = {};
|
|
28962
28985
|
}
|
|
28986
|
+
if (!theme[variant].cssValue) {
|
|
28987
|
+
theme[variant].cssValue = {};
|
|
28988
|
+
}
|
|
28963
28989
|
Object.keys(variants[variant]).forEach(function (shade) {
|
|
28964
28990
|
var numShade = variants[variant][shade];
|
|
28965
28991
|
var hoverShade = getNextLevel(numShade);
|
|
28966
28992
|
var textShade = invert(numShade);
|
|
28967
28993
|
theme[variant]["bg-".concat(type, "-").concat(shade)] = classFor("bg", type, numShade, channelValue);
|
|
28994
|
+
theme[variant].cssValue["bg-".concat(type, "-").concat(shade)] = cssValueFor(type, numShade, channelValue);
|
|
28968
28995
|
theme[variant]["hover-bg-".concat(type, "-").concat(shade)] = classFor("bg", type, hoverShade, channelValue, true);
|
|
28996
|
+
theme[variant].cssValue["hover-bg-".concat(type, "-").concat(shade)] = cssValueFor(type, hoverShade, channelValue);
|
|
28969
28997
|
theme[variant]["hover-border-".concat(type, "-").concat(shade)] = classFor("border", type, hoverShade, channelValue, true);
|
|
28998
|
+
theme[variant].cssValue["hover-border-".concat(type, "-").concat(shade)] = cssValueFor(type, hoverShade, channelValue);
|
|
28970
28999
|
theme[variant]["border-".concat(type, "-").concat(shade)] = classFor("border", type, numShade, channelValue);
|
|
29000
|
+
theme[variant].cssValue["border-".concat(type, "-").concat(shade)] = cssValueFor(type, numShade, channelValue);
|
|
28971
29001
|
// we should be "flipping" these so dark text on light and light on dark...
|
|
28972
29002
|
theme[variant]["text-".concat(type, "-").concat(shade)] = classFor("text", type, textShade, channelValue);
|
|
29003
|
+
theme[variant].cssValue["text-".concat(type, "-").concat(shade)] = cssValueFor(type, textShade, channelValue);
|
|
28973
29004
|
theme[variant]["hover-text-".concat(type, "-").concat(shade)] = classFor("text", type, textShade, channelValue, true);
|
|
29005
|
+
theme[variant].cssValue["hover-text-".concat(type, "-").concat(shade)] = cssValueFor(type, textShade, channelValue);
|
|
28974
29006
|
});
|
|
28975
29007
|
});
|
|
28976
29008
|
});
|
|
@@ -29037,7 +29069,9 @@ var ThemeModel = function ThemeModel() {
|
|
|
29037
29069
|
DashReact.colorTypes.forEach(function (type) {
|
|
29038
29070
|
var channelValue = theme[type];
|
|
29039
29071
|
theme["dark"]["bg-".concat(type, "-darkest")] = classFor("bg", type, 950, channelValue);
|
|
29072
|
+
theme["dark"].cssValue["bg-".concat(type, "-darkest")] = cssValueFor(type, 950, channelValue);
|
|
29040
29073
|
theme["light"]["bg-".concat(type, "-darkest")] = classFor("bg", type, 50, channelValue);
|
|
29074
|
+
theme["light"].cssValue["bg-".concat(type, "-darkest")] = cssValueFor(type, 50, channelValue);
|
|
29041
29075
|
});
|
|
29042
29076
|
|
|
29043
29077
|
// Accumulate CSS custom properties for any hex-color channels.
|
|
@@ -29079,6 +29113,17 @@ var ThemeModel = function ThemeModel() {
|
|
|
29079
29113
|
theme["light"]["hover-border-none"] = "hover:border-transparent";
|
|
29080
29114
|
theme["light"]["hover-bg-none"] = "hover:bg-transparent";
|
|
29081
29115
|
theme["light"]["hover-text-none"] = "hover:text-transparent";
|
|
29116
|
+
|
|
29117
|
+
// Mirror the transparent tokens into cssValue so inline-style
|
|
29118
|
+
// consumers can read borderless/transparent surfaces from the
|
|
29119
|
+
// same map as colored ones.
|
|
29120
|
+
["dark", "light"].forEach(function (variant) {
|
|
29121
|
+
theme[variant].cssValue["bg-none"] = "transparent";
|
|
29122
|
+
theme[variant].cssValue["border-none"] = "transparent";
|
|
29123
|
+
theme[variant].cssValue["hover-bg-none"] = "transparent";
|
|
29124
|
+
theme[variant].cssValue["hover-border-none"] = "transparent";
|
|
29125
|
+
theme[variant].cssValue["hover-text-none"] = "transparent";
|
|
29126
|
+
});
|
|
29082
29127
|
return theme;
|
|
29083
29128
|
} catch (e) {
|
|
29084
29129
|
return {};
|
|
@@ -35912,6 +35957,20 @@ function getThemePresets() {
|
|
|
35912
35957
|
return [buildRawTheme("Ocean Depth", "blue", "cyan", "teal", "slate"), buildRawTheme("Sunset Ember", "orange", "rose", "amber", "stone"), buildRawTheme("Forest Canopy", "green", "emerald", "lime", "gray"), buildRawTheme("Arctic Night", "slate", "sky", "indigo", "zinc"), buildRawTheme("Royal Amethyst", "purple", "violet", "fuchsia", "gray"), buildRawTheme("Warm Earth", "stone", "amber", "orange", "neutral"), buildRawTheme("Cyber Pulse", "cyan", "blue", "violet", "slate"), buildRawTheme("Rose Garden", "rose", "pink", "fuchsia", "gray"), buildRawTheme("Golden Hour", "amber", "yellow", "orange", "stone"), buildRawTheme("Midnight Sky", "indigo", "blue", "violet", "slate"), buildRawTheme("Spring Meadow", "emerald", "lime", "green", "gray"), buildRawTheme("Coral Reef", "red", "orange", "pink", "zinc"), buildRawTheme("Nordic Ice", "sky", "cyan", "blue", "slate"), buildRawTheme("Twilight Bloom", "violet", "purple", "pink", "gray"), buildRawTheme("Desert Sand", "amber", "orange", "stone", "neutral")];
|
|
35913
35958
|
}
|
|
35914
35959
|
|
|
35960
|
+
/**
|
|
35961
|
+
* Brand presets — curated hex palettes mirroring well-known
|
|
35962
|
+
* products. Surfaced in the theme picker so users can pick
|
|
35963
|
+
* familiar brand identities in one click. Hex values flow
|
|
35964
|
+
* through the arbitrary-color-themes pipeline (PRD US-006).
|
|
35965
|
+
*
|
|
35966
|
+
* Each preset spans all four channels (primary, secondary,
|
|
35967
|
+
* tertiary, neutral). When applied, every theme token resolves
|
|
35968
|
+
* to a brand-equivalent shade via the cssVars map.
|
|
35969
|
+
*/
|
|
35970
|
+
function getBrandPresets() {
|
|
35971
|
+
return [buildRawTheme("Slack Brand", "#4A154B", "#36C5F0", "#ECB22E", "#BCBEC0"), buildRawTheme("Notion Brand", "#2F3437", "#9B6A8C", "#D4845A", "#C1B5A7"), buildRawTheme("GitHub Brand", "#0D1117", "#58A6FF", "#F0883E", "#21262D"), buildRawTheme("Stripe Brand", "#635BFF", "#00D4FF", "#FFD600", "#525F7F"), buildRawTheme("Linear Brand", "#5E6AD2", "#B07FD0", "#E2A8F5", "#1F2026"), buildRawTheme("Discord Brand", "#5865F2", "#57F287", "#FEE75C", "#36393F"), buildRawTheme("Vercel Brand", "#000000", "#0070F3", "#FF0080", "#888888"), buildRawTheme("Figma Brand", "#F24E1E", "#A259FF", "#1ABCFE", "#2C2C2C")];
|
|
35972
|
+
}
|
|
35973
|
+
|
|
35915
35974
|
// ─── Random Generation ───────────────────────────────────────────────────
|
|
35916
35975
|
|
|
35917
35976
|
function generateRandomTheme() {
|
|
@@ -36808,6 +36867,87 @@ var PreviewColorsPane = function PreviewColorsPane(_ref) {
|
|
|
36808
36867
|
}) : null;
|
|
36809
36868
|
};
|
|
36810
36869
|
|
|
36870
|
+
var AA_RATIO = 4.5;
|
|
36871
|
+
var CustomHexColorPane = function CustomHexColorPane(_ref) {
|
|
36872
|
+
var onApply = _ref.onApply,
|
|
36873
|
+
_ref$label = _ref.label,
|
|
36874
|
+
label = _ref$label === void 0 ? "Custom hex color" : _ref$label;
|
|
36875
|
+
var _useState = React.useState(""),
|
|
36876
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36877
|
+
input = _useState2[0],
|
|
36878
|
+
setInput = _useState2[1];
|
|
36879
|
+
var _useState3 = React.useState(null),
|
|
36880
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36881
|
+
error = _useState4[0],
|
|
36882
|
+
setError = _useState4[1];
|
|
36883
|
+
var normalized = React.useMemo(function () {
|
|
36884
|
+
return DashReact.normalizeHex(input);
|
|
36885
|
+
}, [input]);
|
|
36886
|
+
var isValid = !!normalized;
|
|
36887
|
+
|
|
36888
|
+
// Contrast vs. white — the most common "text on a colored fill"
|
|
36889
|
+
// case for primary buttons / active channels. Low contrast means
|
|
36890
|
+
// light text on the picked color will be hard to read.
|
|
36891
|
+
var contrastVsWhite = React.useMemo(function () {
|
|
36892
|
+
return isValid ? DashReact.contrastRatio(normalized, "#ffffff") : null;
|
|
36893
|
+
}, [normalized, isValid]);
|
|
36894
|
+
var contrastVsBlack = React.useMemo(function () {
|
|
36895
|
+
return isValid ? DashReact.contrastRatio(normalized, "#000000") : null;
|
|
36896
|
+
}, [normalized, isValid]);
|
|
36897
|
+
var bestContrast = contrastVsWhite ? Math.max(contrastVsWhite, contrastVsBlack) : null;
|
|
36898
|
+
var warning = bestContrast !== null && bestContrast < AA_RATIO ? "Best contrast ".concat(bestContrast.toFixed(1), ":1 \u2014 below WCAG AA target (4.5:1). Text overlaid on this color may be hard to read.") : null;
|
|
36899
|
+
function handleApply() {
|
|
36900
|
+
if (!normalized) {
|
|
36901
|
+
setError("Invalid hex (try #4A154B)");
|
|
36902
|
+
return;
|
|
36903
|
+
}
|
|
36904
|
+
setError(null);
|
|
36905
|
+
onApply(normalized);
|
|
36906
|
+
setInput("");
|
|
36907
|
+
}
|
|
36908
|
+
function handleKeyDown(e) {
|
|
36909
|
+
if (e.key === "Enter" && isValid) {
|
|
36910
|
+
e.preventDefault();
|
|
36911
|
+
handleApply();
|
|
36912
|
+
}
|
|
36913
|
+
}
|
|
36914
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36915
|
+
className: "flex flex-col gap-2 p-3 border-t border-gray-700",
|
|
36916
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36917
|
+
className: "text-xs uppercase font-bold tracking-wider text-gray-400",
|
|
36918
|
+
children: label
|
|
36919
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36920
|
+
className: "flex flex-row items-center gap-2",
|
|
36921
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
36922
|
+
value: input,
|
|
36923
|
+
onChange: function onChange(value) {
|
|
36924
|
+
var _value$target;
|
|
36925
|
+
// dispatchInputChange unwraps the event to a string
|
|
36926
|
+
setInput(typeof value === "string" ? value : (value === null || value === void 0 || (_value$target = value.target) === null || _value$target === void 0 ? void 0 : _value$target.value) || "");
|
|
36927
|
+
setError(null);
|
|
36928
|
+
},
|
|
36929
|
+
onKeyDown: handleKeyDown,
|
|
36930
|
+
placeholder: "#4A154B"
|
|
36931
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36932
|
+
className: "w-10 h-10 rounded flex-shrink-0",
|
|
36933
|
+
style: {
|
|
36934
|
+
backgroundColor: normalized || "transparent",
|
|
36935
|
+
border: "1px solid rgba(255,255,255,0.15)"
|
|
36936
|
+
},
|
|
36937
|
+
"aria-label": "Color preview"
|
|
36938
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
36939
|
+
title: "Apply",
|
|
36940
|
+
onClick: handleApply,
|
|
36941
|
+
disabled: !isValid
|
|
36942
|
+
})]
|
|
36943
|
+
}), error && /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
36944
|
+
text: error
|
|
36945
|
+
}), warning && /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption, {
|
|
36946
|
+
text: warning
|
|
36947
|
+
})]
|
|
36948
|
+
});
|
|
36949
|
+
};
|
|
36950
|
+
|
|
36811
36951
|
var AvailableColorsGridPane = function AvailableColorsGridPane(_ref) {
|
|
36812
36952
|
var _ref$currentColor = _ref.currentColor,
|
|
36813
36953
|
currentColor = _ref$currentColor === void 0 ? null : _ref$currentColor,
|
|
@@ -36881,13 +37021,23 @@ var AvailableColorsGridPane = function AvailableColorsGridPane(_ref) {
|
|
|
36881
37021
|
scrollable: true,
|
|
36882
37022
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.DashPanel.Header, {
|
|
36883
37023
|
title: "AvailableColors"
|
|
36884
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
37024
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(DashReact.DashPanel.Body, {
|
|
36885
37025
|
scrollable: true,
|
|
36886
37026
|
space: true,
|
|
36887
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37027
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36888
37028
|
className: "flex flex-col space-y-1",
|
|
36889
37029
|
children: renderAvailableColors()
|
|
36890
|
-
})
|
|
37030
|
+
}), shade !== null && /*#__PURE__*/jsxRuntime.jsx(CustomHexColorPane, {
|
|
37031
|
+
onApply: function onApply(hex) {
|
|
37032
|
+
return handleChooseColor({
|
|
37033
|
+
colorName: hex,
|
|
37034
|
+
colorType: colorType,
|
|
37035
|
+
shade: shade || 500,
|
|
37036
|
+
panelType: "main"
|
|
37037
|
+
});
|
|
37038
|
+
},
|
|
37039
|
+
label: "Custom hex for ".concat(colorType || "channel")
|
|
37040
|
+
})]
|
|
36891
37041
|
}), onCancel && /*#__PURE__*/jsxRuntime.jsx(DashReact.DashPanel.Footer, {
|
|
36892
37042
|
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
36893
37043
|
title: "Cancel",
|
|
@@ -38353,23 +38503,41 @@ var ThemePickerGridPane = function ThemePickerGridPane(_ref) {
|
|
|
38353
38503
|
themeVariant = _useContext.themeVariant;
|
|
38354
38504
|
function renderMenuItem(tk) {
|
|
38355
38505
|
var displayTheme = themes[tk][themeVariant];
|
|
38356
|
-
|
|
38357
|
-
|
|
38506
|
+
// Read inline CSS color values from `cssValue` (v0.1.569+) so
|
|
38507
|
+
// preview swatches render correctly for BOTH named-color and
|
|
38508
|
+
// hex (brand-preset) themes. For hex themes, the className path
|
|
38509
|
+
// resolves to `bg-[var(--secondary-700)]` which depends on the
|
|
38510
|
+
// active theme's CSS variables — those aren't injected for
|
|
38511
|
+
// OTHER themes shown in the picker grid. Inline cssValue
|
|
38512
|
+
// sidesteps that limitation.
|
|
38513
|
+
var cssValue = displayTheme.cssValue || {};
|
|
38514
|
+
var swatches = [{
|
|
38358
38515
|
type: "secondary",
|
|
38359
|
-
|
|
38516
|
+
value: cssValue["bg-secondary-medium"],
|
|
38517
|
+
className: displayTheme["bg-secondary-medium"]
|
|
38360
38518
|
}, {
|
|
38361
|
-
colorName: displayTheme["tertiary"],
|
|
38362
38519
|
type: "tertiary",
|
|
38363
|
-
|
|
38520
|
+
value: cssValue["bg-tertiary-medium"],
|
|
38521
|
+
className: displayTheme["bg-tertiary-medium"]
|
|
38364
38522
|
}, {
|
|
38365
|
-
colorName: displayTheme["neutral"],
|
|
38366
38523
|
type: "neutral",
|
|
38367
|
-
|
|
38524
|
+
value: cssValue["bg-neutral-light"],
|
|
38525
|
+
className: displayTheme["bg-neutral-light"]
|
|
38368
38526
|
}];
|
|
38369
|
-
return
|
|
38527
|
+
return swatches.map(function (swatch) {
|
|
38528
|
+
// Prefer cssValue (works for any theme). Fall back to className
|
|
38529
|
+
// for pre-v0.1.569 themes without a cssValue map.
|
|
38530
|
+
if (swatch.value) {
|
|
38531
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38532
|
+
className: "rounded h-20 w-full",
|
|
38533
|
+
style: {
|
|
38534
|
+
backgroundColor: swatch.value
|
|
38535
|
+
}
|
|
38536
|
+
}, "theme-grid-".concat(swatch.type));
|
|
38537
|
+
}
|
|
38370
38538
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38371
|
-
className: "rounded ".concat(
|
|
38372
|
-
}, "theme-grid-".concat(
|
|
38539
|
+
className: "rounded ".concat(swatch.className, " h-20 w-full")
|
|
38540
|
+
}, "theme-grid-".concat(swatch.type));
|
|
38373
38541
|
});
|
|
38374
38542
|
}
|
|
38375
38543
|
function renderCurrentThemes() {
|
|
@@ -38529,15 +38697,30 @@ var GENERATE_MODES = {
|
|
|
38529
38697
|
|
|
38530
38698
|
// ─── Preset Gallery ──────────────────────────────────────────────────────
|
|
38531
38699
|
|
|
38532
|
-
|
|
38533
|
-
|
|
38534
|
-
|
|
38535
|
-
|
|
38536
|
-
|
|
38537
|
-
var
|
|
38538
|
-
|
|
38539
|
-
return "
|
|
38700
|
+
// Render a swatch for a preset's channel value. Handles both Tailwind
|
|
38701
|
+
// named colors (`"blue"` → `bg-blue-500`) and arbitrary-color-themes
|
|
38702
|
+
// hex values (`"#4A154B"` → inline style). Used by brand presets which
|
|
38703
|
+
// carry hex palettes.
|
|
38704
|
+
var PresetSwatch = function PresetSwatch(_ref) {
|
|
38705
|
+
var color = _ref.color;
|
|
38706
|
+
if (DashReact.isHexColor(color)) {
|
|
38707
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38708
|
+
className: "h-6 flex-1 rounded",
|
|
38709
|
+
style: {
|
|
38710
|
+
backgroundColor: DashReact.normalizeHex(color) || color
|
|
38711
|
+
}
|
|
38712
|
+
});
|
|
38713
|
+
}
|
|
38714
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38715
|
+
className: "h-6 flex-1 rounded bg-".concat(color, "-500")
|
|
38540
38716
|
});
|
|
38717
|
+
};
|
|
38718
|
+
var PresetCard = function PresetCard(_ref2) {
|
|
38719
|
+
var preset = _ref2.preset,
|
|
38720
|
+
onSelect = _ref2.onSelect,
|
|
38721
|
+
_ref2$selected = _ref2.selected,
|
|
38722
|
+
selected = _ref2$selected === void 0 ? false : _ref2$selected;
|
|
38723
|
+
var colors = [preset.primary, preset.secondary, preset.tertiary];
|
|
38541
38724
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38542
38725
|
className: "flex flex-col gap-2 p-3 rounded-lg cursor-pointer transition-all bg-white/5 hover:bg-white/10 ".concat(selected ? "ring-2 ring-blue-500" : "hover:ring-2 hover:ring-blue-500"),
|
|
38543
38726
|
onClick: function onClick() {
|
|
@@ -38545,9 +38728,9 @@ var PresetCard = function PresetCard(_ref) {
|
|
|
38545
38728
|
},
|
|
38546
38729
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38547
38730
|
className: "flex flex-row gap-1",
|
|
38548
|
-
children:
|
|
38549
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
38550
|
-
|
|
38731
|
+
children: colors.map(function (c, i) {
|
|
38732
|
+
return /*#__PURE__*/jsxRuntime.jsx(PresetSwatch, {
|
|
38733
|
+
color: c
|
|
38551
38734
|
}, i);
|
|
38552
38735
|
})
|
|
38553
38736
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -38556,13 +38739,14 @@ var PresetCard = function PresetCard(_ref) {
|
|
|
38556
38739
|
})]
|
|
38557
38740
|
});
|
|
38558
38741
|
};
|
|
38559
|
-
var PresetGallery = function PresetGallery(
|
|
38560
|
-
var onSelect =
|
|
38561
|
-
|
|
38562
|
-
selectedPresetId =
|
|
38563
|
-
|
|
38564
|
-
inline =
|
|
38742
|
+
var PresetGallery = function PresetGallery(_ref3) {
|
|
38743
|
+
var onSelect = _ref3.onSelect,
|
|
38744
|
+
_ref3$selectedPresetI = _ref3.selectedPresetId,
|
|
38745
|
+
selectedPresetId = _ref3$selectedPresetI === void 0 ? null : _ref3$selectedPresetI,
|
|
38746
|
+
_ref3$inline = _ref3.inline,
|
|
38747
|
+
inline = _ref3$inline === void 0 ? false : _ref3$inline;
|
|
38565
38748
|
var presets = getThemePresets();
|
|
38749
|
+
var brandPresets = getBrandPresets();
|
|
38566
38750
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38567
38751
|
className: inline ? "flex flex-col gap-4" : "flex flex-col gap-4 p-6 overflow-y-auto flex-1 min-h-0",
|
|
38568
38752
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -38577,16 +38761,28 @@ var PresetGallery = function PresetGallery(_ref2) {
|
|
|
38577
38761
|
selected: selectedPresetId != null && preset.name === selectedPresetId
|
|
38578
38762
|
}, i);
|
|
38579
38763
|
})
|
|
38764
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38765
|
+
className: "text-sm font-semibold opacity-50 mt-4",
|
|
38766
|
+
children: "Brand Presets"
|
|
38767
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38768
|
+
className: "grid grid-cols-3 gap-3",
|
|
38769
|
+
children: brandPresets.map(function (preset, i) {
|
|
38770
|
+
return /*#__PURE__*/jsxRuntime.jsx(PresetCard, {
|
|
38771
|
+
preset: preset,
|
|
38772
|
+
onSelect: onSelect,
|
|
38773
|
+
selected: selectedPresetId != null && preset.name === selectedPresetId
|
|
38774
|
+
}, "brand-".concat(i));
|
|
38775
|
+
})
|
|
38580
38776
|
})]
|
|
38581
38777
|
});
|
|
38582
38778
|
};
|
|
38583
38779
|
|
|
38584
38780
|
// ─── Color Harmony Picker ────────────────────────────────────────────────
|
|
38585
38781
|
|
|
38586
|
-
var ColorSwatchGrid$1 = function ColorSwatchGrid(
|
|
38587
|
-
var value =
|
|
38588
|
-
onChange =
|
|
38589
|
-
label =
|
|
38782
|
+
var ColorSwatchGrid$1 = function ColorSwatchGrid(_ref4) {
|
|
38783
|
+
var value = _ref4.value,
|
|
38784
|
+
onChange = _ref4.onChange,
|
|
38785
|
+
label = _ref4.label;
|
|
38590
38786
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38591
38787
|
className: "flex flex-col gap-2",
|
|
38592
38788
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -38606,10 +38802,10 @@ var ColorSwatchGrid$1 = function ColorSwatchGrid(_ref3) {
|
|
|
38606
38802
|
})]
|
|
38607
38803
|
});
|
|
38608
38804
|
};
|
|
38609
|
-
var PreviewSwatch = function PreviewSwatch(
|
|
38610
|
-
var color =
|
|
38611
|
-
strategy =
|
|
38612
|
-
customColors =
|
|
38805
|
+
var PreviewSwatch = function PreviewSwatch(_ref5) {
|
|
38806
|
+
var color = _ref5.color,
|
|
38807
|
+
strategy = _ref5.strategy,
|
|
38808
|
+
customColors = _ref5.customColors;
|
|
38613
38809
|
var colors;
|
|
38614
38810
|
if (strategy === "custom" && customColors) {
|
|
38615
38811
|
colors = [customColors.primary, customColors.secondary, customColors.tertiary];
|
|
@@ -38632,10 +38828,10 @@ var PreviewSwatch = function PreviewSwatch(_ref4) {
|
|
|
38632
38828
|
})
|
|
38633
38829
|
});
|
|
38634
38830
|
};
|
|
38635
|
-
var ColorHarmonyPicker = function ColorHarmonyPicker(
|
|
38636
|
-
var onGenerate =
|
|
38637
|
-
|
|
38638
|
-
inline =
|
|
38831
|
+
var ColorHarmonyPicker = function ColorHarmonyPicker(_ref6) {
|
|
38832
|
+
var onGenerate = _ref6.onGenerate,
|
|
38833
|
+
_ref6$inline = _ref6.inline,
|
|
38834
|
+
inline = _ref6$inline === void 0 ? false : _ref6$inline;
|
|
38639
38835
|
var _useState = React.useState("blue"),
|
|
38640
38836
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38641
38837
|
selectedColor = _useState2[0],
|
|
@@ -38729,12 +38925,12 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref5) {
|
|
|
38729
38925
|
|
|
38730
38926
|
// ─── Wizard Components ──────────────────────────────────────────────────
|
|
38731
38927
|
|
|
38732
|
-
var MethodCard = function MethodCard(
|
|
38733
|
-
var icon =
|
|
38734
|
-
title =
|
|
38735
|
-
subtitle =
|
|
38736
|
-
selected =
|
|
38737
|
-
onClick =
|
|
38928
|
+
var MethodCard = function MethodCard(_ref7) {
|
|
38929
|
+
var icon = _ref7.icon,
|
|
38930
|
+
title = _ref7.title,
|
|
38931
|
+
subtitle = _ref7.subtitle,
|
|
38932
|
+
selected = _ref7.selected,
|
|
38933
|
+
onClick = _ref7.onClick;
|
|
38738
38934
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38739
38935
|
className: "flex flex-col gap-1.5 p-3 rounded-lg cursor-pointer transition-all bg-white/5 hover:bg-white/10 ".concat(selected ? "ring-2 ring-blue-500 bg-white/10" : "hover:ring-1 hover:ring-white/20"),
|
|
38740
38936
|
onClick: onClick,
|
|
@@ -38753,9 +38949,9 @@ var MethodCard = function MethodCard(_ref6) {
|
|
|
38753
38949
|
})]
|
|
38754
38950
|
});
|
|
38755
38951
|
};
|
|
38756
|
-
var RandomPreview = function RandomPreview(
|
|
38757
|
-
var theme =
|
|
38758
|
-
onRegenerate =
|
|
38952
|
+
var RandomPreview = function RandomPreview(_ref8) {
|
|
38953
|
+
var theme = _ref8.theme,
|
|
38954
|
+
onRegenerate = _ref8.onRegenerate;
|
|
38759
38955
|
var colors = theme ? [theme.primary, theme.secondary, theme.tertiary] : [];
|
|
38760
38956
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38761
38957
|
className: "flex flex-col gap-4",
|
|
@@ -38782,20 +38978,20 @@ var RandomPreview = function RandomPreview(_ref7) {
|
|
|
38782
38978
|
})]
|
|
38783
38979
|
});
|
|
38784
38980
|
};
|
|
38785
|
-
var ThemeQuickCreate = function ThemeQuickCreate(
|
|
38786
|
-
var wizardName =
|
|
38787
|
-
setWizardName =
|
|
38788
|
-
wizardMethod =
|
|
38789
|
-
setWizardMethod =
|
|
38790
|
-
wizardTheme =
|
|
38791
|
-
setWizardTheme =
|
|
38792
|
-
onComplete =
|
|
38793
|
-
|
|
38794
|
-
onExtract =
|
|
38795
|
-
|
|
38796
|
-
onMapToTheme =
|
|
38797
|
-
|
|
38798
|
-
initialMethod =
|
|
38981
|
+
var ThemeQuickCreate = function ThemeQuickCreate(_ref9) {
|
|
38982
|
+
var wizardName = _ref9.wizardName,
|
|
38983
|
+
setWizardName = _ref9.setWizardName,
|
|
38984
|
+
wizardMethod = _ref9.wizardMethod,
|
|
38985
|
+
setWizardMethod = _ref9.setWizardMethod,
|
|
38986
|
+
wizardTheme = _ref9.wizardTheme,
|
|
38987
|
+
setWizardTheme = _ref9.setWizardTheme,
|
|
38988
|
+
onComplete = _ref9.onComplete,
|
|
38989
|
+
_ref9$onExtract = _ref9.onExtract,
|
|
38990
|
+
onExtract = _ref9$onExtract === void 0 ? null : _ref9$onExtract,
|
|
38991
|
+
_ref9$onMapToTheme = _ref9.onMapToTheme,
|
|
38992
|
+
onMapToTheme = _ref9$onMapToTheme === void 0 ? null : _ref9$onMapToTheme,
|
|
38993
|
+
_ref9$initialMethod = _ref9.initialMethod,
|
|
38994
|
+
initialMethod = _ref9$initialMethod === void 0 ? null : _ref9$initialMethod;
|
|
38799
38995
|
var canCreate = wizardName.trim().length > 0 && wizardTheme !== null;
|
|
38800
38996
|
var showMethodPicker = initialMethod === null;
|
|
38801
38997
|
React.useEffect(function () {
|
|
@@ -66616,6 +66812,7 @@ exports.generateHarmonyTheme = generateHarmonyTheme;
|
|
|
66616
66812
|
exports.generateRandomTheme = generateRandomTheme;
|
|
66617
66813
|
exports.generateThemeName = generateThemeName;
|
|
66618
66814
|
exports.getBorderStyle = getBorderStyle;
|
|
66815
|
+
exports.getBrandPresets = getBrandPresets;
|
|
66619
66816
|
exports.getChildrenForLayoutItem = getChildrenForLayoutItem;
|
|
66620
66817
|
exports.getComponentInLayout = getComponentInLayout;
|
|
66621
66818
|
exports.getContainerBorderColor = getContainerBorderColor;
|