@clubmed/trident-ui 1.3.1-beta.2 → 1.4.0-beta.1

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.
@@ -1,55 +1,51 @@
1
- import { jsxs as a, jsx as s } from "react/jsx-runtime";
2
- import { useTransition as c, config as p, animated as l } from "@react-spring/web";
3
- import { c as b } from "../chunks/index.js";
4
- const k = ({
1
+ import { jsxs as p, jsx as m } from "react/jsx-runtime";
2
+ import { useRef as f, useState as k, useEffect as x } from "react";
3
+ import { c as l } from "../chunks/index.js";
4
+ const s = ({
5
5
  children: r,
6
- onClose: o,
7
- isVisible: e,
8
- sweep: t
9
- }) => c(e, {
10
- from: {
11
- WebkitBackdropFilter: "blur(0px)",
12
- backdropFilter: "blur(0px)",
13
- "--tw-bg-opacity": 0,
14
- x: t ? "-100%" : "0%"
15
- },
16
- enter: {
17
- WebkitBackdropFilter: "blur(10px)",
18
- backdropFilter: "blur(10px)",
19
- "--tw-bg-opacity": 0.8,
20
- x: "0%"
21
- },
22
- leave: {
23
- WebkitBackdropFilter: "blur(0px)",
24
- backdropFilter: "blur(0px)",
25
- "--tw-bg-opacity": 0,
26
- x: t ? "100%" : "0%"
27
- },
28
- config: t ? { tension: 200, friction: 40 } : p.gentle
29
- })(
30
- (i, n) => n && /* @__PURE__ */ a(
6
+ onClose: c,
7
+ isVisible: t,
8
+ sweep: n
9
+ }) => {
10
+ const e = f(!!t), u = e.current, a = !t && u, [d, o] = k(!!t);
11
+ return x(() => {
12
+ t && o(!0);
13
+ }, [t]), e.current = !!t, d ? /* @__PURE__ */ p(
31
14
  "div",
32
15
  {
33
16
  role: "presentation",
34
- className: "z-1 pointer-events-none fixed inset-0 flex items-center justify-center",
17
+ className: "z-1 pointer-events-none fixed inset-0 items-center justify-center flex",
35
18
  children: [
36
- /* @__PURE__ */ s(
37
- l.button,
19
+ /* @__PURE__ */ m(
20
+ "button",
38
21
  {
39
22
  type: "button",
40
- className: b("-z-1 absolute inset-0 bg-white", {
41
- "pointer-events-auto": e
42
- }),
43
- style: i,
44
- onClick: o
23
+ "aria-hidden": "true",
24
+ className: l(
25
+ "-z-1 absolute inset-0 bg-white backdrop will-change-[opacity,transform,backdrop-filter]",
26
+ {
27
+ "pointer-events-auto": t || a,
28
+ "pointer-events-none": !t && !a,
29
+ "animate-backdropFadeIn": !n && t,
30
+ "animate-backdropFadeOut": !n && !t && a,
31
+ "backdrop-blur-0 opacity-0": !n && t && !a,
32
+ "animate-backdropSweepIn": n && t,
33
+ "animate-backdropSweepOut": n && !t && a,
34
+ "backdrop-blur-0 opacity-0 translate-x-[-100%]": n && t && !a
35
+ }
36
+ ),
37
+ onClick: c,
38
+ onAnimationEnd: () => {
39
+ t || o(!1);
40
+ }
45
41
  }
46
42
  ),
47
43
  r
48
44
  ]
49
45
  }
50
- )
51
- );
46
+ ) : null;
47
+ };
52
48
  export {
53
- k as Backdrop
49
+ s as Backdrop
54
50
  };
55
51
  //# sourceMappingURL=Backdrop.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Backdrop.js","sources":["../../lib/molecules/Backdrop.tsx"],"sourcesContent":["import { animated, config, useTransition } from '@react-spring/web';\nimport classnames from 'classnames';\nimport type { FunctionComponent, MouseEvent, PropsWithChildren } from 'react';\n\ninterface BackdropProps {\n /**\n * On close\n * @param event\n */\n onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Is visible\n */\n isVisible?: boolean;\n /**\n * Sweep Mode™\n * (makes it appear from the sides instead of from everywhere)\n */\n sweep?: boolean;\n}\n\nexport const Backdrop: FunctionComponent<PropsWithChildren<BackdropProps>> = ({\n children,\n onClose,\n isVisible,\n sweep,\n}) => {\n const transitions = useTransition(isVisible, {\n from: {\n WebkitBackdropFilter: 'blur(0px)',\n backdropFilter: 'blur(0px)',\n '--tw-bg-opacity': 0,\n x: sweep ? '-100%' : '0%',\n },\n enter: {\n WebkitBackdropFilter: 'blur(10px)',\n backdropFilter: 'blur(10px)',\n '--tw-bg-opacity': 0.8,\n x: '0%',\n },\n leave: {\n WebkitBackdropFilter: 'blur(0px)',\n backdropFilter: 'blur(0px)',\n '--tw-bg-opacity': 0,\n x: sweep ? '100%' : '0%',\n },\n config: sweep ? { tension: 200, friction: 40 } : config.gentle,\n });\n\n return transitions(\n (style, item) =>\n item && (\n <div\n role=\"presentation\"\n className=\"z-1 pointer-events-none fixed inset-0 flex items-center justify-center\"\n >\n <animated.button\n type=\"button\"\n className={classnames('-z-1 absolute inset-0 bg-white', {\n 'pointer-events-auto': isVisible,\n })}\n style={style}\n onClick={onClose}\n />\n {children}\n </div>\n ),\n );\n};\n"],"names":["Backdrop","children","onClose","isVisible","sweep","useTransition","config","style","item","jsxs","jsx","animated","classnames"],"mappings":";;;AAqBO,MAAMA,IAAgE,CAAC;AAAA,EAC5E,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AACF,MACsBC,EAAcF,GAAW;AAAA,EAC3C,MAAM;AAAA,IACJ,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAGC,IAAQ,UAAU;AAAA,EAAA;AAAA,EAEvB,OAAO;AAAA,IACL,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAG;AAAA,EAAA;AAAA,EAEL,OAAO;AAAA,IACL,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,GAAGA,IAAQ,SAAS;AAAA,EAAA;AAAA,EAEtB,QAAQA,IAAQ,EAAE,SAAS,KAAK,UAAU,GAAA,IAAOE,EAAO;AAAA,CACzD;AAAA,EAGC,CAACC,GAAOC,MACNA,KACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAACC,EAAS;AAAA,UAAT;AAAA,YACC,MAAK;AAAA,YACL,WAAWC,EAAW,kCAAkC;AAAA,cACtD,uBAAuBT;AAAA,YAAA,CACxB;AAAA,YACD,OAAAI;AAAA,YACA,SAASL;AAAA,UAAA;AAAA,QAAA;AAAA,QAEVD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AACH;"}
1
+ {"version":3,"file":"Backdrop.js","sources":["../../lib/molecules/Backdrop.tsx"],"sourcesContent":["import {\n type FunctionComponent,\n type MouseEvent,\n type PropsWithChildren,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport classnames from 'classnames';\n\ninterface BackdropProps {\n /**\n * On close\n * @param event\n */\n onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Is visible\n */\n isVisible?: boolean;\n /**\n * Sweep Mode™\n * (makes it appear from the sides instead of from everywhere)\n */\n sweep?: boolean;\n}\n\nexport const Backdrop: FunctionComponent<PropsWithChildren<BackdropProps>> = ({\n children,\n onClose,\n isVisible,\n sweep,\n}) => {\n // Prevent initial mount animation flash when closed\n const wasVisibleRef = useRef(!!isVisible);\n const wasVisible = wasVisibleRef.current;\n const isLeaving = !isVisible && wasVisible;\n\n // Mount only when visible or when we need to play leave animation\n const [mounted, setMounted] = useState<boolean>(!!isVisible);\n\n // When becoming visible, ensure we are mounted\n useEffect(() => {\n if (isVisible) setMounted(true);\n }, [isVisible]);\n\n // update ref for next render\n wasVisibleRef.current = !!isVisible;\n\n if (!mounted) {\n return null;\n }\n\n return (\n <div\n role=\"presentation\"\n className=\"z-1 pointer-events-none fixed inset-0 items-center justify-center flex\"\n >\n <button\n type=\"button\"\n aria-hidden=\"true\"\n className={classnames(\n '-z-1 absolute inset-0 bg-white backdrop will-change-[opacity,transform,backdrop-filter]',\n {\n 'pointer-events-auto': isVisible || isLeaving,\n 'pointer-events-none': !isVisible && !isLeaving,\n 'animate-backdropFadeIn': !sweep && isVisible,\n 'animate-backdropFadeOut': !sweep && !isVisible && isLeaving,\n 'backdrop-blur-0 opacity-0': !sweep && isVisible && !isLeaving,\n 'animate-backdropSweepIn': sweep && isVisible,\n 'animate-backdropSweepOut': sweep && !isVisible && isLeaving,\n 'backdrop-blur-0 opacity-0 translate-x-[-100%]': sweep && isVisible && !isLeaving,\n },\n )}\n onClick={onClose}\n onAnimationEnd={() => {\n // When leave animation finishes and still not visible, unmount\n if (!isVisible) {\n setMounted(false);\n }\n }}\n />\n {children}\n </div>\n );\n};\n"],"names":["Backdrop","children","onClose","isVisible","sweep","wasVisibleRef","useRef","wasVisible","isLeaving","mounted","setMounted","useState","useEffect","jsxs","jsx","classnames"],"mappings":";;;AA2BO,MAAMA,IAAgE,CAAC;AAAA,EAC5E,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AACF,MAAM;AAEJ,QAAMC,IAAgBC,EAAO,CAAC,CAACH,CAAS,GAClCI,IAAaF,EAAc,SAC3BG,IAAY,CAACL,KAAaI,GAG1B,CAACE,GAASC,CAAU,IAAIC,EAAkB,CAAC,CAACR,CAAS;AAU3D,SAPAS,EAAU,MAAM;AACd,IAAIT,OAAsB,EAAI;AAAA,EAChC,GAAG,CAACA,CAAS,CAAC,GAGdE,EAAc,UAAU,CAAC,CAACF,GAErBM,IAKH,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,eAAY;AAAA,YACZ,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,gBACE,uBAAuBZ,KAAaK;AAAA,gBACpC,uBAAuB,CAACL,KAAa,CAACK;AAAA,gBACtC,0BAA0B,CAACJ,KAASD;AAAA,gBACpC,2BAA2B,CAACC,KAAS,CAACD,KAAaK;AAAA,gBACnD,6BAA6B,CAACJ,KAASD,KAAa,CAACK;AAAA,gBACrD,2BAA2BJ,KAASD;AAAA,gBACpC,4BAA4BC,KAAS,CAACD,KAAaK;AAAA,gBACnD,iDAAiDJ,KAASD,KAAa,CAACK;AAAA,cAAA;AAAA,YAC1E;AAAA,YAEF,SAASN;AAAA,YACT,gBAAgB,MAAM;AAEpB,cAAKC,KACHO,EAAW,EAAK;AAAA,YAEpB;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDT;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAhCI;AAmCX;"}
@@ -1,22 +1,22 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import { Card as n } from "./v2/Card.js";
3
3
  import { Icon as d } from "@clubmed/trident-icons";
4
4
  import { Chip as l } from "../Chip.js";
5
- const x = ({
6
- title: e,
5
+ const h = ({
6
+ title: a,
7
7
  children: s,
8
8
  icon: i,
9
9
  iconType: t,
10
10
  theme: o = "light",
11
11
  dataName: m = "Card"
12
- }) => /* @__PURE__ */ a(n, { "data-name": m, className: "p-20 flex shrink-0 flex-row gap-20", children: [
13
- /* @__PURE__ */ r(l, { theme: o, size: "size-48", children: /* @__PURE__ */ r(d, { name: i, type: t, width: "24px" }) }),
14
- /* @__PURE__ */ a("div", { className: "space-y-8 font-sans", children: [
15
- /* @__PURE__ */ r("div", { className: "text-b3 font-semibold", children: e }),
16
- /* @__PURE__ */ r("div", { className: "text-b4 font-normal", children: s })
12
+ }) => /* @__PURE__ */ r(n, { "data-name": m, className: "p-20 flex shrink-0 flex-row gap-20", children: [
13
+ /* @__PURE__ */ e(l, { theme: o, size: "size-48", children: /* @__PURE__ */ e(d, { name: i, type: t, width: "24px" }) }),
14
+ /* @__PURE__ */ r("div", { className: "space-y-8 font-sans flex-1", children: [
15
+ /* @__PURE__ */ e("div", { className: "text-b3 font-semibold", children: a }),
16
+ /* @__PURE__ */ e("div", { className: "text-b4 font-normal", children: s })
17
17
  ] })
18
18
  ] });
19
19
  export {
20
- x as Card
20
+ h as Card
21
21
  };
22
22
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../lib/molecules/Cards/Card.tsx"],"sourcesContent":["import type { FunctionComponent, PropsWithChildren } from 'react';\nimport { Card as CardV2, type CardProps as CardPropsV2 } from '@/molecules/Cards/v2/Card';\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\nimport { Chip, type ChipProps } from '@/molecules/Chip';\n\ninterface CardProps extends Omit<CardPropsV2, 'theme'> {\n title: string;\n icon: IconicNames;\n iconType?: IconicTypes;\n theme?: ChipProps['theme'];\n dataName?: string;\n}\n\nexport const Card: FunctionComponent<PropsWithChildren<CardProps>> = ({\n title,\n children,\n icon,\n iconType,\n theme = 'light',\n dataName = 'Card',\n}) => {\n return (\n <CardV2 data-name={dataName} className=\"p-20 flex shrink-0 flex-row gap-20\">\n <Chip theme={theme} size={'size-48'}>\n <Icon name={icon} type={iconType} width=\"24px\" />\n </Chip>\n <div className=\"space-y-8 font-sans\">\n <div className=\"text-b3 font-semibold\">{title}</div>\n <div className=\"text-b4 font-normal\">{children}</div>\n </div>\n </CardV2>\n );\n};\n"],"names":["Card","title","children","icon","iconType","theme","dataName","jsxs","CardV2","jsx","Chip","Icon"],"mappings":";;;;AAaO,MAAMA,IAAwD,CAAC;AAAA,EACpE,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AACb,MAEI,gBAAAC,EAACC,GAAA,EAAO,aAAWF,GAAU,WAAU,uCACrC,UAAA;AAAA,EAAA,gBAAAG,EAACC,GAAA,EAAK,OAAAL,GAAc,MAAM,WACxB,UAAA,gBAAAI,EAACE,GAAA,EAAK,MAAMR,GAAM,MAAMC,GAAU,OAAM,OAAA,CAAO,GACjD;AAAA,EACA,gBAAAG,EAAC,OAAA,EAAI,WAAU,uBACb,UAAA;AAAA,IAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,yBAAyB,UAAAR,GAAM;AAAA,IAC9C,gBAAAQ,EAAC,OAAA,EAAI,WAAU,uBAAuB,UAAAP,EAAA,CAAS;AAAA,EAAA,EAAA,CACjD;AAAA,GACF;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../lib/molecules/Cards/Card.tsx"],"sourcesContent":["import type { FunctionComponent, PropsWithChildren } from 'react';\nimport { Card as CardV2, type CardProps as CardPropsV2 } from '@/molecules/Cards/v2/Card';\nimport { Icon, type IconicNames, type IconicTypes } from '@clubmed/trident-icons';\nimport { Chip, type ChipProps } from '@/molecules/Chip';\n\ninterface CardProps extends Omit<CardPropsV2, 'theme'> {\n title: string;\n icon: IconicNames;\n iconType?: IconicTypes;\n theme?: ChipProps['theme'];\n dataName?: string;\n}\n\nexport const Card: FunctionComponent<PropsWithChildren<CardProps>> = ({\n title,\n children,\n icon,\n iconType,\n theme = 'light',\n dataName = 'Card',\n}) => {\n return (\n <CardV2 data-name={dataName} className=\"p-20 flex shrink-0 flex-row gap-20\">\n <Chip theme={theme} size={'size-48'}>\n <Icon name={icon} type={iconType} width=\"24px\" />\n </Chip>\n <div className=\"space-y-8 font-sans flex-1\">\n <div className=\"text-b3 font-semibold\">{title}</div>\n <div className=\"text-b4 font-normal\">{children}</div>\n </div>\n </CardV2>\n );\n};\n"],"names":["Card","title","children","icon","iconType","theme","dataName","jsxs","CardV2","jsx","Chip","Icon"],"mappings":";;;;AAaO,MAAMA,IAAwD,CAAC;AAAA,EACpE,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AACb,MAEI,gBAAAC,EAACC,GAAA,EAAO,aAAWF,GAAU,WAAU,sCACrC,UAAA;AAAA,EAAA,gBAAAG,EAACC,GAAA,EAAK,OAAAL,GAAc,MAAM,WACxB,UAAA,gBAAAI,EAACE,GAAA,EAAK,MAAMR,GAAM,MAAMC,GAAU,OAAM,OAAA,CAAO,GACjD;AAAA,EACA,gBAAAG,EAAC,OAAA,EAAI,WAAU,8BACb,UAAA;AAAA,IAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,yBAAyB,UAAAR,GAAM;AAAA,IAC9C,gBAAAQ,EAAC,OAAA,EAAI,WAAU,uBAAuB,UAAAP,EAAA,CAAS;AAAA,EAAA,EAAA,CACjD;AAAA,GACF;"}
@@ -306,14 +306,14 @@ export declare function useNumberField(props: NumberFieldProps): {
306
306
  capture?: boolean | "user" | "environment" | undefined | undefined;
307
307
  checked?: boolean | undefined | undefined;
308
308
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
309
+ htmlFor?: string | undefined | undefined;
309
310
  maxLength?: number | undefined | undefined;
310
311
  minLength?: number | undefined | undefined;
311
- placeholder?: string | undefined | undefined;
312
- readOnly?: boolean | undefined | undefined;
313
- required?: boolean | undefined | undefined;
314
- htmlFor?: string | undefined | undefined;
315
312
  description?: string | undefined;
313
+ required?: boolean | undefined | undefined;
316
314
  hideRequiredStar?: boolean | undefined;
315
+ placeholder?: string | undefined | undefined;
316
+ readOnly?: boolean | undefined | undefined;
317
317
  };
318
318
  export declare const NumberField: (props: NumberFieldProps) => import("react/jsx-runtime").JSX.Element;
319
319
  export {};
@@ -1,13 +1,6 @@
1
- import { FunctionComponent } from 'react';
2
- interface HamburgerIconProps {
3
- /**
4
- * Width of the HamburgerIcon
5
- */
6
- width?: string;
7
- /**
8
- * Whether the HamburgerIcon is active or not
9
- */
1
+ import { ComponentPropsWithoutRef, FunctionComponent } from 'react';
2
+ interface Props extends ComponentPropsWithoutRef<'span'> {
10
3
  isActive?: boolean;
11
4
  }
12
- export declare const HamburgerIcon: FunctionComponent<HamburgerIconProps>;
5
+ export declare const HamburgerIcon: FunctionComponent<Props>;
13
6
  export {};
@@ -1,39 +1,43 @@
1
- import { jsx as o, jsxs as h } from "react/jsx-runtime";
2
- import { useSpring as C, animated as t } from "@react-spring/web";
3
- const s = ({
4
- width: e = "24px",
5
- isActive: a = !1
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { c as e } from "../chunks/index.js";
3
+ const c = ({
4
+ className: a,
5
+ isActive: r = !1,
6
+ ...o
6
7
  }) => {
7
- const { width: n } = C({ width: e }), r = C({
8
- transform: a ? "translate(3.002700, 6.224356)" : "translate(3,6)",
9
- path1: a ? "M4.93259468,0.296729803 L20.476916,15.8410511 C20.8700674,16.2342025 20.8721957,16.8713128 20.4825799,17.2609286 C20.0929641,17.6505444 19.4558538,17.648416 19.0627024,17.2552647 L3.51838112,1.71094337 C3.12522975,1.317792 3.12240132,0.679981679 3.51201716,0.290365842 C3.901633,-0.0992499941 4.53944331,-0.096421567 4.93259468,0.296729803 Z" : "M1.009,0 L22.99199,0 C23.54799,0 24,0.449 24,1 C24,1.551 23.54799,2 22.99199,2 L1.009,2 C0.453,2 0,1.551 0,1 C0,0.449 0.453,0 1.009,0 Z",
10
- path2: a ? "M5.1242772,17.4441138 L20.665063,1.90332799 C21.0582143,1.51017662 21.0617499,0.873073405 20.6714269,0.482750462 C20.281104,0.092427519 19.6440008,0.0959630529 19.2508494,0.489114423 L3.71006364,16.0299002 C3.31691227,16.4230516 3.31408384,17.0594477 3.70440678,17.4497706 C4.09472972,17.8400935 4.73112583,17.8372651 5.1242772,17.4441138 Z" : "M1.0113,18 L22.98929,18 C23.54529,18 23.99829,17.552 23.99829,17 C23.99829,16.448 23.54529,16 22.98929,16 L1.0113,16 C0.4553,16 0.0033,16.448 0.0033,17 C0.0033,17.552 0.4553,18 1.0113,18 Z",
11
- opacity: a ? 0 : 1
12
- });
13
- return /* @__PURE__ */ o(
14
- t.svg,
8
+ const n = e(
9
+ 'before:absolute before:left-0 before:top-0 before:block before:h-2 before:w-24 before:bg-current before:opacity-100 before:transition-transform before:duration-500 before:content-[""] before:cursor-pointer',
10
+ { "before:translate-y-[-6px]": !r, "before:translate-y-0 before:rotate-45": r }
11
+ ), f = e(
12
+ 'after:absolute after:left-0 after:top-0 after:block after:h-2 after:w-24 after:bg-current after:opacity-100 after:transition-transform after:duration-500 after:content-[""] after:cursor-pointer',
13
+ { "after:translate-y-[6px]": !r, "after:translate-y-0 after:-rotate-45": r }
14
+ );
15
+ return /* @__PURE__ */ t(
16
+ "span",
15
17
  {
16
- className: "shrink-0",
17
- "data-testid": a ? "HamburgerIcon-active" : "HamburgerIcon",
18
18
  "data-name": "HamburgerIcon",
19
- width: n,
20
- height: n,
21
- viewBox: "0 0 30 30",
22
- children: /* @__PURE__ */ h(t.g, { transform: r.transform, fill: "currentColor", children: [
23
- /* @__PURE__ */ o(t.path, { d: r.path1 }),
24
- /* @__PURE__ */ o(
25
- t.path,
26
- {
27
- opacity: r.opacity,
28
- d: "M22.98969,8 L1.0117,8 C0.4557,8 0.0027,8.448 0.0027,9 C0.0027,9.552 0.4557,10 1.0117,10 L22.98969,10 C23.54569,10 23.99769,9.552 23.99769,9 C23.99769,8.448 23.54569,8 22.98969,8 Z"
29
- }
30
- ),
31
- /* @__PURE__ */ o(t.path, { d: r.path2 })
32
- ] })
19
+ ...o,
20
+ className: e(
21
+ "menu-icon cursor-pointer",
22
+ "color-current relative isolate shrink-0 h-24 w-24 block",
23
+ a
24
+ ),
25
+ "data-testid": r ? "HamburgerIcon-active" : "HamburgerIcon",
26
+ children: /* @__PURE__ */ t(
27
+ "span",
28
+ {
29
+ className: e(
30
+ "absolute left-1/2 top-1/2 block h-2 w-24 -translate-x-1/2 -translate-y-1/2 transition-[background] duration-500 cursor-pointer",
31
+ { "bg-current": !r, "bg-transparent": r },
32
+ n,
33
+ f
34
+ )
35
+ }
36
+ )
33
37
  }
34
38
  );
35
39
  };
36
40
  export {
37
- s as HamburgerIcon
41
+ c as HamburgerIcon
38
42
  };
39
43
  //# sourceMappingURL=HamburgerIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HamburgerIcon.js","sources":["../../lib/molecules/HamburgerIcon.tsx"],"sourcesContent":["import { animated, useSpring } from '@react-spring/web';\nimport type { FunctionComponent } from 'react';\n\ninterface HamburgerIconProps {\n /**\n * Width of the HamburgerIcon\n */\n width?: string;\n /**\n * Whether the HamburgerIcon is active or not\n */\n isActive?: boolean;\n}\n\nexport const HamburgerIcon: FunctionComponent<HamburgerIconProps> = ({\n width: widthProp = '24px',\n isActive = false,\n}) => {\n const { width } = useSpring({ width: widthProp });\n const iconStyle = useSpring({\n transform: isActive ? 'translate(3.002700, 6.224356)' : 'translate(3,6)',\n path1: isActive\n ? 'M4.93259468,0.296729803 L20.476916,15.8410511 C20.8700674,16.2342025 20.8721957,16.8713128 20.4825799,17.2609286 C20.0929641,17.6505444 19.4558538,17.648416 19.0627024,17.2552647 L3.51838112,1.71094337 C3.12522975,1.317792 3.12240132,0.679981679 3.51201716,0.290365842 C3.901633,-0.0992499941 4.53944331,-0.096421567 4.93259468,0.296729803 Z'\n : 'M1.009,0 L22.99199,0 C23.54799,0 24,0.449 24,1 C24,1.551 23.54799,2 22.99199,2 L1.009,2 C0.453,2 0,1.551 0,1 C0,0.449 0.453,0 1.009,0 Z',\n path2: isActive\n ? 'M5.1242772,17.4441138 L20.665063,1.90332799 C21.0582143,1.51017662 21.0617499,0.873073405 20.6714269,0.482750462 C20.281104,0.092427519 19.6440008,0.0959630529 19.2508494,0.489114423 L3.71006364,16.0299002 C3.31691227,16.4230516 3.31408384,17.0594477 3.70440678,17.4497706 C4.09472972,17.8400935 4.73112583,17.8372651 5.1242772,17.4441138 Z'\n : 'M1.0113,18 L22.98929,18 C23.54529,18 23.99829,17.552 23.99829,17 C23.99829,16.448 23.54529,16 22.98929,16 L1.0113,16 C0.4553,16 0.0033,16.448 0.0033,17 C0.0033,17.552 0.4553,18 1.0113,18 Z',\n opacity: isActive ? 0 : 1,\n });\n\n return (\n <animated.svg\n className=\"shrink-0\"\n data-testid={isActive ? 'HamburgerIcon-active' : 'HamburgerIcon'}\n data-name=\"HamburgerIcon\"\n width={width}\n height={width}\n viewBox=\"0 0 30 30\"\n >\n <animated.g transform={iconStyle.transform} fill=\"currentColor\">\n <animated.path d={iconStyle.path1} />\n <animated.path\n opacity={iconStyle.opacity}\n d=\"M22.98969,8 L1.0117,8 C0.4557,8 0.0027,8.448 0.0027,9 C0.0027,9.552 0.4557,10 1.0117,10 L22.98969,10 C23.54569,10 23.99769,9.552 23.99769,9 C23.99769,8.448 23.54569,8 22.98969,8 Z\"\n />\n <animated.path d={iconStyle.path2} />\n </animated.g>\n </animated.svg>\n );\n};\n"],"names":["HamburgerIcon","widthProp","isActive","width","useSpring","iconStyle","jsx","animated","jsxs"],"mappings":";;AAcO,MAAMA,IAAuD,CAAC;AAAA,EACnE,OAAOC,IAAY;AAAA,EACnB,UAAAC,IAAW;AACb,MAAM;AACJ,QAAM,EAAE,OAAAC,EAAA,IAAUC,EAAU,EAAE,OAAOH,GAAW,GAC1CI,IAAYD,EAAU;AAAA,IAC1B,WAAWF,IAAW,kCAAkC;AAAA,IACxD,OAAOA,IACH,0VACA;AAAA,IACJ,OAAOA,IACH,yVACA;AAAA,IACJ,SAASA,IAAW,IAAI;AAAA,EAAA,CACzB;AAED,SACE,gBAAAI;AAAA,IAACC,EAAS;AAAA,IAAT;AAAA,MACC,WAAU;AAAA,MACV,eAAaL,IAAW,yBAAyB;AAAA,MACjD,aAAU;AAAA,MACV,OAAAC;AAAA,MACA,QAAQA;AAAA,MACR,SAAQ;AAAA,MAER,UAAA,gBAAAK,EAACD,EAAS,GAAT,EAAW,WAAWF,EAAU,WAAW,MAAK,gBAC/C,UAAA;AAAA,QAAA,gBAAAC,EAACC,EAAS,MAAT,EAAc,GAAGF,EAAU,OAAO;AAAA,QACnC,gBAAAC;AAAA,UAACC,EAAS;AAAA,UAAT;AAAA,YACC,SAASF,EAAU;AAAA,YACnB,GAAE;AAAA,UAAA;AAAA,QAAA;AAAA,0BAEHE,EAAS,MAAT,EAAc,GAAGF,EAAU,MAAA,CAAO;AAAA,MAAA,EAAA,CACrC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"HamburgerIcon.js","sources":["../../lib/molecules/HamburgerIcon.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { ComponentPropsWithoutRef, FunctionComponent } from 'react';\n\ninterface Props extends ComponentPropsWithoutRef<'span'> {\n isActive?: boolean;\n}\n\nexport const HamburgerIcon: FunctionComponent<Props> = ({\n className,\n isActive = false,\n ...attrs\n}) => {\n const before = classnames(\n 'before:absolute before:left-0 before:top-0 before:block before:h-2 before:w-24 before:bg-current before:opacity-100 before:transition-transform before:duration-500 before:content-[\"\"] before:cursor-pointer',\n { 'before:translate-y-[-6px]': !isActive, 'before:translate-y-0 before:rotate-45': isActive },\n );\n\n const after = classnames(\n 'after:absolute after:left-0 after:top-0 after:block after:h-2 after:w-24 after:bg-current after:opacity-100 after:transition-transform after:duration-500 after:content-[\"\"] after:cursor-pointer',\n { 'after:translate-y-[6px]': !isActive, 'after:translate-y-0 after:-rotate-45': isActive },\n );\n\n return (\n <span\n data-name=\"HamburgerIcon\"\n {...attrs}\n className={classnames(\n 'menu-icon cursor-pointer',\n 'color-current relative isolate shrink-0 h-24 w-24 block',\n className,\n )}\n data-testid={isActive ? 'HamburgerIcon-active' : 'HamburgerIcon'}\n >\n <span\n className={classnames(\n 'absolute left-1/2 top-1/2 block h-2 w-24 -translate-x-1/2 -translate-y-1/2 transition-[background] duration-500 cursor-pointer',\n { 'bg-current': !isActive, 'bg-transparent': isActive },\n before,\n after,\n )}\n />\n </span>\n );\n};\n"],"names":["HamburgerIcon","className","isActive","attrs","before","classnames","after","jsx"],"mappings":";;AAOO,MAAMA,IAA0C,CAAC;AAAA,EACtD,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,GAAGC;AACL,MAAM;AACJ,QAAMC,IAASC;AAAA,IACb;AAAA,IACA,EAAE,6BAA6B,CAACH,GAAU,yCAAyCA,EAAA;AAAA,EAAS,GAGxFI,IAAQD;AAAA,IACZ;AAAA,IACA,EAAE,2BAA2B,CAACH,GAAU,wCAAwCA,EAAA;AAAA,EAAS;AAG3F,SACE,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACT,GAAGJ;AAAA,MACJ,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACAJ;AAAA,MAAA;AAAA,MAEF,eAAaC,IAAW,yBAAyB;AAAA,MAEjD,UAAA,gBAAAK;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF;AAAA,YACT;AAAA,YACA,EAAE,cAAc,CAACH,GAAU,kBAAkBA,EAAA;AAAA,YAC7CE;AAAA,YACAE;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { jsx as l, jsxs as a } from "react/jsx-runtime";
3
- import { useTransition as n, animated as r } from "@react-spring/web";
4
- import { Backdrop as o } from "./Backdrop.js";
5
- const h = /* @__PURE__ */ a("svg", { viewBox: "0 0 140 140", width: 140, children: [
2
+ import { jsx as l, jsxs as c } from "react/jsx-runtime";
3
+ import { Backdrop as t } from "./Backdrop.js";
4
+ import { c as m } from "../chunks/index.js";
5
+ const r = /* @__PURE__ */ c("svg", { viewBox: "0 0 140 140", width: 140, children: [
6
6
  /* @__PURE__ */ l("defs", { children: /* @__PURE__ */ l(
7
7
  "path",
8
8
  {
@@ -10,15 +10,15 @@ const h = /* @__PURE__ */ a("svg", { viewBox: "0 0 140 140", width: 140, childre
10
10
  d: "m70 74.1-9.6 9.6 9.6 9.5 9.5-9.5L70 74Zm6.6-70.7c-.7-2.7-6.9 1.1-20.1 13 5.3 5.8 7.9 2.5 12.1 1 3.4 6.4 4.8 35.4-17.3 44 .6-29.1.9-60.4.9-60.4a1 1 0 0 0-1.3-1c-6.1.8-17 11.6-25.3 20.6 4.6 7.5 10.4.8 15-1.1 0 1.2-1 22.8-.6 44.7C17.3 66 21 19.5 22.2 13.6 22.8 8.9 7.6 19.3 0 26.4c2.4 4.3 5.7 3.4 10 1.8C8.3 49 23 67.9 40 67.5c.6 21.4 2.9 42.2 9 43.7 1 .2 1.6-21.8 2-46.1C92 52.4 76.5 3.4 76.5 3.4"
11
11
  }
12
12
  ) }),
13
- /* @__PURE__ */ a("g", { fill: "none", fillRule: "evenodd", transform: "translate(27 14)", children: [
13
+ /* @__PURE__ */ c("g", { fill: "none", fillRule: "evenodd", transform: "translate(27 14)", children: [
14
14
  /* @__PURE__ */ l("mask", { id: "b", fill: "#fff", children: /* @__PURE__ */ l("use", { xlinkHref: "#a" }) }),
15
- /* @__PURE__ */ a("g", { mask: "url(#b)", children: [
15
+ /* @__PURE__ */ c("g", { mask: "url(#b)", children: [
16
16
  /* @__PURE__ */ l(
17
17
  "path",
18
18
  {
19
19
  fill: "#1E2643",
20
20
  fillRule: "nonzero",
21
- d: "M-83.1-23s6.7 3 11.2 3c4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3C.2-20 2.3-23 7-23c4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 11.3-3 11.3-3v138H-83V-23Z",
21
+ d: "M-83.1-23s6.7 3 11.2 3c4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3C.2-20 2.3-23 7-23c4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 11.3-3 11.3-3v138H-83V-23Z",
22
22
  className: "animate-wave"
23
23
  }
24
24
  ),
@@ -33,45 +33,34 @@ const h = /* @__PURE__ */ a("svg", { viewBox: "0 0 140 140", width: 140, childre
33
33
  )
34
34
  ] })
35
35
  ] })
36
- ] }), f = ({ isVisible: e, label: t }) => {
37
- const s = n(e, {
38
- from: { x: "-600px", opacity: 0.3 },
39
- enter: { x: "0px", opacity: 1 },
40
- leave: { x: "600px", opacity: 0 },
41
- config: {
42
- tension: e ? 280 : 380,
43
- // we make it fling off faster when closing
44
- friction: 50
45
- }
46
- });
47
- return /* @__PURE__ */ l(o, { isVisible: e, sweep: !0, children: s(
48
- ({ x: c, opacity: m }, i) => i && /* @__PURE__ */ a("div", { className: "flex flex-col items-center", role: "alert", children: [
49
- /* @__PURE__ */ l(
50
- r.div,
36
+ ] }), o = ({ isVisible: a, label: e }) => /* @__PURE__ */ l(t, { isVisible: a, sweep: !0, children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center", role: "alert", children: [
37
+ /* @__PURE__ */ l(
38
+ "div",
39
+ {
40
+ className: m(
41
+ "relative will-change-[transform,opacity] transition-[transform,opacity] duration-500 ease-out",
51
42
  {
52
- style: {
53
- x: c,
54
- opacity: m,
55
- // the masks prevent subpixel flickering on transitions (and covid), please don't remove them
56
- maskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cellipse cx='1' cy='1' rx='1' ry='1'/%3E%3C/svg%3E")`,
57
- WebkitMaskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cellipse cx='1' cy='1' rx='1' ry='1'/%3E%3C/svg%3E")`
58
- },
59
- className: "relative",
60
- children: h
43
+ "translate-x-0 opacity-100 ": a,
44
+ "opacity-0 translate-x-[600px] ": !a
61
45
  }
62
46
  ),
63
- /* @__PURE__ */ l(
64
- r.div,
65
- {
66
- className: "text-b3 mx-auto max-w-[320px] px-20 text-center",
67
- style: { x: c.to((Z) => `calc(${Z} / 2)`), opacity: m },
68
- children: t
69
- }
70
- )
71
- ] })
72
- ) });
73
- };
47
+ style: {
48
+ // the masks prevent subpixel flickering on transitions (and covid), please don't remove them
49
+ maskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cellipse cx='1' cy='1' rx='1' ry='1'/%3E%3C/svg%3E")`,
50
+ WebkitMaskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cellipse cx='1' cy='1' rx='1' ry='1'/%3E%3C/svg%3E")`
51
+ },
52
+ children: r
53
+ }
54
+ ),
55
+ /* @__PURE__ */ l(
56
+ "div",
57
+ {
58
+ className: "text-b3 mx-auto max-w-[320px] px-20 text-center will-change-[transform,opacity] transition-[transform,opacity] duration-500 ease-out " + (a ? "translate-x-0 opacity-100 " : "opacity-0 translate-x-[300px] "),
59
+ children: e
60
+ }
61
+ )
62
+ ] }) });
74
63
  export {
75
- f as Loader
64
+ o as Loader
76
65
  };
77
66
  //# sourceMappingURL=Loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.js","sources":["../../lib/molecules/Loader.tsx"],"sourcesContent":["'use client';\nimport { animated, useTransition } from '@react-spring/web';\nimport type { FunctionComponent } from 'react';\n\nimport { Backdrop } from './Backdrop';\n\ninterface LoaderProps {\n isVisible?: boolean;\n label?: string;\n}\n\nconst loaderSVG = (\n <svg viewBox=\"0 0 140 140\" width={140}>\n <defs>\n <path\n id=\"a\"\n d=\"m70 74.1-9.6 9.6 9.6 9.5 9.5-9.5L70 74Zm6.6-70.7c-.7-2.7-6.9 1.1-20.1 13 5.3 5.8 7.9 2.5 12.1 1 3.4 6.4 4.8 35.4-17.3 44 .6-29.1.9-60.4.9-60.4a1 1 0 0 0-1.3-1c-6.1.8-17 11.6-25.3 20.6 4.6 7.5 10.4.8 15-1.1 0 1.2-1 22.8-.6 44.7C17.3 66 21 19.5 22.2 13.6 22.8 8.9 7.6 19.3 0 26.4c2.4 4.3 5.7 3.4 10 1.8C8.3 49 23 67.9 40 67.5c.6 21.4 2.9 42.2 9 43.7 1 .2 1.6-21.8 2-46.1C92 52.4 76.5 3.4 76.5 3.4\"\n />\n </defs>\n <g fill=\"none\" fillRule=\"evenodd\" transform=\"translate(27 14)\">\n <mask id=\"b\" fill=\"#fff\">\n <use xlinkHref=\"#a\" />\n </mask>\n <g mask=\"url(#b)\">\n <path\n fill=\"#1E2643\"\n fillRule=\"nonzero\"\n d=\"M-83.1-23s6.7 3 11.2 3c4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3C.2-20 2.3-23 7-23c4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 11.3-3 11.3-3v138H-83V-23Z\"\n className=\"animate-wave\"\n />\n <path\n fill=\"#1E2643\"\n fillRule=\"nonzero\"\n d=\"m70 74.1.7-.7-.7-.7-.7.7.7.7Zm-9.6 9.6-.7-.7-.7.7.7.7.7-.7Zm9.6 9.5-.7.7.7.7.7-.7-.7-.7Zm9.5-9.5.7.7.7-.7-.7-.7-.7.7Zm-23-67.3-.7-.7-.7.6.7.8.7-.7Zm12.1 1 1-.5-.5-.8-.8.3.3 1Zm-17.3 44h-1V63l1.4-.6-.4-1ZM52.2 1h1-1Zm-1.3-1v1h.2L51 0ZM25.6 20.6l-.7-.7-.5.5.4.7.8-.5Zm15-1.1h1V18l-1.4.5.4 1ZM40 64.2l.1 1h1v-1h-1ZM22.2 13.6l1 .2-1-.2ZM0 26.4l-.7-.8-.6.6.4.7.9-.5Zm10 1.8h1v-1.5l-1.4.6.3.9Zm30 39.3h1v-1h-1v1Zm9 43.7.3-1-.2 1Zm2-46.1-.2-1-.7.2v.8h1Zm18.2 8.3L59.7 83l1.4 1.4 9.6-9.6-1.4-1.4Zm-9.6 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mask=\"url(#a)\"\n />\n </g>\n </g>\n </svg>\n);\n\nexport const Loader: FunctionComponent<LoaderProps> = ({ isVisible, label }) => {\n const transitions = useTransition(isVisible, {\n from: { x: '-600px', opacity: 0.3 },\n enter: { x: '0px', opacity: 1 },\n leave: { x: '600px', opacity: 0 },\n config: {\n tension: isVisible ? 280 : 380, // we make it fling off faster when closing\n friction: 50,\n },\n });\n\n return (\n <Backdrop isVisible={isVisible} sweep>\n {transitions(\n ({ x, opacity }, item) =>\n item && (\n <div className=\"flex flex-col items-center\" role=\"alert\">\n <animated.div\n style={{\n x,\n opacity,\n // the masks prevent subpixel flickering on transitions (and covid), please don't remove them\n maskImage: `url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cellipse cx='1' cy='1' rx='1' ry='1'/%3E%3C/svg%3E\")`,\n WebkitMaskImage: `url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cellipse cx='1' cy='1' rx='1' ry='1'/%3E%3C/svg%3E\")`,\n }}\n className=\"relative\"\n >\n {loaderSVG}\n </animated.div>\n <animated.div\n className=\"text-b3 mx-auto max-w-[320px] px-20 text-center\"\n style={{ x: x.to((value) => `calc(${value} / 2)`), opacity }}\n >\n {label}\n </animated.div>\n </div>\n ),\n )}\n </Backdrop>\n );\n};\n"],"names":["loaderSVG","jsxs","jsx","Loader","isVisible","label","transitions","useTransition","Backdrop","x","opacity","item","animated","value"],"mappings":";;;;AAWA,MAAMA,IACJ,gBAAAC,EAAC,OAAA,EAAI,SAAQ,eAAc,OAAO,KAChC,UAAA;AAAA,EAAA,gBAAAC,EAAC,QAAA,EACC,UAAA,gBAAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,GAAE;AAAA,IAAA;AAAA,EAAA,GAEN;AAAA,oBACC,KAAA,EAAE,MAAK,QAAO,UAAS,WAAU,WAAU,oBAC1C,UAAA;AA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;AAAA,QAAA;AAAA,MAAA;AAAA,MAEH,gBAAAE;AAAA,QAACU,EAAS;AAAA,QAAT;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,GAAGH,EAAE,GAAG,CAACI,MAAU,QAAQA,CAAK,OAAO,GAAG,SAAAH,EAAA;AAAA,UAElD,UAAAL;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,EAAA,CACF;AAAA,EAAA,GAGR;AAEJ;"}
1
+ {"version":3,"file":"Loader.js","sources":["../../lib/molecules/Loader.tsx"],"sourcesContent":["'use client';\nimport type { FunctionComponent } from 'react';\n\nimport { Backdrop } from './Backdrop';\nimport classnames from 'classnames';\n\ninterface LoaderProps {\n isVisible?: boolean;\n label?: string;\n}\n\nconst loaderSVG = (\n <svg viewBox=\"0 0 140 140\" width={140}>\n <defs>\n <path\n id=\"a\"\n d=\"m70 74.1-9.6 9.6 9.6 9.5 9.5-9.5L70 74Zm6.6-70.7c-.7-2.7-6.9 1.1-20.1 13 5.3 5.8 7.9 2.5 12.1 1 3.4 6.4 4.8 35.4-17.3 44 .6-29.1.9-60.4.9-60.4a1 1 0 0 0-1.3-1c-6.1.8-17 11.6-25.3 20.6 4.6 7.5 10.4.8 15-1.1 0 1.2-1 22.8-.6 44.7C17.3 66 21 19.5 22.2 13.6 22.8 8.9 7.6 19.3 0 26.4c2.4 4.3 5.7 3.4 10 1.8C8.3 49 23 67.9 40 67.5c.6 21.4 2.9 42.2 9 43.7 1 .2 1.6-21.8 2-46.1C92 52.4 76.5 3.4 76.5 3.4\"\n />\n </defs>\n <g fill=\"none\" fillRule=\"evenodd\" transform=\"translate(27 14)\">\n <mask id=\"b\" fill=\"#fff\">\n <use xlinkHref=\"#a\" />\n </mask>\n <g mask=\"url(#b)\">\n <path\n fill=\"#1E2643\"\n fillRule=\"nonzero\"\n d=\"M-83.1-23s6.7 3 11.2 3c4.6 0 6.7-3 11.3-3 4.5 0 6.7 3 11.2 3 4.6 0 6.7-3 11.3-3 4.5 0 6.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4 0 0 1 6.4-3h.3l-.2-.1v.2l2 .2ZM-.8 27c.6 1.1 1.3 2 2.2 2.6a5 5 0 0 0 2.8 1c2 .1 4-.6 6-1.4l-.6-1.8c-2.1.8-3.8 1.3-5.2 1.2-.7 0-1.3-.2-1.9-.6-.5-.4-1-1-1.6-2l-1.8 1Zm9.6 1a41.8 41.8 0 0 0 8.4 28.3c5.7 7.5 14 12.3 22.9 12v-2a26 26 0 0 1-21.3-11.2 40 40 0 0 1-8-27H9ZM39 67.4c.3 10.7 1 21.3 2.5 29.5.7 4 1.6 7.5 2.7 10.1 1.1 2.6 2.6 4.6 4.7 5l.4-2c-1-.2-2.2-1.3-3.2-3.8-1-2.3-2-5.7-2.7-9.7-1.4-8-2-18.5-2.4-29.1h-2Zm9.8 44.6c.7.2 1.1-.3 1.2-.4l.2-.4.2-.9.3-2.8.5-10.2.9-32.3h-2a1859.2 1859.2 0 0 1-1.4 42.3 38 38 0 0 1-.4 3.2c0-.1.4-.6 1-.4l-.5 2Zm2.6-46a39.2 39.2 0 0 0 21.8-15.4 46 46 0 0 0 7-21.1 73 73 0 0 0-2.6-25.9l-.1-.4v-.1l-1 .2-1 .3a14.2 14.2 0 0 1 .2.6 51 51 0 0 1 1.6 7.1 71 71 0 0 1 .9 18A37.2 37.2 0 0 1 50.8 64l.6 2Z\"\n mask=\"url(#a)\"\n />\n </g>\n </g>\n </svg>\n);\n\nexport const Loader: FunctionComponent<LoaderProps> = ({ isVisible, label }) => {\n return (\n <Backdrop isVisible={isVisible} sweep>\n <div className=\"flex flex-col items-center\" role=\"alert\">\n <div\n className={classnames(\n `relative will-change-[transform,opacity] transition-[transform,opacity] duration-500 ease-out`,\n {\n 'translate-x-0 opacity-100 ': isVisible,\n 'opacity-0 translate-x-[600px] ': !isVisible,\n },\n )}\n style={{\n // the masks prevent subpixel flickering on transitions (and covid), please don't remove them\n maskImage:\n \"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cellipse cx='1' cy='1' rx='1' ry='1'/%3E%3C/svg%3E\\\")\",\n WebkitMaskImage:\n \"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Cellipse cx='1' cy='1' rx='1' ry='1'/%3E%3C/svg%3E\\\")\",\n }}\n >\n {loaderSVG}\n </div>\n <div\n className={\n 'text-b3 mx-auto max-w-[320px] px-20 text-center will-change-[transform,opacity] transition-[transform,opacity] duration-500 ease-out ' +\n (isVisible ? 'translate-x-0 opacity-100 ' : 'opacity-0 translate-x-[300px] ')\n }\n >\n {label}\n </div>\n </div>\n </Backdrop>\n );\n};\n"],"names":["loaderSVG","jsxs","jsx","Loader","isVisible","label","Backdrop","classnames"],"mappings":";;;;AAWA,MAAMA,IACJ,gBAAAC,EAAC,OAAA,EAAI,SAAQ,eAAc,OAAO,KAChC,UAAA;AAAA,EAAA,gBAAAC,EAAC,QAAA,EACC,UAAA,gBAAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,GAAE;AAAA,IAAA;AAAA,EAAA,GAEN;AAAA,oBACC,KAAA,EAAE,MAAK,QAAO,UAAS,WAAU,WAAU,oBAC1C,UAAA;AAAA,IAAA,gBAAAA,EAAC,QAAA,EAAK,IAAG,KAAI,MAAK,QAChB,UAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,KAAA,CAAK,EAAA,CACtB;AAAA,IACA,gBAAAD,EAAC,KAAA,EAAE,MAAK,WACN,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAS;AAAA,UACT,GAAE;AAAA,UACF,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,MAEZ,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAS;AAAA,UACT,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MAAA;AAAA,IACP,EAAA,CACF;AAAA,EAAA,EAAA,CACF;AAAA,GACF,GAGWC,IAAyC,CAAC,EAAE,WAAAC,GAAW,OAAAC,QAEhE,gBAAAH,EAACI,GAAA,EAAS,WAAAF,GAAsB,OAAK,IACnC,4BAAC,OAAA,EAAI,WAAU,8BAA6B,MAAK,SAC/C,UAAA;AAAA,EAAA,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWK;AAAA,QACT;AAAA,QACA;AAAA,UACE,8BAA8BH;AAAA,UAC9B,kCAAkC,CAACA;AAAA,QAAA;AAAA,MACrC;AAAA,MAEF,OAAO;AAAA;AAAA,QAEL,WACE;AAAA,QACF,iBACE;AAAA,MAAA;AAAA,MAGH,UAAAJ;AAAA,IAAA;AAAA,EAAA;AAAA,EAEH,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WACE,2IACCE,IAAY,+BAA+B;AAAA,MAG7C,UAAAC;AAAA,IAAA;AAAA,EAAA;AACH,EAAA,CACF,EAAA,CACF;"}
@@ -1,6 +1,6 @@
1
1
  import { FunctionComponent, PropsWithChildren, ReactNode } from 'react';
2
2
  export type ClosePopinCallback = () => void;
3
- interface PopinFooterProps {
3
+ export interface PopinFooterProps {
4
4
  closeLabel: string;
5
5
  onClose: ClosePopinCallback;
6
6
  }
@@ -14,4 +14,3 @@ export interface PopinProps {
14
14
  Footer?: FunctionComponent<PopinFooterProps> | false;
15
15
  }
16
16
  export declare const Popin: FunctionComponent<PropsWithChildren<PopinProps>>;
17
- export {};
@@ -1,55 +1,49 @@
1
- import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
- import { useTransition as f, config as p, animated as x } from "@react-spring/web";
3
- import { Backdrop as h } from "./Backdrop.js";
4
- import { Button as v } from "./Buttons/Button.js";
5
- import { c as u } from "../chunks/index.js";
6
- const b = ({ closeLabel: e, onClose: r }) => /* @__PURE__ */ t(
7
- v,
1
+ import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
+ import { useRef as f } from "react";
3
+ import { Backdrop as p } from "./Backdrop.js";
4
+ import { Button as u } from "./Buttons/v2/Button.js";
5
+ import { c as x } from "../chunks/index.js";
6
+ const h = ({ closeLabel: o, onClose: e }) => /* @__PURE__ */ r(
7
+ u,
8
8
  {
9
- theme: "black",
10
- variant: "icon",
11
9
  color: "black",
12
10
  variant: "circle",
13
11
  icon: "CrossDefault",
14
12
  className: "mx-auto",
15
- label: e,
16
- "aria-label": e,
17
- onClick: r
13
+ "aria-label": o,
14
+ onClick: e
18
15
  }
19
- ), j = ({
20
- title: e,
21
- children: r,
22
- closeLabel: c,
23
- onClose: o,
24
- isVisible: a,
25
- className: i = "sm:w-360",
26
- Footer: n = b
16
+ ), k = ({
17
+ title: o,
18
+ children: e,
19
+ closeLabel: s,
20
+ onClose: a,
21
+ isVisible: t,
22
+ className: l = "sm:w-360",
23
+ Footer: c = h
27
24
  }) => {
28
- const s = f(a, {
29
- from: { scale: 0.3, opacity: 0.3 },
30
- enter: { scale: 1, opacity: 1 },
31
- leave: { scale: 0, opacity: 0 },
32
- config: a ? { tension: 120, friction: 20 } : p.gentle
33
- });
34
- return /* @__PURE__ */ t(h, { isVisible: a, onClose: o, children: s(
35
- (l, m) => m && /* @__PURE__ */ t(
36
- x.div,
37
- {
38
- className: u(
39
- "border-lightGrey rounded-16 pointer-events-auto mx-20 w-full border bg-white",
40
- i
41
- ),
42
- style: l,
43
- children: /* @__PURE__ */ d("div", { className: "p-40 text-center max-h-[90vh] flex flex-col", children: [
44
- e && /* @__PURE__ */ t("div", { className: "mt-12 text-h5 text-start font-serif", children: e }),
45
- /* @__PURE__ */ t("div", { className: "mt-12 mb-40 last:mb-0 text-start overflow-auto", children: r }),
46
- n && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(n, { closeLabel: c, onClose: o }) })
47
- ] })
48
- }
49
- )
25
+ const n = f(t), i = n.current, m = !t && i;
26
+ return n.current = t, /* @__PURE__ */ r(p, { isVisible: t, onClose: a, children: /* @__PURE__ */ r(
27
+ "div",
28
+ {
29
+ className: x(
30
+ "border-lightGrey rounded-16 pointer-events-auto mx-20 w-full border bg-white origin-center will-change[transform,opacity]",
31
+ {
32
+ "animate-zoomIn": t,
33
+ "animate-zoomOut": !t && m,
34
+ "opacity-0 scale-90": !t && !m
35
+ },
36
+ l
37
+ ),
38
+ children: /* @__PURE__ */ d("div", { className: "p-40 text-center max-h-[90vh] flex flex-col", children: [
39
+ o && /* @__PURE__ */ r("div", { className: "mt-12 text-h5 text-start font-serif", children: o }),
40
+ /* @__PURE__ */ r("div", { className: "mt-12 mb-40 last:mb-0 text-start overflow-auto", children: e }),
41
+ c && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(c, { closeLabel: s, onClose: a }) })
42
+ ] })
43
+ }
50
44
  ) });
51
45
  };
52
46
  export {
53
- j as Popin
47
+ k as Popin
54
48
  };
55
49
  //# sourceMappingURL=Popin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popin.js","sources":["../../lib/molecules/Popin.tsx"],"sourcesContent":["import { animated, config, useTransition } from '@react-spring/web';\nimport type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';\n\nimport { Backdrop } from './Backdrop';\nimport { Button } from './Buttons/Button';\nimport classnames from 'classnames';\n\nexport type ClosePopinCallback = () => void;\n\ninterface PopinFooterProps {\n closeLabel: string;\n onClose: ClosePopinCallback;\n}\n\nconst PopinFooter = ({ closeLabel, onClose }: PopinFooterProps) => {\n return (\n <Button\n theme=\"black\"\n variant=\"icon\"\n color=\"black\"\n variant=\"circle\"\n icon=\"CrossDefault\"\n className=\"mx-auto\"\n label={closeLabel}\n aria-label={closeLabel}\n onClick={onClose}\n />\n );\n};\n\nexport interface PopinProps {\n title: ReactNode;\n closeLabel: string;\n onClose: ClosePopinCallback;\n isVisible: boolean;\n className?: string;\n showCloseButton?: boolean;\n Footer?: FunctionComponent<PopinFooterProps> | false;\n}\n\nexport const Popin: FunctionComponent<PropsWithChildren<PopinProps>> = ({\n title,\n children,\n closeLabel,\n onClose,\n isVisible,\n className = 'sm:w-360',\n Footer = PopinFooter,\n}) => {\n const transitions = useTransition(isVisible, {\n from: { scale: 0.3, opacity: 0.3 },\n enter: { scale: 1, opacity: 1 },\n leave: { scale: 0, opacity: 0 },\n config: isVisible ? { tension: 120, friction: 20 } : config.gentle,\n });\n\n return (\n <Backdrop isVisible={isVisible} onClose={onClose}>\n {transitions(\n (style, item) =>\n item && (\n <animated.div\n className={classnames(\n 'border-lightGrey rounded-16 pointer-events-auto mx-20 w-full border bg-white',\n className,\n )}\n style={style}\n >\n <div className=\"p-40 text-center max-h-[90vh] flex flex-col\">\n {title && <div className=\"mt-12 text-h5 text-start font-serif\">{title}</div>}\n <div className=\"mt-12 mb-40 last:mb-0 text-start overflow-auto\">{children}</div>\n {Footer && (\n <div>\n <Footer closeLabel={closeLabel} onClose={onClose} />\n </div>\n )}\n </div>\n </animated.div>\n ),\n )}\n </Backdrop>\n );\n};\n"],"names":["PopinFooter","closeLabel","onClose","jsx","Button","Popin","title","children","isVisible","className","Footer","transitions","useTransition","config","Backdrop","style","item","animated","classnames","jsxs"],"mappings":";;;;;AAcA,MAAMA,IAAc,CAAC,EAAE,YAAAC,GAAY,SAAAC,QAE/B,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,SAAQ;AAAA,IACR,OAAM;AAAA,IACN,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,WAAU;AAAA,IACV,OAAOH;AAAA,IACP,cAAYA;AAAA,IACZ,SAASC;AAAA,EAAA;AAAA,GAeFG,IAA0D,CAAC;AAAA,EACtE,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAN;AAAA,EACA,SAAAC;AAAA,EACA,WAAAM;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC,IAASV;AACX,MAAM;AACJ,QAAMW,IAAcC,EAAcJ,GAAW;AAAA,IAC3C,MAAM,EAAE,OAAO,KAAK,SAAS,IAAA;AAAA,IAC7B,OAAO,EAAE,OAAO,GAAG,SAAS,EAAA;AAAA,IAC5B,OAAO,EAAE,OAAO,GAAG,SAAS,EAAA;AAAA,IAC5B,QAAQA,IAAY,EAAE,SAAS,KAAK,UAAU,GAAA,IAAOK,EAAO;AAAA,EAAA,CAC7D;AAED,SACE,gBAAAV,EAACW,GAAA,EAAS,WAAAN,GAAsB,SAAAN,GAC7B,UAAAS;AAAA,IACC,CAACI,GAAOC,MACNA,KACE,gBAAAb;AAAA,MAACc,EAAS;AAAA,MAAT;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACAT;AAAA,QAAA;AAAA,QAEF,OAAAM;AAAA,QAEA,UAAA,gBAAAI,EAAC,OAAA,EAAI,WAAU,+CACZ,UAAA;AAAA,UAAAb,KAAS,gBAAAH,EAAC,OAAA,EAAI,WAAU,uCAAuC,UAAAG,GAAM;AAAA,UACtE,gBAAAH,EAAC,OAAA,EAAI,WAAU,kDAAkD,UAAAI,EAAA,CAAS;AAAA,UACzEG,KACC,gBAAAP,EAAC,OAAA,EACC,4BAACO,GAAA,EAAO,YAAAT,GAAwB,SAAAC,GAAkB,EAAA,CACpD;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAGR;AAEJ;"}
1
+ {"version":3,"file":"Popin.js","sources":["../../lib/molecules/Popin.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';\n\nimport { Backdrop } from './Backdrop';\nimport { Button } from './Buttons/v2/Button';\nimport classnames from 'classnames';\n\nexport type ClosePopinCallback = () => void;\n\nexport interface PopinFooterProps {\n closeLabel: string;\n onClose: ClosePopinCallback;\n}\n\nconst PopinFooter = ({ closeLabel, onClose }: PopinFooterProps) => {\n return (\n <Button\n color=\"black\"\n variant=\"circle\"\n icon=\"CrossDefault\"\n className=\"mx-auto\"\n aria-label={closeLabel}\n onClick={onClose}\n />\n );\n};\n\nexport interface PopinProps {\n title: ReactNode;\n closeLabel: string;\n onClose: ClosePopinCallback;\n isVisible: boolean;\n className?: string;\n showCloseButton?: boolean;\n Footer?: FunctionComponent<PopinFooterProps> | false;\n}\n\nexport const Popin: FunctionComponent<PropsWithChildren<PopinProps>> = ({\n title,\n children,\n closeLabel,\n onClose,\n isVisible,\n className = 'sm:w-360',\n Footer = PopinFooter,\n}) => {\n // Prevent initial mount flash when closed: only animate leave if it was visible before\n const wasVisibleRef = useRef(isVisible);\n const wasVisible = wasVisibleRef.current;\n const isLeaving = !isVisible && wasVisible;\n\n // update ref for next render\n wasVisibleRef.current = isVisible;\n return (\n <Backdrop isVisible={isVisible} onClose={onClose}>\n <div\n className={classnames(\n 'border-lightGrey rounded-16 pointer-events-auto mx-20 w-full border bg-white origin-center will-change[transform,opacity]',\n {\n 'animate-zoomIn': isVisible,\n 'animate-zoomOut': !isVisible && isLeaving,\n 'opacity-0 scale-90': !isVisible && !isLeaving,\n },\n className,\n )}\n >\n <div className=\"p-40 text-center max-h-[90vh] flex flex-col\">\n {title && <div className=\"mt-12 text-h5 text-start font-serif\">{title}</div>}\n <div className=\"mt-12 mb-40 last:mb-0 text-start overflow-auto\">{children}</div>\n {Footer && (\n <div>\n <Footer closeLabel={closeLabel} onClose={onClose} />\n </div>\n )}\n </div>\n </div>\n </Backdrop>\n );\n};\n"],"names":["PopinFooter","closeLabel","onClose","jsx","Button","Popin","title","children","isVisible","className","Footer","wasVisibleRef","useRef","wasVisible","isLeaving","Backdrop","classnames","jsxs"],"mappings":";;;;;AAcA,MAAMA,IAAc,CAAC,EAAE,YAAAC,GAAY,SAAAC,QAE/B,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,WAAU;AAAA,IACV,cAAYH;AAAA,IACZ,SAASC;AAAA,EAAA;AAAA,GAeFG,IAA0D,CAAC;AAAA,EACtE,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAN;AAAA,EACA,SAAAC;AAAA,EACA,WAAAM;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC,IAASV;AACX,MAAM;AAEJ,QAAMW,IAAgBC,EAAOJ,CAAS,GAChCK,IAAaF,EAAc,SAC3BG,IAAY,CAACN,KAAaK;AAGhC,SAAAF,EAAc,UAAUH,GAEtB,gBAAAL,EAACY,GAAA,EAAS,WAAAP,GAAsB,SAAAN,GAC9B,UAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWa;AAAA,QACT;AAAA,QACA;AAAA,UACE,kBAAkBR;AAAA,UAClB,mBAAmB,CAACA,KAAaM;AAAA,UACjC,sBAAsB,CAACN,KAAa,CAACM;AAAA,QAAA;AAAA,QAEvCL;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAQ,EAAC,OAAA,EAAI,WAAU,+CACZ,UAAA;AAAA,QAAAX,KAAS,gBAAAH,EAAC,OAAA,EAAI,WAAU,uCAAuC,UAAAG,GAAM;AAAA,QACtE,gBAAAH,EAAC,OAAA,EAAI,WAAU,kDAAkD,UAAAI,EAAA,CAAS;AAAA,QACzEG,KACC,gBAAAP,EAAC,OAAA,EACC,4BAACO,GAAA,EAAO,YAAAT,GAAwB,SAAAC,GAAkB,EAAA,CACpD;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,7 +1,6 @@
1
- import { FunctionComponent, PropsWithChildren } from 'react';
1
+ import { ComponentPropsWithoutRef, FunctionComponent, PropsWithChildren } from 'react';
2
2
  import { Theme } from './theme';
3
- interface Props {
4
- className?: string;
3
+ interface Props extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
5
4
  /**
6
5
  * Tab Heading text
7
6
  */
@@ -19,7 +18,7 @@ interface Props {
19
18
  label: Props['label'];
20
19
  }) => void;
21
20
  /**
22
- * Tab Heading theme
21
+ * Tab theme
23
22
  */
24
23
  theme?: Theme;
25
24
  /**