@parrot-co/parrot-ui 1.0.0-beta.0 → 1.0.0-beta.2

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/index.mjs CHANGED
@@ -1,9 +1,11 @@
1
- import * as React36 from 'react';
2
- import React36__default from 'react';
3
- import { TextField, Input as Input$1, Button as Button$1, ToggleButton as ToggleButton$1, NumberField, Group, TextArea, CheckboxGroup as CheckboxGroup$1, CheckboxField, CheckboxButton, MenuTrigger as MenuTrigger$1, Pressable, Popover as Popover$1, Menu as Menu$1, MenuItem as MenuItem$1, MenuSection as MenuSection$1, Header, ListBox as ListBox$1, ListBoxItem as ListBoxItem$1, composeRenderProps, ListBoxSection as ListBoxSection$1, useAsyncList, useFilter, ComboBox as ComboBox$1, RadioField, RadioButton, RadioGroup as RadioGroup$1, Select as Select$1, SelectValue, Calendar as Calendar$1, RangeCalendar as RangeCalendar$1, DateField as DateField$1, TimeField as TimeField$1, DatePicker as DatePicker$1, DateRangePicker as DateRangePicker$1, DropZone, FileTrigger, ProgressBar, SwitchField, SwitchButton, Slider as Slider$1, SliderTrack, SliderThumb, Tabs as Tabs$1, TabList, Tab as Tab$1, TabPanel, Table as Table$1, TableHeader, Column, TableBody, Row, Cell, ModalOverlay, Modal as Modal$1, Dialog, TagGroup as TagGroup$1, TagList, Tag as Tag$1, parseColor, ColorArea as ColorArea$1, ColorThumb, ColorField as ColorField$1, ColorSwatchPicker as ColorSwatchPicker$1, ColorSwatchPickerItem, ColorSwatch, ColorSlider as ColorSlider$1, ToggleButtonGroup, Collection, useContextProps, GroupContext, FieldError, LabelContext, CalendarMonthPicker, CalendarYearPicker, Heading, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, DateInput, DateSegment, TextContext } from 'react-aria-components';
4
- import { twMerge } from 'tailwind-merge';
1
+ import * as React13 from 'react';
2
+ import React13__default from 'react';
3
+ import { UNSTABLE_ToastQueue, TextField, Input as Input$1, Button as Button$1, ToggleButton as ToggleButton$1, NumberField, Group, FieldErrorContext, TextArea, CheckboxGroup as CheckboxGroup$1, CheckboxField, CheckboxButton, MenuTrigger as MenuTrigger$1, Pressable, Popover as Popover$1, Menu as Menu$1, MenuItem as MenuItem$1, MenuSection as MenuSection$1, Header, ListBox as ListBox$1, ListBoxItem as ListBoxItem$1, composeRenderProps, ListBoxSection as ListBoxSection$1, useAsyncList, useFilter, ComboBox as ComboBox$1, RadioField, RadioButton, RadioGroup as RadioGroup$1, Select as Select$1, SelectValue, Calendar as Calendar$1, RangeCalendar as RangeCalendar$1, DateField as DateField$1, TimeField as TimeField$1, DatePicker as DatePicker$1, DateRangePicker as DateRangePicker$1, DropZone, FileTrigger, ProgressBar, SwitchField, SwitchButton, Slider as Slider$1, SliderTrack, SliderThumb, Tabs as Tabs$1, TabList, Tab as Tab$1, TabPanel, Table as Table$1, TableBody, useTableOptions, TableHeader, Column, Collection, Row, Cell, ModalOverlay, Modal as Modal$1, Dialog, TagGroup as TagGroup$1, TagList, Tag as Tag$1, parseColor, ColorArea as ColorArea$1, ColorThumb, ColorField as ColorField$1, ColorSwatchPicker as ColorSwatchPicker$1, ColorSwatchPickerItem, ColorSwatch, ColorSlider as ColorSlider$1, ToggleButtonGroup, UNSTABLE_ToastRegion, TooltipTrigger, Tooltip as Tooltip$1, OverlayArrow, useContextProps, GroupContext, FieldError, LabelContext, CalendarMonthPicker, CalendarYearPicker, Heading, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, DateInput, DateSegment, UNSTABLE_Toast, UNSTABLE_ToastContent, Text as Text$1, TextContext } from 'react-aria-components';
4
+ import { OTPInput, REGEXP_ONLY_DIGITS_AND_CHARS, REGEXP_ONLY_DIGITS, OTPInputContext } from 'input-otp';
5
5
  import { parseDate, parseTime } from '@internationalized/date';
6
6
  import { useOverlayTriggerState } from 'react-stately';
7
+ import { flushSync } from 'react-dom';
8
+ import { useHover, useFocusWithin, mergeProps } from 'react-aria';
7
9
 
8
10
  // src/components/input/input.tsx
9
11
 
@@ -66,7 +68,7 @@ function cx(...args) {
66
68
  return classStr;
67
69
  }
68
70
  function cn(...args) {
69
- return twMerge(cx(...args));
71
+ return cx(...args);
70
72
  }
