@trops/dash-core 0.1.578 → 0.1.580
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 +86 -94
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +86 -94
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -34881,7 +34881,7 @@ var CustomHexColorPane = function CustomHexColorPane(_ref) {
|
|
|
34881
34881
|
}
|
|
34882
34882
|
}
|
|
34883
34883
|
return /*#__PURE__*/jsxs("div", {
|
|
34884
|
-
className: "flex flex-col gap-2
|
|
34884
|
+
className: "flex flex-col gap-2 py-3 border-t border-gray-700",
|
|
34885
34885
|
children: [/*#__PURE__*/jsx("span", {
|
|
34886
34886
|
className: "text-xs uppercase font-bold tracking-wider text-gray-400",
|
|
34887
34887
|
children: label
|
|
@@ -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,11 +37845,11 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref8) {
|
|
|
37841
37845
|
})
|
|
37842
37846
|
})]
|
|
37843
37847
|
}), /*#__PURE__*/jsxs("div", {
|
|
37844
|
-
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
37848
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-6 flex-1 min-h-0",
|
|
37845
37849
|
children: [/*#__PURE__*/jsxs("div", {
|
|
37846
|
-
className: "flex flex-col gap-2",
|
|
37850
|
+
className: "flex flex-col gap-2 min-h-0",
|
|
37847
37851
|
children: [/*#__PURE__*/jsx("span", {
|
|
37848
|
-
className: "text-xs opacity-50",
|
|
37852
|
+
className: "text-xs opacity-50 shrink-0",
|
|
37849
37853
|
children: "Base Color"
|
|
37850
37854
|
}), /*#__PURE__*/jsx(InlineHexPicker, {
|
|
37851
37855
|
selectedHex: isHexColor$1(selectedColor) ? selectedColor : null,
|
|
@@ -37853,41 +37857,38 @@ var ColorHarmonyPicker = function ColorHarmonyPicker(_ref8) {
|
|
|
37853
37857
|
return setSelectedColor(hex);
|
|
37854
37858
|
}
|
|
37855
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);
|
|
37871
|
+
}
|
|
37872
|
+
})]
|
|
37873
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
37874
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
37875
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
37876
|
+
className: "text-xs opacity-50",
|
|
37877
|
+
children: "Generated Palette"
|
|
37856
37878
|
}), /*#__PURE__*/jsxs("div", {
|
|
37857
|
-
className: "flex flex-
|
|
37858
|
-
children: [/*#__PURE__*/jsx(
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
|
|
37870
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
37871
|
-
className: "flex flex-col gap-2",
|
|
37872
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
37873
|
-
className: "text-xs opacity-50",
|
|
37874
|
-
children: "Generated Palette"
|
|
37875
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
37876
|
-
className: "flex flex-row gap-2",
|
|
37877
|
-
children: [/*#__PURE__*/jsx(PaletteSwatch, {
|
|
37878
|
-
value: previewTheme.primary,
|
|
37879
|
-
label: "Primary"
|
|
37880
|
-
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
37881
|
-
value: previewTheme.secondary,
|
|
37882
|
-
label: "Secondary"
|
|
37883
|
-
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
37884
|
-
value: previewTheme.tertiary,
|
|
37885
|
-
label: "Tertiary"
|
|
37886
|
-
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
37887
|
-
value: previewTheme.neutral,
|
|
37888
|
-
label: "Neutral"
|
|
37889
|
-
})]
|
|
37890
|
-
})]
|
|
37879
|
+
className: "flex flex-row gap-2 h-20",
|
|
37880
|
+
children: [/*#__PURE__*/jsx(PaletteSwatch, {
|
|
37881
|
+
value: previewTheme.primary,
|
|
37882
|
+
label: "Primary"
|
|
37883
|
+
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
37884
|
+
value: previewTheme.secondary,
|
|
37885
|
+
label: "Secondary"
|
|
37886
|
+
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
37887
|
+
value: previewTheme.tertiary,
|
|
37888
|
+
label: "Tertiary"
|
|
37889
|
+
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
37890
|
+
value: previewTheme.neutral,
|
|
37891
|
+
label: "Neutral"
|
|
37891
37892
|
})]
|
|
37892
37893
|
})]
|
|
37893
37894
|
}), !inline && /*#__PURE__*/jsx(Button, {
|
|
@@ -38058,13 +38059,10 @@ var RandomPreview = function RandomPreview(_ref1) {
|
|
|
38058
38059
|
setSeed(generateRandomHexTheme());
|
|
38059
38060
|
}
|
|
38060
38061
|
return /*#__PURE__*/jsxs("div", {
|
|
38061
|
-
className: "flex flex-col gap-4",
|
|
38062
|
-
children: [/*#__PURE__*/jsx("
|
|
38063
|
-
className: "
|
|
38064
|
-
children:
|
|
38065
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
38066
|
-
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
38067
|
-
children: [/*#__PURE__*/jsx(HslNudgePanel, {
|
|
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, {
|
|
38068
38066
|
dH: dH,
|
|
38069
38067
|
dS: dS,
|
|
38070
38068
|
dL: dL,
|
|
@@ -38076,26 +38074,26 @@ var RandomPreview = function RandomPreview(_ref1) {
|
|
|
38076
38074
|
setDS(s);
|
|
38077
38075
|
setDL(l);
|
|
38078
38076
|
}
|
|
38079
|
-
})
|
|
38080
|
-
|
|
38081
|
-
|
|
38082
|
-
|
|
38083
|
-
|
|
38084
|
-
|
|
38085
|
-
|
|
38086
|
-
|
|
38087
|
-
|
|
38088
|
-
|
|
38089
|
-
|
|
38090
|
-
|
|
38091
|
-
|
|
38092
|
-
|
|
38093
|
-
|
|
38094
|
-
|
|
38095
|
-
|
|
38096
|
-
|
|
38097
|
-
|
|
38098
|
-
|
|
38077
|
+
})
|
|
38078
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
38079
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
38080
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
38081
|
+
className: "text-xs opacity-50",
|
|
38082
|
+
children: "Generated Palette"
|
|
38083
|
+
}), previewTheme && /*#__PURE__*/jsxs("div", {
|
|
38084
|
+
className: "flex flex-row gap-2 h-20",
|
|
38085
|
+
children: [/*#__PURE__*/jsx(PaletteSwatch, {
|
|
38086
|
+
value: previewTheme.primary,
|
|
38087
|
+
label: "Primary"
|
|
38088
|
+
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
38089
|
+
value: previewTheme.secondary,
|
|
38090
|
+
label: "Secondary"
|
|
38091
|
+
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
38092
|
+
value: previewTheme.tertiary,
|
|
38093
|
+
label: "Tertiary"
|
|
38094
|
+
}), /*#__PURE__*/jsx(PaletteSwatch, {
|
|
38095
|
+
value: previewTheme.neutral,
|
|
38096
|
+
label: "Neutral"
|
|
38099
38097
|
})]
|
|
38100
38098
|
})]
|
|
38101
38099
|
}), /*#__PURE__*/jsx(Button, {
|
|
@@ -38135,19 +38133,13 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
|
|
|
38135
38133
|
setWizardTheme(null);
|
|
38136
38134
|
}
|
|
38137
38135
|
return /*#__PURE__*/jsxs("div", {
|
|
38138
|
-
className: "flex flex-col gap-
|
|
38139
|
-
children: [/*#__PURE__*/
|
|
38140
|
-
|
|
38141
|
-
|
|
38142
|
-
|
|
38143
|
-
|
|
38144
|
-
|
|
38145
|
-
value: wizardName,
|
|
38146
|
-
onChange: function onChange(val) {
|
|
38147
|
-
return setWizardName(val);
|
|
38148
|
-
},
|
|
38149
|
-
placeholder: "Theme name..."
|
|
38150
|
-
})]
|
|
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..."
|
|
38151
38143
|
}), showMethodPicker && /*#__PURE__*/jsxs("div", {
|
|
38152
38144
|
className: "flex flex-col gap-2",
|
|
38153
38145
|
children: [/*#__PURE__*/jsx("span", {
|