@trops/dash-core 0.1.578 → 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 +85 -93
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +85 -93
- 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,11 +37863,11 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref8) {
|
|
|
37859
37863
|
})
|
|
37860
37864
|
})]
|
|
37861
37865
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37862
|
-
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
37866
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-6 flex-1 min-h-0",
|
|
37863
37867
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37864
|
-
className: "flex flex-col gap-2",
|
|
37868
|
+
className: "flex flex-col gap-2 min-h-0",
|
|
37865
37869
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
37866
|
-
className: "text-xs opacity-50",
|
|
37870
|
+
className: "text-xs opacity-50 shrink-0",
|
|
37867
37871
|
children: "Base Color"
|
|
37868
37872
|
}), /*#__PURE__*/jsxRuntime.jsx(InlineHexPicker, {
|
|
37869
37873
|
selectedHex: DashReact.isHexColor(selectedColor) ? selectedColor : null,
|
|
@@ -37871,41 +37875,38 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref8) {
|
|
|
37871
37875
|
return setSelectedColor(hex);
|
|
37872
37876
|
}
|
|
37873
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);
|
|
37889
|
+
}
|
|
37890
|
+
})]
|
|
37891
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37892
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
37893
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
37894
|
+
className: "text-xs opacity-50",
|
|
37895
|
+
children: "Generated Palette"
|
|
37874
37896
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37875
|
-
className: "flex flex-
|
|
37876
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
37877
|
-
|
|
37878
|
-
|
|
37879
|
-
|
|
37880
|
-
|
|
37881
|
-
|
|
37882
|
-
|
|
37883
|
-
|
|
37884
|
-
|
|
37885
|
-
|
|
37886
|
-
|
|
37887
|
-
|
|
37888
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37889
|
-
className: "flex flex-col gap-2",
|
|
37890
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
37891
|
-
className: "text-xs opacity-50",
|
|
37892
|
-
children: "Generated Palette"
|
|
37893
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37894
|
-
className: "flex flex-row gap-2",
|
|
37895
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37896
|
-
value: previewTheme.primary,
|
|
37897
|
-
label: "Primary"
|
|
37898
|
-
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37899
|
-
value: previewTheme.secondary,
|
|
37900
|
-
label: "Secondary"
|
|
37901
|
-
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37902
|
-
value: previewTheme.tertiary,
|
|
37903
|
-
label: "Tertiary"
|
|
37904
|
-
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37905
|
-
value: previewTheme.neutral,
|
|
37906
|
-
label: "Neutral"
|
|
37907
|
-
})]
|
|
37908
|
-
})]
|
|
37897
|
+
className: "flex flex-row gap-2 h-20",
|
|
37898
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37899
|
+
value: previewTheme.primary,
|
|
37900
|
+
label: "Primary"
|
|
37901
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37902
|
+
value: previewTheme.secondary,
|
|
37903
|
+
label: "Secondary"
|
|
37904
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37905
|
+
value: previewTheme.tertiary,
|
|
37906
|
+
label: "Tertiary"
|
|
37907
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
37908
|
+
value: previewTheme.neutral,
|
|
37909
|
+
label: "Neutral"
|
|
37909
37910
|
})]
|
|
37910
37911
|
})]
|
|
37911
37912
|
}), !inline && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
@@ -38076,13 +38077,10 @@ var RandomPreview = function RandomPreview(_ref1) {
|
|
|
38076
38077
|
setSeed(generateRandomHexTheme());
|
|
38077
38078
|
}
|
|
38078
38079
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38079
|
-
className: "flex flex-col gap-4",
|
|
38080
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("
|
|
38081
|
-
className: "
|
|
38082
|
-
children:
|
|
38083
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38084
|
-
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
38085
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(HslNudgePanel, {
|
|
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, {
|
|
38086
38084
|
dH: dH,
|
|
38087
38085
|
dS: dS,
|
|
38088
38086
|
dL: dL,
|
|
@@ -38094,26 +38092,26 @@ var RandomPreview = function RandomPreview(_ref1) {
|
|
|
38094
38092
|
setDS(s);
|
|
38095
38093
|
setDL(l);
|
|
38096
38094
|
}
|
|
38097
|
-
})
|
|
38098
|
-
|
|
38099
|
-
|
|
38100
|
-
|
|
38101
|
-
|
|
38102
|
-
|
|
38103
|
-
|
|
38104
|
-
|
|
38105
|
-
|
|
38106
|
-
|
|
38107
|
-
|
|
38108
|
-
|
|
38109
|
-
|
|
38110
|
-
|
|
38111
|
-
|
|
38112
|
-
|
|
38113
|
-
|
|
38114
|
-
|
|
38115
|
-
|
|
38116
|
-
|
|
38095
|
+
})
|
|
38096
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38097
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
38098
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38099
|
+
className: "text-xs opacity-50",
|
|
38100
|
+
children: "Generated Palette"
|
|
38101
|
+
}), previewTheme && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38102
|
+
className: "flex flex-row gap-2 h-20",
|
|
38103
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
38104
|
+
value: previewTheme.primary,
|
|
38105
|
+
label: "Primary"
|
|
38106
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
38107
|
+
value: previewTheme.secondary,
|
|
38108
|
+
label: "Secondary"
|
|
38109
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
38110
|
+
value: previewTheme.tertiary,
|
|
38111
|
+
label: "Tertiary"
|
|
38112
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PaletteSwatch, {
|
|
38113
|
+
value: previewTheme.neutral,
|
|
38114
|
+
label: "Neutral"
|
|
38117
38115
|
})]
|
|
38118
38116
|
})]
|
|
38119
38117
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
@@ -38153,19 +38151,13 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
|
|
|
38153
38151
|
setWizardTheme(null);
|
|
38154
38152
|
}
|
|
38155
38153
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38156
|
-
className: "flex flex-col gap-
|
|
38157
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
38158
|
-
|
|
38159
|
-
|
|
38160
|
-
|
|
38161
|
-
|
|
38162
|
-
|
|
38163
|
-
value: wizardName,
|
|
38164
|
-
onChange: function onChange(val) {
|
|
38165
|
-
return setWizardName(val);
|
|
38166
|
-
},
|
|
38167
|
-
placeholder: "Theme name..."
|
|
38168
|
-
})]
|
|
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..."
|
|
38169
38161
|
}), showMethodPicker && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38170
38162
|
className: "flex flex-col gap-2",
|
|
38171
38163
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|