@marigold/components 7.3.1 → 7.3.3

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.d.mts CHANGED
@@ -480,9 +480,8 @@ interface UnderlayProps extends Omit<RAC.ModalOverlayProps, 'isOpen' | 'isDismis
480
480
  declare const Underlay: ({ size, variant, open, dismissable, keyboardDismissable, ...rest }: UnderlayProps) => react_jsx_runtime.JSX.Element;
481
481
 
482
482
  interface MarigoldProviderProps<T extends Theme> extends ThemeProviderProps<T> {
483
- portalContainer?: string;
484
483
  }
485
- declare function MarigoldProvider<T extends Theme>({ children, theme, portalContainer, }: MarigoldProviderProps<T>): react_jsx_runtime.JSX.Element;
484
+ declare function MarigoldProvider<T extends Theme>({ children, theme, }: MarigoldProviderProps<T>): react_jsx_runtime.JSX.Element;
486
485
 
487
486
  declare const OverlayContainerProvider: react.Provider<string | undefined>;
488
487
  declare const usePortalContainer: () => HTMLElement | null;
@@ -646,6 +645,7 @@ interface TextAreaProps extends Omit<RAC.TextFieldProps, RemovedProps$4>, Pick<R
646
645
  readOnly?: RAC.TextFieldProps['isReadOnly'];
647
646
  value?: string;
648
647
  defaultValue?: string;
648
+ placeholder?: string;
649
649
  }
650
650
  declare const _TextArea: react.ForwardRefExoticComponent<TextAreaProps & react.RefAttributes<HTMLTextAreaElement>>;
651
651
 
package/dist/index.d.ts CHANGED
@@ -480,9 +480,8 @@ interface UnderlayProps extends Omit<RAC.ModalOverlayProps, 'isOpen' | 'isDismis
480
480
  declare const Underlay: ({ size, variant, open, dismissable, keyboardDismissable, ...rest }: UnderlayProps) => react_jsx_runtime.JSX.Element;
481
481
 
482
482
  interface MarigoldProviderProps<T extends Theme> extends ThemeProviderProps<T> {
483
- portalContainer?: string;
484
483
  }
485
- declare function MarigoldProvider<T extends Theme>({ children, theme, portalContainer, }: MarigoldProviderProps<T>): react_jsx_runtime.JSX.Element;
484
+ declare function MarigoldProvider<T extends Theme>({ children, theme, }: MarigoldProviderProps<T>): react_jsx_runtime.JSX.Element;
486
485
 
487
486
  declare const OverlayContainerProvider: react.Provider<string | undefined>;
488
487
  declare const usePortalContainer: () => HTMLElement | null;
@@ -646,6 +645,7 @@ interface TextAreaProps extends Omit<RAC.TextFieldProps, RemovedProps$4>, Pick<R
646
645
  readOnly?: RAC.TextFieldProps['isReadOnly'];
647
646
  value?: string;
648
647
  defaultValue?: string;
648
+ placeholder?: string;
649
649
  }
650
650
  declare const _TextArea: react.ForwardRefExoticComponent<TextAreaProps & react.RefAttributes<HTMLTextAreaElement>>;
651
651
 
