@texturehq/edges 1.26.6 → 1.26.7

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.
@@ -508,6 +508,11 @@ interface AvatarProps {
508
508
  * @default false
509
509
  */
510
510
  bordered?: boolean;
511
+ /**
512
+ * Entity identifier for PII masking (e.g., "contact:ctc_abc123")
513
+ * When provided, adds data-pii-* attributes for the Curtain extension
514
+ */
515
+ piiEntity?: string;
511
516
  }
512
517
  /**
513
518
  * Avatar
@@ -515,7 +520,7 @@ interface AvatarProps {
515
520
  * Display user, team, or organization avatars with support for images,
516
521
  * initials, and fallback icons. Includes optional status indicators.
517
522
  */
518
- declare function Avatar({ src, alt, firstName, lastName, fullName, onClick, size, shape, variant, className, status, bordered, }: AvatarProps): react_jsx_runtime.JSX.Element;
523
+ declare function Avatar({ src, alt, firstName, lastName, fullName, onClick, size, shape, variant, className, status, bordered, piiEntity, }: AvatarProps): react_jsx_runtime.JSX.Element;
519
524
 
520
525
  type DeviceState = "unknown" | "on" | "off" | "idle" | "charging" | "discharging" | "heat" | "eco" | "cool" | "auto";
521
526
  type MetricFormat = "percentage" | "kW" | "temperature";
@@ -1602,6 +1607,9 @@ interface TextLinkProps {
1602
1607
  * @example LinkComponent={Link} (where Link is from 'next/link')
1603
1608
  */
1604
1609
  LinkComponent?: ComponentType<any>;
1610
+ /** Data attributes for PII masking support */
1611
+ "data-pii-type"?: string;
1612
+ "data-pii-entity"?: string;
1605
1613
  }
1606
1614
  /**
1607
1615
  * TextLink
@@ -1611,7 +1619,7 @@ interface TextLinkProps {
1611
1619
  *
1612
1620
  * @param LinkComponent - Optional custom Link component (e.g., Next.js Link) for client-side navigation
1613
1621
  */
1614
- declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, alwaysUnderlined, LinkComponent, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
1622
+ declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, alwaysUnderlined, LinkComponent, "data-pii-type": dataPiiType, "data-pii-entity": dataPiiEntity, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
1615
1623
 
1616
1624
  /**
1617
1625
  * Entity Configuration
@@ -508,6 +508,11 @@ interface AvatarProps {
508
508
  * @default false
509
509
  */
510
510
  bordered?: boolean;
511
+ /**
512
+ * Entity identifier for PII masking (e.g., "contact:ctc_abc123")
513
+ * When provided, adds data-pii-* attributes for the Curtain extension
514
+ */
515
+ piiEntity?: string;
511
516
  }
512
517
  /**
513
518
  * Avatar
@@ -515,7 +520,7 @@ interface AvatarProps {
515
520
  * Display user, team, or organization avatars with support for images,
516
521
  * initials, and fallback icons. Includes optional status indicators.
517
522
  */
518
- declare function Avatar({ src, alt, firstName, lastName, fullName, onClick, size, shape, variant, className, status, bordered, }: AvatarProps): react_jsx_runtime.JSX.Element;
523
+ declare function Avatar({ src, alt, firstName, lastName, fullName, onClick, size, shape, variant, className, status, bordered, piiEntity, }: AvatarProps): react_jsx_runtime.JSX.Element;
519
524
 
520
525
  type DeviceState = "unknown" | "on" | "off" | "idle" | "charging" | "discharging" | "heat" | "eco" | "cool" | "auto";
521
526
  type MetricFormat = "percentage" | "kW" | "temperature";
@@ -1602,6 +1607,9 @@ interface TextLinkProps {
1602
1607
  * @example LinkComponent={Link} (where Link is from 'next/link')
1603
1608
  */
1604
1609
  LinkComponent?: ComponentType<any>;
1610
+ /** Data attributes for PII masking support */
1611
+ "data-pii-type"?: string;
1612
+ "data-pii-entity"?: string;
1605
1613
  }
1606
1614
  /**
1607
1615
  * TextLink
@@ -1611,7 +1619,7 @@ interface TextLinkProps {
1611
1619
  *
1612
1620
  * @param LinkComponent - Optional custom Link component (e.g., Next.js Link) for client-side navigation
1613
1621
  */
1614
- declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, alwaysUnderlined, LinkComponent, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
1622
+ declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, alwaysUnderlined, LinkComponent, "data-pii-type": dataPiiType, "data-pii-entity": dataPiiEntity, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
1615
1623
 
