@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
|
@@ -88,7 +88,7 @@ const ColorPrefixes = {
|
|
|
88
88
|
EMOTION: 'emotion',
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
var __rest$
|
|
91
|
+
var __rest$2W = (undefined && undefined.__rest) || function (s, e) {
|
|
92
92
|
var t = {};
|
|
93
93
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
94
94
|
t[p] = s[p];
|
|
@@ -147,7 +147,7 @@ const Sizes = {
|
|
|
147
147
|
LARGE: 'large',
|
|
148
148
|
};
|
|
149
149
|
const SizesExtended = Object.assign(Object.assign({ XSMALL: 'xsmall' }, Sizes), { XLARGE: 'xlarge' });
|
|
150
|
-
const _a = createUppercaseKeyDictionary(spiritDesignTokens.containers), { MAXWIDTH, PADDING } = _a; __rest$
|
|
150
|
+
const _a = createUppercaseKeyDictionary(spiritDesignTokens.containers), { MAXWIDTH, PADDING } = _a; __rest$2W(_a, ["MAXWIDTH", "PADDING"]);
|
|
151
151
|
const FillVariants = {
|
|
152
152
|
OUTLINE: 'outline',
|
|
153
153
|
};
|
|
@@ -166,6 +166,11 @@ var DirectionAxis;
|
|
|
166
166
|
})(DirectionAxis || (DirectionAxis = {}));
|
|
167
167
|
const isDirectionHorizontal = (direction) => direction === Direction.HORIZONTAL;
|
|
168
168
|
|
|
169
|
+
const InputPositions = {
|
|
170
|
+
START: 'start',
|
|
171
|
+
END: 'end',
|
|
172
|
+
};
|
|
173
|
+
|
|
169
174
|
const ObjectFit = {
|
|
170
175
|
COVER: 'cover',
|
|
171
176
|
};
|
|
@@ -518,7 +523,7 @@ const useStyleUtilities = (props, prefix = '', additionalProps = {}) => {
|
|
|
518
523
|
};
|
|
519
524
|
};
|
|
520
525
|
|
|
521
|
-
var __rest$
|
|
526
|
+
var __rest$2V = (undefined && undefined.__rest) || function (s, e) {
|
|
522
527
|
var t = {};
|
|
523
528
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
524
529
|
t[p] = s[p];
|
|
@@ -531,7 +536,7 @@ var __rest$2U = (undefined && undefined.__rest) || function (s, e) {
|
|
|
531
536
|
};
|
|
532
537
|
function useStyleProps(props, additionalUtilities) {
|
|
533
538
|
const classNamePrefix = React.useContext(ClassNamePrefixContext);
|
|
534
|
-
const { UNSAFE_className, UNSAFE_style } = props, otherProps = __rest$
|
|
539
|
+
const { UNSAFE_className, UNSAFE_style } = props, otherProps = __rest$2V(props, ["UNSAFE_className", "UNSAFE_style"]);
|
|
535
540
|
const styleUtilitiesConfig = Object.assign({ theme: ThemeStyleProps.theme }, (additionalUtilities !== null && additionalUtilities !== void 0 ? additionalUtilities : {}));
|
|
536
541
|
const { styleUtilities, props: modifiedProps } = useStyleUtilities(otherProps, classNamePrefix, styleUtilitiesConfig);
|
|
537
542
|
const style = Object.assign({}, UNSAFE_style);
|
|
@@ -657,11 +662,11 @@ const useClickOutside = ({ ref, callback }) => {
|
|
|
657
662
|
};
|
|
658
663
|
|
|
659
664
|
const useDeprecationMessage = ({ method = 'component', trigger, componentName, componentProps, propertyProps, customText, }) => {
|
|
660
|
-
let message;
|
|
661
|
-
let hasProps;
|
|
662
665
|
const messageBase = `Deprecation warning (${componentName}):`;
|
|
663
666
|
React.useEffect(() => {
|
|
664
667
|
const isExecutable = trigger && componentName && process.env.NODE_ENV === 'development';
|
|
668
|
+
let message;
|
|
669
|
+
let hasProps;
|
|
665
670
|
switch (method) {
|
|
666
671
|
case 'property':
|
|
667
672
|
if (propertyProps === null || propertyProps === void 0 ? void 0 : propertyProps.delete) {
|
|
@@ -766,6 +771,13 @@ function useIconName(key, iconMap, defaultKey = 'default') {
|
|
|
766
771
|
return key && iconMap[key] ? iconMap[key] : iconMap[defaultKey];
|
|
767
772
|
}
|
|
768
773
|
|
|
774
|
+
function useInputPositionClass(componentClass, property) {
|
|
775
|
+
if (!property) {
|
|
776
|
+
return '';
|
|
777
|
+
}
|
|
778
|
+
return generateStylePropsClassNames(componentClass, property, 'inputPosition');
|
|
779
|
+
}
|
|
780
|
+
|
|
769
781
|
const useLastActiveFocus = (isOpen) => {
|
|
770
782
|
const lastActiveElement = React.useRef(null);
|
|
771
783
|
React.useEffect(() => {
|
|
@@ -895,6 +907,43 @@ function useSpacingStyle(spacing, prefix, direction = undefined) {
|
|
|
895
907
|
return style;
|
|
896
908
|
}
|
|
897
909
|
|
|
910
|
+
const SYMMETRICAL_CLASS_SUFFIX = '--symmetrical';
|
|
911
|
+
const NON_SYMMETRICAL_CLASS_SUFFIX = '--asymmetrical';
|
|
912
|
+
function getSymmetryClassNamesReducer(componentClass, isSymmetrical) {
|
|
913
|
+
return (acc, breakpoint) => {
|
|
914
|
+
if (breakpoint in isSymmetrical) {
|
|
915
|
+
const value = isSymmetrical[breakpoint];
|
|
916
|
+
const infix = breakpoint === BREAKPOINT_MOBILE ? '' : `--${breakpoint}`;
|
|
917
|
+
if (value) {
|
|
918
|
+
return {
|
|
919
|
+
classes: [...acc.classes, `${componentClass}${infix}${SYMMETRICAL_CLASS_SUFFIX}`],
|
|
920
|
+
wasSymmetrical: true,
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
if (acc.wasSymmetrical) {
|
|
924
|
+
return {
|
|
925
|
+
classes: [...acc.classes, `${componentClass}${infix}${NON_SYMMETRICAL_CLASS_SUFFIX}`],
|
|
926
|
+
wasSymmetrical: acc.wasSymmetrical,
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
return acc;
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
function useSymmetry(componentClass, isSymmetrical) {
|
|
934
|
+
if (typeof isSymmetrical !== 'object' || isSymmetrical === null) {
|
|
935
|
+
return {
|
|
936
|
+
isSymmetricalActive: isSymmetrical === true,
|
|
937
|
+
symmetricalClassName: isSymmetrical ? `${componentClass}${SYMMETRICAL_CLASS_SUFFIX}` : '',
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
const { classes } = Object.keys(spiritDesignTokens.breakpoints).reduce(getSymmetryClassNamesReducer(componentClass, isSymmetrical), { classes: [], wasSymmetrical: false });
|
|
941
|
+
return {
|
|
942
|
+
isSymmetricalActive: Object.values(isSymmetrical).includes(true),
|
|
943
|
+
symmetricalClassName: classes.join(' '),
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
|
|
898
947
|
const useToggle = (initialState = false) => {
|
|
899
948
|
const [state, setState] = React.useState(initialState);
|
|
900
949
|
const toggle = React.useCallback(() => setState((prevState) => !prevState), []);
|
|
@@ -960,7 +1009,7 @@ const useOpenItem = (id) => {
|
|
|
960
1009
|
};
|
|
961
1010
|
};
|
|
962
1011
|
|
|
963
|
-
var __rest$
|
|
1012
|
+
var __rest$2U = (undefined && undefined.__rest) || function (s, e) {
|
|
964
1013
|
var t = {};
|
|
965
1014
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
966
1015
|
t[p] = s[p];
|
|
@@ -972,7 +1021,7 @@ var __rest$2T = (undefined && undefined.__rest) || function (s, e) {
|
|
|
972
1021
|
return t;
|
|
973
1022
|
};
|
|
974
1023
|
const Accordion = (props) => {
|
|
975
|
-
const { children, elementType: ElementTag = 'section', open, toggle } = props, restProps = __rest$
|
|
1024
|
+
const { children, elementType: ElementTag = 'section', open, toggle } = props, restProps = __rest$2U(props, ["children", "elementType", "open", "toggle"]);
|
|
976
1025
|
const { classProps } = useAccordionStyleProps();
|
|
977
1026
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
978
1027
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.root, styleProps });
|
|
@@ -984,6 +1033,8 @@ const Accordion = (props) => {
|
|
|
984
1033
|
React.createElement(AccordionProvider, { value: contextValue }, children)));
|
|
985
1034
|
};
|
|
986
1035
|
Accordion.spiritComponent = 'Accordion';
|
|
1036
|
+
Accordion.spiritDefaultElement = 'section';
|
|
1037
|
+
Accordion.spiritDefaultProps = null;
|
|
987
1038
|
|
|
988
1039
|
const defaultContext$8 = {
|
|
989
1040
|
id: '',
|
|
@@ -993,7 +1044,7 @@ const AccordionItemProvider = AccordionItemContext.Provider;
|
|
|
993
1044
|
AccordionItemContext.Consumer;
|
|
994
1045
|
const useAccordionItemContext = () => React.useContext(AccordionItemContext);
|
|
995
1046
|
|
|
996
|
-
var __rest$
|
|
1047
|
+
var __rest$2T = (undefined && undefined.__rest) || function (s, e) {
|
|
997
1048
|
var t = {};
|
|
998
1049
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
999
1050
|
t[p] = s[p];
|
|
@@ -1005,7 +1056,7 @@ var __rest$2S = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1005
1056
|
return t;
|
|
1006
1057
|
};
|
|
1007
1058
|
const AccordionItem = (props) => {
|
|
1008
|
-
const { children, elementType: ElementTag = 'article', id } = props, restProps = __rest$
|
|
1059
|
+
const { children, elementType: ElementTag = 'article', id } = props, restProps = __rest$2T(props, ["children", "elementType", "id"]);
|
|
1009
1060
|
const { classProps } = useAccordionStyleProps();
|
|
1010
1061
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
1011
1062
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.item, styleProps });
|
|
@@ -1014,12 +1065,14 @@ const AccordionItem = (props) => {
|
|
|
1014
1065
|
React.createElement(AccordionItemProvider, { value: contextValue }, children)));
|
|
1015
1066
|
};
|
|
1016
1067
|
AccordionItem.spiritComponent = 'AccordionItem';
|
|
1068
|
+
AccordionItem.spiritDefaultElement = 'article';
|
|
1069
|
+
AccordionItem.spiritDefaultProps = null;
|
|
1017
1070
|
|
|
1018
1071
|
const DEFAULT_BOX_SIZE = 24;
|
|
1019
1072
|
|
|
1020
1073
|
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); };
|
|
1021
1074
|
|
|
1022
|
-
var __rest$
|
|
1075
|
+
var __rest$2S = (undefined && undefined.__rest) || function (s, e) {
|
|
1023
1076
|
var t = {};
|
|
1024
1077
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1025
1078
|
t[p] = s[p];
|
|
@@ -1041,7 +1094,7 @@ const setCustomDimension$1 = (prefix, size) => {
|
|
|
1041
1094
|
return style;
|
|
1042
1095
|
};
|
|
1043
1096
|
const useIconStyleProps = (props) => {
|
|
1044
|
-
const { boxSize, color, name } = props, otherProps = __rest$
|
|
1097
|
+
const { boxSize, color, name } = props, otherProps = __rest$2S(props, ["boxSize", "color", "name"]);
|
|
1045
1098
|
const stylePrefix = `--${spiritDesignTokens.cssVariablePrefix}icon`;
|
|
1046
1099
|
const isDualtoneIcon = String(name).includes('-dualtone');
|
|
1047
1100
|
const dualtoneColorWithDefault = isDualtoneIcon && !color ? TextColors.PRIMARY : color;
|
|
@@ -1058,7 +1111,7 @@ const useIconStyleProps = (props) => {
|
|
|
1058
1111
|
};
|
|
1059
1112
|
};
|
|
1060
1113
|
|
|
1061
|
-
var __rest$
|
|
1114
|
+
var __rest$2R = (undefined && undefined.__rest) || function (s, e) {
|
|
1062
1115
|
var t = {};
|
|
1063
1116
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1064
1117
|
t[p] = s[p];
|
|
@@ -1069,13 +1122,13 @@ var __rest$2Q = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1069
1122
|
}
|
|
1070
1123
|
return t;
|
|
1071
1124
|
};
|
|
1072
|
-
const defaultProps$
|
|
1125
|
+
const defaultProps$10 = {
|
|
1073
1126
|
ariaHidden: true,
|
|
1074
1127
|
boxSize: DEFAULT_BOX_SIZE,
|
|
1075
1128
|
};
|
|
1076
1129
|
const _Icon = (props, ref) => {
|
|
1077
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1078
|
-
const { boxSize, name, title, ariaHidden } = propsWithDefaults, restProps = __rest$
|
|
1130
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$10), props);
|
|
1131
|
+
const { boxSize, name, title, ariaHidden } = propsWithDefaults, restProps = __rest$2R(propsWithDefaults, ["boxSize", "name", "title", "ariaHidden"]);
|
|
1079
1132
|
let icon = useIcon(name);
|
|
1080
1133
|
const iconSize = useIconBoxSize(boxSize);
|
|
1081
1134
|
const { classProps, iconStyleProps, props: modifiedProps } = useIconStyleProps(Object.assign({ boxSize, name }, restProps));
|
|
@@ -1093,7 +1146,7 @@ const _Icon = (props, ref) => {
|
|
|
1093
1146
|
const Icon = React.forwardRef(_Icon);
|
|
1094
1147
|
Icon.spiritComponent = 'Icon';
|
|
1095
1148
|
|
|
1096
|
-
var __rest$
|
|
1149
|
+
var __rest$2Q = (undefined && undefined.__rest) || function (s, e) {
|
|
1097
1150
|
var t = {};
|
|
1098
1151
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1099
1152
|
t[p] = s[p];
|
|
@@ -1104,20 +1157,28 @@ var __rest$2P = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1104
1157
|
}
|
|
1105
1158
|
return t;
|
|
1106
1159
|
};
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1160
|
+
const defaultProps$$ = {
|
|
1161
|
+
elementType: 'h3',
|
|
1162
|
+
};
|
|
1163
|
+
const AccordionHeader = (props) => {
|
|
1164
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$$), props);
|
|
1165
|
+
const { elementType: ElementTag = 'h3', children, slot } = propsWithDefaults, restProps = __rest$2Q(propsWithDefaults, ["elementType", "children", "slot"]);
|
|
1109
1166
|
const { classProps } = useAccordionStyleProps();
|
|
1110
1167
|
const { toggle } = useAccordionContext();
|
|
1111
1168
|
const { id } = useAccordionItemContext();
|
|
1112
1169
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
1113
1170
|
const { isOpen } = useOpenItem(id);
|
|
1114
1171
|
const { triggerProps, headerProps } = useAccordionAriaProps({ id, isOpen });
|
|
1172
|
+
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
1173
|
+
classProps: classProps.header,
|
|
1174
|
+
styleProps,
|
|
1175
|
+
});
|
|
1115
1176
|
const itemToggle = () => {
|
|
1116
1177
|
if (toggle && id) {
|
|
1117
1178
|
toggle(id);
|
|
1118
1179
|
}
|
|
1119
1180
|
};
|
|
1120
|
-
return (React.createElement(
|
|
1181
|
+
return (React.createElement(ElementTag, Object.assign({}, transferProps, mergedStyleProps, headerProps),
|
|
1121
1182
|
React.createElement("button", Object.assign({ type: "button", className: classProps.toggle, onClick: itemToggle }, triggerProps), children),
|
|
1122
1183
|
React.createElement("span", { className: classProps.side },
|
|
1123
1184
|
slot && React.createElement("span", { className: classProps.slot }, slot),
|
|
@@ -1125,8 +1186,10 @@ const AccordionHeader = (_a) => {
|
|
|
1125
1186
|
React.createElement(Icon, { name: "chevron-down" })))));
|
|
1126
1187
|
};
|
|
1127
1188
|
AccordionHeader.spiritComponent = 'AccordionHeader';
|
|
1189
|
+
AccordionHeader.spiritDefaultElement = 'h3';
|
|
1190
|
+
AccordionHeader.spiritDefaultProps = null;
|
|
1128
1191
|
|
|
1129
|
-
var __rest$
|
|
1192
|
+
var __rest$2P = (undefined && undefined.__rest) || function (s, e) {
|
|
1130
1193
|
var t = {};
|
|
1131
1194
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1132
1195
|
t[p] = s[p];
|
|
@@ -1141,7 +1204,7 @@ const ATTRIBUTE_ARIA_EXPANDED = 'aria-expanded';
|
|
|
1141
1204
|
const ATTRIBUTE_ARIA_CONTROLS = 'aria-controls';
|
|
1142
1205
|
const ATTRIBUTE_DATA_BREAKPOINT = 'data-spirit-breakpoint';
|
|
1143
1206
|
const useCollapseAriaProps = (props) => {
|
|
1144
|
-
const { isOpen, collapsibleToBreakpoint } = props, modifiedProps = __rest$
|
|
1207
|
+
const { isOpen, collapsibleToBreakpoint } = props, modifiedProps = __rest$2P(props, ["isOpen", "collapsibleToBreakpoint"]);
|
|
1145
1208
|
useDeprecationMessage({
|
|
1146
1209
|
method: 'custom',
|
|
1147
1210
|
trigger: !modifiedProps.id,
|
|
@@ -1188,7 +1251,7 @@ const useResizeHeight = (ref) => {
|
|
|
1188
1251
|
return height;
|
|
1189
1252
|
};
|
|
1190
1253
|
|
|
1191
|
-
var __rest$
|
|
1254
|
+
var __rest$2O = (undefined && undefined.__rest) || function (s, e) {
|
|
1192
1255
|
var t = {};
|
|
1193
1256
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1194
1257
|
t[p] = s[p];
|
|
@@ -1206,15 +1269,15 @@ const transitioningStyles = {
|
|
|
1206
1269
|
exiting: 'is-transitioning',
|
|
1207
1270
|
exited: '',
|
|
1208
1271
|
};
|
|
1209
|
-
const defaultProps$
|
|
1272
|
+
const defaultProps$_ = {
|
|
1210
1273
|
elementType: 'div',
|
|
1211
1274
|
isOpen: false,
|
|
1212
1275
|
collapsibleToBreakpoint: undefined,
|
|
1213
1276
|
transitionDuration: TRANSITION_DURATION$1,
|
|
1214
1277
|
};
|
|
1215
1278
|
const Collapse = (props) => {
|
|
1216
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1217
|
-
const { elementType: ElementTag = defaultProps$
|
|
1279
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$_), props);
|
|
1280
|
+
const { elementType: ElementTag = defaultProps$_.elementType, children, transitionDuration = TRANSITION_DURATION$1 } = propsWithDefaults, restProps = __rest$2O(propsWithDefaults, ["elementType", "children", "transitionDuration"]);
|
|
1218
1281
|
const rootElementRef = React.useRef(null);
|
|
1219
1282
|
const collapseElementRef = React.useRef(null);
|
|
1220
1283
|
const collapseHeight = useResizeHeight(collapseElementRef);
|
|
@@ -1252,7 +1315,7 @@ const useCollapse = (defaultOpenState) => {
|
|
|
1252
1315
|
};
|
|
1253
1316
|
};
|
|
1254
1317
|
|
|
1255
|
-
var __rest$
|
|
1318
|
+
var __rest$2N = (undefined && undefined.__rest) || function (s, e) {
|
|
1256
1319
|
var t = {};
|
|
1257
1320
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1258
1321
|
t[p] = s[p];
|
|
@@ -1263,12 +1326,12 @@ var __rest$2M = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1263
1326
|
}
|
|
1264
1327
|
return t;
|
|
1265
1328
|
};
|
|
1266
|
-
const defaultProps$
|
|
1329
|
+
const defaultProps$Z = {
|
|
1267
1330
|
isOpen: false,
|
|
1268
1331
|
};
|
|
1269
1332
|
const UncontrolledCollapse = (props) => {
|
|
1270
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1271
|
-
const { children, hideOnCollapse, isDisposable, renderTrigger } = propsWithDefaults, restProps = __rest$
|
|
1333
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$Z), props);
|
|
1334
|
+
const { children, hideOnCollapse, isDisposable, renderTrigger } = propsWithDefaults, restProps = __rest$2N(propsWithDefaults, ["children", "hideOnCollapse", "isDisposable", "renderTrigger"]);
|
|
1272
1335
|
const { isOpen, toggleHandler } = useCollapse(restProps.isOpen);
|
|
1273
1336
|
const { ariaProps } = useCollapseAriaProps(Object.assign(Object.assign({}, restProps), { isOpen }));
|
|
1274
1337
|
const isDisposed = hideOnCollapse || isDisposable;
|
|
@@ -1284,7 +1347,7 @@ const UncontrolledCollapse = (props) => {
|
|
|
1284
1347
|
};
|
|
1285
1348
|
UncontrolledCollapse.spiritComponent = 'UncontrolledCollapse';
|
|
1286
1349
|
|
|
1287
|
-
var __rest$
|
|
1350
|
+
var __rest$2M = (undefined && undefined.__rest) || function (s, e) {
|
|
1288
1351
|
var t = {};
|
|
1289
1352
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1290
1353
|
t[p] = s[p];
|
|
@@ -1296,7 +1359,7 @@ var __rest$2L = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1296
1359
|
return t;
|
|
1297
1360
|
};
|
|
1298
1361
|
const AccordionContent = (_a) => {
|
|
1299
|
-
var { children } = _a, restProps = __rest$
|
|
1362
|
+
var { children } = _a, restProps = __rest$2M(_a, ["children"]);
|
|
1300
1363
|
const { classProps } = useAccordionStyleProps();
|
|
1301
1364
|
const { id } = useAccordionItemContext();
|
|
1302
1365
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
@@ -1307,7 +1370,7 @@ const AccordionContent = (_a) => {
|
|
|
1307
1370
|
};
|
|
1308
1371
|
AccordionContent.spiritComponent = 'AccordionContent';
|
|
1309
1372
|
|
|
1310
|
-
var __rest$
|
|
1373
|
+
var __rest$2L = (undefined && undefined.__rest) || function (s, e) {
|
|
1311
1374
|
var t = {};
|
|
1312
1375
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1313
1376
|
t[p] = s[p];
|
|
@@ -1319,13 +1382,15 @@ var __rest$2K = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1319
1382
|
return t;
|
|
1320
1383
|
};
|
|
1321
1384
|
const UncontrolledAccordion = (props) => {
|
|
1322
|
-
const { defaultOpen, stayOpen } = props, restProps = __rest$
|
|
1385
|
+
const { defaultOpen, stayOpen } = props, restProps = __rest$2L(props, ["defaultOpen", "stayOpen"]);
|
|
1323
1386
|
const { open, toggle } = useAccordion({ defaultOpen, stayOpen });
|
|
1324
|
-
return React.createElement(Accordion, Object.assign({ open: open, toggle: toggle }
|
|
1387
|
+
return React.createElement(Accordion, Object.assign({}, restProps, { open: open, toggle: toggle }));
|
|
1325
1388
|
};
|
|
1326
1389
|
UncontrolledAccordion.spiritComponent = 'UncontrolledAccordion';
|
|
1390
|
+
UncontrolledAccordion.spiritDefaultElement = 'section';
|
|
1391
|
+
UncontrolledAccordion.spiritDefaultProps = null;
|
|
1327
1392
|
|
|
1328
|
-
var __rest$
|
|
1393
|
+
var __rest$2K = (undefined && undefined.__rest) || function (s, e) {
|
|
1329
1394
|
var t = {};
|
|
1330
1395
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1331
1396
|
t[p] = s[p];
|
|
@@ -1337,7 +1402,7 @@ var __rest$2J = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1337
1402
|
return t;
|
|
1338
1403
|
};
|
|
1339
1404
|
function useFlexStyleProps(props) {
|
|
1340
|
-
const { alignmentX, alignmentY, direction, spacing, spacingX, spacingY, isWrapping } = props, restProps = __rest$
|
|
1405
|
+
const { alignmentX, alignmentY, direction, spacing, spacingX, spacingY, isWrapping } = props, restProps = __rest$2K(props, ["alignmentX", "alignmentY", "direction", "spacing", "spacingX", "spacingY", "isWrapping"]);
|
|
1341
1406
|
useDeprecationMessage({
|
|
1342
1407
|
method: 'custom',
|
|
1343
1408
|
trigger: direction === 'row' || direction === 'column',
|
|
@@ -1359,7 +1424,7 @@ function useFlexStyleProps(props) {
|
|
|
1359
1424
|
};
|
|
1360
1425
|
}
|
|
1361
1426
|
|
|
1362
|
-
var __rest$
|
|
1427
|
+
var __rest$2J = (undefined && undefined.__rest) || function (s, e) {
|
|
1363
1428
|
var t = {};
|
|
1364
1429
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1365
1430
|
t[p] = s[p];
|
|
@@ -1370,7 +1435,7 @@ var __rest$2I = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1370
1435
|
}
|
|
1371
1436
|
return t;
|
|
1372
1437
|
};
|
|
1373
|
-
const defaultProps$
|
|
1438
|
+
const defaultProps$Y = {
|
|
1374
1439
|
alignmentX: AlignmentXExtended.STRETCH,
|
|
1375
1440
|
alignmentY: AlignmentYExtended.STRETCH,
|
|
1376
1441
|
direction: DirectionExtended.HORIZONTAL,
|
|
@@ -1378,16 +1443,18 @@ const defaultProps$X = {
|
|
|
1378
1443
|
isWrapping: false,
|
|
1379
1444
|
};
|
|
1380
1445
|
const Flex = (props) => {
|
|
1381
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1382
|
-
const { elementType: ElementTag = 'div', direction, children } = propsWithDefaults, restProps = __rest$
|
|
1446
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$Y), props);
|
|
1447
|
+
const { elementType: ElementTag = 'div', direction, children } = propsWithDefaults, restProps = __rest$2J(propsWithDefaults, ["elementType", "direction", "children"]);
|
|
1383
1448
|
const { classProps, props: modifiedProps, styleProps: flexStyle } = useFlexStyleProps(Object.assign({ direction }, restProps));
|
|
1384
1449
|
const { styleProps, props: otherProps } = useStyleProps(Object.assign({}, modifiedProps));
|
|
1385
1450
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, flexStyle, styleProps, otherProps });
|
|
1386
1451
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
1387
1452
|
};
|
|
1388
1453
|
Flex.spiritComponent = 'Flex';
|
|
1454
|
+
Flex.spiritDefaultElement = 'div';
|
|
1455
|
+
Flex.spiritDefaultProps = null;
|
|
1389
1456
|
|
|
1390
|
-
var __rest$
|
|
1457
|
+
var __rest$2I = (undefined && undefined.__rest) || function (s, e) {
|
|
1391
1458
|
var t = {};
|
|
1392
1459
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1393
1460
|
t[p] = s[p];
|
|
@@ -1398,7 +1465,7 @@ var __rest$2H = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1398
1465
|
}
|
|
1399
1466
|
return t;
|
|
1400
1467
|
};
|
|
1401
|
-
const defaultProps$
|
|
1468
|
+
const defaultProps$X = {
|
|
1402
1469
|
alignmentX: {
|
|
1403
1470
|
mobile: AlignmentXExtended.STRETCH,
|
|
1404
1471
|
tablet: AlignmentXExtended.LEFT,
|
|
@@ -1409,13 +1476,13 @@ const defaultProps$W = {
|
|
|
1409
1476
|
},
|
|
1410
1477
|
};
|
|
1411
1478
|
const ActionGroup = (props) => {
|
|
1412
|
-
const { children } = props, restProps = __rest$
|
|
1413
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1479
|
+
const { children } = props, restProps = __rest$2I(props, ["children"]);
|
|
1480
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$X), restProps);
|
|
1414
1481
|
return React.createElement(Flex, Object.assign({}, propsWithDefaults), children);
|
|
1415
1482
|
};
|
|
1416
1483
|
ActionGroup.spiritComponent = 'ActionGroup';
|
|
1417
1484
|
|
|
1418
|
-
var __rest$
|
|
1485
|
+
var __rest$2H = (undefined && undefined.__rest) || function (s, e) {
|
|
1419
1486
|
var t = {};
|
|
1420
1487
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1421
1488
|
t[p] = s[p];
|
|
@@ -1427,7 +1494,7 @@ var __rest$2G = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1427
1494
|
return t;
|
|
1428
1495
|
};
|
|
1429
1496
|
function useAlertStyleProps(props) {
|
|
1430
|
-
const { color, isCentered } = props, modifiedProps = __rest$
|
|
1497
|
+
const { color, isCentered } = props, modifiedProps = __rest$2H(props, ["color", "isCentered"]);
|
|
1431
1498
|
const alertClass = useClassNamePrefix('Alert');
|
|
1432
1499
|
const alertColorClass = `${alertClass}--${color}`;
|
|
1433
1500
|
const alertCenteredClass = `${alertClass}--center`;
|
|
@@ -1452,7 +1519,7 @@ function useAlertIcon({ color, iconName }) {
|
|
|
1452
1519
|
return iconName || iconNameValue;
|
|
1453
1520
|
}
|
|
1454
1521
|
|
|
1455
|
-
var __rest$
|
|
1522
|
+
var __rest$2G = (undefined && undefined.__rest) || function (s, e) {
|
|
1456
1523
|
var t = {};
|
|
1457
1524
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1458
1525
|
t[p] = s[p];
|
|
@@ -1463,13 +1530,13 @@ var __rest$2F = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1463
1530
|
}
|
|
1464
1531
|
return t;
|
|
1465
1532
|
};
|
|
1466
|
-
const defaultProps$
|
|
1533
|
+
const defaultProps$W = {
|
|
1467
1534
|
color: 'success',
|
|
1468
1535
|
isCentered: false,
|
|
1469
1536
|
};
|
|
1470
1537
|
const Alert = (props) => {
|
|
1471
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1472
|
-
const { elementType: ElementTag = 'div', children, color, iconName } = propsWithDefaults, restProps = __rest$
|
|
1538
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$W), props);
|
|
1539
|
+
const { elementType: ElementTag = 'div', children, color, iconName } = propsWithDefaults, restProps = __rest$2G(propsWithDefaults, ["elementType", "children", "color", "iconName"]);
|
|
1473
1540
|
const { classProps, props: modifiedProps } = useAlertStyleProps(Object.assign({ color }, restProps));
|
|
1474
1541
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
1475
1542
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps });
|
|
@@ -1480,7 +1547,7 @@ const Alert = (props) => {
|
|
|
1480
1547
|
};
|
|
1481
1548
|
Alert.spiritComponent = 'Alert';
|
|
1482
1549
|
|
|
1483
|
-
var __rest$
|
|
1550
|
+
var __rest$2F = (undefined && undefined.__rest) || function (s, e) {
|
|
1484
1551
|
var t = {};
|
|
1485
1552
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1486
1553
|
t[p] = s[p];
|
|
@@ -1493,7 +1560,7 @@ var __rest$2E = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1493
1560
|
};
|
|
1494
1561
|
const getAvatarSizeClassname = (className, size) => compose(applySize(size))(className);
|
|
1495
1562
|
function useAvatarStyleProps(props) {
|
|
1496
|
-
const { isSquare, size } = props, restProps = __rest$
|
|
1563
|
+
const { isSquare, size } = props, restProps = __rest$2F(props, ["isSquare", "size"]);
|
|
1497
1564
|
const avatarClass = useClassNamePrefix('Avatar');
|
|
1498
1565
|
const avatarSquareClass = `${avatarClass}--square`;
|
|
1499
1566
|
const classProps = classNames(avatarClass, getAvatarSizeClassname(avatarClass, size), {
|
|
@@ -1505,7 +1572,7 @@ function useAvatarStyleProps(props) {
|
|
|
1505
1572
|
};
|
|
1506
1573
|
}
|
|
1507
1574
|
|
|
1508
|
-
var __rest$
|
|
1575
|
+
var __rest$2E = (undefined && undefined.__rest) || function (s, e) {
|
|
1509
1576
|
var t = {};
|
|
1510
1577
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1511
1578
|
t[p] = s[p];
|
|
@@ -1516,14 +1583,14 @@ var __rest$2D = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1516
1583
|
}
|
|
1517
1584
|
return t;
|
|
1518
1585
|
};
|
|
1519
|
-
const defaultProps$
|
|
1586
|
+
const defaultProps$V = {
|
|
1520
1587
|
elementType: 'div',
|
|
1521
1588
|
isSquare: false,
|
|
1522
1589
|
size: SizesExtended.MEDIUM,
|
|
1523
1590
|
};
|
|
1524
1591
|
const _Avatar = (props, ref) => {
|
|
1525
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1526
|
-
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$
|
|
1592
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$V), props);
|
|
1593
|
+
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$2E(propsWithDefaults, ["elementType", "children"]);
|
|
1527
1594
|
const { classProps, props: modifiedProps } = useAvatarStyleProps(restProps);
|
|
1528
1595
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
1529
1596
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps });
|
|
@@ -1534,7 +1601,7 @@ _Avatar.spiritDefaultElement = 'div';
|
|
|
1534
1601
|
_Avatar.spiritDefaultProps = null;
|
|
1535
1602
|
const Avatar = React.forwardRef(_Avatar);
|
|
1536
1603
|
|
|
1537
|
-
var __rest$
|
|
1604
|
+
var __rest$2D = (undefined && undefined.__rest) || function (s, e) {
|
|
1538
1605
|
var t = {};
|
|
1539
1606
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1540
1607
|
t[p] = s[p];
|
|
@@ -1546,7 +1613,7 @@ var __rest$2C = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1546
1613
|
return t;
|
|
1547
1614
|
};
|
|
1548
1615
|
const useBoxStyleProps = (props) => {
|
|
1549
|
-
const _a = props || {}, { backgroundColor, borderColor, borderStyle, borderWidth, textColor } = _a, restProps = __rest$
|
|
1616
|
+
const _a = props || {}, { backgroundColor, borderColor, borderStyle, borderWidth, textColor } = _a, restProps = __rest$2D(_a, ["backgroundColor", "borderColor", "borderStyle", "borderWidth", "textColor"]);
|
|
1550
1617
|
const boxBackgroundClassName = useClassNamePrefix(`bg-${backgroundColor}`);
|
|
1551
1618
|
const boxBorderClassName = useClassNamePrefix('border-');
|
|
1552
1619
|
const boxBackgroundColor = backgroundColor ? boxBackgroundClassName : '';
|
|
@@ -1569,7 +1636,7 @@ const useBoxStyleProps = (props) => {
|
|
|
1569
1636
|
};
|
|
1570
1637
|
};
|
|
1571
1638
|
|
|
1572
|
-
var __rest$
|
|
1639
|
+
var __rest$2C = (undefined && undefined.__rest) || function (s, e) {
|
|
1573
1640
|
var t = {};
|
|
1574
1641
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1575
1642
|
t[p] = s[p];
|
|
@@ -1580,13 +1647,13 @@ var __rest$2B = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1580
1647
|
}
|
|
1581
1648
|
return t;
|
|
1582
1649
|
};
|
|
1583
|
-
const defaultProps$
|
|
1650
|
+
const defaultProps$U = {
|
|
1584
1651
|
elementType: 'div',
|
|
1585
1652
|
borderStyle: BorderStyles.SOLID,
|
|
1586
1653
|
};
|
|
1587
1654
|
const Box = (props) => {
|
|
1588
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1589
|
-
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$
|
|
1655
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$U), props);
|
|
1656
|
+
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$2C(propsWithDefaults, ["elementType", "children"]);
|
|
1590
1657
|
const { classProps, props: modifiedProps } = useBoxStyleProps(restProps);
|
|
1591
1658
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps, Object.assign(Object.assign(Object.assign({}, BackgroundStyleProps), BorderRadiusStyleProps), PaddingStyleProps));
|
|
1592
1659
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps });
|
|
@@ -1596,7 +1663,7 @@ Box.spiritComponent = 'Box';
|
|
|
1596
1663
|
Box.spiritDefaultElement = 'div';
|
|
1597
1664
|
Box.spiritDefaultProps = null;
|
|
1598
1665
|
|
|
1599
|
-
var __rest$
|
|
1666
|
+
var __rest$2B = (undefined && undefined.__rest) || function (s, e) {
|
|
1600
1667
|
var t = {};
|
|
1601
1668
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1602
1669
|
t[p] = s[p];
|
|
@@ -1608,7 +1675,7 @@ var __rest$2A = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1608
1675
|
return t;
|
|
1609
1676
|
};
|
|
1610
1677
|
function useLinkStyleProps(props) {
|
|
1611
|
-
const { color, hasVisitedStyleAllowed, isDisabled, underlined } = props, restProps = __rest$
|
|
1678
|
+
const { color, hasVisitedStyleAllowed, isDisabled, underlined } = props, restProps = __rest$2B(props, ["color", "hasVisitedStyleAllowed", "isDisabled", "underlined"]);
|
|
1612
1679
|
const linkClass = useClassNamePrefix('link');
|
|
1613
1680
|
const linkColorClass = `${linkClass}-${color}`;
|
|
1614
1681
|
const linkDisabledClass = `${linkClass}-disabled`;
|
|
@@ -1627,7 +1694,7 @@ function useLinkStyleProps(props) {
|
|
|
1627
1694
|
};
|
|
1628
1695
|
}
|
|
1629
1696
|
|
|
1630
|
-
var __rest$
|
|
1697
|
+
var __rest$2A = (undefined && undefined.__rest) || function (s, e) {
|
|
1631
1698
|
var t = {};
|
|
1632
1699
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1633
1700
|
t[p] = s[p];
|
|
@@ -1638,15 +1705,15 @@ var __rest$2z = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1638
1705
|
}
|
|
1639
1706
|
return t;
|
|
1640
1707
|
};
|
|
1641
|
-
const defaultProps$
|
|
1708
|
+
const defaultProps$T = {
|
|
1642
1709
|
elementType: 'a',
|
|
1643
1710
|
color: 'primary',
|
|
1644
1711
|
hasVisitedStyleAllowed: false,
|
|
1645
1712
|
underlined: 'hover',
|
|
1646
1713
|
};
|
|
1647
1714
|
const _Link = (props, ref) => {
|
|
1648
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1649
|
-
const { elementType: ElementTag = defaultProps$
|
|
1715
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$T), props);
|
|
1716
|
+
const { elementType: ElementTag = defaultProps$T.elementType, children } = propsWithDefaults, restProps = __rest$2A(propsWithDefaults, ["elementType", "children"]);
|
|
1650
1717
|
const { classProps, props: modifiedProps } = useLinkStyleProps(restProps);
|
|
1651
1718
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
1652
1719
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps });
|
|
@@ -1655,7 +1722,7 @@ const _Link = (props, ref) => {
|
|
|
1655
1722
|
const Link = React.forwardRef(_Link);
|
|
1656
1723
|
Link.spiritComponent = 'Link';
|
|
1657
1724
|
|
|
1658
|
-
var __rest$
|
|
1725
|
+
var __rest$2z = (undefined && undefined.__rest) || function (s, e) {
|
|
1659
1726
|
var t = {};
|
|
1660
1727
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1661
1728
|
t[p] = s[p];
|
|
@@ -1667,7 +1734,7 @@ var __rest$2y = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1667
1734
|
return t;
|
|
1668
1735
|
};
|
|
1669
1736
|
function useBreadcrumbsStyleProps(props) {
|
|
1670
|
-
const { isGoBackOnly } = props, restProps = __rest$
|
|
1737
|
+
const { isGoBackOnly } = props, restProps = __rest$2z(props, ["isGoBackOnly"]);
|
|
1671
1738
|
const breadcrumbsClass = useClassNamePrefix('Breadcrumbs');
|
|
1672
1739
|
const displayNoneClassName = useClassNamePrefix('d-none');
|
|
1673
1740
|
const displayTabletFlexClassName = useClassNamePrefix('d-tablet-flex');
|
|
@@ -1685,7 +1752,7 @@ function useBreadcrumbsStyleProps(props) {
|
|
|
1685
1752
|
};
|
|
1686
1753
|
}
|
|
1687
1754
|
|
|
1688
|
-
var __rest$
|
|
1755
|
+
var __rest$2y = (undefined && undefined.__rest) || function (s, e) {
|
|
1689
1756
|
var t = {};
|
|
1690
1757
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1691
1758
|
t[p] = s[p];
|
|
@@ -1696,15 +1763,15 @@ var __rest$2x = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1696
1763
|
}
|
|
1697
1764
|
return t;
|
|
1698
1765
|
};
|
|
1699
|
-
const defaultProps$
|
|
1766
|
+
const defaultProps$S = {
|
|
1700
1767
|
iconNameEnd: 'chevron-right',
|
|
1701
1768
|
iconNameStart: 'chevron-left',
|
|
1702
1769
|
isCurrent: false,
|
|
1703
1770
|
isGoBackOnly: false,
|
|
1704
1771
|
};
|
|
1705
1772
|
const BreadcrumbsItem = (props) => {
|
|
1706
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1707
|
-
const { children, href, isCurrent, iconNameStart, iconNameEnd } = propsWithDefaults, restProps = __rest$
|
|
1773
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$S), props);
|
|
1774
|
+
const { children, href, isCurrent, iconNameStart, iconNameEnd } = propsWithDefaults, restProps = __rest$2y(propsWithDefaults, ["children", "href", "isCurrent", "iconNameStart", "iconNameEnd"]);
|
|
1708
1775
|
const { classProps, props: otherProps } = useBreadcrumbsStyleProps(Object.assign({}, restProps));
|
|
1709
1776
|
const { styleProps, props: transferProps } = useStyleProps(otherProps);
|
|
1710
1777
|
return (React.createElement("li", Object.assign({}, transferProps, styleProps, { className: classNames(classProps.item, styleProps.className) }),
|
|
@@ -1714,7 +1781,7 @@ const BreadcrumbsItem = (props) => {
|
|
|
1714
1781
|
};
|
|
1715
1782
|
BreadcrumbsItem.spiritComponent = 'BreadcrumbsItem';
|
|
1716
1783
|
|
|
1717
|
-
var __rest$
|
|
1784
|
+
var __rest$2x = (undefined && undefined.__rest) || function (s, e) {
|
|
1718
1785
|
var t = {};
|
|
1719
1786
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1720
1787
|
t[p] = s[p];
|
|
@@ -1725,13 +1792,13 @@ var __rest$2w = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1725
1792
|
}
|
|
1726
1793
|
return t;
|
|
1727
1794
|
};
|
|
1728
|
-
const defaultProps$
|
|
1795
|
+
const defaultProps$R = {
|
|
1729
1796
|
elementType: 'nav',
|
|
1730
1797
|
items: [],
|
|
1731
1798
|
};
|
|
1732
1799
|
const Breadcrumbs = (props) => {
|
|
1733
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1734
|
-
const { children, elementType: ElementTag = 'nav', goBackTitle, items } = propsWithDefaults, restProps = __rest$
|
|
1800
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$R), props);
|
|
1801
|
+
const { children, elementType: ElementTag = 'nav', goBackTitle, items } = propsWithDefaults, restProps = __rest$2x(propsWithDefaults, ["children", "elementType", "goBackTitle", "items"]);
|
|
1735
1802
|
const { classProps, props: modifiedProps } = useBreadcrumbsStyleProps(Object.assign({}, restProps));
|
|
1736
1803
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
1737
1804
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.root, styleProps });
|
|
@@ -1756,7 +1823,7 @@ const useButtonProps = (props) => {
|
|
|
1756
1823
|
};
|
|
1757
1824
|
};
|
|
1758
1825
|
|
|
1759
|
-
var __rest$
|
|
1826
|
+
var __rest$2w = (undefined && undefined.__rest) || function (s, e) {
|
|
1760
1827
|
var t = {};
|
|
1761
1828
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1762
1829
|
t[p] = s[p];
|
|
@@ -1770,7 +1837,7 @@ var __rest$2v = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1770
1837
|
const getButtonColorClassname = (className, color) => compose(applyColor(color))(className);
|
|
1771
1838
|
const getButtonSizeClassname = (className, size) => compose(applySize(size))(className);
|
|
1772
1839
|
function useButtonStyleProps(props) {
|
|
1773
|
-
const { color, isBlock, isDisabled, isLoading, isSymmetrical, size } = props, restProps = __rest$
|
|
1840
|
+
const { color, isBlock, isDisabled, isLoading, isSymmetrical, size } = props, restProps = __rest$2w(props, ["color", "isBlock", "isDisabled", "isLoading", "isSymmetrical", "size"]);
|
|
1774
1841
|
useDeprecationMessage({
|
|
1775
1842
|
method: 'custom',
|
|
1776
1843
|
trigger: !!isBlock,
|
|
@@ -1781,16 +1848,16 @@ function useButtonStyleProps(props) {
|
|
|
1781
1848
|
const buttonBlockClass = `${buttonClass}--block`;
|
|
1782
1849
|
const buttonDisabledClass = `${buttonClass}--disabled`;
|
|
1783
1850
|
const buttonLoadingClass = `${buttonClass}--loading`;
|
|
1784
|
-
const
|
|
1785
|
-
if (isBlock &&
|
|
1851
|
+
const { isSymmetricalActive, symmetricalClassName } = useSymmetry(buttonClass, isSymmetrical);
|
|
1852
|
+
if (isBlock && isSymmetricalActive) {
|
|
1786
1853
|
warning(false, 'isBlock and isSymmetrical props are mutually exclusive');
|
|
1787
1854
|
}
|
|
1855
|
+
const shouldApplyBlock = () => isBlock && !isSymmetricalActive;
|
|
1788
1856
|
const classProps = classNames(buttonClass, getButtonColorClassname(buttonClass, color), getButtonSizeClassname(buttonClass, size), {
|
|
1789
|
-
[buttonBlockClass]:
|
|
1857
|
+
[buttonBlockClass]: shouldApplyBlock(),
|
|
1790
1858
|
[buttonDisabledClass]: isDisabled || isLoading,
|
|
1791
1859
|
[buttonLoadingClass]: isLoading,
|
|
1792
|
-
|
|
1793
|
-
});
|
|
1860
|
+
}, symmetricalClassName);
|
|
1794
1861
|
return {
|
|
1795
1862
|
classProps,
|
|
1796
1863
|
props: restProps,
|
|
@@ -1805,7 +1872,7 @@ const usePropsContext = (props = {}) => {
|
|
|
1805
1872
|
return context ? Object.assign(Object.assign({}, props), context) : props;
|
|
1806
1873
|
};
|
|
1807
1874
|
|
|
1808
|
-
var __rest$
|
|
1875
|
+
var __rest$2v = (undefined && undefined.__rest) || function (s, e) {
|
|
1809
1876
|
var t = {};
|
|
1810
1877
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1811
1878
|
t[p] = s[p];
|
|
@@ -1817,7 +1884,7 @@ var __rest$2u = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1817
1884
|
return t;
|
|
1818
1885
|
};
|
|
1819
1886
|
function useSpinnerStyleProps(props) {
|
|
1820
|
-
const { color } = props, restProps = __rest$
|
|
1887
|
+
const { color } = props, restProps = __rest$2v(props, ["color"]);
|
|
1821
1888
|
const spinnerClass = useClassNamePrefix('text');
|
|
1822
1889
|
const spinnerColorClass = color ? `${spinnerClass}-${color}` : '';
|
|
1823
1890
|
const spinnerAnimation = useClassNamePrefix('animation-spin-clockwise');
|
|
@@ -1835,7 +1902,7 @@ const Spinner = (props) => {
|
|
|
1835
1902
|
};
|
|
1836
1903
|
Spinner.spiritComponent = 'Spinner';
|
|
1837
1904
|
|
|
1838
|
-
var __rest$
|
|
1905
|
+
var __rest$2u = (undefined && undefined.__rest) || function (s, e) {
|
|
1839
1906
|
var t = {};
|
|
1840
1907
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1841
1908
|
t[p] = s[p];
|
|
@@ -1846,7 +1913,7 @@ var __rest$2t = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1846
1913
|
}
|
|
1847
1914
|
return t;
|
|
1848
1915
|
};
|
|
1849
|
-
const defaultProps$
|
|
1916
|
+
const defaultProps$Q = {
|
|
1850
1917
|
color: 'primary',
|
|
1851
1918
|
isBlock: false,
|
|
1852
1919
|
isDisabled: false,
|
|
@@ -1858,8 +1925,8 @@ const defaultProps$P = {
|
|
|
1858
1925
|
};
|
|
1859
1926
|
const _Button = (props, ref) => {
|
|
1860
1927
|
const propsWithContext = usePropsContext();
|
|
1861
|
-
const propsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaultProps$
|
|
1862
|
-
const { elementType: ElementTag = defaultProps$
|
|
1928
|
+
const propsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaultProps$Q), props), propsWithContext);
|
|
1929
|
+
const { elementType: ElementTag = defaultProps$Q.elementType, children } = propsWithDefaults, restProps = __rest$2u(propsWithDefaults, ["elementType", "children"]);
|
|
1863
1930
|
const { buttonProps } = useButtonProps(restProps);
|
|
1864
1931
|
const { classProps, props: modifiedProps } = useButtonStyleProps(restProps);
|
|
1865
1932
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
@@ -1886,7 +1953,7 @@ const useButtonLinkProps = (props) => {
|
|
|
1886
1953
|
};
|
|
1887
1954
|
};
|
|
1888
1955
|
|
|
1889
|
-
var __rest$
|
|
1956
|
+
var __rest$2t = (undefined && undefined.__rest) || function (s, e) {
|
|
1890
1957
|
var t = {};
|
|
1891
1958
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1892
1959
|
t[p] = s[p];
|
|
@@ -1900,7 +1967,7 @@ var __rest$2s = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1900
1967
|
const getButtonLinkColorClassname = (className, color) => compose(applyColor(color))(className);
|
|
1901
1968
|
const getButtonLinkSizeClassname = (className, size) => compose(applySize(size))(className);
|
|
1902
1969
|
function useButtonLinkStyleProps(props) {
|
|
1903
|
-
const { color, isBlock, isDisabled, isLoading, isSymmetrical, size } = props, restProps = __rest$
|
|
1970
|
+
const { color, isBlock, isDisabled, isLoading, isSymmetrical, size } = props, restProps = __rest$2t(props, ["color", "isBlock", "isDisabled", "isLoading", "isSymmetrical", "size"]);
|
|
1904
1971
|
useDeprecationMessage({
|
|
1905
1972
|
method: 'custom',
|
|
1906
1973
|
trigger: !!isBlock,
|
|
@@ -1911,23 +1978,23 @@ function useButtonLinkStyleProps(props) {
|
|
|
1911
1978
|
const buttonBlockClass = `${buttonClass}--block`;
|
|
1912
1979
|
const buttonDisabledClass = `${buttonClass}--disabled`;
|
|
1913
1980
|
const buttonLoadingClass = `${buttonClass}--loading`;
|
|
1914
|
-
const
|
|
1915
|
-
if (isBlock &&
|
|
1981
|
+
const { isSymmetricalActive, symmetricalClassName } = useSymmetry(buttonClass, isSymmetrical);
|
|
1982
|
+
if (isBlock && isSymmetricalActive) {
|
|
1916
1983
|
warning(false, 'isBlock and isSymmetrical props are mutually exclusive');
|
|
1917
1984
|
}
|
|
1985
|
+
const shouldApplyBlock = () => isBlock && !isSymmetricalActive;
|
|
1918
1986
|
const classProps = classNames(buttonClass, getButtonLinkColorClassname(buttonClass, color), getButtonLinkSizeClassname(buttonClass, size), {
|
|
1919
|
-
[buttonBlockClass]:
|
|
1987
|
+
[buttonBlockClass]: shouldApplyBlock(),
|
|
1920
1988
|
[buttonDisabledClass]: isDisabled || isLoading,
|
|
1921
1989
|
[buttonLoadingClass]: isLoading,
|
|
1922
|
-
|
|
1923
|
-
});
|
|
1990
|
+
}, symmetricalClassName);
|
|
1924
1991
|
return {
|
|
1925
1992
|
classProps,
|
|
1926
1993
|
props: restProps,
|
|
1927
1994
|
};
|
|
1928
1995
|
}
|
|
1929
1996
|
|
|
1930
|
-
var __rest$
|
|
1997
|
+
var __rest$2s = (undefined && undefined.__rest) || function (s, e) {
|
|
1931
1998
|
var t = {};
|
|
1932
1999
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1933
2000
|
t[p] = s[p];
|
|
@@ -1938,7 +2005,7 @@ var __rest$2r = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1938
2005
|
}
|
|
1939
2006
|
return t;
|
|
1940
2007
|
};
|
|
1941
|
-
const defaultProps$
|
|
2008
|
+
const defaultProps$P = {
|
|
1942
2009
|
color: 'primary',
|
|
1943
2010
|
elementType: 'a',
|
|
1944
2011
|
isBlock: false,
|
|
@@ -1948,8 +2015,8 @@ const defaultProps$O = {
|
|
|
1948
2015
|
size: 'medium',
|
|
1949
2016
|
};
|
|
1950
2017
|
const _ButtonLink = (props, ref) => {
|
|
1951
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
1952
|
-
const { elementType: ElementTag = defaultProps$
|
|
2018
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$P), props);
|
|
2019
|
+
const { elementType: ElementTag = defaultProps$P.elementType, children } = propsWithDefaults, restProps = __rest$2s(propsWithDefaults, ["elementType", "children"]);
|
|
1953
2020
|
const { buttonLinkProps } = useButtonLinkProps(propsWithDefaults);
|
|
1954
2021
|
const { classProps, props: modifiedProps } = useButtonLinkStyleProps(restProps);
|
|
1955
2022
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
@@ -2016,7 +2083,7 @@ function useCardStyleProps(props) {
|
|
|
2016
2083
|
};
|
|
2017
2084
|
}
|
|
2018
2085
|
|
|
2019
|
-
var __rest$
|
|
2086
|
+
var __rest$2r = (undefined && undefined.__rest) || function (s, e) {
|
|
2020
2087
|
var t = {};
|
|
2021
2088
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2022
2089
|
t[p] = s[p];
|
|
@@ -2027,14 +2094,14 @@ var __rest$2q = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2027
2094
|
}
|
|
2028
2095
|
return t;
|
|
2029
2096
|
};
|
|
2030
|
-
const defaultProps$
|
|
2097
|
+
const defaultProps$O = {
|
|
2031
2098
|
direction: DirectionExtended.VERTICAL,
|
|
2032
2099
|
elementType: 'article',
|
|
2033
2100
|
isBoxed: false,
|
|
2034
2101
|
};
|
|
2035
2102
|
const Card = (props) => {
|
|
2036
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2037
|
-
const { elementType: ElementTag = 'article', direction, isBoxed, children } = propsWithDefaults, restProps = __rest$
|
|
2103
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$O), props);
|
|
2104
|
+
const { elementType: ElementTag = 'article', direction, isBoxed, children } = propsWithDefaults, restProps = __rest$2r(propsWithDefaults, ["elementType", "direction", "isBoxed", "children"]);
|
|
2038
2105
|
const { classProps } = useCardStyleProps({ direction, isBoxed });
|
|
2039
2106
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2040
2107
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.root, styleProps, otherProps });
|
|
@@ -2042,7 +2109,7 @@ const Card = (props) => {
|
|
|
2042
2109
|
};
|
|
2043
2110
|
Card.spiritComponent = 'Card';
|
|
2044
2111
|
|
|
2045
|
-
var __rest$
|
|
2112
|
+
var __rest$2q = (undefined && undefined.__rest) || function (s, e) {
|
|
2046
2113
|
var t = {};
|
|
2047
2114
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2048
2115
|
t[p] = s[p];
|
|
@@ -2053,19 +2120,19 @@ var __rest$2p = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2053
2120
|
}
|
|
2054
2121
|
return t;
|
|
2055
2122
|
};
|
|
2056
|
-
const defaultProps$
|
|
2123
|
+
const defaultProps$N = {
|
|
2057
2124
|
alignmentX: AlignmentX.LEFT,
|
|
2058
2125
|
};
|
|
2059
2126
|
const CardArtwork = (props) => {
|
|
2060
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2061
|
-
const { children, alignmentX } = propsWithDefaults, restProps = __rest$
|
|
2127
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$N), props);
|
|
2128
|
+
const { children, alignmentX } = propsWithDefaults, restProps = __rest$2q(propsWithDefaults, ["children", "alignmentX"]);
|
|
2062
2129
|
const { classProps } = useCardStyleProps({ artworkAlignmentX: alignmentX });
|
|
2063
2130
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2064
2131
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.artwork, styleProps.className), style: styleProps.style }), children));
|
|
2065
2132
|
};
|
|
2066
2133
|
CardArtwork.spiritComponent = 'CardArtwork';
|
|
2067
2134
|
|
|
2068
|
-
var __rest$
|
|
2135
|
+
var __rest$2p = (undefined && undefined.__rest) || function (s, e) {
|
|
2069
2136
|
var t = {};
|
|
2070
2137
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2071
2138
|
t[p] = s[p];
|
|
@@ -2076,19 +2143,19 @@ var __rest$2o = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2076
2143
|
}
|
|
2077
2144
|
return t;
|
|
2078
2145
|
};
|
|
2079
|
-
const defaultProps$
|
|
2146
|
+
const defaultProps$M = {
|
|
2080
2147
|
isSelectable: false,
|
|
2081
2148
|
};
|
|
2082
2149
|
const CardBody = (props) => {
|
|
2083
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2084
|
-
const { children, isSelectable } = propsWithDefaults, restProps = __rest$
|
|
2150
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$M), props);
|
|
2151
|
+
const { children, isSelectable } = propsWithDefaults, restProps = __rest$2p(propsWithDefaults, ["children", "isSelectable"]);
|
|
2085
2152
|
const { classProps } = useCardStyleProps({ isSelectable });
|
|
2086
2153
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2087
2154
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.body, styleProps.className), style: styleProps.style }), children));
|
|
2088
2155
|
};
|
|
2089
2156
|
CardBody.spiritComponent = 'CardBody';
|
|
2090
2157
|
|
|
2091
|
-
var __rest$
|
|
2158
|
+
var __rest$2o = (undefined && undefined.__rest) || function (s, e) {
|
|
2092
2159
|
var t = {};
|
|
2093
2160
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2094
2161
|
t[p] = s[p];
|
|
@@ -2100,14 +2167,14 @@ var __rest$2n = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2100
2167
|
return t;
|
|
2101
2168
|
};
|
|
2102
2169
|
const CardEyebrow = (props) => {
|
|
2103
|
-
const { children } = props, restProps = __rest$
|
|
2170
|
+
const { children } = props, restProps = __rest$2o(props, ["children"]);
|
|
2104
2171
|
const { classProps } = useCardStyleProps();
|
|
2105
2172
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2106
2173
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.eyebrow, styleProps.className), style: styleProps.style }), children));
|
|
2107
2174
|
};
|
|
2108
2175
|
CardEyebrow.spiritComponent = 'CardEyebrow';
|
|
2109
2176
|
|
|
2110
|
-
var __rest$
|
|
2177
|
+
var __rest$2n = (undefined && undefined.__rest) || function (s, e) {
|
|
2111
2178
|
var t = {};
|
|
2112
2179
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2113
2180
|
t[p] = s[p];
|
|
@@ -2118,19 +2185,19 @@ var __rest$2m = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2118
2185
|
}
|
|
2119
2186
|
return t;
|
|
2120
2187
|
};
|
|
2121
|
-
const defaultProps$
|
|
2188
|
+
const defaultProps$L = {
|
|
2122
2189
|
alignmentX: AlignmentX.LEFT,
|
|
2123
2190
|
};
|
|
2124
2191
|
const CardFooter = (props) => {
|
|
2125
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2126
|
-
const { children, alignmentX } = propsWithDefaults, restProps = __rest$
|
|
2192
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$L), props);
|
|
2193
|
+
const { children, alignmentX } = propsWithDefaults, restProps = __rest$2n(propsWithDefaults, ["children", "alignmentX"]);
|
|
2127
2194
|
const { classProps } = useCardStyleProps({ footerAlignmentX: alignmentX });
|
|
2128
2195
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2129
2196
|
return (React.createElement("footer", Object.assign({}, otherProps, { className: classNames(classProps.footer, styleProps.className), style: styleProps.style }), children));
|
|
2130
2197
|
};
|
|
2131
2198
|
CardFooter.spiritComponent = 'CardFooter';
|
|
2132
2199
|
|
|
2133
|
-
var __rest$
|
|
2200
|
+
var __rest$2m = (undefined && undefined.__rest) || function (s, e) {
|
|
2134
2201
|
var t = {};
|
|
2135
2202
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2136
2203
|
t[p] = s[p];
|
|
@@ -2141,12 +2208,12 @@ var __rest$2l = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2141
2208
|
}
|
|
2142
2209
|
return t;
|
|
2143
2210
|
};
|
|
2144
|
-
const defaultProps$
|
|
2211
|
+
const defaultProps$K = {
|
|
2145
2212
|
elementType: 'a',
|
|
2146
2213
|
};
|
|
2147
2214
|
const _CardLink = (props, ref) => {
|
|
2148
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2149
|
-
const { elementType: ElementTag = defaultProps$
|
|
2215
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$K), props);
|
|
2216
|
+
const { elementType: ElementTag = defaultProps$K.elementType, children, href } = propsWithDefaults, restProps = __rest$2m(propsWithDefaults, ["elementType", "children", "href"]);
|
|
2150
2217
|
const { classProps } = useCardStyleProps();
|
|
2151
2218
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2152
2219
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.link, styleProps, otherProps });
|
|
@@ -2155,7 +2222,7 @@ const _CardLink = (props, ref) => {
|
|
|
2155
2222
|
const CardLink = React.forwardRef(_CardLink);
|
|
2156
2223
|
CardLink.spiritComponent = 'CardLink';
|
|
2157
2224
|
|
|
2158
|
-
var __rest$
|
|
2225
|
+
var __rest$2l = (undefined && undefined.__rest) || function (s, e) {
|
|
2159
2226
|
var t = {};
|
|
2160
2227
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2161
2228
|
t[p] = s[p];
|
|
@@ -2167,7 +2234,7 @@ var __rest$2k = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2167
2234
|
return t;
|
|
2168
2235
|
};
|
|
2169
2236
|
const CardLogo = (props) => {
|
|
2170
|
-
const { children } = props, restProps = __rest$
|
|
2237
|
+
const { children } = props, restProps = __rest$2l(props, ["children"]);
|
|
2171
2238
|
const { classProps } = useCardStyleProps();
|
|
2172
2239
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2173
2240
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.logo, styleProps.className), style: Object.assign({}, styleProps.style) }), children));
|
|
@@ -2187,7 +2254,7 @@ const useCardMediaStyleProps = (props) => {
|
|
|
2187
2254
|
};
|
|
2188
2255
|
};
|
|
2189
2256
|
|
|
2190
|
-
var __rest$
|
|
2257
|
+
var __rest$2k = (undefined && undefined.__rest) || function (s, e) {
|
|
2191
2258
|
var t = {};
|
|
2192
2259
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2193
2260
|
t[p] = s[p];
|
|
@@ -2198,15 +2265,15 @@ var __rest$2j = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2198
2265
|
}
|
|
2199
2266
|
return t;
|
|
2200
2267
|
};
|
|
2201
|
-
const defaultProps$
|
|
2268
|
+
const defaultProps$J = {
|
|
2202
2269
|
fit: ObjectFit.COVER,
|
|
2203
2270
|
hasFilledHeight: false,
|
|
2204
2271
|
isExpanded: false,
|
|
2205
2272
|
size: CardSizes.AUTO,
|
|
2206
2273
|
};
|
|
2207
2274
|
const CardMedia = (props) => {
|
|
2208
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2209
|
-
const { backgroundColor, children, fit, hasFilledHeight, isExpanded, size } = propsWithDefaults, restProps = __rest$
|
|
2275
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$J), props);
|
|
2276
|
+
const { backgroundColor, children, fit, hasFilledHeight, isExpanded, size } = propsWithDefaults, restProps = __rest$2k(propsWithDefaults, ["backgroundColor", "children", "fit", "hasFilledHeight", "isExpanded", "size"]);
|
|
2210
2277
|
const { classProps } = useCardStyleProps({ size, isExpanded, hasFilledHeight });
|
|
2211
2278
|
const { classProps: cardMediaClassProps, styleProps: cardMediaStyleProps } = useCardMediaStyleProps({
|
|
2212
2279
|
backgroundColor,
|
|
@@ -2222,7 +2289,7 @@ const CardMedia = (props) => {
|
|
|
2222
2289
|
};
|
|
2223
2290
|
CardMedia.spiritComponent = 'CardMedia';
|
|
2224
2291
|
|
|
2225
|
-
var __rest$
|
|
2292
|
+
var __rest$2j = (undefined && undefined.__rest) || function (s, e) {
|
|
2226
2293
|
var t = {};
|
|
2227
2294
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2228
2295
|
t[p] = s[p];
|
|
@@ -2233,13 +2300,13 @@ var __rest$2i = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2233
2300
|
}
|
|
2234
2301
|
return t;
|
|
2235
2302
|
};
|
|
2236
|
-
const defaultProps$
|
|
2303
|
+
const defaultProps$I = {
|
|
2237
2304
|
elementType: 'h4',
|
|
2238
2305
|
isHeading: true,
|
|
2239
2306
|
};
|
|
2240
2307
|
const CardTitle = (props) => {
|
|
2241
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2242
|
-
const { elementType: ElementTag = 'h4', children, isHeading } = propsWithDefaults, restProps = __rest$
|
|
2308
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$I), props);
|
|
2309
|
+
const { elementType: ElementTag = 'h4', children, isHeading } = propsWithDefaults, restProps = __rest$2j(propsWithDefaults, ["elementType", "children", "isHeading"]);
|
|
2243
2310
|
const { classProps } = useCardStyleProps({ isHeading });
|
|
2244
2311
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2245
2312
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.title, styleProps, otherProps });
|
|
@@ -2247,7 +2314,7 @@ const CardTitle = (props) => {
|
|
|
2247
2314
|
};
|
|
2248
2315
|
CardTitle.spiritComponent = 'CardTitle';
|
|
2249
2316
|
|
|
2250
|
-
var __rest$
|
|
2317
|
+
var __rest$2i = (undefined && undefined.__rest) || function (s, e) {
|
|
2251
2318
|
var t = {};
|
|
2252
2319
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2253
2320
|
t[p] = s[p];
|
|
@@ -2258,14 +2325,14 @@ var __rest$2h = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2258
2325
|
}
|
|
2259
2326
|
return t;
|
|
2260
2327
|
};
|
|
2261
|
-
const defaultProps$
|
|
2328
|
+
const defaultProps$H = {
|
|
2262
2329
|
elementType: 'div',
|
|
2263
2330
|
id: undefined,
|
|
2264
2331
|
registerAria: undefined,
|
|
2265
2332
|
};
|
|
2266
2333
|
const HelperText = (props) => {
|
|
2267
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2268
|
-
const { helperText, elementType: ElementTag = defaultProps$
|
|
2334
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$H), props);
|
|
2335
|
+
const { helperText, elementType: ElementTag = defaultProps$H.elementType, id, registerAria } = propsWithDefaults, restProps = __rest$2i(propsWithDefaults, ["helperText", "elementType", "id", "registerAria"]);
|
|
2269
2336
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
2270
2337
|
const mergedStyleProps = mergeStyleProps(ElementTag, { styleProps, transferProps });
|
|
2271
2338
|
React.useEffect(() => {
|
|
@@ -2281,7 +2348,7 @@ const HelperText = (props) => {
|
|
|
2281
2348
|
};
|
|
2282
2349
|
HelperText.spiritComponent = 'HelperText';
|
|
2283
2350
|
|
|
2284
|
-
var __rest$
|
|
2351
|
+
var __rest$2h = (undefined && undefined.__rest) || function (s, e) {
|
|
2285
2352
|
var t = {};
|
|
2286
2353
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2287
2354
|
t[p] = s[p];
|
|
@@ -2293,7 +2360,7 @@ var __rest$2g = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2293
2360
|
return t;
|
|
2294
2361
|
};
|
|
2295
2362
|
const Label = (props) => {
|
|
2296
|
-
const { elementType: ElementTag = 'label', children, htmlFor, for: labelFor } = props, restProps = __rest$
|
|
2363
|
+
const { elementType: ElementTag = 'label', children, htmlFor, for: labelFor } = props, restProps = __rest$2h(props, ["elementType", "children", "htmlFor", "for"]);
|
|
2297
2364
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2298
2365
|
const mergedStyleProps = mergeStyleProps(ElementTag, { styleProps, otherProps });
|
|
2299
2366
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps, { htmlFor: ElementTag === 'label' ? labelFor || htmlFor : undefined }), children));
|
|
@@ -2326,7 +2393,7 @@ function useValidationIcon({ hasValidationStateIcon }) {
|
|
|
2326
2393
|
return iconNameValue;
|
|
2327
2394
|
}
|
|
2328
2395
|
|
|
2329
|
-
var __rest$
|
|
2396
|
+
var __rest$2g = (undefined && undefined.__rest) || function (s, e) {
|
|
2330
2397
|
var t = {};
|
|
2331
2398
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2332
2399
|
t[p] = s[p];
|
|
@@ -2337,15 +2404,15 @@ var __rest$2f = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2337
2404
|
}
|
|
2338
2405
|
return t;
|
|
2339
2406
|
};
|
|
2340
|
-
const defaultProps$
|
|
2407
|
+
const defaultProps$G = {
|
|
2341
2408
|
elementType: 'div',
|
|
2342
2409
|
id: undefined,
|
|
2343
2410
|
registerAria: undefined,
|
|
2344
2411
|
role: undefined,
|
|
2345
2412
|
};
|
|
2346
2413
|
const ValidationText = (props) => {
|
|
2347
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2348
|
-
const { elementType: ElementTag = defaultProps$
|
|
2414
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$G), props);
|
|
2415
|
+
const { elementType: ElementTag = defaultProps$G.elementType, id, hasValidationStateIcon, registerAria, role, validationText } = propsWithDefaults, restProps = __rest$2g(propsWithDefaults, ["elementType", "id", "hasValidationStateIcon", "registerAria", "role", "validationText"]);
|
|
2349
2416
|
const validationIconName = useValidationIcon({ hasValidationStateIcon });
|
|
2350
2417
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
2351
2418
|
const mergedStyleProps = mergeStyleProps(ElementTag, { styleProps, transferProps });
|
|
@@ -2381,7 +2448,7 @@ const useValidationTextRole = ({ validationState, validationText, }) => {
|
|
|
2381
2448
|
return role;
|
|
2382
2449
|
};
|
|
2383
2450
|
|
|
2384
|
-
var __rest$
|
|
2451
|
+
var __rest$2f = (undefined && undefined.__rest) || function (s, e) {
|
|
2385
2452
|
var t = {};
|
|
2386
2453
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2387
2454
|
t[p] = s[p];
|
|
@@ -2393,12 +2460,13 @@ var __rest$2e = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2393
2460
|
return t;
|
|
2394
2461
|
};
|
|
2395
2462
|
function useCheckboxStyleProps(props) {
|
|
2396
|
-
const {
|
|
2463
|
+
const { inputPosition = InputPositions.START, isItem, isLabelHidden, validationState } = props, restProps = __rest$2f(props, ["inputPosition", "isItem", "isLabelHidden", "validationState"]);
|
|
2397
2464
|
const { isDisabled, isRequired } = restProps;
|
|
2398
2465
|
const checkboxClass = useClassNamePrefix('Checkbox');
|
|
2399
2466
|
const checkboxDisabledClass = `${checkboxClass}--disabled`;
|
|
2400
2467
|
const checkboxItemClass = `${checkboxClass}--item`;
|
|
2401
2468
|
const checkboxInputClass = `${checkboxClass}__input`;
|
|
2469
|
+
const checkboxInputPositionClass = useInputPositionClass(checkboxClass, inputPosition);
|
|
2402
2470
|
const checkboxTextClass = `${checkboxClass}__text`;
|
|
2403
2471
|
const checkboxLabelClass = `${checkboxClass}__label`;
|
|
2404
2472
|
const checkboxLabelRequiredClass = `${checkboxClass}__label--required`;
|
|
@@ -2407,6 +2475,7 @@ function useCheckboxStyleProps(props) {
|
|
|
2407
2475
|
const checkboxValidationTextClass = `${checkboxClass}__validationText`;
|
|
2408
2476
|
const checkboxValidationClass = `${checkboxClass}--${validationState}`;
|
|
2409
2477
|
const rootStyles = classNames(checkboxClass, {
|
|
2478
|
+
[checkboxInputPositionClass]: checkboxInputPositionClass,
|
|
2410
2479
|
[checkboxDisabledClass]: isDisabled,
|
|
2411
2480
|
[checkboxItemClass]: isItem,
|
|
2412
2481
|
[checkboxValidationClass]: validationState,
|
|
@@ -2428,7 +2497,7 @@ function useCheckboxStyleProps(props) {
|
|
|
2428
2497
|
};
|
|
2429
2498
|
}
|
|
2430
2499
|
|
|
2431
|
-
var __rest$
|
|
2500
|
+
var __rest$2e = (undefined && undefined.__rest) || function (s, e) {
|
|
2432
2501
|
var t = {};
|
|
2433
2502
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2434
2503
|
t[p] = s[p];
|
|
@@ -2441,7 +2510,7 @@ var __rest$2d = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2441
2510
|
};
|
|
2442
2511
|
const _Checkbox = (props, ref) => {
|
|
2443
2512
|
const { classProps, props: modifiedProps } = useCheckboxStyleProps(props);
|
|
2444
|
-
const { 'aria-describedby': ariaDescribedBy = '', hasValidationIcon, helperText, id, isChecked, isDisabled, isRequired, label, validationState, validationText, value } = modifiedProps, restProps = __rest$
|
|
2513
|
+
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"]);
|
|
2445
2514
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2446
2515
|
const [ids, register] = useAriaIds(ariaDescribedBy);
|
|
2447
2516
|
const ariaDescribedByProp = useAriaDescribedBy(ids);
|
|
@@ -2459,7 +2528,7 @@ const _Checkbox = (props, ref) => {
|
|
|
2459
2528
|
const Checkbox = React.forwardRef(_Checkbox);
|
|
2460
2529
|
Checkbox.spiritComponent = 'Checkbox';
|
|
2461
2530
|
|
|
2462
|
-
var __rest$
|
|
2531
|
+
var __rest$2d = (undefined && undefined.__rest) || function (s, e) {
|
|
2463
2532
|
var t = {};
|
|
2464
2533
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2465
2534
|
t[p] = s[p];
|
|
@@ -2471,7 +2540,7 @@ var __rest$2c = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2471
2540
|
return t;
|
|
2472
2541
|
};
|
|
2473
2542
|
function useContainerStyleProps(props) {
|
|
2474
|
-
const { isFluid, size } = props, modifiedProps = __rest$
|
|
2543
|
+
const { isFluid, size } = props, modifiedProps = __rest$2d(props, ["isFluid", "size"]);
|
|
2475
2544
|
const containerClass = useClassNamePrefix('Container');
|
|
2476
2545
|
const containerFluidClass = `${containerClass}--fluid`;
|
|
2477
2546
|
const containerSizeClass = `${containerClass}--${size}`;
|
|
@@ -2485,7 +2554,7 @@ function useContainerStyleProps(props) {
|
|
|
2485
2554
|
};
|
|
2486
2555
|
}
|
|
2487
2556
|
|
|
2488
|
-
var __rest$
|
|
2557
|
+
var __rest$2c = (undefined && undefined.__rest) || function (s, e) {
|
|
2489
2558
|
var t = {};
|
|
2490
2559
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2491
2560
|
t[p] = s[p];
|
|
@@ -2496,13 +2565,13 @@ var __rest$2b = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2496
2565
|
}
|
|
2497
2566
|
return t;
|
|
2498
2567
|
};
|
|
2499
|
-
const defaultProps$
|
|
2568
|
+
const defaultProps$F = {
|
|
2500
2569
|
isFluid: false,
|
|
2501
2570
|
size: SizesExtended.XLARGE,
|
|
2502
2571
|
};
|
|
2503
2572
|
const Container = (props) => {
|
|
2504
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2505
|
-
const { children } = propsWithDefaults, restProps = __rest$
|
|
2573
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$F), props);
|
|
2574
|
+
const { children } = propsWithDefaults, restProps = __rest$2c(propsWithDefaults, ["children"]);
|
|
2506
2575
|
const { classProps, props: modifiedProps } = useContainerStyleProps(restProps);
|
|
2507
2576
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps, {
|
|
2508
2577
|
textAlignment: TextStyleProps.textAlignment,
|
|
@@ -2523,7 +2592,7 @@ const useControlButtonProps = (props) => {
|
|
|
2523
2592
|
};
|
|
2524
2593
|
};
|
|
2525
2594
|
|
|
2526
|
-
var __rest$
|
|
2595
|
+
var __rest$2b = (undefined && undefined.__rest) || function (s, e) {
|
|
2527
2596
|
var t = {};
|
|
2528
2597
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2529
2598
|
t[p] = s[p];
|
|
@@ -2536,27 +2605,26 @@ var __rest$2a = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2536
2605
|
};
|
|
2537
2606
|
const getControlButtonSizeClassname = (className, size) => compose(applySize(size))(className);
|
|
2538
2607
|
function useControlButtonStyleProps(props) {
|
|
2539
|
-
const { isDisabled, isSubtle, isSymmetrical, size } = props, restProps = __rest$
|
|
2608
|
+
const { isDisabled, isSubtle, isSymmetrical, size } = props, restProps = __rest$2b(props, ["isDisabled", "isSubtle", "isSymmetrical", "size"]);
|
|
2540
2609
|
const controlButtonClass = useClassNamePrefix('ControlButton');
|
|
2541
2610
|
const controlButtonBackgroundClass = `${controlButtonClass}--hasBackground`;
|
|
2542
2611
|
const controlButtonDisabledClass = `${controlButtonClass}--disabled`;
|
|
2543
|
-
const controlButtonSymmetricalClass = `${controlButtonClass}--symmetrical`;
|
|
2544
2612
|
const dynamicColorBackgroundInteractiveClass = useClassNamePrefix('dynamic-color-background-interactive');
|
|
2545
2613
|
const dynamicColorBorderClass = useClassNamePrefix('dynamic-color-border');
|
|
2546
2614
|
const accessibilityTapTargetClass = useClassNamePrefix('accessibility-tap-target');
|
|
2615
|
+
const { symmetricalClassName } = useSymmetry(controlButtonClass, isSymmetrical);
|
|
2547
2616
|
const classProps = classNames(controlButtonClass, getControlButtonSizeClassname(controlButtonClass, size), dynamicColorBackgroundInteractiveClass, accessibilityTapTargetClass, {
|
|
2548
2617
|
[controlButtonDisabledClass]: isDisabled,
|
|
2549
|
-
[controlButtonSymmetricalClass]: isSymmetrical,
|
|
2550
2618
|
[controlButtonBackgroundClass]: !isSubtle,
|
|
2551
2619
|
[dynamicColorBorderClass]: !isSubtle,
|
|
2552
|
-
});
|
|
2620
|
+
}, symmetricalClassName);
|
|
2553
2621
|
return {
|
|
2554
2622
|
classProps,
|
|
2555
2623
|
props: restProps,
|
|
2556
2624
|
};
|
|
2557
2625
|
}
|
|
2558
2626
|
|
|
2559
|
-
var __rest$
|
|
2627
|
+
var __rest$2a = (undefined && undefined.__rest) || function (s, e) {
|
|
2560
2628
|
var t = {};
|
|
2561
2629
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2562
2630
|
t[p] = s[p];
|
|
@@ -2567,7 +2635,7 @@ var __rest$29 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2567
2635
|
}
|
|
2568
2636
|
return t;
|
|
2569
2637
|
};
|
|
2570
|
-
const defaultProps$
|
|
2638
|
+
const defaultProps$E = {
|
|
2571
2639
|
elementType: 'button',
|
|
2572
2640
|
isDisabled: false,
|
|
2573
2641
|
isSubtle: false,
|
|
@@ -2576,8 +2644,8 @@ const defaultProps$D = {
|
|
|
2576
2644
|
type: 'button',
|
|
2577
2645
|
};
|
|
2578
2646
|
const _ControlButton = (props, ref) => {
|
|
2579
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2580
|
-
const { elementType: ElementTag = defaultProps$
|
|
2647
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$E), props);
|
|
2648
|
+
const { elementType: ElementTag = defaultProps$E.elementType, children } = propsWithDefaults, restProps = __rest$2a(propsWithDefaults, ["elementType", "children"]);
|
|
2581
2649
|
const { controlButtonProps } = useControlButtonProps(restProps);
|
|
2582
2650
|
const { classProps, props: modifiedProps } = useControlButtonStyleProps(restProps);
|
|
2583
2651
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
@@ -2637,7 +2705,7 @@ const useDialog = (ref, isOpen) => {
|
|
|
2637
2705
|
};
|
|
2638
2706
|
};
|
|
2639
2707
|
|
|
2640
|
-
var __rest$
|
|
2708
|
+
var __rest$29 = (undefined && undefined.__rest) || function (s, e) {
|
|
2641
2709
|
var t = {};
|
|
2642
2710
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2643
2711
|
t[p] = s[p];
|
|
@@ -2649,7 +2717,7 @@ var __rest$28 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2649
2717
|
return t;
|
|
2650
2718
|
};
|
|
2651
2719
|
const Dialog = (props, ref) => {
|
|
2652
|
-
const { children, isOpen, onClose, closeOnBackdropClick = true, closeOnEscapeKeyDown } = props, restProps = __rest$
|
|
2720
|
+
const { children, isOpen, onClose, closeOnBackdropClick = true, closeOnEscapeKeyDown } = props, restProps = __rest$29(props, ["children", "isOpen", "onClose", "closeOnBackdropClick", "closeOnEscapeKeyDown"]);
|
|
2653
2721
|
const dialogElementRef = React.useRef(ref);
|
|
2654
2722
|
const contentElementRef = React.useRef(null);
|
|
2655
2723
|
const { closeDialog, onTransitionEnd } = useDialog(dialogElementRef, isOpen);
|
|
@@ -2725,7 +2793,7 @@ const useDrawerStyleProps = (props = {}) => {
|
|
|
2725
2793
|
};
|
|
2726
2794
|
};
|
|
2727
2795
|
|
|
2728
|
-
var __rest$
|
|
2796
|
+
var __rest$28 = (undefined && undefined.__rest) || function (s, e) {
|
|
2729
2797
|
var t = {};
|
|
2730
2798
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2731
2799
|
t[p] = s[p];
|
|
@@ -2737,7 +2805,7 @@ var __rest$27 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2737
2805
|
return t;
|
|
2738
2806
|
};
|
|
2739
2807
|
const Drawer = (props) => {
|
|
2740
|
-
const { children, alignmentX = DRAWER_ALIGNMENT_DEFAULT, isOpen, onClose, id } = props, restProps = __rest$
|
|
2808
|
+
const { children, alignmentX = DRAWER_ALIGNMENT_DEFAULT, isOpen, onClose, id } = props, restProps = __rest$28(props, ["children", "alignmentX", "isOpen", "onClose", "id"]);
|
|
2741
2809
|
const { classProps } = useDrawerStyleProps({ drawerAlignmentX: alignmentX });
|
|
2742
2810
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2743
2811
|
const contextValue = {
|
|
@@ -2751,7 +2819,7 @@ const Drawer = (props) => {
|
|
|
2751
2819
|
};
|
|
2752
2820
|
Drawer.spiritComponent = 'Drawer';
|
|
2753
2821
|
|
|
2754
|
-
var __rest$
|
|
2822
|
+
var __rest$27 = (undefined && undefined.__rest) || function (s, e) {
|
|
2755
2823
|
var t = {};
|
|
2756
2824
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2757
2825
|
t[p] = s[p];
|
|
@@ -2763,7 +2831,7 @@ var __rest$26 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2763
2831
|
return t;
|
|
2764
2832
|
};
|
|
2765
2833
|
function useVisuallyHiddenProps(props) {
|
|
2766
|
-
const restProps = __rest$
|
|
2834
|
+
const restProps = __rest$27(props, []);
|
|
2767
2835
|
const visuallyHiddenClass = useClassNamePrefix('accessibility-hidden');
|
|
2768
2836
|
return {
|
|
2769
2837
|
classProps: visuallyHiddenClass,
|
|
@@ -2771,7 +2839,7 @@ function useVisuallyHiddenProps(props) {
|
|
|
2771
2839
|
};
|
|
2772
2840
|
}
|
|
2773
2841
|
|
|
2774
|
-
var __rest$
|
|
2842
|
+
var __rest$26 = (undefined && undefined.__rest) || function (s, e) {
|
|
2775
2843
|
var t = {};
|
|
2776
2844
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2777
2845
|
t[p] = s[p];
|
|
@@ -2783,7 +2851,7 @@ var __rest$25 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2783
2851
|
return t;
|
|
2784
2852
|
};
|
|
2785
2853
|
const VisuallyHidden = (props) => {
|
|
2786
|
-
const { children, elementType: ElementTag = 'span' } = props, rest = __rest$
|
|
2854
|
+
const { children, elementType: ElementTag = 'span' } = props, rest = __rest$26(props, ["children", "elementType"]);
|
|
2787
2855
|
const { classProps, props: modifiedProps } = useVisuallyHiddenProps(rest);
|
|
2788
2856
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
2789
2857
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps });
|
|
@@ -2791,7 +2859,7 @@ const VisuallyHidden = (props) => {
|
|
|
2791
2859
|
};
|
|
2792
2860
|
VisuallyHidden.spiritComponent = 'VisuallyHidden';
|
|
2793
2861
|
|
|
2794
|
-
var __rest$
|
|
2862
|
+
var __rest$25 = (undefined && undefined.__rest) || function (s, e) {
|
|
2795
2863
|
var t = {};
|
|
2796
2864
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2797
2865
|
t[p] = s[p];
|
|
@@ -2802,15 +2870,15 @@ var __rest$24 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2802
2870
|
}
|
|
2803
2871
|
return t;
|
|
2804
2872
|
};
|
|
2805
|
-
const defaultProps$
|
|
2873
|
+
const defaultProps$D = {
|
|
2806
2874
|
color: ComponentButtonColors.TERTIARY,
|
|
2807
2875
|
iconBoxSize: DEFAULT_BOX_SIZE,
|
|
2808
2876
|
label: DRAWER_CLOSE_BUTTON_LABEL_DEFAULT,
|
|
2809
2877
|
size: Sizes.MEDIUM,
|
|
2810
2878
|
};
|
|
2811
2879
|
const DrawerCloseButton = (props) => {
|
|
2812
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2813
|
-
const { color, iconBoxSize, label, size } = propsWithDefaults, restProps = __rest$
|
|
2880
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$D), props);
|
|
2881
|
+
const { color, iconBoxSize, label, size } = propsWithDefaults, restProps = __rest$25(propsWithDefaults, ["color", "iconBoxSize", "label", "size"]);
|
|
2814
2882
|
const { id, isOpen, onClose } = useDrawerContext();
|
|
2815
2883
|
const { classProps } = useDrawerStyleProps();
|
|
2816
2884
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
@@ -2820,7 +2888,7 @@ const DrawerCloseButton = (props) => {
|
|
|
2820
2888
|
};
|
|
2821
2889
|
DrawerCloseButton.spiritComponent = 'DrawerCloseButton';
|
|
2822
2890
|
|
|
2823
|
-
var __rest$
|
|
2891
|
+
var __rest$24 = (undefined && undefined.__rest) || function (s, e) {
|
|
2824
2892
|
var t = {};
|
|
2825
2893
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2826
2894
|
t[p] = s[p];
|
|
@@ -2832,7 +2900,7 @@ var __rest$23 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2832
2900
|
return t;
|
|
2833
2901
|
};
|
|
2834
2902
|
const _DrawerPanel = (props, ref) => {
|
|
2835
|
-
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$
|
|
2903
|
+
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$24(props, ["elementType", "children"]);
|
|
2836
2904
|
const { classProps } = useDrawerStyleProps(restProps);
|
|
2837
2905
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
2838
2906
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.panel, styleProps, otherProps });
|
|
@@ -2884,7 +2952,7 @@ const DropdownProvider = DropdownContext.Provider;
|
|
|
2884
2952
|
DropdownContext.Consumer;
|
|
2885
2953
|
const useDropdownContext = () => React.useContext(DropdownContext);
|
|
2886
2954
|
|
|
2887
|
-
var __rest$
|
|
2955
|
+
var __rest$23 = (undefined && undefined.__rest) || function (s, e) {
|
|
2888
2956
|
var t = {};
|
|
2889
2957
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2890
2958
|
t[p] = s[p];
|
|
@@ -2896,7 +2964,7 @@ var __rest$22 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2896
2964
|
return t;
|
|
2897
2965
|
};
|
|
2898
2966
|
const useDropdownStyleProps = (props = { isOpen: false }) => {
|
|
2899
|
-
const { alignmentX, alignmentY, isOpen } = props, modifiedProps = __rest$
|
|
2967
|
+
const { alignmentX, alignmentY, isOpen } = props, modifiedProps = __rest$23(props, ["alignmentX", "alignmentY", "isOpen"]);
|
|
2900
2968
|
const dropdownRootClass = useClassNamePrefix('Dropdown');
|
|
2901
2969
|
const dropdownPopoverClass = `${dropdownRootClass}Popover`;
|
|
2902
2970
|
const expandedClass = isOpen ? 'is-expanded' : '';
|
|
@@ -2917,7 +2985,7 @@ const useDropdownStyleProps = (props = { isOpen: false }) => {
|
|
|
2917
2985
|
};
|
|
2918
2986
|
};
|
|
2919
2987
|
|
|
2920
|
-
var __rest$
|
|
2988
|
+
var __rest$22 = (undefined && undefined.__rest) || function (s, e) {
|
|
2921
2989
|
var t = {};
|
|
2922
2990
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2923
2991
|
t[p] = s[p];
|
|
@@ -2929,7 +2997,7 @@ var __rest$21 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2929
2997
|
return t;
|
|
2930
2998
|
};
|
|
2931
2999
|
const Dropdown = (props) => {
|
|
2932
|
-
const { children, enableAutoClose = true, fullWidthMode, id, isOpen = false, onAutoClose, onToggle, placement } = props, rest = __rest$
|
|
3000
|
+
const { children, enableAutoClose = true, fullWidthMode, id, isOpen = false, onAutoClose, onToggle, placement } = props, rest = __rest$22(props, ["children", "enableAutoClose", "fullWidthMode", "id", "isOpen", "onAutoClose", "onToggle", "placement"]);
|
|
2933
3001
|
const { classProps, props: modifiedProps } = useDropdownStyleProps(Object.assign({ isOpen }, rest));
|
|
2934
3002
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
2935
3003
|
const dropdownRef = React.useRef(null);
|
|
@@ -2952,7 +3020,7 @@ const Dropdown = (props) => {
|
|
|
2952
3020
|
};
|
|
2953
3021
|
Dropdown.spiritComponent = 'Dropdown';
|
|
2954
3022
|
|
|
2955
|
-
var __rest$
|
|
3023
|
+
var __rest$21 = (undefined && undefined.__rest) || function (s, e) {
|
|
2956
3024
|
var t = {};
|
|
2957
3025
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2958
3026
|
t[p] = s[p];
|
|
@@ -2963,12 +3031,12 @@ var __rest$20 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2963
3031
|
}
|
|
2964
3032
|
return t;
|
|
2965
3033
|
};
|
|
2966
|
-
const defaultProps$
|
|
3034
|
+
const defaultProps$C = {
|
|
2967
3035
|
elementType: 'button',
|
|
2968
3036
|
};
|
|
2969
3037
|
const DropdownTrigger = (props) => {
|
|
2970
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
2971
|
-
const { elementType: ElementTag = 'button', children } = propsWithDefaults, rest = __rest$
|
|
3038
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$C), props);
|
|
3039
|
+
const { elementType: ElementTag = 'button', children } = propsWithDefaults, rest = __rest$21(propsWithDefaults, ["elementType", "children"]);
|
|
2972
3040
|
const { id, isOpen, onToggle, fullWidthMode, triggerRef } = useDropdownContext();
|
|
2973
3041
|
const { classProps, props: modifiedProps } = useDropdownStyleProps(Object.assign({ isOpen }, rest));
|
|
2974
3042
|
const { styleProps: triggerStyleProps, props: transferProps } = useStyleProps(modifiedProps);
|
|
@@ -2978,7 +3046,7 @@ const DropdownTrigger = (props) => {
|
|
|
2978
3046
|
};
|
|
2979
3047
|
DropdownTrigger.spiritComponent = 'DropdownTrigger';
|
|
2980
3048
|
|
|
2981
|
-
var __rest$
|
|
3049
|
+
var __rest$20 = (undefined && undefined.__rest) || function (s, e) {
|
|
2982
3050
|
var t = {};
|
|
2983
3051
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2984
3052
|
t[p] = s[p];
|
|
@@ -2990,7 +3058,7 @@ var __rest$1$ = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2990
3058
|
return t;
|
|
2991
3059
|
};
|
|
2992
3060
|
const DropdownPopover = (props) => {
|
|
2993
|
-
const { children } = props, rest = __rest$
|
|
3061
|
+
const { children } = props, rest = __rest$20(props, ["children"]);
|
|
2994
3062
|
const { id, isOpen, onToggle, fullWidthMode, placement } = useDropdownContext();
|
|
2995
3063
|
const { classProps, props: modifiedProps } = useDropdownStyleProps(Object.assign({ isOpen }, rest));
|
|
2996
3064
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
@@ -3025,7 +3093,7 @@ const useDropdown = ({ dropdownRef, triggerRef, enableAutoClose, onAutoClose, })
|
|
|
3025
3093
|
};
|
|
3026
3094
|
};
|
|
3027
3095
|
|
|
3028
|
-
var __rest$
|
|
3096
|
+
var __rest$1$ = (undefined && undefined.__rest) || function (s, e) {
|
|
3029
3097
|
var t = {};
|
|
3030
3098
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3031
3099
|
t[p] = s[p];
|
|
@@ -3037,7 +3105,7 @@ var __rest$1_ = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3037
3105
|
return t;
|
|
3038
3106
|
};
|
|
3039
3107
|
const UncontrolledDropdown = (props) => {
|
|
3040
|
-
const { children, enableAutoClose = true, fullWidthMode, id, onAutoClose, placement } = props, rest = __rest$
|
|
3108
|
+
const { children, enableAutoClose = true, fullWidthMode, id, onAutoClose, placement } = props, rest = __rest$1$(props, ["children", "enableAutoClose", "fullWidthMode", "id", "onAutoClose", "placement"]);
|
|
3041
3109
|
const { classProps, props: modifiedProps } = useDropdownStyleProps(rest);
|
|
3042
3110
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3043
3111
|
const dropdownRef = React.useRef(null);
|
|
@@ -3048,7 +3116,7 @@ const UncontrolledDropdown = (props) => {
|
|
|
3048
3116
|
};
|
|
3049
3117
|
UncontrolledDropdown.spiritComponent = 'UncontrolledDropdown';
|
|
3050
3118
|
|
|
3051
|
-
var __rest$
|
|
3119
|
+
var __rest$1_ = (undefined && undefined.__rest) || function (s, e) {
|
|
3052
3120
|
var t = {};
|
|
3053
3121
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3054
3122
|
t[p] = s[p];
|
|
@@ -3060,7 +3128,7 @@ var __rest$1Z = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3060
3128
|
return t;
|
|
3061
3129
|
};
|
|
3062
3130
|
function useStackStyleProps(props) {
|
|
3063
|
-
const { hasEndDivider, hasIntermediateDividers, hasSpacing, hasStartDivider, spacing } = props, restProps = __rest$
|
|
3131
|
+
const { hasEndDivider, hasIntermediateDividers, hasSpacing, hasStartDivider, spacing } = props, restProps = __rest$1_(props, ["hasEndDivider", "hasIntermediateDividers", "hasSpacing", "hasStartDivider", "spacing"]);
|
|
3064
3132
|
const StackClass = useClassNamePrefix('Stack');
|
|
3065
3133
|
const StackBottomDividerClass = `${StackClass}--hasEndDivider`;
|
|
3066
3134
|
const StackMiddleDividersClass = `${StackClass}--hasIntermediateDividers`;
|
|
@@ -3084,7 +3152,7 @@ function useStackStyleProps(props) {
|
|
|
3084
3152
|
};
|
|
3085
3153
|
}
|
|
3086
3154
|
|
|
3087
|
-
var __rest$
|
|
3155
|
+
var __rest$1Z = (undefined && undefined.__rest) || function (s, e) {
|
|
3088
3156
|
var t = {};
|
|
3089
3157
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3090
3158
|
t[p] = s[p];
|
|
@@ -3095,7 +3163,7 @@ var __rest$1Y = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3095
3163
|
}
|
|
3096
3164
|
return t;
|
|
3097
3165
|
};
|
|
3098
|
-
const defaultProps$
|
|
3166
|
+
const defaultProps$B = {
|
|
3099
3167
|
elementType: 'div',
|
|
3100
3168
|
hasSpacing: false,
|
|
3101
3169
|
hasEndDivider: false,
|
|
@@ -3103,8 +3171,8 @@ const defaultProps$A = {
|
|
|
3103
3171
|
hasStartDivider: false,
|
|
3104
3172
|
};
|
|
3105
3173
|
const Stack = (props) => {
|
|
3106
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
3107
|
-
const { elementType: ElementTag = defaultProps$
|
|
3174
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$B), props);
|
|
3175
|
+
const { elementType: ElementTag = defaultProps$B.elementType, children } = propsWithDefaults, restProps = __rest$1Z(propsWithDefaults, ["elementType", "children"]);
|
|
3108
3176
|
const { classProps, props: modifiedProps, styleProps: stackStyle } = useStackStyleProps(restProps);
|
|
3109
3177
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3110
3178
|
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
@@ -3117,7 +3185,7 @@ const Stack = (props) => {
|
|
|
3117
3185
|
};
|
|
3118
3186
|
Stack.spiritComponent = 'Stack';
|
|
3119
3187
|
|
|
3120
|
-
var __rest$
|
|
3188
|
+
var __rest$1Y = (undefined && undefined.__rest) || function (s, e) {
|
|
3121
3189
|
var t = {};
|
|
3122
3190
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3123
3191
|
t[p] = s[p];
|
|
@@ -3129,7 +3197,7 @@ var __rest$1X = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3129
3197
|
return t;
|
|
3130
3198
|
};
|
|
3131
3199
|
const StackItem = (props) => {
|
|
3132
|
-
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$
|
|
3200
|
+
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$1Y(props, ["elementType", "children"]);
|
|
3133
3201
|
const { classProps, props: modifiedProps } = useStackStyleProps(restProps);
|
|
3134
3202
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3135
3203
|
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
@@ -3153,7 +3221,7 @@ function useEmptyStateStyleProps(props) {
|
|
|
3153
3221
|
};
|
|
3154
3222
|
}
|
|
3155
3223
|
|
|
3156
|
-
var __rest$
|
|
3224
|
+
var __rest$1X = (undefined && undefined.__rest) || function (s, e) {
|
|
3157
3225
|
var t = {};
|
|
3158
3226
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3159
3227
|
t[p] = s[p];
|
|
@@ -3165,14 +3233,14 @@ var __rest$1W = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3165
3233
|
return t;
|
|
3166
3234
|
};
|
|
3167
3235
|
const EmptyState = (props) => {
|
|
3168
|
-
const { children } = props, restProps = __rest$
|
|
3236
|
+
const { children } = props, restProps = __rest$1X(props, ["children"]);
|
|
3169
3237
|
const { classProps, props: modifiedProps } = useEmptyStateStyleProps(restProps);
|
|
3170
3238
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3171
3239
|
return (React.createElement(Stack, Object.assign({}, otherProps, { UNSAFE_className: classNames(classProps.root, styleProps.className), UNSAFE_style: styleProps.style }), children));
|
|
3172
3240
|
};
|
|
3173
3241
|
EmptyState.spiritComponent = 'EmptyState';
|
|
3174
3242
|
|
|
3175
|
-
var __rest$
|
|
3243
|
+
var __rest$1W = (undefined && undefined.__rest) || function (s, e) {
|
|
3176
3244
|
var t = {};
|
|
3177
3245
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3178
3246
|
t[p] = s[p];
|
|
@@ -3184,7 +3252,7 @@ var __rest$1V = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3184
3252
|
return t;
|
|
3185
3253
|
};
|
|
3186
3254
|
const EmptyStateSection = (props) => {
|
|
3187
|
-
const { children } = props, restProps = __rest$
|
|
3255
|
+
const { children } = props, restProps = __rest$1W(props, ["children"]);
|
|
3188
3256
|
const { classProps, props: modifiedProps } = useEmptyStateStyleProps(restProps);
|
|
3189
3257
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3190
3258
|
return (React.createElement(Stack, Object.assign({}, otherProps, { UNSAFE_className: classNames(classProps.section, styleProps.className), UNSAFE_style: styleProps.style }), children));
|
|
@@ -3216,7 +3284,7 @@ const useFieldGroupStyleProps = ({ isFluid, isRequired, validationState, }) => {
|
|
|
3216
3284
|
};
|
|
3217
3285
|
};
|
|
3218
3286
|
|
|
3219
|
-
var __rest$
|
|
3287
|
+
var __rest$1V = (undefined && undefined.__rest) || function (s, e) {
|
|
3220
3288
|
var t = {};
|
|
3221
3289
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3222
3290
|
t[p] = s[p];
|
|
@@ -3228,7 +3296,7 @@ var __rest$1U = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3228
3296
|
return t;
|
|
3229
3297
|
};
|
|
3230
3298
|
const FieldGroup = (props) => {
|
|
3231
|
-
const { 'aria-describedby': ariaDescribedBy = '', children, helperText, hasValidationIcon, id, isDisabled, isFluid, isLabelHidden, isRequired, label, validationState, validationText } = props, rest = __rest$
|
|
3299
|
+
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"]);
|
|
3232
3300
|
const { classProps } = useFieldGroupStyleProps({ isFluid, isRequired, validationState });
|
|
3233
3301
|
const { styleProps, props: transferProps } = useStyleProps(rest);
|
|
3234
3302
|
const [ids, register] = useAriaIds(ariaDescribedBy);
|
|
@@ -3257,6 +3325,7 @@ const DEFAULT_ERROR_MESSAGE_UNSUPPORTED_FILE = 'This file type is not supported'
|
|
|
3257
3325
|
const DEFAULT_ICON_NAME = 'file';
|
|
3258
3326
|
const DEFAULT_BUTTON_LABEL = 'Remove';
|
|
3259
3327
|
const DEFAULT_EDIT_BUTTON_LABEL = 'Edit';
|
|
3328
|
+
const DEFAULT_ATTACHMENT_LIST_LABEL = 'Attachments';
|
|
3260
3329
|
const FileUploaderCropCSS = {
|
|
3261
3330
|
TOP: '--file-uploader-attachment-image-top',
|
|
3262
3331
|
LEFT: '--file-uploader-attachment-image-left',
|
|
@@ -3372,7 +3441,7 @@ const useFileUploaderStyleProps = (props) => {
|
|
|
3372
3441
|
};
|
|
3373
3442
|
};
|
|
3374
3443
|
|
|
3375
|
-
var __rest$
|
|
3444
|
+
var __rest$1U = (undefined && undefined.__rest) || function (s, e) {
|
|
3376
3445
|
var t = {};
|
|
3377
3446
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3378
3447
|
t[p] = s[p];
|
|
@@ -3384,7 +3453,7 @@ var __rest$1T = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3384
3453
|
return t;
|
|
3385
3454
|
};
|
|
3386
3455
|
const FileUploader = (props) => {
|
|
3387
|
-
const { addToQueue, children, clearQueue, errorMessages, fileQueue, findInQueue, id, isFluid, onDismiss, updateQueue } = props, restProps = __rest$
|
|
3456
|
+
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"]);
|
|
3388
3457
|
const { classProps } = useFileUploaderStyleProps({ isFluid });
|
|
3389
3458
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
3390
3459
|
const contextValue = {
|
|
@@ -3557,7 +3626,7 @@ const useFileUploaderInput = (props) => {
|
|
|
3557
3626
|
return Object.assign({ isDropZoneHidden: dropZoneHidden, isDisabledByQueueLimitBehavior: disabledByQueueLimitBehavior, onChange: onChangeHandler }, dragAndDropProps);
|
|
3558
3627
|
};
|
|
3559
3628
|
|
|
3560
|
-
var __rest$
|
|
3629
|
+
var __rest$1T = (undefined && undefined.__rest) || function (s, e) {
|
|
3561
3630
|
var t = {};
|
|
3562
3631
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3563
3632
|
t[p] = s[p];
|
|
@@ -3570,7 +3639,7 @@ var __rest$1S = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3570
3639
|
};
|
|
3571
3640
|
const FileUploaderInput = (props) => {
|
|
3572
3641
|
const [isDragAndDropSupported, setIsDragAndDropSupported] = React.useState(false);
|
|
3573
|
-
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$
|
|
3642
|
+
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"]);
|
|
3574
3643
|
const { isDisabledByQueueLimitBehavior, isDragging, isDropZoneHidden, onChange, onDragEnter, onDragLeave, onDragOver, onDrop, } = useFileUploaderInput({
|
|
3575
3644
|
accept,
|
|
3576
3645
|
isMultiple,
|
|
@@ -3614,7 +3683,7 @@ const FileUploaderInput = (props) => {
|
|
|
3614
3683
|
};
|
|
3615
3684
|
FileUploaderInput.spiritComponent = 'FileUploaderInput';
|
|
3616
3685
|
|
|
3617
|
-
var __rest$
|
|
3686
|
+
var __rest$1S = (undefined && undefined.__rest) || function (s, e) {
|
|
3618
3687
|
var t = {};
|
|
3619
3688
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3620
3689
|
t[p] = s[p];
|
|
@@ -3626,7 +3695,7 @@ var __rest$1R = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3626
3695
|
return t;
|
|
3627
3696
|
};
|
|
3628
3697
|
const FileUploaderList = (props) => {
|
|
3629
|
-
const { label, id, attachmentComponent, inputName, hasImagePreview } = props, restProps = __rest$
|
|
3698
|
+
const { label = DEFAULT_ATTACHMENT_LIST_LABEL, id, attachmentComponent, inputName, hasImagePreview } = props, restProps = __rest$1S(props, ["label", "id", "attachmentComponent", "inputName", "hasImagePreview"]);
|
|
3630
3699
|
const { classProps } = useFileUploaderStyleProps();
|
|
3631
3700
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
3632
3701
|
const { fileQueue, onDismiss } = useFileUploaderContext();
|
|
@@ -3649,7 +3718,7 @@ const FileUploaderList = (props) => {
|
|
|
3649
3718
|
};
|
|
3650
3719
|
FileUploaderList.spiritComponent = 'FileUploaderList';
|
|
3651
3720
|
|
|
3652
|
-
var __rest$
|
|
3721
|
+
var __rest$1R = (undefined && undefined.__rest) || function (s, e) {
|
|
3653
3722
|
var t = {};
|
|
3654
3723
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3655
3724
|
t[p] = s[p];
|
|
@@ -3661,7 +3730,7 @@ var __rest$1Q = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3661
3730
|
return t;
|
|
3662
3731
|
};
|
|
3663
3732
|
const AttachmentActionButton = (props) => {
|
|
3664
|
-
const { name = 'edit', children } = props, restProps = __rest$
|
|
3733
|
+
const { name = 'edit', children } = props, restProps = __rest$1R(props, ["name", "children"]);
|
|
3665
3734
|
const { classProps } = useFileUploaderStyleProps();
|
|
3666
3735
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
3667
3736
|
return (React.createElement("button", Object.assign({ type: "button" }, transferProps, styleProps, { className: classNames(classProps.attachment.button, styleProps.className) }),
|
|
@@ -3670,7 +3739,7 @@ const AttachmentActionButton = (props) => {
|
|
|
3670
3739
|
};
|
|
3671
3740
|
AttachmentActionButton.spiritComponent = 'AttachmentActionButton';
|
|
3672
3741
|
|
|
3673
|
-
var __rest$
|
|
3742
|
+
var __rest$1Q = (undefined && undefined.__rest) || function (s, e) {
|
|
3674
3743
|
var t = {};
|
|
3675
3744
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3676
3745
|
t[p] = s[p];
|
|
@@ -3682,7 +3751,7 @@ var __rest$1P = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3682
3751
|
return t;
|
|
3683
3752
|
};
|
|
3684
3753
|
const AttachmentDismissButton = (props) => {
|
|
3685
|
-
const { children } = props, restProps = __rest$
|
|
3754
|
+
const { children } = props, restProps = __rest$1Q(props, ["children"]);
|
|
3686
3755
|
const { classProps } = useFileUploaderStyleProps();
|
|
3687
3756
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
3688
3757
|
return (React.createElement("button", Object.assign({ type: "button" }, transferProps, styleProps, { className: classNames(classProps.attachment.button, styleProps.className) }),
|
|
@@ -3691,12 +3760,12 @@ const AttachmentDismissButton = (props) => {
|
|
|
3691
3760
|
};
|
|
3692
3761
|
AttachmentDismissButton.spiritComponent = 'AttachmentDismissButton';
|
|
3693
3762
|
|
|
3694
|
-
const defaultProps$
|
|
3763
|
+
const defaultProps$A = {
|
|
3695
3764
|
meta: undefined,
|
|
3696
3765
|
imageObjectFit: 'cover',
|
|
3697
3766
|
};
|
|
3698
3767
|
const AttachmentImagePreview = (props) => {
|
|
3699
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
3768
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$A), props);
|
|
3700
3769
|
const { label, imagePreview, meta, imageObjectFit } = propsWithDefaults;
|
|
3701
3770
|
const { classProps } = useFileUploaderStyleProps({ meta, imageObjectFit });
|
|
3702
3771
|
const { imageCropStyles, attachmentStyles } = classProps;
|
|
@@ -3780,7 +3849,7 @@ const useFileUploaderAttachment = ({ attachmentRef, file, name, meta, onError, }
|
|
|
3780
3849
|
}, [attachmentRef, file, name, meta, onError]);
|
|
3781
3850
|
};
|
|
3782
3851
|
|
|
3783
|
-
var __rest$
|
|
3852
|
+
var __rest$1P = (undefined && undefined.__rest) || function (s, e) {
|
|
3784
3853
|
var t = {};
|
|
3785
3854
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3786
3855
|
t[p] = s[p];
|
|
@@ -3792,7 +3861,7 @@ var __rest$1O = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3792
3861
|
return t;
|
|
3793
3862
|
};
|
|
3794
3863
|
const FileUploaderAttachment = (props) => {
|
|
3795
|
-
const { editText, file, hasImagePreview, iconName = DEFAULT_ICON_NAME, id, imageObjectFit, label, meta, name, onDismiss, onEdit, onError, removeText } = props, restProps = __rest$
|
|
3864
|
+
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"]);
|
|
3796
3865
|
const [imagePreview, setImagePreview] = React.useState('');
|
|
3797
3866
|
const { classProps } = useFileUploaderStyleProps();
|
|
3798
3867
|
const { styleProps, props: transferProps } = useStyleProps(restProps);
|
|
@@ -3813,8 +3882,8 @@ const FileUploaderAttachment = (props) => {
|
|
|
3813
3882
|
React.createElement("span", { className: classProps.attachment.name },
|
|
3814
3883
|
React.createElement("span", { className: useClassNamePrefix('text-truncate') }, label)),
|
|
3815
3884
|
onEdit && (React.createElement("span", { className: classProps.attachment.slot },
|
|
3816
|
-
React.createElement(AttachmentActionButton, { onClick: onEditHandler }, editText
|
|
3817
|
-
React.createElement(AttachmentDismissButton, { onClick: dismissHandler }, removeText
|
|
3885
|
+
React.createElement(AttachmentActionButton, { onClick: onEditHandler }, editText))),
|
|
3886
|
+
React.createElement(AttachmentDismissButton, { onClick: dismissHandler }, removeText)));
|
|
3818
3887
|
};
|
|
3819
3888
|
FileUploaderAttachment.spiritComponent = 'FileUploaderAttachment';
|
|
3820
3889
|
|
|
@@ -3867,7 +3936,7 @@ const useFileQueue = () => {
|
|
|
3867
3936
|
};
|
|
3868
3937
|
};
|
|
3869
3938
|
|
|
3870
|
-
var __rest$
|
|
3939
|
+
var __rest$1O = (undefined && undefined.__rest) || function (s, e) {
|
|
3871
3940
|
var t = {};
|
|
3872
3941
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3873
3942
|
t[p] = s[p];
|
|
@@ -3879,7 +3948,7 @@ var __rest$1N = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3879
3948
|
return t;
|
|
3880
3949
|
};
|
|
3881
3950
|
const UncontrolledFileUploader = (props) => {
|
|
3882
|
-
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$
|
|
3951
|
+
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"]);
|
|
3883
3952
|
const { fileQueue, addToQueue, clearQueue, onDismiss, findInQueue, updateQueue } = useFileQueue();
|
|
3884
3953
|
React.useEffect(() => {
|
|
3885
3954
|
if (onChange) {
|
|
@@ -3907,7 +3976,7 @@ const useFooterStyleProps = (props) => {
|
|
|
3907
3976
|
};
|
|
3908
3977
|
};
|
|
3909
3978
|
|
|
3910
|
-
var __rest$
|
|
3979
|
+
var __rest$1N = (undefined && undefined.__rest) || function (s, e) {
|
|
3911
3980
|
var t = {};
|
|
3912
3981
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3913
3982
|
t[p] = s[p];
|
|
@@ -3920,23 +3989,25 @@ var __rest$1M = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3920
3989
|
};
|
|
3921
3990
|
const defaultStyleProps = {
|
|
3922
3991
|
backgroundColor: BackgroundColors.SECONDARY,
|
|
3992
|
+
elementType: 'footer',
|
|
3923
3993
|
paddingBottom: PADDING_BOTTOM,
|
|
3924
3994
|
paddingTop: PADDING_TOP,
|
|
3925
3995
|
};
|
|
3926
3996
|
const Footer = (props) => {
|
|
3927
3997
|
const propsWithDefaults = Object.assign(Object.assign({}, defaultStyleProps), props);
|
|
3928
|
-
const { children, backgroundColor } = propsWithDefaults, restProps = __rest$
|
|
3998
|
+
const { elementType: ElementTag = defaultStyleProps.elementType, children, backgroundColor } = propsWithDefaults, restProps = __rest$1N(propsWithDefaults, ["elementType", "children", "backgroundColor"]);
|
|
3929
3999
|
const { classProps } = useFooterStyleProps({ backgroundColor });
|
|
3930
4000
|
const { styleProps, props: otherProps } = useStyleProps(restProps, {
|
|
3931
4001
|
paddingBottom: PaddingStyleProps.paddingBottom,
|
|
3932
4002
|
paddingTop: PaddingStyleProps.paddingTop,
|
|
3933
4003
|
textAlignment: TextStyleProps.textAlignment,
|
|
3934
4004
|
});
|
|
3935
|
-
|
|
4005
|
+
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps });
|
|
4006
|
+
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
3936
4007
|
};
|
|
3937
4008
|
Footer.spiritComponent = 'Footer';
|
|
3938
4009
|
|
|
3939
|
-
var __rest$
|
|
4010
|
+
var __rest$1M = (undefined && undefined.__rest) || function (s, e) {
|
|
3940
4011
|
var t = {};
|
|
3941
4012
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3942
4013
|
t[p] = s[p];
|
|
@@ -3948,7 +4019,7 @@ var __rest$1L = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3948
4019
|
return t;
|
|
3949
4020
|
};
|
|
3950
4021
|
function useGridStyleProps(props) {
|
|
3951
|
-
const { alignmentX, alignmentY, cols, spacing, spacingX, spacingY } = props, restProps = __rest$
|
|
4022
|
+
const { alignmentX, alignmentY, cols, spacing, spacingX, spacingY } = props, restProps = __rest$1M(props, ["alignmentX", "alignmentY", "cols", "spacing", "spacingX", "spacingY"]);
|
|
3952
4023
|
const gridClass = useClassNamePrefix('Grid');
|
|
3953
4024
|
const gridStyle = Object.assign(Object.assign(Object.assign(Object.assign({}, useSpacingStyle(spacing, 'grid', DirectionAxis.X)), useSpacingStyle(spacing, 'grid', DirectionAxis.Y)), useSpacingStyle(spacingX, 'grid', DirectionAxis.X)), useSpacingStyle(spacingY, 'grid', DirectionAxis.Y));
|
|
3954
4025
|
function generateColsClasses(componentClass, property, type) {
|
|
@@ -3975,7 +4046,7 @@ function useGridStyleProps(props) {
|
|
|
3975
4046
|
};
|
|
3976
4047
|
}
|
|
3977
4048
|
|
|
3978
|
-
var __rest$
|
|
4049
|
+
var __rest$1L = (undefined && undefined.__rest) || function (s, e) {
|
|
3979
4050
|
var t = {};
|
|
3980
4051
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3981
4052
|
t[p] = s[p];
|
|
@@ -3986,20 +4057,22 @@ var __rest$1K = (undefined && undefined.__rest) || function (s, e) {
|
|
|
3986
4057
|
}
|
|
3987
4058
|
return t;
|
|
3988
4059
|
};
|
|
3989
|
-
const defaultProps$
|
|
4060
|
+
const defaultProps$z = {
|
|
3990
4061
|
alignmentX: AlignmentXExtended.STRETCH,
|
|
3991
4062
|
alignmentY: AlignmentYExtended.STRETCH,
|
|
3992
4063
|
elementType: 'div',
|
|
3993
4064
|
};
|
|
3994
4065
|
const Grid = (props) => {
|
|
3995
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
3996
|
-
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$
|
|
4066
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$z), props);
|
|
4067
|
+
const { elementType: ElementTag = 'div', children } = propsWithDefaults, restProps = __rest$1L(propsWithDefaults, ["elementType", "children"]);
|
|
3997
4068
|
const { classProps, props: modifiedProps, styleProps: gridStyle } = useGridStyleProps(restProps);
|
|
3998
4069
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
3999
4070
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps, gridStyle });
|
|
4000
4071
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
4001
4072
|
};
|
|
4002
4073
|
Grid.spiritComponent = 'Grid';
|
|
4074
|
+
Grid.spiritDefaultElement = 'div';
|
|
4075
|
+
Grid.spiritDefaultProps = null;
|
|
4003
4076
|
|
|
4004
4077
|
const setStyleProperty = (styleObject, propertyName, value) => {
|
|
4005
4078
|
styleObject[propertyName] = value;
|
|
@@ -4021,22 +4094,23 @@ const setGridItemStyle = (styleObject, baseVarName, propValue) => {
|
|
|
4021
4094
|
function useGridItemStyleProps(props) {
|
|
4022
4095
|
const gridItemClass = useClassNamePrefix('GridItem');
|
|
4023
4096
|
const gridItemStyle = {};
|
|
4024
|
-
const
|
|
4097
|
+
const propsClone = Object.assign({}, props);
|
|
4098
|
+
const typePropNames = Object.keys(propsClone).filter((propName) => propName.startsWith('column') || propName.startsWith('row'));
|
|
4025
4099
|
typePropNames.forEach((propName) => {
|
|
4026
4100
|
const type = propName.startsWith('column') ? 'column' : 'row';
|
|
4027
|
-
if (
|
|
4028
|
-
setGridItemStyle(gridItemStyle, `grid-item-${type}-${propName.replace(type, '').toLowerCase()}`,
|
|
4101
|
+
if (propsClone[propName]) {
|
|
4102
|
+
setGridItemStyle(gridItemStyle, `grid-item-${type}-${propName.replace(type, '').toLowerCase()}`, propsClone[propName]);
|
|
4029
4103
|
}
|
|
4030
|
-
delete
|
|
4104
|
+
delete propsClone[propName];
|
|
4031
4105
|
});
|
|
4032
4106
|
return {
|
|
4033
4107
|
classProps: gridItemClass,
|
|
4034
|
-
props,
|
|
4108
|
+
props: propsClone,
|
|
4035
4109
|
styleProps: gridItemStyle,
|
|
4036
4110
|
};
|
|
4037
4111
|
}
|
|
4038
4112
|
|
|
4039
|
-
var __rest$
|
|
4113
|
+
var __rest$1K = (undefined && undefined.__rest) || function (s, e) {
|
|
4040
4114
|
var t = {};
|
|
4041
4115
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4042
4116
|
t[p] = s[p];
|
|
@@ -4048,13 +4122,15 @@ var __rest$1J = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4048
4122
|
return t;
|
|
4049
4123
|
};
|
|
4050
4124
|
const GridItem = (props) => {
|
|
4051
|
-
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$
|
|
4125
|
+
const { elementType: ElementTag = 'div', children } = props, restProps = __rest$1K(props, ["elementType", "children"]);
|
|
4052
4126
|
const { classProps, styleProps: gridItemStyle, props: modifiedProps } = useGridItemStyleProps(restProps);
|
|
4053
4127
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
4054
4128
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps, styleProps, otherProps, gridItemStyle });
|
|
4055
4129
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
4056
4130
|
};
|
|
4057
4131
|
GridItem.spiritComponent = 'GridItem';
|
|
4132
|
+
GridItem.spiritDefaultElement = 'div';
|
|
4133
|
+
GridItem.spiritDefaultProps = null;
|
|
4058
4134
|
|
|
4059
4135
|
const HEADER_COLOR_DEFAULT = 'primary';
|
|
4060
4136
|
const HEADER_ACTIONS_COLOR_DEFAULT = 'primary';
|
|
@@ -4115,7 +4191,7 @@ const useHeaderStyleProps = ({ actionsColor = HEADER_ACTIONS_COLOR_DEFAULT, colo
|
|
|
4115
4191
|
};
|
|
4116
4192
|
};
|
|
4117
4193
|
|
|
4118
|
-
var __rest$
|
|
4194
|
+
var __rest$1J = (undefined && undefined.__rest) || function (s, e) {
|
|
4119
4195
|
var t = {};
|
|
4120
4196
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4121
4197
|
t[p] = s[p];
|
|
@@ -4127,7 +4203,7 @@ var __rest$1I = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4127
4203
|
return t;
|
|
4128
4204
|
};
|
|
4129
4205
|
const Header = (props) => {
|
|
4130
|
-
const { children, color = HEADER_COLOR_DEFAULT, isSimple } = props, restProps = __rest$
|
|
4206
|
+
const { children, color = HEADER_COLOR_DEFAULT, isSimple } = props, restProps = __rest$1J(props, ["children", "color", "isSimple"]);
|
|
4131
4207
|
const { classProps } = useHeaderStyleProps({ color, isSimple });
|
|
4132
4208
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4133
4209
|
useDeprecationMessage({
|
|
@@ -4148,7 +4224,7 @@ const HeaderButton = (props) => {
|
|
|
4148
4224
|
};
|
|
4149
4225
|
HeaderButton.spiritComponent = 'HeaderButton';
|
|
4150
4226
|
|
|
4151
|
-
var __rest$
|
|
4227
|
+
var __rest$1I = (undefined && undefined.__rest) || function (s, e) {
|
|
4152
4228
|
var t = {};
|
|
4153
4229
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4154
4230
|
t[p] = s[p];
|
|
@@ -4159,12 +4235,12 @@ var __rest$1H = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4159
4235
|
}
|
|
4160
4236
|
return t;
|
|
4161
4237
|
};
|
|
4162
|
-
const defaultProps$
|
|
4238
|
+
const defaultProps$y = {
|
|
4163
4239
|
isAtEnd: false,
|
|
4164
4240
|
};
|
|
4165
4241
|
const HeaderDesktopActions = (props) => {
|
|
4166
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
4167
|
-
const { isAtEnd } = propsWithDefaults, restProps = __rest$
|
|
4242
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$y), props);
|
|
4243
|
+
const { isAtEnd } = propsWithDefaults, restProps = __rest$1I(propsWithDefaults, ["isAtEnd"]);
|
|
4168
4244
|
const { classProps } = useHeaderStyleProps({ hasActionsAtEnd: isAtEnd });
|
|
4169
4245
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4170
4246
|
return (React.createElement("nav", Object.assign({}, otherProps, { className: classNames(classProps.headerDesktopActions, styleProps.className), style: styleProps.style })));
|
|
@@ -4181,7 +4257,7 @@ const HeaderDialogProvider = HeaderDialogContext.Provider;
|
|
|
4181
4257
|
const HeaderDialogConsumer = HeaderDialogContext.Consumer;
|
|
4182
4258
|
const useHeaderDialogContext = () => React.useContext(HeaderDialogContext);
|
|
4183
4259
|
|
|
4184
|
-
var __rest$
|
|
4260
|
+
var __rest$1H = (undefined && undefined.__rest) || function (s, e) {
|
|
4185
4261
|
var t = {};
|
|
4186
4262
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4187
4263
|
t[p] = s[p];
|
|
@@ -4193,7 +4269,7 @@ var __rest$1G = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4193
4269
|
return t;
|
|
4194
4270
|
};
|
|
4195
4271
|
const HeaderDialog = (props) => {
|
|
4196
|
-
const { children, id, isOpen, onClose } = props, restProps = __rest$
|
|
4272
|
+
const { children, id, isOpen, onClose } = props, restProps = __rest$1H(props, ["children", "id", "isOpen", "onClose"]);
|
|
4197
4273
|
const { classProps } = useHeaderStyleProps();
|
|
4198
4274
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4199
4275
|
const providerValue = { id, isOpen, onClose };
|
|
@@ -4205,7 +4281,7 @@ const HeaderDialog = (props) => {
|
|
|
4205
4281
|
};
|
|
4206
4282
|
HeaderDialog.spiritComponent = 'HeaderDialog';
|
|
4207
4283
|
|
|
4208
|
-
var __rest$
|
|
4284
|
+
var __rest$1G = (undefined && undefined.__rest) || function (s, e) {
|
|
4209
4285
|
var t = {};
|
|
4210
4286
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4211
4287
|
t[p] = s[p];
|
|
@@ -4217,7 +4293,7 @@ var __rest$1F = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4217
4293
|
return t;
|
|
4218
4294
|
};
|
|
4219
4295
|
const HeaderDialogActions = (props) => {
|
|
4220
|
-
const { color = HEADER_ACTIONS_COLOR_DEFAULT } = props, restProps = __rest$
|
|
4296
|
+
const { color = HEADER_ACTIONS_COLOR_DEFAULT } = props, restProps = __rest$1G(props, ["color"]);
|
|
4221
4297
|
const { classProps } = useHeaderStyleProps({ actionsColor: color });
|
|
4222
4298
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4223
4299
|
return (React.createElement("nav", Object.assign({}, otherProps, { className: classNames(classProps.headerDialogActions, styleProps.className), style: styleProps.style })));
|
|
@@ -4231,7 +4307,7 @@ const HeaderDialogButton = (props) => {
|
|
|
4231
4307
|
};
|
|
4232
4308
|
HeaderDialogButton.spiritComponent = 'HeaderDialogButton';
|
|
4233
4309
|
|
|
4234
|
-
var __rest$
|
|
4310
|
+
var __rest$1F = (undefined && undefined.__rest) || function (s, e) {
|
|
4235
4311
|
var t = {};
|
|
4236
4312
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4237
4313
|
t[p] = s[p];
|
|
@@ -4243,7 +4319,7 @@ var __rest$1E = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4243
4319
|
return t;
|
|
4244
4320
|
};
|
|
4245
4321
|
const HeaderDialogCloseButton = (props) => {
|
|
4246
|
-
const { label = HEADER_DIALOG_CLOSE_BUTTON_LABEL_DEFAULT, onClick } = props, restProps = __rest$
|
|
4322
|
+
const { label = HEADER_DIALOG_CLOSE_BUTTON_LABEL_DEFAULT, onClick } = props, restProps = __rest$1F(props, ["label", "onClick"]);
|
|
4247
4323
|
const { classProps } = useHeaderStyleProps();
|
|
4248
4324
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4249
4325
|
const { id, isOpen, onClose } = useHeaderDialogContext();
|
|
@@ -4258,7 +4334,7 @@ const HeaderDialogCloseButton = (props) => {
|
|
|
4258
4334
|
};
|
|
4259
4335
|
HeaderDialogCloseButton.spiritComponent = 'HeaderDialogCloseButton';
|
|
4260
4336
|
|
|
4261
|
-
var __rest$
|
|
4337
|
+
var __rest$1E = (undefined && undefined.__rest) || function (s, e) {
|
|
4262
4338
|
var t = {};
|
|
4263
4339
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4264
4340
|
t[p] = s[p];
|
|
@@ -4270,7 +4346,7 @@ var __rest$1D = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4270
4346
|
return t;
|
|
4271
4347
|
};
|
|
4272
4348
|
const _HeaderDialogLink = (props, ref) => {
|
|
4273
|
-
const { elementType: ElementTag = 'a', children, isCurrent } = props, restProps = __rest$
|
|
4349
|
+
const { elementType: ElementTag = 'a', children, isCurrent } = props, restProps = __rest$1E(props, ["elementType", "children", "isCurrent"]);
|
|
4274
4350
|
const { classProps } = useHeaderStyleProps({ isCurrentLink: isCurrent });
|
|
4275
4351
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4276
4352
|
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
@@ -4304,7 +4380,7 @@ const HeaderDialogText = (props) => {
|
|
|
4304
4380
|
};
|
|
4305
4381
|
HeaderDialogText.spiritComponent = 'HeaderDialogText';
|
|
4306
4382
|
|
|
4307
|
-
var __rest$
|
|
4383
|
+
var __rest$1D = (undefined && undefined.__rest) || function (s, e) {
|
|
4308
4384
|
var t = {};
|
|
4309
4385
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4310
4386
|
t[p] = s[p];
|
|
@@ -4316,7 +4392,7 @@ var __rest$1C = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4316
4392
|
return t;
|
|
4317
4393
|
};
|
|
4318
4394
|
const _HeaderLink = (props, ref) => {
|
|
4319
|
-
const { elementType: ElementTag = 'a', children, isCurrent } = props, restProps = __rest$
|
|
4395
|
+
const { elementType: ElementTag = 'a', children, isCurrent } = props, restProps = __rest$1D(props, ["elementType", "children", "isCurrent"]);
|
|
4320
4396
|
const { classProps } = useHeaderStyleProps({ isCurrentLink: isCurrent });
|
|
4321
4397
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4322
4398
|
const mergedStyleProps = mergeStyleProps(ElementTag, {
|
|
@@ -4329,7 +4405,7 @@ const _HeaderLink = (props, ref) => {
|
|
|
4329
4405
|
const HeaderLink = React.forwardRef(_HeaderLink);
|
|
4330
4406
|
HeaderLink.spiritComponent = 'HeaderLink';
|
|
4331
4407
|
|
|
4332
|
-
var __rest$
|
|
4408
|
+
var __rest$1C = (undefined && undefined.__rest) || function (s, e) {
|
|
4333
4409
|
var t = {};
|
|
4334
4410
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4335
4411
|
t[p] = s[p];
|
|
@@ -4341,7 +4417,7 @@ var __rest$1B = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4341
4417
|
return t;
|
|
4342
4418
|
};
|
|
4343
4419
|
const HeaderMobileActions = (props) => {
|
|
4344
|
-
const { children, dialogId, menuToggleLabel = HEADER_MENU_TOGGLE_LABEL_DEFAULT, isOpen, onOpen } = props, restProps = __rest$
|
|
4420
|
+
const { children, dialogId, menuToggleLabel = HEADER_MENU_TOGGLE_LABEL_DEFAULT, isOpen, onOpen } = props, restProps = __rest$1C(props, ["children", "dialogId", "menuToggleLabel", "isOpen", "onOpen"]);
|
|
4345
4421
|
const { classProps } = useHeaderStyleProps();
|
|
4346
4422
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4347
4423
|
return (React.createElement("div", Object.assign({}, otherProps, { className: classNames(classProps.headerMobileActions, styleProps.className), style: styleProps.style }),
|
|
@@ -4366,7 +4442,7 @@ const HeaderNavItem = (props) => {
|
|
|
4366
4442
|
};
|
|
4367
4443
|
HeaderNavItem.spiritComponent = 'HeaderNavItem';
|
|
4368
4444
|
|
|
4369
|
-
var __rest$
|
|
4445
|
+
var __rest$1B = (undefined && undefined.__rest) || function (s, e) {
|
|
4370
4446
|
var t = {};
|
|
4371
4447
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4372
4448
|
t[p] = s[p];
|
|
@@ -4378,7 +4454,7 @@ var __rest$1A = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4378
4454
|
return t;
|
|
4379
4455
|
};
|
|
4380
4456
|
function useHeadingStyleProps(props) {
|
|
4381
|
-
const { emphasis, size, textColor } = props, restProps = __rest$
|
|
4457
|
+
const { emphasis, size, textColor } = props, restProps = __rest$1B(props, ["emphasis", "size", "textColor"]);
|
|
4382
4458
|
const headingClass = useClassNamePrefix('typography-heading');
|
|
4383
4459
|
const headingTextColorClass = useClassNamePrefix(textColor ? `text-${textColor}` : '');
|
|
4384
4460
|
const className = classNames(`${headingClass}-${size}-${emphasis}`, {
|
|
@@ -4390,7 +4466,7 @@ function useHeadingStyleProps(props) {
|
|
|
4390
4466
|
};
|
|
4391
4467
|
}
|
|
4392
4468
|
|
|
4393
|
-
var __rest$
|
|
4469
|
+
var __rest$1A = (undefined && undefined.__rest) || function (s, e) {
|
|
4394
4470
|
var t = {};
|
|
4395
4471
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4396
4472
|
t[p] = s[p];
|
|
@@ -4401,13 +4477,13 @@ var __rest$1z = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4401
4477
|
}
|
|
4402
4478
|
return t;
|
|
4403
4479
|
};
|
|
4404
|
-
const defaultProps$
|
|
4480
|
+
const defaultProps$x = {
|
|
4405
4481
|
emphasis: Emphasis.BOLD,
|
|
4406
4482
|
size: SizesExtended.MEDIUM,
|
|
4407
4483
|
};
|
|
4408
4484
|
const Heading = (props) => {
|
|
4409
|
-
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$
|
|
4410
|
-
const { elementType: ElementTag, children } = propsWithDefaults, restProps = __rest$
|
|
4485
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$x), props);
|
|
4486
|
+
const { elementType: ElementTag, children } = propsWithDefaults, restProps = __rest$1A(propsWithDefaults, ["elementType", "children"]);
|
|
4411
4487
|
const { classProps, props: modifiedProps } = useHeadingStyleProps(Object.assign({}, restProps));
|
|
4412
4488
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps, {
|
|
4413
4489
|
isTextBalanced: HeadingStyleProps.isTextBalanced,
|
|
@@ -4420,6 +4496,32 @@ const Heading = (props) => {
|
|
|
4420
4496
|
};
|
|
4421
4497
|
Heading.spiritComponent = 'Heading';
|
|
4422
4498
|
|
|
4499
|
+
var __rest$1z = (undefined && undefined.__rest) || function (s, e) {
|
|
4500
|
+
var t = {};
|
|
4501
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4502
|
+
t[p] = s[p];
|
|
4503
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
4504
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4505
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
4506
|
+
t[p[i]] = s[p[i]];
|
|
4507
|
+
}
|
|
4508
|
+
return t;
|
|
4509
|
+
};
|
|
4510
|
+
const defaultProps$w = {
|
|
4511
|
+
elementType: 'span',
|
|
4512
|
+
};
|
|
4513
|
+
const Hidden = (props) => {
|
|
4514
|
+
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$w), props);
|
|
4515
|
+
const { elementType: ElementTag = 'span', children, on, from } = propsWithDefaults, restProps = __rest$1z(propsWithDefaults, ["elementType", "children", "on", "from"]);
|
|
4516
|
+
const stylePropsWithMapping = Object.assign(Object.assign({}, restProps), { hideOn: on || restProps.hideOn, hideFrom: from || restProps.hideFrom });
|
|
4517
|
+
const { styleProps, props: otherProps } = useStyleProps(stylePropsWithMapping);
|
|
4518
|
+
const mergedStyleProps = mergeStyleProps(ElementTag, { styleProps });
|
|
4519
|
+
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps), children));
|
|
4520
|
+
};
|
|
4521
|
+
Hidden.spiritComponent = 'Hidden';
|
|
4522
|
+
Hidden.spiritDefaultElement = 'span';
|
|
4523
|
+
Hidden.spiritDefaultProps = null;
|
|
4524
|
+
|
|
4423
4525
|
const IconBoxShapes = {
|
|
4424
4526
|
ROUNDED: 'rounded',
|
|
4425
4527
|
SQUARE: 'square',
|
|
@@ -4769,6 +4871,8 @@ const ModalBody = (_a) => {
|
|
|
4769
4871
|
};
|
|
4770
4872
|
ModalBody.spiritComponent = 'ModalBody';
|
|
4771
4873
|
|
|
4874
|
+
const MODAL_CLOSE_BUTTON_LABEL_DEFAULT = 'Close';
|
|
4875
|
+
|
|
4772
4876
|
var __rest$1q = (undefined && undefined.__rest) || function (s, e) {
|
|
4773
4877
|
var t = {};
|
|
4774
4878
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -4781,7 +4885,7 @@ var __rest$1q = (undefined && undefined.__rest) || function (s, e) {
|
|
|
4781
4885
|
return t;
|
|
4782
4886
|
};
|
|
4783
4887
|
const ModalCloseButton = (_a) => {
|
|
4784
|
-
var { label =
|
|
4888
|
+
var { label = MODAL_CLOSE_BUTTON_LABEL_DEFAULT, onClose, id, isOpen } = _a, restProps = __rest$1q(_a, ["label", "onClose", "id", "isOpen"]);
|
|
4785
4889
|
return (React.createElement(Button, Object.assign({}, restProps, { isSymmetrical: true, color: "tertiary", onClick: onClose, "aria-expanded": isOpen, "aria-controls": id }),
|
|
4786
4890
|
React.createElement(Icon, { name: "close" }),
|
|
4787
4891
|
React.createElement(VisuallyHidden, null, label)));
|
|
@@ -4807,8 +4911,7 @@ const setCustomHeight = (baseVarName, propValue) => {
|
|
|
4807
4911
|
var _a;
|
|
4808
4912
|
const suffix = key === 'mobile' ? '' : `-${key}`;
|
|
4809
4913
|
const propName = `--${baseVarName}${suffix}`;
|
|
4810
|
-
acc[propName]
|
|
4811
|
-
return acc;
|
|
4914
|
+
return Object.assign(Object.assign({}, acc), { [propName]: (_a = propValue[key]) === null || _a === void 0 ? void 0 : _a.toString() });
|
|
4812
4915
|
}, {});
|
|
4813
4916
|
}
|
|
4814
4917
|
const propName = `--${baseVarName}`;
|
|
@@ -4887,7 +4990,7 @@ const defaultProps$t = {
|
|
|
4887
4990
|
};
|
|
4888
4991
|
const ModalHeader = (props) => {
|
|
4889
4992
|
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$t), props);
|
|
4890
|
-
const { children, closeLabel, hasCloseButton } = propsWithDefaults, restProps = __rest$1m(propsWithDefaults, ["children", "closeLabel", "hasCloseButton"]);
|
|
4993
|
+
const { children, closeLabel = MODAL_CLOSE_BUTTON_LABEL_DEFAULT, hasCloseButton } = propsWithDefaults, restProps = __rest$1m(propsWithDefaults, ["children", "closeLabel", "hasCloseButton"]);
|
|
4891
4994
|
const { classProps } = useModalStyleProps();
|
|
4892
4995
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
4893
4996
|
const { id, isOpen, onClose } = useModalContext();
|
|
@@ -5098,6 +5201,10 @@ const Pagination = (props) => {
|
|
|
5098
5201
|
};
|
|
5099
5202
|
Pagination.spiritComponent = 'Pagination';
|
|
5100
5203
|
|
|
5204
|
+
const PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Previous';
|
|
5205
|
+
const PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Next';
|
|
5206
|
+
const PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX = 'Go to page';
|
|
5207
|
+
|
|
5101
5208
|
var __rest$1f = (undefined && undefined.__rest) || function (s, e) {
|
|
5102
5209
|
var t = {};
|
|
5103
5210
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -5110,7 +5217,9 @@ var __rest$1f = (undefined && undefined.__rest) || function (s, e) {
|
|
|
5110
5217
|
return t;
|
|
5111
5218
|
};
|
|
5112
5219
|
const _PaginationButtonLink = (props, ref) => {
|
|
5113
|
-
const _a = props, { direction, accessibilityLabel
|
|
5220
|
+
const _a = props, { direction, accessibilityLabel = direction === 'previous'
|
|
5221
|
+
? PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL
|
|
5222
|
+
: PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL } = _a, restProps = __rest$1f(_a, ["direction", "accessibilityLabel"]);
|
|
5114
5223
|
const iconType = {
|
|
5115
5224
|
previous: 'chevron-left',
|
|
5116
5225
|
next: 'chevron-right',
|
|
@@ -5154,19 +5263,17 @@ var __rest$1d = (undefined && undefined.__rest) || function (s, e) {
|
|
|
5154
5263
|
};
|
|
5155
5264
|
const _PaginationLink = (props, ref) => {
|
|
5156
5265
|
const { elementType: ElementTag = 'a', accessibilityLabel, isCurrent, pageNumber } = props, restProps = __rest$1d(props, ["elementType", "accessibilityLabel", "isCurrent", "pageNumber"]);
|
|
5266
|
+
const visuallyHiddenLabel = accessibilityLabel || `${PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX} ${pageNumber}`;
|
|
5157
5267
|
const { classProps } = usePaginationStyleProps({ isCurrent });
|
|
5158
5268
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
5159
5269
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.link, styleProps, otherProps });
|
|
5160
|
-
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps, { ref: ref }),
|
|
5161
|
-
React.createElement(VisuallyHidden, null,
|
|
5270
|
+
return (React.createElement(ElementTag, Object.assign({}, (isCurrent && { 'aria-current': 'page' }), otherProps, mergedStyleProps, { ref: ref }),
|
|
5271
|
+
React.createElement(VisuallyHidden, null, visuallyHiddenLabel),
|
|
5162
5272
|
React.createElement("span", { "aria-hidden": "true" }, pageNumber)));
|
|
5163
5273
|
};
|
|
5164
5274
|
const PaginationLink = React.forwardRef(_PaginationLink);
|
|
5165
5275
|
PaginationLink.spiritComponent = 'PaginationLink';
|
|
5166
5276
|
|
|
5167
|
-
const PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Previous';
|
|
5168
|
-
const PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Next';
|
|
5169
|
-
|
|
5170
5277
|
var __rest$1c = (undefined && undefined.__rest) || function (s, e) {
|
|
5171
5278
|
var t = {};
|
|
5172
5279
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -5248,7 +5355,7 @@ var __rest$1a = (undefined && undefined.__rest) || function (s, e) {
|
|
|
5248
5355
|
return t;
|
|
5249
5356
|
};
|
|
5250
5357
|
const UncontrolledPagination = (props) => {
|
|
5251
|
-
const { accessibilityLabel, accessibilityLabelPrevious =
|
|
5358
|
+
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"]);
|
|
5252
5359
|
const { currentPage, pages, handlePageChange } = usePagination({
|
|
5253
5360
|
defaultPage,
|
|
5254
5361
|
onChange,
|
|
@@ -6036,18 +6143,20 @@ var __rest$U = (undefined && undefined.__rest) || function (s, e) {
|
|
|
6036
6143
|
return t;
|
|
6037
6144
|
};
|
|
6038
6145
|
function useRadioStyleProps(props) {
|
|
6039
|
-
const {
|
|
6146
|
+
const { inputPosition = InputPositions.START, isItem, isLabelHidden, validationState } = props, restProps = __rest$U(props, ["inputPosition", "isItem", "isLabelHidden", "validationState"]);
|
|
6040
6147
|
const { isDisabled } = restProps;
|
|
6041
6148
|
const radioClass = useClassNamePrefix('Radio');
|
|
6042
6149
|
const radioDisabledClass = `${radioClass}--disabled`;
|
|
6043
6150
|
const radioItemClass = `${radioClass}--item`;
|
|
6044
6151
|
const radioInputClass = `${radioClass}__input`;
|
|
6152
|
+
const radioInputPositionClass = useInputPositionClass(radioClass, inputPosition);
|
|
6045
6153
|
const radioLabelClass = `${radioClass}__label`;
|
|
6046
6154
|
const radioLabelHiddenClass = `${radioClass}__label--hidden`;
|
|
6047
6155
|
const radioTextClass = `${radioClass}__text`;
|
|
6048
6156
|
const radioHelperTextClass = `${radioClass}__helperText`;
|
|
6049
6157
|
const radioValidationClass = `${radioClass}--${validationState}`;
|
|
6050
6158
|
const rootStyles = classNames(radioClass, {
|
|
6159
|
+
[radioInputPositionClass]: radioInputPositionClass,
|
|
6051
6160
|
[radioDisabledClass]: isDisabled,
|
|
6052
6161
|
[radioItemClass]: isItem,
|
|
6053
6162
|
[radioValidationClass]: validationState,
|
|
@@ -6095,6 +6204,7 @@ Radio.spiritComponent = 'Radio';
|
|
|
6095
6204
|
|
|
6096
6205
|
const DEBOUNCE_DELAY = 50;
|
|
6097
6206
|
const EDGE_DETECTION_INACCURACY_PX = 1;
|
|
6207
|
+
const SCROLL_CANCEL_DELAY = 10;
|
|
6098
6208
|
const SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_END = 'Scroll right';
|
|
6099
6209
|
const SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_START = 'Scroll left';
|
|
6100
6210
|
const SCROLL_VIEW_ARROWS_LABEL_VERTICAL_END = 'Scroll down';
|
|
@@ -6102,6 +6212,43 @@ const SCROLL_VIEW_ARROWS_LABEL_VERTICAL_START = 'Scroll up';
|
|
|
6102
6212
|
const SCROLL_VIEW_DEFAULT_DIRECTION = Direction.VERTICAL;
|
|
6103
6213
|
const SCROLL_VIEW_DEFAULT_OVERFLOW_DECORATOR = 'shadows';
|
|
6104
6214
|
|
|
6215
|
+
const useScrollCallback = ({ viewportRef, direction }) => {
|
|
6216
|
+
const scrollTimeoutRef = React.useRef(null);
|
|
6217
|
+
React.useEffect(() => () => {
|
|
6218
|
+
if (scrollTimeoutRef.current) {
|
|
6219
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
6220
|
+
}
|
|
6221
|
+
}, []);
|
|
6222
|
+
const handleScroll = React.useCallback((step) => {
|
|
6223
|
+
if (!viewportRef.current) {
|
|
6224
|
+
return;
|
|
6225
|
+
}
|
|
6226
|
+
const isHorizontal = isDirectionHorizontal(direction);
|
|
6227
|
+
const scrollToDirection = isHorizontal ? Position.LEFT : Position.TOP;
|
|
6228
|
+
const currentScrollPosition = isHorizontal ? viewportRef.current.scrollLeft : viewportRef.current.scrollTop;
|
|
6229
|
+
const maxScroll = isHorizontal
|
|
6230
|
+
? viewportRef.current.scrollWidth - viewportRef.current.clientWidth
|
|
6231
|
+
: viewportRef.current.scrollHeight - viewportRef.current.clientHeight;
|
|
6232
|
+
viewportRef.current.scrollTo({
|
|
6233
|
+
[scrollToDirection]: currentScrollPosition,
|
|
6234
|
+
behavior: 'auto',
|
|
6235
|
+
});
|
|
6236
|
+
if (scrollTimeoutRef.current) {
|
|
6237
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
6238
|
+
}
|
|
6239
|
+
const targetPosition = Math.max(0, Math.min(currentScrollPosition + step, maxScroll));
|
|
6240
|
+
scrollTimeoutRef.current = setTimeout(() => {
|
|
6241
|
+
if (viewportRef.current) {
|
|
6242
|
+
viewportRef.current.scrollTo({
|
|
6243
|
+
[scrollToDirection]: targetPosition,
|
|
6244
|
+
behavior: 'smooth',
|
|
6245
|
+
});
|
|
6246
|
+
}
|
|
6247
|
+
}, SCROLL_CANCEL_DELAY);
|
|
6248
|
+
}, [viewportRef, direction]);
|
|
6249
|
+
return { handleScroll };
|
|
6250
|
+
};
|
|
6251
|
+
|
|
6105
6252
|
const getDefaultArrowLabels = (isHorizontal) => isHorizontal
|
|
6106
6253
|
? {
|
|
6107
6254
|
start: SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_START,
|
|
@@ -6185,14 +6332,7 @@ const ScrollViewArrows = (props) => {
|
|
|
6185
6332
|
const mergedStyleProps = mergeStyleProps('button', { classProps: classProps.arrows, styleProps });
|
|
6186
6333
|
const isHorizontal = isDirectionHorizontal(direction);
|
|
6187
6334
|
const { arrows } = useScrollViewArrows(isHorizontal, ariaLabelArrows, scrollStep);
|
|
6188
|
-
const handleScroll = (
|
|
6189
|
-
var _a;
|
|
6190
|
-
const scrollToDirection = isHorizontal ? 'left' : 'top';
|
|
6191
|
-
(_a = viewportRef.current) === null || _a === void 0 ? void 0 : _a.scrollBy({
|
|
6192
|
-
[scrollToDirection]: step,
|
|
6193
|
-
behavior: 'smooth',
|
|
6194
|
-
});
|
|
6195
|
-
};
|
|
6335
|
+
const { handleScroll } = useScrollCallback({ viewportRef, direction });
|
|
6196
6336
|
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 },
|
|
6197
6337
|
React.createElement(Icon, { name: icon }))))));
|
|
6198
6338
|
};
|
|
@@ -6900,6 +7040,8 @@ const SplitButton = (props) => {
|
|
|
6900
7040
|
React.createElement("div", Object.assign({}, styleProps, otherProps, { className: classNames(classProps, styleProps.className) }), children)));
|
|
6901
7041
|
};
|
|
6902
7042
|
|
|
7043
|
+
const UNCONTROLLED_SPLIT_BUTTON_DROPDOWN_TRIGGER_LABEL_DEFAULT = 'More';
|
|
7044
|
+
|
|
6903
7045
|
var __rest$B = (undefined && undefined.__rest) || function (s, e) {
|
|
6904
7046
|
var t = {};
|
|
6905
7047
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -6914,6 +7056,7 @@ var __rest$B = (undefined && undefined.__rest) || function (s, e) {
|
|
|
6914
7056
|
const defaultProps$a = {
|
|
6915
7057
|
dropdownPlacement: 'bottom-end',
|
|
6916
7058
|
dropdownTriggerIconName: 'chevron-down',
|
|
7059
|
+
dropdownTriggerLabel: UNCONTROLLED_SPLIT_BUTTON_DROPDOWN_TRIGGER_LABEL_DEFAULT,
|
|
6917
7060
|
};
|
|
6918
7061
|
const UncontrolledSplitButton = (props) => {
|
|
6919
7062
|
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps$a), props);
|
|
@@ -7323,6 +7466,9 @@ function useTextFieldBaseStyleProps(props) {
|
|
|
7323
7466
|
};
|
|
7324
7467
|
}
|
|
7325
7468
|
|
|
7469
|
+
const TEXT_FIELD_BASE_PASSWORD_TOGGLE_SHOW_LABEL_DEFAULT = 'Show password';
|
|
7470
|
+
const TEXT_FIELD_BASE_PASSWORD_TOGGLE_HIDE_LABEL_DEFAULT = 'Hide password';
|
|
7471
|
+
|
|
7326
7472
|
function useTextFieldBasePasswordToggleStyleProps() {
|
|
7327
7473
|
const TextFieldBaseClass = useClassNamePrefix('TextField');
|
|
7328
7474
|
const TextFieldBasePasswordToggleClass = `${TextFieldBaseClass}__passwordToggle`;
|
|
@@ -7340,9 +7486,12 @@ function useTextFieldBasePasswordToggleStyleProps() {
|
|
|
7340
7486
|
const TextFieldBasePasswordToggle = (props) => {
|
|
7341
7487
|
const { children, isPasswordShown, onToggleClick, isDisabled, size } = props;
|
|
7342
7488
|
const { classProps } = useTextFieldBasePasswordToggleStyleProps();
|
|
7489
|
+
const ariaLabel = isPasswordShown
|
|
7490
|
+
? TEXT_FIELD_BASE_PASSWORD_TOGGLE_HIDE_LABEL_DEFAULT
|
|
7491
|
+
: TEXT_FIELD_BASE_PASSWORD_TOGGLE_SHOW_LABEL_DEFAULT;
|
|
7343
7492
|
return (React.createElement("div", { className: classProps.passwordToggle },
|
|
7344
7493
|
children,
|
|
7345
|
-
React.createElement("button", { className: classProps.passwordToggleButton, type: "button", role: "switch", "aria-checked": !!isPasswordShown, "aria-label":
|
|
7494
|
+
React.createElement("button", { className: classProps.passwordToggleButton, type: "button", role: "switch", "aria-checked": !!isPasswordShown, "aria-label": ariaLabel, onClick: () => onToggleClick(), disabled: isDisabled },
|
|
7346
7495
|
React.createElement("span", { className: classProps.passwordToggleIcon },
|
|
7347
7496
|
React.createElement(Icon, { name: `visibility-${isPasswordShown ? 'off' : 'on'}`, boxSize: size === Sizes.SMALL ? 16 : 20 })))));
|
|
7348
7497
|
};
|
|
@@ -7890,7 +8039,7 @@ var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
7890
8039
|
return t;
|
|
7891
8040
|
};
|
|
7892
8041
|
const UncontrolledToast = (props) => {
|
|
7893
|
-
const { alignmentX, alignmentY, isCollapsible, closeLabel } = props, restProps = __rest$7(props, ["alignmentX", "alignmentY", "isCollapsible", "closeLabel"]);
|
|
8042
|
+
const { alignmentX, alignmentY, isCollapsible, closeLabel = TOAST_BAR_CLOSE_BUTTON_LABEL_DEFAULT } = props, restProps = __rest$7(props, ["alignmentX", "alignmentY", "isCollapsible", "closeLabel"]);
|
|
7894
8043
|
const { hide, queue } = useToast();
|
|
7895
8044
|
return (React.createElement(Toast, { alignmentX: alignmentX, alignmentY: alignmentY, isCollapsible: isCollapsible }, queue.map((item) => {
|
|
7896
8045
|
const { color, iconName, id, isOpen, content, hasIcon, isDismissible, linkProps } = item;
|
|
@@ -7913,7 +8062,7 @@ var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
7913
8062
|
return t;
|
|
7914
8063
|
};
|
|
7915
8064
|
function useToggleStyleProps(props) {
|
|
7916
|
-
const {
|
|
8065
|
+
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"]);
|
|
7917
8066
|
const toggleClass = useClassNamePrefix('Toggle');
|
|
7918
8067
|
const toggleFluidClass = `${toggleClass}--fluid`;
|
|
7919
8068
|
const toggleDisabledClass = `${toggleClass}--disabled`;
|
|
@@ -7924,9 +8073,11 @@ function useToggleStyleProps(props) {
|
|
|
7924
8073
|
const toggleRequiredClass = `${toggleLabelClass}--required`;
|
|
7925
8074
|
const toggleInputClass = `${toggleClass}__input`;
|
|
7926
8075
|
const toggleInputIndicatorsClass = `${toggleInputClass}--indicators`;
|
|
8076
|
+
const toggleInputPositionClass = useInputPositionClass(toggleClass, inputPosition);
|
|
7927
8077
|
const toggleHelperTextClass = `${toggleClass}__helperText`;
|
|
7928
8078
|
const toggleValidationTextClass = `${toggleClass}__validationText`;
|
|
7929
8079
|
const rootClass = classNames(toggleClass, {
|
|
8080
|
+
[toggleInputPositionClass]: toggleInputPositionClass,
|
|
7930
8081
|
[toggleFluidClass]: isFluid,
|
|
7931
8082
|
[toggleDisabledClass]: isDisabled,
|
|
7932
8083
|
[toggleValidationClass]: validationState,
|
|
@@ -8183,6 +8334,7 @@ exports.Collapse = Collapse;
|
|
|
8183
8334
|
exports.Container = Container;
|
|
8184
8335
|
exports.ControlButton = ControlButton;
|
|
8185
8336
|
exports.DEBOUNCE_DELAY = DEBOUNCE_DELAY;
|
|
8337
|
+
exports.DEFAULT_ATTACHMENT_LIST_LABEL = DEFAULT_ATTACHMENT_LIST_LABEL;
|
|
8186
8338
|
exports.DEFAULT_BUTTON_LABEL = DEFAULT_BUTTON_LABEL;
|
|
8187
8339
|
exports.DEFAULT_EDIT_BUTTON_LABEL = DEFAULT_EDIT_BUTTON_LABEL;
|
|
8188
8340
|
exports.DEFAULT_ERROR_MESSAGE_MAX_FILE_SIZE = DEFAULT_ERROR_MESSAGE_MAX_FILE_SIZE;
|
|
@@ -8241,6 +8393,7 @@ exports.HeaderNav = HeaderNav;
|
|
|
8241
8393
|
exports.HeaderNavItem = HeaderNavItem;
|
|
8242
8394
|
exports.Heading = Heading;
|
|
8243
8395
|
exports.HelperText = HelperText;
|
|
8396
|
+
exports.Hidden = Hidden;
|
|
8244
8397
|
exports.ICON_BOX_SIZE = ICON_BOX_SIZE;
|
|
8245
8398
|
exports.IMAGE_DIMENSION = IMAGE_DIMENSION;
|
|
8246
8399
|
exports.IMAGE_PREVIEW_BASE64_MAX_WIDTH = IMAGE_PREVIEW_BASE64_MAX_WIDTH;
|
|
@@ -8263,6 +8416,7 @@ exports.NavigationAction = NavigationAction;
|
|
|
8263
8416
|
exports.NavigationAvatar = NavigationAvatar;
|
|
8264
8417
|
exports.NavigationItem = NavigationItem;
|
|
8265
8418
|
exports.NoSsr = NoSsr;
|
|
8419
|
+
exports.PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX = PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX;
|
|
8266
8420
|
exports.PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL;
|
|
8267
8421
|
exports.PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL;
|
|
8268
8422
|
exports.Pagination = Pagination;
|
|
@@ -8280,6 +8434,7 @@ exports.PricingPlanFooter = PricingPlanFooter;
|
|
|
8280
8434
|
exports.PricingPlanHeader = PricingPlanHeader;
|
|
8281
8435
|
exports.ProductLogo = ProductLogo;
|
|
8282
8436
|
exports.Radio = Radio;
|
|
8437
|
+
exports.SCROLL_CANCEL_DELAY = SCROLL_CANCEL_DELAY;
|
|
8283
8438
|
exports.SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_END = SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_END;
|
|
8284
8439
|
exports.SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_START = SCROLL_VIEW_ARROWS_LABEL_HORIZONTAL_START;
|
|
8285
8440
|
exports.SCROLL_VIEW_ARROWS_LABEL_VERTICAL_END = SCROLL_VIEW_ARROWS_LABEL_VERTICAL_END;
|
|
@@ -8410,6 +8565,7 @@ exports.usePartnerLogoStyleProps = usePartnerLogoStyleProps;
|
|
|
8410
8565
|
exports.usePillStyleProps = usePillStyleProps;
|
|
8411
8566
|
exports.usePricingPlanStyleProps = usePricingPlanStyleProps;
|
|
8412
8567
|
exports.useRadioStyleProps = useRadioStyleProps;
|
|
8568
|
+
exports.useScrollCallback = useScrollCallback;
|
|
8413
8569
|
exports.useScrollPosition = useScrollPosition;
|
|
8414
8570
|
exports.useScrollViewArrows = useScrollViewArrows;
|
|
8415
8571
|
exports.useScrollViewStyleProps = useScrollViewStyleProps;
|