package/dist/index.js CHANGED
@@ -60,7 +60,7 @@ __export(src_exports, {
60
60
  Form: () => import_react_aria_components20.Form,
61
61
  Header: () => _Header,
62
62
  Headline: () => _Headline,
63
- I18nProvider: () => import_i18n.I18nProvider,
63
+ I18nProvider: () => import_i18n2.I18nProvider,
64
64
  Image: () => Image,
65
65
  Inline: () => Inline,
66
66
  Input: () => _Input,
@@ -90,7 +90,7 @@ __export(src_exports, {
90
90
  Text: () => Text2,
91
91
  TextArea: () => _TextArea,
92
92
  TextField: () => _TextField,
93
- ThemeProvider: () => import_system13.ThemeProvider,
93
+ ThemeProvider: () => import_system14.ThemeProvider,
94
94
  Tiles: () => Tiles,
95
95
  Tooltip: () => _Tooltip,
96
96
  Underlay: () => Underlay,
@@ -101,7 +101,7 @@ __export(src_exports, {
101
101
  useFieldGroupContext: () => useFieldGroupContext,
102
102
  useListData: () => import_data.useListData,
103
103
  usePortalContainer: () => usePortalContainer,
104
- useTheme: () => import_system13.useTheme
104
+ useTheme: () => import_system14.useTheme
105
105
  });
106
106
  module.exports = __toCommonJS(src_exports);
107
107
 
@@ -270,7 +270,7 @@ var AccordionItem = ({
270
270
  });
271
271
  const classNames2 = (0, import_system3.useClassNames)({ component: "Accordion", variant, size });
272
272
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col", ...props, children: [
273
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_focus.FocusRing, { within: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
273
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
274
274
  "button",
275
275
  {
276
276
  className: (0, import_system3.cn)(
@@ -285,7 +285,7 @@ var AccordionItem = ({
285
285
  expanded ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronUp, { className: "h3 w-6" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronDown, { className: "h3 w-6" })
286
286
  ]
287
287
  }
288
- ) }),
288
+ ),
289
289
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
290
290
  "div",
291
291
  {
@@ -408,9 +408,9 @@ var Aspect = ({
408
408
  };
409
409
 
410
410
  // src/Autocomplete/Autocomplete.tsx
411
- var import_react15 = require("react");
412
- var import_react16 = __toESM(require("react"));
413
- var import_react_aria_components11 = require("react-aria-components");
411
+ var import_react14 = require("react");
412
+ var import_react15 = __toESM(require("react"));
413
+ var import_react_aria_components10 = require("react-aria-components");
414
414
 
415
415
  // src/FieldBase/FieldBase.tsx
416
416
  var import_react7 = require("react");
@@ -546,6 +546,12 @@ var _FieldBase = (props, ref) => {
546
546
  };
547
547
  var FieldBase = fixedForwardRef(_FieldBase);
548
548
 
549
+ // src/Input/SearchInput.tsx
550
+ var import_react9 = require("react");
551
+ var import_react_aria_components4 = require("react-aria-components");
552
+ var import_i18n = require("@react-aria/i18n");
553
+ var import_system10 = require("@marigold/system");
554
+
549
555
  // src/Input/Input.tsx
550
556
  var import_react8 = require("react");
551
557
  var import_react_aria_components3 = require("react-aria-components");
@@ -559,20 +565,20 @@ var _Input = (0, import_react8.forwardRef)(
559
565
  size
560
566
  });
561
567
  const inputIcon = icon ? (0, import_react8.cloneElement)(icon, {
568
+ ...icon.props,
562
569
  className: (0, import_system9.cn)(
563
570
  "pointer-events-none absolute",
564
571
  classNames2.icon,
565
572
  icon.props.className
566
- ),
567
- ...icon.props
573
+ )
568
574
  }) : null;
569
575
  const inputAction = action && !props.readOnly ? (0, import_react8.cloneElement)(action, {
576
+ ...action.props,
570
577
  className: (0, import_system9.cn)(
571
- "absolute",
578
+ "absolute right-0",
572
579
  classNames2.action,
573
580
  action.props.className
574
- ),
575
- ...action.props
581
+ )
576
582
  }) : null;
577
583
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
578
584
  "div",
@@ -605,49 +611,115 @@ var _Input = (0, import_react8.forwardRef)(
605
611
  }
606
612
  );
607
613
 
614
+ // src/Input/SearchInput.tsx
615
+ var import_jsx_runtime12 = require("react/jsx-runtime");
616
+ var intlMessages = {
617
+ "de-DE": {
618
+ "Clear search": "Suche zur\xFCcksetzen"
619
+ },
620
+ "en-US": {
621
+ "Clear search": "Clear search"
622
+ },
623
+ "fr-FR": {
624
+ "Clear search": "Effacer la recherche"
625
+ }
626
+ };
627
+ var SearchIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
628
+ "svg",
629
+ {
630
+ xmlns: "http://www.w3.org/2000/svg",
631
+ viewBox: "0 0 24 24",
632
+ fill: "currentColor",
633
+ width: 24,
634
+ height: 24,
635
+ ...props,
636
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M16.1865 14.5142H15.3057L14.9936 14.2131C16.0862 12.9421 16.744 11.292 16.744 9.497C16.744 5.49443 13.4996 2.25 9.497 2.25C5.49443 2.25 2.25 5.49443 2.25 9.497C2.25 13.4996 5.49443 16.744 9.497 16.744C11.292 16.744 12.9421 16.0862 14.2131 14.9936L14.5142 15.3057V16.1865L20.0888 21.75L21.75 20.0888L16.1865 14.5142ZM9.49701 14.5142C6.72085 14.5142 4.47986 12.2732 4.47986 9.49701C4.47986 6.72085 6.72085 4.47986 9.49701 4.47986C12.2732 4.47986 14.5142 6.72085 14.5142 9.49701C14.5142 12.2732 12.2732 14.5142 9.49701 14.5142Z" })
637
+ }
638
+ );
639
+ var SearchInput = (0, import_react9.forwardRef)(
640
+ ({ className, onClear, ...props }, ref) => {
641
+ const stringFormatter = (0, import_i18n.useLocalizedStringFormatter)(intlMessages);
642
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
643
+ _Input,
644
+ {
645
+ type: "search",
646
+ className: (0, import_system10.cn)(
647
+ "[&::-webkit-search-cancel-button]:hidden",
648
+ className == null ? void 0 : className.input
649
+ ),
650
+ ref,
651
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SearchIcon, {}),
652
+ action: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
653
+ import_react_aria_components4.Button,
654
+ {
655
+ className: className == null ? void 0 : className.action,
656
+ onPress: () => onClear == null ? void 0 : onClear(),
657
+ slot: null,
658
+ "aria-label": stringFormatter.format("Clear search"),
659
+ excludeFromTabOrder: true,
660
+ preventFocusOnPress: true,
661
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
662
+ "svg",
663
+ {
664
+ xmlns: "http://www.w3.org/2000/svg",
665
+ viewBox: "0 0 20 20",
666
+ fill: "currentColor",
667
+ width: 20,
668
+ height: 20,
669
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
670
+ }
671
+ )
672
+ }
673
+ ),
674
+ ...props
675
+ }
676
+ );
677
+ }
678
+ );
679
+
608
680
  // src/ListBox/ListBox.tsx
