@sendoutcards/quantum-design-ui 1.6.8 → 1.6.9

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
@@ -8,7 +8,7 @@ import LazyLoad from 'react-lazyload';
8
8
  import useResizeObserver from 'use-resize-observer';
9
9
  import ContentLoader from 'react-content-loader';
10
10
  import InfiniteScroll from 'react-infinite-scroller';
11
- import { Page as Page$1 } from 'framer';
11
+ import { Page as Page$1, AnimatePresence as AnimatePresence$1 } from 'framer';
12
12
  import { HexColorPicker } from 'react-colorful';
13
13
  import { EyeDropper } from 'react-eyedrop';
14
14
 
@@ -11718,7 +11718,8 @@ var Tooltip = function (_a) {
11718
11718
  direction = _a.direction,
11719
11719
  _b = _a.background,
11720
11720
  background = _b === void 0 ? 'light' : _b,
11721
- repositionTooltip = _a.repositionTooltip;
11721
+ repositionTooltip = _a.repositionTooltip,
11722
+ zIndex = _a.zIndex;
11722
11723
  var tooltip = useEntities().tooltip;
11723
11724
  var backgroundColor = background === 'light' ? tooltip.lightBackgroundColor : tooltip.darkBackgroundColor ? tooltip.darkBackgroundColor : tooltip.lightBackgroundColor; // TODO this is because the dark bg color is set from a color swatch which can alter through the theme, come up with fix when colors get sorted out
11724
11725
 
@@ -11729,7 +11730,8 @@ var Tooltip = function (_a) {
11729
11730
  vertical: 'x_5',
11730
11731
  horizontal: 'x1'
11731
11732
  },
11732
- boxShadow: tooltip.boxShadow
11733
+ boxShadow: tooltip.boxShadow,
11734
+ zIndex: zIndex
11733
11735
  }, jsx(Text, {
11734
11736
  type: "footnote",
11735
11737
  color: background === 'light' ? 'primaryBody' : 'inverseBody',
@@ -12108,7 +12110,8 @@ var Overlay = function (_a) {
12108
12110
  exit = _a.exit,
12109
12111
  variants = _a.variants,
12110
12112
  transition = _a.transition,
12111
- motionKey = _a.motionKey;
12113
+ motionKey = _a.motionKey,
12114
+ position = _a.position;
12112
12115
  var hocs = useEntities().hocs;
12113
12116
  return jsx(Div, {
12114
12117
  motionKey: motionKey,
@@ -12121,7 +12124,7 @@ var Overlay = function (_a) {
12121
12124
  display: "flex",
12122
12125
  justifyContent: "center",
12123
12126
  alignItems: "center",
12124
- position: "fixed",
12127
+ position: position !== null && position !== void 0 ? position : 'fixed',
12125
12128
  top: "0",
12126
12129
  left: "0",
12127
12130
  width: "100%",
@@ -16046,13 +16049,9 @@ var DownloadButton = function (_a) {
16046
16049
  var StackedCards = function (_a) {
16047
16050
  var size = _a.size,
16048
16051
  _b = _a.stackCount,
16049
- stackCount = _b === void 0 ? 7 : _b,
16052
+ stackCount = _b === void 0 ? 3 : _b,
16050
16053
  children = _a.children;
16051
16054
  var stackCountArr = Array.from(Array(stackCount).keys());
16052
- var cardPositionStyles = {
16053
- position: 'absolute',
16054
- transformOrigin: 'center top'
16055
- };
16056
16055
 
16057
16056
  var getDimensionsFromSize = function () {
16058
16057
  if (typeof size === 'object') {
@@ -16082,95 +16081,98 @@ var StackedCards = function (_a) {
16082
16081
 
16083
16082
  return jsx(Flex, {
16084
16083
  position: "relative",
16085
- justifyContent: 'center',
16086
- alignContent: "center"
16084
+ justifyContent: 'flex-start',
16085
+ alignContent: "center",
16086
+ width: getDimensionsFromSize().width + stackCountArr.length * 8 + "px",
16087
+ height: getDimensionsFromSize().height + "px"
16087
16088
  }, stackCountArr.map(function (_, index) {
16088
- var offset = 11 - stackCountArr.length;
16089
- return jsx(Card, _extends({
16089
+ index += 1;
16090
+ return jsx(Card, {
16090
16091
  key: index,
16091
16092
  backgroundColor: "foreground",
16092
- style: {
16093
- padding: 0
16094
- },
16095
16093
  width: getDimensionsFromSize().width + "px",
16096
16094
  height: getDimensionsFromSize().height + "px",
16097
- transform: "scale(" + (index + offset) / 10 + ") translate(100%, -50%)"
16098
- }, cardPositionStyles), index === stackCountArr.length - 1 && children);
16095
+ style: {
16096
+ scale: 1 - index / 10,
16097
+ translateY: '-50%'
16098
+ },
16099
+ position: "absolute",
16100
+ left: index * 8 + "px",
16101
+ top: '50%',
16102
+ boxShadow: "mediumLight",
16103
+ zIndex: stackCountArr.length - index
16104
+ }, index === stackCountArr.length - 1 && children);
16099
16105
  }));
16100
16106
  };
16101
16107
 
16102
16108
  var ConfigurationCard = function (_a) {
16103
- var _b = _a.graphic,
16104
- graphic = _b === void 0 ? 'addressed' : _b,
16105
- _c = _a.title,
16106
- title = _c === void 0 ? 'Blank Envelopes' : _c,
16107
- _d = _a.description,
16108
- description = _d === void 0 ? 'Address and send yourself' : _d,
16109
- _e = _a.cost,
16110
- cost = _e === void 0 ? 0.29 : _e,
16109
+ var graphic = _a.graphic,
16110
+ title = _a.title,
16111
+ description = _a.description,
16112
+ cost = _a.cost,
16111
16113
  isSelected = _a.isSelected,
16112
16114
  onSelect = _a.onSelect,
16113
- _f = _a.layout,
16114
- layout = _f === void 0 ? 'horizontal' : _f,
16115
+ _b = _a.layout,
16116
+ layout = _b === void 0 ? 'horizontal' : _b,
16115
16117
  configurationId = _a.configurationId,
16116
- _g = _a.itemTitle,
16117
- itemTitle = _g === void 0 ? 'per envelope' : _g;
16118
-
16119
- var handleIsSelected = function () {
16120
- onSelect(configurationId);
16121
- };
16122
-
16123
- return jsx(Flex, {
16124
- onClick: handleIsSelected,
16118
+ itemPriceTitle = _a.itemPriceTitle;
16119
+ var hasNoGraphic = graphic !== 'none';
16120
+ return jsx(Card, {
16121
+ onClick: function () {
16122
+ return onSelect(configurationId);
16123
+ },
16125
16124
  width: layout === 'horizontal' ? '100%' : 'initial',
16126
16125
  flexDirection: layout === 'vertical' ? 'column' : 'row',
16127
16126
  position: "relative",
16128
- cursor: "pointer"
16129
- }, isSelected && jsx(Div, {
16130
- right: "x1",
16131
- position: "absolute",
16132
- top: "x1"
16133
- }, jsx(AnimatedCheckMark, null)), jsx(Div, {
16127
+ boxShadow: "mediumDark",
16128
+ backgroundColor: graphic === 'none' ? 'background' : 'foreground',
16129
+ cursor: "pointer",
16130
+ inset: {
16131
+ vertical: 'x4',
16132
+ horizontal: 'x1'
16133
+ },
16134
+ borderWidth: "default",
16135
+ borderRadius: "default",
16134
16136
  borderStyle: "solid",
16135
16137
  borderColor: isSelected ? {
16136
16138
  swatch: 'success',
16137
16139
  shade: 'base'
16138
16140
  } : 'transparent',
16139
- borderWidth: "default",
16140
- borderRadius: "default",
16141
- width: "100%",
16142
- height: "100%",
16143
- boxShadow: "mediumDark",
16144
- inset: {
16145
- left: 'x2',
16146
- vertical: 'x4'
16147
- }
16148
- }, jsx(Flex, {
16149
- justifyContent: "space-between",
16150
- height: "100%"
16151
- }, jsx(HStack, {
16152
- justify: "flex-start",
16153
- gap: "x3"
16141
+ minWidth: "420px"
16154
16142
  }, jsx(Div, {
16155
- height: "100%"
16156
- }, jsx(Card, {
16157
- width: "75px",
16158
- height: "50px"
16159
- }, graphic)), jsx(Div, null, jsx(Text, {
16143
+ right: "x1",
16144
+ position: "absolute",
16145
+ top: "x1"
16146
+ }, isSelected && hasNoGraphic ? jsx(AnimatedCheckMark, null) : (graphic === 'none' && !isSelected || isSelected) && jsx(Icon, {
16147
+ name: "information",
16148
+ size: "small",
16149
+ primaryColor: "secondaryBrand"
16150
+ })), jsx(Flex, {
16151
+ justifyContent: "space-between",
16152
+ alignItems: "center",
16153
+ width: "100%",
16154
+ flexDirection: layout === 'horizontal' ? 'row' : 'column'
16155
+ }, jsx(StackedCards, {
16156
+ size: "small",
16157
+ stackCount: 3
16158
+ }), jsx(Text, {
16160
16159
  weight: "bold",
16161
- type: "largeBody"
16160
+ type: {
16161
+ xSmall: 'body',
16162
+ medium: 'largeBody'
16163
+ },
16164
+ whiteSpace: "nowrap"
16162
16165
  }, title, jsx(Text, {
16163
- type: "footnote"
16164
- }, description)))), jsx(Div, {
16165
- outset: "x2",
16166
- position: "relative",
16167
- justifyContent: "flex-end"
16168
- }, cost && jsx(Div, {
16169
- width: "100%"
16170
- }, jsx(Text, {
16171
- type: "caption",
16172
- content: " $" + (typeof cost === 'number' ? "" + cost.toFixed(2) : cost) + " " + itemTitle
16173
- }))))));
16166
+ type: {
16167
+ xSmall: 'footnote',
16168
+ medium: 'caption'
16169
+ },
16170
+ whiteSpace: "nowrap"
16171
+ }, description)), cost && jsx(Text, {
16172
+ type: "footnote",
16173
+ whiteSpace: "nowrap",
16174
+ content: " $" + (typeof cost === 'number' ? "" + cost.toFixed(2) : cost) + " " + itemPriceTitle
16175
+ })));
16174
16176
  };
16175
16177
 
16176
16178
  var _emotionSourceMap2$a = process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJdUIiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgX19tYWtlVGVtcGxhdGVPYmplY3QgfSBmcm9tIFwidHNsaWJcIjtcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vY29yZSc7XHJcbmV4cG9ydCBkZWZhdWx0IHtcclxuICAgIHVzZXJDYXJkQ29udGFpbmVyOiBjc3ModGVtcGxhdGVPYmplY3RfMSB8fCAodGVtcGxhdGVPYmplY3RfMSA9IF9fbWFrZVRlbXBsYXRlT2JqZWN0KFtcIlxcbiAgICBkaXNwbGF5OiBmbGV4O1xcbiAgICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtc3RhcnQ7XFxuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XFxuICBcIl0sIFtcIlxcbiAgICBkaXNwbGF5OiBmbGV4O1xcbiAgICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtc3RhcnQ7XFxuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XFxuICBcIl0pKSksXHJcbiAgICB1c2VySW5mb0NvbnRhaW5lcjogY3NzKHRlbXBsYXRlT2JqZWN0XzIgfHwgKHRlbXBsYXRlT2JqZWN0XzIgPSBfX21ha2VUZW1wbGF0ZU9iamVjdChbXCJcXG4gICAgcGFkZGluZy1sZWZ0OiAxNnB4O1xcbiAgXCJdLCBbXCJcXG4gICAgcGFkZGluZy1sZWZ0OiAxNnB4O1xcbiAgXCJdKSkpLFxyXG59O1xyXG52YXIgdGVtcGxhdGVPYmplY3RfMSwgdGVtcGxhdGVPYmplY3RfMjtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGVzLmpzLm1hcCJdfQ== */";
@@ -20146,7 +20148,10 @@ var QuantitySlider = function (_a) {
20146
20148
  quantityDescription = _a.quantityDescription,
20147
20149
  width = _a.width,
20148
20150
  hasIncrement = _a.hasIncrement;
20149
- return jsx(Div, null, jsx(Text, {
20151
+ return jsx(Flex, {
20152
+ justifyContent: "center",
20153
+ flexDirection: "column"
20154
+ }, jsx(Text, {
20150
20155
  type: "subtitle",
20151
20156
  weight: "bold",
20152
20157
  color: "primaryHeading",
@@ -20198,7 +20203,9 @@ var QuantitySlider = function (_a) {
20198
20203
  style: {
20199
20204
  letterSpacing: '1px'
20200
20205
  }
20201
- }), hasIncrement ? jsx(React.Fragment, null, jsx(Spacer, {
20206
+ }), hasIncrement ? jsx(Div, {
20207
+ width: "370px"
20208
+ }, jsx(Spacer, {
20202
20209
  orientation: "vertical",
20203
20210
  space: "x2"
20204
20211
  }), jsx(IncrementSetting, {
@@ -20206,11 +20213,12 @@ var QuantitySlider = function (_a) {
20206
20213
  min: min,
20207
20214
  max: max,
20208
20215
  value: quantity,
20209
- layout: "inlineBlock",
20216
+ layout: "inline",
20210
20217
  setValue: function (quantity) {
20211
20218
  return setQuantity(quantity);
20212
20219
  },
20213
- activeColor: sliderFill
20220
+ activeColor: sliderFill,
20221
+ inputWidth: width
20214
20222
  })) : jsx(Slider, {
20215
20223
  min: min,
20216
20224
  max: max,
@@ -20644,7 +20652,9 @@ var BulkSend = function (_a) {
20644
20652
  setIsActive = _a.setIsActive,
20645
20653
  addDialog = _a.addDialog,
20646
20654
  removeDialog = _a.removeDialog,
20647
- hasIncrement = _a.hasIncrement;
20655
+ hasIncrement = _a.hasIncrement,
20656
+ isConfigurable = _a.isConfigurable,
20657
+ disableMessage = _a.disableMessage;
20648
20658
 
20649
20659
  var _b = React.useState(false),
20650
20660
  isAddDialogOpen = _b[0],
@@ -20669,6 +20679,14 @@ var BulkSend = function (_a) {
20669
20679
  setIsAddDialogOpen(true);
20670
20680
  };
20671
20681
 
20682
+ var overlayVariants = {
20683
+ open: {
20684
+ opacity: 0.5
20685
+ },
20686
+ closed: {
20687
+ opacity: 0
20688
+ }
20689
+ };
20672
20690
  return jsx(Flex, {
20673
20691
  inset: "x3",
20674
20692
  flexDirection: {
@@ -20735,11 +20753,41 @@ var BulkSend = function (_a) {
20735
20753
  xSmall: 2,
20736
20754
  medium: 0
20737
20755
  }
20738
- }, jsx(Div, {
20756
+ }, jsx(AnimatePresence$1, null, !isConfigurable && jsx(Overlay, {
20757
+ variants: overlayVariants,
20758
+ initial: 'closed',
20759
+ animate: !isConfigurable ? 'open' : 'closed',
20760
+ exit: 'closed',
20761
+ zIndex: 1
20762
+ })), jsx(Div, {
20739
20763
  outset: {
20740
20764
  bottom: 'x3'
20765
+ },
20766
+ position: "relative"
20767
+ }, jsx(AnimatePresence$1, null, !isConfigurable && jsx(Flex, {
20768
+ position: "absolute",
20769
+ top: "-32px",
20770
+ initial: {
20771
+ opacity: 0
20772
+ },
20773
+ animate: !isConfigurable ? {
20774
+ opacity: 1
20775
+ } : {
20776
+ opacity: 0
20777
+ },
20778
+ exit: {
20779
+ opacity: 0
20780
+ },
20781
+ transition: {
20782
+ delay: 0.3,
20783
+ duration: 0.3
20741
20784
  }
20742
- }, jsx(Text, {
20785
+ }, jsx(Tooltip, {
20786
+ title: disableMessage,
20787
+ direction: "bottom",
20788
+ background: "light",
20789
+ zIndex: 2
20790
+ }))), jsx(Text, {
20743
20791
  type: {
20744
20792
  xSmall: 'largeBody',
20745
20793
  medium: 'subtitle',
@@ -20755,10 +20803,10 @@ var BulkSend = function (_a) {
20755
20803
  large: 'largeBody'
20756
20804
  },
20757
20805
  content: description
20758
- })), isActive && jsx(React.Fragment, null, configurationSections.map(function (section, index) {
20806
+ })), isActive && isConfigurable ? jsx(React.Fragment, null, configurationSections.map(function (section, index) {
20759
20807
  return jsx(React.Fragment, null, jsx(Flex, {
20760
20808
  flexDirection: "column",
20761
- maxWidth: "450px",
20809
+ maxWidth: "480px",
20762
20810
  key: index
20763
20811
  }, jsx(Div, {
20764
20812
  outset: {
@@ -20789,8 +20837,10 @@ var BulkSend = function (_a) {
20789
20837
  large: 'largeBody'
20790
20838
  },
20791
20839
  content: section.description
20792
- })), section.configurationList.map(function (config, index) {
20793
- return jsx(React.Fragment, null, jsx(ConfigurationCard, {
20840
+ })), jsx(VStack, {
20841
+ gap: "x1"
20842
+ }, section.configurationList.map(function (config, index) {
20843
+ return jsx(ConfigurationCard, {
20794
20844
  key: index,
20795
20845
  graphic: config.graphicType,
20796
20846
  title: config.configurationTitle,
@@ -20799,20 +20849,18 @@ var BulkSend = function (_a) {
20799
20849
  onSelect: function () {
20800
20850
  section.setActiveConfigurationId(config.configurationId);
20801
20851
  },
20802
- isSelected: config.configurationId === section.activeConfigurationId,
20803
- cost: config.configurationPrice
20804
- }), jsx(Spacer, {
20805
- orientation: "vertical",
20806
- space: "x2"
20807
- }));
20808
- }), index !== configurationSections.length - 1 && jsx(Div, {
20852
+ isSelected: false,
20853
+ cost: config.configurationPrice,
20854
+ itemPriceTitle: config.configurationItemPriceTitle
20855
+ });
20856
+ })), index !== configurationSections.length - 1 && jsx(Div, {
20809
20857
  outset: {
20810
20858
  vertical: 'x2'
20811
20859
  }
20812
20860
  }, jsx(Separator, {
20813
20861
  orientation: "horizontal"
20814
20862
  }))));
20815
- }))), jsx(Flex, {
20863
+ })) : !isConfigurable && undefined), jsx(Flex, {
20816
20864
  width: {
20817
20865
  xSmall: '100%',
20818
20866
  medium: '50%'
@@ -20824,7 +20872,7 @@ var BulkSend = function (_a) {
20824
20872
  xSmall: 1,
20825
20873
  medium: 0
20826
20874
  }
20827
- }, jsx(Flex, null, jsx(QuantitySlider, {
20875
+ }, jsx(QuantitySlider, {
20828
20876
  unitPrice: unitPrice,
20829
20877
  salePrice: salePrice,
20830
20878
  quantityDescription: quantityDescription,
@@ -20837,7 +20885,7 @@ var BulkSend = function (_a) {
20837
20885
  },
20838
20886
  sliderFill: sliderFill,
20839
20887
  hasIncrement: hasIncrement
20840
- })), jsx(Flex, {
20888
+ }), jsx(Flex, {
20841
20889
  outset: {
20842
20890
  top: 'x4'
20843
20891
  }
@@ -20845,7 +20893,7 @@ var BulkSend = function (_a) {
20845
20893
  type: "secondary",
20846
20894
  size: "medium",
20847
20895
  title: isActive ? 'Remove Bulk Option' : 'Add Bulk Option',
20848
- onClick: isActive ? handleSetRemoveDialog : handleSetAddDialog,
20896
+ onClick: isActive && isConfigurable ? handleSetRemoveDialog : !isConfigurable ? undefined : handleSetAddDialog,
20849
20897
  fullWidth: true,
20850
20898
  outlined: true
20851
20899
  }))));
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  export declare type ConfigurationCardProps = {
3
- graphic: 'blank' | 'addressed' | 'withStamp';
3
+ graphic: 'blank' | 'addressed' | 'withStamp' | 'none';
4
4
  title: string;
5
5
  description: string;
6
6
  cost?: number | string;
@@ -8,6 +8,6 @@ export declare type ConfigurationCardProps = {
8
8
  onSelect: (configurationId: string) => void;
9
9
  layout?: 'horizontal' | 'vertical';
10
10
  configurationId: string;
11
- itemTitle?: string;
11
+ itemPriceTitle?: string;
12
12
  };
13
13
  export declare const ConfigurationCard: FC<ConfigurationCardProps>;
@@ -1,6 +1,9 @@
1
1
  import { FC } from 'react';
2
2
  import { HOCMotionProps } from "../../helpers/hoc-types/hocMotionTypes";
3
+ import { Responsive } from "../../helpers/hoc-types/entityValueTypes";
4
+ import { Position } from "../../helpers/hoc-types/cssValueTypes";
3
5
  export declare type OverlayPropTypes = {
4
6
  zIndex?: number;
7
+ position?: Responsive<Position> | Position;
5
8
  } & HOCMotionProps;
6
9
  export declare const Overlay: FC<OverlayPropTypes>;
@@ -5,6 +5,7 @@ export declare type TooltipProps = {
5
5
  direction: DirectionType;
6
6
  background?: ColorModeType;
7
7
  repositionTooltip?: boolean;
8
+ zIndex?: number;
8
9
  };
9
10
  export declare type DirectionType = 'left' | 'right' | 'top' | 'bottom';
10
11
  export declare const Tooltip: FC<TooltipProps>;
@@ -10,11 +10,12 @@ export declare type ConfigurationOptionSection = {
10
10
  configurationList: ConfigurationListOption[];
11
11
  };
12
12
  declare type ConfigurationListOption = {
13
- graphicType: 'blank' | 'addressed' | 'withStamp';
13
+ graphicType: 'blank' | 'addressed' | 'withStamp' | 'none';
14
14
  configurationId: string;
15
15
  configurationTitle: string;
16
16
  configurationDescription: string;
17
17
  configurationPrice?: number;
18
+ configurationItemPriceTitle?: string;
18
19
  };
19
20
  export declare type BulkSendProps = {
20
21
  quantity: number;
@@ -35,6 +36,8 @@ export declare type BulkSendProps = {
35
36
  addDialog?: ConfirmDialogProps;
36
37
  removeDialog?: ConfirmDialogProps;
37
38
  hasIncrement?: boolean;
39
+ isConfigurable?: boolean;
40
+ disableMessage: string;
38
41
  };
39
42
  export declare const BulkSend: FC<BulkSendProps>;
40
43
  export {};
@@ -2,3 +2,4 @@ import { Meta } from '@storybook/react/types-6-0';
2
2
  declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
3
3
  export default _default;
4
4
  export declare const ConfigurationCardWithCallback: any;
5
+ export declare const ConfigurationInfoCard: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoutcards/quantum-design-ui",
3
- "version": "1.6.8",
3
+ "version": "1.6.9",
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",