@trops/dash-core 0.1.570 → 0.1.571
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 +71 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +70 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
2
2
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import * as DashReact from '@trops/dash-react';
|
|
5
|
-
import { isObject, ThemeContext, Modal, FontAwesomeIcon, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, isHexColor, deriveShades, TAILWIND_PALETTE, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, MenuItem, Tag2, ButtonIcon3, normalizeHex, contrastRatio, Caption2, Caption, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, ThemeFromUrlPane, TextArea, CodeEditorInline, Icon2, AlgoliaSearchBox, CommandPalette, useSidebar, Divider, Caption3, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
|
|
5
|
+
import { isObject, ThemeContext, Modal, FontAwesomeIcon, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, isHexColor, deriveShades, TAILWIND_PALETTE, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, MenuItem, Tag2, ButtonIcon3, normalizeHex, contrastRatio, Caption2, Caption, getColorFamilies, getCuratedColorGrid, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, ThemeFromUrlPane, TextArea, CodeEditorInline, Icon2, AlgoliaSearchBox, CommandPalette, useSidebar, Divider, Caption3, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
|
|
6
6
|
export * from '@trops/dash-react';
|
|
7
7
|
export { ThemeContext } from '@trops/dash-react';
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -36930,6 +36930,52 @@ var CustomHexColorPane = function CustomHexColorPane(_ref) {
|
|
|
36930
36930
|
});
|
|
36931
36931
|
};
|
|
36932
36932
|
|
|
36933
|
+
var CategorizedColorGrid = function CategorizedColorGrid(_ref) {
|
|
36934
|
+
var onSelect = _ref.onSelect,
|
|
36935
|
+
_ref$selectedHex = _ref.selectedHex,
|
|
36936
|
+
selectedHex = _ref$selectedHex === void 0 ? null : _ref$selectedHex;
|
|
36937
|
+
var families = getColorFamilies();
|
|
36938
|
+
var _useState = useState(families[0]),
|
|
36939
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36940
|
+
activeFamily = _useState2[0],
|
|
36941
|
+
setActiveFamily = _useState2[1];
|
|
36942
|
+
var colors = getCuratedColorGrid(activeFamily);
|
|
36943
|
+
return /*#__PURE__*/jsxs("div", {
|
|
36944
|
+
className: "flex flex-col gap-3 p-3",
|
|
36945
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
36946
|
+
className: "flex flex-row gap-2 flex-wrap",
|
|
36947
|
+
children: families.map(function (family) {
|
|
36948
|
+
var isActive = activeFamily === family;
|
|
36949
|
+
return /*#__PURE__*/jsx("button", {
|
|
36950
|
+
type: "button",
|
|
36951
|
+
onClick: function onClick() {
|
|
36952
|
+
return setActiveFamily(family);
|
|
36953
|
+
},
|
|
36954
|
+
className: "px-3 py-1 rounded-full text-xs font-medium transition-colors ".concat(isActive ? "bg-blue-600 text-white" : "bg-gray-700 text-gray-300 hover:bg-gray-600"),
|
|
36955
|
+
children: family
|
|
36956
|
+
}, family);
|
|
36957
|
+
})
|
|
36958
|
+
}), /*#__PURE__*/jsx("div", {
|
|
36959
|
+
className: "grid grid-cols-6 gap-1",
|
|
36960
|
+
children: colors.map(function (hex) {
|
|
36961
|
+
var isSelected = selectedHex && hex.toLowerCase() === selectedHex.toLowerCase();
|
|
36962
|
+
return /*#__PURE__*/jsx("button", {
|
|
36963
|
+
type: "button",
|
|
36964
|
+
onClick: function onClick() {
|
|
36965
|
+
return onSelect(hex);
|
|
36966
|
+
},
|
|
36967
|
+
title: hex,
|
|
36968
|
+
className: "aspect-square rounded transition-transform hover:scale-110 focus:scale-110 focus:outline-none ".concat(isSelected ? "ring-2 ring-white scale-110" : ""),
|
|
36969
|
+
style: {
|
|
36970
|
+
backgroundColor: hex
|
|
36971
|
+
},
|
|
36972
|
+
"aria-label": "Select color ".concat(hex)
|
|
36973
|
+
}, hex);
|
|
36974
|
+
})
|
|
36975
|
+
})]
|
|
36976
|
+
});
|
|
36977
|
+
};
|
|
36978
|
+
|
|
36933
36979
|
var AvailableColorsGridPane = function AvailableColorsGridPane(_ref) {
|
|
36934
36980
|
var _ref$currentColor = _ref.currentColor,
|
|
36935
36981
|
currentColor = _ref$currentColor === void 0 ? null : _ref$currentColor,
|
|
@@ -37003,23 +37049,34 @@ var AvailableColorsGridPane = function AvailableColorsGridPane(_ref) {
|
|
|
37003
37049
|
scrollable: true,
|
|
37004
37050
|
children: [/*#__PURE__*/jsx(DashPanel.Header, {
|
|
37005
37051
|
title: "AvailableColors"
|
|
37006
|
-
}), /*#__PURE__*/
|
|
37052
|
+
}), /*#__PURE__*/jsx(DashPanel.Body, {
|
|
37007
37053
|
scrollable: true,
|
|
37008
37054
|
space: true,
|
|
37009
|
-
children:
|
|
37055
|
+
children: shade !== null ? /*#__PURE__*/jsxs(Fragment, {
|
|
37056
|
+
children: [/*#__PURE__*/jsx(CategorizedColorGrid, {
|
|
37057
|
+
onSelect: function onSelect(hex) {
|
|
37058
|
+
return handleChooseColor({
|
|
37059
|
+
colorName: hex,
|
|
37060
|
+
colorType: colorType,
|
|
37061
|
+
shade: shade || 500,
|
|
37062
|
+
panelType: "main"
|
|
37063
|
+
});
|
|
37064
|
+
}
|
|
37065
|
+
}), /*#__PURE__*/jsx(CustomHexColorPane, {
|
|
37066
|
+
onApply: function onApply(hex) {
|
|
37067
|
+
return handleChooseColor({
|
|
37068
|
+
colorName: hex,
|
|
37069
|
+
colorType: colorType,
|
|
37070
|
+
shade: shade || 500,
|
|
37071
|
+
panelType: "main"
|
|
37072
|
+
});
|
|
37073
|
+
},
|
|
37074
|
+
label: "Custom hex for ".concat(colorType || "channel")
|
|
37075
|
+
})]
|
|
37076
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
37010
37077
|
className: "flex flex-col space-y-1",
|
|
37011
37078
|
children: renderAvailableColors()
|
|
37012
|
-
})
|
|
37013
|
-
onApply: function onApply(hex) {
|
|
37014
|
-
return handleChooseColor({
|
|
37015
|
-
colorName: hex,
|
|
37016
|
-
colorType: colorType,
|
|
37017
|
-
shade: shade || 500,
|
|
37018
|
-
panelType: "main"
|
|
37019
|
-
});
|
|
37020
|
-
},
|
|
37021
|
-
label: "Custom hex for ".concat(colorType || "channel")
|
|
37022
|
-
})]
|
|
37079
|
+
})
|
|
37023
37080
|
}), onCancel && /*#__PURE__*/jsx(DashPanel.Footer, {
|
|
37024
37081
|
children: /*#__PURE__*/jsx(Button, {
|
|
37025
37082
|
title: "Cancel",
|