@clubmed/trident-ui 2.1.0-beta.4 → 2.1.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/chunks/Layer.js +2022 -0
  2. package/chunks/Layer.js.map +1 -0
  3. package/chunks/useTransitionState.js +69 -0
  4. package/chunks/useTransitionState.js.map +1 -0
  5. package/examples/backdrop-demo.js +1 -1
  6. package/examples/layer-buttons-demo.d.ts +1 -0
  7. package/examples/layer-buttons-demo.js +43 -0
  8. package/examples/layer-buttons-demo.js.map +1 -0
  9. package/examples/layer-demo.d.ts +1 -0
  10. package/examples/layer-demo.js +30 -0
  11. package/examples/layer-demo.js.map +1 -0
  12. package/examples/layer-header-demo.d.ts +1 -0
  13. package/examples/layer-header-demo.js +27 -0
  14. package/examples/layer-header-demo.js.map +1 -0
  15. package/examples/layer-nested-demo.d.ts +1 -0
  16. package/examples/layer-nested-demo.js +51 -0
  17. package/examples/layer-nested-demo.js.map +1 -0
  18. package/examples/layer-pinned-demo.d.ts +1 -0
  19. package/examples/layer-pinned-demo.js +36 -0
  20. package/examples/layer-pinned-demo.js.map +1 -0
  21. package/examples/layer-scale-demo.d.ts +1 -0
  22. package/examples/layer-scale-demo.js +34 -0
  23. package/examples/layer-scale-demo.js.map +1 -0
  24. package/examples/layer-use-layer-demo.d.ts +1 -0
  25. package/examples/layer-use-layer-demo.js +33 -0
  26. package/examples/layer-use-layer-demo.js.map +1 -0
  27. package/package.json +2 -1
  28. package/ui/Backdrop.d.ts +5 -0
  29. package/ui/Backdrop.js +54 -2
  30. package/ui/Backdrop.js.map +1 -0
  31. package/ui/Layer.d.ts +72 -0
  32. package/ui/Layer.js +2 -0
  33. package/ui/LayerHeader.d.ts +33 -0
  34. package/ui/LayerHeader.js +45 -0
  35. package/ui/LayerHeader.js.map +1 -0
  36. package/ui/Loader.js +2 -1
  37. package/ui/Loader.js.map +1 -1
  38. package/ui/Popin.d.ts +6 -0
  39. package/ui/Popin.js +11 -10
  40. package/ui/Popin.js.map +1 -1
  41. package/ui/hooks/useIsomorphicLayoutEffect.d.ts +6 -0
  42. package/ui/hooks/useIsomorphicLayoutEffect.js +7 -0
  43. package/ui/hooks/useIsomorphicLayoutEffect.js.map +1 -0
  44. package/ui/hooks/useLayer.d.ts +13 -0
  45. package/ui/hooks/useLayer.js +31 -0
  46. package/ui/hooks/useLayer.js.map +1 -0
  47. package/ui/hooks/useTransitionState.d.ts +7 -0
  48. package/ui/hooks/useTransitionState.js +15 -0
  49. package/ui/hooks/useTransitionState.js.map +1 -0
  50. package/ui/hooks/useVisualViewportBox.d.ts +7 -0
  51. package/ui/hooks/useVisualViewportBox.js +22 -0
  52. package/ui/hooks/useVisualViewportBox.js.map +1 -0
  53. package/chunks/Backdrop.js +0 -105
  54. package/chunks/Backdrop.js.map +0 -1
