@texturehq/edges 1.25.2 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RichTextEditor-BGQenUvv.d.cts → RichTextEditor-BhX77nTp.d.cts} +16 -2
- package/dist/{RichTextEditor-BGQenUvv.d.ts → RichTextEditor-BhX77nTp.d.ts} +16 -2
- package/dist/{TimeField-p31z8xSR.d.cts → TimeField-DT3apBHn.d.cts} +49 -6
- package/dist/{TimeField-Blk2Ci2M.d.ts → TimeField-TmPbBV-t.d.ts} +49 -6
- package/dist/{colors-Bw6dREwE.d.ts → colors-BER6l3p0.d.ts} +11 -3
- package/dist/{colors-nZbxzpnU.d.cts → colors-DdsCnLrp.d.cts} +11 -3
- package/dist/components.manifest.json +5 -5
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.cjs.map +1 -1
- package/dist/form/index.d.cts +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/{index-DKA9NMRw.d.ts → index-Dkhk7IbI.d.cts} +5 -1
- package/dist/{index-DKA9NMRw.d.cts → index-Dkhk7IbI.d.ts} +5 -1
- package/dist/index.cjs +20 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -13
- package/dist/index.d.ts +74 -13
- package/dist/index.js +20 -14
- 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 +2 -2
- package/dist/rhf/index.d.ts +2 -2
- package/dist/rhf/index.js +1 -1
- package/dist/rhf/index.js.map +1 -1
- package/dist/server.cjs +2 -2
- 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 +2 -2
- package/dist/server.js.map +1 -1
- package/dist/styles/utilities.css +13 -2
- package/dist/styles.css +46 -18
- package/dist/utilities.manifest.json +1 -1
- package/package.json +1 -1
- package/scripts/setup-cursor-rules.js +4 -4
|
@@ -79,6 +79,7 @@ interface BaseProps {
|
|
|
79
79
|
/** Additional CSS classes to apply */
|
|
80
80
|
className?: string;
|
|
81
81
|
}
|
|
82
|
+
type DescriptionPlacement = "below" | "tooltip" | "inline" | "hidden";
|
|
82
83
|
interface BaseInputProps extends BaseProps {
|
|
83
84
|
/** Whether the input should have a transparent background */
|
|
84
85
|
transparent?: boolean;
|
|
@@ -93,12 +94,25 @@ interface BaseInputProps extends BaseProps {
|
|
|
93
94
|
* @default true
|
|
94
95
|
*/
|
|
95
96
|
reserveErrorSpace?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Where to display the description text
|
|
99
|
+
* - "below": Show below the field (default)
|
|
100
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
101
|
+
* - "inline": Show inline with the label
|
|
102
|
+
* - "hidden": Don't display the description
|
|
103
|
+
* @default "below"
|
|
104
|
+
*/
|
|
105
|
+
descriptionPlacement?: DescriptionPlacement;
|
|
96
106
|
}
|
|
97
107
|
interface LabelProps extends BaseProps {
|
|
98
108
|
/** The label content */
|
|
99
109
|
children: React__default.ReactNode;
|
|
100
110
|
/** Optional tooltip text to show next to the label */
|
|
101
111
|
tooltip?: string;
|
|
112
|
+
/** Optional description to show as tooltip or inline */
|
|
113
|
+
description?: string;
|
|
114
|
+
/** Where to display the description (only used if description is provided) */
|
|
115
|
+
descriptionPlacement?: DescriptionPlacement;
|
|
102
116
|
/** Whether to show a required field indicator (*) */
|
|
103
117
|
isRequired?: boolean;
|
|
104
118
|
/** The ID of the input this label is associated with */
|
|
@@ -214,7 +228,7 @@ declare function getFieldGroupStyles(props: FieldGroupProps): string;
|
|
|
214
228
|
* </Label>
|
|
215
229
|
* ```
|
|
216
230
|
*/
|
|
217
|
-
declare function Label({ children, size, tooltip, isRequired, className, htmlFor, }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
231
|
+
declare function Label({ children, size, tooltip, description, descriptionPlacement, isRequired, className, htmlFor, }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
218
232
|
/**
|
|
219
233
|
* Description component for providing additional context about a form field.
|
|
220
234
|
*
|
|
@@ -379,4 +393,4 @@ interface RichTextEditorProps {
|
|
|
379
393
|
*/
|
|
380
394
|
declare function RichTextEditor({ initialContent, onChange, className, isDisabled, placeholder, id, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
381
395
|
|
|
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
|
|
396
|
+
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 DescriptionPlacement as g, type FieldErrorProps as h, type InputProps as i, type DescriptionProps as j, type FieldGroupProps as k, InputWrapper as l, getInputStateStyles as m, getInputBackgroundStyles as n, getInputBaseStyles as o, getFieldGroupStyles as p, Label as q, Description as r, FieldError as s, Input as t, useInputFocus as u, FieldGroup as v };
|
|
@@ -79,6 +79,7 @@ interface BaseProps {
|
|
|
79
79
|
/** Additional CSS classes to apply */
|
|
80
80
|
className?: string;
|
|
81
81
|
}
|
|
82
|
+
type DescriptionPlacement = "below" | "tooltip" | "inline" | "hidden";
|
|
82
83
|
interface BaseInputProps extends BaseProps {
|
|
83
84
|
/** Whether the input should have a transparent background */
|
|
84
85
|
transparent?: boolean;
|
|
@@ -93,12 +94,25 @@ interface BaseInputProps extends BaseProps {
|
|
|
93
94
|
* @default true
|
|
94
95
|
*/
|
|
95
96
|
reserveErrorSpace?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Where to display the description text
|
|
99
|
+
* - "below": Show below the field (default)
|
|
100
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
101
|
+
* - "inline": Show inline with the label
|
|
102
|
+
* - "hidden": Don't display the description
|
|
103
|
+
* @default "below"
|
|
104
|
+
*/
|
|
105
|
+
descriptionPlacement?: DescriptionPlacement;
|
|
96
106
|
}
|
|
97
107
|
interface LabelProps extends BaseProps {
|
|
98
108
|
/** The label content */
|
|
99
109
|
children: React__default.ReactNode;
|
|
100
110
|
/** Optional tooltip text to show next to the label */
|
|
101
111
|
tooltip?: string;
|
|
112
|
+
/** Optional description to show as tooltip or inline */
|
|
113
|
+
description?: string;
|
|
114
|
+
/** Where to display the description (only used if description is provided) */
|
|
115
|
+
descriptionPlacement?: DescriptionPlacement;
|
|
102
116
|
/** Whether to show a required field indicator (*) */
|
|
103
117
|
isRequired?: boolean;
|
|
104
118
|
/** The ID of the input this label is associated with */
|
|
@@ -214,7 +228,7 @@ declare function getFieldGroupStyles(props: FieldGroupProps): string;
|
|
|
214
228
|
* </Label>
|
|
215
229
|
* ```
|
|
216
230
|
*/
|
|
217
|
-
declare function Label({ children, size, tooltip, isRequired, className, htmlFor, }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
231
|
+
declare function Label({ children, size, tooltip, description, descriptionPlacement, isRequired, className, htmlFor, }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
218
232
|
/**
|
|
219
233
|
* Description component for providing additional context about a form field.
|
|
220
234
|
*
|
|
@@ -379,4 +393,4 @@ interface RichTextEditorProps {
|
|
|
379
393
|
*/
|
|
380
394
|
declare function RichTextEditor({ initialContent, onChange, className, isDisabled, placeholder, id, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
381
395
|
|
|
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
|
|
396
|
+
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 DescriptionPlacement as g, type FieldErrorProps as h, type InputProps as i, type DescriptionProps as j, type FieldGroupProps as k, InputWrapper as l, getInputStateStyles as m, getInputBackgroundStyles as n, getInputBaseStyles as o, getFieldGroupStyles as p, Label as q, Description as r, FieldError as s, Input as t, useInputFocus as u, FieldGroup as v };
|
|
@@ -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 './RichTextEditor-
|
|
4
|
+
import { S as Size, I as Icon, B as BaseInputProps } from './RichTextEditor-BhX77nTp.cjs';
|
|
5
5
|
|
|
6
6
|
interface Item {
|
|
7
7
|
id: string;
|
|
@@ -65,8 +65,13 @@ interface AutocompleteProps {
|
|
|
65
65
|
* @default false
|
|
66
66
|
*/
|
|
67
67
|
reserveErrorSpace?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to hide the dropdown chevron icon
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
hideChevron?: boolean;
|
|
68
73
|
}
|
|
69
|
-
declare function Autocomplete({ label, staticItems, sections, selectedKey, defaultSelectedKey, onSelectionChange, requestConfig, defaultFilter, placeholder, errorMessage, description, size, tooltip, isRequired, isDisabled, isInvalid, validationResult, showErrors, renderItem, renderLeftIcon, renderSection, autoFocus, reserveErrorSpace, }: AutocompleteProps): react_jsx_runtime.JSX.Element;
|
|
74
|
+
declare function Autocomplete({ label, staticItems, sections, selectedKey, defaultSelectedKey, onSelectionChange, requestConfig, defaultFilter, placeholder, errorMessage, description, size, tooltip, isRequired, isDisabled, isInvalid, validationResult, showErrors, renderItem, renderLeftIcon, renderSection, autoFocus, reserveErrorSpace, hideChevron, }: AutocompleteProps): react_jsx_runtime.JSX.Element;
|
|
70
75
|
|
|
71
76
|
type IconName = ComponentProps<typeof Icon>["name"];
|
|
72
77
|
type BaseButtonProps = Omit<ButtonProps$1, "className">;
|
|
@@ -203,8 +208,17 @@ interface NumberFieldProps extends Omit<NumberFieldProps$1, "size" | "className"
|
|
|
203
208
|
isRequired?: boolean;
|
|
204
209
|
className?: string;
|
|
205
210
|
validationResult?: ValidationResult;
|
|
211
|
+
/**
|
|
212
|
+
* Where to display the description text
|
|
213
|
+
* - "below": Show below the field (default)
|
|
214
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
215
|
+
* - "inline": Show inline with the label
|
|
216
|
+
* - "hidden": Don't display the description
|
|
217
|
+
* @default "below"
|
|
218
|
+
*/
|
|
219
|
+
descriptionPlacement?: "below" | "tooltip" | "inline" | "hidden";
|
|
206
220
|
}
|
|
207
|
-
declare function NumberField({ label, description, errorMessage, size, tooltip, isRequired, transparent, validationResult, reserveErrorSpace, ...props }: NumberFieldProps): react_jsx_runtime.JSX.Element;
|
|
221
|
+
declare function NumberField({ label, description, errorMessage, size, tooltip, isRequired, transparent, validationResult, reserveErrorSpace, descriptionPlacement, ...props }: NumberFieldProps): react_jsx_runtime.JSX.Element;
|
|
208
222
|
|
|
209
223
|
interface RadioGroupProps extends Omit<RadioGroupProps$1, "children"> {
|
|
210
224
|
/** Label for the radio group */
|
|
@@ -256,6 +270,8 @@ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "chil
|
|
|
256
270
|
children?: React__default.ReactNode | ((item: T) => React__default.ReactNode);
|
|
257
271
|
/** Custom render function for individual items. When provided, items prop is used to render items automatically */
|
|
258
272
|
renderItem?: (item: T) => React__default.ReactNode;
|
|
273
|
+
/** Custom render function for the selected value display. When provided, this overrides the default SelectValue display */
|
|
274
|
+
renderSelectedValue?: (item: T) => React__default.ReactNode;
|
|
259
275
|
/** Currently selected item's id. Uses the SelectItem's `id` field for stable selection tracking */
|
|
260
276
|
selectedKey?: Key;
|
|
261
277
|
/** Default selected item's id for uncontrolled usage */
|
|
@@ -288,8 +304,17 @@ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "chil
|
|
|
288
304
|
* @default "match"
|
|
289
305
|
*/
|
|
290
306
|
menuWidth?: "match" | "auto";
|
|
307
|
+
/**
|
|
308
|
+
* Where to display the description text
|
|
309
|
+
* - "below": Show below the field (default)
|
|
310
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
311
|
+
* - "inline": Show inline with the label
|
|
312
|
+
* - "hidden": Don't display the description
|
|
313
|
+
* @default "below"
|
|
314
|
+
*/
|
|
315
|
+
descriptionPlacement?: "below" | "tooltip" | "inline" | "hidden";
|
|
291
316
|
}
|
|
292
|
-
declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, renderItem, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, reserveErrorSpace, placement, shouldFlip, menuWidth, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
317
|
+
declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, renderItem, renderSelectedValue, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, reserveErrorSpace, placement, shouldFlip, menuWidth, descriptionPlacement, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
293
318
|
|
|
294
319
|
interface SwitchProps extends Omit<SwitchProps$1, "children"> {
|
|
295
320
|
children: React__default.ReactNode;
|
|
@@ -361,12 +386,21 @@ interface TextFieldProps extends Omit<TextFieldProps$1, "isRequired" | "size" |
|
|
|
361
386
|
* @default false
|
|
362
387
|
*/
|
|
363
388
|
isLoading?: boolean;
|
|
389
|
+
/**
|
|
390
|
+
* Where to display the description text
|
|
391
|
+
* - "below": Show below the field (default)
|
|
392
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
393
|
+
* - "inline": Show inline with the label
|
|
394
|
+
* - "hidden": Don't display the description
|
|
395
|
+
* @default "below"
|
|
396
|
+
*/
|
|
397
|
+
descriptionPlacement?: "below" | "tooltip" | "inline" | "hidden";
|
|
364
398
|
}
|
|
365
399
|
/**
|
|
366
400
|
* Renders an Edges TextField with label, description, validation states and
|
|
367
401
|
* optional search/clear/password affordances.
|
|
368
402
|
*/
|
|
369
|
-
declare function TextField({ label, description, errorMessage, size, tooltip, isRequired, transparent, showSearchIcon, isClearable, onClear, type, validationResult, reserveErrorSpace, isLoading, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
403
|
+
declare function TextField({ label, description, errorMessage, size, tooltip, isRequired, transparent, showSearchIcon, isClearable, onClear, type, validationResult, reserveErrorSpace, isLoading, descriptionPlacement, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
370
404
|
|
|
371
405
|
/**
|
|
372
406
|
* TimeField
|
|
@@ -388,11 +422,20 @@ interface TimeFieldProps extends Omit<TimeFieldProps$1<TimeValue>, "isRequired"
|
|
|
388
422
|
* @default true
|
|
389
423
|
*/
|
|
390
424
|
reserveErrorSpace?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Where to display the description text
|
|
427
|
+
* - "below": Show below the field (default)
|
|
428
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
429
|
+
* - "inline": Show inline with the label
|
|
430
|
+
* - "hidden": Don't display the description
|
|
431
|
+
* @default "below"
|
|
432
|
+
*/
|
|
433
|
+
descriptionPlacement?: "below" | "tooltip" | "inline" | "hidden";
|
|
391
434
|
}
|
|
392
435
|
/**
|
|
393
436
|
* Renders an Edges TimeField with label, description, validation states,
|
|
394
437
|
* and segmented time input.
|
|
395
438
|
*/
|
|
396
|
-
declare function TimeField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, reserveErrorSpace, validationResult, className, ...props }: TimeFieldProps): react_jsx_runtime.JSX.Element;
|
|
439
|
+
declare function TimeField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, reserveErrorSpace, validationResult, className, descriptionPlacement, ...props }: TimeFieldProps): react_jsx_runtime.JSX.Element;
|
|
397
440
|
|
|
398
441
|
export { Autocomplete as A, Button as B, Checkbox as C, NumberField as N, RadioGroup as R, Select as S, TextArea as T, CheckboxGroup as a, ColorField as b, Switch as c, TextField as d, type TimeFieldProps as e, type ColorFieldProps as f, Radio as g, TimeField as h };
|
|
@@ -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 './RichTextEditor-
|
|
4
|
+
import { S as Size, I as Icon, B as BaseInputProps } from './RichTextEditor-BhX77nTp.js';
|
|
5
5
|
|
|
6
6
|
interface Item {
|
|
7
7
|
id: string;
|
|
@@ -65,8 +65,13 @@ interface AutocompleteProps {
|
|
|
65
65
|
* @default false
|
|
66
66
|
*/
|
|
67
67
|
reserveErrorSpace?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to hide the dropdown chevron icon
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
hideChevron?: boolean;
|
|
68
73
|
}
|
|
69
|
-
declare function Autocomplete({ label, staticItems, sections, selectedKey, defaultSelectedKey, onSelectionChange, requestConfig, defaultFilter, placeholder, errorMessage, description, size, tooltip, isRequired, isDisabled, isInvalid, validationResult, showErrors, renderItem, renderLeftIcon, renderSection, autoFocus, reserveErrorSpace, }: AutocompleteProps): react_jsx_runtime.JSX.Element;
|
|
74
|
+
declare function Autocomplete({ label, staticItems, sections, selectedKey, defaultSelectedKey, onSelectionChange, requestConfig, defaultFilter, placeholder, errorMessage, description, size, tooltip, isRequired, isDisabled, isInvalid, validationResult, showErrors, renderItem, renderLeftIcon, renderSection, autoFocus, reserveErrorSpace, hideChevron, }: AutocompleteProps): react_jsx_runtime.JSX.Element;
|
|
70
75
|
|
|
71
76
|
type IconName = ComponentProps<typeof Icon>["name"];
|
|
72
77
|
type BaseButtonProps = Omit<ButtonProps$1, "className">;
|
|
@@ -203,8 +208,17 @@ interface NumberFieldProps extends Omit<NumberFieldProps$1, "size" | "className"
|
|
|
203
208
|
isRequired?: boolean;
|
|
204
209
|
className?: string;
|
|
205
210
|
validationResult?: ValidationResult;
|
|
211
|
+
/**
|
|
212
|
+
* Where to display the description text
|
|
213
|
+
* - "below": Show below the field (default)
|
|
214
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
215
|
+
* - "inline": Show inline with the label
|
|
216
|
+
* - "hidden": Don't display the description
|
|
217
|
+
* @default "below"
|
|
218
|
+
*/
|
|
219
|
+
descriptionPlacement?: "below" | "tooltip" | "inline" | "hidden";
|
|
206
220
|
}
|
|
207
|
-
declare function NumberField({ label, description, errorMessage, size, tooltip, isRequired, transparent, validationResult, reserveErrorSpace, ...props }: NumberFieldProps): react_jsx_runtime.JSX.Element;
|
|
221
|
+
declare function NumberField({ label, description, errorMessage, size, tooltip, isRequired, transparent, validationResult, reserveErrorSpace, descriptionPlacement, ...props }: NumberFieldProps): react_jsx_runtime.JSX.Element;
|
|
208
222
|
|
|
209
223
|
interface RadioGroupProps extends Omit<RadioGroupProps$1, "children"> {
|
|
210
224
|
/** Label for the radio group */
|
|
@@ -256,6 +270,8 @@ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "chil
|
|
|
256
270
|
children?: React__default.ReactNode | ((item: T) => React__default.ReactNode);
|
|
257
271
|
/** Custom render function for individual items. When provided, items prop is used to render items automatically */
|
|
258
272
|
renderItem?: (item: T) => React__default.ReactNode;
|
|
273
|
+
/** Custom render function for the selected value display. When provided, this overrides the default SelectValue display */
|
|
274
|
+
renderSelectedValue?: (item: T) => React__default.ReactNode;
|
|
259
275
|
/** Currently selected item's id. Uses the SelectItem's `id` field for stable selection tracking */
|
|
260
276
|
selectedKey?: Key;
|
|
261
277
|
/** Default selected item's id for uncontrolled usage */
|
|
@@ -288,8 +304,17 @@ interface SelectProps<T extends SelectItem> extends Omit<SelectProps$1<T>, "chil
|
|
|
288
304
|
* @default "match"
|
|
289
305
|
*/
|
|
290
306
|
menuWidth?: "match" | "auto";
|
|
307
|
+
/**
|
|
308
|
+
* Where to display the description text
|
|
309
|
+
* - "below": Show below the field (default)
|
|
310
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
311
|
+
* - "inline": Show inline with the label
|
|
312
|
+
* - "hidden": Don't display the description
|
|
313
|
+
* @default "below"
|
|
314
|
+
*/
|
|
315
|
+
descriptionPlacement?: "below" | "tooltip" | "inline" | "hidden";
|
|
291
316
|
}
|
|
292
|
-
declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, renderItem, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, reserveErrorSpace, placement, shouldFlip, menuWidth, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
317
|
+
declare function Select<T extends SelectItem>({ label, description, errorMessage, children, items, renderItem, renderSelectedValue, size, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectionChange, placeholder, showErrors, tooltip, isRequired, transparent, reserveErrorSpace, placement, shouldFlip, menuWidth, descriptionPlacement, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
293
318
|
|
|
294
319
|
interface SwitchProps extends Omit<SwitchProps$1, "children"> {
|
|
295
320
|
children: React__default.ReactNode;
|
|
@@ -361,12 +386,21 @@ interface TextFieldProps extends Omit<TextFieldProps$1, "isRequired" | "size" |
|
|
|
361
386
|
* @default false
|
|
362
387
|
*/
|
|
363
388
|
isLoading?: boolean;
|
|
389
|
+
/**
|
|
390
|
+
* Where to display the description text
|
|
391
|
+
* - "below": Show below the field (default)
|
|
392
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
393
|
+
* - "inline": Show inline with the label
|
|
394
|
+
* - "hidden": Don't display the description
|
|
395
|
+
* @default "below"
|
|
396
|
+
*/
|
|
397
|
+
descriptionPlacement?: "below" | "tooltip" | "inline" | "hidden";
|
|
364
398
|
}
|
|
365
399
|
/**
|
|
366
400
|
* Renders an Edges TextField with label, description, validation states and
|
|
367
401
|
* optional search/clear/password affordances.
|
|
368
402
|
*/
|
|
369
|
-
declare function TextField({ label, description, errorMessage, size, tooltip, isRequired, transparent, showSearchIcon, isClearable, onClear, type, validationResult, reserveErrorSpace, isLoading, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
403
|
+
declare function TextField({ label, description, errorMessage, size, tooltip, isRequired, transparent, showSearchIcon, isClearable, onClear, type, validationResult, reserveErrorSpace, isLoading, descriptionPlacement, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
370
404
|
|
|
371
405
|
/**
|
|
372
406
|
* TimeField
|
|
@@ -388,11 +422,20 @@ interface TimeFieldProps extends Omit<TimeFieldProps$1<TimeValue>, "isRequired"
|
|
|
388
422
|
* @default true
|
|
389
423
|
*/
|
|
390
424
|
reserveErrorSpace?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Where to display the description text
|
|
427
|
+
* - "below": Show below the field (default)
|
|
428
|
+
* - "tooltip": Show as a tooltip on the label icon
|
|
429
|
+
* - "inline": Show inline with the label
|
|
430
|
+
* - "hidden": Don't display the description
|
|
431
|
+
* @default "below"
|
|
432
|
+
*/
|
|
433
|
+
descriptionPlacement?: "below" | "tooltip" | "inline" | "hidden";
|
|
391
434
|
}
|
|
392
435
|
/**
|
|
393
436
|
* Renders an Edges TimeField with label, description, validation states,
|
|
394
437
|
* and segmented time input.
|
|
395
438
|
*/
|
|
396
|
-
declare function TimeField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, reserveErrorSpace, validationResult, className, ...props }: TimeFieldProps): react_jsx_runtime.JSX.Element;
|
|
439
|
+
declare function TimeField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, reserveErrorSpace, validationResult, className, descriptionPlacement, ...props }: TimeFieldProps): react_jsx_runtime.JSX.Element;
|
|
397
440
|
|
|
398
441
|
export { Autocomplete as A, Button as B, Checkbox as C, NumberField as N, RadioGroup as R, Select as S, TextArea as T, CheckboxGroup as a, ColorField as b, Switch as c, TextField as d, type TimeFieldProps as e, type ColorFieldProps as f, Radio as g, TimeField as h };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as d3_scale from 'd3-scale';
|
|
2
2
|
import { ScaleTime, ScaleLinear } from 'd3-scale';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { ReactNode } from 'react';
|
|
4
|
+
import React__default, { ReactNode, ComponentType } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import { d as IconName } from './RichTextEditor-
|
|
6
|
+
import { d as IconName } from './RichTextEditor-BhX77nTp.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';
|
|
@@ -1586,14 +1586,22 @@ interface TextLinkProps {
|
|
|
1586
1586
|
asButton?: boolean;
|
|
1587
1587
|
onPress?: () => void;
|
|
1588
1588
|
showArrow?: boolean;
|
|
1589
|
+
/**
|
|
1590
|
+
* Custom Link component (e.g., Next.js Link) to handle navigation
|
|
1591
|
+
* If provided, this component will be used instead of a standard <a> tag
|
|
1592
|
+
* @example LinkComponent={Link} (where Link is from 'next/link')
|
|
1593
|
+
*/
|
|
1594
|
+
LinkComponent?: ComponentType<any>;
|
|
1589
1595
|
}
|
|
1590
1596
|
/**
|
|
1591
1597
|
* TextLink
|
|
1592
1598
|
*
|
|
1593
1599
|
* Styled text link component for navigation and actions.
|
|
1594
1600
|
* Supports internal/external links, button mode, and multiple visual variants.
|
|
1601
|
+
*
|
|
1602
|
+
* @param LinkComponent - Optional custom Link component (e.g., Next.js Link) for client-side navigation
|
|
1595
1603
|
*/
|
|
1596
|
-
declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
|
|
1604
|
+
declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, LinkComponent, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
|
|
1597
1605
|
|
|
1598
1606
|
/**
|
|
1599
1607
|
* Entity Configuration
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as d3_scale from 'd3-scale';
|
|
2
2
|
import { ScaleTime, ScaleLinear } from 'd3-scale';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { ReactNode } from 'react';
|
|
4
|
+
import React__default, { ReactNode, ComponentType } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import { d as IconName } from './RichTextEditor-
|
|
6
|
+
import { d as IconName } from './RichTextEditor-BhX77nTp.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';
|
|
@@ -1586,14 +1586,22 @@ interface TextLinkProps {
|
|
|
1586
1586
|
asButton?: boolean;
|
|
1587
1587
|
onPress?: () => void;
|
|
1588
1588
|
showArrow?: boolean;
|
|
1589
|
+
/**
|
|
1590
|
+
* Custom Link component (e.g., Next.js Link) to handle navigation
|
|
1591
|
+
* If provided, this component will be used instead of a standard <a> tag
|
|
1592
|
+
* @example LinkComponent={Link} (where Link is from 'next/link')
|
|
1593
|
+
*/
|
|
1594
|
+
LinkComponent?: ComponentType<any>;
|
|
1589
1595
|
}
|
|
1590
1596
|
/**
|
|
1591
1597
|
* TextLink
|
|
1592
1598
|
*
|
|
1593
1599
|
* Styled text link component for navigation and actions.
|
|
1594
1600
|
* Supports internal/external links, button mode, and multiple visual variants.
|
|
1601
|
+
*
|
|
1602
|
+
* @param LinkComponent - Optional custom Link component (e.g., Next.js Link) for client-side navigation
|
|
1595
1603
|
*/
|
|
1596
|
-
declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
|
|
1604
|
+
declare const TextLink: ({ href, children, className, external, title, variant, onClick, asButton, onPress, showArrow, LinkComponent, }: TextLinkProps) => react_jsx_runtime.JSX.Element;
|
|
1597
1605
|
|
|
1598
1606
|
/**
|
|
1599
1607
|
* Entity Configuration
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.26.0",
|
|
3
3
|
"components": [
|
|
4
4
|
{
|
|
5
5
|
"name": "ActionCell",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
{
|
|
98
98
|
"name": "Autocomplete",
|
|
99
99
|
"category": "Form Controls",
|
|
100
|
-
"description": "Whether to
|
|
100
|
+
"description": "Whether to hide the dropdown chevron icon @default false",
|
|
101
101
|
"importRoot": "@texturehq/edges",
|
|
102
102
|
"importPath": "@texturehq/edges/components/Autocomplete",
|
|
103
103
|
"props": [
|
|
@@ -1704,7 +1704,7 @@
|
|
|
1704
1704
|
{
|
|
1705
1705
|
"name": "NumberField",
|
|
1706
1706
|
"category": "Form Controls",
|
|
1707
|
-
"description": "
|
|
1707
|
+
"description": "Where to display the description text - \"below\": Show below the field (default) - \"tooltip\": Show as a tooltip on the label icon - \"inline\": Show inline with the label - \"hidden\": Don't display the description @default \"below\"",
|
|
1708
1708
|
"importRoot": "@texturehq/edges",
|
|
1709
1709
|
"importPath": "@texturehq/edges/components/NumberField",
|
|
1710
1710
|
"props": [
|
|
@@ -2134,7 +2134,7 @@
|
|
|
2134
2134
|
{
|
|
2135
2135
|
"name": "Select",
|
|
2136
2136
|
"category": "Form Controls",
|
|
2137
|
-
"description": "
|
|
2137
|
+
"description": "Where to display the description text - \"below\": Show below the field (default) - \"tooltip\": Show as a tooltip on the label icon - \"inline\": Show inline with the label - \"hidden\": Don't display the description @default \"below\"",
|
|
2138
2138
|
"importRoot": "@texturehq/edges",
|
|
2139
2139
|
"importPath": "@texturehq/edges/components/Select",
|
|
2140
2140
|
"props": [],
|
|
@@ -2652,7 +2652,7 @@
|
|
|
2652
2652
|
{
|
|
2653
2653
|
"name": "TextLink",
|
|
2654
2654
|
"category": "Navigation",
|
|
2655
|
-
"description": "TextLink Styled text link component for navigation and actions. Supports internal/external links, button mode, and multiple visual variants.",
|
|
2655
|
+
"description": "TextLink Styled text link component for navigation and actions. Supports internal/external links, button mode, and multiple visual variants. @param LinkComponent - Optional custom Link component (e.g., Next.js Link) for client-side navigation",
|
|
2656
2656
|
"importRoot": "@texturehq/edges",
|
|
2657
2657
|
"importPath": "@texturehq/edges/components/TextLink",
|
|
2658
2658
|
"props": [
|
package/dist/form/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),Ke=require('react'),lt=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 Ke__namespace=/*#__PURE__*/_interopNamespace(Ke);var lt__namespace=/*#__PURE__*/_interopNamespace(lt);var at=Object.defineProperty;var nt=(e,t,o)=>t in e?at(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var ge=(e,t,o)=>nt(e,typeof t!="symbol"?t+"":t,o);function De(e,t=false){let[o,r]=Ke.useState(t);return Ke.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 Se(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 G={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},D=Ke.memo(({name:e,size:t="md",color:o,weight:r="regular",className:a,ariaLabel:n,...s})=>{let i=lt__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 G?G[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}`})});D.displayName="Icon";var Ie=Ke.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:p,...c})=>{let g=typeof a=="string"&&a in G?G[a]:a,x=o?typeof o=="string"&&o in G?G[o]:o:g*1.75,y=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:y,style:{width:x,height:x},children:jsxRuntime.jsx(D,{...c,name:s,size:a,color:i,weight:l,className:n,ariaLabel:d})})});Ie.displayName="IconWithContainer";var ut="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",pt={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"},He={full:"w-full",default:"w-fit"},ft="opacity-50 cursor-not-allowed pointer-events-none",mt="opacity-100 cursor-pointer",gt={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},bt={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function ht(e){return e?e==="primary"?"brand":e:"default"}function xt(e){let{variant:t="default",size:o="md",isDisabled:r,fullWidth:a=false,isLoading:n=false}=e,s=ht(t),i=s==="unstyled"?"":`${ut} ${pt[s]}`;s!=="unstyled"&&(i+=` ${$[o].text} ${$[o].height} ${$[o].padding} ${$[o].gap}`),r||n?i+=` ${ft}`:i+=` ${mt}`,a?i+=` ${He.full}`:i+=` ${He.default}`;let l=s==="brand"?"focus-visible:outline-action-brand":void 0;return [i,Se(),l].filter(Boolean).join(" ")}function B(e){let{icon:t,children:o,isLoading:r=false,loadingText:a,loadingIndicator:n,size:s="md",iconPosition:i="left",iconWeight:l,href:d,className:p,badgeNumber:c,badgeVariant:g="primary",badgePosition:x="top-right",style:y,target:R,rel:k,...P}=e,m=t?jsxRuntime.jsx(D,{name:t,size:s,weight:l}):null,v=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof o=="function"?null:o,i==="right"&&m]}),N=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n||jsxRuntime.jsx(D,{name:"CircleNotch",size:s,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:v}),a&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:a})]}),f=(c??0)>0,w=tailwindMerge.twMerge(xt(e),p),T=d?{href:d,target:R,rel:k,...P}:{};if(d){let{onPress:z,onPressStart:q,onPressEnd:se,onPressChange:j,onPressUp:Y,onAuxClick:Re,onContextMenu:ke,onDoubleClick:le,...de}=P;Object.assign(T,de);}let L=d?jsxRuntime.jsx(reactAriaComponents.Link,{...T,...r&&{"aria-busy":true},style:f?void 0:y,className:w,children:r?N:typeof o=="function"?(function(z){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,o(z),i==="right"&&m]})}):v}):jsxRuntime.jsx(reactAriaComponents.Button,{...P,...r&&{"aria-busy":true},style:f?void 0:y,className:w,children:r?N:typeof o=="function"?(function(z){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,o(z),i==="right"&&m]})}):v});return f?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:y,children:[L,jsxRuntime.jsx("span",{className:`absolute ${gt[x]} flex h-5 w-5 items-center justify-center rounded-full ${bt[g]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):L}function _({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(B,{size:t.size||"lg",variant:t.variant||"secondary",onPress:t.onPress,isLoading:t.isLoading,isDisabled:t.isDisabled,children:t.label}),e&&jsxRuntime.jsx(B,{size:e.size||"lg",variant:e.variant,onPress:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})]})]})}var yt={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"},Pt={page:"h-16 leading-[62px]"};function O({tag:e="h1",size:t="lg",height:o,className:r="",children:a}){let n=yt[t],s=o?Pt[o]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(n,s,r),children:a})}var C=({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(B,{variant:"icon",onPress:n,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(D,{name:"CaretLeft","data-testid":"back-arrow"})}),s||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(O,{size:"xs",children:e}),t&&!o&&jsxRuntime.jsx(B,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(D,{name:"X","data-testid":"close-button"})})]})]});var S=({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:p,className:c,"data-testid":g})=>{let[x,y]=Ke.useState(l===0);if(Ke.useEffect(()=>{if(l>0){let f=setTimeout(()=>y(true),l);return ()=>clearTimeout(f)}},[l]),!x)return null;let R=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]`})():"",P=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 v=n?"flex-1 min-w-0":"",N=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(R,P,m,v,N,c),style:{width:f,height:t}},w))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(R,P,m,v,N,c),style:{width:e,height:t},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":g})};var Dt={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",ye={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Bt={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function E({variant:e="outlined",className:t,children:o,isLoading:r=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Dt[e],St,t),"data-testid":"card",children:r?jsxRuntime.jsx(S,{width:"100%",height:"100%",className:"rounded-none"}):o})}function ze({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(S,{width:120,height:20}),jsxRuntime.jsx(S,{width:24,height:24})]}),t&&jsxRuntime.jsx(S,{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(O,{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 Ae({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",ye[o],r),children:jsxRuntime.jsx(S,{width:"100%",height:"100%"})}):a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",ye[o],r),children:a}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",ye[o],r),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function _e({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(S,{width:"100%",height:16}),jsxRuntime.jsx(S,{width:"80%",height:16}),jsxRuntime.jsx(S,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:t}):null}function We({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(S,{width:80,height:32}),jsxRuntime.jsx(S,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Bt[o],e),children:t}):null}E.Header=ze;E.Media=Ae;E.Content=_e;E.Footer=We;var I=class extends Ke.Component{constructor(){super(...arguments);ge(this,"state",{hasError:false});ge(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(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 W({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})}var zt=.3,At=.5;function te({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:p=false,primaryAction:c,secondaryAction:g,footerContent:x,maxHeight:y="80vh",height:R,maxWidth:k="640px",contentPadding:P=true,showHandle:m=true,animationVariant:v="scale",className:N}){let[f,w]=Ke.useState(false),[T,L]=Ke.useState(0),[z,q]=Ke.useState(false),se=Ke.useRef(null),j=Ke.useRef(null),Y=Ke.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});Ke.useEffect(()=>{if(i){let h=setTimeout(()=>{w(true),setTimeout(()=>w(false),600);},400);return ()=>clearTimeout(h)}},[i]),Ke.useEffect(()=>{i||(L(0),q(false),Y.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]);let Re=Ke.useCallback(h=>{d&&(h.pointerType!=="touch"&&h.pointerType!=="pen"||(j.current&&(clearTimeout(j.current),j.current=null),Y.current={isDragging:true,startY:h.clientY,startTime:Date.now(),pointerId:h.pointerId},q(false),h.currentTarget.setPointerCapture(h.pointerId)));},[d]),ke=Ke.useCallback(h=>{let{isDragging:ce,startY:ue,pointerId:pe}=Y.current;if(!ce||h.pointerId!==pe)return;let fe=h.clientY-ue;L(Math.max(0,fe));},[]),le=Ke.useCallback(h=>{let{isDragging:ce,startY:ue,startTime:pe,pointerId:fe}=Y.current;if(!ce||h.pointerId!==fe)return;let me=h.clientY-ue,tt=Date.now()-pe,ot=me/tt;Y.current={isDragging:false,startY:0,startTime:0,pointerId:null};let rt=(se.current?.getBoundingClientRect().height??0)*zt;(me>rt||ot>At&&me>50)&&d?(l?.(),L(0)):(q(true),L(0),j.current=setTimeout(()=>{q(false),j.current=null;},200));},[d,l]);if(!i)return null;let de=t||o,et=c||g||x;return jsxRuntime.jsx(I,{children:jsxRuntime.jsx(W,{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",isDismissable:d,children:jsxRuntime.jsx("div",{ref:se,className:tailwindMerge.twMerge("w-full",z&&"transition-transform duration-200"),style:{transform:T>0?`translateY(${T}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",v==="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)]",v==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",N),style:{maxWidth:k,...R?{height:R}:{maxHeight:y}},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:le,onPointerCancel:le,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]")})}),de&&(n?jsxRuntime.jsx(C,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a||!l,hasBackArrow:true,onBack:s??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(C,{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",P?"p-4":"p-0"),children:e}),et&&jsxRuntime.jsx(_,{primaryAction:c,secondaryAction:g,footerContent:x})]})})})})})}te.displayName="Tray";function Ce({isOpen:e,onClose:t,title:o,headerContent:r,titleAlign:a="left",hideCloseIcon:n=false,hasBackArrow:s=false,onBack:i,children:l,primaryAction:d,secondaryAction:p,footerContent:c,transparentOverlay:g=false,maxWidth:x="600px",minWidth:y="400px",maxHeight:R="85vh",height:k,mobileMaxHeight:P="90vh",mobileHeight:m,contentPadding:v=true,className:N}){if(e===false)return null;let f=o||r,w=d||p||c,T=e!==void 0;return De("(max-width: 767px)")?T?jsxRuntime.jsx(te,{isOpen:e,onClose:t,title:o,headerContent:r,titleAlign:a,hideCloseIcon:n,hasBackArrow:s,onBack:i,primaryAction:d,secondaryAction:p,footerContent:c,transparentOverlay:g,maxHeight:P,height:m,maxWidth:x,contentPadding:v,showHandle:true,animationVariant:"scale",className:N,children:l}):jsxRuntime.jsx(I,{children:jsxRuntime.jsx(W,{isDismissable:true,transparent:g,className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full 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-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",N),style:{...m?{height:m}:{maxHeight:P}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),f&&(s?jsxRuntime.jsx(C,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(C,{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",v?"px-6 py-6":"p-0"),children:l}),w&&jsxRuntime.jsx(_,{primaryAction:d,secondaryAction:p,footerContent:c})]})})})}):jsxRuntime.jsx(I,{children:jsxRuntime.jsx(W,{...T?{isOpen:e,onOpenChange:z=>{!z&&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",N),style:{minWidth:y,...k?{height:k}:{maxHeight:R}},children:[f&&(s?jsxRuntime.jsx(C,{title:o,headerContent:r,titleAlign:a,hideCloseIcon:n||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(C,{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",v?"px-6 py-6":"p-0"),children:l}),w&&jsxRuntime.jsx(_,{primaryAction:d,secondaryAction:p,footerContent:c})]})})})})}function J(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function la({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(Ce,{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(J,{id:e,onSubmit:t,children:i})})}function re({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:p,className:c,primaryAction:g,secondaryAction:x,footerContent:y,contentPadding:R=true,maxWidth:k="400px"}){let[P,m]=Ke.useState(false);if(Ke.useEffect(()=>{if(i){let f=setTimeout(()=>m(true),10);return ()=>clearTimeout(f)}m(false);},[i]),!i)return null;let v=t||o,N=g||x||y;return jsxRuntime.jsx(I,{children:jsxRuntime.jsx(W,{isOpen:i,onOpenChange:f=>!f&&p?.(),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",P?l==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":"",c),style:{[l==="right"?"right":"left"]:0,maxWidth:k,transform:P?void 0:l==="right"?"translateX(100%)":"translateX(-100%)"},children:[v&&(n&&s?jsxRuntime.jsx(C,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a,hasBackArrow:true,onBack:s,onClose:p}):jsxRuntime.jsx(C,{title:t,headerContent:o,titleAlign:r,hideCloseIcon:a,onClose:p})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",R?"px-6 py-6":"p-0"),children:e}),N&&jsxRuntime.jsx(_,{primaryAction:g,secondaryAction:x,footerContent:y})]})})})})}re.displayName="Drawer";function Ca({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(re,{primaryAction:{label:o,onPress:()=>{let p=document.getElementById(e);p&&p.requestSubmit();},variant:n},secondaryAction:a?{label:r,onPress:a,variant:s}:void 0,...l,children:jsxRuntime.jsx(J,{id:e,onSubmit:t,className:"mt-2",children:i})})}function Sa({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 Jt={sm:"gap-2",md:"gap-4",lg:"gap-6"};function Kt(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 Ma({cols:e={base:1},gap:t="lg",className:o,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",Kt(e),Jt[t],o)})}function Qe({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 Ya({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(O,{tag:"h3",size:"sm",children:e}):e,t?jsxRuntime.jsx(Qe,{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 Ga(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function Ja({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(D,{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 on({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(B,{variant:"secondary",onPress:r,children:n}),jsxRuntime.jsx(B,{type:"submit",form:e,isDisabled:!!o,children:o?"Saving...":a})]})]})}):null}function nn({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Ke__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 ln({steps:e,initialStepId:t,canNavigate:o}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,a]=Ke__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=la;exports.DrawerForm=Ca;exports.FormActions=Sa;exports.FormDivider=Ga;exports.FormGrid=Ma;exports.FormSection=Ya;exports.FormStepper=Ja;exports.SaveBar=on;exports.UnsavedChangesPrompt=nn;exports.useWizard=ln;//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),Ke=require('react'),lt=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 Ke__namespace=/*#__PURE__*/_interopNamespace(Ke);var lt__namespace=/*#__PURE__*/_interopNamespace(lt);var nt=Object.defineProperty;var at=(e,o,t)=>o in e?nt(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var be=(e,o,t)=>at(e,typeof o!="symbol"?o+"":o,t);function Se(e,o=false){let[t,r]=Ke.useState(o);return Ke.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=Ke.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...s})=>{let i=lt__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=Ke.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 ut="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",pt={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"},ft="opacity-50 cursor-not-allowed pointer-events-none",mt="opacity-100 cursor-pointer",gt={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},bt={primary:"bg-action-brand text-white",destructive:"bg-action-destructive text-white"};function ht(e){return e?e==="primary"?"brand":e:"default"}function xt(e){let{variant:o="default",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,s=ht(o),i=s==="unstyled"?"":`${ut} ${pt[s]}`;s!=="unstyled"&&(i+=` ${O[t].text} ${O[t].height} ${O[t].padding} ${O[t].gap}`),r||a?i+=` ${ft}`:i+=` ${mt}`,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 k(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:B,...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(xt(e),p),L=d?{href:d,target:D,rel:B,...P}:{};if(d){let{onPress:W,onPressStart:$,onPressEnd:le,onPressChange:Y,onPressUp:G,onAuxClick:Re,onContextMenu:ke,onDoubleClick:de,...ce}=P;Object.assign(L,ce);}let F=d?jsxRuntime.jsx(reactAriaComponents.Link,{...L,...r&&{"aria-busy":true},style:f?void 0:v,className:N,children:r?w:typeof t=="function"?(function(W){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t(W),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(W){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t(W),i==="right"&&m]})}):y});return f?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:v,children:[F,jsxRuntime.jsx("span",{className:`absolute ${gt[h]} flex h-5 w-5 items-center justify-center rounded-full ${bt[g]} text-xs font-medium`,"aria-label":`${c} items`,children:c})]}):F}function A({primaryAction:e,secondaryAction:o,tertiaryAction:t,footerContent:r}){let n=e||o||t;return !n&&!r?null:jsxRuntime.jsxs("div",{className:"flex h-28 w-full flex-col items-center justify-center border-t p-4",children:[r&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:r}),n&&jsxRuntime.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:t&&jsxRuntime.jsx(k,{size:t.size||"lg",variant:t.variant||"destructive",onPress:t.onPress,isLoading:t.isLoading,isDisabled:t.isDisabled,children:t.label})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(k,{size:o.size||"lg",variant:o.variant||"secondary",onPress:o.onPress,isLoading:o.isLoading,isDisabled:o.isDisabled,children:o.label}),e&&jsxRuntime.jsx(k,{size:e.size||"lg",variant:e.variant||"default",onPress:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})]})]})]})}var yt={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"},Pt={page:"h-16 leading-[62px]"};function V({tag:e="h1",size:o="lg",height:t,className:r="",children:n}){let a=yt[o],s=t?Pt[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(k,{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(k,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(R,{name:"X","data-testid":"close-button"})})]})]});var S=({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]=Ke.useState(l===0);if(Ke.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)]",B=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 ${B}`: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 ${B}`:"",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 kt={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",Pe={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Bt={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function T({variant:e="outlined",className:o,children:t,isLoading:r=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",kt[e],St,o),"data-testid":"card",children:r?jsxRuntime.jsx(S,{width:"100%",height:"100%",className:"rounded-none"}):t})}function ze({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(S,{width:120,height:20}),jsxRuntime.jsx(S,{width:24,height:24})]}),o&&jsxRuntime.jsx(S,{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 Ae({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",Pe[t],r),children:jsxRuntime.jsx(S,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Pe[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Pe[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(S,{width:"100%",height:16}),jsxRuntime.jsx(S,{width:"80%",height:16}),jsxRuntime.jsx(S,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:o}):null}function We({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(S,{width:80,height:32}),jsxRuntime.jsx(S,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Bt[t],e),children:o}):null}T.Header=ze;T.Media=Ae;T.Content=_e;T.Footer=We;var M=class extends Ke.Component{constructor(){super(...arguments);be(this,"state",{hasError:false});be(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(T,{children:[this.props.title&&jsxRuntime.jsx(T.Header,{title:this.props.title}),jsxRuntime.jsx(T.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 zt=.3,At=.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:B="640px",contentPadding:P=true,showHandle:m=true,animationVariant:y="scale",className:w}){let[f,N]=Ke.useState(false),[L,F]=Ke.useState(0),[W,$]=Ke.useState(false),le=Ke.useRef(null),Y=Ke.useRef(null),G=Ke.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});Ke.useEffect(()=>{if(i){let x=setTimeout(()=>{N(true),setTimeout(()=>N(false),600);},400);return ()=>clearTimeout(x)}},[i]),Ke.useEffect(()=>{i||(F(0),$(false),G.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]);let Re=Ke.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},$(false),x.currentTarget.setPointerCapture(x.pointerId)));},[d]),ke=Ke.useCallback(x=>{let{isDragging:ue,startY:pe,pointerId:fe}=G.current;if(!ue||x.pointerId!==fe)return;let me=x.clientY-pe;F(Math.max(0,me));},[]),de=Ke.useCallback(x=>{let{isDragging:ue,startY:pe,startTime:fe,pointerId:me}=G.current;if(!ue||x.pointerId!==me)return;let ge=x.clientY-pe,tt=Date.now()-fe,ot=ge/tt;G.current={isDragging:false,startY:0,startTime:0,pointerId:null};let rt=(le.current?.getBoundingClientRect().height??0)*zt;(ge>rt||ot>At&&ge>50)&&d?(l?.(),F(0)):($(true),F(0),Y.current=setTimeout(()=>{$(false),Y.current=null;},200));},[d,l]);if(!i)return null;let ce=o||t,et=c||g||h;return jsxRuntime.jsx(M,{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:le,className:tailwindMerge.twMerge("w-full",W&&"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:B,...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:de,onPointerCancel:de,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]")})}),ce&&(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}),et&&jsxRuntime.jsx(A,{primaryAction:c,secondaryAction:g,footerContent:h})]})})})})})}oe.displayName="Tray";function De({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:B="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,F=e!==void 0;return Se("(max-width: 767px)")?F?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(M,{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(A,{primaryAction:d,secondaryAction:p,tertiaryAction:c,footerContent:g})]})})})}):jsxRuntime.jsx(M,{children:jsxRuntime.jsx(_,{...F?{isOpen:e,onOpenChange:$=>{!$&&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:B}},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(A,{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 dn({formId:e="dialog-form",onSubmit:o,primaryLabel:t="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:s="secondary",children:i,title:l,...d}){return jsxRuntime.jsx(De,{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:B="400px"}){let[P,m]=Ke.useState(false);if(Ke.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(M,{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:B,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(A,{primaryAction:g,secondaryAction:h,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 Jt={sm:"gap-2",md:"gap-4",lg:"gap-6"};function Kt(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",Kt(e),Jt[o],t)})}function Qe({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 Gn({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(Qe,{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 Un(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function Kn({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.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((a,s)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-0.5 flex-1 transition-colors",s<n?"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((a,s)=>{let i=a.id===o,l=s<n,d=t&&(l||i);return jsxRuntime.jsxs("li",{className:"flex flex-col items-center",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})}),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 ra({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(k,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx(k,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function ia({when:e,message:o="You have unsaved changes. Leave anyway?"}){return Ke__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 la({steps:e,initialStepId:o,canNavigate:t}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,n]=Ke__namespace.useState(o||e[0].id),a=e.findIndex(c=>c.id===r),s=a>0,i=a<e.length-1,l=async c=>c===r?true:t&&!await t(r,c)?false:(n(c),true);return {steps:e,currentStepId:r,setCurrentStepId:l,next:async()=>!i||a===-1?false:l(e[a+1].id),prev:async()=>!s||a===-1?false:l(e[a-1].id),hasNext:i,hasPrev:s,stepIndex:a}}exports.DialogForm=dn;exports.DrawerForm=Dn;exports.FormActions=Bn;exports.FormDivider=Un;exports.FormGrid=Hn;exports.FormSection=Gn;exports.FormStepper=Kn;exports.SaveBar=ra;exports.UnsavedChangesPrompt=ia;exports.useWizard=la;//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|