@laerdal/life-react-components 3.4.2 → 3.4.3

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.
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.default = exports.ToastTextContainer = exports.ToastIconContainer = exports.ToastContainer = exports.ToastCloseButton = exports.ToastActionButtons = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
@@ -27,7 +27,7 @@ var LoaderAnimationKeyframes = (0, _styledComponents.keyframes)(_templateObject
27
27
  var Loader = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n border-bottom-left-radius: 8px;\n border-bottom-right-radius: 8px;\n\n animation: ", " ", "ms cubic-bezier(0.18, 0.39, 0.35, 1);\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n"])), LoaderAnimationKeyframes, function (props) {
28
28
  return props.duration;
29
29
  }, _types.ToastColor[_types.ToastColor.BLACK], _styles.COLORS.neutral_200, _styles.COLORS.neutral_800, _types.ToastColor[_types.ToastColor.WHITE], _styles.COLORS.neutral_400, _styles.COLORS.white, _types.ToastColor[_types.ToastColor.BLUE], _styles.COLORS.accent1_200, _styles.COLORS.accent1_600, _types.ToastColor[_types.ToastColor.GREEN], _styles.COLORS.correct_200, _styles.COLORS.correct_500, _types.ToastColor[_types.ToastColor.ORANGE], _styles.COLORS.warning_200, _styles.COLORS.warning_500, _types.ToastColor[_types.ToastColor.RED], _styles.COLORS.critical_200, _styles.COLORS.critical_500);
30
- var Container = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: ", ";\n border-radius: 4px;\n\n animation: ", " ", " ", ";\n transform: ", ";\n\n transition: all 300ms cubic-bezier(0.64, 0.04, 0.35, 1);\n\n padding: 0 ", " ", " 16px;\n\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 16px;\n justify-content: left;\n\n position: relative;\n\n width: max-content;\n min-height: 48px;\n box-sizing: border-box;\n\n ", "\n\n & a {\n display: inline;\n ", "\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n color: ", ";\n\n & a {\n ", "\n }\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n"])), _styles.BOXSHADOWS.BOXSHADOW_L2, function (props) {
30
+ var ToastContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: ", ";\n border-radius: 4px;\n\n animation: ", " ", " ", ";\n transform: ", ";\n\n transition: all 300ms cubic-bezier(0.64, 0.04, 0.35, 1);\n\n padding: 0 ", " ", " 16px;\n\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 16px;\n justify-content: left;\n\n position: relative;\n\n width: max-content;\n min-height: 48px;\n box-sizing: border-box;\n\n ", "\n\n & a {\n display: inline;\n ", "\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n color: ", ";\n\n & a {\n ", "\n }\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n"])), _styles.BOXSHADOWS.BOXSHADOW_L2, function (props) {
31
31
  return props.animation.keyframes;
32
32
  }, function (props) {
33
33
  return props.animation.duration;
@@ -40,10 +40,15 @@ var Container = _styledComponents.default.div(_templateObject3 || (_templateObje
40
40
  }, function (props) {
41
41
  return props.withLoader ? '4px' : '0';
42
42
  }, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.white), _HyperLink.HyperLinkInvertedStyling, _types.ToastColor[_types.ToastColor.BLACK], _styles.COLORS.neutral_800, _types.ToastColor[_types.ToastColor.WHITE], _styles.COLORS.white, _styles.COLORS.black, _HyperLink.HyperLinkDefaultStyling, _types.ToastColor[_types.ToastColor.BLUE], _styles.COLORS.accent1_600, _types.ToastColor[_types.ToastColor.GREEN], _styles.COLORS.correct_500, _types.ToastColor[_types.ToastColor.ORANGE], _styles.COLORS.warning_500, _types.ToastColor[_types.ToastColor.RED], _styles.COLORS.critical_500);
43
- var ActionButtons = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n\n & .action {\n height: unset;\n }\n"])));
44
- var CloseButton = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n & > button {\n margin-left: 16px;\n\n & svg {\n padding: 0;\n }\n }\n\n button svg path{\n fill: ", " !important;\n }\n\n &.", " {\n button svg path {\n fill: ", " !important;\n }\n }\n"])), _styles.COLORS.white, _types.ToastColor[_types.ToastColor.WHITE], _styles.COLORS.neutral_600);
45
- var TextContainer = _styledComponents.default.span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-feature-settings: 'liga' off;\n width: 240px;\n display: flex;\n padding: 16px 0;\n"])));
46
- var IconContainer = _styledComponents.default.span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-right: -8px;\n"])));
43
+ exports.ToastContainer = ToastContainer;
44
+ var ToastActionButtons = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n\n & .action {\n height: unset;\n }\n"])));
45
+ exports.ToastActionButtons = ToastActionButtons;
46
+ var ToastCloseButton = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n & > button {\n margin-left: 16px;\n\n & svg {\n padding: 0;\n }\n }\n\n button svg path{\n fill: ", " !important;\n }\n\n &.", " {\n button svg path {\n fill: ", " !important;\n }\n }\n"])), _styles.COLORS.white, _types.ToastColor[_types.ToastColor.WHITE], _styles.COLORS.neutral_600);
47
+ exports.ToastCloseButton = ToastCloseButton;
48
+ var ToastTextContainer = _styledComponents.default.span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-feature-settings: 'liga' off;\n width: 240px;\n display: flex;\n padding: 16px 0;\n"])));
49
+ exports.ToastTextContainer = ToastTextContainer;
50
+ var ToastIconContainer = _styledComponents.default.span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-right: -8px;\n"])));
51
+ exports.ToastIconContainer = ToastIconContainer;
47
52
  var DEFAULT_OPTIONS = {
48
53
  color: _types.ToastColor.BLACK,
49
54
  autoClose: true,
@@ -130,7 +135,7 @@ var Toast = function Toast(_ref) {
130
135
  return elementRef === null || elementRef === void 0 ? void 0 : (_elementRef$current3 = elementRef.current) === null || _elementRef$current3 === void 0 ? void 0 : _elementRef$current3.focus();
131
136
  });
132
137
  }