1616
1624
  /**
1617
1625
  * Entity Configuration
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.26.6",
2
+ "version": "1.26.7",
3
3
  "components": [
4
4
  {
5
5
  "name": "ActionCell",
@@ -391,7 +391,7 @@
391
391
  {
392
392
  "name": "Card",
393
393
  "category": "Layout",
394
- "description": "Card - Enterprise surface container component A flexible, composable card component following enterprise design system best practices. Supports modular content sections with consistent styling and accessibility. Usage: ```tsx <Card variant=\"outlined\" size=\"md\"> <Card.Header title=\"Card Title\" subtitle=\"Optional subtitle\" actions={<Button variant=\"ghost\" icon=\"MoreHorizontal\" />} /> <Card.Media src=\"image.jpg\" alt=\"Description\" /> <Card.Content> <p>Main content goes here</p> </Card.Content> <Card.Footer> <Button variant=\"brand\">Action</Button> </Card.Footer> </Card> ```",
394
+ "description": "When true and parent Card has layout=\"flex\", content expands to fill available space",
395
395
  "importRoot": "@texturehq/edges",
396
396
  "importPath": "@texturehq/edges/components/Card",
397
397
  "props": [
@@ -424,7 +424,7 @@
424
424
  {
425
425
  "name": "CardContent",
426
426
  "category": "Layout",
427
- "description": "Card - Enterprise surface container component A flexible, composable card component following enterprise design system best practices. Supports modular content sections with consistent styling and accessibility. Usage: ```tsx <Card variant=\"outlined\" size=\"md\"> <Card.Header title=\"Card Title\" subtitle=\"Optional subtitle\" actions={<Button variant=\"ghost\" icon=\"MoreHorizontal\" />} /> <Card.Media src=\"image.jpg\" alt=\"Description\" /> <Card.Content> <p>Main content goes here</p> </Card.Content> <Card.Footer> <Button variant=\"brand\">Action</Button> </Card.Footer> </Card> ```",
427
+ "description": "When true and parent Card has layout=\"flex\", content expands to fill available space",
428
428
  "importRoot": "@texturehq/edges",
429
429
  "importPath": "@texturehq/edges/components/CardContent",
430
430
  "props": [
@@ -453,7 +453,7 @@
453
453
  {
454
454
  "name": "CardFooter",
455
455
  "category": "Layout",
456
- "description": "Card - Enterprise surface container component A flexible, composable card component following enterprise design system best practices. Supports modular content sections with consistent styling and accessibility. Usage: ```tsx <Card variant=\"outlined\" size=\"md\"> <Card.Header title=\"Card Title\" subtitle=\"Optional subtitle\" actions={<Button variant=\"ghost\" icon=\"MoreHorizontal\" />} /> <Card.Media src=\"image.jpg\" alt=\"Description\" /> <Card.Content> <p>Main content goes here</p> </Card.Content> <Card.Footer> <Button variant=\"brand\">Action</Button> </Card.Footer> </Card> ```",
456
+ "description": "When true and parent Card has layout=\"flex\", content expands to fill available space",
457
457
  "importRoot": "@texturehq/edges",
458
458
  "importPath": "@texturehq/edges/components/CardFooter",
459
459
  "props": [
@@ -486,7 +486,7 @@
486
486
  {
487
487
  "name": "CardHeader",
488
488
  "category": "Layout",
489
- "description": "Card - Enterprise surface container component A flexible, composable card component following enterprise design system best practices. Supports modular content sections with consistent styling and accessibility. Usage: ```tsx <Card variant=\"outlined\" size=\"md\"> <Card.Header title=\"Card Title\" subtitle=\"Optional subtitle\" actions={<Button variant=\"ghost\" icon=\"MoreHorizontal\" />} /> <Card.Media src=\"image.jpg\" alt=\"Description\" /> <Card.Content> <p>Main content goes here</p> </Card.Content> <Card.Footer> <Button variant=\"brand\">Action</Button> </Card.Footer> </Card> ```",
489
+ "description": "When true and parent Card has layout=\"flex\", content expands to fill available space",
490
490
  "importRoot": "@texturehq/edges",
491
491
  "importPath": "@texturehq/edges/components/CardHeader",
492
492
  "props": [
@@ -523,7 +523,7 @@
523
523
  {
524
524
  "name": "CardMedia",
525
525
  "category": "Layout",
526
- "description": "Card - Enterprise surface container component A flexible, composable card component following enterprise design system best practices. Supports modular content sections with consistent styling and accessibility. Usage: ```tsx <Card variant=\"outlined\" size=\"md\"> <Card.Header title=\"Card Title\" subtitle=\"Optional subtitle\" actions={<Button variant=\"ghost\" icon=\"MoreHorizontal\" />} /> <Card.Media src=\"image.jpg\" alt=\"Description\" /> <Card.Content> <p>Main content goes here</p> </Card.Content> <Card.Footer> <Button variant=\"brand\">Action</Button> </Card.Footer> </Card> ```",
526
+ "description": "When true and parent Card has layout=\"flex\", content expands to fill available space",
527
527
  "importRoot": "@texturehq/edges",
528
528
  "importPath": "@texturehq/edges/components/CardMedia",
529
529
  "props": [
@@ -2384,7 +2384,7 @@
2384
2384
  {
2385
2385
  "name": "StatList",
2386
2386
  "category": "Data",
2387
- "description": "Additional CSS classes */ className?: string; } // Helpers // Use the centralized formatting utility function formatValue(value: StatValue, formatter?: StatFormatter): React.ReactNode { // If value is already a React element, return it as-is (skip formatting) if (React.isValidElement(value)) { return value; } return formatComponentValue({ value, formatter, emptyClassName: \"text-text-muted\", emptyText: \"—\", }); } function getTone(item: StatItem): StatTone | undefined { // Check thresholds first if (item.thresholds && item.value !== null && item.value !== undefined) { for (const threshold of item.thresholds) { if (threshold.when(item.value)) { return threshold.tone; } } } // Fall back to explicit tone return item.tone; } const toneColors: Record<StatTone, string> = { neutral: \"text-text-body\", success: \"text-feedback-success\", warning: \"text-feedback-warning\", error: \"text-feedback-error\", info: \"text-feedback-info\", }; // StatRow Component // Constants for auto-truncation const LONG_STRING_THRESHOLD = 24; const LONG_STRING_TRUNCATE_LENGTH = 20; function StatRow({ item, dense, valueAlign, }: { item: StatItem; dense?: boolean; valueAlign?: StatAlign; }) { const tone = getTone(item); const toneClass = tone ? toneColors[tone] : \"\"; const isStacked = item.stackOnMobile; // Check if this is a long string that should be auto-truncated on mobile const isLongString = typeof item.value === \"string\" && item.value.length > LONG_STRING_THRESHOLD && !item.formatter && !React.isValidElement(item.value); // Get the formatted value (used for both truncated and full display) const formattedValue = formatValue(item.value, item.formatter); // Get the truncated value for mobile display // Note: We cast to string here because isLongString already verifies typeof item.value === \"string\" const truncatedValue = isLongString ? truncateMiddle(item.value as string, LONG_STRING_TRUNCATE_LENGTH) : null; const textToCopy = typeof item.copyable === \"function\" ? item.copyable(item.value) : String(item.value); // For long strings, render both truncated (mobile) and full (desktop) versions // CSS classes control which is visible based on screen size const valueDisplay = isLongString ? ( <> {/* Mobile: show truncated with tooltip */} <Tooltip content={String(item.value)}> <span className={twMerge(\"md:hidden\", item.href ? \"hover:underline cursor-pointer\" : \"\")}> {truncatedValue} </span> </Tooltip> {/* Desktop: show full value",
2387
+ "description": "Additional CSS classes */ className?: string; } // Helpers // Use the centralized formatting utility function formatValue(value: StatValue, formatter?: StatFormatter): React.ReactNode { // If value is already a React element, return it as-is (skip formatting) if (React.isValidElement(value)) { return value; } return formatComponentValue({ value, formatter, emptyClassName: \"text-text-muted\", emptyText: \"—\", }); } function getTone(item: StatItem): StatTone | undefined { // Check thresholds first if (item.thresholds && item.value !== null && item.value !== undefined) { for (const threshold of item.thresholds) { if (threshold.when(item.value)) { return threshold.tone; } } } // Fall back to explicit tone return item.tone; } const toneColors: Record<StatTone, string> = { neutral: \"text-text-body\", success: \"text-feedback-success\", warning: \"text-feedback-warning\", error: \"text-feedback-error\", info: \"text-feedback-info\", }; // StatRow Component // Constants for auto-truncation const LONG_STRING_THRESHOLD = 24; const LONG_STRING_TRUNCATE_LENGTH = 20; function StatRow({ item, dense, valueAlign, }: { item: StatItem; dense?: boolean; valueAlign?: StatAlign; }) { const tone = getTone(item); const toneClass = tone ? toneColors[tone] : \"\"; const isStacked = item.stackOnMobile; // Check if this is a long string that should be auto-truncated on mobile const isLongString = typeof item.value === \"string\" && item.value.length > LONG_STRING_THRESHOLD && !item.formatter && !React.isValidElement(item.value); // Get the formatted value (used for both truncated and full display) const formattedValue = formatValue(item.value, item.formatter); // Get the truncated value for mobile display // Note: We cast to string here because isLongString already verifies typeof item.value === \"string\" const truncatedValue = isLongString ? truncateMiddle(item.value as string, LONG_STRING_TRUNCATE_LENGTH) : null; const textToCopy = typeof item.copyable === \"function\" ? item.copyable(item.value) : String(item.value); // PII data attributes (only set if both piiType and piiEntity are provided) const piiAttrs = item.piiType && item.piiEntity ? { \"data-pii-type\": item.piiType, \"data-pii-entity\": item.piiEntity, } : {}; // For long strings, render both truncated (mobile) and full (desktop) versions // CSS classes control which is visible based on screen size // Tooltip content is wrapped in span with PII attributes to allow masking by Curtain extension const hasPiiAttrs = Object.keys(piiAttrs).length > 0; const valueDisplay = isLongString ? ( <> {/* Mobile: show truncated with tooltip */} <Tooltip content={hasPiiAttrs ? <span {...piiAttrs}>{String(item.value)}</span> : String(item.value)} > <span className={twMerge(\"md:hidden\", item.href ? \"hover:underline cursor-pointer\" : \"\")} {...piiAttrs} > {truncatedValue} </span> </Tooltip> {/* Desktop: show full value",
2388
2388
  "importRoot": "@texturehq/edges",
