@marigold/components 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -110,41 +110,46 @@ import {
110
110
  useComponentStyles as useComponentStyles2,
111
111
  useStateProps
112
112
  } from "@marigold/system";
113
- var Button = forwardRef(({
114
- as = "button",
115
- children,
116
- variant,
117
- size,
118
- disabled,
119
- ...props
120
- }, ref) => {
121
- const buttonRef = useRef(null);
122
- useImperativeHandle(ref, () => buttonRef.current);
123
- const { buttonProps, isPressed } = useButton({
124
- ...props,
125
- elementType: typeof as === "string" ? as : "span",
126
- isDisabled: disabled
127
- }, buttonRef);
128
- const { isFocusVisible, focusProps } = useFocusRing();
129
- const styles = useComponentStyles2("Button", { variant, size });
130
- const stateProps = useStateProps({
131
- active: isPressed,
132
- focus: isFocusVisible
133
- });
134
- return /* @__PURE__ */ React5.createElement(Box2, {
135
- ...mergeProps(buttonProps, focusProps),
136
- ...stateProps,
137
- as,
138
- ref: buttonRef,
139
- __baseCSS: {
140
- display: "inline-flex",
141
- alignItems: "center",
142
- gap: "0.5ch",
143
- cursor: disabled ? "not-allowed" : "pointer"
144
- },
145
- css: styles
146
- }, children);
147
- });
113
+ var Button = forwardRef(
114
+ ({
115
+ as = "button",
116
+ children,
117
+ variant,
118
+ size,
119
+ disabled,
120
+ ...props
121
+ }, ref) => {
122
+ const buttonRef = useRef(null);
123
+ useImperativeHandle(ref, () => buttonRef.current);
124
+ const { buttonProps, isPressed } = useButton(
125
+ {
126
+ ...props,
127
+ elementType: typeof as === "string" ? as : "span",
128
+ isDisabled: disabled
129
+ },
130
+ buttonRef
131
+ );
132
+ const { isFocusVisible, focusProps } = useFocusRing();
133
+ const styles = useComponentStyles2("Button", { variant, size });
134
+ const stateProps = useStateProps({
135
+ active: isPressed,
136
+ focus: isFocusVisible
137
+ });
138
+ return /* @__PURE__ */ React5.createElement(Box2, {
139
+ ...mergeProps(buttonProps, focusProps),
140
+ ...stateProps,
141
+ as,
142
+ ref: buttonRef,
143
+ __baseCSS: {
144
+ display: "inline-flex",
145
+ alignItems: "center",
146
+ gap: "0.5ch",
147
+ cursor: disabled ? "not-allowed" : "pointer"
148
+ },
149
+ css: styles
150
+ }, children);
151
+ }
152
+ );
148
153
 
149
154
  // src/Card/Card.tsx
150
155
  import React6 from "react";
