@alma-oss/spirit-web-react 4.1.0 → 4.2.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/README.md +2 -1
- package/bundles/web-react.umd.js +765 -419
- package/bundles/web-react.umd.js.map +1 -1
- package/bundles/web-react.umd.min.js +1 -1
- package/bundles/web-react.umd.min.js.map +1 -1
- package/components/Accordion/Accordion.cjs +24 -8
- package/components/Accordion/Accordion.cjs.map +1 -1
- package/components/Accordion/Accordion.d.ts +5 -3
- package/components/Accordion/Accordion.js +2 -0
- package/components/Accordion/Accordion.js.map +1 -1
- package/components/Accordion/AccordionHeader.d.ts +5 -3
- package/components/Accordion/AccordionHeader.js +14 -4
- package/components/Accordion/AccordionHeader.js.map +1 -1
- package/components/Accordion/AccordionItem.d.ts +5 -3
- package/components/Accordion/AccordionItem.js +2 -0
- package/components/Accordion/AccordionItem.js.map +1 -1
- package/components/Accordion/UncontrolledAccordion.d.ts +5 -3
- package/components/Accordion/UncontrolledAccordion.js +3 -1
- package/components/Accordion/UncontrolledAccordion.js.map +1 -1
- package/components/Accordion/useAccordion.d.ts +2 -2
- package/components/Accordion/useAccordion.js.map +1 -1
- package/components/ActionGroup/ActionGroup.cjs +4 -2
- package/components/ActionGroup/ActionGroup.cjs.map +1 -1
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Button/Button.cjs +49 -12
- package/components/Button/Button.cjs.map +1 -1
- package/components/Button/Button.js.map +1 -1
- package/components/Button/useButtonStyleProps.js +6 -6
- package/components/Button/useButtonStyleProps.js.map +1 -1
- package/components/ButtonLink/ButtonLink.js.map +1 -1
- package/components/ButtonLink/useButtonLinkStyleProps.js +6 -6
- package/components/ButtonLink/useButtonLinkStyleProps.js.map +1 -1
- package/components/Card/CardLink.d.ts +1 -1
- package/components/Card/CardLink.js.map +1 -1
- package/components/Checkbox/Checkbox.cjs +45 -1
- package/components/Checkbox/Checkbox.cjs.map +1 -1
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/Checkbox/useCheckboxStyleProps.js +5 -2
- package/components/Checkbox/useCheckboxStyleProps.js.map +1 -1
- package/components/Collapse/Collapse.cjs +2 -2
- package/components/Collapse/Collapse.cjs.map +1 -1
- package/components/ControlButton/ControlButton.js.map +1 -1
- package/components/ControlButton/useControlButtonStyleProps.js +3 -4
- package/components/ControlButton/useControlButtonStyleProps.js.map +1 -1
- package/components/Drawer/Drawer.cjs +49 -12
- package/components/Drawer/Drawer.cjs.map +1 -1
- package/components/Drawer/DrawerPanel.js.map +1 -1
- package/components/FileUploader/FileUploader.cjs +6 -4
- package/components/FileUploader/FileUploader.cjs.map +1 -1
- package/components/FileUploader/FileUploaderAttachment.js +3 -3
- package/components/FileUploader/FileUploaderAttachment.js.map +1 -1
- package/components/FileUploader/FileUploaderList.js +2 -1
- package/components/FileUploader/FileUploaderList.js.map +1 -1
- package/components/FileUploader/constants.d.ts +1 -0
- package/components/FileUploader/constants.js +1 -0
- package/components/FileUploader/constants.js.map +1 -1
- package/components/FileUploader/useFileUploaderInput.js.map +1 -1
- package/components/Flex/Flex.cjs +4 -2
- package/components/Flex/Flex.cjs.map +1 -1
- package/components/Flex/Flex.d.ts +2 -0
- package/components/Flex/Flex.js +2 -0
- package/components/Flex/Flex.js.map +1 -1
- package/components/Flex/useFlexStyleProps.d.ts +2 -2
- package/components/Footer/Footer.cjs +40 -3
- package/components/Footer/Footer.cjs.map +1 -1
- package/components/Footer/Footer.d.ts +2 -2
- package/components/Footer/Footer.js +5 -3
- package/components/Footer/Footer.js.map +1 -1
- package/components/Footer/useFooterStyleProps.d.ts +2 -2
- package/components/Footer/useFooterStyleProps.js.map +1 -1
- package/components/Grid/Grid.cjs +10 -5
- package/components/Grid/Grid.cjs.map +1 -1
- package/components/Grid/Grid.d.ts +2 -0
- package/components/Grid/Grid.js +2 -0
- package/components/Grid/Grid.js.map +1 -1
- package/components/Grid/GridItem.d.ts +2 -0
- package/components/Grid/GridItem.js +2 -0
- package/components/Grid/GridItem.js.map +1 -1
- package/components/Grid/useGridItemStyleProps.d.ts +2 -2
- package/components/Grid/useGridItemStyleProps.js +6 -5
- package/components/Grid/useGridItemStyleProps.js.map +1 -1
- package/components/Grid/useGridStyleProps.d.ts +2 -2
- package/components/Header/Header.cjs +49 -12
- package/components/Header/Header.cjs.map +1 -1
- package/components/Header/HeaderDialogLink.js.map +1 -1
- package/components/Header/HeaderLink.js.map +1 -1
- package/components/Hidden/Hidden.d.ts +9 -0
- package/components/Hidden/Hidden.js +31 -0
- package/components/Hidden/Hidden.js.map +1 -0
- package/components/Hidden/index.d.ts +1 -0
- package/components/Hidden/index.js +2 -0
- package/components/Hidden/index.js.map +1 -0
- package/components/Icon/Icon.js.map +1 -1
- package/components/Icon/useIconStyleProps.d.ts +10 -10
- package/components/Link/Link.js.map +1 -1
- package/components/Matrix/Matrix.cjs.map +1 -1
- package/components/Matrix/Matrix.js +2 -2
- package/components/Matrix/Matrix.js.map +1 -1
- package/components/Matrix/useMatrixStyleProps.d.ts +1 -1
- package/components/Matrix/useMatrixStyleProps.js.map +1 -1
- package/components/Modal/Modal.cjs +54 -16
- package/components/Modal/Modal.cjs.map +1 -1
- package/components/Modal/ModalCloseButton.js +2 -1
- package/components/Modal/ModalCloseButton.js.map +1 -1
- package/components/Modal/ModalHeader.js +2 -1
- package/components/Modal/ModalHeader.js.map +1 -1
- package/components/Modal/constants.d.ts +1 -0
- package/components/Modal/constants.js +2 -0
- package/components/Modal/constants.js.map +1 -0
- package/components/Modal/useModalDialogStyleProps.js +1 -2
- package/components/Modal/useModalDialogStyleProps.js.map +1 -1
- package/components/Navigation/NavigationAction.js.map +1 -1
- package/components/Navigation/NavigationAvatar.js.map +1 -1
- package/components/Pagination/Pagination.cjs +61 -19
- package/components/Pagination/Pagination.cjs.map +1 -1
- package/components/Pagination/PaginationButtonLink.js +4 -1
- package/components/Pagination/PaginationButtonLink.js.map +1 -1
- package/components/Pagination/PaginationLink.js +4 -2
- package/components/Pagination/PaginationLink.js.map +1 -1
- package/components/Pagination/PaginationLinkNext.js.map +1 -1
- package/components/Pagination/PaginationLinkPrevious.js.map +1 -1
- package/components/Pagination/UncontrolledPagination.js +2 -1
- package/components/Pagination/UncontrolledPagination.js.map +1 -1
- package/components/Pagination/constants.d.ts +1 -0
- package/components/Pagination/constants.js +1 -0
- package/components/Pagination/constants.js.map +1 -1
- package/components/PricingPlan/PricingPlan.cjs +54 -16
- package/components/PricingPlan/PricingPlan.cjs.map +1 -1
- package/components/Radio/Radio.cjs +45 -1
- package/components/Radio/Radio.cjs.map +1 -1
- package/components/Radio/Radio.js.map +1 -1
- package/components/Radio/useRadioStyleProps.js +5 -2
- package/components/Radio/useRadioStyleProps.js.map +1 -1
- package/components/ScrollView/ScrollView.cjs +80 -11
- package/components/ScrollView/ScrollView.cjs.map +1 -1
- package/components/ScrollView/ScrollViewArrows.js +3 -8
- package/components/ScrollView/ScrollViewArrows.js.map +1 -1
- package/components/ScrollView/constants.d.ts +1 -0
- package/components/ScrollView/constants.js +1 -0
- package/components/ScrollView/constants.js.map +1 -1
- package/components/ScrollView/index.d.ts +1 -0
- package/components/ScrollView/index.js +1 -0
- package/components/ScrollView/index.js.map +1 -1
- package/components/ScrollView/useScrollCallback.d.ts +10 -0
- package/components/ScrollView/useScrollCallback.js +41 -0
- package/components/ScrollView/useScrollCallback.js.map +1 -0
- package/components/ScrollView/useScrollPosition.js.map +1 -1
- package/components/SegmentedControl/SegmentedControlContext.js.map +1 -1
- package/components/Select/Select.js.map +1 -1
- package/components/Skeleton/useSkeletonShapeStyleProps.d.ts +10 -10
- package/components/SkipLink/SkipLink.js.map +1 -1
- package/components/Slider/Slider.js.map +1 -1
- package/components/Spinner/Spinner.js.map +1 -1
- package/components/SplitButton/SplitButton.cjs +52 -12
- package/components/SplitButton/SplitButton.cjs.map +1 -1
- package/components/SplitButton/UncontrolledSplitButton.js +2 -0
- package/components/SplitButton/UncontrolledSplitButton.js.map +1 -1
- package/components/SplitButton/constants.d.ts +1 -0
- package/components/SplitButton/constants.js +2 -0
- package/components/SplitButton/constants.js.map +1 -0
- package/components/Tabs/TabContext.js.map +1 -1
- package/components/Tabs/TabLink.js.map +1 -1
- package/components/Tag/Tag.js.map +1 -1
- package/components/TextArea/TextArea.cjs +7 -1
- package/components/TextArea/TextArea.cjs.map +1 -1
- package/components/TextArea/TextArea.js.map +1 -1
- package/components/TextArea/useAdjustHeight.js.map +1 -1
- package/components/TextField/TextField.cjs +7 -1
- package/components/TextField/TextField.cjs.map +1 -1
- package/components/TextField/TextField.js.map +1 -1
- package/components/TextFieldBase/TextFieldBase.cjs +7 -1
- package/components/TextFieldBase/TextFieldBase.cjs.map +1 -1
- package/components/TextFieldBase/TextFieldBase.d.ts +2 -2
- package/components/TextFieldBase/TextFieldBase.js.map +1 -1
- package/components/TextFieldBase/TextFieldBaseInput.js.map +1 -1
- package/components/TextFieldBase/TextFieldBasePasswordToggle.js +5 -1
- package/components/TextFieldBase/TextFieldBasePasswordToggle.js.map +1 -1
- package/components/TextFieldBase/constants.d.ts +2 -0
- package/components/TextFieldBase/constants.js +3 -0
- package/components/TextFieldBase/constants.js.map +1 -0
- package/components/Toast/Toast.cjs +1 -1
- package/components/Toast/Toast.cjs.map +1 -1
- package/components/Toast/ToastBarLink.js.map +1 -1
- package/components/Toast/ToastContext.js +2 -2
- package/components/Toast/ToastContext.js.map +1 -1
- package/components/Toast/UncontrolledToast.js +2 -1
- package/components/Toast/UncontrolledToast.js.map +1 -1
- package/components/Toast/useToastBarStyleProps.d.ts +10 -10
- package/components/Toggle/Toggle.cjs +46 -1
- package/components/Toggle/Toggle.cjs.map +1 -1
- package/components/Toggle/Toggle.js.map +1 -1
- package/components/Toggle/useToggleStyleProps.js +5 -2
- package/components/Toggle/useToggleStyleProps.js.map +1 -1
- package/components/UNSTABLE_Header/UNSTABLE_HeaderLogo.js.map +1 -1
- package/components/components.cjs +441 -285
- package/components/components.cjs.map +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/constants/constants.cjs +6 -0
- package/constants/constants.cjs.map +1 -1
- package/constants/index.d.ts +1 -0
- package/constants/index.js +1 -0
- package/constants/index.js.map +1 -1
- package/constants/inputs.d.ts +4 -0
- package/constants/inputs.js +5 -0
- package/constants/inputs.js.map +1 -0
- package/hooks/hooks.cjs +48 -7
- package/hooks/hooks.cjs.map +1 -1
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +2 -1
- package/hooks/index.js.map +1 -1
- package/hooks/useDeprecationMessage.js +2 -2
- package/hooks/useDeprecationMessage.js.map +1 -1
- package/hooks/useInputPositionClass.d.ts +2 -0
- package/hooks/useInputPositionClass.js +8 -0
- package/hooks/useInputPositionClass.js.map +1 -0
- package/hooks/useSymmetry.d.ts +7 -0
- package/hooks/useSymmetry.js +39 -0
- package/hooks/useSymmetry.js.map +1 -0
- package/index.cjs +444 -290
- package/index.cjs.map +1 -1
- package/package.json +11 -18
- package/spirit-web-react.cjs +444 -290
- package/spirit-web-react.cjs.map +1 -1
- package/spirit-web-react.min.cjs +1 -1
- package/types/accordion.d.ts +14 -7
- package/types/box.d.ts +2 -2
- package/types/button.d.ts +2 -2
- package/types/checkbox.d.ts +2 -1
- package/types/controlButton.d.ts +2 -2
- package/types/flex.d.ts +2 -3
- package/types/footer.d.ts +7 -2
- package/types/grid.d.ts +3 -5
- package/types/hidden.d.ts +10 -0
- package/types/hidden.js +2 -0
- package/types/hidden.js.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/types/index.js.map +1 -1
- package/types/item.d.ts +2 -2
- package/types/pricingPlan.d.ts +1 -1
- package/types/radio.d.ts +2 -1
- package/types/shared/inputs.d.ts +3 -0
- package/types/slider.d.ts +2 -2
- package/types/toggle.d.ts +2 -1
- package/hooks/useDirectionClass.d.ts +0 -2
- package/hooks/useDirectionClass.js +0 -5
- package/hooks/useDirectionClass.js.map +0 -1
package/spirit-web-react.cjs
CHANGED
|
@@ -83,7 +83,7 @@ const ColorPrefixes = {
|
|
|
83
83
|
EMOTION: 'emotion',
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
var __rest$
|
|
86
|
+
var __rest$2W = (undefined && undefined.__rest) || function (s, e) {
|
|
87
87
|
var t = {};
|
|
88
88
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
89
89
|
t[p] = s[p];
|
|
@@ -183,7 +183,7 @@ const Sizes = {
|
|
|
183
183
|
LARGE: 'large',
|
|
184
184
|
};
|
|
185
185
|
const SizesExtended = Object.assign(Object.assign({ XSMALL: 'xsmall' }, Sizes), { XLARGE: 'xlarge' });
|
|
186
|
-
const _a = createUppercaseKeyDictionary(spiritDesignTokens.containers), { MAXWIDTH, PADDING } = _a, ContainerTokenSizes = __rest$
|
|
186
|
+
const _a = createUppercaseKeyDictionary(spiritDesignTokens.containers), { MAXWIDTH, PADDING } = _a, ContainerTokenSizes = __rest$2W(_a, ["MAXWIDTH", "PADDING"]);
|
|
187
187
|
const ValidationStates = {
|
|
188
188
|
SUCCESS: 'success',
|
|
189
189
|
WARNING: 'warning',
|
|
@@ -210,6 +210,11 @@ exports.DirectionAxis = void 0;
|
|
|
210
210
|
})(exports.DirectionAxis || (exports.DirectionAxis = {}));
|
|
211
211
|
const isDirectionHorizontal = (direction) => direction === Direction.HORIZONTAL;
|
|
212
212
|
|
|
213
|
+
const InputPositions = {
|
|
214
|
+
START: 'start',
|
|
215
|
+
END: 'end',
|
|
216
|
+
};
|
|
217
|
+
|
|
213
218
|
const ObjectFit = {
|
|
214
219
|
CONTAIN: 'contain',
|
|
215
220
|
COVER: 'cover',
|
|
@@ -621,7 +626,7 @@ const useStyleUtilities = (props, prefix = '', additionalProps = {}) => {
|
|
|
621
626
|
};
|
|
622
627
|
};
|
|
623
628
|
|
|
624
|
-
var __rest$
|
|
629
|
+
var __rest$2V = (undefined && undefined.__rest) || function (s, e) {
|
|
625
630
|
var t = {};
|
|
626
631
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
627
632
|
t[p] = s[p];
|
|
@@ -634,7 +639,7 @@ var __rest$2U = (undefined && undefined.__rest) || function (s, e) {
|
|
|
634
639
|
};
|
|
635
640
|
function useStyleProps(props, additionalUtilities) {
|
|
636
641
|
const classNamePrefix = React.useContext(ClassNamePrefixContext);
|
|
637
|
-
const { UNSAFE_className, UNSAFE_style } = props, otherProps = __rest$
|
|
642
|
+
const { UNSAFE_className, UNSAFE_style } = props, otherProps = __rest$2V(props, ["UNSAFE_className", "UNSAFE_style"]);
|
|
638
643
|
const styleUtilitiesConfig = Object.assign({ theme: ThemeStyleProps.theme }, (additionalUtilities !== null && additionalUtilities !== void 0 ? additionalUtilities : {}));
|
|
639
644
|
const { styleUtilities, props: modifiedProps } = useStyleUtilities(otherProps, classNamePrefix, styleUtilitiesConfig);
|
|
640
645
|
const style = Object.assign({}, UNSAFE_style);
|
|
@@ -760,11 +765,11 @@ const useClickOutside = ({ ref, callback }) => {
|
|
|
760
765
|
};
|
|
761
766
|
|
|
762
767
|
const useDeprecationMessage = ({ method = 'component', trigger, componentName, componentProps, propertyProps, customText, }) => {
|
|
763
|
-
let message;
|
|
764
|
-
let hasProps;
|
|
765
768
|
const messageBase = `Deprecation warning (${componentName}):`;
|
|
766
769
|
React.useEffect(() => {
|
|
767
770
|
const isExecutable = trigger && componentName && "development" === 'development';
|
|
771
|
+
let message;
|
|
772
|
+
let hasProps;
|
|
768
773
|
switch (method) {
|
|
769
774
|
case 'property':
|
|
770
775
|
if (propertyProps === null || propertyProps === void 0 ? void 0 : propertyProps.delete) {
|
|
@@ -815,10 +820,6 @@ const useDimensionStyle = (property, prefix) => {
|
|
|
815
820
|
return style;
|
|
816
821
|
};
|
|
817
822
|
|
|
818
|
-
function useDirectionClass(componentClass, property) {
|
|
819
|
-
return generateStylePropsClassNames(componentClass, property);
|
|
820
|
-
}
|
|
821
|
-
|
|
822
823
|
const useDragAndDrop = (props) => {
|
|
823
824
|
const [isDragging, setDragging] = React.useState(false);
|
|
824
825
|
const onDragOverHandler = (event) => {
|
|
@@ -873,6 +874,13 @@ function useIconName(key, iconMap, defaultKey = 'default') {
|
|
|
873
874
|
return key && iconMap[key] ? iconMap[key] : iconMap[defaultKey];
|
|
874
875
|
}
|
|
875
876
|
|
|
877
|
+
function useInputPositionClass(componentClass, property) {
|
|
878
|
+
if (!property) {
|
|
879
|
+
return '';
|
|
880
|
+
}
|
|
881
|
+
return generateStylePropsClassNames(componentClass, property, 'inputPosition');
|
|
882
|
+
}
|
|
883
|
+
|
|
876
884
|
const useLastActiveFocus = (isOpen) => {
|
|
877
885
|
const lastActiveElement = React.useRef(null);
|
|
878
886
|
React.useEffect(() => {
|
|
@@ -1002,6 +1010,43 @@ function useSpacingStyle(spacing, prefix, direction = undefined) {
|
|
|
1002
1010
|
return style;
|
|
1003
1011
|
}
|
|
1004
1012
|
|
|
1013
|
+
const SYMMETRICAL_CLASS_SUFFIX = '--symmetrical';
|
|
1014
|
+
const NON_SYMMETRICAL_CLASS_SUFFIX = '--asymmetrical';
|
|
1015
|
+
function getSymmetryClassNamesReducer(componentClass, isSymmetrical) {
|
|
1016
|
+
return (acc, breakpoint) => {
|
|
1017
|
+
if (breakpoint in isSymmetrical) {
|
|
1018
|
+
const value = isSymmetrical[breakpoint];
|
|
1019
|
+
const infix = breakpoint === BREAKPOINT_MOBILE ? '' : `--${breakpoint}`;
|
|
1020
|
+
if (value) {
|
|
1021
|
+
return {
|
|
1022
|
+
classes: [...acc.classes, `${componentClass}${infix}${SYMMETRICAL_CLASS_SUFFIX}`],
|
|
1023
|
+
wasSymmetrical: true,
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
if (acc.wasSymmetrical) {
|
|
1027
|
+
return {
|
|
1028
|
+
classes: [...acc.classes, `${componentClass}${infix}${NON_SYMMETRICAL_CLASS_SUFFIX}`],
|
|
1029
|
+
wasSymmetrical: acc.wasSymmetrical,
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
return acc;
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
function useSymmetry(componentClass, isSymmetrical) {
|
|
1037
|
+
if (typeof isSymmetrical !== 'object' || isSymmetrical === null) {
|
|
1038
|
+
return {
|
|
1039
|
+
isSymmetricalActive: isSymmetrical === true,
|
|
1040
|
+
symmetricalClassName: isSymmetrical ? `${componentClass}${SYMMETRICAL_CLASS_SUFFIX}` : '',
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
const { classes } = Object.keys(spiritDesignTokens.breakpoints).reduce(getSymmetryClassNamesReducer(componentClass, isSymmetrical), { classes: [], wasSymmetrical: false });
|
|
1044
|
+
return {
|
|
1045
|
+
isSymmetricalActive: Object.values(isSymmetrical).includes(true),
|
|
1046
|
+
symmetricalClassName: classes.join(' '),
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1005
1050
|
const useToggle = (initialState = false) => {
|
|
1006
1051
|
const [state, setState] = React.useState(initialState);
|
|
1007
1052
|
const toggle = React.useCallback(() => setState((prevState) => !prevState), []);
|
|
@@ -1067,7 +1112,7 @@ const useOpenItem = (id) => {
|
|
|
1067
1112
|
};
|
|
1068
1113
|
};
|
|
1069
1114
|
|
|
1070
|
-
var __rest$
|
|
1115
|
+
var __rest$2U = (undefined && undefined.__rest) || function (s, e) {
|
|
1071
1116
|
var t = {};
|
|
1072
1117
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1073
1118
|
t[p] = s[p];
|
|
@@ -1079,7 +1124,7 @@ var __rest$2T = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1079
1124
|
return t;
|
|
1080
1125
|
};
|
|
1081
1126
|
const Accordion = (props) => {
|
|
1082
|
-
const { children, elementType: ElementTag = 'section', open, toggle } = props, restProps = __rest$
|
|
1127
|
+
const { children, elementType: ElementTag = 'section', open, toggle } = props, restProps = __rest$2U(props, ["children", "elementType", "open", "toggle"]);
|
|
1083
1128
|
const { classProps } = useAccordionStyleProps();
|
|
1084
1129
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
1085
1130
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.root, styleProps });
|
|
@@ -1091,6 +1136,8 @@ const Accordion = (props) => {
|
|
|
1091
1136
|
React.createElement(AccordionProvider, { value: contextValue }, children)));
|
|
1092
1137
|
};
|
|
1093
1138
|
Accordion.spiritComponent = 'Accordion';
|
|
1139
|
+
Accordion.spiritDefaultElement = 'section';
|
|
1140
|
+
Accordion.spiritDefaultProps = null;
|
|
1094
1141
|
|
|
1095
1142
|
const defaultContext$8 = {
|
|
1096
1143
|
id: '',
|
|
@@ -1100,7 +1147,7 @@ const AccordionItemProvider = AccordionItemContext.Provider;
|
|
|
1100
1147
|
AccordionItemContext.Consumer;
|
|
1101
1148
|
const useAccordionItemContext = () => React.useContext(AccordionItemContext);
|
|
1102
1149
|
|
|
1103
|
-
var __rest$
|
|
1150
|
+
var __rest$2T = (undefined && undefined.__rest) || function (s, e) {
|
|
1104
1151
|
var t = {};
|
|
1105
1152
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1106
1153
|
t[p] = s[p];
|
|
@@ -1112,7 +1159,7 @@ var __rest$2S = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1112
1159
|
return t;
|
|
1113
1160
|
};
|
|
1114
1161
|
const AccordionItem = (props) => {
|
|
1115
|
-
const { children, elementType: ElementTag = 'article', id } = props, restProps = __rest$
|
|
1162
|
+
const { children, elementType: ElementTag = 'article', id } = props, restProps = __rest$2T(props, ["children", "elementType", "id"]);
|
|
1116
1163
|
const { classProps } = useAccordionStyleProps();
|
|
1117
1164
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
1118
1165
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.item, styleProps });
|
|
@@ -1121,12 +1168,14 @@ const AccordionItem = (props) => {
|
|
|
1121
1168
|
React.createElement(AccordionItemProvider, { value: contextValue }, children)));
|
|
1122
1169
|
};
|
|
1123
1170
|
AccordionItem.spiritComponent = 'AccordionItem';
|
|
1171
|
+
AccordionItem.spiritDefaultElement = 'article';
|
|
1172
|
+
AccordionItem.spiritDefaultProps = null;
|
|
1124
1173
|
|
|
1125
1174
|
const DEFAULT_BOX_SIZE = 24;
|
|
1126
1175
|
|
|
1127
1176
|
const useIconBoxSize = (boxSize) => { var _a; return typeof boxSize === 'object' ? ((_a = boxSize.mobile) !== null && _a !== void 0 ? _a : DEFAULT_BOX_SIZE) : (boxSize !== null && boxSize !== void 0 ? boxSize : DEFAULT_BOX_SIZE); };
|
|
1128
1177
|
|
|
1129
|
-
var __rest$
|
|
1178
|
+
var __rest$2S = (undefined && undefined.__rest) || function (s, e) {
|
|
1130
1179
|
var t = {};
|
|
1131
1180
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1132
1181
|
t[p] = s[p];
|
|
@@ -1148,7 +1197,7 @@ const setCustomDimension$1 = (prefix, size) => {
|
|
|
1148
1197
|
return style;
|
|
1149
1198
|
};
|
|
1150
1199
|
const useIconStyleProps = (props) => {
|
|
1151
|
-
const { boxSize, color, name } = props, otherProps = __rest$
|
|
1200
|
+
const { boxSize, color, name } = props, otherProps = __rest$2S(props, ["boxSize", "color", "name"]);
|
|
1152
1201
|
const stylePrefix = `--${spiritDesignTokens.cssVariablePrefix}icon`;
|
|
1153
1202
|
const isDualtoneIcon = String(name).includes('-dualtone');
|
|
1154
1203
|
const dualtoneColorWithDefault = isDualtoneIcon && !color ? TextColors.PRIMARY : color;
|
|
@@ -1165,7 +1214,7 @@ const useIconStyleProps = (props) => {
|
|
|
1165
1214
|
};
|
|
1166
1215
|
};
|
|
1167
1216
|
|
|
1168
|
-
var __rest$
|
|
1217
|
+
var __rest$2R = (undefined && undefined.__rest) || function (s, e) {
|
|
1169
1218
|
var t = {};
|
|
1170
1219
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1171
1220
|
t[p] = s[p];
|
|
@@ -1176,13 +1225,13 @@ var __rest$2Q = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1176
1225
|
}
|
|
1177
1226
|
return t;
|
|
1178
1227
|
};
|
|
1179
|
-
const defaultProps$
|
|
1228
|
+
const defaultProps$10 = {
|
|
1180
1229
|
ariaHidden: true,
|
|
1181
1230
|
boxSize: DEFAULT_BOX_SIZE,
|
|
1182
1231
|
};
|
|
1183
1232
|
const _Icon = (props, ref) => {
|
|
1184
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1185
|
-
const { boxSize, name, title, ariaHidden } = propsWithDefaults, restProps = __rest$
|
|
1233
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$10), props);
|
|
1234
|
+
const { boxSize, name, title, ariaHidden } = propsWithDefaults, restProps = __rest$2R(propsWithDefaults, ["boxSize", "name", "title", "ariaHidden"]);
|
|
1186
1235
|
let icon = useIcon(name);
|
|
1187
1236
|
const iconSize = useIconBoxSize(boxSize);
|
|
1188
1237
|
const { classProps, iconStyleProps, props: modifiedProps } = useIconStyleProps(Object.assign({ boxSize, name }, restProps));
|
|
@@ -1200,7 +1249,7 @@ const _Icon = (props, ref) => {
|
|
|
1200
1249
|
const Icon = React.forwardRef(_Icon);
|
|
1201
1250
|
Icon.spiritComponent = 'Icon';
|
|
1202
1251
|
|
|
1203
|
-
var __rest$
|
|
1252
|
+
var __rest$2Q = (undefined && undefined.__rest) || function (s, e) {
|
|
1204
1253
|
var t = {};
|
|
1205
1254
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1206
1255
|
t[p] = s[p];
|
|
@@ -1211,20 +1260,28 @@ var __rest$2P = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1211
1260
|
}
|
|
1212
1261
|
return t;
|
|
1213
1262
|
};
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1263
|
+
const defaultProps$$ = {
|
|
1264
|
+
elementType: 'h3',
|
|
1265
|
+
};
|
|
1266
|
+
const AccordionHeader = (props) => {
|
|
1267
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$$), props);
|
|
1268
|
+
const { elementType: ElementTag = 'h3', children, slot } = propsWithDefaults, restProps = __rest$2Q(propsWithDefaults, ["elementType", "children", "slot"]);
|
|
1216
1269
|
const { classProps } = useAccordionStyleProps();
|
|
1217
1270
|
const { toggle } = useAccordionContext();
|
|
1218
1271
|
const { id } = useAccordionItemContext();
|
|
1219
1272
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
1220
1273
|
const { isOpen } = useOpenItem(id);
|
|
1221
1274
|
const { triggerProps, headerProps } = useAccordionAriaProps({ id, isOpen });
|
|
1275
|
+
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
1276
|
+
classProps: classProps.header,
|
|
1277
|
+
styleProps,
|
|
1278
|
+
});
|
|
1222
1279
|
const itemToggle = () => {
|
|
1223
1280
|
if (toggle && id) {
|
|
1224
1281
|
toggle(id);
|
|
1225
1282
|
}
|
|
1226
1283
|
};
|
|
1227
|
-
return (React.createElement(
|
|
1284
|
+
return (React.createElement(ElementTag, Object.assign({}, transferProps, mergedStyleProps, headerProps),
|
|
1228
1285
|
React.createElement("button", Object.assign({ type: "button", className: classProps.toggle, onClick: itemToggle }, triggerProps), children),
|
|
1229
1286
|
React.createElement("span", { className: classProps.side },
|
|
1230
1287
|
slot && React.createElement("span", { className: classProps.slot }, slot),
|
|
@@ -1232,8 +1289,10 @@ const AccordionHeader = (_a) => {
|
|
|
1232
1289
|
React.createElement(Icon, { name: "chevron-down" })))));
|
|
1233
1290
|
};
|
|
1234
1291
|
AccordionHeader.spiritComponent = 'AccordionHeader';
|
|
1292
|
+
AccordionHeader.spiritDefaultElement = 'h3';
|
|
1293
|
+
AccordionHeader.spiritDefaultProps = null;
|
|
1235
1294
|
|
|
1236
|
-
var __rest$
|
|
1295
|
+
var __rest$2P = (undefined && undefined.__rest) || function (s, e) {
|
|
1237
1296
|
var t = {};
|
|
1238
1297
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1239
1298
|
t[p] = s[p];
|
|
@@ -1248,7 +1307,7 @@ const ATTRIBUTE_ARIA_EXPANDED = 'aria-expanded';
|
|
|
1248
1307
|
const ATTRIBUTE_ARIA_CONTROLS = 'aria-controls';
|
|
1249
1308
|
const ATTRIBUTE_DATA_BREAKPOINT = 'data-spirit-breakpoint';
|
|
1250
1309
|
const useCollapseAriaProps = (props) => {
|
|
1251
|
-
const { isOpen, collapsibleToBreakpoint } = props, modifiedProps = __rest$
|
|
1310
|
+
const { isOpen, collapsibleToBreakpoint } = props, modifiedProps = __rest$2P(props, ["isOpen", "collapsibleToBreakpoint"]);
|
|
1252
1311
|
useDeprecationMessage({
|
|
1253
1312
|
method: 'custom',
|
|
1254
1313
|
trigger: !modifiedProps.id,
|
|
@@ -1295,7 +1354,7 @@ const useResizeHeight = (ref) => {
|
|
|
1295
1354
|
return height;
|
|
1296
1355
|
};
|
|
1297
1356
|
|
|
1298
|
-
var __rest$
|
|
1357
|
+
var __rest$2O = (undefined && undefined.__rest) || function (s, e) {
|
|
1299
1358
|
var t = {};
|
|
1300
1359
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1301
1360
|
t[p] = s[p];
|
|
@@ -1313,15 +1372,15 @@ const transitioningStyles = {
|
|
|
1313
1372
|
exiting: 'is-transitioning',
|
|
1314
1373
|
exited: '',
|
|
1315
1374
|
};
|
|
1316
|
-
const defaultProps$
|
|
1375
|
+
const defaultProps$_ = {
|
|
1317
1376
|
elementType: 'div',
|
|
1318
1377
|
isOpen: false,
|
|
1319
1378
|
collapsibleToBreakpoint: undefined,
|
|
1320
1379
|
transitionDuration: TRANSITION_DURATION$1,
|
|
1321
1380
|
};
|
|
1322
1381
|
const Collapse = (props) => {
|
|
1323
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1324
|
-
const { elementType: ElementTag = defaultProps$
|
|
1382
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$_), props);
|
|
1383
|
+
const { elementType: ElementTag = defaultProps$_.elementType, children, transitionDuration = TRANSITION_DURATION$1 } = propsWithDefaults, restProps = __rest$2O(propsWithDefaults, ["elementType", "children", "transitionDuration"]);
|
|
1325
1384
|
const rootElementRef = React.useRef(null);
|
|
1326
1385
|
const collapseElementRef = React.useRef(null);
|
|
1327
1386
|
const collapseHeight = useResizeHeight(collapseElementRef);
|
|
@@ -1359,7 +1418,7 @@ const useCollapse = (defaultOpenState) => {
|
|
|
1359
1418
|
};
|
|
1360
1419
|
};
|
|
1361
1420
|
|
|
1362
|
-
var __rest$
|
|
1421
|
+
var __rest$2N = (undefined && undefined.__rest) || function (s, e) {
|
|
1363
1422
|
var t = {};
|
|
1364
1423
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1365
1424
|
t[p] = s[p];
|
|
@@ -1370,12 +1429,12 @@ var __rest$2M = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1370
1429
|
}
|
|
1371
1430
|
return t;
|
|
1372
1431
|
};
|
|
1373
|
-
const defaultProps$
|
|
1432
|
+
const defaultProps$Z = {
|
|
1374
1433
|
isOpen: false,
|
|
1375
1434
|
};
|
|
1376
1435
|
const UncontrolledCollapse = (props) => {
|
|
1377
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1378
|
-
const { children, hideOnCollapse, isDisposable, renderTrigger } = propsWithDefaults, restProps = __rest$
|
|
1436
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$Z), props);
|
|
1437
|
+
const { children, hideOnCollapse, isDisposable, renderTrigger } = propsWithDefaults, restProps = __rest$2N(propsWithDefaults, ["children", "hideOnCollapse", "isDisposable", "renderTrigger"]);
|
|
1379
1438
|
const { isOpen, toggleHandler } = useCollapse(restProps.isOpen);
|
|
1380
1439
|
const { ariaProps } = useCollapseAriaProps(Object.assign(Object.assign({}, restProps), { isOpen }));
|
|
1381
1440
|
const isDisposed = hideOnCollapse || isDisposable;
|
|
@@ -1391,7 +1450,7 @@ const UncontrolledCollapse = (props) => {
|
|
|
1391
1450
|
};
|
|
1392
1451
|
UncontrolledCollapse.spiritComponent = 'UncontrolledCollapse';
|
|
1393
1452
|
|
|
1394
|
-
var __rest$
|
|
1453
|
+
var __rest$2M = (undefined && undefined.__rest) || function (s, e) {
|
|
1395
1454
|
var t = {};
|
|
1396
1455
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1397
1456
|
t[p] = s[p];
|
|
@@ -1403,7 +1462,7 @@ var __rest$2L = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1403
1462
|
return t;
|
|
1404
1463
|
};
|
|
1405
1464
|
const AccordionContent = (_a) => {
|
|
1406
|
-
var { children } = _a, restProps = __rest$
|
|
1465
|
+
var { children } = _a, restProps = __rest$2M(_a, ["children"]);
|
|
1407
1466
|
const { classProps } = useAccordionStyleProps();
|
|
1408
1467
|
const { id } = useAccordionItemContext();
|
|
1409
1468
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
@@ -1414,7 +1473,7 @@ const AccordionContent = (_a) => {
|
|
|
1414
1473
|
};
|
|
1415
1474
|
AccordionContent.spiritComponent = 'AccordionContent';
|
|
1416
1475
|
|
|
1417
|
-
var __rest$
|
|
1476
|
+
var __rest$2L = (undefined && undefined.__rest) || function (s, e) {
|
|
1418
1477
|
var t = {};
|
|
1419
1478
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1420
1479
|
t[p] = s[p];
|
|
@@ -1426,13 +1485,15 @@ var __rest$2K = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1426
1485
|
return t;
|
|
1427
1486
|
};
|
|
1428
1487
|
const UncontrolledAccordion = (props) => {
|
|
1429
|
-
const { defaultOpen, stayOpen } = props, restProps = __rest$
|
|
1488
|
+
const { defaultOpen, stayOpen } = props, restProps = __rest$2L(props, ["defaultOpen", "stayOpen"]);
|
|
1430
1489
|
const { open, toggle } = useAccordion({ defaultOpen, stayOpen });
|
|
1431
|
-
return React.createElement(Accordion, Object.assign({ open: open, toggle: toggle }
|
|
1490
|
+
return React.createElement(Accordion, Object.assign({}, restProps, { open: open, toggle: toggle }));
|
|
1432
1491
|
};
|
|
1433
1492
|
UncontrolledAccordion.spiritComponent = 'UncontrolledAccordion';
|
|
1493
|
+
UncontrolledAccordion.spiritDefaultElement = 'section';
|
|
1494
|
+
UncontrolledAccordion.spiritDefaultProps = null;
|
|
1434
1495
|
|
|
1435
|
-
var __rest$
|
|
1496
|
+
var __rest$2K = (undefined && undefined.__rest) || function (s, e) {
|
|
1436
1497
|
var t = {};
|
|
1437
1498
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1438
1499
|
t[p] = s[p];
|
|
@@ -1444,7 +1505,7 @@ var __rest$2J = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1444
1505
|
return t;
|
|
1445
1506
|
};
|
|
1446
1507
|
function useFlexStyleProps(props) {
|
|
1447
|
-
const { alignmentX, alignmentY, direction, spacing, spacingX, spacingY, isWrapping } = props, restProps = __rest$
|
|
1508
|
+
const { alignmentX, alignmentY, direction, spacing, spacingX, spacingY, isWrapping } = props, restProps = __rest$2K(props, ["alignmentX", "alignmentY", "direction", "spacing", "spacingX", "spacingY", "isWrapping"]);
|
|
1448
1509
|
useDeprecationMessage({
|
|
1449
1510
|
method: 'custom',
|
|
1450
1511
|
trigger: direction === 'row' || direction === 'column',
|
|
@@ -1466,7 +1527,7 @@ function useFlexStyleProps(props) {
|
|
|
1466
1527
|
};
|
|
1467
1528
|
}
|
|
1468
1529
|
|
|
1469
|
-
var __rest$
|
|
1530
|
+
var __rest$2J = (undefined && undefined.__rest) || function (s, e) {
|
|
1470
1531
|
var t = {};
|
|
1471
1532
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1472
1533
|
t[p] = s[p];
|
|
@@ -1477,7 +1538,7 @@ var __rest$2I = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1477
1538
|
}
|
|
1478
1539
|
return t;
|
|
1479
1540
|
};
|
|
1480
|
-
const defaultProps$
|
|
1541
|
+
const defaultProps$Y = {
|
|
1481
1542
|
alignmentX: AlignmentXExtended.STRETCH,
|
|
1482
1543
|
alignmentY: AlignmentYExtended.STRETCH,
|
|
1483
1544
|
direction: DirectionExtended.HORIZONTAL,
|
|
@@ -1485,16 +1546,18 @@ const defaultProps$X = {
|
|
|
1485
1546
|
isWrapping: false,
|
|
1486
1547
|
};
|
|
1487
1548
|
const Flex = (props) => {
|
|
1488
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1489
|
-
const { elementType: ElementTag = 'div', direction, children } = propsWithDefaults, restProps = __rest$
|
|
1549
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$Y), props);
|
|
1550
|
+
const { elementType: ElementTag = 'div', direction, children } = propsWithDefaults, restProps = __rest$2J(propsWithDefaults, ["elementType", "direction", "children"]);
|
|
1490
1551
|
const { classProps, props: modifiedProps, styleProps: flexStyle } = useFlexStyleProps(Object.assign({ direction }, restProps));
|
|
1491
1552
|
const { styleProps, props: otherProps } = useStyleProps(Object.assign({}, modifiedProps));
|
|
1492
1553
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, flexStyle, styleProps, otherProps });
|
|
1493
1554
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
1494
1555
|
};
|
|
1495
1556
|
Flex.spiritComponent = 'Flex';
|
|
1557
|
+
Flex.spiritDefaultElement = 'div';
|
|
1558
|
+
Flex.spiritDefaultProps = null;
|
|
1496
1559
|
|
|
1497
|
-
var __rest$
|
|
1560
|
+
var __rest$2I = (undefined && undefined.__rest) || function (s, e) {
|
|
1498
1561
|
var t = {};
|
|
1499
1562
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1500
1563
|
t[p] = s[p];
|
|
@@ -1505,7 +1568,7 @@ var __rest$2H = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1505
1568
|
}
|
|
1506
1569
|
return t;
|
|
1507
1570
|
};
|
|
1508
|
-
const defaultProps$
|
|
1571
|
+
const defaultProps$X = {
|
|
1509
1572
|
alignmentX: {
|
|
1510
1573
|
mobile: AlignmentXExtended.STRETCH,
|
|
1511
1574
|
tablet: AlignmentXExtended.LEFT,
|
|
@@ -1516,13 +1579,13 @@ const defaultProps$W = {
|
|
|
1516
1579
|
},
|
|
1517
1580
|
};
|
|
1518
1581
|
const ActionGroup = (props) => {
|
|
1519
|
-
const { children } = props, restProps = __rest$
|
|
1520
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1582
|
+
const { children } = props, restProps = __rest$2I(props, ["children"]);
|
|
1583
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$X), restProps);
|
|
1521
1584
|
return React.createElement(Flex, Object.assign({}, propsWithDefaults), children);
|
|
1522
1585
|
};
|
|
1523
1586
|
ActionGroup.spiritComponent = 'ActionGroup';
|
|
1524
1587
|
|
|
1525
|
-
var __rest$
|
|
1588
|
+
var __rest$2H = (undefined && undefined.__rest) || function (s, e) {
|
|
1526
1589
|
var t = {};
|
|
1527
1590
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1528
1591
|
t[p] = s[p];
|
|
@@ -1534,7 +1597,7 @@ var __rest$2G = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1534
1597
|
return t;
|
|
1535
1598
|
};
|
|
1536
1599
|
function useAlertStyleProps(props) {
|
|
1537
|
-
const { color, isCentered } = props, modifiedProps = __rest$
|
|
1600
|
+
const { color, isCentered } = props, modifiedProps = __rest$2H(props, ["color", "isCentered"]);
|
|
1538
1601
|
const alertClass = useClassNamePrefix('Alert');
|
|
1539
1602
|
const alertColorClass = `${alertClass}--${color}`;
|
|
1540
1603
|
const alertCenteredClass = `${alertClass}--center`;
|
|
@@ -1559,7 +1622,7 @@ function useAlertIcon({ color, iconName }) {
|
|
|
1559
1622
|
return iconName || iconNameValue;
|
|
1560
1623
|
}
|
|
1561
1624
|
|
|
1562
|
-
var __rest$
|
|
1625
|
+
var __rest$2G = (undefined && undefined.__rest) || function (s, e) {
|
|
1563
1626
|
var t = {};
|
|
1564
1627
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1565
1628
|
t[p] = s[p];
|
|
@@ -1570,13 +1633,13 @@ var __rest$2F = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1570
1633
|
}
|
|
1571
1634
|
return t;
|
|
1572
1635
|
};
|
|
1573
|
-
const defaultProps$
|
|
1636
|
+
const defaultProps$W = {
|
|
1574
1637
|
color: 'success',
|
|
1575
1638
|
isCentered: false,
|
|
1576
1639
|
};
|
|
1577
1640
|
const Alert = (props) => {
|
|
1578
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1579
|
-
const { elementType: ElementTag = 'div', children, color, iconName } = propsWithDefaults, restProps = __rest$
|
|
1641
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$W), props);
|
|
1642
|
+
const { elementType: ElementTag = 'div', children, color, iconName } = propsWithDefaults, restProps = __rest$2G(propsWithDefaults, ["elementType", "children", "color", "iconName"]);
|
|
1580
1643
|
const { classProps, props: modifiedProps } = useAlertStyleProps(Object.assign({ color }, restProps));
|
|
1581
1644
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
1582
1645
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps });
|
|
@@ -1587,7 +1650,7 @@ const Alert = (props) => {
|
|
|
1587
1650
|
};
|
|
1588
1651
|
Alert.spiritComponent = 'Alert';
|
|
1589
1652
|
|
|
1590
|
-
var __rest$
|
|
1653
|
+
var __rest$2F = (undefined && undefined.__rest) || function (s, e) {
|
|
1591
1654
|
var t = {};
|
|
1592
1655
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1593
1656
|
t[p] = s[p];
|
|
@@ -1600,7 +1663,7 @@ var __rest$2E = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1600
1663
|
};
|
|
1601
1664
|
const getAvatarSizeClassname = (className, size) => compose(applySize(size))(className);
|
|
1602
1665
|
function useAvatarStyleProps(props) {
|
|
1603
|
-
const { isSquare, size } = props, restProps = __rest$
|
|
1666
|
+
const { isSquare, size } = props, restProps = __rest$2F(props, ["isSquare", "size"]);
|
|
1604
1667
|
const avatarClass = useClassNamePrefix('Avatar');
|
|
1605
1668
|
const avatarSquareClass = `${avatarClass}--square`;
|
|
1606
1669
|
const classProps = classNames(avatarClass, getAvatarSizeClassname(avatarClass, size), {
|
|
@@ -1612,7 +1675,7 @@ function useAvatarStyleProps(props) {
|
|
|
1612
1675
|
};
|
|
1613
1676
|
}
|
|
1614
1677
|
|
|
1615
|
-
var __rest$
|
|
1678
|
+
var __rest$2E = (undefined && undefined.__rest) || function (s, e) {
|
|
1616
1679
|
var t = {};
|
|
1617
1680
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1618
1681
|
t[p] = s[p];
|
|
@@ -1623,14 +1686,14 @@ var __rest$2D = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1623
1686
|
}
|
|
1624
1687
|
return t;
|
|
1625
1688
|
};
|
|
1626
|
-
const defaultProps$
|
|
1689
|
+
const defaultProps$V = {
|
|
1627
1690
|
elementType: 'div',
|
|
1628
1691
|
isSquare: false,
|
|
1629
1692
|
size: SizesExtended.MEDIUM,
|
|
1630
1693
|
};
|
|
1631
1694
|
const _Avatar = (props, ref) => {
|
|
1632
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1633
|
-
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$
|
|
1695
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$V), props);
|
|
1696
|
+
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$2E(propsWithDefaults, ["elementType", "children"]);
|
|
1634
1697
|
const { classProps, props: modifiedProps } = useAvatarStyleProps(restProps);
|
|
1635
1698
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
1636
1699
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps });
|
|
@@ -1641,7 +1704,7 @@ _Avatar.spiritDefaultElement = 'div';
|
|
|
1641
1704
|
_Avatar.spiritDefaultProps = null;
|
|
1642
1705
|
const Avatar = React.forwardRef(_Avatar);
|
|
1643
1706
|
|
|
1644
|
-
var __rest$
|
|
1707
|
+
var __rest$2D = (undefined && undefined.__rest) || function (s, e) {
|
|
1645
1708
|
var t = {};
|
|
1646
1709
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1647
1710
|
t[p] = s[p];
|
|
@@ -1653,7 +1716,7 @@ var __rest$2C = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1653
1716
|
return t;
|
|
1654
1717
|
};
|
|
1655
1718
|
const useBoxStyleProps = (props) => {
|
|
1656
|
-
const _a = props || {}, { backgroundColor, borderColor, borderStyle, borderWidth, textColor } = _a, restProps = __rest$
|
|
1719
|
+
const _a = props || {}, { backgroundColor, borderColor, borderStyle, borderWidth, textColor } = _a, restProps = __rest$2D(_a, ["backgroundColor", "borderColor", "borderStyle", "borderWidth", "textColor"]);
|
|
1657
1720
|
const boxBackgroundClassName = useClassNamePrefix(`bg-${backgroundColor}`);
|
|
1658
1721
|
const boxBorderClassName = useClassNamePrefix('border-');
|
|
1659
1722
|
const boxBackgroundColor = backgroundColor ? boxBackgroundClassName : '';
|
|
@@ -1676,7 +1739,7 @@ const useBoxStyleProps = (props) => {
|
|
|
1676
1739
|
};
|
|
1677
1740
|
};
|
|
1678
1741
|
|
|
1679
|
-
var __rest$
|
|
1742
|
+
var __rest$2C = (undefined && undefined.__rest) || function (s, e) {
|
|
1680
1743
|
var t = {};
|
|
1681
1744
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1682
1745
|
t[p] = s[p];
|
|
@@ -1687,13 +1750,13 @@ var __rest$2B = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1687
1750
|
}
|
|
1688
1751
|
return t;
|
|
1689
1752
|
};
|
|
1690
|
-
const defaultProps$
|
|
1753
|
+
const defaultProps$U = {
|
|
1691
1754
|
elementType: 'div',
|
|
1692
1755
|
borderStyle: BorderStyles.SOLID,
|
|
1693
1756
|
};
|
|
1694
1757
|
const Box = (props) => {
|
|
1695
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1696
|
-
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$
|
|
1758
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$U), props);
|
|
1759
|
+
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$2C(propsWithDefaults, ["elementType", "children"]);
|
|
1697
1760
|
const { classProps, props: modifiedProps } = useBoxStyleProps(restProps);
|
|
1698
1761
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps, Object.assign(Object.assign(Object.assign({}, BackgroundStyleProps), BorderRadiusStyleProps), PaddingStyleProps));
|
|
1699
1762
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps });
|
|
@@ -1703,7 +1766,7 @@ Box.spiritComponent = 'Box';
|
|
|
1703
1766
|
Box.spiritDefaultElement = 'div';
|
|
1704
1767
|
Box.spiritDefaultProps = null;
|
|
1705
1768
|
|
|
1706
|
-
var __rest$
|
|
1769
|
+
var __rest$2B = (undefined && undefined.__rest) || function (s, e) {
|
|
1707
1770
|
var t = {};
|
|
1708
1771
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1709
1772
|
t[p] = s[p];
|
|
@@ -1715,7 +1778,7 @@ var __rest$2A = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1715
1778
|
return t;
|
|
1716
1779
|
};
|
|
1717
1780
|
function useLinkStyleProps(props) {
|
|
1718
|
-
const { color, hasVisitedStyleAllowed, isDisabled, underlined } = props, restProps = __rest$
|
|
1781
|
+
const { color, hasVisitedStyleAllowed, isDisabled, underlined } = props, restProps = __rest$2B(props, ["color", "hasVisitedStyleAllowed", "isDisabled", "underlined"]);
|
|
1719
1782
|
const linkClass = useClassNamePrefix('link');
|
|
1720
1783
|
const linkColorClass = `${linkClass}-${color}`;
|
|
1721
1784
|
const linkDisabledClass = `${linkClass}-disabled`;
|
|
@@ -1734,7 +1797,7 @@ function useLinkStyleProps(props) {
|
|
|
1734
1797
|
};
|
|
1735
1798
|
}
|
|
1736
1799
|
|
|
1737
|
-
var __rest$
|
|
1800
|
+
var __rest$2A = (undefined && undefined.__rest) || function (s, e) {
|
|
1738
1801
|
var t = {};
|
|
1739
1802
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1740
1803
|
t[p] = s[p];
|
|
@@ -1745,15 +1808,15 @@ var __rest$2z = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1745
1808
|
}
|
|
1746
1809
|
return t;
|
|
1747
1810
|
};
|
|
1748
|
-
const defaultProps$
|
|
1811
|
+
const defaultProps$T = {
|
|
1749
1812
|
elementType: 'a',
|
|
1750
1813
|
color: 'primary',
|
|
1751
1814
|
hasVisitedStyleAllowed: false,
|
|
1752
1815
|
underlined: 'hover',
|
|
1753
1816
|
};
|
|
1754
1817
|
const _Link = (props, ref) => {
|
|
1755
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1756
|
-
const { elementType: ElementTag = defaultProps$
|
|
1818
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$T), props);
|
|
1819
|
+
const { elementType: ElementTag = defaultProps$T.elementType, children } = propsWithDefaults, restProps = __rest$2A(propsWithDefaults, ["elementType", "children"]);
|
|
1757
1820
|
const { classProps, props: modifiedProps } = useLinkStyleProps(restProps);
|
|
1758
1821
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
1759
1822
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps });
|
|
@@ -1762,7 +1825,7 @@ const _Link = (props, ref) => {
|
|
|
1762
1825
|
const Link = React.forwardRef(_Link);
|
|
1763
1826
|
Link.spiritComponent = 'Link';
|
|
1764
1827
|
|
|
1765
|
-
var __rest$
|
|
1828
|
+
var __rest$2z = (undefined && undefined.__rest) || function (s, e) {
|
|
1766
1829
|
var t = {};
|
|
1767
1830
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1768
1831
|
t[p] = s[p];
|
|
@@ -1774,7 +1837,7 @@ var __rest$2y = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1774
1837
|
return t;
|
|
1775
1838
|
};
|
|
1776
1839
|
function useBreadcrumbsStyleProps(props) {
|
|
1777
|
-
const { isGoBackOnly } = props, restProps = __rest$
|
|
1840
|
+
const { isGoBackOnly } = props, restProps = __rest$2z(props, ["isGoBackOnly"]);
|
|
1778
1841
|
const breadcrumbsClass = useClassNamePrefix('Breadcrumbs');
|
|
1779
1842
|
const displayNoneClassName = useClassNamePrefix('d-none');
|
|
1780
1843
|
const displayTabletFlexClassName = useClassNamePrefix('d-tablet-flex');
|
|
@@ -1792,7 +1855,7 @@ function useBreadcrumbsStyleProps(props) {
|
|
|
1792
1855
|
};
|
|
1793
1856
|
}
|
|
1794
1857
|
|
|
1795
|
-
var __rest$
|
|
1858
|
+
var __rest$2y = (undefined && undefined.__rest) || function (s, e) {
|
|
1796
1859
|
var t = {};
|
|
1797
1860
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1798
1861
|
t[p] = s[p];
|
|
@@ -1803,15 +1866,15 @@ var __rest$2x = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1803
1866
|
}
|
|
1804
1867
|
return t;
|
|
1805
1868
|
};
|
|
1806
|
-
const defaultProps$
|
|
1869
|
+
const defaultProps$S = {
|
|
1807
1870
|
iconNameEnd: 'chevron-right',
|
|
1808
1871
|
iconNameStart: 'chevron-left',
|
|
1809
1872
|
isCurrent: false,
|
|
1810
1873
|
isGoBackOnly: false,
|
|
1811
1874
|
};
|
|
1812
1875
|
const BreadcrumbsItem = (props) => {
|
|
1813
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1814
|
-
const { children, href, isCurrent, iconNameStart, iconNameEnd } = propsWithDefaults, restProps = __rest$
|
|
1876
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$S), props);
|
|
1877
|
+
const { children, href, isCurrent, iconNameStart, iconNameEnd } = propsWithDefaults, restProps = __rest$2y(propsWithDefaults, ["children", "href", "isCurrent", "iconNameStart", "iconNameEnd"]);
|
|
1815
1878
|
const { classProps, props: otherProps } = useBreadcrumbsStyleProps(Object.assign({}, restProps));
|
|
1816
1879
|
const { styleProps, props: transferProps } = useStyleProps(otherProps);
|
|
1817
1880
|
return (React.createElement("li", Object.assign({}, transferProps, styleProps, { className: classNames(classProps.item, styleProps.className) }),
|
|
@@ -1821,7 +1884,7 @@ const BreadcrumbsItem = (props) => {
|
|
|
1821
1884
|
};
|
|
1822
1885
|
BreadcrumbsItem.spiritComponent = 'BreadcrumbsItem';
|
|
1823
1886
|
|
|
1824
|
-
var __rest$
|
|
1887
|
+
var __rest$2x = (undefined && undefined.__rest) || function (s, e) {
|
|
1825
1888
|
var t = {};
|
|
1826
1889
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1827
1890
|
t[p] = s[p];
|
|
@@ -1832,13 +1895,13 @@ var __rest$2w = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1832
1895
|
}
|
|
1833
1896
|
return t;
|
|
1834
1897
|
};
|
|
1835
|
-
const defaultProps$
|
|
1898
|
+
const defaultProps$R = {
|
|
1836
1899
|
elementType: 'nav',
|
|
1837
1900
|
items: [],
|
|
1838
1901
|
};
|
|
1839
1902
|
const Breadcrumbs = (props) => {
|
|
1840
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1841
|
-
const { children, elementType: ElementTag = 'nav', goBackTitle, items } = propsWithDefaults, restProps = __rest$
|
|
1903
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$R), props);
|
|
1904
|
+
const { children, elementType: ElementTag = 'nav', goBackTitle, items } = propsWithDefaults, restProps = __rest$2x(propsWithDefaults, ["children", "elementType", "goBackTitle", "items"]);
|
|
1842
1905
|
const { classProps, props: modifiedProps } = useBreadcrumbsStyleProps(Object.assign({}, restProps));
|
|
1843
1906
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
1844
1907
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.root, styleProps });
|
|
@@ -1863,7 +1926,7 @@ const useButtonProps = (props) => {
|
|
|
1863
1926
|
};
|
|
1864
1927
|
};
|
|
1865
1928
|
|
|
1866
|
-
var __rest$
|
|
1929
|
+
var __rest$2w = (undefined && undefined.__rest) || function (s, e) {
|
|
1867
1930
|
var t = {};
|
|
1868
1931
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1869
1932
|
t[p] = s[p];
|
|
@@ -1877,7 +1940,7 @@ var __rest$2v = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1877
1940
|
const getButtonColorClassname = (className, color) => compose(applyColor(color))(className);
|
|
1878
1941
|
const getButtonSizeClassname = (className, size) => compose(applySize(size))(className);
|
|
1879
1942
|
function useButtonStyleProps(props) {
|
|
1880
|
-
const { color, isBlock, isDisabled, isLoading, isSymmetrical, size } = props, restProps = __rest$
|
|
1943
|
+
const { color, isBlock, isDisabled, isLoading, isSymmetrical, size } = props, restProps = __rest$2w(props, ["color", "isBlock", "isDisabled", "isLoading", "isSymmetrical", "size"]);
|
|
1881
1944
|
useDeprecationMessage({
|
|
1882
1945
|
method: 'custom',
|
|
1883
1946
|
trigger: !!isBlock,
|
|
@@ -1888,16 +1951,16 @@ function useButtonStyleProps(props) {
|
|
|
1888
1951
|
const buttonBlockClass = `${buttonClass}--block`;
|
|
1889
1952
|
const buttonDisabledClass = `${buttonClass}--disabled`;
|
|
1890
1953
|
const buttonLoadingClass = `${buttonClass}--loading`;
|
|
1891
|
-
const
|
|
1892
|
-
if (isBlock &&
|
|
1954
|
+
const { isSymmetricalActive, symmetricalClassName } = useSymmetry(buttonClass, isSymmetrical);
|
|
1955
|
+
if (isBlock && isSymmetricalActive) {
|
|
1893
1956
|
warning(false, 'isBlock and isSymmetrical props are mutually exclusive');
|
|
1894
1957
|
}
|
|
1958
|
+
const shouldApplyBlock = () => isBlock && !isSymmetricalActive;
|
|
1895
1959
|
const classProps = classNames(buttonClass, getButtonColorClassname(buttonClass, color), getButtonSizeClassname(buttonClass, size), {
|
|
1896
|
-
[buttonBlockClass]:
|
|
1960
|
+
[buttonBlockClass]: shouldApplyBlock(),
|
|
1897
1961
|
[buttonDisabledClass]: isDisabled || isLoading,
|
|
1898
1962
|
[buttonLoadingClass]: isLoading,
|
|
1899
|
-
|
|
1900
|
-
});
|
|
1963
|
+
}, symmetricalClassName);
|
|
1901
1964
|
return {
|
|
1902
1965
|
classProps,
|
|
1903
1966
|
props: restProps,
|
|
@@ -1912,7 +1975,7 @@ const usePropsContext = (props = {}) => {
|
|
|
1912
1975
|
return context ? Object.assign(Object.assign({}, props), context) : props;
|
|
1913
1976
|
};
|
|
1914
1977
|
|
|
1915
|
-
var __rest$
|
|
1978
|
+
var __rest$2v = (undefined && undefined.__rest) || function (s, e) {
|
|
1916
1979
|
var t = {};
|
|
1917
1980
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1918
1981
|
t[p] = s[p];
|
|
@@ -1924,7 +1987,7 @@ var __rest$2u = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1924
1987
|
return t;
|
|
1925
1988
|
};
|
|
1926
1989
|
function useSpinnerStyleProps(props) {
|
|
1927
|
-
const { color } = props, restProps = __rest$
|
|
1990
|
+
const { color } = props, restProps = __rest$2v(props, ["color"]);
|
|
1928
1991
|
const spinnerClass = useClassNamePrefix('text');
|
|
1929
1992
|
const spinnerColorClass = color ? `${spinnerClass}-${color}` : '';
|
|
1930
1993
|
const spinnerAnimation = useClassNamePrefix('animation-spin-clockwise');
|
|
@@ -1942,7 +2005,7 @@ const Spinner = (props) => {
|
|
|
1942
2005
|
};
|
|
1943
2006
|
Spinner.spiritComponent = 'Spinner';
|
|
1944
2007
|
|
|
1945
|
-
var __rest$
|
|
2008
|
+
var __rest$2u = (undefined && undefined.__rest) || function (s, e) {
|
|
1946
2009
|
var t = {};
|
|
1947
2010
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1948
2011
|
t[p] = s[p];
|
|
@@ -1953,7 +2016,7 @@ var __rest$2t = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1953
2016
|
}
|
|
1954
2017
|
return t;
|
|
1955
2018
|
};
|
|
1956
|
-
const defaultProps$
|
|
2019
|
+
const defaultProps$Q = {
|
|
1957
2020
|
color: 'primary',
|
|
1958
2021
|
isBlock: false,
|
|
1959
2022
|
isDisabled: false,
|
|
@@ -1965,8 +2028,8 @@ const defaultProps$P = {
|
|
|
1965
2028
|
};
|
|
1966
2029
|
const _Button = (props, ref) => {
|
|
1967
2030
|
const propsWithContext = usePropsContext();
|
|
1968
|
-
const propsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaultProps$
|
|
1969
|
-
const { elementType: ElementTag = defaultProps$
|
|
2031
|
+
const propsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaultProps$Q), props), propsWithContext);
|
|
2032
|
+
const { elementType: ElementTag = defaultProps$Q.elementType, children } = propsWithDefaults, restProps = __rest$2u(propsWithDefaults, ["elementType", "children"]);
|
|
1970
2033
|
const { buttonProps } = useButtonProps(restProps);
|
|
1971
2034
|
const { classProps, props: modifiedProps } = useButtonStyleProps(restProps);
|
|
1972
2035
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
@@ -1993,7 +2056,7 @@ const useButtonLinkProps = (props) => {
|
|
|
1993
2056
|
};
|
|
1994
2057
|
};
|
|
1995
2058
|
|
|
1996
|
-
var __rest$
|
|
2059
|
+
var __rest$2t = (undefined && undefined.__rest) || function (s, e) {
|
|
1997
2060
|
var t = {};
|
|
1998
2061
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1999
2062
|
t[p] = s[p];
|
|
@@ -2007,7 +2070,7 @@ var __rest$2s = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2007
2070
|
const getButtonLinkColorClassname = (className, color) => compose(applyColor(color))(className);
|
|
2008
2071
|
const getButtonLinkSizeClassname = (className, size) => compose(applySize(size))(className);
|
|
2009
2072
|
function useButtonLinkStyleProps(props) {
|
|
2010
|
-
const { color, isBlock, isDisabled, isLoading, isSymmetrical, size } = props, restProps = __rest$
|
|
2073
|
+
const { color, isBlock, isDisabled, isLoading, isSymmetrical, size } = props, restProps = __rest$2t(props, ["color", "isBlock", "isDisabled", "isLoading", "isSymmetrical", "size"]);
|
|
2011
2074
|
useDeprecationMessage({
|
|
2012
2075
|
method: 'custom',
|
|
2013
2076
|
trigger: !!isBlock,
|
|
@@ -2018,23 +2081,23 @@ function useButtonLinkStyleProps(props) {
|
|
|
2018
2081
|
const buttonBlockClass = `${buttonClass}--block`;
|
|
2019
2082
|
const buttonDisabledClass = `${buttonClass}--disabled`;
|
|
2020
2083
|
const buttonLoadingClass = `${buttonClass}--loading`;
|
|
2021
|
-
const
|
|
2022
|
-
if (isBlock &&
|
|
2084
|
+
const { isSymmetricalActive, symmetricalClassName } = useSymmetry(buttonClass, isSymmetrical);
|
|
2085
|
+
if (isBlock && isSymmetricalActive) {
|
|
2023
2086
|
warning(false, 'isBlock and isSymmetrical props are mutually exclusive');
|
|
2024
2087
|
}
|
|
2088
|
+
const shouldApplyBlock = () => isBlock && !isSymmetricalActive;
|
|
2025
2089
|
const classProps = classNames(buttonClass, getButtonLinkColorClassname(buttonClass, color), getButtonLinkSizeClassname(buttonClass, size), {
|
|
2026
|
-
[buttonBlockClass]:
|
|
2090
|
+
[buttonBlockClass]: shouldApplyBlock(),
|
|
2027
2091
|
[buttonDisabledClass]: isDisabled || isLoading,
|
|
2028
2092
|
[buttonLoadingClass]: isLoading,
|
|
2029
|
-
|
|
2030
|
-
});
|
|
2093
|
+
}, symmetricalClassName);
|
|
2031
2094
|
return {
|
|
2032
2095
|
classProps,
|
|
2033
2096
|
props: restProps,
|
|
2034
2097
|
};
|
|
2035
2098
|
}
|
|
2036
2099
|
|
|
2037
|
-
var __rest$
|
|
2100
|
+
var __rest$2s = (undefined && undefined.__rest) || function (s, e) {
|
|
2038
2101
|
var t = {};
|
|
2039
2102
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2040
2103
|
t[p] = s[p];
|
|
@@ -2045,7 +2108,7 @@ var __rest$2r = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2045
2108
|
}
|
|
2046
2109
|
return t;
|
|
2047
2110
|
};
|
|
2048
|
-
const defaultProps$
|
|
2111
|
+
const defaultProps$P = {
|
|
2049
2112
|
color: 'primary',
|
|
2050
2113
|
elementType: 'a',
|
|
2051
2114
|
isBlock: false,
|
|
@@ -2055,8 +2118,8 @@ const defaultProps$O = {
|
|
|
2055
2118
|
size: 'medium',
|
|
2056
2119
|
};
|
|
2057
2120
|
const _ButtonLink = (props, ref) => {
|
|
2058
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2059
|
-
const { elementType: ElementTag = defaultProps$
|
|
2121
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$P), props);
|
|
2122
|
+
const { elementType: ElementTag = defaultProps$P.elementType, children } = propsWithDefaults, restProps = __rest$2s(propsWithDefaults, ["elementType", "children"]);
|
|
2060
2123
|
const { buttonLinkProps } = useButtonLinkProps(propsWithDefaults);
|
|
2061
2124
|
const { classProps, props: modifiedProps } = useButtonLinkStyleProps(restProps);
|
|
2062
2125
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
@@ -2123,7 +2186,7 @@ function useCardStyleProps(props) {
|
|
|
2123
2186
|
};
|
|
2124
2187
|
}
|
|
2125
2188
|
|
|
2126
|
-
var __rest$
|
|
2189
|
+
var __rest$2r = (undefined && undefined.__rest) || function (s, e) {
|
|
2127
2190
|
var t = {};
|
|
2128
2191
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2129
2192
|
t[p] = s[p];
|
|
@@ -2134,14 +2197,14 @@ var __rest$2q = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2134
2197
|
}
|
|
2135
2198
|
return t;
|
|
2136
2199
|
};
|
|
2137
|
-
const defaultProps$
|
|
2200
|
+
const defaultProps$O = {
|
|
2138
2201
|
direction: DirectionExtended.VERTICAL,
|
|
2139
2202
|
elementType: 'article',
|
|
2140
2203
|
isBoxed: false,
|
|
2141
2204
|
};
|
|
2142
2205
|
const Card = (props) => {
|
|
2143
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2144
|
-
const { elementType: ElementTag = 'article', direction, isBoxed, children } = propsWithDefaults, restProps = __rest$
|
|
2206
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$O), props);
|
|
2207
|
+
const { elementType: ElementTag = 'article', direction, isBoxed, children } = propsWithDefaults, restProps = __rest$2r(propsWithDefaults, ["elementType", "direction", "isBoxed", "children"]);
|
|
2145
2208
|
const { classProps } = useCardStyleProps({ direction, isBoxed });
|
|
2146
2209
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2147
2210
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.root, styleProps, otherProps });
|
|
@@ -2149,7 +2212,7 @@ const Card = (props) => {
|
|
|
2149
2212
|
};
|
|
2150
2213
|
Card.spiritComponent = 'Card';
|
|
2151
2214
|
|
|
2152
|
-
var __rest$
|
|
2215
|
+
var __rest$2q = (undefined && undefined.__rest) || function (s, e) {
|
|
2153
2216
|
var t = {};
|
|
2154
2217
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2155
2218
|
t[p] = s[p];
|
|
@@ -2160,19 +2223,19 @@ var __rest$2p = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2160
2223
|
}
|
|
2161
2224
|
return t;
|
|
2162
2225
|
};
|
|
2163
|
-
const defaultProps$
|
|
2226
|
+
const defaultProps$N = {
|
|
2164
2227
|
alignmentX: AlignmentX.LEFT,
|
|
2165
2228
|
};
|
|
2166
2229
|
const CardArtwork = (props) => {
|
|
2167
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2168
|
-
const { children, alignmentX } = propsWithDefaults, restProps = __rest$
|
|
2230
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$N), props);
|
|
2231
|
+
const { children, alignmentX } = propsWithDefaults, restProps = __rest$2q(propsWithDefaults, ["children", "alignmentX"]);
|
|
2169
2232
|
const { classProps } = useCardStyleProps({ artworkAlignmentX: alignmentX });
|
|
2170
2233
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2171
2234
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.artwork, styleProps.className), style: styleProps.style }), children));
|
|
2172
2235
|
};
|
|
2173
2236
|
CardArtwork.spiritComponent = 'CardArtwork';
|
|
2174
2237
|
|
|
2175
|
-
var __rest$
|
|
2238
|
+
var __rest$2p = (undefined && undefined.__rest) || function (s, e) {
|
|
2176
2239
|
var t = {};
|
|
2177
2240
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2178
2241
|
t[p] = s[p];
|
|
@@ -2183,19 +2246,19 @@ var __rest$2o = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2183
2246
|
}
|
|
2184
2247
|
return t;
|
|
2185
2248
|
};
|
|
2186
|
-
const defaultProps$
|
|
2249
|
+
const defaultProps$M = {
|
|
2187
2250
|
isSelectable: false,
|
|
2188
2251
|
};
|
|
2189
2252
|
const CardBody = (props) => {
|
|
2190
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2191
|
-
const { children, isSelectable } = propsWithDefaults, restProps = __rest$
|
|
2253
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$M), props);
|
|
2254
|
+
const { children, isSelectable } = propsWithDefaults, restProps = __rest$2p(propsWithDefaults, ["children", "isSelectable"]);
|
|
2192
2255
|
const { classProps } = useCardStyleProps({ isSelectable });
|
|
2193
2256
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2194
2257
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.body, styleProps.className), style: styleProps.style }), children));
|
|
2195
2258
|
};
|
|
2196
2259
|
CardBody.spiritComponent = 'CardBody';
|
|
2197
2260
|
|
|
2198
|
-
var __rest$
|
|
2261
|
+
var __rest$2o = (undefined && undefined.__rest) || function (s, e) {
|
|
2199
2262
|
var t = {};
|
|
2200
2263
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2201
2264
|
t[p] = s[p];
|
|
@@ -2207,14 +2270,14 @@ var __rest$2n = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2207
2270
|
return t;
|
|
2208
2271
|
};
|
|
2209
2272
|
const CardEyebrow = (props) => {
|
|
2210
|
-
const { children } = props, restProps = __rest$
|
|
2273
|
+
const { children } = props, restProps = __rest$2o(props, ["children"]);
|
|
2211
2274
|
const { classProps } = useCardStyleProps();
|
|
2212
2275
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2213
2276
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.eyebrow, styleProps.className), style: styleProps.style }), children));
|
|
2214
2277
|
};
|
|
2215
2278
|
CardEyebrow.spiritComponent = 'CardEyebrow';
|
|
2216
2279
|
|
|
2217
|
-
var __rest$
|
|
2280
|
+
var __rest$2n = (undefined && undefined.__rest) || function (s, e) {
|
|
2218
2281
|
var t = {};
|
|
2219
2282
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2220
2283
|
t[p] = s[p];
|
|
@@ -2225,19 +2288,19 @@ var __rest$2m = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2225
2288
|
}
|
|
2226
2289
|
return t;
|
|
2227
2290
|
};
|
|
2228
|
-
const defaultProps$
|
|
2291
|
+
const defaultProps$L = {
|
|
2229
2292
|
alignmentX: AlignmentX.LEFT,
|
|
2230
2293
|
};
|
|
2231
2294
|
const CardFooter = (props) => {
|
|
2232
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2233
|
-
const { children, alignmentX } = propsWithDefaults, restProps = __rest$
|
|
2295
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$L), props);
|
|
2296
|
+
const { children, alignmentX } = propsWithDefaults, restProps = __rest$2n(propsWithDefaults, ["children", "alignmentX"]);
|
|
2234
2297
|
const { classProps } = useCardStyleProps({ footerAlignmentX: alignmentX });
|
|
2235
2298
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2236
2299
|
return (React.createElement("footer", Object.assign({}, otherProps, { className: classNames(classProps.footer, styleProps.className), style: styleProps.style }), children));
|
|
2237
2300
|
};
|
|
2238
2301
|
CardFooter.spiritComponent = 'CardFooter';
|
|
2239
2302
|
|
|
2240
|
-
var __rest$
|
|
2303
|
+
var __rest$2m = (undefined && undefined.__rest) || function (s, e) {
|
|
2241
2304
|
var t = {};
|
|
2242
2305
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2243
2306
|
t[p] = s[p];
|
|
@@ -2248,12 +2311,12 @@ var __rest$2l = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2248
2311
|
}
|
|
2249
2312
|
return t;
|
|
2250
2313
|
};
|
|
2251
|
-
const defaultProps$
|
|
2314
|
+
const defaultProps$K = {
|
|
2252
2315
|
elementType: 'a',
|
|
2253
2316
|
};
|
|
2254
2317
|
const _CardLink = (props, ref) => {
|
|
2255
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2256
|
-
const { elementType: ElementTag = defaultProps$
|
|
2318
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$K), props);
|
|
2319
|
+
const { elementType: ElementTag = defaultProps$K.elementType, children, href } = propsWithDefaults, restProps = __rest$2m(propsWithDefaults, ["elementType", "children", "href"]);
|
|
2257
2320
|
const { classProps } = useCardStyleProps();
|
|
2258
2321
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2259
2322
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.link, styleProps, otherProps });
|
|
@@ -2262,7 +2325,7 @@ const _CardLink = (props, ref) => {
|
|
|
2262
2325
|
const CardLink = React.forwardRef(_CardLink);
|
|
2263
2326
|
CardLink.spiritComponent = 'CardLink';
|
|
2264
2327
|
|
|
2265
|
-
var __rest$
|
|
2328
|
+
var __rest$2l = (undefined && undefined.__rest) || function (s, e) {
|
|
2266
2329
|
var t = {};
|
|
2267
2330
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2268
2331
|
t[p] = s[p];
|
|
@@ -2274,7 +2337,7 @@ var __rest$2k = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2274
2337
|
return t;
|
|
2275
2338
|
};
|
|
2276
2339
|
const CardLogo = (props) => {
|
|
2277
|
-
const { children } = props, restProps = __rest$
|
|
2340
|
+
const { children } = props, restProps = __rest$2l(props, ["children"]);
|
|
2278
2341
|
const { classProps } = useCardStyleProps();
|
|
2279
2342
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2280
2343
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.logo, styleProps.className), style: Object.assign({}, styleProps.style) }), children));
|
|
@@ -2294,7 +2357,7 @@ const useCardMediaStyleProps = (props) => {
|
|
|
2294
2357
|
};
|
|
2295
2358
|
};
|
|
2296
2359
|
|
|
2297
|
-
var __rest$
|
|
2360
|
+
var __rest$2k = (undefined && undefined.__rest) || function (s, e) {
|
|
2298
2361
|
var t = {};
|
|
2299
2362
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2300
2363
|
t[p] = s[p];
|
|
@@ -2305,15 +2368,15 @@ var __rest$2j = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2305
2368
|
}
|
|
2306
2369
|
return t;
|
|
2307
2370
|
};
|
|
2308
|
-
const defaultProps$
|
|
2371
|
+
const defaultProps$J = {
|
|
2309
2372
|
fit: ObjectFit.COVER,
|
|
2310
2373
|
hasFilledHeight: false,
|
|
2311
2374
|
isExpanded: false,
|
|
2312
2375
|
size: CardSizes.AUTO,
|
|
2313
2376
|
};
|
|
2314
2377
|
const CardMedia = (props) => {
|
|
2315
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2316
|
-
const { backgroundColor, children, fit, hasFilledHeight, isExpanded, size } = propsWithDefaults, restProps = __rest$
|
|
2378
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$J), props);
|
|
2379
|
+
const { backgroundColor, children, fit, hasFilledHeight, isExpanded, size } = propsWithDefaults, restProps = __rest$2k(propsWithDefaults, ["backgroundColor", "children", "fit", "hasFilledHeight", "isExpanded", "size"]);
|
|
2317
2380
|
const { classProps } = useCardStyleProps({ size, isExpanded, hasFilledHeight });
|
|
2318
2381
|
const { classProps: cardMediaClassProps, styleProps: cardMediaStyleProps } = useCardMediaStyleProps({
|
|
2319
2382
|
backgroundColor,
|
|
@@ -2329,7 +2392,7 @@ const CardMedia = (props) => {
|
|
|
2329
2392
|
};
|
|
2330
2393
|
CardMedia.spiritComponent = 'CardMedia';
|
|
2331
2394
|
|
|
2332
|
-
var __rest$
|
|
2395
|
+
var __rest$2j = (undefined && undefined.__rest) || function (s, e) {
|
|
2333
2396
|
var t = {};
|
|
2334
2397
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2335
2398
|
t[p] = s[p];
|
|
@@ -2340,13 +2403,13 @@ var __rest$2i = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2340
2403
|
}
|
|
2341
2404
|
return t;
|
|
2342
2405
|
};
|
|
2343
|
-
const defaultProps$
|
|
2406
|
+
const defaultProps$I = {
|
|
2344
2407
|
elementType: 'h4',
|
|
2345
2408
|
isHeading: true,
|
|
2346
2409
|
};
|
|
2347
2410
|
const CardTitle = (props) => {
|
|
2348
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2349
|
-
const { elementType: ElementTag = 'h4', children, isHeading } = propsWithDefaults, restProps = __rest$
|
|
2411
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$I), props);
|
|
2412
|
+
const { elementType: ElementTag = 'h4', children, isHeading } = propsWithDefaults, restProps = __rest$2j(propsWithDefaults, ["elementType", "children", "isHeading"]);
|
|
2350
2413
|
const { classProps } = useCardStyleProps({ isHeading });
|
|
2351
2414
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2352
2415
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.title, styleProps, otherProps });
|
|
@@ -2354,7 +2417,7 @@ const CardTitle = (props) => {
|
|
|
2354
2417
|
};
|
|
2355
2418
|
CardTitle.spiritComponent = 'CardTitle';
|
|
2356
2419
|
|
|
2357
|
-
var __rest$
|
|
2420
|
+
var __rest$2i = (undefined && undefined.__rest) || function (s, e) {
|
|
2358
2421
|
var t = {};
|
|
2359
2422
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2360
2423
|
t[p] = s[p];
|
|
@@ -2365,14 +2428,14 @@ var __rest$2h = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2365
2428
|
}
|
|
2366
2429
|
return t;
|
|
2367
2430
|
};
|
|
2368
|
-
const defaultProps$
|
|
2431
|
+
const defaultProps$H = {
|
|
2369
2432
|
elementType: 'div',
|
|
2370
2433
|
id: undefined,
|
|
2371
2434
|
registerAria: undefined,
|
|
2372
2435
|
};
|
|
2373
2436
|
const HelperText = (props) => {
|
|
2374
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2375
|
-
const { helperText, elementType: ElementTag = defaultProps$
|
|
2437
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$H), props);
|
|
2438
|
+
const { helperText, elementType: ElementTag = defaultProps$H.elementType, id, registerAria } = propsWithDefaults, restProps = __rest$2i(propsWithDefaults, ["helperText", "elementType", "id", "registerAria"]);
|
|
2376
2439
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
2377
2440
|
const mergedStyleProps = mergeStyleProps(ElementTag, { styleProps, transferProps });
|
|
2378
2441
|
React.useEffect(() => {
|
|
@@ -2388,7 +2451,7 @@ const HelperText = (props) => {
|
|
|
2388
2451
|
};
|
|
2389
2452
|
HelperText.spiritComponent = 'HelperText';
|
|
2390
2453
|
|
|
2391
|
-
var __rest$
|
|
2454
|
+
var __rest$2h = (undefined && undefined.__rest) || function (s, e) {
|
|
2392
2455
|
var t = {};
|
|
2393
2456
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2394
2457
|
t[p] = s[p];
|
|
@@ -2400,7 +2463,7 @@ var __rest$2g = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2400
2463
|
return t;
|
|
2401
2464
|
};
|
|
2402
2465
|
const Label = (props) => {
|
|
2403
|
-
const { elementType: ElementTag = 'label', children, htmlFor, for: labelFor } = props, restProps = __rest$
|
|
2466
|
+
const { elementType: ElementTag = 'label', children, htmlFor, for: labelFor } = props, restProps = __rest$2h(props, ["elementType", "children", "htmlFor", "for"]);
|
|
2404
2467
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2405
2468
|
const mergedStyleProps = mergeStyleProps(ElementTag, { styleProps, otherProps });
|
|
2406
2469
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps, { htmlFor: ElementTag === 'label' ? labelFor || htmlFor : undefined }), children));
|
|
@@ -2433,7 +2496,7 @@ function useValidationIcon({ hasValidationStateIcon }) {
|
|
|
2433
2496
|
return iconNameValue;
|
|
2434
2497
|
}
|
|
2435
2498
|
|
|
2436
|
-
var __rest$
|
|
2499
|
+
var __rest$2g = (undefined && undefined.__rest) || function (s, e) {
|
|
2437
2500
|
var t = {};
|
|
2438
2501
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2439
2502
|
t[p] = s[p];
|
|
@@ -2444,15 +2507,15 @@ var __rest$2f = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2444
2507
|
}
|
|
2445
2508
|
return t;
|
|
2446
2509
|
};
|
|
2447
|
-
const defaultProps$
|
|
2510
|
+
const defaultProps$G = {
|
|
2448
2511
|
elementType: 'div',
|
|
2449
2512
|
id: undefined,
|
|
2450
2513
|
registerAria: undefined,
|
|
2451
2514
|
role: undefined,
|
|
2452
2515
|
};
|
|
2453
2516
|
const ValidationText = (props) => {
|
|
2454
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2455
|
-
const { elementType: ElementTag = defaultProps$
|
|
2517
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$G), props);
|
|
2518
|
+
const { elementType: ElementTag = defaultProps$G.elementType, id, hasValidationStateIcon, registerAria, role, validationText } = propsWithDefaults, restProps = __rest$2g(propsWithDefaults, ["elementType", "id", "hasValidationStateIcon", "registerAria", "role", "validationText"]);
|
|
2456
2519
|
const validationIconName = useValidationIcon({ hasValidationStateIcon });
|
|
2457
2520
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
2458
2521
|
const mergedStyleProps = mergeStyleProps(ElementTag, { styleProps, transferProps });
|
|
@@ -2488,7 +2551,7 @@ const useValidationTextRole = ({ validationState, validationText, }) => {
|
|
|
2488
2551
|
return role;
|
|
2489
2552
|
};
|
|
2490
2553
|
|
|
2491
|
-
var __rest$
|
|
2554
|
+
var __rest$2f = (undefined && undefined.__rest) || function (s, e) {
|
|
2492
2555
|
var t = {};
|
|
2493
2556
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2494
2557
|
t[p] = s[p];
|
|
@@ -2500,12 +2563,13 @@ var __rest$2e = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2500
2563
|
return t;
|
|
2501
2564
|
};
|
|
2502
2565
|
function useCheckboxStyleProps(props) {
|
|
2503
|
-
const {
|
|
2566
|
+
const { inputPosition = InputPositions.START, isItem, isLabelHidden, validationState } = props, restProps = __rest$2f(props, ["inputPosition", "isItem", "isLabelHidden", "validationState"]);
|
|
2504
2567
|
const { isDisabled, isRequired } = restProps;
|
|
2505
2568
|
const checkboxClass = useClassNamePrefix('Checkbox');
|
|
2506
2569
|
const checkboxDisabledClass = `${checkboxClass}--disabled`;
|
|
2507
2570
|
const checkboxItemClass = `${checkboxClass}--item`;
|
|
2508
2571
|
const checkboxInputClass = `${checkboxClass}__input`;
|
|
2572
|
+
const checkboxInputPositionClass = useInputPositionClass(checkboxClass, inputPosition);
|
|
2509
2573
|
const checkboxTextClass = `${checkboxClass}__text`;
|
|
2510
2574
|
const checkboxLabelClass = `${checkboxClass}__label`;
|
|
2511
2575
|
const checkboxLabelRequiredClass = `${checkboxClass}__label--required`;
|
|
@@ -2514,6 +2578,7 @@ function useCheckboxStyleProps(props) {
|
|
|
2514
2578
|
const checkboxValidationTextClass = `${checkboxClass}__validationText`;
|
|
2515
2579
|
const checkboxValidationClass = `${checkboxClass}--${validationState}`;
|
|
2516
2580
|
const rootStyles = classNames(checkboxClass, {
|
|
2581
|
+
[checkboxInputPositionClass]: checkboxInputPositionClass,
|
|
2517
2582
|
[checkboxDisabledClass]: isDisabled,
|
|
2518
2583
|
[checkboxItemClass]: isItem,
|
|
2519
2584
|
[checkboxValidationClass]: validationState,
|
|
@@ -2535,7 +2600,7 @@ function useCheckboxStyleProps(props) {
|
|
|
2535
2600
|
};
|
|
2536
2601
|
}
|
|
2537
2602
|
|
|
2538
|
-
var __rest$
|
|
2603
|
+
var __rest$2e = (undefined && undefined.__rest) || function (s, e) {
|
|
2539
2604
|
var t = {};
|
|
2540
2605
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2541
2606
|
t[p] = s[p];
|
|
@@ -2548,7 +2613,7 @@ var __rest$2d = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2548
2613
|
};
|
|
2549
2614
|
const _Checkbox = (props, ref) => {
|
|
2550
2615
|
const { classProps, props: modifiedProps } = useCheckboxStyleProps(props);
|
|
2551
|
-
const { 'aria-describedby': ariaDescribedBy = '', hasValidationIcon, helperText, id, isChecked, isDisabled, isRequired, label, validationState, validationText, value } = modifiedProps, restProps = __rest$
|
|
2616
|
+
const { 'aria-describedby': ariaDescribedBy = '', hasValidationIcon, helperText, id, isChecked, isDisabled, isRequired, label, validationState, validationText, value } = modifiedProps, restProps = __rest$2e(modifiedProps, ['aria-describedby', "hasValidationIcon", "helperText", "id", "isChecked", "isDisabled", "isRequired", "label", "validationState", "validationText", "value"]);
|
|
2552
2617
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2553
2618
|
const [ids, register] = useAriaIds(ariaDescribedBy);
|
|
2554
2619
|
const ariaDescribedByProp = useAriaDescribedBy(ids);
|
|
@@ -2566,7 +2631,7 @@ const _Checkbox = (props, ref) => {
|
|
|
2566
2631
|
const Checkbox = React.forwardRef(_Checkbox);
|
|
2567
2632
|
Checkbox.spiritComponent = 'Checkbox';
|
|
2568
2633
|
|
|
2569
|
-
var __rest$
|
|
2634
|
+
var __rest$2d = (undefined && undefined.__rest) || function (s, e) {
|
|
2570
2635
|
var t = {};
|
|
2571
2636
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2572
2637
|
t[p] = s[p];
|
|
@@ -2578,7 +2643,7 @@ var __rest$2c = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2578
2643
|
return t;
|
|
2579
2644
|
};
|
|
2580
2645
|
function useContainerStyleProps(props) {
|
|
2581
|
-
const { isFluid, size } = props, modifiedProps = __rest$
|
|
2646
|
+
const { isFluid, size } = props, modifiedProps = __rest$2d(props, ["isFluid", "size"]);
|
|
2582
2647
|
const containerClass = useClassNamePrefix('Container');
|
|
2583
2648
|
const containerFluidClass = `${containerClass}--fluid`;
|
|
2584
2649
|
const containerSizeClass = `${containerClass}--${size}`;
|
|
@@ -2592,7 +2657,7 @@ function useContainerStyleProps(props) {
|
|
|
2592
2657
|
};
|
|
2593
2658
|
}
|
|
2594
2659
|
|
|
2595
|
-
var __rest$
|
|
2660
|
+
var __rest$2c = (undefined && undefined.__rest) || function (s, e) {
|
|
2596
2661
|
var t = {};
|
|
2597
2662
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2598
2663
|
t[p] = s[p];
|
|
@@ -2603,13 +2668,13 @@ var __rest$2b = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2603
2668
|
}
|
|
2604
2669
|
return t;
|
|
2605
2670
|
};
|
|
2606
|
-
const defaultProps$
|
|
2671
|
+
const defaultProps$F = {
|
|
2607
2672
|
isFluid: false,
|
|
2608
2673
|
size: SizesExtended.XLARGE,
|
|
2609
2674
|
};
|
|
2610
2675
|
const Container = (props) => {
|
|
2611
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2612
|
-
const { children } = propsWithDefaults, restProps = __rest$
|
|
2676
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$F), props);
|
|
2677
|
+
const { children } = propsWithDefaults, restProps = __rest$2c(propsWithDefaults, ["children"]);
|
|
2613
2678
|
const { classProps, props: modifiedProps } = useContainerStyleProps(restProps);
|
|
2614
2679
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps, {
|
|
2615
2680
|
textAlignment: TextStyleProps.textAlignment,
|
|
@@ -2630,7 +2695,7 @@ const useControlButtonProps = (props) => {
|
|
|
2630
2695
|
};
|
|
2631
2696
|
};
|
|
2632
2697
|
|
|
2633
|
-
var __rest$
|
|
2698
|
+
var __rest$2b = (undefined && undefined.__rest) || function (s, e) {
|
|
2634
2699
|
var t = {};
|
|
2635
2700
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2636
2701
|
t[p] = s[p];
|
|
@@ -2643,27 +2708,26 @@ var __rest$2a = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2643
2708
|
};
|
|
2644
2709
|
const getControlButtonSizeClassname = (className, size) => compose(applySize(size))(className);
|
|
2645
2710
|
function useControlButtonStyleProps(props) {
|
|
2646
|
-
const { isDisabled, isSubtle, isSymmetrical, size } = props, restProps = __rest$
|
|
2711
|
+
const { isDisabled, isSubtle, isSymmetrical, size } = props, restProps = __rest$2b(props, ["isDisabled", "isSubtle", "isSymmetrical", "size"]);
|
|
2647
2712
|
const controlButtonClass = useClassNamePrefix('ControlButton');
|
|
2648
2713
|
const controlButtonBackgroundClass = `${controlButtonClass}--hasBackground`;
|
|
2649
2714
|
const controlButtonDisabledClass = `${controlButtonClass}--disabled`;
|
|
2650
|
-
const controlButtonSymmetricalClass = `${controlButtonClass}--symmetrical`;
|
|
2651
2715
|
const dynamicColorBackgroundInteractiveClass = useClassNamePrefix('dynamic-color-background-interactive');
|
|
2652
2716
|
const dynamicColorBorderClass = useClassNamePrefix('dynamic-color-border');
|
|
2653
2717
|
const accessibilityTapTargetClass = useClassNamePrefix('accessibility-tap-target');
|
|
2718
|
+
const { symmetricalClassName } = useSymmetry(controlButtonClass, isSymmetrical);
|
|
2654
2719
|
const classProps = classNames(controlButtonClass, getControlButtonSizeClassname(controlButtonClass, size), dynamicColorBackgroundInteractiveClass, accessibilityTapTargetClass, {
|
|
2655
2720
|
[controlButtonDisabledClass]: isDisabled,
|
|
2656
|
-
[controlButtonSymmetricalClass]: isSymmetrical,
|
|
2657
2721
|
[controlButtonBackgroundClass]: !isSubtle,
|
|
2658
2722
|
[dynamicColorBorderClass]: !isSubtle,
|
|
2659
|
-
});
|
|
2723
|
+
}, symmetricalClassName);
|
|
2660
2724
|
return {
|
|
2661
2725
|
classProps,
|
|
2662
2726
|
props: restProps,
|
|
2663
2727
|
};
|
|
2664
2728
|
}
|
|
2665
2729
|
|
|
2666
|
-
var __rest$
|
|
2730
|
+
var __rest$2a = (undefined && undefined.__rest) || function (s, e) {
|
|
2667
2731
|
var t = {};
|
|
2668
2732
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2669
2733
|
t[p] = s[p];
|
|
@@ -2674,7 +2738,7 @@ var __rest$29 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2674
2738
|
}
|
|
2675
2739
|
return t;
|
|
2676
2740
|
};
|
|
2677
|
-
const defaultProps$
|
|
2741
|
+
const defaultProps$E = {
|
|
2678
2742
|
elementType: 'button',
|
|
2679
2743
|
isDisabled: false,
|
|
2680
2744
|
isSubtle: false,
|
|
@@ -2683,8 +2747,8 @@ const defaultProps$D = {
|
|
|
2683
2747
|
type: 'button',
|
|
2684
2748
|
};
|
|
2685
2749
|
const _ControlButton = (props, ref) => {
|
|
2686
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2687
|
-
const { elementType: ElementTag = defaultProps$
|
|
2750
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$E), props);
|
|
2751
|
+
const { elementType: ElementTag = defaultProps$E.elementType, children } = propsWithDefaults, restProps = __rest$2a(propsWithDefaults, ["elementType", "children"]);
|
|
2688
2752
|
const { controlButtonProps } = useControlButtonProps(restProps);
|
|
2689
2753
|
const { classProps, props: modifiedProps } = useControlButtonStyleProps(restProps);
|
|
2690
2754
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
@@ -2744,7 +2808,7 @@ const useDialog = (ref, isOpen) => {
|
|
|
2744
2808
|
};
|
|
2745
2809
|
};
|
|
2746
2810
|
|
|
2747
|
-
var __rest$
|
|
2811
|
+
var __rest$29 = (undefined && undefined.__rest) || function (s, e) {
|
|
2748
2812
|
var t = {};
|
|
2749
2813
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2750
2814
|
t[p] = s[p];
|
|
@@ -2756,7 +2820,7 @@ var __rest$28 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2756
2820
|
return t;
|
|
2757
2821
|
};
|
|
2758
2822
|
const Dialog = (props, ref) => {
|
|
2759
|
-
const { children, isOpen, onClose, closeOnBackdropClick = true, closeOnEscapeKeyDown } = props, restProps = __rest$
|
|
2823
|
+
const { children, isOpen, onClose, closeOnBackdropClick = true, closeOnEscapeKeyDown } = props, restProps = __rest$29(props, ["children", "isOpen", "onClose", "closeOnBackdropClick", "closeOnEscapeKeyDown"]);
|
|
2760
2824
|
const dialogElementRef = React.useRef(ref);
|
|
2761
2825
|
const contentElementRef = React.useRef(null);
|
|
2762
2826
|
const { closeDialog, onTransitionEnd } = useDialog(dialogElementRef, isOpen);
|
|
@@ -2832,7 +2896,7 @@ const useDrawerStyleProps = (props = {}) => {
|
|
|
2832
2896
|
};
|
|
2833
2897
|
};
|
|
2834
2898
|
|
|
2835
|
-
var __rest$
|
|
2899
|
+
var __rest$28 = (undefined && undefined.__rest) || function (s, e) {
|
|
2836
2900
|
var t = {};
|
|
2837
2901
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2838
2902
|
t[p] = s[p];
|
|
@@ -2844,7 +2908,7 @@ var __rest$27 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2844
2908
|
return t;
|
|
2845
2909
|
};
|
|
2846
2910
|
const Drawer = (props) => {
|
|
2847
|
-
const { children, alignmentX = DRAWER_ALIGNMENT_DEFAULT, isOpen, onClose, id } = props, restProps = __rest$
|
|
2911
|
+
const { children, alignmentX = DRAWER_ALIGNMENT_DEFAULT, isOpen, onClose, id } = props, restProps = __rest$28(props, ["children", "alignmentX", "isOpen", "onClose", "id"]);
|
|
2848
2912
|
const { classProps } = useDrawerStyleProps({ drawerAlignmentX: alignmentX });
|
|
2849
2913
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2850
2914
|
const contextValue = {
|
|
@@ -2858,7 +2922,7 @@ const Drawer = (props) => {
|
|
|
2858
2922
|
};
|
|
2859
2923
|
Drawer.spiritComponent = 'Drawer';
|
|
2860
2924
|
|
|
2861
|
-
var __rest$
|
|
2925
|
+
var __rest$27 = (undefined && undefined.__rest) || function (s, e) {
|
|
2862
2926
|
var t = {};
|
|
2863
2927
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2864
2928
|
t[p] = s[p];
|
|
@@ -2870,7 +2934,7 @@ var __rest$26 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2870
2934
|
return t;
|
|
2871
2935
|
};
|
|
2872
2936
|
function useVisuallyHiddenProps(props) {
|
|
2873
|
-
const restProps = __rest$
|
|
2937
|
+
const restProps = __rest$27(props, []);
|
|
2874
2938
|
const visuallyHiddenClass = useClassNamePrefix('accessibility-hidden');
|
|
2875
2939
|
return {
|
|
2876
2940
|
classProps: visuallyHiddenClass,
|
|
@@ -2878,7 +2942,7 @@ function useVisuallyHiddenProps(props) {
|
|
|
2878
2942
|
};
|
|
2879
2943
|
}
|
|
2880
2944
|
|
|
2881
|
-
var __rest$
|
|
2945
|
+
var __rest$26 = (undefined && undefined.__rest) || function (s, e) {
|
|
2882
2946
|
var t = {};
|
|
2883
2947
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2884
2948
|
t[p] = s[p];
|
|
@@ -2890,7 +2954,7 @@ var __rest$25 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2890
2954
|
return t;
|
|
2891
2955
|
};
|
|
2892
2956
|
const VisuallyHidden = (props) => {
|
|
2893
|
-
const { children, elementType: ElementTag = 'span' } = props, rest = __rest$
|
|
2957
|
+
const { children, elementType: ElementTag = 'span' } = props, rest = __rest$26(props, ["children", "elementType"]);
|
|
2894
2958
|
const { classProps, props: modifiedProps } = useVisuallyHiddenProps(rest);
|
|
2895
2959
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
2896
2960
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps });
|
|
@@ -2898,7 +2962,7 @@ const VisuallyHidden = (props) => {
|
|
|
2898
2962
|
};
|
|
2899
2963
|
VisuallyHidden.spiritComponent = 'VisuallyHidden';
|
|
2900
2964
|
|
|
2901
|
-
var __rest$
|
|
2965
|
+
var __rest$25 = (undefined && undefined.__rest) || function (s, e) {
|
|
2902
2966
|
var t = {};
|
|
2903
2967
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2904
2968
|
t[p] = s[p];
|
|
@@ -2909,15 +2973,15 @@ var __rest$24 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2909
2973
|
}
|
|
2910
2974
|
return t;
|
|
2911
2975
|
};
|
|
2912
|
-
const defaultProps$
|
|
2976
|
+
const defaultProps$D = {
|
|
2913
2977
|
color: ComponentButtonColors.TERTIARY,
|
|
2914
2978
|
iconBoxSize: DEFAULT_BOX_SIZE,
|
|
2915
2979
|
label: DRAWER_CLOSE_BUTTON_LABEL_DEFAULT,
|
|
2916
2980
|
size: Sizes.MEDIUM,
|
|
2917
2981
|
};
|
|
2918
2982
|
const DrawerCloseButton = (props) => {
|
|
2919
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2920
|
-
const { color, iconBoxSize, label, size } = propsWithDefaults, restProps = __rest$
|
|
2983
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$D), props);
|
|
2984
|
+
const { color, iconBoxSize, label, size } = propsWithDefaults, restProps = __rest$25(propsWithDefaults, ["color", "iconBoxSize", "label", "size"]);
|
|
2921
2985
|
const { id, isOpen, onClose } = useDrawerContext();
|
|
2922
2986
|
const { classProps } = useDrawerStyleProps();
|
|
2923
2987
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
@@ -2927,7 +2991,7 @@ const DrawerCloseButton = (props) => {
|
|
|
2927
2991
|
};
|
|
2928
2992
|
DrawerCloseButton.spiritComponent = 'DrawerCloseButton';
|
|
2929
2993
|
|
|
2930
|
-
var __rest$
|
|
2994
|
+
var __rest$24 = (undefined && undefined.__rest) || function (s, e) {
|
|
2931
2995
|
var t = {};
|
|
2932
2996
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2933
2997
|
t[p] = s[p];
|
|
@@ -2939,7 +3003,7 @@ var __rest$23 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2939
3003
|
return t;
|
|
2940
3004
|
};
|
|
2941
3005
|
const _DrawerPanel = (props, ref) => {
|
|
2942
|
-
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$
|
|
3006
|
+
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$24(props, ["elementType", "children"]);
|
|
2943
3007
|
const { classProps } = useDrawerStyleProps(restProps);
|
|
2944
3008
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2945
3009
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.panel, styleProps, otherProps });
|
|
@@ -2991,7 +3055,7 @@ const DropdownProvider = DropdownContext.Provider;
|
|
|
2991
3055
|
DropdownContext.Consumer;
|
|
2992
3056
|
const useDropdownContext = () => React.useContext(DropdownContext);
|
|
2993
3057
|
|
|
2994
|
-
var __rest$
|
|
3058
|
+
var __rest$23 = (undefined && undefined.__rest) || function (s, e) {
|
|
2995
3059
|
var t = {};
|
|
2996
3060
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2997
3061
|
t[p] = s[p];
|
|
@@ -3003,7 +3067,7 @@ var __rest$22 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3003
3067
|
return t;
|
|
3004
3068
|
};
|
|
3005
3069
|
const useDropdownStyleProps = (props = { isOpen: false }) => {
|
|
3006
|
-
const { alignmentX, alignmentY, isOpen } = props, modifiedProps = __rest$
|
|
3070
|
+
const { alignmentX, alignmentY, isOpen } = props, modifiedProps = __rest$23(props, ["alignmentX", "alignmentY", "isOpen"]);
|
|
3007
3071
|
const dropdownRootClass = useClassNamePrefix('Dropdown');
|
|
3008
3072
|
const dropdownPopoverClass = `${dropdownRootClass}Popover`;
|
|
3009
3073
|
const expandedClass = isOpen ? 'is-expanded' : '';
|
|
@@ -3024,7 +3088,7 @@ const useDropdownStyleProps = (props = { isOpen: false }) => {
|
|
|
3024
3088
|
};
|
|
3025
3089
|
};
|
|
3026
3090
|
|
|
3027
|
-
var __rest$
|
|
3091
|
+
var __rest$22 = (undefined && undefined.__rest) || function (s, e) {
|
|
3028
3092
|
var t = {};
|
|
3029
3093
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3030
3094
|
t[p] = s[p];
|
|
@@ -3036,7 +3100,7 @@ var __rest$21 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3036
3100
|
return t;
|
|
3037
3101
|
};
|
|
3038
3102
|
const Dropdown = (props) => {
|
|
3039
|
-
const { children, enableAutoClose = true, fullWidthMode, id, isOpen = false, onAutoClose, onToggle, placement } = props, rest = __rest$
|
|
3103
|
+
const { children, enableAutoClose = true, fullWidthMode, id, isOpen = false, onAutoClose, onToggle, placement } = props, rest = __rest$22(props, ["children", "enableAutoClose", "fullWidthMode", "id", "isOpen", "onAutoClose", "onToggle", "placement"]);
|
|
3040
3104
|
const { classProps, props: modifiedProps } = useDropdownStyleProps(Object.assign({ isOpen }, rest));
|
|
3041
3105
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3042
3106
|
const dropdownRef = React.useRef(null);
|
|
@@ -3059,7 +3123,7 @@ const Dropdown = (props) => {
|
|
|
3059
3123
|
};
|
|
3060
3124
|
Dropdown.spiritComponent = 'Dropdown';
|
|
3061
3125
|
|
|
3062
|
-
var __rest$
|
|
3126
|
+
var __rest$21 = (undefined && undefined.__rest) || function (s, e) {
|
|
3063
3127
|
var t = {};
|
|
3064
3128
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3065
3129
|
t[p] = s[p];
|
|
@@ -3070,12 +3134,12 @@ var __rest$20 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3070
3134
|
}
|
|
3071
3135
|
return t;
|
|
3072
3136
|
};
|
|
3073
|
-
const defaultProps$
|
|
3137
|
+
const defaultProps$C = {
|
|
3074
3138
|
elementType: 'button',
|
|
3075
3139
|
};
|
|
3076
3140
|
const DropdownTrigger = (props) => {
|
|
3077
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
3078
|
-
const { elementType: ElementTag = 'button', children } = propsWithDefaults, rest = __rest$
|
|
3141
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$C), props);
|
|
3142
|
+
const { elementType: ElementTag = 'button', children } = propsWithDefaults, rest = __rest$21(propsWithDefaults, ["elementType", "children"]);
|
|
3079
3143
|
const { id, isOpen, onToggle, fullWidthMode, triggerRef } = useDropdownContext();
|
|
3080
3144
|
const { classProps, props: modifiedProps } = useDropdownStyleProps(Object.assign({ isOpen }, rest));
|
|
3081
3145
|
const { styleProps: triggerStyleProps, props: transferProps } = useStyleProps(modifiedProps);
|
|
@@ -3085,7 +3149,7 @@ const DropdownTrigger = (props) => {
|
|
|
3085
3149
|
};
|
|
3086
3150
|
DropdownTrigger.spiritComponent = 'DropdownTrigger';
|
|
3087
3151
|
|
|
3088
|
-
var __rest$
|
|
3152
|
+
var __rest$20 = (undefined && undefined.__rest) || function (s, e) {
|
|
3089
3153
|
var t = {};
|
|
3090
3154
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3091
3155
|
t[p] = s[p];
|
|
@@ -3097,7 +3161,7 @@ var __rest$1$ = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3097
3161
|
return t;
|
|
3098
3162
|
};
|
|
3099
3163
|
const DropdownPopover = (props) => {
|
|
3100
|
-
const { children } = props, rest = __rest$
|
|
3164
|
+
const { children } = props, rest = __rest$20(props, ["children"]);
|
|
3101
3165
|
const { id, isOpen, onToggle, fullWidthMode, placement } = useDropdownContext();
|
|
3102
3166
|
const { classProps, props: modifiedProps } = useDropdownStyleProps(Object.assign({ isOpen }, rest));
|
|
3103
3167
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
@@ -3132,7 +3196,7 @@ const useDropdown = ({ dropdownRef, triggerRef, enableAutoClose, onAutoClose, })
|
|
|
3132
3196
|
};
|
|
3133
3197
|
};
|
|
3134
3198
|
|
|
3135
|
-
var __rest$
|
|
3199
|
+
var __rest$1$ = (undefined && undefined.__rest) || function (s, e) {
|
|
3136
3200
|
var t = {};
|
|
3137
3201
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3138
3202
|
t[p] = s[p];
|
|
@@ -3144,7 +3208,7 @@ var __rest$1_ = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3144
3208
|
return t;
|
|
3145
3209
|
};
|
|
3146
3210
|
const UncontrolledDropdown = (props) => {
|
|
3147
|
-
const { children, enableAutoClose = true, fullWidthMode, id, onAutoClose, placement } = props, rest = __rest$
|
|
3211
|
+
const { children, enableAutoClose = true, fullWidthMode, id, onAutoClose, placement } = props, rest = __rest$1$(props, ["children", "enableAutoClose", "fullWidthMode", "id", "onAutoClose", "placement"]);
|
|
3148
3212
|
const { classProps, props: modifiedProps } = useDropdownStyleProps(rest);
|
|
3149
3213
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3150
3214
|
const dropdownRef = React.useRef(null);
|
|
@@ -3155,7 +3219,7 @@ const UncontrolledDropdown = (props) => {
|
|
|
3155
3219
|
};
|
|
3156
3220
|
UncontrolledDropdown.spiritComponent = 'UncontrolledDropdown';
|
|
3157
3221
|
|
|
3158
|
-
var __rest$
|
|
3222
|
+
var __rest$1_ = (undefined && undefined.__rest) || function (s, e) {
|
|
3159
3223
|
var t = {};
|
|
3160
3224
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3161
3225
|
t[p] = s[p];
|
|
@@ -3167,7 +3231,7 @@ var __rest$1Z = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3167
3231
|
return t;
|
|
3168
3232
|
};
|
|
3169
3233
|
function useStackStyleProps(props) {
|
|
3170
|
-
const { hasEndDivider, hasIntermediateDividers, hasSpacing, hasStartDivider, spacing } = props, restProps = __rest$
|
|
3234
|
+
const { hasEndDivider, hasIntermediateDividers, hasSpacing, hasStartDivider, spacing } = props, restProps = __rest$1_(props, ["hasEndDivider", "hasIntermediateDividers", "hasSpacing", "hasStartDivider", "spacing"]);
|
|
3171
3235
|
const StackClass = useClassNamePrefix('Stack');
|
|
3172
3236
|
const StackBottomDividerClass = `${StackClass}--hasEndDivider`;
|
|
3173
3237
|
const StackMiddleDividersClass = `${StackClass}--hasIntermediateDividers`;
|
|
@@ -3191,7 +3255,7 @@ function useStackStyleProps(props) {
|
|
|
3191
3255
|
};
|
|
3192
3256
|
}
|
|
3193
3257
|
|
|
3194
|
-
var __rest$
|
|
3258
|
+
var __rest$1Z = (undefined && undefined.__rest) || function (s, e) {
|
|
3195
3259
|
var t = {};
|
|
3196
3260
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3197
3261
|
t[p] = s[p];
|
|
@@ -3202,7 +3266,7 @@ var __rest$1Y = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3202
3266
|
}
|
|
3203
3267
|
return t;
|
|
3204
3268
|
};
|
|
3205
|
-
const defaultProps$
|
|
3269
|
+
const defaultProps$B = {
|
|
3206
3270
|
elementType: 'div',
|
|
3207
3271
|
hasSpacing: false,
|
|
3208
3272
|
hasEndDivider: false,
|
|
@@ -3210,8 +3274,8 @@ const defaultProps$A = {
|
|
|
3210
3274
|
hasStartDivider: false,
|
|
3211
3275
|
};
|
|
3212
3276
|
const Stack = (props) => {
|
|
3213
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
3214
|
-
const { elementType: ElementTag = defaultProps$
|
|
3277
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$B), props);
|
|
3278
|
+
const { elementType: ElementTag = defaultProps$B.elementType, children } = propsWithDefaults, restProps = __rest$1Z(propsWithDefaults, ["elementType", "children"]);
|
|
3215
3279
|
const { classProps, props: modifiedProps, styleProps: stackStyle } = useStackStyleProps(restProps);
|
|
3216
3280
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3217
3281
|
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
@@ -3224,7 +3288,7 @@ const Stack = (props) => {
|
|
|
3224
3288
|
};
|
|
3225
3289
|
Stack.spiritComponent = 'Stack';
|
|
3226
3290
|
|
|
3227
|
-
var __rest$
|
|
3291
|
+
var __rest$1Y = (undefined && undefined.__rest) || function (s, e) {
|
|
3228
3292
|
var t = {};
|
|
3229
3293
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3230
3294
|
t[p] = s[p];
|
|
@@ -3236,7 +3300,7 @@ var __rest$1X = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3236
3300
|
return t;
|
|
3237
3301
|
};
|
|
3238
3302
|
const StackItem = (props) => {
|
|
3239
|
-
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$
|
|
3303
|
+
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$1Y(props, ["elementType", "children"]);
|
|
3240
3304
|
const { classProps, props: modifiedProps } = useStackStyleProps(restProps);
|
|
3241
3305
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3242
3306
|
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
@@ -3260,7 +3324,7 @@ function useEmptyStateStyleProps(props) {
|
|
|
3260
3324
|
};
|
|
3261
3325
|
}
|
|
3262
3326
|
|
|
3263
|
-
var __rest$
|
|
3327
|
+
var __rest$1X = (undefined && undefined.__rest) || function (s, e) {
|
|
3264
3328
|
var t = {};
|
|
3265
3329
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3266
3330
|
t[p] = s[p];
|
|
@@ -3272,14 +3336,14 @@ var __rest$1W = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3272
3336
|
return t;
|
|
3273
3337
|
};
|
|
3274
3338
|
const EmptyState = (props) => {
|
|
3275
|
-
const { children } = props, restProps = __rest$
|
|
3339
|
+
const { children } = props, restProps = __rest$1X(props, ["children"]);
|
|
3276
3340
|
const { classProps, props: modifiedProps } = useEmptyStateStyleProps(restProps);
|
|
3277
3341
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3278
3342
|
return (React.createElement(Stack, Object.assign({}, otherProps, { UNSAFE_className: classNames(classProps.root, styleProps.className), UNSAFE_style: styleProps.style }), children));
|
|
3279
3343
|
};
|
|
3280
3344
|
EmptyState.spiritComponent = 'EmptyState';
|
|
3281
3345
|
|
|
3282
|
-
var __rest$
|
|
3346
|
+
var __rest$1W = (undefined && undefined.__rest) || function (s, e) {
|
|
3283
3347
|
var t = {};
|
|
3284
3348
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3285
3349
|
t[p] = s[p];
|
|
@@ -3291,7 +3355,7 @@ var __rest$1V = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3291
3355
|
return t;
|
|
3292
3356
|
};
|
|
3293
3357
|
const EmptyStateSection = (props) => {
|
|
3294
|
-
const { children } = props, restProps = __rest$
|
|
3358
|
+
const { children } = props, restProps = __rest$1W(props, ["children"]);
|
|
3295
3359
|
const { classProps, props: modifiedProps } = useEmptyStateStyleProps(restProps);
|
|
3296
3360
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3297
3361
|
return (React.createElement(Stack, Object.assign({}, otherProps, { UNSAFE_className: classNames(classProps.section, styleProps.className), UNSAFE_style: styleProps.style }), children));
|
|
@@ -3323,7 +3387,7 @@ const useFieldGroupStyleProps = ({ isFluid, isRequired, validationState, }) => {
|
|
|
3323
3387
|
};
|
|
3324
3388
|
};
|
|
3325
3389
|
|
|
3326
|
-
var __rest$
|
|
3390
|
+
var __rest$1V = (undefined && undefined.__rest) || function (s, e) {
|
|
3327
3391
|
var t = {};
|
|
3328
3392
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3329
3393
|
t[p] = s[p];
|
|
@@ -3335,7 +3399,7 @@ var __rest$1U = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3335
3399
|
return t;
|
|
3336
3400
|
};
|
|
3337
3401
|
const FieldGroup = (props) => {
|
|
3338
|
-
const { 'aria-describedby': ariaDescribedBy = '', children, helperText, hasValidationIcon, id, isDisabled, isFluid, isLabelHidden, isRequired, label, validationState, validationText } = props, rest = __rest$
|
|
3402
|
+
const { 'aria-describedby': ariaDescribedBy = '', children, helperText, hasValidationIcon, id, isDisabled, isFluid, isLabelHidden, isRequired, label, validationState, validationText } = props, rest = __rest$1V(props, ['aria-describedby', "children", "helperText", "hasValidationIcon", "id", "isDisabled", "isFluid", "isLabelHidden", "isRequired", "label", "validationState", "validationText"]);
|
|
3339
3403
|
const { classProps } = useFieldGroupStyleProps({ isFluid, isRequired, validationState });
|
|
3340
3404
|
const { styleProps, props: transferProps } = useStyleProps(rest);
|
|
3341
3405
|
const [ids, register] = useAriaIds(ariaDescribedBy);
|
|
@@ -3364,6 +3428,7 @@ const DEFAULT_ERROR_MESSAGE_UNSUPPORTED_FILE = 'This file type is not supported'
|
|
|
3364
3428
|
const DEFAULT_ICON_NAME = 'file';
|
|
3365
3429
|
const DEFAULT_BUTTON_LABEL = 'Remove';
|
|
3366
3430
|
const DEFAULT_EDIT_BUTTON_LABEL = 'Edit';
|
|
3431
|
+
const DEFAULT_ATTACHMENT_LIST_LABEL = 'Attachments';
|
|
3367
3432
|
const FileUploaderCropCSS = {
|
|
3368
3433
|
TOP: '--file-uploader-attachment-image-top',
|
|
3369
3434
|
LEFT: '--file-uploader-attachment-image-left',
|
|
@@ -3479,7 +3544,7 @@ const useFileUploaderStyleProps = (props) => {
|
|
|
3479
3544
|
};
|
|
3480
3545
|
};
|
|
3481
3546
|
|
|
3482
|
-
var __rest$
|
|
3547
|
+
var __rest$1U = (undefined && undefined.__rest) || function (s, e) {
|
|
3483
3548
|
var t = {};
|
|
3484
3549
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3485
3550
|
t[p] = s[p];
|
|
@@ -3491,7 +3556,7 @@ var __rest$1T = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3491
3556
|
return t;
|
|
3492
3557
|
};
|
|
3493
3558
|
const FileUploader = (props) => {
|
|
3494
|
-
const { addToQueue, children, clearQueue, errorMessages, fileQueue, findInQueue, id, isFluid, onDismiss, updateQueue } = props, restProps = __rest$
|
|
3559
|
+
const { addToQueue, children, clearQueue, errorMessages, fileQueue, findInQueue, id, isFluid, onDismiss, updateQueue } = props, restProps = __rest$1U(props, ["addToQueue", "children", "clearQueue", "errorMessages", "fileQueue", "findInQueue", "id", "isFluid", "onDismiss", "updateQueue"]);
|
|
3495
3560
|
const { classProps } = useFileUploaderStyleProps({ isFluid });
|
|
3496
3561
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
3497
3562
|
const contextValue = {
|
|
@@ -3664,7 +3729,7 @@ const useFileUploaderInput = (props) => {
|
|
|
3664
3729
|
return Object.assign({ isDropZoneHidden: dropZoneHidden, isDisabledByQueueLimitBehavior: disabledByQueueLimitBehavior, onChange: onChangeHandler }, dragAndDropProps);
|
|
3665
3730
|
};
|
|
3666
3731
|
|
|
3667
|
-
var __rest$
|
|
3732
|
+
var __rest$1T = (undefined && undefined.__rest) || function (s, e) {
|
|
3668
3733
|
var t = {};
|
|
3669
3734
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3670
3735
|
t[p] = s[p];
|
|
@@ -3677,7 +3742,7 @@ var __rest$1S = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3677
3742
|
};
|
|
3678
3743
|
const FileUploaderInput = (props) => {
|
|
3679
3744
|
const [isDragAndDropSupported, setIsDragAndDropSupported] = React.useState(false);
|
|
3680
|
-
const { accept, 'aria-describedby': ariaDescribedBy = '', dropZoneRef, hasValidationIcon, helperText, iconName = 'upload', id, inputRef, isDisabled, isLabelHidden, isMultiple, isRequired, label, labelText, linkText, maxFileSize = DEFAULT_FILE_SIZE_LIMIT, maxUploadedFiles = DEFAULT_FILE_QUEUE_LIMIT, onError, queueLimitBehavior = 'none', validationState, validationText } = props, restProps = __rest$
|
|
3745
|
+
const { accept, 'aria-describedby': ariaDescribedBy = '', dropZoneRef, hasValidationIcon, helperText, iconName = 'upload', id, inputRef, isDisabled, isLabelHidden, isMultiple, isRequired, label, labelText, linkText, maxFileSize = DEFAULT_FILE_SIZE_LIMIT, maxUploadedFiles = DEFAULT_FILE_QUEUE_LIMIT, onError, queueLimitBehavior = 'none', validationState, validationText } = props, restProps = __rest$1T(props, ["accept", 'aria-describedby', "dropZoneRef", "hasValidationIcon", "helperText", "iconName", "id", "inputRef", "isDisabled", "isLabelHidden", "isMultiple", "isRequired", "label", "labelText", "linkText", "maxFileSize", "maxUploadedFiles", "onError", "queueLimitBehavior", "validationState", "validationText"]);
|
|
3681
3746
|
const { isDisabledByQueueLimitBehavior, isDragging, isDropZoneHidden, onChange, onDragEnter, onDragLeave, onDragOver, onDrop, } = useFileUploaderInput({
|
|
3682
3747
|
accept,
|
|
3683
3748
|
isMultiple,
|
|
@@ -3721,7 +3786,7 @@ const FileUploaderInput = (props) => {
|
|
|
3721
3786
|
};
|
|
3722
3787
|
FileUploaderInput.spiritComponent = 'FileUploaderInput';
|
|
3723
3788
|
|
|
3724
|
-
var __rest$
|
|
3789
|
+
var __rest$1S = (undefined && undefined.__rest) || function (s, e) {
|
|
3725
3790
|
var t = {};
|
|
3726
3791
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3727
3792
|
t[p] = s[p];
|
|
@@ -3733,7 +3798,7 @@ var __rest$1R = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3733
3798
|
return t;
|
|
3734
3799
|
};
|
|
3735
3800
|
const FileUploaderList = (props) => {
|
|
3736
|
-
const { label, id, attachmentComponent, inputName, hasImagePreview } = props, restProps = __rest$
|
|
3801
|
+
const { label = DEFAULT_ATTACHMENT_LIST_LABEL, id, attachmentComponent, inputName, hasImagePreview } = props, restProps = __rest$1S(props, ["label", "id", "attachmentComponent", "inputName", "hasImagePreview"]);
|
|
3737
3802
|
const { classProps } = useFileUploaderStyleProps();
|
|
3738
3803
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
3739
3804
|
const { fileQueue, onDismiss } = useFileUploaderContext();
|
|
@@ -3756,7 +3821,7 @@ const FileUploaderList = (props) => {
|
|
|
3756
3821
|
};
|
|
3757
3822
|
FileUploaderList.spiritComponent = 'FileUploaderList';
|
|
3758
3823
|
|
|
3759
|
-
var __rest$
|
|
3824
|
+
var __rest$1R = (undefined && undefined.__rest) || function (s, e) {
|
|
3760
3825
|
var t = {};
|
|
3761
3826
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3762
3827
|
t[p] = s[p];
|
|
@@ -3768,7 +3833,7 @@ var __rest$1Q = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3768
3833
|
return t;
|
|
3769
3834
|
};
|
|
3770
3835
|
const AttachmentActionButton = (props) => {
|
|
3771
|
-
const { name = 'edit', children } = props, restProps = __rest$
|
|
3836
|
+
const { name = 'edit', children } = props, restProps = __rest$1R(props, ["name", "children"]);
|
|
3772
3837
|
const { classProps } = useFileUploaderStyleProps();
|
|
3773
3838
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
3774
3839
|
return (React.createElement("button", Object.assign({ type: "button" }, transferProps, styleProps, { className: classNames(classProps.attachment.button, styleProps.className) }),
|
|
@@ -3777,7 +3842,7 @@ const AttachmentActionButton = (props) => {
|
|
|
3777
3842
|
};
|
|
3778
3843
|
AttachmentActionButton.spiritComponent = 'AttachmentActionButton';
|
|
3779
3844
|
|
|
3780
|
-
var __rest$
|
|
3845
|
+
var __rest$1Q = (undefined && undefined.__rest) || function (s, e) {
|
|
3781
3846
|
var t = {};
|
|
3782
3847
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3783
3848
|
t[p] = s[p];
|
|
@@ -3789,7 +3854,7 @@ var __rest$1P = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3789
3854
|
return t;
|
|
3790
3855
|
};
|
|
3791
3856
|
const AttachmentDismissButton = (props) => {
|
|
3792
|
-
const { children } = props, restProps = __rest$
|
|
3857
|
+
const { children } = props, restProps = __rest$1Q(props, ["children"]);
|
|
3793
3858
|
const { classProps } = useFileUploaderStyleProps();
|
|
3794
3859
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
3795
3860
|
return (React.createElement("button", Object.assign({ type: "button" }, transferProps, styleProps, { className: classNames(classProps.attachment.button, styleProps.className) }),
|
|
@@ -3798,12 +3863,12 @@ const AttachmentDismissButton = (props) => {
|
|
|
3798
3863
|
};
|
|
3799
3864
|
AttachmentDismissButton.spiritComponent = 'AttachmentDismissButton';
|
|
3800
3865
|
|
|
3801
|
-
const defaultProps$
|
|
3866
|
+
const defaultProps$A = {
|
|
3802
3867
|
meta: undefined,
|
|
3803
3868
|
imageObjectFit: 'cover',
|
|
3804
3869
|
};
|
|
3805
3870
|
const AttachmentImagePreview = (props) => {
|
|
3806
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
3871
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$A), props);
|
|
3807
3872
|
const { label, imagePreview, meta, imageObjectFit } = propsWithDefaults;
|
|
3808
3873
|
const { classProps } = useFileUploaderStyleProps({ meta, imageObjectFit });
|
|
3809
3874
|
const { imageCropStyles, attachmentStyles } = classProps;
|
|
@@ -3887,7 +3952,7 @@ const useFileUploaderAttachment = ({ attachmentRef, file, name, meta, onError, }
|
|
|
3887
3952
|
}, [attachmentRef, file, name, meta, onError]);
|
|
3888
3953
|
};
|
|
3889
3954
|
|
|
3890
|
-
var __rest$
|
|
3955
|
+
var __rest$1P = (undefined && undefined.__rest) || function (s, e) {
|
|
3891
3956
|
var t = {};
|
|
3892
3957
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3893
3958
|
t[p] = s[p];
|
|
@@ -3899,7 +3964,7 @@ var __rest$1O = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3899
3964
|
return t;
|
|
3900
3965
|
};
|
|
3901
3966
|
const FileUploaderAttachment = (props) => {
|
|
3902
|
-
const { editText, file, hasImagePreview, iconName = DEFAULT_ICON_NAME, id, imageObjectFit, label, meta, name, onDismiss, onEdit, onError, removeText } = props, restProps = __rest$
|
|
3967
|
+
const { editText = DEFAULT_EDIT_BUTTON_LABEL, file, hasImagePreview, iconName = DEFAULT_ICON_NAME, id, imageObjectFit, label, meta, name, onDismiss, onEdit, onError, removeText = DEFAULT_BUTTON_LABEL } = props, restProps = __rest$1P(props, ["editText", "file", "hasImagePreview", "iconName", "id", "imageObjectFit", "label", "meta", "name", "onDismiss", "onEdit", "onError", "removeText"]);
|
|
3903
3968
|
const [imagePreview, setImagePreview] = React.useState('');
|
|
3904
3969
|
const { classProps } = useFileUploaderStyleProps();
|
|
3905
3970
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
@@ -3920,8 +3985,8 @@ const FileUploaderAttachment = (props) => {
|
|
|
3920
3985
|
React.createElement("span", { className: classProps.attachment.name },
|
|
3921
3986
|
React.createElement("span", { className: useClassNamePrefix('text-truncate') }, label)),
|
|
3922
3987
|
onEdit && (React.createElement("span", { className: classProps.attachment.slot },
|
|
3923
|
-
React.createElement(AttachmentActionButton, { onClick: onEditHandler }, editText
|
|
3924
|
-
React.createElement(AttachmentDismissButton, { onClick: dismissHandler }, removeText
|
|
3988
|
+
React.createElement(AttachmentActionButton, { onClick: onEditHandler }, editText))),
|
|
3989
|
+
React.createElement(AttachmentDismissButton, { onClick: dismissHandler }, removeText)));
|
|
3925
3990
|
};
|
|
3926
3991
|
FileUploaderAttachment.spiritComponent = 'FileUploaderAttachment';
|
|
3927
3992
|
|
|
@@ -3974,7 +4039,7 @@ const useFileQueue = () => {
|
|
|
3974
4039
|
};
|
|
3975
4040
|
};
|
|
3976
4041
|
|
|
3977
|
-
var __rest$
|
|
4042
|
+
var __rest$1O = (undefined && undefined.__rest) || function (s, e) {
|
|
3978
4043
|
var t = {};
|
|
3979
4044
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3980
4045
|
t[p] = s[p];
|
|
@@ -3986,7 +4051,7 @@ var __rest$1N = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3986
4051
|
return t;
|
|
3987
4052
|
};
|
|
3988
4053
|
const UncontrolledFileUploader = (props) => {
|
|
3989
|
-
const { attachmentComponent, maxFileSize, maxUploadedFiles, helperText, iconName, inputId, inputLabel, inputName, inputProps, isLabelHidden, isDisabled, isFluid, queueLimitBehavior, isMultiple, isRequired, labelText, linkText, listId, listProps, onInputError, onChange, errorMessages, validationState, validationText } = props, restProps = __rest$
|
|
4054
|
+
const { attachmentComponent, maxFileSize, maxUploadedFiles, helperText, iconName, inputId, inputLabel, inputName, inputProps, isLabelHidden, isDisabled, isFluid, queueLimitBehavior, isMultiple, isRequired, labelText, linkText, listId, listProps, onInputError, onChange, errorMessages, validationState, validationText } = props, restProps = __rest$1O(props, ["attachmentComponent", "maxFileSize", "maxUploadedFiles", "helperText", "iconName", "inputId", "inputLabel", "inputName", "inputProps", "isLabelHidden", "isDisabled", "isFluid", "queueLimitBehavior", "isMultiple", "isRequired", "labelText", "linkText", "listId", "listProps", "onInputError", "onChange", "errorMessages", "validationState", "validationText"]);
|
|
3990
4055
|
const { fileQueue, addToQueue, clearQueue, onDismiss, findInQueue, updateQueue } = useFileQueue();
|
|
3991
4056
|
React.useEffect(() => {
|
|
3992
4057
|
if (onChange) {
|
|
@@ -4014,7 +4079,7 @@ const useFooterStyleProps = (props) => {
|
|
|
4014
4079
|
};
|
|
4015
4080
|
};
|
|
4016
4081
|
|
|
4017
|
-
var __rest$
|
|
4082
|
+
var __rest$1N = (undefined && undefined.__rest) || function (s, e) {
|
|
4018
4083
|
var t = {};
|
|
4019
4084
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4020
4085
|
t[p] = s[p];
|
|
@@ -4027,23 +4092,25 @@ var __rest$1M = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4027
4092
|
};
|
|
4028
4093
|
const defaultStyleProps = {
|
|
4029
4094
|
backgroundColor: BackgroundColors.SECONDARY,
|
|
4095
|
+
elementType: 'footer',
|
|
4030
4096
|
paddingBottom: PADDING_BOTTOM,
|
|
4031
4097
|
paddingTop: PADDING_TOP,
|
|
4032
4098
|
};
|
|
4033
4099
|
const Footer = (props) => {
|
|
4034
4100
|
const propsWithDefaults = Object.assign(Object.assign({}, defaultStyleProps), props);
|
|
4035
|
-
const { children, backgroundColor } = propsWithDefaults, restProps = __rest$
|
|
4101
|
+
const { elementType: ElementTag = defaultStyleProps.elementType, children, backgroundColor } = propsWithDefaults, restProps = __rest$1N(propsWithDefaults, ["elementType", "children", "backgroundColor"]);
|
|
4036
4102
|
const { classProps } = useFooterStyleProps({ backgroundColor });
|
|
4037
4103
|
const { styleProps, props: otherProps } = useStyleProps(restProps, {
|
|
4038
4104
|
paddingBottom: PaddingStyleProps.paddingBottom,
|
|
4039
4105
|
paddingTop: PaddingStyleProps.paddingTop,
|
|
4040
4106
|
textAlignment: TextStyleProps.textAlignment,
|
|
4041
4107
|
});
|
|
4042
|
-
|
|
4108
|
+
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps });
|
|
4109
|
+
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
4043
4110
|
};
|
|
4044
4111
|
Footer.spiritComponent = 'Footer';
|
|
4045
4112
|
|
|
4046
|
-
var __rest$
|
|
4113
|
+
var __rest$1M = (undefined && undefined.__rest) || function (s, e) {
|
|
4047
4114
|
var t = {};
|
|
4048
4115
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4049
4116
|
t[p] = s[p];
|
|
@@ -4055,7 +4122,7 @@ var __rest$1L = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4055
4122
|
return t;
|
|
4056
4123
|
};
|
|
4057
4124
|
function useGridStyleProps(props) {
|
|
4058
|
-
const { alignmentX, alignmentY, cols, spacing, spacingX, spacingY } = props, restProps = __rest$
|
|
4125
|
+
const { alignmentX, alignmentY, cols, spacing, spacingX, spacingY } = props, restProps = __rest$1M(props, ["alignmentX", "alignmentY", "cols", "spacing", "spacingX", "spacingY"]);
|
|
4059
4126
|
const gridClass = useClassNamePrefix('Grid');
|
|
4060
4127
|
const gridStyle = Object.assign(Object.assign(Object.assign(Object.assign({}, useSpacingStyle(spacing, 'grid', exports.DirectionAxis.X)), useSpacingStyle(spacing, 'grid', exports.DirectionAxis.Y)), useSpacingStyle(spacingX, 'grid', exports.DirectionAxis.X)), useSpacingStyle(spacingY, 'grid', exports.DirectionAxis.Y));
|
|
4061
4128
|
function generateColsClasses(componentClass, property, type) {
|
|
@@ -4082,7 +4149,7 @@ function useGridStyleProps(props) {
|
|
|
4082
4149
|
};
|
|
4083
4150
|
}
|
|
4084
4151
|
|
|
4085
|
-
var __rest$
|
|
4152
|
+
var __rest$1L = (undefined && undefined.__rest) || function (s, e) {
|
|
4086
4153
|
var t = {};
|
|
4087
4154
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4088
4155
|
t[p] = s[p];
|
|
@@ -4093,20 +4160,22 @@ var __rest$1K = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4093
4160
|
}
|
|
4094
4161
|
return t;
|
|
4095
4162
|
};
|
|
4096
|
-
const defaultProps$
|
|
4163
|
+
const defaultProps$z = {
|
|
4097
4164
|
alignmentX: AlignmentXExtended.STRETCH,
|
|
4098
4165
|
alignmentY: AlignmentYExtended.STRETCH,
|
|
4099
4166
|
elementType: 'div',
|
|
4100
4167
|
};
|
|
4101
4168
|
const Grid = (props) => {
|
|
4102
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
4103
|
-
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$
|
|
4169
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$z), props);
|
|
4170
|
+
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$1L(propsWithDefaults, ["elementType", "children"]);
|
|
4104
4171
|
const { classProps, props: modifiedProps, styleProps: gridStyle } = useGridStyleProps(restProps);
|
|
4105
4172
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
4106
4173
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps, gridStyle });
|
|
4107
4174
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
4108
4175
|
};
|
|
4109
4176
|
Grid.spiritComponent = 'Grid';
|
|
4177
|
+
Grid.spiritDefaultElement = 'div';
|
|
4178
|
+
Grid.spiritDefaultProps = null;
|
|
4110
4179
|
|
|
4111
4180
|
const setStyleProperty = (styleObject, propertyName, value) => {
|
|
4112
4181
|
styleObject[propertyName] = value;
|
|
@@ -4128,22 +4197,23 @@ const setGridItemStyle = (styleObject, baseVarName, propValue) => {
|
|
|
4128
4197
|
function useGridItemStyleProps(props) {
|
|
4129
4198
|
const gridItemClass = useClassNamePrefix('GridItem');
|
|
4130
4199
|
const gridItemStyle = {};
|
|
4131
|
-
const
|
|
4200
|
+
const propsClone = Object.assign({}, props);
|
|
4201
|
+
const typePropNames = Object.keys(propsClone).filter((propName) => propName.startsWith('column') || propName.startsWith('row'));
|
|
4132
4202
|
typePropNames.forEach((propName) => {
|
|
4133
4203
|
const type = propName.startsWith('column') ? 'column' : 'row';
|
|
4134
|
-
if (
|
|
4135
|
-
setGridItemStyle(gridItemStyle, `grid-item-${type}-${propName.replace(type, '').toLowerCase()}`,
|
|
4204
|
+
if (propsClone[propName]) {
|
|
4205
|
+
setGridItemStyle(gridItemStyle, `grid-item-${type}-${propName.replace(type, '').toLowerCase()}`, propsClone[propName]);
|
|
4136
4206
|
}
|
|
4137
|
-
delete
|
|
4207
|
+
delete propsClone[propName];
|
|
4138
4208
|
});
|
|
4139
4209
|
return {
|
|
4140
4210
|
classProps: gridItemClass,
|
|
4141
|
-
props,
|
|
4211
|
+
props: propsClone,
|
|
4142
4212
|
styleProps: gridItemStyle,
|
|
4143
4213
|
};
|
|
4144
4214
|
}
|
|
4145
4215
|
|
|
4146
|
-
var __rest$
|
|
4216
|
+
var __rest$1K = (undefined && undefined.__rest) || function (s, e) {
|
|
4147
4217
|
var t = {};
|
|
4148
4218
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4149
4219
|
t[p] = s[p];
|
|
@@ -4155,13 +4225,15 @@ var __rest$1J = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4155
4225
|
return t;
|
|
4156
4226
|
};
|
|
4157
4227
|
const GridItem = (props) => {
|
|
4158
|
-
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$
|
|
4228
|
+
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$1K(props, ["elementType", "children"]);
|
|
4159
4229
|
const { classProps, styleProps: gridItemStyle, props: modifiedProps } = useGridItemStyleProps(restProps);
|
|
4160
4230
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
4161
4231
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps, gridItemStyle });
|
|
4162
4232
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
4163
4233
|
};
|
|
4164
4234
|
GridItem.spiritComponent = 'GridItem';
|
|
4235
|
+
GridItem.spiritDefaultElement = 'div';
|
|
4236
|
+
GridItem.spiritDefaultProps = null;
|
|
4165
4237
|
|
|
4166
4238
|
const HEADER_COLOR_DEFAULT = 'primary';
|
|
4167
4239
|
const HEADER_ACTIONS_COLOR_DEFAULT = 'primary';
|
|
@@ -4222,7 +4294,7 @@ const useHeaderStyleProps = ({ actionsColor = HEADER_ACTIONS_COLOR_DEFAULT, colo
|
|
|
4222
4294
|
};
|
|
4223
4295
|
};
|
|
4224
4296
|
|
|
4225
|
-
var __rest$
|
|
4297
|
+
var __rest$1J = (undefined && undefined.__rest) || function (s, e) {
|
|
4226
4298
|
var t = {};
|
|
4227
4299
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4228
4300
|
t[p] = s[p];
|
|
@@ -4234,7 +4306,7 @@ var __rest$1I = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4234
4306
|
return t;
|
|
4235
4307
|
};
|
|
4236
4308
|
const Header = (props) => {
|
|
4237
|
-
const { children, color = HEADER_COLOR_DEFAULT, isSimple } = props, restProps = __rest$
|
|
4309
|
+
const { children, color = HEADER_COLOR_DEFAULT, isSimple } = props, restProps = __rest$1J(props, ["children", "color", "isSimple"]);
|
|
4238
4310
|
const { classProps } = useHeaderStyleProps({ color, isSimple });
|
|
4239
4311
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4240
4312
|
useDeprecationMessage({
|
|
@@ -4255,7 +4327,7 @@ const HeaderButton = (props) => {
|
|
|
4255
4327
|
};
|
|
4256
4328
|
HeaderButton.spiritComponent = 'HeaderButton';
|
|
4257
4329
|
|
|
4258
|
-
var __rest$
|
|
4330
|
+
var __rest$1I = (undefined && undefined.__rest) || function (s, e) {
|
|
4259
4331
|
var t = {};
|
|
4260
4332
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4261
4333
|
t[p] = s[p];
|
|
@@ -4266,12 +4338,12 @@ var __rest$1H = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4266
4338
|
}
|
|
4267
4339
|
return t;
|
|
4268
4340
|
};
|
|
4269
|
-
const defaultProps$
|
|
4341
|
+
const defaultProps$y = {
|
|
4270
4342
|
isAtEnd: false,
|
|
4271
4343
|
};
|
|
4272
4344
|
const HeaderDesktopActions = (props) => {
|
|
4273
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
4274
|
-
const { isAtEnd } = propsWithDefaults, restProps = __rest$
|
|
4345
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$y), props);
|
|
4346
|
+
const { isAtEnd } = propsWithDefaults, restProps = __rest$1I(propsWithDefaults, ["isAtEnd"]);
|
|
4275
4347
|
const { classProps } = useHeaderStyleProps({ hasActionsAtEnd: isAtEnd });
|
|
4276
4348
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4277
4349
|
return (React.createElement("nav", Object.assign({}, otherProps, { className: classNames(classProps.headerDesktopActions, styleProps.className), style: styleProps.style })));
|
|
@@ -4288,7 +4360,7 @@ const HeaderDialogProvider = HeaderDialogContext.Provider;
|
|
|
4288
4360
|
const HeaderDialogConsumer = HeaderDialogContext.Consumer;
|
|
4289
4361
|
const useHeaderDialogContext = () => React.useContext(HeaderDialogContext);
|
|
4290
4362
|
|
|
4291
|
-
var __rest$
|
|
4363
|
+
var __rest$1H = (undefined && undefined.__rest) || function (s, e) {
|
|
4292
4364
|
var t = {};
|
|
4293
4365
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4294
4366
|
t[p] = s[p];
|
|
@@ -4300,7 +4372,7 @@ var __rest$1G = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4300
4372
|
return t;
|
|
4301
4373
|
};
|
|
4302
4374
|
const HeaderDialog = (props) => {
|
|
4303
|
-
const { children, id, isOpen, onClose } = props, restProps = __rest$
|
|
4375
|
+
const { children, id, isOpen, onClose } = props, restProps = __rest$1H(props, ["children", "id", "isOpen", "onClose"]);
|
|
4304
4376
|
const { classProps } = useHeaderStyleProps();
|
|
4305
4377
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4306
4378
|
const providerValue = { id, isOpen, onClose };
|
|
@@ -4312,7 +4384,7 @@ const HeaderDialog = (props) => {
|
|
|
4312
4384
|
};
|
|
4313
4385
|
HeaderDialog.spiritComponent = 'HeaderDialog';
|
|
4314
4386
|
|
|
4315
|
-
var __rest$
|
|
4387
|
+
var __rest$1G = (undefined && undefined.__rest) || function (s, e) {
|
|
4316
4388
|
var t = {};
|
|
4317
4389
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4318
4390
|
t[p] = s[p];
|
|
@@ -4324,7 +4396,7 @@ var __rest$1F = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4324
4396
|
return t;
|
|
4325
4397
|
};
|
|
4326
4398
|
const HeaderDialogActions = (props) => {
|
|
4327
|
-
const { color = HEADER_ACTIONS_COLOR_DEFAULT } = props, restProps = __rest$
|
|
4399
|
+
const { color = HEADER_ACTIONS_COLOR_DEFAULT } = props, restProps = __rest$1G(props, ["color"]);
|
|
4328
4400
|
const { classProps } = useHeaderStyleProps({ actionsColor: color });
|
|
4329
4401
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4330
4402
|
return (React.createElement("nav", Object.assign({}, otherProps, { className: classNames(classProps.headerDialogActions, styleProps.className), style: styleProps.style })));
|
|
@@ -4338,7 +4410,7 @@ const HeaderDialogButton = (props) => {
|
|
|
4338
4410
|
};
|
|
4339
4411
|
HeaderDialogButton.spiritComponent = 'HeaderDialogButton';
|
|
4340
4412
|
|
|
4341
|
-
var __rest$
|
|
4413
|
+
var __rest$1F = (undefined && undefined.__rest) || function (s, e) {
|
|
4342
4414
|
var t = {};
|
|
4343
4415
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4344
4416
|
t[p] = s[p];
|
|
@@ -4350,7 +4422,7 @@ var __rest$1E = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4350
4422
|
return t;
|
|
4351
4423
|
};
|
|
4352
4424
|
const HeaderDialogCloseButton = (props) => {
|
|
4353
|
-
const { label = HEADER_DIALOG_CLOSE_BUTTON_LABEL_DEFAULT, onClick } = props, restProps = __rest$
|
|
4425
|
+
const { label = HEADER_DIALOG_CLOSE_BUTTON_LABEL_DEFAULT, onClick } = props, restProps = __rest$1F(props, ["label", "onClick"]);
|
|
4354
4426
|
const { classProps } = useHeaderStyleProps();
|
|
4355
4427
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4356
4428
|
const { id, isOpen, onClose } = useHeaderDialogContext();
|
|
@@ -4365,7 +4437,7 @@ const HeaderDialogCloseButton = (props) => {
|
|
|
4365
4437
|
};
|
|
4366
4438
|
HeaderDialogCloseButton.spiritComponent = 'HeaderDialogCloseButton';
|
|
4367
4439
|
|
|
4368
|
-
var __rest$
|
|
4440
|
+
var __rest$1E = (undefined && undefined.__rest) || function (s, e) {
|
|
4369
4441
|
var t = {};
|
|
4370
4442
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4371
4443
|
t[p] = s[p];
|
|
@@ -4377,7 +4449,7 @@ var __rest$1D = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4377
4449
|
return t;
|
|
4378
4450
|
};
|
|
4379
4451
|
const _HeaderDialogLink = (props, ref) => {
|
|
4380
|
-
const { elementType: ElementTag = 'a', children, isCurrent } = props, restProps = __rest$
|
|
4452
|
+
const { elementType: ElementTag = 'a', children, isCurrent } = props, restProps = __rest$1E(props, ["elementType", "children", "isCurrent"]);
|
|
4381
4453
|
const { classProps } = useHeaderStyleProps({ isCurrentLink: isCurrent });
|
|
4382
4454
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4383
4455
|
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
@@ -4411,7 +4483,7 @@ const HeaderDialogText = (props) => {
|
|
|
4411
4483
|
};
|
|
4412
4484
|
HeaderDialogText.spiritComponent = 'HeaderDialogText';
|
|
4413
4485
|
|
|
4414
|
-
var __rest$
|
|
4486
|
+
var __rest$1D = (undefined && undefined.__rest) || function (s, e) {
|
|
4415
4487
|
var t = {};
|
|
4416
4488
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4417
4489
|
t[p] = s[p];
|
|
@@ -4423,7 +4495,7 @@ var __rest$1C = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4423
4495
|
return t;
|
|
4424
4496
|
};
|
|
4425
4497
|
const _HeaderLink = (props, ref) => {
|
|
4426
|
-
const { elementType: ElementTag = 'a', children, isCurrent } = props, restProps = __rest$
|
|
4498
|
+
const { elementType: ElementTag = 'a', children, isCurrent } = props, restProps = __rest$1D(props, ["elementType", "children", "isCurrent"]);
|
|
4427
4499
|
const { classProps } = useHeaderStyleProps({ isCurrentLink: isCurrent });
|
|
4428
4500
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4429
4501
|
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
@@ -4436,7 +4508,7 @@ const _HeaderLink = (props, ref) => {
|
|
|
4436
4508
|
const HeaderLink = React.forwardRef(_HeaderLink);
|
|
4437
4509
|
HeaderLink.spiritComponent = 'HeaderLink';
|
|
4438
4510
|
|
|
4439
|
-
var __rest$
|
|
4511
|
+
var __rest$1C = (undefined && undefined.__rest) || function (s, e) {
|
|
4440
4512
|
var t = {};
|
|
4441
4513
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4442
4514
|
t[p] = s[p];
|
|
@@ -4448,7 +4520,7 @@ var __rest$1B = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4448
4520
|
return t;
|
|
4449
4521
|
};
|
|
4450
4522
|
const HeaderMobileActions = (props) => {
|
|
4451
|
-
const { children, dialogId, menuToggleLabel = HEADER_MENU_TOGGLE_LABEL_DEFAULT, isOpen, onOpen } = props, restProps = __rest$
|
|
4523
|
+
const { children, dialogId, menuToggleLabel = HEADER_MENU_TOGGLE_LABEL_DEFAULT, isOpen, onOpen } = props, restProps = __rest$1C(props, ["children", "dialogId", "menuToggleLabel", "isOpen", "onOpen"]);
|
|
4452
4524
|
const { classProps } = useHeaderStyleProps();
|
|
4453
4525
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4454
4526
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.headerMobileActions, styleProps.className), style: styleProps.style }),
|
|
@@ -4473,7 +4545,7 @@ const HeaderNavItem = (props) => {
|
|
|
4473
4545
|
};
|
|
4474
4546
|
HeaderNavItem.spiritComponent = 'HeaderNavItem';
|
|
4475
4547
|
|
|
4476
|
-
var __rest$
|
|
4548
|
+
var __rest$1B = (undefined && undefined.__rest) || function (s, e) {
|
|
4477
4549
|
var t = {};
|
|
4478
4550
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4479
4551
|
t[p] = s[p];
|
|
@@ -4485,7 +4557,7 @@ var __rest$1A = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4485
4557
|
return t;
|
|
4486
4558
|
};
|
|
4487
4559
|
function useHeadingStyleProps(props) {
|
|
4488
|
-
const { emphasis, size, textColor } = props, restProps = __rest$
|
|
4560
|
+
const { emphasis, size, textColor } = props, restProps = __rest$1B(props, ["emphasis", "size", "textColor"]);
|
|
4489
4561
|
const headingClass = useClassNamePrefix('typography-heading');
|
|
4490
4562
|
const headingTextColorClass = useClassNamePrefix(textColor ? `text-${textColor}` : '');
|
|
4491
4563
|
const className = classNames(`${headingClass}-${size}-${emphasis}`, {
|
|
@@ -4497,7 +4569,7 @@ function useHeadingStyleProps(props) {
|
|
|
4497
4569
|
};
|
|
4498
4570
|
}
|
|
4499
4571
|
|
|
4500
|
-
var __rest$
|
|
4572
|
+
var __rest$1A = (undefined && undefined.__rest) || function (s, e) {
|
|
4501
4573
|
var t = {};
|
|
4502
4574
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4503
4575
|
t[p] = s[p];
|
|
@@ -4508,13 +4580,13 @@ var __rest$1z = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4508
4580
|
}
|
|
4509
4581
|
return t;
|
|
4510
4582
|
};
|
|
4511
|
-
const defaultProps$
|
|
4583
|
+
const defaultProps$x = {
|
|
4512
4584
|
emphasis: Emphasis.BOLD,
|
|
4513
4585
|
size: SizesExtended.MEDIUM,
|
|
4514
4586
|
};
|
|
4515
4587
|
const Heading = (props) => {
|
|
4516
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
4517
|
-
const { elementType: ElementTag, children } = propsWithDefaults, restProps = __rest$
|
|
4588
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$x), props);
|
|
4589
|
+
const { elementType: ElementTag, children } = propsWithDefaults, restProps = __rest$1A(propsWithDefaults, ["elementType", "children"]);
|
|
4518
4590
|
const { classProps, props: modifiedProps } = useHeadingStyleProps(Object.assign({}, restProps));
|
|
4519
4591
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps, {
|
|
4520
4592
|
isTextBalanced: HeadingStyleProps.isTextBalanced,
|
|
@@ -4527,6 +4599,32 @@ const Heading = (props) => {
|
|
|
4527
4599
|
};
|
|
4528
4600
|
Heading.spiritComponent = 'Heading';
|
|
4529
4601
|
|
|
4602
|
+
var __rest$1z = (undefined && undefined.__rest) || function (s, e) {
|
|
4603
|
+
var t = {};
|
|
4604
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4605
|
+
t[p] = s[p];
|
|
4606
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4607
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4608
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4609
|
+
t[p[i]] = s[p[i]];
|
|
4610
|
+
}
|
|
4611
|
+
return t;
|
|
4612
|
+
};
|
|
4613
|
+
const defaultProps$w = {
|
|
4614
|
+
elementType: 'span',
|
|
4615
|
+
};
|
|
4616
|
+
const Hidden = (props) => {
|
|
4617
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$w), props);
|
|
4618
|
+
const { elementType: ElementTag = 'span', children, on, from } = propsWithDefaults, restProps = __rest$1z(propsWithDefaults, ["elementType", "children", "on", "from"]);
|
|
4619
|
+
const stylePropsWithMapping = Object.assign(Object.assign({}, restProps), { hideOn: on || restProps.hideOn, hideFrom: from || restProps.hideFrom });
|
|
4620
|
+
const { styleProps, props: otherProps } = useStyleProps(stylePropsWithMapping);
|
|
4621
|
+
const mergedStyleProps = mergeStyleProps(ElementTag, { styleProps });
|
|
4622
|
+
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
4623
|
+
};
|
|
4624
|
+
Hidden.spiritComponent = 'Hidden';
|
|
4625
|
+
Hidden.spiritDefaultElement = 'span';
|
|
4626
|
+
Hidden.spiritDefaultProps = null;
|
|
4627
|
+
|
|
4530
4628
|
const IconBoxShapes = {
|
|
4531
4629
|
ROUNDED: 'rounded',
|
|
4532
4630
|
SQUARE: 'square',
|
|
@@ -4876,6 +4974,8 @@ const ModalBody = (_a) => {
|
|
|
4876
4974
|
};
|
|
4877
4975
|
ModalBody.spiritComponent = 'ModalBody';
|
|
4878
4976
|
|
|
4977
|
+
const MODAL_CLOSE_BUTTON_LABEL_DEFAULT = 'Close';
|
|
4978
|
+
|
|
4879
4979
|
var __rest$1q = (undefined && undefined.__rest) || function (s, e) {
|
|
4880
4980
|
var t = {};
|
|
4881
4981
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -4888,7 +4988,7 @@ var __rest$1q = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4888
4988
|
return t;
|
|
4889
4989
|
};
|
|
4890
4990
|
const ModalCloseButton = (_a) => {
|
|
4891
|
-
var { label =
|
|
4991
|
+
var { label = MODAL_CLOSE_BUTTON_LABEL_DEFAULT, onClose, id, isOpen } = _a, restProps = __rest$1q(_a, ["label", "onClose", "id", "isOpen"]);
|
|
4892
4992
|
return (React.createElement(Button, Object.assign({}, restProps, { isSymmetrical: true, color: "tertiary", onClick: onClose, "aria-expanded": isOpen, "aria-controls": id }),
|
|
4893
4993
|
React.createElement(Icon, { name: "close" }),
|
|
4894
4994
|
React.createElement(VisuallyHidden, null, label)));
|
|
@@ -4914,8 +5014,7 @@ const setCustomHeight = (baseVarName, propValue) => {
|
|
|
4914
5014
|
var _a;
|
|
4915
5015
|
const suffix = key === 'mobile' ? '' : `-${key}`;
|
|
4916
5016
|
const propName = `--${baseVarName}${suffix}`;
|
|
4917
|
-
acc[propName]
|
|
4918
|
-
return acc;
|
|
5017
|
+
return Object.assign(Object.assign({}, acc), { [propName]: (_a = propValue[key]) === null || _a === void 0 ? void 0 : _a.toString() });
|
|
4919
5018
|
}, {});
|
|
4920
5019
|
}
|
|
4921
5020
|
const propName = `--${baseVarName}`;
|
|
@@ -4994,7 +5093,7 @@ const defaultProps$t = {
|
|
|
4994
5093
|
};
|
|
4995
5094
|
const ModalHeader = (props) => {
|
|
4996
5095
|
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$t), props);
|
|
4997
|
-
const { children, closeLabel, hasCloseButton } = propsWithDefaults, restProps = __rest$1m(propsWithDefaults, ["children", "closeLabel", "hasCloseButton"]);
|
|
5096
|
+
const { children, closeLabel = MODAL_CLOSE_BUTTON_LABEL_DEFAULT, hasCloseButton } = propsWithDefaults, restProps = __rest$1m(propsWithDefaults, ["children", "closeLabel", "hasCloseButton"]);
|
|
4998
5097
|
const { classProps } = useModalStyleProps();
|
|
4999
5098
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
5000
5099
|
const { id, isOpen, onClose } = useModalContext();
|
|
@@ -5205,6 +5304,10 @@ const Pagination = (props) => {
|
|
|
5205
5304
|
};
|
|
5206
5305
|
Pagination.spiritComponent = 'Pagination';
|
|
5207
5306
|
|
|
5307
|
+
const PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Previous';
|
|
5308
|
+
const PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Next';
|
|
5309
|
+
const PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX = 'Go to page';
|
|
5310
|
+
|
|
5208
5311
|
var __rest$1f = (undefined && undefined.__rest) || function (s, e) {
|
|
5209
5312
|
var t = {};
|
|
5210
5313
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -5217,7 +5320,9 @@ var __rest$1f = (undefined && undefined.__rest) || function (s, e) {
|
|
|
5217
5320
|
return t;
|
|
5218
5321
|
};
|
|
5219
5322
|
const _PaginationButtonLink = (props, ref) => {
|
|
5220
|
-
const _a = props, { direction, accessibilityLabel
|
|
5323
|
+
const _a = props, { direction, accessibilityLabel = direction === 'previous'
|
|
5324
|
+
? PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL
|
|
5325
|
+
: PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL } = _a, restProps = __rest$1f(_a, ["direction", "accessibilityLabel"]);
|
|
5221
5326
|
const iconType = {
|
|
5222
5327
|
previous: 'chevron-left',
|
|
5223
5328
|
next: 'chevron-right',
|
|
@@ -5261,19 +5366,17 @@ var __rest$1d = (undefined && undefined.__rest) || function (s, e) {
|
|
|
5261
5366
|
};
|
|
5262
5367
|
const _PaginationLink = (props, ref) => {
|
|
5263
5368
|
const { elementType: ElementTag = 'a', accessibilityLabel, isCurrent, pageNumber } = props, restProps = __rest$1d(props, ["elementType", "accessibilityLabel", "isCurrent", "pageNumber"]);
|
|
5369
|
+
const visuallyHiddenLabel = accessibilityLabel || `${PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX} ${pageNumber}`;
|
|
5264
5370
|
const { classProps } = usePaginationStyleProps({ isCurrent });
|
|
5265
5371
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
5266
5372
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.link, styleProps, otherProps });
|
|
5267
|
-
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps, { ref: ref }),
|
|
5268
|
-
React.createElement(VisuallyHidden, null,
|
|
5373
|
+
return (React.createElement(ElementTag, Object.assign({}, (isCurrent && { 'aria-current': 'page' }), otherProps, mergedStyleProps, { ref: ref }),
|
|
5374
|
+
React.createElement(VisuallyHidden, null, visuallyHiddenLabel),
|
|
5269
5375
|
React.createElement("span", { "aria-hidden": "true" }, pageNumber)));
|
|
5270
5376
|
};
|
|
5271
5377
|
const PaginationLink = React.forwardRef(_PaginationLink);
|
|
5272
5378
|
PaginationLink.spiritComponent = 'PaginationLink';
|
|
5273
5379
|
|
|
5274
|
-
const PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Previous';
|
|
5275
|
-
const PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Next';
|
|
5276
|
-
|
|
5277
5380
|
var __rest$1c = (undefined && undefined.__rest) || function (s, e) {
|
|
5278
5381
|
var t = {};
|
|
5279
5382
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -5355,7 +5458,7 @@ var __rest$1a = (undefined && undefined.__rest) || function (s, e) {
|
|
|
5355
5458
|
return t;
|
|
5356
5459
|
};
|
|
5357
5460
|
const UncontrolledPagination = (props) => {
|
|
5358
|
-
const { accessibilityLabel, accessibilityLabelPrevious =
|
|
5461
|
+
const { accessibilityLabel = PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX, accessibilityLabelPrevious = PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL, accessibilityLabelNext = PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL, defaultPage = 1, onChange, totalPages = 0, visiblePages = 5 } = props, rest = __rest$1a(props, ["accessibilityLabel", "accessibilityLabelPrevious", "accessibilityLabelNext", "defaultPage", "onChange", "totalPages", "visiblePages"]);
|
|
5359
5462
|
const { currentPage, pages, handlePageChange } = usePagination({
|
|
5360
5463
|
defaultPage,
|
|
5361
5464
|
onChange,
|
|
@@ -6143,18 +6246,20 @@ var __rest$U = (undefined && undefined.__rest) || function (s, e) {
|
|
|
6143
6246
|
return t;
|
|
6144
6247
|
};
|
|
6145
6248
|
function useRadioStyleProps(props) {
|
|
6146
|
-
const {
|
|
6249
|
+
const { inputPosition = InputPositions.START, isItem, isLabelHidden, validationState } = props, restProps = __rest$U(props, ["inputPosition", "isItem", "isLabelHidden", "validationState"]);
|
|
6147
6250
|
const { isDisabled } = restProps;
|
|
6148
6251
|
const radioClass = useClassNamePrefix('Radio');
|
|
6149
6252
|
const radioDisabledClass = `${radioClass}--disabled`;
|
|
6150
6253
|
const radioItemClass = `${radioClass}--item`;
|
|
6151
6254
|
const radioInputClass = `${radioClass}__input`;
|
|
6255
|
+
const radioInputPositionClass = useInputPositionClass(radioClass, inputPosition);
|
|
6152
6256
|
const radioLabelClass = `${radioClass}__label`;
|
|
6153
6257
|
const radioLabelHiddenClass = `${radioClass}__label--hidden`;
|
|
6154
6258
|
const radioTextClass = `${radioClass}__text`;
|
|
6155
6259
|
const radioHelperTextClass = `${radioClass}__helperText`;
|
|
6156
6260
|
const radioValidationClass = `${radioClass}--${validationState}`;
|
|
6157
6261
|
const rootStyles = classNames(radioClass, {
|
|
6262
|
+
[radioInputPositionClass]: radioInputPositionClass,
|
|
6158
6263
|
[radioDisabledClass]: isDisabled,
|
|
6159
6264
|
[radioItemClass]: isItem,
|
|
6160
6265
|
[radioValidationClass]: validationState,
|
|
@@ -6202,6 +6307,7 @@ Radio.spiritComponent = 'Radio';
|
|
|
6202
6307
|
|
|
6203
6308
|
const DEBOUNCE_DELAY = 50;
|
|
6204
6309
|
const EDGE_DETECTION_INACCURACY_PX = 1;
|
|
6310
|
+
const SCROLL_CANCEL_DELAY = 10;
|
|
6205
6311
|
const SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_END = 'Scroll right';
|
|
6206
6312
|
const SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_START = 'Scroll left';
|
|
6207
6313
|
const SCROLL_VIEW_ARROWS_LABEL_VERTICAL_END = 'Scroll down';
|
|
@@ -6209,6 +6315,43 @@ const SCROLL_VIEW_ARROWS_LABEL_VERTICAL_START = 'Scroll up';
|
|
|
6209
6315
|
const SCROLL_VIEW_DEFAULT_DIRECTION = Direction.VERTICAL;
|
|
6210
6316
|
const SCROLL_VIEW_DEFAULT_OVERFLOW_DECORATOR = 'shadows';
|
|
6211
6317
|
|
|
6318
|
+
const useScrollCallback = ({ viewportRef, direction }) => {
|
|
6319
|
+
const scrollTimeoutRef = React.useRef(null);
|
|
6320
|
+
React.useEffect(() => () => {
|
|
6321
|
+
if (scrollTimeoutRef.current) {
|
|
6322
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
6323
|
+
}
|
|
6324
|
+
}, []);
|
|
6325
|
+
const handleScroll = React.useCallback((step) => {
|
|
6326
|
+
if (!viewportRef.current) {
|
|
6327
|
+
return;
|
|
6328
|
+
}
|
|
6329
|
+
const isHorizontal = isDirectionHorizontal(direction);
|
|
6330
|
+
const scrollToDirection = isHorizontal ? Position.LEFT : Position.TOP;
|
|
6331
|
+
const currentScrollPosition = isHorizontal ? viewportRef.current.scrollLeft : viewportRef.current.scrollTop;
|
|
6332
|
+
const maxScroll = isHorizontal
|
|
6333
|
+
? viewportRef.current.scrollWidth - viewportRef.current.clientWidth
|
|
6334
|
+
: viewportRef.current.scrollHeight - viewportRef.current.clientHeight;
|
|
6335
|
+
viewportRef.current.scrollTo({
|
|
6336
|
+
[scrollToDirection]: currentScrollPosition,
|
|
6337
|
+
behavior: 'auto',
|
|
6338
|
+
});
|
|
6339
|
+
if (scrollTimeoutRef.current) {
|
|
6340
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
6341
|
+
}
|
|
6342
|
+
const targetPosition = Math.max(0, Math.min(currentScrollPosition + step, maxScroll));
|
|
6343
|
+
scrollTimeoutRef.current = setTimeout(() => {
|
|
6344
|
+
if (viewportRef.current) {
|
|
6345
|
+
viewportRef.current.scrollTo({
|
|
6346
|
+
[scrollToDirection]: targetPosition,
|
|
6347
|
+
behavior: 'smooth',
|
|
6348
|
+
});
|
|
6349
|
+
}
|
|
6350
|
+
}, SCROLL_CANCEL_DELAY);
|
|
6351
|
+
}, [viewportRef, direction]);
|
|
6352
|
+
return { handleScroll };
|
|
6353
|
+
};
|
|
6354
|
+
|
|
6212
6355
|
const getDefaultArrowLabels = (isHorizontal) => isHorizontal
|
|
6213
6356
|
? {
|
|
6214
6357
|
start: SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_START,
|
|
@@ -6292,14 +6435,7 @@ const ScrollViewArrows = (props) => {
|
|
|
6292
6435
|
const mergedStyleProps = mergeStyleProps('button', { classProps: classProps.arrows, styleProps });
|
|
6293
6436
|
const isHorizontal = isDirectionHorizontal(direction);
|
|
6294
6437
|
const { arrows } = useScrollViewArrows(isHorizontal, ariaLabelArrows, scrollStep);
|
|
6295
|
-
const handleScroll = (
|
|
6296
|
-
var _a;
|
|
6297
|
-
const scrollToDirection = isHorizontal ? 'left' : 'top';
|
|
6298
|
-
(_a = viewportRef.current) === null || _a === void 0 ? void 0 : _a.scrollBy({
|
|
6299
|
-
[scrollToDirection]: step,
|
|
6300
|
-
behavior: 'smooth',
|
|
6301
|
-
});
|
|
6302
|
-
};
|
|
6438
|
+
const { handleScroll } = useScrollCallback({ viewportRef, direction });
|
|
6303
6439
|
return (React.createElement("div", Object.assign({}, otherProps, mergedStyleProps), arrows.map(({ icon, label, step }) => (React.createElement(ControlButton, { key: icon, "aria-label": label, onClick: () => handleScroll(step), size: "small", isSymmetrical: true },
|
|
6304
6440
|
React.createElement(Icon, { name: icon }))))));
|
|
6305
6441
|
};
|
|
@@ -7007,6 +7143,8 @@ const SplitButton = (props) => {
|
|
|
7007
7143
|
React.createElement("div", Object.assign({}, styleProps, otherProps, { className: classNames(classProps, styleProps.className) }), children)));
|
|
7008
7144
|
};
|
|
7009
7145
|
|
|
7146
|
+
const UNCONTROLLED_SPLIT_BUTTON_DROPDOWN_TRIGGER_LABEL_DEFAULT = 'More';
|
|
7147
|
+
|
|
7010
7148
|
var __rest$B = (undefined && undefined.__rest) || function (s, e) {
|
|
7011
7149
|
var t = {};
|
|
7012
7150
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -7021,6 +7159,7 @@ var __rest$B = (undefined && undefined.__rest) || function (s, e) {
|
|
|
7021
7159
|
const defaultProps$a = {
|
|
7022
7160
|
dropdownPlacement: 'bottom-end',
|
|
7023
7161
|
dropdownTriggerIconName: 'chevron-down',
|
|
7162
|
+
dropdownTriggerLabel: UNCONTROLLED_SPLIT_BUTTON_DROPDOWN_TRIGGER_LABEL_DEFAULT,
|
|
7024
7163
|
};
|
|
7025
7164
|
const UncontrolledSplitButton = (props) => {
|
|
7026
7165
|
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$a), props);
|
|
@@ -7430,6 +7569,9 @@ function useTextFieldBaseStyleProps(props) {
|
|
|
7430
7569
|
};
|
|
7431
7570
|
}
|
|
7432
7571
|
|
|
7572
|
+
const TEXT_FIELD_BASE_PASSWORD_TOGGLE_SHOW_LABEL_DEFAULT = 'Show password';
|
|
7573
|
+
const TEXT_FIELD_BASE_PASSWORD_TOGGLE_HIDE_LABEL_DEFAULT = 'Hide password';
|
|
7574
|
+
|
|
7433
7575
|
function useTextFieldBasePasswordToggleStyleProps() {
|
|
7434
7576
|
const TextFieldBaseClass = useClassNamePrefix('TextField');
|
|
7435
7577
|
const TextFieldBasePasswordToggleClass = `${TextFieldBaseClass}__passwordToggle`;
|
|
@@ -7447,9 +7589,12 @@ function useTextFieldBasePasswordToggleStyleProps() {
|
|
|
7447
7589
|
const TextFieldBasePasswordToggle = (props) => {
|
|
7448
7590
|
const { children, isPasswordShown, onToggleClick, isDisabled, size } = props;
|
|
7449
7591
|
const { classProps } = useTextFieldBasePasswordToggleStyleProps();
|
|
7592
|
+
const ariaLabel = isPasswordShown
|
|
7593
|
+
? TEXT_FIELD_BASE_PASSWORD_TOGGLE_HIDE_LABEL_DEFAULT
|
|
7594
|
+
: TEXT_FIELD_BASE_PASSWORD_TOGGLE_SHOW_LABEL_DEFAULT;
|
|
7450
7595
|
return (React.createElement("div", { className: classProps.passwordToggle },
|
|
7451
7596
|
children,
|
|
7452
|
-
React.createElement("button", { className: classProps.passwordToggleButton, type: "button", role: "switch", "aria-checked": !!isPasswordShown, "aria-label":
|
|
7597
|
+
React.createElement("button", { className: classProps.passwordToggleButton, type: "button", role: "switch", "aria-checked": !!isPasswordShown, "aria-label": ariaLabel, onClick: () => onToggleClick(), disabled: isDisabled },
|
|
7453
7598
|
React.createElement("span", { className: classProps.passwordToggleIcon },
|
|
7454
7599
|
React.createElement(Icon, { name: `visibility-${isPasswordShown ? 'off' : 'on'}`, boxSize: size === Sizes.SMALL ? 16 : 20 })))));
|
|
7455
7600
|
};
|
|
@@ -7997,7 +8142,7 @@ var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
7997
8142
|
return t;
|
|
7998
8143
|
};
|
|
7999
8144
|
const UncontrolledToast = (props) => {
|
|
8000
|
-
const { alignmentX, alignmentY, isCollapsible, closeLabel } = props, restProps = __rest$7(props, ["alignmentX", "alignmentY", "isCollapsible", "closeLabel"]);
|
|
8145
|
+
const { alignmentX, alignmentY, isCollapsible, closeLabel = TOAST_BAR_CLOSE_BUTTON_LABEL_DEFAULT } = props, restProps = __rest$7(props, ["alignmentX", "alignmentY", "isCollapsible", "closeLabel"]);
|
|
8001
8146
|
const { hide, queue } = useToast();
|
|
8002
8147
|
return (React.createElement(Toast, { alignmentX: alignmentX, alignmentY: alignmentY, isCollapsible: isCollapsible }, queue.map((item) => {
|
|
8003
8148
|
const { color, iconName, id, isOpen, content, hasIcon, isDismissible, linkProps } = item;
|
|
@@ -8020,7 +8165,7 @@ var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
8020
8165
|
return t;
|
|
8021
8166
|
};
|
|
8022
8167
|
function useToggleStyleProps(props) {
|
|
8023
|
-
const {
|
|
8168
|
+
const { hasIndicators = false, inputPosition = InputPositions.END, isDisabled = false, isFluid = false, isLabelHidden = false, isRequired = false, validationState } = props, restProps = __rest$6(props, ["hasIndicators", "inputPosition", "isDisabled", "isFluid", "isLabelHidden", "isRequired", "validationState"]);
|
|
8024
8169
|
const toggleClass = useClassNamePrefix('Toggle');
|
|
8025
8170
|
const toggleFluidClass = `${toggleClass}--fluid`;
|
|
8026
8171
|
const toggleDisabledClass = `${toggleClass}--disabled`;
|
|
@@ -8031,9 +8176,11 @@ function useToggleStyleProps(props) {
|
|
|
8031
8176
|
const toggleRequiredClass = `${toggleLabelClass}--required`;
|
|
8032
8177
|
const toggleInputClass = `${toggleClass}__input`;
|
|
8033
8178
|
const toggleInputIndicatorsClass = `${toggleInputClass}--indicators`;
|
|
8179
|
+
const toggleInputPositionClass = useInputPositionClass(toggleClass, inputPosition);
|
|
8034
8180
|
const toggleHelperTextClass = `${toggleClass}__helperText`;
|
|
8035
8181
|
const toggleValidationTextClass = `${toggleClass}__validationText`;
|
|
8036
8182
|
const rootClass = classNames(toggleClass, {
|
|
8183
|
+
[toggleInputPositionClass]: toggleInputPositionClass,
|
|
8037
8184
|
[toggleFluidClass]: isFluid,
|
|
8038
8185
|
[toggleDisabledClass]: isDisabled,
|
|
8039
8186
|
[toggleValidationClass]: validationState,
|
|
@@ -8310,6 +8457,7 @@ exports.Container = Container;
|
|
|
8310
8457
|
exports.ContainerTokenSizes = ContainerTokenSizes;
|
|
8311
8458
|
exports.ControlButton = ControlButton;
|
|
8312
8459
|
exports.DEBOUNCE_DELAY = DEBOUNCE_DELAY;
|
|
8460
|
+
exports.DEFAULT_ATTACHMENT_LIST_LABEL = DEFAULT_ATTACHMENT_LIST_LABEL;
|
|
8313
8461
|
exports.DEFAULT_BUTTON_LABEL = DEFAULT_BUTTON_LABEL;
|
|
8314
8462
|
exports.DEFAULT_EDIT_BUTTON_LABEL = DEFAULT_EDIT_BUTTON_LABEL;
|
|
8315
8463
|
exports.DEFAULT_ERROR_MESSAGE_MAX_FILE_SIZE = DEFAULT_ERROR_MESSAGE_MAX_FILE_SIZE;
|
|
@@ -8376,6 +8524,7 @@ exports.HeaderNavItem = HeaderNavItem;
|
|
|
8376
8524
|
exports.Heading = Heading;
|
|
8377
8525
|
exports.HeadingStyleProps = HeadingStyleProps;
|
|
8378
8526
|
exports.HelperText = HelperText;
|
|
8527
|
+
exports.Hidden = Hidden;
|
|
8379
8528
|
exports.ICON_BOX_SIZE = ICON_BOX_SIZE;
|
|
8380
8529
|
exports.IMAGE_DIMENSION = IMAGE_DIMENSION;
|
|
8381
8530
|
exports.IMAGE_PREVIEW_BASE64_MAX_WIDTH = IMAGE_PREVIEW_BASE64_MAX_WIDTH;
|
|
@@ -8383,6 +8532,7 @@ exports.Icon = Icon;
|
|
|
8383
8532
|
exports.IconBox = IconBox;
|
|
8384
8533
|
exports.IconsConsumer = IconsConsumer;
|
|
8385
8534
|
exports.IconsProvider = IconsProvider;
|
|
8535
|
+
exports.InputPositions = InputPositions;
|
|
8386
8536
|
exports.Intensity = Intensity;
|
|
8387
8537
|
exports.Item = Item;
|
|
8388
8538
|
exports.Label = Label;
|
|
@@ -8403,6 +8553,7 @@ exports.NavigationAvatar = NavigationAvatar;
|
|
|
8403
8553
|
exports.NavigationItem = NavigationItem;
|
|
8404
8554
|
exports.NoSsr = NoSsr;
|
|
8405
8555
|
exports.ObjectFit = ObjectFit;
|
|
8556
|
+
exports.PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX = PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX;
|
|
8406
8557
|
exports.PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL;
|
|
8407
8558
|
exports.PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL;
|
|
8408
8559
|
exports.PaddingStyleProps = PaddingStyleProps;
|
|
@@ -8425,6 +8576,7 @@ exports.ProductLogo = ProductLogo;
|
|
|
8425
8576
|
exports.PropsConsumer = PropsConsumer;
|
|
8426
8577
|
exports.PropsProvider = PropsProvider;
|
|
8427
8578
|
exports.Radio = Radio;
|
|
8579
|
+
exports.SCROLL_CANCEL_DELAY = SCROLL_CANCEL_DELAY;
|
|
8428
8580
|
exports.SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_END = SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_END;
|
|
8429
8581
|
exports.SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_START = SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_START;
|
|
8430
8582
|
exports.SCROLL_VIEW_ARROWS_LABEL_VERTICAL_END = SCROLL_VIEW_ARROWS_LABEL_VERTICAL_END;
|
|
@@ -8585,7 +8737,6 @@ exports.useDefaultResponsiveRowsStyle = useDefaultResponsiveRowsStyle;
|
|
|
8585
8737
|
exports.useDeprecationMessage = useDeprecationMessage;
|
|
8586
8738
|
exports.useDialog = useDialog;
|
|
8587
8739
|
exports.useDimensionStyle = useDimensionStyle;
|
|
8588
|
-
exports.useDirectionClass = useDirectionClass;
|
|
8589
8740
|
exports.useDividerStyleProps = useDividerStyleProps;
|
|
8590
8741
|
exports.useDragAndDrop = useDragAndDrop;
|
|
8591
8742
|
exports.useDrawerContext = useDrawerContext;
|
|
@@ -8608,6 +8759,7 @@ exports.useIconBoxColors = useIconBoxColors;
|
|
|
8608
8759
|
exports.useIconBoxStyleProps = useIconBoxStyleProps;
|
|
8609
8760
|
exports.useIconName = useIconName;
|
|
8610
8761
|
exports.useIconStyleProps = useIconStyleProps;
|
|
8762
|
+
exports.useInputPositionClass = useInputPositionClass;
|
|
8611
8763
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
8612
8764
|
exports.useItemStyleProps = useItemStyleProps;
|
|
8613
8765
|
exports.useLastActiveFocus = useLastActiveFocus;
|
|
@@ -8625,6 +8777,7 @@ exports.usePricingPlanStyleProps = usePricingPlanStyleProps;
|
|
|
8625
8777
|
exports.usePropsContext = usePropsContext;
|
|
8626
8778
|
exports.useRadioStyleProps = useRadioStyleProps;
|
|
8627
8779
|
exports.useResizeObserver = useResizeObserver;
|
|
8780
|
+
exports.useScrollCallback = useScrollCallback;
|
|
8628
8781
|
exports.useScrollControl = useScrollControl;
|
|
8629
8782
|
exports.useScrollPosition = useScrollPosition;
|
|
8630
8783
|
exports.useScrollViewArrows = useScrollViewArrows;
|
|
@@ -8641,6 +8794,7 @@ exports.useSpacingStyle = useSpacingStyle;
|
|
|
8641
8794
|
exports.useSpinnerStyleProps = useSpinnerStyleProps;
|
|
8642
8795
|
exports.useSplitButtonStyleProps = useSplitButtonStyleProps;
|
|
8643
8796
|
exports.useStyleProps = useStyleProps;
|
|
8797
|
+
exports.useSymmetry = useSymmetry;
|
|
8644
8798
|
exports.useTab = useTab;
|
|
8645
8799
|
exports.useTabContext = useTabContext;
|
|
8646
8800
|
exports.useTabsStyleProps = useTabsStyleProps;
|