@manufac/react-components-potli 1.0.3 → 1.0.4

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.
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { colorPaletteItem, ColorOptions } from "./utils";
2
3
  import { Select } from "@mantine/core";
3
4
  export function CustomColorSelect(props) {
4
- return _jsx(Select, { ...props });
5
+ return (_jsx(Select, { placeholder: "Select color palette for chart", renderOption: colorPaletteItem, data: ColorOptions, ...props }));
5
6
  }
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/CustomColorPalette/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAQvC,MAAM,UAAU,iBAAiB,CAAC,KAAkB;IAClD,OAAO,KAAC,MAAM,OAAK,KAAK,GAAI,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/CustomColorPalette/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AASvC,MAAM,UAAU,iBAAiB,CAAC,KAA8B;IAC9D,OAAO,CACL,KAAC,MAAM,IACL,WAAW,EAAC,gCAAgC,EAC5C,YAAY,EAAE,gBAAgB,EAC9B,IAAI,EAAE,YAAY,KACd,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { CustomColorSelect } from ".";
2
+ export default {
3
+ title: "CustomColorSelect",
4
+ component: CustomColorSelect,
5
+ };
6
+ export const Template = {};
7
+ //# sourceMappingURL=index.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/CustomColorPalette/index.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAGtC,eAAe;IACb,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,iBAAiB;CACK,CAAC;AAEpC,MAAM,CAAC,MAAM,QAAQ,GAAuC,EAAE,CAAC"}
@@ -1,3 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Group, ThemeIcon, Text } from "@mantine/core";
1
3
  import { schemeAccent, schemeBlues, schemeBrBG, schemeBuPu, schemeCategory10, schemeDark2, schemeGreens, schemeGreys, schemeObservable10, schemeOranges, schemeOrRd, schemePaired, schemePiYG, schemePRGn, schemePuBuGn, schemePuOr, schemePurples, schemeRdBu, schemeRdGy, schemeRdYlBu, schemeRdYlGn, schemeReds, schemeSet1, schemeSet2, schemeSpectral, schemeTableau10, schemeYlOrBr, schemeYlOrRd, } from "d3-scale-chromatic";
2
4
  export const ColorSchemeMap = {
3
5
  Categorical: {
@@ -43,4 +45,53 @@ export const ColorPalette = {
43
45
  ...ColorSchemeMap.SequentialMultiHue,
44
46
  ...ColorSchemeMap.Diverging,
45
47
  };
48
+ export const ColorSchemeLabels = {
49
+ "color-scheme-category-10": "Category 10",
50
+ "color-scheme-accent": "Accent",
51
+ "color-scheme-dark-2": "Dark 2",
52
+ "color-scheme-observable-10": "Observable 10",
53
+ "color-scheme-paired": "Paired",
54
+ "color-scheme-set-1": "Set 1",
55
+ "color-scheme-set-2": "Set 2",
56
+ "color-scheme-tableau-10": "Tableau 10",
57
+ "color-scheme-blues": "Blues",
58
+ "color-scheme-greens": "Greens",
59
+ "color-scheme-greys": "Greys",
60
+ "color-scheme-oranges": "Oranges",
61
+ "color-scheme-purples": "Purples",
62
+ "color-scheme-reds": "Reds",
63
+ "color-scheme-yellow-orange-brown": "Yellow Orange Brown",
64
+ "color-scheme-yellow-orange-red": "Yellow Orange Red",
65
+ "color-scheme-orange-red": "Orange Red",
66
+ "color-scheme-purple-blue-green": "Purple Blue Green",
67
+ "color-scheme-blue-purple": "Blue Purple",
68
+ "color-scheme-brown-blue-green": "Brown Blue Green",
69
+ "color-scheme-purple-green": "Purple Green",
70
+ "color-scheme-pink-yellow-green": "Pink Yellow Green",
71
+ "color-scheme-purple-orange": "Purple Orange",
72
+ "color-scheme-red-blue": "Red Blue",
73
+ "color-scheme-red-grey": "Red Grey",
74
+ "color-scheme-red-yellow-blue": "Red Yellow Blue",
75
+ "color-scheme-red-yellow-green": "Red Yellow Green",
76
+ "color-scheme-spectral": "Spectral",
77
+ };
78
+ export const ColorOptions = Object.entries(ColorSchemeMap).map(([groupName, schemes]) => {
79
+ return {
80
+ group: groupName,
81
+ items: Object.keys(schemes).map((name) => {
82
+ return {
83
+ value: name,
84
+ label: ColorSchemeLabels[name],
85
+ groupName,
86
+ };
87
+ }),
88
+ };
89
+ });
90
+ export function colorPaletteItem({ option, }) {
91
+ const schemeGroup = ColorSchemeMap[option.groupName];
92
+ const colors = schemeGroup[option.value];
93
+ return (_jsxs(Group, { justify: "space-between", w: "100%", wrap: "nowrap", children: [_jsx(Text, { children: option.label }), _jsx(Group, { p: "xs", children: colors.map((color) => {
94
+ return _jsx(ThemeIcon, { bg: color, size: "xs" }, color);
95
+ }) })] }));
96
+ }
46
97
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/CustomColorPalette/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,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E,CAAC;QACjD,uBAAuB,EAAE,cAAc,CAAC,EAAE,CAAC;KAC5C;CACO,CAAC;AAQX,MAAM,CAAC,MAAM,YAAY,GAA+C;IACtE,GAAG,cAAc,CAAC,WAAW;IAC7B,GAAG,cAAc,CAAC,mBAAmB;IACrC,GAAG,cAAc,CAAC,kBAAkB;IACpC,GAAG,cAAc,CAAC,SAAS;CAC5B,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/CustomColorPalette/utils.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,oBAAoB,CAAC;AAQ5B,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,WAAW,EAAE;QACX,0BAA0B,EAAE,gBAAgB;QAC5C,qBAAqB,EAAE,YAAY;QACnC,qBAAqB,EAAE,WAAW;QAClC,4BAA4B,EAAE,kBAAkB;QAChD,qBAAqB,EAAE,YAAY;QACnC,oBAAoB,EAAE,UAAU;QAChC,oBAAoB,EAAE,UAAU;QAChC,yBAAyB,EAAE,eAAe;KAC3C;IAED,mBAAmB,EAAE;QACnB,oBAAoB,EAAE,WAAW,CAAC,CAAC,CAAC;QACpC,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAC;QACtC,oBAAoB,EAAE,WAAW,CAAC,CAAC,CAAC;QACpC,sBAAsB,EAAE,aAAa,CAAC,CAAC,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