609
- var import_react10 = require("react");
610
- var import_react_aria_components6 = require("react-aria-components");
611
- var import_system11 = require("@marigold/system");
681
+ var import_react11 = require("react");
682
+ var import_react_aria_components7 = require("react-aria-components");
683
+ var import_system12 = require("@marigold/system");
612
684
 
613
685
  // src/ListBox/Context.ts
614
- var import_react9 = require("react");
615
- var ListBoxContext = (0, import_react9.createContext)({});
616
- var useListBoxContext = () => (0, import_react9.useContext)(ListBoxContext);
686
+ var import_react10 = require("react");
687
+ var ListBoxContext = (0, import_react10.createContext)({});
688
+ var useListBoxContext = () => (0, import_react10.useContext)(ListBoxContext);
617
689
 
618
690
  // src/ListBox/ListBoxOption.tsx
619
- var import_react_aria_components4 = require("react-aria-components");
620
- var import_jsx_runtime12 = require("react/jsx-runtime");
691
+ var import_react_aria_components5 = require("react-aria-components");
692
+ var import_jsx_runtime13 = require("react/jsx-runtime");
621
693
  var _ListBoxItem = (props) => {
622
694
  const { classNames: classNames2 } = useListBoxContext();
623
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_aria_components4.ListBoxItem, { ...props, className: classNames2.option });
695
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_aria_components5.ListBoxItem, { ...props, className: classNames2.option });
624
696
  };
625
697
 
626
698
  // src/ListBox/ListBoxSection.tsx
627
- var import_react_aria_components5 = require("react-aria-components");
628
- var import_system10 = require("@marigold/system");
629
- var import_jsx_runtime13 = require("react/jsx-runtime");
699
+ var import_react_aria_components6 = require("react-aria-components");
700
+ var import_system11 = require("@marigold/system");
701
+ var import_jsx_runtime14 = require("react/jsx-runtime");
630
702
  var _Section = (props) => {
631
703
  const { classNames: classNames2 } = useListBoxContext();
632
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
633
- import_react_aria_components5.Section,
704
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
705
+ import_react_aria_components6.Section,
634
706
  {
635
707
  ...props,
636
- className: (0, import_system10.cn)(classNames2.section, classNames2.sectionTitle)
708
+ className: (0, import_system11.cn)(classNames2.section, classNames2.sectionTitle)
637
709
  }
638
710
  );