71
73
  var validDOMProperties = /* @__PURE__ */ new Set([
72
74
  // Common HTML attributes
@@ -288,7 +290,7 @@ function InputLabel({
288
290
  LabelContext
289
291
  );
290
292
  const { elementType: ElementType = "label", ...labelProps } = merged;
291
- return /* @__PURE__ */ React36.createElement(
293
+ return /* @__PURE__ */ React13.createElement(
292
294
  ElementType,
293
295
  {
294
296
  ...labelProps,
@@ -305,7 +307,7 @@ function InputError({
305
307
  className,
306
308
  ...props
307
309
  }) {
308
- return /* @__PURE__ */ React36.createElement(
310
+ return /* @__PURE__ */ React13.createElement(
309
311
  FieldError,
310
312
  {
311
313
  ...props,
@@ -316,7 +318,7 @@ function InputError({
316
318
  children
317
319
  );
318
320
  }
319
- var SpaceContext = React36.createContext({ classNames: {}, compactItemWrapperAdjust: "" });
321
+ var SpaceContext = React13.createContext({ classNames: {}, compactItemWrapperAdjust: "" });
320
322
  var GAP_CLASS = {
321
323
  none: "gap-0",
322
324
  "4xs": "gap-0.5",
@@ -341,13 +343,13 @@ function Space({
341
343
  style,
342
344
  styles
343
345
  }) {
344
- const childrenCount = React36.Children.count(children);
345
- const nodes = React36.useMemo(() => {
346
- return React36.Children.map(children, (child, index) => {
346
+ const childrenCount = React13.Children.count(children);
347
+ const nodes = React13.useMemo(() => {
348
+ return React13.Children.map(children, (child, index) => {
347
349
  const isFirstChild = index == 0;
348
350
  const isLastChild = index == childrenCount - 1;
349
- if (!React36.isValidElement(child)) return null;
350
- return /* @__PURE__ */ React36.createElement(
351
+ if (!React13.isValidElement(child)) return null;
352
+ return /* @__PURE__ */ React13.createElement(
351
353
  SpaceContext.Provider,
352
354
  {
353
355
  value: {
@@ -363,7 +365,7 @@ function Space({
363
365
  );
364
366
  });
365
367
  }, [children]);
366
- return /* @__PURE__ */ React36.createElement(
368
+ return /* @__PURE__ */ React13.createElement(
367
369
  "div",
368
370
  {
369
371
  "data-compact": compact,
@@ -380,15 +382,15 @@ function Space({
380
382
  );
381
383
  }
382
384
  function useSpace() {
383
- return React36.useContext(SpaceContext);
385
+ return React13.useContext(SpaceContext);
384
386
  }
385
- var ThemeContext = React36.createContext(null);
387
+ var ThemeContext = React13.createContext(null);
386
388
  function ThemeProvider(props) {
387
389
  const { children, className, ...themeProps } = props;
388
- return /* @__PURE__ */ React36.createElement(ThemeContext.Provider, { value: themeProps }, /* @__PURE__ */ React36.createElement(
390
+ return /* @__PURE__ */ React13.createElement(ThemeContext.Provider, { value: themeProps }, /* @__PURE__ */ React13.createElement(
389
391
  "div",
390
392
  {
391
- "data-theme": themeProps.appearance,
393
+ "data-theme": themeProps.colorScheme,
392
394
  "data-radius": themeProps.radius,
393
395
  "data-color": themeProps.color,
394
396
  className: cn("parrot-theme", className)
@@ -397,7 +399,7 @@ function ThemeProvider(props) {
397
399
  ));
398
400
  }
399
401
  function useTheme(options) {
400
- const theme = React36.useContext(ThemeContext);
402
+ const theme = React13.useContext(ThemeContext);
401
403
  if (!theme && options?.requireThemeProvider)
402
404
  throw new Error("No theme found");
403
405
  return theme;
@@ -410,14 +412,14 @@ function Field({
410
412
  error,
411
413
  color = "gray",
412
414
  radius,
413
- size = "md",
415
+ size,
414
416
  className,
415
417
  classNames,
416
418
  style,
417
419
  styles,
418
420
  prepend,
419
421
  append,
420
- appearance = "outline",
422
+ appearance,
421
423
  validationStatus,
422
424
  children,
423
425
  replaceDefaultControlWrapper,
@@ -427,16 +429,18 @@ function Field({
427
429
  }) {
428
430
  const space = useSpace();
429
431
  const theme = useTheme();
430
- const controlRef = React36__default.useRef(null);
432
+ const resolvedSize = size ?? theme?.size ?? "md";
433
+ const resolvedAppearance = appearance ?? theme?.inputAppearance ?? "outline";
434
+ const controlRef = React13__default.useRef(null);
431
435
  const [, groupRef] = useContextProps({}, controlRef, GroupContext);
432
- return /* @__PURE__ */ React36__default.createElement(
436
+ return /* @__PURE__ */ React13__default.createElement(
433
437
  "div",
434
438
  {
435
439
  ref: wrapperRef,
436
440
  ...filterDOMProps(props),
437
441
  "data-color": color,
438
442
  "data-radius": radius ?? theme?.radius ?? "lg",
439
- "data-size": size,
443
+ "data-size": resolvedSize,
440
444
  className: cn(
441
445
  "prt-input-group flex flex-col gap-1",
442
446
  space.compactItemWrapperAdjust,
@@ -445,7 +449,7 @@ function Field({
445
449
  ),
446
450
  style: { ...style, ...styles?.wrapper }
447
451
  },
448
- label && /* @__PURE__ */ React36__default.createElement(
452
+ label && /* @__PURE__ */ React13__default.createElement(
449
453
  InputLabel,
450
454
  {
451
455
  style: styles?.label,
@@ -454,7 +458,7 @@ function Field({
454
458
  },
455
459
  label
456
460
  ),
457
- !replaceDefaultControlWrapper && /* @__PURE__ */ React36__default.createElement(
461
+ !replaceDefaultControlWrapper && /* @__PURE__ */ React13__default.createElement(
458
462
  "div",
459
463
  {
460
464
  ref: groupRef,
@@ -463,16 +467,16 @@ function Field({
463
467
  space.classNames
464
468
  ),
465
469
  "data-has-error": !!error,
466
- "data-appearance": appearance,
470
+ "data-appearance": resolvedAppearance,
467
471
  "data-disabled": isDisabled
468
472
  },
469
- prepend && /* @__PURE__ */ React36__default.createElement("div", { className: "add-on add-on-left flex items-center" }, prepend),
473
+ prepend && /* @__PURE__ */ React13__default.createElement("div", { className: "add-on add-on-left flex items-center" }, prepend),
470
474
  children,
471
- append && /* @__PURE__ */ React36__default.createElement("div", { className: "add-on add-on-right flex items-center" }, append)
475
+ append && /* @__PURE__ */ React13__default.createElement("div", { className: "add-on add-on-right flex items-center" }, append)
472
476
  ),
473
477
  replaceDefaultControlWrapper && children,
474
- error && /* @__PURE__ */ React36__default.createElement(InputError, { validationStatus }, error),
475
- description && /* @__PURE__ */ React36__default.createElement(
478
+ error && /* @__PURE__ */ React13__default.createElement(InputError, { validationStatus }, error),
479
+ description && /* @__PURE__ */ React13__default.createElement(
476
480
  FieldDescription,
477
481
  {
478
482
  style: styles?.description,
@@ -493,7 +497,7 @@ function FieldDescription({
493
497
  null,
494
498
  TextContext
495
499
  );
496
- return /* @__PURE__ */ React36__default.createElement(
500
+ return /* @__PURE__ */ React13__default.createElement(
497
501
  "div",
498
502
  {
499
503
  ...merged,
@@ -528,7 +532,7 @@ function Input({
528
532
  placeholder,
529
533
  ...textFieldProps
530
534
  }) {
531
- return /* @__PURE__ */ React36.createElement(TextField, { ...textFieldProps, onChange, isInvalid: !!error }, /* @__PURE__ */ React36.createElement(
535
+ return /* @__PURE__ */ React13.createElement(TextField, { ...textFieldProps, onChange, isInvalid: !!error }, /* @__PURE__ */ React13.createElement(
532
536
  Field,
533
537
  {
534
538
  className,
@@ -547,7 +551,7 @@ function Input({
547
551
  appearance,
548
552
  validationStatus
549
553
  },
550
- /* @__PURE__ */ React36.createElement(
554
+ /* @__PURE__ */ React13.createElement(
551
555
  Input$1,
552
556
  {
553
557
  ref: inputRef,
@@ -566,15 +570,16 @@ function Loader({
566
570
  classNames,
567
571
  style,
568
572
  styles,
569
- size = "sm",
573
+ size,
570
574
  label = "Loading",
571
575
  ref,
572
576
  ...props
573
577
  }) {
574
578
  const theme = useTheme();
575
579
  const resolvedColor = color ?? theme?.color;
576
- const id2 = React36.useId();
577
- return /* @__PURE__ */ React36.createElement(
580
+ const resolvedSize = size ?? theme?.size ?? "sm";
581
+ const id2 = React13.useId();
582
+ return /* @__PURE__ */ React13.createElement(
578
583
  "div",
579
584
  {
580
585
  "data-color": resolvedColor,
@@ -585,16 +590,16 @@ function Loader({
585
590
  ref,
586
591
  ...props
587
592
  },
588
- /* @__PURE__ */ React36.createElement(
593
+ /* @__PURE__ */ React13.createElement(
589
594
  "svg",
590
595
  {
591
596
  className: cn("prt-loader-icon", classNames?.icon),
592
597
  style: styles?.icon,
593
- "data-size": size,
598
+ "data-size": resolvedSize,
594
599
  viewBox: "0 0 24 24",
595
600
  "aria-hidden": "true"
596
601
  },
597
- /* @__PURE__ */ React36.createElement("defs", null, /* @__PURE__ */ React36.createElement(
602
+ /* @__PURE__ */ React13.createElement("defs", null, /* @__PURE__ */ React13.createElement(
598
603
  "linearGradient",
599
604
  {
600
605
  id: `${id2}-a`,
@@ -603,9 +608,9 @@ function Loader({
603
608
  y1: "5.271%",
604
609
  y2: "91.793%"
605
610
  },
606
- /* @__PURE__ */ React36.createElement("stop", { offset: "0%", stopColor: "currentColor" }),
607
- /* @__PURE__ */ React36.createElement("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0.55" })
608
- ), /* @__PURE__ */ React36.createElement(
611
+ /* @__PURE__ */ React13.createElement("stop", { offset: "0%", stopColor: "currentColor" }),
612
+ /* @__PURE__ */ React13.createElement("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0.55" })
613
+ ), /* @__PURE__ */ React13.createElement(
609
614
  "linearGradient",
610
615
  {
611
616
  id: `${id2}-b`,
@@ -614,17 +619,17 @@ function Loader({
614
619
  y1: "15.24%",
615
620
  y2: "87.15%"
616
621
  },
617
- /* @__PURE__ */ React36.createElement("stop", { offset: "0%", stopColor: "currentColor", stopOpacity: "0" }),
618
- /* @__PURE__ */ React36.createElement("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0.55" })
622
+ /* @__PURE__ */ React13.createElement("stop", { offset: "0%", stopColor: "currentColor", stopOpacity: "0" }),
623
+ /* @__PURE__ */ React13.createElement("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0.55" })
619
624
  )),
620
- /* @__PURE__ */ React36.createElement("g", { fill: "none" }, /* @__PURE__ */ React36.createElement(
625
+ /* @__PURE__ */ React13.createElement("g", { fill: "none" }, /* @__PURE__ */ React13.createElement(
621
626
  "path",
622
627
  {
623
628
  d: "M8.749.021a1.5 1.5 0 0 1 .497 2.958A7.5 7.5 0 0 0 3 10.375a7.5 7.5 0 0 0 7.5 7.5v3c-5.799 0-10.5-4.7-10.5-10.5C0 5.23 3.726.865 8.749.021",
624
629
  fill: `url(#${id2}-a)`,
625
630
  transform: "translate(1.5 1.625)"
626
631
  }
627
- ), /* @__PURE__ */ React36.createElement(
632
+ ), /* @__PURE__ */ React13.createElement(
628
633
  "path",
629
634
  {
630
635
  d: "M15.392 2.673a1.5 1.5 0 0 1 2.119-.115A10.48 10.48 0 0 1 21 10.375c0 5.8-4.701 10.5-10.5 10.5v-3a7.5 7.5 0 0 0 5.007-13.084a1.5 1.5 0 0 1-.115-2.118",
@@ -650,7 +655,7 @@ function omitNullOrUndefined(object) {
650
655
  }
651
656
 
652
657
  // src/components/button/button-group.tsx
653
- var ButtonGroupContext = React36.createContext({});
658
+ var ButtonGroupContext = React13.createContext({});
654
659
  function ButtonGroup({
655
660
  color,
656
661
  variant,
@@ -670,7 +675,7 @@ function ButtonGroup({
670
675
  size,
671
676
  radius
672
677
  });
673
- return /* @__PURE__ */ React36.createElement(ButtonGroupContext.Provider, { value: cleanProps }, /* @__PURE__ */ React36.createElement(
678
+ return /* @__PURE__ */ React13.createElement(ButtonGroupContext.Provider, { value: cleanProps }, /* @__PURE__ */ React13.createElement(
674
679
  Space,
675
680
  {
676
681
  className,
@@ -684,7 +689,7 @@ function ButtonGroup({
684
689
  ));
685
690
  }
686
691
  function useButtonGroup() {
687
- return React36.useContext(ButtonGroupContext);
692
+ return React13.useContext(ButtonGroupContext);
688
693
  }
689
694
 
690
695
  // src/components/button/button.tsx
@@ -697,23 +702,24 @@ function Button(props) {
697
702
  variant = "solid",
698
703
  append,
699
704
  prepend,
700
- size = "md",
705
+ size,
701
706
  children,
702
707
  className,
703
708
  isLoading,
704
- radius = "full",
709
+ radius,
705
710
  isIconButton,
706
711
  style,
707
712
  classNames,
708
713
  styles,
709
714
  ...otherProps
710
715
  } = { ...buttonGroupProps, ...props };
711
- return /* @__PURE__ */ React36.createElement(
716
+ const resolvedSize = size ?? theme?.size ?? "md";
717
+ return /* @__PURE__ */ React13.createElement(
712
718
  Button$1,
713
719
  {
714
720
  style: { ...style, ...styles?.wrapper },
715
- "data-size": size,
716
- "data-radius": radius,
721
+ "data-size": resolvedSize,
722
+ "data-radius": radius ?? theme?.radius ?? "full",
717
723
  "data-icon-button": isIconButton,
718
724
  "data-loading": isLoading,
719
725
  "aria-busy": isLoading,
@@ -729,7 +735,7 @@ function Button(props) {
729
735
  },
730
736
  prepend,
731
737
  isIconButton && isLoading ? null : children,
732
- isLoading ? /* @__PURE__ */ React36.createElement(
738
+ isLoading ? /* @__PURE__ */ React13.createElement(
733
739
  Loader,
734
740
  {
735
741
  color,
@@ -741,9 +747,9 @@ function Button(props) {
741
747
  );
742
748
  }
743
749
  function IconButton({ children, ...props }) {
744
- return /* @__PURE__ */ React36__default.createElement(Button, { isIconButton: true, ...props }, children);
750
+ return /* @__PURE__ */ React13__default.createElement(Button, { isIconButton: true, ...props }, children);
745
751
  }
746
- var ToggleButtonGroupContext = React36.createContext({});
752
+ var ToggleButtonGroupContext = React13.createContext({});
747
753
  function ToggleButton({
748
754
  idleColor,
749
755
  idleVariant,
@@ -763,15 +769,15 @@ function ToggleButton({
763
769
  }) {
764
770
  const space = useSpace();
765
771
  const theme = useTheme();
766
- const group = React36.useContext(ToggleButtonGroupContext);
772
+ const group = React13.useContext(ToggleButtonGroupContext);
767
773
  const _idleColor = idleColor ?? group.idleColor ?? "gray";
768
774
  const _idleVariant = idleVariant ?? group.idleVariant ?? "outline";
769
775
  const _activeColor = activeColor ?? group.activeColor ?? theme?.color ?? "primary";
770
776
  const _activeVariant = activeVariant ?? group.activeVariant ?? "solid";
771
- const _size = size ?? group.size ?? "md";
777
+ const _size = size ?? group.size ?? theme?.size ?? "md";
772
778
  const _radius = radius ?? group.radius ?? "full";
773
779
  const _isIconButton = isIconButton ?? group.isIconButton;
774
- return /* @__PURE__ */ React36.createElement(
780
+ return /* @__PURE__ */ React13.createElement(
775
781
  ToggleButton$1,
776
782
  {
777
783
  ...props,
@@ -782,7 +788,7 @@ function ToggleButton({
782
788
  classNames?.wrapper
783
789
  ),
784
790
  style: { ...style, ...styles?.wrapper },
785
- render: (domProps, { isSelected }) => /* @__PURE__ */ React36.createElement(
791
+ render: (domProps, { isSelected }) => /* @__PURE__ */ React13.createElement(
786
792
  "button",
787
793
  {
788
794
  ...domProps,
@@ -804,7 +810,7 @@ function ToggleButton({
804
810
  // src/components/input/number-input.tsx
805
811
  function NumberInput({
806
812
  appearance = "outline",
807
- size = "md",
813
+ size,
808
814
  color = "gray",
809
815
  classNames,
810
816
  styles,
@@ -825,19 +831,21 @@ function NumberInput({
825
831
  ...props
826
832
  }) {
827
833
  const space = useSpace();
828
- return /* @__PURE__ */ React36.createElement(
834
+ const theme = useTheme();
835
+ const resolvedSize = size ?? theme?.size ?? "md";
836
+ return /* @__PURE__ */ React13.createElement(
829
837
  NumberField,
830
838
  {
831
839
  ...props,
832
840
  isInvalid: !!error,
833
841
  "aria-label": props["aria-label"] ?? "number input"
834
842
  },
835
- /* @__PURE__ */ React36.createElement(
843
+ /* @__PURE__ */ React13.createElement(
836
844
  Field,
837
845
  {
838
846
  classNames,
839
847
  color,
840
- size,
848
+ size: resolvedSize,
841
849
  radius,
842
850
  error,
843
851
  label,
@@ -845,19 +853,19 @@ function NumberInput({
845
853
  validationStatus,
846
854
  replaceDefaultControlWrapper: true
847
855
  },
848
- /* @__PURE__ */ React36.createElement(Group, { className: "prt-input-container", style: { display: "flex", gap: 4 } }, showSteppers && /* @__PURE__ */ React36.createElement(
856
+ /* @__PURE__ */ React13.createElement(Group, { className: "prt-input-container", style: { display: "flex", gap: 4 } }, showSteppers && /* @__PURE__ */ React13.createElement(
849
857
  IconButton,
850
858
  {
851
859
  slot: "decrement",
852
860
  radius: "md",
853
861
  color,
854
862
  variant: "outline",
855
- size,
863
+ size: resolvedSize,
856
864
  className: classNames?.decrement,
857
865
  style: styles?.decrement
858
866
  },
859
867
  decrementIcon
860
- ), /* @__PURE__ */ React36.createElement(
868
+ ), /* @__PURE__ */ React13.createElement(
861
869
  Input$1,
862
870
  {
863
871
  style: styles?.input,
@@ -873,14 +881,14 @@ function NumberInput({
873
881
  "data-has-left-addon": !!prepend,
874
882
  "data-has-right-addon": !!append
875
883
  }
876
- ), showSteppers && /* @__PURE__ */ React36.createElement(
884
+ ), showSteppers && /* @__PURE__ */ React13.createElement(
877
885
  IconButton,
878
886
  {
879
887
  slot: "increment",
880
888
  radius: "md",
881
889
  color,
882
890
  variant: "outline",
883
- size,
891
+ size: resolvedSize,
884
892
  className: classNames?.increment,
885
893
  style: styles?.increment
886
894
  },
@@ -890,46 +898,219 @@ function NumberInput({
890
898
  );
891
899
  }
892
900
  function HiCheck({ size = "1em", ...props }) {
893
- return /* @__PURE__ */ React36.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }));
901
+ return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }));
894
902
  }
895
903
  function HiChevronDown({ size = "1em", ...props }) {
896
- return /* @__PURE__ */ React36.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }));
904
+ return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }));
897
905
  }
898
906
  function HiChevronLeft({ size = "1em", ...props }) {
899
- return /* @__PURE__ */ React36.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { fillRule: "evenodd", d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z", clipRule: "evenodd" }));
907
+ return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z", clipRule: "evenodd" }));
900
908
  }
901
909
  function HiChevronRight({ size = "1em", ...props }) {
902
- return /* @__PURE__ */ React36.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { fillRule: "evenodd", d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", clipRule: "evenodd" }));
910
+ return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", clipRule: "evenodd" }));
903
911
  }
904
912
  function HiChevronUp({ size = "1em", ...props }) {
905
- return /* @__PURE__ */ React36.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { fillRule: "evenodd", d: "M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z", clipRule: "evenodd" }));
913
+ return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z", clipRule: "evenodd" }));
906
914
  }
907
915
  function HiOutlineCalendar({ size = "1em", ...props }) {
908
- return /* @__PURE__ */ React36.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }));
916
+ return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }));
909
917
  }
910
918
  function HiOutlineCheckCircle({ size = "1em", ...props }) {
911
- return /* @__PURE__ */ React36.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }));
919
+ return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }));
912
920
  }
913
921
  function HiOutlineDocumentAdd({ size = "1em", ...props }) {
914
- return /* @__PURE__ */ React36.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }));
922
+ return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }));
915
923
  }
916
924
  function HiOutlineExclamationCircle({ size = "1em", ...props }) {
917
- return /* @__PURE__ */ React36.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }));
925
+ return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }));
926
+ }
927
+ function HiOutlineInformationCircle({ size = "1em", ...props }) {
928
+ return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }));
918
929
  }
919
930
  function HiOutlinePaperClip({ size = "1em", ...props }) {
920
- return /* @__PURE__ */ React36.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" }));
931
+ return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" }));
921
932
  }
922
933
  function HiOutlineRefresh({ size = "1em", ...props }) {
923
- return /* @__PURE__ */ React36.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }));
934
+ return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }));
924
935
  }
925
936
  function HiOutlineTrash({ size = "1em", ...props }) {
926
- return /* @__PURE__ */ React36.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }));
937
+ return /* @__PURE__ */ React13.createElement("svg", { fill: "none", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }));
927
938
  }
928
939
  function HiSelector({ size = "1em", ...props }) {
929
- return /* @__PURE__ */ React36.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { fillRule: "evenodd", d: "M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z", clipRule: "evenodd" }));
940
+ return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z", clipRule: "evenodd" }));
930
941
  }
931
942
  function HiX({ size = "1em", ...props }) {
932
- return /* @__PURE__ */ React36.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React36.createElement("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }));
943
+ return /* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", width: size, height: size, ...props }, /* @__PURE__ */ React13.createElement("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }));
944
+ }
945
+ var PATTERNS = {
946
+ numeric: REGEXP_ONLY_DIGITS,
947
+ alphanumeric: REGEXP_ONLY_DIGITS_AND_CHARS,
948
+ all: void 0
949
+ };
950
+ var INPUT_MODE = {
951
+ numeric: "numeric",
952
+ alphanumeric: "text",
953
+ all: "text"
954
+ };
955
+ var PinInputConfigContext = React13.createContext(null);
956
+ function usePinInputConfig() {
957
+ const ctx = React13.useContext(PinInputConfigContext);
958
+ if (!ctx) {
959
+ throw new Error(
960
+ "PinInput compound components must be rendered inside <PinInput>"
961
+ );
962
+ }
963
+ return ctx;
964
+ }
965
+ function PinInput({
966
+ value,
967
+ defaultValue,
968
+ onChange,
969
+ onComplete,
970
+ length,
971
+ maxLength: maxLength2,
972
+ type = "numeric",
973
+ pattern: pattern2,
974
+ mask = false,
975
+ placeholder,
976
+ isReadOnly = false,
977
+ autoFocus,
978
+ name,
979
+ groupSize,
980
+ separator,
981
+ children,
982
+ inputRef: inputRefProp,
983
+ classNames,
984
+ styles,
985
+ ...fieldProps
986
+ }) {
987
+ const resolvedMax = maxLength2 ?? length ?? 6;
988
+ const isDisabled = fieldProps.isDisabled ?? false;
989
+ const isInvalid = !!fieldProps.error;
990
+ const isControlled = value !== void 0;
991
+ const [internalValue, setInternalValue] = React13.useState(defaultValue ?? "");
992
+ const currentValue = isControlled ? value : internalValue;
993
+ function handleChange(next) {
994
+ if (!isControlled) setInternalValue(next);
995
+ onChange?.(next);
996
+ }
997
+ const config = React13.useMemo(
998
+ () => ({ mask, placeholder, isDisabled, isInvalid }),
999
+ [mask, placeholder, isDisabled, isInvalid]
1000
+ );
1001
+ const fieldError = React13.useMemo(
1002
+ () => ({
1003
+ isInvalid,
1004
+ validationErrors: [],
1005
+ validationDetails: {}
1006
+ }),
1007
+ [isInvalid]
1008
+ );
1009
+ const content = children ?? renderSlots(resolvedMax, groupSize, separator, classNames?.slot);
1010
+ return /* @__PURE__ */ React13.createElement(PinInputConfigContext.Provider, { value: config }, /* @__PURE__ */ React13.createElement(FieldErrorContext.Provider, { value: fieldError }, /* @__PURE__ */ React13.createElement(
1011
+ Field,
1012
+ {
1013
+ ...fieldProps,
1014
+ classNames,
1015
+ styles,
1016
+ replaceDefaultControlWrapper: true
1017
+ },
1018
+ /* @__PURE__ */ React13.createElement(
1019
+ "div",
1020
+ {
1021
+ className: cn("prt-pin", classNames?.control),
1022
+ style: styles?.control,
1023
+ "data-disabled": isDisabled || void 0,
1024
+ "data-invalid": isInvalid || void 0
1025
+ },
1026
+ /* @__PURE__ */ React13.createElement(
1027
+ OTPInput,
1028
+ {
1029
+ ref: inputRefProp,
1030
+ value: currentValue,
1031
+ onChange: handleChange,
1032
+ onComplete,
1033
+ maxLength: resolvedMax,
1034
+ pattern: pattern2?.source ?? PATTERNS[type],
1035
+ inputMode: INPUT_MODE[type],
1036
+ textAlign: "center",
1037
+ autoComplete: "one-time-code",
1038
+ autoCorrect: "off",
1039
+ autoCapitalize: "off",
1040
+ spellCheck: false,
1041
+ autoFocus,
1042
+ disabled: isDisabled,
1043
+ readOnly: isReadOnly,
1044
+ name,
1045
+ "aria-invalid": isInvalid || void 0,
1046
+ containerClassName: "prt-pin-otp",
1047
+ className: cn("prt-pin-input", classNames?.input),
1048
+ style: styles?.input
1049
+ },
1050
+ content
1051
+ )
1052
+ )
1053
+ )));
1054
+ }
1055
+ function renderSlots(maxLength2, groupSize, separator, slotClassName) {
1056
+ const size = groupSize && groupSize > 0 ? groupSize : maxLength2;
1057
+ const groups = [];
1058
+ for (let i = 0; i < maxLength2; i += size) {
1059
+ groups.push(
1060
+ Array.from({ length: Math.min(size, maxLength2 - i) }, (_, j) => i + j)
1061
+ );
1062
+ }
1063
+ return groups.map((indices, groupIndex) => /* @__PURE__ */ React13.createElement(React13.Fragment, { key: groupIndex }, groupIndex > 0 && /* @__PURE__ */ React13.createElement(PinInputSeparator, null, separator), /* @__PURE__ */ React13.createElement(PinInputGroup, null, indices.map((index) => /* @__PURE__ */ React13.createElement(PinInputSlot, { key: index, index, className: slotClassName })))));
1064
+ }
1065
+ function PinInputGroup({ className, ...props }) {
1066
+ return /* @__PURE__ */ React13.createElement(
1067
+ "div",
1068
+ {
1069
+ className: cn("prt-pin-group", className),
1070
+ "data-slot": "group",
1071
+ ...props
1072
+ }
1073
+ );
1074
+ }
1075
+ function PinInputSlot({
1076
+ index,
1077
+ className,
1078
+ ...props
1079
+ }) {
1080
+ const { mask, placeholder, isDisabled, isInvalid } = usePinInputConfig();
1081
+ const { slots } = React13.useContext(OTPInputContext);
1082
+ const slot = slots[index];
1083
+ const char = slot?.char ?? null;
1084
+ return /* @__PURE__ */ React13.createElement(
1085
+ "div",
1086
+ {
1087
+ ...props,
1088
+ className: cn("prt-pin-slot", className),
1089
+ "data-slot": "slot",
1090
+ "data-active": slot?.isActive || void 0,
1091
+ "data-filled": !!char || void 0,
1092
+ "data-disabled": isDisabled || void 0,
1093
+ "data-invalid": isInvalid || void 0
1094
+ },
1095
+ char !== null ? /* @__PURE__ */ React13.createElement("span", { className: "prt-pin-char" }, mask ? "\u2022" : char) : placeholder ? /* @__PURE__ */ React13.createElement("span", { className: "prt-pin-placeholder" }, placeholder) : null,
1096
+ slot?.hasFakeCaret && /* @__PURE__ */ React13.createElement("div", { className: "prt-pin-caret", "aria-hidden": true })
1097
+ );
1098
+ }
1099
+ function PinInputSeparator({
1100
+ className,
1101
+ children,
1102
+ ...props
1103
+ }) {
1104
+ return /* @__PURE__ */ React13.createElement(
1105
+ "div",
1106
+ {
1107
+ className: cn("prt-pin-separator", className),
1108
+ "data-slot": "separator",
1109
+ "aria-hidden": true,
1110
+ ...props
1111
+ },
1112
+ children ?? "-"
1113
+ );
933
1114
  }
934
1115
 
935
1116
  // src/utils/theme.ts
@@ -1005,7 +1186,7 @@ function breakpointClassNames(prefix, value) {
1005
1186
  // src/components/text/text.tsx
1006
1187
  function Text({
1007
1188
  textCase,
1008
- size = "sm",
1189
+ size,
1009
1190
  weight,
1010
1191
  color = "gray",
1011
1192
  variant = "default",
@@ -1018,7 +1199,9 @@ function Text({
1018
1199
  className,
1019
1200
  ...rest
1020
1201
  }) {
1021
- return /* @__PURE__ */ React36.createElement(
1202
+ const theme = useTheme();
1203
+ const resolvedSize = size ?? theme?.size ?? "sm";
1204
+ return /* @__PURE__ */ React13.createElement(
1022
1205
  Comp,
1023
1206
  {
1024
1207
  className: cn(
@@ -1031,7 +1214,7 @@ function Text({
1031
1214
  [`text-line-height-${lineHeight}`]: !!lineHeight,
1032
1215
  [`text-transform-${textCase}`]: !!textCase
1033
1216
  },
1034
- breakpointClassNames("text-size", size)
1217
+ breakpointClassNames("text-size", resolvedSize)
1035
1218
  ),
1036
1219
  "data-underline": underline,
1037
1220
  "data-italic": italic,
@@ -1066,7 +1249,7 @@ function Textarea({
1066
1249
  ...textFieldProps
1067
1250
  }) {
1068
1251
  const theme = useTheme();
1069
- return /* @__PURE__ */ React36.createElement(TextField, { ...textFieldProps, isDisabled, isInvalid: !!error }, /* @__PURE__ */ React36.createElement(
1252
+ return /* @__PURE__ */ React13.createElement(TextField, { ...textFieldProps, isDisabled, isInvalid: !!error }, /* @__PURE__ */ React13.createElement(
1070
1253
  Field,
1071
1254
  {
1072
1255
  label,
@@ -1081,7 +1264,7 @@ function Textarea({
1081
1264
  classNames,
1082
1265
  replaceDefaultControlWrapper: true
1083
1266
  },
1084
- /* @__PURE__ */ React36.createElement(
1267
+ /* @__PURE__ */ React13.createElement(
1085
1268
  TextArea,
1086
1269
  {
1087
1270
  placeholder,
@@ -1096,7 +1279,7 @@ function Textarea({
1096
1279
  )
1097
1280
  ));
1098
1281
  }
1099
- var CheckboxGroupVariantContext = React36.createContext(null);
1282
+ var CheckboxGroupVariantContext = React13.createContext(null);
1100
1283
  function CheckboxGroup({
1101
1284
  children,
1102
1285
  label,
@@ -1109,17 +1292,17 @@ function CheckboxGroup({
1109
1292
  shape,
1110
1293
  ...props
1111
1294
  }) {
1112
- const variants = React36.useMemo(
1295
+ const variants = React13.useMemo(
1113
1296
  () => ({ size, appearance, color, radius, shape }),
1114
1297
  [size, appearance, color, radius, shape]
1115
1298
  );
1116
- return /* @__PURE__ */ React36.createElement(
1299
+ return /* @__PURE__ */ React13.createElement(
1117
1300
  CheckboxGroup$1,
1118
1301
  {
1119
1302
  ...props,
1120
1303
  "aria-label": typeof label === "string" ? label : void 0
1121
1304
  },
1122
- /* @__PURE__ */ React36.createElement("div", { className: "flex flex-col gap-2" }, label && /* @__PURE__ */ React36.createElement("span", { className: "text-sm font-medium text-gray-700" }, label), /* @__PURE__ */ React36.createElement(CheckboxGroupVariantContext.Provider, { value: variants }, children), description && /* @__PURE__ */ React36.createElement("span", { className: "text-xs leading-normal text-gray-400" }, description), errorMessage && /* @__PURE__ */ React36.createElement(InputError, null, errorMessage))
1305
+ /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-2" }, label && /* @__PURE__ */ React13.createElement("span", { className: "text-sm font-medium text-gray-700" }, label), /* @__PURE__ */ React13.createElement(CheckboxGroupVariantContext.Provider, { value: variants }, children), description && /* @__PURE__ */ React13.createElement("span", { className: "text-xs leading-normal text-gray-400" }, description), errorMessage && /* @__PURE__ */ React13.createElement(InputError, null, errorMessage))
1123
1306
  );
1124
1307
  }
1125
1308
 
@@ -1142,18 +1325,19 @@ function Checkbox({
1142
1325
  children,
1143
1326
  ...props
1144
1327
  }) {
1145
- const group = React36.useContext(CheckboxGroupVariantContext);
1328
+ const theme = useTheme();
1329
+ const group = React13.useContext(CheckboxGroupVariantContext);
1146
1330
  const resolvedColor = color ?? group?.color ?? "primary";
1147
- const resolvedAppearance = appearance ?? group?.appearance ?? "outline";
1148
- const resolvedSize = size ?? group?.size ?? "md";
1331
+ const resolvedAppearance = appearance ?? group?.appearance ?? theme?.inputAppearance ?? "outline";
1332
+ const resolvedSize = size ?? group?.size ?? theme?.size ?? "md";
1149
1333
  const resolvedRadius = radius ?? group?.radius ?? getRadius(shape ?? group?.shape) ?? "md";
1150
- return /* @__PURE__ */ React36.createElement(CheckboxField, { ...props }, /* @__PURE__ */ React36.createElement(
1334
+ return /* @__PURE__ */ React13.createElement(CheckboxField, { ...props }, /* @__PURE__ */ React13.createElement(
1151
1335
  CheckboxButton,
1152
1336
  {
1153
1337
  style: { ...style, ...styles?.wrapper },
1154
1338
  className: cn(className, "prt-checkbox", classNames?.wrapper)
1155
1339
  },
1156
- ({ isSelected, isIndeterminate, isFocusVisible }) => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(
1340
+ ({ isSelected, isIndeterminate, isFocusVisible }) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
1157
1341
  "div",
1158
1342
  {
1159
1343
  style: styles?.checkbox,
@@ -1168,7 +1352,7 @@ function Checkbox({
1168
1352
  "data-appearance": isSelected || isIndeterminate ? void 0 : resolvedAppearance,
1169
1353
  "aria-hidden": "true"
1170
1354
  },
1171
- isSelected && !isIndeterminate && /* @__PURE__ */ React36.createElement(
1355
+ isSelected && !isIndeterminate && /* @__PURE__ */ React13.createElement(
1172
1356
  "svg",
1173
1357
  {
1174
1358
  className: cn("prt-checkbox-icon", classNames?.icon),
@@ -1180,9 +1364,9 @@ function Checkbox({
1180
1364
  strokeLinecap: "round",
1181
1365
  strokeLinejoin: "round"
1182
1366
  },
1183
- /* @__PURE__ */ React36.createElement("path", { d: "M9 12l2 2l4 -4" })
1367
+ /* @__PURE__ */ React13.createElement("path", { d: "M9 12l2 2l4 -4" })
1184
1368
  ),
1185
- isIndeterminate && /* @__PURE__ */ React36.createElement(
1369
+ isIndeterminate && /* @__PURE__ */ React13.createElement(
1186
1370
  "div",
1187
1371
  {
1188
1372
  className: cn(["prt-checkbox-icon", classNames?.icon]),
@@ -1205,7 +1389,7 @@ function CheckboxItem({
1205
1389
  children,
1206
1390
  ...props
1207
1391
  }) {
1208
- return /* @__PURE__ */ React36.createElement(CheckboxField, { ...props }, /* @__PURE__ */ React36.createElement(
1392
+ return /* @__PURE__ */ React13.createElement(CheckboxField, { ...props }, /* @__PURE__ */ React13.createElement(
1209
1393
  CheckboxButton,
1210
1394
  {
1211
1395
  style: { ...style, ...styles?.wrapper },
@@ -1215,13 +1399,13 @@ function CheckboxItem({
1215
1399
  ));
1216
1400
  }
1217
1401
  function Menu({ children, ...props }) {
1218
- return /* @__PURE__ */ React36.createElement(MenuTrigger$1, { ...props }, children);
1402
+ return /* @__PURE__ */ React13.createElement(MenuTrigger$1, { ...props }, children);
1219
1403
  }
1220
1404
  function MenuTrigger({ asChild, children }) {
1221
1405
  if (asChild) {
1222
- return /* @__PURE__ */ React36.createElement(Pressable, null, children);
1406
+ return /* @__PURE__ */ React13.createElement(Pressable, null, children);
1223
1407
  }
1224
- return /* @__PURE__ */ React36.createElement(Button, null, children);
1408
+ return /* @__PURE__ */ React13.createElement(Button, null, children);
1225
1409
  }
1226
1410
  function px(value) {
1227
1411
  if (value == null) return void 0;
@@ -1248,7 +1432,7 @@ function MenuContent({
1248
1432
  const dataRadius = theme?.radius ?? "lg";
1249
1433
  const header = typeof menuHeader === "function" ? menuHeader() : menuHeader;
1250
1434
  const footer = typeof menuFooter === "function" ? menuFooter() : menuFooter;
1251
- return /* @__PURE__ */ React36.createElement(
1435
+ return /* @__PURE__ */ React13.createElement(
1252
1436
  Popover$1,
1253
1437
  {
1254
1438
  placement,
@@ -1258,7 +1442,7 @@ function MenuContent({
1258
1442
  className: cn("prt-popover", classNames?.popover),
1259
1443
  style: { ...styles?.popover }
1260
1444
  },
1261
- /* @__PURE__ */ React36.createElement(
1445
+ /* @__PURE__ */ React13.createElement(
1262
1446
  "div",
1263
1447
  {
1264
1448
  "data-color": dataColor,
@@ -1273,7 +1457,7 @@ function MenuContent({
1273
1457
  }
1274
1458
  },
1275
1459
  header,
1276
- /* @__PURE__ */ React36.createElement(
1460
+ /* @__PURE__ */ React13.createElement(
1277
1461
  Menu$1,
1278
1462
  {
1279
1463
  ...props,
@@ -1299,7 +1483,7 @@ function MenuItem({
1299
1483
  ...props
1300
1484
  }) {
1301
1485
  const resolvedTextValue = textValue ?? (typeof label === "string" ? label : void 0) ?? (typeof children === "string" ? children : void 0);
1302
- return /* @__PURE__ */ React36.createElement(
1486
+ return /* @__PURE__ */ React13.createElement(
1303
1487
  MenuItem$1,
1304
1488
  {
1305
1489
  ...props,
@@ -1309,18 +1493,18 @@ function MenuItem({
1309
1493
  style,
1310
1494
  className: cn(className, "prt-list-option prt-menu-item")
1311
1495
  },
1312
- ({ isSelected }) => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement("div", { className: "flex items-center gap-3" }, icon && /* @__PURE__ */ React36.createElement("div", { className: "flex gap-3 prt-list-option-icon-wrapper" }, React36.isValidElement(icon) && React36.cloneElement(icon, {
1496
+ ({ isSelected }) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-3" }, icon && /* @__PURE__ */ React13.createElement("div", { className: "flex gap-3 prt-list-option-icon-wrapper" }, React13.isValidElement(icon) && React13.cloneElement(icon, {
1313
1497
  className: "prt-list-option-icon",
1314
1498
  size: 18,
1315
1499
  ...icon.props
1316
- })), /* @__PURE__ */ React36.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React36.createElement("div", { slot: "label", className: "text-sm text-black" }, label ?? children), description && /* @__PURE__ */ React36.createElement(
1500
+ })), /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React13.createElement("div", { slot: "label", className: "text-sm text-black" }, label ?? children), description && /* @__PURE__ */ React13.createElement(
1317
1501
  "div",
1318
1502
  {
1319
1503
  slot: "description",
1320
1504
  className: "text-sm leading-normal text-gray-500"
1321
1505
  },
1322
1506
  description
1323
- ))), isSelected && /* @__PURE__ */ React36.createElement(HiCheck, { className: "selected-marker" }))
1507
+ ))), isSelected && /* @__PURE__ */ React13.createElement(HiCheck, { className: "selected-marker" }))
1324
1508
  );
1325
1509
  }
1326
1510
  function MenuSection({
@@ -1329,9 +1513,9 @@ function MenuSection({
1329
1513
  className,
1330
1514
  ...props
1331
1515
  }) {
1332
- return /* @__PURE__ */ React36.createElement(MenuSection$1, { ...props, className: cn(className, "prt-list-section") }, title && /* @__PURE__ */ React36.createElement(Header, { className: "prt-list-section-header" }, title), children);
1516
+ return /* @__PURE__ */ React13.createElement(MenuSection$1, { ...props, className: cn(className, "prt-list-section") }, title && /* @__PURE__ */ React13.createElement(Header, { className: "prt-list-section-header" }, title), children);
1333
1517
  }
1334
- var ListBoxConfigContext = React36.createContext({
1518
+ var ListBoxConfigContext = React13.createContext({
1335
1519
  showSelectionIndicator: true
1336
1520
  });
1337
1521
  function ListBox({
@@ -1356,7 +1540,7 @@ function ListBox({
1356
1540
  ...props
1357
1541
  }) {
1358
1542
  const theme = useTheme();
1359
- const config = React36.useMemo(
1543
+ const config = React13.useMemo(
1360
1544
  () => ({
1361
1545
  showSelectionIndicator,
1362
1546
  renderSelectionIndicator
@@ -1368,15 +1552,15 @@ function ListBox({
1368
1552
  const id2 = record[valueKey];
1369
1553
  const label = record[labelKey];
1370
1554
  if (sectionKey && record[sectionKey]) {
1371
- return /* @__PURE__ */ React36.createElement(
1555
+ return /* @__PURE__ */ React13.createElement(
1372
1556
  ListBoxSection,
1373
1557
  {
1374
1558
  id: id2,
1375
1559
  title: renderSectionLabel?.(item) ?? label
1376
1560
  },
1377
- /* @__PURE__ */ React36.createElement(Collection, { items: record[sectionKey] }, (child) => {
1561
+ /* @__PURE__ */ React13.createElement(Collection, { items: record[sectionKey] }, (child) => {
1378
1562
  const childRecord = child;
1379
- return /* @__PURE__ */ React36.createElement(
1563
+ return /* @__PURE__ */ React13.createElement(
1380
1564
  ListBoxItem,
1381
1565
  {
1382
1566
  id: childRecord[valueKey],
@@ -1387,10 +1571,10 @@ function ListBox({
1387
1571
  })
1388
1572
  );
1389
1573
  }
1390
- return /* @__PURE__ */ React36.createElement(ListBoxItem, { id: id2, textValue: label }, renderOption?.(item) ?? label);
1574
+ return /* @__PURE__ */ React13.createElement(ListBoxItem, { id: id2, textValue: label }, renderOption?.(item) ?? label);
1391
1575
  }
1392
1576
  const listBoxChildren = children ?? renderItem;
1393
- return /* @__PURE__ */ React36.createElement(ListBoxConfigContext.Provider, { value: config }, /* @__PURE__ */ React36.createElement(
1577
+ return /* @__PURE__ */ React13.createElement(ListBoxConfigContext.Provider, { value: config }, /* @__PURE__ */ React13.createElement(
1394
1578
  ListBox$1,
1395
1579
  {
1396
1580
  ...props,
@@ -1401,13 +1585,13 @@ function ListBox({
1401
1585
  "data-color": color,
1402
1586
  "data-section-separator": showSectionSeparator,
1403
1587
  style: { width, ...style, ...styles?.wrapper },
1404
- renderEmptyState: () => /* @__PURE__ */ React36.createElement(
1588
+ renderEmptyState: () => /* @__PURE__ */ React13.createElement(
1405
1589
  "div",
1406
1590
  {
1407
1591
  className: "flex items-center justify-center gap-3",
1408
1592
  style: { height: 50 }
1409
1593
  },
1410
- renderEmpty?.() ?? /* @__PURE__ */ React36.createElement("span", { className: "text-sm text-gray-400" }, "No options")
1594
+ renderEmpty?.() ?? /* @__PURE__ */ React13.createElement("span", { className: "text-sm text-gray-400" }, "No options")
1411
1595
  )
1412
1596
  },
1413
1597
  listBoxChildren
@@ -1422,10 +1606,10 @@ function ListBoxItem({
1422
1606
  textValue,
1423
1607
  ...props
1424
1608
  }) {
1425
- const config = React36.useContext(ListBoxConfigContext);
1609
+ const config = React13.useContext(ListBoxConfigContext);
1426
1610
  const showIndicator = showSelectionIndicator ?? config.showSelectionIndicator;
1427
1611
  const resolvedTextValue = textValue ?? (typeof children === "string" ? children : void 0);
1428
- return /* @__PURE__ */ React36.createElement(
1612
+ return /* @__PURE__ */ React13.createElement(
1429
1613
  ListBoxItem$1,
1430
1614
  {
1431
1615
  ...props,
@@ -1436,9 +1620,9 @@ function ListBoxItem({
1436
1620
  },
1437
1621
  composeRenderProps(
1438
1622
  children,
1439
- (rendered, renderProps) => /* @__PURE__ */ React36.createElement(React36.Fragment, null, rendered, renderProps.isSelected && showIndicator && /* @__PURE__ */ React36.createElement("span", { className: "selection-indicator" }, config.renderSelectionIndicator?.(
1623
+ (rendered, renderProps) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, rendered, renderProps.isSelected && showIndicator && /* @__PURE__ */ React13.createElement("span", { className: "selection-indicator" }, config.renderSelectionIndicator?.(
1440
1624
  props.value ?? props
1441
- ) ?? /* @__PURE__ */ React36.createElement(HiCheck, { size: 16 })))
1625
+ ) ?? /* @__PURE__ */ React13.createElement(HiCheck, { size: 16 })))
1442
1626
  )
1443
1627
  );
1444
1628
  }
@@ -1448,7 +1632,7 @@ function ListBoxSection({
1448
1632
  children,
1449
1633
  ...props
1450
1634
  }) {
1451
- return /* @__PURE__ */ React36.createElement(ListBoxSection$1, { ...props, className: cn("prt-list-section", className) }, title && /* @__PURE__ */ React36.createElement(Header, { className: "prt-list-section-header" }, title), children);
1635
+ return /* @__PURE__ */ React13.createElement(ListBoxSection$1, { ...props, className: cn("prt-list-section", className) }, title && /* @__PURE__ */ React13.createElement(Header, { className: "prt-list-section-header" }, title), children);
1452
1636
  }
1453
1637
 
1454
1638
  // src/components/combo-box/combo-box.tsx
@@ -1456,7 +1640,7 @@ function ComboBox({
1456
1640
  description,
1457
1641
  error,
1458
1642
  label,
1459
- selectorIcon = /* @__PURE__ */ React36.createElement(HiSelector, { size: 18 }),
1643
+ selectorIcon = /* @__PURE__ */ React13.createElement(HiSelector, { size: 18 }),
1460
1644
  selectorSize = "sm",
1461
1645
  style,
1462
1646
  styles,
@@ -1464,7 +1648,7 @@ function ComboBox({
1464
1648
  classNames,
1465
1649
  isLoading,
1466
1650
  loadData,
1467
- loadingIndicator = /* @__PURE__ */ React36.createElement(Loader, { size: "xs" }),
1651
+ loadingIndicator = /* @__PURE__ */ React13.createElement(Loader, { size: "xs" }),
1468
1652
  items,
1469
1653
  defaultItems,
1470
1654
  inputValue,
@@ -1510,13 +1694,13 @@ function ComboBox({
1510
1694
  isInvalid: !!error,
1511
1695
  defaultFilter: contains
1512
1696
  };
1513
- return /* @__PURE__ */ React36.createElement(
1697
+ return /* @__PURE__ */ React13.createElement(
1514
1698
  ComboBox$1,
1515
1699
  {
1516
1700
  ...comboBoxProps,
1517
1701
  className: cn("prt-combo-box", className, classNames?.wrapper)
1518
1702
  },
1519
- /* @__PURE__ */ React36.createElement(
1703
+ /* @__PURE__ */ React13.createElement(
1520
1704
  Field,
1521
1705
  {
1522
1706
  styles,
@@ -1532,7 +1716,7 @@ function ComboBox({
1532
1716
  prepend,
1533
1717
  append
1534
1718
  },
1535
- /* @__PURE__ */ React36.createElement(
1719
+ /* @__PURE__ */ React13.createElement(
1536
1720
  Input$1,
1537
1721
  {
1538
1722
  placeholder,
@@ -1544,7 +1728,7 @@ function ComboBox({
1544
1728
  )
1545
1729
  }
1546
1730
  ),
1547
- /* @__PURE__ */ React36.createElement(
1731
+ /* @__PURE__ */ React13.createElement(
1548
1732
  IconButton,
1549
1733
  {
1550
1734
  className: cn("prt-combo-box-button", classNames?.button),
@@ -1556,7 +1740,7 @@ function ComboBox({
1556
1740
  loading ? loadingIndicator : selectorIcon
1557
1741
  )
1558
1742
  ),
1559
- /* @__PURE__ */ React36.createElement(
1743
+ /* @__PURE__ */ React13.createElement(
1560
1744
  Popover$1,
1561
1745
  {
1562
1746
  offset: 6,
@@ -1567,7 +1751,7 @@ function ComboBox({
1567
1751
  ),
1568
1752
  style: styles?.popover
1569
1753
  },
1570
- /* @__PURE__ */ React36.createElement(
1754
+ /* @__PURE__ */ React13.createElement(
1571
1755
  ListBox,
1572
1756
  {
1573
1757
  items: comboItems,
@@ -1584,7 +1768,7 @@ function ComboBox({
1584
1768
  );
1585
1769
  }
1586
1770
  function Radio({
1587
- size = "sm",
1771
+ size,
1588
1772
  className,
1589
1773
  style,
1590
1774
  appearance,
@@ -1592,14 +1776,18 @@ function Radio({
1592
1776
  children,
1593
1777
  ...props
1594
1778
  }) {
1595
- return /* @__PURE__ */ React36.createElement(RadioField, { ...props }, /* @__PURE__ */ React36.createElement(RadioButton, { style, className: cn("prt-radio", className) }, ({ isSelected }) => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(
1779
+ const theme = useTheme();
1780
+ const resolvedSize = size ?? theme?.size ?? "sm";
1781
+ const resolvedAppearance = appearance ?? theme?.inputAppearance;
1782
+ return /* @__PURE__ */ React13.createElement(RadioField, { ...props }, /* @__PURE__ */ React13.createElement(RadioButton, { style, className: cn("prt-radio", className) }, ({ isSelected }) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
1596
1783
  "div",
1597
1784
  {
1598
1785
  "data-color": color,
1786
+ "data-variant": isSelected ? "solid" : void 0,
1599
1787
  className: "prt-fake-radio",
1600
- "data-appearance": appearance,
1788
+ "data-appearance": resolvedAppearance,
1601
1789
  "data-checked": isSelected,
1602
- "data-size": size
1790
+ "data-size": resolvedSize
1603
1791
  }
1604
1792
  ), children)));
1605
1793
  }
@@ -1615,13 +1803,13 @@ function RadioGroup({
1615
1803
  ...props
1616
1804
  }) {
1617
1805
  const isHorizontal = props.orientation === "horizontal";
1618
- return /* @__PURE__ */ React36.createElement(
1806
+ return /* @__PURE__ */ React13.createElement(
1619
1807
  RadioGroup$1,
1620
1808
  {
1621
1809
  ...props,
1622
1810
  "aria-label": typeof label === "string" ? label : void 0
1623
1811
  },
1624
- /* @__PURE__ */ React36.createElement(
1812
+ /* @__PURE__ */ React13.createElement(
1625
1813
  "div",
1626
1814
  {
1627
1815
  style: { ...style, ...styles?.wrapper },
@@ -1631,10 +1819,10 @@ function RadioGroup({
1631
1819
  classNames?.wrapper
1632
1820
  )
1633
1821
  },
1634
- label && /* @__PURE__ */ React36.createElement(InputLabel, null, label),
1635
- description && /* @__PURE__ */ React36.createElement("span", { className: "text-sm text-gray-600" }, description),
1636
- /* @__PURE__ */ React36.createElement("div", { className: cn("flex gap-2", isHorizontal ? "flex-row" : "flex-col") }, children),
1637
- errorMessage && /* @__PURE__ */ React36.createElement(InputError, null, errorMessage)
1822
+ label && /* @__PURE__ */ React13.createElement(InputLabel, null, label),
1823
+ description && /* @__PURE__ */ React13.createElement("span", { className: "text-sm text-gray-600" }, description),
1824
+ /* @__PURE__ */ React13.createElement("div", { className: cn("flex gap-2", isHorizontal ? "flex-row" : "flex-col") }, children),
1825
+ errorMessage && /* @__PURE__ */ React13.createElement(InputError, null, errorMessage)
1638
1826
  )
1639
1827
  );
1640
1828
  }
@@ -1651,23 +1839,25 @@ function RadioCard({
1651
1839
  styles,
1652
1840
  ...props
1653
1841
  }) {
1654
- return /* @__PURE__ */ React36.createElement(RadioField, { ...props }, /* @__PURE__ */ React36.createElement(
1842
+ const theme = useTheme();
1843
+ const resolvedAppearance = appearance ?? theme?.inputAppearance;
1844
+ return /* @__PURE__ */ React13.createElement(RadioField, { ...props }, /* @__PURE__ */ React13.createElement(
1655
1845
  RadioButton,
1656
1846
  {
1657
1847
  "data-radius": "lg",
1658
1848
  className: cn(className, "prt-radio-card", classNames?.wrapper),
1659
1849
  "data-color": color,
1660
- "data-appearance": appearance,
1850
+ "data-appearance": resolvedAppearance,
1661
1851
  style: { ...style, ...styles?.wrapper }
1662
1852
  },
1663
- ({ isSelected }) => /* @__PURE__ */ React36.createElement(React36.Fragment, null, showIndicator && /* @__PURE__ */ React36.createElement(
1853
+ ({ isSelected }) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, showIndicator && /* @__PURE__ */ React13.createElement(
1664
1854
  "div",
1665
1855
  {
1666
1856
  className: "prt-radio-card-indicator prt-fake-radio",
1667
1857
  "data-size": "sm",
1668
1858
  "data-checked": isSelected
1669
1859
  }
1670
- ), /* @__PURE__ */ React36.createElement(
1860
+ ), /* @__PURE__ */ React13.createElement(
1671
1861
  "div",
1672
1862
  {
1673
1863
  className: cn(
@@ -1676,14 +1866,14 @@ function RadioCard({
1676
1866
  ),
1677
1867
  style: { ...styles?.content }
1678
1868
  },
1679
- (title || description) && /* @__PURE__ */ React36.createElement("div", { className: "flex flex-col gap-0.5" }, title && /* @__PURE__ */ React36.createElement(
1869
+ (title || description) && /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-0.5" }, title && /* @__PURE__ */ React13.createElement(
1680
1870
  "div",
1681
1871
  {
1682
1872
  className: cn("text-sm", classNames?.title),
1683
1873
  style: { ...styles?.title }
1684
1874
  },
1685
1875
  title
1686
- ), description && /* @__PURE__ */ React36.createElement(
1876
+ ), description && /* @__PURE__ */ React13.createElement(
1687
1877
  "div",
1688
1878
  {
1689
1879
  className: cn(
@@ -1706,7 +1896,7 @@ function RadioItem({
1706
1896
  children,
1707
1897
  ...props
1708
1898
  }) {
1709
- return /* @__PURE__ */ React36.createElement(RadioField, { ...props }, /* @__PURE__ */ React36.createElement(
1899
+ return /* @__PURE__ */ React13.createElement(RadioField, { ...props }, /* @__PURE__ */ React13.createElement(
1710
1900
  RadioButton,
1711
1901
  {
1712
1902
  style: { ...style, ...styles?.wrapper },
@@ -1721,7 +1911,7 @@ function Tag({
1721
1911
  children,
1722
1912
  hashValue,
1723
1913
  color,
1724
- size = "sm",
1914
+ size,
1725
1915
  shape,
1726
1916
  variant = "light",
1727
1917
  className,
@@ -1733,19 +1923,21 @@ function Tag({
1733
1923
  ...props
1734
1924
  }) {
1735
1925
  warnDeprecation("shape", "radius", shape);
1736
- const randomColor = React36__default.useMemo(() => {
1926
+ const theme = useTheme();
1927
+ const resolvedSize = size ?? theme?.size ?? "sm";
1928
+ const randomColor = React13__default.useMemo(() => {
1737
1929
  if (hashValue) {
1738
1930
  return getRandomColor(hashValue);
1739
1931
  }
1740
1932
  return "gray";
1741
1933
  }, [hashValue]);
1742
- return /* @__PURE__ */ React36__default.createElement(
1934
+ return /* @__PURE__ */ React13__default.createElement(
1743
1935
  "span",
1744
1936
  {
1745
1937
  className: cn(className, "prt-tag", classNames?.wrapper),
1746
1938
  style: { ...style, ...styles?.wrapper },
1747
1939
  "data-radius": radius,
1748
- "data-size": size,
1940
+ "data-size": resolvedSize,
1749
1941
  "data-color": color ?? randomColor,
1750
1942
  "data-variant": variant,
1751
1943
  ref,
@@ -1763,21 +1955,12 @@ function Select({
1763
1955
  description,
1764
1956
  error,
1765
1957
  placeholder,
1766
- selectionMode = "single",
1767
- appearance = "outline",
1958
+ appearance,
1768
1959
  renderValue,
1769
1960
  color = "gray",
1770
- size = "sm",
1961
+ size,
1771
1962
  radius,
1772
1963
  listBoxColor,
1773
- name,
1774
- value,
1775
- defaultValue,
1776
- isDisabled,
1777
- isRequired,
1778
- disabledKeys,
1779
- onChange,
1780
- onSelectionChange,
1781
1964
  showSectionSeparator = true,
1782
1965
  showSelectionIndicator = true,
1783
1966
  items,
@@ -1787,65 +1970,61 @@ function Select({
1787
1970
  sectionKey,
1788
1971
  renderOption,
1789
1972
  renderSectionLabel,
1973
+ disabledKeys,
1790
1974
  className,
1791
1975
  classNames,
1792
1976
  style,
1793
- styles
1977
+ styles,
1978
+ "aria-label": ariaLabel,
1979
+ ...racProps
1794
1980
  }) {
1795
1981
  const theme = useTheme();
1796
- const isMultiple = selectionMode === "multiple";
1797
- color = color ?? theme?.color;
1798
- function handleChange(v) {
1799
- onChange?.({ target: { value: v, name } });
1800
- onSelectionChange?.(v == null ? [] : Array.isArray(v) ? v : [v]);
1801
- }
1982
+ const resolvedColor = color ?? theme?.color;
1983
+ const resolvedSize = size ?? theme?.size ?? "sm";
1984
+ const resolvedAppearance = appearance ?? theme?.inputAppearance ?? "outline";
1985
+ const isMultiple = racProps.selectionMode === "multiple";
1802
1986
  function labelOf(item) {
1803
1987
  if (item == null) return null;
1804
1988
  return item[labelKey];
1805
1989
  }
1806
- const racSelectProps = {
1807
- selectionMode,
1808
- isDisabled,
1809
- isRequired,
1810
- placeholder,
1811
- disabledKeys,
1812
- value,
1813
- defaultValue,
1814
- isInvalid: !!error,
1815
- onChange: handleChange
1816
- };
1817
- return /* @__PURE__ */ React36.createElement(
1990
+ return /* @__PURE__ */ React13.createElement(
1818
1991
  Select$1,
1819
1992
  {
1820
- ...racSelectProps,
1821
- "aria-label": label == null ? placeholder ?? "Select" : void 0,
1993
+ ...racProps,
1994
+ placeholder,
1995
+ isInvalid: !!error,
1996
+ "aria-label": ariaLabel ?? (label == null ? placeholder ?? "Select" : void 0),
1822
1997
  className: cn("prt-select", className, classNames?.wrapper),
1823
1998
  style: { ...style, ...styles?.wrapper }
1824
1999
  },
1825
- /* @__PURE__ */ React36.createElement(
2000
+ /* @__PURE__ */ React13.createElement(
1826
2001
  Field,
1827
2002
  {
1828
2003
  replaceDefaultControlWrapper: true,
1829
2004
  label,
1830
2005
  error,
1831
2006
  description,
1832
- color,
1833
- size,
2007
+ color: resolvedColor,
2008
+ size: resolvedSize,
1834
2009
  radius,
1835
2010
  classNames,
1836
2011
  styles
1837
2012
  },
1838
- /* @__PURE__ */ React36.createElement(
2013
+ /* @__PURE__ */ React13.createElement(
1839
2014
  Button$1,
1840
2015
  {
1841
- "data-selection-mode": selectionMode,
1842
- "data-appearance": appearance,
2016
+ "data-selection-mode": racProps.selectionMode ?? "single",
2017
+ "data-appearance": resolvedAppearance,
1843
2018
  style: styles?.trigger,
1844
- className: cn("prt-input-control", "prt-select-trigger", classNames?.trigger)
2019
+ className: cn(
2020
+ "prt-input-control",
2021
+ "prt-select-trigger",
2022
+ classNames?.trigger
2023
+ )
1845
2024
  },
1846
- /* @__PURE__ */ React36.createElement(SelectValue, { className: cn("single-value", classNames?.value) }, ({ isPlaceholder, selectedItems, selectedText }) => {
2025
+ /* @__PURE__ */ React13.createElement(SelectValue, { className: cn("single-value", classNames?.value) }, ({ isPlaceholder, selectedItems, selectedText }) => {
1847
2026
  if (isPlaceholder) {
1848
- return /* @__PURE__ */ React36.createElement(
2027
+ return /* @__PURE__ */ React13.createElement(
1849
2028
  "span",
1850
2029
  {
1851
2030
  style: styles?.placeholder,
@@ -1855,13 +2034,13 @@ function Select({
1855
2034
  );
1856
2035
  }
1857
2036
  if (isMultiple) {
1858
- return /* @__PURE__ */ React36.createElement("div", { className: "flex flex-wrap gap-1" }, selectedItems.map(
1859
- (item, index) => item == null ? null : renderValue?.(item) ?? /* @__PURE__ */ React36.createElement(
2037
+ return /* @__PURE__ */ React13.createElement("div", { className: "flex flex-wrap gap-1" }, selectedItems.map(
2038
+ (item, index) => item == null ? null : renderValue?.(item) ?? /* @__PURE__ */ React13.createElement(
1860
2039
  Tag,
1861
2040
  {
1862
2041
  size: "md",
1863
2042
  variant: "pastel",
1864
- color,
2043
+ color: resolvedColor,
1865
2044
  key: index
1866
2045
  },
1867
2046
  labelOf(item)
@@ -1869,7 +2048,7 @@ function Select({
1869
2048
  ));
1870
2049
  }
1871
2050
  const selectedItem = selectedItems[0] ?? null;
1872
- return /* @__PURE__ */ React36.createElement(
2051
+ return /* @__PURE__ */ React13.createElement(
1873
2052
  "div",
1874
2053
  {
1875
2054
  className: cn("single-value", classNames?.value),
@@ -1878,23 +2057,32 @@ function Select({
1878
2057
  (selectedItem && renderValue?.(selectedItem)) ?? labelOf(selectedItem) ?? selectedText
1879
2058
  );
1880
2059
  }),
1881
- /* @__PURE__ */ React36.createElement(HiSelector, { className: "selector", size: 18 })
2060
+ /* @__PURE__ */ React13.createElement(
2061
+ HiSelector,
2062
+ {
2063
+ className: "selector",
2064
+ size: 18,
2065
+ "data-variant": "solid",
2066
+ "data-interactive": "false"
2067
+ }
2068
+ )
1882
2069
  )
1883
2070
  ),
1884
- /* @__PURE__ */ React36.createElement(
2071
+ /* @__PURE__ */ React13.createElement(
1885
2072
  Popover$1,
1886
2073
  {
1887
2074
  offset: 4,
1888
2075
  className: cn("prt-popover", "prt-select-popover", classNames?.popover),
1889
2076
  style: styles?.popover
1890
2077
  },
1891
- /* @__PURE__ */ React36.createElement(
2078
+ /* @__PURE__ */ React13.createElement(
1892
2079
  ListBox,
1893
2080
  {
1894
2081
  items,
1895
2082
  labelKey,
1896
2083
  valueKey,
1897
2084
  sectionKey,
2085
+ disabledKeys,
1898
2086
  renderOption,
1899
2087
  renderSectionLabel,
1900
2088
  showSectionSeparator,
@@ -1911,7 +2099,7 @@ function CalendarBody({
1911
2099
  numberOfMonths = 1,
1912
2100
  showMonthAndYearPickers = false
1913
2101
  }) {
1914
- return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement("header", { className: "prt-calendar-header" }, /* @__PURE__ */ React36.createElement(
2102
+ return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement("header", { className: "prt-calendar-header" }, /* @__PURE__ */ React13.createElement(
1915
2103
  IconButton,
1916
2104
  {
1917
2105
  slot: "previous",
@@ -1920,8 +2108,8 @@ function CalendarBody({
1920
2108
  size: "sm",
1921
2109
  color: "gray"
1922
2110
  },
1923
- /* @__PURE__ */ React36.createElement(HiChevronLeft, { size: 20 })
1924
- ), showMonthAndYearPickers ? /* @__PURE__ */ React36.createElement("div", { className: "flex items-center gap-2 prt-calendar-selects" }, /* @__PURE__ */ React36.createElement(CalendarMonthPicker, null, ({ "aria-label": ariaLabel, value, onChange, items }) => /* @__PURE__ */ React36.createElement(
2111
+ /* @__PURE__ */ React13.createElement(HiChevronLeft, { size: 20 })
2112
+ ), showMonthAndYearPickers ? /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-2 prt-calendar-selects" }, /* @__PURE__ */ React13.createElement(CalendarMonthPicker, null, ({ "aria-label": ariaLabel, value, onChange, items }) => /* @__PURE__ */ React13.createElement(
1925
2113
  Select,
1926
2114
  {
1927
2115
  "aria-label": ariaLabel,
@@ -1930,10 +2118,10 @@ function CalendarBody({
1930
2118
  valueKey: "id",
1931
2119
  labelKey: "formatted",
1932
2120
  value,
1933
- onChange: (e) => onChange(e.target.value),
2121
+ onChange: (v) => v != null && onChange(Number(v)),
1934
2122
  items
1935
2123
  }
1936
- )), /* @__PURE__ */ React36.createElement(CalendarYearPicker, null, ({ "aria-label": ariaLabel, value, onChange, items }) => /* @__PURE__ */ React36.createElement(
2124
+ )), /* @__PURE__ */ React13.createElement(CalendarYearPicker, null, ({ "aria-label": ariaLabel, value, onChange, items }) => /* @__PURE__ */ React13.createElement(
1937
2125
  Select,
1938
2126
  {
1939
2127
  "aria-label": ariaLabel,
@@ -1942,10 +2130,10 @@ function CalendarBody({
1942
2130
  valueKey: "id",
1943
2131
  labelKey: "formatted",
1944
2132
  value,
1945
- onChange: (e) => onChange(e.target.value),
2133
+ onChange: (v) => v != null && onChange(Number(v)),
1946
2134
  items
1947
2135
  }
1948
- ))) : /* @__PURE__ */ React36.createElement(Heading, { className: "prt-calendar-heading" }), /* @__PURE__ */ React36.createElement(
2136
+ ))) : /* @__PURE__ */ React13.createElement(Heading, { className: "prt-calendar-heading" }), /* @__PURE__ */ React13.createElement(
1949
2137
  IconButton,
1950
2138
  {
1951
2139
  slot: "next",
@@ -1954,16 +2142,16 @@ function CalendarBody({
1954
2142
  size: "sm",
1955
2143
  color: "gray"
1956
2144
  },
1957
- /* @__PURE__ */ React36.createElement(HiChevronRight, { size: 20 })
1958
- )), /* @__PURE__ */ React36.createElement("div", { className: "prt-calendar-months" }, Array.from({ length: numberOfMonths }, (_, i) => /* @__PURE__ */ React36.createElement(
2145
+ /* @__PURE__ */ React13.createElement(HiChevronRight, { size: 20 })
2146
+ )), /* @__PURE__ */ React13.createElement("div", { className: "prt-calendar-months" }, Array.from({ length: numberOfMonths }, (_, i) => /* @__PURE__ */ React13.createElement(
1959
2147
  CalendarGrid,
1960
2148
  {
1961
2149
  key: i,
1962
2150
  offset: { months: i },
1963
2151
  className: "prt-calendar-grid"
1964
2152
  },
1965
- /* @__PURE__ */ React36.createElement(CalendarGridHeader, null, (day) => /* @__PURE__ */ React36.createElement(CalendarHeaderCell, { className: "prt-date-weekday" }, day)),
1966
- /* @__PURE__ */ React36.createElement(CalendarGridBody, null, (date) => /* @__PURE__ */ React36.createElement(CalendarCell, { date, className: "prt-date-cell" }))
2153
+ /* @__PURE__ */ React13.createElement(CalendarGridHeader, null, (day) => /* @__PURE__ */ React13.createElement(CalendarHeaderCell, { className: "prt-date-weekday" }, day)),
2154
+ /* @__PURE__ */ React13.createElement(CalendarGridBody, null, (date) => /* @__PURE__ */ React13.createElement(CalendarCell, { date, className: "prt-date-cell" }))
1967
2155
  ))));
1968
2156
  }
1969
2157
  function Calendar({
@@ -1975,17 +2163,19 @@ function Calendar({
1975
2163
  ...props
1976
2164
  }) {
1977
2165
  const theme = useTheme();
1978
- return /* @__PURE__ */ React36.createElement(
2166
+ return /* @__PURE__ */ React13.createElement(
1979
2167
  Calendar$1,
1980
2168
  {
1981
2169
  ...props,
1982
2170
  ref,
1983
2171
  visibleDuration: { months: numberOfMonths },
1984
2172
  "data-color": color ?? theme?.color ?? "primary",
2173
+ "data-variant": "solid",
2174
+ "data-interactive": "false",
1985
2175
  "data-radius": radius ?? theme?.radius ?? "lg",
1986
2176
  className: "prt-calendar-wrapper"
1987
2177
  },
1988
- /* @__PURE__ */ React36.createElement(
2178
+ /* @__PURE__ */ React13.createElement(
1989
2179
  CalendarBody,
1990
2180
  {
1991
2181
  numberOfMonths,
@@ -2003,18 +2193,20 @@ function RangeCalendar({
2003
2193
  ...props
2004
2194
  }) {
2005
2195
  const theme = useTheme();
2006
- return /* @__PURE__ */ React36.createElement(
2196
+ return /* @__PURE__ */ React13.createElement(
2007
2197
  RangeCalendar$1,
2008
2198
  {
2009
2199
  ...props,
2010
2200
  ref,
2011
2201
  visibleDuration: { months: numberOfMonths },
2012
2202
  "data-color": color ?? theme?.color ?? "primary",
2203
+ "data-variant": "solid",
2204
+ "data-interactive": "false",
2013
2205
  "data-radius": radius ?? theme?.radius ?? "lg",
2014
2206
  "data-range": "true",
2015
2207
  className: "prt-calendar-wrapper"
2016
2208
  },
2017
- /* @__PURE__ */ React36.createElement(
2209
+ /* @__PURE__ */ React13.createElement(
2018
2210
  CalendarBody,
2019
2211
  {
2020
2212
  numberOfMonths,
@@ -2024,13 +2216,22 @@ function RangeCalendar({
2024
2216
  );
2025
2217
  }
2026
2218
  function DateSegments({ slot, className }) {
2027
- return /* @__PURE__ */ React36.createElement(DateInput, { slot, className: cn("prt-date-field", className) }, (segment) => /* @__PURE__ */ React36.createElement(DateSegment, { segment, className: "prt-date-input-segment" }));
2219
+ return /* @__PURE__ */ React13.createElement(
2220
+ DateInput,
2221
+ {
2222
+ slot,
2223
+ "data-variant": "solid",
2224
+ "data-interactive": "false",
2225
+ className: cn("prt-date-field", className)
2226
+ },
2227
+ (segment) => /* @__PURE__ */ React13.createElement(DateSegment, { segment, className: "prt-date-input-segment" })
2228
+ );
2028
2229
  }
2029
2230
 
2030
2231
  // src/components/date/date-field.tsx
2031
2232
  function DateField({
2032
2233
  appearance = "outline",
2033
- size = "md",
2234
+ size,
2034
2235
  color,
2035
2236
  radius,
2036
2237
  value,
@@ -2049,10 +2250,12 @@ function DateField({
2049
2250
  ref,
2050
2251
  ...props
2051
2252
  }) {
2253
+ const theme = useTheme();
2254
+ const resolvedSize = size ?? theme?.size ?? "md";
2052
2255
  function handleChange(date) {
2053
2256
  onChange?.(date?.toString() ?? null, date);
2054
2257
  }
2055
- return /* @__PURE__ */ React36.createElement(
2258
+ return /* @__PURE__ */ React13.createElement(
2056
2259
  DateField$1,
2057
2260
  {
2058
2261
  ...props,
@@ -2061,7 +2264,7 @@ function DateField({
2061
2264
  onChange: handleChange,
2062
2265
  isInvalid: !!error
2063
2266
  },
2064
- /* @__PURE__ */ React36.createElement(
2267
+ /* @__PURE__ */ React13.createElement(
2065
2268
  Field,
2066
2269
  {
2067
2270
  replaceDefaultControlWrapper: true,
@@ -2069,7 +2272,7 @@ function DateField({
2069
2272
  error,
2070
2273
  description,
2071
2274
  color,
2072
- size,
2275
+ size: resolvedSize,
2073
2276
  radius,
2074
2277
  appearance,
2075
2278
  validationStatus,
@@ -2078,7 +2281,7 @@ function DateField({
2078
2281
  style,
2079
2282
  styles
2080
2283
  },
2081
- /* @__PURE__ */ React36.createElement(
2284
+ /* @__PURE__ */ React13.createElement(
2082
2285
  Group,
2083
2286
  {
2084
2287
  ref,
@@ -2086,16 +2289,16 @@ function DateField({
2086
2289
  "data-color": color,
2087
2290
  className: cn("prt-input-control", "date-field-control")
2088
2291
  },
2089
- prepend && /* @__PURE__ */ React36.createElement("div", { className: "add-on add-on-left flex items-center" }, prepend),
2090
- /* @__PURE__ */ React36.createElement(DateSegments, null),
2091
- append && /* @__PURE__ */ React36.createElement("div", { className: "add-on add-on-right flex items-center" }, append)
2292
+ prepend && /* @__PURE__ */ React13.createElement("div", { className: "add-on add-on-left flex items-center" }, prepend),
2293
+ /* @__PURE__ */ React13.createElement(DateSegments, null),
2294
+ append && /* @__PURE__ */ React13.createElement("div", { className: "add-on add-on-right flex items-center" }, append)
2092
2295
  )
2093
2296
  )
2094
2297
  );
2095
2298
  }
2096
2299
  function TimeField({
2097
2300
  appearance = "outline",
2098
- size = "md",
2301
+ size,
2099
2302
  color,
2100
2303
  radius,
2101
2304
  value,
@@ -2114,10 +2317,12 @@ function TimeField({
2114
2317
  ref,
2115
2318
  ...props
2116
2319
  }) {
2320
+ const theme = useTheme();
2321
+ const resolvedSize = size ?? theme?.size ?? "md";
2117
2322
  function handleChange(time) {
2118
2323
  onChange?.(time?.toString() ?? null, time);
2119
2324
  }
2120
- return /* @__PURE__ */ React36.createElement(
2325
+ return /* @__PURE__ */ React13.createElement(
2121
2326
  TimeField$1,
2122
2327
  {
2123
2328
  ...props,
@@ -2126,7 +2331,7 @@ function TimeField({
2126
2331
  onChange: handleChange,
2127
2332
  isInvalid: !!error
2128
2333
  },
2129
- /* @__PURE__ */ React36.createElement(
2334
+ /* @__PURE__ */ React13.createElement(
2130
2335
  Field,
2131
2336
  {
2132
2337
  replaceDefaultControlWrapper: true,
@@ -2134,7 +2339,7 @@ function TimeField({
2134
2339
  error,
2135
2340
  description,
2136
2341
  color,
2137
- size,
2342
+ size: resolvedSize,
2138
2343
  radius,
2139
2344
  appearance,
2140
2345
  validationStatus,
@@ -2143,7 +2348,7 @@ function TimeField({
2143
2348
  style,
2144
2349
  styles
2145
2350
  },
2146
- /* @__PURE__ */ React36.createElement(
2351
+ /* @__PURE__ */ React13.createElement(
2147
2352
  Group,
2148
2353
  {
2149
2354
  ref,
@@ -2151,21 +2356,21 @@ function TimeField({
2151
2356
  "data-color": color,
2152
2357
  className: cn("prt-input-control", "date-field-control")
2153
2358
  },
2154
- prepend && /* @__PURE__ */ React36.createElement("div", { className: "add-on add-on-left flex items-center" }, prepend),
2155
- /* @__PURE__ */ React36.createElement(DateSegments, null),
2156
- append && /* @__PURE__ */ React36.createElement("div", { className: "add-on add-on-right flex items-center" }, append)
2359
+ prepend && /* @__PURE__ */ React13.createElement("div", { className: "add-on add-on-left flex items-center" }, prepend),
2360
+ /* @__PURE__ */ React13.createElement(DateSegments, null),
2361
+ append && /* @__PURE__ */ React13.createElement("div", { className: "add-on add-on-right flex items-center" }, append)
2157
2362
  )
2158
2363
  )
2159
2364
  );
2160
2365
  }
2161
2366
  function DatePicker({
2162
2367
  appearance = "outline",
2163
- size = "md",
2368
+ size,
2164
2369
  color,
2165
2370
  numberOfMonths,
2166
2371
  showMonthAndYearPickers,
2167
2372
  radius,
2168
- selectorIcon = /* @__PURE__ */ React36.createElement(HiOutlineCalendar, { size: 16 }),
2373
+ selectorIcon = /* @__PURE__ */ React13.createElement(HiOutlineCalendar, { size: 16 }),
2169
2374
  value,
2170
2375
  defaultValue,
2171
2376
  onChange,
@@ -2180,10 +2385,12 @@ function DatePicker({
2180
2385
  ref,
2181
2386
  ...props
2182
2387
  }) {
2388
+ const theme = useTheme();
2389
+ const resolvedSize = size ?? theme?.size ?? "md";
2183
2390
  function handleChange(date) {
2184
2391
  onChange?.(date?.toString() ?? null, date);
2185
2392
  }
2186
- return /* @__PURE__ */ React36.createElement(
2393
+ return /* @__PURE__ */ React13.createElement(
2187
2394
  DatePicker$1,
2188
2395
  {
2189
2396
  ...props,
@@ -2192,7 +2399,7 @@ function DatePicker({
2192
2399
  onChange: handleChange,
2193
2400
  isInvalid: !!error
2194
2401
  },
2195
- /* @__PURE__ */ React36.createElement(
2402
+ /* @__PURE__ */ React13.createElement(
2196
2403
  Field,
2197
2404
  {
2198
2405
  replaceDefaultControlWrapper: true,
@@ -2200,7 +2407,7 @@ function DatePicker({
2200
2407
  error,
2201
2408
  description,
2202
2409
  color,
2203
- size,
2410
+ size: resolvedSize,
2204
2411
  radius,
2205
2412
  appearance,
2206
2413
  validationStatus,
@@ -2209,7 +2416,7 @@ function DatePicker({
2209
2416
  style,
2210
2417
  styles
2211
2418
  },
2212
- /* @__PURE__ */ React36.createElement(
2419
+ /* @__PURE__ */ React13.createElement(
2213
2420
  Group,
2214
2421
  {
2215
2422
  ref,
@@ -2217,18 +2424,18 @@ function DatePicker({
2217
2424
  "data-color": color,
2218
2425
  className: cn("prt-input-control", "prt-date-picker-trigger")
2219
2426
  },
2220
- /* @__PURE__ */ React36.createElement(DateSegments, null),
2221
- /* @__PURE__ */ React36.createElement(IconButton, { size: "sm", variant: "light", color }, selectorIcon)
2427
+ /* @__PURE__ */ React13.createElement(DateSegments, null),
2428
+ /* @__PURE__ */ React13.createElement(IconButton, { size: "sm", variant: "light", color }, selectorIcon)
2222
2429
  )
2223
2430
  ),
2224
- /* @__PURE__ */ React36.createElement(
2431
+ /* @__PURE__ */ React13.createElement(
2225
2432
  Popover$1,
2226
2433
  {
2227
2434
  offset: 8,
2228
2435
  placement: "bottom start",
2229
2436
  className: cn("prt-popover", "prt-date-popover")
2230
2437
  },
2231
- /* @__PURE__ */ React36.createElement(
2438
+ /* @__PURE__ */ React13.createElement(
2232
2439
  Calendar,
2233
2440
  {
2234
2441
  color,
@@ -2245,12 +2452,12 @@ function toRange(value) {
2245
2452
  }
2246
2453
  function DateRangePicker({
2247
2454
  appearance = "outline",
2248
- size = "md",
2455
+ size,
2249
2456
  color,
2250
2457
  numberOfMonths = 2,
2251
2458
  showMonthAndYearPickers,
2252
2459
  radius,
2253
- dropdownIcon = /* @__PURE__ */ React36.createElement(HiOutlineCalendar, { size: 16 }),
2460
+ dropdownIcon = /* @__PURE__ */ React13.createElement(HiOutlineCalendar, { size: 16 }),
2254
2461
  value,
2255
2462
  defaultValue,
2256
2463
  onChange,
@@ -2271,7 +2478,9 @@ function DateRangePicker({
2271
2478
  range
2272
2479
  );
2273
2480
  }
2274
- return /* @__PURE__ */ React36.createElement(
2481
+ const theme = useTheme();
2482
+ const resolvedSize = size ?? theme?.size ?? "md";
2483
+ return /* @__PURE__ */ React13.createElement(
2275
2484
  DateRangePicker$1,
2276
2485
  {
2277
2486
  ...props,
@@ -2280,7 +2489,7 @@ function DateRangePicker({
2280
2489
  onChange: handleChange,
2281
2490
  isInvalid: !!error
2282
2491
  },
2283
- /* @__PURE__ */ React36.createElement(
2492
+ /* @__PURE__ */ React13.createElement(
2284
2493
  Field,
2285
2494
  {
2286
2495
  replaceDefaultControlWrapper: true,
@@ -2288,7 +2497,7 @@ function DateRangePicker({
2288
2497
  error,
2289
2498
  description,
2290
2499
  color,
2291
- size,
2500
+ size: resolvedSize,
2292
2501
  radius,
2293
2502
  appearance,
2294
2503
  validationStatus,
@@ -2297,7 +2506,7 @@ function DateRangePicker({
2297
2506
  style,
2298
2507
  styles
2299
2508
  },
2300
- /* @__PURE__ */ React36.createElement(
2509
+ /* @__PURE__ */ React13.createElement(
2301
2510
  Group,
2302
2511
  {
2303
2512
  ref,
@@ -2305,18 +2514,27 @@ function DateRangePicker({
2305
2514
  "data-color": color,
2306
2515
  className: cn("prt-input-control", "prt-date-picker-trigger")
2307
2516
  },
2308
- /* @__PURE__ */ React36.createElement("div", { className: "prt-date-range-fields" }, /* @__PURE__ */ React36.createElement(DateSegments, { slot: "start" }), /* @__PURE__ */ React36.createElement("span", { "aria-hidden": "true", className: "prt-date-range-sep" }, "\u2013"), /* @__PURE__ */ React36.createElement(DateSegments, { slot: "end" })),
2309
- /* @__PURE__ */ React36.createElement(IconButton, { size: "sm", variant: "light", color }, dropdownIcon)
2517
+ /* @__PURE__ */ React13.createElement("div", { className: "prt-date-range-fields" }, /* @__PURE__ */ React13.createElement(DateSegments, { slot: "start" }), /* @__PURE__ */ React13.createElement(
2518
+ "span",
2519
+ {
2520
+ "aria-hidden": "true",
2521
+ "data-variant": "solid",
2522
+ "data-interactive": "false",
2523
+ className: "prt-date-range-sep"
2524
+ },
2525
+ "\u2013"
2526
+ ), /* @__PURE__ */ React13.createElement(DateSegments, { slot: "end" })),
2527
+ /* @__PURE__ */ React13.createElement(IconButton, { size: "sm", variant: "light", color }, dropdownIcon)
2310
2528
  )
2311
2529
  ),
2312
- /* @__PURE__ */ React36.createElement(
2530
+ /* @__PURE__ */ React13.createElement(
2313
2531
  Popover$1,
2314
2532
  {
2315
2533
  offset: 8,
2316
2534
  placement: "bottom start",
2317
2535
  className: cn("prt-popover", "prt-date-popover")
2318
2536
  },
2319
- /* @__PURE__ */ React36.createElement(
2537
+ /* @__PURE__ */ React13.createElement(
2320
2538
  RangeCalendar,
2321
2539
  {
2322
2540
  color,
@@ -2328,7 +2546,7 @@ function DateRangePicker({
2328
2546
  )
2329
2547
  );
2330
2548
  }
2331
- var AvatarGroupContext = React36.createContext(null);
2549
+ var AvatarGroupContext = React13.createContext(null);
2332
2550
  function defaultGetInitials(name) {
2333
2551
  const parts = name.trim().split(/\s+/).filter(Boolean);
2334
2552
  if (parts.length === 0) return "";
@@ -2353,18 +2571,18 @@ function Avatar({
2353
2571
  ref,
2354
2572
  ...props
2355
2573
  }) {
2356
- const [erroredSrc, setErroredSrc] = React36.useState();
2574
+ const [erroredSrc, setErroredSrc] = React13.useState();
2357
2575
  const theme = useTheme();
2358
- const group = React36.useContext(AvatarGroupContext);
2359
- const defaultColor = React36.useMemo(() => {
2576
+ const group = React13.useContext(AvatarGroupContext);
2577
+ const defaultColor = React13.useMemo(() => {
2360
2578
  return supportedColors[hashCode(name || "") % supportedColors.length];
2361
2579
  }, [name]);
2362
- const resolvedSize = size ?? group?.size ?? "md";
2580
+ const resolvedSize = size ?? group?.size ?? theme?.size ?? "md";
2363
2581
  const resolvedVariant = variant ?? group?.variant ?? "light";
2364
2582
  const resolvedColor = color ?? group?.color ?? defaultColor;
2365
2583
  function renderContent() {
2366
2584
  if (src && erroredSrc !== src) {
2367
- return /* @__PURE__ */ React36.createElement(
2585
+ return /* @__PURE__ */ React13.createElement(
2368
2586
  "img",
2369
2587
  {
2370
2588
  className: cn("prt-avatar-img", classNames?.img),
@@ -2377,7 +2595,7 @@ function Avatar({
2377
2595
  }
2378
2596
  if (children) return children;
2379
2597
  if (name) {
2380
- return /* @__PURE__ */ React36.createElement(
2598
+ return /* @__PURE__ */ React13.createElement(
2381
2599
  "span",
2382
2600
  {
2383
2601
  className: cn("prt-avatar-fallback", classNames?.fallback),
@@ -2388,12 +2606,12 @@ function Avatar({
2388
2606
  }
2389
2607
  return fallback ?? null;
2390
2608
  }
2391
- return /* @__PURE__ */ React36.createElement(
2609
+ return /* @__PURE__ */ React13.createElement(
2392
2610
  "div",
2393
2611
  {
2394
2612
  style: { ...style, ...styles?.base },
2395
2613
  className: cn("prt-avatar prt-size", className, classNames?.base),
2396
- "data-radius": radius ?? theme?.avatarRadiusSize ?? "full",
2614
+ "data-radius": radius ?? theme?.radius ?? "full",
2397
2615
  "data-color": resolvedColor,
2398
2616
  "data-variant": resolvedVariant,
2399
2617
  "data-interactive": false,
@@ -2407,7 +2625,7 @@ function Avatar({
2407
2625
  );
2408
2626
  }
2409
2627
  function AvatarGroup({
2410
- max,
2628
+ max: max2,
2411
2629
  size,
2412
2630
  color,
2413
2631
  variant,
@@ -2417,21 +2635,21 @@ function AvatarGroup({
2417
2635
  classNames,
2418
2636
  styles
2419
2637
  }) {
2420
- const value = React36.useMemo(
2638
+ const value = React13.useMemo(
2421
2639
  () => ({ size, color, variant }),
2422
2640
  [size, color, variant]
2423
2641
  );
2424
- const items = React36.Children.toArray(children);
2425
- const visible = max != null ? items.slice(0, max) : items;
2426
- const overflow = max != null ? Math.max(0, items.length - max) : 0;
2427
- return /* @__PURE__ */ React36.createElement(AvatarGroupContext.Provider, { value }, /* @__PURE__ */ React36.createElement(
2642
+ const items = React13.Children.toArray(children);
2643
+ const visible = max2 != null ? items.slice(0, max2) : items;
2644
+ const overflow = max2 != null ? Math.max(0, items.length - max2) : 0;
2645
+ return /* @__PURE__ */ React13.createElement(AvatarGroupContext.Provider, { value }, /* @__PURE__ */ React13.createElement(
2428
2646
  "div",
2429
2647
  {
2430
2648
  className: cn("prt-avatar-group", className, classNames?.wrapper),
2431
2649
  style: { ...style, ...styles?.wrapper }
2432
2650
  },
2433
2651
  visible,
2434
- overflow > 0 && /* @__PURE__ */ React36.createElement(
2652
+ overflow > 0 && /* @__PURE__ */ React13.createElement(
2435
2653
  "div",
2436
2654
  {
2437
2655
  className: cn("prt-avatar prt-size", classNames?.overflow),
@@ -2471,7 +2689,7 @@ function FileUploader({
2471
2689
  className,
2472
2690
  style
2473
2691
  }) {
2474
- const [_uploads, setUploads] = React36.useState([]);
2692
+ const [_uploads, setUploads] = React13.useState([]);
2475
2693
  const uploads = controlledUploads ?? _uploads;
2476
2694
  function onUpload(next) {
2477
2695
  if (isEmptyArray(next)) return;
@@ -2493,15 +2711,15 @@ function FileUploader({
2493
2711
  const isUploading = !allowMultiple && uploads[0]?.status === "loading";
2494
2712
  const isUploaded = !allowMultiple && uploads[0]?.status === "success";
2495
2713
  const isFailed = !allowMultiple && uploads[0]?.status === "error";
2496
- return /* @__PURE__ */ React36.createElement(
2714
+ return /* @__PURE__ */ React13.createElement(
2497
2715
  "div",
2498
2716
  {
2499
2717
  ref,
2500
2718
  className: cn("flex flex-col gap-2.5", classNames?.wrapper, className),
2501
2719
  style: { ...styles?.wrapper, ...style }
2502
2720
  },
2503
- label && /* @__PURE__ */ React36.createElement(InputLabel, null, label),
2504
- /* @__PURE__ */ React36.createElement(
2721
+ label && /* @__PURE__ */ React13.createElement(InputLabel, null, label),
2722
+ /* @__PURE__ */ React13.createElement(
2505
2723
  DropZone,
2506
2724
  {
2507
2725
  "aria-label": typeof label === "string" ? label : "File upload",
@@ -2516,13 +2734,33 @@ function FileUploader({
2516
2734
  },
2517
2735
  "data-radius": "lg",
2518
2736
  "data-color": color,
2737
+ "data-variant": "light",
2738
+ "data-interactive": "false",
2519
2739
  className: cn("prt-file-uploader", classNames?.dropzone),
2520
2740
  style: { ...styles?.dropzone },
2521
2741
  "data-state": allowMultiple || !uploads.length ? "idle" : uploads[0]?.status
2522
2742
  },
2523
- isIdle && /* @__PURE__ */ React36.createElement(FileTrigger, { allowsMultiple: allowMultiple, onSelect: handleSelect }, /* @__PURE__ */ React36.createElement(Button$1, { className: "prt-file-uploader-trigger" }, /* @__PURE__ */ React36.createElement("div", { className: "flex items-center gap-2.5" }, /* @__PURE__ */ React36.createElement(HiOutlineDocumentAdd, { className: "state-icon", size: 20 }), /* @__PURE__ */ React36.createElement("span", { className: "text-sm text-inherit" }, "Click or drag files here to upload")))),
2524
- isUploading && /* @__PURE__ */ React36.createElement("div", { className: "flex items-center gap-2.5" }, /* @__PURE__ */ React36.createElement(Loader, { size: "xs" }), /* @__PURE__ */ React36.createElement("span", { className: "text-sm text-inherit" }, "Name_of_file.ext / Uploading...")),
2525
- isUploaded && /* @__PURE__ */ React36.createElement("div", { className: "flex w-full items-center justify-between" }, /* @__PURE__ */ React36.createElement("div", { className: "flex items-center gap-2.5" }, /* @__PURE__ */ React36.createElement(HiOutlineCheckCircle, { size: 16 }), /* @__PURE__ */ React36.createElement("span", { className: "text-sm text-green-600" }, "File successfully uploaded")), /* @__PURE__ */ React36.createElement(
2743
+ isIdle && /* @__PURE__ */ React13.createElement(FileTrigger, { allowsMultiple: allowMultiple, onSelect: handleSelect }, /* @__PURE__ */ React13.createElement(Button$1, { className: "prt-file-uploader-trigger" }, /* @__PURE__ */ React13.createElement(
2744
+ "div",
2745
+ {
2746
+ "data-variant": "solid",
2747
+ "data-interactive": "false",
2748
+ className: "prt-file-uploader-content flex items-center gap-2.5"
2749
+ },
2750
+ /* @__PURE__ */ React13.createElement(HiOutlineDocumentAdd, { className: "state-icon", size: 20 }),
2751
+ /* @__PURE__ */ React13.createElement("span", { className: "text-sm text-inherit" }, "Click or drag files here to upload")
2752
+ ))),
2753
+ isUploading && /* @__PURE__ */ React13.createElement(
2754
+ "div",
2755
+ {
2756
+ "data-variant": "solid",
2757
+ "data-interactive": "false",
2758
+ className: "prt-file-uploader-content flex items-center gap-2.5"
2759
+ },
2760
+ /* @__PURE__ */ React13.createElement(Loader, { size: "xs" }),
2761
+ /* @__PURE__ */ React13.createElement("span", { className: "text-sm text-inherit" }, "Name_of_file.ext / Uploading...")
2762
+ ),
2763
+ isUploaded && /* @__PURE__ */ React13.createElement("div", { className: "flex w-full items-center justify-between" }, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-2.5" }, /* @__PURE__ */ React13.createElement(HiOutlineCheckCircle, { size: 16 }), /* @__PURE__ */ React13.createElement("span", { className: "text-sm text-green-600" }, "File successfully uploaded")), /* @__PURE__ */ React13.createElement(
2526
2764
  IconButton,
2527
2765
  {
2528
2766
  onPress: handleRemoveFile,
@@ -2530,9 +2768,9 @@ function FileUploader({
2530
2768
  color: "green",
2531
2769
  size: "xs"
2532
2770
  },
2533
- /* @__PURE__ */ React36.createElement(HiOutlineTrash, { size: 16 })
2771
+ /* @__PURE__ */ React13.createElement(HiOutlineTrash, { size: 16 })
2534
2772
  )),
2535
- isFailed && /* @__PURE__ */ React36.createElement("div", { className: "flex w-full justify-between" }, /* @__PURE__ */ React36.createElement("div", { className: "flex items-center gap-2.5" }, /* @__PURE__ */ React36.createElement(HiOutlineExclamationCircle, { className: "state-icon" }), /* @__PURE__ */ React36.createElement("span", { className: "text-sm text-red-600" }, "Failed to upload file")), /* @__PURE__ */ React36.createElement(
2773
+ isFailed && /* @__PURE__ */ React13.createElement("div", { className: "flex w-full justify-between" }, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-2.5" }, /* @__PURE__ */ React13.createElement(HiOutlineExclamationCircle, { className: "state-icon" }), /* @__PURE__ */ React13.createElement("span", { className: "text-sm text-red-600" }, "Failed to upload file")), /* @__PURE__ */ React13.createElement(
2536
2774
  IconButton,
2537
2775
  {
2538
2776
  onPress: handleRetry,
@@ -2540,18 +2778,18 @@ function FileUploader({
2540
2778
  color: "tomato",
2541
2779
  size: "xs"
2542
2780
  },
2543
- /* @__PURE__ */ React36.createElement(HiOutlineRefresh, { size: 16 })
2781
+ /* @__PURE__ */ React13.createElement(HiOutlineRefresh, { size: 16 })
2544
2782
  ))
2545
2783
  ),
2546
- uploads.length > 1 && !hideFileList && /* @__PURE__ */ React36.createElement(
2784
+ uploads.length > 1 && !hideFileList && /* @__PURE__ */ React13.createElement(
2547
2785
  "div",
2548
2786
  {
2549
2787
  style: { marginTop: 10, ...styles?.list },
2550
2788
  className: cn("flex flex-col gap-3 upload-list", classNames?.list)
2551
2789
  },
2552
- uploads.map((upload) => /* @__PURE__ */ React36.createElement("div", { className: "flex items-center gap-2.5", key: upload.id }, upload.status === "loading" && /* @__PURE__ */ React36.createElement(Loader, null), upload.status === "success" && /* @__PURE__ */ React36.createElement(HiOutlinePaperClip, null), /* @__PURE__ */ React36.createElement("span", { className: "text-sm text-gray-700" }, upload.name)))
2790
+ uploads.map((upload) => /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-2.5", key: upload.id }, upload.status === "loading" && /* @__PURE__ */ React13.createElement(Loader, null), upload.status === "success" && /* @__PURE__ */ React13.createElement(HiOutlinePaperClip, null), /* @__PURE__ */ React13.createElement("span", { className: "text-sm text-gray-700" }, upload.name)))
2553
2791
  ),
2554
- error && /* @__PURE__ */ React36.createElement(InputError, null, error)
2792
+ error && /* @__PURE__ */ React13.createElement(InputError, null, error)
2555
2793
  );
2556
2794
  }
2557
2795
  function Separator({
@@ -2562,7 +2800,7 @@ function Separator({
2562
2800
  ref,
2563
2801
  ...props
2564
2802
  }) {
2565
- return /* @__PURE__ */ React36.createElement(
2803
+ return /* @__PURE__ */ React13.createElement(
2566
2804
  "div",
2567
2805
  {
2568
2806
  "data-opacity": opacity,
@@ -2585,7 +2823,7 @@ function Progress({
2585
2823
  ref,
2586
2824
  ...props
2587
2825
  }) {
2588
- return /* @__PURE__ */ React36.createElement(
2826
+ return /* @__PURE__ */ React13.createElement(
2589
2827
  ProgressBar,
2590
2828
  {
2591
2829
  ...props,
@@ -2594,14 +2832,14 @@ function Progress({
2594
2832
  className: cn("progress-bar", className, classNames?.wrapper),
2595
2833
  style: { ...style, ...styles?.wrapper }
2596
2834
  },
2597
- ({ percentage }) => /* @__PURE__ */ React36.createElement(React36.Fragment, null, label && /* @__PURE__ */ React36.createElement(
2835
+ ({ percentage }) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, label && /* @__PURE__ */ React13.createElement(
2598
2836
  "span",
2599
2837
  {
2600
2838
  className: cn("text-sm text-gray-700", classNames?.label),
2601
2839
  style: { ...styles?.label }
2602
2840
  },
2603
2841
  label
2604
- ), /* @__PURE__ */ React36.createElement(
2842
+ ), /* @__PURE__ */ React13.createElement(
2605
2843
  "div",
2606
2844
  {
2607
2845
  className: cn("progress-wrapper", classNames?.track),
@@ -2615,16 +2853,18 @@ function Progress({
2615
2853
  },
2616
2854
  ref
2617
2855
  },
2618
- /* @__PURE__ */ React36.createElement(
2856
+ /* @__PURE__ */ React13.createElement(
2619
2857
  "div",
2620
2858
  {
2859
+ "data-variant": "solid",
2860
+ "data-interactive": "false",
2621
2861
  className: cn("progress absolute", classNames?.bar),
2622
2862
  style: {
2623
2863
  left: 0,
2624
2864
  top: 0,
2625
2865
  height: "100%",
2626
2866
  width: `${percentage ?? 0}%`,
2627
- background: "var(--c-solid)",
2867
+ background: "var(--variant-bg)",
2628
2868
  transition: "all 0.3s ease",
2629
2869
  ...styles?.bar
2630
2870
  }
@@ -2635,7 +2875,7 @@ function Progress({
2635
2875
  }
2636
2876
  function Switch({
2637
2877
  color = "violet",
2638
- size = "sm",
2878
+ size,
2639
2879
  children,
2640
2880
  className,
2641
2881
  style,
@@ -2643,20 +2883,30 @@ function Switch({
2643
2883
  styles,
2644
2884
  ...props
2645
2885
  }) {
2646
- return /* @__PURE__ */ React36.createElement(SwitchField, { ...props }, /* @__PURE__ */ React36.createElement(
2886
+ const theme = useTheme();
2887
+ const resolvedSize = size ?? theme?.size ?? "sm";
2888
+ return /* @__PURE__ */ React13.createElement(SwitchField, { ...props }, /* @__PURE__ */ React13.createElement(
2647
2889
  SwitchButton,
2648
2890
  {
2649
2891
  className: cn(className, "prt-switch-group", classNames?.wrapper),
2650
2892
  style: { ...style, ...styles?.wrapper }
2651
2893
  },
2652
- /* @__PURE__ */ React36.createElement("span", { "data-color": color, "data-size": size, className: "prt-switch track" }, /* @__PURE__ */ React36.createElement(
2894
+ ({ isSelected }) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
2653
2895
  "span",
2654
2896
  {
2655
- className: cn("prt-switch-thumb", classNames?.thumb),
2656
- style: { ...styles?.thumb }
2657
- }
2658
- )),
2659
- children
2897
+ "data-color": color,
2898
+ "data-size": resolvedSize,
2899
+ "data-variant": isSelected ? "solid" : void 0,
2900
+ className: "prt-switch track"
2901
+ },
2902
+ /* @__PURE__ */ React13.createElement(
2903
+ "span",
2904
+ {
2905
+ className: cn("prt-switch-thumb", classNames?.thumb),
2906
+ style: { ...styles?.thumb }
2907
+ }
2908
+ )
2909
+ ), children)
2660
2910
  ));
2661
2911
  }
2662
2912
  function Slider({
@@ -2665,48 +2915,54 @@ function Slider({
2665
2915
  style,
2666
2916
  styles,
2667
2917
  name,
2668
- size = "sm",
2918
+ size,
2669
2919
  color,
2670
2920
  label,
2671
2921
  orientation = "horizontal",
2672
2922
  ...props
2673
2923
  }) {
2674
- return /* @__PURE__ */ React36.createElement(
2924
+ const theme = useTheme();
2925
+ const resolvedSize = size ?? theme?.size ?? "sm";
2926
+ return /* @__PURE__ */ React13.createElement(
2675
2927
  Slider$1,
2676
2928
  {
2677
2929
  ...props,
2678
2930
  orientation,
2679
2931
  "aria-label": typeof label === "string" ? label : props["aria-label"] ?? "slider",
2680
2932
  "data-color": color,
2681
- "data-size": size,
2933
+ "data-size": resolvedSize,
2682
2934
  style: { ...style, ...styles?.wrapper },
2683
2935
  className: cn("prt-slider", orientation, className, classNames?.wrapper)
2684
2936
  },
2685
- label && /* @__PURE__ */ React36.createElement(InputLabel, { style: styles?.label, className: classNames?.label }, label),
2686
- /* @__PURE__ */ React36.createElement(
2937
+ label && /* @__PURE__ */ React13.createElement(InputLabel, { style: styles?.label, className: classNames?.label }, label),
2938
+ /* @__PURE__ */ React13.createElement(
2687
2939
  SliderTrack,
2688
2940
  {
2689
2941
  className: cn("prt-slider-track", classNames?.track),
2690
2942
  style: styles?.track
2691
2943
  },
2692
- ({ state }) => /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(
2944
+ ({ state }) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
2693
2945
  "div",
2694
2946
  {
2947
+ "data-variant": "solid",
2948
+ "data-interactive": "false",
2695
2949
  style: {
2696
2950
  ...styles?.fill,
2697
2951
  width: `${state.getThumbPercent(0) * 100}%`
2698
2952
  },
2699
2953
  className: cn("prt-slider-track-fill", classNames?.fill)
2700
2954
  }
2701
- ), /* @__PURE__ */ React36.createElement(
2955
+ ), /* @__PURE__ */ React13.createElement(
2702
2956
  SliderThumb,
2703
2957
  {
2704
2958
  index: 0,
2705
2959
  name,
2960
+ "data-variant": "solid",
2961
+ "data-interactive": "false",
2706
2962
  className: cn("prt-slider-thumb", classNames?.thumb),
2707
2963
  style: styles?.thumb
2708
2964
  },
2709
- /* @__PURE__ */ React36.createElement(
2965
+ /* @__PURE__ */ React13.createElement(
2710
2966
  "div",
2711
2967
  {
2712
2968
  style: styles?.innerThumb,
@@ -2729,7 +2985,7 @@ function Sticker({
2729
2985
  ...props
2730
2986
  }) {
2731
2987
  const theme = useTheme();
2732
- return /* @__PURE__ */ React36__default.createElement(
2988
+ return /* @__PURE__ */ React13__default.createElement(
2733
2989
  "div",
2734
2990
  {
2735
2991
  ref,
@@ -2756,11 +3012,11 @@ function Tabs({
2756
3012
  ...props
2757
3013
  }) {
2758
3014
  const theme = useTheme();
2759
- const tabListRef = React36.useRef(null);
2760
- const [indicator, setIndicator] = React36.useState({ width: 0, left: 0 });
3015
+ const tabListRef = React13.useRef(null);
3016
+ const [indicator, setIndicator] = React13.useState({ width: 0, left: 0 });
2761
3017
  const tabs = [];
2762
- React36.Children.forEach(children, (child, index) => {
2763
- if (React36.isValidElement(child)) {
3018
+ React13.Children.forEach(children, (child, index) => {
3019
+ if (React13.isValidElement(child)) {
2764
3020
  tabs.push({
2765
3021
  id: child.props.id ?? child.key ?? index,
2766
3022
  title: child.props.title,
@@ -2769,13 +3025,13 @@ function Tabs({
2769
3025
  });
2770
3026
  }
2771
3027
  });
2772
- const [activeKey, setActiveKey] = React36.useState(
3028
+ const [activeKey, setActiveKey] = React13.useState(
2773
3029
  props.selectedKey ?? props.defaultSelectedKey ?? tabs[0]?.id
2774
3030
  );
2775
- React36.useEffect(() => {
3031
+ React13.useEffect(() => {
2776
3032
  if (props.selectedKey != null) setActiveKey(props.selectedKey);
2777
3033
  }, [props.selectedKey]);
2778
- React36.useEffect(() => {
3034
+ React13.useEffect(() => {
2779
3035
  const list = tabListRef.current;
2780
3036
  const selected = list?.querySelector(
2781
3037
  ".prt-tab[data-selected]"
@@ -2786,7 +3042,7 @@ function Tabs({
2786
3042
  setIndicator({ width: sb.width, left: sb.left - lb.left });
2787
3043
  }
2788
3044
  }, [activeKey, tabs.length]);
2789
- return /* @__PURE__ */ React36.createElement(
3045
+ return /* @__PURE__ */ React13.createElement(
2790
3046
  Tabs$1,
2791
3047
  {
2792
3048
  ...props,
@@ -2798,7 +3054,7 @@ function Tabs({
2798
3054
  className: cn("prt-tabs", className, classNames?.wrapper),
2799
3055
  style: { position: "relative", ...style, ...styles?.wrapper }
2800
3056
  },
2801
- /* @__PURE__ */ React36.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React36.createElement(
3057
+ /* @__PURE__ */ React13.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React13.createElement(
2802
3058
  TabList,
2803
3059
  {
2804
3060
  ref: tabListRef,
@@ -2806,7 +3062,7 @@ function Tabs({
2806
3062
  style: { ...styles?.list },
2807
3063
  items: tabs
2808
3064
  },
2809
- (tab) => /* @__PURE__ */ React36.createElement(
3065
+ (tab) => /* @__PURE__ */ React13.createElement(
2810
3066
  Tab$1,
2811
3067
  {
2812
3068
  id: tab.id,
@@ -2816,7 +3072,7 @@ function Tabs({
2816
3072
  },
2817
3073
  tab.title
2818
3074
  )
2819
- ), /* @__PURE__ */ React36.createElement(
3075
+ ), /* @__PURE__ */ React13.createElement(
2820
3076
  "div",
2821
3077
  {
2822
3078
  className: cn("indicator", classNames?.indicator),
@@ -2833,7 +3089,7 @@ function Tabs({
2833
3089
  }
2834
3090
  }
2835
3091
  )),
2836
- tabs.map((tab) => /* @__PURE__ */ React36.createElement(
3092
+ tabs.map((tab) => /* @__PURE__ */ React13.createElement(
2837
3093
  TabPanel,
2838
3094
  {
2839
3095
  key: String(tab.id),
@@ -2856,6 +3112,7 @@ function Table({
2856
3112
  selectionMode = "none",
2857
3113
  selectedKeys,
2858
3114
  onSelectionChange,
3115
+ onRowAction,
2859
3116
  sortDescriptor,
2860
3117
  onSortChange,
2861
3118
  renderEmptyState,
@@ -2866,14 +3123,13 @@ function Table({
2866
3123
  styles,
2867
3124
  ...props
2868
3125
  }) {
2869
- const racColumns = React36.useMemo(
3126
+ const racColumns = React13.useMemo(
2870
3127
  () => columns.map((column) => ({ ...column, id: column.key })),
2871
3128
  [columns]
2872
3129
  );
2873
- const firstColumnKey = columns[0]?.key;
2874
- const [internalSort, setInternalSort] = React36.useState();
3130
+ const [internalSort, setInternalSort] = React13.useState();
2875
3131
  const activeSort = onSortChange ? sortDescriptor : internalSort;
2876
- const rows = React36.useMemo(() => {
3132
+ const rows = React13.useMemo(() => {
2877
3133
  if (onSortChange || !activeSort) return data;
2878
3134
  const column = columns.find((c) => c.key === activeSort.column);
2879
3135
  if (!column) return data;
@@ -2884,63 +3140,94 @@ function Table({
2884
3140
  return activeSort.direction === "descending" ? -cmp : cmp;
2885
3141
  });
2886
3142
  }, [data, columns, activeSort, onSortChange]);
2887
- return /* @__PURE__ */ React36.createElement(
3143
+ return /* @__PURE__ */ React13.createElement(
2888
3144
  Table$1,
2889
3145
  {
2890
3146
  ...props,
2891
3147
  selectionMode,
2892
3148
  selectedKeys,
2893
3149
  onSelectionChange,
3150
+ onRowAction: onRowAction ? (key) => onRowAction(key) : void 0,
2894
3151
  sortDescriptor: activeSort,
2895
3152
  onSortChange: onSortChange ?? setInternalSort,
2896
3153
  "data-radius": radius,
2897
3154
  className: cn("prt-table", className, classNames?.wrapper),
2898
3155
  style: { ...style, ...styles?.wrapper }
2899
3156
  },
2900
- /* @__PURE__ */ React36.createElement(
2901
- TableHeader,
3157
+ /* @__PURE__ */ React13.createElement(
3158
+ TableHead,
2902
3159
  {
2903
- columns: racColumns,
2904
- className: cn("prt-table-header", classNames?.header)
2905
- },
2906
- (column) => /* @__PURE__ */ React36.createElement(
2907
- Column,
2908
- {
2909
- isRowHeader: column.key === firstColumnKey,
2910
- allowsSorting: column.allowSorting,
2911
- className: cn("prt-table-column", classNames?.column),
2912
- style: styles?.column
2913
- },
2914
- ({ allowsSorting, sortDirection }) => /* @__PURE__ */ React36.createElement("div", { className: "prt-table-column-header" }, /* @__PURE__ */ React36.createElement("span", null, column.title), allowsSorting && sortDirection && /* @__PURE__ */ React36.createElement("span", { "aria-hidden": "true", className: "prt-table-sort-indicator" }, sortDirection === "ascending" ? /* @__PURE__ */ React36.createElement(HiChevronUp, { size: 14 }) : /* @__PURE__ */ React36.createElement(HiChevronDown, { size: 14 })))
2915
- )
3160
+ columns,
3161
+ racColumns,
3162
+ classNames,
3163
+ styles
3164
+ }
2916
3165
  ),
2917
- /* @__PURE__ */ React36.createElement(
3166
+ /* @__PURE__ */ React13.createElement(
2918
3167
  TableBody,
2919
3168
  {
2920
3169
  items: rows,
2921
3170
  dependencies: [columns],
2922
- renderEmptyState: renderEmptyState ? () => /* @__PURE__ */ React36.createElement(React36.Fragment, null, renderEmptyState()) : void 0
3171
+ renderEmptyState: renderEmptyState ? () => /* @__PURE__ */ React13.createElement("div", { className: "prt-table-empty" }, renderEmptyState()) : void 0
2923
3172
  },
2924
- (item) => /* @__PURE__ */ React36.createElement(
2925
- Row,
3173
+ (item) => /* @__PURE__ */ React13.createElement(
3174
+ TableBodyRow,
2926
3175
  {
3176
+ item,
2927
3177
  id: getRowId(item),
2928
- columns: racColumns,
2929
- className: cn("prt-table-row", classNames?.row),
2930
- style: styles?.row
2931
- },
2932
- (column) => /* @__PURE__ */ React36.createElement(
2933
- Cell,
2934
- {
2935
- className: cn("prt-table-cell", classNames?.cell),
2936
- style: styles?.cell
2937
- },
2938
- column.render ? column.render(item[column.dataIndex], item) : item[column.dataIndex]
2939
- )
3178
+ racColumns,
3179
+ classNames,
3180
+ styles
3181
+ }
2940
3182
  )
2941
3183
  )
2942
3184
  );
2943
3185
  }
3186
+ function TableHead({
3187
+ columns,
3188
+ racColumns,
3189
+ classNames,
3190
+ styles
3191
+ }) {
3192
+ const { selectionBehavior, selectionMode } = useTableOptions();
3193
+ const firstColumnKey = columns[0]?.key;
3194
+ return /* @__PURE__ */ React13.createElement(TableHeader, { className: cn("prt-table-header", classNames?.header) }, selectionBehavior === "toggle" && /* @__PURE__ */ React13.createElement(Column, { className: "prt-table-column prt-table-selection" }, selectionMode === "multiple" ? /* @__PURE__ */ React13.createElement(Checkbox, { slot: "selection", size: "sm" }) : null), /* @__PURE__ */ React13.createElement(Collection, { items: racColumns }, (column) => /* @__PURE__ */ React13.createElement(
3195
+ Column,
3196
+ {
3197
+ isRowHeader: column.key === firstColumnKey,
3198
+ allowsSorting: column.allowSorting,
3199
+ className: cn("prt-table-column", classNames?.column),
3200
+ style: styles?.column
3201
+ },
3202
+ ({ allowsSorting, sortDirection }) => /* @__PURE__ */ React13.createElement("div", { className: "prt-table-column-header" }, /* @__PURE__ */ React13.createElement("span", null, column.title), allowsSorting && sortDirection && /* @__PURE__ */ React13.createElement("span", { "aria-hidden": "true", className: "prt-table-sort-indicator" }, sortDirection === "ascending" ? /* @__PURE__ */ React13.createElement(HiChevronUp, { size: 14 }) : /* @__PURE__ */ React13.createElement(HiChevronDown, { size: 14 })))
3203
+ )));
3204
+ }
3205
+ function TableBodyRow({
3206
+ item,
3207
+ id: id2,
3208
+ racColumns,
3209
+ classNames,
3210
+ styles
3211
+ }) {
3212
+ const { selectionBehavior } = useTableOptions();
3213
+ return /* @__PURE__ */ React13.createElement(
3214
+ Row,
3215
+ {
3216
+ id: id2,
3217
+ className: cn("prt-table-row", classNames?.row),
3218
+ style: styles?.row
3219
+ },
3220
+ selectionBehavior === "toggle" && /* @__PURE__ */ React13.createElement(Cell, { className: "prt-table-cell prt-table-selection" }, /* @__PURE__ */ React13.createElement(Checkbox, { slot: "selection", size: "sm" })),
3221
+ /* @__PURE__ */ React13.createElement(Collection, { items: racColumns }, (column) => /* @__PURE__ */ React13.createElement(
3222
+ Cell,
3223
+ {
3224
+ className: cn("prt-table-cell", classNames?.cell),
3225
+ style: styles?.cell
3226
+ },
3227
+ column.render ? column.render(item[column.dataIndex], item) : item[column.dataIndex]
3228
+ ))
3229
+ );
3230
+ }
2944
3231
  function Timeline({
2945
3232
  items,
2946
3233
  render,
@@ -2952,25 +3239,25 @@ function Timeline({
2952
3239
  className,
2953
3240
  style
2954
3241
  }) {
2955
- return /* @__PURE__ */ React36__default.createElement(
3242
+ return /* @__PURE__ */ React13__default.createElement(
2956
3243
  "div",
2957
3244
  {
2958
3245
  className: cn(classNames?.wrapper, className),
2959
3246
  style: { ...styles?.wrapper, ...style }
2960
3247
  },
2961
3248
  items.map((item, index) => {
2962
- const indicator = getIndicator?.(item) ?? /* @__PURE__ */ React36__default.createElement("div", { className: "prt-timeline-indicator", "data-variant": "outline" });
3249
+ const indicator = getIndicator?.(item) ?? /* @__PURE__ */ React13__default.createElement("div", { className: "prt-timeline-indicator", "data-variant": "outline" });
2963
3250
  const content = render?.(item) ?? item[labelKey];
2964
3251
  const isLast = index === items.length - 1;
2965
- return /* @__PURE__ */ React36__default.createElement(
3252
+ return /* @__PURE__ */ React13__default.createElement(
2966
3253
  "div",
2967
3254
  {
2968
3255
  className: cn("flex gap-3 prt-timeline-item", classNames?.item),
2969
3256
  style: { ...styles?.item },
2970
3257
  key: index
2971
3258
  },
2972
- /* @__PURE__ */ React36__default.createElement("div", { className: "flex flex-col items-center gap-3" }, /* @__PURE__ */ React36__default.createElement("div", { className: "flex gap-3 prt-timeline-indicator-container" }, indicator), isLast && hideLastItemTail ? null : /* @__PURE__ */ React36__default.createElement("div", { className: "prt-timeline-item-tail" })),
2973
- /* @__PURE__ */ React36__default.createElement(
3259
+ /* @__PURE__ */ React13__default.createElement("div", { className: "flex flex-col items-center gap-3" }, /* @__PURE__ */ React13__default.createElement("div", { className: "flex gap-3 prt-timeline-indicator-container" }, indicator), isLast && hideLastItemTail ? null : /* @__PURE__ */ React13__default.createElement("div", { className: "prt-timeline-item-tail" })),
3260
+ /* @__PURE__ */ React13__default.createElement(
2974
3261
  "div",
2975
3262
  {
2976
3263
  className: cn(
@@ -3009,7 +3296,7 @@ function Modal({
3009
3296
  ...props
3010
3297
  }) {
3011
3298
  const theme = useTheme();
3012
- return /* @__PURE__ */ React36.createElement(
3299
+ return /* @__PURE__ */ React13.createElement(
3013
3300
  ModalOverlay,
3014
3301
  {
3015
3302
  ...props,
@@ -3017,14 +3304,14 @@ function Modal({
3017
3304
  style: styles?.underlay,
3018
3305
  className: cn("prt-modal-underlay", classNames?.underlay)
3019
3306
  },
3020
- /* @__PURE__ */ React36.createElement(
3307
+ /* @__PURE__ */ React13.createElement(
3021
3308
  Modal$1,
3022
3309
  {
3023
- "data-variant": variant,
3310
+ "data-layout": variant,
3024
3311
  style: styles?.wrapper,
3025
3312
  className: cn("prt-modal-container", classNames?.wrapper)
3026
3313
  },
3027
- /* @__PURE__ */ React36.createElement(
3314
+ /* @__PURE__ */ React13.createElement(
3028
3315
  Dialog,
3029
3316
  {
3030
3317
  "aria-label": typeof title === "string" ? title : void 0,
@@ -3032,7 +3319,7 @@ function Modal({
3032
3319
  className: cn("prt-modal-content", className, classNames?.content),
3033
3320
  style: { width, ...style, ...styles?.content }
3034
3321
  },
3035
- ({ close }) => /* @__PURE__ */ React36.createElement(React36.Fragment, null, !hideTitle && /* @__PURE__ */ React36.createElement(
3322
+ ({ close }) => /* @__PURE__ */ React13.createElement(React13.Fragment, null, !hideTitle && /* @__PURE__ */ React13.createElement(
3036
3323
  "header",
3037
3324
  {
3038
3325
  style: styles?.header,
@@ -3041,7 +3328,7 @@ function Modal({
3041
3328
  classNames?.header
3042
3329
  )
3043
3330
  },
3044
- /* @__PURE__ */ React36.createElement("div", { className: "flex flex-col gap-1" }, title && /* @__PURE__ */ React36.createElement(
3331
+ /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-1" }, title && /* @__PURE__ */ React13.createElement(
3045
3332
  "div",
3046
3333
  {
3047
3334
  style: styles?.title,
@@ -3051,8 +3338,8 @@ function Modal({
3051
3338
  )
3052
3339
  },
3053
3340
  title
3054
- ), description && /* @__PURE__ */ React36.createElement("div", { className: "text-xs leading-normal text-gray-500" }, description)),
3055
- showCloseButton && /* @__PURE__ */ React36.createElement(
3341
+ ), description && /* @__PURE__ */ React13.createElement("div", { className: "text-xs leading-normal text-gray-500" }, description)),
3342
+ showCloseButton && /* @__PURE__ */ React13.createElement(
3056
3343
  IconButton,
3057
3344
  {
3058
3345
  variant: "ghost",
@@ -3063,9 +3350,9 @@ function Modal({
3063
3350
  close();
3064
3351
  }
3065
3352
  },
3066
- /* @__PURE__ */ React36.createElement(HiX, { size: 18 })
3353
+ /* @__PURE__ */ React13.createElement(HiX, { size: 18 })
3067
3354
  )
3068
- ), /* @__PURE__ */ React36.createElement(
3355
+ ), /* @__PURE__ */ React13.createElement(
3069
3356
  "div",
3070
3357
  {
3071
3358
  className: cn(
@@ -3075,7 +3362,7 @@ function Modal({
3075
3362
  style: styles?.body
3076
3363
  },
3077
3364
  children
3078
- ), (onConfirm || onCancel) && /* @__PURE__ */ React36.createElement(
3365
+ ), (onConfirm || onCancel) && /* @__PURE__ */ React13.createElement(
3079
3366
  "footer",
3080
3367
  {
3081
3368
  style: styles?.footer,
@@ -3084,7 +3371,7 @@ function Modal({
3084
3371
  classNames?.footer
3085
3372
  )
3086
3373
  },
3087
- onCancel && /* @__PURE__ */ React36.createElement(
3374
+ onCancel && /* @__PURE__ */ React13.createElement(
3088
3375
  Button,
3089
3376
  {
3090
3377
  onPress: () => {
@@ -3097,7 +3384,7 @@ function Modal({
3097
3384
  },
3098
3385
  cancelLabel
3099
3386
  ),
3100
- onConfirm && /* @__PURE__ */ React36.createElement(Button, { onPress: onConfirm, ...confirmButtonProps }, confirmLabel)
3387
+ onConfirm && /* @__PURE__ */ React13.createElement(Button, { onPress: onConfirm, ...confirmButtonProps }, confirmLabel)
3101
3388
  ))
3102
3389
  )
3103
3390
  )
@@ -3106,14 +3393,89 @@ function Modal({
3106
3393
  function useModal(props = {}) {
3107
3394
  return useOverlayTriggerState(props);
3108
3395
  }
3396
+ var ModalContext = React13.createContext(null);
3397
+ var counter = 0;
3398
+ function uid() {
3399
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
3400
+ return crypto.randomUUID();
3401
+ }
3402
+ return `prt-modal-${++counter}`;
3403
+ }
3404
+ function ModalProvider({ registry, children }) {
3405
+ const registryRef = React13.useRef(registry);
3406
+ registryRef.current = registry;
3407
+ const [stack, setStack] = React13.useState([]);
3408
+ const stackRef = React13.useRef(stack);
3409
+ stackRef.current = stack;
3410
+ const closeById = React13.useCallback((id2, result) => {
3411
+ setStack((prev) => {
3412
+ prev.find((m) => m.id === id2)?.resolve(result);
3413
+ return prev.filter((m) => m.id !== id2);
3414
+ });
3415
+ }, []);
3416
+ const controls = React13.useMemo(
3417
+ () => ({
3418
+ open: (key, props) => new Promise((resolve) => {
3419
+ setStack((prev) => [
3420
+ ...prev,
3421
+ {
3422
+ id: uid(),
3423
+ key,
3424
+ props: props ?? {},
3425
+ resolve
3426
+ }
3427
+ ]);
3428
+ }),
3429
+ close: (key) => {
3430
+ setStack((prev) => {
3431
+ for (const m of prev) if (m.key === key) m.resolve(void 0);
3432
+ return prev.filter((m) => m.key !== key);
3433
+ });
3434
+ },
3435
+ update: (key, props) => {
3436
+ setStack(
3437
+ (prev) => prev.map(
3438
+ (m) => m.key === key ? { ...m, props: { ...m.props, ...props } } : m
3439
+ )
3440
+ );
3441
+ },
3442
+ isOpen: (key) => stackRef.current.some((m) => m.key === key)
3443
+ }),
3444
+ []
3445
+ );
3446
+ return /* @__PURE__ */ React13.createElement(ModalContext.Provider, { value: controls }, children, stack.map((instance) => {
3447
+ const def = registryRef.current[instance.key];
3448
+ if (!def) return null;
3449
+ const Component = def.component;
3450
+ return /* @__PURE__ */ React13.createElement(
3451
+ Component,
3452
+ {
3453
+ key: instance.id,
3454
+ ...instance.props,
3455
+ isOpen: true,
3456
+ onOpenChange: (open) => {
3457
+ if (!open) closeById(instance.id, void 0);
3458
+ },
3459
+ onResolve: (result) => closeById(instance.id, result)
3460
+ }
3461
+ );
3462
+ }));
3463
+ }
3464
+ function useModals() {
3465
+ const ctx = React13.useContext(ModalContext);
3466
+ if (!ctx) {
3467
+ throw new Error("useModals must be used within <ModalProvider>");
3468
+ }
3469
+ return ctx;
3470
+ }
3109
3471
 
3110
3472
  // src/utils/regex.ts
3111
3473
  var EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3112
3474
  function useControlledState(value, defaultValue, onChange) {
3113
- const [state, setState] = React36.useState(value || defaultValue);
3475
+ const [state, setState] = React13.useState(value || defaultValue);
3114
3476
  const isControlled = !isUndefinedOrNull(value);
3115
3477
  const controlledValue = isControlled ? value : state;
3116
- const setValue = React36.useCallback(
3478
+ const setValue = React13.useCallback(
3117
3479
  (value2) => {
3118
3480
  if (!isControlled) {
3119
3481
  setState(value2);
@@ -3157,7 +3519,7 @@ function escapeRegExp(value) {
3157
3519
  }
3158
3520
  function TagInput({
3159
3521
  appearance = "outline",
3160
- size = "md",
3522
+ size,
3161
3523
  label,
3162
3524
  error,
3163
3525
  description,
@@ -3184,15 +3546,17 @@ function TagInput({
3184
3546
  renderTag,
3185
3547
  ref
3186
3548
  }) {
3187
- const [inputValue, setInputValue] = React36.useState("");
3549
+ const theme = useTheme();
3550
+ const resolvedSize = size ?? theme?.size ?? "md";
3551
+ const [inputValue, setInputValue] = React13.useState("");
3188
3552
  const [values, setValues] = useControlledState(
3189
3553
  dedupe(tags),
3190
3554
  dedupe(defaultTags) ?? [],
3191
3555
  onChange
3192
3556
  );
3193
- const inputRef = React36.useRef(null);
3557
+ const inputRef = React13.useRef(null);
3194
3558
  const isValid = validate ?? FORMAT_VALIDATORS[format];
3195
- const splitPattern = React36.useMemo(
3559
+ const splitPattern = React13.useMemo(
3196
3560
  () => new RegExp(`[${delimiters.map(escapeRegExp).join("")}\\n]`),
3197
3561
  [delimiters]
3198
3562
  );
@@ -3231,7 +3595,7 @@ function TagInput({
3231
3595
  inputRef.current?.focus();
3232
3596
  }
3233
3597
  const groupLabel = typeof label === "string" ? label : "tags";
3234
- return /* @__PURE__ */ React36.createElement(
3598
+ return /* @__PURE__ */ React13.createElement(
3235
3599
  TextField,
3236
3600
  {
3237
3601
  value: inputValue,
@@ -3239,7 +3603,7 @@ function TagInput({
3239
3603
  isRequired,
3240
3604
  isInvalid: !!error
3241
3605
  },
3242
- /* @__PURE__ */ React36.createElement(
3606
+ /* @__PURE__ */ React13.createElement(
3243
3607
  Field,
3244
3608
  {
3245
3609
  replaceDefaultControlWrapper: true,
@@ -3247,7 +3611,7 @@ function TagInput({
3247
3611
  error,
3248
3612
  description,
3249
3613
  color,
3250
- size,
3614
+ size: resolvedSize,
3251
3615
  radius,
3252
3616
  appearance,
3253
3617
  validationStatus,
@@ -3256,7 +3620,7 @@ function TagInput({
3256
3620
  style,
3257
3621
  styles
3258
3622
  },
3259
- /* @__PURE__ */ React36.createElement(
3623
+ /* @__PURE__ */ React13.createElement(
3260
3624
  "div",
3261
3625
  {
3262
3626
  ref,
@@ -3264,14 +3628,14 @@ function TagInput({
3264
3628
  "data-appearance": appearance,
3265
3629
  onClick: captureFocus
3266
3630
  },
3267
- /* @__PURE__ */ React36.createElement(
3631
+ /* @__PURE__ */ React13.createElement(
3268
3632
  TagGroup$1,
3269
3633
  {
3270
3634
  "aria-label": groupLabel,
3271
3635
  className: "prt-tag-field-group",
3272
3636
  onRemove: (keys) => setValues(values.filter((v) => !keys.has(v)))
3273
3637
  },
3274
- /* @__PURE__ */ React36.createElement(TagList, { className: "prt-tag-field-list" }, values.map((value) => /* @__PURE__ */ React36.createElement(
3638
+ /* @__PURE__ */ React13.createElement(TagList, { className: "prt-tag-field-list" }, values.map((value) => /* @__PURE__ */ React13.createElement(
3275
3639
  Tag$1,
3276
3640
  {
3277
3641
  key: value,
@@ -3279,28 +3643,28 @@ function TagInput({
3279
3643
  textValue: value,
3280
3644
  className: "prt-tag-field-tag"
3281
3645
  },
3282
- renderTag ? renderTag(value, removeValue) : /* @__PURE__ */ React36.createElement(
3646
+ renderTag ? renderTag(value, removeValue) : /* @__PURE__ */ React13.createElement(
3283
3647
  Tag,
3284
3648
  {
3285
3649
  variant: tagVariant,
3286
3650
  color: tagColor,
3287
3651
  radius: tagShape ? SHAPE_RADIUS[tagShape] : "full",
3288
3652
  size: tagSize,
3289
- append: /* @__PURE__ */ React36.createElement(
3653
+ append: /* @__PURE__ */ React13.createElement(
3290
3654
  Button$1,
3291
3655
  {
3292
3656
  slot: "remove",
3293
3657
  className: "prt-tag-field-remove",
3294
3658
  "aria-label": `Remove ${value}`
3295
3659
  },
3296
- /* @__PURE__ */ React36.createElement(HiX, { size: 14 })
3660
+ /* @__PURE__ */ React13.createElement(HiX, { size: 14 })
3297
3661
  )
3298
3662
  },
3299
3663
  value
3300
3664
  )
3301
3665
  )))
3302
3666
  ),
3303
- /* @__PURE__ */ React36.createElement(
3667
+ /* @__PURE__ */ React13.createElement(
3304
3668
  Input$1,
3305
3669
  {
3306
3670
  ref: inputRef,
@@ -3313,22 +3677,22 @@ function TagInput({
3313
3677
  )
3314
3678
  );
3315
3679
  }
3316
- var PopoverContext = React36.createContext(null);
3680
+ var PopoverContext = React13.createContext(null);
3317
3681
  function usePopoverContext(component) {
3318
- const ctx = React36.useContext(PopoverContext);
3682
+ const ctx = React13.useContext(PopoverContext);
3319
3683
  if (!ctx) {
3320
3684
  throw new Error(`${component} must be used within a Popover`);
3321
3685
  }
3322
3686
  return ctx;
3323
3687
  }
3324
3688
  function Popover({ children, ...props }) {
3325
- const triggerRef = React36.useRef(null);
3689
+ const triggerRef = React13.useRef(null);
3326
3690
  const state = useOverlayTriggerState(props);
3327
- return /* @__PURE__ */ React36.createElement(PopoverContext.Provider, { value: { triggerRef, state } }, children);
3691
+ return /* @__PURE__ */ React13.createElement(PopoverContext.Provider, { value: { triggerRef, state } }, children);
3328
3692
  }
3329
3693
  function PopoverTrigger({ children }) {
3330
3694
  const ctx = usePopoverContext("PopoverTrigger");
3331
- return React36.cloneElement(children, {
3695
+ return React13.cloneElement(children, {
3332
3696
  ref: ctx.triggerRef,
3333
3697
  onPress: () => ctx.state.toggle()
3334
3698
  });
@@ -3346,7 +3710,7 @@ function PopoverContent({
3346
3710
  }) {
3347
3711
  const ctx = usePopoverContext("PopoverContent");
3348
3712
  const theme = useTheme();
3349
- return /* @__PURE__ */ React36.createElement(
3713
+ return /* @__PURE__ */ React13.createElement(
3350
3714
  Popover$1,
3351
3715
  {
3352
3716
  ...props,
@@ -3360,7 +3724,7 @@ function PopoverContent({
3360
3724
  className: cn("prt-popover", classNames?.popover),
3361
3725
  style: { ...width != null ? { width } : null, ...styles?.popover }
3362
3726
  },
3363
- /* @__PURE__ */ React36.createElement(
3727
+ /* @__PURE__ */ React13.createElement(
3364
3728
  "div",
3365
3729
  {
3366
3730
  "data-radius": "md",
@@ -3371,7 +3735,7 @@ function PopoverContent({
3371
3735
  )
3372
3736
  );
3373
3737
  }
3374
- var TagGroupVariantContext = React36.createContext({});
3738
+ var TagGroupVariantContext = React13.createContext({});
3375
3739
  function TagGroup({
3376
3740
  label,
3377
3741
  description,
@@ -3390,24 +3754,24 @@ function TagGroup({
3390
3754
  style,
3391
3755
  ...props
3392
3756
  }) {
3393
- const variants = React36.useMemo(
3757
+ const variants = React13.useMemo(
3394
3758
  () => ({ activeColor, activeVariant, idleColor, idleVariant, autoColor }),
3395
3759
  [activeColor, activeVariant, idleColor, idleVariant, autoColor]
3396
3760
  );
3397
- return /* @__PURE__ */ React36.createElement(
3761
+ return /* @__PURE__ */ React13.createElement(
3398
3762
  TagGroup$1,
3399
3763
  {
3400
3764
  ...props,
3401
3765
  "aria-label": typeof label === "string" ? label : void 0
3402
3766
  },
3403
- /* @__PURE__ */ React36.createElement(
3767
+ /* @__PURE__ */ React13.createElement(
3404
3768
  "div",
3405
3769
  {
3406
3770
  className: cn("flex flex-col gap-3 tag-group", classNames?.wrapper, className),
3407
3771
  style: { ...styles?.wrapper, ...style }
3408
3772
  },
3409
- label && /* @__PURE__ */ React36.createElement(InputLabel, null, label),
3410
- /* @__PURE__ */ React36.createElement(TagGroupVariantContext.Provider, { value: variants }, /* @__PURE__ */ React36.createElement(
3773
+ label && /* @__PURE__ */ React13.createElement(InputLabel, null, label),
3774
+ /* @__PURE__ */ React13.createElement(TagGroupVariantContext.Provider, { value: variants }, /* @__PURE__ */ React13.createElement(
3411
3775
  TagList,
3412
3776
  {
3413
3777
  items,
@@ -3417,8 +3781,8 @@ function TagGroup({
3417
3781
  },
3418
3782
  children
3419
3783
  )),
3420
- errorMessage && /* @__PURE__ */ React36.createElement(InputError, null, errorMessage),
3421
- description && /* @__PURE__ */ React36.createElement("div", { className: "text-sm text-gray-700" }, description)
3784
+ errorMessage && /* @__PURE__ */ React13.createElement(InputError, null, errorMessage),
3785
+ description && /* @__PURE__ */ React13.createElement("div", { className: "text-sm text-gray-700" }, description)
3422
3786
  )
3423
3787
  );
3424
3788
  }
@@ -3434,10 +3798,10 @@ function TagGroupItem({
3434
3798
  idleColor = "gray",
3435
3799
  idleVariant = "outline",
3436
3800
  autoColor
3437
- } = React36.useContext(TagGroupVariantContext);
3801
+ } = React13.useContext(TagGroupVariantContext);
3438
3802
  const resolvedActive = activeColor ?? theme?.color ?? "gray";
3439
3803
  const tv = textValue ?? (typeof children === "string" ? children : void 0);
3440
- return /* @__PURE__ */ React36.createElement(
3804
+ return /* @__PURE__ */ React13.createElement(
3441
3805
  Tag$1,
3442
3806
  {
3443
3807
  ...props,
@@ -3445,7 +3809,7 @@ function TagGroupItem({
3445
3809
  render: (domProps, { isSelected }) => {
3446
3810
  const color = autoColor ? getRandomColor(String(tv ?? "")) : isSelected ? resolvedActive : idleColor;
3447
3811
  const variant = isSelected ? activeVariant : idleVariant;
3448
- return /* @__PURE__ */ React36.createElement(
3812
+ return /* @__PURE__ */ React13.createElement(
3449
3813
  "div",
3450
3814
  {
3451
3815
  ...domProps,
@@ -3470,7 +3834,7 @@ function ColorPicker({
3470
3834
  className,
3471
3835
  style
3472
3836
  }) {
3473
- const [colorSpace, setColorSpace] = React36.useState("hex");
3837
+ const [colorSpace, setColorSpace] = React13.useState("hex");
3474
3838
  const [color, setColor] = useControlledState(
3475
3839
  colorProp,
3476
3840
  parseColor("#BB66CC").toFormat("hsla"),
@@ -3490,13 +3854,13 @@ function ColorPicker({
3490
3854
  const [h, s, l] = color.getColorChannels();
3491
3855
  const rgbaColor = color.toFormat("rgba");
3492
3856
  const [r, g, b] = rgbaColor.getColorChannels();
3493
- return /* @__PURE__ */ React36.createElement(
3857
+ return /* @__PURE__ */ React13.createElement(
3494
3858
  "div",
3495
3859
  {
3496
3860
  className: cn("flex flex-col gap-3", className, classNames?.wrapper),
3497
3861
  style: { width: 240, ...style, ...styles?.wrapper }
3498
3862
  },
3499
- /* @__PURE__ */ React36.createElement(
3863
+ /* @__PURE__ */ React13.createElement(
3500
3864
  ColorArea,
3501
3865
  {
3502
3866
  onChange: handleChange,
@@ -3507,7 +3871,7 @@ function ColorPicker({
3507
3871
  style: { width: "100%", height: 140 }
3508
3872
  }
3509
3873
  ),
3510
- /* @__PURE__ */ React36.createElement("div", { className: "flex flex-col gap-3", style: { padding: 8 } }, /* @__PURE__ */ React36.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ React36.createElement(
3874
+ /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-3", style: { padding: 8 } }, /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ React13.createElement(
3511
3875
  ColorSlider,
3512
3876
  {
3513
3877
  value: color,
@@ -3515,7 +3879,7 @@ function ColorPicker({
3515
3879
  onChangeEnd: handleChange,
3516
3880
  channel: h
3517
3881
  }
3518
- ), /* @__PURE__ */ React36.createElement(
3882
+ ), /* @__PURE__ */ React13.createElement(
3519
3883
  ColorSlider,
3520
3884
  {
3521
3885
  value: color,
@@ -3523,7 +3887,7 @@ function ColorPicker({
3523
3887
  onChangeEnd: handleChange,
3524
3888
  channel: "alpha"
3525
3889
  }
3526
- )), /* @__PURE__ */ React36.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React36.createElement("div", { className: "flex gap-1", style: { width: "100%" } }, colorSpace === "hex" && /* @__PURE__ */ React36.createElement(Space, { style: { gap: 3 }, compact: true }, /* @__PURE__ */ React36.createElement(
3890
+ )), /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React13.createElement("div", { className: "flex gap-1", style: { width: "100%" } }, colorSpace === "hex" && /* @__PURE__ */ React13.createElement(Space, { style: { gap: 3 }, compact: true }, /* @__PURE__ */ React13.createElement(
3527
3891
  ColorField,
3528
3892
  {
3529
3893
  value: color,
@@ -3533,7 +3897,7 @@ function ColorPicker({
3533
3897
  appearance: "filled",
3534
3898
  placeholder: "Add a color"
3535
3899
  }
3536
- ), /* @__PURE__ */ React36.createElement(
3900
+ ), /* @__PURE__ */ React13.createElement(
3537
3901
  NumberInput,
3538
3902
  {
3539
3903
  onChange: (n) => setAlpha(n),
@@ -3547,28 +3911,28 @@ function ColorPicker({
3547
3911
  style: { width: "40%" },
3548
3912
  appearance: "filled"
3549
3913
  }
3550
- )), ["rgb", "hsl"].includes(colorSpace) && /* @__PURE__ */ React36.createElement(Space, { style: { gap: 3 }, compact: true }, /* @__PURE__ */ React36.createElement(
3914
+ )), ["rgb", "hsl"].includes(colorSpace) && /* @__PURE__ */ React13.createElement(Space, { style: { gap: 3 }, compact: true }, /* @__PURE__ */ React13.createElement(
3551
3915
  NumberInput,
3552
3916
  {
3553
3917
  value: colorSpace === "rgb" ? rgbaColor.getChannelValue(r) : color.getChannelValue(h),
3554
3918
  appearance: "filled",
3555
3919
  size: "sm"
3556
3920
  }
3557
- ), /* @__PURE__ */ React36.createElement(
3921
+ ), /* @__PURE__ */ React13.createElement(
3558
3922
  NumberInput,
3559
3923
  {
3560
3924
  value: colorSpace === "rgb" ? rgbaColor.getChannelValue(g) : color.getChannelValue(s),
3561
3925
  appearance: "filled",
3562
3926
  size: "sm"
3563
3927
  }
3564
- ), /* @__PURE__ */ React36.createElement(
3928
+ ), /* @__PURE__ */ React13.createElement(
3565
3929
  NumberInput,
3566
3930
  {
3567
3931
  value: colorSpace === "rgb" ? rgbaColor.getChannelValue(b) : color.getChannelValue(l),
3568
3932
  appearance: "filled",
3569
3933
  size: "sm"
3570
3934
  }
3571
- ), /* @__PURE__ */ React36.createElement(
3935
+ ), /* @__PURE__ */ React13.createElement(
3572
3936
  NumberInput,
3573
3937
  {
3574
3938
  formatOptions: {
@@ -3579,12 +3943,12 @@ function ColorPicker({
3579
3943
  appearance: "filled",
3580
3944
  size: "sm"
3581
3945
  }
3582
- )), /* @__PURE__ */ React36.createElement(
3946
+ )), /* @__PURE__ */ React13.createElement(
3583
3947
  Select,
3584
3948
  {
3585
3949
  style: { width: "60%" },
3586
3950
  valueKey: "id",
3587
- onChange: (v) => setColorSpace(v.target.value ?? colorSpace),
3951
+ onChange: (v) => setColorSpace(v ?? colorSpace),
3588
3952
  showSelectionIndicator: false,
3589
3953
  value: colorSpace,
3590
3954
  size: "sm",
@@ -3594,7 +3958,7 @@ function ColorPicker({
3594
3958
  id: o
3595
3959
  }))
3596
3960
  }
3597
- )), /* @__PURE__ */ React36.createElement(Separator, { color: "gray" }), /* @__PURE__ */ React36.createElement("div", { className: "flex gap-3" }, /* @__PURE__ */ React36.createElement(
3961
+ )), /* @__PURE__ */ React13.createElement(Separator, { color: "gray" }), /* @__PURE__ */ React13.createElement("div", { className: "flex gap-3" }, /* @__PURE__ */ React13.createElement(
3598
3962
  ColorSwatchPicker,
3599
3963
  {
3600
3964
  styles: {
@@ -3647,7 +4011,7 @@ function ColorArea({
3647
4011
  ...props
3648
4012
  }) {
3649
4013
  const theme = useTheme();
3650
- return /* @__PURE__ */ React36.createElement(
4014
+ return /* @__PURE__ */ React13.createElement(
3651
4015
  ColorArea$1,
3652
4016
  {
3653
4017
  ...props,
@@ -3659,7 +4023,7 @@ function ColorArea({
3659
4023
  ...style
3660
4024
  })
3661
4025
  },
3662
- /* @__PURE__ */ React36.createElement(
4026
+ /* @__PURE__ */ React13.createElement(
3663
4027
  ColorThumb,
3664
4028
  {
3665
4029
  className: cn("prt-color-area-thumb", classNames?.thumb),
@@ -3689,14 +4053,14 @@ function ColorField({
3689
4053
  placeholder,
3690
4054
  ...colorFieldProps
3691
4055
  }) {
3692
- return /* @__PURE__ */ React36.createElement(
4056
+ return /* @__PURE__ */ React13.createElement(
3693
4057
  ColorField$1,
3694
4058
  {
3695
4059
  ...colorFieldProps,
3696
4060
  isInvalid: !!error,
3697
4061
  "aria-label": colorFieldProps["aria-label"] ?? "color-field"
3698
4062
  },
3699
- /* @__PURE__ */ React36.createElement(
4063
+ /* @__PURE__ */ React13.createElement(
3700
4064
  Field,
3701
4065
  {
3702
4066
  className,
@@ -3715,7 +4079,7 @@ function ColorField({
3715
4079
  appearance,
3716
4080
  validationStatus
3717
4081
  },
3718
- /* @__PURE__ */ React36.createElement(
4082
+ /* @__PURE__ */ React13.createElement(
3719
4083
  Input$1,
3720
4084
  {
3721
4085
  ref: inputRef,
@@ -3740,7 +4104,7 @@ function ColorSwatchPicker({
3740
4104
  styles,
3741
4105
  ...props
3742
4106
  }) {
3743
- return /* @__PURE__ */ React36.createElement(
4107
+ return /* @__PURE__ */ React13.createElement(
3744
4108
  ColorSwatchPicker$1,
3745
4109
  {
3746
4110
  ...props,
@@ -3749,7 +4113,7 @@ function ColorSwatchPicker({
3749
4113
  className: cn("prt-color-swatch-picker", className, classNames?.wrapper),
3750
4114
  style: { ...style, ...styles?.wrapper }
3751
4115
  },
3752
- colors.map((option) => /* @__PURE__ */ React36.createElement(
4116
+ colors.map((option) => /* @__PURE__ */ React13.createElement(
3753
4117
  ColorSwatchPickerItem,
3754
4118
  {
3755
4119
  key: option.key ?? option.color,
@@ -3757,18 +4121,18 @@ function ColorSwatchPicker({
3757
4121
  className: cn("prt-color-swatch-item", classNames?.swatch),
3758
4122
  style: styles?.swatch
3759
4123
  },
3760
- /* @__PURE__ */ React36.createElement(ColorSwatch, { className: "prt-color-swatch" })
4124
+ /* @__PURE__ */ React13.createElement(ColorSwatch, { className: "prt-color-swatch" })
3761
4125
  ))
3762
4126
  );
3763
4127
  }
3764
4128
  function ColorSlider({ label, ...props }) {
3765
- return /* @__PURE__ */ React36.createElement(
4129
+ return /* @__PURE__ */ React13.createElement(
3766
4130
  ColorSlider$1,
3767
4131
  {
3768
4132
  ...props,
3769
4133
  "aria-label": props["aria-label"] ?? "color-slider"
3770
4134
  },
3771
- /* @__PURE__ */ React36.createElement(Field, { label, className: "prt-color-slider", replaceDefaultControlWrapper: true }, /* @__PURE__ */ React36.createElement(SliderTrack, { className: "prt-color-slider-track" }, /* @__PURE__ */ React36.createElement("div", { className: "prt-color-slider-checkers" }), /* @__PURE__ */ React36.createElement(
4135
+ /* @__PURE__ */ React13.createElement(Field, { label, className: "prt-color-slider", replaceDefaultControlWrapper: true }, /* @__PURE__ */ React13.createElement(SliderTrack, { className: "prt-color-slider-track" }, /* @__PURE__ */ React13.createElement("div", { className: "prt-color-slider-checkers" }), /* @__PURE__ */ React13.createElement(
3772
4136
  ColorThumb,
3773
4137
  {
3774
4138
  className: "prt-color-slider-thumb",
@@ -3806,7 +4170,7 @@ function ToggleGroup({
3806
4170
  styles,
3807
4171
  children
3808
4172
  }) {
3809
- const groupDefaults = React36.useMemo(
4173
+ const groupDefaults = React13.useMemo(
3810
4174
  () => ({ idleColor, idleVariant, activeColor, activeVariant, size, radius }),
3811
4175
  [idleColor, idleVariant, activeColor, activeVariant, size, radius]
3812
4176
  );
@@ -3816,7 +4180,7 @@ function ToggleGroup({
3816
4180
  selectionMode === "multiple" ? arr : arr[0] ?? ""
3817
4181
  );
3818
4182
  }
3819
- return /* @__PURE__ */ React36.createElement(
4183
+ return /* @__PURE__ */ React13.createElement(
3820
4184
  ToggleButtonGroup,
3821
4185
  {
3822
4186
  "aria-label": label,
@@ -3827,7 +4191,7 @@ function ToggleGroup({
3827
4191
  disallowEmptySelection: disallowEmptySelection ?? selectionMode === "single",
3828
4192
  orientation
3829
4193
  },
3830
- /* @__PURE__ */ React36.createElement(ToggleButtonGroupContext.Provider, { value: groupDefaults }, /* @__PURE__ */ React36.createElement(
4194
+ /* @__PURE__ */ React13.createElement(ToggleButtonGroupContext.Provider, { value: groupDefaults }, /* @__PURE__ */ React13.createElement(
3831
4195
  Space,
3832
4196
  {
3833
4197
  compact,
@@ -3842,9 +4206,591 @@ function ToggleGroup({
3842
4206
  );
3843
4207
  }
3844
4208
  function Toggle({ value, ...props }) {
3845
- return /* @__PURE__ */ React36.createElement(ToggleButton, { id: value, ...props });
4209
+ return /* @__PURE__ */ React13.createElement(ToggleButton, { id: value, ...props });
4210
+ }
4211
+ var DEFAULT_TIMEOUT = 4e3;
4212
+ var ALL_POSITIONS = [
4213
+ "top-left",
4214
+ "top-center",
4215
+ "top-right",
4216
+ "bottom-left",
4217
+ "bottom-center",
4218
+ "bottom-right"
4219
+ ];
4220
+ var VARIANT_COLOR = {
4221
+ success: "success",
4222
+ error: "critical",
4223
+ warning: "warning",
4224
+ info: "info"
4225
+ };
4226
+ function createQueue() {
4227
+ return new UNSTABLE_ToastQueue({
4228
+ maxVisibleToasts: 5,
4229
+ wrapUpdate(fn) {
4230
+ flushSync(fn);
4231
+ }
4232
+ });
4233
+ }
4234
+ var queues = {
4235
+ "top-left": createQueue(),
4236
+ "top-center": createQueue(),
4237
+ "top-right": createQueue(),
4238
+ "bottom-left": createQueue(),
4239
+ "bottom-center": createQueue(),
4240
+ "bottom-right": createQueue()
4241
+ };
4242
+ var defaultPosition = "top-right";
4243
+ function resolveTimeout(duration) {
4244
+ if (duration == null) return DEFAULT_TIMEOUT;
4245
+ if (!Number.isFinite(duration) || duration <= 0) return void 0;
4246
+ return duration;
4247
+ }
4248
+ function ToastIcon({ variant }) {
4249
+ switch (variant) {
4250
+ case "success":
4251
+ return /* @__PURE__ */ React13.createElement(HiOutlineCheckCircle, { className: "prt-toast-icon", size: 20 });
4252
+ case "error":
4253
+ case "warning":
4254
+ return /* @__PURE__ */ React13.createElement(HiOutlineExclamationCircle, { className: "prt-toast-icon", size: 20 });
4255
+ case "info":
4256
+ return /* @__PURE__ */ React13.createElement(HiOutlineInformationCircle, { className: "prt-toast-icon", size: 20 });
4257
+ default:
4258
+ return null;
4259
+ }
4260
+ }
4261
+ function ToastItem({
4262
+ toast: toast2,
4263
+ queue,
4264
+ position
4265
+ }) {
4266
+ const content = toast2.content;
4267
+ const viewTransitionName = toast2.key;
4268
+ if (content.kind === "custom") {
4269
+ return /* @__PURE__ */ React13.createElement(
4270
+ UNSTABLE_Toast,
4271
+ {
4272
+ toast: toast2,
4273
+ className: "prt-toast",
4274
+ "data-position": position,
4275
+ style: { viewTransitionName }
4276
+ },
4277
+ content.render({ close: () => queue.close(toast2.key) })
4278
+ );
4279
+ }
4280
+ const { variant, title, description, action, cancel } = content;
4281
+ const color = variant === "default" ? void 0 : VARIANT_COLOR[variant];
4282
+ return /* @__PURE__ */ React13.createElement(
4283
+ UNSTABLE_Toast,
4284
+ {
4285
+ toast: toast2,
4286
+ className: "prt-toast",
4287
+ "data-color": color,
4288
+ "data-position": position,
4289
+ style: { viewTransitionName }
4290
+ },
4291
+ /* @__PURE__ */ React13.createElement(UNSTABLE_ToastContent, { className: "prt-toast-content" }, /* @__PURE__ */ React13.createElement(ToastIcon, { variant }), /* @__PURE__ */ React13.createElement("div", { className: "prt-toast-body" }, /* @__PURE__ */ React13.createElement(Text$1, { slot: "title", className: "prt-toast-title" }, title), description && /* @__PURE__ */ React13.createElement(Text$1, { slot: "description", className: "prt-toast-description" }, description), (action || cancel) && /* @__PURE__ */ React13.createElement("div", { className: "prt-toast-actions" }, action && /* @__PURE__ */ React13.createElement(
4292
+ Button,
4293
+ {
4294
+ size: "xs",
4295
+ color: "primary",
4296
+ variant: "solid",
4297
+ onPress: () => {
4298
+ action.onClick();
4299
+ queue.close(toast2.key);
4300
+ }
4301
+ },
4302
+ action.label
4303
+ ), cancel && /* @__PURE__ */ React13.createElement(
4304
+ Button,
4305
+ {
4306
+ size: "xs",
4307
+ color: "gray",
4308
+ variant: "outline",
4309
+ onPress: () => {
4310
+ cancel.onClick();
4311
+ queue.close(toast2.key);
4312
+ }
4313
+ },
4314
+ cancel.label
4315
+ )))),
4316
+ /* @__PURE__ */ React13.createElement(
4317
+ IconButton,
4318
+ {
4319
+ slot: "close",
4320
+ "aria-label": "Close",
4321
+ size: "xs",
4322
+ variant: "ghost",
4323
+ color: "gray",
4324
+ className: "prt-toast-close"
4325
+ },
4326
+ /* @__PURE__ */ React13.createElement(HiX, { size: 16 })
4327
+ )
4328
+ );
4329
+ }
4330
+ function ToastRegion({ position = "top-right" }) {
4331
+ React13.useEffect(() => {
4332
+ defaultPosition = position;
4333
+ }, [position]);
4334
+ return /* @__PURE__ */ React13.createElement(React13.Fragment, null, ALL_POSITIONS.map((pos) => /* @__PURE__ */ React13.createElement(
4335
+ UNSTABLE_ToastRegion,
4336
+ {
4337
+ key: pos,
4338
+ queue: queues[pos],
4339
+ "data-position": pos,
4340
+ className: cn("prt-toast-region", `prt-toast-region-${pos}`)
4341
+ },
4342
+ ({ toast: toast2 }) => /* @__PURE__ */ React13.createElement(ToastItem, { toast: toast2, queue: queues[pos], position: pos })
4343
+ )));
4344
+ }
4345
+ function addToast(variant, title, options) {
4346
+ const position = options?.position ?? defaultPosition;
4347
+ return queues[position].add(
4348
+ {
4349
+ kind: "standard",
4350
+ variant,
4351
+ title,
4352
+ description: options?.description,
4353
+ action: options?.action,
4354
+ cancel: options?.cancel
4355
+ },
4356
+ { timeout: resolveTimeout(options?.duration) }
4357
+ );
4358
+ }
4359
+ function toast(title, options) {
4360
+ return addToast("default", title, options);
4361
+ }
4362
+ toast.success = function(title, options) {
4363
+ return addToast("success", title, options);
4364
+ };
4365
+ toast.error = function(title, options) {
4366
+ return addToast("error", title, options);
4367
+ };
4368
+ toast.warning = function(title, options) {
4369
+ return addToast("warning", title, options);
4370
+ };
4371
+ toast.info = function(title, options) {
4372
+ return addToast("info", title, options);
4373
+ };
4374
+ toast.custom = function(render, options) {
4375
+ const position = options?.position ?? defaultPosition;
4376
+ return queues[position].add(
4377
+ { kind: "custom", render },
4378
+ { timeout: resolveTimeout(options?.duration) }
4379
+ );
4380
+ };
4381
+ toast.dismiss = function(key) {
4382
+ for (const pos of ALL_POSITIONS) queues[pos].close(key);
4383
+ };
4384
+ function Tooltip({
4385
+ content,
4386
+ children,
4387
+ delay = 600,
4388
+ closeDelay,
4389
+ isDisabled,
4390
+ showArrow = true,
4391
+ placement = "top",
4392
+ offset = 8,
4393
+ className,
4394
+ classNames,
4395
+ style,
4396
+ styles,
4397
+ ...props
4398
+ }) {
4399
+ return /* @__PURE__ */ React13.createElement(TooltipTrigger, { delay, closeDelay, isDisabled }, children, /* @__PURE__ */ React13.createElement(
4400
+ Tooltip$1,
4401
+ {
4402
+ ...props,
4403
+ placement,
4404
+ offset,
4405
+ className: cn("prt-tooltip", className, classNames?.tooltip),
4406
+ style: { ...style, ...styles?.tooltip }
4407
+ },
4408
+ showArrow && /* @__PURE__ */ React13.createElement(OverlayArrow, { className: "prt-tooltip-arrow" }, /* @__PURE__ */ React13.createElement("svg", { width: "10", height: "5", viewBox: "0 0 10 5", "aria-hidden": "true" }, /* @__PURE__ */ React13.createElement("path", { d: "M0 0 L5 5 L10 0 Z" }))),
4409
+ content
4410
+ ));
4411
+ }
4412
+ function HoverCard({
4413
+ children,
4414
+ content,
4415
+ openDelay = 300,
4416
+ closeDelay = 200,
4417
+ isDisabled,
4418
+ isOpen,
4419
+ defaultOpen,
4420
+ onOpenChange,
4421
+ offset = 10,
4422
+ placement = "bottom",
4423
+ className,
4424
+ classNames,
4425
+ style,
4426
+ styles,
4427
+ ...props
4428
+ }) {
4429
+ const theme = useTheme();
4430
+ const triggerRef = React13.useRef(null);
4431
+ const state = useOverlayTriggerState({ isOpen, defaultOpen, onOpenChange });
4432
+ const openTimer = React13.useRef(null);
4433
+ const closeTimer = React13.useRef(null);
4434
+ function clearTimers() {
4435
+ if (openTimer.current) clearTimeout(openTimer.current);
4436
+ if (closeTimer.current) clearTimeout(closeTimer.current);
4437
+ }
4438
+ function scheduleOpen() {
4439
+ clearTimers();
4440
+ if (isDisabled) return;
4441
+ openTimer.current = setTimeout(() => state.open(), openDelay);
4442
+ }
4443
+ function scheduleClose() {
4444
+ clearTimers();
4445
+ closeTimer.current = setTimeout(() => state.close(), closeDelay);
4446
+ }
4447
+ function openNow() {
4448
+ clearTimers();
4449
+ if (!isDisabled) state.open();
4450
+ }
4451
+ function keepOpen() {
4452
+ clearTimers();
4453
+ }
4454
+ React13.useEffect(() => clearTimers, []);
4455
+ const { hoverProps: triggerHover } = useHover({
4456
+ isDisabled,
4457
+ onHoverStart: scheduleOpen,
4458
+ onHoverEnd: scheduleClose
4459
+ });
4460
+ const { focusWithinProps: triggerFocus } = useFocusWithin({
4461
+ isDisabled,
4462
+ onFocusWithin: openNow,
4463
+ onBlurWithin: scheduleClose
4464
+ });
4465
+ const { hoverProps: contentHover } = useHover({
4466
+ onHoverStart: keepOpen,
4467
+ onHoverEnd: scheduleClose
4468
+ });
4469
+ const { focusWithinProps: contentFocus } = useFocusWithin({
4470
+ onFocusWithin: keepOpen,
4471
+ onBlurWithin: scheduleClose
4472
+ });
4473
+ const trigger = React13.cloneElement(children, {
4474
+ ...mergeProps(
4475
+ children.props,
4476
+ triggerHover,
4477
+ triggerFocus
4478
+ ),
4479
+ ref: triggerRef
4480
+ });
4481
+ return /* @__PURE__ */ React13.createElement(React13.Fragment, null, trigger, /* @__PURE__ */ React13.createElement(
4482
+ Popover$1,
4483
+ {
4484
+ ...props,
4485
+ triggerRef,
4486
+ isOpen: state.isOpen,
4487
+ onOpenChange: state.setOpen,
4488
+ isNonModal: true,
4489
+ offset,
4490
+ placement,
4491
+ "data-color": theme?.color,
4492
+ "data-radius": theme?.radius,
4493
+ className: cn("prt-popover", classNames?.popover),
4494
+ style: styles?.popover
4495
+ },
4496
+ /* @__PURE__ */ React13.createElement(
4497
+ "div",
4498
+ {
4499
+ ...mergeProps(contentHover, contentFocus),
4500
+ className: cn("prt-popover-content", className, classNames?.content),
4501
+ style: { ...style, ...styles?.content }
4502
+ },
4503
+ content
4504
+ )
4505
+ ));
4506
+ }
4507
+ function isEmpty(value) {
4508
+ if (value === null || value === void 0) return true;
4509
+ if (typeof value === "string") return value.trim() === "";
4510
+ if (Array.isArray(value)) return value.length === 0;
4511
+ return false;
4512
+ }
4513
+ function cleanErrors(fields) {
4514
+ const errors = {};
4515
+ for (const key of Object.keys(fields)) errors[key] = null;
4516
+ return errors;
4517
+ }
4518
+ function cleanTouched(fields) {
4519
+ const touched = {};
4520
+ for (const key of Object.keys(fields)) touched[key] = false;
4521
+ return touched;
4522
+ }
4523
+ function useForm({
4524
+ fields: defaultFields,
4525
+ validators,
4526
+ optional = [],
4527
+ resetKey
4528
+ }) {
4529
+ const [values, setValues] = React13.useState(defaultFields);
4530
+ const [errors, setErrors] = React13.useState(
4531
+ () => cleanErrors(defaultFields)
4532
+ );
4533
+ const [touched, setTouched] = React13.useState(
4534
+ () => cleanTouched(defaultFields)
4535
+ );
4536
+ const [isSubmitting, setIsSubmitting] = React13.useState(false);
4537
+ const valuesRef = React13.useRef(values);
4538
+ valuesRef.current = values;
4539
+ const touchedRef = React13.useRef(touched);
4540
+ touchedRef.current = touched;
4541
+ const isSubmittingRef = React13.useRef(false);
4542
+ const fieldsRef = React13.useRef(defaultFields);
4543
+ fieldsRef.current = defaultFields;
4544
+ const resetKeyRef = React13.useRef(resetKey);
4545
+ React13.useEffect(() => {
4546
+ if (resetKey !== void 0 && resetKey !== resetKeyRef.current) {
4547
+ resetKeyRef.current = resetKey;
4548
+ setValues(fieldsRef.current);
4549
+ setErrors(cleanErrors(fieldsRef.current));
4550
+ setTouched(cleanTouched(fieldsRef.current));
4551
+ setIsSubmitting(false);
4552
+ isSubmittingRef.current = false;
4553
+ }
4554
+ }, [resetKey]);
4555
+ const validateField = React13.useCallback(
4556
+ (fieldName, value, currentValues) => {
4557
+ const validator = validators?.[fieldName];
4558
+ if (validator) return validator(value, currentValues);
4559
+ if (!optional.includes(fieldName) && isEmpty(value)) {
4560
+ return "This field is required";
4561
+ }
4562
+ return null;
4563
+ },
4564
+ [validators, optional]
4565
+ );
4566
+ function onChange(fieldName, value) {
4567
+ const next = { ...valuesRef.current, [fieldName]: value };
4568
+ setValues(next);
4569
+ setTouched((prev) => ({ ...prev, [fieldName]: true }));
4570
+ setErrors((prev) => {
4571
+ const nextErrors = { ...prev };
4572
+ nextErrors[fieldName] = validateField(fieldName, value, next);
4573
+ for (const field of Object.keys(prev)) {
4574
+ if (field !== fieldName && touchedRef.current[field]) {
4575
+ nextErrors[field] = validateField(field, next[field], next);
4576
+ }
4577
+ }
4578
+ return nextErrors;
4579
+ });
4580
+ }
4581
+ function visibleError(fieldName) {
4582
+ return touched[fieldName] ? errors[fieldName] : null;
4583
+ }
4584
+ function getFieldProps(fieldName) {
4585
+ return {
4586
+ name: String(fieldName),
4587
+ value: values[fieldName] ?? "",
4588
+ onChange: (value) => onChange(fieldName, value),
4589
+ error: visibleError(fieldName)
4590
+ };
4591
+ }
4592
+ function getNumberFieldProps(fieldName) {
4593
+ return {
4594
+ name: String(fieldName),
4595
+ value: values[fieldName] ?? Number.NaN,
4596
+ onChange: (value) => onChange(fieldName, value),
4597
+ error: visibleError(fieldName)
4598
+ };
4599
+ }
4600
+ function getSelectProps(fieldName) {
4601
+ return {
4602
+ name: String(fieldName),
4603
+ value: values[fieldName] ?? null,
4604
+ onChange: (value) => onChange(fieldName, value ?? ""),
4605
+ error: visibleError(fieldName)
4606
+ };
4607
+ }
4608
+ function getCheckboxGroupProps(fieldName) {
4609
+ return {
4610
+ name: String(fieldName),
4611
+ value: values[fieldName] ?? [],
4612
+ onChange: (value) => onChange(fieldName, value),
4613
+ errorMessage: visibleError(fieldName)
4614
+ };
4615
+ }
4616
+ function getRadioGroupProps(fieldName) {
4617
+ return {
4618
+ name: String(fieldName),
4619
+ value: values[fieldName] ?? "",
4620
+ onChange: (value) => onChange(fieldName, value),
4621
+ errorMessage: visibleError(fieldName)
4622
+ };
4623
+ }
4624
+ function getSwitchProps(fieldName) {
4625
+ return {
4626
+ name: String(fieldName),
4627
+ isSelected: Boolean(values[fieldName]),
4628
+ onChange: (value) => onChange(fieldName, value)
4629
+ };
4630
+ }
4631
+ function validateAll() {
4632
+ const current = valuesRef.current;
4633
+ const allErrors = {};
4634
+ const allTouched = {};
4635
+ for (const field of Object.keys(current)) {
4636
+ allErrors[field] = validateField(field, current[field], current);
4637
+ allTouched[field] = true;
4638
+ }
4639
+ setErrors(allErrors);
4640
+ setTouched(allTouched);
4641
+ return allErrors;
4642
+ }
4643
+ function handleSubmit(callback) {
4644
+ return (e) => {
4645
+ e.preventDefault();
4646
+ if (isSubmittingRef.current) return;
4647
+ const allErrors = validateAll();
4648
+ const hasErrors = Object.values(allErrors).some((error) => error !== null);
4649
+ if (hasErrors) return;
4650
+ const result = callback(valuesRef.current);
4651
+ if (result instanceof Promise) {
4652
+ isSubmittingRef.current = true;
4653
+ setIsSubmitting(true);
4654
+ result.finally(() => {
4655
+ isSubmittingRef.current = false;
4656
+ setIsSubmitting(false);
4657
+ });
4658
+ }
4659
+ };
4660
+ }
4661
+ function isValid() {
4662
+ const current = valuesRef.current;
4663
+ for (const field of Object.keys(current)) {
4664
+ if (validateField(field, current[field], current) !== null) return false;
4665
+ }
4666
+ return true;
4667
+ }
4668
+ const isDirty = React13.useMemo(() => {
4669
+ for (const field of Object.keys(defaultFields)) {
4670
+ if (values[field] !== defaultFields[field]) return true;
4671
+ }
4672
+ return false;
4673
+ }, [values, defaultFields]);
4674
+ function reset() {
4675
+ setValues(fieldsRef.current);
4676
+ setErrors(cleanErrors(fieldsRef.current));
4677
+ setTouched(cleanTouched(fieldsRef.current));
4678
+ setIsSubmitting(false);
4679
+ isSubmittingRef.current = false;
4680
+ }
4681
+ function setFieldValues(newValues) {
4682
+ const next = { ...valuesRef.current, ...newValues };
4683
+ setValues(next);
4684
+ setErrors((prev) => {
4685
+ const nextErrors = { ...prev };
4686
+ for (const field of Object.keys(newValues)) {
4687
+ nextErrors[field] = validateField(field, next[field], next);
4688
+ }
4689
+ return nextErrors;
4690
+ });
4691
+ setTouched((prev) => {
4692
+ const nextTouched = { ...prev };
4693
+ for (const field of Object.keys(newValues)) {
4694
+ nextTouched[field] = true;
4695
+ }
4696
+ return nextTouched;
4697
+ });
4698
+ }
4699
+ function setFieldError(fieldName, error) {
4700
+ setErrors((prev) => ({ ...prev, [fieldName]: error }));
4701
+ setTouched((prev) => ({ ...prev, [fieldName]: true }));
4702
+ }
4703
+ return {
4704
+ values,
4705
+ errors,
4706
+ touched,
4707
+ isDirty,
4708
+ isSubmitting,
4709
+ setIsSubmitting,
4710
+ onChange,
4711
+ getFieldProps,
4712
+ getNumberFieldProps,
4713
+ getSelectProps,
4714
+ getCheckboxGroupProps,
4715
+ getRadioGroupProps,
4716
+ getSwitchProps,
4717
+ handleSubmit,
4718
+ isValid,
4719
+ reset,
4720
+ validateAll,
4721
+ setFieldValues,
4722
+ setFieldError
4723
+ };
4724
+ }
4725
+
4726
+ // src/hooks/validators.ts
4727
+ function required(message) {
4728
+ return function(value) {
4729
+ if (value === "" || value === null || value === void 0) {
4730
+ return message ?? "This field is required";
4731
+ }
4732
+ if (typeof value === "string" && value.trim() === "") {
4733
+ return message ?? "This field is required";
4734
+ }
4735
+ if (Array.isArray(value) && value.length === 0) {
4736
+ return message ?? "This field is required";
4737
+ }
4738
+ return null;
4739
+ };
4740
+ }
4741
+ function email(message) {
4742
+ return function(value) {
4743
+ if (!value) return null;
4744
+ const valid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(value));
4745
+ return valid ? null : message ?? "Invalid email address";
4746
+ };
4747
+ }
4748
+ function minLength(length, message) {
4749
+ return function(value) {
4750
+ if (!value) return null;
4751
+ return String(value).length >= length ? null : message ?? `Must be at least ${length} characters`;
4752
+ };
4753
+ }
4754
+ function maxLength(length, message) {
4755
+ return function(value) {
4756
+ if (!value) return null;
4757
+ return String(value).length <= length ? null : message ?? `Must be at most ${length} characters`;
4758
+ };
4759
+ }
4760
+ function min(n, message) {
4761
+ return function(value) {
4762
+ if (value === null || value === void 0 || value === "") return null;
4763
+ return Number(value) >= n ? null : message ?? `Must be at least ${n}`;
4764
+ };
4765
+ }
4766
+ function max(n, message) {
4767
+ return function(value) {
4768
+ if (value === null || value === void 0 || value === "") return null;
4769
+ return Number(value) <= n ? null : message ?? `Must be at most ${n}`;
4770
+ };
4771
+ }
4772
+ function pattern(regex, message) {
4773
+ return function(value) {
4774
+ if (!value) return null;
4775
+ return regex.test(String(value)) ? null : message ?? "Invalid format";
4776
+ };
4777
+ }
4778
+ function matches(fieldName, message) {
4779
+ return function(value, values) {
4780
+ if (!value) return null;
4781
+ return value === values[fieldName] ? null : message ?? `Must match ${fieldName}`;
4782
+ };
4783
+ }
4784
+ function compose(...fns) {
4785
+ return function(value, values) {
4786
+ for (const fn of fns) {
4787
+ const error = fn(value, values);
4788
+ if (error) return error;
4789
+ }
4790
+ return null;
4791
+ };
3846
4792
  }
3847
4793
 
3848
- export { Avatar, AvatarGroup, Button, ButtonGroup, Calendar, Checkbox, CheckboxGroup, CheckboxItem, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatchPicker, ComboBox, DateField, DatePicker, DateRangePicker, FileUploader, IconButton, Input, ListBox, ListBoxItem, ListBoxSection, Loader, Menu, MenuContent, MenuItem, MenuSection, MenuTrigger, Modal, NumberInput, ListBoxItem as Option, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioCard, RadioGroup, RadioItem, RangeCalendar, ListBoxSection as Section, Select, Separator, Slider, Space, Sticker, Switch, Tab, Table, Tabs, Tag, TagGroup, TagGroupItem, TagInput, Text, Textarea, ThemeProvider, TimeField, Timeline, Toggle, ToggleButton, ToggleGroup, parseColor2 as parseColor, useModal, useTheme };
4794
+ export { Avatar, AvatarGroup, Button, ButtonGroup, Calendar, Checkbox, CheckboxGroup, CheckboxItem, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatchPicker, ComboBox, DateField, DatePicker, DateRangePicker, FileUploader, HoverCard, IconButton, Input, ListBox, ListBoxItem, ListBoxSection, Loader, Menu, MenuContent, MenuItem, MenuSection, MenuTrigger, Modal, ModalProvider, NumberInput, ListBoxItem as Option, PinInput, PinInputGroup, PinInputSeparator, PinInputSlot, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioCard, RadioGroup, RadioItem, RangeCalendar, ListBoxSection as Section, Select, Separator, Slider, Space, Sticker, Switch, Tab, Table, Tabs, Tag, TagGroup, TagGroupItem, TagInput, Text, Textarea, ThemeProvider, TimeField, Timeline, ToastRegion, Toggle, ToggleButton, ToggleGroup, Tooltip, compose, email, matches, max, maxLength, min, minLength, parseColor2 as parseColor, pattern, required, toast, useForm, useModal, useModals, useTheme };
3849
4795
  //# sourceMappingURL=index.mjs.map
3850
4796
  //# sourceMappingURL=index.mjs.map