@sendoutcards/quantum-design-ui 1.7.66 → 1.7.69

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.es.js CHANGED
@@ -12353,41 +12353,6 @@ var Capsule = function (_a) {
12353
12353
  }));
12354
12354
  };
12355
12355
 
12356
- var ColorThumbnail = function (_a) {
12357
- var backgroundColor = _a.backgroundColor,
12358
- isSelected = _a.isSelected,
12359
- onSelect = _a.onSelect,
12360
- _b = _a.thumbnailSize,
12361
- thumbnailSize = _b === void 0 ? '32px' : _b,
12362
- outset = _a.outset,
12363
- _c = _a.isRounded,
12364
- isRounded = _c === void 0 ? false : _c;
12365
- var selectedThumbnailSize = "calc(" + thumbnailSize + " / 2.75)";
12366
- return jsx(Flex, {
12367
- onClick: function () {
12368
- return onSelect(backgroundColor);
12369
- },
12370
- backgroundColor: backgroundColor,
12371
- whileHover: {
12372
- scale: 1.2
12373
- },
12374
- cursor: "pointer",
12375
- borderRadius: isRounded ? 'circle' : 'small',
12376
- width: thumbnailSize,
12377
- height: thumbnailSize,
12378
- minWidth: thumbnailSize,
12379
- outset: outset,
12380
- justifyContent: "center",
12381
- alignItems: "center"
12382
- }, isSelected && jsx(Div, {
12383
- backgroundColor: "foreground",
12384
- width: selectedThumbnailSize,
12385
- height: selectedThumbnailSize,
12386
- borderRadius: isRounded ? 'circle' : '3px',
12387
- boxShadow: "mediumLight"
12388
- }));
12389
- };
12390
-
12391
12356
  var computeButtonSizeProperties = function (size, sizeMap) {
12392
12357
  return mapSizeType(size, sizeMap);
12393
12358
  };
@@ -19711,20 +19676,20 @@ var DropperIcon = function (props) {
19711
19676
  };
19712
19677
 
