@texturehq/edges 1.33.2 → 1.34.0

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 (52) hide show
  1. package/README.md +57 -3
  2. package/dist/{RichTextEditor-CxrunTg7.d.cts → RichTextEditor-diZqy_s1.d.cts} +1 -1
  3. package/dist/{RichTextEditor-CxrunTg7.d.ts → RichTextEditor-diZqy_s1.d.ts} +1 -1
  4. package/dist/{TimeField-DRQshIHX.d.ts → TimeField-7pTUPh11.d.ts} +32 -17
  5. package/dist/{TimeField-WCmeiLu3.d.cts → TimeField-CqmVrAdn.d.cts} +32 -17
  6. package/dist/{colors-Cgs2MGZ8.d.ts → colors-CoULWZ5j.d.ts} +53 -18
  7. package/dist/{colors-DGRiGzgj.d.cts → colors-upTGgIQe.d.cts} +53 -18
  8. package/dist/form/index.cjs +1 -1
  9. package/dist/form/index.cjs.map +1 -1
  10. package/dist/form/index.d.cts +1 -1
  11. package/dist/form/index.d.ts +1 -1
  12. package/dist/form/index.js +1 -1
  13. package/dist/form/index.js.map +1 -1
  14. package/dist/{index-BqpWEc_N.d.ts → index-dofSwYId.d.cts} +5 -5
  15. package/dist/{index-BqpWEc_N.d.cts → index-dofSwYId.d.ts} +5 -5
  16. package/dist/index.cjs +10 -10
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +161 -41
  19. package/dist/index.d.ts +161 -41
  20. package/dist/index.js +10 -10
  21. package/dist/index.js.map +1 -1
  22. package/dist/prose.css +202 -0
  23. package/dist/rhf/index.cjs +1 -1
  24. package/dist/rhf/index.cjs.map +1 -1
  25. package/dist/rhf/index.d.cts +2 -2
  26. package/dist/rhf/index.d.ts +2 -2
  27. package/dist/rhf/index.js +1 -1
  28. package/dist/rhf/index.js.map +1 -1
  29. package/dist/server.cjs +2 -2
  30. package/dist/server.cjs.map +1 -1
  31. package/dist/server.d.cts +2 -2
  32. package/dist/server.d.ts +2 -2
  33. package/dist/server.js +2 -2
  34. package/dist/server.js.map +1 -1
  35. package/dist/styles/computed.css +2 -2
  36. package/dist/styles/responsive-typography.css +9 -7
  37. package/dist/styles/theme-light-override.css +26 -15
  38. package/dist/styles.css +953 -877
  39. package/dist/theme.css +20 -7
  40. package/dist/typography.css +150 -0
  41. package/package.json +10 -12
  42. package/scripts/check-legacy-action-variants.mjs +96 -0
  43. package/scripts/check-legacy-font-colors.mjs +92 -0
  44. package/scripts/copy-assets.js +12 -0
  45. package/templates/claude-rules/.claude +5 -5
  46. package/templates/claude-rules/claude.md +5 -5
  47. package/templates/codex-rules/codex.md +5 -5
  48. package/dist/generated/tailwind-tokens-dark.css +0 -397
  49. package/dist/generated/tailwind-tokens-light.css +0 -611
  50. package/dist/generated/viz-runtime.css +0 -243
  51. package/scripts/generate-viz-runtime.js +0 -107
  52. package/scripts/validate-tokens.js +0 -176
@@ -3,7 +3,7 @@ import * as React$1 from 'react';
3
3
  import React__default, { ReactNode, ComponentType } from 'react';
4
4
  import { ScaleTime, ScaleLinear } from 'd3-scale';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import { d as IconName } from './RichTextEditor-CxrunTg7.cjs';
6
+ import { d as IconName } from './RichTextEditor-diZqy_s1.cjs';
7
7
  import * as react_map_gl from 'react-map-gl';
8
8
  import { ViewState, MapRef } from 'react-map-gl';
9
9
  import { MeterProps as MeterProps$1 } from 'react-aria-components';
