@openedx/paragon 21.12.1 → 21.12.2
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.js +7 -8
- package/dist/ActionRow/index.js.map +1 -1
- package/dist/Alert/index.js +33 -25
- package/dist/Alert/index.js.map +1 -1
- package/dist/Annotation/index.js +7 -9
- package/dist/Annotation/index.js.map +1 -1
- package/dist/Avatar/index.js +5 -7
- package/dist/Avatar/index.js.map +1 -1
- package/dist/AvatarButton/index.js +10 -12
- package/dist/AvatarButton/index.js.map +1 -1
- package/dist/Badge/index.js +6 -4
- package/dist/Badge/index.js.map +1 -1
- package/dist/Breadcrumb/BreadcrumbLink.js +11 -14
- package/dist/Breadcrumb/BreadcrumbLink.js.map +1 -1
- package/dist/Breadcrumb/index.js +29 -29
- package/dist/Breadcrumb/index.js.map +1 -1
- package/dist/Bubble/index.js +11 -13
- package/dist/Bubble/index.js.map +1 -1
- package/dist/Button/deprecated/index.js +87 -66
- package/dist/Button/deprecated/index.js.map +1 -1
- package/dist/Button/index.js +10 -11
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/CardBody.js +4 -6
- package/dist/Card/CardBody.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarousel.js +11 -13
- package/dist/Card/CardCarousel/CardCarousel.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselControls.js +6 -7
- package/dist/Card/CardCarousel/CardCarouselControls.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselHeader.js +9 -12
- package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselItems.js +6 -9
- package/dist/Card/CardCarousel/CardCarouselItems.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselProvider.js +27 -28
- package/dist/Card/CardCarousel/CardCarouselProvider.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselSubtitle.js +4 -6
- package/dist/Card/CardCarousel/CardCarouselSubtitle.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselTitle.js +4 -6
- package/dist/Card/CardCarousel/CardCarouselTitle.js.map +1 -1
- package/dist/Card/CardContext.js +8 -10
- package/dist/Card/CardContext.js.map +1 -1
- package/dist/Card/CardDeck.js +19 -17
- package/dist/Card/CardDeck.js.map +1 -1
- package/dist/Card/CardDivider.js +3 -5
- package/dist/Card/CardDivider.js.map +1 -1
- package/dist/Card/CardFooter.js +15 -18
- package/dist/Card/CardFooter.js.map +1 -1
- package/dist/Card/CardGrid.js +13 -11
- package/dist/Card/CardGrid.js.map +1 -1
- package/dist/Card/CardHeader.js +17 -22
- package/dist/Card/CardHeader.js.map +1 -1
- package/dist/Card/CardImageCap.js +48 -33
- package/dist/Card/CardImageCap.js.map +1 -1
- package/dist/Card/CardSection.js +11 -14
- package/dist/Card/CardSection.js.map +1 -1
- package/dist/Card/CardStatus.js +11 -14
- package/dist/Card/CardStatus.js.map +1 -1
- package/dist/Card/index.js +18 -20
- package/dist/Card/index.js.map +1 -1
- package/dist/Carousel/index.js +17 -11
- package/dist/Carousel/index.js.map +1 -1
- package/dist/CheckBox/index.js +66 -36
- package/dist/CheckBox/index.js.map +1 -1
- package/dist/Chip/index.js +14 -16
- package/dist/Chip/index.js.map +1 -1
- package/dist/ChipCarousel/index.js +29 -30
- package/dist/ChipCarousel/index.js.map +1 -1
- package/dist/Collapsible/CollapsibleAdvanced.js +82 -62
- package/dist/Collapsible/CollapsibleAdvanced.js.map +1 -1
- package/dist/Collapsible/CollapsibleBody.js +13 -15
- package/dist/Collapsible/CollapsibleBody.js.map +1 -1
- package/dist/Collapsible/CollapsibleTrigger.js +18 -20
- package/dist/Collapsible/CollapsibleTrigger.js.map +1 -1
- package/dist/Collapsible/CollapsibleVisible.js +6 -9
- package/dist/Collapsible/CollapsibleVisible.js.map +1 -1
- package/dist/Collapsible/index.js +17 -18
- package/dist/Collapsible/index.js.map +1 -1
- package/dist/ColorPicker/index.js +58 -33
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/Container/index.js +8 -9
- package/dist/Container/index.js.map +1 -1
- package/dist/DataTable/ActionDisplay.js +8 -9
- package/dist/DataTable/ActionDisplay.js.map +1 -1
- package/dist/DataTable/BulkActions.js +23 -20
- package/dist/DataTable/BulkActions.js.map +1 -1
- package/dist/DataTable/CardView.js +46 -43
- package/dist/DataTable/CardView.js.map +1 -1
- package/dist/DataTable/CollapsibleButtonGroup.js +57 -39
- package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
- package/dist/DataTable/DataTableContext.js +1 -1
- package/dist/DataTable/DataTableContext.js.map +1 -1
- package/dist/DataTable/DataTableLayout.js +6 -9
- package/dist/DataTable/DataTableLayout.js.map +1 -1
- package/dist/DataTable/DataViewToggle.js +25 -20
- package/dist/DataTable/DataViewToggle.js.map +1 -1
- package/dist/DataTable/DropdownFilters.js +41 -28
- package/dist/DataTable/DropdownFilters.js.map +1 -1
- package/dist/DataTable/EmptyTable.js +6 -9
- package/dist/DataTable/EmptyTable.js.map +1 -1
- package/dist/DataTable/ExpandAll.js +2 -4
- package/dist/DataTable/ExpandAll.js.map +1 -1
- package/dist/DataTable/ExpandRow.js +2 -4
- package/dist/DataTable/ExpandRow.js.map +1 -1
- package/dist/DataTable/FilterStatus.js +18 -17
- package/dist/DataTable/FilterStatus.js.map +1 -1
- package/dist/DataTable/RowStatus.js +15 -18
- package/dist/DataTable/RowStatus.js.map +1 -1
- package/dist/DataTable/SidebarFilters.js +16 -13
- package/dist/DataTable/SidebarFilters.js.map +1 -1
- package/dist/DataTable/SmartStatus.js +14 -16
- package/dist/DataTable/SmartStatus.js.map +1 -1
- package/dist/DataTable/Table.js +17 -19
- package/dist/DataTable/Table.js.map +1 -1
- package/dist/DataTable/TableActions.js +11 -13
- package/dist/DataTable/TableActions.js.map +1 -1
- package/dist/DataTable/TableCell.js +6 -10
- package/dist/DataTable/TableCell.js.map +1 -1
- package/dist/DataTable/TableControlBar.js +7 -12
- package/dist/DataTable/TableControlBar.js.map +1 -1
- package/dist/DataTable/TableFilters.js +14 -12
- package/dist/DataTable/TableFilters.js.map +1 -1
- package/dist/DataTable/TableFooter.js +5 -8
- package/dist/DataTable/TableFooter.js.map +1 -1
- package/dist/DataTable/TableHeaderCell.js +11 -15
- package/dist/DataTable/TableHeaderCell.js.map +1 -1
- package/dist/DataTable/TableHeaderRow.js +6 -4
- package/dist/DataTable/TableHeaderRow.js.map +1 -1
- package/dist/DataTable/TablePagination.js +8 -7
- package/dist/DataTable/TablePagination.js.map +1 -1
- package/dist/DataTable/TablePaginationMinimal.js +9 -8
- package/dist/DataTable/TablePaginationMinimal.js.map +1 -1
- package/dist/DataTable/TableRow.js +15 -18
- package/dist/DataTable/TableRow.js.map +1 -1
- package/dist/DataTable/filters/CheckboxFilter.js +23 -22
- package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
- package/dist/DataTable/filters/DropdownFilter.js +14 -19
- package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js +19 -20
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/TextFilter.js +10 -13
- package/dist/DataTable/filters/TextFilter.js.map +1 -1
- package/dist/DataTable/hooks.js +29 -25
- package/dist/DataTable/hooks.js.map +1 -1
- package/dist/DataTable/index.js +120 -104
- package/dist/DataTable/index.js.map +1 -1
- package/dist/DataTable/selection/BaseSelectionStatus.js +29 -31
- package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelect.js +13 -9
- package/dist/DataTable/selection/ControlledSelect.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelectHeader.js +19 -15
- package/dist/DataTable/selection/ControlledSelectHeader.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelectionStatus.js +34 -24
- package/dist/DataTable/selection/ControlledSelectionStatus.js.map +1 -1
- package/dist/DataTable/selection/SelectionStatus.js +23 -23
- package/dist/DataTable/selection/SelectionStatus.js.map +1 -1
- package/dist/DataTable/utils/getVisibleColumns.js +36 -44
- package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownButton.js +9 -13
- package/dist/Dropdown/deprecated/DropdownButton.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownItem.js +7 -8
- package/dist/Dropdown/deprecated/DropdownItem.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownMenu.js +8 -12
- package/dist/Dropdown/deprecated/DropdownMenu.js.map +1 -1
- package/dist/Dropdown/deprecated/index.js +136 -103
- package/dist/Dropdown/deprecated/index.js.map +1 -1
- package/dist/Dropdown/index.js +32 -29
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Dropzone/DefaultContent.js +13 -13
- package/dist/Dropzone/DefaultContent.js.map +1 -1
- package/dist/Dropzone/DragError.js +1 -3
- package/dist/Dropzone/DragError.js.map +1 -1
- package/dist/Dropzone/GenericError.js +7 -7
- package/dist/Dropzone/GenericError.js.map +1 -1
- package/dist/Dropzone/UploadProgress.js +6 -8
- package/dist/Dropzone/UploadProgress.js.map +1 -1
- package/dist/Dropzone/index.js +145 -86
- package/dist/Dropzone/index.js.map +1 -1
- package/dist/Fieldset/index.js +82 -57
- package/dist/Fieldset/index.js.map +1 -1
- package/dist/Form/FormAutosuggest.js +137 -95
- package/dist/Form/FormAutosuggest.js.map +1 -1
- package/dist/Form/FormAutosuggestOption.js +4 -6
- package/dist/Form/FormAutosuggestOption.js.map +1 -1
- package/dist/Form/FormCheckbox.js +35 -42
- package/dist/Form/FormCheckbox.js.map +1 -1
- package/dist/Form/FormCheckboxSet.js +13 -16
- package/dist/Form/FormCheckboxSet.js.map +1 -1
- package/dist/Form/FormCheckboxSetContext.js +39 -34
- package/dist/Form/FormCheckboxSetContext.js.map +1 -1
- package/dist/Form/FormControl.js +41 -35
- package/dist/Form/FormControl.js.map +1 -1
- package/dist/Form/FormControlDecorator.js +3 -5
- package/dist/Form/FormControlDecorator.js.map +1 -1
- package/dist/Form/FormControlDecoratorGroup.js +8 -10
- package/dist/Form/FormControlDecoratorGroup.js.map +1 -1
- package/dist/Form/FormControlFeedback.js +12 -15
- package/dist/Form/FormControlFeedback.js.map +1 -1
- package/dist/Form/FormControlFloatingLabel.js +3 -6
- package/dist/Form/FormControlFloatingLabel.js.map +1 -1
- package/dist/Form/FormControlSet.js +8 -9
- package/dist/Form/FormControlSet.js.map +1 -1
- package/dist/Form/FormGroup.js +11 -12
- package/dist/Form/FormGroup.js.map +1 -1
- package/dist/Form/FormGroupContext.js +64 -39
- package/dist/Form/FormGroupContext.js.map +1 -1
- package/dist/Form/FormLabel.js +15 -17
- package/dist/Form/FormLabel.js.map +1 -1
- package/dist/Form/FormRadio.js +19 -22
- package/dist/Form/FormRadio.js.map +1 -1
- package/dist/Form/FormRadioSet.js +13 -16
- package/dist/Form/FormRadioSet.js.map +1 -1
- package/dist/Form/FormRadioSetContext.js +39 -34
- package/dist/Form/FormRadioSetContext.js.map +1 -1
- package/dist/Form/FormSwitch.js +16 -20
- package/dist/Form/FormSwitch.js.map +1 -1
- package/dist/Form/FormText.js +20 -29
- package/dist/Form/FormText.js.map +1 -1
- package/dist/Form/useCheckboxSetValues.js +46 -23
- package/dist/Form/useCheckboxSetValues.js.map +1 -1
- package/dist/Hyperlink/index.js +25 -25
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Hyperlink/index.scss +2 -2
- package/dist/Icon/index.js +21 -20
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.js +30 -32
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButtonToggle/index.js +16 -16
- package/dist/IconButtonToggle/index.js.map +1 -1
- package/dist/Input/index.js +122 -92
- package/dist/Input/index.js.map +1 -1
- package/dist/InputSelect/index.js +78 -51
- package/dist/InputSelect/index.js.map +1 -1
- package/dist/InputText/index.js +11 -9
- package/dist/InputText/index.js.map +1 -1
- package/dist/Layout/index.js +33 -29
- package/dist/Layout/index.js.map +1 -1
- package/dist/ListBox/index.js +112 -80
- package/dist/ListBox/index.js.map +1 -1
- package/dist/ListBoxOption/index.js +68 -45
- package/dist/ListBoxOption/index.js.map +1 -1
- package/dist/MailtoLink/index.js +37 -34
- package/dist/MailtoLink/index.js.map +1 -1
- package/dist/Menu/MenuItem.js +13 -14
- package/dist/Menu/MenuItem.js.map +1 -1
- package/dist/Menu/SelectMenu.js +68 -44
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Menu/index.js +10 -11
- package/dist/Menu/index.js.map +1 -1
- package/dist/Modal/AlertModal.js +5 -7
- package/dist/Modal/AlertModal.js.map +1 -1
- package/dist/Modal/FullscreenModal.js +6 -8
- package/dist/Modal/FullscreenModal.js.map +1 -1
- package/dist/Modal/MarketingModal.js +8 -10
- package/dist/Modal/MarketingModal.js.map +1 -1
- package/dist/Modal/ModalCloseButton.js +13 -15
- package/dist/Modal/ModalCloseButton.js.map +1 -1
- package/dist/Modal/ModalContext.js +13 -13
- package/dist/Modal/ModalContext.js.map +1 -1
- package/dist/Modal/ModalDialog.js +22 -23
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalDialogBody.js +22 -11
- package/dist/Modal/ModalDialogBody.js.map +1 -1
- package/dist/Modal/ModalDialogFooter.js +6 -7
- package/dist/Modal/ModalDialogFooter.js.map +1 -1
- package/dist/Modal/ModalDialogHeader.js +6 -7
- package/dist/Modal/ModalDialogHeader.js.map +1 -1
- package/dist/Modal/ModalDialogHero.js +6 -7
- package/dist/Modal/ModalDialogHero.js.map +1 -1
- package/dist/Modal/ModalDialogHeroBackground.js +8 -9
- package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
- package/dist/Modal/ModalDialogHeroContent.js +6 -7
- package/dist/Modal/ModalDialogHeroContent.js.map +1 -1
- package/dist/Modal/ModalDialogTitle.js +6 -7
- package/dist/Modal/ModalDialogTitle.js.map +1 -1
- package/dist/Modal/ModalLayer.js +11 -17
- package/dist/Modal/ModalLayer.js.map +1 -1
- package/dist/Modal/ModalPopup.js +17 -17
- package/dist/Modal/ModalPopup.js.map +1 -1
- package/dist/Modal/PopperElement.js +25 -18
- package/dist/Modal/PopperElement.js.map +1 -1
- package/dist/Modal/Portal.js +40 -18
- package/dist/Modal/Portal.js.map +1 -1
- package/dist/Modal/StandardModal.js +6 -8
- package/dist/Modal/StandardModal.js.map +1 -1
- package/dist/Modal/index.js +215 -187
- package/dist/Modal/index.js.map +1 -1
- package/dist/Nav/index.js +3 -2
- package/dist/Nav/index.js.map +1 -1
- package/dist/Navbar/index.js +7 -6
- package/dist/Navbar/index.js.map +1 -1
- package/dist/OverflowScroll/OverflowScroll.js +45 -37
- package/dist/OverflowScroll/OverflowScroll.js.map +1 -1
- package/dist/OverflowScroll/OverflowScrollContext.js +1 -1
- package/dist/OverflowScroll/OverflowScrollContext.js.map +1 -1
- package/dist/OverflowScroll/OverflowScrollItems.js +2 -4
- package/dist/OverflowScroll/OverflowScrollItems.js.map +1 -1
- package/dist/Overlay/index.js +4 -4
- package/dist/Overlay/index.js.map +1 -1
- package/dist/PageBanner/index.js +11 -13
- package/dist/PageBanner/index.js.map +1 -1
- package/dist/Pagination/index.js +331 -296
- package/dist/Pagination/index.js.map +1 -1
- package/dist/Popover/index.js +11 -14
- package/dist/Popover/index.js.map +1 -1
- package/dist/ProductTour/Checkpoint.js +29 -22
- package/dist/ProductTour/Checkpoint.js.map +1 -1
- package/dist/ProductTour/CheckpointActionRow.js +18 -16
- package/dist/ProductTour/CheckpointActionRow.js.map +1 -1
- package/dist/ProductTour/CheckpointBody.js +2 -4
- package/dist/ProductTour/CheckpointBody.js.map +1 -1
- package/dist/ProductTour/CheckpointBreadcrumbs.js +16 -16
- package/dist/ProductTour/CheckpointBreadcrumbs.js.map +1 -1
- package/dist/ProductTour/CheckpointTitle.js +2 -4
- package/dist/ProductTour/CheckpointTitle.js.map +1 -1
- package/dist/ProductTour/index.js +66 -47
- package/dist/ProductTour/index.js.map +1 -1
- package/dist/ProgressBar/index.js +37 -35
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/RadioButtonGroup/index.js +133 -102
- package/dist/RadioButtonGroup/index.js.map +1 -1
- package/dist/Scrollable/index.js +30 -15
- package/dist/Scrollable/index.js.map +1 -1
- package/dist/SearchField/SearchFieldAdvanced.js +54 -44
- package/dist/SearchField/SearchFieldAdvanced.js.map +1 -1
- package/dist/SearchField/SearchFieldClearButton.js +7 -8
- package/dist/SearchField/SearchFieldClearButton.js.map +1 -1
- package/dist/SearchField/SearchFieldInput.js +8 -9
- package/dist/SearchField/SearchFieldInput.js.map +1 -1
- package/dist/SearchField/SearchFieldLabel.js +5 -8
- package/dist/SearchField/SearchFieldLabel.js.map +1 -1
- package/dist/SearchField/SearchFieldSubmitButton.js +12 -15
- package/dist/SearchField/SearchFieldSubmitButton.js.map +1 -1
- package/dist/SearchField/index.js +22 -22
- package/dist/SearchField/index.js.map +1 -1
- package/dist/SelectableBox/SelectableBoxSet.js +25 -26
- package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
- package/dist/SelectableBox/index.js +42 -38
- package/dist/SelectableBox/index.js.map +1 -1
- package/dist/Sheet/SheetContainer.js +38 -16
- package/dist/Sheet/SheetContainer.js.map +1 -1
- package/dist/Sheet/index.js +65 -43
- package/dist/Sheet/index.js.map +1 -1
- package/dist/Spinner/index.js +8 -9
- package/dist/Spinner/index.js.map +1 -1
- package/dist/Stack/index.js +9 -11
- package/dist/Stack/index.js.map +1 -1
- package/dist/StatefulButton/index.js +15 -17
- package/dist/StatefulButton/index.js.map +1 -1
- package/dist/StatusAlert/index.js +120 -82
- package/dist/StatusAlert/index.js.map +1 -1
- package/dist/Stepper/Stepper.js +2 -4
- package/dist/Stepper/Stepper.js.map +1 -1
- package/dist/Stepper/StepperActionRow.js +7 -10
- package/dist/Stepper/StepperActionRow.js.map +1 -1
- package/dist/Stepper/StepperContext.js +64 -32
- package/dist/Stepper/StepperContext.js.map +1 -1
- package/dist/Stepper/StepperHeader.js +23 -30
- package/dist/Stepper/StepperHeader.js.map +1 -1
- package/dist/Stepper/StepperHeaderStep.js +14 -17
- package/dist/Stepper/StepperHeaderStep.js.map +1 -1
- package/dist/Stepper/StepperStep.js +23 -24
- package/dist/Stepper/StepperStep.js.map +1 -1
- package/dist/Sticky/index.js +30 -22
- package/dist/Sticky/index.js.map +1 -1
- package/dist/Table/index.js +178 -109
- package/dist/Table/index.js.map +1 -1
- package/dist/Tabs/deprecated/index.js +99 -66
- package/dist/Tabs/deprecated/index.js.map +1 -1
- package/dist/Tabs/index.js +65 -49
- package/dist/Tabs/index.js.map +1 -1
- package/dist/TextArea/index.js +10 -8
- package/dist/TextArea/index.js.map +1 -1
- package/dist/Toast/ToastContainer.js +38 -16
- package/dist/Toast/ToastContainer.js.map +1 -1
- package/dist/Toast/index.js +33 -18
- package/dist/Toast/index.js.map +1 -1
- package/dist/Tooltip/index.js +8 -9
- package/dist/Tooltip/index.js.map +1 -1
- package/dist/TransitionReplace/DemoTransitionReplace.js +12 -3
- package/dist/TransitionReplace/DemoTransitionReplace.js.map +1 -1
- package/dist/TransitionReplace/index.js +136 -100
- package/dist/TransitionReplace/index.js.map +1 -1
- package/dist/Truncate/index.js +30 -24
- package/dist/Truncate/index.js.map +1 -1
- package/dist/ValidationFormGroup/index.js +38 -37
- package/dist/ValidationFormGroup/index.js.map +1 -1
- package/dist/ValidationMessage/index.js +76 -51
- package/dist/ValidationMessage/index.js.map +1 -1
- package/dist/asInput/index.js +251 -202
- package/dist/asInput/index.js.map +1 -1
- package/dist/hooks/useArrowKeyNavigation.js +46 -43
- package/dist/hooks/useArrowKeyNavigation.js.map +1 -1
- package/dist/hooks/useIndexOfLastVisibleChild.js +40 -26
- package/dist/hooks/useIndexOfLastVisibleChild.js.map +1 -1
- package/dist/hooks/useIsVisible.js +20 -13
- package/dist/hooks/useIsVisible.js.map +1 -1
- package/dist/hooks/useToggle.js +18 -11
- package/dist/hooks/useToggle.js.map +1 -1
- package/dist/hooks/useWindowSize.js +17 -6
- package/dist/hooks/useWindowSize.js.map +1 -1
- package/dist/paragon.css +1 -1
- package/dist/withDeprecatedProps.js +79 -58
- package/dist/withDeprecatedProps.js.map +1 -1
- package/package.json +1 -5
- package/src/Button/index.jsx +2 -2
- package/src/Dropzone/index.jsx +1 -1
- package/src/Hyperlink/index.scss +2 -2
- package/src/Icon/index.jsx +1 -1
- package/src/IconButton/__snapshots__/IconButton.test.jsx.snap +12 -10
- package/src/IconButton/index.jsx +1 -1
- package/src/Menu/MenuItem.jsx +2 -2
- package/src/Overlay/README.md +1 -1
- package/src/Overlay/index.jsx +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["type", "value", "checked", "children", "isIndeterminate", "isInvalid", "onClick", "onFocus", "inputHidden", "className", "showActiveBoxState"];
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
7
|
-
function _toPrimitive(input, hint) { if (
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
11
|
import React, { useRef, useEffect } from 'react';
|
|
@@ -14,30 +15,27 @@ import SelectableBoxSet from './SelectableBoxSet';
|
|
|
14
15
|
import { useCheckboxSetContext } from '../Form/FormCheckboxSetContext';
|
|
15
16
|
import { useRadioSetContext } from '../Form/FormRadioSetContext';
|
|
16
17
|
import { getInputType } from './utils';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
showActiveBoxState
|
|
31
|
-
} = _ref,
|
|
18
|
+
var INPUT_TYPES = ['radio', 'checkbox'];
|
|
19
|
+
var SelectableBox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
20
|
+
var type = _ref.type,
|
|
21
|
+
value = _ref.value,
|
|
22
|
+
checked = _ref.checked,
|
|
23
|
+
children = _ref.children,
|
|
24
|
+
isIndeterminate = _ref.isIndeterminate,
|
|
25
|
+
isInvalid = _ref.isInvalid,
|
|
26
|
+
onClick = _ref.onClick,
|
|
27
|
+
onFocus = _ref.onFocus,
|
|
28
|
+
inputHidden = _ref.inputHidden,
|
|
29
|
+
className = _ref.className,
|
|
30
|
+
showActiveBoxState = _ref.showActiveBoxState,
|
|
32
31
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
value
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const isChecked = () => {
|
|
32
|
+
var inputType = getInputType('SelectableBox', type);
|
|
33
|
+
var _useRadioSetContext = useRadioSetContext(),
|
|
34
|
+
radioValue = _useRadioSetContext.value;
|
|
35
|
+
var _useCheckboxSetContex = useCheckboxSetContext(),
|
|
36
|
+
_useCheckboxSetContex2 = _useCheckboxSetContex.value,
|
|
37
|
+
checkboxValues = _useCheckboxSetContex2 === void 0 ? [] : _useCheckboxSetContex2;
|
|
38
|
+
var isChecked = function isChecked() {
|
|
41
39
|
switch (type) {
|
|
42
40
|
case 'radio':
|
|
43
41
|
return radioValue === value;
|
|
@@ -47,26 +45,32 @@ const SelectableBox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
47
45
|
return radioValue === value;
|
|
48
46
|
}
|
|
49
47
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
value,
|
|
53
|
-
checked,
|
|
48
|
+
var inputRef = useRef(null);
|
|
49
|
+
var input = /*#__PURE__*/React.createElement(inputType, _objectSpread({
|
|
50
|
+
value: value,
|
|
51
|
+
checked: checked,
|
|
54
52
|
hidden: inputHidden,
|
|
55
53
|
ref: inputRef,
|
|
56
54
|
tabIndex: -1,
|
|
57
|
-
onChange: ()
|
|
55
|
+
onChange: function onChange() {}
|
|
58
56
|
}, type === 'checkbox' ? _objectSpread(_objectSpread({}, props), {}, {
|
|
59
|
-
isIndeterminate
|
|
57
|
+
isIndeterminate: isIndeterminate
|
|
60
58
|
}) : _objectSpread({}, props)), null);
|
|
61
|
-
useEffect(()
|
|
59
|
+
useEffect(function () {
|
|
62
60
|
if (onClick && inputRef.current) {
|
|
63
|
-
inputRef.current.onclick = ()
|
|
61
|
+
inputRef.current.onclick = function () {
|
|
62
|
+
return onClick(inputRef.current);
|
|
63
|
+
};
|
|
64
64
|
}
|
|
65
65
|
}, [onClick]);
|
|
66
66
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
67
67
|
role: "button",
|
|
68
|
-
onKeyPress: ()
|
|
69
|
-
|
|
68
|
+
onKeyPress: function onKeyPress() {
|
|
69
|
+
return inputRef.current.click();
|
|
70
|
+
},
|
|
71
|
+
onClick: function onClick() {
|
|
72
|
+
return inputRef.current.click();
|
|
73
|
+
},
|
|
70
74
|
onFocus: onFocus,
|
|
71
75
|
className: classNames('pgn__selectable_box', className, {
|
|
72
76
|
'pgn__selectable_box-active': !inputHidden && !showActiveBoxState ? false : isChecked() || checked,
|
|
@@ -104,8 +108,8 @@ SelectableBox.defaultProps = {
|
|
|
104
108
|
value: undefined,
|
|
105
109
|
checked: false,
|
|
106
110
|
type: 'radio',
|
|
107
|
-
onClick: ()
|
|
108
|
-
onFocus: ()
|
|
111
|
+
onClick: function onClick() {},
|
|
112
|
+
onFocus: function onFocus() {},
|
|
109
113
|
inputHidden: true,
|
|
110
114
|
isIndeterminate: false,
|
|
111
115
|
isInvalid: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useRef","useEffect","PropTypes","classNames","SelectableBoxSet","useCheckboxSetContext","useRadioSetContext","getInputType","INPUT_TYPES","SelectableBox","forwardRef","_ref","ref","type","value","checked","children","isIndeterminate","isInvalid","onClick","onFocus","inputHidden","className","showActiveBoxState","props","_objectWithoutProperties","_excluded","inputType","radioValue","checkboxValues","isChecked","includes","inputRef","input","createElement","_objectSpread","hidden","tabIndex","onChange","current","onclick","_extends","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 showActiveBoxState: true,\n};\n\nSelectableBox.Set = SelectableBoxSet;\nexport default SelectableBox;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useRef","useEffect","PropTypes","classNames","SelectableBoxSet","useCheckboxSetContext","useRadioSetContext","getInputType","INPUT_TYPES","SelectableBox","forwardRef","_ref","ref","type","value","checked","children","isIndeterminate","isInvalid","onClick","onFocus","inputHidden","className","showActiveBoxState","props","_objectWithoutProperties","_excluded","inputType","_useRadioSetContext","radioValue","_useCheckboxSetContex","_useCheckboxSetContex2","checkboxValues","isChecked","includes","inputRef","input","createElement","_objectSpread","hidden","tabIndex","onChange","current","onclick","_extends","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 showActiveBoxState: true,\n};\n\nSelectableBox.Set = SelectableBoxSet;\nexport default SelectableBox;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAChD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,kBAAkB,QAAQ,6BAA6B;AAChE,SAASC,YAAY,QAAQ,SAAS;AAEtC,IAAMC,WAAW,GAAG,CAClB,OAAO,EACP,UAAU,CACX;AAED,IAAMC,aAAa,gBAAGV,KAAK,CAACW,UAAU,CAAC,UAAAC,IAAA,EAapCC,GAAG,EAAK;EAAA,IAZTC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,eAAe,GAAAN,IAAA,CAAfM,eAAe;IACfC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;IACPC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,WAAW,GAAAV,IAAA,CAAXU,WAAW;IACXC,SAAS,GAAAX,IAAA,CAATW,SAAS;IACTC,kBAAkB,GAAAZ,IAAA,CAAlBY,kBAAkB;IACfC,KAAK,GAAAC,wBAAA,CAAAd,IAAA,EAAAe,SAAA;EAER,IAAMC,SAAS,GAAGpB,YAAY,CAAC,eAAe,EAAEM,IAAI,CAAC;EACrD,IAAAe,mBAAA,GAA8BtB,kBAAkB,CAAC,CAAC;IAAnCuB,UAAU,GAAAD,mBAAA,CAAjBd,KAAK;EACb,IAAAgB,qBAAA,GAAuCzB,qBAAqB,CAAC,CAAC;IAAA0B,sBAAA,GAAAD,qBAAA,CAAtDhB,KAAK;IAAEkB,cAAc,GAAAD,sBAAA,cAAG,EAAE,GAAAA,sBAAA;EAElC,IAAME,SAAS,GAAG,SAAZA,SAASA,CAAA,EAAS;IACtB,QAAQpB,IAAI;MACV,KAAK,OAAO;QACV,OAAOgB,UAAU,KAAKf,KAAK;MAC7B,KAAK,UAAU;QACb,OAAOkB,cAAc,CAACE,QAAQ,CAACpB,KAAK,CAAC;MACvC;QACE,OAAOe,UAAU,KAAKf,KAAK;IAC/B;EACF,CAAC;EAED,IAAMqB,QAAQ,GAAGnC,MAAM,CAAC,IAAI,CAAC;EAC7B,IAAMoC,KAAK,gBAAGrC,KAAK,CAACsC,aAAa,CAACV,SAAS,EAAAW,aAAA;IACzCxB,KAAK,EAALA,KAAK;IACLC,OAAO,EAAPA,OAAO;IACPwB,MAAM,EAAElB,WAAW;IACnBT,GAAG,EAAEuB,QAAQ;IACbK,QAAQ,EAAE,CAAC,CAAC;IACZC,QAAQ,EAAE,SAAAA,SAAA,EAAM,CAAC;EAAC,GACd5B,IAAI,KAAK,UAAU,GAAAyB,aAAA,CAAAA,aAAA,KAAQd,KAAK;IAAEP,eAAe,EAAfA;EAAe,KAAAqB,aAAA,KAAUd,KAAK,CAAE,GACrE,IAAI,CAAC;EAERvB,SAAS,CAAC,YAAM;IACd,IAAIkB,OAAO,IAAIgB,QAAQ,CAACO,OAAO,EAAE;MAC/BP,QAAQ,CAACO,OAAO,CAACC,OAAO,GAAG;QAAA,OAAMxB,OAAO,CAACgB,QAAQ,CAACO,OAAO,CAAC;MAAA;IAC5D;EACF,CAAC,EAAE,CAACvB,OAAO,CAAC,CAAC;EAEb,oBACEpB,KAAA,CAAAsC,aAAA,QAAAO,QAAA;IACEC,IAAI,EAAC,QAAQ;IACbC,UAAU,EAAE,SAAAA,WAAA;MAAA,OAAMX,QAAQ,CAACO,OAAO,CAACK,KAAK,CAAC,CAAC;IAAA,CAAC;IAC3C5B,OAAO,EAAE,SAAAA,QAAA;MAAA,OAAMgB,QAAQ,CAACO,OAAO,CAACK,KAAK,CAAC,CAAC;IAAA,CAAC;IACxC3B,OAAO,EAAEA,OAAQ;IACjBE,SAAS,EAAEnB,UAAU,CAAC,qBAAqB,EAAEmB,SAAS,EAAE;MACtD,4BAA4B,EAAG,CAACD,WAAW,IAAI,CAACE,kBAAkB,GAAI,KAAK,GAAGU,SAAS,CAAC,CAAC,IAAIlB,OAAO;MACpG,6BAA6B,EAAEG;IACjC,CAAC,CAAE;IACHsB,QAAQ,EAAE,CAAE;IACZ5B,GAAG,EAAEA;EAAI,GACLY,KAAK,GAERY,KAAK,EACLpB,QACE,CAAC;AAEV,CAAC,CAAC;AAEFP,aAAa,CAACuC,SAAS,GAAG;EACxB;EACAhC,QAAQ,EAAEd,SAAS,CAAC+C,IAAI,CAACC,UAAU;EACnC;EACApC,KAAK,EAAEZ,SAAS,CAACiD,SAAS,CAAC,CAACjD,SAAS,CAACkD,MAAM,EAAElD,SAAS,CAACmD,MAAM,CAAC,CAAC;EAChE;EACAtC,OAAO,EAAEb,SAAS,CAACoD,IAAI;EACvB;EACAzC,IAAI,EAAEX,SAAS,CAACqD,KAAK,CAAC/C,WAAW,CAAC;EAClC;EACAW,OAAO,EAAEjB,SAAS,CAACsD,IAAI;EACvB;EACApC,OAAO,EAAElB,SAAS,CAACsD,IAAI;EACvB;EACAnC,WAAW,EAAEnB,SAAS,CAACoD,IAAI;EAC3B;EACArC,eAAe,EAAEf,SAAS,CAACoD,IAAI;EAC/B;EACApC,SAAS,EAAEhB,SAAS,CAACoD,IAAI;EACzB;EACAhC,SAAS,EAAEpB,SAAS,CAACkD,MAAM;EAC3B;EACA7B,kBAAkB,EAAErB,SAAS,CAACoD;AAChC,CAAC;AAED7C,aAAa,CAACgD,YAAY,GAAG;EAC3B3C,KAAK,EAAE4C,SAAS;EAChB3C,OAAO,EAAE,KAAK;EACdF,IAAI,EAAE,OAAO;EACbM,OAAO,EAAE,SAAAA,QAAA,EAAM,CAAC,CAAC;EACjBC,OAAO,EAAE,SAAAA,QAAA,EAAM,CAAC,CAAC;EACjBC,WAAW,EAAE,IAAI;EACjBJ,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAE,KAAK;EAChBI,SAAS,EAAEoC,SAAS;EACpBnC,kBAAkB,EAAE;AACtB,CAAC;AAEDd,aAAa,CAACkD,GAAG,GAAGvD,gBAAgB;AACpC,eAAeK,aAAa"}
|
|
@@ -1,29 +1,51 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1
14
|
import React from 'react';
|
|
2
15
|
import ReactDOM from 'react-dom';
|
|
3
16
|
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
17
|
+
var SheetContainer = /*#__PURE__*/function (_React$Component) {
|
|
18
|
+
_inherits(SheetContainer, _React$Component);
|
|
19
|
+
var _super = _createSuper(SheetContainer);
|
|
20
|
+
function SheetContainer(props) {
|
|
21
|
+
var _this;
|
|
22
|
+
_classCallCheck(this, SheetContainer);
|
|
23
|
+
_this = _super.call(this, props);
|
|
24
|
+
_this.sheetRootName = 'sheet-root';
|
|
8
25
|
if (typeof document === 'undefined') {
|
|
9
|
-
|
|
10
|
-
} else if (document.getElementById(
|
|
11
|
-
|
|
26
|
+
_this.rootElement = null;
|
|
27
|
+
} else if (document.getElementById(_this.sheetRootName)) {
|
|
28
|
+
_this.rootElement = document.getElementById(_this.sheetRootName);
|
|
12
29
|
} else {
|
|
13
|
-
|
|
14
|
-
rootElement.setAttribute('id',
|
|
30
|
+
var rootElement = document.createElement('div');
|
|
31
|
+
rootElement.setAttribute('id', _this.sheetRootName);
|
|
15
32
|
rootElement.setAttribute('class', 'sheet-container');
|
|
16
33
|
rootElement.setAttribute('data-testid', 'sheet-container');
|
|
17
|
-
|
|
34
|
+
_this.rootElement = document.body.appendChild(rootElement);
|
|
18
35
|
}
|
|
36
|
+
return _this;
|
|
19
37
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
_createClass(SheetContainer, [{
|
|
39
|
+
key: "render",
|
|
40
|
+
value: function render() {
|
|
41
|
+
if (this.rootElement) {
|
|
42
|
+
return /*#__PURE__*/ReactDOM.createPortal(this.props.children, this.rootElement);
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
23
45
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
46
|
+
}]);
|
|
47
|
+
return SheetContainer;
|
|
48
|
+
}(React.Component);
|
|
27
49
|
SheetContainer.propTypes = {
|
|
28
50
|
children: PropTypes.node.isRequired
|
|
29
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetContainer.js","names":["React","ReactDOM","PropTypes","SheetContainer","Component","
|
|
1
|
+
{"version":3,"file":"SheetContainer.js","names":["React","ReactDOM","PropTypes","SheetContainer","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","sheetRootName","document","rootElement","getElementById","createElement","setAttribute","body","appendChild","_createClass","key","value","render","createPortal","children","Component","propTypes","node","isRequired"],"sources":["../../src/Sheet/SheetContainer.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\n\nclass SheetContainer extends React.Component {\n constructor(props) {\n super(props);\n this.sheetRootName = 'sheet-root';\n if (typeof document === 'undefined') {\n this.rootElement = null;\n } else if (document.getElementById(this.sheetRootName)) {\n this.rootElement = document.getElementById(this.sheetRootName);\n } else {\n const rootElement = document.createElement('div');\n rootElement.setAttribute('id', this.sheetRootName);\n rootElement.setAttribute('class', 'sheet-container');\n rootElement.setAttribute('data-testid', 'sheet-container');\n this.rootElement = document.body.appendChild(rootElement);\n }\n }\n\n render() {\n if (this.rootElement) {\n return ReactDOM.createPortal(\n this.props.children,\n this.rootElement,\n );\n }\n return null;\n }\n}\n\nSheetContainer.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nexport default SheetContainer;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,WAAW;AAChC,OAAOC,SAAS,MAAM,YAAY;AAAC,IAE7BC,cAAc,0BAAAC,gBAAA;EAAAC,SAAA,CAAAF,cAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,cAAA;EAClB,SAAAA,eAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,cAAA;IACjBM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IACXC,KAAA,CAAKG,aAAa,GAAG,YAAY;IACjC,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;MACnCJ,KAAA,CAAKK,WAAW,GAAG,IAAI;IACzB,CAAC,MAAM,IAAID,QAAQ,CAACE,cAAc,CAACN,KAAA,CAAKG,aAAa,CAAC,EAAE;MACtDH,KAAA,CAAKK,WAAW,GAAGD,QAAQ,CAACE,cAAc,CAACN,KAAA,CAAKG,aAAa,CAAC;IAChE,CAAC,MAAM;MACL,IAAME,WAAW,GAAGD,QAAQ,CAACG,aAAa,CAAC,KAAK,CAAC;MACjDF,WAAW,CAACG,YAAY,CAAC,IAAI,EAAER,KAAA,CAAKG,aAAa,CAAC;MAClDE,WAAW,CAACG,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC;MACpDH,WAAW,CAACG,YAAY,CAAC,aAAa,EAAE,iBAAiB,CAAC;MAC1DR,KAAA,CAAKK,WAAW,GAAGD,QAAQ,CAACK,IAAI,CAACC,WAAW,CAACL,WAAW,CAAC;IAC3D;IAAC,OAAAL,KAAA;EACH;EAACW,YAAA,CAAAjB,cAAA;IAAAkB,GAAA;IAAAC,KAAA,EAED,SAAAC,OAAA,EAAS;MACP,IAAI,IAAI,CAACT,WAAW,EAAE;QACpB,oBAAOb,QAAQ,CAACuB,YAAY,CAC1B,IAAI,CAAChB,KAAK,CAACiB,QAAQ,EACnB,IAAI,CAACX,WACP,CAAC;MACH;MACA,OAAO,IAAI;IACb;EAAC;EAAA,OAAAX,cAAA;AAAA,EAzB0BH,KAAK,CAAC0B,SAAS;AA4B5CvB,cAAc,CAACwB,SAAS,GAAG;EACzBF,QAAQ,EAAEvB,SAAS,CAAC0B,IAAI,CAACC;AAC3B,CAAC;AAED,eAAe1B,cAAc"}
|
package/dist/Sheet/index.js
CHANGED
|
@@ -1,60 +1,82 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1
14
|
import React from 'react';
|
|
2
15
|
import PropTypes from 'prop-types';
|
|
3
16
|
import classNames from 'classnames';
|
|
4
17
|
import { FocusOn } from 'react-focus-on';
|
|
5
18
|
import SheetContainer from './SheetContainer';
|
|
6
|
-
export
|
|
19
|
+
export var POSITIONS = {
|
|
7
20
|
left: 'left',
|
|
8
21
|
right: 'right',
|
|
9
22
|
top: 'top',
|
|
10
23
|
bottom: 'bottom'
|
|
11
24
|
};
|
|
12
|
-
export
|
|
25
|
+
export var VARIANTS = {
|
|
13
26
|
light: 'light',
|
|
14
27
|
dark: 'dark'
|
|
15
28
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
var Sheet = /*#__PURE__*/function (_React$Component) {
|
|
30
|
+
_inherits(Sheet, _React$Component);
|
|
31
|
+
var _super = _createSuper(Sheet);
|
|
32
|
+
function Sheet(props) {
|
|
33
|
+
var _this;
|
|
34
|
+
_classCallCheck(this, Sheet);
|
|
35
|
+
_this = _super.call(this, props);
|
|
36
|
+
_this.wrapperRef = /*#__PURE__*/React.createRef();
|
|
37
|
+
_this.renderSheet = _this.renderSheet.bind(_assertThisInitialized(_this));
|
|
38
|
+
return _this;
|
|
21
39
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
render() {
|
|
38
|
-
const {
|
|
39
|
-
blocking,
|
|
40
|
-
show,
|
|
41
|
-
onClose
|
|
42
|
-
} = this.props;
|
|
43
|
-
if (!show) {
|
|
44
|
-
return null;
|
|
40
|
+
_createClass(Sheet, [{
|
|
41
|
+
key: "renderSheet",
|
|
42
|
+
value: function renderSheet() {
|
|
43
|
+
var _this$props = this.props,
|
|
44
|
+
children = _this$props.children,
|
|
45
|
+
position = _this$props.position,
|
|
46
|
+
variant = _this$props.variant;
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: classNames('pgn__sheet-component', "pgn__sheet__".concat(variant), position),
|
|
49
|
+
role: "alert",
|
|
50
|
+
"aria-live": "polite",
|
|
51
|
+
"aria-atomic": "true"
|
|
52
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: "pgn__sheet-content"
|
|
54
|
+
}, children));
|
|
45
55
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
}, {
|
|
57
|
+
key: "render",
|
|
58
|
+
value: function render() {
|
|
59
|
+
var _this$props2 = this.props,
|
|
60
|
+
blocking = _this$props2.blocking,
|
|
61
|
+
show = _this$props2.show,
|
|
62
|
+
onClose = _this$props2.onClose;
|
|
63
|
+
if (!show) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return /*#__PURE__*/React.createElement(SheetContainer, null, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: classNames('pgn__sheet-skrim', {
|
|
68
|
+
hidden: !blocking
|
|
69
|
+
}),
|
|
70
|
+
role: "presentation"
|
|
71
|
+
}), /*#__PURE__*/React.createElement(FocusOn, {
|
|
72
|
+
onClickOutside: blocking ? function () {} : onClose,
|
|
73
|
+
onEscapeKey: blocking ? function () {} : onClose,
|
|
74
|
+
shards: [this.wrapperRef]
|
|
75
|
+
}, this.renderSheet()));
|
|
76
|
+
}
|
|
77
|
+
}]);
|
|
78
|
+
return Sheet;
|
|
79
|
+
}(React.Component);
|
|
58
80
|
Sheet.propTypes = {
|
|
59
81
|
/** specifies whether the sheet provides a click-blocking scrim */
|
|
60
82
|
blocking: PropTypes.bool,
|
|
@@ -74,7 +96,7 @@ Sheet.defaultProps = {
|
|
|
74
96
|
children: undefined,
|
|
75
97
|
position: POSITIONS.bottom,
|
|
76
98
|
show: true,
|
|
77
|
-
onClose: ()
|
|
99
|
+
onClose: function onClose() {},
|
|
78
100
|
variant: VARIANTS.light
|
|
79
101
|
};
|
|
80
102
|
export default Sheet;
|
package/dist/Sheet/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","FocusOn","SheetContainer","POSITIONS","left","right","top","bottom","VARIANTS","light","dark","Sheet","Component","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","FocusOn","SheetContainer","POSITIONS","left","right","top","bottom","VARIANTS","light","dark","Sheet","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","wrapperRef","createRef","renderSheet","bind","_assertThisInitialized","_createClass","key","value","_this$props","children","position","variant","createElement","className","concat","role","render","_this$props2","blocking","show","onClose","hidden","onClickOutside","onEscapeKey","shards","Component","propTypes","bool","node","oneOf","func","defaultProps","undefined"],"sources":["../../src/Sheet/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { FocusOn } from 'react-focus-on';\n\nimport SheetContainer from './SheetContainer';\n\nexport const POSITIONS = {\n left: 'left',\n right: 'right',\n top: 'top',\n bottom: 'bottom',\n};\n\nexport const VARIANTS = {\n light: 'light',\n dark: 'dark',\n};\n\nclass Sheet extends React.Component {\n constructor(props) {\n super(props);\n\n this.wrapperRef = React.createRef();\n this.renderSheet = this.renderSheet.bind(this);\n }\n\n renderSheet() {\n const { children, position, variant } = this.props;\n return (\n <div\n className={classNames(\n 'pgn__sheet-component',\n `pgn__sheet__${variant}`,\n position,\n )}\n role=\"alert\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n <div className=\"pgn__sheet-content\">\n { children }\n </div>\n </div>\n );\n }\n\n render() {\n const {\n blocking,\n show,\n onClose,\n } = this.props;\n if (!show) {\n return null;\n }\n return (\n <SheetContainer>\n <div\n className={classNames(\n 'pgn__sheet-skrim',\n { hidden: !blocking },\n )}\n role=\"presentation\"\n />\n <FocusOn\n onClickOutside={blocking ? () => {} : onClose}\n onEscapeKey={blocking ? () => {} : onClose}\n shards={[this.wrapperRef]}\n >\n {this.renderSheet()}\n </FocusOn>\n </SheetContainer>\n );\n }\n}\n\nSheet.propTypes = {\n /** specifies whether the sheet provides a click-blocking scrim */\n blocking: PropTypes.bool,\n /** an element rendered inside the sheet */\n children: PropTypes.node,\n /** a string designating the sheet's position on the window */\n position: PropTypes.oneOf([\n POSITIONS.left,\n POSITIONS.right,\n POSITIONS.top,\n POSITIONS.bottom,\n ]),\n /** Boolean used to control whether the Sheet shows. */\n show: PropTypes.bool,\n /** Specifies function that controls `show` value. */\n onClose: PropTypes.func,\n /** a string designating which version of the sheet to show (light vs dark) */\n variant: PropTypes.oneOf([VARIANTS.light, VARIANTS.dark]),\n};\n\nSheet.defaultProps = {\n blocking: false,\n children: undefined,\n position: POSITIONS.bottom,\n show: true,\n onClose: () => {},\n variant: VARIANTS.light,\n};\n\nexport default Sheet;\n"],"mappings":"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"}
|
package/dist/Spinner/index.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["className", "screenReaderText"];
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
7
|
-
function _toPrimitive(input, hint) { if (
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
11
|
import React from 'react';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
13
|
import classNames from 'classnames';
|
|
13
14
|
import BaseSpinner from 'react-bootstrap/Spinner';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
screenReaderText
|
|
18
|
-
} = _ref,
|
|
15
|
+
var Spinner = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
16
|
+
var className = _ref.className,
|
|
17
|
+
screenReaderText = _ref.screenReaderText,
|
|
19
18
|
attrs = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
|
|
19
|
+
var spinnerProps = _objectSpread(_objectSpread({}, attrs), {}, {
|
|
21
20
|
className: classNames('pgn__spinner', className),
|
|
22
21
|
role: screenReaderText ? 'status' : undefined
|
|
23
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","BaseSpinner","Spinner","forwardRef","_ref","ref","className","screenReaderText","attrs","_objectWithoutProperties","_excluded","spinnerProps","_objectSpread","role","undefined","createElement","_extends","propTypes","string","node","defaultProps"],"sources":["../../src/Spinner/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport BaseSpinner from 'react-bootstrap/Spinner';\n\nconst Spinner = React.forwardRef(({\n className,\n screenReaderText,\n ...attrs\n}, ref) => {\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\nSpinner.propTypes = {\n /** Specifies the class name for the component. */\n className: PropTypes.string,\n /** Specifies the screen reader content for a11y. */\n screenReaderText: PropTypes.node,\n};\n\nSpinner.defaultProps = {\n className: undefined,\n screenReaderText: undefined,\n};\n\nexport default Spinner;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","BaseSpinner","Spinner","forwardRef","_ref","ref","className","screenReaderText","attrs","_objectWithoutProperties","_excluded","spinnerProps","_objectSpread","role","undefined","createElement","_extends","propTypes","string","node","defaultProps"],"sources":["../../src/Spinner/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport BaseSpinner from 'react-bootstrap/Spinner';\n\nconst Spinner = React.forwardRef(({\n className,\n screenReaderText,\n ...attrs\n}, ref) => {\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\nSpinner.propTypes = {\n /** Specifies the class name for the component. */\n className: PropTypes.string,\n /** Specifies the screen reader content for a11y. */\n screenReaderText: PropTypes.node,\n};\n\nSpinner.defaultProps = {\n className: undefined,\n screenReaderText: undefined,\n};\n\nexport default Spinner;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAM,yBAAyB;AAEjD,IAAMC,OAAO,gBAAGJ,KAAK,CAACK,UAAU,CAAC,UAAAC,IAAA,EAI9BC,GAAG,EAAK;EAAA,IAHTC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,gBAAgB,GAAAH,IAAA,CAAhBG,gBAAgB;IACbC,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAER,IAAMC,YAAY,GAAAC,aAAA,CAAAA,aAAA,KACbJ,KAAK;IACRF,SAAS,EAAEN,UAAU,CAAC,cAAc,EAAEM,SAAS,CAAC;IAChDO,IAAI,EAAEN,gBAAgB,GAAG,QAAQ,GAAGO;EAAS,EAC9C;EACD,oBACEhB,KAAA,CAAAiB,aAAA,CAACd,WAAW,EAAAe,QAAA,KAAKL,YAAY;IAAEN,GAAG,EAAEA;EAAI,IACrCE,gBAAgB,iBAAIT,KAAA,CAAAiB,aAAA;IAAMT,SAAS,EAAC;EAAS,GAAEC,gBAAuB,CAC5D,CAAC;AAElB,CAAC,CAAC;AAEFL,OAAO,CAACe,SAAS,GAAG;EAClB;EACAX,SAAS,EAAEP,SAAS,CAACmB,MAAM;EAC3B;EACAX,gBAAgB,EAAER,SAAS,CAACoB;AAC9B,CAAC;AAEDjB,OAAO,CAACkB,YAAY,GAAG;EACrBd,SAAS,EAAEQ,SAAS;EACpBP,gBAAgB,EAAEO;AACpB,CAAC;AAED,eAAeZ,OAAO"}
|
package/dist/Stack/index.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["direction", "gap", "reversed", "children", "className"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
className
|
|
16
|
-
} = _ref,
|
|
8
|
+
var DIRECTION_VARIANTS = ['horizontal', 'vertical'];
|
|
9
|
+
var Stack = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
|
+
var direction = _ref.direction,
|
|
11
|
+
gap = _ref.gap,
|
|
12
|
+
reversed = _ref.reversed,
|
|
13
|
+
children = _ref.children,
|
|
14
|
+
className = _ref.className,
|
|
17
15
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
16
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
19
17
|
ref: ref,
|
|
20
|
-
className: classNames(direction === 'horizontal' ? 'pgn__hstack' : 'pgn__vstack', gap ?
|
|
18
|
+
className: classNames(direction === 'horizontal' ? 'pgn__hstack' : 'pgn__vstack', gap ? "pgn__stack-gap--".concat(gap) : '', reversed ? 'pgn__stack-reversed' : '', className)
|
|
21
19
|
}, rest), children);
|
|
22
20
|
});
|
|
23
21
|
Stack.propTypes = {
|
package/dist/Stack/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","forwardRef","PropTypes","classNames","DIRECTION_VARIANTS","Stack","_ref","ref","direction","gap","reversed","children","className","rest","_objectWithoutProperties","_excluded","createElement","_extends","propTypes","node","isRequired","oneOf","number","bool","string","defaultProps","undefined"],"sources":["../../src/Stack/index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst DIRECTION_VARIANTS = [\n 'horizontal',\n 'vertical',\n];\n\nconst Stack = forwardRef(({\n direction,\n gap,\n reversed,\n children,\n className,\n ...rest\n}, ref) => (\n <div\n ref={ref}\n className={classNames(\n direction === 'horizontal' ? 'pgn__hstack' : 'pgn__vstack',\n gap ? `pgn__stack-gap--${gap}` : '',\n reversed ? 'pgn__stack-reversed' : '',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n));\n\nStack.propTypes = {\n /** Specifies the content of the `Stack`. */\n children: PropTypes.node.isRequired,\n /** Specifies direction of the children blocks (column/row). */\n direction: PropTypes.oneOf(DIRECTION_VARIANTS),\n /**\n * Specifies inner space between children blocks.\n *\n * Valid values are based on `the spacing classes`:\n * `0, 0.5, ... 6`.\n */\n gap: PropTypes.number,\n /** Specifies the order of the children. */\n reversed: PropTypes.bool,\n /** Specifies an additional `className` to add to the base element. */\n className: PropTypes.string,\n};\n\nStack.defaultProps = {\n direction: 'vertical',\n gap: 0,\n className: undefined,\n reversed: false,\n};\n\nexport default Stack;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","forwardRef","PropTypes","classNames","DIRECTION_VARIANTS","Stack","_ref","ref","direction","gap","reversed","children","className","rest","_objectWithoutProperties","_excluded","createElement","_extends","concat","propTypes","node","isRequired","oneOf","number","bool","string","defaultProps","undefined"],"sources":["../../src/Stack/index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst DIRECTION_VARIANTS = [\n 'horizontal',\n 'vertical',\n];\n\nconst Stack = forwardRef(({\n direction,\n gap,\n reversed,\n children,\n className,\n ...rest\n}, ref) => (\n <div\n ref={ref}\n className={classNames(\n direction === 'horizontal' ? 'pgn__hstack' : 'pgn__vstack',\n gap ? `pgn__stack-gap--${gap}` : '',\n reversed ? 'pgn__stack-reversed' : '',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n));\n\nStack.propTypes = {\n /** Specifies the content of the `Stack`. */\n children: PropTypes.node.isRequired,\n /** Specifies direction of the children blocks (column/row). */\n direction: PropTypes.oneOf(DIRECTION_VARIANTS),\n /**\n * Specifies inner space between children blocks.\n *\n * Valid values are based on `the spacing classes`:\n * `0, 0.5, ... 6`.\n */\n gap: PropTypes.number,\n /** Specifies the order of the children. */\n reversed: PropTypes.bool,\n /** Specifies an additional `className` to add to the base element. */\n className: PropTypes.string,\n};\n\nStack.defaultProps = {\n direction: 'vertical',\n gap: 0,\n className: undefined,\n reversed: false,\n};\n\nexport default Stack;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,IAAMC,kBAAkB,GAAG,CACzB,YAAY,EACZ,UAAU,CACX;AAED,IAAMC,KAAK,gBAAGJ,UAAU,CAAC,UAAAK,IAAA,EAOtBC,GAAG;EAAA,IANJC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,GAAG,GAAAH,IAAA,CAAHG,GAAG;IACHC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACNC,IAAI,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA;EAAA,oBAEPf,KAAA,CAAAgB,aAAA,QAAAC,QAAA;IACEV,GAAG,EAAEA,GAAI;IACTK,SAAS,EAAET,UAAU,CACnBK,SAAS,KAAK,YAAY,GAAG,aAAa,GAAG,aAAa,EAC1DC,GAAG,sBAAAS,MAAA,CAAsBT,GAAG,IAAK,EAAE,EACnCC,QAAQ,GAAG,qBAAqB,GAAG,EAAE,EACrCE,SACF;EAAE,GACEC,IAAI,GAEPF,QACE,CAAC;AAAA,CACP,CAAC;AAEFN,KAAK,CAACc,SAAS,GAAG;EAChB;EACAR,QAAQ,EAAET,SAAS,CAACkB,IAAI,CAACC,UAAU;EACnC;EACAb,SAAS,EAAEN,SAAS,CAACoB,KAAK,CAAClB,kBAAkB,CAAC;EAC9C;AACF;AACA;AACA;AACA;AACA;EACEK,GAAG,EAAEP,SAAS,CAACqB,MAAM;EACrB;EACAb,QAAQ,EAAER,SAAS,CAACsB,IAAI;EACxB;EACAZ,SAAS,EAAEV,SAAS,CAACuB;AACvB,CAAC;AAEDpB,KAAK,CAACqB,YAAY,GAAG;EACnBlB,SAAS,EAAE,UAAU;EACrBC,GAAG,EAAE,CAAC;EACNG,SAAS,EAAEe,SAAS;EACpBjB,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeL,KAAK"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["className", "state", "labels", "icons", "disabledStates", "onClick"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -9,25 +9,23 @@ import { Cancel, CheckCircleOutline, SpinnerSimple } from '../../icons';
|
|
|
9
9
|
import Button from '../Button';
|
|
10
10
|
import Icon from '../Icon';
|
|
11
11
|
function StatefulButton(_ref) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
onClick
|
|
19
|
-
} = _ref,
|
|
12
|
+
var className = _ref.className,
|
|
13
|
+
state = _ref.state,
|
|
14
|
+
labels = _ref.labels,
|
|
15
|
+
icons = _ref.icons,
|
|
16
|
+
disabledStates = _ref.disabledStates,
|
|
17
|
+
_onClick = _ref.onClick,
|
|
20
18
|
attributes = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
var isDisabled = disabledStates.indexOf(state) !== -1;
|
|
20
|
+
var icon = icons[state] !== undefined ? icons[state] : icons["default"];
|
|
21
|
+
var label = labels[state] !== undefined ? labels[state] : labels["default"];
|
|
24
22
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
25
23
|
"aria-live": "assertive",
|
|
26
24
|
"aria-disabled": isDisabled,
|
|
27
|
-
className: classNames('pgn__stateful-btn',
|
|
25
|
+
className: classNames('pgn__stateful-btn', "pgn__stateful-btn-state-".concat(state), className, {
|
|
28
26
|
disabled: isDisabled
|
|
29
27
|
}),
|
|
30
|
-
onClick: e
|
|
28
|
+
onClick: function onClick(e) {
|
|
31
29
|
// Swallow clicks if the button is disabled.
|
|
32
30
|
// We do this instead of disabling the button to prevent
|
|
33
31
|
// it from losing focus (disabled elements cannot have focus).
|
|
@@ -35,8 +33,8 @@ function StatefulButton(_ref) {
|
|
|
35
33
|
e.preventDefault();
|
|
36
34
|
return;
|
|
37
35
|
}
|
|
38
|
-
if (
|
|
39
|
-
|
|
36
|
+
if (_onClick) {
|
|
37
|
+
_onClick(e);
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
}, attributes), /*#__PURE__*/React.createElement("span", {
|
|
@@ -91,7 +89,7 @@ StatefulButton.defaultProps = {
|
|
|
91
89
|
className: undefined,
|
|
92
90
|
state: 'default',
|
|
93
91
|
icons: {
|
|
94
|
-
default: undefined,
|
|
92
|
+
"default": undefined,
|
|
95
93
|
pending: /*#__PURE__*/React.createElement(Icon, {
|
|
96
94
|
src: SpinnerSimple,
|
|
97
95
|
className: classNames('icon-spin')
|