@texturehq/edges 1.22.3 → 1.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FileUpload-DXTcfLIh.d.cts → RichTextEditor-BGQenUvv.d.cts} +35 -1
- package/dist/{FileUpload-DXTcfLIh.d.ts → RichTextEditor-BGQenUvv.d.ts} +35 -1
- package/dist/{TimeField-D2AOjQ1K.d.cts → TimeField-CC3x7lhz.d.cts} +1 -1
- package/dist/{TimeField-B4J8gA8E.d.ts → TimeField-D3hN7DMK.d.ts} +1 -1
- package/dist/{colors-BTM11lUb.d.ts → colors-4FidHJjY.d.ts} +11 -32
- package/dist/{colors-DTZwmrPz.d.cts → colors-DZxe608j.d.cts} +11 -32
- package/dist/components.manifest.json +2 -2
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.cjs.map +1 -1
- package/dist/form/index.js +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/index.cjs +34 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.js +34 -18
- package/dist/index.js.map +1 -1
- package/dist/rhf/index.cjs +1 -1
- package/dist/rhf/index.cjs.map +1 -1
- package/dist/rhf/index.d.cts +22 -3
- package/dist/rhf/index.d.ts +22 -3
- package/dist/rhf/index.js +1 -1
- package/dist/rhf/index.js.map +1 -1
- package/dist/server.cjs +17 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +17 -1
- package/dist/server.js.map +1 -1
- package/dist/styles.css +30 -18
- package/dist/utilities.manifest.json +2 -2
- package/package.json +1 -1
|
@@ -345,4 +345,38 @@ interface FileUploadProps {
|
|
|
345
345
|
*/
|
|
346
346
|
declare function FileUpload({ value, onChange, onUrlChange, accept, maxSize, isDisabled, onUpload, className, showPreview, placeholder, }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
347
347
|
|
|
348
|
-
|
|
348
|
+
interface RichTextEditorProps {
|
|
349
|
+
/**
|
|
350
|
+
* The initial content of the editor
|
|
351
|
+
*/
|
|
352
|
+
initialContent?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Callback when the content changes
|
|
355
|
+
*/
|
|
356
|
+
onChange?: (html: string) => void;
|
|
357
|
+
/**
|
|
358
|
+
* Additional className to apply to the editor
|
|
359
|
+
*/
|
|
360
|
+
className?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Whether the editor is disabled
|
|
363
|
+
*/
|
|
364
|
+
isDisabled?: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* Placeholder text when editor is empty
|
|
367
|
+
*/
|
|
368
|
+
placeholder?: string;
|
|
369
|
+
/**
|
|
370
|
+
* ID for the editor element for label association
|
|
371
|
+
*/
|
|
372
|
+
id?: string;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* RichTextEditor
|
|
376
|
+
*
|
|
377
|
+
* A rich text editor with formatting capabilities including headings, bold, italic, lists, and links.
|
|
378
|
+
* Built on top of TipTap/ProseMirror.
|
|
379
|
+
*/
|
|
380
|
+
declare function RichTextEditor({ initialContent, onChange, className, isDisabled, placeholder, id, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
381
|
+
|
|
382
|
+
export { type BaseInputProps as B, ClearButton as C, type DateFieldProps as D, type FileUploadProps as F, Icon as I, type LabelProps as L, type RichTextEditorProps as R, type Size as S, DateField as a, FileUpload as b, RichTextEditor as c, type IconName as d, type InputStyleProps as e, type BaseProps as f, type FieldErrorProps as g, type InputProps as h, type DescriptionProps as i, type FieldGroupProps as j, InputWrapper as k, getInputStateStyles as l, getInputBackgroundStyles as m, getInputBaseStyles as n, getFieldGroupStyles as o, Label as p, Description as q, FieldError as r, Input as s, FieldGroup as t, useInputFocus as u };
|
|
@@ -345,4 +345,38 @@ interface FileUploadProps {
|
|
|
345
345
|
*/
|
|
346
346
|
declare function FileUpload({ value, onChange, onUrlChange, accept, maxSize, isDisabled, onUpload, className, showPreview, placeholder, }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
347
347
|
|
|
348
|
-
|
|
348
|
+
interface RichTextEditorProps {
|
|
349
|
+
/**
|
|
350
|
+
* The initial content of the editor
|
|
351
|
+
*/
|
|
352
|
+
initialContent?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Callback when the content changes
|
|
355
|
+
*/
|
|
356
|
+
onChange?: (html: string) => void;
|
|
357
|
+
/**
|
|
358
|
+
* Additional className to apply to the editor
|
|
359
|
+
*/
|
|
360
|
+
className?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Whether the editor is disabled
|
|
363
|
+
*/
|
|
364
|
+
isDisabled?: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* Placeholder text when editor is empty
|
|
367
|
+
*/
|
|
368
|
+
placeholder?: string;
|
|
369
|
+
/**
|
|
370
|
+
* ID for the editor element for label association
|
|
371
|
+
*/
|
|
372
|
+
id?: string;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* RichTextEditor
|
|
376
|
+
*
|
|
377
|
+
* A rich text editor with formatting capabilities including headings, bold, italic, lists, and links.
|
|
378
|
+
* Built on top of TipTap/ProseMirror.
|
|
379
|
+
*/
|
|
380
|
+
declare function RichTextEditor({ initialContent, onChange, className, isDisabled, placeholder, id, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
381
|
+
|
|
382
|
+
export { type BaseInputProps as B, ClearButton as C, type DateFieldProps as D, type FileUploadProps as F, Icon as I, type LabelProps as L, type RichTextEditorProps as R, type Size as S, DateField as a, FileUpload as b, RichTextEditor as c, type IconName as d, type InputStyleProps as e, type BaseProps as f, type FieldErrorProps as g, type InputProps as h, type DescriptionProps as i, type FieldGroupProps as j, InputWrapper as k, getInputStateStyles as l, getInputBackgroundStyles as m, getInputBaseStyles as n, getFieldGroupStyles as o, Label as p, Description as q, FieldError as r, Input as s, FieldGroup as t, useInputFocus as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { ComponentProps, ReactNode } from 'react';
|
|
3
3
|
import { Key, ValidationResult, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, CheckboxRenderProps, CheckboxGroupProps as CheckboxGroupProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, RadioProps, RadioGroupProps as RadioGroupProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1, TimeFieldProps as TimeFieldProps$1, TimeValue } from 'react-aria-components';
|
|
4
|
-
import { S as Size, I as Icon, B as BaseInputProps } from './
|
|
4
|
+
import { S as Size, I as Icon, B as BaseInputProps } from './RichTextEditor-BGQenUvv.cjs';
|
|
5
5
|
|
|
6
6
|
interface Item {
|
|
7
7
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { ComponentProps, ReactNode } from 'react';
|
|
3
3
|
import { Key, ValidationResult, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, CheckboxRenderProps, CheckboxGroupProps as CheckboxGroupProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, RadioProps, RadioGroupProps as RadioGroupProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1, TimeFieldProps as TimeFieldProps$1, TimeValue } from 'react-aria-components';
|
|
4
|
-
import { S as Size, I as Icon, B as BaseInputProps } from './
|
|
4
|
+
import { S as Size, I as Icon, B as BaseInputProps } from './RichTextEditor-BGQenUvv.js';
|
|
5
5
|
|
|
6
6
|
interface Item {
|
|
7
7
|
id: string;
|
|
@@ -3,7 +3,7 @@ import { ScaleTime, ScaleLinear } from 'd3-scale';
|
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default, { ReactNode } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { d as IconName } from './RichTextEditor-BGQenUvv.js';
|
|
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';
|
|
@@ -281,6 +281,10 @@ interface ActionItem {
|
|
|
281
281
|
* Display name for the action
|
|
282
282
|
*/
|
|
283
283
|
name: string;
|
|
284
|
+
/**
|
|
285
|
+
* Optional subtitle for the action
|
|
286
|
+
*/
|
|
287
|
+
subtitle?: string;
|
|
284
288
|
/**
|
|
285
289
|
* Visual variant of the action
|
|
286
290
|
*/
|
|
@@ -301,6 +305,11 @@ interface ActionItem {
|
|
|
301
305
|
* Test ID for testing
|
|
302
306
|
*/
|
|
303
307
|
testId?: string;
|
|
308
|
+
/**
|
|
309
|
+
* Custom render function for the menu item content
|
|
310
|
+
* If provided, this will override the default name/subtitle rendering
|
|
311
|
+
*/
|
|
312
|
+
render?: () => ReactNode;
|
|
304
313
|
}
|
|
305
314
|
interface ActionMenuProps {
|
|
306
315
|
/**
|
|
@@ -1490,36 +1499,6 @@ interface MeterProps extends MeterProps$1 {
|
|
|
1490
1499
|
*/
|
|
1491
1500
|
declare function Meter({ label, size, variant, showWarningIndicator, warningThreshold, className, ...props }: MeterProps): react_jsx_runtime.JSX.Element;
|
|
1492
1501
|
|
|
1493
|
-
interface RichTextEditorProps {
|
|
1494
|
-
/**
|
|
1495
|
-
* The initial content of the editor
|
|
1496
|
-
*/
|
|
1497
|
-
initialContent?: string;
|
|
1498
|
-
/**
|
|
1499
|
-
* Callback when the content changes
|
|
1500
|
-
*/
|
|
1501
|
-
onChange?: (html: string) => void;
|
|
1502
|
-
/**
|
|
1503
|
-
* Additional className to apply to the editor
|
|
1504
|
-
*/
|
|
1505
|
-
className?: string;
|
|
1506
|
-
/**
|
|
1507
|
-
* Whether the editor is disabled
|
|
1508
|
-
*/
|
|
1509
|
-
isDisabled?: boolean;
|
|
1510
|
-
/**
|
|
1511
|
-
* Placeholder text when editor is empty
|
|
1512
|
-
*/
|
|
1513
|
-
placeholder?: string;
|
|
1514
|
-
}
|
|
1515
|
-
/**
|
|
1516
|
-
* RichTextEditor
|
|
1517
|
-
*
|
|
1518
|
-
* A rich text editor with formatting capabilities including headings, bold, italic, lists, and links.
|
|
1519
|
-
* Built on top of TipTap/ProseMirror.
|
|
1520
|
-
*/
|
|
1521
|
-
declare function RichTextEditor({ initialContent, onChange, className, isDisabled, placeholder, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
1522
|
-
|
|
1523
1502
|
type SegmentOption = {
|
|
1524
1503
|
id: string;
|
|
1525
1504
|
label: string;
|
|
@@ -1804,4 +1783,4 @@ declare const isLightColor: (color: string) => boolean;
|
|
|
1804
1783
|
*/
|
|
1805
1784
|
declare const getContrastingTextColor: (backgroundColor: string) => string;
|
|
1806
1785
|
|
|
1807
|
-
export { type
|
|
1786
|
+
export { type DateFormat as $, type ActionItem as A, type BadgeProps as B, type CodeEditorProps as C, getResolvedColor as D, type EntityConfig as E, getThemeCategoricalColors as F, isLightColor as G, Heading as H, type InteractiveMapProps as I, type TooltipData as J, type TooltipSeries as K, Loader as L, type MapPoint as M, type BaseDataPoint as N, type ChartMargin as O, createXScale as P, createYScale as Q, defaultMargin as R, type StaticMapProps as S, TextLink as T, getYFormatSettings as U, type YFormatSettings as V, type FieldValue as W, type BooleanFormat as X, type YFormatType as Y, type FormattedValue as Z, type CurrentFormat as _, type ActionMenuProps as a, type DistanceFormat as a0, type EnergyFormat as a1, type CurrencyFormat as a2, type NumberFormat as a3, type PhoneFormat as a4, type PowerFormat as a5, type FormatterFunction as a6, type ResistanceFormat as a7, type TemperatureUnitString as a8, type TemperatureUnit as a9, ChartContext as aA, useChartContext as aB, type ComponentFormatOptions as aC, formatComponentValue as aD, useComponentFormatter as aE, type BaseFormat as aF, type TextTransform as aG, type TextTruncatePosition as aH, type PercentageFormat as aI, type DateFormatStyle as aJ, type EnergyUnit as aK, type PowerUnit as aL, type VoltageUnit as aM, type CurrentUnit as aN, type ResistanceUnit as aO, type DistanceUnit as aP, type CustomFormat as aQ, type MetricFormat as aR, deviceStateMetricFormats as aS, activeDeviceStates as aT, deviceStateLabels as aU, isActiveState as aV, getDeviceStateLabel as aW, gridStateLabels as aX, getGridStateLabel as aY, type TemperatureFormat as aa, type TextFormat as ab, type VoltageFormat as ac, type FieldFormat as ad, type DeviceState as ae, type GridState as af, type ComponentFormatter as ag, type LayerSpec as ah, type CustomPinsSpec as ai, type GeoJsonLayerSpec as aj, type RasterLayerSpec as ak, type VectorLayerSpec as al, type ClusteredVectorLayerSpec as am, ActionMenu as an, Badge as ao, CodeEditor as ap, type ColorSpec as aq, type LayerFeature as ar, type LayerStyle as as, type RenderType as at, type ZoomStops as au, InteractiveMap as av, MAP_TYPES as aw, StaticMap as ax, Meter as ay, SegmentedControl as az, AppShell as b, type AppShellProps as c, type AvatarProps as d, Avatar as e, type CodeLanguage as f, type CodeTheme as g, Logo as h, type MeterProps as i, type SegmentedControlProps as j, type SegmentOption as k, SideNav as l, type SideNavItem as m, type SideNavProps as n, TopNav as o, type TopNavProps as p, type EntityType as q, ENTITY_CONFIG as r, getEntityConfig as s, getEntityIcon as t, getEntityLabel as u, clearColorCache as v, createCategoryColorMap as w, getContrastingTextColor as x, getDefaultChartColor as y, getDefaultColors as z };
|
|
@@ -3,7 +3,7 @@ import { ScaleTime, ScaleLinear } from 'd3-scale';
|
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default, { ReactNode } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { d as IconName } from './RichTextEditor-BGQenUvv.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';
|
|
@@ -281,6 +281,10 @@ interface ActionItem {
|
|
|
281
281
|
* Display name for the action
|
|
282
282
|
*/
|
|
283
283
|
name: string;
|
|
284
|
+
/**
|
|
285
|
+
* Optional subtitle for the action
|
|
286
|
+
*/
|
|
287
|
+
subtitle?: string;
|
|
284
288
|
/**
|
|
285
289
|
* Visual variant of the action
|
|
286
290
|
*/
|
|
@@ -301,6 +305,11 @@ interface ActionItem {
|
|
|
301
305
|
* Test ID for testing
|
|
302
306
|
*/
|
|
303
307
|
testId?: string;
|
|
308
|
+
/**
|
|
309
|
+
* Custom render function for the menu item content
|
|
310
|
+
* If provided, this will override the default name/subtitle rendering
|
|
311
|
+
*/
|
|
312
|
+
render?: () => ReactNode;
|
|
304
313
|
}
|
|
305
314
|
interface ActionMenuProps {
|
|
306
315
|
/**
|
|
@@ -1490,36 +1499,6 @@ interface MeterProps extends MeterProps$1 {
|
|
|
1490
1499
|
*/
|
|
1491
1500
|
declare function Meter({ label, size, variant, showWarningIndicator, warningThreshold, className, ...props }: MeterProps): react_jsx_runtime.JSX.Element;
|
|
1492
1501
|
|
|
1493
|
-
interface RichTextEditorProps {
|
|
1494
|
-
/**
|
|
1495
|
-
* The initial content of the editor
|
|
1496
|
-
*/
|
|
1497
|
-
initialContent?: string;
|
|
1498
|
-
/**
|
|
1499
|
-
* Callback when the content changes
|
|
1500
|
-
*/
|
|
1501
|
-
onChange?: (html: string) => void;
|
|
1502
|
-
/**
|
|
1503
|
-
* Additional className to apply to the editor
|
|
1504
|
-
*/
|
|
1505
|
-
className?: string;
|
|
1506
|
-
/**
|
|
1507
|
-
* Whether the editor is disabled
|
|
1508
|
-
*/
|
|
1509
|
-
isDisabled?: boolean;
|
|
1510
|
-
/**
|
|
1511
|
-
* Placeholder text when editor is empty
|
|
1512
|
-
*/
|
|
1513
|
-
placeholder?: string;
|
|
1514
|
-
}
|
|
1515
|
-
/**
|
|
1516
|
-
* RichTextEditor
|
|
1517
|
-
*
|
|
1518
|
-
* A rich text editor with formatting capabilities including headings, bold, italic, lists, and links.
|
|
1519
|
-
* Built on top of TipTap/ProseMirror.
|
|
1520
|
-
*/
|
|
1521
|
-
declare function RichTextEditor({ initialContent, onChange, className, isDisabled, placeholder, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
1522
|
-
|
|
1523
1502
|
type SegmentOption = {
|
|
1524
1503
|
id: string;
|
|
1525
1504
|
label: string;
|
|
@@ -1804,4 +1783,4 @@ declare const isLightColor: (color: string) => boolean;
|
|
|
1804
1783
|
*/
|
|
1805
1784
|
declare const getContrastingTextColor: (backgroundColor: string) => string;
|
|
1806
1785
|
|
|
1807
|
-
export { type
|
|
1786
|
+
export { type DateFormat as $, type ActionItem as A, type BadgeProps as B, type CodeEditorProps as C, getResolvedColor as D, type EntityConfig as E, getThemeCategoricalColors as F, isLightColor as G, Heading as H, type InteractiveMapProps as I, type TooltipData as J, type TooltipSeries as K, Loader as L, type MapPoint as M, type BaseDataPoint as N, type ChartMargin as O, createXScale as P, createYScale as Q, defaultMargin as R, type StaticMapProps as S, TextLink as T, getYFormatSettings as U, type YFormatSettings as V, type FieldValue as W, type BooleanFormat as X, type YFormatType as Y, type FormattedValue as Z, type CurrentFormat as _, type ActionMenuProps as a, type DistanceFormat as a0, type EnergyFormat as a1, type CurrencyFormat as a2, type NumberFormat as a3, type PhoneFormat as a4, type PowerFormat as a5, type FormatterFunction as a6, type ResistanceFormat as a7, type TemperatureUnitString as a8, type TemperatureUnit as a9, ChartContext as aA, useChartContext as aB, type ComponentFormatOptions as aC, formatComponentValue as aD, useComponentFormatter as aE, type BaseFormat as aF, type TextTransform as aG, type TextTruncatePosition as aH, type PercentageFormat as aI, type DateFormatStyle as aJ, type EnergyUnit as aK, type PowerUnit as aL, type VoltageUnit as aM, type CurrentUnit as aN, type ResistanceUnit as aO, type DistanceUnit as aP, type CustomFormat as aQ, type MetricFormat as aR, deviceStateMetricFormats as aS, activeDeviceStates as aT, deviceStateLabels as aU, isActiveState as aV, getDeviceStateLabel as aW, gridStateLabels as aX, getGridStateLabel as aY, type TemperatureFormat as aa, type TextFormat as ab, type VoltageFormat as ac, type FieldFormat as ad, type DeviceState as ae, type GridState as af, type ComponentFormatter as ag, type LayerSpec as ah, type CustomPinsSpec as ai, type GeoJsonLayerSpec as aj, type RasterLayerSpec as ak, type VectorLayerSpec as al, type ClusteredVectorLayerSpec as am, ActionMenu as an, Badge as ao, CodeEditor as ap, type ColorSpec as aq, type LayerFeature as ar, type LayerStyle as as, type RenderType as at, type ZoomStops as au, InteractiveMap as av, MAP_TYPES as aw, StaticMap as ax, Meter as ay, SegmentedControl as az, AppShell as b, type AppShellProps as c, type AvatarProps as d, Avatar as e, type CodeLanguage as f, type CodeTheme as g, Logo as h, type MeterProps as i, type SegmentedControlProps as j, type SegmentOption as k, SideNav as l, type SideNavItem as m, type SideNavProps as n, TopNav as o, type TopNavProps as p, type EntityType as q, ENTITY_CONFIG as r, getEntityConfig as s, getEntityIcon as t, getEntityLabel as u, clearColorCache as v, createCategoryColorMap as w, getContrastingTextColor as x, getDefaultChartColor as y, getDefaultColors as z };
|
package/dist/form/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),Ee=require('react'),We=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 Ee__namespace=/*#__PURE__*/_interopNamespace(Ee);var We__namespace=/*#__PURE__*/_interopNamespace(We);var Te=Object.defineProperty;var Ae=(e,t,o)=>t in e?Te(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var oe=(e,t,o)=>Ae(e,typeof t!="symbol"?t+"":t,o);function ce(e,t=false){let[o,r]=Ee.useState(t);return Ee.useEffect(()=>{if(typeof window>"u")return;let a=window.matchMedia(e);r(a.matches);let n=s=>{r(s.matches);};return a.addEventListener("change",n),()=>{a.removeEventListener("change",n);}},[e]),o}function pe(e=false){return `${e?"outline outline-1 outline-border-input focus:outline-2 focus:outline-action-default focus: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 focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default 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 $={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 O={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},R=Ee.memo(({name:e,size:t="md",color:o,weight:r="regular",className:a,ariaLabel:n,...s})=>{let i=We__namespace[e];if(!i)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let l=typeof t=="string"&&t in O?O[t]:t,d=tailwindMerge.twMerge("inline-block flex-shrink-0",!o&&"text-current",a);return jsxRuntime.jsx(i,{...s,size:l,color:o,weight:r,className:d,"aria-label":n||`${e} icon`,"data-testid":`icon-${e}`})});R.displayName="Icon";var me=Ee.memo(({variant:e="subtle",shape:t="square",containerSize:o,containerClassName:r,size:a="md",className:n,name:s,color:i,weight:l,ariaLabel:d,ref:u,...c})=>{let g=typeof a=="string"&&a in O?O[a]:a,x=o?typeof o=="string"&&o in O?O[o]:o:g*1.75,v=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="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:a,color:i,weight:l,className:n,ariaLabel:d})})});me.displayName="IconWithContainer";var Ve="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",Ge={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"},be={full:"w-full",default:"w-fit"},Ue="opacity-50 cursor-not-allowed pointer-events-none",qe="opacity-100 cursor-pointer",Ye={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Qe={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function Xe(e){return e?e==="primary"?"brand":e:"default"}function Je(e){let{variant:t="default",size:o="md",isDisabled:r,fullWidth:a=false,isLoading:n=false}=e,s=Xe(t),i=s==="unstyled"?"":`${Ve} ${Ge[s]}`;s!=="unstyled"&&(i+=` ${$[o].text} ${$[o].height} ${$[o].padding} ${$[o].gap}`),r||n?i+=` ${Ue}`:i+=` ${qe}`,a?i+=` ${be.full}`:i+=` ${be.default}`;let l=s==="brand"?"focus-visible:outline-action-brand":void 0;return [i,pe(),l].filter(Boolean).join(" ")}function S(e){let{icon:t,children:o,isLoading:r=false,loadingText:a,loadingIndicator:n,size:s="md",iconPosition:i="left",iconWeight:l,href:d,className:u,badgeNumber:c,badgeVariant:g="primary",badgePosition:x="top-right",style:v,target:C,rel:k,...y}=e,m=t?jsxRuntime.jsx(R,{name:t,size:s,weight:l}):null,h=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof o=="function"?null:o,i==="right"&&m]}),P=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:n||jsxRuntime.jsx(R,{name:"CircleNotch",size:s,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:h}),a&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:a})]}),f=(c??0)>0,w=tailwindMerge.twMerge(Je(e),u),A=d?{href:d,target:C,rel:k,...y}:{};if(d){let{onPress:B,onPressStart:Tt,onPressEnd:At,onPressChange:$t,onPressUp:_t,onAuxClick:Wt,onContextMenu:Ot,onDoubleClick:jt,...Le}=y;Object.assign(A,Le);}let V=d?jsxRuntime.jsx(reactAriaComponents.Link,{...A,...r&&{"aria-busy":true},style:f?void 0:v,className:w,children:r?P:typeof o=="function"?(function(B){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,o(B),i==="right"&&m]})}):h}):jsxRuntime.jsx(reactAriaComponents.Button,{...y,...r&&{"aria-busy":true},style:f?void 0:v,className:w,children:r?P:typeof o=="function"?(function(B){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,o(B),i==="right"&&m]})}):h});return f?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",u),style:v,children:[V,jsxRuntime.jsx("span",{className:`absolute ${Ye[x]} flex h-5 w-5 items-center justify-center rounded-full ${Qe[g]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):V}function L({primaryAction:e,secondaryAction:t,footerContent:o}){let r=e||t;return !r&&!o?null:jsxRuntime.jsxs("div",{className:"flex h-28 w-full flex-col items-center justify-center border-t p-4",children:[o&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:o}),r&&jsxRuntime.jsxs("div",{className:"flex h-full w-full items-center justify-end gap-3",children:[t&&jsxRuntime.jsx(S,{size:t.size||"lg",variant:t.variant||"secondary",onPress:t.onPress,isLoading:t.isLoading,isDisabled:t.isDisabled,children:t.label}),e&&jsxRuntime.jsx(S,{size:e.size||"lg",variant:e.variant,onPress:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})]})]})}var Ze={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"},et={page:"h-16 leading-[62px]"};function _({tag:e="h1",size:t="lg",height:o,className:r="",children:a}){let n=Ze[t],s=o?et[o]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(n,s,r),children:a})}var N=({title:e,onClose:t,hideCloseIcon:o=false,titleAlign:r="left",hasBackArrow:a=false,onBack:n,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:[a&&jsxRuntime.jsx(S,{variant:"icon",onPress:n,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(_,{size:"xs",children:e}),t&&!o&&jsxRuntime.jsx(S,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(R,{name:"X","data-testid":"close-button"})})]})]});var D=({width:e,height:t,variant:o="rect",animation:r="pulse",gradient:a=false,flex:n=false,stack:s,responsive:i,delay:l=0,adjustAnimationSpeedBasedOnWidth:d=false,ariaLabel:u,className:c,"data-testid":g})=>{let[x,v]=Ee.useState(l===0);if(Ee.useEffect(()=>{if(l>0){let f=setTimeout(()=>v(true),l);return ()=>clearTimeout(f)}},[l]),!x)return null;let C=a?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",k=d&&e?(()=>{let f=typeof e=="number"?e:parseFloat(String(e));return isNaN(f)?"":`animation-duration-[${Math.max(.8,f/100)}s]`})():"",y=r==="pulse"?`animate-pulse ${k}`: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 ${k}`:"",m="rounded-sm";o==="circle"&&(m="rounded-full"),o==="text"&&(m="h-4 w-full rounded-sm");let h=n?"flex-1 min-w-0":"",P=i?Object.entries(i).map(([f,w])=>`${f}:w-[${w}]`).join(" "):"";return s?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":g,children:s.map((f,w)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,y,m,h,P,c),style:{width:f,height:t}},w))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,y,m,h,P,c),style:{width:e,height:t},role:"presentation","aria-hidden":!u,"aria-label":u??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"},st="rounded-lg",se={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},lt={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function H({variant:e="outlined",className:t,children:o,isLoading:r=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",it[e],st,t),"data-testid":"card",children:r?jsxRuntime.jsx(D,{width:"100%",height:"100%",className:"rounded-none"}):o})}function ye({title:e,subtitle:t,actions:o,className:r,isLoading:a=false}){return a?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(D,{width:120,height:20}),jsxRuntime.jsx(D,{width:24,height:24})]}),t&&jsxRuntime.jsx(D,{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(_,{tag:"h3",size:"sm",className:"text-text-heading",children:e}):e}),t&&jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:t})]}),o&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:o})]})})}function Pe({src:e,alt:t,aspectRatio:o="auto",className:r,children:a,isLoading:n=false}){return n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",se[o],r),children:jsxRuntime.jsx(D,{width:"100%",height:"100%"})}):a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",se[o],r),children:a}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",se[o],r),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function we({className:e,children:t,isLoading:o=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,e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(D,{width:"100%",height:16}),jsxRuntime.jsx(D,{width:"80%",height:16}),jsxRuntime.jsx(D,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:t}):null}function Ne({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(D,{width:80,height:32}),jsxRuntime.jsx(D,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",lt[o],e),children:t}):null}H.Header=ye;H.Media=Pe;H.Content=we;H.Footer=Ne;var I=class extends Ee.Component{constructor(){super(...arguments);oe(this,"state",{hasError:false});oe(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(H,{children:[this.props.title&&jsxRuntime.jsx(H.Header,{title:this.props.title}),jsxRuntime.jsx(H.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 T({transparent:e=false,className:t,children:o,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(t,(a,n)=>tailwindMerge.twMerge("fixed inset-0 z-50",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(" "),n.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),n.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),a)),children:o})}function X({children:e,title:t,headerContent:o,titleAlign:r="left",hideCloseIcon:a=false,hasBackArrow:n=false,onBack:s,isOpen:i,onClose:l,isDismissable:d=true,transparentOverlay:u=false,primaryAction:c,secondaryAction:g,footerContent:x,maxHeight:v="80vh",height:C,maxWidth:k="640px",contentPadding:y=true,showHandle:m=true,animationVariant:h="scale",className:P}){let[f,w]=Ee.useState(false);if(Ee.useEffect(()=>{if(i){let B=setTimeout(()=>{w(true),setTimeout(()=>w(false),600);},400);return ()=>clearTimeout(B)}},[i]),!i)return null;let A=t||o,V=c||g||x;return jsxRuntime.jsx(I,{children:jsxRuntime.jsx(T,{isOpen:i,onOpenChange:B=>{B||l?.();},isDismissable:d,transparent:u,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",isDismissable:d,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",h==="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)]",h==="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)]",P),style:{maxWidth:k,...C?{height:C}:{maxHeight:v}},children:[m&&jsxRuntime.jsx("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-10 flex justify-center",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]")})}),A&&(n?jsxRuntime.jsx(N,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a||!l,hasBackArrow:true,onBack:s??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(N,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",y?"p-4":"p-0"),children:e}),V&&jsxRuntime.jsx(L,{primaryAction:c,secondaryAction:g,footerContent:x})]})})})})}X.displayName="Tray";function de({isOpen:e,onClose:t,title:o,headerContent:r,titleAlign:a="left",hideCloseIcon:n=false,hasBackArrow:s=false,onBack:i,children:l,primaryAction:d,secondaryAction:u,footerContent:c,transparentOverlay:g=false,maxWidth:x="600px",minWidth:v="400px",maxHeight:C="85vh",height:k,mobileMaxHeight:y="90vh",mobileHeight:m,contentPadding:h=true,className:P}){if(e===false)return null;let f=o||r,w=d||u||c,A=e!==void 0;return ce("(max-width: 767px)")?A?jsxRuntime.jsx(X,{isOpen:e,onClose:t,title:o,headerContent:r,titleAlign:a,hideCloseIcon:n,hasBackArrow:s,onBack:i,primaryAction:d,secondaryAction:u,footerContent:c,transparentOverlay:g,maxHeight:y,height:m,maxWidth:x,contentPadding:h,showHandle:true,animationVariant:"scale",className:P,children:l}):jsxRuntime.jsx(I,{children:jsxRuntime.jsx(T,{isDismissable:true,transparent:g,className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-fit p-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-none","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",P),style:{maxWidth:x,...m?{height:m}:{maxHeight:y}},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"})}),f&&(s?jsxRuntime.jsx(N,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(N,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",h?"px-6 py-6":"p-0"),children:l}),w&&jsxRuntime.jsx(L,{primaryAction:d,secondaryAction:u,footerContent:c})]})})})}):jsxRuntime.jsx(I,{children:jsxRuntime.jsx(T,{...A?{isOpen:e,onOpenChange:B=>{!B&&t&&t();}}:{},isDismissable:true,transparent:g,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4",style:{maxWidth:x},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",P),style:{minWidth:v,...k?{height:k}:{maxHeight:C}},children:[f&&(s?jsxRuntime.jsx(N,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(N,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",h?"px-6 py-6":"p-0"),children:l}),w&&jsxRuntime.jsx(L,{primaryAction:d,secondaryAction:u,footerContent:c})]})})})})}function q(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Ur({formId:e="dialog-form",onSubmit:t,primaryLabel:o="Save",secondaryLabel:r="Cancel",onCancel:a,primaryVariant:n,secondaryVariant:s="secondary",children:i,title:l,...d}){return jsxRuntime.jsx(de,{title:l,primaryAction:{label:o,onPress:()=>{let c=document.getElementById(e);c&&c.requestSubmit();},variant:n},secondaryAction:a?{label:r,onPress:a,variant:s}:void 0,...d,children:jsxRuntime.jsx(q,{id:e,onSubmit:t,children:i})})}function K({children:e,title:t,headerContent:o,titleAlign:r="left",hideCloseIcon:a=false,hasBackArrow:n=false,onBack:s,isOpen:i,slideInFrom:l="right",transparentOverlay:d=false,onClose:u,className:c,primaryAction:g,secondaryAction:x,footerContent:v,contentPadding:C=true,maxWidth:k="400px"}){let[y,m]=Ee.useState(false);if(Ee.useEffect(()=>{if(i){let f=setTimeout(()=>m(true),10);return ()=>clearTimeout(f)}m(false);},[i]),!i)return null;let h=t||o,P=g||x||v;return jsxRuntime.jsx(I,{children:jsxRuntime.jsx(T,{isOpen:i,onOpenChange:f=>!f&&u?.(),isDismissable:true,transparent:d,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex justify-end",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",y?l==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":"",c),style:{[l==="right"?"right":"left"]:0,maxWidth:k,transform:y?void 0:l==="right"?"translateX(100%)":"translateX(-100%)"},children:[h&&(n&&s?jsxRuntime.jsx(N,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a,hasBackArrow:true,onBack:s,onClose:u}):jsxRuntime.jsx(N,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a,onClose:u})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",C?"px-6 py-6":"p-0"),children:e}),P&&jsxRuntime.jsx(L,{primaryAction:g,secondaryAction:x,footerContent:v})]})})})})}K.displayName="Drawer";function la({formId:e="drawer-form",onSubmit:t,primaryLabel:o="Save",secondaryLabel:r="Cancel",onCancel:a,primaryVariant:n,secondaryVariant:s="secondary",children:i,...l}){return jsxRuntime.jsx(K,{primaryAction:{label:o,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:n},secondaryAction:a?{label:r,onPress:a,variant:s}:void 0,...l,children:jsxRuntime.jsx(q,{id:e,onSubmit:t,className:"mt-2",children:i})})}function ua({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 Ft={sm:"gap-2",md:"gap-4",lg:"gap-6"};function It(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 ba({cols:e={base:1},gap:t="lg",className:o,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",It(e),Ft[t],o)})}function Ie({size:e="md",className:t,children:o,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-caption",$[e].text,t),children:o})}function Sa({title:e,description:t,showDivider:o,className:r,children:a,...n}){return jsxRuntime.jsxs("section",{...n,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(_,{tag:"h3",size:"sm",children:e}):e,t?jsxRuntime.jsx(Ie,{size:"lg",children:t}):null]}),jsxRuntime.jsx("div",{className:"flex flex-col gap-6",children:a}),o&&jsxRuntime.jsx("hr",{className:"mt-2 border-border-muted"})]})}function Fa(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function za({steps:e,currentStepId:t,onStepClick:o,className:r}){let a=e.findIndex(n=>n.id===t);return jsxRuntime.jsx("nav",{"aria-label":"Progress",className:tailwindMerge.twMerge("w-full",r),children:jsxRuntime.jsxs("div",{className:"relative mb-20",children:[jsxRuntime.jsxs("div",{className:"absolute top-5 left-0 right-0 flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"w-10 flex-shrink-0"}),e.slice(0,-1).map((n,s)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-0.5 flex-1 transition-colors",s<a?"bg-action-default":"bg-border-default")},s)),jsxRuntime.jsx("div",{className:"w-10 flex-shrink-0"})]}),jsxRuntime.jsx("ol",{className:"relative flex items-start justify-between",children:e.map((n,s)=>{let i=n.id===t,l=s<a,d=o&&(l||i);return jsxRuntime.jsxs("li",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("button",{type:"button",disabled:!d,onClick:()=>d&&o?.(n.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})}),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:n.title}),n.description&&jsxRuntime.jsx("span",{className:"mt-1 text-xs text-text-caption",children:n.description})]})]},n.id)})})]})})}function _a({formId:e,show:t,isSubmitting:o,onCancel:r,primaryLabel:a="Save changes",secondaryLabel:n="Cancel",className:s}){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",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(S,{variant:"secondary",onPress:r,children:n}),jsxRuntime.jsx(S,{type:"submit",form:e,isDisabled:!!o,children:o?"Saving...":a})]})]})}):null}function ja({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Ee__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 Ga({steps:e,initialStepId:t,canNavigate:o}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,a]=Ee__namespace.useState(t||e[0].id),n=e.findIndex(c=>c.id===r),s=n>0,i=n<e.length-1,l=async c=>c===r?true:o&&!await o(r,c)?false:(a(c),true);return {steps:e,currentStepId:r,setCurrentStepId:l,next:async()=>!i||n===-1?false:l(e[n+1].id),prev:async()=>!s||n===-1?false:l(e[n-1].id),hasNext:i,hasPrev:s,stepIndex:n}}exports.DialogForm=Ur;exports.DrawerForm=la;exports.FormActions=ua;exports.FormDivider=Fa;exports.FormGrid=ba;exports.FormSection=Sa;exports.FormStepper=za;exports.SaveBar=_a;exports.UnsavedChangesPrompt=ja;exports.useWizard=Ga;//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),Ee=require('react'),We=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 Ee__namespace=/*#__PURE__*/_interopNamespace(Ee);var We__namespace=/*#__PURE__*/_interopNamespace(We);var Te=Object.defineProperty;var Ae=(e,t,o)=>t in e?Te(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var oe=(e,t,o)=>Ae(e,typeof t!="symbol"?t+"":t,o);function ce(e,t=false){let[o,r]=Ee.useState(t);return Ee.useEffect(()=>{if(typeof window>"u")return;let a=window.matchMedia(e);r(a.matches);let n=s=>{r(s.matches);};return a.addEventListener("change",n),()=>{a.removeEventListener("change",n);}},[e]),o}function pe(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 $={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 O={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},R=Ee.memo(({name:e,size:t="md",color:o,weight:r="regular",className:a,ariaLabel:n,...s})=>{let i=We__namespace[e];if(!i)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let l=typeof t=="string"&&t in O?O[t]:t,d=tailwindMerge.twMerge("inline-block flex-shrink-0",!o&&"text-current",a);return jsxRuntime.jsx(i,{...s,size:l,color:o,weight:r,className:d,"aria-label":n||`${e} icon`,"data-testid":`icon-${e}`})});R.displayName="Icon";var me=Ee.memo(({variant:e="subtle",shape:t="square",containerSize:o,containerClassName:r,size:a="md",className:n,name:s,color:i,weight:l,ariaLabel:d,ref:u,...c})=>{let g=typeof a=="string"&&a in O?O[a]:a,x=o?typeof o=="string"&&o in O?O[o]:o:g*1.75,v=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="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:a,color:i,weight:l,className:n,ariaLabel:d})})});me.displayName="IconWithContainer";var Ve="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",Ge={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"},be={full:"w-full",default:"w-fit"},Ue="opacity-50 cursor-not-allowed pointer-events-none",qe="opacity-100 cursor-pointer",Ye={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Qe={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function Xe(e){return e?e==="primary"?"brand":e:"default"}function Je(e){let{variant:t="default",size:o="md",isDisabled:r,fullWidth:a=false,isLoading:n=false}=e,s=Xe(t),i=s==="unstyled"?"":`${Ve} ${Ge[s]}`;s!=="unstyled"&&(i+=` ${$[o].text} ${$[o].height} ${$[o].padding} ${$[o].gap}`),r||n?i+=` ${Ue}`:i+=` ${qe}`,a?i+=` ${be.full}`:i+=` ${be.default}`;let l=s==="brand"?"focus-visible:outline-action-brand":void 0;return [i,pe(),l].filter(Boolean).join(" ")}function S(e){let{icon:t,children:o,isLoading:r=false,loadingText:a,loadingIndicator:n,size:s="md",iconPosition:i="left",iconWeight:l,href:d,className:u,badgeNumber:c,badgeVariant:g="primary",badgePosition:x="top-right",style:v,target:C,rel:k,...y}=e,m=t?jsxRuntime.jsx(R,{name:t,size:s,weight:l}):null,h=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof o=="function"?null:o,i==="right"&&m]}),P=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:n||jsxRuntime.jsx(R,{name:"CircleNotch",size:s,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:h}),a&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:a})]}),f=(c??0)>0,w=tailwindMerge.twMerge(Je(e),u),A=d?{href:d,target:C,rel:k,...y}:{};if(d){let{onPress:B,onPressStart:Tt,onPressEnd:At,onPressChange:$t,onPressUp:_t,onAuxClick:Wt,onContextMenu:Ot,onDoubleClick:jt,...Le}=y;Object.assign(A,Le);}let V=d?jsxRuntime.jsx(reactAriaComponents.Link,{...A,...r&&{"aria-busy":true},style:f?void 0:v,className:w,children:r?P:typeof o=="function"?(function(B){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,o(B),i==="right"&&m]})}):h}):jsxRuntime.jsx(reactAriaComponents.Button,{...y,...r&&{"aria-busy":true},style:f?void 0:v,className:w,children:r?P:typeof o=="function"?(function(B){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,o(B),i==="right"&&m]})}):h});return f?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",u),style:v,children:[V,jsxRuntime.jsx("span",{className:`absolute ${Ye[x]} flex h-5 w-5 items-center justify-center rounded-full ${Qe[g]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):V}function L({primaryAction:e,secondaryAction:t,footerContent:o}){let r=e||t;return !r&&!o?null:jsxRuntime.jsxs("div",{className:"flex h-28 w-full flex-col items-center justify-center border-t p-4",children:[o&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:o}),r&&jsxRuntime.jsxs("div",{className:"flex h-full w-full items-center justify-end gap-3",children:[t&&jsxRuntime.jsx(S,{size:t.size||"lg",variant:t.variant||"secondary",onPress:t.onPress,isLoading:t.isLoading,isDisabled:t.isDisabled,children:t.label}),e&&jsxRuntime.jsx(S,{size:e.size||"lg",variant:e.variant,onPress:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})]})]})}var Ze={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"},et={page:"h-16 leading-[62px]"};function _({tag:e="h1",size:t="lg",height:o,className:r="",children:a}){let n=Ze[t],s=o?et[o]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(n,s,r),children:a})}var N=({title:e,onClose:t,hideCloseIcon:o=false,titleAlign:r="left",hasBackArrow:a=false,onBack:n,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:[a&&jsxRuntime.jsx(S,{variant:"icon",onPress:n,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(_,{size:"xs",children:e}),t&&!o&&jsxRuntime.jsx(S,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(R,{name:"X","data-testid":"close-button"})})]})]});var D=({width:e,height:t,variant:o="rect",animation:r="pulse",gradient:a=false,flex:n=false,stack:s,responsive:i,delay:l=0,adjustAnimationSpeedBasedOnWidth:d=false,ariaLabel:u,className:c,"data-testid":g})=>{let[x,v]=Ee.useState(l===0);if(Ee.useEffect(()=>{if(l>0){let f=setTimeout(()=>v(true),l);return ()=>clearTimeout(f)}},[l]),!x)return null;let C=a?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",k=d&&e?(()=>{let f=typeof e=="number"?e:parseFloat(String(e));return isNaN(f)?"":`animation-duration-[${Math.max(.8,f/100)}s]`})():"",y=r==="pulse"?`animate-pulse ${k}`: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 ${k}`:"",m="rounded-sm";o==="circle"&&(m="rounded-full"),o==="text"&&(m="h-4 w-full rounded-sm");let h=n?"flex-1 min-w-0":"",P=i?Object.entries(i).map(([f,w])=>`${f}:w-[${w}]`).join(" "):"";return s?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":g,children:s.map((f,w)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,y,m,h,P,c),style:{width:f,height:t}},w))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(C,y,m,h,P,c),style:{width:e,height:t},role:"presentation","aria-hidden":!u,"aria-label":u??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"},st="rounded-lg",se={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},lt={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function H({variant:e="outlined",className:t,children:o,isLoading:r=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",it[e],st,t),"data-testid":"card",children:r?jsxRuntime.jsx(D,{width:"100%",height:"100%",className:"rounded-none"}):o})}function ye({title:e,subtitle:t,actions:o,className:r,isLoading:a=false}){return a?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(D,{width:120,height:20}),jsxRuntime.jsx(D,{width:24,height:24})]}),t&&jsxRuntime.jsx(D,{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(_,{tag:"h3",size:"sm",className:"text-text-heading",children:e}):e}),t&&jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:t})]}),o&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:o})]})})}function Pe({src:e,alt:t,aspectRatio:o="auto",className:r,children:a,isLoading:n=false}){return n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",se[o],r),children:jsxRuntime.jsx(D,{width:"100%",height:"100%"})}):a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",se[o],r),children:a}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",se[o],r),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function we({className:e,children:t,isLoading:o=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,e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(D,{width:"100%",height:16}),jsxRuntime.jsx(D,{width:"80%",height:16}),jsxRuntime.jsx(D,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:t}):null}function Ne({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(D,{width:80,height:32}),jsxRuntime.jsx(D,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",lt[o],e),children:t}):null}H.Header=ye;H.Media=Pe;H.Content=we;H.Footer=Ne;var I=class extends Ee.Component{constructor(){super(...arguments);oe(this,"state",{hasError:false});oe(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(H,{children:[this.props.title&&jsxRuntime.jsx(H.Header,{title:this.props.title}),jsxRuntime.jsx(H.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 T({transparent:e=false,className:t,children:o,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(t,(a,n)=>tailwindMerge.twMerge("fixed inset-0 z-50",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(" "),n.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),n.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),a)),children:o})}function X({children:e,title:t,headerContent:o,titleAlign:r="left",hideCloseIcon:a=false,hasBackArrow:n=false,onBack:s,isOpen:i,onClose:l,isDismissable:d=true,transparentOverlay:u=false,primaryAction:c,secondaryAction:g,footerContent:x,maxHeight:v="80vh",height:C,maxWidth:k="640px",contentPadding:y=true,showHandle:m=true,animationVariant:h="scale",className:P}){let[f,w]=Ee.useState(false);if(Ee.useEffect(()=>{if(i){let B=setTimeout(()=>{w(true),setTimeout(()=>w(false),600);},400);return ()=>clearTimeout(B)}},[i]),!i)return null;let A=t||o,V=c||g||x;return jsxRuntime.jsx(I,{children:jsxRuntime.jsx(T,{isOpen:i,onOpenChange:B=>{B||l?.();},isDismissable:d,transparent:u,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",isDismissable:d,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",h==="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)]",h==="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)]",P),style:{maxWidth:k,...C?{height:C}:{maxHeight:v}},children:[m&&jsxRuntime.jsx("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-10 flex justify-center",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]")})}),A&&(n?jsxRuntime.jsx(N,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a||!l,hasBackArrow:true,onBack:s??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(N,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",y?"p-4":"p-0"),children:e}),V&&jsxRuntime.jsx(L,{primaryAction:c,secondaryAction:g,footerContent:x})]})})})})}X.displayName="Tray";function de({isOpen:e,onClose:t,title:o,headerContent:r,titleAlign:a="left",hideCloseIcon:n=false,hasBackArrow:s=false,onBack:i,children:l,primaryAction:d,secondaryAction:u,footerContent:c,transparentOverlay:g=false,maxWidth:x="600px",minWidth:v="400px",maxHeight:C="85vh",height:k,mobileMaxHeight:y="90vh",mobileHeight:m,contentPadding:h=true,className:P}){if(e===false)return null;let f=o||r,w=d||u||c,A=e!==void 0;return ce("(max-width: 767px)")?A?jsxRuntime.jsx(X,{isOpen:e,onClose:t,title:o,headerContent:r,titleAlign:a,hideCloseIcon:n,hasBackArrow:s,onBack:i,primaryAction:d,secondaryAction:u,footerContent:c,transparentOverlay:g,maxHeight:y,height:m,maxWidth:x,contentPadding:h,showHandle:true,animationVariant:"scale",className:P,children:l}):jsxRuntime.jsx(I,{children:jsxRuntime.jsx(T,{isDismissable:true,transparent:g,className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-fit p-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-none","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",P),style:{maxWidth:x,...m?{height:m}:{maxHeight:y}},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"})}),f&&(s?jsxRuntime.jsx(N,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(N,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",h?"px-6 py-6":"p-0"),children:l}),w&&jsxRuntime.jsx(L,{primaryAction:d,secondaryAction:u,footerContent:c})]})})})}):jsxRuntime.jsx(I,{children:jsxRuntime.jsx(T,{...A?{isOpen:e,onOpenChange:B=>{!B&&t&&t();}}:{},isDismissable:true,transparent:g,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4",style:{maxWidth:x},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",P),style:{minWidth:v,...k?{height:k}:{maxHeight:C}},children:[f&&(s?jsxRuntime.jsx(N,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(N,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",h?"px-6 py-6":"p-0"),children:l}),w&&jsxRuntime.jsx(L,{primaryAction:d,secondaryAction:u,footerContent:c})]})})})})}function q(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Ur({formId:e="dialog-form",onSubmit:t,primaryLabel:o="Save",secondaryLabel:r="Cancel",onCancel:a,primaryVariant:n,secondaryVariant:s="secondary",children:i,title:l,...d}){return jsxRuntime.jsx(de,{title:l,primaryAction:{label:o,onPress:()=>{let c=document.getElementById(e);c&&c.requestSubmit();},variant:n},secondaryAction:a?{label:r,onPress:a,variant:s}:void 0,...d,children:jsxRuntime.jsx(q,{id:e,onSubmit:t,children:i})})}function K({children:e,title:t,headerContent:o,titleAlign:r="left",hideCloseIcon:a=false,hasBackArrow:n=false,onBack:s,isOpen:i,slideInFrom:l="right",transparentOverlay:d=false,onClose:u,className:c,primaryAction:g,secondaryAction:x,footerContent:v,contentPadding:C=true,maxWidth:k="400px"}){let[y,m]=Ee.useState(false);if(Ee.useEffect(()=>{if(i){let f=setTimeout(()=>m(true),10);return ()=>clearTimeout(f)}m(false);},[i]),!i)return null;let h=t||o,P=g||x||v;return jsxRuntime.jsx(I,{children:jsxRuntime.jsx(T,{isOpen:i,onOpenChange:f=>!f&&u?.(),isDismissable:true,transparent:d,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex justify-end",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",y?l==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":"",c),style:{[l==="right"?"right":"left"]:0,maxWidth:k,transform:y?void 0:l==="right"?"translateX(100%)":"translateX(-100%)"},children:[h&&(n&&s?jsxRuntime.jsx(N,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a,hasBackArrow:true,onBack:s,onClose:u}):jsxRuntime.jsx(N,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a,onClose:u})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",C?"px-6 py-6":"p-0"),children:e}),P&&jsxRuntime.jsx(L,{primaryAction:g,secondaryAction:x,footerContent:v})]})})})})}K.displayName="Drawer";function la({formId:e="drawer-form",onSubmit:t,primaryLabel:o="Save",secondaryLabel:r="Cancel",onCancel:a,primaryVariant:n,secondaryVariant:s="secondary",children:i,...l}){return jsxRuntime.jsx(K,{primaryAction:{label:o,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:n},secondaryAction:a?{label:r,onPress:a,variant:s}:void 0,...l,children:jsxRuntime.jsx(q,{id:e,onSubmit:t,className:"mt-2",children:i})})}function ua({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 Ft={sm:"gap-2",md:"gap-4",lg:"gap-6"};function It(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 ba({cols:e={base:1},gap:t="lg",className:o,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",It(e),Ft[t],o)})}function Ie({size:e="md",className:t,children:o,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-caption",$[e].text,t),children:o})}function Sa({title:e,description:t,showDivider:o,className:r,children:a,...n}){return jsxRuntime.jsxs("section",{...n,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(_,{tag:"h3",size:"sm",children:e}):e,t?jsxRuntime.jsx(Ie,{size:"lg",children:t}):null]}),jsxRuntime.jsx("div",{className:"flex flex-col gap-6",children:a}),o&&jsxRuntime.jsx("hr",{className:"mt-2 border-border-muted"})]})}function Fa(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function za({steps:e,currentStepId:t,onStepClick:o,className:r}){let a=e.findIndex(n=>n.id===t);return jsxRuntime.jsx("nav",{"aria-label":"Progress",className:tailwindMerge.twMerge("w-full",r),children:jsxRuntime.jsxs("div",{className:"relative mb-20",children:[jsxRuntime.jsxs("div",{className:"absolute top-5 left-0 right-0 flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"w-10 flex-shrink-0"}),e.slice(0,-1).map((n,s)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-0.5 flex-1 transition-colors",s<a?"bg-action-default":"bg-border-default")},s)),jsxRuntime.jsx("div",{className:"w-10 flex-shrink-0"})]}),jsxRuntime.jsx("ol",{className:"relative flex items-start justify-between",children:e.map((n,s)=>{let i=n.id===t,l=s<a,d=o&&(l||i);return jsxRuntime.jsxs("li",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("button",{type:"button",disabled:!d,onClick:()=>d&&o?.(n.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})}),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:n.title}),n.description&&jsxRuntime.jsx("span",{className:"mt-1 text-xs text-text-caption",children:n.description})]})]},n.id)})})]})})}function _a({formId:e,show:t,isSubmitting:o,onCancel:r,primaryLabel:a="Save changes",secondaryLabel:n="Cancel",className:s}){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",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(S,{variant:"secondary",onPress:r,children:n}),jsxRuntime.jsx(S,{type:"submit",form:e,isDisabled:!!o,children:o?"Saving...":a})]})]})}):null}function ja({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Ee__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 Ga({steps:e,initialStepId:t,canNavigate:o}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,a]=Ee__namespace.useState(t||e[0].id),n=e.findIndex(c=>c.id===r),s=n>0,i=n<e.length-1,l=async c=>c===r?true:o&&!await o(r,c)?false:(a(c),true);return {steps:e,currentStepId:r,setCurrentStepId:l,next:async()=>!i||n===-1?false:l(e[n+1].id),prev:async()=>!s||n===-1?false:l(e[n-1].id),hasNext:i,hasPrev:s,stepIndex:n}}exports.DialogForm=Ur;exports.DrawerForm=la;exports.FormActions=ua;exports.FormDivider=Fa;exports.FormGrid=ba;exports.FormSection=Sa;exports.FormStepper=za;exports.SaveBar=_a;exports.UnsavedChangesPrompt=ja;exports.useWizard=Ga;//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|