19713
19678
  var QuantumColorPicker = function (_a) {
19679
+ var _b, _c, _d;
19680
+
19714
19681
  var color = _a.color,
19715
19682
  onChange = _a.onChange,
19716
19683
  convertedColorCallback = _a.convertedColorCallback,
19717
- _b = _a.convertedColorType,
19718
- convertedColorType = _b === void 0 ? 'hex' : _b,
19719
- _c = _a.showEyeDropper,
19720
- showEyeDropper = _c === void 0 ? false : _c,
19721
- palettes = _a.palettes,
19722
- _d = _a.paletteTitle,
19723
- paletteTitle = _d === void 0 ? 'Presets' : _d;
19684
+ _e = _a.convertedColorType,
19685
+ convertedColorType = _e === void 0 ? 'hex' : _e,
19686
+ _f = _a.showEyeDropper,
19687
+ showEyeDropper = _f === void 0 ? false : _f,
19688
+ palette = _a.palette;
19724
19689
 
19725
- var _e = useResizeObserver(),
19726
- ref = _e.ref,
19727
- width = _e.width;
19690
+ var _g = useResizeObserver(),
19691
+ ref = _g.ref,
19692
+ width = _g.width;
19728
19693
 
19729
19694
  var formattedHexValue = function (value) {
19730
19695
  return value.startsWith('#') ? value : "#" + value;
@@ -19757,6 +19722,7 @@ var QuantumColorPicker = function (_a) {
19757
19722
  }
19758
19723
  };
19759
19724
 
19725
+ var paletteArray = (_b = palette === null || palette === void 0 ? void 0 : palette.colors) !== null && _b !== void 0 ? _b : Array.from(Array((_c = palette === null || palette === void 0 ? void 0 : palette.count) !== null && _c !== void 0 ? _c : 12));
19760
19726
  return jsx(Div, {
19761
19727
  inset: "x2",
19762
19728
  display: "flex",
@@ -19794,11 +19760,11 @@ var QuantumColorPicker = function (_a) {
19794
19760
  return handleOnChange(formattedHexValue(value));
19795
19761
  },
19796
19762
  type: "text"
19797
- })), palettes && jsx(React.Fragment, null, jsx(Spacer, {
19763
+ })), (palette && palette.colors || (palette === null || palette === void 0 ? void 0 : palette.isLoading)) && jsx(React.Fragment, null, jsx(Spacer, {
19798
19764
  space: "x1"
19799
19765
  }), jsx(Text, {
19800
19766
  type: "caption",
19801
- content: paletteTitle,
19767
+ content: (_d = palette.title) !== null && _d !== void 0 ? _d : 'Presets',
19802
19768
  color: "primaryBody",
19803
19769
  lineHeight: 1.2,
19804
19770
  inset: {
@@ -19812,13 +19778,17 @@ var QuantumColorPicker = function (_a) {
19812
19778
  width: "100%",
19813
19779
  justifyContent: "flex-start",
19814
19780
  flexWrap: 'wrap',
19815
- alignItems: "center"
19816
- }, palettes.map(function (palette, index) {
19781
+ alignItems: "center",
19782
+ inset: {
19783
+ bottom: '6px'
19784
+ }
19785
+ }, paletteArray.map(function (paletteColor, index) {
19817
19786
  return jsx(ColorThumbnail, {
19818
19787
  key: index,
19819
19788
  isRounded: true,
19820
- backgroundColor: palette,
19821
- isSelected: palette === color,
19789
+ isLoading: palette.isLoading,
19790
+ backgroundColor: paletteColor,
19791
+ isSelected: paletteColor === color,
19822
19792
  onSelect: function (value) {
19823
19793
  handleOnChange(formattedHexValue(value));
19824
19794
  },
@@ -20915,13 +20885,13 @@ var StaticNavigation = function (_a) {
20915
20885
  onClick: function () {
20916
20886
  return setIsOpen(!isOpen);
20917
20887
  }
20918
- })), jsx(Logo, {
20888
+ })), !links && !isMobile && jsx("div", null), jsx(Logo, {
20919
20889
  brand: logo.brand,
20920
20890
  href: logo.href,
20921
20891
  onClick: logo.onClick,
20922
20892
  color: logo.color,
20923
20893
  width: isMobile ? '130px' : '200px'
20924
- }), !isMobile && jsx(Flex, {
20894
+ }), links && !isMobile && jsx(Flex, {
20925
20895
  height: "100%",
20926
20896
  width: "100%",
20927
20897
  alignItems: "center",
@@ -21013,7 +20983,7 @@ var StaticNavigation = function (_a) {
21013
20983
  subLinkColor: column.linkColor ? column.linkColor : 'primaryBody'
21014
20984
  })));
21015
20985
  }));
21016
- })))), isMobile && jsx(Div, {
20986
+ })))), links && isMobile && jsx(Div, {
21017
20987
  height: "calc(100% - " + drawerOffset + "px)",
21018
20988
  position: "fixed",
21019
20989
  left: "0px",
@@ -22743,6 +22713,67 @@ var UploadButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
22743
22713
  });
22744
22714
  var templateObject_1$2, templateObject_2, templateObject_3;
22745
22715
 
