@sendoutcards/quantum-design-ui 1.8.3 → 1.8.5

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
@@ -13562,8 +13562,11 @@ var Overlay = function (_a) {
13562
13562
  variants = _a.variants,
13563
13563
  transition = _a.transition,
13564
13564
  motionKey = _a.motionKey,
13565
- position = _a.position;
13565
+ position = _a.position,
13566
+ _b = _a.pinned,
13567
+ pinned = _b === void 0 ? 'center' : _b;
13566
13568
  var hocs = useEntities().hocs;
13569
+ var pinnedPosition = pinned === 'top' ? 'flex-start' : pinned === 'bottom' ? 'flex-end' : 'center';
13567
13570
  return jsx(Div, {
13568
13571
  motionKey: motionKey,
13569
13572
  variants: variants,
@@ -13573,7 +13576,7 @@ var Overlay = function (_a) {
13573
13576
  zIndex: zIndex,
13574
13577
  display: "flex",
13575
13578
  justifyContent: "center",
13576
- alignItems: "center",
13579
+ alignItems: pinnedPosition,
13577
13580
  position: position !== null && position !== void 0 ? position : 'fixed',
13578
13581
  top: "0",
13579
13582
  left: "0",
@@ -14959,21 +14962,31 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (props, ref) {
14959
14962
  _d = props.shouldScroll,
14960
14963
  shouldScroll = _d === void 0 ? false : _d,
14961
14964
  _e = props.borderRadius,
14962
- borderRadius = _e === void 0 ? 'default' : _e;
14965
+ borderRadius = _e === void 0 ? 'default' : _e,
14966
+ _f = props.pinned,
14967
+ pinned = _f === void 0 ? 'center' : _f;
14968
+ var pinnedRadius = pinned === 'bottom' ? {
14969
+ top: borderRadius,
14970
+ bottom: 'none'
14971
+ } : pinned === 'top' ? {
14972
+ bottom: borderRadius,
14973
+ top: 'none'
14974
+ } : borderRadius;
14963
14975
  return jsx(AnimatePresence, null, isOpen && jsx(Overlay, {
14964
14976
  variants: overlayVariants,
14965
14977
  animate: isOpen ? 'open' : 'closed',
14966
14978
  initial: 'closed',
14967
14979
  zIndex: zIndex,
14968
14980
  exit: 'closed',
14969
- bgElementSelector: bgElementSelector
14981
+ bgElementSelector: bgElementSelector,
14982
+ pinned: pinned
14970
14983
  }, jsx(Div, {
14971
14984
  ref: ref,
14972
14985
  outsideClick: onClose,
14973
14986
  variants: dialogVariants,
14974
14987
  css: styles$w.dialogContainer,
14975
14988
  backgroundColor: dialog.backgroundColor,
14976
- borderRadius: borderRadius,
14989
+ borderRadius: pinnedRadius,
14977
14990
  boxShadow: dialog.boxShadow,
14978
14991
  inset: insetOverride !== null && insetOverride !== void 0 ? insetOverride : dialog.defaultInset,
14979
14992
  outset: onClose ? {
@@ -14983,6 +14996,8 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (props, ref) {
14983
14996
  small: 'x1'
14984
14997
  }
14985
14998
  } : 'x0',
14999
+ position: 'absolute',
15000
+ bottom: 0,
14986
15001
  maxWidth: maxWidth,
14987
15002
  maxHeight: maxHeight,
14988
15003
  width: (_a = isFullScreen ? '100%' : undefined) !== null && _a !== void 0 ? _a : width,
@@ -24340,7 +24355,7 @@ var UpsaleOptions = function (_a) {
24340
24355
  height: "100%",
24341
24356
  position: "relative",
24342
24357
  width: "100%"
24343
- }, jsx(Div, null, shouldShowCheckoutScreen &&
24358
+ }, jsx(Div, null, shouldShowCheckoutScreen && removeSelectedOption &&
24344
24359
  // Back Button
24345
24360
  jsx(Div, {
24346
24361
  outset: {
@@ -24450,15 +24465,14 @@ var UpsaleDialog = function (_a) {
24450
24465
  acceptSelectedAction = _a.acceptSelectedAction,
24451
24466
  shouldHideSendFreeCard = _a.shouldHideSendFreeCard,
24452
24467
  upsaleBanner = _a.upsaleBanner,
24453
- _e = _a.defaultActiveKeys,
24454
- defaultActiveKeys = _e === void 0 ? [1] : _e;
24455
- var _f = React.useState(false),
24456
- shouldShowCheckoutView = _f[0],
24457
- setShouldShowCheckoutView = _f[1];
24458
- var _g = useResizeObserver(),
24459
- ref = _g.ref,
24460
- width = _g.width,
24461
- height = _g.height;
24468
+ checkoutOnly = _a.checkoutOnly;
24469
+ var _e = React.useState(checkoutOnly !== null && checkoutOnly !== void 0 ? checkoutOnly : false),
24470
+ shouldShowCheckoutView = _e[0],
24471
+ setShouldShowCheckoutView = _e[1];
24472
+ var _f = useResizeObserver(),
24473
+ ref = _f.ref,
24474
+ width = _f.width,
24475
+ height = _f.height;
24462
24476
  var dialogFooterHeight = shouldHideSendFreeCard ? '120px' : '170px';
24463
24477
  var device = useWindowSize().width;
24464
24478
  var isMobile = device <= 910;
@@ -24585,7 +24599,7 @@ var UpsaleDialog = function (_a) {
24585
24599
  top: '1.4rem'
24586
24600
  }
24587
24601
  }, jsx(Accordion, {
24588
- defaultActiveKeys: defaultActiveKeys,
24602
+ defaultActiveKeys: [1],
24589
24603
  arrowLocation: "right",
24590
24604
  background: "background",
24591
24605
  inset: "x0",
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Responsive, LiteralUnion, HOCSpacingKeys } from "../../helpers/hoc-types/entityValueTypes";
3
3
  import { Height, Width, BorderRadius } from "../../helpers/hoc-types/hocBaseUnion";
4
+ export declare type PinnedType = 'top' | 'center' | 'bottom';
4
5
  export declare type DialogProps = {
5
6
  zIndex?: number;
6
7
  isOpen: boolean;
@@ -15,6 +16,7 @@ export declare type DialogProps = {
15
16
  width?: Width;
16
17
  shouldScroll?: boolean;
17
18
  borderRadius?: BorderRadius;
19
+ pinned?: PinnedType;
18
20
  };
19
21
  export declare const Dialog: React.ForwardRefExoticComponent<DialogProps & {
20
22
  children: React.ReactNode;
@@ -2,10 +2,12 @@ import React from 'react';
2
2
  import { HOCMotionProps } from "../../helpers/hoc-types/hocMotionTypes";
3
3
  import { Responsive } from "../../helpers/hoc-types/entityValueTypes";
4
4
  import { Position } from "../../helpers/hoc-types/cssValueTypes";
5
+ import { PinnedType } from '../dialog/dialog';
5
6
  export declare type OverlayPropTypes = {
6
7
  zIndex?: number;
7
8
  position?: Responsive<Position> | Position;
8
9
  bgElementSelector?: string;
9
10
  children?: React.ReactNode;
11
+ pinned?: PinnedType;
10
12
  } & HOCMotionProps;
11
- export declare const Overlay: ({ children, zIndex, animate, initial, exit, variants, transition, motionKey, position, }: OverlayPropTypes) => JSX.Element;
13
+ export declare const Overlay: ({ children, zIndex, animate, initial, exit, variants, transition, motionKey, position, pinned, }: OverlayPropTypes) => JSX.Element;
@@ -34,6 +34,6 @@ export declare type UpsaleDialogProps = {
34
34
  acceptSelectedAction?: AcceptSelectedOptionType;
35
35
  shouldHideSendFreeCard?: boolean;
36
36
  upsaleBanner?: React.ReactNode;
37
- defaultActiveKeys?: (number | string)[];
37
+ checkoutOnly?: boolean;
38
38
  } & UpsaleOptionsType;
39
39
  export declare const UpsaleDialog: FC<UpsaleDialogProps>;
@@ -18,7 +18,7 @@ export declare type UpsaleOptionsType = {
18
18
  selectableOptions: UpsaleOptionType[];
19
19
  selectedOption: string;
20
20
  handleSelectedOption: (optionId: string) => void;
21
- removeSelectedOption: () => void;
21
+ removeSelectedOption?: () => void;
22
22
  children: React.ReactNode;
23
23
  activeSelectedOption?: UpsaleOptionType;
24
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoutcards/quantum-design-ui",
3
- "version": "1.8.3",
3
+ "version": "1.8.5",
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",