@marigold/components 6.8.0 → 6.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +69 -90
- package/dist/index.d.ts +69 -90
- package/dist/index.js +898 -1069
- package/dist/index.mjs +815 -992
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ __export(src_exports, {
|
|
|
52
52
|
Container: () => Container,
|
|
53
53
|
DateField: () => DateField,
|
|
54
54
|
DatePicker: () => DatePicker,
|
|
55
|
-
Dialog: () =>
|
|
55
|
+
Dialog: () => _Dialog,
|
|
56
56
|
Divider: () => _Divider,
|
|
57
57
|
FieldBase: () => FieldBase,
|
|
58
58
|
FieldGroup: () => FieldGroup,
|
|
@@ -70,8 +70,8 @@ __export(src_exports, {
|
|
|
70
70
|
MarigoldProvider: () => MarigoldProvider,
|
|
71
71
|
Menu: () => Menu,
|
|
72
72
|
Message: () => Message,
|
|
73
|
-
Modal: () =>
|
|
74
|
-
NumberField: () =>
|
|
73
|
+
Modal: () => _Modal,
|
|
74
|
+
NumberField: () => _NumberField,
|
|
75
75
|
Overlay: () => Overlay,
|
|
76
76
|
Popover: () => Popover,
|
|
77
77
|
Radio: () => _Radio,
|
|
@@ -85,21 +85,22 @@ __export(src_exports, {
|
|
|
85
85
|
Tabs: () => Tabs,
|
|
86
86
|
Tag: () => Tag2,
|
|
87
87
|
Text: () => Text2,
|
|
88
|
-
TextArea: () =>
|
|
89
|
-
TextField: () =>
|
|
90
|
-
ThemeProvider: () =>
|
|
88
|
+
TextArea: () => _TextArea,
|
|
89
|
+
TextField: () => _TextField,
|
|
90
|
+
ThemeProvider: () => import_system55.ThemeProvider,
|
|
91
91
|
Tiles: () => Tiles,
|
|
92
|
-
Tooltip: () =>
|
|
92
|
+
Tooltip: () => _Tooltip,
|
|
93
93
|
Tray: () => Tray,
|
|
94
94
|
TrayWrapper: () => TrayWrapper,
|
|
95
95
|
Underlay: () => Underlay,
|
|
96
96
|
VisuallyHidden: () => import_visually_hidden.VisuallyHidden,
|
|
97
97
|
XLoader: () => XLoader,
|
|
98
98
|
_Slider: () => _Slider,
|
|
99
|
+
_TextArea: () => _TextArea,
|
|
99
100
|
useAsyncList: () => import_data.useAsyncList,
|
|
100
101
|
useFieldGroupContext: () => useFieldGroupContext,
|
|
101
102
|
useListData: () => import_data.useListData,
|
|
102
|
-
useTheme: () =>
|
|
103
|
+
useTheme: () => import_system55.useTheme
|
|
103
104
|
});
|
|
104
105
|
module.exports = __toCommonJS(src_exports);
|
|
105
106
|
|
|
@@ -698,62 +699,78 @@ var ListBox = (0, import_react10.forwardRef)(
|
|
|
698
699
|
|
|
699
700
|
// src/Overlay/Modal.tsx
|
|
700
701
|
var import_react11 = require("react");
|
|
701
|
-
var
|
|
702
|
-
var
|
|
703
|
-
var import_utils7 = require("@react-aria/utils");
|
|
702
|
+
var import_react_aria_components3 = require("react-aria-components");
|
|
703
|
+
var import_system13 = require("@marigold/system");
|
|
704
704
|
|
|
705
705
|
// src/Overlay/Underlay.tsx
|
|
706
|
+
var import_react_aria_components2 = require("react-aria-components");
|
|
706
707
|
var import_system12 = require("@marigold/system");
|
|
707
708
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
708
|
-
var Underlay = ({
|
|
709
|
+
var Underlay = ({
|
|
710
|
+
size,
|
|
711
|
+
variant,
|
|
712
|
+
open,
|
|
713
|
+
dismissable,
|
|
714
|
+
keyboardDismissable,
|
|
715
|
+
...rest
|
|
716
|
+
}) => {
|
|
709
717
|
const classNames2 = (0, import_system12.useClassNames)({ component: "Underlay", size, variant });
|
|
710
|
-
|
|
718
|
+
const props = {
|
|
719
|
+
isOpen: open,
|
|
720
|
+
isDismissable: dismissable,
|
|
721
|
+
isKeyboardDismissDisabled: keyboardDismissable,
|
|
722
|
+
...rest
|
|
723
|
+
};
|
|
724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
725
|
+
import_react_aria_components2.ModalOverlay,
|
|
726
|
+
{
|
|
727
|
+
className: ({ isEntering, isExiting }) => (0, import_system12.cn)(
|
|
728
|
+
"fixed inset-0 z-10 flex min-h-full items-center justify-center overflow-y-auto backdrop-blur ",
|
|
729
|
+
isEntering ? "animate-in fade-in duration-300 ease-out" : "",
|
|
730
|
+
isExiting ? "animate-out fade-out duration-200 ease-in" : "",
|
|
731
|
+
classNames2
|
|
732
|
+
),
|
|
733
|
+
...props,
|
|
734
|
+
children: props.children
|
|
735
|
+
}
|
|
736
|
+
);
|
|
711
737
|
};
|
|
712
738
|
|
|
713
739
|
// src/Overlay/Modal.tsx
|
|
714
740
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
715
|
-
var
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
className: "pointer-none fixed inset-0 z-50 flex items-center justify-center",
|
|
735
|
-
ref: modalRef,
|
|
736
|
-
...(0, import_utils7.mergeProps)(props, overlayProps, modalProps),
|
|
737
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { pointerEvents: "auto" }, children })
|
|
738
|
-
}
|
|
739
|
-
)
|
|
740
|
-
] });
|
|
741
|
-
}
|
|
742
|
-
);
|
|
741
|
+
var _Modal = (0, import_react11.forwardRef)(({ open, dismissable, keyboardDismissable, ...rest }, ref) => {
|
|
742
|
+
const theme = (0, import_system13.useTheme)();
|
|
743
|
+
const props = {
|
|
744
|
+
isOpen: open,
|
|
745
|
+
isDismissable: dismissable,
|
|
746
|
+
isKeyboardDismissDisabled: keyboardDismissable,
|
|
747
|
+
...rest
|
|
748
|
+
};
|
|
749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
750
|
+
Underlay,
|
|
751
|
+
{
|
|
752
|
+
dismissable,
|
|
753
|
+
keyboardDismissable,
|
|
754
|
+
open,
|
|
755
|
+
variant: "modal",
|
|
756
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_aria_components3.Modal, { ref, "data-theme": theme.name, ...props, children: props.children })
|
|
757
|
+
}
|
|
758
|
+
);
|
|
759
|
+
});
|
|
743
760
|
|
|
744
761
|
// src/Overlay/Overlay.tsx
|
|
745
762
|
var import_react12 = require("react");
|
|
746
|
-
var
|
|
747
|
-
var
|
|
763
|
+
var import_overlays = require("@react-aria/overlays");
|
|
764
|
+
var import_system14 = require("@marigold/system");
|
|
748
765
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
749
766
|
var Overlay = ({ children, container, open }) => {
|
|
750
767
|
const nodeRef = (0, import_react12.useRef)(null);
|
|
751
|
-
const theme = (0,
|
|
768
|
+
const theme = (0, import_system14.useTheme)();
|
|
752
769
|
let mountOverlay = open;
|
|
753
770
|
if (!mountOverlay) {
|
|
754
771
|
return null;
|
|
755
772
|
}
|
|
756
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays.Overlay, { portalContainer: container, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
757
774
|
"div",
|
|
758
775
|
{
|
|
759
776
|
ref: nodeRef,
|
|
@@ -767,9 +784,9 @@ var Overlay = ({ children, container, open }) => {
|
|
|
767
784
|
|
|
768
785
|
// src/Overlay/Popover.tsx
|
|
769
786
|
var import_react13 = require("react");
|
|
770
|
-
var
|
|
771
|
-
var
|
|
772
|
-
var
|
|
787
|
+
var import_focus2 = require("@react-aria/focus");
|
|
788
|
+
var import_overlays2 = require("@react-aria/overlays");
|
|
789
|
+
var import_system15 = require("@marigold/system");
|
|
773
790
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
774
791
|
var Popover = (0, import_react13.forwardRef)(
|
|
775
792
|
(props, ref) => {
|
|
@@ -787,7 +804,7 @@ var PopoverWrapper = (0, import_react13.forwardRef)(
|
|
|
787
804
|
keyboardDismissDisabled,
|
|
788
805
|
...props
|
|
789
806
|
}, ref) => {
|
|
790
|
-
const { popoverProps, underlayProps, placement } = (0,
|
|
807
|
+
const { popoverProps, underlayProps, placement } = (0, import_overlays2.usePopover)(
|
|
791
808
|
{
|
|
792
809
|
...props,
|
|
793
810
|
isNonModal,
|
|
@@ -797,11 +814,11 @@ var PopoverWrapper = (0, import_react13.forwardRef)(
|
|
|
797
814
|
},
|
|
798
815
|
state
|
|
799
816
|
);
|
|
800
|
-
const classNames2 = (0,
|
|
817
|
+
const classNames2 = (0, import_system15.useClassNames)({
|
|
801
818
|
component: "Popover",
|
|
802
819
|
variant: placement
|
|
803
820
|
});
|
|
804
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_focus2.FocusScope, { restoreFocus: true, children: [
|
|
805
822
|
!isNonModal && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Underlay, { ...underlayProps }),
|
|
806
823
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
807
824
|
"div",
|
|
@@ -815,9 +832,9 @@ var PopoverWrapper = (0, import_react13.forwardRef)(
|
|
|
815
832
|
ref,
|
|
816
833
|
role: "presentation",
|
|
817
834
|
children: [
|
|
818
|
-
!isNonModal && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
835
|
+
!isNonModal && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_overlays2.DismissButton, { onDismiss: state.close }),
|
|
819
836
|
children,
|
|
820
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
837
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_overlays2.DismissButton, { onDismiss: state.close })
|
|
821
838
|
]
|
|
822
839
|
}
|
|
823
840
|
)
|
|
@@ -827,19 +844,29 @@ var PopoverWrapper = (0, import_react13.forwardRef)(
|
|
|
827
844
|
|
|
828
845
|
// src/Overlay/Tray.tsx
|
|
829
846
|
var import_react14 = require("react");
|
|
830
|
-
var
|
|
831
|
-
var
|
|
832
|
-
var
|
|
847
|
+
var import_focus3 = require("@react-aria/focus");
|
|
848
|
+
var import_overlays3 = require("@react-aria/overlays");
|
|
849
|
+
var import_utils7 = require("@react-aria/utils");
|
|
850
|
+
|
|
851
|
+
// src/Overlay/_Underlay.tsx
|
|
852
|
+
var import_system16 = require("@marigold/system");
|
|
833
853
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
854
|
+
var Underlay2 = ({ size, variant, ...props }) => {
|
|
855
|
+
const classNames2 = (0, import_system16.useClassNames)({ component: "Underlay", size, variant });
|
|
856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: (0, import_system16.cn)("fixed inset-0 z-40", classNames2), ...props });
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
// src/Overlay/Tray.tsx
|
|
860
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
834
861
|
var Tray = (0, import_react14.forwardRef)(
|
|
835
862
|
({ state, children, ...props }, ref) => {
|
|
836
|
-
const trayRef = (0,
|
|
837
|
-
return /* @__PURE__ */ (0,
|
|
863
|
+
const trayRef = (0, import_utils7.useObjectRef)(ref);
|
|
864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Overlay, { open: state.isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TrayWrapper, { state, ...props, ref: trayRef, children }) });
|
|
838
865
|
}
|
|
839
866
|
);
|
|
840
867
|
var TrayWrapper = (0, import_react14.forwardRef)(
|
|
841
868
|
({ children, state, ...props }, ref) => {
|
|
842
|
-
let { modalProps, underlayProps } = (0,
|
|
869
|
+
let { modalProps, underlayProps } = (0, import_overlays3.useModalOverlay)(
|
|
843
870
|
{
|
|
844
871
|
...props,
|
|
845
872
|
isDismissable: true
|
|
@@ -847,7 +874,7 @@ var TrayWrapper = (0, import_react14.forwardRef)(
|
|
|
847
874
|
state,
|
|
848
875
|
ref
|
|
849
876
|
);
|
|
850
|
-
return /* @__PURE__ */ (0,
|
|
877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_focus3.FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Underlay2, { ...underlayProps, variant: "modal", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
851
878
|
"div",
|
|
852
879
|
{
|
|
853
880
|
...modalProps,
|
|
@@ -855,9 +882,9 @@ var TrayWrapper = (0, import_react14.forwardRef)(
|
|
|
855
882
|
className: "absolute bottom-0 w-full",
|
|
856
883
|
"data-testid": "tray",
|
|
857
884
|
children: [
|
|
858
|
-
/* @__PURE__ */ (0,
|
|
885
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_overlays3.DismissButton, { onDismiss: state.close }),
|
|
859
886
|
children,
|
|
860
|
-
/* @__PURE__ */ (0,
|
|
887
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_overlays3.DismissButton, { onDismiss: state.close })
|
|
861
888
|
]
|
|
862
889
|
}
|
|
863
890
|
) }) });
|
|
@@ -867,11 +894,11 @@ var TrayWrapper = (0, import_react14.forwardRef)(
|
|
|
867
894
|
// src/Autocomplete/ClearButton.tsx
|
|
868
895
|
var import_react15 = require("react");
|
|
869
896
|
var import_button2 = require("@react-aria/button");
|
|
870
|
-
var
|
|
897
|
+
var import_focus4 = require("@react-aria/focus");
|
|
871
898
|
var import_interactions = require("@react-aria/interactions");
|
|
872
|
-
var
|
|
873
|
-
var
|
|
874
|
-
var
|
|
899
|
+
var import_utils8 = require("@react-aria/utils");
|
|
900
|
+
var import_system17 = require("@marigold/system");
|
|
901
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
875
902
|
var ClearButton = ({
|
|
876
903
|
preventFocus,
|
|
877
904
|
disabled,
|
|
@@ -888,7 +915,7 @@ var ClearButton = ({
|
|
|
888
915
|
}) => {
|
|
889
916
|
const buttonRef = (0, import_react15.useRef)(null);
|
|
890
917
|
const { hoverProps, isHovered } = (0, import_interactions.useHover)({ isDisabled: disabled });
|
|
891
|
-
const { isFocusVisible, focusProps } = (0,
|
|
918
|
+
const { isFocusVisible, focusProps } = (0, import_focus4.useFocusRing)({
|
|
892
919
|
autoFocus: props.autoFocus
|
|
893
920
|
});
|
|
894
921
|
const { buttonProps, isPressed } = (0, import_button2.useButton)(
|
|
@@ -909,22 +936,22 @@ var ClearButton = ({
|
|
|
909
936
|
if (preventFocus) {
|
|
910
937
|
delete buttonProps.tabIndex;
|
|
911
938
|
}
|
|
912
|
-
const stateProps = (0,
|
|
939
|
+
const stateProps = (0, import_system17.useStateProps)({
|
|
913
940
|
active: isPressed,
|
|
914
941
|
focusVisible: isFocusVisible,
|
|
915
942
|
hover: isHovered
|
|
916
943
|
});
|
|
917
|
-
return /* @__PURE__ */ (0,
|
|
944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
918
945
|
"button",
|
|
919
946
|
{
|
|
920
|
-
...(0,
|
|
947
|
+
...(0, import_utils8.mergeProps)(buttonProps, focusProps, hoverProps, props),
|
|
921
948
|
...stateProps,
|
|
922
949
|
ref: buttonRef,
|
|
923
|
-
className: (0,
|
|
950
|
+
className: (0, import_system17.cn)(
|
|
924
951
|
"cursor-pointer appearance-none border-none p-0 pr-1",
|
|
925
952
|
className
|
|
926
953
|
),
|
|
927
|
-
children: /* @__PURE__ */ (0,
|
|
954
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
928
955
|
"svg",
|
|
929
956
|
{
|
|
930
957
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -932,7 +959,7 @@ var ClearButton = ({
|
|
|
932
959
|
fill: "currentColor",
|
|
933
960
|
width: 20,
|
|
934
961
|
height: 20,
|
|
935
|
-
children: /* @__PURE__ */ (0,
|
|
962
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
936
963
|
}
|
|
937
964
|
)
|
|
938
965
|
}
|
|
@@ -940,8 +967,8 @@ var ClearButton = ({
|
|
|
940
967
|
};
|
|
941
968
|
|
|
942
969
|
// src/Autocomplete/Autocomplete.tsx
|
|
943
|
-
var
|
|
944
|
-
var SearchIcon = (props) => /* @__PURE__ */ (0,
|
|
970
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
971
|
+
var SearchIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
945
972
|
"svg",
|
|
946
973
|
{
|
|
947
974
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -950,7 +977,7 @@ var SearchIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
|
950
977
|
width: 24,
|
|
951
978
|
height: 24,
|
|
952
979
|
...props,
|
|
953
|
-
children: /* @__PURE__ */ (0,
|
|
980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M16.1865 14.5142H15.3057L14.9936 14.2131C16.0862 12.9421 16.744 11.292 16.744 9.497C16.744 5.49443 13.4996 2.25 9.497 2.25C5.49443 2.25 2.25 5.49443 2.25 9.497C2.25 13.4996 5.49443 16.744 9.497 16.744C11.292 16.744 12.9421 16.0862 14.2131 14.9936L14.5142 15.3057V16.1865L20.0888 21.75L21.75 20.0888L16.1865 14.5142ZM9.49701 14.5142C6.72085 14.5142 4.47986 12.2732 4.47986 9.49701C4.47986 6.72085 6.72085 4.47986 9.49701 4.47986C12.2732 4.47986 14.5142 6.72085 14.5142 9.49701C14.5142 12.2732 12.2732 14.5142 9.49701 14.5142Z" })
|
|
954
981
|
}
|
|
955
982
|
);
|
|
956
983
|
var Autocomplete = ({
|
|
@@ -1005,8 +1032,8 @@ var Autocomplete = ({
|
|
|
1005
1032
|
state
|
|
1006
1033
|
);
|
|
1007
1034
|
const { isDisabled, ...restClearButtonProps } = clearButtonProps;
|
|
1008
|
-
return /* @__PURE__ */ (0,
|
|
1009
|
-
/* @__PURE__ */ (0,
|
|
1035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
1036
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1010
1037
|
FieldBase,
|
|
1011
1038
|
{
|
|
1012
1039
|
label: props.label,
|
|
@@ -1016,13 +1043,13 @@ var Autocomplete = ({
|
|
|
1016
1043
|
errorMessage: props.errorMessage,
|
|
1017
1044
|
disabled,
|
|
1018
1045
|
width,
|
|
1019
|
-
children: /* @__PURE__ */ (0,
|
|
1046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1020
1047
|
Input,
|
|
1021
1048
|
{
|
|
1022
1049
|
...inputProps,
|
|
1023
1050
|
ref: inputRef,
|
|
1024
|
-
icon: /* @__PURE__ */ (0,
|
|
1025
|
-
action: state.inputValue !== "" ? /* @__PURE__ */ (0,
|
|
1051
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SearchIcon, {}),
|
|
1052
|
+
action: state.inputValue !== "" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1026
1053
|
ClearButton,
|
|
1027
1054
|
{
|
|
1028
1055
|
preventFocus: true,
|
|
@@ -1034,7 +1061,7 @@ var Autocomplete = ({
|
|
|
1034
1061
|
)
|
|
1035
1062
|
}
|
|
1036
1063
|
),
|
|
1037
|
-
/* @__PURE__ */ (0,
|
|
1064
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1038
1065
|
Popover,
|
|
1039
1066
|
{
|
|
1040
1067
|
state,
|
|
@@ -1042,7 +1069,7 @@ var Autocomplete = ({
|
|
|
1042
1069
|
triggerRef: inputRef,
|
|
1043
1070
|
scrollRef: listBoxRef,
|
|
1044
1071
|
isNonModal: true,
|
|
1045
|
-
children: /* @__PURE__ */ (0,
|
|
1072
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ListBox, { ref: listBoxRef, state, ...listBoxProps })
|
|
1046
1073
|
}
|
|
1047
1074
|
)
|
|
1048
1075
|
] });
|
|
@@ -1058,23 +1085,23 @@ var import_combobox3 = require("@react-stately/combobox");
|
|
|
1058
1085
|
|
|
1059
1086
|
// src/Button/Button.tsx
|
|
1060
1087
|
var import_react17 = require("react");
|
|
1061
|
-
var
|
|
1062
|
-
var
|
|
1063
|
-
var
|
|
1088
|
+
var import_react_aria_components4 = require("react-aria-components");
|
|
1089
|
+
var import_system18 = require("@marigold/system");
|
|
1090
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1064
1091
|
var _Button = (0, import_react17.forwardRef)(
|
|
1065
1092
|
({ children, variant, size, className, disabled, fullWidth, ...props }, ref) => {
|
|
1066
|
-
const classNames2 = (0,
|
|
1093
|
+
const classNames2 = (0, import_system18.useClassNames)({
|
|
1067
1094
|
component: "Button",
|
|
1068
1095
|
variant,
|
|
1069
1096
|
size,
|
|
1070
1097
|
className
|
|
1071
1098
|
});
|
|
1072
|
-
return /* @__PURE__ */ (0,
|
|
1073
|
-
|
|
1099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1100
|
+
import_react_aria_components4.Button,
|
|
1074
1101
|
{
|
|
1075
1102
|
...props,
|
|
1076
1103
|
ref,
|
|
1077
|
-
className: (0,
|
|
1104
|
+
className: (0, import_system18.cn)(
|
|
1078
1105
|
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
1079
1106
|
classNames2,
|
|
1080
1107
|
fullWidth ? "w-full" : void 0
|
|
@@ -1087,7 +1114,7 @@ var _Button = (0, import_react17.forwardRef)(
|
|
|
1087
1114
|
);
|
|
1088
1115
|
|
|
1089
1116
|
// src/ComboBox/ComboBox.tsx
|
|
1090
|
-
var
|
|
1117
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1091
1118
|
var ComboBox = ({
|
|
1092
1119
|
error,
|
|
1093
1120
|
width,
|
|
@@ -1127,8 +1154,8 @@ var ComboBox = ({
|
|
|
1127
1154
|
);
|
|
1128
1155
|
const errorMessageProps = { "aria-invalid": error };
|
|
1129
1156
|
const { label, description, errorMessage } = props;
|
|
1130
|
-
return /* @__PURE__ */ (0,
|
|
1131
|
-
/* @__PURE__ */ (0,
|
|
1157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1132
1159
|
FieldBase,
|
|
1133
1160
|
{
|
|
1134
1161
|
label,
|
|
@@ -1138,25 +1165,25 @@ var ComboBox = ({
|
|
|
1138
1165
|
errorMessage,
|
|
1139
1166
|
errorMessageProps,
|
|
1140
1167
|
width,
|
|
1141
|
-
children: /* @__PURE__ */ (0,
|
|
1168
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1142
1169
|
Input,
|
|
1143
1170
|
{
|
|
1144
1171
|
...inputProps,
|
|
1145
1172
|
ref: inputRef,
|
|
1146
|
-
action: /* @__PURE__ */ (0,
|
|
1173
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1147
1174
|
_Button,
|
|
1148
1175
|
{
|
|
1149
1176
|
className: "absolute right-2 h-4 w-4 border-none bg-transparent p-0",
|
|
1150
1177
|
ref: buttonRef,
|
|
1151
1178
|
...triggerProps,
|
|
1152
|
-
children: /* @__PURE__ */ (0,
|
|
1179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChevronDown, { className: "h-4 w-4" })
|
|
1153
1180
|
}
|
|
1154
1181
|
)
|
|
1155
1182
|
}
|
|
1156
1183
|
)
|
|
1157
1184
|
}
|
|
1158
1185
|
),
|
|
1159
|
-
/* @__PURE__ */ (0,
|
|
1186
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1160
1187
|
Popover,
|
|
1161
1188
|
{
|
|
1162
1189
|
state,
|
|
@@ -1164,7 +1191,7 @@ var ComboBox = ({
|
|
|
1164
1191
|
triggerRef: inputRef,
|
|
1165
1192
|
scrollRef: listBoxRef,
|
|
1166
1193
|
isNonModal: true,
|
|
1167
|
-
children: /* @__PURE__ */ (0,
|
|
1194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ListBox, { ref: listBoxRef, state, ...listBoxProps })
|
|
1168
1195
|
}
|
|
1169
1196
|
)
|
|
1170
1197
|
] });
|
|
@@ -1172,16 +1199,16 @@ var ComboBox = ({
|
|
|
1172
1199
|
ComboBox.Item = import_collections3.Item;
|
|
1173
1200
|
|
|
1174
1201
|
// src/Badge/Badge.tsx
|
|
1175
|
-
var
|
|
1176
|
-
var
|
|
1202
|
+
var import_system19 = require("@marigold/system");
|
|
1203
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1177
1204
|
var Badge = ({ variant, size, children, ...props }) => {
|
|
1178
|
-
const classNames2 = (0,
|
|
1179
|
-
return /* @__PURE__ */ (0,
|
|
1205
|
+
const classNames2 = (0, import_system19.useClassNames)({ component: "Badge", variant, size });
|
|
1206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...props, className: classNames2, children });
|
|
1180
1207
|
};
|
|
1181
1208
|
|
|
1182
1209
|
// src/Breakout/Breakout.tsx
|
|
1183
|
-
var
|
|
1184
|
-
var
|
|
1210
|
+
var import_system20 = require("@marigold/system");
|
|
1211
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1185
1212
|
var Breakout = ({
|
|
1186
1213
|
height,
|
|
1187
1214
|
children,
|
|
@@ -1191,17 +1218,17 @@ var Breakout = ({
|
|
|
1191
1218
|
...props
|
|
1192
1219
|
}) => {
|
|
1193
1220
|
var _a, _b, _c, _d;
|
|
1194
|
-
return /* @__PURE__ */ (0,
|
|
1221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1195
1222
|
"div",
|
|
1196
1223
|
{
|
|
1197
|
-
className: (0,
|
|
1224
|
+
className: (0, import_system20.cn)(
|
|
1198
1225
|
"col-start-[1_!important] col-end-[-1_!important] w-full",
|
|
1199
|
-
alignX && ((_b = (_a =
|
|
1200
|
-
alignY && ((_d = (_c =
|
|
1226
|
+
alignX && ((_b = (_a = import_system20.alignment) == null ? void 0 : _a.horizontal) == null ? void 0 : _b.alignmentX[alignX]),
|
|
1227
|
+
alignY && ((_d = (_c = import_system20.alignment) == null ? void 0 : _c.horizontal) == null ? void 0 : _d.alignmentY[alignY]),
|
|
1201
1228
|
alignX || alignY ? "flex" : "block",
|
|
1202
1229
|
"h-[--height]"
|
|
1203
1230
|
),
|
|
1204
|
-
style: (0,
|
|
1231
|
+
style: (0, import_system20.createVar)({ height }),
|
|
1205
1232
|
...props,
|
|
1206
1233
|
children
|
|
1207
1234
|
}
|
|
@@ -1209,16 +1236,16 @@ var Breakout = ({
|
|
|
1209
1236
|
};
|
|
1210
1237
|
|
|
1211
1238
|
// src/Body/Body.tsx
|
|
1212
|
-
var
|
|
1213
|
-
var
|
|
1239
|
+
var import_system21 = require("@marigold/system");
|
|
1240
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1214
1241
|
var Body = ({ children, variant, size, ...props }) => {
|
|
1215
|
-
const classNames2 = (0,
|
|
1216
|
-
return /* @__PURE__ */ (0,
|
|
1242
|
+
const classNames2 = (0, import_system21.useClassNames)({ component: "Body", variant, size });
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("section", { ...props, className: classNames2, children });
|
|
1217
1244
|
};
|
|
1218
1245
|
|
|
1219
1246
|
// src/Card/Card.tsx
|
|
1220
|
-
var
|
|
1221
|
-
var
|
|
1247
|
+
var import_system22 = require("@marigold/system");
|
|
1248
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1222
1249
|
var Card = ({
|
|
1223
1250
|
children,
|
|
1224
1251
|
variant,
|
|
@@ -1233,22 +1260,22 @@ var Card = ({
|
|
|
1233
1260
|
pr,
|
|
1234
1261
|
...props
|
|
1235
1262
|
}) => {
|
|
1236
|
-
const classNames2 = (0,
|
|
1237
|
-
return /* @__PURE__ */ (0,
|
|
1263
|
+
const classNames2 = (0, import_system22.useClassNames)({ component: "Card", variant, size });
|
|
1264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1238
1265
|
"div",
|
|
1239
1266
|
{
|
|
1240
1267
|
...props,
|
|
1241
|
-
className: (0,
|
|
1268
|
+
className: (0, import_system22.cn)(
|
|
1242
1269
|
"flex flex-col",
|
|
1243
1270
|
classNames2,
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1271
|
+
import_system22.gapSpace[space],
|
|
1272
|
+
import_system22.paddingSpace !== void 0 && import_system22.paddingSpace[p],
|
|
1273
|
+
import_system22.paddingSpaceX !== void 0 && import_system22.paddingSpaceX[px],
|
|
1274
|
+
import_system22.paddingSpaceY !== void 0 && import_system22.paddingSpaceY[py],
|
|
1275
|
+
import_system22.paddingRight !== void 0 && import_system22.paddingRight[pr],
|
|
1276
|
+
import_system22.paddingLeft !== void 0 && import_system22.paddingLeft[pl],
|
|
1277
|
+
import_system22.paddingBottom !== void 0 && import_system22.paddingBottom[pb],
|
|
1278
|
+
import_system22.paddingTop !== void 0 && import_system22.paddingTop[pt]
|
|
1252
1279
|
),
|
|
1253
1280
|
children
|
|
1254
1281
|
}
|
|
@@ -1256,24 +1283,24 @@ var Card = ({
|
|
|
1256
1283
|
};
|
|
1257
1284
|
|
|
1258
1285
|
// src/Center/Center.tsx
|
|
1259
|
-
var
|
|
1260
|
-
var
|
|
1286
|
+
var import_system23 = require("@marigold/system");
|
|
1287
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1261
1288
|
var Center = ({
|
|
1262
1289
|
maxWidth = "100%",
|
|
1263
1290
|
space = 0,
|
|
1264
1291
|
children,
|
|
1265
1292
|
...props
|
|
1266
1293
|
}) => {
|
|
1267
|
-
return /* @__PURE__ */ (0,
|
|
1294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1268
1295
|
"div",
|
|
1269
1296
|
{
|
|
1270
1297
|
...props,
|
|
1271
|
-
className: (0,
|
|
1298
|
+
className: (0, import_system23.cn)(
|
|
1272
1299
|
"me-[auto] ms-[auto] box-content flex flex-col items-center justify-center",
|
|
1273
|
-
|
|
1300
|
+
import_system23.gapSpace[space],
|
|
1274
1301
|
"max-w-[--maxWidth]"
|
|
1275
1302
|
),
|
|
1276
|
-
style: (0,
|
|
1303
|
+
style: (0, import_system23.createVar)({ maxWidth }),
|
|
1277
1304
|
children
|
|
1278
1305
|
}
|
|
1279
1306
|
);
|
|
@@ -1281,10 +1308,10 @@ var Center = ({
|
|
|
1281
1308
|
|
|
1282
1309
|
// src/Checkbox/Checkbox.tsx
|
|
1283
1310
|
var import_react19 = require("react");
|
|
1284
|
-
var
|
|
1285
|
-
var
|
|
1286
|
-
var
|
|
1287
|
-
var CheckMark = () => /* @__PURE__ */ (0,
|
|
1311
|
+
var import_react_aria_components5 = require("react-aria-components");
|
|
1312
|
+
var import_system24 = require("@marigold/system");
|
|
1313
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1314
|
+
var CheckMark = () => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("svg", { viewBox: "0 0 12 10", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1288
1315
|
"path",
|
|
1289
1316
|
{
|
|
1290
1317
|
fill: "currentColor",
|
|
@@ -1292,7 +1319,7 @@ var CheckMark = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { vie
|
|
|
1292
1319
|
d: "M11.915 1.548 10.367 0 4.045 6.315 1.557 3.827 0 5.373l4.045 4.046 7.87-7.871Z"
|
|
1293
1320
|
}
|
|
1294
1321
|
) });
|
|
1295
|
-
var IndeterminateMark = () => /* @__PURE__ */ (0,
|
|
1322
|
+
var IndeterminateMark = () => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("svg", { width: "12", height: "3", viewBox: "0 0 12 3", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1296
1323
|
"path",
|
|
1297
1324
|
{
|
|
1298
1325
|
fill: "currentColor",
|
|
@@ -1301,11 +1328,11 @@ var IndeterminateMark = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg
|
|
|
1301
1328
|
}
|
|
1302
1329
|
) });
|
|
1303
1330
|
var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
1304
|
-
return /* @__PURE__ */ (0,
|
|
1331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1305
1332
|
"div",
|
|
1306
1333
|
{
|
|
1307
1334
|
"aria-hidden": "true",
|
|
1308
|
-
className: (0,
|
|
1335
|
+
className: (0, import_system24.cn)(
|
|
1309
1336
|
"flex shrink-0 grow-0 basis-4 items-center justify-center",
|
|
1310
1337
|
"h-4 w-4 p-px",
|
|
1311
1338
|
"bg-white",
|
|
@@ -1313,7 +1340,7 @@ var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
|
1313
1340
|
className
|
|
1314
1341
|
),
|
|
1315
1342
|
...props,
|
|
1316
|
-
children: indeterminate ? /* @__PURE__ */ (0,
|
|
1343
|
+
children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IndeterminateMark, {}) : checked ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CheckMark, {}) : null
|
|
1317
1344
|
}
|
|
1318
1345
|
);
|
|
1319
1346
|
};
|
|
@@ -1342,19 +1369,19 @@ var _Checkbox = (0, import_react19.forwardRef)(
|
|
|
1342
1369
|
defaultSelected: defaultChecked,
|
|
1343
1370
|
...rest
|
|
1344
1371
|
};
|
|
1345
|
-
const classNames2 = (0,
|
|
1346
|
-
return /* @__PURE__ */ (0,
|
|
1347
|
-
|
|
1372
|
+
const classNames2 = (0, import_system24.useClassNames)({ component: "Checkbox", variant, size });
|
|
1373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1374
|
+
import_react_aria_components5.Checkbox,
|
|
1348
1375
|
{
|
|
1349
1376
|
ref,
|
|
1350
|
-
className: (0,
|
|
1377
|
+
className: (0, import_system24.cn)(
|
|
1351
1378
|
"group/checkbox flex items-center gap-[0.5rem]",
|
|
1352
1379
|
"cursor-pointer data-[disabled]:cursor-not-allowed",
|
|
1353
1380
|
classNames2.container
|
|
1354
1381
|
),
|
|
1355
1382
|
...props,
|
|
1356
|
-
children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ (0,
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1383
|
+
children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1358
1385
|
Icon,
|
|
1359
1386
|
{
|
|
1360
1387
|
checked: isSelected,
|
|
@@ -1362,7 +1389,7 @@ var _Checkbox = (0, import_react19.forwardRef)(
|
|
|
1362
1389
|
className: classNames2.checkbox
|
|
1363
1390
|
}
|
|
1364
1391
|
),
|
|
1365
|
-
/* @__PURE__ */ (0,
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: classNames2.label, children })
|
|
1366
1393
|
] })
|
|
1367
1394
|
}
|
|
1368
1395
|
);
|
|
@@ -1370,17 +1397,17 @@ var _Checkbox = (0, import_react19.forwardRef)(
|
|
|
1370
1397
|
);
|
|
1371
1398
|
|
|
1372
1399
|
// src/Checkbox/CheckboxGroup.tsx
|
|
1373
|
-
var
|
|
1374
|
-
var
|
|
1400
|
+
var import_react_aria_components7 = require("react-aria-components");
|
|
1401
|
+
var import_system27 = require("@marigold/system");
|
|
1375
1402
|
|
|
1376
1403
|
// src/FieldBase/_FieldBase.tsx
|
|
1377
1404
|
var import_react20 = require("react");
|
|
1378
|
-
var
|
|
1405
|
+
var import_system26 = require("@marigold/system");
|
|
1379
1406
|
|
|
1380
1407
|
// src/HelpText/_HelpText.tsx
|
|
1381
|
-
var
|
|
1382
|
-
var
|
|
1383
|
-
var
|
|
1408
|
+
var import_react_aria_components6 = require("react-aria-components");
|
|
1409
|
+
var import_system25 = require("@marigold/system");
|
|
1410
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1384
1411
|
var HelpText2 = ({
|
|
1385
1412
|
variant,
|
|
1386
1413
|
size,
|
|
@@ -1391,7 +1418,7 @@ var HelpText2 = ({
|
|
|
1391
1418
|
...props
|
|
1392
1419
|
}) => {
|
|
1393
1420
|
const hasErrorMessage = errorMessage && error;
|
|
1394
|
-
const classNames2 = (0,
|
|
1421
|
+
const classNames2 = (0, import_system25.useClassNames)({
|
|
1395
1422
|
component: "HelpText",
|
|
1396
1423
|
variant,
|
|
1397
1424
|
size
|
|
@@ -1399,33 +1426,33 @@ var HelpText2 = ({
|
|
|
1399
1426
|
if (!description && !errorMessage) {
|
|
1400
1427
|
return null;
|
|
1401
1428
|
}
|
|
1402
|
-
return /* @__PURE__ */ (0,
|
|
1403
|
-
/* @__PURE__ */ (0,
|
|
1404
|
-
|
|
1429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_system25.cn)(classNames2.container), children: [
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1431
|
+
import_react_aria_components6.FieldError,
|
|
1405
1432
|
{
|
|
1406
1433
|
...props,
|
|
1407
1434
|
className: "grid grid-flow-col items-center justify-start gap-1",
|
|
1408
1435
|
children: [
|
|
1409
|
-
/* @__PURE__ */ (0,
|
|
1436
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1410
1437
|
"svg",
|
|
1411
1438
|
{
|
|
1412
|
-
className: (0,
|
|
1439
|
+
className: (0, import_system25.cn)("h-4 w-4", classNames2.icon),
|
|
1413
1440
|
viewBox: "0 0 24 24",
|
|
1414
1441
|
role: "presentation",
|
|
1415
1442
|
fill: "currentColor",
|
|
1416
|
-
children: /* @__PURE__ */ (0,
|
|
1443
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("path", { d: "M2.25 20.3097H21.75L12 3.46875L2.25 20.3097ZM12.8864 17.2606H11.1136V15.4879H12.8864V17.2606ZM12.8864 13.7151H11.1136V10.1697H12.8864V13.7151Z" })
|
|
1417
1444
|
}
|
|
1418
1445
|
),
|
|
1419
1446
|
errorMessage
|
|
1420
1447
|
]
|
|
1421
1448
|
}
|
|
1422
1449
|
),
|
|
1423
|
-
!hasErrorMessage && /* @__PURE__ */ (0,
|
|
1450
|
+
!hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_aria_components6.Text, { slot: "description", children: description })
|
|
1424
1451
|
] });
|
|
1425
1452
|
};
|
|
1426
1453
|
|
|
1427
1454
|
// src/FieldBase/_FieldBase.tsx
|
|
1428
|
-
var
|
|
1455
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1429
1456
|
var fixedForwardRef = import_react20.forwardRef;
|
|
1430
1457
|
var _FieldBase = (props, ref) => {
|
|
1431
1458
|
const {
|
|
@@ -1438,24 +1465,26 @@ var _FieldBase = (props, ref) => {
|
|
|
1438
1465
|
description,
|
|
1439
1466
|
errorMessage,
|
|
1440
1467
|
className,
|
|
1468
|
+
stateProps,
|
|
1441
1469
|
...rest
|
|
1442
1470
|
} = props;
|
|
1443
|
-
const classNames2 = (0,
|
|
1471
|
+
const classNames2 = (0, import_system26.useClassNames)({
|
|
1444
1472
|
component: "Field",
|
|
1445
1473
|
variant,
|
|
1446
1474
|
size
|
|
1447
1475
|
});
|
|
1448
|
-
return /* @__PURE__ */ (0,
|
|
1476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1449
1477
|
Component,
|
|
1450
1478
|
{
|
|
1451
1479
|
ref,
|
|
1452
|
-
className: (0,
|
|
1480
|
+
className: (0, import_system26.cn)("group/field", import_system26.width[width], classNames2, className),
|
|
1453
1481
|
"data-required": props.isRequired ? true : void 0,
|
|
1482
|
+
"data-error": props.isInvalid ? true : void 0,
|
|
1454
1483
|
...rest,
|
|
1455
1484
|
children: [
|
|
1456
|
-
label ? /* @__PURE__ */ (0,
|
|
1485
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(_Label, { variant, size, children: label }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { "aria-hidden": "true" }),
|
|
1457
1486
|
children,
|
|
1458
|
-
/* @__PURE__ */ (0,
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1459
1488
|
HelpText2,
|
|
1460
1489
|
{
|
|
1461
1490
|
variant,
|
|
@@ -1472,7 +1501,7 @@ var _FieldBase = (props, ref) => {
|
|
|
1472
1501
|
var FieldBase2 = fixedForwardRef(_FieldBase);
|
|
1473
1502
|
|
|
1474
1503
|
// src/Checkbox/CheckboxGroup.tsx
|
|
1475
|
-
var
|
|
1504
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1476
1505
|
var _CheckboxGroup = ({
|
|
1477
1506
|
children,
|
|
1478
1507
|
variant,
|
|
@@ -1483,7 +1512,7 @@ var _CheckboxGroup = ({
|
|
|
1483
1512
|
error,
|
|
1484
1513
|
...rest
|
|
1485
1514
|
}) => {
|
|
1486
|
-
const classNames2 = (0,
|
|
1515
|
+
const classNames2 = (0, import_system27.useClassNames)({
|
|
1487
1516
|
component: "Checkbox",
|
|
1488
1517
|
variant,
|
|
1489
1518
|
size,
|
|
@@ -1497,13 +1526,13 @@ var _CheckboxGroup = ({
|
|
|
1497
1526
|
isInvalid: error,
|
|
1498
1527
|
...rest
|
|
1499
1528
|
};
|
|
1500
|
-
return /* @__PURE__ */ (0,
|
|
1529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FieldBase2, { as: import_react_aria_components7.CheckboxGroup, ...props, children });
|
|
1501
1530
|
};
|
|
1502
1531
|
|
|
1503
1532
|
// src/Columns/Columns.tsx
|
|
1504
1533
|
var import_react21 = require("react");
|
|
1505
|
-
var
|
|
1506
|
-
var
|
|
1534
|
+
var import_system28 = require("@marigold/system");
|
|
1535
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1507
1536
|
var Columns = ({
|
|
1508
1537
|
space = 0,
|
|
1509
1538
|
columns,
|
|
@@ -1519,22 +1548,22 @@ var Columns = ({
|
|
|
1519
1548
|
)}`
|
|
1520
1549
|
);
|
|
1521
1550
|
}
|
|
1522
|
-
return /* @__PURE__ */ (0,
|
|
1551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1523
1552
|
"div",
|
|
1524
1553
|
{
|
|
1525
|
-
className: (0,
|
|
1554
|
+
className: (0, import_system28.cn)(
|
|
1526
1555
|
"flex flex-wrap items-stretch",
|
|
1527
1556
|
stretch && "h-full",
|
|
1528
|
-
|
|
1557
|
+
import_system28.gapSpace[space]
|
|
1529
1558
|
),
|
|
1530
1559
|
...props,
|
|
1531
|
-
children: import_react21.Children.map(children, (child, idx) => /* @__PURE__ */ (0,
|
|
1560
|
+
children: import_react21.Children.map(children, (child, idx) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1532
1561
|
"div",
|
|
1533
1562
|
{
|
|
1534
|
-
className: (0,
|
|
1563
|
+
className: (0, import_system28.cn)(
|
|
1535
1564
|
"grow-[--columnSize] basis-[calc((var(--collapseAt)_-_100%)_*_999)]"
|
|
1536
1565
|
),
|
|
1537
|
-
style: (0,
|
|
1566
|
+
style: (0, import_system28.createVar)({ collapseAt, columnSize: columns[idx] }),
|
|
1538
1567
|
children: (0, import_react21.isValidElement)(child) ? (0, import_react21.cloneElement)(child) : child
|
|
1539
1568
|
}
|
|
1540
1569
|
))
|
|
@@ -1543,8 +1572,8 @@ var Columns = ({
|
|
|
1543
1572
|
};
|
|
1544
1573
|
|
|
1545
1574
|
// src/Container/Container.tsx
|
|
1546
|
-
var
|
|
1547
|
-
var
|
|
1575
|
+
var import_system29 = require("@marigold/system");
|
|
1576
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1548
1577
|
var content = {
|
|
1549
1578
|
small: "20ch",
|
|
1550
1579
|
medium: "45ch",
|
|
@@ -1564,44 +1593,30 @@ var Container = ({
|
|
|
1564
1593
|
...props
|
|
1565
1594
|
}) => {
|
|
1566
1595
|
const maxWidth = contentType === "content" ? content[size] : header[size];
|
|
1567
|
-
return /* @__PURE__ */ (0,
|
|
1596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1568
1597
|
"div",
|
|
1569
1598
|
{
|
|
1570
1599
|
...props,
|
|
1571
|
-
className: (0,
|
|
1600
|
+
className: (0, import_system29.cn)(
|
|
1572
1601
|
"grid",
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1602
|
+
import_system29.placeItems[alignItems],
|
|
1603
|
+
import_system29.gridColsAlign[align],
|
|
1604
|
+
import_system29.gridColumn[align]
|
|
1576
1605
|
),
|
|
1577
|
-
style: (0,
|
|
1606
|
+
style: (0, import_system29.createVar)({ maxWidth }),
|
|
1578
1607
|
children
|
|
1579
1608
|
}
|
|
1580
1609
|
);
|
|
1581
1610
|
};
|
|
1582
1611
|
|
|
1583
1612
|
// src/Dialog/Dialog.tsx
|
|
1584
|
-
var
|
|
1585
|
-
var
|
|
1586
|
-
var
|
|
1587
|
-
var import_system30 = require("@marigold/system");
|
|
1588
|
-
|
|
1589
|
-
// src/Header/Header.tsx
|
|
1590
|
-
var import_react_aria_components6 = require("react-aria-components");
|
|
1591
|
-
var import_system28 = require("@marigold/system");
|
|
1592
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1593
|
-
var _Header = ({ variant, size, ...props }) => {
|
|
1594
|
-
const classNames2 = (0, import_system28.useClassNames)({
|
|
1595
|
-
component: "Header",
|
|
1596
|
-
variant,
|
|
1597
|
-
size
|
|
1598
|
-
});
|
|
1599
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_aria_components6.Header, { className: classNames2, ...props, children: props.children });
|
|
1600
|
-
};
|
|
1613
|
+
var import_react23 = require("react");
|
|
1614
|
+
var import_react_aria_components10 = require("react-aria-components");
|
|
1615
|
+
var import_system31 = require("@marigold/system");
|
|
1601
1616
|
|
|
1602
1617
|
// src/Headline/Headline.tsx
|
|
1603
|
-
var
|
|
1604
|
-
var
|
|
1618
|
+
var import_react_aria_components8 = require("react-aria-components");
|
|
1619
|
+
var import_system30 = require("@marigold/system");
|
|
1605
1620
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1606
1621
|
var _Headline = ({
|
|
1607
1622
|
variant,
|
|
@@ -1612,20 +1627,20 @@ var _Headline = ({
|
|
|
1612
1627
|
level = 1,
|
|
1613
1628
|
...props
|
|
1614
1629
|
}) => {
|
|
1615
|
-
const theme = (0,
|
|
1616
|
-
const classNames2 = (0,
|
|
1630
|
+
const theme = (0, import_system30.useTheme)();
|
|
1631
|
+
const classNames2 = (0, import_system30.useClassNames)({
|
|
1617
1632
|
component: "Headline",
|
|
1618
1633
|
variant,
|
|
1619
1634
|
size: size != null ? size : `level-${level}`
|
|
1620
1635
|
});
|
|
1621
1636
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1622
|
-
|
|
1637
|
+
import_react_aria_components8.Heading,
|
|
1623
1638
|
{
|
|
1624
1639
|
level: Number(level),
|
|
1625
1640
|
...props,
|
|
1626
|
-
className: (0,
|
|
1627
|
-
style: (0,
|
|
1628
|
-
color: color && theme.colors && (0,
|
|
1641
|
+
className: (0, import_system30.cn)(classNames2, "text-[--color]", import_system30.textAlign[align]),
|
|
1642
|
+
style: (0, import_system30.createVar)({
|
|
1643
|
+
color: color && theme.colors && (0, import_system30.get)(
|
|
1629
1644
|
theme.colors,
|
|
1630
1645
|
color.replace("-", "."),
|
|
1631
1646
|
color
|
|
@@ -1637,96 +1652,50 @@ var _Headline = ({
|
|
|
1637
1652
|
);
|
|
1638
1653
|
};
|
|
1639
1654
|
|
|
1640
|
-
// src/Dialog/
|
|
1655
|
+
// src/Dialog/DialogTrigger.tsx
|
|
1641
1656
|
var import_react22 = require("react");
|
|
1642
|
-
var
|
|
1643
|
-
var useDialogContext = () => (0, import_react22.useContext)(DialogContext);
|
|
1644
|
-
|
|
1645
|
-
// src/Dialog/DialogController.tsx
|
|
1646
|
-
var import_overlays5 = require("@react-stately/overlays");
|
|
1657
|
+
var import_react_aria_components9 = require("react-aria-components");
|
|
1647
1658
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1648
|
-
var
|
|
1649
|
-
children,
|
|
1650
|
-
dismissable = true,
|
|
1651
|
-
keyboardDismissable = true,
|
|
1659
|
+
var _DialogTrigger = ({
|
|
1652
1660
|
open,
|
|
1653
|
-
|
|
1661
|
+
dismissable,
|
|
1662
|
+
keyboardDismissable,
|
|
1663
|
+
...rest
|
|
1654
1664
|
}) => {
|
|
1655
|
-
const
|
|
1665
|
+
const props = {
|
|
1656
1666
|
isOpen: open,
|
|
1657
|
-
|
|
1658
|
-
}
|
|
1659
|
-
const
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
children
|
|
1668
|
-
}
|
|
1669
|
-
) }) });
|
|
1670
|
-
};
|
|
1671
|
-
|
|
1672
|
-
// src/Dialog/DialogTrigger.tsx
|
|
1673
|
-
var import_react23 = require("react");
|
|
1674
|
-
var import_interactions2 = require("@react-aria/interactions");
|
|
1675
|
-
var import_overlays6 = require("@react-stately/overlays");
|
|
1676
|
-
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1677
|
-
var DialogTrigger = ({
|
|
1678
|
-
children,
|
|
1679
|
-
dismissable = true,
|
|
1680
|
-
keyboardDismissable = true
|
|
1681
|
-
}) => {
|
|
1682
|
-
const [dialogTrigger, dialog] = import_react23.Children.toArray(children);
|
|
1683
|
-
const dialogTriggerRef = (0, import_react23.useRef)(null);
|
|
1684
|
-
const state = (0, import_overlays6.useOverlayTriggerState)({});
|
|
1685
|
-
const ctx = { open: state.isOpen, close: state.close };
|
|
1686
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(DialogContext.Provider, { value: ctx, children: [
|
|
1687
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1688
|
-
import_interactions2.PressResponder,
|
|
1689
|
-
{
|
|
1690
|
-
ref: dialogTriggerRef,
|
|
1691
|
-
isPressed: state.isOpen,
|
|
1692
|
-
onPress: state.toggle,
|
|
1693
|
-
children: dialogTrigger
|
|
1694
|
-
}
|
|
1695
|
-
),
|
|
1696
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Overlay, { open: state.isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1697
|
-
Modal,
|
|
1667
|
+
...rest
|
|
1668
|
+
};
|
|
1669
|
+
const children = import_react22.Children.toArray(props.children);
|
|
1670
|
+
const [dialogTrigger, dialog] = children;
|
|
1671
|
+
const hasDialogTrigger = dialogTrigger.type !== _Dialog;
|
|
1672
|
+
const currentDialog = children.length < 2 ? !hasDialogTrigger && dialogTrigger : dialog;
|
|
1673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react_aria_components9.DialogTrigger, { ...props, children: [
|
|
1674
|
+
hasDialogTrigger && dialogTrigger,
|
|
1675
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1676
|
+
_Modal,
|
|
1698
1677
|
{
|
|
1699
|
-
open: state.isOpen,
|
|
1700
|
-
onClose: state.close,
|
|
1701
1678
|
dismissable,
|
|
1702
1679
|
keyboardDismissable,
|
|
1703
|
-
children:
|
|
1680
|
+
children: currentDialog
|
|
1704
1681
|
}
|
|
1705
|
-
)
|
|
1682
|
+
)
|
|
1706
1683
|
] });
|
|
1707
1684
|
};
|
|
1708
1685
|
|
|
1709
1686
|
// src/Dialog/Dialog.tsx
|
|
1710
|
-
var
|
|
1687
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1711
1688
|
var CloseButton = ({ className }) => {
|
|
1712
|
-
const
|
|
1713
|
-
|
|
1714
|
-
const { buttonProps } = (0, import_button3.useButton)(
|
|
1715
|
-
{
|
|
1716
|
-
onPress: () => close == null ? void 0 : close()
|
|
1717
|
-
},
|
|
1718
|
-
ref
|
|
1719
|
-
);
|
|
1720
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1689
|
+
const { close } = (0, import_react23.useContext)(import_react_aria_components10.OverlayTriggerStateContext);
|
|
1690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1721
1691
|
"button",
|
|
1722
1692
|
{
|
|
1723
|
-
className: (0,
|
|
1693
|
+
className: (0, import_system31.cn)(
|
|
1724
1694
|
"h-4 w-4 cursor-pointer border-none p-0 leading-normal outline-0",
|
|
1725
1695
|
className
|
|
1726
1696
|
),
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1697
|
+
onClick: close,
|
|
1698
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1730
1699
|
"path",
|
|
1731
1700
|
{
|
|
1732
1701
|
fillRule: "evenodd",
|
|
@@ -1737,62 +1706,70 @@ var CloseButton = ({ className }) => {
|
|
|
1737
1706
|
}
|
|
1738
1707
|
) });
|
|
1739
1708
|
};
|
|
1740
|
-
var
|
|
1741
|
-
|
|
1742
|
-
const titleIndex = childs.findIndex(
|
|
1743
|
-
(child) => (0, import_react24.isValidElement)(child) && (child.type === _Header || child.type === _Headline)
|
|
1744
|
-
);
|
|
1745
|
-
if (titleIndex < 0) {
|
|
1746
|
-
console.warn(
|
|
1747
|
-
"No child in <Dialog> found that can act as title for accessibility. Please add a <Header> or <Headline> as direct child."
|
|
1748
|
-
);
|
|
1749
|
-
return children;
|
|
1750
|
-
}
|
|
1751
|
-
const titleChild = (0, import_react24.cloneElement)(
|
|
1752
|
-
childs[titleIndex],
|
|
1753
|
-
titleProps
|
|
1754
|
-
);
|
|
1755
|
-
childs.splice(titleIndex, 1, titleChild);
|
|
1756
|
-
return childs;
|
|
1757
|
-
};
|
|
1758
|
-
var Dialog = ({
|
|
1759
|
-
children,
|
|
1709
|
+
var DialogHeadline = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(_Headline, { slot: "title", children });
|
|
1710
|
+
var _Dialog = ({
|
|
1760
1711
|
variant,
|
|
1761
1712
|
size,
|
|
1762
1713
|
closeButton,
|
|
1714
|
+
isNonModal,
|
|
1763
1715
|
...props
|
|
1764
1716
|
}) => {
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1717
|
+
const classNames2 = (0, import_system31.useClassNames)({ component: "Dialog", variant, size });
|
|
1718
|
+
let state = (0, import_react23.useContext)(import_react_aria_components10.OverlayTriggerStateContext);
|
|
1719
|
+
let children = props.children;
|
|
1720
|
+
if (typeof children === "function") {
|
|
1721
|
+
children = children({
|
|
1722
|
+
close: (state == null ? void 0 : state.close) || (() => {
|
|
1723
|
+
})
|
|
1724
|
+
});
|
|
1725
|
+
}
|
|
1726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1727
|
+
import_react_aria_components10.Dialog,
|
|
1728
|
+
{
|
|
1729
|
+
...props,
|
|
1730
|
+
className: (0, import_system31.cn)("relative outline-none", classNames2.container),
|
|
1731
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
1732
|
+
closeButton && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CloseButton, { className: classNames2.closeButton }),
|
|
1733
|
+
children
|
|
1734
|
+
] })
|
|
1735
|
+
}
|
|
1736
|
+
);
|
|
1773
1737
|
};
|
|
1774
|
-
|
|
1775
|
-
|
|
1738
|
+
_Dialog.Trigger = _DialogTrigger;
|
|
1739
|
+
_Dialog.Headline = DialogHeadline;
|
|
1776
1740
|
|
|
1777
1741
|
// src/Divider/Divider.tsx
|
|
1778
|
-
var
|
|
1779
|
-
var
|
|
1780
|
-
var
|
|
1742
|
+
var import_react_aria_components11 = require("react-aria-components");
|
|
1743
|
+
var import_system32 = require("@marigold/system");
|
|
1744
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1781
1745
|
var _Divider = ({ variant, ...props }) => {
|
|
1782
|
-
const classNames2 = (0,
|
|
1783
|
-
return /* @__PURE__ */ (0,
|
|
1746
|
+
const classNames2 = (0, import_system32.useClassNames)({ component: "Divider", variant });
|
|
1747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_aria_components11.Separator, { className: classNames2, ...props });
|
|
1784
1748
|
};
|
|
1785
1749
|
|
|
1786
1750
|
// src/Footer/Footer.tsx
|
|
1787
|
-
var
|
|
1788
|
-
var
|
|
1751
|
+
var import_system33 = require("@marigold/system");
|
|
1752
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1789
1753
|
var Footer = ({ children, variant, size, ...props }) => {
|
|
1790
|
-
const classNames2 = (0,
|
|
1791
|
-
return /* @__PURE__ */ (0,
|
|
1754
|
+
const classNames2 = (0, import_system33.useClassNames)({ component: "Footer", variant, size });
|
|
1755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("footer", { ...props, className: classNames2, children });
|
|
1756
|
+
};
|
|
1757
|
+
|
|
1758
|
+
// src/Header/Header.tsx
|
|
1759
|
+
var import_react_aria_components12 = require("react-aria-components");
|
|
1760
|
+
var import_system34 = require("@marigold/system");
|
|
1761
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1762
|
+
var _Header = ({ variant, size, ...props }) => {
|
|
1763
|
+
const classNames2 = (0, import_system34.useClassNames)({
|
|
1764
|
+
component: "Header",
|
|
1765
|
+
variant,
|
|
1766
|
+
size
|
|
1767
|
+
});
|
|
1768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_aria_components12.Header, { className: classNames2, ...props, children: props.children });
|
|
1792
1769
|
};
|
|
1793
1770
|
|
|
1794
1771
|
// src/Image/Image.tsx
|
|
1795
|
-
var
|
|
1772
|
+
var import_system35 = require("@marigold/system");
|
|
1796
1773
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1797
1774
|
var Image = ({
|
|
1798
1775
|
variant,
|
|
@@ -1801,24 +1778,24 @@ var Image = ({
|
|
|
1801
1778
|
position = "none",
|
|
1802
1779
|
...props
|
|
1803
1780
|
}) => {
|
|
1804
|
-
const classNames2 = (0,
|
|
1781
|
+
const classNames2 = (0, import_system35.useClassNames)({ component: "Image", variant, size });
|
|
1805
1782
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1806
1783
|
"img",
|
|
1807
1784
|
{
|
|
1808
1785
|
...props,
|
|
1809
1786
|
alt: props.alt,
|
|
1810
|
-
className: (0,
|
|
1787
|
+
className: (0, import_system35.cn)(
|
|
1811
1788
|
fit !== "none" && "h-full w-full",
|
|
1812
1789
|
classNames2,
|
|
1813
|
-
|
|
1814
|
-
|
|
1790
|
+
import_system35.objectFit[fit],
|
|
1791
|
+
import_system35.objectPosition[position]
|
|
1815
1792
|
)
|
|
1816
1793
|
}
|
|
1817
1794
|
);
|
|
1818
1795
|
};
|
|
1819
1796
|
|
|
1820
1797
|
// src/Inline/Inline.tsx
|
|
1821
|
-
var
|
|
1798
|
+
var import_system36 = require("@marigold/system");
|
|
1822
1799
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1823
1800
|
var Inline = ({
|
|
1824
1801
|
space = 0,
|
|
@@ -1833,11 +1810,11 @@ var Inline = ({
|
|
|
1833
1810
|
"div",
|
|
1834
1811
|
{
|
|
1835
1812
|
...props,
|
|
1836
|
-
className: (0,
|
|
1813
|
+
className: (0, import_system36.cn)(
|
|
1837
1814
|
"flex flex-wrap",
|
|
1838
|
-
|
|
1839
|
-
alignX && ((_b2 = (_a2 =
|
|
1840
|
-
alignY && ((_d = (_c =
|
|
1815
|
+
import_system36.gapSpace[space],
|
|
1816
|
+
alignX && ((_b2 = (_a2 = import_system36.alignment) == null ? void 0 : _a2.horizontal) == null ? void 0 : _b2.alignmentX[alignX]),
|
|
1817
|
+
alignY && ((_d = (_c = import_system36.alignment) == null ? void 0 : _c.horizontal) == null ? void 0 : _d.alignmentY[alignY])
|
|
1841
1818
|
),
|
|
1842
1819
|
children
|
|
1843
1820
|
}
|
|
@@ -1846,21 +1823,21 @@ var Inline = ({
|
|
|
1846
1823
|
|
|
1847
1824
|
// src/DateField/DateField.tsx
|
|
1848
1825
|
var import_date = require("@internationalized/date");
|
|
1849
|
-
var
|
|
1826
|
+
var import_react25 = require("react");
|
|
1850
1827
|
var import_datepicker2 = require("@react-aria/datepicker");
|
|
1851
|
-
var
|
|
1828
|
+
var import_focus6 = require("@react-aria/focus");
|
|
1852
1829
|
var import_i18n3 = require("@react-aria/i18n");
|
|
1853
|
-
var
|
|
1854
|
-
var
|
|
1830
|
+
var import_interactions2 = require("@react-aria/interactions");
|
|
1831
|
+
var import_utils10 = require("@react-aria/utils");
|
|
1855
1832
|
var import_datepicker3 = require("@react-stately/datepicker");
|
|
1856
|
-
var
|
|
1833
|
+
var import_system38 = require("@marigold/system");
|
|
1857
1834
|
|
|
1858
1835
|
// src/DateField/DateSegment.tsx
|
|
1859
|
-
var
|
|
1836
|
+
var import_react24 = require("react");
|
|
1860
1837
|
var import_datepicker = require("@react-aria/datepicker");
|
|
1861
|
-
var
|
|
1862
|
-
var
|
|
1863
|
-
var
|
|
1838
|
+
var import_focus5 = require("@react-aria/focus");
|
|
1839
|
+
var import_utils9 = require("@react-aria/utils");
|
|
1840
|
+
var import_system37 = require("@marigold/system");
|
|
1864
1841
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1865
1842
|
var DateSegment = ({
|
|
1866
1843
|
className,
|
|
@@ -1868,13 +1845,13 @@ var DateSegment = ({
|
|
|
1868
1845
|
state,
|
|
1869
1846
|
isPrevPlaceholder
|
|
1870
1847
|
}) => {
|
|
1871
|
-
const ref = (0,
|
|
1848
|
+
const ref = (0, import_react24.useRef)(null);
|
|
1872
1849
|
const { segmentProps } = (0, import_datepicker.useDateSegment)(segment, state, ref);
|
|
1873
|
-
const { focusProps, isFocused } = (0,
|
|
1850
|
+
const { focusProps, isFocused } = (0, import_focus5.useFocusRing)({
|
|
1874
1851
|
within: true,
|
|
1875
1852
|
isTextInput: true
|
|
1876
1853
|
});
|
|
1877
|
-
const stateProps = (0,
|
|
1854
|
+
const stateProps = (0, import_system37.useStateProps)({
|
|
1878
1855
|
disabled: state.isDisabled,
|
|
1879
1856
|
focusVisible: isFocused
|
|
1880
1857
|
});
|
|
@@ -1882,9 +1859,9 @@ var DateSegment = ({
|
|
|
1882
1859
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
1883
1860
|
"div",
|
|
1884
1861
|
{
|
|
1885
|
-
...(0,
|
|
1862
|
+
...(0, import_utils9.mergeProps)(segmentProps, stateProps, focusProps),
|
|
1886
1863
|
ref,
|
|
1887
|
-
className: (0,
|
|
1864
|
+
className: (0, import_system37.cn)(
|
|
1888
1865
|
"group/segment",
|
|
1889
1866
|
"text-center leading-none outline-0",
|
|
1890
1867
|
type !== "literal" && "p-0.5",
|
|
@@ -1899,7 +1876,7 @@ var DateSegment = ({
|
|
|
1899
1876
|
"span",
|
|
1900
1877
|
{
|
|
1901
1878
|
"aria-hidden": "true",
|
|
1902
|
-
className: (0,
|
|
1879
|
+
className: (0, import_system37.cn)(
|
|
1903
1880
|
isPlaceholder ? "visible block" : "invisible hidden",
|
|
1904
1881
|
"pointer-events-none w-full text-center"
|
|
1905
1882
|
),
|
|
@@ -1942,20 +1919,20 @@ var DateField = ({
|
|
|
1942
1919
|
locale,
|
|
1943
1920
|
createCalendar: import_date.createCalendar
|
|
1944
1921
|
});
|
|
1945
|
-
const ref = (0,
|
|
1922
|
+
const ref = (0, import_react25.useRef)(null);
|
|
1946
1923
|
const { fieldProps, labelProps, descriptionProps } = (0, import_datepicker2.useDateField)(
|
|
1947
1924
|
props,
|
|
1948
1925
|
state,
|
|
1949
1926
|
ref
|
|
1950
1927
|
);
|
|
1951
|
-
const classNames2 = (0,
|
|
1952
|
-
const { focusProps, isFocused } = (0,
|
|
1928
|
+
const classNames2 = (0, import_system38.useClassNames)({ component: "DateField", variant, size });
|
|
1929
|
+
const { focusProps, isFocused } = (0, import_focus6.useFocusRing)({
|
|
1953
1930
|
within: true,
|
|
1954
1931
|
isTextInput: true,
|
|
1955
1932
|
autoFocus: props.autoFocus
|
|
1956
1933
|
});
|
|
1957
|
-
const { hoverProps, isHovered } = (0,
|
|
1958
|
-
const stateProps = (0,
|
|
1934
|
+
const { hoverProps, isHovered } = (0, import_interactions2.useHover)({ isDisabled: disabled });
|
|
1935
|
+
const stateProps = (0, import_system38.useStateProps)({
|
|
1959
1936
|
hover: isHovered,
|
|
1960
1937
|
error,
|
|
1961
1938
|
readOnly,
|
|
@@ -1981,8 +1958,8 @@ var DateField = ({
|
|
|
1981
1958
|
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
1982
1959
|
"div",
|
|
1983
1960
|
{
|
|
1984
|
-
...(0,
|
|
1985
|
-
className: (0,
|
|
1961
|
+
...(0, import_utils10.mergeProps)(fieldProps, focusProps, stateProps, hoverProps),
|
|
1962
|
+
className: (0, import_system38.cn)(
|
|
1986
1963
|
"relative flex flex-row flex-nowrap",
|
|
1987
1964
|
"cursor-text aria-disabled:cursor-not-allowed",
|
|
1988
1965
|
classNames2.field
|
|
@@ -2007,7 +1984,7 @@ var DateField = ({
|
|
|
2007
1984
|
"svg",
|
|
2008
1985
|
{
|
|
2009
1986
|
"data-testid": "action",
|
|
2010
|
-
className: (0,
|
|
1987
|
+
className: (0, import_system38.cn)(classNames2.action),
|
|
2011
1988
|
viewBox: "0 0 24 24",
|
|
2012
1989
|
width: 24,
|
|
2013
1990
|
height: 24,
|
|
@@ -2023,39 +2000,39 @@ var DateField = ({
|
|
|
2023
2000
|
|
|
2024
2001
|
// src/Calendar/Calendar.tsx
|
|
2025
2002
|
var import_date3 = require("@internationalized/date");
|
|
2026
|
-
var
|
|
2003
|
+
var import_react29 = require("react");
|
|
2027
2004
|
var import_calendar3 = require("@react-aria/calendar");
|
|
2028
2005
|
var import_i18n7 = require("@react-aria/i18n");
|
|
2029
2006
|
var import_calendar4 = require("@react-stately/calendar");
|
|
2030
2007
|
var import_icons = require("@marigold/icons");
|
|
2031
|
-
var
|
|
2008
|
+
var import_system40 = require("@marigold/system");
|
|
2032
2009
|
|
|
2033
2010
|
// src/Calendar/CalendarGrid.tsx
|
|
2034
2011
|
var import_date2 = require("@internationalized/date");
|
|
2035
|
-
var
|
|
2012
|
+
var import_react27 = require("react");
|
|
2036
2013
|
var import_calendar2 = require("@react-aria/calendar");
|
|
2037
2014
|
var import_i18n4 = require("@react-aria/i18n");
|
|
2038
2015
|
var import_i18n5 = require("@react-aria/i18n");
|
|
2039
2016
|
|
|
2040
2017
|
// src/Calendar/CalendarCell.tsx
|
|
2041
|
-
var
|
|
2018
|
+
var import_react26 = require("react");
|
|
2042
2019
|
var import_calendar = require("@react-aria/calendar");
|
|
2043
|
-
var
|
|
2044
|
-
var
|
|
2045
|
-
var
|
|
2020
|
+
var import_interactions3 = require("@react-aria/interactions");
|
|
2021
|
+
var import_utils11 = require("@react-aria/utils");
|
|
2022
|
+
var import_system39 = require("@marigold/system");
|
|
2046
2023
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2047
2024
|
var CalendarCell = (props) => {
|
|
2048
|
-
const ref = (0,
|
|
2025
|
+
const ref = (0, import_react26.useRef)(null);
|
|
2049
2026
|
const { state } = props;
|
|
2050
2027
|
let { cellProps, buttonProps, formattedDate, isOutsideVisibleRange } = (0, import_calendar.useCalendarCell)(props, state, ref);
|
|
2051
|
-
const classNames2 = (0,
|
|
2028
|
+
const classNames2 = (0, import_system39.useClassNames)({
|
|
2052
2029
|
component: "Calendar"
|
|
2053
2030
|
});
|
|
2054
2031
|
const isDisabled = cellProps["aria-disabled"];
|
|
2055
|
-
const { hoverProps, isHovered } = (0,
|
|
2032
|
+
const { hoverProps, isHovered } = (0, import_interactions3.useHover)({
|
|
2056
2033
|
isDisabled: isDisabled || cellProps["aria-selected"]
|
|
2057
2034
|
});
|
|
2058
|
-
const stateProps = (0,
|
|
2035
|
+
const stateProps = (0, import_system39.useStateProps)({
|
|
2059
2036
|
disabled: isDisabled,
|
|
2060
2037
|
hover: isHovered,
|
|
2061
2038
|
selected: cellProps["aria-selected"]
|
|
@@ -2063,13 +2040,13 @@ var CalendarCell = (props) => {
|
|
|
2063
2040
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("td", { className: "group/cell", ...cellProps, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2064
2041
|
"div",
|
|
2065
2042
|
{
|
|
2066
|
-
className: (0,
|
|
2043
|
+
className: (0, import_system39.cn)(
|
|
2067
2044
|
"flex h-[30px] w-[30px] cursor-pointer items-center justify-center rounded-full p-[5.3px] text-sm font-normal aria-disabled:cursor-default",
|
|
2068
2045
|
classNames2.calendarCell
|
|
2069
2046
|
),
|
|
2070
2047
|
hidden: isOutsideVisibleRange,
|
|
2071
2048
|
ref,
|
|
2072
|
-
...(0,
|
|
2049
|
+
...(0, import_utils11.mergeProps)(buttonProps, stateProps, hoverProps),
|
|
2073
2050
|
children: formattedDate
|
|
2074
2051
|
}
|
|
2075
2052
|
) });
|
|
@@ -2088,7 +2065,7 @@ var CalendarGrid = ({ state, ...props }) => {
|
|
|
2088
2065
|
weekday: "short",
|
|
2089
2066
|
timeZone: state.timeZone
|
|
2090
2067
|
});
|
|
2091
|
-
const weekDays = (0,
|
|
2068
|
+
const weekDays = (0, import_react27.useMemo)(() => {
|
|
2092
2069
|
const weekStart = (0, import_date2.startOfWeek)((0, import_date2.today)(state.timeZone), locale);
|
|
2093
2070
|
return [...new Array(7).keys()].map((index) => {
|
|
2094
2071
|
const date = weekStart.add({ days: index });
|
|
@@ -2157,7 +2134,7 @@ var MonthDropdown = ({
|
|
|
2157
2134
|
var MonthDropdown_default = MonthDropdown;
|
|
2158
2135
|
|
|
2159
2136
|
// src/Calendar/YearDropdown.tsx
|
|
2160
|
-
var
|
|
2137
|
+
var import_react28 = require("react");
|
|
2161
2138
|
var import_i18n6 = require("@react-aria/i18n");
|
|
2162
2139
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2163
2140
|
var YearDropdown = ({ state, setSelectedDropdown }) => {
|
|
@@ -2173,8 +2150,8 @@ var YearDropdown = ({ state, setSelectedDropdown }) => {
|
|
|
2173
2150
|
formatted: formatter.format(date.toDate(state.timeZone))
|
|
2174
2151
|
});
|
|
2175
2152
|
}
|
|
2176
|
-
const activeButtonRef = (0,
|
|
2177
|
-
(0,
|
|
2153
|
+
const activeButtonRef = (0, import_react28.useRef)(null);
|
|
2154
|
+
(0, import_react28.useEffect)(() => {
|
|
2178
2155
|
if (activeButtonRef.current) {
|
|
2179
2156
|
const activeButton = activeButtonRef.current;
|
|
2180
2157
|
activeButton == null ? void 0 : activeButton.scrollIntoView({
|
|
@@ -2244,7 +2221,7 @@ var Calendar = ({
|
|
|
2244
2221
|
locale,
|
|
2245
2222
|
createCalendar: import_date3.createCalendar
|
|
2246
2223
|
});
|
|
2247
|
-
const ref = (0,
|
|
2224
|
+
const ref = (0, import_react29.useRef)(null);
|
|
2248
2225
|
const { calendarProps, prevButtonProps, nextButtonProps } = (0, import_calendar3.useCalendar)(
|
|
2249
2226
|
props,
|
|
2250
2227
|
state
|
|
@@ -2259,13 +2236,13 @@ var Calendar = ({
|
|
|
2259
2236
|
onFocusChange: nextFocusChange,
|
|
2260
2237
|
...nextPropsRest
|
|
2261
2238
|
} = nextButtonProps;
|
|
2262
|
-
const calendarState = (0,
|
|
2239
|
+
const calendarState = (0, import_system40.useStateProps)({
|
|
2263
2240
|
disabled: state.isDisabled,
|
|
2264
2241
|
focusVisible: state.isFocused
|
|
2265
2242
|
});
|
|
2266
|
-
const classNames2 = (0,
|
|
2267
|
-
const { select: selectClassNames } = (0,
|
|
2268
|
-
const [selectedDropdown, setSelectedDropdown] = (0,
|
|
2243
|
+
const classNames2 = (0, import_system40.useClassNames)({ component: "Calendar" });
|
|
2244
|
+
const { select: selectClassNames } = (0, import_system40.useClassNames)({ component: "Select" });
|
|
2245
|
+
const [selectedDropdown, setSelectedDropdown] = (0, import_react29.useState)();
|
|
2269
2246
|
let months = [];
|
|
2270
2247
|
let formatter = (0, import_i18n7.useDateFormatter)({
|
|
2271
2248
|
month: "long",
|
|
@@ -2284,7 +2261,7 @@ var Calendar = ({
|
|
|
2284
2261
|
"div",
|
|
2285
2262
|
{
|
|
2286
2263
|
tabIndex: -1,
|
|
2287
|
-
className: (0,
|
|
2264
|
+
className: (0, import_system40.cn)(
|
|
2288
2265
|
"flex min-h-[350px] w-[360px] flex-col rounded-sm p-4 shadow-[0_4px_4px_rgba(165,165,165,0.25)]",
|
|
2289
2266
|
classNames2.calendar
|
|
2290
2267
|
),
|
|
@@ -2312,7 +2289,7 @@ var Calendar = ({
|
|
|
2312
2289
|
{
|
|
2313
2290
|
disabled: state.isDisabled,
|
|
2314
2291
|
onClick: () => setSelectedDropdown("month"),
|
|
2315
|
-
className: (0,
|
|
2292
|
+
className: (0, import_system40.cn)(buttonStyles, selectClassNames),
|
|
2316
2293
|
"data-testid": "month",
|
|
2317
2294
|
children: [
|
|
2318
2295
|
selectedValue.month,
|
|
@@ -2325,7 +2302,7 @@ var Calendar = ({
|
|
|
2325
2302
|
{
|
|
2326
2303
|
disabled: state.isDisabled,
|
|
2327
2304
|
onClick: () => setSelectedDropdown("year"),
|
|
2328
|
-
className: (0,
|
|
2305
|
+
className: (0, import_system40.cn)(buttonStyles, selectClassNames),
|
|
2329
2306
|
"data-testid": "year",
|
|
2330
2307
|
children: [
|
|
2331
2308
|
selectedValue.year,
|
|
@@ -2337,7 +2314,7 @@ var Calendar = ({
|
|
|
2337
2314
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
2338
2315
|
"div",
|
|
2339
2316
|
{
|
|
2340
|
-
className: (0,
|
|
2317
|
+
className: (0, import_system40.cn)(
|
|
2341
2318
|
"flex w-full flex-nowrap justify-end gap-[10px] [&_button:disabled]:cursor-not-allowed [&_button]:px-2 [&_button]:py-1",
|
|
2342
2319
|
classNames2.calendarControllers
|
|
2343
2320
|
),
|
|
@@ -2355,11 +2332,11 @@ var Calendar = ({
|
|
|
2355
2332
|
};
|
|
2356
2333
|
|
|
2357
2334
|
// src/DatePicker/DatePicker.tsx
|
|
2358
|
-
var
|
|
2335
|
+
var import_react30 = require("react");
|
|
2359
2336
|
var import_datepicker4 = require("@react-aria/datepicker");
|
|
2360
|
-
var
|
|
2337
|
+
var import_utils12 = require("@react-aria/utils");
|
|
2361
2338
|
var import_datepicker5 = require("@react-stately/datepicker");
|
|
2362
|
-
var
|
|
2339
|
+
var import_system41 = require("@marigold/system");
|
|
2363
2340
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2364
2341
|
var DatePicker = ({
|
|
2365
2342
|
disabled,
|
|
@@ -2384,8 +2361,8 @@ var DatePicker = ({
|
|
|
2384
2361
|
shouldCloseOnSelect,
|
|
2385
2362
|
...props
|
|
2386
2363
|
});
|
|
2387
|
-
const ref = (0,
|
|
2388
|
-
const stateProps = (0,
|
|
2364
|
+
const ref = (0, import_react30.useRef)(null);
|
|
2365
|
+
const stateProps = (0, import_system41.useStateProps)({
|
|
2389
2366
|
focus: state.isOpen
|
|
2390
2367
|
});
|
|
2391
2368
|
const { groupProps, fieldProps, buttonProps, calendarProps } = (0, import_datepicker4.useDatePicker)(
|
|
@@ -2394,7 +2371,7 @@ var DatePicker = ({
|
|
|
2394
2371
|
ref
|
|
2395
2372
|
);
|
|
2396
2373
|
const { isDisabled, errorMessage, description, label } = props;
|
|
2397
|
-
const classNames2 = (0,
|
|
2374
|
+
const classNames2 = (0, import_system41.useClassNames)({
|
|
2398
2375
|
component: "DatePicker",
|
|
2399
2376
|
size,
|
|
2400
2377
|
variant
|
|
@@ -2416,7 +2393,7 @@ var DatePicker = ({
|
|
|
2416
2393
|
action: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: classNames2.container, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2417
2394
|
_Button,
|
|
2418
2395
|
{
|
|
2419
|
-
...(0,
|
|
2396
|
+
...(0, import_utils12.mergeProps)(buttonProps, stateProps),
|
|
2420
2397
|
disabled: isDisabled,
|
|
2421
2398
|
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2422
2399
|
"svg",
|
|
@@ -2437,43 +2414,43 @@ var DatePicker = ({
|
|
|
2437
2414
|
};
|
|
2438
2415
|
|
|
2439
2416
|
// src/Inset/Inset.tsx
|
|
2440
|
-
var
|
|
2417
|
+
var import_system42 = require("@marigold/system");
|
|
2441
2418
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2442
2419
|
var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2443
2420
|
"div",
|
|
2444
2421
|
{
|
|
2445
|
-
className: (0,
|
|
2446
|
-
space &&
|
|
2447
|
-
!space && spaceX &&
|
|
2448
|
-
!space && spaceY &&
|
|
2422
|
+
className: (0, import_system42.cn)(
|
|
2423
|
+
space && import_system42.paddingSpace[space],
|
|
2424
|
+
!space && spaceX && import_system42.paddingSpaceX[spaceX],
|
|
2425
|
+
!space && spaceY && import_system42.paddingSpaceY[spaceY]
|
|
2449
2426
|
),
|
|
2450
2427
|
children
|
|
2451
2428
|
}
|
|
2452
2429
|
);
|
|
2453
2430
|
|
|
2454
2431
|
// src/Link/Link.tsx
|
|
2455
|
-
var
|
|
2456
|
-
var
|
|
2457
|
-
var
|
|
2432
|
+
var import_react31 = require("react");
|
|
2433
|
+
var import_react_aria_components13 = require("react-aria-components");
|
|
2434
|
+
var import_system43 = require("@marigold/system");
|
|
2458
2435
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2459
|
-
var _Link = (0,
|
|
2436
|
+
var _Link = (0, import_react31.forwardRef)(
|
|
2460
2437
|
({ variant, size, disabled, children, ...props }, ref) => {
|
|
2461
|
-
const classNames2 = (0,
|
|
2438
|
+
const classNames2 = (0, import_system43.useClassNames)({
|
|
2462
2439
|
component: "Link",
|
|
2463
2440
|
variant,
|
|
2464
2441
|
size
|
|
2465
2442
|
});
|
|
2466
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_aria_components13.Link, { ...props, ref, className: classNames2, isDisabled: disabled, children });
|
|
2467
2444
|
}
|
|
2468
2445
|
);
|
|
2469
2446
|
|
|
2470
2447
|
// src/List/List.tsx
|
|
2471
|
-
var
|
|
2448
|
+
var import_system44 = require("@marigold/system");
|
|
2472
2449
|
|
|
2473
2450
|
// src/List/Context.ts
|
|
2474
|
-
var
|
|
2475
|
-
var ListContext = (0,
|
|
2476
|
-
var useListContext = () => (0,
|
|
2451
|
+
var import_react32 = require("react");
|
|
2452
|
+
var ListContext = (0, import_react32.createContext)({});
|
|
2453
|
+
var useListContext = () => (0, import_react32.useContext)(ListContext);
|
|
2477
2454
|
|
|
2478
2455
|
// src/List/ListItem.tsx
|
|
2479
2456
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
@@ -2492,30 +2469,30 @@ var List = ({
|
|
|
2492
2469
|
...props
|
|
2493
2470
|
}) => {
|
|
2494
2471
|
const Component = as;
|
|
2495
|
-
const classNames2 = (0,
|
|
2472
|
+
const classNames2 = (0, import_system44.useClassNames)({ component: "List", variant, size });
|
|
2496
2473
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Component, { ...props, className: classNames2[as], children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ListContext.Provider, { value: { classNames: classNames2.item }, children }) });
|
|
2497
2474
|
};
|
|
2498
2475
|
List.Item = ListItem;
|
|
2499
2476
|
|
|
2500
2477
|
// src/Menu/Menu.tsx
|
|
2501
|
-
var
|
|
2478
|
+
var import_react36 = require("react");
|
|
2502
2479
|
var import_menu5 = require("@react-aria/menu");
|
|
2503
|
-
var
|
|
2480
|
+
var import_utils15 = require("@react-aria/utils");
|
|
2504
2481
|
var import_collections4 = require("@react-stately/collections");
|
|
2505
2482
|
var import_tree2 = require("@react-stately/tree");
|
|
2506
|
-
var
|
|
2483
|
+
var import_system48 = require("@marigold/system");
|
|
2507
2484
|
|
|
2508
2485
|
// src/Menu/Context.ts
|
|
2509
|
-
var
|
|
2510
|
-
var MenuContext = (0,
|
|
2511
|
-
var useMenuContext = () => (0,
|
|
2486
|
+
var import_react33 = require("react");
|
|
2487
|
+
var MenuContext = (0, import_react33.createContext)({});
|
|
2488
|
+
var useMenuContext = () => (0, import_react33.useContext)(MenuContext);
|
|
2512
2489
|
|
|
2513
2490
|
// src/Menu/MenuItem.tsx
|
|
2514
|
-
var
|
|
2515
|
-
var
|
|
2491
|
+
var import_react34 = require("react");
|
|
2492
|
+
var import_focus7 = require("@react-aria/focus");
|
|
2516
2493
|
var import_menu = require("@react-aria/menu");
|
|
2517
|
-
var
|
|
2518
|
-
var
|
|
2494
|
+
var import_utils13 = require("@react-aria/utils");
|
|
2495
|
+
var import_system45 = require("@marigold/system");
|
|
2519
2496
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2520
2497
|
var MenuItem = ({
|
|
2521
2498
|
item,
|
|
@@ -2523,7 +2500,7 @@ var MenuItem = ({
|
|
|
2523
2500
|
onAction,
|
|
2524
2501
|
className
|
|
2525
2502
|
}) => {
|
|
2526
|
-
const ref = (0,
|
|
2503
|
+
const ref = (0, import_react34.useRef)(null);
|
|
2527
2504
|
const { onClose } = useMenuContext();
|
|
2528
2505
|
const { menuItemProps } = (0, import_menu.useMenuItem)(
|
|
2529
2506
|
{
|
|
@@ -2534,8 +2511,8 @@ var MenuItem = ({
|
|
|
2534
2511
|
state,
|
|
2535
2512
|
ref
|
|
2536
2513
|
);
|
|
2537
|
-
const { isFocusVisible, focusProps } = (0,
|
|
2538
|
-
const stateProps = (0,
|
|
2514
|
+
const { isFocusVisible, focusProps } = (0, import_focus7.useFocusRing)();
|
|
2515
|
+
const stateProps = (0, import_system45.useStateProps)({
|
|
2539
2516
|
focus: isFocusVisible
|
|
2540
2517
|
});
|
|
2541
2518
|
const { onPointerUp, ...props } = menuItemProps;
|
|
@@ -2544,7 +2521,7 @@ var MenuItem = ({
|
|
|
2544
2521
|
{
|
|
2545
2522
|
ref,
|
|
2546
2523
|
className,
|
|
2547
|
-
...(0,
|
|
2524
|
+
...(0, import_utils13.mergeProps)(
|
|
2548
2525
|
props,
|
|
2549
2526
|
{ onPointerDown: onPointerUp },
|
|
2550
2527
|
stateProps,
|
|
@@ -2557,14 +2534,14 @@ var MenuItem = ({
|
|
|
2557
2534
|
|
|
2558
2535
|
// src/Menu/MenuSection.tsx
|
|
2559
2536
|
var import_menu2 = require("@react-aria/menu");
|
|
2560
|
-
var
|
|
2537
|
+
var import_system46 = require("@marigold/system");
|
|
2561
2538
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2562
2539
|
var MenuSection = ({ onAction, item, state }) => {
|
|
2563
2540
|
let { itemProps, headingProps, groupProps } = (0, import_menu2.useMenuSection)({
|
|
2564
2541
|
heading: item.rendered,
|
|
2565
2542
|
"aria-label": item["aria-label"]
|
|
2566
2543
|
});
|
|
2567
|
-
const className = (0,
|
|
2544
|
+
const className = (0, import_system46.useClassNames)({ component: "Menu" });
|
|
2568
2545
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
2569
2546
|
item.key !== state.collection.getFirstKey() && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(_Divider, { variant: "section" }) }),
|
|
2570
2547
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("li", { ...itemProps, children: [
|
|
@@ -2585,12 +2562,12 @@ var MenuSection = ({ onAction, item, state }) => {
|
|
|
2585
2562
|
var MenuSection_default = MenuSection;
|
|
2586
2563
|
|
|
2587
2564
|
// src/Menu/MenuTrigger.tsx
|
|
2588
|
-
var
|
|
2589
|
-
var
|
|
2565
|
+
var import_react35 = require("react");
|
|
2566
|
+
var import_interactions4 = require("@react-aria/interactions");
|
|
2590
2567
|
var import_menu3 = require("@react-aria/menu");
|
|
2591
|
-
var
|
|
2568
|
+
var import_utils14 = require("@react-aria/utils");
|
|
2592
2569
|
var import_menu4 = require("@react-stately/menu");
|
|
2593
|
-
var
|
|
2570
|
+
var import_system47 = require("@marigold/system");
|
|
2594
2571
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2595
2572
|
var MenuTrigger = ({
|
|
2596
2573
|
disabled,
|
|
@@ -2598,9 +2575,9 @@ var MenuTrigger = ({
|
|
|
2598
2575
|
onOpenChange,
|
|
2599
2576
|
children
|
|
2600
2577
|
}) => {
|
|
2601
|
-
const [menuTrigger, menu] =
|
|
2602
|
-
const menuTriggerRef = (0,
|
|
2603
|
-
const menuRef = (0,
|
|
2578
|
+
const [menuTrigger, menu] = import_react35.Children.toArray(children);
|
|
2579
|
+
const menuTriggerRef = (0, import_react35.useRef)(null);
|
|
2580
|
+
const menuRef = (0, import_utils14.useObjectRef)();
|
|
2604
2581
|
const state = (0, import_menu4.useMenuTriggerState)({
|
|
2605
2582
|
isOpen: open,
|
|
2606
2583
|
onOpenChange
|
|
@@ -2617,10 +2594,10 @@ var MenuTrigger = ({
|
|
|
2617
2594
|
onClose: state.close,
|
|
2618
2595
|
autoFocus: state.focusStrategy
|
|
2619
2596
|
};
|
|
2620
|
-
const isSmallScreen = (0,
|
|
2597
|
+
const isSmallScreen = (0, import_system47.useSmallScreen)();
|
|
2621
2598
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(MenuContext.Provider, { value: menuContext, children: [
|
|
2622
2599
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2623
|
-
|
|
2600
|
+
import_interactions4.PressResponder,
|
|
2624
2601
|
{
|
|
2625
2602
|
...menuTriggerProps,
|
|
2626
2603
|
ref: menuTriggerRef,
|
|
@@ -2637,11 +2614,11 @@ var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
|
2637
2614
|
var Menu = ({ variant, size, ...props }) => {
|
|
2638
2615
|
const { ref: scrollRef, ...menuContext } = useMenuContext();
|
|
2639
2616
|
const ownProps = { ...props, ...menuContext };
|
|
2640
|
-
const ref = (0,
|
|
2617
|
+
const ref = (0, import_react36.useRef)(null);
|
|
2641
2618
|
const state = (0, import_tree2.useTreeState)({ ...ownProps, selectionMode: "none" });
|
|
2642
2619
|
const { menuProps } = (0, import_menu5.useMenu)(ownProps, state, ref);
|
|
2643
|
-
(0,
|
|
2644
|
-
const classNames2 = (0,
|
|
2620
|
+
(0, import_utils15.useSyncRef)({ ref: scrollRef }, ref);
|
|
2621
|
+
const classNames2 = (0, import_system48.useClassNames)({ component: "Menu", variant, size });
|
|
2645
2622
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { ref, className: classNames2.container, ...menuProps, children: [...state.collection].map((item) => {
|
|
2646
2623
|
if (item.type === "section") {
|
|
2647
2624
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
@@ -2671,19 +2648,35 @@ Menu.Item = import_collections4.Item;
|
|
|
2671
2648
|
Menu.Section = import_collections4.Section;
|
|
2672
2649
|
|
|
2673
2650
|
// src/Menu/ActionMenu.tsx
|
|
2674
|
-
var
|
|
2651
|
+
var import_system49 = require("@marigold/system");
|
|
2675
2652
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2676
2653
|
var ActionMenu = (props) => {
|
|
2677
2654
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Menu.Trigger, { children: [
|
|
2678
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(_Button, { variant: "menu", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2655
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(_Button, { variant: "menu", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_system49.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("path", { d: "M12.0117 7.47656C13.2557 7.47656 14.2734 6.45879 14.2734 5.21484C14.2734 3.9709 13.2557 2.95312 12.0117 2.95312C10.7678 2.95312 9.75 3.9709 9.75 5.21484C9.75 6.45879 10.7678 7.47656 12.0117 7.47656ZM12.0117 9.73828C10.7678 9.73828 9.75 10.7561 9.75 12C9.75 13.2439 10.7678 14.2617 12.0117 14.2617C13.2557 14.2617 14.2734 13.2439 14.2734 12C14.2734 10.7561 13.2557 9.73828 12.0117 9.73828ZM12.0117 16.5234C10.7678 16.5234 9.75 17.5412 9.75 18.7852C9.75 20.0291 10.7678 21.0469 12.0117 21.0469C13.2557 21.0469 14.2734 20.0291 14.2734 18.7852C14.2734 17.5412 13.2557 16.5234 12.0117 16.5234Z" }) }) }),
|
|
2679
2656
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Menu, { ...props })
|
|
2680
2657
|
] });
|
|
2681
2658
|
};
|
|
2682
2659
|
|
|
2683
2660
|
// src/Message/Message.tsx
|
|
2684
|
-
var
|
|
2661
|
+
var import_system50 = require("@marigold/system");
|
|
2685
2662
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2686
2663
|
var icons = {
|
|
2664
|
+
success: () => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2665
|
+
"svg",
|
|
2666
|
+
{
|
|
2667
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2668
|
+
viewBox: "0 0 24 24",
|
|
2669
|
+
fill: "currentColor",
|
|
2670
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2671
|
+
"path",
|
|
2672
|
+
{
|
|
2673
|
+
fillRule: "evenodd",
|
|
2674
|
+
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z",
|
|
2675
|
+
clipRule: "evenodd"
|
|
2676
|
+
}
|
|
2677
|
+
)
|
|
2678
|
+
}
|
|
2679
|
+
),
|
|
2687
2680
|
info: () => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2688
2681
|
"svg",
|
|
2689
2682
|
{
|
|
@@ -2740,49 +2733,100 @@ var Message = ({
|
|
|
2740
2733
|
children,
|
|
2741
2734
|
...props
|
|
2742
2735
|
}) => {
|
|
2743
|
-
const classNames2 = (0,
|
|
2736
|
+
const classNames2 = (0, import_system50.useClassNames)({ component: "Message", variant, size });
|
|
2744
2737
|
const Icon3 = icons[variant];
|
|
2745
2738
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
2746
2739
|
"div",
|
|
2747
2740
|
{
|
|
2748
|
-
className: (0,
|
|
2741
|
+
className: (0, import_system50.cn)(
|
|
2749
2742
|
"grid auto-rows-min grid-cols-[min-content_auto] gap-1",
|
|
2750
2743
|
classNames2.container
|
|
2751
2744
|
),
|
|
2752
2745
|
...props,
|
|
2753
2746
|
children: [
|
|
2754
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0,
|
|
2747
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0, import_system50.cn)("col-span-1 h-5 w-5 self-center", classNames2.icon), children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon3, {}) }),
|
|
2755
2748
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2756
2749
|
"div",
|
|
2757
2750
|
{
|
|
2758
|
-
className: (0,
|
|
2751
|
+
className: (0, import_system50.cn)("col-start-2 row-start-1 self-center", classNames2.title),
|
|
2759
2752
|
children: messageTitle
|
|
2760
2753
|
}
|
|
2761
2754
|
),
|
|
2762
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0,
|
|
2755
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0, import_system50.cn)("col-start-2", classNames2.content), children })
|
|
2763
2756
|
]
|
|
2764
2757
|
}
|
|
2765
2758
|
);
|
|
2766
2759
|
};
|
|
2767
2760
|
|
|
2768
2761
|
// src/NumberField/NumberField.tsx
|
|
2769
|
-
var import_react39 = require("react");
|
|
2770
|
-
var import_focus9 = require("@react-aria/focus");
|
|
2771
|
-
var import_i18n8 = require("@react-aria/i18n");
|
|
2772
|
-
var import_interactions7 = require("@react-aria/interactions");
|
|
2773
|
-
var import_numberfield = require("@react-aria/numberfield");
|
|
2774
|
-
var import_utils18 = require("@react-aria/utils");
|
|
2775
|
-
var import_numberfield2 = require("@react-stately/numberfield");
|
|
2776
|
-
var import_system50 = require("@marigold/system");
|
|
2777
|
-
|
|
2778
|
-
// src/NumberField/StepButton.tsx
|
|
2779
2762
|
var import_react38 = require("react");
|
|
2780
|
-
var
|
|
2781
|
-
var
|
|
2782
|
-
|
|
2783
|
-
|
|
2763
|
+
var import_react_aria_components16 = require("react-aria-components");
|
|
2764
|
+
var import_system53 = require("@marigold/system");
|
|
2765
|
+
|
|
2766
|
+
// src/Input/_Input.tsx
|
|
2767
|
+
var import_react37 = require("react");
|
|
2768
|
+
var import_react_aria_components14 = require("react-aria-components");
|
|
2769
|
+
var import_system51 = require("@marigold/system");
|
|
2784
2770
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2785
|
-
var
|
|
2771
|
+
var _Input = (0, import_react37.forwardRef)(
|
|
2772
|
+
({ type, icon, action, variant, size, className, ...props }, ref) => {
|
|
2773
|
+
const classNames2 = (0, import_system51.useClassNames)({
|
|
2774
|
+
component: "Input",
|
|
2775
|
+
variant,
|
|
2776
|
+
size
|
|
2777
|
+
});
|
|
2778
|
+
const inputIcon = icon ? (0, import_react37.cloneElement)(icon, {
|
|
2779
|
+
className: (0, import_system51.cn)(
|
|
2780
|
+
"pointer-events-none absolute",
|
|
2781
|
+
classNames2.icon,
|
|
2782
|
+
icon.props.className
|
|
2783
|
+
),
|
|
2784
|
+
...icon.props
|
|
2785
|
+
}) : null;
|
|
2786
|
+
const inputAction = action && !props.readOnly ? (0, import_react37.cloneElement)(action, {
|
|
2787
|
+
className: (0, import_system51.cn)(
|
|
2788
|
+
"absolute",
|
|
2789
|
+
classNames2.action,
|
|
2790
|
+
action.props.className
|
|
2791
|
+
),
|
|
2792
|
+
...action.props
|
|
2793
|
+
}) : null;
|
|
2794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
2795
|
+
"div",
|
|
2796
|
+
{
|
|
2797
|
+
className: "group/input relative flex items-center",
|
|
2798
|
+
"data-icon": icon && "",
|
|
2799
|
+
"data-action": action && "",
|
|
2800
|
+
children: [
|
|
2801
|
+
inputIcon,
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2803
|
+
import_react_aria_components14.Input,
|
|
2804
|
+
{
|
|
2805
|
+
...props,
|
|
2806
|
+
className: (0, import_system51.cn)(
|
|
2807
|
+
"w-full flex-1",
|
|
2808
|
+
"disabled:cursor-not-allowed",
|
|
2809
|
+
"[&[type=file]]:border-none [&[type=file]]:p-0",
|
|
2810
|
+
"[&[type=color]]:ml-0 [&[type=color]]:border-none [&[type=color]]:bg-transparent [&[type=color]]:p-0",
|
|
2811
|
+
classNames2.input,
|
|
2812
|
+
className
|
|
2813
|
+
),
|
|
2814
|
+
ref,
|
|
2815
|
+
type
|
|
2816
|
+
}
|
|
2817
|
+
),
|
|
2818
|
+
inputAction
|
|
2819
|
+
]
|
|
2820
|
+
}
|
|
2821
|
+
);
|
|
2822
|
+
}
|
|
2823
|
+
);
|
|
2824
|
+
|
|
2825
|
+
// src/NumberField/StepButton.tsx
|
|
2826
|
+
var import_react_aria_components15 = require("react-aria-components");
|
|
2827
|
+
var import_system52 = require("@marigold/system");
|
|
2828
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2829
|
+
var Plus = () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2786
2830
|
"path",
|
|
2787
2831
|
{
|
|
2788
2832
|
fillRule: "evenodd",
|
|
@@ -2790,7 +2834,7 @@ var Plus = () => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("svg", { width: 1
|
|
|
2790
2834
|
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"
|
|
2791
2835
|
}
|
|
2792
2836
|
) });
|
|
2793
|
-
var Minus = () => /* @__PURE__ */ (0,
|
|
2837
|
+
var Minus = () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2794
2838
|
"path",
|
|
2795
2839
|
{
|
|
2796
2840
|
fillRule: "evenodd",
|
|
@@ -2798,47 +2842,30 @@ var Minus = () => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("svg", { width:
|
|
|
2798
2842
|
d: "M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
2799
2843
|
}
|
|
2800
2844
|
) });
|
|
2801
|
-
var
|
|
2802
|
-
direction,
|
|
2803
|
-
className,
|
|
2804
|
-
...props
|
|
2805
|
-
}) => {
|
|
2806
|
-
const ref = (0, import_react38.useRef)(null);
|
|
2807
|
-
const { buttonProps, isPressed } = (0, import_button4.useButton)(
|
|
2808
|
-
{ ...props, elementType: "div" },
|
|
2809
|
-
ref
|
|
2810
|
-
);
|
|
2811
|
-
const { hoverProps, isHovered } = (0, import_interactions6.useHover)(props);
|
|
2812
|
-
const stateProps = (0, import_system49.useStateProps)({
|
|
2813
|
-
active: isPressed,
|
|
2814
|
-
hover: isHovered,
|
|
2815
|
-
disabled: props.isDisabled
|
|
2816
|
-
});
|
|
2845
|
+
var _StepButton = ({ direction, className, ...props }) => {
|
|
2817
2846
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
2818
|
-
return /* @__PURE__ */ (0,
|
|
2819
|
-
|
|
2847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2848
|
+
import_react_aria_components15.Button,
|
|
2820
2849
|
{
|
|
2821
|
-
className: (0,
|
|
2850
|
+
className: (0, import_system52.cn)(
|
|
2822
2851
|
[
|
|
2823
2852
|
"flex items-center justify-center",
|
|
2824
2853
|
"cursor-pointer data-[disabled]:cursor-not-allowed"
|
|
2825
2854
|
],
|
|
2826
2855
|
className
|
|
2827
2856
|
),
|
|
2828
|
-
...
|
|
2829
|
-
|
|
2830
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Icon3, {})
|
|
2857
|
+
...props,
|
|
2858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Icon3, {})
|
|
2831
2859
|
}
|
|
2832
2860
|
);
|
|
2833
2861
|
};
|
|
2834
2862
|
|
|
2835
2863
|
// src/NumberField/NumberField.tsx
|
|
2836
|
-
var
|
|
2837
|
-
var
|
|
2864
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2865
|
+
var _NumberField = (0, import_react38.forwardRef)(
|
|
2838
2866
|
({
|
|
2839
2867
|
variant,
|
|
2840
2868
|
size,
|
|
2841
|
-
width,
|
|
2842
2869
|
disabled,
|
|
2843
2870
|
required,
|
|
2844
2871
|
readOnly,
|
|
@@ -2846,134 +2873,81 @@ var NumberField = (0, import_react39.forwardRef)(
|
|
|
2846
2873
|
hideStepper,
|
|
2847
2874
|
...rest
|
|
2848
2875
|
}, ref) => {
|
|
2876
|
+
const classNames2 = (0, import_system53.useClassNames)({
|
|
2877
|
+
component: "NumberField",
|
|
2878
|
+
size,
|
|
2879
|
+
variant
|
|
2880
|
+
});
|
|
2849
2881
|
const props = {
|
|
2850
2882
|
isDisabled: disabled,
|
|
2851
|
-
isRequired: required,
|
|
2852
2883
|
isReadOnly: readOnly,
|
|
2853
|
-
|
|
2884
|
+
isInvalid: error,
|
|
2885
|
+
isRequired: required,
|
|
2854
2886
|
...rest
|
|
2855
2887
|
};
|
|
2856
2888
|
const showStepper = !hideStepper;
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
component: "NumberField",
|
|
2885
|
-
size,
|
|
2886
|
-
variant
|
|
2887
|
-
});
|
|
2888
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2889
|
-
FieldBase,
|
|
2890
|
-
{
|
|
2891
|
-
label: props.label,
|
|
2892
|
-
labelProps,
|
|
2893
|
-
description: props.description,
|
|
2894
|
-
descriptionProps,
|
|
2895
|
-
error,
|
|
2896
|
-
errorMessage: props.errorMessage,
|
|
2897
|
-
errorMessageProps,
|
|
2898
|
-
stateProps,
|
|
2899
|
-
variant,
|
|
2900
|
-
size,
|
|
2901
|
-
width,
|
|
2902
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
2903
|
-
"div",
|
|
2904
|
-
{
|
|
2905
|
-
"data-group": true,
|
|
2906
|
-
className: (0, import_system50.cn)("flex items-stretch", classNames2.group),
|
|
2907
|
-
"data-testid": "number-field-container",
|
|
2908
|
-
...(0, import_utils18.mergeProps)(groupProps, focusProps, hoverProps),
|
|
2909
|
-
...stateProps,
|
|
2910
|
-
children: [
|
|
2911
|
-
showStepper && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2912
|
-
StepButton,
|
|
2913
|
-
{
|
|
2914
|
-
className: classNames2.stepper,
|
|
2915
|
-
direction: "down",
|
|
2916
|
-
...decrementButtonProps
|
|
2917
|
-
}
|
|
2918
|
-
),
|
|
2919
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2920
|
-
Input,
|
|
2921
|
-
{
|
|
2922
|
-
ref: inputRef,
|
|
2923
|
-
variant,
|
|
2924
|
-
size,
|
|
2925
|
-
...inputProps,
|
|
2926
|
-
...stateProps
|
|
2927
|
-
}
|
|
2928
|
-
) }),
|
|
2929
|
-
showStepper && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2930
|
-
StepButton,
|
|
2931
|
-
{
|
|
2932
|
-
className: classNames2.stepper,
|
|
2933
|
-
direction: "up",
|
|
2934
|
-
...incrementButtonProps
|
|
2935
|
-
}
|
|
2936
|
-
)
|
|
2937
|
-
]
|
|
2938
|
-
}
|
|
2939
|
-
)
|
|
2940
|
-
}
|
|
2941
|
-
);
|
|
2889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(FieldBase2, { as: import_react_aria_components16.NumberField, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_react_aria_components16.Group, { className: (0, import_system53.cn)("flex items-stretch", classNames2.group), children: [
|
|
2890
|
+
showStepper && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
2891
|
+
_StepButton,
|
|
2892
|
+
{
|
|
2893
|
+
className: classNames2.stepper,
|
|
2894
|
+
direction: "down",
|
|
2895
|
+
slot: "decrement"
|
|
2896
|
+
}
|
|
2897
|
+
),
|
|
2898
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
2899
|
+
_Input,
|
|
2900
|
+
{
|
|
2901
|
+
ref,
|
|
2902
|
+
variant,
|
|
2903
|
+
size,
|
|
2904
|
+
className: classNames2.input
|
|
2905
|
+
}
|
|
2906
|
+
) }),
|
|
2907
|
+
showStepper && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
2908
|
+
_StepButton,
|
|
2909
|
+
{
|
|
2910
|
+
className: classNames2.stepper,
|
|
2911
|
+
direction: "up",
|
|
2912
|
+
slot: "increment"
|
|
2913
|
+
}
|
|
2914
|
+
)
|
|
2915
|
+
] }) });
|
|
2942
2916
|
}
|
|
2943
2917
|
);
|
|
2944
2918
|
|
|
2945
2919
|
// src/Provider/index.ts
|
|
2946
|
-
var
|
|
2920
|
+
var import_system55 = require("@marigold/system");
|
|
2947
2921
|
|
|
2948
2922
|
// src/Provider/MarigoldProvider.tsx
|
|
2949
|
-
var
|
|
2950
|
-
var
|
|
2951
|
-
var
|
|
2923
|
+
var import_overlays4 = require("@react-aria/overlays");
|
|
2924
|
+
var import_system54 = require("@marigold/system");
|
|
2925
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2952
2926
|
function MarigoldProvider({
|
|
2953
2927
|
children,
|
|
2954
2928
|
theme
|
|
2955
2929
|
}) {
|
|
2956
|
-
const outerTheme = (0,
|
|
2957
|
-
const isTopLevel = outerTheme ===
|
|
2958
|
-
return /* @__PURE__ */ (0,
|
|
2930
|
+
const outerTheme = (0, import_system54.useTheme)();
|
|
2931
|
+
const isTopLevel = outerTheme === import_system54.defaultTheme;
|
|
2932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_system54.ThemeProvider, { theme, children: isTopLevel ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_overlays4.OverlayProvider, { children }) : children });
|
|
2959
2933
|
}
|
|
2960
2934
|
|
|
2961
2935
|
// src/Radio/Radio.tsx
|
|
2962
|
-
var
|
|
2963
|
-
var
|
|
2964
|
-
var
|
|
2936
|
+
var import_react40 = require("react");
|
|
2937
|
+
var import_react_aria_components18 = require("react-aria-components");
|
|
2938
|
+
var import_system57 = require("@marigold/system");
|
|
2965
2939
|
|
|
2966
2940
|
// src/Radio/Context.ts
|
|
2967
|
-
var
|
|
2968
|
-
var RadioGroupContext = (0,
|
|
2941
|
+
var import_react39 = require("react");
|
|
2942
|
+
var RadioGroupContext = (0, import_react39.createContext)(
|
|
2969
2943
|
null
|
|
2970
2944
|
);
|
|
2971
|
-
var useRadioGroupContext = () => (0,
|
|
2945
|
+
var useRadioGroupContext = () => (0, import_react39.useContext)(RadioGroupContext);
|
|
2972
2946
|
|
|
2973
2947
|
// src/Radio/RadioGroup.tsx
|
|
2974
|
-
var
|
|
2975
|
-
var
|
|
2976
|
-
var
|
|
2948
|
+
var import_react_aria_components17 = require("react-aria-components");
|
|
2949
|
+
var import_system56 = require("@marigold/system");
|
|
2950
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2977
2951
|
var _RadioGroup = ({
|
|
2978
2952
|
variant,
|
|
2979
2953
|
size,
|
|
@@ -2989,7 +2963,7 @@ var _RadioGroup = ({
|
|
|
2989
2963
|
width,
|
|
2990
2964
|
...rest
|
|
2991
2965
|
}) => {
|
|
2992
|
-
const classNames2 = (0,
|
|
2966
|
+
const classNames2 = (0, import_system56.useClassNames)({ component: "Radio", variant, size });
|
|
2993
2967
|
const props = {
|
|
2994
2968
|
isDisabled: disabled,
|
|
2995
2969
|
isReadOnly: readOnly,
|
|
@@ -2997,10 +2971,10 @@ var _RadioGroup = ({
|
|
|
2997
2971
|
isInvalid: error,
|
|
2998
2972
|
...rest
|
|
2999
2973
|
};
|
|
3000
|
-
return /* @__PURE__ */ (0,
|
|
2974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3001
2975
|
FieldBase2,
|
|
3002
2976
|
{
|
|
3003
|
-
as:
|
|
2977
|
+
as: import_react_aria_components17.RadioGroup,
|
|
3004
2978
|
width,
|
|
3005
2979
|
label,
|
|
3006
2980
|
description,
|
|
@@ -3008,18 +2982,18 @@ var _RadioGroup = ({
|
|
|
3008
2982
|
variant,
|
|
3009
2983
|
size,
|
|
3010
2984
|
...props,
|
|
3011
|
-
children: /* @__PURE__ */ (0,
|
|
2985
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3012
2986
|
"div",
|
|
3013
2987
|
{
|
|
3014
2988
|
role: "presentation",
|
|
3015
2989
|
"data-testid": "group",
|
|
3016
2990
|
"data-orientation": orientation,
|
|
3017
|
-
className: (0,
|
|
2991
|
+
className: (0, import_system56.cn)(
|
|
3018
2992
|
classNames2.group,
|
|
3019
2993
|
"flex items-start",
|
|
3020
2994
|
orientation === "vertical" ? "flex-col gap-[0.5ch]" : "flex-row gap-[1.5ch]"
|
|
3021
2995
|
),
|
|
3022
|
-
children: /* @__PURE__ */ (0,
|
|
2996
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(RadioGroupContext.Provider, { value: { width, variant, size }, children })
|
|
3023
2997
|
}
|
|
3024
2998
|
)
|
|
3025
2999
|
}
|
|
@@ -3027,33 +3001,33 @@ var _RadioGroup = ({
|
|
|
3027
3001
|
};
|
|
3028
3002
|
|
|
3029
3003
|
// src/Radio/Radio.tsx
|
|
3030
|
-
var
|
|
3031
|
-
var Dot = () => /* @__PURE__ */ (0,
|
|
3032
|
-
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ (0,
|
|
3004
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3005
|
+
var Dot = () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("svg", { viewBox: "0 0 6 6", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("circle", { fill: "currentColor", cx: "3", cy: "3", r: "3" }) });
|
|
3006
|
+
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3033
3007
|
"div",
|
|
3034
3008
|
{
|
|
3035
|
-
className: (0,
|
|
3009
|
+
className: (0, import_system57.cn)(
|
|
3036
3010
|
"bg-secondary-50 flex h-4 w-4 items-center justify-center rounded-[50%] border p-1",
|
|
3037
3011
|
className
|
|
3038
3012
|
),
|
|
3039
3013
|
"aria-hidden": "true",
|
|
3040
3014
|
...props,
|
|
3041
|
-
children: checked ? /* @__PURE__ */ (0,
|
|
3015
|
+
children: checked ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Dot, {}) : null
|
|
3042
3016
|
}
|
|
3043
3017
|
);
|
|
3044
|
-
var _Radio = (0,
|
|
3018
|
+
var _Radio = (0, import_react40.forwardRef)(
|
|
3045
3019
|
({ value, disabled, width, children, ...props }, ref) => {
|
|
3046
3020
|
const { variant, size, width: groupWidth } = useRadioGroupContext();
|
|
3047
|
-
const classNames2 = (0,
|
|
3021
|
+
const classNames2 = (0, import_system57.useClassNames)({
|
|
3048
3022
|
component: "Radio",
|
|
3049
3023
|
variant: variant || props.variant,
|
|
3050
3024
|
size: size || props.size
|
|
3051
3025
|
});
|
|
3052
|
-
return /* @__PURE__ */ (0,
|
|
3053
|
-
|
|
3026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3027
|
+
import_react_aria_components18.Radio,
|
|
3054
3028
|
{
|
|
3055
3029
|
ref,
|
|
3056
|
-
className: (0,
|
|
3030
|
+
className: (0, import_system57.cn)(
|
|
3057
3031
|
"group/radio",
|
|
3058
3032
|
"relative flex items-center gap-[1ch]",
|
|
3059
3033
|
width || groupWidth || "w-full",
|
|
@@ -3062,18 +3036,18 @@ var _Radio = (0, import_react41.forwardRef)(
|
|
|
3062
3036
|
value,
|
|
3063
3037
|
isDisabled: disabled,
|
|
3064
3038
|
...props,
|
|
3065
|
-
children: ({ isSelected }) => /* @__PURE__ */ (0,
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3039
|
+
children: ({ isSelected }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3067
3041
|
Icon2,
|
|
3068
3042
|
{
|
|
3069
3043
|
checked: isSelected,
|
|
3070
|
-
className: (0,
|
|
3044
|
+
className: (0, import_system57.cn)(
|
|
3071
3045
|
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
3072
3046
|
classNames2.radio
|
|
3073
3047
|
)
|
|
3074
3048
|
}
|
|
3075
3049
|
),
|
|
3076
|
-
/* @__PURE__ */ (0,
|
|
3050
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: classNames2.label, children })
|
|
3077
3051
|
] })
|
|
3078
3052
|
}
|
|
3079
3053
|
);
|
|
@@ -3082,15 +3056,15 @@ var _Radio = (0, import_react41.forwardRef)(
|
|
|
3082
3056
|
_Radio.Group = _RadioGroup;
|
|
3083
3057
|
|
|
3084
3058
|
// src/Select/Select.tsx
|
|
3085
|
-
var
|
|
3086
|
-
var
|
|
3087
|
-
var
|
|
3088
|
-
var
|
|
3059
|
+
var import_react41 = require("react");
|
|
3060
|
+
var import_button3 = require("@react-aria/button");
|
|
3061
|
+
var import_focus8 = require("@react-aria/focus");
|
|
3062
|
+
var import_i18n8 = require("@react-aria/i18n");
|
|
3089
3063
|
var import_select = require("@react-aria/select");
|
|
3090
|
-
var
|
|
3064
|
+
var import_utils16 = require("@react-aria/utils");
|
|
3091
3065
|
var import_collections5 = require("@react-stately/collections");
|
|
3092
3066
|
var import_select2 = require("@react-stately/select");
|
|
3093
|
-
var
|
|
3067
|
+
var import_system58 = require("@marigold/system");
|
|
3094
3068
|
|
|
3095
3069
|
// src/Select/intl.ts
|
|
3096
3070
|
var messages = {
|
|
@@ -3103,8 +3077,8 @@ var messages = {
|
|
|
3103
3077
|
};
|
|
3104
3078
|
|
|
3105
3079
|
// src/Select/Select.tsx
|
|
3106
|
-
var
|
|
3107
|
-
var Select = (0,
|
|
3080
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3081
|
+
var Select = (0, import_react41.forwardRef)(
|
|
3108
3082
|
({
|
|
3109
3083
|
variant,
|
|
3110
3084
|
size,
|
|
@@ -3116,7 +3090,7 @@ var Select = (0, import_react42.forwardRef)(
|
|
|
3116
3090
|
onChange,
|
|
3117
3091
|
...rest
|
|
3118
3092
|
}, ref) => {
|
|
3119
|
-
const formatMessage = (0,
|
|
3093
|
+
const formatMessage = (0, import_i18n8.useLocalizedStringFormatter)(messages);
|
|
3120
3094
|
const props = {
|
|
3121
3095
|
isOpen: open,
|
|
3122
3096
|
isDisabled: disabled,
|
|
@@ -3126,8 +3100,8 @@ var Select = (0, import_react42.forwardRef)(
|
|
|
3126
3100
|
onSelectionChange: onChange,
|
|
3127
3101
|
...rest
|
|
3128
3102
|
};
|
|
3129
|
-
const buttonRef = (0,
|
|
3130
|
-
const listboxRef = (0,
|
|
3103
|
+
const buttonRef = (0, import_utils16.useObjectRef)(ref);
|
|
3104
|
+
const listboxRef = (0, import_react41.useRef)(null);
|
|
3131
3105
|
const state = (0, import_select2.useSelectState)(props);
|
|
3132
3106
|
const {
|
|
3133
3107
|
labelProps,
|
|
@@ -3137,21 +3111,21 @@ var Select = (0, import_react42.forwardRef)(
|
|
|
3137
3111
|
descriptionProps,
|
|
3138
3112
|
errorMessageProps
|
|
3139
3113
|
} = (0, import_select.useSelect)(props, state, buttonRef);
|
|
3140
|
-
const { buttonProps } = (0,
|
|
3114
|
+
const { buttonProps } = (0, import_button3.useButton)(
|
|
3141
3115
|
{ isDisabled: disabled, ...triggerProps },
|
|
3142
3116
|
buttonRef
|
|
3143
3117
|
);
|
|
3144
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3145
|
-
const classNames2 = (0,
|
|
3146
|
-
const isSmallScreen = (0,
|
|
3147
|
-
const stateProps = (0,
|
|
3118
|
+
const { focusProps, isFocusVisible } = (0, import_focus8.useFocusRing)();
|
|
3119
|
+
const classNames2 = (0, import_system58.useClassNames)({ component: "Select", variant, size });
|
|
3120
|
+
const isSmallScreen = (0, import_system58.useSmallScreen)();
|
|
3121
|
+
const stateProps = (0, import_system58.useStateProps)({
|
|
3148
3122
|
disabled,
|
|
3149
3123
|
error,
|
|
3150
3124
|
focusVisible: isFocusVisible,
|
|
3151
3125
|
expanded: state.isOpen,
|
|
3152
3126
|
required
|
|
3153
3127
|
});
|
|
3154
|
-
return /* @__PURE__ */ (0,
|
|
3128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
3155
3129
|
FieldBase,
|
|
3156
3130
|
{
|
|
3157
3131
|
variant,
|
|
@@ -3167,7 +3141,7 @@ var Select = (0, import_react42.forwardRef)(
|
|
|
3167
3141
|
stateProps,
|
|
3168
3142
|
disabled,
|
|
3169
3143
|
children: [
|
|
3170
|
-
/* @__PURE__ */ (0,
|
|
3144
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3171
3145
|
import_select.HiddenSelect,
|
|
3172
3146
|
{
|
|
3173
3147
|
state,
|
|
@@ -3177,23 +3151,23 @@ var Select = (0, import_react42.forwardRef)(
|
|
|
3177
3151
|
isDisabled: disabled
|
|
3178
3152
|
}
|
|
3179
3153
|
),
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3154
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
3181
3155
|
"button",
|
|
3182
3156
|
{
|
|
3183
|
-
className: (0,
|
|
3157
|
+
className: (0, import_system58.cn)(
|
|
3184
3158
|
"flex w-full items-center justify-between gap-1 overflow-hidden",
|
|
3185
3159
|
classNames2.select
|
|
3186
3160
|
),
|
|
3187
3161
|
ref: buttonRef,
|
|
3188
|
-
...(0,
|
|
3162
|
+
...(0, import_utils16.mergeProps)(buttonProps, focusProps),
|
|
3189
3163
|
...stateProps,
|
|
3190
3164
|
children: [
|
|
3191
|
-
/* @__PURE__ */ (0,
|
|
3192
|
-
/* @__PURE__ */ (0,
|
|
3165
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "overflow-hidden whitespace-nowrap", ...valueProps, children: state.selectedItem ? state.selectedItem.rendered : props.placeholder }),
|
|
3166
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ChevronDown, { className: "h-4 w-4" })
|
|
3193
3167
|
]
|
|
3194
3168
|
}
|
|
3195
3169
|
),
|
|
3196
|
-
isSmallScreen ? /* @__PURE__ */ (0,
|
|
3170
|
+
isSmallScreen ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Tray, { state, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3197
3171
|
ListBox,
|
|
3198
3172
|
{
|
|
3199
3173
|
ref: listboxRef,
|
|
@@ -3202,7 +3176,7 @@ var Select = (0, import_react42.forwardRef)(
|
|
|
3202
3176
|
size,
|
|
3203
3177
|
...menuProps
|
|
3204
3178
|
}
|
|
3205
|
-
) }) : /* @__PURE__ */ (0,
|
|
3179
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Popover, { state, triggerRef: buttonRef, scrollRef: listboxRef, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3206
3180
|
ListBox,
|
|
3207
3181
|
{
|
|
3208
3182
|
ref: listboxRef,
|
|
@@ -3221,11 +3195,11 @@ Select.Option = import_collections5.Item;
|
|
|
3221
3195
|
Select.Section = import_collections5.Section;
|
|
3222
3196
|
|
|
3223
3197
|
// src/Slider/Slider.tsx
|
|
3224
|
-
var
|
|
3225
|
-
var
|
|
3226
|
-
var
|
|
3227
|
-
var
|
|
3228
|
-
var _Slider = (0,
|
|
3198
|
+
var import_react42 = require("react");
|
|
3199
|
+
var import_react_aria_components19 = require("react-aria-components");
|
|
3200
|
+
var import_system59 = require("@marigold/system");
|
|
3201
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
3202
|
+
var _Slider = (0, import_react42.forwardRef)(
|
|
3229
3203
|
({
|
|
3230
3204
|
thumbLabels,
|
|
3231
3205
|
variant,
|
|
@@ -3234,7 +3208,7 @@ var _Slider = (0, import_react43.forwardRef)(
|
|
|
3234
3208
|
disabled,
|
|
3235
3209
|
...rest
|
|
3236
3210
|
}, ref) => {
|
|
3237
|
-
const classNames2 = (0,
|
|
3211
|
+
const classNames2 = (0, import_system59.useClassNames)({
|
|
3238
3212
|
component: "Slider",
|
|
3239
3213
|
variant,
|
|
3240
3214
|
size
|
|
@@ -3243,27 +3217,27 @@ var _Slider = (0, import_react43.forwardRef)(
|
|
|
3243
3217
|
isDisabled: disabled,
|
|
3244
3218
|
...rest
|
|
3245
3219
|
};
|
|
3246
|
-
return /* @__PURE__ */ (0,
|
|
3247
|
-
|
|
3220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
3221
|
+
import_react_aria_components19.Slider,
|
|
3248
3222
|
{
|
|
3249
|
-
className: (0,
|
|
3223
|
+
className: (0, import_system59.cn)(
|
|
3250
3224
|
"grid grid-cols-[auto_1fr] gap-y-1",
|
|
3251
3225
|
classNames2.container,
|
|
3252
|
-
|
|
3226
|
+
import_system59.width[width]
|
|
3253
3227
|
),
|
|
3254
3228
|
ref,
|
|
3255
3229
|
...props,
|
|
3256
3230
|
children: [
|
|
3257
|
-
/* @__PURE__ */ (0,
|
|
3258
|
-
/* @__PURE__ */ (0,
|
|
3259
|
-
/* @__PURE__ */ (0,
|
|
3260
|
-
|
|
3231
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(_Label, { children: props.children }),
|
|
3232
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_aria_components19.SliderOutput, { className: (0, import_system59.cn)("flex justify-end", classNames2.output), children: ({ state }) => state.values.map((_, i) => state.getThumbValueLabel(i)).join(" \u2013 ") }),
|
|
3233
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3234
|
+
import_react_aria_components19.SliderTrack,
|
|
3261
3235
|
{
|
|
3262
|
-
className: (0,
|
|
3263
|
-
children: ({ state }) => state.values.map((_, i) => /* @__PURE__ */ (0,
|
|
3264
|
-
|
|
3236
|
+
className: (0, import_system59.cn)("relative col-span-2 h-2 w-full", classNames2.track),
|
|
3237
|
+
children: ({ state }) => state.values.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3238
|
+
import_react_aria_components19.SliderThumb,
|
|
3265
3239
|
{
|
|
3266
|
-
className: (0,
|
|
3240
|
+
className: (0, import_system59.cn)("top-1/2 cursor-pointer", classNames2.thumb),
|
|
3267
3241
|
index: i,
|
|
3268
3242
|
"aria-label": thumbLabels == null ? void 0 : thumbLabels[i]
|
|
3269
3243
|
},
|
|
@@ -3278,12 +3252,12 @@ var _Slider = (0, import_react43.forwardRef)(
|
|
|
3278
3252
|
);
|
|
3279
3253
|
|
|
3280
3254
|
// src/Split/Split.tsx
|
|
3281
|
-
var
|
|
3282
|
-
var Split = (props) => /* @__PURE__ */ (0,
|
|
3255
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3256
|
+
var Split = (props) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { ...props, role: "separator", className: "grow" });
|
|
3283
3257
|
|
|
3284
3258
|
// src/Stack/Stack.tsx
|
|
3285
|
-
var
|
|
3286
|
-
var
|
|
3259
|
+
var import_system60 = require("@marigold/system");
|
|
3260
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3287
3261
|
var Stack = ({
|
|
3288
3262
|
children,
|
|
3289
3263
|
space = 0,
|
|
@@ -3294,14 +3268,14 @@ var Stack = ({
|
|
|
3294
3268
|
...props
|
|
3295
3269
|
}) => {
|
|
3296
3270
|
var _a, _b, _c, _d;
|
|
3297
|
-
return /* @__PURE__ */ (0,
|
|
3271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3298
3272
|
"div",
|
|
3299
3273
|
{
|
|
3300
|
-
className: (0,
|
|
3274
|
+
className: (0, import_system60.cn)(
|
|
3301
3275
|
"flex flex-col",
|
|
3302
|
-
|
|
3303
|
-
alignX && ((_b = (_a =
|
|
3304
|
-
alignY && ((_d = (_c =
|
|
3276
|
+
import_system60.gapSpace[space],
|
|
3277
|
+
alignX && ((_b = (_a = import_system60.alignment) == null ? void 0 : _a.vertical) == null ? void 0 : _b.alignmentX[alignX]),
|
|
3278
|
+
alignY && ((_d = (_c = import_system60.alignment) == null ? void 0 : _c.vertical) == null ? void 0 : _d.alignmentY[alignY]),
|
|
3305
3279
|
stretch && "h-full w-full"
|
|
3306
3280
|
),
|
|
3307
3281
|
...props,
|
|
@@ -3311,11 +3285,11 @@ var Stack = ({
|
|
|
3311
3285
|
};
|
|
3312
3286
|
|
|
3313
3287
|
// src/Switch/Switch.tsx
|
|
3314
|
-
var
|
|
3315
|
-
var
|
|
3316
|
-
var
|
|
3317
|
-
var
|
|
3318
|
-
var _Switch = (0,
|
|
3288
|
+
var import_react43 = require("react");
|
|
3289
|
+
var import_react_aria_components20 = require("react-aria-components");
|
|
3290
|
+
var import_system61 = require("@marigold/system");
|
|
3291
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
3292
|
+
var _Switch = (0, import_react43.forwardRef)(
|
|
3319
3293
|
({
|
|
3320
3294
|
variant,
|
|
3321
3295
|
size,
|
|
@@ -3326,37 +3300,37 @@ var _Switch = (0, import_react44.forwardRef)(
|
|
|
3326
3300
|
readOnly,
|
|
3327
3301
|
...rest
|
|
3328
3302
|
}, ref) => {
|
|
3329
|
-
const classNames2 = (0,
|
|
3303
|
+
const classNames2 = (0, import_system61.useClassNames)({ component: "Switch", size, variant });
|
|
3330
3304
|
const props = {
|
|
3331
3305
|
isDisabled: disabled,
|
|
3332
3306
|
isReadOnly: readOnly,
|
|
3333
3307
|
isSelected: selected,
|
|
3334
3308
|
...rest
|
|
3335
3309
|
};
|
|
3336
|
-
return /* @__PURE__ */ (0,
|
|
3337
|
-
|
|
3310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
3311
|
+
import_react_aria_components20.Switch,
|
|
3338
3312
|
{
|
|
3339
3313
|
...props,
|
|
3340
3314
|
ref,
|
|
3341
|
-
className: (0,
|
|
3342
|
-
|
|
3315
|
+
className: (0, import_system61.cn)(
|
|
3316
|
+
import_system61.width[width],
|
|
3343
3317
|
"group/switch",
|
|
3344
3318
|
"flex items-center justify-between gap-[1ch]",
|
|
3345
3319
|
classNames2.container
|
|
3346
3320
|
),
|
|
3347
3321
|
children: [
|
|
3348
|
-
/* @__PURE__ */ (0,
|
|
3349
|
-
/* @__PURE__ */ (0,
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(_Label, { elementType: "span", children }),
|
|
3323
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3350
3324
|
"div",
|
|
3351
3325
|
{
|
|
3352
|
-
className: (0,
|
|
3326
|
+
className: (0, import_system61.cn)(
|
|
3353
3327
|
"h-6 w-12 basis-12 rounded-3xl group-disabled/switch:cursor-not-allowed ",
|
|
3354
3328
|
classNames2.track
|
|
3355
3329
|
),
|
|
3356
|
-
children: /* @__PURE__ */ (0,
|
|
3330
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3357
3331
|
"div",
|
|
3358
3332
|
{
|
|
3359
|
-
className: (0,
|
|
3333
|
+
className: (0, import_system61.cn)(
|
|
3360
3334
|
"h-[22px] w-[22px]",
|
|
3361
3335
|
"cubic-bezier(.7,0,.3,1)",
|
|
3362
3336
|
"absolute left-0 top-px",
|
|
@@ -3375,33 +3349,33 @@ var _Switch = (0, import_react44.forwardRef)(
|
|
|
3375
3349
|
);
|
|
3376
3350
|
|
|
3377
3351
|
// src/Table/Table.tsx
|
|
3378
|
-
var
|
|
3352
|
+
var import_react51 = require("react");
|
|
3379
3353
|
var import_table9 = require("@react-aria/table");
|
|
3380
3354
|
var import_table10 = require("@react-stately/table");
|
|
3381
|
-
var
|
|
3355
|
+
var import_system68 = require("@marigold/system");
|
|
3382
3356
|
|
|
3383
3357
|
// src/Table/Context.tsx
|
|
3384
|
-
var
|
|
3385
|
-
var TableContext = (0,
|
|
3386
|
-
var useTableContext = () => (0,
|
|
3358
|
+
var import_react44 = require("react");
|
|
3359
|
+
var TableContext = (0, import_react44.createContext)({});
|
|
3360
|
+
var useTableContext = () => (0, import_react44.useContext)(TableContext);
|
|
3387
3361
|
|
|
3388
3362
|
// src/Table/TableBody.tsx
|
|
3389
3363
|
var import_table = require("@react-aria/table");
|
|
3390
|
-
var
|
|
3364
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
3391
3365
|
var TableBody = ({ children }) => {
|
|
3392
3366
|
const { rowGroupProps } = (0, import_table.useTableRowGroup)();
|
|
3393
|
-
return /* @__PURE__ */ (0,
|
|
3367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("tbody", { ...rowGroupProps, children });
|
|
3394
3368
|
};
|
|
3395
3369
|
|
|
3396
3370
|
// src/Table/TableCell.tsx
|
|
3397
|
-
var
|
|
3398
|
-
var
|
|
3371
|
+
var import_react45 = require("react");
|
|
3372
|
+
var import_focus9 = require("@react-aria/focus");
|
|
3399
3373
|
var import_table2 = require("@react-aria/table");
|
|
3400
|
-
var
|
|
3401
|
-
var
|
|
3402
|
-
var
|
|
3374
|
+
var import_utils17 = require("@react-aria/utils");
|
|
3375
|
+
var import_system62 = require("@marigold/system");
|
|
3376
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3403
3377
|
var TableCell = ({ cell }) => {
|
|
3404
|
-
const ref = (0,
|
|
3378
|
+
const ref = (0, import_react45.useRef)(null);
|
|
3405
3379
|
const { interactive, state, classNames: classNames2 } = useTableContext();
|
|
3406
3380
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3407
3381
|
const { gridCellProps } = (0, import_table2.useTableCell)(
|
|
@@ -3420,14 +3394,14 @@ var TableCell = ({ cell }) => {
|
|
|
3420
3394
|
onMouseDown: (e) => e.stopPropagation(),
|
|
3421
3395
|
onPointerDown: (e) => e.stopPropagation()
|
|
3422
3396
|
};
|
|
3423
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3424
|
-
const stateProps = (0,
|
|
3425
|
-
return /* @__PURE__ */ (0,
|
|
3397
|
+
const { focusProps, isFocusVisible } = (0, import_focus9.useFocusRing)();
|
|
3398
|
+
const stateProps = (0, import_system62.useStateProps)({ disabled, focusVisible: isFocusVisible });
|
|
3399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3426
3400
|
"td",
|
|
3427
3401
|
{
|
|
3428
3402
|
ref,
|
|
3429
3403
|
className: classNames2 == null ? void 0 : classNames2.cell,
|
|
3430
|
-
...(0,
|
|
3404
|
+
...(0, import_utils17.mergeProps)(cellProps, focusProps),
|
|
3431
3405
|
...stateProps,
|
|
3432
3406
|
children: cell.rendered
|
|
3433
3407
|
}
|
|
@@ -3435,11 +3409,11 @@ var TableCell = ({ cell }) => {
|
|
|
3435
3409
|
};
|
|
3436
3410
|
|
|
3437
3411
|
// src/Table/TableCheckboxCell.tsx
|
|
3438
|
-
var
|
|
3439
|
-
var
|
|
3412
|
+
var import_react46 = require("react");
|
|
3413
|
+
var import_focus10 = require("@react-aria/focus");
|
|
3440
3414
|
var import_table3 = require("@react-aria/table");
|
|
3441
|
-
var
|
|
3442
|
-
var
|
|
3415
|
+
var import_utils18 = require("@react-aria/utils");
|
|
3416
|
+
var import_system63 = require("@marigold/system");
|
|
3443
3417
|
|
|
3444
3418
|
// src/Table/utils.ts
|
|
3445
3419
|
var mapCheckboxProps = ({
|
|
@@ -3462,9 +3436,9 @@ var mapCheckboxProps = ({
|
|
|
3462
3436
|
};
|
|
3463
3437
|
|
|
3464
3438
|
// src/Table/TableCheckboxCell.tsx
|
|
3465
|
-
var
|
|
3439
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3466
3440
|
var TableCheckboxCell = ({ cell }) => {
|
|
3467
|
-
const ref = (0,
|
|
3441
|
+
const ref = (0, import_react46.useRef)(null);
|
|
3468
3442
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3469
3443
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3470
3444
|
const { gridCellProps } = (0, import_table3.useTableCell)(
|
|
@@ -3477,36 +3451,36 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3477
3451
|
const { checkboxProps } = mapCheckboxProps(
|
|
3478
3452
|
(0, import_table3.useTableSelectionCheckbox)({ key: cell.parentKey }, state)
|
|
3479
3453
|
);
|
|
3480
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3481
|
-
const stateProps = (0,
|
|
3482
|
-
return /* @__PURE__ */ (0,
|
|
3454
|
+
const { focusProps, isFocusVisible } = (0, import_focus10.useFocusRing)();
|
|
3455
|
+
const stateProps = (0, import_system63.useStateProps)({ disabled, focusVisible: isFocusVisible });
|
|
3456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3483
3457
|
"td",
|
|
3484
3458
|
{
|
|
3485
3459
|
ref,
|
|
3486
|
-
className: (0,
|
|
3487
|
-
...(0,
|
|
3460
|
+
className: (0, import_system63.cn)("text-center align-middle leading-none", classNames2 == null ? void 0 : classNames2.cell),
|
|
3461
|
+
...(0, import_utils18.mergeProps)(gridCellProps, focusProps),
|
|
3488
3462
|
...stateProps,
|
|
3489
|
-
children: /* @__PURE__ */ (0,
|
|
3463
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(_Checkbox, { ...checkboxProps })
|
|
3490
3464
|
}
|
|
3491
3465
|
);
|
|
3492
3466
|
};
|
|
3493
3467
|
|
|
3494
3468
|
// src/Table/TableColumnHeader.tsx
|
|
3495
|
-
var
|
|
3496
|
-
var
|
|
3497
|
-
var
|
|
3469
|
+
var import_react47 = require("react");
|
|
3470
|
+
var import_focus11 = require("@react-aria/focus");
|
|
3471
|
+
var import_interactions5 = require("@react-aria/interactions");
|
|
3498
3472
|
var import_table4 = require("@react-aria/table");
|
|
3499
|
-
var
|
|
3473
|
+
var import_utils20 = require("@react-aria/utils");
|
|
3500
3474
|
var import_icons2 = require("@marigold/icons");
|
|
3501
|
-
var
|
|
3502
|
-
var
|
|
3503
|
-
var
|
|
3475
|
+
var import_system64 = require("@marigold/system");
|
|
3476
|
+
var import_system65 = require("@marigold/system");
|
|
3477
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3504
3478
|
var TableColumnHeader = ({
|
|
3505
3479
|
column,
|
|
3506
3480
|
width = "auto"
|
|
3507
3481
|
}) => {
|
|
3508
3482
|
var _a, _b;
|
|
3509
|
-
const ref = (0,
|
|
3483
|
+
const ref = (0, import_react47.useRef)(null);
|
|
3510
3484
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3511
3485
|
const { columnHeaderProps } = (0, import_table4.useTableColumnHeader)(
|
|
3512
3486
|
{
|
|
@@ -3515,23 +3489,23 @@ var TableColumnHeader = ({
|
|
|
3515
3489
|
state,
|
|
3516
3490
|
ref
|
|
3517
3491
|
);
|
|
3518
|
-
const { hoverProps, isHovered } = (0,
|
|
3519
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3520
|
-
const stateProps = (0,
|
|
3492
|
+
const { hoverProps, isHovered } = (0, import_interactions5.useHover)({});
|
|
3493
|
+
const { focusProps, isFocusVisible } = (0, import_focus11.useFocusRing)();
|
|
3494
|
+
const stateProps = (0, import_system64.useStateProps)({
|
|
3521
3495
|
hover: isHovered,
|
|
3522
3496
|
focusVisible: isFocusVisible
|
|
3523
3497
|
});
|
|
3524
|
-
return /* @__PURE__ */ (0,
|
|
3498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
3525
3499
|
"th",
|
|
3526
3500
|
{
|
|
3527
3501
|
colSpan: column.colspan,
|
|
3528
3502
|
ref,
|
|
3529
|
-
className: (0,
|
|
3530
|
-
...(0,
|
|
3503
|
+
className: (0, import_system64.cn)("cursor-default", import_system65.width[width], classNames2 == null ? void 0 : classNames2.header),
|
|
3504
|
+
...(0, import_utils20.mergeProps)(columnHeaderProps, hoverProps, focusProps),
|
|
3531
3505
|
...stateProps,
|
|
3532
3506
|
children: [
|
|
3533
3507
|
column.rendered,
|
|
3534
|
-
column.props.allowsSorting && (((_a = state.sortDescriptor) == null ? void 0 : _a.column) === column.key ? ((_b = state.sortDescriptor) == null ? void 0 : _b.direction) === "ascending" ? /* @__PURE__ */ (0,
|
|
3508
|
+
column.props.allowsSorting && (((_a = state.sortDescriptor) == null ? void 0 : _a.column) === column.key ? ((_b = state.sortDescriptor) == null ? void 0 : _b.direction) === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_icons2.SortUp, { className: "inline-block" }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_icons2.SortDown, { className: "inline-block" }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_icons2.SortDown, { className: "inline-block" }))
|
|
3535
3509
|
]
|
|
3536
3510
|
}
|
|
3537
3511
|
);
|
|
@@ -3539,36 +3513,36 @@ var TableColumnHeader = ({
|
|
|
3539
3513
|
|
|
3540
3514
|
// src/Table/TableHeader.tsx
|
|
3541
3515
|
var import_table5 = require("@react-aria/table");
|
|
3542
|
-
var
|
|
3516
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
3543
3517
|
var TableHeader = ({ children }) => {
|
|
3544
3518
|
const { rowGroupProps } = (0, import_table5.useTableRowGroup)();
|
|
3545
|
-
return /* @__PURE__ */ (0,
|
|
3519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("thead", { ...rowGroupProps, children });
|
|
3546
3520
|
};
|
|
3547
3521
|
|
|
3548
3522
|
// src/Table/TableHeaderRow.tsx
|
|
3549
|
-
var
|
|
3523
|
+
var import_react48 = require("react");
|
|
3550
3524
|
var import_table6 = require("@react-aria/table");
|
|
3551
|
-
var
|
|
3525
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
3552
3526
|
var TableHeaderRow = ({ item, children }) => {
|
|
3553
3527
|
const { state } = useTableContext();
|
|
3554
|
-
const ref = (0,
|
|
3528
|
+
const ref = (0, import_react48.useRef)(null);
|
|
3555
3529
|
const { rowProps } = (0, import_table6.useTableHeaderRow)({ node: item }, state, ref);
|
|
3556
|
-
return /* @__PURE__ */ (0,
|
|
3530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tr", { ...rowProps, ref, children });
|
|
3557
3531
|
};
|
|
3558
3532
|
|
|
3559
3533
|
// src/Table/TableRow.tsx
|
|
3560
|
-
var
|
|
3561
|
-
var
|
|
3562
|
-
var
|
|
3534
|
+
var import_react49 = require("react");
|
|
3535
|
+
var import_focus12 = require("@react-aria/focus");
|
|
3536
|
+
var import_interactions6 = require("@react-aria/interactions");
|
|
3563
3537
|
var import_table7 = require("@react-aria/table");
|
|
3564
|
-
var
|
|
3565
|
-
var
|
|
3566
|
-
var
|
|
3538
|
+
var import_utils21 = require("@react-aria/utils");
|
|
3539
|
+
var import_system66 = require("@marigold/system");
|
|
3540
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
3567
3541
|
var TableRow = ({ children, row }) => {
|
|
3568
|
-
const ref = (0,
|
|
3542
|
+
const ref = (0, import_react49.useRef)(null);
|
|
3569
3543
|
const { interactive, state, ...ctx } = useTableContext();
|
|
3570
3544
|
const { variant, size } = row.props;
|
|
3571
|
-
const classNames2 = (0,
|
|
3545
|
+
const classNames2 = (0, import_system66.useClassNames)({
|
|
3572
3546
|
component: "Table",
|
|
3573
3547
|
variant: variant || ctx.variant,
|
|
3574
3548
|
size: size || ctx.size
|
|
@@ -3582,28 +3556,28 @@ var TableRow = ({ children, row }) => {
|
|
|
3582
3556
|
);
|
|
3583
3557
|
const disabled = state.disabledKeys.has(row.key);
|
|
3584
3558
|
const selected = state.selectionManager.isSelected(row.key);
|
|
3585
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3586
|
-
const { hoverProps, isHovered } = (0,
|
|
3559
|
+
const { focusProps, isFocusVisible } = (0, import_focus12.useFocusRing)({ within: true });
|
|
3560
|
+
const { hoverProps, isHovered } = (0, import_interactions6.useHover)({
|
|
3587
3561
|
isDisabled: disabled || !interactive
|
|
3588
3562
|
});
|
|
3589
|
-
const stateProps = (0,
|
|
3563
|
+
const stateProps = (0, import_system66.useStateProps)({
|
|
3590
3564
|
disabled,
|
|
3591
3565
|
selected,
|
|
3592
3566
|
hover: isHovered,
|
|
3593
3567
|
focusVisible: isFocusVisible,
|
|
3594
3568
|
active: isPressed
|
|
3595
3569
|
});
|
|
3596
|
-
return /* @__PURE__ */ (0,
|
|
3570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
3597
3571
|
"tr",
|
|
3598
3572
|
{
|
|
3599
3573
|
ref,
|
|
3600
|
-
className: (0,
|
|
3574
|
+
className: (0, import_system66.cn)(
|
|
3601
3575
|
[
|
|
3602
3576
|
!interactive ? "cursor-text" : disabled ? "cursor-default" : "cursor-pointer"
|
|
3603
3577
|
],
|
|
3604
3578
|
classNames2 == null ? void 0 : classNames2.row
|
|
3605
3579
|
),
|
|
3606
|
-
...(0,
|
|
3580
|
+
...(0, import_utils21.mergeProps)(rowProps, focusProps, hoverProps),
|
|
3607
3581
|
...stateProps,
|
|
3608
3582
|
children
|
|
3609
3583
|
}
|
|
@@ -3611,18 +3585,18 @@ var TableRow = ({ children, row }) => {
|
|
|
3611
3585
|
};
|
|
3612
3586
|
|
|
3613
3587
|
// src/Table/TableSelectAllCell.tsx
|
|
3614
|
-
var
|
|
3615
|
-
var
|
|
3616
|
-
var
|
|
3588
|
+
var import_react50 = require("react");
|
|
3589
|
+
var import_focus13 = require("@react-aria/focus");
|
|
3590
|
+
var import_interactions7 = require("@react-aria/interactions");
|
|
3617
3591
|
var import_table8 = require("@react-aria/table");
|
|
3618
|
-
var
|
|
3619
|
-
var
|
|
3620
|
-
var
|
|
3592
|
+
var import_utils22 = require("@react-aria/utils");
|
|
3593
|
+
var import_system67 = require("@marigold/system");
|
|
3594
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
3621
3595
|
var TableSelectAllCell = ({
|
|
3622
3596
|
column,
|
|
3623
3597
|
width = "auto"
|
|
3624
3598
|
}) => {
|
|
3625
|
-
const ref = (0,
|
|
3599
|
+
const ref = (0, import_react50.useRef)(null);
|
|
3626
3600
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3627
3601
|
const { columnHeaderProps } = (0, import_table8.useTableColumnHeader)(
|
|
3628
3602
|
{
|
|
@@ -3632,30 +3606,30 @@ var TableSelectAllCell = ({
|
|
|
3632
3606
|
ref
|
|
3633
3607
|
);
|
|
3634
3608
|
const { checkboxProps } = mapCheckboxProps((0, import_table8.useTableSelectAllCheckbox)(state));
|
|
3635
|
-
const { hoverProps, isHovered } = (0,
|
|
3636
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3637
|
-
const stateProps = (0,
|
|
3609
|
+
const { hoverProps, isHovered } = (0, import_interactions7.useHover)({});
|
|
3610
|
+
const { focusProps, isFocusVisible } = (0, import_focus13.useFocusRing)();
|
|
3611
|
+
const stateProps = (0, import_system67.useStateProps)({
|
|
3638
3612
|
hover: isHovered,
|
|
3639
3613
|
focusVisible: isFocusVisible
|
|
3640
3614
|
});
|
|
3641
|
-
return /* @__PURE__ */ (0,
|
|
3615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3642
3616
|
"th",
|
|
3643
3617
|
{
|
|
3644
3618
|
ref,
|
|
3645
|
-
className: (0,
|
|
3646
|
-
|
|
3619
|
+
className: (0, import_system67.cn)(
|
|
3620
|
+
import_system67.width[width],
|
|
3647
3621
|
["text-center align-middle leading-none"],
|
|
3648
3622
|
classNames2 == null ? void 0 : classNames2.header
|
|
3649
3623
|
),
|
|
3650
|
-
...(0,
|
|
3624
|
+
...(0, import_utils22.mergeProps)(columnHeaderProps, hoverProps, focusProps),
|
|
3651
3625
|
...stateProps,
|
|
3652
|
-
children: /* @__PURE__ */ (0,
|
|
3626
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(_Checkbox, { ...checkboxProps })
|
|
3653
3627
|
}
|
|
3654
3628
|
);
|
|
3655
3629
|
};
|
|
3656
3630
|
|
|
3657
3631
|
// src/Table/Table.tsx
|
|
3658
|
-
var
|
|
3632
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3659
3633
|
var Table = ({
|
|
3660
3634
|
variant,
|
|
3661
3635
|
size,
|
|
@@ -3664,7 +3638,7 @@ var Table = ({
|
|
|
3664
3638
|
...props
|
|
3665
3639
|
}) => {
|
|
3666
3640
|
const interactive = selectionMode !== "none";
|
|
3667
|
-
const tableRef = (0,
|
|
3641
|
+
const tableRef = (0, import_react51.useRef)(null);
|
|
3668
3642
|
const state = (0, import_table10.useTableState)({
|
|
3669
3643
|
...props,
|
|
3670
3644
|
selectionMode,
|
|
@@ -3672,21 +3646,21 @@ var Table = ({
|
|
|
3672
3646
|
props.selectionBehavior !== "replace"
|
|
3673
3647
|
});
|
|
3674
3648
|
const { gridProps } = (0, import_table9.useTable)(props, state, tableRef);
|
|
3675
|
-
const classNames2 = (0,
|
|
3649
|
+
const classNames2 = (0, import_system68.useClassNames)({
|
|
3676
3650
|
component: "Table",
|
|
3677
3651
|
variant,
|
|
3678
3652
|
size
|
|
3679
3653
|
});
|
|
3680
3654
|
const { collection } = state;
|
|
3681
|
-
return /* @__PURE__ */ (0,
|
|
3655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3682
3656
|
TableContext.Provider,
|
|
3683
3657
|
{
|
|
3684
3658
|
value: { state, interactive, classNames: classNames2, variant, size },
|
|
3685
|
-
children: /* @__PURE__ */ (0,
|
|
3659
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
3686
3660
|
"table",
|
|
3687
3661
|
{
|
|
3688
3662
|
ref: tableRef,
|
|
3689
|
-
className: (0,
|
|
3663
|
+
className: (0, import_system68.cn)(
|
|
3690
3664
|
"group/table",
|
|
3691
3665
|
"border-collapse overflow-auto whitespace-nowrap",
|
|
3692
3666
|
stretch ? "table w-full" : "block",
|
|
@@ -3694,17 +3668,17 @@ var Table = ({
|
|
|
3694
3668
|
),
|
|
3695
3669
|
...gridProps,
|
|
3696
3670
|
children: [
|
|
3697
|
-
/* @__PURE__ */ (0,
|
|
3671
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TableHeader, { children: collection.headerRows.map((headerRow) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TableHeaderRow, { item: headerRow, children: [...collection.getChildren(headerRow.key)].map(
|
|
3698
3672
|
(column) => {
|
|
3699
3673
|
var _a, _b, _c;
|
|
3700
|
-
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ (0,
|
|
3674
|
+
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3701
3675
|
TableSelectAllCell,
|
|
3702
3676
|
{
|
|
3703
3677
|
width: (_b = column.props) == null ? void 0 : _b.width,
|
|
3704
3678
|
column
|
|
3705
3679
|
},
|
|
3706
3680
|
column.key
|
|
3707
|
-
) : /* @__PURE__ */ (0,
|
|
3681
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3708
3682
|
TableColumnHeader,
|
|
3709
3683
|
{
|
|
3710
3684
|
width: (_c = column.props) == null ? void 0 : _c.width,
|
|
@@ -3714,12 +3688,12 @@ var Table = ({
|
|
|
3714
3688
|
);
|
|
3715
3689
|
}
|
|
3716
3690
|
) }, headerRow.key)) }),
|
|
3717
|
-
/* @__PURE__ */ (0,
|
|
3691
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(TableBody, { children: [
|
|
3718
3692
|
...collection.rows.map(
|
|
3719
|
-
(row) => row.type === "item" && /* @__PURE__ */ (0,
|
|
3693
|
+
(row) => row.type === "item" && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TableRow, { row, children: [...collection.getChildren(row.key)].map(
|
|
3720
3694
|
(cell) => {
|
|
3721
3695
|
var _a;
|
|
3722
|
-
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ (0,
|
|
3696
|
+
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TableCheckboxCell, { cell }, cell.key) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TableCell, { cell }, cell.key);
|
|
3723
3697
|
}
|
|
3724
3698
|
) }, row.key)
|
|
3725
3699
|
)
|
|
@@ -3737,8 +3711,8 @@ Table.Header = import_table10.TableHeader;
|
|
|
3737
3711
|
Table.Row = import_table10.Row;
|
|
3738
3712
|
|
|
3739
3713
|
// src/Text/Text.tsx
|
|
3740
|
-
var
|
|
3741
|
-
var
|
|
3714
|
+
var import_system69 = require("@marigold/system");
|
|
3715
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3742
3716
|
var Text2 = ({
|
|
3743
3717
|
variant,
|
|
3744
3718
|
size,
|
|
@@ -3751,27 +3725,27 @@ var Text2 = ({
|
|
|
3751
3725
|
children,
|
|
3752
3726
|
...props
|
|
3753
3727
|
}) => {
|
|
3754
|
-
const theme = (0,
|
|
3755
|
-
const classNames2 = (0,
|
|
3728
|
+
const theme = (0, import_system69.useTheme)();
|
|
3729
|
+
const classNames2 = (0, import_system69.useClassNames)({
|
|
3756
3730
|
component: "Text",
|
|
3757
3731
|
variant,
|
|
3758
3732
|
size
|
|
3759
3733
|
});
|
|
3760
|
-
return /* @__PURE__ */ (0,
|
|
3734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3761
3735
|
"p",
|
|
3762
3736
|
{
|
|
3763
3737
|
...props,
|
|
3764
|
-
className: (0,
|
|
3738
|
+
className: (0, import_system69.cn)(
|
|
3765
3739
|
classNames2,
|
|
3766
3740
|
"text-[--color] outline-[--outline]",
|
|
3767
|
-
fontStyle &&
|
|
3768
|
-
align &&
|
|
3769
|
-
cursor &&
|
|
3770
|
-
weight &&
|
|
3771
|
-
fontSize &&
|
|
3741
|
+
fontStyle && import_system69.textStyle[fontStyle],
|
|
3742
|
+
align && import_system69.textAlign[align],
|
|
3743
|
+
cursor && import_system69.cursorStyle[cursor],
|
|
3744
|
+
weight && import_system69.fontWeight[weight],
|
|
3745
|
+
fontSize && import_system69.textSize[fontSize]
|
|
3772
3746
|
),
|
|
3773
|
-
style: (0,
|
|
3774
|
-
color: color && theme.colors && (0,
|
|
3747
|
+
style: (0, import_system69.createVar)({
|
|
3748
|
+
color: color && theme.colors && (0, import_system69.get)(
|
|
3775
3749
|
theme.colors,
|
|
3776
3750
|
color.replace("-", "."),
|
|
3777
3751
|
color
|
|
@@ -3784,145 +3758,61 @@ var Text2 = ({
|
|
|
3784
3758
|
};
|
|
3785
3759
|
|
|
3786
3760
|
// src/TextArea/TextArea.tsx
|
|
3787
|
-
var
|
|
3788
|
-
var
|
|
3789
|
-
var
|
|
3790
|
-
var
|
|
3791
|
-
var
|
|
3792
|
-
var import_system67 = require("@marigold/system");
|
|
3793
|
-
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3794
|
-
var TextArea = (0, import_react53.forwardRef)(
|
|
3761
|
+
var import_react52 = require("react");
|
|
3762
|
+
var import_react_aria_components21 = require("react-aria-components");
|
|
3763
|
+
var import_system70 = require("@marigold/system");
|
|
3764
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
3765
|
+
var _TextArea = (0, import_react52.forwardRef)(
|
|
3795
3766
|
({
|
|
3796
3767
|
variant,
|
|
3797
3768
|
size,
|
|
3798
|
-
width,
|
|
3799
|
-
disabled,
|
|
3800
3769
|
required,
|
|
3770
|
+
disabled,
|
|
3801
3771
|
readOnly,
|
|
3802
3772
|
error,
|
|
3803
3773
|
rows,
|
|
3804
|
-
...
|
|
3774
|
+
...rest
|
|
3805
3775
|
}, ref) => {
|
|
3806
|
-
const {
|
|
3807
|
-
const
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
...props
|
|
3816
|
-
},
|
|
3817
|
-
textAreaRef
|
|
3818
|
-
);
|
|
3819
|
-
const { hoverProps, isHovered } = (0, import_interactions11.useHover)({});
|
|
3820
|
-
const { focusProps, isFocusVisible } = (0, import_focus16.useFocusRing)();
|
|
3821
|
-
const stateProps = (0, import_system67.useStateProps)({
|
|
3822
|
-
hover: isHovered,
|
|
3823
|
-
focus: isFocusVisible,
|
|
3824
|
-
disabled,
|
|
3825
|
-
readOnly,
|
|
3826
|
-
required,
|
|
3827
|
-
error
|
|
3828
|
-
});
|
|
3829
|
-
const classNames2 = (0, import_system67.useClassNames)({ component: "TextArea", variant, size });
|
|
3830
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3831
|
-
FieldBase,
|
|
3832
|
-
{
|
|
3833
|
-
label,
|
|
3834
|
-
labelProps,
|
|
3835
|
-
description,
|
|
3836
|
-
descriptionProps,
|
|
3837
|
-
error,
|
|
3838
|
-
errorMessage,
|
|
3839
|
-
errorMessageProps,
|
|
3840
|
-
stateProps,
|
|
3841
|
-
variant,
|
|
3842
|
-
size,
|
|
3843
|
-
width,
|
|
3844
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3845
|
-
"textarea",
|
|
3846
|
-
{
|
|
3847
|
-
className: classNames2,
|
|
3848
|
-
ref: textAreaRef,
|
|
3849
|
-
rows,
|
|
3850
|
-
...inputProps,
|
|
3851
|
-
...focusProps,
|
|
3852
|
-
...hoverProps
|
|
3853
|
-
}
|
|
3854
|
-
)
|
|
3855
|
-
}
|
|
3856
|
-
);
|
|
3776
|
+
const classNames2 = (0, import_system70.useClassNames)({ component: "TextArea", variant, size });
|
|
3777
|
+
const props = {
|
|
3778
|
+
isDisabled: disabled,
|
|
3779
|
+
isReadOnly: readOnly,
|
|
3780
|
+
isInvalid: error,
|
|
3781
|
+
isRequired: required,
|
|
3782
|
+
...rest
|
|
3783
|
+
};
|
|
3784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(FieldBase2, { as: import_react_aria_components21.TextField, ...props, variant, size, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_react_aria_components21.TextArea, { className: classNames2, ref, rows }) });
|
|
3857
3785
|
}
|
|
3858
3786
|
);
|
|
3859
3787
|
|
|
3860
3788
|
// src/TextField/TextField.tsx
|
|
3861
|
-
var
|
|
3862
|
-
var
|
|
3863
|
-
var
|
|
3864
|
-
var
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
);
|
|
3882
|
-
const { hoverProps, isHovered } = (0, import_interactions12.useHover)({});
|
|
3883
|
-
const { focusProps, isFocused } = (0, import_focus17.useFocusRing)({
|
|
3884
|
-
isTextInput: true,
|
|
3885
|
-
autoFocus
|
|
3886
|
-
});
|
|
3887
|
-
const stateProps = (0, import_system68.useStateProps)({
|
|
3888
|
-
hover: isHovered,
|
|
3889
|
-
focus: isFocused,
|
|
3890
|
-
disabled,
|
|
3891
|
-
error,
|
|
3892
|
-
readOnly,
|
|
3893
|
-
required
|
|
3894
|
-
});
|
|
3895
|
-
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
3896
|
-
FieldBase,
|
|
3897
|
-
{
|
|
3898
|
-
label,
|
|
3899
|
-
labelProps,
|
|
3900
|
-
description,
|
|
3901
|
-
descriptionProps,
|
|
3902
|
-
error,
|
|
3903
|
-
errorMessage,
|
|
3904
|
-
errorMessageProps,
|
|
3905
|
-
stateProps,
|
|
3906
|
-
variant,
|
|
3907
|
-
size,
|
|
3908
|
-
width,
|
|
3909
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
3910
|
-
Input,
|
|
3911
|
-
{
|
|
3912
|
-
ref: inputRef,
|
|
3913
|
-
variant,
|
|
3914
|
-
size,
|
|
3915
|
-
...(0, import_utils28.mergeProps)(focusProps, inputProps, hoverProps)
|
|
3916
|
-
}
|
|
3917
|
-
)
|
|
3918
|
-
}
|
|
3919
|
-
);
|
|
3789
|
+
var import_react53 = require("react");
|
|
3790
|
+
var import_react_aria_components22 = require("react-aria-components");
|
|
3791
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
3792
|
+
var _TextField = (0, import_react53.forwardRef)(
|
|
3793
|
+
({
|
|
3794
|
+
variant,
|
|
3795
|
+
size,
|
|
3796
|
+
required,
|
|
3797
|
+
disabled,
|
|
3798
|
+
readOnly,
|
|
3799
|
+
error,
|
|
3800
|
+
...rest
|
|
3801
|
+
}, ref) => {
|
|
3802
|
+
const props = {
|
|
3803
|
+
isDisabled: disabled,
|
|
3804
|
+
isReadOnly: readOnly,
|
|
3805
|
+
isInvalid: error,
|
|
3806
|
+
isRequired: required,
|
|
3807
|
+
...rest
|
|
3808
|
+
};
|
|
3809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(FieldBase2, { as: import_react_aria_components22.TextField, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(_Input, { ref }) });
|
|
3920
3810
|
}
|
|
3921
3811
|
);
|
|
3922
3812
|
|
|
3923
3813
|
// src/Tiles/Tiles.tsx
|
|
3924
|
-
var
|
|
3925
|
-
var
|
|
3814
|
+
var import_system71 = require("@marigold/system");
|
|
3815
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3926
3816
|
var Tiles = ({
|
|
3927
3817
|
space = 0,
|
|
3928
3818
|
stretch = false,
|
|
@@ -3935,151 +3825,89 @@ var Tiles = ({
|
|
|
3935
3825
|
if (stretch) {
|
|
3936
3826
|
column = `minmax(${column}, 1fr)`;
|
|
3937
3827
|
}
|
|
3938
|
-
return /* @__PURE__ */ (0,
|
|
3828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3939
3829
|
"div",
|
|
3940
3830
|
{
|
|
3941
3831
|
...props,
|
|
3942
|
-
className: (0,
|
|
3832
|
+
className: (0, import_system71.cn)(
|
|
3943
3833
|
"grid",
|
|
3944
|
-
|
|
3834
|
+
import_system71.gapSpace[space],
|
|
3945
3835
|
"grid-cols-[repeat(auto-fit,var(--column))]",
|
|
3946
3836
|
equalHeight && "auto-rows-[1fr]"
|
|
3947
3837
|
),
|
|
3948
|
-
style: (0,
|
|
3838
|
+
style: (0, import_system71.createVar)({ column, tilesWidth }),
|
|
3949
3839
|
children
|
|
3950
3840
|
}
|
|
3951
3841
|
);
|
|
3952
3842
|
};
|
|
3953
3843
|
|
|
3954
3844
|
// src/Tooltip/Tooltip.tsx
|
|
3955
|
-
var
|
|
3956
|
-
var
|
|
3957
|
-
|
|
3958
|
-
// src/Tooltip/Context.ts
|
|
3959
|
-
var import_react55 = require("react");
|
|
3960
|
-
var TooltipContext = (0, import_react55.createContext)({});
|
|
3961
|
-
var useTooltipContext = () => (0, import_react55.useContext)(TooltipContext);
|
|
3845
|
+
var import_react_aria_components24 = require("react-aria-components");
|
|
3846
|
+
var import_system72 = require("@marigold/system");
|
|
3962
3847
|
|
|
3963
3848
|
// src/Tooltip/TooltipTrigger.tsx
|
|
3964
|
-
var
|
|
3965
|
-
var
|
|
3966
|
-
var
|
|
3967
|
-
var import_tooltip = require("@react-aria/tooltip");
|
|
3968
|
-
var import_tooltip2 = require("@react-stately/tooltip");
|
|
3969
|
-
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3970
|
-
var TooltipTrigger = ({
|
|
3971
|
-
disabled,
|
|
3972
|
-
open,
|
|
3849
|
+
var import_react_aria_components23 = require("react-aria-components");
|
|
3850
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
3851
|
+
var _TooltipTrigger = ({
|
|
3973
3852
|
delay = 1e3,
|
|
3974
|
-
placement = "top",
|
|
3975
3853
|
children,
|
|
3854
|
+
disabled,
|
|
3855
|
+
open,
|
|
3976
3856
|
...rest
|
|
3977
3857
|
}) => {
|
|
3978
|
-
const [tooltipTrigger, tooltip] = import_react56.Children.toArray(children);
|
|
3979
3858
|
const props = {
|
|
3980
3859
|
...rest,
|
|
3981
3860
|
isDisabled: disabled,
|
|
3982
3861
|
isOpen: open,
|
|
3983
|
-
delay
|
|
3984
|
-
placement
|
|
3862
|
+
delay
|
|
3985
3863
|
};
|
|
3986
|
-
|
|
3987
|
-
const overlayRef = (0, import_react56.useRef)(null);
|
|
3988
|
-
const state = (0, import_tooltip2.useTooltipTriggerState)(props);
|
|
3989
|
-
const { triggerProps, tooltipProps } = (0, import_tooltip.useTooltipTrigger)(
|
|
3990
|
-
props,
|
|
3991
|
-
state,
|
|
3992
|
-
tooltipTriggerRef
|
|
3993
|
-
);
|
|
3994
|
-
const {
|
|
3995
|
-
overlayProps: positionProps,
|
|
3996
|
-
placement: overlayPlacement,
|
|
3997
|
-
arrowProps
|
|
3998
|
-
} = (0, import_overlays8.useOverlayPosition)({
|
|
3999
|
-
placement: props.placement,
|
|
4000
|
-
targetRef: tooltipTriggerRef,
|
|
4001
|
-
offset: props.offset,
|
|
4002
|
-
crossOffset: props.crossOffset,
|
|
4003
|
-
isOpen: state.isOpen,
|
|
4004
|
-
overlayRef
|
|
4005
|
-
});
|
|
4006
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_focus18.FocusableProvider, { ref: tooltipTriggerRef, ...triggerProps, children: [
|
|
4007
|
-
tooltipTrigger,
|
|
4008
|
-
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4009
|
-
TooltipContext.Provider,
|
|
4010
|
-
{
|
|
4011
|
-
value: {
|
|
4012
|
-
state,
|
|
4013
|
-
overlayRef,
|
|
4014
|
-
arrowProps,
|
|
4015
|
-
placement: overlayPlacement,
|
|
4016
|
-
...tooltipProps,
|
|
4017
|
-
...positionProps
|
|
4018
|
-
},
|
|
4019
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Overlay, { open: state.isOpen, children: tooltip })
|
|
4020
|
-
}
|
|
4021
|
-
)
|
|
4022
|
-
] });
|
|
3864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react_aria_components23.TooltipTrigger, { ...props, children });
|
|
4023
3865
|
};
|
|
4024
3866
|
|
|
4025
3867
|
// src/Tooltip/Tooltip.tsx
|
|
4026
|
-
var
|
|
4027
|
-
var
|
|
4028
|
-
const
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
className: (0, import_system70.cn)("group/tooltip", classNames2.container),
|
|
4038
|
-
"data-placement": placement,
|
|
4039
|
-
children: [
|
|
4040
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { children }),
|
|
4041
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4042
|
-
"div",
|
|
4043
|
-
{
|
|
4044
|
-
...arrowProps,
|
|
4045
|
-
className: (0, import_system70.cn)("absolute h-0 w-0", classNames2.arrow)
|
|
4046
|
-
}
|
|
4047
|
-
)
|
|
4048
|
-
]
|
|
4049
|
-
}
|
|
4050
|
-
);
|
|
3868
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
3869
|
+
var _Tooltip = ({ children, variant, size, open, ...rest }) => {
|
|
3870
|
+
const props = {
|
|
3871
|
+
...rest,
|
|
3872
|
+
isOpen: open
|
|
3873
|
+
};
|
|
3874
|
+
const classNames2 = (0, import_system72.useClassNames)({ component: "Tooltip", variant, size });
|
|
3875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_react_aria_components24.Tooltip, { ...props, className: (0, import_system72.cn)("group/tooltip", classNames2.container), children: [
|
|
3876
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react_aria_components24.OverlayArrow, { className: classNames2.arrow, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("svg", { width: 8, height: 8, viewBox: "0 0 8 8", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("path", { d: "M0 0 L4 4 L8 0" }) }) }),
|
|
3877
|
+
children
|
|
3878
|
+
] });
|
|
4051
3879
|
};
|
|
4052
|
-
|
|
3880
|
+
_Tooltip.Trigger = _TooltipTrigger;
|
|
4053
3881
|
|
|
4054
3882
|
// src/TagGroup/index.ts
|
|
4055
3883
|
var import_collections6 = require("@react-stately/collections");
|
|
4056
3884
|
|
|
4057
3885
|
// src/TagGroup/TagGroup.tsx
|
|
4058
|
-
var
|
|
3886
|
+
var import_react55 = require("react");
|
|
4059
3887
|
var import_tag2 = require("@react-aria/tag");
|
|
4060
3888
|
var import_list = require("@react-stately/list");
|
|
4061
|
-
var
|
|
3889
|
+
var import_system74 = require("@marigold/system");
|
|
4062
3890
|
|
|
4063
3891
|
// src/TagGroup/Tag.tsx
|
|
4064
|
-
var
|
|
4065
|
-
var
|
|
4066
|
-
var
|
|
3892
|
+
var import_react54 = __toESM(require("react"));
|
|
3893
|
+
var import_button4 = require("@react-aria/button");
|
|
3894
|
+
var import_focus14 = require("@react-aria/focus");
|
|
4067
3895
|
var import_tag = require("@react-aria/tag");
|
|
4068
|
-
var
|
|
4069
|
-
var
|
|
4070
|
-
var
|
|
3896
|
+
var import_utils24 = require("@react-aria/utils");
|
|
3897
|
+
var import_system73 = require("@marigold/system");
|
|
3898
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
4071
3899
|
var CloseButton2 = ({ className, ...props }) => {
|
|
4072
|
-
const ref = (0,
|
|
4073
|
-
const { buttonProps } = (0,
|
|
4074
|
-
return /* @__PURE__ */ (0,
|
|
3900
|
+
const ref = (0, import_react54.useRef)(null);
|
|
3901
|
+
const { buttonProps } = (0, import_button4.useButton)({ ...props }, ref);
|
|
3902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("button", { className, ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", width: 20, height: 20, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("path", { d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" }) }) });
|
|
4075
3903
|
};
|
|
4076
3904
|
var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
4077
3905
|
const props = {
|
|
4078
3906
|
item,
|
|
4079
3907
|
...rest
|
|
4080
3908
|
};
|
|
4081
|
-
let ref =
|
|
4082
|
-
let { focusProps } = (0,
|
|
3909
|
+
let ref = import_react54.default.useRef(null);
|
|
3910
|
+
let { focusProps } = (0, import_focus14.useFocusRing)({ within: true });
|
|
4083
3911
|
const { rowProps, gridCellProps, allowsRemoving, removeButtonProps } = (0, import_tag.useTag)(
|
|
4084
3912
|
{
|
|
4085
3913
|
...props,
|
|
@@ -4088,20 +3916,20 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4088
3916
|
state,
|
|
4089
3917
|
ref
|
|
4090
3918
|
);
|
|
4091
|
-
const classNames2 = (0,
|
|
4092
|
-
return /* @__PURE__ */ (0,
|
|
3919
|
+
const classNames2 = (0, import_system73.useClassNames)({ component: "Tag", variant, size });
|
|
3920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4093
3921
|
"span",
|
|
4094
3922
|
{
|
|
4095
3923
|
ref,
|
|
4096
|
-
...(0,
|
|
3924
|
+
...(0, import_utils24.mergeProps)(rowProps, focusProps),
|
|
4097
3925
|
className: classNames2.tag,
|
|
4098
|
-
children: /* @__PURE__ */ (0,
|
|
4099
|
-
/* @__PURE__ */ (0,
|
|
4100
|
-
allowsRemoving && /* @__PURE__ */ (0,
|
|
3926
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { ...gridCellProps, className: classNames2.gridCell, children: [
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { children: item.rendered }),
|
|
3928
|
+
allowsRemoving && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4101
3929
|
CloseButton2,
|
|
4102
3930
|
{
|
|
4103
3931
|
...removeButtonProps,
|
|
4104
|
-
className: (0,
|
|
3932
|
+
className: (0, import_system73.cn)("flex items-center", classNames2.closeButton)
|
|
4105
3933
|
}
|
|
4106
3934
|
)
|
|
4107
3935
|
] })
|
|
@@ -4110,8 +3938,8 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4110
3938
|
};
|
|
4111
3939
|
|
|
4112
3940
|
// src/TagGroup/TagGroup.tsx
|
|
4113
|
-
var
|
|
4114
|
-
var
|
|
3941
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
3942
|
+
var import_react56 = require("react");
|
|
4115
3943
|
var TagGroup = ({
|
|
4116
3944
|
width,
|
|
4117
3945
|
required,
|
|
@@ -4124,14 +3952,14 @@ var TagGroup = ({
|
|
|
4124
3952
|
validationState: error ? "invalid" : "valid",
|
|
4125
3953
|
...rest
|
|
4126
3954
|
};
|
|
4127
|
-
const inputRef = (0,
|
|
3955
|
+
const inputRef = (0, import_react55.useRef)(null);
|
|
4128
3956
|
const state = (0, import_list.useListState)(props);
|
|
4129
3957
|
const { gridProps, labelProps, descriptionProps, errorMessageProps } = (0, import_tag2.useTagGroup)(props, state, inputRef);
|
|
4130
|
-
const stateProps = (0,
|
|
3958
|
+
const stateProps = (0, import_system74.useStateProps)({
|
|
4131
3959
|
error,
|
|
4132
3960
|
required
|
|
4133
3961
|
});
|
|
4134
|
-
return /* @__PURE__ */ (0,
|
|
3962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4135
3963
|
FieldBase,
|
|
4136
3964
|
{
|
|
4137
3965
|
width,
|
|
@@ -4144,13 +3972,13 @@ var TagGroup = ({
|
|
|
4144
3972
|
errorMessageProps,
|
|
4145
3973
|
stateProps,
|
|
4146
3974
|
...gridProps,
|
|
4147
|
-
children: /* @__PURE__ */ (0,
|
|
3975
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4148
3976
|
"div",
|
|
4149
3977
|
{
|
|
4150
3978
|
role: "presentation",
|
|
4151
3979
|
ref: inputRef,
|
|
4152
3980
|
className: "flex flex-wrap items-start gap-1",
|
|
4153
|
-
children: [...state.collection].map((item) => /* @__PURE__ */ (0,
|
|
3981
|
+
children: [...state.collection].map((item) => /* @__PURE__ */ (0, import_react56.createElement)(
|
|
4154
3982
|
Tag,
|
|
4155
3983
|
{
|
|
4156
3984
|
...item.props,
|
|
@@ -4176,11 +4004,11 @@ Tag2.Group = TagGroup;
|
|
|
4176
4004
|
var import_visually_hidden = require("@react-aria/visually-hidden");
|
|
4177
4005
|
|
|
4178
4006
|
// src/XLoader/XLoader.tsx
|
|
4179
|
-
var
|
|
4180
|
-
var
|
|
4181
|
-
var
|
|
4182
|
-
var XLoader = (0,
|
|
4183
|
-
|
|
4007
|
+
var import_react57 = require("react");
|
|
4008
|
+
var import_system75 = require("@marigold/system");
|
|
4009
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4010
|
+
var XLoader = (0, import_react57.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
4011
|
+
import_system75.SVG,
|
|
4184
4012
|
{
|
|
4185
4013
|
id: "XLoader",
|
|
4186
4014
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4189,13 +4017,13 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4189
4017
|
...props,
|
|
4190
4018
|
...ref,
|
|
4191
4019
|
children: [
|
|
4192
|
-
/* @__PURE__ */ (0,
|
|
4193
|
-
/* @__PURE__ */ (0,
|
|
4020
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { id: "XMLID_1_", d: "M35.3 27h26.5l54 74.1H88.7z" }),
|
|
4021
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4194
4022
|
"path",
|
|
4195
4023
|
{
|
|
4196
4024
|
id: "XMLID_5_",
|
|
4197
4025
|
d: "M124.3 12.8h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z",
|
|
4198
|
-
children: /* @__PURE__ */ (0,
|
|
4026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4199
4027
|
"animate",
|
|
4200
4028
|
{
|
|
4201
4029
|
attributeName: "opacity",
|
|
@@ -4208,12 +4036,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4208
4036
|
)
|
|
4209
4037
|
}
|
|
4210
4038
|
),
|
|
4211
|
-
/* @__PURE__ */ (0,
|
|
4039
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4212
4040
|
"path",
|
|
4213
4041
|
{
|
|
4214
4042
|
id: "XMLID_18_",
|
|
4215
4043
|
d: "M115.9 24.4h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z",
|
|
4216
|
-
children: /* @__PURE__ */ (0,
|
|
4044
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4217
4045
|
"animate",
|
|
4218
4046
|
{
|
|
4219
4047
|
attributeName: "opacity",
|
|
@@ -4226,12 +4054,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4226
4054
|
)
|
|
4227
4055
|
}
|
|
4228
4056
|
),
|
|
4229
|
-
/* @__PURE__ */ (0,
|
|
4057
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4230
4058
|
"path",
|
|
4231
4059
|
{
|
|
4232
4060
|
id: "XMLID_19_",
|
|
4233
4061
|
d: "M107.5 35.9h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z",
|
|
4234
|
-
children: /* @__PURE__ */ (0,
|
|
4062
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4235
4063
|
"animate",
|
|
4236
4064
|
{
|
|
4237
4065
|
attributeName: "opacity",
|
|
@@ -4244,12 +4072,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4244
4072
|
)
|
|
4245
4073
|
}
|
|
4246
4074
|
),
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
4075
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4248
4076
|
"path",
|
|
4249
4077
|
{
|
|
4250
4078
|
id: "XMLID_20_",
|
|
4251
4079
|
d: "M99.1 47.5h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z",
|
|
4252
|
-
children: /* @__PURE__ */ (0,
|
|
4080
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4253
4081
|
"animate",
|
|
4254
4082
|
{
|
|
4255
4083
|
attributeName: "opacity",
|
|
@@ -4262,12 +4090,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4262
4090
|
)
|
|
4263
4091
|
}
|
|
4264
4092
|
),
|
|
4265
|
-
/* @__PURE__ */ (0,
|
|
4093
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4266
4094
|
"path",
|
|
4267
4095
|
{
|
|
4268
4096
|
id: "XMLID_21_",
|
|
4269
4097
|
d: "M90.7 59H90c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.8-2.2 4.9-4.9 4.9z",
|
|
4270
|
-
children: /* @__PURE__ */ (0,
|
|
4098
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4271
4099
|
"animate",
|
|
4272
4100
|
{
|
|
4273
4101
|
attributeName: "opacity",
|
|
@@ -4280,12 +4108,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4280
4108
|
)
|
|
4281
4109
|
}
|
|
4282
4110
|
),
|
|
4283
|
-
/* @__PURE__ */ (0,
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4284
4112
|
"path",
|
|
4285
4113
|
{
|
|
4286
4114
|
id: "XMLID_22_",
|
|
4287
4115
|
d: "M68 89.8h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.8c0 2.6-2.2 4.8-4.9 4.8z",
|
|
4288
|
-
children: /* @__PURE__ */ (0,
|
|
4116
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4289
4117
|
"animate",
|
|
4290
4118
|
{
|
|
4291
4119
|
attributeName: "opacity",
|
|
@@ -4298,12 +4126,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4298
4126
|
)
|
|
4299
4127
|
}
|
|
4300
4128
|
),
|
|
4301
|
-
/* @__PURE__ */ (0,
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4302
4130
|
"path",
|
|
4303
4131
|
{
|
|
4304
4132
|
id: "XMLID_23_",
|
|
4305
4133
|
d: "M59.6 101.4h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z",
|
|
4306
|
-
children: /* @__PURE__ */ (0,
|
|
4134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4307
4135
|
"animate",
|
|
4308
4136
|
{
|
|
4309
4137
|
attributeName: "opacity",
|
|
@@ -4316,12 +4144,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4316
4144
|
)
|
|
4317
4145
|
}
|
|
4318
4146
|
),
|
|
4319
|
-
/* @__PURE__ */ (0,
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4320
4148
|
"path",
|
|
4321
4149
|
{
|
|
4322
4150
|
id: "XMLID_24_",
|
|
4323
4151
|
d: "M51.2 112.9h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c-.1 2.8-2.2 4.9-4.9 4.9z",
|
|
4324
|
-
children: /* @__PURE__ */ (0,
|
|
4152
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4325
4153
|
"animate",
|
|
4326
4154
|
{
|
|
4327
4155
|
attributeName: "opacity",
|
|
@@ -4334,12 +4162,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4334
4162
|
)
|
|
4335
4163
|
}
|
|
4336
4164
|
),
|
|
4337
|
-
/* @__PURE__ */ (0,
|
|
4165
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4338
4166
|
"path",
|
|
4339
4167
|
{
|
|
4340
4168
|
id: "XMLID_25_",
|
|
4341
4169
|
d: "M42.8 124.5h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c-.1 2.7-2.2 4.9-4.9 4.9z",
|
|
4342
|
-
children: /* @__PURE__ */ (0,
|
|
4170
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4343
4171
|
"animate",
|
|
4344
4172
|
{
|
|
4345
4173
|
attributeName: "opacity",
|
|
@@ -4352,12 +4180,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4352
4180
|
)
|
|
4353
4181
|
}
|
|
4354
4182
|
),
|
|
4355
|
-
/* @__PURE__ */ (0,
|
|
4183
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4356
4184
|
"path",
|
|
4357
4185
|
{
|
|
4358
4186
|
id: "XMLID_26_",
|
|
4359
4187
|
d: "M34.4 136h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c-.1 2.7-2.2 4.9-4.9 4.9z",
|
|
4360
|
-
children: /* @__PURE__ */ (0,
|
|
4188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4361
4189
|
"animate",
|
|
4362
4190
|
{
|
|
4363
4191
|
attributeName: "opacity",
|
|
@@ -4370,12 +4198,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4370
4198
|
)
|
|
4371
4199
|
}
|
|
4372
4200
|
),
|
|
4373
|
-
/* @__PURE__ */ (0,
|
|
4201
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4374
4202
|
"path",
|
|
4375
4203
|
{
|
|
4376
4204
|
id: "XMLID_27_",
|
|
4377
4205
|
d: "M26 147.6h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c-.1 2.8-2.2 4.9-4.9 4.9z",
|
|
4378
|
-
children: /* @__PURE__ */ (0,
|
|
4206
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4379
4207
|
"animate",
|
|
4380
4208
|
{
|
|
4381
4209
|
attributeName: "opacity",
|
|
@@ -4393,43 +4221,43 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4393
4221
|
));
|
|
4394
4222
|
|
|
4395
4223
|
// src/Tabs/Tabs.tsx
|
|
4396
|
-
var
|
|
4224
|
+
var import_react61 = require("react");
|
|
4397
4225
|
var import_tabs3 = require("@react-aria/tabs");
|
|
4398
4226
|
var import_collections7 = require("@react-stately/collections");
|
|
4399
4227
|
var import_tabs4 = require("@react-stately/tabs");
|
|
4400
|
-
var
|
|
4228
|
+
var import_system78 = require("@marigold/system");
|
|
4401
4229
|
|
|
4402
4230
|
// src/Tabs/Context.ts
|
|
4403
|
-
var
|
|
4404
|
-
var TabContext = (0,
|
|
4405
|
-
var useTabContext = () => (0,
|
|
4231
|
+
var import_react58 = require("react");
|
|
4232
|
+
var TabContext = (0, import_react58.createContext)({});
|
|
4233
|
+
var useTabContext = () => (0, import_react58.useContext)(TabContext);
|
|
4406
4234
|
|
|
4407
4235
|
// src/Tabs/Tab.tsx
|
|
4408
|
-
var
|
|
4409
|
-
var
|
|
4236
|
+
var import_react59 = require("react");
|
|
4237
|
+
var import_interactions8 = require("@react-aria/interactions");
|
|
4410
4238
|
var import_tabs = require("@react-aria/tabs");
|
|
4411
|
-
var
|
|
4412
|
-
var
|
|
4413
|
-
var
|
|
4239
|
+
var import_utils25 = require("@react-aria/utils");
|
|
4240
|
+
var import_system76 = require("@marigold/system");
|
|
4241
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
4414
4242
|
var Tab = ({ item, state }) => {
|
|
4415
4243
|
const { key, rendered } = item;
|
|
4416
|
-
const ref = (0,
|
|
4244
|
+
const ref = (0, import_react59.useRef)(null);
|
|
4417
4245
|
const { tabProps, isSelected } = (0, import_tabs.useTab)({ key }, state, ref);
|
|
4418
4246
|
const disabled = tabProps["aria-disabled"];
|
|
4419
|
-
const { hoverProps, isHovered } = (0,
|
|
4247
|
+
const { hoverProps, isHovered } = (0, import_interactions8.useHover)({
|
|
4420
4248
|
isDisabled: disabled || isSelected
|
|
4421
4249
|
});
|
|
4422
|
-
const { focusProps } = (0,
|
|
4423
|
-
const stateProps = (0,
|
|
4250
|
+
const { focusProps } = (0, import_interactions8.useFocus)({});
|
|
4251
|
+
const stateProps = (0, import_system76.useStateProps)({ active: isSelected, hover: isHovered });
|
|
4424
4252
|
const { classNames: classNames2 } = useTabContext();
|
|
4425
|
-
return /* @__PURE__ */ (0,
|
|
4253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4426
4254
|
"div",
|
|
4427
4255
|
{
|
|
4428
|
-
className: (0,
|
|
4256
|
+
className: (0, import_system76.cn)(
|
|
4429
4257
|
"flex cursor-pointer justify-center aria-disabled:cursor-not-allowed",
|
|
4430
4258
|
classNames2.tab
|
|
4431
4259
|
),
|
|
4432
|
-
...(0,
|
|
4260
|
+
...(0, import_utils25.mergeProps)(tabProps, stateProps, focusProps, hoverProps),
|
|
4433
4261
|
ref,
|
|
4434
4262
|
children: rendered
|
|
4435
4263
|
}
|
|
@@ -4437,21 +4265,21 @@ var Tab = ({ item, state }) => {
|
|
|
4437
4265
|
};
|
|
4438
4266
|
|
|
4439
4267
|
// src/Tabs/TabPanel.tsx
|
|
4440
|
-
var
|
|
4268
|
+
var import_react60 = require("react");
|
|
4441
4269
|
var import_tabs2 = require("@react-aria/tabs");
|
|
4442
|
-
var
|
|
4443
|
-
var
|
|
4270
|
+
var import_system77 = require("@marigold/system");
|
|
4271
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
4444
4272
|
var TabPanel = ({ state, ...props }) => {
|
|
4445
4273
|
var _a;
|
|
4446
|
-
const ref = (0,
|
|
4274
|
+
const ref = (0, import_react60.useRef)(null);
|
|
4447
4275
|
const { tabPanelProps } = (0, import_tabs2.useTabPanel)(props, state, ref);
|
|
4448
4276
|
const selectedItemProps = (_a = state.selectedItem) == null ? void 0 : _a.props;
|
|
4449
4277
|
const { classNames: classNames2 } = useTabContext();
|
|
4450
|
-
return /* @__PURE__ */ (0,
|
|
4278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: (0, import_system77.cn)(classNames2.tabpanel), ref, ...tabPanelProps, children: selectedItemProps == null ? void 0 : selectedItemProps.children });
|
|
4451
4279
|
};
|
|
4452
4280
|
|
|
4453
4281
|
// src/Tabs/Tabs.tsx
|
|
4454
|
-
var
|
|
4282
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
4455
4283
|
var Tabs = ({
|
|
4456
4284
|
space = 2,
|
|
4457
4285
|
size = "medium",
|
|
@@ -4460,31 +4288,31 @@ var Tabs = ({
|
|
|
4460
4288
|
...rest
|
|
4461
4289
|
}) => {
|
|
4462
4290
|
var _a;
|
|
4463
|
-
const ref = (0,
|
|
4291
|
+
const ref = (0, import_react61.useRef)(null);
|
|
4464
4292
|
const props = {
|
|
4465
4293
|
isDisabled: disabled,
|
|
4466
4294
|
...rest
|
|
4467
4295
|
};
|
|
4468
4296
|
const state = (0, import_tabs4.useTabListState)(props);
|
|
4469
4297
|
const { tabListProps } = (0, import_tabs3.useTabList)(props, state, ref);
|
|
4470
|
-
const classNames2 = (0,
|
|
4298
|
+
const classNames2 = (0, import_system78.useClassNames)({
|
|
4471
4299
|
component: "Tabs",
|
|
4472
4300
|
size,
|
|
4473
4301
|
variant
|
|
4474
4302
|
});
|
|
4475
|
-
return /* @__PURE__ */ (0,
|
|
4476
|
-
/* @__PURE__ */ (0,
|
|
4303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TabContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_system78.cn)(classNames2.container), children: [
|
|
4304
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
4477
4305
|
"div",
|
|
4478
4306
|
{
|
|
4479
|
-
className: (0,
|
|
4307
|
+
className: (0, import_system78.cn)("flex", import_system78.gapSpace[space], classNames2.tabs),
|
|
4480
4308
|
...tabListProps,
|
|
4481
4309
|
ref,
|
|
4482
4310
|
children: [...state.collection].map((item) => {
|
|
4483
|
-
return /* @__PURE__ */ (0,
|
|
4311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Tab, { item, state }, item.key);
|
|
4484
4312
|
})
|
|
4485
4313
|
}
|
|
4486
4314
|
),
|
|
4487
|
-
/* @__PURE__ */ (0,
|
|
4315
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TabPanel, { state }, (_a = state.selectedItem) == null ? void 0 : _a.key)
|
|
4488
4316
|
] }) });
|
|
4489
4317
|
};
|
|
4490
4318
|
Tabs.Item = import_collections7.Item;
|
|
@@ -4556,6 +4384,7 @@ Tabs.Item = import_collections7.Item;
|
|
|
4556
4384
|
VisuallyHidden,
|
|
4557
4385
|
XLoader,
|
|
4558
4386
|
_Slider,
|
|
4387
|
+
_TextArea,
|
|
4559
4388
|
useAsyncList,
|
|
4560
4389
|
useFieldGroupContext,
|
|
4561
4390
|
useListData,
|