22716
+ var ColorThumbnailLoader = function (_a) {
22717
+ var diameter = _a.diameter,
22718
+ outset = _a.outset;
22719
+ var radius = diameter / 2;
22720
+ return jsx(Flex, {
22721
+ outset: outset
22722
+ }, jsx(Loader, {
22723
+ width: diameter,
22724
+ height: diameter
22725
+ }, jsx("circle", {
22726
+ cy: radius,
22727
+ cx: radius,
22728
+ r: radius
22729
+ })));
22730
+ };
22731
+
22732
+ var ColorThumbnail = function (_a) {
22733
+ var backgroundColor = _a.backgroundColor,
22734
+ isSelected = _a.isSelected,
22735
+ onSelect = _a.onSelect,
22736
+ _b = _a.thumbnailSize,
22737
+ thumbnailSize = _b === void 0 ? 32 : _b,
22738
+ outset = _a.outset,
22739
+ _c = _a.isRounded,
22740
+ isRounded = _c === void 0 ? false : _c,
22741
+ _d = _a.isLoading,
22742
+ isLoading = _d === void 0 ? false : _d;
22743
+ var selectedThumbnailSize = "calc(" + thumbnailSize + " / 2.75)";
22744
+
22745
+ if (isLoading) {
22746
+ return jsx(ColorThumbnailLoader, {
22747
+ diameter: thumbnailSize,
22748
+ outset: outset
22749
+ });
22750
+ }
22751
+
22752
+ return jsx(Flex, {
22753
+ onClick: function () {
22754
+ return onSelect(backgroundColor);
22755
+ },
22756
+ backgroundColor: backgroundColor,
22757
+ whileHover: {
22758
+ scale: 1.2
22759
+ },
22760
+ cursor: "pointer",
22761
+ borderRadius: isRounded ? 'circle' : 'small',
22762
+ width: thumbnailSize + "px",
22763
+ height: thumbnailSize + "px",
22764
+ minWidth: thumbnailSize + "px",
22765
+ outset: outset,
22766
+ justifyContent: "center",
22767
+ alignItems: "center"
22768
+ }, isSelected && jsx(Div, {
22769
+ backgroundColor: "foreground",
22770
+ width: selectedThumbnailSize,
22771
+ height: selectedThumbnailSize,
22772
+ borderRadius: isRounded ? 'circle' : '3px',
22773
+ boxShadow: "mediumLight"
22774
+ }));
22775
+ };
22776
+
22746
22777
  var _emotionSourceMap$1 = process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHd0IiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgX19tYWtlVGVtcGxhdGVPYmplY3QgfSBmcm9tIFwidHNsaWJcIjtcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vY29yZSc7XHJcbmV4cG9ydCBkZWZhdWx0IHtcclxuICAgIHRodW1ibmFpbENvbnRhaW5lcjogY3NzKHRlbXBsYXRlT2JqZWN0XzEgfHwgKHRlbXBsYXRlT2JqZWN0XzEgPSBfX21ha2VUZW1wbGF0ZU9iamVjdChbXCJcIl0sIFtcIlwiXSkpKSxcclxufTtcclxudmFyIHRlbXBsYXRlT2JqZWN0XzE7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */";
22747
22778
  var styles$1 = {
22748
22779
  thumbnailContainer: /*#__PURE__*/css(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject([";label:thumbnailContainer;" + _emotionSourceMap$1], [";label:thumbnailContainer;" + _emotionSourceMap$1])))
@@ -4,8 +4,9 @@ export declare type ColorThumbnailProps = {
4
4
  backgroundColor: string;
5
5
  isSelected: boolean;
6
6
  isRounded?: boolean;
7
- thumbnailSize?: string;
7
+ thumbnailSize?: number;
8
8
  outset?: SpacingDirection | LiteralUnion<HOCSpacingKeys>;
9
9
  onSelect: (fill: string) => void;
10
+ isLoading?: boolean;
10
11
  };
11
12
  export declare const ColorThumbnail: FC<ColorThumbnailProps>;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { HOCSpacingKeys, SpacingDirection, LiteralUnion } from "../../../helpers/hoc-types/entityValueTypes";
3
+ declare type ColorThumbnailLoaderProps = {
4
+ diameter: number;
5
+ outset?: SpacingDirection | LiteralUnion<HOCSpacingKeys>;
6
+ };
7
+ export declare const ColorThumbnailLoader: FC<ColorThumbnailLoaderProps>;
8
+ export {};
@@ -10,7 +10,11 @@ export declare type QuantumColorPickerProps = {
10
10
  convertedColorCallback?: (color: ConvertedColorType) => void;
11
11
  convertedColorType?: 'hex' | 'rgb' | 'hsl';
12
12
  showEyeDropper?: boolean;
13
- palettes?: QuantumHex[];
14
- paletteTitle?: string;
13
+ palette?: {
14
+ title?: string;
15
+ colors?: QuantumHex[];
16
+ isLoading?: boolean;
17
+ count?: number;
18
+ };
15
19
  };
16
20
  export declare const QuantumColorPicker: FC<QuantumColorPickerProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoutcards/quantum-design-ui",
3
- "version": "1.7.66",
3
+ "version": "1.7.69",
4
4
  "description": "UI component library for Quantum Design System",
5
5
  "module": "dist/index.es.js",
6
6
  "jsnext:main": "dist/index.es.js",