@sendoutcards/quantum-design-ui 1.7.65 → 1.7.68

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
  },
@@ -20203,7 +20173,9 @@ var PricingTile = function (_a) {
20203
20173
  hasShadow = _h === void 0 ? true : _h,
20204
20174
  disclaimer = _a.disclaimer,
20205
20175
  _j = _a.isSelected,
20206
- isSelected = _j === void 0 ? false : _j;
20176
+ isSelected = _j === void 0 ? false : _j,
20177
+ _k = _a.isFullLength,
20178
+ isFullLength = _k === void 0 ? false : _k;
20207
20179
  var hocs = useEntities().hocs;
20208
20180
 
20209
20181
  var getIconColorFromAccentColor = function (accentColor) {
@@ -20251,16 +20223,17 @@ var PricingTile = function (_a) {
20251
20223
 
20252
20224
  var featureTextColor = isFeatured ? featuredItemStyles.textColor === 'white' ? 'inverseBody' : 'primaryBody' : textColor === 'white' ? 'inverseBody' : 'primaryBody';
20253
20225
 
20254
- var _k = useState(false),
20255
- isDisclaimerOpen = _k[0],
20256
- setDisclaimerOpen = _k[1];
20226
+ var _l = useState(false),
20227
+ isDisclaimerOpen = _l[0],
20228
+ setDisclaimerOpen = _l[1];
20257
20229
 
20258
20230
  return jsx(Flex, {
20231
+ id: "pricingTileContainerQDS",
20259
20232
  inset: "x5",
20260
20233
  backgroundColor: isFeatured ? hocs.textColors[featuredItemStyles.backgroundColor] : hocs.textColors[backgroundColor],
20261
20234
  width: "100%",
20262
20235
  position: "relative",
20263
- height: "fit-content",
20236
+ height: isFullLength ? 'auto' : 'fit-content',
20264
20237
  borderStyle: 'solid',
20265
20238
  borderColor: isSelected ? {
20266
20239
  swatch: 'success',
@@ -20713,7 +20686,7 @@ var MobileView = function (_a) {
20713
20686
  setOpenSection(false);
20714
20687
  };
20715
20688
 
20716
- var section = links[currentSection];
20689
+ var section = links ? links[currentSection] : undefined;
20717
20690
 
20718
20691
  var isLinkType = function (valueToCheck) {
20719
20692
  var link = valueToCheck;
@@ -20737,7 +20710,7 @@ var MobileView = function (_a) {
20737
20710
  width: "100%"
20738
20711
  }, jsx(VStack, {
20739
20712
  gap: "x0"
20740
- }, links.map(function (item, i) {
20713
+ }, links && links.map(function (item, i) {
20741
20714
  return isLinkType(item) ? jsx(Anchor, _extends({
20742
20715
  inset: {
20743
20716
  horizontal: 'x3'
@@ -20779,7 +20752,7 @@ var MobileView = function (_a) {
20779
20752
  }
20780
20753
  }, jsx(Div, {
20781
20754
  width: "100%"
20782
- }, !isLinkType(section) && jsx(React.Fragment, null, jsx(Div, {
20755
+ }, section && !isLinkType(section) && jsx(React.Fragment, null, jsx(Div, {
20783
20756
  cursor: "pointer",
20784
20757
  display: "flex",
20785
20758
  width: "100%",
@@ -20906,24 +20879,24 @@ var StaticNavigation = function (_a) {
20906
20879
  horizontal: 'x3'
20907
20880
  },
20908
20881
  zIndex: zIndex
20909
- }, isMobile && jsx(Div, null, jsx(IconLink, {
20882
+ }, links && isMobile && jsx(Div, null, jsx(IconLink, {
20910
20883
  size: isOpen ? 'xSmall' : 'small',
20911
20884
  icon: isOpen ? 'close' : 'hamburger',
20912
20885
  onClick: function () {
20913
20886
  return setIsOpen(!isOpen);
20914
20887
  }
20915
- })), jsx(Logo, {
20888
+ })), !links && !isMobile && jsx("div", null), jsx(Logo, {
20916
20889
  brand: logo.brand,
20917
20890
  href: logo.href,
20918
20891
  onClick: logo.onClick,
20919
20892
  color: logo.color,
20920
20893
  width: isMobile ? '130px' : '200px'
20921
- }), !isMobile && jsx(Flex, {
20894
+ }), links && !isMobile && jsx(Flex, {
20922
20895
  height: "100%",
20923
20896
  width: "100%",
20924
20897
  alignItems: "center",
20925
20898
  justifyContent: "center"
20926
- }, links.map(function (link, index) {
20899
+ }, links && links.map(function (link, index) {
20927
20900
  return jsx(Div, {
20928
20901
  inset: {
20929
20902
  horizontal: size === 'large' ? 'x1' : 'x2'
@@ -20969,7 +20942,7 @@ var StaticNavigation = function (_a) {
20969
20942
  }, jsx(Div, {
20970
20943
  outset: "x3",
20971
20944
  ref: ref
20972
- }, links.map(function (link, index) {
20945
+ }, links && links.map(function (link, index) {
20973
20946
  return selectedTab === index && jsx(HStack, {
20974
20947
  key: index,
20975
20948
  gap: "x9",
@@ -21010,7 +20983,7 @@ var StaticNavigation = function (_a) {
21010
20983
  subLinkColor: column.linkColor ? column.linkColor : 'primaryBody'
21011
20984
  })));
21012
20985
  }));
21013
- })))), isMobile && jsx(Div, {
20986
+ })))), links && isMobile && jsx(Div, {
21014
20987
  height: "calc(100% - " + drawerOffset + "px)",
21015
20988
  position: "fixed",
21016
20989
  left: "0px",
@@ -22740,6 +22713,67 @@ var UploadButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
22740
22713
  });
22741
22714
  var templateObject_1$2, templateObject_2, templateObject_3;
22742
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
+
22743
22777
  var _emotionSourceMap$1 = process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHd0IiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgX19tYWtlVGVtcGxhdGVPYmplY3QgfSBmcm9tIFwidHNsaWJcIjtcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vY29yZSc7XHJcbmV4cG9ydCBkZWZhdWx0IHtcclxuICAgIHRodW1ibmFpbENvbnRhaW5lcjogY3NzKHRlbXBsYXRlT2JqZWN0XzEgfHwgKHRlbXBsYXRlT2JqZWN0XzEgPSBfX21ha2VUZW1wbGF0ZU9iamVjdChbXCJcIl0sIFtcIlwiXSkpKSxcclxufTtcclxudmFyIHRlbXBsYXRlT2JqZWN0XzE7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */";
22744
22778
  var styles$1 = {
22745
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 {};
@@ -40,6 +40,7 @@ export declare type PricingTileProps = {
40
40
  hasShadow?: boolean;
41
41
  disclaimer?: Disclaimer;
42
42
  isSelected?: boolean;
43
+ isFullLength?: boolean;
43
44
  };
44
45
  export declare const PricingTile: FC<PricingTileProps>;
45
46
  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>;
@@ -2,7 +2,7 @@ import { FC } from 'react';
2
2
  import { DropdownLink, Link } from '../staticNavigation';
3
3
  declare type MobileViewProps = {
4
4
  isOpen: boolean;
5
- links: (DropdownLink | Link)[];
5
+ links?: (DropdownLink | Link)[];
6
6
  toggle: () => void;
7
7
  };
8
8
  export declare const MobileView: FC<MobileViewProps>;
@@ -28,7 +28,7 @@ export declare type StaticNavigationProps = {
28
28
  onClick?: () => void;
29
29
  };
30
30
  accountSection?: React.ReactNode;
31
- links: (DropdownLink | Link)[];
31
+ links?: (DropdownLink | Link)[];
32
32
  zIndex?: number;
33
33
  openValueOverride?: number;
34
34
  drawerOffset?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoutcards/quantum-design-ui",
3
- "version": "1.7.65",
3
+ "version": "1.7.68",
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",