@openedx/paragon 23.14.2 → 23.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionRow/index.d.ts +18 -0
- package/dist/ActionRow/index.js +6 -24
- package/dist/ActionRow/index.js.map +1 -1
- package/dist/Alert/index.js +21 -24
- package/dist/Alert/index.js.map +1 -1
- package/dist/Annotation/index.d.ts +13 -0
- package/dist/Annotation/index.js +11 -30
- package/dist/Annotation/index.js.map +1 -1
- package/dist/Avatar/index.d.ts +11 -0
- package/dist/Avatar/index.js +7 -21
- package/dist/Avatar/index.js.map +1 -1
- package/dist/AvatarButton/index.d.ts +17 -0
- package/dist/AvatarButton/index.js +11 -33
- package/dist/AvatarButton/index.js.map +1 -1
- package/dist/Breadcrumb/BreadcrumbLink.js +5 -6
- package/dist/Breadcrumb/BreadcrumbLink.js.map +1 -1
- package/dist/Breadcrumb/index.js +11 -12
- package/dist/Breadcrumb/index.js.map +1 -1
- package/dist/Bubble/index.js +15 -18
- package/dist/Bubble/index.js.map +1 -1
- package/dist/Button/index.d.ts +42 -7
- package/dist/Button/index.js +43 -115
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/BaseCard.js +11 -12
- package/dist/Card/BaseCard.js.map +1 -1
- package/dist/Card/CardBody.js +9 -12
- package/dist/Card/CardBody.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarousel.js +13 -14
- package/dist/Card/CardCarousel/CardCarousel.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselHeader.js +4 -5
- package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselItems.js +3 -4
- package/dist/Card/CardCarousel/CardCarouselItems.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselProvider.js +7 -8
- package/dist/Card/CardCarousel/CardCarouselProvider.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselSubtitle.js +5 -6
- package/dist/Card/CardCarousel/CardCarouselSubtitle.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselTitle.js +5 -6
- package/dist/Card/CardCarousel/CardCarouselTitle.js.map +1 -1
- package/dist/Card/CardCarousel/messages.d.ts +13 -0
- package/dist/Card/CardCarousel/messages.js +4 -5
- package/dist/Card/CardCarousel/messages.js.map +1 -0
- package/dist/Card/CardContext.js +6 -7
- package/dist/Card/CardContext.js.map +1 -1
- package/dist/Card/CardDeck.js +9 -10
- package/dist/Card/CardDeck.js.map +1 -1
- package/dist/Card/CardDivider.js +8 -11
- package/dist/Card/CardDivider.js.map +1 -1
- package/dist/Card/CardFooter.js +9 -10
- package/dist/Card/CardFooter.js.map +1 -1
- package/dist/Card/CardGrid.js +6 -7
- package/dist/Card/CardGrid.js.map +1 -1
- package/dist/Card/CardHeader.js +9 -10
- package/dist/Card/CardHeader.js.map +1 -1
- package/dist/Card/CardImageCap.js +15 -16
- package/dist/Card/CardImageCap.js.map +1 -1
- package/dist/Card/CardSection.js +9 -10
- package/dist/Card/CardSection.js.map +1 -1
- package/dist/Card/CardStatus.js +9 -10
- package/dist/Card/CardStatus.js.map +1 -1
- package/dist/Card/index.js +9 -10
- package/dist/Card/index.js.map +1 -1
- package/dist/Chip/ChipIcon.js +8 -9
- package/dist/Chip/ChipIcon.js.map +1 -1
- package/dist/Chip/index.d.ts +22 -0
- package/dist/Chip/index.js +15 -70
- package/dist/Chip/index.js.map +1 -1
- package/dist/ChipCarousel/index.js +49 -53
- package/dist/ChipCarousel/index.js.map +1 -1
- package/dist/ChipCarousel/messages.d.ts +13 -0
- package/dist/ChipCarousel/messages.js +4 -5
- package/dist/ChipCarousel/messages.js.map +1 -0
- package/dist/CloseButton/index.js.map +1 -1
- package/dist/Collapse/index.js.map +1 -1
- package/dist/Collapsible/CollapsibleBody.js +6 -7
- package/dist/Collapsible/CollapsibleBody.js.map +1 -1
- package/dist/Collapsible/CollapsibleTrigger.js +9 -10
- package/dist/Collapsible/CollapsibleTrigger.js.map +1 -1
- package/dist/Collapsible/CollapsibleVisible.js +5 -6
- package/dist/Collapsible/CollapsibleVisible.js.map +1 -1
- package/dist/ColorPicker/index.js +6 -7
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/Container/index.js +9 -12
- package/dist/Container/index.js.map +1 -1
- package/dist/DataTable/BulkActions.js +4 -5
- package/dist/DataTable/BulkActions.js.map +1 -1
- package/dist/DataTable/CardView.js +16 -18
- package/dist/DataTable/CardView.js.map +1 -1
- package/dist/DataTable/CollapsibleButtonGroup.js +5 -6
- package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
- package/dist/DataTable/DataTableLayout.js +5 -6
- package/dist/DataTable/DataTableLayout.js.map +1 -1
- package/dist/DataTable/EmptyTable.js +5 -6
- package/dist/DataTable/EmptyTable.js.map +1 -1
- package/dist/DataTable/ExpandAll.js +4 -5
- package/dist/DataTable/ExpandAll.js.map +1 -1
- package/dist/DataTable/ExpandRow.js +3 -4
- package/dist/DataTable/ExpandRow.js.map +1 -1
- package/dist/DataTable/FilterStatus.js +8 -9
- package/dist/DataTable/FilterStatus.js.map +1 -1
- package/dist/DataTable/RowStatus.js +4 -5
- package/dist/DataTable/RowStatus.js.map +1 -1
- package/dist/DataTable/SidebarFilters.js +3 -4
- package/dist/DataTable/SidebarFilters.js.map +1 -1
- package/dist/DataTable/Table.js +3 -4
- package/dist/DataTable/Table.js.map +1 -1
- package/dist/DataTable/TableActions.js +3 -4
- package/dist/DataTable/TableActions.js.map +1 -1
- package/dist/DataTable/TableCell.js +5 -6
- package/dist/DataTable/TableCell.js.map +1 -1
- package/dist/DataTable/TableControlBar.js +3 -4
- package/dist/DataTable/TableControlBar.js.map +1 -1
- package/dist/DataTable/TableFilters.js +6 -7
- package/dist/DataTable/TableFilters.js.map +1 -1
- package/dist/DataTable/TableFooter.js +4 -5
- package/dist/DataTable/TableFooter.js.map +1 -1
- package/dist/DataTable/TableHeaderCell.js +13 -15
- package/dist/DataTable/TableHeaderCell.js.map +1 -1
- package/dist/DataTable/TableHeaderRow.js +3 -4
- package/dist/DataTable/TableHeaderRow.js.map +1 -1
- package/dist/DataTable/TableRow.js +3 -4
- package/dist/DataTable/TableRow.js.map +1 -1
- package/dist/DataTable/filters/CheckboxFilter.js +25 -29
- package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
- package/dist/DataTable/filters/DropdownFilter.js +16 -20
- package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js +25 -29
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/TextFilter.js +8 -9
- package/dist/DataTable/filters/TextFilter.js.map +1 -1
- package/dist/DataTable/hooks.js +11 -13
- package/dist/DataTable/hooks.js.map +1 -1
- package/dist/DataTable/index.js +35 -36
- package/dist/DataTable/index.js.map +1 -1
- package/dist/DataTable/messages.d.ts +13 -0
- package/dist/DataTable/messages.js +4 -5
- package/dist/DataTable/messages.js.map +1 -0
- package/dist/DataTable/selection/BaseSelectionStatus.js +11 -12
- package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelect.js +3 -4
- package/dist/DataTable/selection/ControlledSelect.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelectHeader.js +3 -4
- package/dist/DataTable/selection/ControlledSelectHeader.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelectionStatus.js +4 -5
- package/dist/DataTable/selection/ControlledSelectionStatus.js.map +1 -1
- package/dist/DataTable/selection/SelectionStatus.js +4 -5
- package/dist/DataTable/selection/SelectionStatus.js.map +1 -1
- package/dist/DataTable/utils/getVisibleColumns.js +9 -13
- package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
- package/dist/Dropdown/index.js +17 -20
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Dropzone/DefaultContent.js +5 -6
- package/dist/Dropzone/DefaultContent.js.map +1 -1
- package/dist/Dropzone/DragError.js +3 -4
- package/dist/Dropzone/DragError.js.map +1 -1
- package/dist/Dropzone/GenericError.js +4 -5
- package/dist/Dropzone/GenericError.js.map +1 -1
- package/dist/Dropzone/UploadProgress.js +6 -7
- package/dist/Dropzone/UploadProgress.js.map +1 -1
- package/dist/Dropzone/index.js +14 -15
- package/dist/Dropzone/index.js.map +1 -1
- package/dist/Dropzone/messages.d.ts +53 -0
- package/dist/Dropzone/messages.js +12 -13
- package/dist/Dropzone/messages.js.map +1 -0
- package/dist/Fade/index.js.map +1 -1
- package/dist/Form/FormAutosuggest.js +18 -20
- package/dist/Form/FormAutosuggest.js.map +1 -1
- package/dist/Form/FormAutosuggestOption.js +6 -7
- package/dist/Form/FormAutosuggestOption.js.map +1 -1
- package/dist/Form/FormCheckbox.js +16 -18
- package/dist/Form/FormCheckbox.js.map +1 -1
- package/dist/Form/FormCheckboxSet.js +11 -12
- package/dist/Form/FormCheckboxSet.js.map +1 -1
- package/dist/Form/FormCheckboxSetContext.js +9 -10
- package/dist/Form/FormCheckboxSetContext.js.map +1 -1
- package/dist/Form/FormControl.js +12 -13
- package/dist/Form/FormControl.js.map +1 -1
- package/dist/Form/FormControlDecorator.js +4 -5
- package/dist/Form/FormControlDecorator.js.map +1 -1
- package/dist/Form/FormControlDecoratorGroup.js +8 -9
- package/dist/Form/FormControlDecoratorGroup.js.map +1 -1
- package/dist/Form/FormControlFeedback.js +4 -5
- package/dist/Form/FormControlFeedback.js.map +1 -1
- package/dist/Form/FormControlFloatingLabel.js +3 -4
- package/dist/Form/FormControlFloatingLabel.js.map +1 -1
- package/dist/Form/FormControlSet.js +7 -8
- package/dist/Form/FormControlSet.js.map +1 -1
- package/dist/Form/FormGroup.js +9 -10
- package/dist/Form/FormGroup.js.map +1 -1
- package/dist/Form/FormGroupContext.js +7 -8
- package/dist/Form/FormGroupContext.js.map +1 -1
- package/dist/Form/FormLabel.d.ts +2 -11
- package/dist/Form/FormLabel.js +5 -15
- package/dist/Form/FormLabel.js.map +1 -1
- package/dist/Form/FormRadio.js +28 -31
- package/dist/Form/FormRadio.js.map +1 -1
- package/dist/Form/FormRadioSet.js +11 -12
- package/dist/Form/FormRadioSet.js.map +1 -1
- package/dist/Form/FormRadioSetContext.js +9 -10
- package/dist/Form/FormRadioSetContext.js.map +1 -1
- package/dist/Form/FormSwitch.js +25 -29
- package/dist/Form/FormSwitch.js.map +1 -1
- package/dist/Form/FormText.js +16 -19
- package/dist/Form/FormText.js.map +1 -1
- package/dist/Form/fieldUtils.js +11 -22
- package/dist/Form/fieldUtils.js.map +1 -1
- package/dist/Form/useCheckboxSetValues.js +1 -2
- package/dist/Form/useCheckboxSetValues.js.map +1 -1
- package/dist/Hyperlink/index.js +17 -21
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Icon/index.js +10 -11
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.d.ts +8 -304
- package/dist/IconButton/index.js +21 -84
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButtonToggle/index.js +5 -6
- package/dist/IconButtonToggle/index.js.map +1 -1
- package/dist/Image/index.js.map +1 -1
- package/dist/Layout/index.js +4 -5
- package/dist/Layout/index.js.map +1 -1
- package/dist/Media/index.js.map +1 -1
- package/dist/Menu/MenuItem.js +8 -9
- package/dist/Menu/MenuItem.js.map +1 -1
- package/dist/Menu/SelectMenu.js +8 -9
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Menu/index.js +6 -7
- package/dist/Menu/index.js.map +1 -1
- package/dist/Modal/AlertModal.js +6 -7
- package/dist/Modal/AlertModal.js.map +1 -1
- package/dist/Modal/FullscreenModal.js +7 -8
- package/dist/Modal/FullscreenModal.js.map +1 -1
- package/dist/Modal/MarketingModal.js +9 -10
- package/dist/Modal/MarketingModal.js.map +1 -1
- package/dist/Modal/ModalCloseButton.js +5 -6
- package/dist/Modal/ModalCloseButton.js.map +1 -1
- package/dist/Modal/ModalContext.js +6 -7
- package/dist/Modal/ModalContext.js.map +1 -1
- package/dist/Modal/ModalDialog.js +16 -17
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalDialogBody.js +5 -6
- package/dist/Modal/ModalDialogBody.js.map +1 -1
- package/dist/Modal/ModalDialogFooter.js +5 -6
- package/dist/Modal/ModalDialogFooter.js.map +1 -1
- package/dist/Modal/ModalDialogHeader.js +9 -12
- package/dist/Modal/ModalDialogHeader.js.map +1 -1
- package/dist/Modal/ModalDialogHero.js +5 -6
- package/dist/Modal/ModalDialogHero.js.map +1 -1
- package/dist/Modal/ModalDialogHeroBackground.js +6 -7
- package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
- package/dist/Modal/ModalDialogHeroContent.js +5 -6
- package/dist/Modal/ModalDialogHeroContent.js.map +1 -1
- package/dist/Modal/ModalDialogTitle.js +5 -6
- package/dist/Modal/ModalDialogTitle.js.map +1 -1
- package/dist/Modal/ModalLayer.js +13 -16
- package/dist/Modal/ModalLayer.js.map +1 -1
- package/dist/Modal/ModalPopup.js +11 -12
- package/dist/Modal/ModalPopup.js.map +1 -1
- package/dist/Modal/PopperElement.js +7 -8
- package/dist/Modal/PopperElement.js.map +1 -1
- package/dist/Modal/StandardModal.js +7 -8
- package/dist/Modal/StandardModal.js.map +1 -1
- package/dist/OverflowScroll/OverflowScroll.js +12 -13
- package/dist/OverflowScroll/OverflowScroll.js.map +1 -1
- package/dist/OverflowScroll/OverflowScrollItems.js +3 -4
- package/dist/OverflowScroll/OverflowScrollItems.js.map +1 -1
- package/dist/Overlay/index.d.ts +2 -2
- package/dist/PageBanner/index.js +9 -10
- package/dist/PageBanner/index.js.map +1 -1
- package/dist/Pagination/PaginationContext.js +12 -13
- package/dist/Pagination/PaginationContext.js.map +1 -1
- package/dist/Pagination/subcomponents/PageButton.js +3 -4
- package/dist/Pagination/subcomponents/PageButton.js.map +1 -1
- package/dist/Popover/index.js +11 -14
- package/dist/Popover/index.js.map +1 -1
- package/dist/ProductTour/Checkpoint.js +12 -13
- package/dist/ProductTour/Checkpoint.js.map +1 -1
- package/dist/ProductTour/CheckpointActionRow.js +10 -11
- package/dist/ProductTour/CheckpointActionRow.js.map +1 -1
- package/dist/ProductTour/CheckpointBody.js +3 -4
- package/dist/ProductTour/CheckpointBody.js.map +1 -1
- package/dist/ProductTour/CheckpointHeader.js +7 -8
- package/dist/ProductTour/CheckpointHeader.js.map +1 -1
- package/dist/ProductTour/CheckpointTitle.js +6 -9
- package/dist/ProductTour/CheckpointTitle.js.map +1 -1
- package/dist/ProductTour/index.js +3 -4
- package/dist/ProductTour/index.js.map +1 -1
- package/dist/ProductTour/messages.d.ts +23 -0
- package/dist/ProductTour/messages.js +6 -7
- package/dist/ProductTour/messages.js.map +1 -0
- package/dist/ProgressBar/index.js +11 -12
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/ResponsiveEmbed/index.js.map +1 -1
- package/dist/Scrollable/index.js +4 -5
- package/dist/Scrollable/index.js.map +1 -1
- package/dist/SearchField/SearchFieldLabel.js +4 -5
- package/dist/SearchField/SearchFieldLabel.js.map +1 -1
- package/dist/SelectableBox/SelectableBoxSet.js +13 -14
- package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
- package/dist/SelectableBox/index.js +14 -15
- package/dist/SelectableBox/index.js.map +1 -1
- package/dist/Skeleton/index.js.map +1 -1
- package/dist/Spinner/index.js +5 -6
- package/dist/Spinner/index.js.map +1 -1
- package/dist/Stack/index.js +12 -15
- package/dist/Stack/index.js.map +1 -1
- package/dist/StatefulButton/index.js +9 -10
- package/dist/StatefulButton/index.js.map +1 -1
- package/dist/Stepper/Stepper.js +4 -5
- package/dist/Stepper/Stepper.js.map +1 -1
- package/dist/Stepper/StepperActionRow.js +6 -7
- package/dist/Stepper/StepperActionRow.js.map +1 -1
- package/dist/Stepper/StepperContext.js +4 -5
- package/dist/Stepper/StepperContext.js.map +1 -1
- package/dist/Stepper/StepperHeader.js +23 -31
- package/dist/Stepper/StepperHeader.js.map +1 -1
- package/dist/Stepper/StepperHeaderStep.js +8 -9
- package/dist/Stepper/StepperHeaderStep.js.map +1 -1
- package/dist/Stepper/StepperStep.js +10 -11
- package/dist/Stepper/StepperStep.js.map +1 -1
- package/dist/Sticky/index.js +8 -12
- package/dist/Sticky/index.js.map +1 -1
- package/dist/Tabs/index.js +8 -9
- package/dist/Tabs/index.js.map +1 -1
- package/dist/Toast/ToastContainer.js +3 -4
- package/dist/Toast/ToastContainer.js.map +1 -1
- package/dist/Toast/index.d.ts +20 -41
- package/dist/Toast/index.js +11 -48
- package/dist/Toast/index.js.map +1 -1
- package/dist/ToggleButton/index.js.map +1 -1
- package/dist/Tooltip/index.js +11 -14
- package/dist/Tooltip/index.js.map +1 -1
- package/dist/Truncate/index.js +9 -10
- package/dist/Truncate/index.js.map +1 -1
- package/dist/asInput/index.js +9 -13
- package/dist/asInput/index.js.map +1 -1
- package/dist/hooks/useArrowKeyNavigationHook.js +17 -21
- package/dist/hooks/useArrowKeyNavigationHook.js.map +1 -1
- package/dist/hooks/useIsVisibleHook.js +4 -6
- package/dist/hooks/useIsVisibleHook.js.map +1 -1
- package/dist/hooks/useToggleHook.js +1 -3
- package/dist/hooks/useToggleHook.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -8
- package/dist/index.js.map +1 -1
- package/dist/utils/newId.js +1 -2
- package/dist/utils/newId.js.map +1 -1
- package/package.json +1 -1
- package/src/ActionRow/{index.jsx → index.tsx} +14 -22
- package/src/Annotation/{index.jsx → index.tsx} +15 -22
- package/src/Avatar/{index.jsx → index.tsx} +13 -19
- package/src/AvatarButton/{index.jsx → index.tsx} +23 -31
- package/src/Button/index.tsx +68 -93
- package/src/Chip/index.tsx +26 -59
- package/src/CloseButton/index.tsx +1 -0
- package/src/Collapse/index.tsx +1 -0
- package/src/Fade/index.tsx +1 -0
- package/src/Form/FormLabel.tsx +2 -10
- package/src/IconButton/index.tsx +17 -81
- package/src/Image/index.tsx +2 -0
- package/src/Media/index.tsx +1 -0
- package/src/Modal/modal-popup.mdx +1 -1
- package/src/ResponsiveEmbed/index.tsx +1 -0
- package/src/Skeleton/index.tsx +1 -0
- package/src/Toast/index.tsx +21 -40
- package/src/ToggleButton/index.tsx +2 -0
- package/src/index.ts +4 -8
- /package/{src/CloseButton/index.jsx → dist/CloseButton/index.d.ts} +0 -0
- /package/{src/Collapse/index.jsx → dist/Collapse/index.d.ts} +0 -0
- /package/{src/Fade/index.jsx → dist/Fade/index.d.ts} +0 -0
- /package/{src/Image/index.jsx → dist/Image/index.d.ts} +0 -0
- /package/{src/Media/index.jsx → dist/Media/index.d.ts} +0 -0
- /package/{src/ResponsiveEmbed/index.jsx → dist/ResponsiveEmbed/index.d.ts} +0 -0
- /package/{src/Skeleton/index.jsx → dist/Skeleton/index.d.ts} +0 -0
- /package/{src/ToggleButton/index.jsx → dist/ToggleButton/index.d.ts} +0 -0
- /package/src/Card/CardCarousel/{messages.js → messages.ts} +0 -0
- /package/src/ChipCarousel/{messages.js → messages.ts} +0 -0
- /package/src/DataTable/{messages.js → messages.ts} +0 -0
- /package/src/Dropzone/{messages.js → messages.ts} +0 -0
- /package/src/ProductTour/{messages.js → messages.ts} +0 -0
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
const CheckpointTitle = /*#__PURE__*/React.forwardRef((
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
ref: ref
|
|
10
|
-
}, children);
|
|
11
|
-
});
|
|
3
|
+
const CheckpointTitle = /*#__PURE__*/React.forwardRef(({
|
|
4
|
+
children
|
|
5
|
+
}, ref) => /*#__PURE__*/React.createElement("h2", {
|
|
6
|
+
id: "pgn__checkpoint-title",
|
|
7
|
+
ref: ref
|
|
8
|
+
}, children));
|
|
12
9
|
CheckpointTitle.defaultProps = {
|
|
13
10
|
children: null
|
|
14
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckpointTitle.js","names":["React","PropTypes","CheckpointTitle","forwardRef","
|
|
1
|
+
{"version":3,"file":"CheckpointTitle.js","names":["React","PropTypes","CheckpointTitle","forwardRef","children","ref","createElement","id","defaultProps","propTypes","node"],"sources":["../../src/ProductTour/CheckpointTitle.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst CheckpointTitle = React.forwardRef(({ children }, ref) => (\n <h2 id=\"pgn__checkpoint-title\" ref={ref}>\n {children}\n </h2>\n));\n\nCheckpointTitle.defaultProps = {\n children: null,\n};\n\nCheckpointTitle.propTypes = {\n children: PropTypes.node,\n};\n\nexport default CheckpointTitle;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,eAAe,gBAAGF,KAAK,CAACG,UAAU,CAAC,CAAC;EAAEC;AAAS,CAAC,EAAEC,GAAG,kBACzDL,KAAA,CAAAM,aAAA;EAAIC,EAAE,EAAC,uBAAuB;EAACF,GAAG,EAAEA;AAAI,GACrCD,QACC,CACL,CAAC;AAEFF,eAAe,CAACM,YAAY,GAAG;EAC7BJ,QAAQ,EAAE;AACZ,CAAC;AAEDF,eAAe,CAACO,SAAS,GAAG;EAC1BL,QAAQ,EAAEH,SAAS,CAACS;AACtB,CAAC;AAED,eAAeR,eAAe","ignoreList":[]}
|
|
@@ -2,10 +2,9 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';
|
|
4
4
|
import Checkpoint from './Checkpoint';
|
|
5
|
-
const ProductTour = /*#__PURE__*/React.forwardRef((
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} = _ref;
|
|
5
|
+
const ProductTour = /*#__PURE__*/React.forwardRef(({
|
|
6
|
+
tours
|
|
7
|
+
}, ref) => {
|
|
9
8
|
const tourValue = tours.find(tour => tour.enabled);
|
|
10
9
|
const {
|
|
11
10
|
enabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useEffect","useState","PropTypes","withDeprecatedProps","DeprTypes","Checkpoint","ProductTour","forwardRef","_ref","ref","tours","tourValue","find","tour","enabled","checkpoints","startingIndex","onEscape","onEnd","onAdvance","tourOnAdvance","onBack","tourOnBack","onDismiss","tourOnDismiss","advanceButtonText","tourAdvanceButtonText","dismissAltText","tourDismissAltText","endButtonText","tourEndButtonText","backButtonText","tourBackButtonText","currentCheckpointData","setCurrentCheckpointData","index","setIndex","isTourEnabled","setIsTourEnabled","prunedCheckpoints","setPrunedCheckpoints","title","body","placement","target","pruneCheckpoints","checkpointList","checkpointsWithRenderedTargets","filter","checkpoint","document","querySelector","length","handleEsc","event","key","global","addEventListener","removeEventListener","handleAdvance","handleBack","handleDismiss","handleEnd","checkpointIndex","createElement","totalCheckpoints","defaultProps","propTypes","arrayOf","shape","node","string","func","oneOf","isRequired","bool","number","tourId","hasDismissButtonText","obj","dismissButtonText","deprType","FORMAT","message","expect","propValue","Array","isArray","some","transform","map","updatedTour","warningMessage","console","warn","rest"],"sources":["../../src/ProductTour/index.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nimport Checkpoint from './Checkpoint';\n\nconst ProductTour = React.forwardRef(({ tours }, ref) => {\n const tourValue = tours.find((tour) => tour.enabled);\n const {\n enabled,\n checkpoints = [],\n startingIndex,\n onEscape,\n onEnd,\n onAdvance: tourOnAdvance,\n onBack: tourOnBack,\n onDismiss: tourOnDismiss,\n advanceButtonText: tourAdvanceButtonText,\n dismissAltText: tourDismissAltText,\n endButtonText: tourEndButtonText,\n backButtonText: tourBackButtonText,\n } = tourValue || {};\n const [currentCheckpointData, setCurrentCheckpointData] = useState(null);\n const [index, setIndex] = useState(0);\n const [isTourEnabled, setIsTourEnabled] = useState(false);\n const [prunedCheckpoints, setPrunedCheckpoints] = useState([]);\n const {\n title,\n body,\n onAdvance,\n onBack,\n onDismiss,\n advanceButtonText,\n dismissAltText,\n endButtonText,\n backButtonText,\n placement,\n target,\n } = currentCheckpointData || {};\n\n /**\n * Takes a list of checkpoints and verifies that each target string provided is\n * an element in the DOM.\n */\n const pruneCheckpoints = (checkpointList) => {\n const checkpointsWithRenderedTargets = checkpointList.filter(\n (checkpoint) => !!document.querySelector(checkpoint.target),\n );\n setPrunedCheckpoints(checkpointsWithRenderedTargets);\n };\n\n useEffect(() => {\n if (enabled && checkpoints) {\n setIsTourEnabled(enabled);\n pruneCheckpoints(checkpoints);\n setIndex(startingIndex || 0);\n }\n }, [enabled, checkpoints, startingIndex]);\n\n useEffect(() => {\n if (isTourEnabled && prunedCheckpoints.length) {\n setCurrentCheckpointData(prunedCheckpoints[index]);\n }\n }, [index, isTourEnabled, prunedCheckpoints]);\n\n useEffect(() => {\n const handleEsc = (event) => {\n if (event.key === 'Escape') {\n setIsTourEnabled(false);\n if (onEscape) {\n onEscape();\n }\n }\n };\n global.addEventListener('keydown', handleEsc);\n\n return () => {\n global.removeEventListener('keydown', handleEsc);\n };\n }, [onEscape]);\n\n if (!tourValue || !currentCheckpointData || !isTourEnabled) {\n return null;\n }\n\n const handleAdvance = () => {\n setIndex(index + 1);\n if (onAdvance) {\n onAdvance();\n } else if (tourOnAdvance) {\n tourOnAdvance();\n }\n };\n\n const handleBack = () => {\n setIndex(index - 1);\n if (onBack) {\n onBack();\n } else if (tourOnBack) {\n tourOnBack();\n }\n };\n\n const handleDismiss = () => {\n setIndex(0);\n setIsTourEnabled(false);\n if (onDismiss) {\n onDismiss();\n } else if (tourOnDismiss) {\n tourOnDismiss();\n }\n setCurrentCheckpointData(null);\n };\n /* eslint-disable */\n /**\n * Takes the final checkpoint array index value and looks for an existing onEnd callback.\n * \n * If an onEnd callback exist on checkpointIndex value and it is the final checkpoint \n * in the array, the onEnd callback will be called for the parent, and individual onEnd object. \n * \n * @param {Integer} checkpointIndex \n */\n /* eslint-enable */\n const handleEnd = (checkpointIndex) => {\n setIndex(0);\n setIsTourEnabled(false);\n if (prunedCheckpoints[checkpointIndex].onEnd) {\n prunedCheckpoints[checkpointIndex].onEnd();\n } else if (onEnd) {\n onEnd(prunedCheckpoints[checkpointIndex]);\n }\n setCurrentCheckpointData(null);\n };\n return (\n <Checkpoint\n advanceButtonText={advanceButtonText || tourAdvanceButtonText}\n body={body}\n currentCheckpointData={currentCheckpointData}\n dismissAltText={dismissAltText || tourDismissAltText}\n endButtonText={endButtonText || tourEndButtonText}\n backButtonText={backButtonText || tourBackButtonText}\n index={index}\n onBack={handleBack}\n onAdvance={handleAdvance}\n onDismiss={handleDismiss}\n onEnd={handleEnd}\n placement={placement}\n target={target}\n title={title}\n totalCheckpoints={prunedCheckpoints.length}\n ref={ref}\n />\n );\n});\n\nProductTour.defaultProps = {\n tours: {\n advanceButtonText: '',\n backButtonText: '',\n checkpoints: {\n advanceButtonText: '',\n backButtonText: '',\n body: '',\n dismissAltText: '',\n endButtonText: '',\n onAdvance: () => {},\n onDismiss: () => {},\n onBack: () => {},\n placement: 'top',\n title: '',\n },\n dismissAltText: '',\n endButtonText: '',\n onBack: () => {},\n onDismiss: () => {},\n onEnd: () => {},\n onEscape: () => {},\n startingIndex: 0,\n },\n};\n\nProductTour.propTypes = {\n tours: PropTypes.arrayOf(PropTypes.shape({\n /** The text displayed on all buttons used to advance the tour. */\n advanceButtonText: PropTypes.node,\n /** The text displayed on all buttons used to go back in the tour */\n backButtonText: PropTypes.string,\n /** An array comprised of checkpoint objects supporting the following values: */\n checkpoints: PropTypes.arrayOf(PropTypes.shape({\n /** The text displayed on the button used to advance the tour for the given Checkpoint\n * (overrides the* `advanceButtonText` defined in the parent tour object). */\n advanceButtonText: PropTypes.node,\n /** The text displayed on the button used to go back in the tour for the given Checkpoint\n * (overrides the* `backButtonText` defined in the parent tour object). */\n backButtonText: PropTypes.string,\n /** The text displayed in the body of the Checkpoint */\n body: PropTypes.node,\n /** The text used in the alt for the icon used to dismiss the tour for the given Checkpoint */\n dismissAltText: PropTypes.string,\n /** The text displayed on the button used to end the tour for the given Checkpoint\n * (overrides the `endButtonText` defined in the parent tour object). */\n endButtonText: PropTypes.node,\n /** A function that runs when triggering the `onClick` event of the advance\n * button for the given Checkpoint. */\n onAdvance: PropTypes.func,\n /** A function that runs when triggering the `onClick` event of the dismiss\n * button for the given Checkpoint (overrides the `onDismiss` function defined in the parent tour object). */\n onDismiss: PropTypes.func,\n /** A function that runs when triggering the `onClick` event of the advance\n * button if the given Checkpoint is the only or last Checkpoint in a tour. */\n onEnd: PropTypes.func,\n /** A string that dictates the alignment of the Checkpoint around its target. */\n placement: PropTypes.oneOf([\n 'top', 'top-start', 'top-end', 'right-start', 'right', 'right-end',\n 'left-start', 'left', 'left-end', 'bottom', 'bottom-start', 'bottom-end',\n ]),\n /** The CSS selector for the Checkpoint's desired target. */\n target: PropTypes.string.isRequired,\n /** The text displayed in the title of the Checkpoint */\n title: PropTypes.node,\n })),\n /** The text used in the alt for the icon used to dismiss the tour for the given Checkpoint */\n dismissAltText: PropTypes.string,\n /** Whether the tour is enabled. If there are multiple tours defined, only one should be enabled at a time. */\n enabled: PropTypes.bool.isRequired,\n /** The text displayed on the button used to end the tour. */\n endButtonText: PropTypes.node,\n /** A function that runs when triggering the `onBack` event of the back button. */\n onBack: PropTypes.func,\n /** A function that runs when triggering the `onClick` event of the dismiss button. */\n onDismiss: PropTypes.func,\n /** A function that runs when triggering the `onClick` event of the end button. */\n onEnd: PropTypes.func,\n /** A function that runs when pressing the Escape key. */\n onEscape: PropTypes.func,\n /** The index of the desired `Checkpoint` to render when the tour starts. */\n startingIndex: PropTypes.number,\n /** The ID of the tour */\n tourId: PropTypes.string.isRequired,\n })),\n};\n\n/**\n * Checks if the given object has a deprecated/legacy `dismissButtonText` property.\n * @param {Object} obj - The object to check\n * @returns {boolean} - True if the object has a deprecated/legacy `dismissButtonText` property, false otherwise\n */\nconst hasDismissButtonText = (obj) => {\n if ('dismissButtonText' in obj && !!obj.dismissButtonText) {\n return true;\n }\n return false;\n};\n\nexport default withDeprecatedProps(ProductTour, 'ProductTour', {\n tours: {\n deprType: DeprTypes.FORMAT,\n message: \"The dismissButtonText options in the 'tours' prop have been moved to 'dismissAltText'.\",\n /**\n * Determines whether the given prop value contains the deprecated/legacy `dismissButtonText` property.\n * @param {Object[]} propValue - The tours prop value to check\n * @returns {boolean} True if the prop value contains the deprecated/legacy `dismissButtonText`\n * property, false otherwise\n */\n expect: (propValue) => {\n if (!Array.isArray(propValue)) {\n return true;\n }\n return !propValue.some((tour) => {\n if (hasDismissButtonText(tour)) {\n return true;\n }\n return Array.isArray(tour.checkpoints)\n && tour.checkpoints.some(hasDismissButtonText);\n });\n },\n /**\n * Transforms the given prop value by updating the\n * deprecated/legacy `dismissButtonText` property to\n * `dismissAltText`, if the prop value is a string. Otherwise,\n * the original `dismissButtonText` property is ignored.\n * @param {Object[]} propValue - The tours prop value to transform\n * @returns {Object[]} The transformed prop value\n */\n transform: (propValue) => {\n const tours = propValue.map((tour) => {\n const updatedTour = { ...tour };\n\n // Replace tour level dismissButtonText with dismissAltText\n if (hasDismissButtonText(tour)) {\n if (typeof tour.dismissButtonText === 'string') {\n updatedTour.dismissAltText = tour.dismissButtonText;\n } else {\n const warningMessage = \"[Deprecated] ProductTour: The 'dismissButtonText' options within the 'tours' prop now expects a string\";\n // eslint-disable-next-line no-console\n console.warn(warningMessage);\n }\n }\n\n // Replace checkpoint level dismissButtonText with dismissAltText\n if (Array.isArray(tour.checkpoints)) {\n updatedTour.checkpoints = tour.checkpoints.map((checkpoint) => {\n if (hasDismissButtonText(checkpoint)) {\n const { dismissButtonText, ...rest } = checkpoint;\n if (typeof dismissButtonText === 'string') {\n return { ...rest, dismissAltText: dismissButtonText };\n }\n }\n return checkpoint;\n });\n }\n return updatedTour;\n });\n\n // Return the transformed tours\n return tours;\n },\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,OAAO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WAAW,CAAChE,cAAc,GAAGd,IAAI,CAACmE,iBAAiB;UACrD,CAAC,MAAM;YACL,MAAMY,cAAc,GAAG,wGAAwG;YAC/H;YACAC,OAAO,CAACC,IAAI,CAACF,cAAc,CAAC;UAC9B;QACF;;QAEA;QACA,IAAIN,KAAK,CAACC,OAAO,CAAC1E,IAAI,CAACE,WAAW,CAAC,EAAE;UACnC4E,WAAW,CAAC5E,WAAW,GAAGF,IAAI,CAACE,WAAW,CAAC2E,GAAG,CAAEzC,UAAU,IAAK;YAC7D,IAAI6B,oBAAoB,CAAC7B,UAAU,CAAC,EAAE;cACpC,MAAM;gBAAE+B,iBAAiB;gBAAE,GAAGe;cAAK,CAAC,GAAG9C,UAAU;cACjD,IAAI,OAAO+B,iBAAiB,KAAK,QAAQ,EAAE;gBACzC,OAAO;kBAAE,GAAGe,IAAI;kBAAEpE,cAAc,EAAEqD;gBAAkB,CAAC;cACvD;YACF;YACA,OAAO/B,UAAU;UACnB,CAAC,CAAC;QACJ;QACA,OAAO0C,WAAW;MACpB,CAAC,CAAC;;MAEF;MACA,OAAOjF,KAAK;IACd;EACF;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useEffect","useState","PropTypes","withDeprecatedProps","DeprTypes","Checkpoint","ProductTour","forwardRef","tours","ref","tourValue","find","tour","enabled","checkpoints","startingIndex","onEscape","onEnd","onAdvance","tourOnAdvance","onBack","tourOnBack","onDismiss","tourOnDismiss","advanceButtonText","tourAdvanceButtonText","dismissAltText","tourDismissAltText","endButtonText","tourEndButtonText","backButtonText","tourBackButtonText","currentCheckpointData","setCurrentCheckpointData","index","setIndex","isTourEnabled","setIsTourEnabled","prunedCheckpoints","setPrunedCheckpoints","title","body","placement","target","pruneCheckpoints","checkpointList","checkpointsWithRenderedTargets","filter","checkpoint","document","querySelector","length","handleEsc","event","key","global","addEventListener","removeEventListener","handleAdvance","handleBack","handleDismiss","handleEnd","checkpointIndex","createElement","totalCheckpoints","defaultProps","propTypes","arrayOf","shape","node","string","func","oneOf","isRequired","bool","number","tourId","hasDismissButtonText","obj","dismissButtonText","deprType","FORMAT","message","expect","propValue","Array","isArray","some","transform","map","updatedTour","warningMessage","console","warn","rest"],"sources":["../../src/ProductTour/index.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nimport Checkpoint from './Checkpoint';\n\nconst ProductTour = React.forwardRef(({ tours }, ref) => {\n const tourValue = tours.find((tour) => tour.enabled);\n const {\n enabled,\n checkpoints = [],\n startingIndex,\n onEscape,\n onEnd,\n onAdvance: tourOnAdvance,\n onBack: tourOnBack,\n onDismiss: tourOnDismiss,\n advanceButtonText: tourAdvanceButtonText,\n dismissAltText: tourDismissAltText,\n endButtonText: tourEndButtonText,\n backButtonText: tourBackButtonText,\n } = tourValue || {};\n const [currentCheckpointData, setCurrentCheckpointData] = useState(null);\n const [index, setIndex] = useState(0);\n const [isTourEnabled, setIsTourEnabled] = useState(false);\n const [prunedCheckpoints, setPrunedCheckpoints] = useState([]);\n const {\n title,\n body,\n onAdvance,\n onBack,\n onDismiss,\n advanceButtonText,\n dismissAltText,\n endButtonText,\n backButtonText,\n placement,\n target,\n } = currentCheckpointData || {};\n\n /**\n * Takes a list of checkpoints and verifies that each target string provided is\n * an element in the DOM.\n */\n const pruneCheckpoints = (checkpointList) => {\n const checkpointsWithRenderedTargets = checkpointList.filter(\n (checkpoint) => !!document.querySelector(checkpoint.target),\n );\n setPrunedCheckpoints(checkpointsWithRenderedTargets);\n };\n\n useEffect(() => {\n if (enabled && checkpoints) {\n setIsTourEnabled(enabled);\n pruneCheckpoints(checkpoints);\n setIndex(startingIndex || 0);\n }\n }, [enabled, checkpoints, startingIndex]);\n\n useEffect(() => {\n if (isTourEnabled && prunedCheckpoints.length) {\n setCurrentCheckpointData(prunedCheckpoints[index]);\n }\n }, [index, isTourEnabled, prunedCheckpoints]);\n\n useEffect(() => {\n const handleEsc = (event) => {\n if (event.key === 'Escape') {\n setIsTourEnabled(false);\n if (onEscape) {\n onEscape();\n }\n }\n };\n global.addEventListener('keydown', handleEsc);\n\n return () => {\n global.removeEventListener('keydown', handleEsc);\n };\n }, [onEscape]);\n\n if (!tourValue || !currentCheckpointData || !isTourEnabled) {\n return null;\n }\n\n const handleAdvance = () => {\n setIndex(index + 1);\n if (onAdvance) {\n onAdvance();\n } else if (tourOnAdvance) {\n tourOnAdvance();\n }\n };\n\n const handleBack = () => {\n setIndex(index - 1);\n if (onBack) {\n onBack();\n } else if (tourOnBack) {\n tourOnBack();\n }\n };\n\n const handleDismiss = () => {\n setIndex(0);\n setIsTourEnabled(false);\n if (onDismiss) {\n onDismiss();\n } else if (tourOnDismiss) {\n tourOnDismiss();\n }\n setCurrentCheckpointData(null);\n };\n /* eslint-disable */\n /**\n * Takes the final checkpoint array index value and looks for an existing onEnd callback.\n * \n * If an onEnd callback exist on checkpointIndex value and it is the final checkpoint \n * in the array, the onEnd callback will be called for the parent, and individual onEnd object. \n * \n * @param {Integer} checkpointIndex \n */\n /* eslint-enable */\n const handleEnd = (checkpointIndex) => {\n setIndex(0);\n setIsTourEnabled(false);\n if (prunedCheckpoints[checkpointIndex].onEnd) {\n prunedCheckpoints[checkpointIndex].onEnd();\n } else if (onEnd) {\n onEnd(prunedCheckpoints[checkpointIndex]);\n }\n setCurrentCheckpointData(null);\n };\n return (\n <Checkpoint\n advanceButtonText={advanceButtonText || tourAdvanceButtonText}\n body={body}\n currentCheckpointData={currentCheckpointData}\n dismissAltText={dismissAltText || tourDismissAltText}\n endButtonText={endButtonText || tourEndButtonText}\n backButtonText={backButtonText || tourBackButtonText}\n index={index}\n onBack={handleBack}\n onAdvance={handleAdvance}\n onDismiss={handleDismiss}\n onEnd={handleEnd}\n placement={placement}\n target={target}\n title={title}\n totalCheckpoints={prunedCheckpoints.length}\n ref={ref}\n />\n );\n});\n\nProductTour.defaultProps = {\n tours: {\n advanceButtonText: '',\n backButtonText: '',\n checkpoints: {\n advanceButtonText: '',\n backButtonText: '',\n body: '',\n dismissAltText: '',\n endButtonText: '',\n onAdvance: () => {},\n onDismiss: () => {},\n onBack: () => {},\n placement: 'top',\n title: '',\n },\n dismissAltText: '',\n endButtonText: '',\n onBack: () => {},\n onDismiss: () => {},\n onEnd: () => {},\n onEscape: () => {},\n startingIndex: 0,\n },\n};\n\nProductTour.propTypes = {\n tours: PropTypes.arrayOf(PropTypes.shape({\n /** The text displayed on all buttons used to advance the tour. */\n advanceButtonText: PropTypes.node,\n /** The text displayed on all buttons used to go back in the tour */\n backButtonText: PropTypes.string,\n /** An array comprised of checkpoint objects supporting the following values: */\n checkpoints: PropTypes.arrayOf(PropTypes.shape({\n /** The text displayed on the button used to advance the tour for the given Checkpoint\n * (overrides the* `advanceButtonText` defined in the parent tour object). */\n advanceButtonText: PropTypes.node,\n /** The text displayed on the button used to go back in the tour for the given Checkpoint\n * (overrides the* `backButtonText` defined in the parent tour object). */\n backButtonText: PropTypes.string,\n /** The text displayed in the body of the Checkpoint */\n body: PropTypes.node,\n /** The text used in the alt for the icon used to dismiss the tour for the given Checkpoint */\n dismissAltText: PropTypes.string,\n /** The text displayed on the button used to end the tour for the given Checkpoint\n * (overrides the `endButtonText` defined in the parent tour object). */\n endButtonText: PropTypes.node,\n /** A function that runs when triggering the `onClick` event of the advance\n * button for the given Checkpoint. */\n onAdvance: PropTypes.func,\n /** A function that runs when triggering the `onClick` event of the dismiss\n * button for the given Checkpoint (overrides the `onDismiss` function defined in the parent tour object). */\n onDismiss: PropTypes.func,\n /** A function that runs when triggering the `onClick` event of the advance\n * button if the given Checkpoint is the only or last Checkpoint in a tour. */\n onEnd: PropTypes.func,\n /** A string that dictates the alignment of the Checkpoint around its target. */\n placement: PropTypes.oneOf([\n 'top', 'top-start', 'top-end', 'right-start', 'right', 'right-end',\n 'left-start', 'left', 'left-end', 'bottom', 'bottom-start', 'bottom-end',\n ]),\n /** The CSS selector for the Checkpoint's desired target. */\n target: PropTypes.string.isRequired,\n /** The text displayed in the title of the Checkpoint */\n title: PropTypes.node,\n })),\n /** The text used in the alt for the icon used to dismiss the tour for the given Checkpoint */\n dismissAltText: PropTypes.string,\n /** Whether the tour is enabled. If there are multiple tours defined, only one should be enabled at a time. */\n enabled: PropTypes.bool.isRequired,\n /** The text displayed on the button used to end the tour. */\n endButtonText: PropTypes.node,\n /** A function that runs when triggering the `onBack` event of the back button. */\n onBack: PropTypes.func,\n /** A function that runs when triggering the `onClick` event of the dismiss button. */\n onDismiss: PropTypes.func,\n /** A function that runs when triggering the `onClick` event of the end button. */\n onEnd: PropTypes.func,\n /** A function that runs when pressing the Escape key. */\n onEscape: PropTypes.func,\n /** The index of the desired `Checkpoint` to render when the tour starts. */\n startingIndex: PropTypes.number,\n /** The ID of the tour */\n tourId: PropTypes.string.isRequired,\n })),\n};\n\n/**\n * Checks if the given object has a deprecated/legacy `dismissButtonText` property.\n * @param {Object} obj - The object to check\n * @returns {boolean} - True if the object has a deprecated/legacy `dismissButtonText` property, false otherwise\n */\nconst hasDismissButtonText = (obj) => {\n if ('dismissButtonText' in obj && !!obj.dismissButtonText) {\n return true;\n }\n return false;\n};\n\nexport default withDeprecatedProps(ProductTour, 'ProductTour', {\n tours: {\n deprType: DeprTypes.FORMAT,\n message: \"The dismissButtonText options in the 'tours' prop have been moved to 'dismissAltText'.\",\n /**\n * Determines whether the given prop value contains the deprecated/legacy `dismissButtonText` property.\n * @param {Object[]} propValue - The tours prop value to check\n * @returns {boolean} True if the prop value contains the deprecated/legacy `dismissButtonText`\n * property, false otherwise\n */\n expect: (propValue) => {\n if (!Array.isArray(propValue)) {\n return true;\n }\n return !propValue.some((tour) => {\n if (hasDismissButtonText(tour)) {\n return true;\n }\n return Array.isArray(tour.checkpoints)\n && tour.checkpoints.some(hasDismissButtonText);\n });\n },\n /**\n * Transforms the given prop value by updating the\n * deprecated/legacy `dismissButtonText` property to\n * `dismissAltText`, if the prop value is a string. Otherwise,\n * the original `dismissButtonText` property is ignored.\n * @param {Object[]} propValue - The tours prop value to transform\n * @returns {Object[]} The transformed prop value\n */\n transform: (propValue) => {\n const tours = propValue.map((tour) => {\n const updatedTour = { ...tour };\n\n // Replace tour level dismissButtonText with dismissAltText\n if (hasDismissButtonText(tour)) {\n if (typeof tour.dismissButtonText === 'string') {\n updatedTour.dismissAltText = tour.dismissButtonText;\n } else {\n const warningMessage = \"[Deprecated] ProductTour: The 'dismissButtonText' options within the 'tours' prop now expects a string\";\n // eslint-disable-next-line no-console\n console.warn(warningMessage);\n }\n }\n\n // Replace checkpoint level dismissButtonText with dismissAltText\n if (Array.isArray(tour.checkpoints)) {\n updatedTour.checkpoints = tour.checkpoints.map((checkpoint) => {\n if (hasDismissButtonText(checkpoint)) {\n const { dismissButtonText, ...rest } = checkpoint;\n if (typeof dismissButtonText === 'string') {\n return { ...rest, dismissAltText: dismissButtonText };\n }\n }\n return checkpoint;\n });\n }\n return updatedTour;\n });\n\n // Return the transformed tours\n return tours;\n },\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,OAAOC,UAAU,MAAM,cAAc;AAErC,MAAMC,WAAW,gBAAGP,KAAK,CAACQ,UAAU,CAAC,CAAC;EAAEC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACvD,MAAMC,SAAS,GAAGF,KAAK,CAACG,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACC,OAAO,CAAC;EACpD,MAAM;IACJA,OAAO;IACPC,WAAW,GAAG,EAAE;IAChBC,aAAa;IACbC,QAAQ;IACRC,KAAK;IACLC,SAAS,EAAEC,aAAa;IACxBC,MAAM,EAAEC,UAAU;IAClBC,SAAS,EAAEC,aAAa;IACxBC,iBAAiB,EAAEC,qBAAqB;IACxCC,cAAc,EAAEC,kBA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EqD;gBAAkB,CAAC;cACvD;YACF;YACA,OAAO/B,UAAU;UACnB,CAAC,CAAC;QACJ;QACA,OAAO0C,WAAW;MACpB,CAAC,CAAC;;MAEF;MACA,OAAOlF,KAAK;IACd;EACF;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
topPositionText: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
bottomPositionText: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
pageIndexText: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
closeAltText: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default messages;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl';
|
|
2
|
-
|
|
3
2
|
const messages = defineMessages({
|
|
4
3
|
topPositionText: {
|
|
5
4
|
id: 'pgn.ProductTour.Checkpoint.top-position-text',
|
|
6
5
|
defaultMessage: 'Top of step {step}',
|
|
7
|
-
description: 'Screen-reader message to notify user that they are located at the bottom of the product tour step.'
|
|
6
|
+
description: 'Screen-reader message to notify user that they are located at the bottom of the product tour step.'
|
|
8
7
|
},
|
|
9
8
|
bottomPositionText: {
|
|
10
9
|
id: 'pgn.ProductTour.Checkpoint.bottom-position-text',
|
|
11
10
|
defaultMessage: 'Bottom of step {step}',
|
|
12
|
-
description: 'Screen-reader message to notify user that they are located at the bottom of the product tour step.'
|
|
11
|
+
description: 'Screen-reader message to notify user that they are located at the bottom of the product tour step.'
|
|
13
12
|
},
|
|
14
13
|
pageIndexText: {
|
|
15
14
|
id: 'pgn.ProductTour.Checkpoint.page-index-text',
|
|
16
15
|
defaultMessage: '{step} of {totalSteps}',
|
|
17
|
-
description: 'Page index showing your place in the ProductTour'
|
|
16
|
+
description: 'Page index showing your place in the ProductTour'
|
|
18
17
|
},
|
|
19
18
|
closeAltText: {
|
|
20
19
|
id: 'pgn.ProductTour.checkpointHeader.close',
|
|
21
20
|
defaultMessage: 'Close tour',
|
|
22
|
-
description: 'Close alternative text for ProductTour component'
|
|
23
|
-
}
|
|
21
|
+
description: 'Close alternative text for ProductTour component'
|
|
22
|
+
}
|
|
24
23
|
});
|
|
25
|
-
|
|
26
24
|
export default messages;
|
|
25
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","names":["defineMessages","messages","topPositionText","id","defaultMessage","description","bottomPositionText","pageIndexText","closeAltText"],"sources":["../../src/ProductTour/messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n topPositionText: {\n id: 'pgn.ProductTour.Checkpoint.top-position-text',\n defaultMessage: 'Top of step {step}',\n description: 'Screen-reader message to notify user that they are located at the bottom of the product tour step.',\n },\n bottomPositionText: {\n id: 'pgn.ProductTour.Checkpoint.bottom-position-text',\n defaultMessage: 'Bottom of step {step}',\n description: 'Screen-reader message to notify user that they are located at the bottom of the product tour step.',\n },\n pageIndexText: {\n id: 'pgn.ProductTour.Checkpoint.page-index-text',\n defaultMessage: '{step} of {totalSteps}',\n description: 'Page index showing your place in the ProductTour',\n },\n closeAltText: {\n id: 'pgn.ProductTour.checkpointHeader.close',\n defaultMessage: 'Close tour',\n description: 'Close alternative text for ProductTour component',\n },\n});\n\nexport default messages;\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,YAAY;AAE3C,MAAMC,QAAQ,GAAGD,cAAc,CAAC;EAC9BE,eAAe,EAAE;IACfC,EAAE,EAAE,8CAA8C;IAClDC,cAAc,EAAE,oBAAoB;IACpCC,WAAW,EAAE;EACf,CAAC;EACDC,kBAAkB,EAAE;IAClBH,EAAE,EAAE,iDAAiD;IACrDC,cAAc,EAAE,uBAAuB;IACvCC,WAAW,EAAE;EACf,CAAC;EACDE,aAAa,EAAE;IACbJ,EAAE,EAAE,4CAA4C;IAChDC,cAAc,EAAE,wBAAwB;IACxCC,WAAW,EAAE;EACf,CAAC;EACDG,YAAY,EAAE;IACZL,EAAE,EAAE,wCAAwC;IAC5CC,cAAc,EAAE,YAAY;IAC5BC,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,eAAeJ,QAAQ","ignoreList":[]}
|
|
@@ -14,18 +14,17 @@ function ProgressBar(props) {
|
|
|
14
14
|
...props
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
function ProgressBarAnnotated(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref;
|
|
17
|
+
function ProgressBarAnnotated({
|
|
18
|
+
now,
|
|
19
|
+
label,
|
|
20
|
+
variant,
|
|
21
|
+
threshold,
|
|
22
|
+
thresholdLabel,
|
|
23
|
+
thresholdVariant,
|
|
24
|
+
progressHint,
|
|
25
|
+
thresholdHint,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
29
28
|
const progressInfoRef = React.useRef();
|
|
30
29
|
const thresholdInfoRef = React.useRef();
|
|
31
30
|
const thresholdPercent = (threshold || 0) - (now || 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","ProgressBarBase","PropTypes","classNames","Annotation","getOffsetStyles","placeInfoAtZero","ANNOTATION_CLASS","HINT_SWAP_PERCENT","PROGRESS_DEFAULT_VARIANT","THRESHOLD_DEFAULT_VARIANT","VARIANTS","ProgressBar","props","createElement","ProgressBarAnnotated","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","ProgressBarBase","PropTypes","classNames","Annotation","getOffsetStyles","placeInfoAtZero","ANNOTATION_CLASS","HINT_SWAP_PERCENT","PROGRESS_DEFAULT_VARIANT","THRESHOLD_DEFAULT_VARIANT","VARIANTS","ProgressBar","props","createElement","ProgressBarAnnotated","now","label","variant","threshold","thresholdLabel","thresholdVariant","progressHint","thresholdHint","progressInfoRef","useRef","thresholdInfoRef","thresholdPercent","isProgressHintAfter","isThresholdHintAfter","progressColor","includes","thresholdColor","direction","window","getComputedStyle","document","body","getPropertyValue","positionAnnotations","observer","ResizeObserver","progressInfoEl","current","observe","unobserve","getHint","text","className","style","ref","srOnly","arrowPlacement","propTypes","number","node","oneOf","string","defaultProps","undefined","Annotated"],"sources":["../../src/ProgressBar/index.jsx"],"sourcesContent":["import React, { useCallback, useEffect } from 'react';\nimport ProgressBarBase from 'react-bootstrap/ProgressBar';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Annotation from '../Annotation';\nimport { getOffsetStyles, placeInfoAtZero } from './utils';\n\nexport const ANNOTATION_CLASS = 'pgn__annotation';\nconst HINT_SWAP_PERCENT = 50;\nconst PROGRESS_DEFAULT_VARIANT = 'warning';\nconst THRESHOLD_DEFAULT_VARIANT = 'dark';\nconst VARIANTS = [\n 'dark',\n 'warning',\n 'success',\n 'error',\n];\n\nfunction ProgressBar(props) {\n return <ProgressBarBase {...props} />;\n}\n\nfunction ProgressBarAnnotated({\n now,\n label,\n variant,\n threshold,\n thresholdLabel,\n thresholdVariant,\n progressHint,\n thresholdHint,\n ...props\n}) {\n const progressInfoRef = React.useRef();\n const thresholdInfoRef = React.useRef();\n const thresholdPercent = (threshold || 0) - (now || 0);\n const isProgressHintAfter = now < HINT_SWAP_PERCENT;\n const isThresholdHintAfter = threshold < HINT_SWAP_PERCENT;\n const progressColor = VARIANTS.includes(variant) ? variant : PROGRESS_DEFAULT_VARIANT;\n const thresholdColor = VARIANTS.includes(thresholdVariant) ? thresholdVariant : THRESHOLD_DEFAULT_VARIANT;\n const direction = window.getComputedStyle(document.body).getPropertyValue('direction');\n\n const positionAnnotations = useCallback(() => {\n placeInfoAtZero(progressInfoRef, direction, isProgressHintAfter, ANNOTATION_CLASS);\n placeInfoAtZero(thresholdInfoRef, direction, isThresholdHintAfter, ANNOTATION_CLASS);\n }, [direction, isProgressHintAfter, isThresholdHintAfter]);\n\n useEffect(() => {\n positionAnnotations();\n const observer = new ResizeObserver(() => {\n positionAnnotations();\n });\n const progressInfoEl = progressInfoRef.current;\n observer.observe(progressInfoEl);\n return () => progressInfoEl && observer.unobserve(progressInfoEl);\n }, [positionAnnotations]);\n\n const getHint = (text) => (\n <span className=\"pgn__progress-hint\" data-testid=\"progress-hint\">\n {text}\n </span>\n );\n\n return (\n <div className=\"pgn__progress-annotated\">\n {!!label && (\n <div\n className=\"pgn__progress-info\"\n style={getOffsetStyles(now, direction)}\n ref={progressInfoRef}\n >\n {!isProgressHintAfter && getHint(progressHint)}\n <Annotation variant={progressColor}>\n {label}\n </Annotation>\n {isProgressHintAfter && getHint(progressHint)}\n </div>\n )}\n <ProgressBarBase>\n <ProgressBarBase\n {...props}\n now={now}\n className={classNames(\n `pgn__progress-bar--${progressColor}`,\n thresholdPercent > 0 ? 'pgn__progress-tick--white' : 'pgn__progress-tick--black',\n )}\n srOnly\n />\n {!!threshold && (\n <ProgressBarBase\n now={thresholdPercent}\n className={`pgn__progress-bar--${thresholdColor}`}\n srOnly\n />\n )}\n </ProgressBarBase>\n {(!!threshold && !!thresholdLabel) && (\n <div\n className=\"pgn__progress-info\"\n style={getOffsetStyles(threshold, direction)}\n ref={thresholdInfoRef}\n >\n {!isThresholdHintAfter && getHint(thresholdHint)}\n <Annotation\n arrowPlacement=\"top\"\n variant={thresholdColor}\n >\n {thresholdLabel}\n </Annotation>\n {isThresholdHintAfter && getHint(thresholdHint)}\n </div>\n )}\n </div>\n );\n}\n\nProgressBarAnnotated.propTypes = {\n /** Current value of progress. */\n now: PropTypes.number,\n /** Show label that represents visual percentage. */\n label: PropTypes.node,\n /** The `ProgressBar` style variant to use. */\n variant: PropTypes.oneOf(VARIANTS),\n /** Specifies an additional `className` to add to the base element. */\n className: PropTypes.string,\n /** Threshold current value. */\n threshold: PropTypes.number,\n /** Specifies label for `threshold`. */\n thresholdLabel: PropTypes.node,\n /** Variant for threshold value. */\n thresholdVariant: PropTypes.oneOf(VARIANTS),\n /** Text near the progress annotation. */\n progressHint: PropTypes.node,\n /** Text near the threshold annotation. */\n thresholdHint: PropTypes.node,\n};\n\nProgressBarAnnotated.defaultProps = {\n now: undefined,\n label: undefined,\n variant: PROGRESS_DEFAULT_VARIANT,\n className: undefined,\n threshold: undefined,\n thresholdLabel: undefined,\n thresholdVariant: THRESHOLD_DEFAULT_VARIANT,\n progressHint: undefined,\n thresholdHint: undefined,\n};\n\nProgressBar.Annotated = ProgressBarAnnotated;\nexport default ProgressBar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AACrD,OAAOC,eAAe,MAAM,6BAA6B;AACzD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,UAAU,MAAM,eAAe;AACtC,SAASC,eAAe,EAAEC,eAAe,QAAQ,SAAS;AAE1D,OAAO,MAAMC,gBAAgB,GAAG,iBAAiB;AACjD,MAAMC,iBAAiB,GAAG,EAAE;AAC5B,MAAMC,wBAAwB,GAAG,SAAS;AAC1C,MAAMC,yBAAyB,GAAG,MAAM;AACxC,MAAMC,QAAQ,GAAG,CACf,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,CACR;AAED,SAASC,WAAWA,CAACC,KAAK,EAAE;EAC1B,oBAAOf,KAAA,CAAAgB,aAAA,CAACb,eAAe;IAAA,GAAKY;EAAK,CAAG,CAAC;AACvC;AAEA,SAASE,oBAAoBA,CAAC;EAC5BC,GAAG;EACHC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,cAAc;EACdC,gBAAgB;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],"sources":["../../src/ResponsiveEmbed/index.
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../src/ResponsiveEmbed/index.tsx"],"sourcesContent":["export { default } from 'react-bootstrap/ResponsiveEmbed';\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,iCAAiC","ignoreList":[]}
|
package/dist/Scrollable/index.js
CHANGED
|
@@ -4,11 +4,10 @@ import classNames from 'classnames';
|
|
|
4
4
|
import useIsVisible from '../hooks/useIsVisibleHook';
|
|
5
5
|
export const CLASSNAME_SCROLL_TOP = 'pgn__scrollable-body-scroll-top';
|
|
6
6
|
export const CLASSNAME_SCROLL_BOTTOM = 'pgn__scrollable-body-scroll-bottom';
|
|
7
|
-
function Scrollable(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
7
|
+
function Scrollable({
|
|
8
|
+
children,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
12
11
|
const [isScrolledToTop, topSentinelRef] = useIsVisible();
|
|
13
12
|
const [isScrolledToBottom, bottomSentinelRef] = useIsVisible();
|
|
14
13
|
const [valueNow, setValueNow] = useState(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","PropTypes","classNames","useIsVisible","CLASSNAME_SCROLL_TOP","CLASSNAME_SCROLL_BOTTOM","Scrollable","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","PropTypes","classNames","useIsVisible","CLASSNAME_SCROLL_TOP","CLASSNAME_SCROLL_BOTTOM","Scrollable","children","props","isScrolledToTop","topSentinelRef","isScrolledToBottom","bottomSentinelRef","valueNow","setValueNow","className","handleScroll","e","maxScrollHeight","currentTarget","scrollHeight","clientHeight","Math","ceil","scrollTop","createElement","role","tabIndex","onScroll","ref","propTypes","node","isRequired","string","defaultProps","undefined"],"sources":["../../src/Scrollable/index.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport useIsVisible from '../hooks/useIsVisibleHook';\n\nexport const CLASSNAME_SCROLL_TOP = 'pgn__scrollable-body-scroll-top';\nexport const CLASSNAME_SCROLL_BOTTOM = 'pgn__scrollable-body-scroll-bottom';\n\nfunction Scrollable({ children, ...props }) {\n const [isScrolledToTop, topSentinelRef] = useIsVisible();\n const [isScrolledToBottom, bottomSentinelRef] = useIsVisible();\n const [valueNow, setValueNow] = useState(0);\n const className = classNames(\n 'pgn__scrollable-body',\n props.className,\n {\n [CLASSNAME_SCROLL_TOP]: isScrolledToTop,\n [CLASSNAME_SCROLL_BOTTOM]: isScrolledToBottom,\n },\n );\n\n const handleScroll = (e) => {\n const maxScrollHeight = e.currentTarget.scrollHeight - e.currentTarget.clientHeight;\n setValueNow(Math.ceil((100 * e.currentTarget.scrollTop) / maxScrollHeight));\n };\n\n return (\n <div\n {...props}\n className={className}\n role=\"scrollbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={valueNow}\n aria-controls=\"scrollbar\"\n tabIndex=\"0\"\n onScroll={handleScroll}\n >\n <div ref={topSentinelRef} />\n <div className=\"pgn__scrollable-body-content\">\n {children}\n </div>\n <div ref={bottomSentinelRef} />\n </div>\n );\n}\n\nScrollable.propTypes = {\n /** Specifies the content of the `Scrollable`. */\n children: PropTypes.node.isRequired,\n /** Additional classnames for this component. */\n className: PropTypes.string,\n};\n\nScrollable.defaultProps = {\n className: undefined,\n};\n\nexport default Scrollable;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,YAAY,MAAM,2BAA2B;AAEpD,OAAO,MAAMC,oBAAoB,GAAG,iCAAiC;AACrE,OAAO,MAAMC,uBAAuB,GAAG,oCAAoC;AAE3E,SAASC,UAAUA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAE;EAC1C,MAAM,CAACC,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B,UAAU,CAAC4B,YAAY,GAAG;EACxBnB,SAAS,EAAEoB;AACb,CAAC;AAED,eAAe7B,UAAU","ignoreList":[]}
|
|
@@ -2,11 +2,10 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { SearchFieldContext } from './SearchFieldAdvanced';
|
|
5
|
-
function SearchFieldLabel(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = _ref;
|
|
5
|
+
function SearchFieldLabel({
|
|
6
|
+
children,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
10
9
|
const {
|
|
11
10
|
screenReaderText,
|
|
12
11
|
inputId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchFieldLabel.js","names":["React","useContext","PropTypes","classNames","SearchFieldContext","SearchFieldLabel","
|
|
1
|
+
{"version":3,"file":"SearchFieldLabel.js","names":["React","useContext","PropTypes","classNames","SearchFieldContext","SearchFieldLabel","children","props","screenReaderText","inputId","createElement","htmlFor","current","className","label","propTypes","oneOfType","string","element","defaultProps","undefined"],"sources":["../../src/SearchField/SearchFieldLabel.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport { SearchFieldContext } from './SearchFieldAdvanced';\n\nfunction SearchFieldLabel({ children, ...props }) {\n const { screenReaderText, inputId } = useContext(SearchFieldContext);\n\n return (\n <label\n htmlFor={inputId.current}\n className={classNames('m-0', { 'has-label-text': !!children })}\n {...props}\n >\n {children || <span className=\"sr-only\">{screenReaderText.label}</span>}\n </label>\n );\n}\n\nSearchFieldLabel.propTypes = {\n /**\n * specifies the label to use for the input field (e.g., for i18n translations).\n * Note: if `children` is not provided, a screenreader-only label will be used in\n * its placed based on the `screenReaderText.label` prop for `SearchField.Advanced`.\n */\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n};\n\nSearchFieldLabel.defaultProps = {\n children: undefined,\n};\n\nexport default SearchFieldLabel;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1D,SAASC,gBAAgBA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAE;EAChD,MAAM;IAAEC,gBAAgB;IAAEC;EAAQ,CAAC,GAAGR,UAAU,CAACG,kBAAkB,CAAC;EAEpE,oBACEJ,KAAA,CAAAU,aAAA;IACEC,OAAO,EAAEF,OAAO,CAACG,OAAQ;IACzBC,SAAS,EAAEV,UAAU,CAAC,KAAK,EAAE;MAAE,gBAAgB,EAAE,CAAC,CAACG;IAAS,CAAC,CAAE;IAAA,GAC3DC;EAAK,GAERD,QAAQ,iBAAIN,KAAA,CAAAU,aAAA;IAAMG,SAAS,EAAC;EAAS,GAAEL,gBAAgB,CAACM,KAAY,CAChE,CAAC;AAEZ;AAEAT,gBAAgB,CAACU,SAAS,GAAG;EAC3B;AACF;AACA;AACA;AACA;EACET,QAAQ,EAAEJ,SAAS,CAACc,SAAS,CAAC,CAACd,SAAS,CAACe,MAAM,EAAEf,SAAS,CAACgB,OAAO,CAAC;AACrE,CAAC;AAEDb,gBAAgB,CAACc,YAAY,GAAG;EAC9Bb,QAAQ,EAAEc;AACZ,CAAC;AAED,eAAef,gBAAgB","ignoreList":[]}
|
|
@@ -5,20 +5,19 @@ import { getInputType } from './utils';
|
|
|
5
5
|
import { requiredWhenNot } from '../utils/propTypes';
|
|
6
6
|
const INPUT_TYPES = ['radio', 'checkbox'];
|
|
7
7
|
const DEFAULT_COLUMNS_NUMBER = 2;
|
|
8
|
-
const SelectableBoxSet = /*#__PURE__*/React.forwardRef((
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = _ref;
|
|
8
|
+
const SelectableBoxSet = /*#__PURE__*/React.forwardRef(({
|
|
9
|
+
children,
|
|
10
|
+
name,
|
|
11
|
+
value,
|
|
12
|
+
defaultValue,
|
|
13
|
+
onChange,
|
|
14
|
+
type,
|
|
15
|
+
columns,
|
|
16
|
+
className,
|
|
17
|
+
ariaLabel,
|
|
18
|
+
ariaLabelledby,
|
|
19
|
+
...props
|
|
20
|
+
}, ref) => {
|
|
22
21
|
const inputType = getInputType('SelectableBoxSet', type);
|
|
23
22
|
return /*#__PURE__*/React.createElement(inputType, {
|
|
24
23
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableBoxSet.js","names":["React","PropTypes","classNames","getInputType","requiredWhenNot","INPUT_TYPES","DEFAULT_COLUMNS_NUMBER","SelectableBoxSet","forwardRef","
|
|
1
|
+
{"version":3,"file":"SelectableBoxSet.js","names":["React","PropTypes","classNames","getInputType","requiredWhenNot","INPUT_TYPES","DEFAULT_COLUMNS_NUMBER","SelectableBoxSet","forwardRef","children","name","value","defaultValue","onChange","type","columns","className","ariaLabel","ariaLabelledby","props","ref","inputType","createElement","propTypes","string","isRequired","node","func","oneOfType","number","array","oneOf","defaultProps","undefined"],"sources":["../../src/SelectableBox/SelectableBoxSet.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { getInputType } from './utils';\nimport { requiredWhenNot } from '../utils/propTypes';\n\nconst INPUT_TYPES = [\n 'radio',\n 'checkbox',\n];\n\nconst DEFAULT_COLUMNS_NUMBER = 2;\n\nconst SelectableBoxSet = React.forwardRef(({\n children,\n name,\n value,\n defaultValue,\n onChange,\n type,\n columns,\n className,\n ariaLabel,\n ariaLabelledby,\n ...props\n}, ref) => {\n const inputType = getInputType('SelectableBoxSet', type);\n\n return React.createElement(\n inputType,\n {\n name,\n value,\n defaultValue,\n onChange,\n ref,\n className: classNames(\n 'pgn__selectable_box-set',\n `pgn__selectable_box-set--${columns || DEFAULT_COLUMNS_NUMBER}`,\n className,\n ),\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...props,\n },\n children,\n );\n});\n\nSelectableBoxSet.propTypes = {\n /** Specifies a name for the group of `SelectableBox`'es. */\n name: PropTypes.string.isRequired,\n /** Content of the `SelectableBoxSet`. */\n children: PropTypes.node,\n /** A function that receives event of the clicked `SelectableBox` and can be used to handle the value change. */\n onChange: PropTypes.func,\n /** Indicates selected `SelectableBox`'es. */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),\n /** Specifies default values for the `SelectableBox`'es. */\n defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n /** Indicates the input type: checkbox or radio. */\n type: PropTypes.oneOf(INPUT_TYPES),\n /**\n * Specifies number of `SelectableBox`'es in a row.\n *\n * Class that is responsible for the columns number: `pgn__selectable_box-set--{columns}`.\n * Max number of columns: `12`.\n */\n columns: PropTypes.number,\n /** A class that is be appended to the base element. */\n className: PropTypes.string,\n /**\n * The ID of the label for the `SelectableBoxSet`.\n *\n * An accessible label must be provided to the `SelectableBoxSet`.\n */\n ariaLabelledby: PropTypes.string,\n /**\n * A label for the `SelectableBoxSet`.\n *\n * If not using `ariaLabelledby`, then `ariaLabel` must be provided */\n ariaLabel: requiredWhenNot(PropTypes.string, 'ariaLabelledby'),\n};\n\nSelectableBoxSet.defaultProps = {\n children: undefined,\n onChange: () => {},\n value: undefined,\n defaultValue: undefined,\n type: 'radio',\n columns: DEFAULT_COLUMNS_NUMBER,\n className: undefined,\n ariaLabelledby: undefined,\n ariaLabel: undefined,\n};\n\nexport default SelectableBoxSet;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,YAAY,QAAQ,SAAS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CAAC8B,KAAK,CAAC1B,WAAW,CAAC;EAClC;AACF;AACA;AACA;AACA;AACA;EACEU,OAAO,EAAEd,SAAS,CAAC4B,MAAM;EACzB;EACAb,SAAS,EAAEf,SAAS,CAACuB,MAAM;EAC3B;AACF;AACA;AACA;AACA;EACEN,cAAc,EAAEjB,SAAS,CAACuB,MAAM;EAChC;AACF;AACA;AACA;EACEP,SAAS,EAAEb,eAAe,CAACH,SAAS,CAACuB,MAAM,EAAE,gBAAgB;AAC/D,CAAC;AAEDjB,gBAAgB,CAACyB,YAAY,GAAG;EAC9BvB,QAAQ,EAAEwB,SAAS;EACnBpB,QAAQ,EAAEA,CAAA,KAAM,CAAC,CAAC;EAClBF,KAAK,EAAEsB,SAAS;EAChBrB,YAAY,EAAEqB,SAAS;EACvBnB,IAAI,EAAE,OAAO;EACbC,OAAO,EAAET,sBAAsB;EAC/BU,SAAS,EAAEiB,SAAS;EACpBf,cAAc,EAAEe,SAAS;EACzBhB,SAAS,EAAEgB;AACb,CAAC;AAED,eAAe1B,gBAAgB","ignoreList":[]}
|
|
@@ -6,21 +6,20 @@ import { useCheckboxSetContext } from '../Form/FormCheckboxSetContext';
|
|
|
6
6
|
import { useRadioSetContext } from '../Form/FormRadioSetContext';
|
|
7
7
|
import { getInputType } from './utils';
|
|
8
8
|
const INPUT_TYPES = ['radio', 'checkbox'];
|
|
9
|
-
const SelectableBox = /*#__PURE__*/React.forwardRef((
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
9
|
+
const SelectableBox = /*#__PURE__*/React.forwardRef(({
|
|
10
|
+
type,
|
|
11
|
+
value,
|
|
12
|
+
checked,
|
|
13
|
+
children,
|
|
14
|
+
isIndeterminate,
|
|
15
|
+
isInvalid,
|
|
16
|
+
onClick,
|
|
17
|
+
onFocus,
|
|
18
|
+
inputHidden,
|
|
19
|
+
className,
|
|
20
|
+
showActiveBoxState,
|
|
21
|
+
...props
|
|
22
|
+
}, ref) => {
|
|
24
23
|
const inputType = getInputType('SelectableBox', type);
|
|
25
24
|
const {
|
|
26
25
|
value: radioValue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useRef","useEffect","PropTypes","classNames","SelectableBoxSet","useCheckboxSetContext","useRadioSetContext","getInputType","INPUT_TYPES","SelectableBox","forwardRef","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useRef","useEffect","PropTypes","classNames","SelectableBoxSet","useCheckboxSetContext","useRadioSetContext","getInputType","INPUT_TYPES","SelectableBox","forwardRef","type","value","checked","children","isIndeterminate","isInvalid","onClick","onFocus","inputHidden","className","showActiveBoxState","props","ref","inputType","radioValue","checkboxValues","isChecked","includes","inputRef","input","createElement","hidden","tabIndex","onChange","current","onclick","role","onKeyPress","click","propTypes","node","isRequired","oneOfType","string","number","bool","oneOf","func","defaultProps","undefined","Set"],"sources":["../../src/SelectableBox/index.jsx"],"sourcesContent":["import React, { useRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport SelectableBoxSet from './SelectableBoxSet';\nimport { useCheckboxSetContext } from '../Form/FormCheckboxSetContext';\nimport { useRadioSetContext } from '../Form/FormRadioSetContext';\nimport { getInputType } from './utils';\n\nconst INPUT_TYPES = [\n 'radio',\n 'checkbox',\n];\n\nconst SelectableBox = React.forwardRef(({\n type,\n value,\n checked,\n children,\n isIndeterminate,\n isInvalid,\n onClick,\n onFocus,\n inputHidden,\n className,\n showActiveBoxState,\n ...props\n}, ref) => {\n const inputType = getInputType('SelectableBox', type);\n const { value: radioValue } = useRadioSetContext();\n const { value: checkboxValues = [] } = useCheckboxSetContext();\n\n const isChecked = () => {\n switch (type) {\n case 'radio':\n return radioValue === value;\n case 'checkbox':\n return checkboxValues.includes(value);\n default:\n return radioValue === value;\n }\n };\n\n const inputRef = useRef(null);\n const input = React.createElement(inputType, {\n value,\n checked,\n hidden: inputHidden,\n ref: inputRef,\n tabIndex: -1,\n onChange: () => {},\n ...(type === 'checkbox' ? { ...props, isIndeterminate } : { ...props }),\n }, null);\n\n useEffect(() => {\n if (onClick && inputRef.current) {\n inputRef.current.onclick = () => onClick(inputRef.current);\n }\n }, [onClick]);\n\n return (\n <div\n role=\"button\"\n onKeyPress={() => inputRef.current.click()}\n onClick={() => inputRef.current.click()}\n onFocus={onFocus}\n className={classNames('pgn__selectable_box', className, {\n 'pgn__selectable_box-active': (!inputHidden && !showActiveBoxState) ? false : isChecked() || checked,\n 'pgn__selectable_box-invalid': isInvalid,\n })}\n tabIndex={0}\n ref={ref}\n {...props}\n >\n {input}\n {children}\n </div>\n );\n});\n\nSelectableBox.propTypes = {\n /** Content of the `SelectableBox`. */\n children: PropTypes.node.isRequired,\n /** A value that is passed to the input tag. */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n /** Controls whether `SelectableBox` is checked. */\n checked: PropTypes.bool,\n /** Indicates the input type: checkbox or radio. */\n type: PropTypes.oneOf(INPUT_TYPES),\n /** Function that is called when the `SelectableBox` is clicked. */\n onClick: PropTypes.func,\n /** Function that is called when the `SelectableBox` is focused. */\n onFocus: PropTypes.func,\n /** Controls display of the input (checkbox or radio button) on the `SelectableBox`. */\n inputHidden: PropTypes.bool,\n /** Indicates a state for the 'checkbox' `type` when `SelectableBox` is neither checked nor unchecked. */\n isIndeterminate: PropTypes.bool,\n /** Adds errors styles to the `SelectableBox`. */\n isInvalid: PropTypes.bool,\n /** A class that is appended to the base element. */\n className: PropTypes.string,\n /** Controls the visibility of the active state for the `SelectableBox`. */\n showActiveBoxState: PropTypes.bool,\n};\n\nSelectableBox.defaultProps = {\n value: undefined,\n checked: false,\n type: 'radio',\n onClick: () => {},\n onFocus: () => {},\n inputHidden: true,\n isIndeterminate: false,\n isInvalid: false,\n className: undefined,\n showActiveBo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,CAAC2C,MAAM,CAAC,CAAC;EAChE;EACAhC,OAAO,EAAEX,SAAS,CAAC4C,IAAI;EACvB;EACAnC,IAAI,EAAET,SAAS,CAAC6C,KAAK,CAACvC,WAAW,CAAC;EAClC;EACAS,OAAO,EAAEf,SAAS,CAAC8C,IAAI;EACvB;EACA9B,OAAO,EAAEhB,SAAS,CAAC8C,IAAI;EACvB;EACA7B,WAAW,EAAEjB,SAAS,CAAC4C,IAAI;EAC3B;EACA/B,eAAe,EAAEb,SAAS,CAAC4C,IAAI;EAC/B;EACA9B,SAAS,EAAEd,SAAS,CAAC4C,IAAI;EACzB;EACA1B,SAAS,EAAElB,SAAS,CAAC0C,MAAM;EAC3B;EACAvB,kBAAkB,EAAEnB,SAAS,CAAC4C;AAChC,CAAC;AAEDrC,aAAa,CAACwC,YAAY,GAAG;EAC3BrC,KAAK,EAAEsC,SAAS;EAChBrC,OAAO,EAAE,KAAK;EACdF,IAAI,EAAE,OAAO;EACbM,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjBC,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjBC,WAAW,EAAE,IAAI;EACjBJ,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAE,KAAK;EAChBI,SAAS,EAAE8B,SAAS;EACpB7B,kBAAkB,EAAE;AACtB,CAAC;AAEDZ,aAAa,CAAC0C,GAAG,GAAG/C,gBAAgB;AACpC,eAAeK,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","SkeletonTheme"],"sources":["../../src/Skeleton/index.
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","SkeletonTheme"],"sources":["../../src/Skeleton/index.tsx"],"sourcesContent":["export { default, SkeletonTheme } from 'react-loading-skeleton';\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,aAAa,QAAQ,wBAAwB","ignoreList":[]}
|
package/dist/Spinner/index.js
CHANGED
|
@@ -2,12 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import BaseSpinner from 'react-bootstrap/Spinner';
|
|
4
4
|
/** A spinning animation that indicates loading. */
|
|
5
|
-
const Spinner = /*#__PURE__*/React.forwardRef((
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = _ref;
|
|
5
|
+
const Spinner = /*#__PURE__*/React.forwardRef(({
|
|
6
|
+
className,
|
|
7
|
+
screenReaderText,
|
|
8
|
+
...attrs
|
|
9
|
+
}, ref) => {
|
|
11
10
|
const spinnerProps = {
|
|
12
11
|
...attrs,
|
|
13
12
|
className: classNames('pgn__spinner', className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classNames","BaseSpinner","Spinner","forwardRef","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classNames","BaseSpinner","Spinner","forwardRef","className","screenReaderText","attrs","ref","spinnerProps","role","undefined","createElement"],"sources":["../../src/Spinner/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport BaseSpinner, { type SpinnerProps as BaseSpinnerProps } from 'react-bootstrap/Spinner';\n\ninterface SpinnerProps extends BaseSpinnerProps {\n /** Optionally specify additional CSS classes to give this spinner's `<div>`. */\n className?: string;\n /** Specifies the screen reader content for a11y. */\n screenReaderText?: React.ReactNode;\n}\n\n/** A spinning animation that indicates loading. */\nconst Spinner = React.forwardRef(({\n className,\n screenReaderText,\n ...attrs\n}: SpinnerProps, ref: React.ForwardedRef<HTMLDivElement>) => {\n const spinnerProps = {\n ...attrs,\n className: classNames('pgn__spinner', className),\n role: screenReaderText ? 'status' : undefined,\n };\n return (\n <BaseSpinner {...spinnerProps} ref={ref}>\n {screenReaderText && <span className=\"sr-only\">{screenReaderText}</span>}\n </BaseSpinner>\n );\n});\n\nexport default Spinner;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAiD,yBAAyB;AAS5F;AACA,MAAMC,OAAO,gBAAGH,KAAK,CAACI,UAAU,CAAC,CAAC;EAChCC,SAAS;EACTC,gBAAgB;EAChB,GAAGC;AACS,CAAC,EAAEC,GAAuC,KAAK;EAC3D,MAAMC,YAAY,GAAG;IACnB,GAAGF,KAAK;IACRF,SAAS,EAAEJ,UAAU,CAAC,cAAc,EAAEI,SAAS,CAAC;IAChDK,IAAI,EAAEJ,gBAAgB,GAAG,QAAQ,GAAGK;EACtC,CAAC;EACD,oBACEX,KAAA,CAAAY,aAAA,CAACV,WAAW;IAAA,GAAKO,YAAY;IAAED,GAAG,EAAEA;EAAI,GACrCF,gBAAgB,iBAAIN,KAAA,CAAAY,aAAA;IAAMP,SAAS,EAAC;EAAS,GAAEC,gBAAuB,CAC5D,CAAC;AAElB,CAAC,CAAC;AAEF,eAAeH,OAAO","ignoreList":[]}
|
package/dist/Stack/index.js
CHANGED
|
@@ -2,21 +2,18 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
const DIRECTION_VARIANTS = ['horizontal', 'vertical'];
|
|
5
|
-
const Stack = /*#__PURE__*/forwardRef((
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...rest
|
|
18
|
-
}, children);
|
|
19
|
-
});
|
|
5
|
+
const Stack = /*#__PURE__*/forwardRef(({
|
|
6
|
+
direction,
|
|
7
|
+
gap,
|
|
8
|
+
reversed,
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
...rest
|
|
12
|
+
}, ref) => /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
ref: ref,
|
|
14
|
+
className: classNames(direction === 'horizontal' ? 'pgn__hstack' : 'pgn__vstack', gap ? `pgn__stack-gap--${gap}` : '', reversed ? 'pgn__stack-reversed' : '', className),
|
|
15
|
+
...rest
|
|
16
|
+
}, children));
|
|
20
17
|
Stack.propTypes = {
|
|
21
18
|
/** Specifies the content of the `Stack`. */
|
|
22
19
|
children: PropTypes.node.isRequired,
|