639
711
  };
640
712
 
641
713
  // src/ListBox/ListBox.tsx
642
- var import_jsx_runtime14 = require("react/jsx-runtime");
643
- var _ListBox = (0, import_react10.forwardRef)(
714
+ var import_jsx_runtime15 = require("react/jsx-runtime");
715
+ var _ListBox = (0, import_react11.forwardRef)(
644
716
  ({ variant, size, ...props }, ref) => {
645
- const classNames2 = (0, import_system11.useClassNames)({ component: "ListBox", variant, size });
646
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ListBoxContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: classNames2.container, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
647
- import_react_aria_components6.ListBox,
717
+ const classNames2 = (0, import_system12.useClassNames)({ component: "ListBox", variant, size });
718
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ListBoxContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: classNames2.container, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
719
+ import_react_aria_components7.ListBox,
648
720
  {
649
721
  ...props,
650
- className: (0, import_system11.cn)(
722
+ className: (0, import_system12.cn)(
651
723
  "overflow-y-auto sm:max-h-[75vh] lg:max-h-[45vh]",
652
724
  classNames2.list
653
725
  ),
@@ -661,46 +733,45 @@ _ListBox.Item = _ListBoxItem;
661
733
  _ListBox.Section = _Section;
662
734
 
663
735
  // src/Overlay/Popover.tsx
664
- var import_react12 = require("react");
665
- var import_react_aria_components8 = require("react-aria-components");
666
- var import_system15 = require("@marigold/system");
736
+ var import_react13 = require("react");
737
+ var import_react_aria_components9 = require("react-aria-components");
738
+ var import_system16 = require("@marigold/system");
667
739
 
668
740
  // src/Provider/OverlayContainerProvider.tsx
669
- var import_react11 = require("react");
741
+ var import_react12 = require("react");
670
742
  var import_ssr = require("@react-aria/ssr");
671
- var OverlayContainerContext = (0, import_react11.createContext)(void 0);
743
+ var OverlayContainerContext = (0, import_react12.createContext)(void 0);
672
744
  var OverlayContainerProvider = OverlayContainerContext.Provider;
673
745
  var usePortalContainer = () => {
674
- const portalContainer = (0, import_react11.useContext)(OverlayContainerContext);
746
+ const portalContainer = (0, import_react12.useContext)(OverlayContainerContext);
675
747
  const isSSR = (0, import_ssr.useIsSSR)();
676
748
  const portal = isSSR ? null : portalContainer ? document.getElementById(portalContainer) : document.body;
677
749
  return portal;
678
750
  };
679
751
 
680
752
  // src/Overlay/Underlay.tsx
681
- var import_react_aria_components7 = require("react-aria-components");
682
- var import_system14 = require("@marigold/system");
753
+ var import_react_aria_components8 = require("react-aria-components");
754
+ var import_system15 = require("@marigold/system");
683
755
 
684
756
  // src/Provider/index.ts
685
- var import_system13 = require("@marigold/system");
686
- var import_i18n = require("@react-aria/i18n");
757
+ var import_system14 = require("@marigold/system");
758
+ var import_i18n2 = require("@react-aria/i18n");
687
759
 
688
760
  // src/Provider/MarigoldProvider.tsx
689
761
  var import_overlays = require("@react-aria/overlays");
690
- var import_system12 = require("@marigold/system");
691
- var import_jsx_runtime15 = require("react/jsx-runtime");
762
+ var import_system13 = require("@marigold/system");
763
+ var import_jsx_runtime16 = require("react/jsx-runtime");
692
764
  function MarigoldProvider({
693
765
  children,
694
- theme,
695
- portalContainer
766
+ theme
696
767
  }) {
697
- const outerTheme = (0, import_system12.useTheme)();
698
- const isTopLevel = outerTheme === import_system12.defaultTheme;
699
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_system12.ThemeProvider, { theme, children: isTopLevel ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(OverlayContainerProvider, { value: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_overlays.OverlayProvider, { children }) }) : children });
768
+ const outerTheme = (0, import_system13.useTheme)();
769
+ const isTopLevel = outerTheme === import_system13.defaultTheme;
770
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_system13.ThemeProvider, { theme, children: isTopLevel ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_overlays.OverlayProvider, { children }) : children });
700
771
  }
701
772
 
702
773
  // src/Overlay/Underlay.tsx
703
- var import_jsx_runtime16 = require("react/jsx-runtime");
774
+ var import_jsx_runtime17 = require("react/jsx-runtime");
704
775
  var Underlay = ({
705
776
  size,
706
777
  variant,
@@ -709,7 +780,7 @@ var Underlay = ({
709
780
  keyboardDismissable,
710
781
  ...rest
711
782
  }) => {
712
- const classNames2 = (0, import_system14.useClassNames)({ component: "Underlay", size, variant });
783
+ const classNames2 = (0, import_system15.useClassNames)({ component: "Underlay", size, variant });
713
784
  const props = {
714
785
  isOpen: open,
715
786
  isDismissable: dismissable,
@@ -717,10 +788,10 @@ var Underlay = ({
717
788
  ...rest
718
789
  };
719
790
  const portal = usePortalContainer();
720
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
721
- import_react_aria_components7.ModalOverlay,
791
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
792
+ import_react_aria_components8.ModalOverlay,
722
793
  {
723
- className: ({ isEntering, isExiting }) => (0, import_system14.cn)(
794
+ className: ({ isEntering, isExiting }) => (0, import_system15.cn)(
724
795
  "fixed inset-0 z-10 flex min-h-full items-center justify-center overflow-y-auto backdrop-blur ",
725
796
  isEntering ? "animate-in fade-in duration-300 ease-out" : "",
726
797
  isExiting ? "animate-out fade-out duration-200 ease-in" : "",
@@ -735,8 +806,8 @@ var Underlay = ({
735
806
  };
736
807
 
737
808
  // src/Overlay/Popover.tsx
738
- var import_jsx_runtime17 = require("react/jsx-runtime");
739
- var _Popover = (0, import_react12.forwardRef)(
809
+ var import_jsx_runtime18 = require("react/jsx-runtime");
810
+ var _Popover = (0, import_react13.forwardRef)(
740
811
  ({ keyboardDismissDisabled, placement, open, children, container, ...rest }, ref) => {
741
812
  const props = {
742
813
  isKeyboardDismissDisabled: keyboardDismissDisabled,
@@ -744,30 +815,30 @@ var _Popover = (0, import_react12.forwardRef)(
744
815
  placement,
745
816
  ...rest
746
817
  };
747
- const classNames2 = (0, import_system15.useClassNames)({
818
+ const classNames2 = (0, import_system16.useClassNames)({
748
819
  component: "Popover",
749
820
  variant: placement,
750
821
  // Make Popover as wide as trigger element
751
822
  className: "min-w-[--trigger-width]"
752
823
  });
753
- const isSmallScreen = (0, import_system15.useSmallScreen)();
824
+ const isSmallScreen = (0, import_system16.useSmallScreen)();
754
825
  const portal = usePortalContainer();
755
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: isSmallScreen ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
756
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Underlay, { open, variant: "modal" }),
757
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
758
- import_react_aria_components8.Popover,
826
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: isSmallScreen ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
827
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Underlay, { open, variant: "modal" }),
828
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
829
+ import_react_aria_components9.Popover,
759
830
  {
760
831
  ref,
761
832
  ...props,
762
- className: (0, import_system15.cn)(
833
+ className: (0, import_system16.cn)(
763
834
  "!left-0 bottom-0 !mt-auto flex !max-h-fit w-full flex-col"
764
835
  ),
765
836
  UNSTABLE_portalContainer: portal,
766
837
  children
767
838
  }
768
839
  )
769
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
770
- import_react_aria_components8.Popover,
840
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
841
+ import_react_aria_components9.Popover,
771
842
  {
772
843
  ref,
773
844
  ...props,
@@ -780,87 +851,21 @@ var _Popover = (0, import_react12.forwardRef)(
780
851
  }
781
852
  );
782
853
 
783
- // src/Autocomplete/ClearButton.tsx
784
- var import_react14 = __toESM(require("react"));
785
- var import_react_aria_components10 = require("react-aria-components");
786
- var import_system17 = require("@marigold/system");
787
-
788
- // src/Button/Button.tsx
789
- var import_react13 = require("react");
790
- var import_react_aria_components9 = require("react-aria-components");
791
- var import_system16 = require("@marigold/system");
792
- var import_jsx_runtime18 = require("react/jsx-runtime");
793
- var _Button = (0, import_react13.forwardRef)(
794
- ({ children, variant, size, className, disabled, fullWidth, ...props }, ref) => {
795
- const classNames2 = (0, import_system16.useClassNames)({
796
- component: "Button",
797
- variant,
798
- size,
799
- className
800
- });
801
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
802
- import_react_aria_components9.Button,
803
- {
804
- ...props,
805
- ref,
806
- className: (0, import_system16.cn)(
807
- "inline-flex items-center justify-center gap-[0.5ch]",
808
- classNames2,
809
- fullWidth ? "w-full" : void 0
810
- ),
811
- isDisabled: disabled,
812
- children
813
- }
814
- );
815
- }
816
- );
817
-
818
- // src/Autocomplete/ClearButton.tsx
854
+ // src/Autocomplete/Autocomplete.tsx
819
855
  var import_jsx_runtime19 = require("react/jsx-runtime");
820
- var AutocompleteClearButton = ({
821
- className,
822
- onClear
856
+ var AutocompleteInput = ({
857
+ onSubmit,
858
+ onClear,
859
+ ref
823
860
  }) => {
824
- let state = import_react14.default.useContext(import_react_aria_components10.ComboBoxStateContext);
861
+ const state = import_react15.default.useContext(import_react_aria_components10.ComboBoxStateContext);
825
862
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
826
- _Button,
827
- {
828
- "aria-label": "Clear",
829
- "data-testid": "clear-button",
830
- onPress: () => {
831
- state == null ? void 0 : state.setInputValue("");
832
- onClear == null ? void 0 : onClear();
833
- },
834
- variant: "icon",
835
- className: (0, import_system17.cn)(
836
- "cursor-pointer appearance-none border-none p-0 pr-1",
837
- className
838
- ),
839
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
840
- "svg",
841
- {
842
- xmlns: "http://www.w3.org/2000/svg",
843
- viewBox: "0 0 20 20",
844
- fill: "currentColor",
845
- width: 20,
846
- height: 20,
847
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
848
- }
849
- )
850
- }
851
- );
852
- };
853
-
854
- // src/Autocomplete/Autocomplete.tsx
855
- var import_jsx_runtime20 = require("react/jsx-runtime");
856
- var SearchInput = ({ onSubmit, onClear, ref }) => {
857
- const state = import_react16.default.useContext(import_react_aria_components11.ComboBoxStateContext);
858
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
859
- _Input,
863
+ SearchInput,
860
864
  {
861
865
  ref,
862
- icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SearchIcon, {}),
863
- action: (state == null ? void 0 : state.inputValue) !== "" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutocompleteClearButton, { onClear }) : void 0,
866
+ className: {
867
+ action: (state == null ? void 0 : state.inputValue) === "" ? "hidden" : void 0
868
+ },
864
869
  onKeyDown: (e) => {
865
870
  if (e.key === "Enter" || e.key === "Escape") {
866
871
  e.preventDefault();
@@ -870,23 +875,16 @@ var SearchInput = ({ onSubmit, onClear, ref }) => {
870
875
  onSubmit == null ? void 0 : onSubmit(null, state.inputValue);
871
876
  }
872
877
  }
878
+ },
879
+ onClear: () => {
880
+ state == null ? void 0 : state.setInputValue("");
881
+ state == null ? void 0 : state.setSelectedKey(null);
882
+ onClear == null ? void 0 : onClear();
873
883
  }
874
884
  }
875
885
  );
876
886
  };
877
- var SearchIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
878
- "svg",
879
- {
880
- xmlns: "http://www.w3.org/2000/svg",
881
- viewBox: "0 0 24 24",
882
- fill: "currentColor",
883
- width: 24,
884
- height: 24,
885
- ...props,
886
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { d: "M16.1865 14.5142H15.3057L14.9936 14.2131C16.0862 12.9421 16.744 11.292 16.744 9.497C16.744 5.49443 13.4996 2.25 9.497 2.25C5.49443 2.25 2.25 5.49443 2.25 9.497C2.25 13.4996 5.49443 16.744 9.497 16.744C11.292 16.744 12.9421 16.0862 14.2131 14.9936L14.5142 15.3057V16.1865L20.0888 21.75L21.75 20.0888L16.1865 14.5142ZM9.49701 14.5142C6.72085 14.5142 4.47986 12.2732 4.47986 9.49701C4.47986 6.72085 6.72085 4.47986 9.49701 4.47986C12.2732 4.47986 14.5142 6.72085 14.5142 9.49701C14.5142 12.2732 12.2732 14.5142 9.49701 14.5142Z" })
887
- }
888
- );
889
- var _Autocomplete = (0, import_react15.forwardRef)(
887
+ var _Autocomplete = (0, import_react14.forwardRef)(
890
888
  ({
891
889
  children,
892
890
  defaultValue,
@@ -912,10 +910,10 @@ var _Autocomplete = (0, import_react15.forwardRef)(
912
910
  isRequired: required,
913
911
  ...rest
914
912
  };
915
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(FieldBase, { as: import_react_aria_components11.ComboBox, ...props, children: [
916
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SearchInput, { onSubmit, onClear, ref }),
917
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(_Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(_ListBox, { children }) })
918
- ] }) });
913
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(FieldBase, { as: import_react_aria_components10.ComboBox, ...props, children: [
914
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AutocompleteInput, { onSubmit, onClear, ref }),
915
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(_Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(_ListBox, { children }) })
916
+ ] });
919
917
  }
920
918
  );
921
919
  _Autocomplete.Item = _ListBox.Item;
@@ -923,6 +921,38 @@ _Autocomplete.Item = _ListBox.Item;
923
921
  // src/ComboBox/ComboBox.tsx
924
922
  var import_react17 = require("react");
925
923
  var import_react_aria_components12 = require("react-aria-components");
924
+
925
+ // src/Button/Button.tsx
926
+ var import_react16 = require("react");
927
+ var import_react_aria_components11 = require("react-aria-components");
928
+ var import_system17 = require("@marigold/system");
929
+ var import_jsx_runtime20 = require("react/jsx-runtime");
930
+ var _Button = (0, import_react16.forwardRef)(
931
+ ({ children, variant, size, className, disabled, fullWidth, ...props }, ref) => {
932
+ const classNames2 = (0, import_system17.useClassNames)({
933
+ component: "Button",
934
+ variant,
935
+ size,
936
+ className
937
+ });
938
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
939
+ import_react_aria_components11.Button,
940
+ {
941
+ ...props,
942
+ ref,
943
+ className: (0, import_system17.cn)(
944
+ "inline-flex items-center justify-center gap-[0.5ch]",
945
+ classNames2,
946
+ fullWidth ? "w-full" : void 0
947
+ ),
948
+ isDisabled: disabled,
949
+ children
950
+ }
951
+ );
952
+ }
953
+ );
954
+
955
+ // src/ComboBox/ComboBox.tsx
926
956
  var import_jsx_runtime21 = require("react/jsx-runtime");
927
957
  var _ComboBox = (0, import_react17.forwardRef)(
928
958
  ({
@@ -1620,14 +1650,14 @@ var import_date = require("@internationalized/date");
1620
1650
  var import_react24 = require("react");
1621
1651
  var import_react_aria_components25 = require("react-aria-components");
1622
1652
  var import_calendar = require("@react-aria/calendar");
1623
- var import_i18n2 = require("@react-aria/i18n");
1653
+ var import_i18n3 = require("@react-aria/i18n");
1624
1654
  var import_system36 = require("@marigold/system");
1625
1655
  var import_jsx_runtime43 = require("react/jsx-runtime");
1626
1656
  function CalendarGridHeader(props) {
1627
1657
  const state = (0, import_react24.useContext)(import_react_aria_components25.CalendarStateContext);
1628
1658
  const { headerProps } = (0, import_calendar.useCalendarGrid)(props, state);
1629
- const { locale } = (0, import_i18n2.useLocale)();
1630
- const dayFormatter = (0, import_i18n2.useDateFormatter)({
1659
+ const { locale } = (0, import_i18n3.useLocale)();
1660
+ const dayFormatter = (0, import_i18n3.useDateFormatter)({
1631
1661
  weekday: "short",
1632
1662
  timeZone: state.timeZone
1633
1663
  });
@@ -1669,10 +1699,10 @@ var import_icons = require("@marigold/icons");
1669
1699
  var import_system38 = require("@marigold/system");
1670
1700
 
1671
1701
  // src/Calendar/useFormattedMonths.tsx
1672
- var import_i18n3 = require("@react-aria/i18n");
1702
+ var import_i18n4 = require("@react-aria/i18n");
1673
1703
  function useFormattedMonths(timeZone, focusedDate) {
1674
1704
  let months = [];
1675
- let formatter = (0, import_i18n3.useDateFormatter)({
1705
+ let formatter = (0, import_i18n4.useDateFormatter)({
1676
1706
  month: "long",
1677
1707
  timeZone
1678
1708
  });
@@ -1795,12 +1825,12 @@ var MonthListBox_default = MonthListBox;
1795
1825
  // src/Calendar/YearListBox.tsx
1796
1826
  var import_react27 = require("react");
1797
1827
  var import_react_aria_components30 = require("react-aria-components");
1798
- var import_i18n4 = require("@react-aria/i18n");
1828
+ var import_i18n5 = require("@react-aria/i18n");
1799
1829
  var import_jsx_runtime48 = require("react/jsx-runtime");
1800
1830
  var YearListBox = ({ setSelectedDropdown }) => {
1801
1831
  const state = (0, import_react27.useContext)(import_react_aria_components30.CalendarStateContext);
1802
1832
  const years = [];
1803
- let formatter = (0, import_i18n4.useDateFormatter)({
1833
+ let formatter = (0, import_i18n5.useDateFormatter)({
1804
1834
  year: "numeric",
1805
1835
  timeZone: state.timeZone
1806
1836
  });
@@ -2424,18 +2454,6 @@ _Radio.Group = _RadioGroup;
2424
2454
  var import_react34 = require("react");
2425
2455
  var import_react_aria_components42 = require("react-aria-components");
2426
2456
  var import_jsx_runtime64 = require("react/jsx-runtime");
2427
- var SearchIcon2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
2428
- "svg",
2429
- {
2430
- xmlns: "http://www.w3.org/2000/svg",
2431
- viewBox: "0 0 24 24",
2432
- fill: "currentColor",
2433
- width: 24,
2434
- height: 24,
2435
- ...props,
2436
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("path", { d: "M16.1865 14.5142H15.3057L14.9936 14.2131C16.0862 12.9421 16.744 11.292 16.744 9.497C16.744 5.49443 13.4996 2.25 9.497 2.25C5.49443 2.25 2.25 5.49443 2.25 9.497C2.25 13.4996 5.49443 16.744 9.497 16.744C11.292 16.744 12.9421 16.0862 14.2131 14.9936L14.5142 15.3057V16.1865L20.0888 21.75L21.75 20.0888L16.1865 14.5142ZM9.49701 14.5142C6.72085 14.5142 4.47986 12.2732 4.47986 9.49701C4.47986 6.72085 6.72085 4.47986 9.49701 4.47986C12.2732 4.47986 14.5142 6.72085 14.5142 9.49701C14.5142 12.2732 12.2732 14.5142 9.49701 14.5142Z" })
2437
- }
2438
- );
2439
2457
  var _SearchField = (0, import_react34.forwardRef)(
2440
2458
  ({ disabled, required, readOnly, error, action, ...rest }, ref) => {
2441
2459
  const props = {
@@ -2445,7 +2463,13 @@ var _SearchField = (0, import_react34.forwardRef)(
2445
2463
  isReadOnly: readOnly,
2446
2464
  isInvalid: error
2447
2465
  };
2448
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(FieldBase, { as: import_react_aria_components42.SearchField, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(_Input, { ref, icon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SearchIcon2, {}) }) });
2466
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(FieldBase, { as: import_react_aria_components42.SearchField, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
2467
+ SearchInput,
2468
+ {
2469
+ ref,
2470
+ className: { action: "group-data-[empty=true]/field:hidden" }
2471
+ }
2472
+ ) });
2449
2473
  }
2450
2474
  );
2451
2475