2389
2389
  "importPath": "@texturehq/edges/components/StatList",
2390
2390
  "props": [],
@@ -1,2 +1,2 @@
1
- 'use strict';var reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),ro=require('react'),ut=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 ro__namespace=/*#__PURE__*/_interopNamespace(ro);var ut__namespace=/*#__PURE__*/_interopNamespace(ut);var st=Object.defineProperty;var lt=(e,o,t)=>o in e?st(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var me=(e,o,t)=>lt(e,typeof o!="symbol"?o+"":o,t);function Se(e,o=false){let[t,r]=ro.useState(o);return ro.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 Be(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 O={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 U={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},R=ro.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...s})=>{let i=ut__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 U?U[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}`})});R.displayName="Icon";var Me=ro.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:p,...c})=>{let g=typeof n=="string"&&n in U?U[n]:n,h=t?typeof t=="string"&&t in U?U[t]:t:g*1.75,v=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:v,style:{width:h,height:h},children:jsxRuntime.jsx(R,{...c,name:s,size:n,color:i,weight:l,className:a,ariaLabel:d})})});Me.displayName="IconWithContainer";var mt="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",gt={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"},Ee={full:"w-full",default:"w-fit"},bt="opacity-50 cursor-not-allowed pointer-events-none",ht="opacity-100 cursor-pointer",xt={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},vt={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function yt(e){return e?e==="primary"?"brand":e:"default"}function Pt(e){let{variant:o="default",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,s=yt(o),i=s==="unstyled"?"":`${mt} ${gt[s]}`;s!=="unstyled"&&(i+=` ${O[t].text} ${O[t].height} ${O[t].padding} ${O[t].gap}`),r||a?i+=` ${bt}`:i+=` ${ht}`,n?i+=` ${Ee.full}`:i+=` ${Ee.default}`;let l=s==="brand"?"focus-visible:outline-action-brand":void 0;return [i,Be(),l].filter(Boolean).join(" ")}function H(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:a,size:s="md",iconPosition:i="left",iconWeight:l,href:d,className:p,badgeNumber:c,badgeVariant:g="primary",badgePosition:h="top-right",style:v,target:D,rel:S,...P}=e,m=o?jsxRuntime.jsx(R,{name:o,size:s,weight:l}):null,y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof t=="function"?null:t,i==="right"&&m]}),w=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(R,{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})]}),f=(c??0)>0,N=tailwindMerge.twMerge(Pt(e),p),L=d?{href:d,target:D,rel:S,...P}:{};if(d){let{onPress:$,onPressStart:W,onPressEnd:ie,onPressChange:Y,onPressUp:G,onAuxClick:Re,onContextMenu:ke,onDoubleClick:se,...le}=P;Object.assign(L,le);}let B=d?jsxRuntime.jsx(reactAriaComponents.Link,{...L,...r&&{"aria-busy":true},style:f?void 0:v,className:N,children:r?w:typeof t=="function"?(function($){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t($),i==="right"&&m]})}):y}):jsxRuntime.jsx(reactAriaComponents.Button,{...P,...r&&{"aria-busy":true},style:f?void 0:v,className:N,children:r?w:typeof t=="function"?(function($){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t($),i==="right"&&m]})}):y});return f?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:v,children:[B,jsxRuntime.jsx("span",{className:`absolute ${xt[h]} flex h-5 w-5 items-center justify-center rounded-full ${vt[g]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):B}function he({action:e,defaultVariant:o,defaultSize:t="lg"}){let r=!!e.formId;return jsxRuntime.jsx(H,{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 z({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(he,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(he,{action:o,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(he,{action:e,defaultVariant:"default"})]})]})]})}var Nt={xs:"text-lg font-semibold",sm:"text-xl font-semibold",md:"text-2xl font-semibold",lg:"text-3xl font-semibold",xl:"text-4xl font-semibold"},Ct={page:"h-16 leading-[62px]"};function V({tag:e="h1",size:o="lg",height:t,className:r="",children:n}){let a=Nt[o],s=t?Ct[t]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(a,s,r),children:n})}var C=({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(H,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(R,{name:"CaretLeft","data-testid":"back-arrow"})}),s||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(V,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx(H,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(R,{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:p,className:c,"data-testid":g})=>{let[h,v]=ro.useState(l===0);if(ro.useEffect(()=>{if(l>0){let f=setTimeout(()=>v(true),l);return ()=>clearTimeout(f)}},[l]),!h)return null;let D=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 f=typeof e=="number"?e:parseFloat(String(e));return isNaN(f)?"":`animation-duration-[${Math.max(.8,f/100)}s]`})():"",P=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}`:"",m="rounded-sm";t==="circle"&&(m="rounded-full"),t==="text"&&(m="h-4 w-full rounded-sm");let y=a?"flex-1 min-w-0":"",w=i?Object.entries(i).map(([f,N])=>`${f}:w-[${N}]`).join(" "):"";return s?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":g,children:s.map((f,N)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(D,P,m,y,w,c),style:{width:f,height:o}},N))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(D,P,m,y,w,c),style:{width:e,height:o},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":g})};var It={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"},Ft="rounded-lg",ye={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Mt={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function E({variant:e="outlined",className:o,children:t,isLoading:r=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",It[e],Ft,o),"data-testid":"card",children:r?jsxRuntime.jsx(k,{width:"100%",height:"100%",className:"rounded-none"}):t})}function Ae({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(V,{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 ze({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",ye[t],r),children:jsxRuntime.jsx(k,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",ye[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",ye[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function _e({className:e,children:o,isLoading:t=false}){let n=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(n,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",e),children:o}):null}function $e({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",Mt[t],e),children:o}):null}E.Header=Ae;E.Media=ze;E.Content=_e;E.Footer=$e;var F=class extends ro.Component{constructor(){super(...arguments);me(this,"state",{hasError:false});me(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(E,{children:[this.props.title&&jsxRuntime.jsx(E.Header,{title:this.props.title}),jsxRuntime.jsx(E.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 _({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 $t=.3,Wt=.5;function oe({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:p=false,primaryAction:c,secondaryAction:g,footerContent:h,maxHeight:v="80vh",height:D,maxWidth:S="640px",contentPadding:P=true,showHandle:m=true,animationVariant:y="scale",className:w}){let[f,N]=ro.useState(false),[L,B]=ro.useState(0),[$,W]=ro.useState(false),ie=ro.useRef(null),Y=ro.useRef(null),G=ro.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});ro.useEffect(()=>{if(i){let x=setTimeout(()=>{N(true),setTimeout(()=>N(false),600);},400);return ()=>clearTimeout(x)}},[i]),ro.useEffect(()=>{i||(B(0),W(false),G.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]);let Re=ro.useCallback(x=>{d&&(x.pointerType!=="touch"&&x.pointerType!=="pen"||(Y.current&&(clearTimeout(Y.current),Y.current=null),G.current={isDragging:true,startY:x.clientY,startTime:Date.now(),pointerId:x.pointerId},W(false),x.currentTarget.setPointerCapture(x.pointerId)));},[d]),ke=ro.useCallback(x=>{let{isDragging:de,startY:ce,pointerId:ue}=G.current;if(!de||x.pointerId!==ue)return;let pe=x.clientY-ce;B(Math.max(0,pe));},[]),se=ro.useCallback(x=>{let{isDragging:de,startY:ce,startTime:ue,pointerId:pe}=G.current;if(!de||x.pointerId!==pe)return;let fe=x.clientY-ce,nt=Date.now()-ue,at=fe/nt;G.current={isDragging:false,startY:0,startTime:0,pointerId:null};let it=(ie.current?.getBoundingClientRect().height??0)*$t;(fe>it||at>Wt&&fe>50)&&d?(l?.(),B(0)):(W(true),B(0),Y.current=setTimeout(()=>{W(false),Y.current=null;},200));},[d,l]);if(!i)return null;let le=o||t,rt=c||g||h;return jsxRuntime.jsx(F,{children:jsxRuntime.jsx(_,{isOpen:i,onOpenChange:x=>{x||l?.();},isDismissable:d,transparent:p,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",$&&"transition-transform duration-200"),style:{transform:L>0?`translateY(${L}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)]",w),style:{maxWidth:S,...D?{height:D}:{maxHeight:v}},children:[m&&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:Re,onPointerMove:ke,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",f&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),le&&(a?jsxRuntime.jsx(C,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,hasBackArrow:true,onBack:s??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(C,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",P?"p-4":"p-0"),children:e}),rt&&jsxRuntime.jsx(z,{primaryAction:c,secondaryAction:g,footerContent:h})]})})})})})}oe.displayName="Tray";function Ce({isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:s=false,onBack:i,children:l,primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:g,transparentOverlay:h=false,maxWidth:v="600px",minWidth:D="400px",maxHeight:S="85vh",height:P,mobileMaxHeight:m="90vh",mobileHeight:y,contentPadding:w=true,className:f}){if(e===false)return null;let N=t||r,L=d||p||c||g,B=e!==void 0;return Se("(max-width: 767px)")?B?jsxRuntime.jsx(oe,{isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n,hideCloseIcon:a,hasBackArrow:s,onBack:i,primaryAction:d,secondaryAction:p,footerContent:g,transparentOverlay:h,maxHeight:m,height:y,maxWidth:v,contentPadding:w,showHandle:true,animationVariant:"scale",className:f,children:l}):jsxRuntime.jsx(F,{children:jsxRuntime.jsx(_,{isDismissable:true,transparent:h,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,{className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface dark:bg-gray-800","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","max-h-[90vh]","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",f),style:{...y?{height:y}:{maxHeight:m}},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"})}),N&&(s?jsxRuntime.jsx(C,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(C,{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 overscroll-contain",w?"px-6 py-6":"p-0"),children:l}),L&&jsxRuntime.jsx(z,{primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:g})]})})})}):jsxRuntime.jsx(F,{children:jsxRuntime.jsx(_,{...B?{isOpen:e,onOpenChange:W=>{!W&&o&&o();}}:{},isDismissable:true,transparent:h,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:v},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface dark:bg-gray-800","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",f),style:{minWidth:D,...P?{height:P}:{maxHeight:S}},children:[N&&(s?jsxRuntime.jsx(C,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(C,{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",w?"px-6 py-6":"p-0"),children:l}),L&&jsxRuntime.jsx(z,{primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:g})]})})})})}function K(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function pn({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(Ce,{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(K,{id:e,onSubmit:o,children:i})})}function ne({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:p,className:c,primaryAction:g,secondaryAction:h,footerContent:v,contentPadding:D=true,maxWidth:S="400px"}){let[P,m]=ro.useState(false);if(ro.useEffect(()=>{if(i){let f=setTimeout(()=>m(true),10);return ()=>clearTimeout(f)}m(false);},[i]),!i)return null;let y=o||t,w=g||h||v;return jsxRuntime.jsx(F,{children:jsxRuntime.jsx(_,{isOpen:i,onOpenChange:f=>!f&&p?.(),isDismissable:true,transparent:d,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex justify-end outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:true,children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed bottom-0 top-0 z-50 flex w-full flex-col bg-background-surface shadow-xl duration-300 h-full min-h-0 overflow-hidden dark:bg-gray-800","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",P?l==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":"",c),style:{[l==="right"?"right":"left"]:0,maxWidth:S,transform:P?void 0:l==="right"?"translateX(100%)":"translateX(-100%)"},children:[y&&(a&&s?jsxRuntime.jsx(C,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,hasBackArrow:true,onBack:s,onClose:p}):jsxRuntime.jsx(C,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,onClose:p})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",D?"px-6 py-6":"p-0"),children:e}),w&&jsxRuntime.jsx(z,{primaryAction:g,secondaryAction:h,footerContent:v})]})})})})}ne.displayName="Drawer";function Sn({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(ne,{primaryAction:{label:t,onPress:()=>{let p=document.getElementById(e);p&&p.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:s}:void 0,...l,children:jsxRuntime.jsx(K,{id:e,onSubmit:o,className:"mt-2",children:i})})}function Mn({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 eo={sm:"gap-2",md:"gap-4",lg:"gap-6"};function to(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 Ln({cols:e={base:1},gap:o="lg",className:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",to(e),eo[o],t)})}var no=ro__namespace.default.forwardRef(({children:e,className:o},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",o),children:e}));no.displayName="InputWrapper";function Xe({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-caption",O[e].text,o),children:t})}function qn({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(V,{tag:"h3",size:"sm",children:e}):e,o?jsxRuntime.jsx(Xe,{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 Qn(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function ea({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(R,{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 aa({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(H,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx(H,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function la({when:e,message:o="You have unsaved changes. Leave anyway?"}){return ro__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 ca({steps:e,initialStepId:o,canNavigate:t}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,n]=ro__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=pn;exports.DrawerForm=Sn;exports.FormActions=Mn;exports.FormDivider=Qn;exports.FormGrid=Ln;exports.FormSection=qn;exports.FormStepper=ea;exports.SaveBar=aa;exports.UnsavedChangesPrompt=la;exports.useWizard=ca;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),to=require('react'),ut=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 to__namespace=/*#__PURE__*/_interopNamespace(to);var ut__namespace=/*#__PURE__*/_interopNamespace(ut);var st=Object.defineProperty;var lt=(e,o,t)=>o in e?st(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var me=(e,o,t)=>lt(e,typeof o!="symbol"?o+"":o,t);function Se(e,o=false){let[t,r]=to.useState(o);return to.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 Be(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 O={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 U={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},R=to.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...s})=>{let i=ut__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 U?U[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}`})});R.displayName="Icon";var Me=to.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:p,...c})=>{let f=typeof n=="string"&&n in U?U[n]:n,x=t?typeof t=="string"&&t in U?U[t]:t:f*1.75,v=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:v,style:{width:x,height:x},children:jsxRuntime.jsx(R,{...c,name:s,size:n,color:i,weight:l,className:a,ariaLabel:d})})});Me.displayName="IconWithContainer";var mt="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",gt={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"},Ee={full:"w-full",default:"w-fit"},bt="opacity-50 cursor-not-allowed pointer-events-none",xt="opacity-100 cursor-pointer",ht={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},vt={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function yt(e){return e?e==="primary"?"brand":e:"default"}function Pt(e){let{variant:o="default",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,s=yt(o),i=s==="unstyled"?"":`${mt} ${gt[s]}`;s!=="unstyled"&&(i+=` ${O[t].text} ${O[t].height} ${O[t].padding} ${O[t].gap}`),r||a?i+=` ${bt}`:i+=` ${xt}`,n?i+=` ${Ee.full}`:i+=` ${Ee.default}`;let l=s==="brand"?"focus-visible:outline-action-brand":void 0;return [i,Be(),l].filter(Boolean).join(" ")}function H(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:a,size:s="md",iconPosition:i="left",iconWeight:l,href:d,className:p,badgeNumber:c,badgeVariant:f="primary",badgePosition:x="top-right",style:v,target:C,rel:S,...P}=e,m=o?jsxRuntime.jsx(R,{name:o,size:s,weight:l}):null,y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof t=="function"?null:t,i==="right"&&m]}),D=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(R,{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})]}),g=(c??0)>0,w=tailwindMerge.twMerge(Pt(e),p),L=d?{href:d,target:C,rel:S,...P}:{};if(d){let{onPress:$,onPressStart:W,onPressEnd:ie,onPressChange:Y,onPressUp:G,onAuxClick:Re,onContextMenu:ke,onDoubleClick:se,...le}=P;Object.assign(L,le);}let B=d?jsxRuntime.jsx(reactAriaComponents.Link,{...L,...r&&{"aria-busy":true},style:g?void 0:v,className:w,children:r?D:typeof t=="function"?(function($){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t($),i==="right"&&m]})}):y}):jsxRuntime.jsx(reactAriaComponents.Button,{...P,...r&&{"aria-busy":true},style:g?void 0:v,className:w,children:r?D:typeof t=="function"?(function($){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t($),i==="right"&&m]})}):y});return g?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:v,children:[B,jsxRuntime.jsx("span",{className:`absolute ${ht[x]} flex h-5 w-5 items-center justify-center rounded-full ${vt[f]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):B}function xe({action:e,defaultVariant:o,defaultSize:t="lg"}){let r=!!e.formId;return jsxRuntime.jsx(H,{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 z({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(xe,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(xe,{action:o,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(xe,{action:e,defaultVariant:"default"})]})]})]})}var Nt={xs:"text-lg font-semibold",sm:"text-xl font-semibold",md:"text-2xl font-semibold",lg:"text-3xl font-semibold",xl:"text-4xl font-semibold"},Ct={page:"h-16 leading-[62px]"};function V({tag:e="h1",size:o="lg",height:t,className:r="",children:n}){let a=Nt[o],s=t?Ct[t]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(a,s,r),children:n})}var N=({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(H,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(R,{name:"CaretLeft","data-testid":"back-arrow"})}),s||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(V,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx(H,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(R,{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:p,className:c,"data-testid":f})=>{let[x,v]=to.useState(l===0);if(to.useEffect(()=>{if(l>0){let g=setTimeout(()=>v(true),l);return ()=>clearTimeout(g)}},[l]),!x)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 g=typeof e=="number"?e:parseFloat(String(e));return isNaN(g)?"":`animation-duration-[${Math.max(.8,g/100)}s]`})():"",P=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}`:"",m="rounded-sm";t==="circle"&&(m="rounded-full"),t==="text"&&(m="h-4 w-full rounded-sm");let y=a?"flex-1 min-w-0":"",D=i?Object.entries(i).map(([g,w])=>`${g}:w-[${w}]`).join(" "):"";return s?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":f,children:s.map((g,w)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,P,m,y,D,c),style:{width:g,height:o}},w))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,P,m,y,D,c),style:{width:e,height:o},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":f})};var It={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"},Ft="rounded-lg",ye={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Mt={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function E({variant:e="outlined",className:o,children:t,isLoading:r=false,layout:n="default"}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",It[e],Ft,n==="flex"&&"flex flex-col",o),"data-testid":"card",children:r?jsxRuntime.jsx(k,{width:"100%",height:"100%",className:"rounded-none"}):t})}function Ae({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(V,{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 ze({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",ye[t],r),children:jsxRuntime.jsx(k,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",ye[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",ye[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function _e({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 $e({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",Mt[t],e),children:o}):null}E.Header=Ae;E.Media=ze;E.Content=_e;E.Footer=$e;var F=class extends to.Component{constructor(){super(...arguments);me(this,"state",{hasError:false});me(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(E,{children:[this.props.title&&jsxRuntime.jsx(E.Header,{title:this.props.title}),jsxRuntime.jsx(E.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 _({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 $t=.3,Wt=.5;function oe({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:p=false,primaryAction:c,secondaryAction:f,footerContent:x,maxHeight:v="80vh",height:C,maxWidth:S="640px",contentPadding:P=true,showHandle:m=true,animationVariant:y="scale",className:D}){let[g,w]=to.useState(false),[L,B]=to.useState(0),[$,W]=to.useState(false),ie=to.useRef(null),Y=to.useRef(null),G=to.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});to.useEffect(()=>{if(i){let h=setTimeout(()=>{w(true),setTimeout(()=>w(false),600);},400);return ()=>clearTimeout(h)}},[i]),to.useEffect(()=>{i||(B(0),W(false),G.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]);let Re=to.useCallback(h=>{d&&(h.pointerType!=="touch"&&h.pointerType!=="pen"||(Y.current&&(clearTimeout(Y.current),Y.current=null),G.current={isDragging:true,startY:h.clientY,startTime:Date.now(),pointerId:h.pointerId},W(false),h.currentTarget.setPointerCapture(h.pointerId)));},[d]),ke=to.useCallback(h=>{let{isDragging:de,startY:ce,pointerId:ue}=G.current;if(!de||h.pointerId!==ue)return;let pe=h.clientY-ce;B(Math.max(0,pe));},[]),se=to.useCallback(h=>{let{isDragging:de,startY:ce,startTime:ue,pointerId:pe}=G.current;if(!de||h.pointerId!==pe)return;let fe=h.clientY-ce,nt=Date.now()-ue,at=fe/nt;G.current={isDragging:false,startY:0,startTime:0,pointerId:null};let it=(ie.current?.getBoundingClientRect().height??0)*$t;(fe>it||at>Wt&&fe>50)&&d?(l?.(),B(0)):(W(true),B(0),Y.current=setTimeout(()=>{W(false),Y.current=null;},200));},[d,l]);if(!i)return null;let le=o||t,rt=c||f||x;return jsxRuntime.jsx(F,{children:jsxRuntime.jsx(_,{isOpen:i,onOpenChange:h=>{h||l?.();},isDismissable:d,transparent:p,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",$&&"transition-transform duration-200"),style:{transform:L>0?`translateY(${L}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)]",D),style:{maxWidth:S,...C?{height:C}:{maxHeight:v}},children:[m&&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:Re,onPointerMove:ke,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",g&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),le&&(a?jsxRuntime.jsx(N,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,hasBackArrow:true,onBack:s??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(N,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",P?"p-4":"p-0"),children:e}),rt&&jsxRuntime.jsx(z,{primaryAction:c,secondaryAction:f,footerContent:x})]})})})})})}oe.displayName="Tray";function Ce({isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:s=false,onBack:i,children:l,primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:f,transparentOverlay:x=false,maxWidth:v="600px",minWidth:C="400px",maxHeight:S="85vh",height:P,mobileMaxHeight:m="90vh",mobileHeight:y,contentPadding:D=true,className:g}){if(e===false)return null;let w=t||r,L=d||p||c||f,B=e!==void 0;return Se("(max-width: 767px)")?B?jsxRuntime.jsx(oe,{isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n,hideCloseIcon:a,hasBackArrow:s,onBack:i,primaryAction:d,secondaryAction:p,footerContent:f,transparentOverlay:x,maxHeight:m,height:y,maxWidth:v,contentPadding:D,showHandle:true,animationVariant:"scale",className:g,children:l}):jsxRuntime.jsx(F,{children:jsxRuntime.jsx(_,{isDismissable:true,transparent:x,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,{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","max-h-[90vh]","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",g),style:{...y?{height:y}:{maxHeight:m}},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"})}),w&&(s?jsxRuntime.jsx(N,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(N,{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 overscroll-contain",D?"px-6 py-6":"p-0"),children:l}),L&&jsxRuntime.jsx(z,{primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:f})]})})})}):jsxRuntime.jsx(F,{children:jsxRuntime.jsx(_,{...B?{isOpen:e,onOpenChange:W=>{!W&&o&&o();}}:{},isDismissable:true,transparent:x,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:v},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{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",g),style:{minWidth:C,...P?{height:P}:{maxHeight:S}},children:[w&&(s?jsxRuntime.jsx(N,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(N,{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",D?"px-6 py-6":"p-0"),children:l}),L&&jsxRuntime.jsx(z,{primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:f})]})})})})}function K(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function cn({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(Ce,{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(K,{id:e,onSubmit:o,children:i})})}function ne({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:p,className:c,primaryAction:f,secondaryAction:x,footerContent:v,contentPadding:C=true,maxWidth:S="400px"}){if(!i)return null;let P=o||t,m=f||x||v;return jsxRuntime.jsx(F,{children:jsxRuntime.jsx(_,{isOpen:i,onOpenChange:y=>!y&&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",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:S,width:"100%"},children:[P&&(a&&s?jsxRuntime.jsx(N,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,hasBackArrow:true,onBack:s,onClose:p}):jsxRuntime.jsx(N,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,onClose:p})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",C?"px-6 py-6":"p-0"),children:e}),m&&jsxRuntime.jsx(z,{primaryAction:f,secondaryAction:x,footerContent:v})]})})})})}ne.displayName="Drawer";function Dn({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(ne,{primaryAction:{label:t,onPress:()=>{let p=document.getElementById(e);p&&p.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:s}:void 0,...l,children:jsxRuntime.jsx(K,{id:e,onSubmit:o,className:"mt-2",children:i})})}function Bn({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 Kt={sm:"gap-2",md:"gap-4",lg:"gap-6"};function Zt(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 Hn({cols:e={base:1},gap:o="lg",className:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",Zt(e),Kt[o],t)})}var oo=to__namespace.default.forwardRef(({children:e,className:o},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",o),children:e}));oo.displayName="InputWrapper";function Xe({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-caption",O[e].text,o),children:t})}function Yn({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(V,{tag:"h3",size:"sm",children:e}):e,o?jsxRuntime.jsx(Xe,{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 Gn(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function Jn({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(R,{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 oa({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(H,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx(H,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function aa({when:e,message:o="You have unsaved changes. Leave anyway?"}){return to__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 sa({steps:e,initialStepId:o,canNavigate:t}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,n]=to__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=cn;exports.DrawerForm=Dn;exports.FormActions=Bn;exports.FormDivider=Gn;exports.FormGrid=Hn;exports.FormSection=Yn;exports.FormStepper=Jn;exports.SaveBar=oa;exports.UnsavedChangesPrompt=aa;exports.useWizard=sa;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map