@frontify/fondue 12.0.0-beta.377 → 12.0.0-beta.379
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/components/Breadcrumbs/FormattedBreadcrumbs.es.js +2 -3
- package/dist/components/Breadcrumbs/FormattedBreadcrumbs.es.js.map +1 -1
- package/dist/components/Toast/Toast.es.js +21 -13
- package/dist/components/Toast/Toast.es.js.map +1 -1
- package/dist/components/Toast/types.es.js.map +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,8 @@ const R = ({
|
|
|
12
12
|
}) => {
|
|
13
13
|
const m = K(!0);
|
|
14
14
|
return [...t.map(({ label: u, badges: B, bold: C, decorator: a, link: i, onClick: f }, e) => {
|
|
15
|
-
const s = `breadcrumb-${e}`, d = o && e === 0, F = e === t.length - 1, g = o ? 2 : 3, b = t.length - g, p = e >= b, v = l && !d && !p, h = e < t.length - 1;
|
|
15
|
+
const s = `breadcrumb-${e}`, d = o && e === 0, F = e === t.length - 1, g = o ? 2 : 3, b = t.length - g, p = e >= b, v = l && !d && !p, h = e < t.length - 1, I = [];
|
|
16
|
+
let c = -1;
|
|
16
17
|
switch (!0) {
|
|
17
18
|
case F:
|
|
18
19
|
return /* @__PURE__ */ r(
|
|
@@ -46,8 +47,6 @@ const R = ({
|
|
|
46
47
|
);
|
|
47
48
|
case (v && m.current):
|
|
48
49
|
m.current = !1;
|
|
49
|
-
const I = [];
|
|
50
|
-
let c = -1;
|
|
51
50
|
for (const $ of t) {
|
|
52
51
|
if (c++, c >= b)
|
|
53
52
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedBreadcrumbs.es.js","sources":["../../../src/components/Breadcrumbs/FormattedBreadcrumbs.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ReactElement, useRef } from 'react';\nimport { BreadcrumbsProps } from './Breadcrumbs';\nimport { CurrentBreadcrumbItem } from './CurrentBreadcrumbItem';\nimport { BreadcrumbItem } from './BreadcrumbItem';\nimport { OverflowMenu, OverflowMenuItemProps } from '..';\n\nexport const FormattedBreadcrumbs = ({\n items,\n keepRoot,\n activeInline = false,\n truncate = false,\n 'data-test-id': dataTestId,\n}: BreadcrumbsProps): ReactElement[] => {\n const renderTruncationRef = useRef<boolean>(true);\n\n const elements = items.map(({ label, badges, bold, decorator, link, onClick }, index) => {\n const key = `breadcrumb-${index}`;\n const isRootKept = keepRoot && index === 0;\n const isCurrent = index === items.length - 1;\n const startLastItemIndex = keepRoot ? 2 : 3;\n const lastItemsIndex = items.length - startLastItemIndex;\n const isLastItems = index >= lastItemsIndex;\n const isTruncatedItem = truncate && !isRootKept && !isLastItems;\n const showSeparator = index < items.length - 1;\n\n switch (true) {\n case isCurrent:\n return (\n <CurrentBreadcrumbItem\n key={key}\n label={label}\n badges={badges}\n bold={bold}\n decorator={decorator}\n link={link}\n onClick={onClick}\n activeInline={activeInline}\n data-test-id={dataTestId}\n />\n );\n\n case !truncate:\n case isRootKept:\n case isLastItems:\n return (\n <BreadcrumbItem\n key={key}\n label={label}\n decorator={decorator}\n link={link}\n onClick={onClick}\n showSeparator={showSeparator}\n data-test-id={dataTestId}\n />\n );\n\n case isTruncatedItem && renderTruncationRef.current:\n renderTruncationRef.current = false;\n
|
|
1
|
+
{"version":3,"file":"FormattedBreadcrumbs.es.js","sources":["../../../src/components/Breadcrumbs/FormattedBreadcrumbs.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ReactElement, useRef } from 'react';\nimport { BreadcrumbsProps } from './Breadcrumbs';\nimport { CurrentBreadcrumbItem } from './CurrentBreadcrumbItem';\nimport { BreadcrumbItem } from './BreadcrumbItem';\nimport { OverflowMenu, OverflowMenuItemProps } from '..';\n\nexport const FormattedBreadcrumbs = ({\n items,\n keepRoot,\n activeInline = false,\n truncate = false,\n 'data-test-id': dataTestId,\n}: BreadcrumbsProps): ReactElement[] => {\n const renderTruncationRef = useRef<boolean>(true);\n\n const elements = items.map(({ label, badges, bold, decorator, link, onClick }, index) => {\n const key = `breadcrumb-${index}`;\n const isRootKept = keepRoot && index === 0;\n const isCurrent = index === items.length - 1;\n const startLastItemIndex = keepRoot ? 2 : 3;\n const lastItemsIndex = items.length - startLastItemIndex;\n const isLastItems = index >= lastItemsIndex;\n const isTruncatedItem = truncate && !isRootKept && !isLastItems;\n const showSeparator = index < items.length - 1;\n const overFlowItems: OverflowMenuItemProps[] = [];\n let count = -1;\n\n switch (true) {\n case isCurrent:\n return (\n <CurrentBreadcrumbItem\n key={key}\n label={label}\n badges={badges}\n bold={bold}\n decorator={decorator}\n link={link}\n onClick={onClick}\n activeInline={activeInline}\n data-test-id={dataTestId}\n />\n );\n\n case !truncate:\n case isRootKept:\n case isLastItems:\n return (\n <BreadcrumbItem\n key={key}\n label={label}\n decorator={decorator}\n link={link}\n onClick={onClick}\n showSeparator={showSeparator}\n data-test-id={dataTestId}\n />\n );\n\n case isTruncatedItem && renderTruncationRef.current:\n renderTruncationRef.current = false;\n for (const element of items) {\n count++;\n if (count >= lastItemsIndex) {\n break;\n } else if (keepRoot && count === 0) {\n continue;\n } else {\n const { label, link, onClick } = element;\n overFlowItems.push({ label, link, onClick });\n }\n }\n return (\n <BreadcrumbItem\n key={key}\n label={''}\n decorator={decorator}\n showSeparator={showSeparator}\n data-test-id={`${dataTestId}-truncation`}\n >\n <OverflowMenu items={overFlowItems} data-test-id={`${dataTestId}-overflow-menu`} />\n </BreadcrumbItem>\n );\n\n default:\n return <span key={key} />;\n }\n });\n return [...elements];\n};\nFormattedBreadcrumbs.displayname = 'FondueFormattedBreadcrumbs';\n"],"names":["FormattedBreadcrumbs","items","keepRoot","activeInline","truncate","dataTestId","renderTruncationRef","useRef","label","badges","bold","decorator","link","onClick","index","key","isRootKept","isCurrent","startLastItemIndex","lastItemsIndex","isLastItems","isTruncatedItem","showSeparator","overFlowItems","count","jsx","CurrentBreadcrumbItem","BreadcrumbItem","element","OverflowMenu"],"mappings":";;;;;AAQO,MAAMA,IAAuB,CAAC;AAAA,EACjC,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC,IAAW;AAAA,EACX,gBAAgBC;AACpB,MAAwC;AAC9B,QAAAC,IAAsBC,EAAgB,EAAI;AA0EzC,SAAA,CAAC,GAxESN,EAAM,IAAI,CAAC,EAAE,OAAAO,GAAO,QAAAC,GAAQ,MAAAC,GAAM,WAAAC,GAAW,MAAAC,GAAM,SAAAC,EAAQ,GAAGC,MAAU;AAC/E,UAAAC,IAAM,cAAcD,CAAK,IACzBE,IAAad,KAAYY,MAAU,GACnCG,IAAYH,MAAUb,EAAM,SAAS,GACrCiB,IAAqBhB,IAAW,IAAI,GACpCiB,IAAiBlB,EAAM,SAASiB,GAChCE,IAAcN,KAASK,GACvBE,IAAkBjB,KAAY,CAACY,KAAc,CAACI,GAC9CE,IAAgBR,IAAQb,EAAM,SAAS,GACvCsB,IAAyC,CAAA;AAC/C,QAAIC,IAAQ;AAEZ,YAAQ,IAAM;AAAA,MACV,KAAKP;AAEG,eAAA,gBAAAQ;AAAA,UAACC;AAAA,UAAA;AAAA,YAEG,OAAAlB;AAAA,YACA,QAAAC;AAAA,YACA,MAAAC;AAAA,YACA,WAAAC;AAAA,YACA,MAAAC;AAAA,YACA,SAAAC;AAAA,YACA,cAAAV;AAAA,YACA,gBAAcE;AAAA,UAAA;AAAA,UARTU;AAAA,QAAA;AAAA,MAYjB,KAAK,CAACX;AAAA,MACN,KAAKY;AAAA,MACL,KAAKI;AAEG,eAAA,gBAAAK;AAAA,UAACE;AAAA,UAAA;AAAA,YAEG,OAAAnB;AAAA,YACA,WAAAG;AAAA,YACA,MAAAC;AAAA,YACA,SAAAC;AAAA,YACA,eAAAS;AAAA,YACA,gBAAcjB;AAAA,UAAA;AAAA,UANTU;AAAA,QAAA;AAAA,MAUjB,MAAKM,KAAmBf,EAAoB;AACxC,QAAAA,EAAoB,UAAU;AAC9B,mBAAWsB,KAAW3B,GAAO;AAEzB,cADAuB,KACIA,KAASL;AACT;AACJ,cAAWjB,KAAYsB,MAAU;AAC7B;AACG;AACH,kBAAM,EAAE,OAAAhB,GAAO,MAAAI,GAAM,SAAAC,EAAY,IAAAe;AACnB,YAAAL,EAAA,KAAK,EAAE,OAAAf,GAAO,MAAAI,GAAM,SAAAC,GAAS;AAAA,UAC/C;AAAA,QACJ;AAEI,eAAA,gBAAAY;AAAA,UAACE;AAAA,UAAA;AAAA,YAEG,OAAO;AAAA,YACP,WAAAhB;AAAA,YACA,eAAAW;AAAA,YACA,gBAAc,GAAGjB,CAAU;AAAA,YAE3B,4BAACwB,GAAa,EAAA,OAAON,GAAe,gBAAc,GAAGlB,CAAU,kBAAkB;AAAA,UAAA;AAAA,UAN5EU;AAAA,QAAA;AAAA,MAUjB;AACW,eAAA,gBAAAU,EAAC,YAAUV,CAAK;AAAA,IAC/B;AAAA,EAAA,CACH,CACkB;AACvB;AACAf,EAAqB,cAAc;"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { INSET_BORDER as
|
|
1
|
+
import { jsx as o, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { INSET_BORDER as p, MIGHTY_INSET_BORDER as T } from "../../utilities/borderStyle.es.js";
|
|
3
3
|
import { merge as e } from "../../utilities/merge.es.js";
|
|
4
|
-
import { AnimatePresence as
|
|
4
|
+
import { AnimatePresence as S, motion as y } from "framer-motion";
|
|
5
5
|
import { toastStylesBackgroundColorsMap as A, ToastAnimationDirection as r } from "./types.es.js";
|
|
6
|
-
const g = "tw-min-h-[2rem] tw-rounded-lg tw-shadow-mid tw-z-[120000] before:!tw-rounded-lg",
|
|
6
|
+
const g = "tw-min-h-[2rem] tw-rounded-lg tw-shadow-mid tw-z-[120000] before:!tw-rounded-lg", f = e([p, "tw-bg-base"]), h = e([T, "tw-bg-box-neutral-mighty"]), a = (t) => t === r.BottomToTop ? "150%" : "-150%", N = (t) => e([g, t === "dark" ? h : f]), u = ({
|
|
7
7
|
isOpen: t,
|
|
8
8
|
style: s,
|
|
9
9
|
icon: n,
|
|
10
10
|
animationDirection: i = r.BottomToTop,
|
|
11
11
|
children: m,
|
|
12
12
|
theme: l = "light",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
enableExitAnimation: d = !1,
|
|
14
|
+
"data-test-id": c = "toast"
|
|
15
|
+
}) => /* @__PURE__ */ o(S, { children: t && /* @__PURE__ */ o(
|
|
16
|
+
y.div,
|
|
16
17
|
{
|
|
17
18
|
className: N(l),
|
|
18
19
|
initial: {
|
|
@@ -20,14 +21,21 @@ const g = "tw-min-h-[2rem] tw-rounded-lg tw-shadow-mid tw-z-[120000] before:!tw-
|
|
|
20
21
|
y: a(i)
|
|
21
22
|
},
|
|
22
23
|
transition: {
|
|
23
|
-
|
|
24
|
+
opacity: {
|
|
25
|
+
ease: [0, 0, 1, 1]
|
|
26
|
+
},
|
|
27
|
+
y: {
|
|
28
|
+
ease: [0, 0.55, 0.45, 1]
|
|
29
|
+
},
|
|
30
|
+
delay: 0.3,
|
|
31
|
+
duration: 0.2
|
|
24
32
|
},
|
|
25
33
|
animate: { opacity: 1, y: 0 },
|
|
26
|
-
exit: { opacity: 0, y: a(i) },
|
|
27
|
-
"data-test-id":
|
|
34
|
+
...d ? { exit: { opacity: 0, y: a(i) } } : {},
|
|
35
|
+
"data-test-id": c,
|
|
28
36
|
"aria-live": "polite",
|
|
29
37
|
role: "alert",
|
|
30
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ w("div", { className: "tw-flex", children: [
|
|
31
39
|
/* @__PURE__ */ o(
|
|
32
40
|
"div",
|
|
33
41
|
{
|
|
@@ -42,8 +50,8 @@ const g = "tw-min-h-[2rem] tw-rounded-lg tw-shadow-mid tw-z-[120000] before:!tw-
|
|
|
42
50
|
] })
|
|
43
51
|
}
|
|
44
52
|
) });
|
|
45
|
-
|
|
53
|
+
u.displayName = "FondueToast";
|
|
46
54
|
export {
|
|
47
|
-
|
|
55
|
+
u as Toast
|
|
48
56
|
};
|
|
49
57
|
//# sourceMappingURL=Toast.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.es.js","sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { INSET_BORDER, MIGHTY_INSET_BORDER } from '@utilities/borderStyle';\nimport { merge } from '@utilities/merge';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport { ReactElement } from 'react';\nimport { ToastAnimationDirection, ToastProps, ToastTheme, toastStylesBackgroundColorsMap } from './types';\n\nconst CONTAINER_BASE_CLASSES = 'tw-min-h-[2rem] tw-rounded-lg tw-shadow-mid tw-z-[120000] before:!tw-rounded-lg';\n\nconst LIGHT_VARIANT_CLASSES = merge([INSET_BORDER, 'tw-bg-base']);\nconst DARK_VARIANT_CLASSES = merge([MIGHTY_INSET_BORDER, 'tw-bg-box-neutral-mighty']);\n\nconst getToastStartPosition = (animationDirection: ToastAnimationDirection) =>\n animationDirection === ToastAnimationDirection.BottomToTop ? '150%' : '-150%';\n\nconst getContainerClasses = (theme: ToastTheme) => {\n return merge([CONTAINER_BASE_CLASSES, theme === 'dark' ? DARK_VARIANT_CLASSES : LIGHT_VARIANT_CLASSES]);\n};\n\nexport const Toast = ({\n isOpen,\n style,\n icon,\n animationDirection = ToastAnimationDirection.BottomToTop,\n children,\n theme = 'light',\n 'data-test-id': dataTestId = 'toast',\n}: ToastProps): ReactElement => (\n <AnimatePresence>\n {isOpen && (\n <motion.div\n className={getContainerClasses(theme)}\n initial={{\n opacity: 0,\n y: getToastStartPosition(animationDirection),\n }}\n transition={{\n ease:
|
|
1
|
+
{"version":3,"file":"Toast.es.js","sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { INSET_BORDER, MIGHTY_INSET_BORDER } from '@utilities/borderStyle';\nimport { merge } from '@utilities/merge';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport { ReactElement } from 'react';\nimport { ToastAnimationDirection, ToastProps, ToastTheme, toastStylesBackgroundColorsMap } from './types';\n\nconst CONTAINER_BASE_CLASSES = 'tw-min-h-[2rem] tw-rounded-lg tw-shadow-mid tw-z-[120000] before:!tw-rounded-lg';\n\nconst LIGHT_VARIANT_CLASSES = merge([INSET_BORDER, 'tw-bg-base']);\nconst DARK_VARIANT_CLASSES = merge([MIGHTY_INSET_BORDER, 'tw-bg-box-neutral-mighty']);\n\nconst getToastStartPosition = (animationDirection: ToastAnimationDirection) =>\n animationDirection === ToastAnimationDirection.BottomToTop ? '150%' : '-150%';\n\nconst getContainerClasses = (theme: ToastTheme) => {\n return merge([CONTAINER_BASE_CLASSES, theme === 'dark' ? DARK_VARIANT_CLASSES : LIGHT_VARIANT_CLASSES]);\n};\n\nexport const Toast = ({\n isOpen,\n style,\n icon,\n animationDirection = ToastAnimationDirection.BottomToTop,\n children,\n theme = 'light',\n enableExitAnimation = false,\n 'data-test-id': dataTestId = 'toast',\n}: ToastProps): ReactElement => (\n <AnimatePresence>\n {isOpen && (\n <motion.div\n className={getContainerClasses(theme)}\n initial={{\n opacity: 0,\n y: getToastStartPosition(animationDirection),\n }}\n transition={{\n opacity: {\n ease: [0, 0, 1, 1],\n },\n y: {\n ease: [0, 0.55, 0.45, 1],\n },\n delay: 0.3,\n duration: 0.2,\n }}\n animate={{ opacity: 1, y: 0 }}\n {...(enableExitAnimation ? { exit: { opacity: 0, y: getToastStartPosition(animationDirection) } } : {})}\n data-test-id={dataTestId}\n aria-live=\"polite\"\n role=\"alert\"\n >\n <div className=\"tw-flex\">\n <div\n className={merge([\n 'tw-flex tw-items-center tw-justify-center tw-min-h-[2rem] tw-min-w-[3rem] tw-rounded-l-lg tw-text-white',\n toastStylesBackgroundColorsMap[style],\n ])}\n >\n {icon}\n </div>\n {children}\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n);\nToast.displayName = 'FondueToast';\n"],"names":["CONTAINER_BASE_CLASSES","LIGHT_VARIANT_CLASSES","merge","INSET_BORDER","DARK_VARIANT_CLASSES","MIGHTY_INSET_BORDER","getToastStartPosition","animationDirection","ToastAnimationDirection","getContainerClasses","theme","Toast","isOpen","style","icon","children","enableExitAnimation","dataTestId","jsx","AnimatePresence","motion","jsxs","toastStylesBackgroundColorsMap"],"mappings":";;;;;AAQA,MAAMA,IAAyB,mFAEzBC,IAAwBC,EAAM,CAACC,GAAc,YAAY,CAAC,GAC1DC,IAAuBF,EAAM,CAACG,GAAqB,0BAA0B,CAAC,GAE9EC,IAAwB,CAACC,MAC3BA,MAAuBC,EAAwB,cAAc,SAAS,SAEpEC,IAAsB,CAACC,MAClBR,EAAM,CAACF,GAAwBU,MAAU,SAASN,IAAuBH,CAAqB,CAAC,GAG7FU,IAAQ,CAAC;AAAA,EAClB,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,oBAAAP,IAAqBC,EAAwB;AAAA,EAC7C,UAAAO;AAAA,EACA,OAAAL,IAAQ;AAAA,EACR,qBAAAM,IAAsB;AAAA,EACtB,gBAAgBC,IAAa;AACjC,MACI,gBAAAC,EAACC,KACI,UACGP,KAAA,gBAAAM;AAAA,EAACE,EAAO;AAAA,EAAP;AAAA,IACG,WAAWX,EAAoBC,CAAK;AAAA,IACpC,SAAS;AAAA,MACL,SAAS;AAAA,MACT,GAAGJ,EAAsBC,CAAkB;AAAA,IAC/C;AAAA,IACA,YAAY;AAAA,MACR,SAAS;AAAA,QACL,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,MACrB;AAAA,MACA,GAAG;AAAA,QACC,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC;AAAA,MAC3B;AAAA,MACA,OAAO;AAAA,MACP,UAAU;AAAA,IACd;AAAA,IACA,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;AAAA,IAC3B,GAAIS,IAAsB,EAAE,MAAM,EAAE,SAAS,GAAG,GAAGV,EAAsBC,CAAkB,EAAE,EAAA,IAAM,CAAC;AAAA,IACrG,gBAAcU;AAAA,IACd,aAAU;AAAA,IACV,MAAK;AAAA,IAEL,UAAA,gBAAAI,EAAC,OAAI,EAAA,WAAU,WACX,UAAA;AAAA,MAAA,gBAAAH;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAWhB,EAAM;AAAA,YACb;AAAA,YACAoB,EAA+BT,CAAK;AAAA,UAAA,CACvC;AAAA,UAEA,UAAAC;AAAA,QAAA;AAAA,MACL;AAAA,MACCC;AAAA,IAAA,GACL;AAAA,EAAA;AACJ,GAER;AAEJJ,EAAM,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.es.js","sources":["../../../src/components/Toast/types.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ReactNode } from 'react';\n\nexport type ToastProps = {\n isOpen: boolean;\n style: ToastStyle;\n icon: ReactNode;\n animationDirection?: ToastAnimationDirection;\n children?: ReactNode;\n theme?: ToastTheme;\n 'data-test-id'?: string;\n};\n\nexport enum ToastAnimationDirection {\n BottomToTop = 'BottomToTop',\n TopToBottom = 'TopToBottom',\n}\n\nexport enum ToastStyle {\n Loud = 'Loud',\n Danger = 'Danger',\n Success = 'Success',\n Warning = 'Warning',\n}\n\nexport const toastStylesBackgroundColorsMap: Record<ToastStyle, string> = {\n [ToastStyle.Loud]: 'tw-bg-box-selected-strong',\n [ToastStyle.Danger]: 'tw-bg-box-negative-strong-pressed',\n [ToastStyle.Success]: 'tw-bg-box-positive-strong-pressed',\n [ToastStyle.Warning]: 'tw-bg-box-warning-strong',\n};\n\nexport type ToastTheme = 'light' | 'dark';\n"],"names":["ToastAnimationDirection","ToastStyle","toastStylesBackgroundColorsMap"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.es.js","sources":["../../../src/components/Toast/types.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ReactNode } from 'react';\n\nexport type ToastProps = {\n isOpen: boolean;\n style: ToastStyle;\n icon: ReactNode;\n animationDirection?: ToastAnimationDirection;\n children?: ReactNode;\n theme?: ToastTheme;\n enableExitAnimation?: boolean;\n 'data-test-id'?: string;\n};\n\nexport enum ToastAnimationDirection {\n BottomToTop = 'BottomToTop',\n TopToBottom = 'TopToBottom',\n}\n\nexport enum ToastStyle {\n Loud = 'Loud',\n Danger = 'Danger',\n Success = 'Success',\n Warning = 'Warning',\n}\n\nexport const toastStylesBackgroundColorsMap: Record<ToastStyle, string> = {\n [ToastStyle.Loud]: 'tw-bg-box-selected-strong',\n [ToastStyle.Danger]: 'tw-bg-box-negative-strong-pressed',\n [ToastStyle.Success]: 'tw-bg-box-positive-strong-pressed',\n [ToastStyle.Warning]: 'tw-bg-box-warning-strong',\n};\n\nexport type ToastTheme = 'light' | 'dark';\n"],"names":["ToastAnimationDirection","ToastStyle","toastStylesBackgroundColorsMap"],"mappings":"AAeY,IAAAA,sBAAAA,OACRA,EAAA,cAAc,eACdA,EAAA,cAAc,eAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACRA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,UAAU,WAJFA,IAAAA,KAAA,CAAA,CAAA;AAOL,MAAMC,IAA6D;AAAA,EACrE,MAAkB;AAAA,EAClB,QAAoB;AAAA,EACpB,SAAqB;AAAA,EACrB,SAAqB;AAC1B;"}
|