@@ -75,7 +75,15 @@ interface BooleanFormat extends BaseFormat {
75
75
  type EnergyUnit = "Wh" | "kWh" | "MWh" | "GWh";
76
76
  interface EnergyFormat extends BaseFormat {
77
77
  type: "energy";
78
+ /** Display unit. If omitted, the formatter auto-scales (Wh → kWh → MWh → GWh). */
78
79
  unit?: EnergyUnit;
80
+ /**
81
+ * The unit the source value is already in. Defaults to "Wh" — the formatter's
82
+ * historical assumption. Set this when feeding a value that's already in a
83
+ * larger unit (e.g. `state.latestKwhUsage` is kWh) so auto-scale and the
84
+ * `unit` switch interpret the magnitude correctly.
85
+ */
86
+ sourceUnit?: EnergyUnit;
79
87
  autoScale?: boolean;
80
88
  decimals?: number;
81
89
  }
@@ -289,7 +297,7 @@ interface ActionItem {
289
297
  /**
290
298
  * Visual variant of the action
291
299
  */
292
- variant?: "default" | "destructive";
300
+ variant?: "primary" | "default" | "destructive";
293
301
  /**
294
302
  * Icon to display with the action
295
303
  */
@@ -669,31 +677,49 @@ interface CodeEditorProps {
669
677
  */
670
678
  declare function CodeEditor({ value, readOnly, onChange, language, theme, height, width, className, lineHeight, minLines, maxLines, showLineNumbers, showGutter, fontSize, wrapEnabled, }: CodeEditorProps): react_jsx_runtime.JSX.Element;
671
679
 
672
- declare const sizeVariants: {
673
- readonly xs: "text-base md:text-lg font-semibold";
674
- readonly sm: "text-lg md:text-xl font-semibold";
675
- readonly md: "text-xl md:text-2xl font-semibold";
676
- readonly lg: "text-2xl md:text-3xl font-semibold";
677
- readonly xl: "text-3xl md:text-4xl font-semibold";
680
+ declare const variantSizeMap: {
681
+ readonly heading: {
682
+ readonly sm: "text-heading-sm";
683
+ readonly md: "text-heading-md";
684
+ readonly lg: "text-heading-lg";
685
+ readonly xl: "text-heading-xl";
686
+ };
687
+ readonly display: {
688
+ readonly sm: "text-display-sm";
689
+ readonly md: "text-display-md";
690
+ readonly lg: "text-display-lg";
691
+ readonly xl: "text-display-xl";
692
+ };
678
693
  };
679
694
  declare const heightVariants: {
680
695
  readonly page: "h-16 leading-[62px]";
681
696
  };
682
- type HeadingSize = keyof typeof sizeVariants;
697
+ type HeadingVariant = keyof typeof variantSizeMap;
698
+ type HeadingSize = keyof (typeof variantSizeMap)["heading"] | "xs";
683
699
  type HeadingHeight = keyof typeof heightVariants;
684
700
  /**
685
701
  * Heading
686
702
  *
687
- * Typography component for page/section headings with size and height options.
703
+ * Typography component for page/section headings.
704
+ *
705
+ * - `variant="heading"` (default) uses the Inter heading scale — for page titles,
706
+ * section titles, card titles, and other product chrome.
707
+ * - `variant="display"` uses the display scale — reserved for brand moments
708
+ * (signup, marketing surfaces) and big-number KPIs.
709
+ *
710
+ * Both variants share the same `sm` / `md` / `lg` / `xl` size scale.
688
711
  */
689
712
  interface HeadingProps {
690
713
  tag?: React__default.ElementType;
714
+ /** Type scale to render in. Defaults to "heading". */
715
+ variant?: HeadingVariant;
716
+ /** Size within the chosen variant's scale. */
691
717
  size?: HeadingSize;
692
718
  height?: HeadingHeight;
693
719
  className?: string;
694
720
  children?: React__default.ReactNode;
695
721
  }
696
- declare function Heading({ tag: Tag, size, height, className, children }: HeadingProps): react_jsx_runtime.JSX.Element;
722
+ declare function Heading({ tag: Tag, variant, size, height, className, children, }: HeadingProps): react_jsx_runtime.JSX.Element;
697
723
 
698
724
  interface LoaderProps {
699
725
  /**
@@ -1599,6 +1625,8 @@ type SegmentOption = {
1599
1625
  label: string;
1600
1626
  icon?: IconName;
1601
1627
  };
1628
+ type SegmentedControlVariant = "primary" | "subtle";
1629
+ type LegacySegmentedControlVariant = "default" | "brand" | "secondary";
1602
1630
  interface SegmentedControlProps {
1603
1631
  /**
1604
1632
  * Array of segment options
@@ -1631,9 +1659,9 @@ interface SegmentedControlProps {
1631
1659
  "aria-label"?: string;
1632
1660
  /**
1633
1661
  * Visual variant of the control
1634
- * @default "default"
1662
+ * @default "subtle"
1635
1663
  */
1636
- variant?: "default" | "brand" | "secondary";
1664
+ variant?: SegmentedControlVariant | LegacySegmentedControlVariant;
1637
1665
  }
1638
1666
  /**
1639
1667
  * SegmentedControl
@@ -1643,13 +1671,20 @@ interface SegmentedControlProps {
1643
1671
  */
1644
1672
  declare function SegmentedControl({ options, value, onChange, size, className, isDisabled, variant, "aria-label": ariaLabel, }: SegmentedControlProps): react_jsx_runtime.JSX.Element;
1645
1673
 
1674
+ type TextLinkVariant = "primary" | "secondary" | "muted" | "unstyled";
1675
+ type LegacyTextLinkVariant = "default" | "brand";
1646
1676
  interface TextLinkProps {
1647
1677
  href?: string;
1648
1678
  children: ReactNode;
1649
1679
  className?: string;
1650
1680
  external?: boolean;
1651
1681
  title?: string;
1652
- variant?: "default" | "brand" | "muted" | "unstyled";
1682
+ /**
1683
+ * Color treatment. Use `primary` for the main action link and `secondary`
1684
+ * for the standard inline/action link. `default` and `brand` are deprecated
1685
+ * aliases for `secondary` and `primary`, respectively.
1686
+ */
1687
+ variant?: TextLinkVariant | LegacyTextLinkVariant;
1653
1688
  onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
1654
1689
  asButton?: boolean;
1655
1690
  onPress?: () => void;
@@ -1860,10 +1895,10 @@ declare function getEntityLabel(entityType: EntityType, plural?: boolean): strin
1860
1895
  * Supports multiple formats and automatically adds the color- prefix if needed
1861
1896
  *
1862
1897
  * @param variableName - CSS variable name in any of these formats:
1863
- * - "brand-primary" → resolves to --color-brand-primary
1864
- * - "color-brand-primary" → resolves to --color-brand-primary
1865
- * - "--color-brand-primary" → used as-is
1866
- * - "var(--color-brand-primary)" → unwrapped and used
1898
+ * - "action-brand" → resolves to --color-action-brand
1899
+ * - "color-action-brand" → resolves to --color-action-brand
1900
+ * - "--color-action-brand" → used as-is
1901
+ * - "var(--color-action-brand)" → unwrapped and used
1867
1902
  * @returns Resolved color value or fallback
1868
1903
  */
1869
1904
  declare const getResolvedColor: (variableName: string, fallback?: string) => string;
@@ -1,2 +1,2 @@
1
- 'use strict';var fo=require('react'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),yt=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var fo__namespace=/*#__PURE__*/_interopNamespace(fo);var yt__namespace=/*#__PURE__*/_interopNamespace(yt);var mt=Object.defineProperty;var gt=(e,o,t)=>o in e?mt(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var Ne=(e,o,t)=>gt(e,typeof o!="symbol"?o+"":o,t);function Le(e,o=false){let[t,r]=fo.useState(o);return fo.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);r(n.matches);let a=s=>{r(s.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),t}function pe(e=true){let[o,t]=fo.useState(null);return fo.useEffect(()=>{if(!e){t(null);return}let r=typeof window<"u"?window.visualViewport:null;if(!r)return;let n=()=>{let a=Math.max(0,window.innerHeight-r.height-(r.offsetTop??0));t({height:r.height,keyboardOffset:a});};return n(),r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n);}},[e]),o}function Ae(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}var Q={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};var te={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},D=fo.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...s})=>{let i=yt__namespace[e];if(!i)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let l=typeof o=="string"&&o in te?te[o]:o,d=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(i,{...s,size:l,color:t,weight:r,className:d,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});D.displayName="Icon";var $e=fo.memo(({variant:e="subtle",shape:o="square",containerSize:t,containerClassName:r,size:n="md",className:a,name:s,color:i,weight:l,ariaLabel:d,ref:f,...c})=>{let g=typeof n=="string"&&n in te?te[n]:n,v=t?typeof t=="string"&&t in te?te[t]:t:g*1.75,b=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",o==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-gray-100 dark:bg-gray-800",e==="solid"&&"bg-brand text-white",e==="outline"&&"border-2 border-current",r);return jsxRuntime.jsx("div",{className:b,style:{width:v,height:v},children:jsxRuntime.jsx(D,{...c,name:s,size:n,color:i,weight:l,className:a,ariaLabel:d})})});$e.displayName="IconWithContainer";var Nt="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",Ct={default:"bg-action-default text-[color:var(--color-action-default-text)] hover:bg-action-default-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",brand:"bg-action-brand text-[color:var(--color-action-brand-text)] hover:bg-action-brand-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",secondary:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-brand hover:text-action-brand/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-body hover:bg-background-hover hover:text-text-heading forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},_e={full:"w-full",default:"w-fit"},Rt="opacity-50 cursor-not-allowed pointer-events-none",Dt="opacity-100 cursor-pointer",kt={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},St={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function Bt(e){return e?e==="primary"?"brand":e:"default"}function It(e){let{variant:o="default",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,s=Bt(o),i=s==="unstyled"?"":`${Nt} ${Ct[s]}`;s!=="unstyled"&&(i+=` ${Q[t].text} ${Q[t].height} ${Q[t].padding} ${Q[t].gap}`),r||a?i+=` ${Rt}`:i+=` ${Dt}`,n?i+=` ${_e.full}`:i+=` ${_e.default}`;let l=s==="brand"?"focus-visible:outline-action-brand":void 0;return [i,Ae(),l].filter(Boolean).join(" ")}function z(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:a,size:s="md",iconPosition:i="left",iconWeight:l,href:d,className:f,badgeNumber:c,badgeVariant:g="primary",badgePosition:v="top-right",style:b,target:C,rel:S,...w}=e,p=o?jsxRuntime.jsx(D,{name:o,size:s,weight:l}):null,y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&p,typeof t=="function"?null:t,i==="right"&&p]}),N=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(D,{name:"CircleNotch",size:s,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:y}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),h=(c??0)>0,P=tailwindMerge.twMerge(It(e),f),O=d?{href:d,target:C,rel:S,...w}:{};if(d){let{onPress:M,onPressStart:I,onPressEnd:ne,onPressChange:_,onPressUp:K,onAuxClick:ae,onContextMenu:Z,onDoubleClick:L,...F}=w;Object.assign(O,F);}let B=d?jsxRuntime.jsx(reactAriaComponents.Link,{...O,...r&&{"aria-busy":true},style:h?void 0:b,className:P,children:r?N:typeof t=="function"?(function(M){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&p,t(M),i==="right"&&p]})}):y}):jsxRuntime.jsx(reactAriaComponents.Button,{...w,...r&&{"aria-busy":true},style:h?void 0:b,className:P,children:r?N:typeof t=="function"?(function(M){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&p,t(M),i==="right"&&p]})}):y});return h?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",f),style:b,children:[B,jsxRuntime.jsx("span",{className:`absolute ${kt[v]} flex h-5 w-5 items-center justify-center rounded-full ${St[g]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):B}function De({action:e,defaultVariant:o,defaultSize:t="lg"}){let r=!!e.formId;return jsxRuntime.jsx(z,{type:r?"submit":"button",form:r?e.formId:void 0,size:e.size||t,variant:e.variant||o,onPress:r?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function j({primaryAction:e,secondaryAction:o,tertiaryAction:t,footerContent:r}){let n=e||o||t;return !n&&!r?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${r?"h-28":""}`,children:[r&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:r}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:t&&jsxRuntime.jsx(De,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(De,{action:o,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(De,{action:e,defaultVariant:"default"})]})]})]})}var Tt={xs:"text-base md:text-lg font-semibold",sm:"text-lg md:text-xl font-semibold",md:"text-xl md:text-2xl font-semibold",lg:"text-2xl md:text-3xl font-semibold",xl:"text-3xl md:text-4xl font-semibold"},Et={page:"h-16 leading-[62px]"};function X({tag:e="h1",size:o="lg",height:t,className:r="",children:n}){let a=Tt[o],s=t?Et[t]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(a,s,r),children:n})}var R=({title:e,onClose:o,hideCloseIcon:t=false,titleAlign:r="left",hasBackArrow:n=false,onBack:a,headerContent:s})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",r==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx(z,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(D,{name:"CaretLeft","data-testid":"back-arrow"})}),s||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(X,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx(z,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(D,{name:"X","data-testid":"close-button"})})]})]});var k=({width:e,height:o,variant:t="rect",animation:r="pulse",gradient:n=false,flex:a=false,stack:s,responsive:i,delay:l=0,adjustAnimationSpeedBasedOnWidth:d=false,ariaLabel:f,className:c,"data-testid":g})=>{let[v,b]=fo.useState(l===0);if(fo.useEffect(()=>{if(l>0){let h=setTimeout(()=>b(true),l);return ()=>clearTimeout(h)}},[l]),!v)return null;let C=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",S=d&&e?(()=>{let h=typeof e=="number"?e:parseFloat(String(e));return isNaN(h)?"":`animation-duration-[${Math.max(.8,h/100)}s]`})():"",w=r==="pulse"?`animate-pulse ${S}`:r==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${S}`:"",p="rounded-sm";t==="circle"&&(p="rounded-full"),t==="text"&&(p="h-4 w-full rounded-sm");let y=a?"flex-1 min-w-0":"",N=i?Object.entries(i).map(([h,P])=>`${h}:w-[${P}]`).join(" "):"";return s?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":g,children:s.map((h,P)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,w,p,y,N,c),style:{width:h,height:o}},P))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,w,p,y,N,c),style:{width:e,height:o},role:"presentation","aria-hidden":!f,"aria-label":f??void 0,"data-testid":g})};var Vt={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},$t="rounded-lg",Be={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Ot={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function V({variant:e="outlined",className:o,children:t,isLoading:r=false,layout:n="default"}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Vt[e],$t,n==="flex"&&"flex flex-col",o),"data-testid":"card",children:r?jsxRuntime.jsx(k,{width:"100%",height:"100%",className:"rounded-none"}):t})}function Ye({title:e,subtitle:o,actions:t,className:r,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(k,{width:120,height:20}),jsxRuntime.jsx(k,{width:24,height:24})]}),o&&jsxRuntime.jsx(k,{width:200,height:16})]}):!e&&!o&&!t?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(X,{tag:"h3",size:"sm",className:"text-text-heading",children:e}):e}),o&&jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:o})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function Ge({src:e,alt:o,aspectRatio:t="auto",className:r,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",Be[t],r),children:jsxRuntime.jsx(k,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Be[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Be[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Ue({className:e,children:o,isLoading:t=false,fill:r=false}){let a=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,r&&"flex-1 flex flex-col min-h-0",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(k,{width:"100%",height:16}),jsxRuntime.jsx(k,{width:"80%",height:16}),jsxRuntime.jsx(k,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",r&&"flex-1 flex flex-col min-h-0",e),children:o}):null}function qe({className:e,children:o,align:t="end",isLoading:r=false}){return r?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(k,{width:80,height:32}),jsxRuntime.jsx(k,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Ot[t],e),children:o}):null}V.Header=Ye;V.Media=Ge;V.Content=Ue;V.Footer=qe;var E=class extends fo.Component{constructor(){super(...arguments);Ne(this,"state",{hasError:false});Ne(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,r){console.error("Error Boundary caught an error:",t,r);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(V,{children:[this.props.title&&jsxRuntime.jsx(V.Header,{title:this.props.title}),jsxRuntime.jsx(V.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-red-500",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};function Y({transparent:e=false,className:o,children:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(o,(n,a)=>tailwindMerge.twMerge("fixed inset-0 z-50","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",e?"bg-transparent":["bg-gradient-to-br from-black/20 via-black/15 to-black/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-black/15"].join(" "),a.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),a.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:t})}var Qt=.3,Xt=.5;function he({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:s,isOpen:i,onClose:l,isDismissable:d=true,transparentOverlay:f=false,primaryAction:c,secondaryAction:g,footerContent:v,maxHeight:b="80vh",height:C,maxWidth:S="640px",contentPadding:w=true,showHandle:p=true,animationVariant:y="scale",className:N}){let[h,P]=fo.useState(false),[O,B]=fo.useState(0),[M,I]=fo.useState(false),ne=pe(i),_=ne?.height??null,K=ne?.keyboardOffset??0,ae=fo.useRef(null),Z=fo.useRef(null),L=fo.useRef(null),F=fo.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});fo.useEffect(()=>{if(i){let m=setTimeout(()=>{P(true),setTimeout(()=>P(false),600);},400);return ()=>clearTimeout(m)}},[i]),fo.useEffect(()=>{i||(B(0),I(false),F.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]),fo.useEffect(()=>{let m=Z.current;if(!m||!i)return;let A=null,ee=le=>{let q=le.target;q&&["INPUT","TEXTAREA","SELECT"].includes(q.tagName)&&(A&&clearTimeout(A),A=setTimeout(()=>{q.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return m.addEventListener("focusin",ee),()=>{m.removeEventListener("focusin",ee),A&&clearTimeout(A);}},[i]);let G=fo.useCallback(m=>{d&&(m.pointerType!=="touch"&&m.pointerType!=="pen"||(L.current&&(clearTimeout(L.current),L.current=null),F.current={isDragging:true,startY:m.clientY,startTime:Date.now(),pointerId:m.pointerId},I(false),m.currentTarget.setPointerCapture(m.pointerId)));},[d]),U=fo.useCallback(m=>{let{isDragging:A,startY:ee,pointerId:le}=F.current;if(!A||m.pointerId!==le)return;let q=m.clientY-ee;B(Math.max(0,q));},[]),ie=fo.useCallback(m=>{let{isDragging:A,startY:ee,startTime:le,pointerId:q}=F.current;if(!A||m.pointerId!==q)return;let we=m.clientY-ee,ut=Date.now()-le,ft=we/ut;F.current={isDragging:false,startY:0,startTime:0,pointerId:null};let pt=(ae.current?.getBoundingClientRect().height??0)*Qt;(we>pt||ft>Xt&&we>50)&&d?(l?.(),B(0)):(I(true),B(0),L.current=setTimeout(()=>{I(false),L.current=null;},200));},[d,l]);if(!i)return null;let Pe=o||t,se=c||g||v;return jsxRuntime.jsx(E,{children:jsxRuntime.jsx(Y,{isOpen:i,onOpenChange:m=>{m||l?.();},isDismissable:d,transparent:f,style:{paddingBottom:K>0?`${K}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:d,children:jsxRuntime.jsx("div",{ref:ae,className:tailwindMerge.twMerge("w-full",M&&"transition-transform duration-200"),style:{transform:O>0?`translateY(${O}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",y==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",y==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",N),style:{maxWidth:S,...C?{height:C}:{maxHeight:/\d/.test(b)?_!==null?`min(${b}, ${Math.max(_-8,0)}px, 100dvh)`:`min(${b}, 100dvh)`:b}},children:[p&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:G,onPointerMove:U,onPointerUp:ie,onPointerCancel:ie,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",h&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Pe&&(a?jsxRuntime.jsx(R,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,hasBackArrow:true,onBack:s??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(R,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{ref:Z,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",w?"p-4":"p-0"),children:e}),se&&jsxRuntime.jsx(j,{primaryAction:c,secondaryAction:g,footerContent:v})]})})})})})}he.displayName="Tray";function He({isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:s=false,onBack:i,children:l,primaryAction:d,secondaryAction:f,tertiaryAction:c,footerContent:g,transparentOverlay:v=false,maxWidth:b="600px",minWidth:C="400px",maxHeight:S="85vh",height:w,mobileMaxHeight:p="90vh",mobileHeight:y,contentPadding:N=true,className:h}){let P=Le("(max-width: 767px)"),O=pe(P&&e===void 0),B=O?.height??null,M=O?.keyboardOffset??0,I=fo.useRef(null),ne=fo.useCallback(()=>{I.current&&I.current.scrollTop!==0&&(I.current.scrollTop=0);},[]),_=fo.useRef(null),K=fo.useRef(null);fo.useEffect(()=>{let G=K.current;if(!G||!P)return;let U=null,ie=Pe=>{let se=Pe.target;se&&["INPUT","TEXTAREA","SELECT"].includes(se.tagName)&&(U&&clearTimeout(U),U=setTimeout(()=>{se.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return G.addEventListener("focusin",ie),()=>{G.removeEventListener("focusin",ie),U&&clearTimeout(U);}},[P]);let ae=fo.useCallback(()=>{_.current&&_.current.scrollTop!==0&&(_.current.scrollTop=0);},[]);if(e===false)return null;let Z=t||r,L=d||f||c||g,F=e!==void 0;return P?F?jsxRuntime.jsx(he,{isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n,hideCloseIcon:a,hasBackArrow:s,onBack:i,primaryAction:d,secondaryAction:f,footerContent:g,transparentOverlay:v,maxHeight:p,height:y,maxWidth:b,contentPadding:N,showHandle:true,animationVariant:"scale",className:h,children:l}):jsxRuntime.jsx(E,{children:jsxRuntime.jsx(Y,{isDismissable:true,transparent:v,style:{paddingBottom:M>0?`${M}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-0 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:I,onScroll:ne,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","rounded-t-xl","overflow-hidden","animate-in slide-in-from-bottom","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:slide-out-to-bottom","data-[exiting]:duration-200 data-[exiting]:ease-in",h),style:{...y?{height:y}:{maxHeight:/\d/.test(p)?B!==null?`min(${p}, ${Math.max(B-8,0)}px, 100dvh)`:`min(${p}, 100dvh)`:p}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),Z&&(s?jsxRuntime.jsx(R,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(R,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,onClose:o||(()=>{})})),jsxRuntime.jsx("div",{ref:K,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",N?"px-6 py-6":"p-0"),children:l}),L&&jsxRuntime.jsx(j,{primaryAction:d,secondaryAction:f,tertiaryAction:c,footerContent:g})]})})})}):jsxRuntime.jsx(E,{children:jsxRuntime.jsx(Y,{...F?{isOpen:e,onOpenChange:G=>{!G&&o&&o();}}:{},isDismissable:true,transparent:v,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",style:{maxWidth:b},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:_,onScroll:ae,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border border-border-default/50","rounded-md","overflow-hidden","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0","animate-in fade-in zoom-in-96 slide-in-from-bottom-2","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-95","data-[exiting]:duration-200 data-[exiting]:ease-in",h),style:{minWidth:C,...w?{height:w}:{maxHeight:S}},children:[Z&&(s?jsxRuntime.jsx(R,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(R,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,onClose:o||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",N?"px-6 py-6":"p-0"),children:l}),L&&jsxRuntime.jsx(j,{primaryAction:d,secondaryAction:f,tertiaryAction:c,footerContent:g})]})})})})}function ue(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Dn({formId:e="dialog-form",onSubmit:o,primaryLabel:t="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:s="secondary",children:i,title:l,...d}){return jsxRuntime.jsx(He,{title:l,primaryAction:{label:t,onPress:()=>{let c=document.getElementById(e);c&&c.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:s}:void 0,...d,children:jsxRuntime.jsx(ue,{id:e,onSubmit:o,children:i})})}function ve({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:s,isOpen:i,slideInFrom:l="right",transparentOverlay:d=false,onClose:f,className:c,primaryAction:g,secondaryAction:v,tertiaryAction:b,footerContent:C,contentPadding:S=true,maxWidth:w="400px"}){if(!i)return null;let p=o||t,y=g||v||b||C;return jsxRuntime.jsx(E,{children:jsxRuntime.jsx(Y,{isOpen:i,onOpenChange:N=>!N&&f?.(),isDismissable:true,transparent:d,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed top-0 bottom-0 flex flex-col bg-background-surface shadow-xl overflow-hidden",l==="right"?"right-0":"left-0",l==="right"?"animate-in slide-in-from-right duration-300 ease-out":"animate-in slide-in-from-left duration-300 ease-out","data-[exiting]:animate-out",l==="right"?"data-[exiting]:slide-out-to-right":"data-[exiting]:slide-out-to-left","data-[exiting]:duration-200 data-[exiting]:ease-in","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",c),style:{maxWidth:w,width:"100%"},children:[p&&(a&&s?jsxRuntime.jsx(R,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,hasBackArrow:true,onBack:s,onClose:f}):jsxRuntime.jsx(R,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,onClose:f})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",S?"px-6 py-6":"p-0"),children:e}),y&&jsxRuntime.jsx(j,{primaryAction:g,secondaryAction:v,tertiaryAction:b,footerContent:C})]})})})})}ve.displayName="Drawer";function On({formId:e="drawer-form",onSubmit:o,primaryLabel:t="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:s="secondary",children:i,...l}){return jsxRuntime.jsx(ve,{primaryAction:{label:t,onPress:()=>{let f=document.getElementById(e);f&&f.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:s}:void 0,...l,children:jsxRuntime.jsx(ue,{id:e,onSubmit:o,className:"mt-2",children:i})})}function Yn({align:e="end",className:o,...t}){return jsxRuntime.jsx("div",{...t,className:tailwindMerge.twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",o)})}var lo={sm:"gap-2",md:"gap-4",lg:"gap-6"};function co(e){if(!e)return "";let o=e.base?`grid-cols-${e.base}`:"",t=e.md?`md:grid-cols-${e.md}`:"",r=e.lg?`lg:grid-cols-${e.lg}`:"";return [o,t,r].filter(Boolean).join(" ")}function Qn({cols:e={base:1},gap:o="lg",className:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",co(e),lo[o],t)})}var po=fo__namespace.default.forwardRef(({children:e,className:o},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",o),children:e}));po.displayName="InputWrapper";function nt({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-caption",Q[e].text,o),children:t})}function sa({title:e,description:o,showDivider:t,className:r,children:n,...a}){return jsxRuntime.jsxs("section",{...a,className:tailwindMerge.twMerge("flex flex-col",r),children:[(e||o)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsxRuntime.jsx(X,{tag:"h3",size:"sm",children:e}):e,o?jsxRuntime.jsx(nt,{size:"lg",children:o}):null]}),jsxRuntime.jsx("div",{className:"flex flex-col gap-6",children:n}),t&&jsxRuntime.jsx("hr",{className:"mt-2 border-border-muted"})]})}function la(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function pa({steps:e,currentStepId:o,onStepClick:t,className:r}){let n=e.findIndex(a=>a.id===o);return jsxRuntime.jsx("nav",{"aria-label":"Progress",className:tailwindMerge.twMerge("w-full",r),children:jsxRuntime.jsx("div",{className:"relative mb-12",children:jsxRuntime.jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,s)=>{let i=a.id===o,l=s<n,d=t&&(l||i);return jsxRuntime.jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsxRuntime.jsx("button",{type:"button",disabled:!d,onClick:()=>d&&t?.(a.id),className:tailwindMerge.twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",l&&"border-action-default bg-action-default text-text-onPrimary hover:bg-action-default/90",i&&"border-action-default bg-background-body text-action-default",!l&&!i&&"border-border-default bg-background-body text-text-muted",d&&"cursor-pointer",!d&&"cursor-default"),"aria-current":i?"step":void 0,children:l?jsxRuntime.jsx(D,{name:"Check",size:20,weight:"bold"}):jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:s+1})}),s<e.length-1&&jsxRuntime.jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:s<n?"var(--color-action-default)":"var(--color-border-default)"}}),jsxRuntime.jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("text-sm font-medium",i&&"text-text-default",l&&"text-text-body",!i&&!l&&"text-text-muted"),children:a.title}),a.description&&jsxRuntime.jsx("span",{className:"mt-1 text-xs text-text-caption",children:a.description})]})]},a.id)})})})})}function xa({formId:e,show:o,isSubmitting:t,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:s}){return o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",s),children:jsxRuntime.jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx(z,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx(z,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function Pa({when:e,message:o="You have unsaved changes. Leave anyway?"}){return fo__namespace.useEffect(()=>{if(!e)return;let t=r=>(r.preventDefault(),r.returnValue=o,o);return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[e,o]),null}function Na({steps:e,initialStepId:o,canNavigate:t}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,n]=fo__namespace.useState(o||e[0].id),a=e.findIndex(c=>c.id===r),s=a>0,i=a<e.length-1,l=async c=>c===r?true:t&&!await t(r,c)?false:(n(c),true);return {steps:e,currentStepId:r,setCurrentStepId:l,next:async()=>!i||a===-1?false:l(e[a+1].id),prev:async()=>!s||a===-1?false:l(e[a-1].id),hasNext:i,hasPrev:s,stepIndex:a}}exports.DialogForm=Dn;exports.DrawerForm=On;exports.FormActions=Yn;exports.FormDivider=la;exports.FormGrid=Qn;exports.FormSection=sa;exports.FormStepper=pa;exports.SaveBar=xa;exports.UnsavedChangesPrompt=Pa;exports.useWizard=Na;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var go=require('react'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),Nt=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var go__namespace=/*#__PURE__*/_interopNamespace(go);var Nt__namespace=/*#__PURE__*/_interopNamespace(Nt);var ht=Object.defineProperty;var xt=(e,t,o)=>t in e?ht(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Re=(e,t,o)=>xt(e,typeof t!="symbol"?t+"":t,o);function ze(e,t=false){let[o,r]=go.useState(t);return go.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);r(n.matches);let a=l=>{r(l.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),o}function me(e=true){let[t,o]=go.useState(null);return go.useEffect(()=>{if(!e){o(null);return}let r=typeof window<"u"?window.visualViewport:null;if(!r)return;let n=()=>{let a=Math.max(0,window.innerHeight-r.height-(r.offsetTop??0));o({height:r.height,keyboardOffset:a});};return n(),r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n);}},[e]),t}function ge(...e){return e.filter(Boolean).join(" ")}var F={displayXl:"text-display-xl",displayLg:"text-display-lg",displayMd:"text-display-md",displaySm:"text-display-sm",headingXl:"text-heading-xl",headingLg:"text-heading-lg",headingMd:"text-heading-md",headingSm:"text-heading-sm",bodyLg:"text-body-lg",bodyMd:"text-body-md",bodySm:"text-body-sm",labelLg:"text-label-lg",labelMd:"text-label-md",labelSm:"text-label-sm",code:"text-code",agent:"text-agent"};function Ve(e,...t){return ge(F[e],...t)}function $e(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}var Q={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};var oe={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},D=go.memo(({name:e,size:t="md",color:o,weight:r="regular",className:n,ariaLabel:a,...l})=>{let i=Nt__namespace[e];if(!i)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let s=typeof t=="string"&&t in oe?oe[t]:t,d=tailwindMerge.twMerge("inline-block flex-shrink-0",!o&&"text-current",n);return jsxRuntime.jsx(i,{...l,size:s,color:o,weight:r,className:d,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});D.displayName="Icon";var We=go.memo(({variant:e="subtle",shape:t="square",containerSize:o,containerClassName:r,size:n="md",className:a,name:l,color:i,weight:s,ariaLabel:d,ref:p,...c})=>{let g=typeof n=="string"&&n in oe?oe[n]:n,v=o?typeof o=="string"&&o in oe?oe[o]:o:g*1.75,b=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",r);return jsxRuntime.jsx("div",{className:b,style:{width:v,height:v},children:jsxRuntime.jsx(D,{...c,name:l,size:n,color:i,weight:s,className:a,ariaLabel:d})})});We.displayName="IconWithContainer";var Dt="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",kt="bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",St={primary:kt,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-action-destructive text-[color:var(--color-action-destructive-text)] hover:bg-action-destructive-hover forced-colors:bg-[Mark] forced-colors:text-[MarkText] border-2 border-transparent",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},Ye={full:"w-full",default:"w-fit"},Bt="opacity-50 cursor-not-allowed pointer-events-none",It="opacity-100 cursor-pointer",Tt={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Ft={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-action-destructive text-[color:var(--color-action-destructive-text)] hover:bg-action-destructive-hover forced-colors:bg-[Mark] forced-colors:text-[MarkText] border-2 border-transparent"};function Mt(e){return !e||e==="default"||e==="brand"?"primary":e}function Et(e){let{variant:t="primary",size:o="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,l=Mt(t),i=l==="unstyled"?"":`${Dt} ${St[l]}`;l!=="unstyled"&&(i+=` ${Q[o].text} ${Q[o].height} ${Q[o].padding} ${Q[o].gap}`),r||a?i+=` ${Bt}`:i+=` ${It}`,n?i+=` ${Ye.full}`:i+=` ${Ye.default}`;let s=l==="primary"?"focus-visible:outline-action-primary":void 0;return [i,$e(),s].filter(Boolean).join(" ")}function V(e){let{icon:t,children:o,isLoading:r=false,loadingText:n,loadingIndicator:a,size:l="md",iconPosition:i="left",iconWeight:s,href:d,className:p,badgeNumber:c,badgeVariant:g="primary",badgePosition:v="top-right",style:b,target:C,rel:S,...w}=e,f=t?jsxRuntime.jsx(D,{name:t,size:l,weight:s}):null,y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&f,typeof o=="function"?null:o,i==="right"&&f]}),N=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(D,{name:"CircleNotch",size:l,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:y}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),h=(c??0)>0,P=tailwindMerge.twMerge(Et(e),p),_=d?{href:d,target:C,rel:S,...w}:{};if(d){let{onPress:L,onPressStart:I,onPressEnd:ae,onPressChange:W,onPressUp:Z,onAuxClick:ie,onContextMenu:ee,onDoubleClick:A,...T}=w;Object.assign(_,T);}let B=d?jsxRuntime.jsx(reactAriaComponents.Link,{..._,...r&&{"aria-busy":true},style:h?void 0:b,className:P,children:r?N:typeof o=="function"?(function(L){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&f,o(L),i==="right"&&f]})}):y}):jsxRuntime.jsx(reactAriaComponents.Button,{...w,...r&&{"aria-busy":true},style:h?void 0:b,className:P,children:r?N:typeof o=="function"?(function(L){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&f,o(L),i==="right"&&f]})}):y});return h?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:b,children:[B,jsxRuntime.jsx("span",{className:`absolute ${Tt[v]} flex h-5 w-5 items-center justify-center rounded-full ${Ft[g]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):B}function Se({action:e,defaultVariant:t,defaultSize:o="lg"}){let r=!!e.formId;return jsxRuntime.jsx(V,{type:r?"submit":"button",form:r?e.formId:void 0,size:e.size||o,variant:e.variant||t,onPress:r?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function Y({primaryAction:e,secondaryAction:t,tertiaryAction:o,footerContent:r}){let n=e||t||o;return !n&&!r?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${r?"h-28":""}`,children:[r&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:r}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:o&&jsxRuntime.jsx(Se,{action:o,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx(Se,{action:t,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(Se,{action:e,defaultVariant:"primary"})]})]})]})}var Ht={heading:{sm:F.headingSm,md:F.headingMd,lg:F.headingLg,xl:F.headingXl},display:{sm:F.displaySm,md:F.displayMd,lg:F.displayLg,xl:F.displayXl}},Lt={page:"h-16 leading-[62px]"};function J({tag:e="h1",variant:t="heading",size:o="lg",height:r,className:n="",children:a}){let l=o==="xs"?"sm":o,i=Ht[t][l],s=r?Lt[r]:"";return jsxRuntime.jsx(e,{className:ge(i,"text-text-primary",s,n),children:a})}var R=({title:e,onClose:t,hideCloseIcon:o=false,titleAlign:r="left",hasBackArrow:n=false,onBack:a,headerContent:l})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",r==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx(V,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(D,{name:"CaretLeft","data-testid":"back-arrow"})}),l||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(J,{size:"xs",children:e}),t&&!o&&jsxRuntime.jsx(V,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(D,{name:"X","data-testid":"close-button"})})]})]});var k=({width:e,height:t,variant:o="rect",animation:r="pulse",gradient:n=false,flex:a=false,stack:l,responsive:i,delay:s=0,adjustAnimationSpeedBasedOnWidth:d=false,ariaLabel:p,className:c,"data-testid":g})=>{let[v,b]=go.useState(s===0);if(go.useEffect(()=>{if(s>0){let h=setTimeout(()=>b(true),s);return ()=>clearTimeout(h)}},[s]),!v)return null;let C=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",S=d&&e?(()=>{let h=typeof e=="number"?e:parseFloat(String(e));return isNaN(h)?"":`animation-duration-[${Math.max(.8,h/100)}s]`})():"",w=r==="pulse"?`animate-pulse ${S}`:r==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${S}`:"",f="rounded-sm";o==="circle"&&(f="rounded-full"),o==="text"&&(f="h-4 w-full rounded-sm");let y=a?"flex-1 min-w-0":"",N=i?Object.entries(i).map(([h,P])=>`${h}:w-[${P}]`).join(" "):"";return l?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":g,children:l.map((h,P)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,w,f,y,N,c),style:{width:h,height:t}},P))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,w,f,y,N,c),style:{width:e,height:t},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":g})};var _t={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},Wt="rounded-lg",Te={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},jt={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function $({variant:e="outlined",className:t,children:o,isLoading:r=false,layout:n="default"}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",_t[e],Wt,n==="flex"&&"flex flex-col",t),"data-testid":"card",children:r?jsxRuntime.jsx(k,{width:"100%",height:"100%",className:"rounded-none"}):o})}function qe({title:e,subtitle:t,actions:o,className:r,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(k,{width:120,height:20}),jsxRuntime.jsx(k,{width:24,height:24})]}),t&&jsxRuntime.jsx(k,{width:200,height:16})]}):!e&&!t&&!o?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(J,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),t&&jsxRuntime.jsx("div",{className:Ve("bodySm","text-text-secondary"),children:t})]}),o&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:o})]})})}function Xe({src:e,alt:t,aspectRatio:o="auto",className:r,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",Te[o],r),children:jsxRuntime.jsx(k,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Te[o],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Te[o],r),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Qe({className:e,children:t,isLoading:o=false,fill:r=false}){let a=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,r&&"flex-1 flex flex-col min-h-0",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(k,{width:"100%",height:16}),jsxRuntime.jsx(k,{width:"80%",height:16}),jsxRuntime.jsx(k,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-primary",r&&"flex-1 flex flex-col min-h-0",e),children:t}):null}function Je({className:e,children:t,align:o="end",isLoading:r=false}){return r?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(k,{width:80,height:32}),jsxRuntime.jsx(k,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",jt[o],e),children:t}):null}$.Header=qe;$.Media=Xe;$.Content=Qe;$.Footer=Je;var E=class extends go.Component{constructor(){super(...arguments);Re(this,"state",{hasError:false});Re(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(o){return {hasError:true,error:o}}componentDidCatch(o,r){console.error("Error Boundary caught an error:",o,r);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs($,{children:[this.props.title&&jsxRuntime.jsx($.Header,{title:this.props.title}),jsxRuntime.jsx($.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};function G({transparent:e=false,className:t,children:o,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(t,(n,a)=>tailwindMerge.twMerge("fixed inset-0 z-50","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",e?"bg-transparent":["bg-gradient-to-br from-background-modal/20 via-background-modal/15 to-background-modal/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-background-modal/15"].join(" "),a.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),a.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:o})}var Kt=.3,Zt=.5;function ve({children:e,title:t,headerContent:o,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:l,isOpen:i,onClose:s,isDismissable:d=true,transparentOverlay:p=false,primaryAction:c,secondaryAction:g,footerContent:v,maxHeight:b="80vh",height:C,maxWidth:S="640px",contentPadding:w=true,showHandle:f=true,animationVariant:y="scale",className:N}){let[h,P]=go.useState(false),[_,B]=go.useState(0),[L,I]=go.useState(false),ae=me(i),W=ae?.height??null,Z=ae?.keyboardOffset??0,ie=go.useRef(null),ee=go.useRef(null),A=go.useRef(null),T=go.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});go.useEffect(()=>{if(i){let m=setTimeout(()=>{P(true),setTimeout(()=>P(false),600);},400);return ()=>clearTimeout(m)}},[i]),go.useEffect(()=>{i||(B(0),I(false),T.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]),go.useEffect(()=>{let m=ee.current;if(!m||!i)return;let z=null,te=de=>{let X=de.target;X&&["INPUT","TEXTAREA","SELECT"].includes(X.tagName)&&(z&&clearTimeout(z),z=setTimeout(()=>{X.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return m.addEventListener("focusin",te),()=>{m.removeEventListener("focusin",te),z&&clearTimeout(z);}},[i]);let U=go.useCallback(m=>{d&&(m.pointerType!=="touch"&&m.pointerType!=="pen"||(A.current&&(clearTimeout(A.current),A.current=null),T.current={isDragging:true,startY:m.clientY,startTime:Date.now(),pointerId:m.pointerId},I(false),m.currentTarget.setPointerCapture(m.pointerId)));},[d]),q=go.useCallback(m=>{let{isDragging:z,startY:te,pointerId:de}=T.current;if(!z||m.pointerId!==de)return;let X=m.clientY-te;B(Math.max(0,X));},[]),se=go.useCallback(m=>{let{isDragging:z,startY:te,startTime:de,pointerId:X}=T.current;if(!z||m.pointerId!==X)return;let Ce=m.clientY-te,mt=Date.now()-de,gt=Ce/mt;T.current={isDragging:false,startY:0,startTime:0,pointerId:null};let bt=(ie.current?.getBoundingClientRect().height??0)*Kt;(Ce>bt||gt>Zt&&Ce>50)&&d?(s?.(),B(0)):(I(true),B(0),A.current=setTimeout(()=>{I(false),A.current=null;},200));},[d,s]);if(!i)return null;let Ne=t||o,le=c||g||v;return jsxRuntime.jsx(E,{children:jsxRuntime.jsx(G,{isOpen:i,onOpenChange:m=>{m||s?.();},isDismissable:d,transparent:p,style:{paddingBottom:Z>0?`${Z}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:d,children:jsxRuntime.jsx("div",{ref:ie,className:tailwindMerge.twMerge("w-full",L&&"transition-transform duration-200"),style:{transform:_>0?`translateY(${_}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",y==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",y==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",N),style:{maxWidth:S,...C?{height:C}:{maxHeight:/\d/.test(b)?W!==null?`min(${b}, ${Math.max(W-8,0)}px, 100dvh)`:`min(${b}, 100dvh)`:b}},children:[f&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:U,onPointerMove:q,onPointerUp:se,onPointerCancel:se,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",h&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Ne&&(a?jsxRuntime.jsx(R,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:n||!s,hasBackArrow:true,onBack:l??(()=>{}),onClose:s||(()=>{})}):jsxRuntime.jsx(R,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:n||!s,onClose:s||(()=>{})})),jsxRuntime.jsx("div",{ref:ee,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",w?"p-4":"p-0"),children:e}),le&&jsxRuntime.jsx(Y,{primaryAction:c,secondaryAction:g,footerContent:v})]})})})})})}ve.displayName="Tray";function Le({isOpen:e,onClose:t,title:o,headerContent:r,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:l=false,onBack:i,children:s,primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:g,transparentOverlay:v=false,maxWidth:b="600px",minWidth:C="400px",maxHeight:S="85vh",height:w,mobileMaxHeight:f="90vh",mobileHeight:y,contentPadding:N=true,className:h}){let P=ze("(max-width: 767px)"),_=me(P&&e===void 0),B=_?.height??null,L=_?.keyboardOffset??0,I=go.useRef(null),ae=go.useCallback(()=>{I.current&&I.current.scrollTop!==0&&(I.current.scrollTop=0);},[]),W=go.useRef(null),Z=go.useRef(null);go.useEffect(()=>{let U=Z.current;if(!U||!P)return;let q=null,se=Ne=>{let le=Ne.target;le&&["INPUT","TEXTAREA","SELECT"].includes(le.tagName)&&(q&&clearTimeout(q),q=setTimeout(()=>{le.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return U.addEventListener("focusin",se),()=>{U.removeEventListener("focusin",se),q&&clearTimeout(q);}},[P]);let ie=go.useCallback(()=>{W.current&&W.current.scrollTop!==0&&(W.current.scrollTop=0);},[]);if(e===false)return null;let ee=o||r,A=d||p||c||g,T=e!==void 0;return P?T?jsxRuntime.jsx(ve,{isOpen:e,onClose:t,title:o,headerContent:r,titleAlign:n,hideCloseIcon:a,hasBackArrow:l,onBack:i,primaryAction:d,secondaryAction:p,footerContent:g,transparentOverlay:v,maxHeight:f,height:y,maxWidth:b,contentPadding:N,showHandle:true,animationVariant:"scale",className:h,children:s}):jsxRuntime.jsx(E,{children:jsxRuntime.jsx(G,{isDismissable:true,transparent:v,style:{paddingBottom:L>0?`${L}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-0 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:I,onScroll:ae,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","rounded-t-xl","overflow-hidden","animate-in slide-in-from-bottom","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:slide-out-to-bottom","data-[exiting]:duration-200 data-[exiting]:ease-in",h),style:{...y?{height:y}:{maxHeight:/\d/.test(f)?B!==null?`min(${f}, ${Math.max(B-8,0)}px, 100dvh)`:`min(${f}, 100dvh)`:f}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),ee&&(l?jsxRuntime.jsx(R,{title:o,headerContent:r,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(R,{title:o,headerContent:r,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{ref:Z,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",N?"px-6 py-6":"p-0"),children:s}),A&&jsxRuntime.jsx(Y,{primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:g})]})})})}):jsxRuntime.jsx(E,{children:jsxRuntime.jsx(G,{...T?{isOpen:e,onOpenChange:U=>{!U&&t&&t();}}:{},isDismissable:true,transparent:v,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",style:{maxWidth:b},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:W,onScroll:ie,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border border-border-default/50","rounded-md","overflow-hidden","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0","animate-in fade-in zoom-in-96 slide-in-from-bottom-2","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-95","data-[exiting]:duration-200 data-[exiting]:ease-in",h),style:{minWidth:C,...w?{height:w}:{maxHeight:S}},children:[ee&&(l?jsxRuntime.jsx(R,{title:o,headerContent:r,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(R,{title:o,headerContent:r,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",N?"px-6 py-6":"p-0"),children:s}),A&&jsxRuntime.jsx(Y,{primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:g})]})})})})}function pe(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Hn({formId:e="dialog-form",onSubmit:t,primaryLabel:o="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:l="secondary",children:i,title:s,...d}){return jsxRuntime.jsx(Le,{title:s,primaryAction:{label:o,onPress:()=>{let c=document.getElementById(e);c&&c.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:l}:void 0,...d,children:jsxRuntime.jsx(pe,{id:e,onSubmit:t,children:i})})}function Pe({children:e,title:t,headerContent:o,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:l,isOpen:i,slideInFrom:s="right",transparentOverlay:d=false,onClose:p,className:c,primaryAction:g,secondaryAction:v,tertiaryAction:b,footerContent:C,contentPadding:S=true,maxWidth:w="400px"}){if(!i)return null;let f=t||o,y=g||v||b||C;return jsxRuntime.jsx(E,{children:jsxRuntime.jsx(G,{isOpen:i,onOpenChange:N=>!N&&p?.(),isDismissable:true,transparent:d,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed top-0 bottom-0 flex flex-col bg-background-surface shadow-xl overflow-hidden",s==="right"?"right-0":"left-0",s==="right"?"animate-in slide-in-from-right duration-300 ease-out":"animate-in slide-in-from-left duration-300 ease-out","data-[exiting]:animate-out",s==="right"?"data-[exiting]:slide-out-to-right":"data-[exiting]:slide-out-to-left","data-[exiting]:duration-200 data-[exiting]:ease-in","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",c),style:{maxWidth:w,width:"100%"},children:[f&&(a&&l?jsxRuntime.jsx(R,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:n,hasBackArrow:true,onBack:l,onClose:p}):jsxRuntime.jsx(R,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:n,onClose:p})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",S?"px-6 py-6":"p-0"),children:e}),y&&jsxRuntime.jsx(Y,{primaryAction:g,secondaryAction:v,tertiaryAction:b,footerContent:C})]})})})})}Pe.displayName="Drawer";function Qn({formId:e="drawer-form",onSubmit:t,primaryLabel:o="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:l="secondary",children:i,...s}){return jsxRuntime.jsx(Pe,{primaryAction:{label:o,onPress:()=>{let p=document.getElementById(e);p&&p.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:l}:void 0,...s,children:jsxRuntime.jsx(pe,{id:e,onSubmit:t,className:"mt-2",children:i})})}function ea({align:e="end",className:t,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",t)})}var po={sm:"gap-2",md:"gap-4",lg:"gap-6"};function fo(e){if(!e)return "";let t=e.base?`grid-cols-${e.base}`:"",o=e.md?`md:grid-cols-${e.md}`:"",r=e.lg?`lg:grid-cols-${e.lg}`:"";return [t,o,r].filter(Boolean).join(" ")}function na({cols:e={base:1},gap:t="lg",className:o,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",fo(e),po[t],o)})}var bo=go__namespace.default.forwardRef(({children:e,className:t},o)=>jsxRuntime.jsx("div",{ref:o,className:tailwindMerge.twMerge("relative w-full",t),children:e}));bo.displayName="InputWrapper";function st({size:e="md",className:t,children:o,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",Q[e].text,t),children:o})}function ba({title:e,description:t,showDivider:o,className:r,children:n,...a}){return jsxRuntime.jsxs("section",{...a,className:tailwindMerge.twMerge("flex flex-col",r),children:[(e||t)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsxRuntime.jsx(J,{tag:"h3",size:"sm",children:e}):e,t?jsxRuntime.jsx(st,{size:"lg",children:t}):null]}),jsxRuntime.jsx("div",{className:"flex flex-col gap-6",children:n}),o&&jsxRuntime.jsx("hr",{className:"mt-2 border-border-muted"})]})}function ha(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function wa({steps:e,currentStepId:t,onStepClick:o,className:r}){let n=e.findIndex(a=>a.id===t);return jsxRuntime.jsx("nav",{"aria-label":"Progress",className:tailwindMerge.twMerge("w-full",r),children:jsxRuntime.jsx("div",{className:"relative mb-12",children:jsxRuntime.jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,l)=>{let i=a.id===t,s=l<n,d=o&&(s||i);return jsxRuntime.jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsxRuntime.jsx("button",{type:"button",disabled:!d,onClick:()=>d&&o?.(a.id),className:tailwindMerge.twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",s&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",i&&"border-action-primary bg-background-body text-action-primary",!s&&!i&&"border-border-default bg-background-body text-text-secondary",d&&"cursor-pointer",!d&&"cursor-default"),"aria-current":i?"step":void 0,children:s?jsxRuntime.jsx(D,{name:"Check",size:20,weight:"bold"}):jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:l+1})}),l<e.length-1&&jsxRuntime.jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:l<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxRuntime.jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("text-sm font-medium",i&&"text-text-default",s&&"text-text-primary",!i&&!s&&"text-text-secondary"),children:a.title}),a.description&&jsxRuntime.jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function ka({formId:e,show:t,isSubmitting:o,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:l}){return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",l),children:jsxRuntime.jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsxRuntime.jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx(V,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx(V,{type:"submit",form:e,isDisabled:!!o,children:o?"Saving...":n})]})]})}):null}function Ia({when:e,message:t="You have unsaved changes. Leave anyway?"}){return go__namespace.useEffect(()=>{if(!e)return;let o=r=>(r.preventDefault(),r.returnValue=t,t);return window.addEventListener("beforeunload",o),()=>window.removeEventListener("beforeunload",o)},[e,t]),null}function Fa({steps:e,initialStepId:t,canNavigate:o}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,n]=go__namespace.useState(t||e[0].id),a=e.findIndex(c=>c.id===r),l=a>0,i=a<e.length-1,s=async c=>c===r?true:o&&!await o(r,c)?false:(n(c),true);return {steps:e,currentStepId:r,setCurrentStepId:s,next:async()=>!i||a===-1?false:s(e[a+1].id),prev:async()=>!l||a===-1?false:s(e[a-1].id),hasNext:i,hasPrev:l,stepIndex:a}}exports.DialogForm=Hn;exports.DrawerForm=Qn;exports.FormActions=ea;exports.FormDivider=ha;exports.FormGrid=na;exports.FormSection=ba;exports.FormStepper=wa;exports.SaveBar=ka;exports.UnsavedChangesPrompt=Ia;exports.useWizard=Fa;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map