@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.esm.js
CHANGED
|
@@ -37583,16 +37583,17 @@ var PresetGallery = function PresetGallery(_ref3) {
|
|
|
37583
37583
|
/**
|
|
37584
37584
|
* Render a swatch for a generated palette channel. Hex values render
|
|
37585
37585
|
* inline; named Tailwind families fall back to `bg-{name}-500` which
|
|
37586
|
-
* is in the safelist.
|
|
37586
|
+
* is in the safelist. Height is set by the parent flex/grid so the
|
|
37587
|
+
* generated-palette row can grow to fill available space.
|
|
37587
37588
|
*/
|
|
37588
37589
|
var PaletteSwatch = function PaletteSwatch(_ref4) {
|
|
37589
37590
|
var value = _ref4.value,
|
|
37590
37591
|
label = _ref4.label;
|
|
37591
37592
|
var isHex = isHexColor$1(value);
|
|
37592
37593
|
return /*#__PURE__*/jsxs("div", {
|
|
37593
|
-
className: "flex flex-col items-center gap-1 flex-1",
|
|
37594
|
+
className: "flex flex-col items-center gap-1 flex-1 min-h-0",
|
|
37594
37595
|
children: [/*#__PURE__*/jsx("div", {
|
|
37595
|
-
className: "h-
|
|
37596
|
+
className: "flex-1 min-h-0 w-full rounded ".concat(isHex ? "" : "bg-".concat(value, "-500")),
|
|
37596
37597
|
style: isHex ? {
|
|
37597
37598
|
backgroundColor: value
|
|
37598
37599
|
} : undefined
|
|
@@ -37619,9 +37620,9 @@ var InlineHexPicker = function InlineHexPicker(_ref5) {
|
|
|
37619
37620
|
setActiveFamily = _useState2[1];
|
|
37620
37621
|
var swatches = getCuratedColorGrid(activeFamily);
|
|
37621
37622
|
return /*#__PURE__*/jsxs("div", {
|
|
37622
|
-
className: "flex flex-col gap-2",
|
|
37623
|
+
className: "flex flex-col gap-2 flex-1 min-h-0",
|
|
37623
37624
|
children: [/*#__PURE__*/jsx("div", {
|
|
37624
|
-
className: "flex flex-row gap-2 flex-wrap",
|
|
37625
|
+
className: "flex flex-row gap-2 flex-wrap shrink-0",
|
|
37625
37626
|
children: families.map(function (family) {
|
|
37626
37627
|
var isActive = activeFamily === family;
|
|
37627
37628
|
return /*#__PURE__*/jsx("button", {
|
|
@@ -37634,7 +37635,10 @@ var InlineHexPicker = function InlineHexPicker(_ref5) {
|
|
|
37634
37635
|
}, family);
|
|
37635
37636
|
})
|
|
37636
37637
|
}), /*#__PURE__*/jsx("div", {
|
|
37637
|
-
className: "grid grid-cols-12 gap-1",
|
|
37638
|
+
className: "grid grid-cols-12 gap-1 flex-1 min-h-0",
|
|
37639
|
+
style: {
|
|
37640
|
+
gridAutoRows: "1fr"
|
|
37641
|
+
},
|
|
37638
37642
|
children: swatches.map(function (hex) {
|
|
37639
37643
|
var isSelected = selectedHex && hex.toLowerCase() === selectedHex.toLowerCase();
|
|
37640
37644
|
return /*#__PURE__*/jsx("button", {
|
|
@@ -37645,14 +37649,17 @@ var InlineHexPicker = function InlineHexPicker(_ref5) {
|
|
|
37645
37649
|
style: {
|
|
37646
37650
|
backgroundColor: hex
|
|
37647
37651
|
},
|
|
37648
|
-
className: "h-
|
|
37652
|
+
className: "w-full h-full rounded transition-transform hover:scale-110 ".concat(isSelected ? "border-2 border-yellow-400 scale-110" : ""),
|
|
37649
37653
|
"aria-label": "Pick ".concat(hex),
|
|
37650
37654
|
title: hex
|
|
37651
37655
|
}, hex);
|
|
37652
37656
|
})
|
|
37653
|
-
}), /*#__PURE__*/jsx(
|
|
37654
|
-
|
|
37655
|
-
|
|
37657
|
+
}), /*#__PURE__*/jsx("div", {
|
|
37658
|
+
className: "shrink-0",
|
|
37659
|
+
children: /*#__PURE__*/jsx(CustomHexColorPane, {
|
|
37660
|
+
onApply: onPick,
|
|
37661
|
+
label: "Or paste a hex value"
|
|
37662
|
+
})
|
|
37656
37663
|
})]
|
|
37657
37664
|
});
|
|
37658
37665
|
};
|
|
@@ -37816,12 +37823,9 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref8) {
|
|
|
37816
37823
|
}
|
|
37817
37824
|
var previewTheme = buildTheme();
|
|
37818
37825
|
return /*#__PURE__*/jsxs("div", {
|
|
37819
|
-
className: inline ? "flex flex-col gap-4" : "flex flex-col gap-4 p-6
|
|
37820
|
-
children: [/*#__PURE__*/
|
|
37821
|
-
className: "
|
|
37822
|
-
children: "Generate from Color"
|
|
37823
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
37824
|
-
className: "flex flex-col gap-2",
|
|
37826
|
+
className: inline ? "flex flex-col gap-4 flex-1 min-h-0" : "flex flex-col gap-4 p-6 flex-1 min-h-0",
|
|
37827
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
37828
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
37825
37829
|
children: [/*#__PURE__*/jsx("span", {
|
|
37826
37830
|
className: "text-xs opacity-50",
|
|
37827
37831
|
children: "Harmony"
|
|
@@ -37841,35 +37845,38 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref8) {
|
|
|
37841
37845
|
})
|
|
37842
37846
|
})]
|
|
37843
37847
|
}), /*#__PURE__*/jsxs("div", {
|
|
37844
|
-
className: "
|
|
37845
|
-
children: [/*#__PURE__*/
|
|
37846
|
-
className: "
|
|
37847
|
-
children: "
|
|
37848
|
-
|
|
37849
|
-
|
|
37850
|
-
|
|
37851
|
-
|
|
37848
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-6 flex-1 min-h-0",
|
|
37849
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
37850
|
+
className: "flex flex-col gap-2 min-h-0",
|
|
37851
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
37852
|
+
className: "text-xs opacity-50 shrink-0",
|
|
37853
|
+
children: "Base Color"
|
|
37854
|
+
}), /*#__PURE__*/jsx(InlineHexPicker, {
|
|
37855
|
+
selectedHex: isHexColor$1(selectedColor) ? selectedColor : null,
|
|
37856
|
+
onPick: function onPick(hex) {
|
|
37857
|
+
return setSelectedColor(hex);
|
|
37858
|
+
}
|
|
37859
|
+
})]
|
|
37860
|
+
}), /*#__PURE__*/jsx(HslNudgePanel, {
|
|
37861
|
+
dH: dH,
|
|
37862
|
+
dS: dS,
|
|
37863
|
+
dL: dL,
|
|
37864
|
+
onChange: function onChange(_ref9) {
|
|
37865
|
+
var h = _ref9.dH,
|
|
37866
|
+
s = _ref9.dS,
|
|
37867
|
+
l = _ref9.dL;
|
|
37868
|
+
setDH(h);
|
|
37869
|
+
setDS(s);
|
|
37870
|
+
setDL(l);
|
|
37852
37871
|
}
|
|
37853
37872
|
})]
|
|
37854
|
-
}), /*#__PURE__*/jsx(HslNudgePanel, {
|
|
37855
|
-
dH: dH,
|
|
37856
|
-
dS: dS,
|
|
37857
|
-
dL: dL,
|
|
37858
|
-
onChange: function onChange(_ref9) {
|
|
37859
|
-
var h = _ref9.dH,
|
|
37860
|
-
s = _ref9.dS,
|
|
37861
|
-
l = _ref9.dL;
|
|
37862
|
-
setDH(h);
|
|
37863
|
-
setDS(s);
|
|
37864
|
-
setDL(l);
|
|
37865
|
-
}
|
|
37866
37873
|
}), /*#__PURE__*/jsxs("div", {
|
|
37867
|
-
className: "flex flex-col gap-2",
|
|
37874
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
37868
37875
|
children: [/*#__PURE__*/jsx("span", {
|
|
37869
37876
|
className: "text-xs opacity-50",
|
|
37870
37877
|
children: "Generated Palette"
|
|
37871
37878
|
}), /*#__PURE__*/jsxs("div", {
|
|
37872
|
-
className: "flex flex-row gap-2",
|
|
37879
|
+
className: "flex flex-row gap-2 h-20",
|
|
37873
37880
|
children: [/*#__PURE__*/jsx(PaletteSwatch, {
|
|
37874
37881
|
value: previewTheme.primary,
|
|
37875
37882
|
label: "Primary"
|
|
@@ -38052,29 +38059,29 @@ var RandomPreview = function RandomPreview(_ref1) {
|
|
|
38052
38059
|
setSeed(generateRandomHexTheme());
|
|
38053
38060
|
}
|
|
38054
38061
|
return /*#__PURE__*/jsxs("div", {
|
|
38055
|
-
className: "flex flex-col gap-4",
|
|
38056
|
-
children: [/*#__PURE__*/jsx("
|
|
38057
|
-
className: "
|
|
38058
|
-
children:
|
|
38059
|
-
|
|
38060
|
-
|
|
38061
|
-
|
|
38062
|
-
|
|
38063
|
-
|
|
38064
|
-
|
|
38065
|
-
|
|
38066
|
-
|
|
38067
|
-
|
|
38068
|
-
|
|
38069
|
-
|
|
38070
|
-
}
|
|
38062
|
+
className: "flex flex-col gap-4 flex-1 min-h-0",
|
|
38063
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
38064
|
+
className: "flex-1 min-h-0",
|
|
38065
|
+
children: /*#__PURE__*/jsx(HslNudgePanel, {
|
|
38066
|
+
dH: dH,
|
|
38067
|
+
dS: dS,
|
|
38068
|
+
dL: dL,
|
|
38069
|
+
onChange: function onChange(_ref10) {
|
|
38070
|
+
var h = _ref10.dH,
|
|
38071
|
+
s = _ref10.dS,
|
|
38072
|
+
l = _ref10.dL;
|
|
38073
|
+
setDH(h);
|
|
38074
|
+
setDS(s);
|
|
38075
|
+
setDL(l);
|
|
38076
|
+
}
|
|
38077
|
+
})
|
|
38071
38078
|
}), /*#__PURE__*/jsxs("div", {
|
|
38072
|
-
className: "flex flex-col gap-2",
|
|
38079
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
38073
38080
|
children: [/*#__PURE__*/jsx("span", {
|
|
38074
38081
|
className: "text-xs opacity-50",
|
|
38075
38082
|
children: "Generated Palette"
|
|
38076
38083
|
}), previewTheme && /*#__PURE__*/jsxs("div", {
|
|
38077
|
-
className: "flex flex-row gap-2",
|
|
38084
|
+
className: "flex flex-row gap-2 h-20",
|
|
38078
38085
|
children: [/*#__PURE__*/jsx(PaletteSwatch, {
|
|
38079
38086
|
value: previewTheme.primary,
|
|
38080
38087
|
label: "Primary"
|
|
@@ -38126,19 +38133,13 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
|
|
|
38126
38133
|
setWizardTheme(null);
|
|
38127
38134
|
}
|
|
38128
38135
|
return /*#__PURE__*/jsxs("div", {
|
|
38129
|
-
className: "flex flex-col gap-
|
|
38130
|
-
children: [/*#__PURE__*/
|
|
38131
|
-
|
|
38132
|
-
|
|
38133
|
-
|
|
38134
|
-
|
|
38135
|
-
|
|
38136
|
-
value: wizardName,
|
|
38137
|
-
onChange: function onChange(val) {
|
|
38138
|
-
return setWizardName(val);
|
|
38139
|
-
},
|
|
38140
|
-
placeholder: "Theme name..."
|
|
38141
|
-
})]
|
|
38136
|
+
className: "flex flex-col gap-4 p-6 flex-1 min-h-0 overflow-hidden",
|
|
38137
|
+
children: [/*#__PURE__*/jsx(InputText, {
|
|
38138
|
+
value: wizardName,
|
|
38139
|
+
onChange: function onChange(val) {
|
|
38140
|
+
return setWizardName(val);
|
|
38141
|
+
},
|
|
38142
|
+
placeholder: "Theme name..."
|
|
38142
38143
|
}), showMethodPicker && /*#__PURE__*/jsxs("div", {
|
|
38143
38144
|
className: "flex flex-col gap-2",
|
|
38144
38145
|
children: [/*#__PURE__*/jsx("span", {
|