@alma-oss/spirit-web-react 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/web-react.umd.js +318 -145
- 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 +22 -6
- 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 +2 -0
- package/components/ActionGroup/ActionGroup.cjs.map +1 -1
- package/components/Card/CardLink.d.ts +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/Flex/Flex.cjs +2 -0
- 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 +4 -0
- 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/useGridStyleProps.d.ts +2 -2
- package/components/Icon/useIconStyleProps.d.ts +10 -10
- package/components/Modal/Modal.cjs +4 -2
- 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/Pagination/Pagination.cjs +11 -6
- 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 +3 -1
- package/components/Pagination/PaginationLink.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 +4 -2
- package/components/PricingPlan/PricingPlan.cjs.map +1 -1
- package/components/ScrollView/ScrollView.cjs +41 -8
- 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/Skeleton/useSkeletonShapeStyleProps.d.ts +10 -10
- package/components/SplitButton/SplitButton.cjs +3 -0
- 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/TextArea/TextArea.cjs +7 -1
- package/components/TextArea/TextArea.cjs.map +1 -1
- package/components/TextField/TextField.cjs +7 -1
- package/components/TextField/TextField.cjs.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/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/UncontrolledToast.js +2 -1
- package/components/Toast/UncontrolledToast.js.map +1 -1
- package/components/Toast/useToastBarStyleProps.d.ts +10 -10
- package/components/components.cjs +105 -30
- package/components/components.cjs.map +1 -1
- package/index.cjs +105 -30
- package/index.cjs.map +1 -1
- package/package.json +8 -6
- package/spirit-web-react.cjs +105 -30
- 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/flex.d.ts +2 -3
- package/types/footer.d.ts +7 -2
- package/types/grid.d.ts +3 -5
|
@@ -14,8 +14,9 @@ import React from 'react';
|
|
|
14
14
|
import { Button } from "../Button/index.js";
|
|
15
15
|
import { Icon } from "../Icon/index.js";
|
|
16
16
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
17
|
+
import { MODAL_CLOSE_BUTTON_LABEL_DEFAULT } from "./constants.js";
|
|
17
18
|
const ModalCloseButton = (_a) => {
|
|
18
|
-
var { label =
|
|
19
|
+
var { label = MODAL_CLOSE_BUTTON_LABEL_DEFAULT, onClose, id, isOpen } = _a, restProps = __rest(_a, ["label", "onClose", "id", "isOpen"]);
|
|
19
20
|
return (React.createElement(Button, Object.assign({}, restProps, { isSymmetrical: true, color: "tertiary", onClick: onClose, "aria-expanded": isOpen, "aria-controls": id }),
|
|
20
21
|
React.createElement(Icon, { name: "close" }),
|
|
21
22
|
React.createElement(VisuallyHidden, null, label)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalCloseButton.js","sourceRoot":"","sources":["../../../src/components/Modal/ModalCloseButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ModalCloseButton.js","sourceRoot":"","sources":["../../../src/components/Modal/ModalCloseButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,gBAAgB,GAAG,CAAC,EAMF,EAAE,EAAE;QANF,EACxB,KAAK,GAAG,gCAAgC,EACxC,OAAO,EACP,EAAE,EACF,MAAM,OAEgB,EADnB,SAAS,cALY,oCAMzB,CADa;IACe,OAAA,CAC3B,oBAAC,MAAM,oBAAK,SAAS,IAAE,aAAa,QAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,mBAAiB,MAAM,mBAAiB,EAAE;QAC9G,oBAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG;QACrB,oBAAC,cAAc,QAAE,KAAK,CAAkB,CACjC,CACV,CAAA;CAAA,CAAC;AAEF,gBAAgB,CAAC,eAAe,GAAG,kBAAkB,CAAC;AAEtD,eAAe,gBAAgB,CAAC"}
|
|
@@ -13,6 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { useStyleProps } from "../../hooks/index.js";
|
|
16
|
+
import { MODAL_CLOSE_BUTTON_LABEL_DEFAULT } from "./constants.js";
|
|
16
17
|
import ModalCloseButton from "./ModalCloseButton.js";
|
|
17
18
|
import { useModalContext } from "./ModalContext.js";
|
|
18
19
|
import { useModalStyleProps } from "./useModalStyleProps.js";
|
|
@@ -21,7 +22,7 @@ const defaultProps = {
|
|
|
21
22
|
};
|
|
22
23
|
const ModalHeader = (props) => {
|
|
23
24
|
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps), props);
|
|
24
|
-
const { children, closeLabel, hasCloseButton } = propsWithDefaults, restProps = __rest(propsWithDefaults, ["children", "closeLabel", "hasCloseButton"]);
|
|
25
|
+
const { children, closeLabel = MODAL_CLOSE_BUTTON_LABEL_DEFAULT, hasCloseButton } = propsWithDefaults, restProps = __rest(propsWithDefaults, ["children", "closeLabel", "hasCloseButton"]);
|
|
25
26
|
const { classProps } = useModalStyleProps();
|
|
26
27
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
27
28
|
const { id, isOpen, onClose } = useModalContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHeader.js","sourceRoot":"","sources":["../../../src/components/Modal/ModalHeader.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AAEb,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,YAAY,GAAqB;IACrC,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC9C,MAAM,iBAAiB,mCAAQ,YAAY,GAAK,KAAK,CAAE,CAAC;IACxD,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,KAAmB,iBAAiB,EAA/B,SAAS,UAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ModalHeader.js","sourceRoot":"","sources":["../../../src/components/Modal/ModalHeader.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AAEb,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,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
+
export declare const MODAL_CLOSE_BUTTON_LABEL_DEFAULT = "Close";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Modal/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gCAAgC,GAAG,OAAO,CAAC"}
|
|
@@ -762,6 +762,10 @@ const VisuallyHidden = (props) => {
|
|
|
762
762
|
};
|
|
763
763
|
VisuallyHidden.spiritComponent = 'VisuallyHidden';
|
|
764
764
|
|
|
765
|
+
const PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Previous';
|
|
766
|
+
const PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Next';
|
|
767
|
+
const PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX = 'Go to page';
|
|
768
|
+
|
|
765
769
|
var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
|
|
766
770
|
var t = {};
|
|
767
771
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -774,7 +778,9 @@ var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
774
778
|
return t;
|
|
775
779
|
};
|
|
776
780
|
const _PaginationButtonLink = (props, ref) => {
|
|
777
|
-
const _a = props, { direction, accessibilityLabel
|
|
781
|
+
const _a = props, { direction, accessibilityLabel = direction === 'previous'
|
|
782
|
+
? PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL
|
|
783
|
+
: PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL } = _a, restProps = __rest$5(_a, ["direction", "accessibilityLabel"]);
|
|
778
784
|
const iconType = {
|
|
779
785
|
previous: 'chevron-left',
|
|
780
786
|
next: 'chevron-right',
|
|
@@ -818,19 +824,17 @@ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
818
824
|
};
|
|
819
825
|
const _PaginationLink = (props, ref) => {
|
|
820
826
|
const { elementType: ElementTag = 'a', accessibilityLabel, isCurrent, pageNumber } = props, restProps = __rest$3(props, ["elementType", "accessibilityLabel", "isCurrent", "pageNumber"]);
|
|
827
|
+
const visuallyHiddenLabel = accessibilityLabel || `${PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX} ${pageNumber}`;
|
|
821
828
|
const { classProps } = usePaginationStyleProps({ isCurrent });
|
|
822
829
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
823
830
|
const mergedStyleProps = mergeStyleProps(ElementTag, { classProps: classProps.link, styleProps, otherProps });
|
|
824
831
|
return (React.createElement(ElementTag, Object.assign({}, otherProps, mergedStyleProps, { ref: ref }),
|
|
825
|
-
React.createElement(VisuallyHidden, null,
|
|
832
|
+
React.createElement(VisuallyHidden, null, visuallyHiddenLabel),
|
|
826
833
|
React.createElement("span", { "aria-hidden": "true" }, pageNumber)));
|
|
827
834
|
};
|
|
828
835
|
const PaginationLink = React.forwardRef(_PaginationLink);
|
|
829
836
|
PaginationLink.spiritComponent = 'PaginationLink';
|
|
830
837
|
|
|
831
|
-
const PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Previous';
|
|
832
|
-
const PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Next';
|
|
833
|
-
|
|
834
838
|
var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
|
|
835
839
|
var t = {};
|
|
836
840
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -912,7 +916,7 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
912
916
|
return t;
|
|
913
917
|
};
|
|
914
918
|
const UncontrolledPagination = (props) => {
|
|
915
|
-
const { accessibilityLabel, accessibilityLabelPrevious =
|
|
919
|
+
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(props, ["accessibilityLabel", "accessibilityLabelPrevious", "accessibilityLabelNext", "defaultPage", "onChange", "totalPages", "visiblePages"]);
|
|
916
920
|
const { currentPage, pages, handlePageChange } = usePagination({
|
|
917
921
|
defaultPage,
|
|
918
922
|
onChange,
|
|
@@ -936,6 +940,7 @@ const UncontrolledPagination = (props) => {
|
|
|
936
940
|
};
|
|
937
941
|
UncontrolledPagination.spiritComponent = 'UncontrolledPagination';
|
|
938
942
|
|
|
943
|
+
exports.PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX = PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX;
|
|
939
944
|
exports.PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL;
|
|
940
945
|
exports.PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL;
|
|
941
946
|
exports.Pagination = Pagination;
|