@@ -231,7 +236,9 @@ var Label = ({
231
236
  };
232
237
 
233
238
  // src/Checkbox/CheckboxGroup.tsx
234
- var CheckboxGroupContext = createContext(null);
239
+ var CheckboxGroupContext = createContext(
240
+ null
241
+ );
235
242
  var useCheckboxGroupContext = () => useContext(CheckboxGroupContext);
236
243
  var CheckboxGroup = ({
237
244
  children,
@@ -252,7 +259,11 @@ var CheckboxGroup = ({
252
259
  };
253
260
  const state = useCheckboxGroupState(props);
254
261
  const { groupProps, labelProps } = useCheckboxGroup(props, state);
255
- const styles = useComponentStyles5("CheckboxGroup", { variant, size }, { parts: ["container", "group"] });
262
+ const styles = useComponentStyles5(
263
+ "CheckboxGroup",
264
+ { variant, size },
265
+ { parts: ["container", "group"] }
266
+ );
256
267
  return /* @__PURE__ */ React9.createElement(Box5, {
257
268
  ...groupProps,
258
269
  css: styles.container
@@ -306,92 +317,106 @@ var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */ React1
306
317
  css,
307
318
  ...props
308
319
  }, indeterminate ? /* @__PURE__ */ React10.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React10.createElement(CheckMark, null) : null);
309
- var Checkbox = forwardRef2(({
310
- size,
311
- variant,
312
- disabled,
313
- checked,
314
- defaultChecked,
315
- indeterminate,
316
- readOnly,
317
- required,
318
- error,
319
- ...props
320
- }, ref) => {
321
- const inputRef = useObjectRef(ref);
322
- const checkboxProps = {
323
- isIndeterminate: indeterminate,
324
- isDisabled: disabled,
325
- isReadOnly: readOnly,
326
- isRequired: required,
327
- validationState: error ? "invalid" : "valid"
328
- };
329
- const groupState = useCheckboxGroupContext();
330
- const { inputProps } = groupState ? useCheckboxGroupItem({
331
- ...props,
332
- ...checkboxProps,
333
- value: props.value
334
- }, groupState, inputRef) : useCheckbox({
335
- isSelected: checked,
336
- defaultSelected: defaultChecked,
337
- ...checkboxProps,
338
- ...props
339
- }, useToggleState({
340
- isSelected: checked,
341
- defaultSelected: defaultChecked,
342
- ...props
343
- }), inputRef);
344
- const styles = useComponentStyles6("Checkbox", {
345
- variant: (groupState == null ? void 0 : groupState.variant) || variant,
346
- size: (groupState == null ? void 0 : groupState.size) || size
347
- }, { parts: ["container", "label", "checkbox"] });
348
- const { hoverProps, isHovered } = useHover({});
349
- const { isFocusVisible, focusProps } = useFocusRing2();
350
- const stateProps = useStateProps2({
351
- hover: isHovered,
352
- focus: isFocusVisible,
353
- checked: inputProps.checked,
354
- disabled: inputProps.disabled,
355
- error: (groupState == null ? void 0 : groupState.error) || error,
356
- readOnly,
357
- indeterminate
358
- });
359
- return /* @__PURE__ */ React10.createElement(Box6, {
360
- as: "label",
361
- __baseCSS: {
362
- display: "flex",
363
- alignItems: "center",
364
- gap: "1ch",
365
- position: "relative"
366
- },
367
- css: styles.container,
368
- ...hoverProps,
369
- ...stateProps
370
- }, /* @__PURE__ */ React10.createElement(Box6, {
371
- as: "input",
372
- ref: inputRef,
373
- css: {
374
- position: "absolute",
375
- width: "100%",
376
- height: "100%",
377
- top: 0,
378
- left: 0,
379
- zIndex: 1,
380
- opacity: 1e-4,
381
- cursor: inputProps.disabled ? "not-allowed" : "pointer"
382
- },
383
- ...inputProps,
384
- ...focusProps
385
- }), /* @__PURE__ */ React10.createElement(Icon, {
386
- checked: inputProps.checked,
320
+ var Checkbox = forwardRef2(
321
+ ({
322
+ size,
323
+ variant,
324
+ disabled,
325
+ checked,
326
+ defaultChecked,
387
327
  indeterminate,
388
- css: styles.checkbox,
389
- ...stateProps
390
- }), props.children && /* @__PURE__ */ React10.createElement(Box6, {
391
- css: styles.label,
392
- ...stateProps
393
- }, props.children));
394
- });
328
+ readOnly,
329
+ required,
330
+ error,
331
+ ...props
332
+ }, ref) => {
333
+ const inputRef = useObjectRef(ref);
334
+ const checkboxProps = {
335
+ isIndeterminate: indeterminate,
336
+ isDisabled: disabled,
337
+ isReadOnly: readOnly,
338
+ isRequired: required,
339
+ validationState: error ? "invalid" : "valid"
340
+ };
341
+ const groupState = useCheckboxGroupContext();
342
+ const { inputProps } = groupState ? useCheckboxGroupItem(
343
+ {
344
+ ...props,
345
+ ...checkboxProps,
346
+ value: props.value
347
+ },
348
+ groupState,
349
+ inputRef
350
+ ) : useCheckbox(
351
+ {
352
+ isSelected: checked,
353
+ defaultSelected: defaultChecked,
354
+ ...checkboxProps,
355
+ ...props
356
+ },
357
+ useToggleState({
358
+ isSelected: checked,
359
+ defaultSelected: defaultChecked,
360
+ ...props
361
+ }),
362
+ inputRef
363
+ );
364
+ const styles = useComponentStyles6(
365
+ "Checkbox",
366
+ {
367
+ variant: (groupState == null ? void 0 : groupState.variant) || variant,
368
+ size: (groupState == null ? void 0 : groupState.size) || size
369
+ },
370
+ { parts: ["container", "label", "checkbox"] }
371
+ );
372
+ const { hoverProps, isHovered } = useHover({});
373
+ const { isFocusVisible, focusProps } = useFocusRing2();
374
+ const stateProps = useStateProps2({
375
+ hover: isHovered,
376
+ focus: isFocusVisible,
377
+ checked: inputProps.checked,
378
+ disabled: inputProps.disabled,
379
+ error: (groupState == null ? void 0 : groupState.error) || error,
380
+ readOnly,
381
+ indeterminate
382
+ });
383
+ return /* @__PURE__ */ React10.createElement(Box6, {
384
+ as: "label",
385
+ __baseCSS: {
386
+ display: "flex",
387
+ alignItems: "center",
388
+ gap: "1ch",
389
+ position: "relative"
390
+ },
391
+ css: styles.container,
392
+ ...hoverProps,
393
+ ...stateProps
394
+ }, /* @__PURE__ */ React10.createElement(Box6, {
395
+ as: "input",
396
+ ref: inputRef,
397
+ css: {
398
+ position: "absolute",
399
+ width: "100%",
400
+ height: "100%",
401
+ top: 0,
402
+ left: 0,
403
+ zIndex: 1,
404
+ opacity: 1e-4,
405
+ cursor: inputProps.disabled ? "not-allowed" : "pointer"
406
+ },
407
+ ...inputProps,
408
+ ...focusProps
409
+ }), /* @__PURE__ */ React10.createElement(Icon, {
410
+ checked: inputProps.checked,
411
+ indeterminate,
412
+ css: styles.checkbox,
413
+ ...stateProps
414
+ }), props.children && /* @__PURE__ */ React10.createElement(Box6, {
415
+ css: styles.label,
416
+ ...stateProps
417
+ }, props.children));
418
+ }
419
+ );
395
420
 
396
421
  // src/Columns/Columns.tsx
397
422
  import React11, { Children } from "react";
@@ -403,7 +428,11 @@ var Columns = ({
403
428
  ...props
404
429
  }) => {
405
430
  if (Children.count(children) !== columns.length) {
406
- throw new Error(`Columns: expected ${columns.length} children, got ${Children.count(children)}`);
431
+ throw new Error(
432
+ `Columns: expected ${columns.length} children, got ${Children.count(
433
+ children
434
+ )}`
435
+ );
407
436
  }
408
437
  const getColumnWidths = columns.map((column, index) => {
409
438
  return {
@@ -414,13 +443,16 @@ var Columns = ({
414
443
  });
415
444
  return /* @__PURE__ */ React11.createElement(Box, {
416
445
  display: "flex",
417
- css: Object.assign({
418
- flexWrap: "wrap",
419
- gap: space,
420
- "> *": {
421
- flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
422
- }
423
- }, ...getColumnWidths),
446
+ css: Object.assign(
447
+ {
448
+ flexWrap: "wrap",
449
+ gap: space,
450
+ "> *": {
451
+ flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
452
+ }
453
+ },
454
+ ...getColumnWidths
455
+ ),
424
456
  ...props
425
457
  }, children);
426
458
  };
@@ -565,38 +597,43 @@ var Underlay = ({ size, variant, ...props }) => {
565
597
  };
566
598
 
567
599
  // src/Overlay/Modal.tsx
568
- var Modal = forwardRef3(({ children, open, dismissable, keyboardDismissable, onClose, ...props }, ref) => {
569
- const modalRef = useObjectRef2(ref);
570
- const { overlayProps, underlayProps } = useOverlay({
571
- isOpen: open,
572
- onClose,
573
- isDismissable: dismissable,
574
- isKeyboardDismissDisabled: !keyboardDismissable
575
- }, modalRef);
576
- usePreventScroll();
577
- const { modalProps } = useModal({});
578
- return /* @__PURE__ */ React17.createElement(FocusScope, {
579
- contain: true,
580
- restoreFocus: true,
581
- autoFocus: true
582
- }, /* @__PURE__ */ React17.createElement(Underlay, {
583
- ...underlayProps
584
- }), /* @__PURE__ */ React17.createElement("div", {
585
- style: {
586
- display: "flex",
587
- alignItems: "center",
588
- justifyContent: "center",
589
- position: "fixed",
590
- inset: 0,
591
- zIndex: 2,
592
- pointerEvents: "none"
593
- },
594
- ref: modalRef,
595
- ...mergeProps2(props, overlayProps, modalProps)
596
- }, /* @__PURE__ */ React17.createElement("div", {
597
- style: { pointerEvents: "auto" }
598
- }, children)));
599
- });
600
+ var Modal = forwardRef3(
601
+ ({ children, open, dismissable, keyboardDismissable, onClose, ...props }, ref) => {
602
+ const modalRef = useObjectRef2(ref);
603
+ const { overlayProps, underlayProps } = useOverlay(
604
+ {
605
+ isOpen: open,
606
+ onClose,
607
+ isDismissable: dismissable,
608
+ isKeyboardDismissDisabled: !keyboardDismissable
609
+ },
610
+ modalRef
611
+ );
612
+ usePreventScroll();
613
+ const { modalProps } = useModal({});
614
+ return /* @__PURE__ */ React17.createElement(FocusScope, {
615
+ contain: true,
616
+ restoreFocus: true,
617
+ autoFocus: true
618
+ }, /* @__PURE__ */ React17.createElement(Underlay, {
619
+ ...underlayProps
620
+ }), /* @__PURE__ */ React17.createElement("div", {
621
+ style: {
622
+ display: "flex",
623
+ alignItems: "center",
624
+ justifyContent: "center",
625
+ position: "fixed",
626
+ inset: 0,
627
+ zIndex: 2,
628
+ pointerEvents: "none"
629
+ },
630
+ ref: modalRef,
631
+ ...mergeProps2(props, overlayProps, modalProps)
632
+ }, /* @__PURE__ */ React17.createElement("div", {
633
+ style: { pointerEvents: "auto" }
634
+ }, children)));
635
+ }
636
+ );
600
637
 
601
638
  // src/Overlay/Overlay.tsx
602
639
  import React18 from "react";
@@ -621,34 +658,39 @@ var Overlay = ({
621
658
  import React19, { forwardRef as forwardRef4, useRef as useRef2 } from "react";
622
659
  import { useModal as useModal2, useOverlay as useOverlay2 } from "@react-aria/overlays";
623
660
  import { mergeProps as mergeProps3 } from "@react-aria/utils";
624
- var Popover = forwardRef4(({
625
- children,
626
- open,
627
- dismissable,
628
- keyboardDismissDisabled,
629
- shouldCloseOnBlur,
630
- minWidth = 0,
631
- ...props
632
- }, ref) => {
633
- const fallbackRef = useRef2(null);
634
- const popoverRef = ref || fallbackRef;
635
- const { overlayProps } = useOverlay2({
636
- isOpen: open,
637
- isDismissable: dismissable,
638
- isKeyboardDismissDisabled: keyboardDismissDisabled,
661
+ var Popover = forwardRef4(
662
+ ({
663
+ children,
664
+ open,
665
+ dismissable,
666
+ keyboardDismissDisabled,
639
667
  shouldCloseOnBlur,
668
+ minWidth = 0,
640
669
  ...props
641
- }, popoverRef);
642
- const { modalProps } = useModal2({});
643
- const style = { minWidth };
644
- return /* @__PURE__ */ React19.createElement(Overlay, {
645
- open
646
- }, /* @__PURE__ */ React19.createElement(Box, {
647
- ref: popoverRef,
648
- role: "presentation",
649
- ...mergeProps3(props, overlayProps, modalProps, style)
650
- }, children));
651
- });
670
+ }, ref) => {
671
+ const fallbackRef = useRef2(null);
672
+ const popoverRef = ref || fallbackRef;
673
+ const { overlayProps } = useOverlay2(
674
+ {
675
+ isOpen: open,
676
+ isDismissable: dismissable,
677
+ isKeyboardDismissDisabled: keyboardDismissDisabled,
678
+ shouldCloseOnBlur,
679
+ ...props
680
+ },
681
+ popoverRef
682
+ );
683
+ const { modalProps } = useModal2({});
684
+ const style = { minWidth };
685
+ return /* @__PURE__ */ React19.createElement(Overlay, {
686
+ open
687
+ }, /* @__PURE__ */ React19.createElement(Box, {
688
+ ref: popoverRef,
689
+ role: "presentation",
690
+ ...mergeProps3(props, overlayProps, modalProps, style)
691
+ }, children));
692
+ }
693
+ );
652
694
 
653
695
  // src/Dialog/DialogTrigger.tsx
654
696
  var DialogTrigger = ({
@@ -680,9 +722,12 @@ var DialogTrigger = ({
680
722
  var CloseButton = ({ css }) => {
681
723
  const ref = useRef4(null);
682
724
  const { close } = useDialogContext();
683
- const { buttonProps } = useButton2({
684
- onPress: () => close == null ? void 0 : close()
685
- }, ref);
725
+ const { buttonProps } = useButton2(
726
+ {
727
+ onPress: () => close == null ? void 0 : close()
728
+ },
729
+ ref
730
+ );
686
731
  return /* @__PURE__ */ React21.createElement(Box10, {
687
732
  css: { display: "flex", justifyContent: "flex-end" }
688
733
  }, /* @__PURE__ */ React21.createElement(Box10, {
@@ -710,12 +755,19 @@ var CloseButton = ({ css }) => {
710
755
  };
711
756
  var addTitleProps = (children, titleProps) => {
712
757
  const childs = React21.Children.toArray(children);
713
- const titleIndex = childs.findIndex((child) => React21.isValidElement(child) && (child.type === Header || child.type === Headline));
758
+ const titleIndex = childs.findIndex(
759
+ (child) => React21.isValidElement(child) && (child.type === Header || child.type === Headline)
760
+ );
714
761
  if (titleIndex < 0) {
715
- console.warn("No child in <Dialog> found that can act as title for accessibility. Please add a <Header> or <Headline> as direct child.");
762
+ console.warn(
763
+ "No child in <Dialog> found that can act as title for accessibility. Please add a <Header> or <Headline> as direct child."
764
+ );
716
765
  return children;
717
766
  }
718
- const titleChild = React21.cloneElement(childs[titleIndex], titleProps);
767
+ const titleChild = React21.cloneElement(
768
+ childs[titleIndex],
769
+ titleProps
770
+ );
719
771
  childs.splice(titleIndex, 1, titleChild);
720
772
  return childs;
721
773
  };
@@ -729,7 +781,11 @@ var Dialog = ({
729
781
  const ref = useRef4(null);
730
782
  const { close } = useDialogContext();
731
783
  const { dialogProps, titleProps } = useDialog(props, ref);
732
- const styles = useComponentStyles11("Dialog", { variant, size }, { parts: ["container", "closeButton"] });
784
+ const styles = useComponentStyles11(
785
+ "Dialog",
786
+ { variant, size },
787
+ { parts: ["container", "closeButton"] }
788
+ );
733
789
  return /* @__PURE__ */ React21.createElement(Box10, {
734
790
  __baseCSS: { bg: "#fff" },
735
791
  css: styles.container,
@@ -812,74 +868,135 @@ var Inline = ({
812
868
  // src/Input/Input.tsx
813
869
  import React26, { forwardRef as forwardRef5 } from "react";
814
870
  import { Box as Box12, useComponentStyles as useComponentStyles15 } from "@marigold/system";
815
- var Input = forwardRef5(({ variant, size, type = "text", ...props }, ref) => {
816
- const styles = useComponentStyles15("Input", { variant, size });
817
- return /* @__PURE__ */ React26.createElement(Box12, {
818
- ...props,
819
- ref,
820
- as: "input",
821
- type,
822
- css: styles
823
- });
824
- });
871
+ var Input = forwardRef5(
872
+ ({ variant, size, type = "text", ...props }, ref) => {
873
+ const styles = useComponentStyles15("Input", { variant, size });
874
+ return /* @__PURE__ */ React26.createElement(Box12, {
875
+ ...props,
876
+ ref,
877
+ as: "input",
878
+ type,
879
+ css: styles
880
+ });
881
+ }
882
+ );
825
883
 
826
884
  // src/Link/Link.tsx
827
- import React27, { useRef as useRef5 } from "react";
885
+ import React27, { forwardRef as forwardRef6 } from "react";
828
886
  import { useLink } from "@react-aria/link";
829
887
  import { useComponentStyles as useComponentStyles16 } from "@marigold/system";
830
- var Link = ({
831
- as = "a",
888
+ import { useObjectRef as useObjectRef3 } from "@react-aria/utils";
889
+ var Link = forwardRef6(
890
+ ({
891
+ as = "a",
892
+ variant,
893
+ size,
894
+ children,
895
+ disabled,
896
+ onPress,
897
+ onPressStart,
898
+ ...props
899
+ }, ref) => {
900
+ const linkRef = useObjectRef3(ref);
901
+ const { linkProps } = useLink(
902
+ {
903
+ ...props,
904
+ elementType: typeof as === "string" ? as : "span",
905
+ isDisabled: disabled
906
+ },
907
+ linkRef
908
+ );
909
+ const styles = useComponentStyles16("Link", { variant, size });
910
+ return /* @__PURE__ */ React27.createElement(Box, {
911
+ as,
912
+ css: styles,
913
+ ref: linkRef,
914
+ ...props,
915
+ ...linkProps
916
+ }, children);
917
+ }
918
+ );
919
+
920
+ // src/List/List.tsx
921
+ import React29 from "react";
922
+ import {
923
+ Box as Box14,
924
+ useComponentStyles as useComponentStyles17
925
+ } from "@marigold/system";
926
+
927
+ // src/List/Context.ts
928
+ import { createContext as createContext3, useContext as useContext3 } from "react";
929
+ var ListContext = createContext3({});
930
+ var useListContext = () => useContext3(ListContext);
931
+
932
+ // src/List/ListItem.tsx
933
+ import React28 from "react";
934
+ import { Box as Box13 } from "@marigold/system";
935
+ var ListItem = ({ children, ...props }) => {
936
+ const { styles } = useListContext();
937
+ return /* @__PURE__ */ React28.createElement(Box13, {
938
+ ...props,
939
+ as: "li",
940
+ css: styles
941
+ }, children);
942
+ };
943
+
944
+ // src/List/List.tsx
945
+ var List = ({
946
+ as = "ul",
947
+ children,
832
948
  variant,
833
949
  size,
834
- children,
835
- disabled,
836
950
  ...props
837
951
  }) => {
838
- const ref = useRef5(null);
839
- const { linkProps } = useLink({
952
+ const styles = useComponentStyles17(
953
+ "List",
954
+ { variant, size },
955
+ { parts: ["ul", "ol", "item"] }
956
+ );
957
+ return /* @__PURE__ */ React29.createElement(Box14, {
840
958
  ...props,
841
- elementType: typeof as === "string" ? as : "span",
842
- isDisabled: disabled
843
- }, ref);
844
- const styles = useComponentStyles16("Link", { variant, size });
845
- return /* @__PURE__ */ React27.createElement(Box, {
846
959
  as,
847
- css: styles,
848
- ref,
849
- ...props,
850
- ...linkProps
851
- }, children);
960
+ css: styles[as]
961
+ }, /* @__PURE__ */ React29.createElement(ListContext.Provider, {
962
+ value: { styles: styles.item }
963
+ }, children));
852
964
  };
965
+ List.Item = ListItem;
853
966
 
854
967
  // src/Menu/Menu.tsx
855
- import React30, { useRef as useRef8 } from "react";
968
+ import React32, { useRef as useRef7 } from "react";
856
969
  import { FocusScope as FocusScope2 } from "@react-aria/focus";
857
970
  import { useMenu } from "@react-aria/menu";
858
971
  import { DismissButton } from "@react-aria/overlays";
859
972
  import { Item } from "@react-stately/collections";
860
973
  import { useTreeState } from "@react-stately/tree";
861
974
  import {
862
- Box as Box14,
863
- useComponentStyles as useComponentStyles17
975
+ Box as Box16,
976
+ useComponentStyles as useComponentStyles18
864
977
  } from "@marigold/system";
865
978
 
866
979
  // src/Menu/Context.ts
867
- import { createContext as createContext3, useContext as useContext3 } from "react";
868
- var MenuContext = createContext3({});
869
- var useMenuContext = () => useContext3(MenuContext);
980
+ import { createContext as createContext4, useContext as useContext4 } from "react";
981
+ var MenuContext = createContext4({});
982
+ var useMenuContext = () => useContext4(MenuContext);
870
983
 
871
984
  // src/Menu/MenuTrigger.tsx
872
- import React28, { useRef as useRef6 } from "react";
985
+ import React30, { useRef as useRef5 } from "react";
873
986
  import { useMenuTriggerState } from "@react-stately/menu";
874
987
  import { useMenuTrigger } from "@react-aria/menu";
875
988
  import { useOverlayPosition } from "@react-aria/overlays";
876
989
  import { PressResponder as PressResponder2 } from "@react-aria/interactions";
877
990
  var MenuTrigger = ({ disabled, children }) => {
878
- const [menuTrigger, menu] = React28.Children.toArray(children);
879
- const menuTriggerRef = useRef6(null);
880
- const overlayRef = useRef6(null);
991
+ const [menuTrigger, menu] = React30.Children.toArray(children);
992
+ const menuTriggerRef = useRef5(null);
993
+ const overlayRef = useRef5(null);
881
994
  const state = useMenuTriggerState({});
882
- const { menuTriggerProps, menuProps } = useMenuTrigger({ trigger: "press", isDisabled: disabled }, state, menuTriggerRef);
995
+ const { menuTriggerProps, menuProps } = useMenuTrigger(
996
+ { trigger: "press", isDisabled: disabled },
997
+ state,
998
+ menuTriggerRef
999
+ );
883
1000
  const { overlayProps: positionProps } = useOverlayPosition({
884
1001
  targetRef: menuTriggerRef,
885
1002
  overlayRef,
@@ -892,13 +1009,13 @@ var MenuTrigger = ({ disabled, children }) => {
892
1009
  autoFocus: state.focusStrategy,
893
1010
  triggerWidth: menuTriggerRef.current ? menuTriggerRef.current.offsetWidth : void 0
894
1011
  };
895
- return /* @__PURE__ */ React28.createElement(MenuContext.Provider, {
1012
+ return /* @__PURE__ */ React30.createElement(MenuContext.Provider, {
896
1013
  value: menuContext
897
- }, /* @__PURE__ */ React28.createElement(PressResponder2, {
1014
+ }, /* @__PURE__ */ React30.createElement(PressResponder2, {
898
1015
  ...menuTriggerProps,
899
1016
  ref: menuTriggerRef,
900
1017
  isPressed: state.isOpen
901
- }, menuTrigger), /* @__PURE__ */ React28.createElement(Popover, {
1018
+ }, menuTrigger), /* @__PURE__ */ React30.createElement(Popover, {
902
1019
  open: state.isOpen,
903
1020
  onClose: state.close,
904
1021
  dismissable: true,
@@ -909,24 +1026,28 @@ var MenuTrigger = ({ disabled, children }) => {
909
1026
  };
910
1027
 
911
1028
  // src/Menu/MenuItem.tsx
912
- import React29, { useRef as useRef7 } from "react";
1029
+ import React31, { useRef as useRef6 } from "react";
913
1030
  import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
914
1031
  import { useMenuItem } from "@react-aria/menu";
915
1032
  import { mergeProps as mergeProps4 } from "@react-aria/utils";
916
- import { Box as Box13, useStateProps as useStateProps3 } from "@marigold/system";
1033
+ import { Box as Box15, useStateProps as useStateProps3 } from "@marigold/system";
917
1034
  var MenuItem = ({ item, state, onAction, css }) => {
918
- const ref = useRef7(null);
1035
+ const ref = useRef6(null);
919
1036
  const { onClose } = useMenuContext();
920
- const { menuItemProps } = useMenuItem({
921
- key: item.key,
922
- onAction,
923
- onClose
924
- }, state, ref);
1037
+ const { menuItemProps } = useMenuItem(
1038
+ {
1039
+ key: item.key,
1040
+ onAction,
1041
+ onClose
1042
+ },
1043
+ state,
1044
+ ref
1045
+ );
925
1046
  const { isFocusVisible, focusProps } = useFocusRing3();
926
1047
  const stateProps = useStateProps3({
927
1048
  focus: isFocusVisible
928
1049
  });
929
- return /* @__PURE__ */ React29.createElement(Box13, {
1050
+ return /* @__PURE__ */ React31.createElement(Box15, {
930
1051
  as: "li",
931
1052
  ref,
932
1053
  __baseCSS: {
@@ -944,15 +1065,19 @@ var MenuItem = ({ item, state, onAction, css }) => {
944
1065
  var Menu = ({ variant, size, ...props }) => {
945
1066
  const { triggerWidth, ...menuContext } = useMenuContext();
946
1067
  const ownProps = { ...props, ...menuContext };
947
- const ref = useRef8(null);
1068
+ const ref = useRef7(null);
948
1069
  const state = useTreeState({ ...ownProps, selectionMode: "none" });
949
1070
  const { menuProps } = useMenu(ownProps, state, ref);
950
- const styles = useComponentStyles17("Menu", { variant, size }, { parts: ["container", "item"] });
951
- return /* @__PURE__ */ React30.createElement(FocusScope2, {
1071
+ const styles = useComponentStyles18(
1072
+ "Menu",
1073
+ { variant, size },
1074
+ { parts: ["container", "item"] }
1075
+ );
1076
+ return /* @__PURE__ */ React32.createElement(FocusScope2, {
952
1077
  restoreFocus: true
953
- }, /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement(DismissButton, {
1078
+ }, /* @__PURE__ */ React32.createElement("div", null, /* @__PURE__ */ React32.createElement(DismissButton, {
954
1079
  onDismiss: ownProps.onClose
955
- }), /* @__PURE__ */ React30.createElement(Box14, {
1080
+ }), /* @__PURE__ */ React32.createElement(Box16, {
956
1081
  as: "ul",
957
1082
  ref,
958
1083
  style: { width: triggerWidth },
@@ -963,13 +1088,13 @@ var Menu = ({ variant, size, ...props }) => {
963
1088
  },
964
1089
  css: styles.container,
965
1090
  ...menuProps
966
- }, [...state.collection].map((item) => /* @__PURE__ */ React30.createElement(MenuItem, {
1091
+ }, [...state.collection].map((item) => /* @__PURE__ */ React32.createElement(MenuItem, {
967
1092
  key: item.key,
968
1093
  item,
969
1094
  state,
970
1095
  onAction: props.onSelect,
971
1096
  css: styles.item
972
- }))), /* @__PURE__ */ React30.createElement(DismissButton, {
1097
+ }))), /* @__PURE__ */ React32.createElement(DismissButton, {
973
1098
  onDismiss: ownProps.onClose
974
1099
  })));
975
1100
  };
@@ -977,9 +1102,9 @@ Menu.Trigger = MenuTrigger;
977
1102
  Menu.Item = Item;
978
1103
 
979
1104
  // src/Message/Message.tsx
980
- import React31 from "react";
1105
+ import React33 from "react";
981
1106
  import { Exclamation, Info, Notification } from "@marigold/icons";
982
- import { useComponentStyles as useComponentStyles18 } from "@marigold/system";
1107
+ import { useComponentStyles as useComponentStyles19 } from "@marigold/system";
983
1108
  var Message = ({
984
1109
  messageTitle,
985
1110
  variant = "info",
@@ -987,56 +1112,60 @@ var Message = ({
987
1112
  children,
988
1113
  ...props
989
1114
  }) => {
990
- const styles = useComponentStyles18("Message", {
991
- variant,
992
- size
993
- }, { parts: ["container", "icon", "title", "content"] });
994
- var icon = /* @__PURE__ */ React31.createElement(Info, null);
1115
+ const styles = useComponentStyles19(
1116
+ "Message",
1117
+ {
1118
+ variant,
1119
+ size
1120
+ },
1121
+ { parts: ["container", "icon", "title", "content"] }
1122
+ );
1123
+ var icon = /* @__PURE__ */ React33.createElement(Info, null);
995
1124
  if (variant === "warning") {
996
- icon = /* @__PURE__ */ React31.createElement(Notification, null);
1125
+ icon = /* @__PURE__ */ React33.createElement(Notification, null);
997
1126
  }
998
1127
  if (variant === "error") {
999
- icon = /* @__PURE__ */ React31.createElement(Exclamation, null);
1128
+ icon = /* @__PURE__ */ React33.createElement(Exclamation, null);
1000
1129
  }
1001
- return /* @__PURE__ */ React31.createElement(Box, {
1130
+ return /* @__PURE__ */ React33.createElement(Box, {
1002
1131
  css: styles.container,
1003
1132
  ...props
1004
- }, /* @__PURE__ */ React31.createElement(Box, {
1133
+ }, /* @__PURE__ */ React33.createElement(Box, {
1005
1134
  __baseCSS: { display: "flex", alignItems: "center", gap: 4 }
1006
- }, /* @__PURE__ */ React31.createElement(Box, {
1135
+ }, /* @__PURE__ */ React33.createElement(Box, {
1007
1136
  role: "presentation",
1008
1137
  css: styles.icon
1009
- }, icon), /* @__PURE__ */ React31.createElement(Box, {
1138
+ }, icon), /* @__PURE__ */ React33.createElement(Box, {
1010
1139
  css: styles.title
1011
- }, messageTitle)), /* @__PURE__ */ React31.createElement(Box, {
1140
+ }, messageTitle)), /* @__PURE__ */ React33.createElement(Box, {
1012
1141
  css: styles.content
1013
1142
  }, children));
1014
1143
  };
1015
1144
 
1016
1145
  // src/NumberField/NumberField.tsx
1017
- import React35, { forwardRef as forwardRef6 } from "react";
1146
+ import React37, { forwardRef as forwardRef7 } from "react";
1018
1147
  import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
1019
1148
  import { useHover as useHover3 } from "@react-aria/interactions";
1020
1149
  import { useLocale } from "@react-aria/i18n";
1021
1150
  import { useNumberField } from "@react-aria/numberfield";
1022
- import { mergeProps as mergeProps6, useObjectRef as useObjectRef3 } from "@react-aria/utils";
1151
+ import { mergeProps as mergeProps6, useObjectRef as useObjectRef4 } from "@react-aria/utils";
1023
1152
  import { useNumberFieldState } from "@react-stately/numberfield";
1024
1153
  import {
1025
- Box as Box18,
1026
- useComponentStyles as useComponentStyles20,
1154
+ Box as Box20,
1155
+ useComponentStyles as useComponentStyles21,
1027
1156
  useStateProps as useStateProps5
1028
1157
  } from "@marigold/system";
1029
1158
 
1030
1159
  // src/FieldBase/FieldBase.tsx
1031
- import React33 from "react";
1032
- import { Box as Box16 } from "@marigold/system";
1160
+ import React35 from "react";
1161
+ import { Box as Box18 } from "@marigold/system";
1033
1162
 
1034
1163
  // src/HelpText/HelpText.tsx
1035
- import React32 from "react";
1164
+ import React34 from "react";
1036
1165
  import { Exclamation as Exclamation2 } from "@marigold/icons";
1037
1166
  import {
1038
- Box as Box15,
1039
- useComponentStyles as useComponentStyles19
1167
+ Box as Box17,
1168
+ useComponentStyles as useComponentStyles20
1040
1169
  } from "@marigold/system";
1041
1170
  var HelpText = ({
1042
1171
  variant,
@@ -1051,16 +1180,20 @@ var HelpText = ({
1051
1180
  }) => {
1052
1181
  var _a;
1053
1182
  const hasErrorMessage = errorMessage && error;
1054
- const styles = useComponentStyles19("HelpText", { variant, size }, { parts: ["container", "icon"] });
1055
- return /* @__PURE__ */ React32.createElement(Box15, {
1183
+ const styles = useComponentStyles20(
1184
+ "HelpText",
1185
+ { variant, size },
1186
+ { parts: ["container", "icon"] }
1187
+ );
1188
+ return /* @__PURE__ */ React34.createElement(Box17, {
1056
1189
  ...hasErrorMessage ? errorMessageProps : descriptionProps,
1057
1190
  ...props,
1058
1191
  __baseCSS: { display: "flex", alignItems: "center", gap: 4 },
1059
1192
  css: styles.container
1060
- }, hasErrorMessage ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Exclamation2, {
1193
+ }, hasErrorMessage ? /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(Exclamation2, {
1061
1194
  role: "presentation",
1062
1195
  size: ((_a = styles == null ? void 0 : styles.icon) == null ? void 0 : _a.size) || 16
1063
- }), errorMessage) : /* @__PURE__ */ React32.createElement(React32.Fragment, null, description));
1196
+ }), errorMessage) : /* @__PURE__ */ React34.createElement(React34.Fragment, null, description));
1064
1197
  };
1065
1198
 
1066
1199
  // src/FieldBase/FieldBase.tsx
@@ -1081,15 +1214,15 @@ var FieldBase = ({
1081
1214
  stateProps
1082
1215
  }) => {
1083
1216
  const hasHelpText = !!description || errorMessage && error;
1084
- return /* @__PURE__ */ React33.createElement(Box16, {
1217
+ return /* @__PURE__ */ React35.createElement(Box18, {
1085
1218
  css: { display: "flex", flexDirection: "column", width }
1086
- }, label && /* @__PURE__ */ React33.createElement(Label, {
1219
+ }, label && /* @__PURE__ */ React35.createElement(Label, {
1087
1220
  required,
1088
1221
  variant,
1089
1222
  size,
1090
1223
  ...labelProps,
1091
1224
  ...stateProps
1092
- }, label), children, hasHelpText && /* @__PURE__ */ React33.createElement(HelpText, {
1225
+ }, label), children, hasHelpText && /* @__PURE__ */ React35.createElement(HelpText, {
1093
1226
  ...stateProps,
1094
1227
  variant,
1095
1228
  size,
@@ -1103,34 +1236,37 @@ var FieldBase = ({
1103
1236
  };
1104
1237
 
1105
1238
  // src/NumberField/StepButton.tsx
1106
- import React34, { useRef as useRef9 } from "react";
1239
+ import React36, { useRef as useRef8 } from "react";
1107
1240
  import { useButton as useButton3 } from "@react-aria/button";
1108
1241
  import { useHover as useHover2 } from "@react-aria/interactions";
1109
1242
  import { mergeProps as mergeProps5 } from "@react-aria/utils";
1110
- import { Box as Box17, useStateProps as useStateProps4 } from "@marigold/system";
1111
- var Plus = () => /* @__PURE__ */ React34.createElement(Box17, {
1243
+ import { Box as Box19, useStateProps as useStateProps4 } from "@marigold/system";
1244
+ var Plus = () => /* @__PURE__ */ React36.createElement(Box19, {
1112
1245
  as: "svg",
1113
1246
  __baseCSS: { width: 16, height: 16 },
1114
1247
  viewBox: "0 0 20 20",
1115
1248
  fill: "currentColor"
1116
- }, /* @__PURE__ */ React34.createElement("path", {
1249
+ }, /* @__PURE__ */ React36.createElement("path", {
1117
1250
  fillRule: "evenodd",
1118
1251
  clipRule: "evenodd",
1119
1252
  d: "M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z"
1120
1253
  }));
1121
- var Minus = () => /* @__PURE__ */ React34.createElement(Box17, {
1254
+ var Minus = () => /* @__PURE__ */ React36.createElement(Box19, {
1122
1255
  as: "svg",
1123
1256
  __baseCSS: { width: 16, height: 16 },
1124
1257
  viewBox: "0 0 20 20",
1125
1258
  fill: "currentColor"
1126
- }, /* @__PURE__ */ React34.createElement("path", {
1259
+ }, /* @__PURE__ */ React36.createElement("path", {
1127
1260
  fillRule: "evenodd",
1128
1261
  clipRule: "evenodd",
1129
1262
  d: "M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
1130
1263
  }));
1131
1264
  var StepButton = ({ direction, css, ...props }) => {
1132
- const ref = useRef9(null);
1133
- const { buttonProps, isPressed } = useButton3({ ...props, elementType: "div" }, ref);
1265
+ const ref = useRef8(null);
1266
+ const { buttonProps, isPressed } = useButton3(
1267
+ { ...props, elementType: "div" },
1268
+ ref
1269
+ );
1134
1270
  const { hoverProps, isHovered } = useHover2(props);
1135
1271
  const stateProps = useStateProps4({
1136
1272
  active: isPressed,
@@ -1138,7 +1274,7 @@ var StepButton = ({ direction, css, ...props }) => {
1138
1274
  disabled: props.isDisabled
1139
1275
  });
1140
1276
  const Icon3 = direction === "up" ? Plus : Minus;
1141
- return /* @__PURE__ */ React34.createElement(Box17, {
1277
+ return /* @__PURE__ */ React36.createElement(Box19, {
1142
1278
  __baseCSS: {
1143
1279
  display: "flex",
1144
1280
  alignItems: "center",
@@ -1148,103 +1284,109 @@ var StepButton = ({ direction, css, ...props }) => {
1148
1284
  css,
1149
1285
  ...mergeProps5(buttonProps, hoverProps),
1150
1286
  ...stateProps
1151
- }, /* @__PURE__ */ React34.createElement(Icon3, null));
1287
+ }, /* @__PURE__ */ React36.createElement(Icon3, null));
1152
1288
  };
1153
1289
 
1154
1290
  // src/NumberField/NumberField.tsx
1155
- var NumberField = forwardRef6(({
1156
- variant,
1157
- size,
1158
- width,
1159
- disabled,
1160
- required,
1161
- readOnly,
1162
- error,
1163
- hideStepper,
1164
- ...rest
1165
- }, ref) => {
1166
- const props = {
1167
- isDisabled: disabled,
1168
- isRequired: required,
1169
- isReadOnly: readOnly,
1170
- validationState: error ? "invalid" : "valid",
1171
- ...rest
1172
- };
1173
- const showStepper = !hideStepper;
1174
- const { locale } = useLocale();
1175
- const inputRef = useObjectRef3(ref);
1176
- const state = useNumberFieldState({ ...props, locale });
1177
- const {
1178
- labelProps,
1179
- groupProps,
1180
- inputProps,
1181
- descriptionProps,
1182
- errorMessageProps,
1183
- incrementButtonProps,
1184
- decrementButtonProps
1185
- } = useNumberField(props, state, inputRef);
1186
- const { hoverProps, isHovered } = useHover3({ isDisabled: disabled });
1187
- const { focusProps, isFocused } = useFocusRing4({
1188
- within: true,
1189
- isTextInput: true,
1190
- autoFocus: props.autoFocus
1191
- });
1192
- const styles = useComponentStyles20("NumberField", { variant, size }, { parts: ["group", "stepper"] });
1193
- const stateProps = useStateProps5({
1194
- hover: isHovered,
1195
- focus: isFocused,
1291
+ var NumberField = forwardRef7(
1292
+ ({
1293
+ variant,
1294
+ size,
1295
+ width,
1196
1296
  disabled,
1197
- readOnly,
1198
- error
1199
- });
1200
- return /* @__PURE__ */ React35.createElement(FieldBase, {
1201
- label: props.label,
1202
- labelProps,
1203
1297
  required,
1204
- description: props.description,
1205
- descriptionProps,
1298
+ readOnly,
1206
1299
  error,
1207
- errorMessage: props.errorMessage,
1208
- errorMessageProps,
1209
- stateProps,
1210
- variant,
1211
- size,
1212
- width
1213
- }, /* @__PURE__ */ React35.createElement(Box18, {
1214
- "data-group": true,
1215
- __baseCSS: {
1216
- display: "flex",
1217
- alignItems: "stretch",
1218
- "> input": {
1219
- flexGrow: 1
1220
- }
1221
- },
1222
- css: styles.group,
1223
- ...mergeProps6(groupProps, focusProps, hoverProps),
1224
- ...stateProps
1225
- }, showStepper && /* @__PURE__ */ React35.createElement(StepButton, {
1226
- direction: "down",
1227
- css: styles.stepper,
1228
- ...decrementButtonProps
1229
- }), /* @__PURE__ */ React35.createElement(Input, {
1230
- ref: inputRef,
1231
- variant,
1232
- size,
1233
- ...inputProps,
1234
- ...stateProps
1235
- }), showStepper && /* @__PURE__ */ React35.createElement(StepButton, {
1236
- direction: "up",
1237
- css: styles.stepper,
1238
- ...incrementButtonProps
1239
- })));
1240
- });
1300
+ hideStepper,
1301
+ ...rest
1302
+ }, ref) => {
1303
+ const props = {
1304
+ isDisabled: disabled,
1305
+ isRequired: required,
1306
+ isReadOnly: readOnly,
1307
+ validationState: error ? "invalid" : "valid",
1308
+ ...rest
1309
+ };
1310
+ const showStepper = !hideStepper;
1311
+ const { locale } = useLocale();
1312
+ const inputRef = useObjectRef4(ref);
1313
+ const state = useNumberFieldState({ ...props, locale });
1314
+ const {
1315
+ labelProps,
1316
+ groupProps,
1317
+ inputProps,
1318
+ descriptionProps,
1319
+ errorMessageProps,
1320
+ incrementButtonProps,
1321
+ decrementButtonProps
1322
+ } = useNumberField(props, state, inputRef);
1323
+ const { hoverProps, isHovered } = useHover3({ isDisabled: disabled });
1324
+ const { focusProps, isFocused } = useFocusRing4({
1325
+ within: true,
1326
+ isTextInput: true,
1327
+ autoFocus: props.autoFocus
1328
+ });
1329
+ const styles = useComponentStyles21(
1330
+ "NumberField",
1331
+ { variant, size },
1332
+ { parts: ["group", "stepper"] }
1333
+ );
1334
+ const stateProps = useStateProps5({
1335
+ hover: isHovered,
1336
+ focus: isFocused,
1337
+ disabled,
1338
+ readOnly,
1339
+ error
1340
+ });
1341
+ return /* @__PURE__ */ React37.createElement(FieldBase, {
1342
+ label: props.label,
1343
+ labelProps,
1344
+ required,
1345
+ description: props.description,
1346
+ descriptionProps,
1347
+ error,
1348
+ errorMessage: props.errorMessage,
1349
+ errorMessageProps,
1350
+ stateProps,
1351
+ variant,
1352
+ size,
1353
+ width
1354
+ }, /* @__PURE__ */ React37.createElement(Box20, {
1355
+ "data-group": true,
1356
+ __baseCSS: {
1357
+ display: "flex",
1358
+ alignItems: "stretch",
1359
+ "> input": {
1360
+ flexGrow: 1
1361
+ }
1362
+ },
1363
+ css: styles.group,
1364
+ ...mergeProps6(groupProps, focusProps, hoverProps),
1365
+ ...stateProps
1366
+ }, showStepper && /* @__PURE__ */ React37.createElement(StepButton, {
1367
+ direction: "down",
1368
+ css: styles.stepper,
1369
+ ...decrementButtonProps
1370
+ }), /* @__PURE__ */ React37.createElement(Input, {
1371
+ ref: inputRef,
1372
+ variant,
1373
+ size,
1374
+ ...inputProps,
1375
+ ...stateProps
1376
+ }), showStepper && /* @__PURE__ */ React37.createElement(StepButton, {
1377
+ direction: "up",
1378
+ css: styles.stepper,
1379
+ ...incrementButtonProps
1380
+ })));
1381
+ }
1382
+ );
1241
1383
 
1242
1384
  // src/Provider/index.ts
1243
1385
  import { useTheme as useTheme2, ThemeProvider as ThemeProvider2 } from "@marigold/system";
1244
1386
  import { SSRProvider } from "@react-aria/ssr";
1245
1387
 
1246
1388
  // src/Provider/MarigoldProvider.tsx
1247
- import React36 from "react";
1389
+ import React38 from "react";
1248
1390
  import { OverlayProvider } from "@react-aria/overlays";
1249
1391
  import {
1250
1392
  Global,
@@ -1262,43 +1404,47 @@ function MarigoldProvider({
1262
1404
  const outer = useTheme();
1263
1405
  const isTopLevel = outer.theme === __defaultTheme;
1264
1406
  if (((_a = outer.theme) == null ? void 0 : _a.root) && !isTopLevel && !selector) {
1265
- throw new Error(`[MarigoldProvider] You cannot nest a MarigoldProvider inside another MarigoldProvider without a "selector"!
1266
- Nested themes with a "root" property must specify a "selector" to prevent accidentally overriding global CSS`);
1407
+ throw new Error(
1408
+ `[MarigoldProvider] You cannot nest a MarigoldProvider inside another MarigoldProvider without a "selector"!
1409
+ Nested themes with a "root" property must specify a "selector" to prevent accidentally overriding global CSS`
1410
+ );
1267
1411
  }
1268
- return /* @__PURE__ */ React36.createElement(ThemeProvider, {
1412
+ return /* @__PURE__ */ React38.createElement(ThemeProvider, {
1269
1413
  theme
1270
- }, /* @__PURE__ */ React36.createElement(Global, {
1414
+ }, /* @__PURE__ */ React38.createElement(Global, {
1271
1415
  normalizeDocument: isTopLevel && normalizeDocument,
1272
1416
  selector
1273
- }), isTopLevel ? /* @__PURE__ */ React36.createElement(OverlayProvider, null, children) : children);
1417
+ }), isTopLevel ? /* @__PURE__ */ React38.createElement(OverlayProvider, null, children) : children);
1274
1418
  }
1275
1419
 
1276
1420
  // src/Radio/Radio.tsx
1277
- import React38, {
1278
- forwardRef as forwardRef7
1421
+ import React40, {
1422
+ forwardRef as forwardRef8
1279
1423
  } from "react";
1280
1424
  import { useHover as useHover4 } from "@react-aria/interactions";
1281
1425
  import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
1282
1426
  import { useRadio } from "@react-aria/radio";
1283
- import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
1427
+ import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
1284
1428
  import {
1285
- Box as Box20,
1286
- useComponentStyles as useComponentStyles22,
1429
+ Box as Box22,
1430
+ useComponentStyles as useComponentStyles23,
1287
1431
  useStateProps as useStateProps6
1288
1432
  } from "@marigold/system";
1289
1433
 
1290
1434
  // src/Radio/Context.ts
1291
- import { createContext as createContext4, useContext as useContext4 } from "react";
1292
- var RadioGroupContext = createContext4(null);
1293
- var useRadioGroupContext = () => useContext4(RadioGroupContext);
1435
+ import { createContext as createContext5, useContext as useContext5 } from "react";
1436
+ var RadioGroupContext = createContext5(
1437
+ null
1438
+ );
1439
+ var useRadioGroupContext = () => useContext5(RadioGroupContext);
1294
1440
 
1295
1441
  // src/Radio/RadioGroup.tsx
1296
- import React37 from "react";
1442
+ import React39 from "react";
1297
1443
  import { useRadioGroup } from "@react-aria/radio";
1298
1444
  import { useRadioGroupState } from "@react-stately/radio";
1299
1445
  import {
1300
- Box as Box19,
1301
- useComponentStyles as useComponentStyles21
1446
+ Box as Box21,
1447
+ useComponentStyles as useComponentStyles22
1302
1448
  } from "@marigold/system";
1303
1449
  var RadioGroup = ({
1304
1450
  children,
@@ -1321,15 +1467,19 @@ var RadioGroup = ({
1321
1467
  };
1322
1468
  const state = useRadioGroupState(props);
1323
1469
  const { radioGroupProps, labelProps } = useRadioGroup(props, state);
1324
- const styles = useComponentStyles21("RadioGroup", { variant, size }, { parts: ["container", "group"] });
1325
- return /* @__PURE__ */ React37.createElement(Box19, {
1470
+ const styles = useComponentStyles22(
1471
+ "RadioGroup",
1472
+ { variant, size },
1473
+ { parts: ["container", "group"] }
1474
+ );
1475
+ return /* @__PURE__ */ React39.createElement(Box21, {
1326
1476
  ...radioGroupProps,
1327
1477
  css: styles.container
1328
- }, props.label && /* @__PURE__ */ React37.createElement(Label, {
1478
+ }, props.label && /* @__PURE__ */ React39.createElement(Label, {
1329
1479
  as: "span",
1330
1480
  required,
1331
1481
  ...labelProps
1332
- }, props.label), /* @__PURE__ */ React37.createElement(Box19, {
1482
+ }, props.label), /* @__PURE__ */ React39.createElement(Box21, {
1333
1483
  role: "presentation",
1334
1484
  "data-orientation": orientation,
1335
1485
  __baseCSS: {
@@ -1339,21 +1489,21 @@ var RadioGroup = ({
1339
1489
  gap: orientation === "vertical" ? "0.5ch" : "1.5ch"
1340
1490
  },
1341
1491
  css: styles.group
1342
- }, /* @__PURE__ */ React37.createElement(RadioGroupContext.Provider, {
1492
+ }, /* @__PURE__ */ React39.createElement(RadioGroupContext.Provider, {
1343
1493
  value: { variant, size, width, error, ...state }
1344
1494
  }, children)));
1345
1495
  };
1346
1496
 
1347
1497
  // src/Radio/Radio.tsx
1348
- var Dot = () => /* @__PURE__ */ React38.createElement("svg", {
1498
+ var Dot = () => /* @__PURE__ */ React40.createElement("svg", {
1349
1499
  viewBox: "0 0 6 6"
1350
- }, /* @__PURE__ */ React38.createElement("circle", {
1500
+ }, /* @__PURE__ */ React40.createElement("circle", {
1351
1501
  fill: "currentColor",
1352
1502
  cx: "3",
1353
1503
  cy: "3",
1354
1504
  r: "3"
1355
1505
  }));
1356
- var Icon2 = ({ checked, css, ...props }) => /* @__PURE__ */ React38.createElement(Box20, {
1506
+ var Icon2 = ({ checked, css, ...props }) => /* @__PURE__ */ React40.createElement(Box22, {
1357
1507
  "aria-hidden": "true",
1358
1508
  __baseCSS: {
1359
1509
  width: 16,
@@ -1368,70 +1518,80 @@ var Icon2 = ({ checked, css, ...props }) => /* @__PURE__ */ React38.createElemen
1368
1518
  },
1369
1519
  css,
1370
1520
  ...props
1371
- }, checked ? /* @__PURE__ */ React38.createElement(Dot, null) : null);
1372
- var Radio = forwardRef7(({ width, disabled, ...props }, ref) => {
1373
- const {
1374
- variant,
1375
- size,
1376
- error,
1377
- width: groupWidth,
1378
- ...state
1379
- } = useRadioGroupContext();
1380
- const inputRef = useObjectRef4(ref);
1381
- const { inputProps } = useRadio({ isDisabled: disabled, ...props }, state, inputRef);
1382
- const styles = useComponentStyles22("Radio", { variant: variant || props.variant, size: size || props.size }, { parts: ["container", "label", "radio"] });
1383
- const { hoverProps, isHovered } = useHover4({});
1384
- const { isFocusVisible, focusProps } = useFocusRing5();
1385
- const stateProps = useStateProps6({
1386
- hover: isHovered,
1387
- focus: isFocusVisible,
1388
- checked: inputProps.checked,
1389
- disabled: inputProps.disabled,
1390
- readOnly: props.readOnly,
1391
- error
1392
- });
1393
- return /* @__PURE__ */ React38.createElement(Box20, {
1394
- as: "label",
1395
- __baseCSS: {
1396
- display: "flex",
1397
- alignItems: "center",
1398
- gap: "1ch",
1399
- position: "relative",
1400
- width: width || groupWidth || "100%"
1401
- },
1402
- css: styles.container,
1403
- ...hoverProps,
1404
- ...stateProps
1405
- }, /* @__PURE__ */ React38.createElement(Box20, {
1406
- as: "input",
1407
- ref: inputRef,
1408
- css: {
1409
- position: "absolute",
1410
- width: "100%",
1411
- height: "100%",
1412
- top: 0,
1413
- left: 0,
1414
- zIndex: 1,
1415
- opacity: 1e-4,
1416
- cursor: inputProps.disabled ? "not-allowed" : "pointer"
1417
- },
1418
- ...inputProps,
1419
- ...focusProps
1420
- }), /* @__PURE__ */ React38.createElement(Icon2, {
1421
- checked: inputProps.checked,
1422
- css: styles.radio,
1423
- ...stateProps
1424
- }), /* @__PURE__ */ React38.createElement(Box20, {
1425
- css: styles.label,
1426
- ...stateProps
1427
- }, props.children));
1428
- });
1521
+ }, checked ? /* @__PURE__ */ React40.createElement(Dot, null) : null);
1522
+ var Radio = forwardRef8(
1523
+ ({ width, disabled, ...props }, ref) => {
1524
+ const {
1525
+ variant,
1526
+ size,
1527
+ error,
1528
+ width: groupWidth,
1529
+ ...state
1530
+ } = useRadioGroupContext();
1531
+ const inputRef = useObjectRef5(ref);
1532
+ const { inputProps } = useRadio(
1533
+ { isDisabled: disabled, ...props },
1534
+ state,
1535
+ inputRef
1536
+ );
1537
+ const styles = useComponentStyles23(
1538
+ "Radio",
1539
+ { variant: variant || props.variant, size: size || props.size },
1540
+ { parts: ["container", "label", "radio"] }
1541
+ );
1542
+ const { hoverProps, isHovered } = useHover4({});
1543
+ const { isFocusVisible, focusProps } = useFocusRing5();
1544
+ const stateProps = useStateProps6({
1545
+ hover: isHovered,
1546
+ focus: isFocusVisible,
1547
+ checked: inputProps.checked,
1548
+ disabled: inputProps.disabled,
1549
+ readOnly: props.readOnly,
1550
+ error
1551
+ });
1552
+ return /* @__PURE__ */ React40.createElement(Box22, {
1553
+ as: "label",
1554
+ __baseCSS: {
1555
+ display: "flex",
1556
+ alignItems: "center",
1557
+ gap: "1ch",
1558
+ position: "relative",
1559
+ width: width || groupWidth || "100%"
1560
+ },
1561
+ css: styles.container,
1562
+ ...hoverProps,
1563
+ ...stateProps
1564
+ }, /* @__PURE__ */ React40.createElement(Box22, {
1565
+ as: "input",
1566
+ ref: inputRef,
1567
+ css: {
1568
+ position: "absolute",
1569
+ width: "100%",
1570
+ height: "100%",
1571
+ top: 0,
1572
+ left: 0,
1573
+ zIndex: 1,
1574
+ opacity: 1e-4,
1575
+ cursor: inputProps.disabled ? "not-allowed" : "pointer"
1576
+ },
1577
+ ...inputProps,
1578
+ ...focusProps
1579
+ }), /* @__PURE__ */ React40.createElement(Icon2, {
1580
+ checked: inputProps.checked,
1581
+ css: styles.radio,
1582
+ ...stateProps
1583
+ }), /* @__PURE__ */ React40.createElement(Box22, {
1584
+ css: styles.label,
1585
+ ...stateProps
1586
+ }, props.children));
1587
+ }
1588
+ );
1429
1589
  Radio.Group = RadioGroup;
1430
1590
 
1431
1591
  // src/Select/Select.tsx
1432
- import React42, {
1433
- forwardRef as forwardRef9,
1434
- useRef as useRef11
1592
+ import React44, {
1593
+ forwardRef as forwardRef10,
1594
+ useRef as useRef10
1435
1595
  } from "react";
1436
1596
  import { useButton as useButton4 } from "@react-aria/button";
1437
1597
  import { FocusScope as FocusScope3, useFocusRing as useFocusRing6 } from "@react-aria/focus";
@@ -1440,48 +1600,52 @@ import { DismissButton as DismissButton2, useOverlayPosition as useOverlayPositi
1440
1600
  import { HiddenSelect, useSelect } from "@react-aria/select";
1441
1601
  import { useSelectState } from "@react-stately/select";
1442
1602
  import { Item as Item2, Section } from "@react-stately/collections";
1443
- import { mergeProps as mergeProps7, useObjectRef as useObjectRef6 } from "@react-aria/utils";
1603
+ import { mergeProps as mergeProps7, useObjectRef as useObjectRef7 } from "@react-aria/utils";
1444
1604
  import {
1445
- Box as Box24,
1446
- useComponentStyles as useComponentStyles24,
1605
+ Box as Box26,
1606
+ useComponentStyles as useComponentStyles25,
1447
1607
  useStateProps as useStateProps8
1448
1608
  } from "@marigold/system";
1449
1609
 
1450
1610
  // src/ListBox/ListBox.tsx
1451
- import React41, { forwardRef as forwardRef8 } from "react";
1452
- import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
1611
+ import React43, { forwardRef as forwardRef9 } from "react";
1612
+ import { useObjectRef as useObjectRef6 } from "@react-aria/utils";
1453
1613
  import {
1454
- Box as Box23,
1455
- useComponentStyles as useComponentStyles23
1614
+ Box as Box25,
1615
+ useComponentStyles as useComponentStyles24
1456
1616
  } from "@marigold/system";
1457
1617
  import { useListBox } from "@react-aria/listbox";
1458
1618
 
1459
1619
  // src/ListBox/Context.ts
1460
- import { createContext as createContext5, useContext as useContext5 } from "react";
1461
- var ListBoxContext = createContext5({});
1462
- var useListBoxContext = () => useContext5(ListBoxContext);
1620
+ import { createContext as createContext6, useContext as useContext6 } from "react";
1621
+ var ListBoxContext = createContext6({});
1622
+ var useListBoxContext = () => useContext6(ListBoxContext);
1463
1623
 
1464
1624
  // src/ListBox/ListBoxSection.tsx
1465
- import React40 from "react";
1625
+ import React42 from "react";
1466
1626
  import { useListBoxSection } from "@react-aria/listbox";
1467
- import { Box as Box22 } from "@marigold/system";
1627
+ import { Box as Box24 } from "@marigold/system";
1468
1628
 
1469
1629
  // src/ListBox/ListBoxOption.tsx
1470
- import React39, { useRef as useRef10 } from "react";
1630
+ import React41, { useRef as useRef9 } from "react";
1471
1631
  import { useOption } from "@react-aria/listbox";
1472
- import { Box as Box21, useStateProps as useStateProps7 } from "@marigold/system";
1632
+ import { Box as Box23, useStateProps as useStateProps7 } from "@marigold/system";
1473
1633
  var ListBoxOption = ({ item, state }) => {
1474
- const ref = useRef10(null);
1475
- const { optionProps, isSelected, isDisabled, isFocused } = useOption({
1476
- key: item.key
1477
- }, state, ref);
1634
+ const ref = useRef9(null);
1635
+ const { optionProps, isSelected, isDisabled, isFocused } = useOption(
1636
+ {
1637
+ key: item.key
1638
+ },
1639
+ state,
1640
+ ref
1641
+ );
1478
1642
  const { styles } = useListBoxContext();
1479
1643
  const stateProps = useStateProps7({
1480
1644
  selected: isSelected,
1481
1645
  disabled: isDisabled,
1482
1646
  focusVisible: isFocused
1483
1647
  });
1484
- return /* @__PURE__ */ React39.createElement(Box21, {
1648
+ return /* @__PURE__ */ React41.createElement(Box23, {
1485
1649
  as: "li",
1486
1650
  ref,
1487
1651
  css: styles.option,
@@ -1497,19 +1661,19 @@ var ListBoxSection = ({ section, state }) => {
1497
1661
  "aria-label": section["aria-label"]
1498
1662
  });
1499
1663
  const { styles } = useListBoxContext();
1500
- return /* @__PURE__ */ React40.createElement(Box22, {
1664
+ return /* @__PURE__ */ React42.createElement(Box24, {
1501
1665
  as: "li",
1502
1666
  css: styles.section,
1503
1667
  ...itemProps
1504
- }, section.rendered && /* @__PURE__ */ React40.createElement(Box22, {
1668
+ }, section.rendered && /* @__PURE__ */ React42.createElement(Box24, {
1505
1669
  css: styles.sectionTitle,
1506
1670
  ...headingProps
1507
- }, section.rendered), /* @__PURE__ */ React40.createElement(Box22, {
1671
+ }, section.rendered), /* @__PURE__ */ React42.createElement(Box24, {
1508
1672
  as: "ul",
1509
1673
  __baseCSS: { listStyle: "none", p: 0 },
1510
1674
  css: styles.list,
1511
1675
  ...groupProps
1512
- }, [...section.childNodes].map((node) => /* @__PURE__ */ React40.createElement(ListBoxOption, {
1676
+ }, [...section.childNodes].map((node) => /* @__PURE__ */ React42.createElement(ListBoxOption, {
1513
1677
  key: node.key,
1514
1678
  item: node,
1515
1679
  state
@@ -1517,30 +1681,38 @@ var ListBoxSection = ({ section, state }) => {
1517
1681
  };
1518
1682
 
1519
1683
  // src/ListBox/ListBox.tsx
1520
- var ListBox = forwardRef8(({ state, variant, size, ...props }, ref) => {
1521
- const innerRef = useObjectRef5(ref);
1522
- const { listBoxProps } = useListBox(props, state, innerRef);
1523
- const styles = useComponentStyles23("ListBox", { variant, size }, { parts: ["container", "list", "option", "section", "sectionTitle"] });
1524
- return /* @__PURE__ */ React41.createElement(ListBoxContext.Provider, {
1525
- value: { styles }
1526
- }, /* @__PURE__ */ React41.createElement(Box23, {
1527
- css: styles.container
1528
- }, /* @__PURE__ */ React41.createElement(Box23, {
1529
- as: "ul",
1530
- ref: innerRef,
1531
- __baseCSS: { listStyle: "none", p: 0 },
1532
- css: styles.list,
1533
- ...listBoxProps
1534
- }, [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */ React41.createElement(ListBoxSection, {
1535
- key: item.key,
1536
- section: item,
1537
- state
1538
- }) : /* @__PURE__ */ React41.createElement(ListBoxOption, {
1539
- key: item.key,
1540
- item,
1541
- state
1542
- })))));
1543
- });
1684
+ var ListBox = forwardRef9(
1685
+ ({ state, variant, size, ...props }, ref) => {
1686
+ const innerRef = useObjectRef6(ref);
1687
+ const { listBoxProps } = useListBox(props, state, innerRef);
1688
+ const styles = useComponentStyles24(
1689
+ "ListBox",
1690
+ { variant, size },
1691
+ { parts: ["container", "list", "option", "section", "sectionTitle"] }
1692
+ );
1693
+ return /* @__PURE__ */ React43.createElement(ListBoxContext.Provider, {
1694
+ value: { styles }
1695
+ }, /* @__PURE__ */ React43.createElement(Box25, {
1696
+ css: styles.container
1697
+ }, /* @__PURE__ */ React43.createElement(Box25, {
1698
+ as: "ul",
1699
+ ref: innerRef,
1700
+ __baseCSS: { listStyle: "none", p: 0 },
1701
+ css: styles.list,
1702
+ ...listBoxProps
1703
+ }, [...state.collection].map(
1704
+ (item) => item.type === "section" ? /* @__PURE__ */ React43.createElement(ListBoxSection, {
1705
+ key: item.key,
1706
+ section: item,
1707
+ state
1708
+ }) : /* @__PURE__ */ React43.createElement(ListBoxOption, {
1709
+ key: item.key,
1710
+ item,
1711
+ state
1712
+ })
1713
+ ))));
1714
+ }
1715
+ );
1544
1716
 
1545
1717
  // src/Select/intl.ts
1546
1718
  var messages = {
@@ -1553,7 +1725,7 @@ var messages = {
1553
1725
  };
1554
1726
 
1555
1727
  // src/Select/Select.tsx
1556
- var Chevron = ({ css }) => /* @__PURE__ */ React42.createElement(Box24, {
1728
+ var Chevron = ({ css }) => /* @__PURE__ */ React44.createElement(Box26, {
1557
1729
  as: "svg",
1558
1730
  __baseCSS: { width: 16, height: 16 },
1559
1731
  css,
@@ -1561,122 +1733,131 @@ var Chevron = ({ css }) => /* @__PURE__ */ React42.createElement(Box24, {
1561
1733
  viewBox: "0 0 24 24",
1562
1734
  stroke: "currentColor",
1563
1735
  strokeWidth: 2
1564
- }, /* @__PURE__ */ React42.createElement("path", {
1736
+ }, /* @__PURE__ */ React44.createElement("path", {
1565
1737
  strokeLinecap: "round",
1566
1738
  strokeLinejoin: "round",
1567
1739
  d: "M19 9l-7 7-7-7"
1568
1740
  }));
1569
- var Select = forwardRef9(({ variant, size, width, open, disabled, required, error, ...rest }, ref) => {
1570
- const formatMessage = useMessageFormatter(messages);
1571
- const buttonRef = useObjectRef6(ref);
1572
- const props = {
1573
- isOpen: open,
1574
- isDisabled: disabled,
1575
- isRequired: required,
1576
- validationState: error ? "invalid" : "valid",
1577
- placeholder: rest.placeholder || formatMessage("placeholder"),
1578
- ...rest
1579
- };
1580
- const state = useSelectState(props);
1581
- const {
1582
- labelProps,
1583
- triggerProps,
1584
- valueProps,
1585
- menuProps,
1586
- descriptionProps,
1587
- errorMessageProps
1588
- } = useSelect(props, state, buttonRef);
1589
- const { buttonProps } = useButton4({ isDisabled: disabled, ...triggerProps }, buttonRef);
1590
- const { focusProps, isFocusVisible } = useFocusRing6();
1591
- const overlayRef = useRef11(null);
1592
- const { overlayProps: positionProps } = useOverlayPosition2({
1593
- targetRef: buttonRef,
1594
- overlayRef,
1595
- isOpen: state.isOpen,
1596
- placement: "bottom left"
1597
- });
1598
- const styles = useComponentStyles24("Select", { variant, size }, { parts: ["container", "button", "icon"] });
1599
- const stateProps = useStateProps8({
1600
- disabled,
1601
- error,
1602
- focusVisible: isFocusVisible,
1603
- expanded: state.isOpen
1604
- });
1605
- return /* @__PURE__ */ React42.createElement(FieldBase, {
1606
- variant,
1607
- size,
1608
- width,
1609
- label: props.label,
1610
- labelProps: { as: "span", ...labelProps },
1611
- description: props.description,
1612
- descriptionProps,
1613
- error,
1614
- errorMessage: props.errorMessage,
1615
- errorMessageProps,
1616
- stateProps,
1617
- disabled,
1618
- required
1619
- }, /* @__PURE__ */ React42.createElement(HiddenSelect, {
1620
- state,
1621
- triggerRef: buttonRef,
1622
- label: props.label,
1623
- name: props.name,
1624
- isDisabled: disabled
1625
- }), /* @__PURE__ */ React42.createElement(Box24, {
1626
- as: "button",
1627
- __baseCSS: {
1628
- display: "flex",
1629
- position: "relative",
1630
- alignItems: "center",
1631
- justifyContent: "space-between",
1632
- width: "100%"
1633
- },
1634
- css: styles.button,
1635
- ref: buttonRef,
1636
- ...mergeProps7(buttonProps, focusProps),
1637
- ...stateProps
1638
- }, /* @__PURE__ */ React42.createElement(Box24, {
1639
- css: {
1640
- overflow: "hidden",
1641
- whiteSpace: "nowrap"
1642
- },
1643
- ...valueProps
1644
- }, state.selectedItem ? state.selectedItem.rendered : props.placeholder), /* @__PURE__ */ React42.createElement(Chevron, {
1645
- css: styles.icon
1646
- })), /* @__PURE__ */ React42.createElement(Popover, {
1647
- open: state.isOpen,
1648
- onClose: state.close,
1649
- dismissable: true,
1650
- shouldCloseOnBlur: true,
1651
- minWidth: buttonRef.current ? buttonRef.current.offsetWidth : void 0,
1652
- ref: overlayRef,
1653
- ...positionProps
1654
- }, /* @__PURE__ */ React42.createElement(FocusScope3, {
1655
- restoreFocus: true
1656
- }, /* @__PURE__ */ React42.createElement(DismissButton2, {
1657
- onDismiss: state.close
1658
- }), /* @__PURE__ */ React42.createElement(ListBox, {
1659
- state,
1660
- variant,
1661
- size,
1662
- ...menuProps
1663
- }), /* @__PURE__ */ React42.createElement(DismissButton2, {
1664
- onDismiss: state.close
1665
- }))));
1666
- });
1741
+ var Select = forwardRef10(
1742
+ ({ variant, size, width, open, disabled, required, error, ...rest }, ref) => {
1743
+ const formatMessage = useMessageFormatter(messages);
1744
+ const buttonRef = useObjectRef7(ref);
1745
+ const props = {
1746
+ isOpen: open,
1747
+ isDisabled: disabled,
1748
+ isRequired: required,
1749
+ validationState: error ? "invalid" : "valid",
1750
+ placeholder: rest.placeholder || formatMessage("placeholder"),
1751
+ ...rest
1752
+ };
1753
+ const state = useSelectState(props);
1754
+ const {
1755
+ labelProps,
1756
+ triggerProps,
1757
+ valueProps,
1758
+ menuProps,
1759
+ descriptionProps,
1760
+ errorMessageProps
1761
+ } = useSelect(props, state, buttonRef);
1762
+ const { buttonProps } = useButton4(
1763
+ { isDisabled: disabled, ...triggerProps },
1764
+ buttonRef
1765
+ );
1766
+ const { focusProps, isFocusVisible } = useFocusRing6();
1767
+ const overlayRef = useRef10(null);
1768
+ const { overlayProps: positionProps } = useOverlayPosition2({
1769
+ targetRef: buttonRef,
1770
+ overlayRef,
1771
+ isOpen: state.isOpen,
1772
+ placement: "bottom left"
1773
+ });
1774
+ const styles = useComponentStyles25(
1775
+ "Select",
1776
+ { variant, size },
1777
+ { parts: ["container", "button", "icon"] }
1778
+ );
1779
+ const stateProps = useStateProps8({
1780
+ disabled,
1781
+ error,
1782
+ focusVisible: isFocusVisible,
1783
+ expanded: state.isOpen
1784
+ });
1785
+ return /* @__PURE__ */ React44.createElement(FieldBase, {
1786
+ variant,
1787
+ size,
1788
+ width,
1789
+ label: props.label,
1790
+ labelProps: { as: "span", ...labelProps },
1791
+ description: props.description,
1792
+ descriptionProps,
1793
+ error,
1794
+ errorMessage: props.errorMessage,
1795
+ errorMessageProps,
1796
+ stateProps,
1797
+ disabled,
1798
+ required
1799
+ }, /* @__PURE__ */ React44.createElement(HiddenSelect, {
1800
+ state,
1801
+ triggerRef: buttonRef,
1802
+ label: props.label,
1803
+ name: props.name,
1804
+ isDisabled: disabled
1805
+ }), /* @__PURE__ */ React44.createElement(Box26, {
1806
+ as: "button",
1807
+ __baseCSS: {
1808
+ display: "flex",
1809
+ position: "relative",
1810
+ alignItems: "center",
1811
+ justifyContent: "space-between",
1812
+ width: "100%"
1813
+ },
1814
+ css: styles.button,
1815
+ ref: buttonRef,
1816
+ ...mergeProps7(buttonProps, focusProps),
1817
+ ...stateProps
1818
+ }, /* @__PURE__ */ React44.createElement(Box26, {
1819
+ css: {
1820
+ overflow: "hidden",
1821
+ whiteSpace: "nowrap"
1822
+ },
1823
+ ...valueProps
1824
+ }, state.selectedItem ? state.selectedItem.rendered : props.placeholder), /* @__PURE__ */ React44.createElement(Chevron, {
1825
+ css: styles.icon
1826
+ })), /* @__PURE__ */ React44.createElement(Popover, {
1827
+ open: state.isOpen,
1828
+ onClose: state.close,
1829
+ dismissable: true,
1830
+ shouldCloseOnBlur: true,
1831
+ minWidth: buttonRef.current ? buttonRef.current.offsetWidth : void 0,
1832
+ ref: overlayRef,
1833
+ ...positionProps
1834
+ }, /* @__PURE__ */ React44.createElement(FocusScope3, {
1835
+ restoreFocus: true
1836
+ }, /* @__PURE__ */ React44.createElement(DismissButton2, {
1837
+ onDismiss: state.close
1838
+ }), /* @__PURE__ */ React44.createElement(ListBox, {
1839
+ state,
1840
+ variant,
1841
+ size,
1842
+ ...menuProps
1843
+ }), /* @__PURE__ */ React44.createElement(DismissButton2, {
1844
+ onDismiss: state.close
1845
+ }))));
1846
+ }
1847
+ );
1667
1848
  Select.Option = Item2;
1668
1849
  Select.Section = Section;
1669
1850
 
1670
1851
  // src/Slider/Slider.tsx
1671
- import React44, { forwardRef as forwardRef10 } from "react";
1852
+ import React46, { forwardRef as forwardRef11 } from "react";
1672
1853
  import { useSlider } from "@react-aria/slider";
1673
1854
  import { useSliderState } from "@react-stately/slider";
1674
1855
  import { useNumberFormatter } from "@react-aria/i18n";
1675
- import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
1676
- import { useComponentStyles as useComponentStyles25 } from "@marigold/system";
1856
+ import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
1857
+ import { useComponentStyles as useComponentStyles26 } from "@marigold/system";
1677
1858
 
1678
1859
  // src/Slider/Thumb.tsx
1679
- import React43, { useEffect } from "react";
1860
+ import React45, { useEffect } from "react";
1680
1861
  import { useSliderThumb } from "@react-aria/slider";
1681
1862
  import { mergeProps as mergeProps8 } from "@react-aria/utils";
1682
1863
  import { useStateProps as useStateProps9 } from "@marigold/system";
@@ -1688,34 +1869,37 @@ import { VisuallyHidden } from "@react-aria/visually-hidden";
1688
1869
  import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
1689
1870
  var Thumb = ({ state, trackRef, styles, ...props }) => {
1690
1871
  const { disabled } = props;
1691
- const inputRef = React43.useRef(null);
1872
+ const inputRef = React45.useRef(null);
1692
1873
  const { isFocusVisible, focusProps, isFocused } = useFocusRing7();
1693
1874
  const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
1694
1875
  const stateProps = useStateProps9({
1695
1876
  focus: focused,
1696
1877
  disabled
1697
1878
  });
1698
- const { thumbProps, inputProps } = useSliderThumb({
1699
- index: 0,
1700
- trackRef,
1701
- inputRef,
1702
- isDisabled: disabled
1703
- }, state);
1879
+ const { thumbProps, inputProps } = useSliderThumb(
1880
+ {
1881
+ index: 0,
1882
+ trackRef,
1883
+ inputRef,
1884
+ isDisabled: disabled
1885
+ },
1886
+ state
1887
+ );
1704
1888
  useEffect(() => {
1705
1889
  state.setThumbEditable(0, !disabled);
1706
1890
  }, [disabled, state]);
1707
- return /* @__PURE__ */ React43.createElement(Box, {
1891
+ return /* @__PURE__ */ React45.createElement(Box, {
1708
1892
  __baseCSS: {
1709
1893
  position: "absolute",
1710
1894
  top: 16,
1711
1895
  transform: "translateX(-50%)",
1712
1896
  left: `${state.getThumbPercent(0) * 100}%`
1713
1897
  }
1714
- }, /* @__PURE__ */ React43.createElement(Box, {
1898
+ }, /* @__PURE__ */ React45.createElement(Box, {
1715
1899
  ...thumbProps,
1716
1900
  __baseCSS: styles,
1717
1901
  ...stateProps
1718
- }, /* @__PURE__ */ React43.createElement(VisuallyHidden, null, /* @__PURE__ */ React43.createElement(Box, {
1902
+ }, /* @__PURE__ */ React45.createElement(VisuallyHidden, null, /* @__PURE__ */ React45.createElement(Box, {
1719
1903
  as: "input",
1720
1904
  type: "range",
1721
1905
  ref: inputRef,
@@ -1724,65 +1908,75 @@ var Thumb = ({ state, trackRef, styles, ...props }) => {
1724
1908
  };
1725
1909
 
1726
1910
  // src/Slider/Slider.tsx
1727
- var Slider = forwardRef10(({ variant, size, width = "100%", ...props }, ref) => {
1728
- const { formatOptions } = props;
1729
- const trackRef = useObjectRef7(ref);
1730
- const numberFormatter = useNumberFormatter(formatOptions);
1731
- const state = useSliderState({ ...props, numberFormatter });
1732
- const { groupProps, trackProps, labelProps, outputProps } = useSlider({
1733
- label: props.children,
1734
- ...props
1735
- }, state, trackRef);
1736
- const styles = useComponentStyles25("Slider", { variant, size }, { parts: ["track", "thumb", "label", "output"] });
1737
- return /* @__PURE__ */ React44.createElement(Box, {
1738
- __baseCSS: {
1739
- display: "flex",
1740
- flexDirection: "column",
1741
- touchAction: "none",
1742
- width
1743
- },
1744
- ...groupProps
1745
- }, /* @__PURE__ */ React44.createElement(Box, {
1746
- __baseCSS: { display: "flex", alignSelf: "stretch" }
1747
- }, props.children && /* @__PURE__ */ React44.createElement(Box, {
1748
- as: "label",
1749
- __baseCSS: styles.label,
1750
- ...labelProps
1751
- }, props.children), /* @__PURE__ */ React44.createElement(Box, {
1752
- as: "output",
1753
- ...outputProps,
1754
- __baseCSS: { flex: "1 0 auto", textAlign: "end" },
1755
- css: styles.output
1756
- }, state.getThumbValueLabel(0))), /* @__PURE__ */ React44.createElement(Box, {
1757
- ...trackProps,
1758
- ref: trackRef,
1759
- __baseCSS: {
1760
- position: "relative",
1761
- height: 32,
1762
- width: "100%",
1763
- cursor: props.disabled ? "not-allowed" : "pointer"
1764
- }
1765
- }, /* @__PURE__ */ React44.createElement(Box, {
1766
- __baseCSS: styles.track
1767
- }), /* @__PURE__ */ React44.createElement(Thumb, {
1768
- state,
1769
- trackRef,
1770
- disabled: props.disabled,
1771
- styles: styles.thumb
1772
- })));
1773
- });
1911
+ var Slider = forwardRef11(
1912
+ ({ variant, size, width = "100%", ...props }, ref) => {
1913
+ const { formatOptions } = props;
1914
+ const trackRef = useObjectRef8(ref);
1915
+ const numberFormatter = useNumberFormatter(formatOptions);
1916
+ const state = useSliderState({ ...props, numberFormatter });
1917
+ const { groupProps, trackProps, labelProps, outputProps } = useSlider(
1918
+ {
1919
+ label: props.children,
1920
+ ...props
1921
+ },
1922
+ state,
1923
+ trackRef
1924
+ );
1925
+ const styles = useComponentStyles26(
1926
+ "Slider",
1927
+ { variant, size },
1928
+ { parts: ["track", "thumb", "label", "output"] }
1929
+ );
1930
+ return /* @__PURE__ */ React46.createElement(Box, {
1931
+ __baseCSS: {
1932
+ display: "flex",
1933
+ flexDirection: "column",
1934
+ touchAction: "none",
1935
+ width
1936
+ },
1937
+ ...groupProps
1938
+ }, /* @__PURE__ */ React46.createElement(Box, {
1939
+ __baseCSS: { display: "flex", alignSelf: "stretch" }
1940
+ }, props.children && /* @__PURE__ */ React46.createElement(Box, {
1941
+ as: "label",
1942
+ __baseCSS: styles.label,
1943
+ ...labelProps
1944
+ }, props.children), /* @__PURE__ */ React46.createElement(Box, {
1945
+ as: "output",
1946
+ ...outputProps,
1947
+ __baseCSS: { flex: "1 0 auto", textAlign: "end" },
1948
+ css: styles.output
1949
+ }, state.getThumbValueLabel(0))), /* @__PURE__ */ React46.createElement(Box, {
1950
+ ...trackProps,
1951
+ ref: trackRef,
1952
+ __baseCSS: {
1953
+ position: "relative",
1954
+ height: 32,
1955
+ width: "100%",
1956
+ cursor: props.disabled ? "not-allowed" : "pointer"
1957
+ }
1958
+ }, /* @__PURE__ */ React46.createElement(Box, {
1959
+ __baseCSS: styles.track
1960
+ }), /* @__PURE__ */ React46.createElement(Thumb, {
1961
+ state,
1962
+ trackRef,
1963
+ disabled: props.disabled,
1964
+ styles: styles.thumb
1965
+ })));
1966
+ }
1967
+ );
1774
1968
 
1775
1969
  // src/Split/Split.tsx
1776
- import React45 from "react";
1777
- import { Box as Box25 } from "@marigold/system";
1778
- var Split = (props) => /* @__PURE__ */ React45.createElement(Box25, {
1970
+ import React47 from "react";
1971
+ import { Box as Box27 } from "@marigold/system";
1972
+ var Split = (props) => /* @__PURE__ */ React47.createElement(Box27, {
1779
1973
  ...props,
1780
1974
  role: "separator",
1781
1975
  css: { flexGrow: 1 }
1782
1976
  });
1783
1977
 
1784
1978
  // src/Stack/Stack.tsx
1785
- import React46 from "react";
1979
+ import React48 from "react";
1786
1980
  var ALIGNMENT_X2 = {
1787
1981
  left: "flex-start",
1788
1982
  center: "center",
@@ -1800,7 +1994,7 @@ var Stack = ({
1800
1994
  alignY = "top",
1801
1995
  stretch = false,
1802
1996
  ...props
1803
- }) => /* @__PURE__ */ React46.createElement(Box, {
1997
+ }) => /* @__PURE__ */ React48.createElement(Box, {
1804
1998
  css: {
1805
1999
  display: "flex",
1806
2000
  flexDirection: "column",
@@ -1814,105 +2008,111 @@ var Stack = ({
1814
2008
  }, children);
1815
2009
 
1816
2010
  // src/Switch/Switch.tsx
1817
- import React47, { forwardRef as forwardRef11 } from "react";
2011
+ import React49, { forwardRef as forwardRef12 } from "react";
1818
2012
  import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
1819
2013
  import { useSwitch } from "@react-aria/switch";
1820
- import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
2014
+ import { useObjectRef as useObjectRef9 } from "@react-aria/utils";
1821
2015
  import { useToggleState as useToggleState2 } from "@react-stately/toggle";
1822
2016
  import {
1823
- useComponentStyles as useComponentStyles26,
2017
+ useComponentStyles as useComponentStyles27,
1824
2018
  useStateProps as useStateProps10
1825
2019
  } from "@marigold/system";
1826
- var Switch = forwardRef11(({
1827
- variant,
1828
- size,
1829
- width = "100%",
1830
- checked,
1831
- disabled,
1832
- readOnly,
1833
- defaultChecked,
1834
- ...rest
1835
- }, ref) => {
1836
- const inputRef = useObjectRef8(ref);
1837
- const props = {
1838
- isSelected: checked,
1839
- isDisabled: disabled,
1840
- isReadOnly: readOnly,
1841
- defaultSelected: defaultChecked,
1842
- ...rest
1843
- };
1844
- const state = useToggleState2(props);
1845
- const { inputProps } = useSwitch(props, state, inputRef);
1846
- const { isFocusVisible, focusProps } = useFocusRing8();
1847
- const stateProps = useStateProps10({
1848
- checked: state.isSelected,
2020
+ var Switch = forwardRef12(
2021
+ ({
2022
+ variant,
2023
+ size,
2024
+ width = "100%",
2025
+ checked,
1849
2026
  disabled,
1850
2027
  readOnly,
1851
- focus: isFocusVisible
1852
- });
1853
- const styles = useComponentStyles26("Switch", { variant, size }, { parts: ["container", "label", "track", "thumb"] });
1854
- return /* @__PURE__ */ React47.createElement(Box, {
1855
- as: "label",
1856
- __baseCSS: {
1857
- display: "flex",
1858
- alignItems: "center",
1859
- justifyContent: "space-between",
1860
- gap: "1ch",
1861
- position: "relative",
1862
- width
1863
- },
1864
- css: styles.container
1865
- }, /* @__PURE__ */ React47.createElement(Box, {
1866
- as: "input",
1867
- ref: inputRef,
1868
- css: {
1869
- position: "absolute",
1870
- width: "100%",
1871
- height: "100%",
1872
- top: 0,
1873
- left: 0,
1874
- zIndex: 1,
1875
- opacity: 1e-4,
1876
- cursor: inputProps.disabled ? "not-allowed" : "pointer"
1877
- },
1878
- ...inputProps,
1879
- ...focusProps
1880
- }), props.children && /* @__PURE__ */ React47.createElement(Box, {
1881
- css: styles.label
1882
- }, props.children), /* @__PURE__ */ React47.createElement(Box, {
1883
- __baseCSS: {
1884
- position: "relative",
1885
- width: 48,
1886
- height: 24,
1887
- bg: "#dee2e6",
1888
- borderRadius: 20
1889
- },
1890
- css: styles.track,
1891
- ...stateProps
1892
- }, /* @__PURE__ */ React47.createElement(Box, {
1893
- __baseCSS: {
1894
- display: "block",
1895
- position: "absolute",
1896
- top: 1,
1897
- left: 0,
1898
- willChange: "transform",
1899
- transform: "translateX(1px)",
1900
- transition: "all 0.1s cubic-bezier(.7, 0, .3, 1)",
1901
- height: 22,
1902
- width: 22,
1903
- borderRadius: 9999,
1904
- bg: "#fff",
1905
- "&:checked": {
1906
- transform: "translateX(calc(47px - 100%))"
1907
- }
1908
- },
1909
- css: styles.thumb,
1910
- ...stateProps
1911
- })));
1912
- });
2028
+ defaultChecked,
2029
+ ...rest
2030
+ }, ref) => {
2031
+ const inputRef = useObjectRef9(ref);
2032
+ const props = {
2033
+ isSelected: checked,
2034
+ isDisabled: disabled,
2035
+ isReadOnly: readOnly,
2036
+ defaultSelected: defaultChecked,
2037
+ ...rest
2038
+ };
2039
+ const state = useToggleState2(props);
2040
+ const { inputProps } = useSwitch(props, state, inputRef);
2041
+ const { isFocusVisible, focusProps } = useFocusRing8();
2042
+ const stateProps = useStateProps10({
2043
+ checked: state.isSelected,
2044
+ disabled,
2045
+ readOnly,
2046
+ focus: isFocusVisible
2047
+ });
2048
+ const styles = useComponentStyles27(
2049
+ "Switch",
2050
+ { variant, size },
2051
+ { parts: ["container", "label", "track", "thumb"] }
2052
+ );
2053
+ return /* @__PURE__ */ React49.createElement(Box, {
2054
+ as: "label",
2055
+ __baseCSS: {
2056
+ display: "flex",
2057
+ alignItems: "center",
2058
+ justifyContent: "space-between",
2059
+ gap: "1ch",
2060
+ position: "relative",
2061
+ width
2062
+ },
2063
+ css: styles.container
2064
+ }, /* @__PURE__ */ React49.createElement(Box, {
2065
+ as: "input",
2066
+ ref: inputRef,
2067
+ css: {
2068
+ position: "absolute",
2069
+ width: "100%",
2070
+ height: "100%",
2071
+ top: 0,
2072
+ left: 0,
2073
+ zIndex: 1,
2074
+ opacity: 1e-4,
2075
+ cursor: inputProps.disabled ? "not-allowed" : "pointer"
2076
+ },
2077
+ ...inputProps,
2078
+ ...focusProps
2079
+ }), props.children && /* @__PURE__ */ React49.createElement(Box, {
2080
+ css: styles.label
2081
+ }, props.children), /* @__PURE__ */ React49.createElement(Box, {
2082
+ __baseCSS: {
2083
+ position: "relative",
2084
+ width: 48,
2085
+ height: 24,
2086
+ bg: "#dee2e6",
2087
+ borderRadius: 20
2088
+ },
2089
+ css: styles.track,
2090
+ ...stateProps
2091
+ }, /* @__PURE__ */ React49.createElement(Box, {
2092
+ __baseCSS: {
2093
+ display: "block",
2094
+ position: "absolute",
2095
+ top: 1,
2096
+ left: 0,
2097
+ willChange: "transform",
2098
+ transform: "translateX(1px)",
2099
+ transition: "all 0.1s cubic-bezier(.7, 0, .3, 1)",
2100
+ height: 22,
2101
+ width: 22,
2102
+ borderRadius: 9999,
2103
+ bg: "#fff",
2104
+ "&:checked": {
2105
+ transform: "translateX(calc(47px - 100%))"
2106
+ }
2107
+ },
2108
+ css: styles.thumb,
2109
+ ...stateProps
2110
+ })));
2111
+ }
2112
+ );
1913
2113
 
1914
2114
  // src/Table/Table.tsx
1915
- import React56, { useRef as useRef18 } from "react";
2115
+ import React58, { useRef as useRef17 } from "react";
1916
2116
  import { useTable } from "@react-aria/table";
1917
2117
  import {
1918
2118
  Cell,
@@ -1923,41 +2123,45 @@ import {
1923
2123
  useTableState
1924
2124
  } from "@react-stately/table";
1925
2125
  import {
1926
- Box as Box31,
1927
- useComponentStyles as useComponentStyles27
2126
+ Box as Box33,
2127
+ useComponentStyles as useComponentStyles28
1928
2128
  } from "@marigold/system";
1929
2129
 
1930
2130
  // src/Table/Context.tsx
1931
- import { createContext as createContext6, useContext as useContext6 } from "react";
1932
- var TableContext = createContext6({});
1933
- var useTableContext = () => useContext6(TableContext);
2131
+ import { createContext as createContext7, useContext as useContext7 } from "react";
2132
+ var TableContext = createContext7({});
2133
+ var useTableContext = () => useContext7(TableContext);
1934
2134
 
1935
2135
  // src/Table/TableBody.tsx
1936
- import React48 from "react";
2136
+ import React50 from "react";
1937
2137
  import { useTableRowGroup } from "@react-aria/table";
1938
2138
  var TableBody = ({ children }) => {
1939
2139
  const { rowGroupProps } = useTableRowGroup();
1940
- return /* @__PURE__ */ React48.createElement("tbody", {
2140
+ return /* @__PURE__ */ React50.createElement("tbody", {
1941
2141
  ...rowGroupProps
1942
2142
  }, children);
1943
2143
  };
1944
2144
 
1945
2145
  // src/Table/TableCell.tsx
1946
- import React49, { useRef as useRef12 } from "react";
2146
+ import React51, { useRef as useRef11 } from "react";
1947
2147
  import { useTableCell } from "@react-aria/table";
1948
2148
  import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
1949
2149
  import { mergeProps as mergeProps9 } from "@react-aria/utils";
1950
- import { Box as Box26, useStateProps as useStateProps11 } from "@marigold/system";
2150
+ import { Box as Box28, useStateProps as useStateProps11 } from "@marigold/system";
1951
2151
  var TableCell = ({ cell }) => {
1952
- const ref = useRef12(null);
2152
+ const ref = useRef11(null);
1953
2153
  const { state, styles } = useTableContext();
1954
2154
  const disabled = state.disabledKeys.has(cell.parentKey);
1955
- const { gridCellProps } = useTableCell({
1956
- node: cell
1957
- }, state, ref);
2155
+ const { gridCellProps } = useTableCell(
2156
+ {
2157
+ node: cell
2158
+ },
2159
+ state,
2160
+ ref
2161
+ );
1958
2162
  const { focusProps, isFocusVisible } = useFocusRing9();
1959
2163
  const stateProps = useStateProps11({ disabled, focusVisible: isFocusVisible });
1960
- return /* @__PURE__ */ React49.createElement(Box26, {
2164
+ return /* @__PURE__ */ React51.createElement(Box28, {
1961
2165
  as: "td",
1962
2166
  ref,
1963
2167
  css: styles.cell,
@@ -1967,11 +2171,11 @@ var TableCell = ({ cell }) => {
1967
2171
  };
1968
2172
 
1969
2173
  // src/Table/TableCheckboxCell.tsx
1970
- import React50, { useRef as useRef13 } from "react";
2174
+ import React52, { useRef as useRef12 } from "react";
1971
2175
  import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
1972
2176
  import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
1973
2177
  import { mergeProps as mergeProps10 } from "@react-aria/utils";
1974
- import { Box as Box27, useStateProps as useStateProps12 } from "@marigold/system";
2178
+ import { Box as Box29, useStateProps as useStateProps12 } from "@marigold/system";
1975
2179
 
1976
2180
  // src/Table/utils.ts
1977
2181
  var mapCheckboxProps = ({
@@ -1995,16 +2199,22 @@ var mapCheckboxProps = ({
1995
2199
 
1996
2200
  // src/Table/TableCheckboxCell.tsx
1997
2201
  var TableCheckboxCell = ({ cell }) => {
1998
- const ref = useRef13(null);
2202
+ const ref = useRef12(null);
1999
2203
  const { state, styles } = useTableContext();
2000
2204
  const disabled = state.disabledKeys.has(cell.parentKey);
2001
- const { gridCellProps } = useTableCell2({
2002
- node: cell
2003
- }, state, ref);
2004
- const { checkboxProps } = mapCheckboxProps(useTableSelectionCheckbox({ key: cell.parentKey }, state));
2205
+ const { gridCellProps } = useTableCell2(
2206
+ {
2207
+ node: cell
2208
+ },
2209
+ state,
2210
+ ref
2211
+ );
2212
+ const { checkboxProps } = mapCheckboxProps(
2213
+ useTableSelectionCheckbox({ key: cell.parentKey }, state)
2214
+ );
2005
2215
  const { focusProps, isFocusVisible } = useFocusRing10();
2006
2216
  const stateProps = useStateProps12({ disabled, focusVisible: isFocusVisible });
2007
- return /* @__PURE__ */ React50.createElement(Box27, {
2217
+ return /* @__PURE__ */ React52.createElement(Box29, {
2008
2218
  as: "td",
2009
2219
  ref,
2010
2220
  __baseCSS: {
@@ -2015,22 +2225,22 @@ var TableCheckboxCell = ({ cell }) => {
2015
2225
  css: styles.cell,
2016
2226
  ...mergeProps10(gridCellProps, focusProps),
2017
2227
  ...stateProps
2018
- }, /* @__PURE__ */ React50.createElement(Checkbox, {
2228
+ }, /* @__PURE__ */ React52.createElement(Checkbox, {
2019
2229
  ...checkboxProps
2020
2230
  }));
2021
2231
  };
2022
2232
 
2023
2233
  // src/Table/TableColumnHeader.tsx
2024
- import React51, { useRef as useRef14 } from "react";
2234
+ import React53, { useRef as useRef13 } from "react";
2025
2235
  import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
2026
2236
  import { useHover as useHover5 } from "@react-aria/interactions";
2027
2237
  import { useTableColumnHeader } from "@react-aria/table";
2028
2238
  import { mergeProps as mergeProps11 } from "@react-aria/utils";
2029
- import { Box as Box28, useStateProps as useStateProps13 } from "@marigold/system";
2239
+ import { Box as Box30, useStateProps as useStateProps13 } from "@marigold/system";
2030
2240
  var SortIndicator = ({
2031
2241
  direction = "ascending",
2032
2242
  visible
2033
- }) => /* @__PURE__ */ React51.createElement(Box28, {
2243
+ }) => /* @__PURE__ */ React53.createElement(Box30, {
2034
2244
  as: "span",
2035
2245
  role: "presentation",
2036
2246
  "aria-hidden": "true",
@@ -2042,66 +2252,74 @@ var SortIndicator = ({
2042
2252
  }, direction === "ascending" ? "\u25B2" : "\u25BC");
2043
2253
  var TableColumnHeader = ({ column }) => {
2044
2254
  var _a, _b;
2045
- const ref = useRef14(null);
2255
+ const ref = useRef13(null);
2046
2256
  const { state, styles } = useTableContext();
2047
- const { columnHeaderProps } = useTableColumnHeader({
2048
- node: column
2049
- }, state, ref);
2257
+ const { columnHeaderProps } = useTableColumnHeader(
2258
+ {
2259
+ node: column
2260
+ },
2261
+ state,
2262
+ ref
2263
+ );
2050
2264
  const { hoverProps, isHovered } = useHover5({});
2051
2265
  const { focusProps, isFocusVisible } = useFocusRing11();
2052
2266
  const stateProps = useStateProps13({
2053
2267
  hover: isHovered,
2054
2268
  focusVisible: isFocusVisible
2055
2269
  });
2056
- return /* @__PURE__ */ React51.createElement(Box28, {
2270
+ return /* @__PURE__ */ React53.createElement(Box30, {
2057
2271
  as: "th",
2058
2272
  colSpan: column.colspan,
2059
2273
  ref,
2060
2274
  css: styles.header,
2061
2275
  ...mergeProps11(columnHeaderProps, hoverProps, focusProps),
2062
2276
  ...stateProps
2063
- }, column.rendered, column.props.allowsSorting && /* @__PURE__ */ React51.createElement(SortIndicator, {
2277
+ }, column.rendered, column.props.allowsSorting && /* @__PURE__ */ React53.createElement(SortIndicator, {
2064
2278
  direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
2065
2279
  visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
2066
2280
  }));
2067
2281
  };
2068
2282
 
2069
2283
  // src/Table/TableHeader.tsx
2070
- import React52 from "react";
2284
+ import React54 from "react";
2071
2285
  import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
2072
2286
  var TableHeader = ({ children }) => {
2073
2287
  const { rowGroupProps } = useTableRowGroup2();
2074
- return /* @__PURE__ */ React52.createElement("thead", {
2288
+ return /* @__PURE__ */ React54.createElement("thead", {
2075
2289
  ...rowGroupProps
2076
2290
  }, children);
2077
2291
  };
2078
2292
 
2079
2293
  // src/Table/TableHeaderRow.tsx
2080
- import React53, { useRef as useRef15 } from "react";
2294
+ import React55, { useRef as useRef14 } from "react";
2081
2295
  import { useTableHeaderRow } from "@react-aria/table";
2082
2296
  var TableHeaderRow = ({ item, children }) => {
2083
2297
  const { state } = useTableContext();
2084
- const ref = useRef15(null);
2298
+ const ref = useRef14(null);
2085
2299
  const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
2086
- return /* @__PURE__ */ React53.createElement("tr", {
2300
+ return /* @__PURE__ */ React55.createElement("tr", {
2087
2301
  ...rowProps,
2088
2302
  ref
2089
2303
  }, children);
2090
2304
  };
2091
2305
 
2092
2306
  // src/Table/TableRow.tsx
2093
- import React54, { useRef as useRef16 } from "react";
2307
+ import React56, { useRef as useRef15 } from "react";
2094
2308
  import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
2095
2309
  import { useHover as useHover6 } from "@react-aria/interactions";
2096
2310
  import { useTableRow } from "@react-aria/table";
2097
2311
  import { mergeProps as mergeProps12 } from "@react-aria/utils";
2098
- import { Box as Box29, useStateProps as useStateProps14 } from "@marigold/system";
2312
+ import { Box as Box31, useStateProps as useStateProps14 } from "@marigold/system";
2099
2313
  var TableRow = ({ children, row }) => {
2100
- const ref = useRef16(null);
2314
+ const ref = useRef15(null);
2101
2315
  const { state, styles } = useTableContext();
2102
- const { rowProps, isPressed } = useTableRow({
2103
- node: row
2104
- }, state, ref);
2316
+ const { rowProps, isPressed } = useTableRow(
2317
+ {
2318
+ node: row
2319
+ },
2320
+ state,
2321
+ ref
2322
+ );
2105
2323
  const disabled = state.disabledKeys.has(row.key);
2106
2324
  const selected = state.selectionManager.isSelected(row.key);
2107
2325
  const { focusProps, isFocusVisible } = useFocusRing12({ within: true });
@@ -2113,7 +2331,7 @@ var TableRow = ({ children, row }) => {
2113
2331
  focusVisible: isFocusVisible,
2114
2332
  active: isPressed
2115
2333
  });
2116
- return /* @__PURE__ */ React54.createElement(Box29, {
2334
+ return /* @__PURE__ */ React56.createElement(Box31, {
2117
2335
  as: "tr",
2118
2336
  ref,
2119
2337
  css: styles.row,
@@ -2123,7 +2341,7 @@ var TableRow = ({ children, row }) => {
2123
2341
  };
2124
2342
 
2125
2343
  // src/Table/TableSelectAllCell.tsx
2126
- import React55, { useRef as useRef17 } from "react";
2344
+ import React57, { useRef as useRef16 } from "react";
2127
2345
  import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
2128
2346
  import { useHover as useHover7 } from "@react-aria/interactions";
2129
2347
  import {
@@ -2131,13 +2349,17 @@ import {
2131
2349
  useTableSelectAllCheckbox
2132
2350
  } from "@react-aria/table";
2133
2351
  import { mergeProps as mergeProps13 } from "@react-aria/utils";
2134
- import { Box as Box30, useStateProps as useStateProps15 } from "@marigold/system";
2352
+ import { Box as Box32, useStateProps as useStateProps15 } from "@marigold/system";
2135
2353
  var TableSelectAllCell = ({ column }) => {
2136
- const ref = useRef17(null);
2354
+ const ref = useRef16(null);
2137
2355
  const { state, styles } = useTableContext();
2138
- const { columnHeaderProps } = useTableColumnHeader2({
2139
- node: column
2140
- }, state, ref);
2356
+ const { columnHeaderProps } = useTableColumnHeader2(
2357
+ {
2358
+ node: column
2359
+ },
2360
+ state,
2361
+ ref
2362
+ );
2141
2363
  const { checkboxProps } = mapCheckboxProps(useTableSelectAllCheckbox(state));
2142
2364
  const { hoverProps, isHovered } = useHover7({});
2143
2365
  const { focusProps, isFocusVisible } = useFocusRing13();
@@ -2145,7 +2367,7 @@ var TableSelectAllCell = ({ column }) => {
2145
2367
  hover: isHovered,
2146
2368
  focusVisible: isFocusVisible
2147
2369
  });
2148
- return /* @__PURE__ */ React55.createElement(Box30, {
2370
+ return /* @__PURE__ */ React57.createElement(Box32, {
2149
2371
  as: "th",
2150
2372
  ref,
2151
2373
  __baseCSS: {
@@ -2156,7 +2378,7 @@ var TableSelectAllCell = ({ column }) => {
2156
2378
  css: styles.header,
2157
2379
  ...mergeProps13(columnHeaderProps, hoverProps, focusProps),
2158
2380
  ...stateProps
2159
- }, /* @__PURE__ */ React55.createElement(Checkbox, {
2381
+ }, /* @__PURE__ */ React57.createElement(Checkbox, {
2160
2382
  ...checkboxProps
2161
2383
  }));
2162
2384
  };
@@ -2168,17 +2390,21 @@ var Table = ({
2168
2390
  stretch,
2169
2391
  ...props
2170
2392
  }) => {
2171
- const tableRef = useRef18(null);
2393
+ const tableRef = useRef17(null);
2172
2394
  const state = useTableState({
2173
2395
  ...props,
2174
2396
  showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
2175
2397
  });
2176
2398
  const { gridProps } = useTable(props, state, tableRef);
2177
- const styles = useComponentStyles27("Table", { variant, size }, { parts: ["table", "header", "row", "cell"] });
2399
+ const styles = useComponentStyles28(
2400
+ "Table",
2401
+ { variant, size },
2402
+ { parts: ["table", "header", "row", "cell"] }
2403
+ );
2178
2404
  const { collection } = state;
2179
- return /* @__PURE__ */ React56.createElement(TableContext.Provider, {
2405
+ return /* @__PURE__ */ React58.createElement(TableContext.Provider, {
2180
2406
  value: { state, styles }
2181
- }, /* @__PURE__ */ React56.createElement(Box31, {
2407
+ }, /* @__PURE__ */ React58.createElement(Box33, {
2182
2408
  as: "table",
2183
2409
  ref: tableRef,
2184
2410
  __baseCSS: {
@@ -2187,31 +2413,35 @@ var Table = ({
2187
2413
  },
2188
2414
  css: styles.table,
2189
2415
  ...gridProps
2190
- }, /* @__PURE__ */ React56.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React56.createElement(TableHeaderRow, {
2416
+ }, /* @__PURE__ */ React58.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React58.createElement(TableHeaderRow, {
2191
2417
  key: headerRow.key,
2192
2418
  item: headerRow
2193
- }, [...headerRow.childNodes].map((column) => {
2194
- var _a;
2195
- return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableSelectAllCell, {
2196
- key: column.key,
2197
- column
2198
- }) : /* @__PURE__ */ React56.createElement(TableColumnHeader, {
2199
- key: column.key,
2200
- column
2201
- });
2202
- })))), /* @__PURE__ */ React56.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ React56.createElement(TableRow, {
2419
+ }, [...headerRow.childNodes].map(
2420
+ (column) => {
2421
+ var _a;
2422
+ return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React58.createElement(TableSelectAllCell, {
2423
+ key: column.key,
2424
+ column
2425
+ }) : /* @__PURE__ */ React58.createElement(TableColumnHeader, {
2426
+ key: column.key,
2427
+ column
2428
+ });
2429
+ }
2430
+ )))), /* @__PURE__ */ React58.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ React58.createElement(TableRow, {
2203
2431
  key: row.key,
2204
2432
  row
2205
- }, [...row.childNodes].map((cell) => {
2206
- var _a;
2207
- return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableCheckboxCell, {
2208
- key: cell.key,
2209
- cell
2210
- }) : /* @__PURE__ */ React56.createElement(TableCell, {
2211
- key: cell.key,
2212
- cell
2213
- });
2214
- }))))));
2433
+ }, [...row.childNodes].map(
2434
+ (cell) => {
2435
+ var _a;
2436
+ return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React58.createElement(TableCheckboxCell, {
2437
+ key: cell.key,
2438
+ cell
2439
+ }) : /* @__PURE__ */ React58.createElement(TableCell, {
2440
+ key: cell.key,
2441
+ cell
2442
+ });
2443
+ }
2444
+ ))))));
2215
2445
  };
2216
2446
  Table.Body = Body;
2217
2447
  Table.Cell = Cell;
@@ -2220,11 +2450,11 @@ Table.Header = Header2;
2220
2450
  Table.Row = Row;
2221
2451
 
2222
2452
  // src/Text/Text.tsx
2223
- import React57 from "react";
2453
+ import React59 from "react";
2224
2454
  import {
2225
- useComponentStyles as useComponentStyles28
2455
+ useComponentStyles as useComponentStyles29
2226
2456
  } from "@marigold/system";
2227
- import { Box as Box32 } from "@marigold/system";
2457
+ import { Box as Box34 } from "@marigold/system";
2228
2458
  var Text = ({
2229
2459
  variant,
2230
2460
  size,
@@ -2236,11 +2466,11 @@ var Text = ({
2236
2466
  children,
2237
2467
  ...props
2238
2468
  }) => {
2239
- const styles = useComponentStyles28("Text", {
2469
+ const styles = useComponentStyles29("Text", {
2240
2470
  variant,
2241
2471
  size
2242
2472
  });
2243
- return /* @__PURE__ */ React57.createElement(Box32, {
2473
+ return /* @__PURE__ */ React59.createElement(Box34, {
2244
2474
  as: "p",
2245
2475
  ...props,
2246
2476
  css: { color, cursor, outline, fontSize, textAlign: align, ...styles }
@@ -2248,152 +2478,164 @@ var Text = ({
2248
2478
  };
2249
2479
 
2250
2480
  // src/TextArea/TextArea.tsx
2251
- import React58, { forwardRef as forwardRef12 } from "react";
2481
+ import React60, { forwardRef as forwardRef13 } from "react";
2252
2482
  import { useHover as useHover8 } from "@react-aria/interactions";
2253
2483
  import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
2254
2484
  import { useTextField } from "@react-aria/textfield";
2255
- import { useObjectRef as useObjectRef9 } from "@react-aria/utils";
2485
+ import { useObjectRef as useObjectRef10 } from "@react-aria/utils";
2256
2486
  import {
2257
- Box as Box33,
2258
- useComponentStyles as useComponentStyles29,
2487
+ Box as Box35,
2488
+ useComponentStyles as useComponentStyles30,
2259
2489
  useStateProps as useStateProps16
2260
2490
  } from "@marigold/system";
2261
- var TextArea = forwardRef12(({
2262
- variant,
2263
- size,
2264
- width,
2265
- disabled,
2266
- required,
2267
- readOnly,
2268
- error,
2269
- rows,
2270
- ...props
2271
- }, ref) => {
2272
- const { label, description, errorMessage } = props;
2273
- const textAreaRef = useObjectRef9(ref);
2274
- const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField({
2275
- inputElementType: "textarea",
2276
- isDisabled: disabled,
2277
- isRequired: required,
2278
- isReadOnly: readOnly,
2279
- validationState: error ? "invalid" : "valid",
2280
- ...props
2281
- }, textAreaRef);
2282
- const { hoverProps, isHovered } = useHover8({});
2283
- const { focusProps, isFocusVisible } = useFocusRing14();
2284
- const stateProps = useStateProps16({
2285
- hover: isHovered,
2286
- focus: isFocusVisible,
2491
+ var TextArea = forwardRef13(
2492
+ ({
2493
+ variant,
2494
+ size,
2495
+ width,
2287
2496
  disabled,
2288
- readOnly,
2289
- error
2290
- });
2291
- const styles = useComponentStyles29("TextArea", { variant, size });
2292
- return /* @__PURE__ */ React58.createElement(FieldBase, {
2293
- label,
2294
- labelProps,
2295
2497
  required,
2296
- description,
2297
- descriptionProps,
2498
+ readOnly,
2298
2499
  error,
2299
- errorMessage,
2300
- errorMessageProps,
2301
- stateProps,
2302
- variant,
2303
- size,
2304
- width
2305
- }, /* @__PURE__ */ React58.createElement(Box33, {
2306
- as: "textarea",
2307
- css: styles,
2308
- ref: textAreaRef,
2309
2500
  rows,
2310
- ...inputProps,
2311
- ...focusProps,
2312
- ...hoverProps,
2313
- ...stateProps
2314
- }));
2315
- });
2501
+ ...props
2502
+ }, ref) => {
2503
+ const { label, description, errorMessage } = props;
2504
+ const textAreaRef = useObjectRef10(ref);
2505
+ const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(
2506
+ {
2507
+ inputElementType: "textarea",
2508
+ isDisabled: disabled,
2509
+ isRequired: required,
2510
+ isReadOnly: readOnly,
2511
+ validationState: error ? "invalid" : "valid",
2512
+ ...props
2513
+ },
2514
+ textAreaRef
2515
+ );
2516
+ const { hoverProps, isHovered } = useHover8({});
2517
+ const { focusProps, isFocusVisible } = useFocusRing14();
2518
+ const stateProps = useStateProps16({
2519
+ hover: isHovered,
2520
+ focus: isFocusVisible,
2521
+ disabled,
2522
+ readOnly,
2523
+ error
2524
+ });
2525
+ const styles = useComponentStyles30("TextArea", { variant, size });
2526
+ return /* @__PURE__ */ React60.createElement(FieldBase, {
2527
+ label,
2528
+ labelProps,
2529
+ required,
2530
+ description,
2531
+ descriptionProps,
2532
+ error,
2533
+ errorMessage,
2534
+ errorMessageProps,
2535
+ stateProps,
2536
+ variant,
2537
+ size,
2538
+ width
2539
+ }, /* @__PURE__ */ React60.createElement(Box35, {
2540
+ as: "textarea",
2541
+ css: styles,
2542
+ ref: textAreaRef,
2543
+ rows,
2544
+ ...inputProps,
2545
+ ...focusProps,
2546
+ ...hoverProps,
2547
+ ...stateProps
2548
+ }));
2549
+ }
2550
+ );
2316
2551
 
2317
2552
  // src/TextField/TextField.tsx
2318
- import React59, { forwardRef as forwardRef13 } from "react";
2553
+ import React61, { forwardRef as forwardRef14 } from "react";
2319
2554
  import { useHover as useHover9 } from "@react-aria/interactions";
2320
2555
  import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
2321
2556
  import { useTextField as useTextField2 } from "@react-aria/textfield";
2322
- import { useObjectRef as useObjectRef10 } from "@react-aria/utils";
2557
+ import { useObjectRef as useObjectRef11 } from "@react-aria/utils";
2323
2558
  import { useStateProps as useStateProps17 } from "@marigold/system";
2324
- var TextField = forwardRef13(({ variant, size, width, disabled, required, readOnly, error, ...props }, ref) => {
2325
- const { label, description, errorMessage, autoFocus } = props;
2326
- const inputRef = useObjectRef10(ref);
2327
- const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2({
2328
- isDisabled: disabled,
2329
- isRequired: required,
2330
- isReadOnly: readOnly,
2331
- validationState: error ? "invalid" : "valid",
2332
- ...props
2333
- }, inputRef);
2334
- const { hoverProps, isHovered } = useHover9({});
2335
- const { focusProps, isFocusVisible } = useFocusRing15({
2336
- isTextInput: true,
2337
- autoFocus
2338
- });
2339
- const stateProps = useStateProps17({
2340
- hover: isHovered,
2341
- focus: isFocusVisible,
2342
- disabled,
2343
- readOnly,
2344
- error
2345
- });
2346
- return /* @__PURE__ */ React59.createElement(FieldBase, {
2347
- label,
2348
- labelProps,
2349
- required,
2350
- description,
2351
- descriptionProps,
2352
- error,
2353
- errorMessage,
2354
- errorMessageProps,
2355
- stateProps,
2356
- variant,
2357
- size,
2358
- width
2359
- }, /* @__PURE__ */ React59.createElement(Input, {
2360
- ref: inputRef,
2361
- variant,
2362
- size,
2363
- ...inputProps,
2364
- ...focusProps,
2365
- ...hoverProps,
2366
- ...stateProps
2367
- }));
2368
- });
2559
+ var TextField = forwardRef14(
2560
+ ({ variant, size, width, disabled, required, readOnly, error, ...props }, ref) => {
2561
+ const { label, description, errorMessage, autoFocus } = props;
2562
+ const inputRef = useObjectRef11(ref);
2563
+ const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(
2564
+ {
2565
+ isDisabled: disabled,
2566
+ isRequired: required,
2567
+ isReadOnly: readOnly,
2568
+ validationState: error ? "invalid" : "valid",
2569
+ ...props
2570
+ },
2571
+ inputRef
2572
+ );
2573
+ const { hoverProps, isHovered } = useHover9({});
2574
+ const { focusProps, isFocusVisible } = useFocusRing15({
2575
+ isTextInput: true,
2576
+ autoFocus
2577
+ });
2578
+ const stateProps = useStateProps17({
2579
+ hover: isHovered,
2580
+ focus: isFocusVisible,
2581
+ disabled,
2582
+ readOnly,
2583
+ error
2584
+ });
2585
+ return /* @__PURE__ */ React61.createElement(FieldBase, {
2586
+ label,
2587
+ labelProps,
2588
+ required,
2589
+ description,
2590
+ descriptionProps,
2591
+ error,
2592
+ errorMessage,
2593
+ errorMessageProps,
2594
+ stateProps,
2595
+ variant,
2596
+ size,
2597
+ width
2598
+ }, /* @__PURE__ */ React61.createElement(Input, {
2599
+ ref: inputRef,
2600
+ variant,
2601
+ size,
2602
+ ...inputProps,
2603
+ ...focusProps,
2604
+ ...hoverProps,
2605
+ ...stateProps
2606
+ }));
2607
+ }
2608
+ );
2369
2609
 
2370
2610
  // src/Tiles/Tiles.tsx
2371
- import React60 from "react";
2372
- var Tiles = React60.forwardRef(({ space = "none", itemMinWidth = "250px", children, ...props }, ref) => /* @__PURE__ */ React60.createElement(Box, {
2373
- ref,
2374
- display: "grid",
2375
- __baseCSS: {
2376
- gap: space,
2377
- gridTemplateColumns: `repeat(auto-fit, minmax(min(${itemMinWidth}, 100%), 1fr))`
2378
- },
2379
- ...props
2380
- }, children));
2611
+ import React62 from "react";
2612
+ var Tiles = React62.forwardRef(
2613
+ ({ space = "none", itemMinWidth = "250px", children, ...props }, ref) => /* @__PURE__ */ React62.createElement(Box, {
2614
+ ref,
2615
+ display: "grid",
2616
+ __baseCSS: {
2617
+ gap: space,
2618
+ gridTemplateColumns: `repeat(auto-fit, minmax(min(${itemMinWidth}, 100%), 1fr))`
2619
+ },
2620
+ ...props
2621
+ }, children)
2622
+ );
2381
2623
 
2382
2624
  // src/Tooltip/Tooltip.tsx
2383
- import React62 from "react";
2625
+ import React64 from "react";
2384
2626
  import { useTooltip } from "@react-aria/tooltip";
2385
2627
  import {
2386
- Box as Box34,
2387
- useComponentStyles as useComponentStyles30
2628
+ Box as Box36,
2629
+ useComponentStyles as useComponentStyles31
2388
2630
  } from "@marigold/system";
2389
2631
 
2390
2632
  // src/Tooltip/Context.ts
2391
- import { createContext as createContext7, useContext as useContext7 } from "react";
2392
- var TooltipContext = createContext7({});
2393
- var useTooltipContext = () => useContext7(TooltipContext);
2633
+ import { createContext as createContext8, useContext as useContext8 } from "react";
2634
+ var TooltipContext = createContext8({});
2635
+ var useTooltipContext = () => useContext8(TooltipContext);
2394
2636
 
2395
2637
  // src/Tooltip/TooltipTrigger.tsx
2396
- import React61, { useRef as useRef19 } from "react";
2638
+ import React63, { useRef as useRef18 } from "react";
2397
2639
  import { FocusableProvider } from "@react-aria/focus";
2398
2640
  import { useOverlayPosition as useOverlayPosition3 } from "@react-aria/overlays";
2399
2641
  import { useTooltipTrigger } from "@react-aria/tooltip";
@@ -2406,7 +2648,7 @@ var TooltipTrigger = ({
2406
2648
  children,
2407
2649
  ...rest
2408
2650
  }) => {
2409
- const [tooltipTrigger, tooltip] = React61.Children.toArray(children);
2651
+ const [tooltipTrigger, tooltip] = React63.Children.toArray(children);
2410
2652
  const props = {
2411
2653
  ...rest,
2412
2654
  isDisabled: disabled,
@@ -2414,10 +2656,14 @@ var TooltipTrigger = ({
2414
2656
  delay,
2415
2657
  placement
2416
2658
  };
2417
- const tooltipTriggerRef = useRef19(null);
2418
- const overlayRef = useRef19(null);
2659
+ const tooltipTriggerRef = useRef18(null);
2660
+ const overlayRef = useRef18(null);
2419
2661
  const state = useTooltipTriggerState(props);
2420
- const { triggerProps, tooltipProps } = useTooltipTrigger(props, state, tooltipTriggerRef);
2662
+ const { triggerProps, tooltipProps } = useTooltipTrigger(
2663
+ props,
2664
+ state,
2665
+ tooltipTriggerRef
2666
+ );
2421
2667
  const {
2422
2668
  overlayProps: positionProps,
2423
2669
  placement: overlayPlacement,
@@ -2430,10 +2676,10 @@ var TooltipTrigger = ({
2430
2676
  isOpen: state.isOpen,
2431
2677
  overlayRef
2432
2678
  });
2433
- return /* @__PURE__ */ React61.createElement(FocusableProvider, {
2679
+ return /* @__PURE__ */ React63.createElement(FocusableProvider, {
2434
2680
  ref: tooltipTriggerRef,
2435
2681
  ...triggerProps
2436
- }, tooltipTrigger, /* @__PURE__ */ React61.createElement(TooltipContext.Provider, {
2682
+ }, tooltipTrigger, /* @__PURE__ */ React63.createElement(TooltipContext.Provider, {
2437
2683
  value: {
2438
2684
  state,
2439
2685
  overlayRef,
@@ -2442,7 +2688,7 @@ var TooltipTrigger = ({
2442
2688
  ...tooltipProps,
2443
2689
  ...positionProps
2444
2690
  }
2445
- }, /* @__PURE__ */ React61.createElement(Overlay, {
2691
+ }, /* @__PURE__ */ React63.createElement(Overlay, {
2446
2692
  open: state.isOpen
2447
2693
  }, tooltip)));
2448
2694
  };
@@ -2451,14 +2697,18 @@ var TooltipTrigger = ({
2451
2697
  var Tooltip = ({ children, variant, size }) => {
2452
2698
  const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
2453
2699
  const { tooltipProps } = useTooltip({}, state);
2454
- const styles = useComponentStyles30("Tooltip", { variant, size }, { parts: ["container", "arrow"] });
2455
- return /* @__PURE__ */ React62.createElement(Box34, {
2700
+ const styles = useComponentStyles31(
2701
+ "Tooltip",
2702
+ { variant, size },
2703
+ { parts: ["container", "arrow"] }
2704
+ );
2705
+ return /* @__PURE__ */ React64.createElement(Box36, {
2456
2706
  ...tooltipProps,
2457
2707
  ...rest,
2458
2708
  ref: overlayRef,
2459
2709
  css: styles.container,
2460
2710
  "data-placement": placement
2461
- }, /* @__PURE__ */ React62.createElement("div", null, children), /* @__PURE__ */ React62.createElement(Box34, {
2711
+ }, /* @__PURE__ */ React64.createElement("div", null, children), /* @__PURE__ */ React64.createElement(Box36, {
2462
2712
  ...arrowProps,
2463
2713
  __baseCSS: {
2464
2714
  position: "absolute",
@@ -2498,6 +2748,7 @@ export {
2498
2748
  Input,
2499
2749
  Label,
2500
2750
  Link,
2751
+ List,
2501
2752
  MarigoldProvider,
2502
2753
  Menu,
2503
2754
  Message,