133
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
138
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ToastContainer, {
134
139
  "data-testid": testId,
135
140
  animation: prop,
136
141
  ref: elementRef,
@@ -138,12 +143,12 @@ var Toast = function Toast(_ref) {
138
143
  className: theme,
139
144
  withClose: !!opts.showCloseButton,
140
145
  tabIndex: -1,
141
- children: [opts.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(IconContainer, {
146
+ children: [opts.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastIconContainer, {
142
147
  children: opts.icon
143
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(TextContainer, {
148
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastTextContainer, {
144
149
  className: 'description',
145
150
  children: content
146
- }), opts.action && /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButtons, {
151
+ }), opts.action && /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastActionButtons, {
147
152
  children: opts.action.map(function (action, i) {
148
153
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
149
154
  size: _types.Size.Small,
@@ -158,7 +163,7 @@ var Toast = function Toast(_ref) {
158
163
  children: action.label
159
164
  }, i);
160
165
  })
161
- }), opts.showCloseButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
166
+ }), opts.showCloseButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastCloseButton, {
162
167
  className: "close-button ".concat(theme),
163
168
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
164
169
  variant: 'secondary',
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.cjs","names":["LoaderAnimationKeyframes","keyframes","Loader","styled","div","props","duration","ToastColor","BLACK","COLORS","neutral_200","neutral_800","WHITE","neutral_400","white","BLUE","accent1_200","accent1_600","GREEN","correct_200","correct_500","ORANGE","warning_200","warning_500","RED","critical_200","critical_500","Container","BOXSHADOWS","BOXSHADOW_L2","animation","bezier","transform","withClose","withLoader","ComponentSStyling","ComponentTextStyle","Regular","HyperLinkInvertedStyling","black","HyperLinkDefaultStyling","ActionButtons","CloseButton","neutral_600","TextContainer","span","IconContainer","DEFAULT_OPTIONS","color","autoClose","delay","showCloseButton","position","ToastPosition","TOPLEFT","enterFrom","ToastEntryDirection","TOP","Toast","content","remove","options","testId","Error","removeRef","React","useRef","current","elementRef","useState","shouldRemove","setShouldRemove","width","height","dimensions","setDimensions","opts","useEffect","id","setTimeout","clearTimeout","undefined","clientHeight","clientWidth","animations","direction","fromY","fromHeight","toY","toHeight","fromX","fromWidth","toX","toWidth","prop","theme","focus","icon","action","map","i","Size","Small","type","ToastActionType","SECONDARY","handler","label","event","enter","BOTTOM","LEFT","RIGHT","leave"],"sources":["../../src/Toasters/Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { keyframes } from 'styled-components';\nimport { ToastActionType, ToastColor, ToastEntryDirection, ToastPosition } from '../types';\nimport { BOXSHADOWS, COLORS} from '../styles';\nimport { Size } from '../types'\nimport { Button, IconButton } from '../Button';\nimport { ComponentSStyling, ComponentTextStyle } from '../styles';\nimport {HyperLinkDefaultStyling, HyperLinkInvertedStyling} from '../HyperLink';\nimport { SystemIcons } from '../icons';\n\nconst LoaderAnimationKeyframes = keyframes`\n 0% {\n background-position: right;\n }\n 100% {\n background-position: left;\n }\n`;\n\nconst Loader = styled.div<{ duration: number }>`\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n border-bottom-left-radius: 8px;\n border-bottom-right-radius: 8px;\n\n animation: ${LoaderAnimationKeyframes} ${(props) => props.duration}ms cubic-bezier(0.18, 0.39, 0.35, 1);\n\n &.${ToastColor[ToastColor.BLACK]} {\n background: linear-gradient(to right, ${COLORS.neutral_200} 50%, ${COLORS.neutral_800} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n background: linear-gradient(to right, ${COLORS.neutral_400} 50%, ${COLORS.white} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.BLUE]} {\n background: linear-gradient(to right, ${COLORS.accent1_200} 50%, ${COLORS.accent1_600} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.GREEN]} {\n background: linear-gradient(to right, ${COLORS.correct_200} 50%, ${COLORS.correct_500} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.ORANGE]} {\n background: linear-gradient(to right, ${COLORS.warning_200} 50%, ${COLORS.warning_500} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.RED]} {\n background: linear-gradient(to right, ${COLORS.critical_200} 50%, ${COLORS.critical_500} 50%) left;\n background-size: 200% 100%;\n }\n`;\n\nconst Container = styled.div<{ animation: { duration: string; bezier: string; transform: string; keyframes: any }; withLoader: boolean; withClose: boolean }>`\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\n border-radius: 4px;\n\n animation: ${(props) => props.animation.keyframes} ${(props) => props.animation.duration} ${(props) => props.animation.bezier};\n transform: ${(props) => props.animation.transform};\n\n transition: all 300ms cubic-bezier(0.64, 0.04, 0.35, 1);\n\n padding: 0 ${(props) => (props.withClose ? '0' : '16px')} ${(props) => (props.withLoader ? '4px' : '0')} 16px;\n\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 16px;\n justify-content: left;\n\n position: relative;\n\n width: max-content;\n min-height: 48px;\n box-sizing: border-box;\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.white)}\n\n & a {\n display: inline;\n ${HyperLinkInvertedStyling}\n }\n\n &.${ToastColor[ToastColor.BLACK]} {\n background-color: ${COLORS.neutral_800};\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n background-color: ${COLORS.white};\n color: ${COLORS.black};\n\n & a {\n ${HyperLinkDefaultStyling}\n }\n }\n\n &.${ToastColor[ToastColor.BLUE]} {\n background-color: ${COLORS.accent1_600};\n }\n\n &.${ToastColor[ToastColor.GREEN]} {\n background-color: ${COLORS.correct_500};\n }\n\n &.${ToastColor[ToastColor.ORANGE]} {\n background-color: ${COLORS.warning_500};\n }\n\n &.${ToastColor[ToastColor.RED]} {\n background-color: ${COLORS.critical_500};\n }\n`;\n\nconst ActionButtons = styled.div`\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n\n & .action {\n height: unset;\n }\n`;\n\nconst CloseButton = styled.div`\n & > button {\n margin-left: 16px;\n\n & svg {\n padding: 0;\n }\n }\n\n button svg path{\n fill: ${COLORS.white} !important;\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n button svg path {\n fill: ${COLORS.neutral_600} !important;\n }\n }\n`;\n\nconst TextContainer = styled.span`\n font-feature-settings: 'liga' off;\n width: 240px;\n display: flex;\n padding: 16px 0;\n`;\n\nconst IconContainer = styled.span`\n margin-right: -8px;\n`;\n\nexport type ToastOptions = {\n color?: ToastColor;\n autoClose?: boolean;\n delay?: number;\n showCloseButton?: boolean;\n action?: {\n label: string;\n handler: () => void;\n type?: ToastActionType;\n }[];\n position: ToastPosition;\n enterFrom?: ToastEntryDirection;\n icon?: React.ReactNode;\n};\n\ntype Props = {\n remove?: any;\n content: any;\n options?: ToastOptions;\n testId?: string;\n};\n\nconst DEFAULT_OPTIONS: ToastOptions = {\n color: ToastColor.BLACK,\n autoClose: true,\n delay: 5000,\n showCloseButton: false,\n position: ToastPosition.TOPLEFT,\n enterFrom: ToastEntryDirection.TOP,\n};\n\nconst Toast = ({ content, remove, options = DEFAULT_OPTIONS, testId }: Props) => {\n\n if(!remove)\n throw new Error('remove function is required when rendering Toast. Make sure that you are using useToast hook and ToastProvider for rendering Toasts');\n\n const removeRef = React.useRef();\n removeRef.current = remove;\n\n const elementRef = React.useRef<any>(null);\n\n const [shouldRemove, setShouldRemove] = React.useState(false);\n const [dimensions, setDimensions] = React.useState<{ width: number; height: number }>({ width: 0, height: 0 });\n\n const opts = { ...DEFAULT_OPTIONS, ...options };\n\n React.useEffect(() => {\n if (opts?.autoClose) {\n // @ts-ignore\n const id = setTimeout(() => setShouldRemove(true), opts.delay);\n return () => clearTimeout(id);\n }\n return undefined;\n }, []);\n\n React.useEffect(() => {\n if (shouldRemove) {\n // @ts-ignore\n const id = setTimeout(() => removeRef.current(), 200);\n return () => clearTimeout(id);\n }\n }, [shouldRemove]);\n\n React.useEffect(() => {\n setDimensions({ height: elementRef.current?.clientHeight, width: elementRef.current?.clientWidth });\n }, []);\n\n const animation = animations[shouldRemove ? 'leave' : 'enter'];\n const direction = animation[opts.enterFrom ?? ToastEntryDirection.TOP];\n\n const fromY = dimensions.height * direction.fromHeight;\n const toY = dimensions.height * direction.toHeight;\n const fromX = dimensions.width * direction.fromWidth;\n const toX = dimensions.width * direction.toWidth;\n\n let prop = {\n duration: animation.duration,\n bezier: animation.bezier,\n transform: `translateY(${toY}) translateX(${toX})`,\n keyframes: keyframes`\n 0% {\n transform: translateY(${fromY}px) translateX(${fromX}px);\n }\n 100% {\n transform: translateY(${toY}px) translateX(${toX}px);\n }`,\n };\n\n if (!dimensions.height) {\n prop = {\n ...prop,\n ...{\n transform: 'translateY(-1000vh) translateX(-1000vw)',\n keyframes: keyframes``,\n },\n };\n }\n\n const theme = ToastColor[opts.color ?? ToastColor.BLACK];\n\n if (!shouldRemove){\n setTimeout(() => elementRef?.current?.focus());\n }\n\n return (\n <Container data-testid={testId}\n animation={prop}\n ref={elementRef}\n withLoader={!!opts.autoClose}\n className={theme}\n withClose={!!opts.showCloseButton}\n tabIndex={-1}>\n {opts.icon && <IconContainer>{opts.icon}</IconContainer>}\n <TextContainer className={'description'}>{content}</TextContainer>\n {opts.action && (\n <ActionButtons>\n {opts.action.map((action, i) => (\n <Button\n size={Size.Small}\n variant={action.type === ToastActionType.SECONDARY ? 'secondary' : 'primary'}\n colorTheme={opts.color !== ToastColor.WHITE ? 'dark' : 'teal'}\n invertFocus={opts.color === ToastColor.BLACK}\n key={i}\n onClick={() => {\n setShouldRemove(true);\n action.handler();\n }}\n className={'action'}>\n {action.label}\n </Button>\n ))}\n </ActionButtons>\n )}\n {opts.showCloseButton && (\n <CloseButton className={`close-button ${theme}`}>\n <IconButton variant={'secondary'}\n shape=\"circular\"\n useTransparentBackground={true}\n invertFocus={opts.color === ToastColor.BLACK}\n action={(event) => setShouldRemove(true)}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600} />\n </IconButton>\n </CloseButton>\n )}\n {!!opts.autoClose && <Loader className={`loader ${theme}`} duration={opts.delay ?? 0} />}\n </Container>\n );\n};\n\nexport default Toast;\n\nconst animations = {\n enter: {\n bezier: 'cubic-bezier(0.22, 0.61, 0.35, 1)',\n duration: '300ms',\n [ToastEntryDirection.TOP]: {\n fromHeight: -1,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.BOTTOM]: {\n fromHeight: 1,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.LEFT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: -1,\n toWidth: 0,\n },\n [ToastEntryDirection.RIGHT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 1,\n toWidth: 0,\n },\n },\n leave: {\n bezier: 'cubic-bezier(0.5, 0.05, 0.67, 0.19)',\n duration: '205ms',\n [ToastEntryDirection.TOP]: {\n fromHeight: 0,\n toHeight: -1,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.BOTTOM]: {\n fromHeight: 0,\n toHeight: 1,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.LEFT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 0,\n toWidth: -1,\n },\n [ToastEntryDirection.RIGHT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 1,\n },\n },\n};\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAEvC,IAAMA,wBAAwB,OAAGC,2BA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IAC1BxB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC,CAAC;IACbE,OAAO,EAAE;EACX,CAAC,yCACArC,0BAAmB,CAACwD,KAAK,EAAG;IAC3BzB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,UACF;EACDoB,KAAK;IACHlF,MAAM,EAAE,qCAAqC;IAC7CzB,QAAQ,EAAE;EAAO,yCAChBkD,0BAAmB,CAACC,GAAG,EAAG;IACzB8B,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC,CAAC;IACZE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,yCACArC,0BAAmB,CAACsD,MAAM,EAAG;IAC5BvB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,yCACArC,0BAAmB,CAACuD,IAAI,EAAG;IAC1BxB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE,CAAC;EACZ,CAAC,yCACArC,0BAAmB,CAACwD,KAAK,EAAG;IAC3BzB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC;AAEL,CAAC"}
1
+ {"version":3,"file":"Toast.cjs","names":["LoaderAnimationKeyframes","keyframes","Loader","styled","div","props","duration","ToastColor","BLACK","COLORS","neutral_200","neutral_800","WHITE","neutral_400","white","BLUE","accent1_200","accent1_600","GREEN","correct_200","correct_500","ORANGE","warning_200","warning_500","RED","critical_200","critical_500","ToastContainer","BOXSHADOWS","BOXSHADOW_L2","animation","bezier","transform","withClose","withLoader","ComponentSStyling","ComponentTextStyle","Regular","HyperLinkInvertedStyling","black","HyperLinkDefaultStyling","ToastActionButtons","ToastCloseButton","neutral_600","ToastTextContainer","span","ToastIconContainer","DEFAULT_OPTIONS","color","autoClose","delay","showCloseButton","position","ToastPosition","TOPLEFT","enterFrom","ToastEntryDirection","TOP","Toast","content","remove","options","testId","Error","removeRef","React","useRef","current","elementRef","useState","shouldRemove","setShouldRemove","width","height","dimensions","setDimensions","opts","useEffect","id","setTimeout","clearTimeout","undefined","clientHeight","clientWidth","animations","direction","fromY","fromHeight","toY","toHeight","fromX","fromWidth","toX","toWidth","prop","theme","focus","icon","action","map","i","Size","Small","type","ToastActionType","SECONDARY","handler","label","event","enter","BOTTOM","LEFT","RIGHT","leave"],"sources":["../../src/Toasters/Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { keyframes } from 'styled-components';\nimport { ToastActionType, ToastColor, ToastEntryDirection, ToastPosition } from '../types';\nimport { BOXSHADOWS, COLORS} from '../styles';\nimport { Size } from '../types'\nimport { Button, IconButton } from '../Button';\nimport { ComponentSStyling, ComponentTextStyle } from '../styles';\nimport {HyperLinkDefaultStyling, HyperLinkInvertedStyling} from '../HyperLink';\nimport { SystemIcons } from '../icons';\n\nconst LoaderAnimationKeyframes = keyframes`\n 0% {\n background-position: right;\n }\n 100% {\n background-position: left;\n }\n`;\n\nconst Loader = styled.div<{ duration: number }>`\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n border-bottom-left-radius: 8px;\n border-bottom-right-radius: 8px;\n\n animation: ${LoaderAnimationKeyframes} ${(props) => props.duration}ms cubic-bezier(0.18, 0.39, 0.35, 1);\n\n &.${ToastColor[ToastColor.BLACK]} {\n background: linear-gradient(to right, ${COLORS.neutral_200} 50%, ${COLORS.neutral_800} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n background: linear-gradient(to right, ${COLORS.neutral_400} 50%, ${COLORS.white} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.BLUE]} {\n background: linear-gradient(to right, ${COLORS.accent1_200} 50%, ${COLORS.accent1_600} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.GREEN]} {\n background: linear-gradient(to right, ${COLORS.correct_200} 50%, ${COLORS.correct_500} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.ORANGE]} {\n background: linear-gradient(to right, ${COLORS.warning_200} 50%, ${COLORS.warning_500} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.RED]} {\n background: linear-gradient(to right, ${COLORS.critical_200} 50%, ${COLORS.critical_500} 50%) left;\n background-size: 200% 100%;\n }\n`;\n\nexport const ToastContainer = styled.div<{ animation: { duration: string; bezier: string; transform: string; keyframes: any }; withLoader: boolean; withClose: boolean }>`\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\n border-radius: 4px;\n\n animation: ${(props) => props.animation.keyframes} ${(props) => props.animation.duration} ${(props) => props.animation.bezier};\n transform: ${(props) => props.animation.transform};\n\n transition: all 300ms cubic-bezier(0.64, 0.04, 0.35, 1);\n\n padding: 0 ${(props) => (props.withClose ? '0' : '16px')} ${(props) => (props.withLoader ? '4px' : '0')} 16px;\n\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 16px;\n justify-content: left;\n\n position: relative;\n\n width: max-content;\n min-height: 48px;\n box-sizing: border-box;\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.white)}\n\n & a {\n display: inline;\n ${HyperLinkInvertedStyling}\n }\n\n &.${ToastColor[ToastColor.BLACK]} {\n background-color: ${COLORS.neutral_800};\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n background-color: ${COLORS.white};\n color: ${COLORS.black};\n\n & a {\n ${HyperLinkDefaultStyling}\n }\n }\n\n &.${ToastColor[ToastColor.BLUE]} {\n background-color: ${COLORS.accent1_600};\n }\n\n &.${ToastColor[ToastColor.GREEN]} {\n background-color: ${COLORS.correct_500};\n }\n\n &.${ToastColor[ToastColor.ORANGE]} {\n background-color: ${COLORS.warning_500};\n }\n\n &.${ToastColor[ToastColor.RED]} {\n background-color: ${COLORS.critical_500};\n }\n`;\n\nexport const ToastActionButtons = styled.div`\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n\n & .action {\n height: unset;\n }\n`;\n\nexport const ToastCloseButton = styled.div`\n & > button {\n margin-left: 16px;\n\n & svg {\n padding: 0;\n }\n }\n\n button svg path{\n fill: ${COLORS.white} !important;\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n button svg path {\n fill: ${COLORS.neutral_600} !important;\n }\n }\n`;\n\nexport const ToastTextContainer = styled.span`\n font-feature-settings: 'liga' off;\n width: 240px;\n display: flex;\n padding: 16px 0;\n`;\n\nexport const ToastIconContainer = styled.span`\n margin-right: -8px;\n`;\n\nexport type ToastOptions = {\n color?: ToastColor;\n autoClose?: boolean;\n delay?: number;\n showCloseButton?: boolean;\n action?: {\n label: string;\n handler: () => void;\n type?: ToastActionType;\n }[];\n position: ToastPosition;\n enterFrom?: ToastEntryDirection;\n icon?: React.ReactNode;\n};\n\ntype Props = {\n remove?: any;\n content: any;\n options?: ToastOptions;\n testId?: string;\n};\n\nconst DEFAULT_OPTIONS: ToastOptions = {\n color: ToastColor.BLACK,\n autoClose: true,\n delay: 5000,\n showCloseButton: false,\n position: ToastPosition.TOPLEFT,\n enterFrom: ToastEntryDirection.TOP,\n};\n\nconst Toast = ({ content, remove, options = DEFAULT_OPTIONS, testId }: Props) => {\n\n if(!remove)\n throw new Error('remove function is required when rendering Toast. Make sure that you are using useToast hook and ToastProvider for rendering Toasts');\n\n const removeRef = React.useRef();\n removeRef.current = remove;\n\n const elementRef = React.useRef<any>(null);\n\n const [shouldRemove, setShouldRemove] = React.useState(false);\n const [dimensions, setDimensions] = React.useState<{ width: number; height: number }>({ width: 0, height: 0 });\n\n const opts = { ...DEFAULT_OPTIONS, ...options };\n\n React.useEffect(() => {\n if (opts?.autoClose) {\n // @ts-ignore\n const id = setTimeout(() => setShouldRemove(true), opts.delay);\n return () => clearTimeout(id);\n }\n return undefined;\n }, []);\n\n React.useEffect(() => {\n if (shouldRemove) {\n // @ts-ignore\n const id = setTimeout(() => removeRef.current(), 200);\n return () => clearTimeout(id);\n }\n }, [shouldRemove]);\n\n React.useEffect(() => {\n setDimensions({ height: elementRef.current?.clientHeight, width: elementRef.current?.clientWidth });\n }, []);\n\n const animation = animations[shouldRemove ? 'leave' : 'enter'];\n const direction = animation[opts.enterFrom ?? ToastEntryDirection.TOP];\n\n const fromY = dimensions.height * direction.fromHeight;\n const toY = dimensions.height * direction.toHeight;\n const fromX = dimensions.width * direction.fromWidth;\n const toX = dimensions.width * direction.toWidth;\n\n let prop = {\n duration: animation.duration,\n bezier: animation.bezier,\n transform: `translateY(${toY}) translateX(${toX})`,\n keyframes: keyframes`\n 0% {\n transform: translateY(${fromY}px) translateX(${fromX}px);\n }\n 100% {\n transform: translateY(${toY}px) translateX(${toX}px);\n }`,\n };\n\n if (!dimensions.height) {\n prop = {\n ...prop,\n ...{\n transform: 'translateY(-1000vh) translateX(-1000vw)',\n keyframes: keyframes``,\n },\n };\n }\n\n const theme = ToastColor[opts.color ?? ToastColor.BLACK];\n\n if (!shouldRemove){\n setTimeout(() => elementRef?.current?.focus());\n }\n\n return (\n <ToastContainer data-testid={testId}\n animation={prop}\n ref={elementRef}\n withLoader={!!opts.autoClose}\n className={theme}\n withClose={!!opts.showCloseButton}\n tabIndex={-1}>\n {opts.icon && <ToastIconContainer>{opts.icon}</ToastIconContainer>}\n <ToastTextContainer className={'description'}>{content}</ToastTextContainer>\n {opts.action && (\n <ToastActionButtons>\n {opts.action.map((action, i) => (\n <Button\n size={Size.Small}\n variant={action.type === ToastActionType.SECONDARY ? 'secondary' : 'primary'}\n colorTheme={opts.color !== ToastColor.WHITE ? 'dark' : 'teal'}\n invertFocus={opts.color === ToastColor.BLACK}\n key={i}\n onClick={() => {\n setShouldRemove(true);\n action.handler();\n }}\n className={'action'}>\n {action.label}\n </Button>\n ))}\n </ToastActionButtons>\n )}\n {opts.showCloseButton && (\n <ToastCloseButton className={`close-button ${theme}`}>\n <IconButton variant={'secondary'}\n shape=\"circular\"\n useTransparentBackground={true}\n invertFocus={opts.color === ToastColor.BLACK}\n action={(event) => setShouldRemove(true)}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600} />\n </IconButton>\n </ToastCloseButton>\n )}\n {!!opts.autoClose && <Loader className={`loader ${theme}`} duration={opts.delay ?? 0} />}\n </ToastContainer>\n );\n};\n\nexport default Toast;\n\nconst animations = {\n enter: {\n bezier: 'cubic-bezier(0.22, 0.61, 0.35, 1)',\n duration: '300ms',\n [ToastEntryDirection.TOP]: {\n fromHeight: -1,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.BOTTOM]: {\n fromHeight: 1,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.LEFT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: -1,\n toWidth: 0,\n },\n [ToastEntryDirection.RIGHT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 1,\n toWidth: 0,\n },\n },\n leave: {\n bezier: 'cubic-bezier(0.5, 0.05, 0.67, 0.19)',\n duration: '205ms',\n [ToastEntryDirection.TOP]: {\n fromHeight: 0,\n toHeight: -1,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.BOTTOM]: {\n fromHeight: 0,\n toHeight: 1,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.LEFT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 0,\n toWidth: -1,\n },\n [ToastEntryDirection.RIGHT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 1,\n },\n },\n};\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAEvC,IAAMA,wBAAwB,OAAGC,2BAA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O,EAAE;EACX,CAAC,yCACArC,0BAAmB,CAACuD,IAAI,EAAG;IAC1BxB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC,CAAC;IACbE,OAAO,EAAE;EACX,CAAC,yCACArC,0BAAmB,CAACwD,KAAK,EAAG;IAC3BzB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,UACF;EACDoB,KAAK;IACHlF,MAAM,EAAE,qCAAqC;IAC7CzB,QAAQ,EAAE;EAAO,yCAChBkD,0BAAmB,CAACC,GAAG,EAAG;IACzB8B,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC,CAAC;IACZE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,yCACArC,0BAAmB,CAACsD,MAAM,EAAG;IAC5BvB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,yCACArC,0BAAmB,CAACuD,IAAI,EAAG;IAC1BxB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE,CAAC;EACZ,CAAC,yCACArC,0BAAmB,CAACwD,KAAK,EAAG;IAC3BzB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC;AAEL,CAAC"}
@@ -1,5 +1,20 @@
1
1
  import * as React from 'react';
2
+ import { keyframes } from 'styled-components';
2
3
  import { ToastActionType, ToastColor, ToastEntryDirection, ToastPosition } from '../types';
4
+ export declare const ToastContainer: import("styled-components").StyledComponent<"div", any, {
5
+ animation: {
6
+ duration: string;
7
+ bezier: string;
8
+ transform: string;
9
+ keyframes: any;
10
+ };
11
+ withLoader: boolean;
12
+ withClose: boolean;
13
+ }, never>;
14
+ export declare const ToastActionButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
15
+ export declare const ToastCloseButton: import("styled-components").StyledComponent<"div", any, {}, never>;
16
+ export declare const ToastTextContainer: import("styled-components").StyledComponent<"span", any, {}, never>;
17
+ export declare const ToastIconContainer: import("styled-components").StyledComponent<"span", any, {}, never>;
3
18
  export type ToastOptions = {
4
19
  color?: ToastColor;
5
20
  autoClose?: boolean;
@@ -20,7 +20,7 @@ var LoaderAnimationKeyframes = keyframes(_templateObject || (_templateObject = _
20
20
  var Loader = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n border-bottom-left-radius: 8px;\n border-bottom-right-radius: 8px;\n\n animation: ", " ", "ms cubic-bezier(0.18, 0.39, 0.35, 1);\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n\n &.", " {\n background: linear-gradient(to right, ", " 50%, ", " 50%) left;\n background-size: 200% 100%;\n }\n"])), LoaderAnimationKeyframes, function (props) {
21
21
  return props.duration;
22
22
  }, ToastColor[ToastColor.BLACK], COLORS.neutral_200, COLORS.neutral_800, ToastColor[ToastColor.WHITE], COLORS.neutral_400, COLORS.white, ToastColor[ToastColor.BLUE], COLORS.accent1_200, COLORS.accent1_600, ToastColor[ToastColor.GREEN], COLORS.correct_200, COLORS.correct_500, ToastColor[ToastColor.ORANGE], COLORS.warning_200, COLORS.warning_500, ToastColor[ToastColor.RED], COLORS.critical_200, COLORS.critical_500);
23
- var Container = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-shadow: ", ";\n border-radius: 4px;\n\n animation: ", " ", " ", ";\n transform: ", ";\n\n transition: all 300ms cubic-bezier(0.64, 0.04, 0.35, 1);\n\n padding: 0 ", " ", " 16px;\n\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 16px;\n justify-content: left;\n\n position: relative;\n\n width: max-content;\n min-height: 48px;\n box-sizing: border-box;\n\n ", "\n\n & a {\n display: inline;\n ", "\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n color: ", ";\n\n & a {\n ", "\n }\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n"])), BOXSHADOWS.BOXSHADOW_L2, function (props) {
23
+ export var ToastContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-shadow: ", ";\n border-radius: 4px;\n\n animation: ", " ", " ", ";\n transform: ", ";\n\n transition: all 300ms cubic-bezier(0.64, 0.04, 0.35, 1);\n\n padding: 0 ", " ", " 16px;\n\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 16px;\n justify-content: left;\n\n position: relative;\n\n width: max-content;\n min-height: 48px;\n box-sizing: border-box;\n\n ", "\n\n & a {\n display: inline;\n ", "\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n color: ", ";\n\n & a {\n ", "\n }\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n"])), BOXSHADOWS.BOXSHADOW_L2, function (props) {
24
24
  return props.animation.keyframes;
25
25
  }, function (props) {
26
26
  return props.animation.duration;
@@ -33,10 +33,10 @@ var Container = styled.div(_templateObject3 || (_templateObject3 = _taggedTempla
33
33
  }, function (props) {
34
34
  return props.withLoader ? '4px' : '0';
35
35
  }, ComponentSStyling(ComponentTextStyle.Regular, COLORS.white), HyperLinkInvertedStyling, ToastColor[ToastColor.BLACK], COLORS.neutral_800, ToastColor[ToastColor.WHITE], COLORS.white, COLORS.black, HyperLinkDefaultStyling, ToastColor[ToastColor.BLUE], COLORS.accent1_600, ToastColor[ToastColor.GREEN], COLORS.correct_500, ToastColor[ToastColor.ORANGE], COLORS.warning_500, ToastColor[ToastColor.RED], COLORS.critical_500);
36
- var ActionButtons = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n\n & .action {\n height: unset;\n }\n"])));
37
- var CloseButton = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & > button {\n margin-left: 16px;\n\n & svg {\n padding: 0;\n }\n }\n\n button svg path{\n fill: ", " !important;\n }\n\n &.", " {\n button svg path {\n fill: ", " !important;\n }\n }\n"])), COLORS.white, ToastColor[ToastColor.WHITE], COLORS.neutral_600);
38
- var TextContainer = styled.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-feature-settings: 'liga' off;\n width: 240px;\n display: flex;\n padding: 16px 0;\n"])));
39
- var IconContainer = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-right: -8px;\n"])));
36
+ export var ToastActionButtons = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n\n & .action {\n height: unset;\n }\n"])));
37
+ export var ToastCloseButton = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & > button {\n margin-left: 16px;\n\n & svg {\n padding: 0;\n }\n }\n\n button svg path{\n fill: ", " !important;\n }\n\n &.", " {\n button svg path {\n fill: ", " !important;\n }\n }\n"])), COLORS.white, ToastColor[ToastColor.WHITE], COLORS.neutral_600);
38
+ export var ToastTextContainer = styled.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-feature-settings: 'liga' off;\n width: 240px;\n display: flex;\n padding: 16px 0;\n"])));
39
+ export var ToastIconContainer = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-right: -8px;\n"])));
40
40
  var DEFAULT_OPTIONS = {
41
41
  color: ToastColor.BLACK,
42
42
  autoClose: true,
@@ -123,7 +123,7 @@ var Toast = function Toast(_ref) {
123
123
  return elementRef === null || elementRef === void 0 ? void 0 : (_elementRef$current3 = elementRef.current) === null || _elementRef$current3 === void 0 ? void 0 : _elementRef$current3.focus();
124
124
  });
125
125
  }
126
- return /*#__PURE__*/_jsxs(Container, {
126
+ return /*#__PURE__*/_jsxs(ToastContainer, {
127
127
  "data-testid": testId,
128
128
  animation: prop,
129
129
  ref: elementRef,
@@ -131,12 +131,12 @@ var Toast = function Toast(_ref) {
131
131
  className: theme,
132
132
  withClose: !!opts.showCloseButton,
133
133
  tabIndex: -1,
134
- children: [opts.icon && /*#__PURE__*/_jsx(IconContainer, {
134
+ children: [opts.icon && /*#__PURE__*/_jsx(ToastIconContainer, {
135
135
  children: opts.icon
136
- }), /*#__PURE__*/_jsx(TextContainer, {
136
+ }), /*#__PURE__*/_jsx(ToastTextContainer, {
137
137
  className: 'description',
138
138
  children: content
139
- }), opts.action && /*#__PURE__*/_jsx(ActionButtons, {
139
+ }), opts.action && /*#__PURE__*/_jsx(ToastActionButtons, {
140
140
  children: opts.action.map(function (action, i) {
141
141
  return /*#__PURE__*/_jsx(Button, {
142
142
  size: Size.Small,
@@ -151,7 +151,7 @@ var Toast = function Toast(_ref) {
151
151
  children: action.label
152
152
  }, i);
153
153
  })
154
- }), opts.showCloseButton && /*#__PURE__*/_jsx(CloseButton, {
154
+ }), opts.showCloseButton && /*#__PURE__*/_jsx(ToastCloseButton, {
155
155
  className: "close-button ".concat(theme),
156
156
  children: /*#__PURE__*/_jsx(IconButton, {
157
157
  variant: 'secondary',
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","names":["React","styled","keyframes","ToastActionType","ToastColor","ToastEntryDirection","ToastPosition","BOXSHADOWS","COLORS","Size","Button","IconButton","ComponentSStyling","ComponentTextStyle","HyperLinkDefaultStyling","HyperLinkInvertedStyling","SystemIcons","LoaderAnimationKeyframes","Loader","div","props","duration","BLACK","neutral_200","neutral_800","WHITE","neutral_400","white","BLUE","accent1_200","accent1_600","GREEN","correct_200","correct_500","ORANGE","warning_200","warning_500","RED","critical_200","critical_500","Container","BOXSHADOW_L2","animation","bezier","transform","withClose","withLoader","Regular","black","ActionButtons","CloseButton","neutral_600","TextContainer","span","IconContainer","DEFAULT_OPTIONS","color","autoClose","delay","showCloseButton","position","TOPLEFT","enterFrom","TOP","Toast","content","remove","options","testId","Error","removeRef","useRef","current","elementRef","useState","shouldRemove","setShouldRemove","width","height","dimensions","setDimensions","opts","useEffect","id","setTimeout","clearTimeout","undefined","clientHeight","clientWidth","animations","direction","fromY","fromHeight","toY","toHeight","fromX","fromWidth","toX","toWidth","prop","theme","focus","icon","action","map","i","Small","type","SECONDARY","handler","label","event","enter","BOTTOM","LEFT","RIGHT","leave"],"sources":["../../src/Toasters/Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { keyframes } from 'styled-components';\nimport { ToastActionType, ToastColor, ToastEntryDirection, ToastPosition } from '../types';\nimport { BOXSHADOWS, COLORS} from '../styles';\nimport { Size } from '../types'\nimport { Button, IconButton } from '../Button';\nimport { ComponentSStyling, ComponentTextStyle } from '../styles';\nimport {HyperLinkDefaultStyling, HyperLinkInvertedStyling} from '../HyperLink';\nimport { SystemIcons } from '../icons';\n\nconst LoaderAnimationKeyframes = keyframes`\n 0% {\n background-position: right;\n }\n 100% {\n background-position: left;\n }\n`;\n\nconst Loader = styled.div<{ duration: number }>`\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n border-bottom-left-radius: 8px;\n border-bottom-right-radius: 8px;\n\n animation: ${LoaderAnimationKeyframes} ${(props) => props.duration}ms cubic-bezier(0.18, 0.39, 0.35, 1);\n\n &.${ToastColor[ToastColor.BLACK]} {\n background: linear-gradient(to right, ${COLORS.neutral_200} 50%, ${COLORS.neutral_800} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n background: linear-gradient(to right, ${COLORS.neutral_400} 50%, ${COLORS.white} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.BLUE]} {\n background: linear-gradient(to right, ${COLORS.accent1_200} 50%, ${COLORS.accent1_600} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.GREEN]} {\n background: linear-gradient(to right, ${COLORS.correct_200} 50%, ${COLORS.correct_500} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.ORANGE]} {\n background: linear-gradient(to right, ${COLORS.warning_200} 50%, ${COLORS.warning_500} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.RED]} {\n background: linear-gradient(to right, ${COLORS.critical_200} 50%, ${COLORS.critical_500} 50%) left;\n background-size: 200% 100%;\n }\n`;\n\nconst Container = styled.div<{ animation: { duration: string; bezier: string; transform: string; keyframes: any }; withLoader: boolean; withClose: boolean }>`\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\n border-radius: 4px;\n\n animation: ${(props) => props.animation.keyframes} ${(props) => props.animation.duration} ${(props) => props.animation.bezier};\n transform: ${(props) => props.animation.transform};\n\n transition: all 300ms cubic-bezier(0.64, 0.04, 0.35, 1);\n\n padding: 0 ${(props) => (props.withClose ? '0' : '16px')} ${(props) => (props.withLoader ? '4px' : '0')} 16px;\n\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 16px;\n justify-content: left;\n\n position: relative;\n\n width: max-content;\n min-height: 48px;\n box-sizing: border-box;\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.white)}\n\n & a {\n display: inline;\n ${HyperLinkInvertedStyling}\n }\n\n &.${ToastColor[ToastColor.BLACK]} {\n background-color: ${COLORS.neutral_800};\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n background-color: ${COLORS.white};\n color: ${COLORS.black};\n\n & a {\n ${HyperLinkDefaultStyling}\n }\n }\n\n &.${ToastColor[ToastColor.BLUE]} {\n background-color: ${COLORS.accent1_600};\n }\n\n &.${ToastColor[ToastColor.GREEN]} {\n background-color: ${COLORS.correct_500};\n }\n\n &.${ToastColor[ToastColor.ORANGE]} {\n background-color: ${COLORS.warning_500};\n }\n\n &.${ToastColor[ToastColor.RED]} {\n background-color: ${COLORS.critical_500};\n }\n`;\n\nconst ActionButtons = styled.div`\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n\n & .action {\n height: unset;\n }\n`;\n\nconst CloseButton = styled.div`\n & > button {\n margin-left: 16px;\n\n & svg {\n padding: 0;\n }\n }\n\n button svg path{\n fill: ${COLORS.white} !important;\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n button svg path {\n fill: ${COLORS.neutral_600} !important;\n }\n }\n`;\n\nconst TextContainer = styled.span`\n font-feature-settings: 'liga' off;\n width: 240px;\n display: flex;\n padding: 16px 0;\n`;\n\nconst IconContainer = styled.span`\n margin-right: -8px;\n`;\n\nexport type ToastOptions = {\n color?: ToastColor;\n autoClose?: boolean;\n delay?: number;\n showCloseButton?: boolean;\n action?: {\n label: string;\n handler: () => void;\n type?: ToastActionType;\n }[];\n position: ToastPosition;\n enterFrom?: ToastEntryDirection;\n icon?: React.ReactNode;\n};\n\ntype Props = {\n remove?: any;\n content: any;\n options?: ToastOptions;\n testId?: string;\n};\n\nconst DEFAULT_OPTIONS: ToastOptions = {\n color: ToastColor.BLACK,\n autoClose: true,\n delay: 5000,\n showCloseButton: false,\n position: ToastPosition.TOPLEFT,\n enterFrom: ToastEntryDirection.TOP,\n};\n\nconst Toast = ({ content, remove, options = DEFAULT_OPTIONS, testId }: Props) => {\n\n if(!remove)\n throw new Error('remove function is required when rendering Toast. Make sure that you are using useToast hook and ToastProvider for rendering Toasts');\n\n const removeRef = React.useRef();\n removeRef.current = remove;\n\n const elementRef = React.useRef<any>(null);\n\n const [shouldRemove, setShouldRemove] = React.useState(false);\n const [dimensions, setDimensions] = React.useState<{ width: number; height: number }>({ width: 0, height: 0 });\n\n const opts = { ...DEFAULT_OPTIONS, ...options };\n\n React.useEffect(() => {\n if (opts?.autoClose) {\n // @ts-ignore\n const id = setTimeout(() => setShouldRemove(true), opts.delay);\n return () => clearTimeout(id);\n }\n return undefined;\n }, []);\n\n React.useEffect(() => {\n if (shouldRemove) {\n // @ts-ignore\n const id = setTimeout(() => removeRef.current(), 200);\n return () => clearTimeout(id);\n }\n }, [shouldRemove]);\n\n React.useEffect(() => {\n setDimensions({ height: elementRef.current?.clientHeight, width: elementRef.current?.clientWidth });\n }, []);\n\n const animation = animations[shouldRemove ? 'leave' : 'enter'];\n const direction = animation[opts.enterFrom ?? ToastEntryDirection.TOP];\n\n const fromY = dimensions.height * direction.fromHeight;\n const toY = dimensions.height * direction.toHeight;\n const fromX = dimensions.width * direction.fromWidth;\n const toX = dimensions.width * direction.toWidth;\n\n let prop = {\n duration: animation.duration,\n bezier: animation.bezier,\n transform: `translateY(${toY}) translateX(${toX})`,\n keyframes: keyframes`\n 0% {\n transform: translateY(${fromY}px) translateX(${fromX}px);\n }\n 100% {\n transform: translateY(${toY}px) translateX(${toX}px);\n }`,\n };\n\n if (!dimensions.height) {\n prop = {\n ...prop,\n ...{\n transform: 'translateY(-1000vh) translateX(-1000vw)',\n keyframes: keyframes``,\n },\n };\n }\n\n const theme = ToastColor[opts.color ?? ToastColor.BLACK];\n\n if (!shouldRemove){\n setTimeout(() => elementRef?.current?.focus());\n }\n\n return (\n <Container data-testid={testId}\n animation={prop}\n ref={elementRef}\n withLoader={!!opts.autoClose}\n className={theme}\n withClose={!!opts.showCloseButton}\n tabIndex={-1}>\n {opts.icon && <IconContainer>{opts.icon}</IconContainer>}\n <TextContainer className={'description'}>{content}</TextContainer>\n {opts.action && (\n <ActionButtons>\n {opts.action.map((action, i) => (\n <Button\n size={Size.Small}\n variant={action.type === ToastActionType.SECONDARY ? 'secondary' : 'primary'}\n colorTheme={opts.color !== ToastColor.WHITE ? 'dark' : 'teal'}\n invertFocus={opts.color === ToastColor.BLACK}\n key={i}\n onClick={() => {\n setShouldRemove(true);\n action.handler();\n }}\n className={'action'}>\n {action.label}\n </Button>\n ))}\n </ActionButtons>\n )}\n {opts.showCloseButton && (\n <CloseButton className={`close-button ${theme}`}>\n <IconButton variant={'secondary'}\n shape=\"circular\"\n useTransparentBackground={true}\n invertFocus={opts.color === ToastColor.BLACK}\n action={(event) => setShouldRemove(true)}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600} />\n </IconButton>\n </CloseButton>\n )}\n {!!opts.autoClose && <Loader className={`loader ${theme}`} duration={opts.delay ?? 0} />}\n </Container>\n );\n};\n\nexport default Toast;\n\nconst animations = {\n enter: {\n bezier: 'cubic-bezier(0.22, 0.61, 0.35, 1)',\n duration: '300ms',\n [ToastEntryDirection.TOP]: {\n fromHeight: -1,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.BOTTOM]: {\n fromHeight: 1,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.LEFT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: -1,\n toWidth: 0,\n },\n [ToastEntryDirection.RIGHT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 1,\n toWidth: 0,\n },\n },\n leave: {\n bezier: 'cubic-bezier(0.5, 0.05, 0.67, 0.19)',\n duration: '205ms',\n [ToastEntryDirection.TOP]: {\n fromHeight: 0,\n toHeight: -1,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.BOTTOM]: {\n fromHeight: 0,\n toHeight: 1,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.LEFT]: {\n fromHeight: 0,\n to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,EAAE;EACX,CAAC,2BACA7F,mBAAmB,CAAC6G,IAAI,EAAG;IAC1BtB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE,CAAC;EACZ,CAAC,2BACA7F,mBAAmB,CAAC8G,KAAK,EAAG;IAC3BvB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC;AAEL,CAAC"}
1
+ {"version":3,"file":"Toast.js","names":["React","styled","keyframes","ToastActionType","ToastColor","ToastEntryDirection","ToastPosition","BOXSHADOWS","COLORS","Size","Button","IconButton","ComponentSStyling","ComponentTextStyle","HyperLinkDefaultStyling","HyperLinkInvertedStyling","SystemIcons","LoaderAnimationKeyframes","Loader","div","props","duration","BLACK","neutral_200","neutral_800","WHITE","neutral_400","white","BLUE","accent1_200","accent1_600","GREEN","correct_200","correct_500","ORANGE","warning_200","warning_500","RED","critical_200","critical_500","ToastContainer","BOXSHADOW_L2","animation","bezier","transform","withClose","withLoader","Regular","black","ToastActionButtons","ToastCloseButton","neutral_600","ToastTextContainer","span","ToastIconContainer","DEFAULT_OPTIONS","color","autoClose","delay","showCloseButton","position","TOPLEFT","enterFrom","TOP","Toast","content","remove","options","testId","Error","removeRef","useRef","current","elementRef","useState","shouldRemove","setShouldRemove","width","height","dimensions","setDimensions","opts","useEffect","id","setTimeout","clearTimeout","undefined","clientHeight","clientWidth","animations","direction","fromY","fromHeight","toY","toHeight","fromX","fromWidth","toX","toWidth","prop","theme","focus","icon","action","map","i","Small","type","SECONDARY","handler","label","event","enter","BOTTOM","LEFT","RIGHT","leave"],"sources":["../../src/Toasters/Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { keyframes } from 'styled-components';\nimport { ToastActionType, ToastColor, ToastEntryDirection, ToastPosition } from '../types';\nimport { BOXSHADOWS, COLORS} from '../styles';\nimport { Size } from '../types'\nimport { Button, IconButton } from '../Button';\nimport { ComponentSStyling, ComponentTextStyle } from '../styles';\nimport {HyperLinkDefaultStyling, HyperLinkInvertedStyling} from '../HyperLink';\nimport { SystemIcons } from '../icons';\n\nconst LoaderAnimationKeyframes = keyframes`\n 0% {\n background-position: right;\n }\n 100% {\n background-position: left;\n }\n`;\n\nconst Loader = styled.div<{ duration: number }>`\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n border-bottom-left-radius: 8px;\n border-bottom-right-radius: 8px;\n\n animation: ${LoaderAnimationKeyframes} ${(props) => props.duration}ms cubic-bezier(0.18, 0.39, 0.35, 1);\n\n &.${ToastColor[ToastColor.BLACK]} {\n background: linear-gradient(to right, ${COLORS.neutral_200} 50%, ${COLORS.neutral_800} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n background: linear-gradient(to right, ${COLORS.neutral_400} 50%, ${COLORS.white} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.BLUE]} {\n background: linear-gradient(to right, ${COLORS.accent1_200} 50%, ${COLORS.accent1_600} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.GREEN]} {\n background: linear-gradient(to right, ${COLORS.correct_200} 50%, ${COLORS.correct_500} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.ORANGE]} {\n background: linear-gradient(to right, ${COLORS.warning_200} 50%, ${COLORS.warning_500} 50%) left;\n background-size: 200% 100%;\n }\n\n &.${ToastColor[ToastColor.RED]} {\n background: linear-gradient(to right, ${COLORS.critical_200} 50%, ${COLORS.critical_500} 50%) left;\n background-size: 200% 100%;\n }\n`;\n\nexport const ToastContainer = styled.div<{ animation: { duration: string; bezier: string; transform: string; keyframes: any }; withLoader: boolean; withClose: boolean }>`\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\n border-radius: 4px;\n\n animation: ${(props) => props.animation.keyframes} ${(props) => props.animation.duration} ${(props) => props.animation.bezier};\n transform: ${(props) => props.animation.transform};\n\n transition: all 300ms cubic-bezier(0.64, 0.04, 0.35, 1);\n\n padding: 0 ${(props) => (props.withClose ? '0' : '16px')} ${(props) => (props.withLoader ? '4px' : '0')} 16px;\n\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 16px;\n justify-content: left;\n\n position: relative;\n\n width: max-content;\n min-height: 48px;\n box-sizing: border-box;\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.white)}\n\n & a {\n display: inline;\n ${HyperLinkInvertedStyling}\n }\n\n &.${ToastColor[ToastColor.BLACK]} {\n background-color: ${COLORS.neutral_800};\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n background-color: ${COLORS.white};\n color: ${COLORS.black};\n\n & a {\n ${HyperLinkDefaultStyling}\n }\n }\n\n &.${ToastColor[ToastColor.BLUE]} {\n background-color: ${COLORS.accent1_600};\n }\n\n &.${ToastColor[ToastColor.GREEN]} {\n background-color: ${COLORS.correct_500};\n }\n\n &.${ToastColor[ToastColor.ORANGE]} {\n background-color: ${COLORS.warning_500};\n }\n\n &.${ToastColor[ToastColor.RED]} {\n background-color: ${COLORS.critical_500};\n }\n`;\n\nexport const ToastActionButtons = styled.div`\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n\n & .action {\n height: unset;\n }\n`;\n\nexport const ToastCloseButton = styled.div`\n & > button {\n margin-left: 16px;\n\n & svg {\n padding: 0;\n }\n }\n\n button svg path{\n fill: ${COLORS.white} !important;\n }\n\n &.${ToastColor[ToastColor.WHITE]} {\n button svg path {\n fill: ${COLORS.neutral_600} !important;\n }\n }\n`;\n\nexport const ToastTextContainer = styled.span`\n font-feature-settings: 'liga' off;\n width: 240px;\n display: flex;\n padding: 16px 0;\n`;\n\nexport const ToastIconContainer = styled.span`\n margin-right: -8px;\n`;\n\nexport type ToastOptions = {\n color?: ToastColor;\n autoClose?: boolean;\n delay?: number;\n showCloseButton?: boolean;\n action?: {\n label: string;\n handler: () => void;\n type?: ToastActionType;\n }[];\n position: ToastPosition;\n enterFrom?: ToastEntryDirection;\n icon?: React.ReactNode;\n};\n\ntype Props = {\n remove?: any;\n content: any;\n options?: ToastOptions;\n testId?: string;\n};\n\nconst DEFAULT_OPTIONS: ToastOptions = {\n color: ToastColor.BLACK,\n autoClose: true,\n delay: 5000,\n showCloseButton: false,\n position: ToastPosition.TOPLEFT,\n enterFrom: ToastEntryDirection.TOP,\n};\n\nconst Toast = ({ content, remove, options = DEFAULT_OPTIONS, testId }: Props) => {\n\n if(!remove)\n throw new Error('remove function is required when rendering Toast. Make sure that you are using useToast hook and ToastProvider for rendering Toasts');\n\n const removeRef = React.useRef();\n removeRef.current = remove;\n\n const elementRef = React.useRef<any>(null);\n\n const [shouldRemove, setShouldRemove] = React.useState(false);\n const [dimensions, setDimensions] = React.useState<{ width: number; height: number }>({ width: 0, height: 0 });\n\n const opts = { ...DEFAULT_OPTIONS, ...options };\n\n React.useEffect(() => {\n if (opts?.autoClose) {\n // @ts-ignore\n const id = setTimeout(() => setShouldRemove(true), opts.delay);\n return () => clearTimeout(id);\n }\n return undefined;\n }, []);\n\n React.useEffect(() => {\n if (shouldRemove) {\n // @ts-ignore\n const id = setTimeout(() => removeRef.current(), 200);\n return () => clearTimeout(id);\n }\n }, [shouldRemove]);\n\n React.useEffect(() => {\n setDimensions({ height: elementRef.current?.clientHeight, width: elementRef.current?.clientWidth });\n }, []);\n\n const animation = animations[shouldRemove ? 'leave' : 'enter'];\n const direction = animation[opts.enterFrom ?? ToastEntryDirection.TOP];\n\n const fromY = dimensions.height * direction.fromHeight;\n const toY = dimensions.height * direction.toHeight;\n const fromX = dimensions.width * direction.fromWidth;\n const toX = dimensions.width * direction.toWidth;\n\n let prop = {\n duration: animation.duration,\n bezier: animation.bezier,\n transform: `translateY(${toY}) translateX(${toX})`,\n keyframes: keyframes`\n 0% {\n transform: translateY(${fromY}px) translateX(${fromX}px);\n }\n 100% {\n transform: translateY(${toY}px) translateX(${toX}px);\n }`,\n };\n\n if (!dimensions.height) {\n prop = {\n ...prop,\n ...{\n transform: 'translateY(-1000vh) translateX(-1000vw)',\n keyframes: keyframes``,\n },\n };\n }\n\n const theme = ToastColor[opts.color ?? ToastColor.BLACK];\n\n if (!shouldRemove){\n setTimeout(() => elementRef?.current?.focus());\n }\n\n return (\n <ToastContainer data-testid={testId}\n animation={prop}\n ref={elementRef}\n withLoader={!!opts.autoClose}\n className={theme}\n withClose={!!opts.showCloseButton}\n tabIndex={-1}>\n {opts.icon && <ToastIconContainer>{opts.icon}</ToastIconContainer>}\n <ToastTextContainer className={'description'}>{content}</ToastTextContainer>\n {opts.action && (\n <ToastActionButtons>\n {opts.action.map((action, i) => (\n <Button\n size={Size.Small}\n variant={action.type === ToastActionType.SECONDARY ? 'secondary' : 'primary'}\n colorTheme={opts.color !== ToastColor.WHITE ? 'dark' : 'teal'}\n invertFocus={opts.color === ToastColor.BLACK}\n key={i}\n onClick={() => {\n setShouldRemove(true);\n action.handler();\n }}\n className={'action'}>\n {action.label}\n </Button>\n ))}\n </ToastActionButtons>\n )}\n {opts.showCloseButton && (\n <ToastCloseButton className={`close-button ${theme}`}>\n <IconButton variant={'secondary'}\n shape=\"circular\"\n useTransparentBackground={true}\n invertFocus={opts.color === ToastColor.BLACK}\n action={(event) => setShouldRemove(true)}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600} />\n </IconButton>\n </ToastCloseButton>\n )}\n {!!opts.autoClose && <Loader className={`loader ${theme}`} duration={opts.delay ?? 0} />}\n </ToastContainer>\n );\n};\n\nexport default Toast;\n\nconst animations = {\n enter: {\n bezier: 'cubic-bezier(0.22, 0.61, 0.35, 1)',\n duration: '300ms',\n [ToastEntryDirection.TOP]: {\n fromHeight: -1,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.BOTTOM]: {\n fromHeight: 1,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.LEFT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: -1,\n toWidth: 0,\n },\n [ToastEntryDirection.RIGHT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 1,\n toWidth: 0,\n },\n },\n leave: {\n bezier: 'cubic-bezier(0.5, 0.05, 0.67, 0.19)',\n duration: '205ms',\n [ToastEntryDirection.TOP]: {\n fromHeight: 0,\n toHeight: -1,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.BOTTOM]: {\n fromHeight: 0,\n toHeight: 1,\n fromWidth: 0,\n toWidth: 0,\n },\n [ToastEntryDirection.LEFT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 0,\n toWidth: -1,\n },\n [ToastEntryDirection.RIGHT]: {\n fromHeight: 0,\n toHeight: 0,\n fromWidth: 0,\n toWidth: 1,\n },\n },\n};\n"],"mappings":";;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AACrD,SAASC,eAAe,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,aAAa,QAAQ,UAAU;AAC1F,SAASC,UAAU,EAAEC,MAAM,QAAO,WAAW;AAC7C,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,MAAM,EAAEC,UAAU,QAAQ,WAAW;AAC9C,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,WAAW;AACjE,SAAQC,uBAAuB,EAAEC,wBAAwB,QAAO,cAAc;AAC9E,SAASC,WAAW,QAAQ,UAAU;AAAC;AAAA;AAEvC,IAAMC,wBAAwB,GAAGf,SAAS,oKAOzC;AAED,IAAMgB,MAAM,GAAGjB,MAAM,CAACkB,GAAG,u/BASVF,wBAAwB,EAAI,UAACG,KAAK;EAAA,OAAKA,KAAK,CAACC,QAAQ;AAAA,GAE9DjB,UAAU,CAACA,UAAU,CAACkB,KAAK,CAAC,EACUd,MAAM,CAACe,WAAW,EAASf,MAAM,CAACgB,WAAW,EAIn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,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,UACF;EACDkB,KAAK;IACHzE,MAAM,EAAE,qCAAqC;IAC7CtB,QAAQ,EAAE;EAAO,2BAChBhB,mBAAmB,CAAC0D,GAAG,EAAG;IACzB6B,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC,CAAC;IACZE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,2BACA7F,mBAAmB,CAAC4G,MAAM,EAAG;IAC5BrB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC,2BACA7F,mBAAmB,CAAC6G,IAAI,EAAG;IAC1BtB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE,CAAC;EACZ,CAAC,2BACA7F,mBAAmB,CAAC8G,KAAK,EAAG;IAC3BvB,UAAU,EAAE,CAAC;IACbE,QAAQ,EAAE,CAAC;IACXE,SAAS,EAAE,CAAC;IACZE,OAAO,EAAE;EACX,CAAC;AAEL,CAAC"}
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ var _exportNames = {
8
+ Toast: true,
9
+ ToastProvider: true,
10
+ useToast: true,
11
+ ToastContext: true
12
+ };
7
13
  Object.defineProperty(exports, "Toast", {
8
14
  enumerable: true,
9
15
  get: function get() {
@@ -28,6 +34,19 @@ Object.defineProperty(exports, "useToast", {
28
34
  return _ToastContext.useToast;
29
35
  }
30
36
  });
31
- var _Toast = _interopRequireDefault(require("./Toast"));
37
+ var _Toast = _interopRequireWildcard(require("./Toast"));
38
+ Object.keys(_Toast).forEach(function (key) {
39
+ if (key === "default" || key === "__esModule") return;
40
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
41
+ if (key in exports && exports[key] === _Toast[key]) return;
42
+ Object.defineProperty(exports, key, {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _Toast[key];
46
+ }
47
+ });
48
+ });
32
49
  var _ToastContext = require("./ToastContext");
50
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
51
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
52
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/Toasters/index.tsx"],"sourcesContent":["import Toast from './Toast';\nimport { ToastProvider, useToast, ToastContext } from './ToastContext';\n\nexport { Toast, ToastProvider, useToast, ToastContext };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/Toasters/index.tsx"],"sourcesContent":["import Toast from './Toast';\nimport { ToastProvider, useToast, ToastContext } from './ToastContext';\n\nexport * from './Toast';\nexport { Toast, ToastProvider, useToast, ToastContext };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAGA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAFA;AAAuE;AAAA"}
@@ -1,3 +1,4 @@
1
1
  import Toast from './Toast';
2
2
  import { ToastProvider, useToast, ToastContext } from './ToastContext';
3
+ export * from './Toast';
3
4
  export { Toast, ToastProvider, useToast, ToastContext };
@@ -1,4 +1,5 @@
1
1
  import Toast from './Toast';
2
2
  import { ToastProvider, useToast, ToastContext } from './ToastContext';
3
+ export * from './Toast';
3
4
  export { Toast, ToastProvider, useToast, ToastContext };
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Toast","ToastProvider","useToast","ToastContext"],"sources":["../../src/Toasters/index.tsx"],"sourcesContent":["import Toast from './Toast';\nimport { ToastProvider, useToast, ToastContext } from './ToastContext';\n\nexport { Toast, ToastProvider, useToast, ToastContext };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,SAAS;AAC3B,SAASC,aAAa,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,gBAAgB;AAEtE,SAASH,KAAK,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,YAAY"}
1
+ {"version":3,"file":"index.js","names":["Toast","ToastProvider","useToast","ToastContext"],"sources":["../../src/Toasters/index.tsx"],"sourcesContent":["import Toast from './Toast';\nimport { ToastProvider, useToast, ToastContext } from './ToastContext';\n\nexport * from './Toast';\nexport { Toast, ToastProvider, useToast, ToastContext };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,SAAS;AAC3B,SAASC,aAAa,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,gBAAgB;AAEtE,cAAc,SAAS;AACvB,SAASH,KAAK,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,YAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laerdal/life-react-components",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "private": false,
5
5
  "author": "Erik Martirosyan <erik.martirosyan@laerdal.com>",
6
6
  "contributors": [],