@@ -0,0 +1,45 @@
1
+ import { t as e } from "../chunks/clsx.js";
2
+ import { Button as t } from "./buttons/Button.js";
3
+ import { Heading as n } from "./heading/Heading.js";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region lib/ui/LayerHeader.tsx
6
+ var a = ({ children: a, className: o, hAriaLevel: s, hLevel: c = 1, id: l, leftButton: u, rightButton: d, ...f }) => {
7
+ let { label: p, ...m } = u || {}, { label: h, ...g } = d || {};
8
+ return /* @__PURE__ */ i("header", {
9
+ ...f,
10
+ className: e("relative flex min-h-64 items-center justify-between gap-8 overscroll-contain bg-white p-8 lg:px-20", o),
11
+ children: [
12
+ u && /* @__PURE__ */ r(t, {
13
+ "aria-describedby": l,
14
+ ...m,
15
+ "aria-label": p,
16
+ className: "absolute start-0 m-8 lg:mx-20",
17
+ color: "black",
18
+ size: "medium",
19
+ theme: "outline",
20
+ variant: "circle"
21
+ }),
22
+ /* @__PURE__ */ r(n, {
23
+ "aria-level": s,
24
+ className: "text-b3 lg:text-b2 flex-1 px-56 text-center font-semibold",
25
+ id: l,
26
+ level: c,
27
+ children: a
28
+ }),
29
+ d && /* @__PURE__ */ r(t, {
30
+ "aria-describedby": l,
31
+ ...g,
32
+ "aria-label": h,
33
+ className: "absolute end-0 m-8 lg:mx-20",
34
+ color: "black",
35
+ size: "medium",
36
+ theme: "outline",
37
+ variant: "circle"
38
+ })
39
+ ]
40
+ });
41
+ };
42
+ //#endregion
43
+ export { a as LayerHeader };
44
+
45
+ //# sourceMappingURL=LayerHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayerHeader.js","names":[],"sources":["../../lib/ui/LayerHeader.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport type { ComponentProps, FunctionComponent, MouseEventHandler } from 'react';\n\nimport { Button } from './buttons/Button';\nimport type { ButtonProps as Btn } from './buttons/Button.type';\nimport { Heading, type HeadingProps } from './heading/Heading';\n\nexport interface LayerHeaderButtonProps\n extends Omit<ComponentProps<'button'>, 'color' | 'onClick'>,\n Omit<Btn, 'variant' | 'theme'> {\n /**\n * Icon displayed in the round button\n */\n icon: Exclude<Btn['icon'], undefined>;\n /**\n * Accessible name of the button (rendered as `aria-label`)\n */\n label: string;\n onClick: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface LayerHeaderProps extends ComponentProps<'header'> {\n /**\n * Overrides the level announced to assistive technologies, without changing the tag\n */\n hAriaLevel?: number;\n /**\n * Level of the heading tag (h1 to h6)\n */\n hLevel?: HeadingProps['level'];\n /**\n * Round button pinned to the inline start of the header (e.g. a \"back\" arrow)\n */\n leftButton?: LayerHeaderButtonProps;\n /**\n * Round button pinned to the inline end of the header (e.g. a \"close\" cross)\n */\n rightButton?: LayerHeaderButtonProps;\n}\n\nexport const LayerHeader: FunctionComponent<LayerHeaderProps> = ({\n children,\n className,\n hAriaLevel,\n hLevel = 1,\n id,\n leftButton,\n rightButton,\n ...attrs\n}) => {\n const { label: leftLabel, ...leftBtn } = leftButton || {};\n const { label: rightLabel, ...rightBtn } = rightButton || {};\n\n return (\n <header\n {...attrs}\n className={clsx(\n 'relative flex min-h-64 items-center justify-between gap-8 overscroll-contain bg-white p-8 lg:px-20',\n className,\n )}\n >\n {leftButton && (\n <Button\n aria-describedby={id}\n {...leftBtn}\n aria-label={leftLabel}\n className=\"absolute start-0 m-8 lg:mx-20\"\n color=\"black\"\n size=\"medium\"\n theme=\"outline\"\n variant=\"circle\"\n />\n )}\n <Heading\n aria-level={hAriaLevel}\n className=\"text-b3 lg:text-b2 flex-1 px-56 text-center font-semibold\"\n id={id}\n level={hLevel}\n >\n {children}\n </Heading>\n {rightButton && (\n <Button\n aria-describedby={id}\n {...rightBtn}\n aria-label={rightLabel}\n className=\"absolute end-0 m-8 lg:mx-20\"\n color=\"black\"\n size=\"medium\"\n theme=\"outline\"\n variant=\"circle\"\n />\n )}\n </header>\n );\n};\n"],"mappings":";;;;;AAwCA,IAAa,KAAoD,EAC/D,aACA,cACA,eACA,YAAS,GACT,OACA,eACA,gBACA,GAAG,QACC;CACJ,IAAM,EAAE,OAAO,GAAW,GAAG,MAAY,KAAc,EAAE,EACnD,EAAE,OAAO,GAAY,GAAG,MAAa,KAAe,EAAE;AAE5D,QACE,kBAAC,UAAD;EACE,GAAI;EACJ,WAAW,EACT,sGACA,EACD;YALH;GAOG,KACC,kBAAC,GAAD;IACE,oBAAkB;IAClB,GAAI;IACJ,cAAY;IACZ,WAAU;IACV,OAAM;IACN,MAAK;IACL,OAAM;IACN,SAAQ;IACR,CAAA;GAEJ,kBAAC,GAAD;IACE,cAAY;IACZ,WAAU;IACN;IACJ,OAAO;IAEN;IACO,CAAA;GACT,KACC,kBAAC,GAAD;IACE,oBAAkB;IAClB,GAAI;IACJ,cAAY;IACZ,WAAU;IACV,OAAM;IACN,MAAK;IACL,OAAM;IACN,SAAQ;IACR,CAAA;GAEG"}
package/ui/Loader.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { t as e } from "../chunks/clsx.js";
3
- import { n as t, t as n } from "../chunks/Backdrop.js";
3
+ import { t } from "../chunks/useTransitionState.js";
4
+ import { Backdrop as n } from "./Backdrop.js";
4
5
  import { useEffect as r } from "react";
5
6
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
7
  //#region lib/ui/Loader.tsx
