@trops/dash-core 0.1.577 → 0.1.579
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.esm.js +70 -69
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +70 -69
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37601,16 +37601,17 @@ var PresetGallery = function PresetGallery(_ref3) {
|
|
|
37601
37601
|
/**
|
|
37602
37602
|
* Render a swatch for a generated palette channel. Hex values render
|
|
37603
37603
|
* inline; named Tailwind families fall back to `bg-{name}-500` which
|
|
37604
|
-
* is in the safelist.
|
|
37604
|
+
* is in the safelist. Height is set by the parent flex/grid so the
|
|
37605
|
+
* generated-palette row can grow to fill available space.
|
|
37605
37606
|
*/
|
|
37606
37607
|
var PaletteSwatch = function PaletteSwatch(_ref4) {
|
|
37607
37608
|
var value = _ref4.value,
|
|
37608
37609
|
label = _ref4.label;
|
|
37609
37610
|
var isHex = DashReact.isHexColor(value);
|
|
37610
37611
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37611
|
-
className: "flex flex-col items-center gap-1 flex-1",
|
|
37612
|
+
className: "flex flex-col items-center gap-1 flex-1 min-h-0",
|
|
37612
37613
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37613
|
-
className: "h-
|
|
37614
|
+
className: "flex-1 min-h-0 w-full rounded ".concat(isHex ? "" : "bg-".concat(value, "-500")),
|
|
37614
37615
|
style: isHex ? {
|
|
37615
37616
|
backgroundColor: value
|
|
37616
37617
|
} : undefined
|
|
@@ -37637,9 +37638,9 @@ var InlineHexPicker = function InlineHexPicker(_ref5) {
|
|
|
37637
37638
|
setActiveFamily = _useState2[1];
|
|
37638
37639
|
var swatches = DashReact.getCuratedColorGrid(activeFamily);
|
|
37639
37640
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37640
|
-
className: "flex flex-col gap-2",
|
|
37641
|
+
className: "flex flex-col gap-2 flex-1 min-h-0",
|
|
37641
37642
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37642
|
-
className: "flex flex-row gap-2 flex-wrap",
|
|
37643
|
+
className: "flex flex-row gap-2 flex-wrap shrink-0",
|
|
37643
37644
|
children: families.map(function (family) {
|
|
37644
37645
|
var isActive = activeFamily === family;
|
|
37645
37646
|
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
@@ -37652,7 +37653,10 @@ var InlineHexPicker = function InlineHexPicker(_ref5) {
|
|
|
37652
37653
|
}, family);
|
|
37653
37654
|
})
|
|
37654
37655
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37655
|
-
className: "grid grid-cols-12 gap-1",
|
|
37656
|
+
className: "grid grid-cols-12 gap-1 flex-1 min-h-0",
|
|
37657
|
+
style: {
|
|
37658
|
+
gridAutoRows: "1fr"
|
|
37659
|
+
},
|
|
37656
37660
|
children: swatches.map(function (hex) {
|
|
37657
37661
|
var isSelected = selectedHex && hex.toLowerCase() === selectedHex.toLowerCase();
|
|
37658
37662
|
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
@@ -37663,14 +37667,17 @@ var InlineHexPicker = function InlineHexPicker(_ref5) {
|
|
|
37663
37667
|
style: {
|
|
37664
37668
|
backgroundColor: hex
|
|
37665
37669
|
},
|
|
37666
|
-
className: "h-
|
|
37670
|
+
className: "w-full h-full rounded transition-transform hover:scale-110 ".concat(isSelected ? "border-2 border-yellow-400 scale-110" : ""),
|
|
37667
37671
|
"aria-label": "Pick ".concat(hex),
|
|
37668
37672
|
title: hex
|
|
37669
37673
|
}, hex);
|
|
37670
37674
|
})
|
|
37671
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
37672
|
-
|
|
37673
|
-
|
|
37675
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37676
|
+
className: "shrink-0",
|
|
37677
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CustomHexColorPane, {
|
|
37678
|
+
onApply: onPick,
|
|
37679
|
+
label: "Or paste a hex value"
|
|
37680
|
+
})
|
|
37674
37681
|
})]
|
|
37675
37682
|
});
|
|
37676
37683
|
};
|
|
@@ -37834,12 +37841,9 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref8) {
|
|
|
37834
37841
|
}
|
|
37835
37842
|
var previewTheme = buildTheme();
|
|
37836
37843
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37837
|
-
className: inline ? "flex flex-col gap-4" : "flex flex-col gap-4 p-6
|
|
37838
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
37839
|
-
className: "
|
|
37840
|
-
children: "Generate from Color"
|
|
37841
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37842
|
-
className: "flex flex-col gap-2",
|
|
37844
|
+
className: inline ? "flex flex-col gap-4 flex-1 min-h-0" : "flex flex-col gap-4 p-6 flex-1 min-h-0",
|
|
37845
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37846
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
37843
37847
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
37844
37848
|
className: "text-xs opacity-50",
|
|
37845
37849
|
children: "Harmony"
|
|
@@ -37859,35 +37863,38 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref8) {
|
|
|
37859
37863
|
})
|
|
37860
37864
|
})]
|
|
37861
37865
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37862
|
-
className: "
|
|
37863
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
37864
|
-
className: "
|
|
37865
|
-
children: "
|
|
37866
|
-
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
|
|
37866
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-6 flex-1 min-h-0",
|
|
37867
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37868
|
+
className: "flex flex-col gap-2 min-h-0",
|
|
37869
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
37870
|
+
className: "text-xs opacity-50 shrink-0",
|
|
37871
|
+
children: "Base Color"
|
|
37872
|
+
}), /*#__PURE__*/jsxRuntime.jsx(InlineHexPicker, {
|
|
37873
|
+
selectedHex: DashReact.isHexColor(selectedColor) ? selectedColor : null,
|
|
37874
|
+
onPick: function onPick(hex) {
|
|
37875
|
+
return setSelectedColor(hex);
|
|
37876
|
+
}
|
|
37877
|
+
})]
|
|
37878
|
+
}), /*#__PURE__*/jsxRuntime.jsx(HslNudgePanel, {
|
|
37879
|
+
dH: dH,
|
|
37880
|
+
dS: dS,
|
|
37881
|
+
dL: dL,
|
|
37882
|
+
onChange: function onChange(_ref9) {
|
|
37883
|
+
var h = _ref9.dH,
|
|
37884
|
+
s = _ref9.dS,
|
|
37885
|
+
l = _ref9.dL;
|
|
37886
|
+
setDH(h);
|
|
37887
|
+
setDS(s);
|
|
37888
|
+
setDL(l);
|
|
37870
37889
|
}
|
|
37871
37890
|
})]
|
|
37872
|
-
}), /*#__PURE__*/jsxRuntime.jsx(HslNudgePanel, {
|
|
37873
|
-
dH: dH,
|
|
37874
|
-
dS: dS,
|
|
37875
|
-
dL: dL,
|
|
37876
|
-
onChange: function onChange(_ref9) {
|
|
37877
|
-
var h = _ref9.dH,
|
|
37878
|
-
s = _ref9.dS,
|
|
37879
|
-
l = _ref9.dL;
|
|
37880
|
-
setDH(h);
|
|
37881
|
-
setDS(s);
|
|
37882
|
-
setDL(l);
|
|
37883
|
-
}
|
|
37884
37891
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37885
|
-
className: "flex flex-col gap-2",
|
|
37892
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
37886
37893
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
37887
37894
|
className: "text-xs opacity-50",
|
|
37888
37895
|
children: "Generated Palette"
|
|
37889
37896
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37890
|
-
className: "flex flex-row gap-2",
|
|
37897
|
+
className: "flex flex-row gap-2 h-20",
|
|
37891
37898
|
children: [/*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37892
37899
|
value: previewTheme.primary,
|
|
37893
37900
|
label: "Primary"
|
|
@@ -38070,29 +38077,29 @@ var RandomPreview = function RandomPreview(_ref1) {
|
|
|
38070
38077
|
setSeed(generateRandomHexTheme());
|
|
38071
38078
|
}
|
|
38072
38079
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38073
|
-
className: "flex flex-col gap-4",
|
|
38074
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("
|
|
38075
|
-
className: "
|
|
38076
|
-
children:
|
|
38077
|
-
|
|
38078
|
-
|
|
38079
|
-
|
|
38080
|
-
|
|
38081
|
-
|
|
38082
|
-
|
|
38083
|
-
|
|
38084
|
-
|
|
38085
|
-
|
|
38086
|
-
|
|
38087
|
-
|
|
38088
|
-
}
|
|
38080
|
+
className: "flex flex-col gap-4 flex-1 min-h-0",
|
|
38081
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38082
|
+
className: "flex-1 min-h-0",
|
|
38083
|
+
children: /*#__PURE__*/jsxRuntime.jsx(HslNudgePanel, {
|
|
38084
|
+
dH: dH,
|
|
38085
|
+
dS: dS,
|
|
38086
|
+
dL: dL,
|
|
38087
|
+
onChange: function onChange(_ref10) {
|
|
38088
|
+
var h = _ref10.dH,
|
|
38089
|
+
s = _ref10.dS,
|
|
38090
|
+
l = _ref10.dL;
|
|
38091
|
+
setDH(h);
|
|
38092
|
+
setDS(s);
|
|
38093
|
+
setDL(l);
|
|
38094
|
+
}
|
|
38095
|
+
})
|
|
38089
38096
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38090
|
-
className: "flex flex-col gap-2",
|
|
38097
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
38091
38098
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38092
38099
|
className: "text-xs opacity-50",
|
|
38093
38100
|
children: "Generated Palette"
|
|
38094
38101
|
}), previewTheme && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38095
|
-
className: "flex flex-row gap-2",
|
|
38102
|
+
className: "flex flex-row gap-2 h-20",
|
|
38096
38103
|
children: [/*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
38097
38104
|
value: previewTheme.primary,
|
|
38098
38105
|
label: "Primary"
|
|
@@ -38144,19 +38151,13 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
|
|
|
38144
38151
|
setWizardTheme(null);
|
|
38145
38152
|
}
|
|
38146
38153
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38147
|
-
className: "flex flex-col gap-
|
|
38148
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
38149
|
-
|
|
38150
|
-
|
|
38151
|
-
|
|
38152
|
-
|
|
38153
|
-
|
|
38154
|
-
value: wizardName,
|
|
38155
|
-
onChange: function onChange(val) {
|
|
38156
|
-
return setWizardName(val);
|
|
38157
|
-
},
|
|
38158
|
-
placeholder: "Theme name..."
|
|
38159
|
-
})]
|
|
38154
|
+
className: "flex flex-col gap-4 p-6 flex-1 min-h-0 overflow-hidden",
|
|
38155
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
38156
|
+
value: wizardName,
|
|
38157
|
+
onChange: function onChange(val) {
|
|
38158
|
+
return setWizardName(val);
|
|
38159
|
+
},
|
|
38160
|
+
placeholder: "Theme name..."
|
|
38160
38161
|
}), showMethodPicker && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38161
38162
|
className: "flex flex-col gap-2",
|
|
38162
38163
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|