package/ui/Loader.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.js","names":[],"sources":["../../lib/ui/Loader.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ComponentProps, type FunctionComponent } from 'react';\nimport { useTransitionState } from 'react-transition-state';\n\nimport { Backdrop } from './Backdrop';\n\nexport interface LoaderProps {\n isVisible?: boolean;\n label?: string;\n portalId?: ComponentProps<typeof Backdrop>['target'];\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 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L.7 27c3.7-3.5 9.4-7.8 14-10.7a26.4 26.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, portalId }) => {\n const [{ status, isMounted }, toggle] = useTransitionState({\n timeout: { enter: 250, exit: 250 },\n mountOnEnter: true,\n unmountOnExit: true,\n preEnter: true,\n });\n\n useEffect(() => {\n toggle(isVisible);\n }, [isVisible, toggle]);\n\n const entering = status === 'preEnter' || status === 'entering';\n const exiting = status === 'exiting';\n\n return (\n <Backdrop isVisible={isVisible} target={portalId} sweep>\n {isMounted && (\n <div\n className={clsx('flex flex-col items-center transition-all duration-500', {\n '-translate-x-full opacity-0': entering,\n 'translate-x-full opacity-100': exiting,\n })}\n role=\"alert\"\n >\n <div\n className=\"relative isolate\"\n style={{\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 >\n {loaderSVG}\n </div>\n <div\n className={clsx(\n 'mx-auto max-w-[320px] px-20 text-center text-b3 transition-all delay-100 duration-400',\n {\n '-translate-x-full opacity-0': entering,\n 'translate-x-full opacity-100': exiting,\n },\n )}\n >\n {label}\n </div>\n </div>\n )}\n </Backdrop>\n );\n};\n"],"mappings":";;;;;;AAcA,IAAM,IACJ,kBAAC,OAAD;CAAK,SAAQ;CAAc,OAAO;WAAlC,CACE,kBAAC,QAAD,EAAA,UACE,kBAAC,QAAD;EACE,IAAG;EACH,GAAE;EACF,CAAA,EACG,CAAA,EACP,kBAAC,KAAD;EAAG,MAAK;EAAO,UAAS;EAAU,WAAU;YAA5C,CACE,kBAAC,QAAD;GAAM,IAAG;GAAI,MAAK;aAChB,kBAAC,OAAD,EAAK,WAAU,MAAO,CAAA;GACjB,CAAA,EACP,kBAAC,KAAD;GAAG,MAAK;aAAR,CACE,kBAAC,QAAD;IACE,MAAK;IACL,UAAS;IACT,GAAE;IACF,WAAU;IACV,CAAA,EACF,kBAAC,QAAD;IACE,MAAK;IACL,UAAS;IACT,GAAE;IACF,MAAK;IACL,CAAA,CAAA;;;IAMG,KAA0C,EAAE,cAAW,UAAO,kBAAe;CACxF,IAAM,CAAC,EAAE,WAAQ,gBAAa,KAAU,EAAmB;EACzD,SAAS;GAAE,OAAO;GAAK,MAAM;GAAK;EAClC,cAAc;EACd,eAAe;EACf,UAAU;EACX,CAAC;AAEF,SAAgB;AACd,IAAO,EAAU;IAChB,CAAC,GAAW,EAAO,CAAC;CAEvB,IAAM,IAAW,MAAW,cAAc,MAAW,YAC/C,IAAU,MAAW;AAE3B,QACE,kBAAC,GAAD;EAAqB;EAAW,QAAQ;EAAU,OAAA;YAC/C,KACC,kBAAC,OAAD;GACE,WAAW,EAAK,0DAA0D;IACxE,+BAA+B;IAC/B,gCAAgC;IACjC,CAAC;GACF,MAAK;aALP,CAOE,kBAAC,OAAD;IACE,WAAU;IACV,OAAO;KACL,WAAW;KACX,iBAAiB;KAClB;cAEA;IACG,CAAA,EACN,kBAAC,OAAD;IACE,WAAW,EACT,yFACA;KACE,+BAA+B;KAC/B,gCAAgC;KACjC,CACF;cAEA;IACG,CAAA,CAAA;;EAGD,CAAA"}
1
+ {"version":3,"file":"Loader.js","names":[],"sources":["../../lib/ui/Loader.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ComponentProps, type FunctionComponent } from 'react';\nimport { useTransitionState } from 'react-transition-state';\n\nimport { Backdrop } from './Backdrop';\n\nexport interface LoaderProps {\n isVisible?: boolean;\n label?: string;\n portalId?: ComponentProps<typeof Backdrop>['target'];\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 11 9.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"url(#a)\"\n />\n </g>\n </g>\n </svg>\n);\n\nexport const Loader: FunctionComponent<LoaderProps> = ({ isVisible, label, portalId }) => {\n const [{ status, isMounted }, toggle] = useTransitionState({\n timeout: { enter: 250, exit: 250 },\n mountOnEnter: true,\n unmountOnExit: true,\n preEnter: true,\n });\n\n useEffect(() => {\n toggle(isVisible);\n }, [isVisible, toggle]);\n\n const entering = status === 'preEnter' || status === 'entering';\n const exiting = status === 'exiting';\n\n return (\n <Backdrop isVisible={isVisible} target={portalId} sweep>\n {isMounted && (\n <div\n className={clsx('flex flex-col items-center transition-all duration-500', {\n '-translate-x-full opacity-0': entering,\n 'translate-x-full opacity-100': exiting,\n })}\n role=\"alert\"\n >\n <div\n className=\"relative isolate\"\n style={{\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 >\n {loaderSVG}\n </div>\n <div\n className={clsx(\n 'mx-auto max-w-[320px] px-20 text-center text-b3 transition-all delay-100 duration-400',\n {\n '-translate-x-full opacity-0': entering,\n 'translate-x-full opacity-100': exiting,\n },\n )}\n >\n {label}\n </div>\n </div>\n )}\n </Backdrop>\n );\n};\n"],"mappings":";;;;;;;AAcA,IAAM,IACJ,kBAAC,OAAD;CAAK,SAAQ;CAAc,OAAO;WAAlC,CACE,kBAAC,QAAD,EAAA,UACE,kBAAC,QAAD;EACE,IAAG;EACH,GAAE;EACF,CAAA,EACG,CAAA,EACP,kBAAC,KAAD;EAAG,MAAK;EAAO,UAAS;EAAU,WAAU;YAA5C,CACE,kBAAC,QAAD;GAAM,IAAG;GAAI,MAAK;aAChB,kBAAC,OAAD,EAAK,WAAU,MAAO,CAAA;GACjB,CAAA,EACP,kBAAC,KAAD;GAAG,MAAK;aAAR,CACE,kBAAC,QAAD;IACE,MAAK;IACL,UAAS;IACT,GAAE;IACF,WAAU;IACV,CAAA,EACF,kBAAC,QAAD;IACE,MAAK;IACL,UAAS;IACT,GAAE;IACF,MAAK;IACL,CAAA,CAAA;;;IAMG,KAA0C,EAAE,cAAW,UAAO,kBAAe;CACxF,IAAM,CAAC,EAAE,WAAQ,gBAAa,KAAU,EAAmB;EACzD,SAAS;GAAE,OAAO;GAAK,MAAM;GAAK;EAClC,cAAc;EACd,eAAe;EACf,UAAU;EACX,CAAC;AAEF,SAAgB;AACd,IAAO,EAAU;IAChB,CAAC,GAAW,EAAO,CAAC;CAEvB,IAAM,IAAW,MAAW,cAAc,MAAW,YAC/C,IAAU,MAAW;AAE3B,QACE,kBAAC,GAAD;EAAqB;EAAW,QAAQ;EAAU,OAAA;YAC/C,KACC,kBAAC,OAAD;GACE,WAAW,EAAK,0DAA0D;IACxE,+BAA+B;IAC/B,gCAAgC;IACjC,CAAC;GACF,MAAK;aALP,CAOE,kBAAC,OAAD;IACE,WAAU;IACV,OAAO;KACL,WAAW;KACX,iBAAiB;KAClB;cAEA;IACG,CAAA,EACN,kBAAC,OAAD;IACE,WAAW,EACT,yFACA;KACE,+BAA+B;KAC/B,gCAAgC;KACjC,CACF;cAEA;IACG,CAAA,CAAA;;EAGD,CAAA"}
package/ui/Popin.d.ts CHANGED
@@ -14,6 +14,12 @@ export interface PopinProps {
14
14
  bodyClassName?: string;
15
15
  showCloseButton?: boolean;
16
16
  target?: BackdropProps['target'];
17
+ /**
18
+ * Whether the popin can be dismissed via ESC, backdrop click, or close button.
19
+ * When false, only programmatic closing via onClose is allowed.
20
+ * @default true
21
+ */
22
+ dismissable?: boolean;
17
23
  /**
18
24
  * @deprecated use popinFooter slot instead
19
25
  */
package/ui/Popin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/clsx.js";
2
2
  import { Button as t } from "./buttons/Button.js";
3
- import { t as n } from "../chunks/Backdrop.js";
3
+ import { Backdrop as n } from "./Backdrop.js";
4
4
  import { twMerge as r } from "./helpers/twMerge.js";
5
5
  import { useSlots as i } from "./hooks/useSlots.js";
6
6
  import { useRef as a } from "react";
@@ -13,16 +13,17 @@ var c = ({ closeLabel: e, onClose: n }) => /* @__PURE__ */ o(t, {
13
13
  className: "mx-auto",
14
14
  "aria-label": e,
15
15
  onClick: n
16
- }), l = ({ title: t, children: l, closeLabel: u, onClose: d, isVisible: f, className: p = "sm:w-360", bodyClassName: m, Footer: h = c }) => {
17
- let { children: g, popinFooter: _ } = i(l, ["popinFooter"]), v = a(f), y = v.current, b = !f && y;
18
- return v.current = f, /* @__PURE__ */ o(n, {
16
+ }), l = ({ title: t, children: l, closeLabel: u, onClose: d, isVisible: f, className: p = "sm:w-360", bodyClassName: m, Footer: h = c, dismissable: g = !0 }) => {
17
+ let { children: _, popinFooter: v } = i(l, ["popinFooter"]), y = a(f), b = y.current, x = !f && b;
18
+ return y.current = f, /* @__PURE__ */ o(n, {
19
19
  isVisible: f,
20
- onClose: d,
20
+ onClose: g ? d : void 0,
21
+ dismissable: g,
21
22
  children: /* @__PURE__ */ o("div", {
22
23
  className: r(e("border-lightGrey rounded-16 pointer-events-auto mx-20 w-full border bg-white origin-center will-change[transform,opacity]", {
23
24
  "animate-zoom-in": f,
24
- "animate-zoom-out": !f && b,
25
- "opacity-0 scale-90": !f && !b
25
+ "animate-zoom-out": !f && x,
26
+ "opacity-0 scale-90": !f && !x
26
27
  }), p),
27
28
  children: /* @__PURE__ */ s("div", {
28
29
  className: r("text-center max-h-[90vh] flex flex-col p-40 gap-40", m),
@@ -33,13 +34,13 @@ var c = ({ closeLabel: e, onClose: n }) => /* @__PURE__ */ o(t, {
33
34
  }),
34
35
  /* @__PURE__ */ o("div", {
35
36
  className: "text-start overflow-auto",
36
- children: g
37
+ children: _
37
38
  }),
38
- !_?.length && h && /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(h, {
39
+ !v?.length && h && g && /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(h, {
39
40
  closeLabel: u,
40
41
  onClose: d
41
42
  }) }),
42
- _
43
+ v
43
44
  ]
44
45
  })
45
46
  })
package/ui/Popin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Popin.js","names":[],"sources":["../../lib/ui/Popin.tsx"],"sourcesContent":["import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';\nimport { useRef } from 'react';\nimport { twMerge } from './helpers/twMerge';\nimport { Backdrop, type BackdropProps } from './Backdrop';\nimport { Button } from './buttons/Button';\nimport clsx from 'clsx';\nimport { useSlots } from './hooks/useSlots';\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 bodyClassName?: string;\n showCloseButton?: boolean;\n target?: BackdropProps['target'];\n /**\n * @deprecated use popinFooter slot instead\n */\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 bodyClassName,\n Footer = PopinFooter,\n}) => {\n const { children: popinBody, popinFooter } = useSlots(children, ['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={twMerge(\n clsx(\n 'border-lightGrey rounded-16 pointer-events-auto mx-20 w-full border bg-white origin-center will-change[transform,opacity]',\n {\n 'animate-zoom-in': isVisible,\n 'animate-zoom-out': !isVisible && isLeaving,\n 'opacity-0 scale-90': !isVisible && !isLeaving,\n },\n ),\n className,\n )}\n >\n <div\n className={twMerge('text-center max-h-[90vh] flex flex-col p-40 gap-40', bodyClassName)}\n >\n {title && <div className=\"text-h5 mt-0 -mb-20 text-start font-serif\">{title}</div>}\n <div className=\"text-start overflow-auto\">{popinBody}</div>\n {!popinFooter?.length && Footer && (\n <div>\n <Footer closeLabel={closeLabel} onClose={onClose} />\n </div>\n )}\n\n {popinFooter}\n </div>\n </div>\n </Backdrop>\n );\n};\n"],"mappings":";;;;;;;;AAeA,IAAM,KAAe,EAAE,eAAY,iBAE/B,kBAAC,GAAD;CACE,OAAM;CACN,SAAQ;CACR,MAAK;CACL,WAAU;CACV,cAAY;CACZ,SAAS;CACT,CAAA,EAmBO,KAA2D,EACtE,UACA,aACA,eACA,YACA,cACA,eAAY,YACZ,kBACA,YAAS,QACL;CACJ,IAAM,EAAE,UAAU,GAAW,mBAAgB,EAAS,GAAU,CAAC,cAAc,CAAC,EAG1E,IAAgB,EAAO,EAAU,EACjC,IAAa,EAAc,SAC3B,IAAY,CAAC,KAAa;AAIhC,QADA,EAAc,UAAU,GAEtB,kBAAC,GAAD;EAAqB;EAAoB;YACvC,kBAAC,OAAD;GACE,WAAW,EACT,EACE,6HACA;IACE,mBAAmB;IACnB,oBAAoB,CAAC,KAAa;IAClC,sBAAsB,CAAC,KAAa,CAAC;IACtC,CACF,EACD,EACD;aAED,kBAAC,OAAD;IACE,WAAW,EAAQ,sDAAsD,EAAc;cADzF;KAGG,KAAS,kBAAC,OAAD;MAAK,WAAU;gBAA6C;MAAY,CAAA;KAClF,kBAAC,OAAD;MAAK,WAAU;gBAA4B;MAAgB,CAAA;KAC1D,CAAC,GAAa,UAAU,KACvB,kBAAC,OAAD,EAAA,UACE,kBAAC,GAAD;MAAoB;MAAqB;MAAW,CAAA,EAChD,CAAA;KAGP;KACG;;GACF,CAAA;EACG,CAAA"}
1
+ {"version":3,"file":"Popin.js","names":[],"sources":["../../lib/ui/Popin.tsx"],"sourcesContent":["import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';\nimport { useRef } from 'react';\nimport { twMerge } from './helpers/twMerge';\nimport { Backdrop, type BackdropProps } from './Backdrop';\nimport { Button } from './buttons/Button';\nimport clsx from 'clsx';\nimport { useSlots } from './hooks/useSlots';\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 bodyClassName?: string;\n showCloseButton?: boolean;\n target?: BackdropProps['target'];\n /**\n * Whether the popin can be dismissed via ESC, backdrop click, or close button.\n * When false, only programmatic closing via onClose is allowed.\n * @default true\n */\n dismissable?: boolean;\n /**\n * @deprecated use popinFooter slot instead\n */\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 bodyClassName,\n Footer = PopinFooter,\n dismissable = true,\n}) => {\n const { children: popinBody, popinFooter } = useSlots(children, ['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\n isVisible={isVisible}\n onClose={dismissable ? onClose : undefined}\n dismissable={dismissable}\n >\n <div\n className={twMerge(\n clsx(\n 'border-lightGrey rounded-16 pointer-events-auto mx-20 w-full border bg-white origin-center will-change[transform,opacity]',\n {\n 'animate-zoom-in': isVisible,\n 'animate-zoom-out': !isVisible && isLeaving,\n 'opacity-0 scale-90': !isVisible && !isLeaving,\n },\n ),\n className,\n )}\n >\n <div\n className={twMerge('text-center max-h-[90vh] flex flex-col p-40 gap-40', bodyClassName)}\n >\n {title && <div className=\"text-h5 mt-0 -mb-20 text-start font-serif\">{title}</div>}\n <div className=\"text-start overflow-auto\">{popinBody}</div>\n {!popinFooter?.length && Footer && dismissable && (\n <div>\n <Footer closeLabel={closeLabel} onClose={onClose} />\n </div>\n )}\n\n {popinFooter}\n </div>\n </div>\n </Backdrop>\n );\n};\n"],"mappings":";;;;;;;;AAeA,IAAM,KAAe,EAAE,eAAY,iBAE/B,kBAAC,GAAD;CACE,OAAM;CACN,SAAQ;CACR,MAAK;CACL,WAAU;CACV,cAAY;CACZ,SAAS;CACT,CAAA,EAyBO,KAA2D,EACtE,UACA,aACA,eACA,YACA,cACA,eAAY,YACZ,kBACA,YAAS,GACT,iBAAc,SACV;CACJ,IAAM,EAAE,UAAU,GAAW,mBAAgB,EAAS,GAAU,CAAC,cAAc,CAAC,EAG1E,IAAgB,EAAO,EAAU,EACjC,IAAa,EAAc,SAC3B,IAAY,CAAC,KAAa;AAIhC,QADA,EAAc,UAAU,GAEtB,kBAAC,GAAD;EACa;EACX,SAAS,IAAc,IAAU,KAAA;EACpB;YAEb,kBAAC,OAAD;GACE,WAAW,EACT,EACE,6HACA;IACE,mBAAmB;IACnB,oBAAoB,CAAC,KAAa;IAClC,sBAAsB,CAAC,KAAa,CAAC;IACtC,CACF,EACD,EACD;aAED,kBAAC,OAAD;IACE,WAAW,EAAQ,sDAAsD,EAAc;cADzF;KAGG,KAAS,kBAAC,OAAD;MAAK,WAAU;gBAA6C;MAAY,CAAA;KAClF,kBAAC,OAAD;MAAK,WAAU;gBAA4B;MAAgB,CAAA;KAC1D,CAAC,GAAa,UAAU,KAAU,KACjC,kBAAC,OAAD,EAAA,UACE,kBAAC,GAAD;MAAoB;MAAqB;MAAW,CAAA,EAChD,CAAA;KAGP;KACG;;GACF,CAAA;EACG,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { useEffect } from 'react';
2
+ /**
3
+ * `useLayoutEffect` in the browser, `useEffect` on the server (where layout effects never run and
4
+ * React 18 warns about them)
5
+ */
6
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;
@@ -0,0 +1,7 @@
1
+ import { useEffect as e, useLayoutEffect as t } from "react";
2
+ //#region lib/ui/hooks/useIsomorphicLayoutEffect.ts
3
+ var n = typeof window < "u" ? t : e;
4
+ //#endregion
5
+ export { n as useIsomorphicLayoutEffect };
6
+
7
+ //# sourceMappingURL=useIsomorphicLayoutEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsomorphicLayoutEffect.js","names":[],"sources":["../../../lib/ui/hooks/useIsomorphicLayoutEffect.ts"],"sourcesContent":["import { useEffect, useLayoutEffect } from 'react';\n\n/**\n * `useLayoutEffect` in the browser, `useEffect` on the server (where layout effects never run and\n * React 18 warns about them)\n */\nexport const useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n"],"mappings":";;AAMA,IAAa,IACX,OAAO,SAAW,MAAc,IAAkB"}
@@ -0,0 +1,13 @@
1
+ export interface UseLayerOptions {
2
+ onClose?: () => void;
3
+ onOpen?: () => void;
4
+ opened?: boolean;
5
+ }
6
+ /**
7
+ * Open state and handlers to drive a `<Layer />`
8
+ */
9
+ export declare const useLayer: ({ onClose, onOpen, opened }?: UseLayerOptions) => {
10
+ close: () => void;
11
+ isOpen: boolean;
12
+ open: () => void;
13
+ };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { useCallback as e, useMemo as t, useRef as n, useState as r } from "react";
3
+ //#region lib/ui/hooks/useLayer.ts
4
+ var i = ({ onClose: i, onOpen: a, opened: o = !1 } = {}) => {
5
+ let [s, c] = r(o), l = n({
6
+ onClose: i,
7
+ onOpen: a
8
+ });
9
+ l.current = {
10
+ onClose: i,
11
+ onOpen: a
12
+ };
13
+ let u = e(() => {
14
+ c(!0), l.current.onOpen?.();
15
+ }, []), d = e(() => {
16
+ c(!1), l.current.onClose?.();
17
+ }, []);
18
+ return t(() => ({
19
+ close: d,
20
+ isOpen: s,
21
+ open: u
22
+ }), [
23
+ d,
24
+ s,
25
+ u
26
+ ]);
27
+ };
28
+ //#endregion
29
+ export { i as useLayer };
30
+
31
+ //# sourceMappingURL=useLayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLayer.js","names":[],"sources":["../../../lib/ui/hooks/useLayer.ts"],"sourcesContent":["'use client';\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\nexport interface UseLayerOptions {\n onClose?: () => void;\n onOpen?: () => void;\n opened?: boolean;\n}\n\n/**\n * Open state and handlers to drive a `<Layer />`\n */\nexport const useLayer = ({ onClose, onOpen, opened = false }: UseLayerOptions = {}) => {\n const [isOpen, setIsOpen] = useState(opened);\n\n // read the callbacks through a ref so `open` and `close` keep the same identity even when the\n // consumer passes inline handlers, which would otherwise re-render every memoized child using them\n const callbacksRef = useRef({ onClose, onOpen });\n callbacksRef.current = { onClose, onOpen };\n\n const open = useCallback(() => {\n setIsOpen(true);\n callbacksRef.current.onOpen?.();\n }, []);\n\n const close = useCallback(() => {\n setIsOpen(false);\n callbacksRef.current.onClose?.();\n }, []);\n\n return useMemo(() => ({ close, isOpen, open }), [close, isOpen, open]);\n};\n"],"mappings":";;;AAYA,IAAa,KAAY,EAAE,YAAS,WAAQ,YAAS,OAA2B,EAAE,KAAK;CACrF,IAAM,CAAC,GAAQ,KAAa,EAAS,EAAO,EAItC,IAAe,EAAO;EAAE;EAAS;EAAQ,CAAC;AAChD,GAAa,UAAU;EAAE;EAAS;EAAQ;CAE1C,IAAM,IAAO,QAAkB;AAE7B,EADA,EAAU,GAAK,EACf,EAAa,QAAQ,UAAU;IAC9B,EAAE,CAAC,EAEA,IAAQ,QAAkB;AAE9B,EADA,EAAU,GAAM,EAChB,EAAa,QAAQ,WAAW;IAC/B,EAAE,CAAC;AAEN,QAAO,SAAe;EAAE;EAAO;EAAQ;EAAM,GAAG;EAAC;EAAO;EAAQ;EAAK,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { TransitionOptions, TransitionResult } from 'react-transition-state';
2
+ /**
3
+ * `react-transition-state` keeps its pending animation frame and timeout when a component
4
+ * unmounts mid-transition, so the scheduled callback runs against a tree that no longer exists.
5
+ * Ending the transition on unmount clears both.
6
+ */
7
+ export declare const useTransitionState: (options?: TransitionOptions) => TransitionResult;
@@ -0,0 +1,15 @@
1
+ import { t as e } from "../../chunks/useTransitionState.js";
2
+ import { useEffect as t, useRef as n } from "react";
3
+ //#region lib/ui/hooks/useTransitionState.ts
4
+ var r = (r) => {
5
+ let [i, a, o] = e(r), s = n(o);
6
+ return s.current = o, t(() => () => s.current(), []), [
7
+ i,
8
+ a,
9
+ o
10
+ ];
11
+ };
12
+ //#endregion
13
+ export { r as useTransitionState };
14
+
15
+ //# sourceMappingURL=useTransitionState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTransitionState.js","names":[],"sources":["../../../lib/ui/hooks/useTransitionState.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport {\n useTransitionState as useBaseTransitionState,\n type TransitionOptions,\n type TransitionResult,\n} from 'react-transition-state';\n\n/**\n * `react-transition-state` keeps its pending animation frame and timeout when a component\n * unmounts mid-transition, so the scheduled callback runs against a tree that no longer exists.\n * Ending the transition on unmount clears both.\n */\nexport const useTransitionState = (options?: TransitionOptions): TransitionResult => {\n const [state, toggle, endTransition] = useBaseTransitionState(options);\n\n const endTransitionRef = useRef(endTransition);\n endTransitionRef.current = endTransition;\n\n useEffect(() => () => endTransitionRef.current(), []);\n\n return [state, toggle, endTransition];\n};\n"],"mappings":";;;AAYA,IAAa,KAAsB,MAAkD;CACnF,IAAM,CAAC,GAAO,GAAQ,KAAiB,EAAuB,EAAQ,EAEhE,IAAmB,EAAO,EAAc;AAK9C,QAJA,EAAiB,UAAU,GAE3B,cAAsB,EAAiB,SAAS,EAAE,EAAE,CAAC,EAE9C;EAAC;EAAO;EAAQ;EAAc"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Pins a `position: fixed` overlay to the visual viewport so iOS Safari's
3
+ * keyboard does not shift the overlay off-screen.
4
+ *
5
+ * Returns a callback ref to put on the overlay element.
6
+ */
7
+ export declare const useVisualViewportBox: <T extends HTMLElement>() => import('react').Dispatch<import('react').SetStateAction<T | null>>;
@@ -0,0 +1,22 @@
1
+ import { useIsomorphicLayoutEffect as e } from "./useIsomorphicLayoutEffect.js";
2
+ import { useState as t } from "react";
3
+ //#region lib/ui/hooks/useVisualViewportBox.ts
4
+ var n = (e, t) => {
5
+ e.style.top = `${t.offsetTop}px`, e.style.left = `${t.offsetLeft}px`, e.style.right = "auto", e.style.bottom = "auto", e.style.width = `${t.width}px`, e.style.height = `${t.height}px`, e.style.maxHeight = `${t.height}px`;
6
+ }, r = () => {
7
+ let [r, i] = t(null);
8
+ return e(() => {
9
+ let e = window.visualViewport;
10
+ if (!r || !e) return;
11
+ let t = () => {
12
+ n(r, e);
13
+ };
14
+ return t(), e.addEventListener("resize", t), e.addEventListener("scroll", t), () => {
15
+ e.removeEventListener("resize", t), e.removeEventListener("scroll", t);
16
+ };
17
+ }, [r]), i;
18
+ };
19
+ //#endregion
20
+ export { r as useVisualViewportBox };
21
+
22
+ //# sourceMappingURL=useVisualViewportBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVisualViewportBox.js","names":[],"sources":["../../../lib/ui/hooks/useVisualViewportBox.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n\nconst applyVisualViewportBox = (element: HTMLElement, viewport: VisualViewport) => {\n element.style.top = `${viewport.offsetTop}px`;\n element.style.left = `${viewport.offsetLeft}px`;\n element.style.right = 'auto';\n element.style.bottom = 'auto';\n element.style.width = `${viewport.width}px`;\n element.style.height = `${viewport.height}px`;\n element.style.maxHeight = `${viewport.height}px`;\n};\n\n/**\n * Pins a `position: fixed` overlay to the visual viewport so iOS Safari's\n * keyboard does not shift the overlay off-screen.\n *\n * Returns a callback ref to put on the overlay element.\n */\nexport const useVisualViewportBox = <T extends HTMLElement>() => {\n const [element, setElement] = useState<T | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n const viewport = window.visualViewport;\n\n if (!element || !viewport) {\n return;\n }\n\n const update = () => {\n applyVisualViewportBox(element, viewport);\n };\n\n update();\n viewport.addEventListener('resize', update);\n viewport.addEventListener('scroll', update);\n\n return () => {\n viewport.removeEventListener('resize', update);\n viewport.removeEventListener('scroll', update);\n };\n }, [element]);\n\n return setElement;\n};\n"],"mappings":";;;AAIA,IAAM,KAA0B,GAAsB,MAA6B;AAOjF,CANA,EAAQ,MAAM,MAAM,GAAG,EAAS,UAAU,KAC1C,EAAQ,MAAM,OAAO,GAAG,EAAS,WAAW,KAC5C,EAAQ,MAAM,QAAQ,QACtB,EAAQ,MAAM,SAAS,QACvB,EAAQ,MAAM,QAAQ,GAAG,EAAS,MAAM,KACxC,EAAQ,MAAM,SAAS,GAAG,EAAS,OAAO,KAC1C,EAAQ,MAAM,YAAY,GAAG,EAAS,OAAO;GASlC,UAAoD;CAC/D,IAAM,CAAC,GAAS,KAAc,EAAmB,KAAK;AAuBtD,QArBA,QAAgC;EAC9B,IAAM,IAAW,OAAO;AAExB,MAAI,CAAC,KAAW,CAAC,EACf;EAGF,IAAM,UAAe;AACnB,KAAuB,GAAS,EAAS;;AAO3C,SAJA,GAAQ,EACR,EAAS,iBAAiB,UAAU,EAAO,EAC3C,EAAS,iBAAiB,UAAU,EAAO,QAE9B;AAEX,GADA,EAAS,oBAAoB,UAAU,EAAO,EAC9C,EAAS,oBAAoB,UAAU,EAAO;;IAE/C,CAAC,EAAQ,CAAC,EAEN"}
@@ -1,105 +0,0 @@
1
- import { t as e } from "./clsx.js";
2
- import { Portal as t } from "../ui/Portal.js";
3
- import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
4
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
- var c = 5, l = 6, u = [
6
- "preEnter",
7
- "entering",
8
- "entered",
9
- "preExit",
10
- "exiting",
11
- "exited",
12
- "unmounted"
13
- ], d = (e) => ({
14
- _s: e,
15
- status: u[e],
16
- isEnter: e < 3,
17
- isMounted: e !== l,
18
- isResolved: e === 2 || e > 4
19
- }), f = (e) => e ? l : c, p = (e, t) => {
20
- switch (e) {
21
- case 1:
22
- case 0: return 2;
23
- case 4:
24
- case 3: return f(t);
25
- }
26
- }, m = (e) => typeof e == "object" ? [e.enter, e.exit] : [e, e], h = (...e) => setTimeout(...e), g = (e, t) => h(() => {
27
- isNaN(document.body.offsetTop) || e(t + 1);
28
- }, 0), _ = (e, t, n, r, i) => {
29
- clearTimeout(r.current);
30
- let a = d(e);
31
- t(a), n.current = a, i && i({ current: a });
32
- }, v = ({ enter: e = !0, exit: t = !0, preEnter: r, preExit: o, timeout: s, initialEntered: c, mountOnEnter: l, unmountOnExit: u, onStateChange: v } = {}) => {
33
- let [y, b] = a(() => d(c ? 2 : f(l))), x = i(y), S = i(0), [C, w] = m(s), T = n(() => {
34
- let e = p(x.current._s, u);
35
- e && _(e, b, x, S, v);
36
- }, [v, u]);
37
- return [
38
- y,
39
- n((n) => {
40
- let i = (e) => {
41
- switch (_(e, b, x, S, v), e) {
42
- case 1:
43
- C >= 0 && (S.current = h(T, C));
44
- break;
45
- case 4:
46
- w >= 0 && (S.current = h(T, w));
47
- break;
48
- case 0:
49
- case 3:
50
- S.current = g(i, e);
51
- break;
52
- }
53
- }, a = x.current.isEnter;
54
- typeof n != "boolean" && (n = !a), n ? !a && i(e ? r ? 0 : 1 : 2) : a && i(t ? o ? 3 : 4 : f(u));
55
- }, [
56
- T,
57
- v,
58
- e,
59
- t,
60
- r,
61
- o,
62
- C,
63
- w,
64
- u
65
- ]),
66
- T
67
- ];
68
- }, y = ({ children: n, className: i = "flex justify-center", onClose: a, isVisible: c, target: l = "backdrop", sweep: u = !1, ...d }) => {
69
- let [f, p] = v({
70
- timeout: {
71
- enter: 0,
72
- exit: 500
73
- },
74
- mountOnEnter: !0,
75
- unmountOnExit: !0,
76
- preEnter: !0
77
- }), { status: m, isMounted: h } = f;
78
- r(() => {
79
- p(c);
80
- }, [c, p]);
81
- let g = m === "preEnter" || m === "exiting";
82
- return /* @__PURE__ */ o(t, {
83
- target: l,
84
- children: h && /* @__PURE__ */ s("div", {
85
- ...d,
86
- role: "presentation",
87
- className: e(i, "fixed inset-0 isolate items-center"),
88
- children: [/* @__PURE__ */ o("button", {
89
- "aria-hidden": "true",
90
- className: e("absolute inset-0 -z-1 transition-all duration-500 outline-none focus-visible:ring-4 focus-visible:ring-black focus-visible:ring-offset-2", {
91
- "bg-white/80 backdrop-blur": !g,
92
- "bg-white/0 backdrop-blur-none": g,
93
- "-translate-x-full": u && (m === "preEnter" || m === "entering"),
94
- "translate-x-full": u && m === "exiting"
95
- }),
96
- onClick: a,
97
- type: "button"
98
- }), n]
99
- })
100
- });
101
- };
102
- //#endregion
103
- export { v as n, y as t };
104
-
105
- //# sourceMappingURL=Backdrop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Backdrop.js","names":[],"sources":["../../../../node_modules/.pnpm/react-transition-state@2.3.3_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-transition-state/dist/esm/utils.mjs","../../../../node_modules/.pnpm/react-transition-state@2.3.3_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-transition-state/dist/esm/useTransitionState.mjs","../../lib/ui/Backdrop.tsx"],"sourcesContent":["//#region src/utils.ts\nconst PRE_ENTER = 0;\nconst ENTERING = 1;\nconst ENTERED = 2;\nconst PRE_EXIT = 3;\nconst EXITING = 4;\nconst EXITED = 5;\nconst UNMOUNTED = 6;\nconst STATUS = [\n\t\"preEnter\",\n\t\"entering\",\n\t\"entered\",\n\t\"preExit\",\n\t\"exiting\",\n\t\"exited\",\n\t\"unmounted\"\n];\nconst getState = (status) => ({\n\t_s: status,\n\tstatus: STATUS[status],\n\tisEnter: status < PRE_EXIT,\n\tisMounted: status !== UNMOUNTED,\n\tisResolved: status === ENTERED || status > EXITING\n});\nconst startOrEnd = (unmounted) => unmounted ? UNMOUNTED : EXITED;\nconst getEndStatus = (status, unmountOnExit) => {\n\tswitch (status) {\n\t\tcase ENTERING:\n\t\tcase PRE_ENTER: return ENTERED;\n\t\tcase EXITING:\n\t\tcase PRE_EXIT: return startOrEnd(unmountOnExit);\n\t}\n};\nconst getTimeout = (timeout) => typeof timeout === \"object\" ? [timeout.enter, timeout.exit] : [timeout, timeout];\nconst _setTimeout = (...args) => setTimeout(...args);\nconst nextTick = (transitState, status) => _setTimeout(() => {\n\tisNaN(document.body.offsetTop) || transitState(status + 1);\n}, 0);\n\n//#endregion\nexport { ENTERED, ENTERING, EXITING, PRE_ENTER, PRE_EXIT, _setTimeout, getEndStatus, getState, getTimeout, nextTick, startOrEnd };","import { ENTERED, ENTERING, EXITING, PRE_ENTER, PRE_EXIT, _setTimeout, getEndStatus, getState, getTimeout, nextTick, startOrEnd } from \"./utils.mjs\";\nimport { useCallback, useRef, useState } from \"react\";\n\n//#region src/useTransitionState.ts\nconst updateState = (status, setState, latestState, timeoutId, onChange) => {\n\tclearTimeout(timeoutId.current);\n\tconst state = getState(status);\n\tsetState(state);\n\tlatestState.current = state;\n\tonChange && onChange({ current: state });\n};\nconst useTransitionState = ({ enter = true, exit = true, preEnter, preExit, timeout, initialEntered, mountOnEnter, unmountOnExit, onStateChange: onChange } = {}) => {\n\tconst [state, setState] = useState(() => getState(initialEntered ? ENTERED : startOrEnd(mountOnEnter)));\n\tconst latestState = useRef(state);\n\tconst timeoutId = useRef(0);\n\tconst [enterTimeout, exitTimeout] = getTimeout(timeout);\n\tconst endTransition = useCallback(() => {\n\t\tconst status = getEndStatus(latestState.current._s, unmountOnExit);\n\t\tstatus && updateState(status, setState, latestState, timeoutId, onChange);\n\t}, [onChange, unmountOnExit]);\n\treturn [\n\t\tstate,\n\t\tuseCallback((toEnter) => {\n\t\t\tconst transitState = (status) => {\n\t\t\t\tupdateState(status, setState, latestState, timeoutId, onChange);\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase ENTERING:\n\t\t\t\t\t\tif (enterTimeout >= 0) timeoutId.current = _setTimeout(endTransition, enterTimeout);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EXITING:\n\t\t\t\t\t\tif (exitTimeout >= 0) timeoutId.current = _setTimeout(endTransition, exitTimeout);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PRE_ENTER:\n\t\t\t\t\tcase PRE_EXIT:\n\t\t\t\t\t\ttimeoutId.current = nextTick(transitState, status);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst enterStage = latestState.current.isEnter;\n\t\t\tif (typeof toEnter !== \"boolean\") toEnter = !enterStage;\n\t\t\tif (toEnter) !enterStage && transitState(enter ? preEnter ? PRE_ENTER : ENTERING : ENTERED);\n\t\t\telse enterStage && transitState(exit ? preExit ? PRE_EXIT : EXITING : startOrEnd(unmountOnExit));\n\t\t}, [\n\t\t\tendTransition,\n\t\t\tonChange,\n\t\t\tenter,\n\t\t\texit,\n\t\t\tpreEnter,\n\t\t\tpreExit,\n\t\t\tenterTimeout,\n\t\t\texitTimeout,\n\t\t\tunmountOnExit\n\t\t]),\n\t\tendTransition\n\t];\n};\n\n//#endregion\nexport { useTransitionState };","import {\n type ComponentProps,\n type FunctionComponent,\n type MouseEvent,\n type PropsWithChildren,\n useEffect,\n} from 'react';\nimport clsx from 'clsx';\nimport { useTransitionState } from 'react-transition-state';\nimport { Portal } from './Portal';\n\nexport interface BackdropProps extends ComponentProps<'div'> {\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 * Target ID for the Portal component\n */\n target?: ComponentProps<typeof Portal>['target'];\n}\n\nexport const Backdrop: FunctionComponent<PropsWithChildren<BackdropProps>> = ({\n children,\n className = 'flex justify-center',\n onClose,\n isVisible,\n target = 'backdrop',\n sweep = false,\n ...attrs\n}) => {\n const [state, toggle] = useTransitionState({\n timeout: { enter: 0, exit: 500 },\n mountOnEnter: true,\n unmountOnExit: true,\n preEnter: true,\n });\n\n const { status, isMounted } = state;\n\n useEffect(() => {\n toggle(isVisible);\n }, [isVisible, toggle]);\n\n const animated = status === 'preEnter' || status === 'exiting';\n\n return (\n <Portal target={target}>\n {isMounted && (\n <div\n {...attrs}\n role=\"presentation\"\n className={clsx(className, 'fixed inset-0 isolate items-center')}\n >\n <button\n aria-hidden=\"true\"\n className={clsx(\n 'absolute inset-0 -z-1 transition-all duration-500 outline-none focus-visible:ring-4 focus-visible:ring-black focus-visible:ring-offset-2',\n {\n 'bg-white/80 backdrop-blur': !animated,\n 'bg-white/0 backdrop-blur-none': animated,\n '-translate-x-full': sweep && (status === 'preEnter' || status === 'entering'),\n 'translate-x-full': sweep && status === 'exiting',\n },\n )}\n onClick={onClose}\n type=\"button\"\n />\n {children}\n </div>\n )}\n </Portal>\n );\n};\n"],"x_google_ignoreList":[0,1],"mappings":";;;;AAMA,IAAM,IAAS,GACT,IAAY,GACZ,IAAS;CACd;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EACK,KAAY,OAAY;CAC7B,IAAI;CACJ,QAAQ,EAAO;CACf,SAAS,IAAA;CACT,WAAW,MAAW;CACtB,YAAY,MAAA,KAAsB,IAAA;CAClC,GACK,KAAc,MAAc,IAAY,IAAY,GACpD,KAAgB,GAAQ,MAAkB;AAC/C,SAAQ,GAAR;EACC,KAAA;EACA,KAAA,EAAgB,Q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