@openedx/paragon 22.4.0 → 23.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -5
- package/bin/paragon-scripts.js +128 -9
- package/dist/ActionRow/_index.scss +2 -4
- package/dist/Alert/index.scss +41 -32
- package/dist/Annotation/_mixins.scss +104 -0
- package/dist/Annotation/index.scss +130 -103
- package/dist/Avatar/index.scss +18 -20
- package/dist/AvatarButton/index.scss +3 -5
- package/dist/Badge/index.scss +112 -2
- package/dist/Breadcrumb/index.scss +14 -16
- package/dist/Bubble/index.scss +25 -12
- package/dist/Button/_mixins.scss +14 -0
- package/dist/Button/button-group.scss +126 -0
- package/dist/Button/index.js +0 -2
- package/dist/Button/index.js.map +1 -1
- package/dist/Button/index.scss +855 -370
- package/dist/Card/card-bootstrap.scss +168 -0
- package/dist/Card/index.scss +78 -79
- package/dist/Carousel/index.scss +168 -2
- package/dist/Chip/index.scss +46 -37
- package/dist/Chip/mixins.scss +8 -3
- package/dist/ChipCarousel/index.scss +4 -4
- package/dist/CloseButton/index.scss +31 -2
- package/dist/Code/index.scss +47 -2
- package/dist/Collapsible/index.scss +15 -15
- package/dist/ColorPicker/index.scss +9 -11
- package/dist/DataTable/CollapsibleButtonGroup.js +2 -2
- package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
- package/dist/DataTable/index.scss +48 -50
- package/dist/Dropdown/dropdown-bootstrap.scss +181 -0
- package/dist/Dropdown/index.js +0 -2
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Dropdown/index.scss +11 -12
- package/dist/Dropzone/index.scss +12 -14
- package/dist/Form/_FormText.scss +8 -8
- package/dist/Form/_bootstrap-custom-forms.scss +551 -0
- package/dist/Form/_bootstrap-forms.scss +381 -0
- package/dist/Form/_index.scss +168 -146
- package/dist/Form/_input-group.scss +188 -0
- package/dist/Form/_mixins.scss +216 -3
- package/dist/Hyperlink/index.scss +1 -1
- package/dist/Icon/index.scss +10 -12
- package/dist/IconButton/_mixins.scss +4 -0
- package/dist/IconButton/index.js +5 -11
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButton/index.scss +387 -74
- package/dist/IconButtonToggle/index.scss +1 -1
- package/dist/Image/index.scss +53 -2
- package/dist/Menu/index.scss +25 -27
- package/dist/Modal/_ModalDialog.scss +52 -50
- package/dist/Modal/index.scss +6 -73
- package/dist/Nav/_mixins.scss +4 -4
- package/dist/Nav/index.scss +70 -66
- package/dist/Navbar/index.scss +276 -2
- package/dist/OverflowScroll/data/useOverflowScrollElementAttributes.js +3 -3
- package/dist/Overlay/index.js +2 -3
- package/dist/Overlay/index.js.map +1 -1
- package/dist/PageBanner/index.scss +17 -21
- package/dist/Pagination/index.scss +32 -34
- package/dist/Pagination/pagination-bootstrap.scss +83 -0
- package/dist/Popover/index.scss +9 -10
- package/dist/Popover/popover-bootstrap.scss +198 -0
- package/dist/ProductTour/Checkpoint.scss +71 -43
- package/dist/ProgressBar/_mixins.scss +22 -0
- package/dist/ProgressBar/bootstrap-progress.scss +49 -0
- package/dist/ProgressBar/index.scss +28 -36
- package/dist/Scrollable/index.scss +2 -2
- package/dist/SearchField/SearchFieldInput.js +2 -2
- package/dist/SearchField/SearchFieldInput.js.map +1 -1
- package/dist/SearchField/index.scss +15 -17
- package/dist/SelectableBox/index.scss +11 -13
- package/dist/Sheet/index.scss +10 -10
- package/dist/Spinner/index.scss +57 -2
- package/dist/Stack/index.scss +1 -3
- package/dist/Stepper/index.scss +19 -20
- package/dist/Sticky/index.scss +4 -6
- package/dist/Tabs/index.js +0 -2
- package/dist/Tabs/index.js.map +1 -1
- package/dist/Tabs/index.scss +26 -25
- package/dist/Toast/ToastContainer.scss +9 -11
- package/dist/Toast/bootstrap-toast.scss +46 -0
- package/dist/Toast/index.scss +9 -10
- package/dist/Tooltip/index.scss +136 -10
- package/dist/ValidationMessage/index.scss +1 -1
- package/dist/core.css +16788 -0
- package/dist/core.css.map +1 -0
- package/dist/core.min.css +2 -0
- package/dist/index.js +0 -14
- package/dist/index.scss +0 -4
- package/dist/light.css +4098 -0
- package/dist/light.css.map +1 -0
- package/dist/light.min.css +2 -0
- package/dist/theme-urls.json +21 -0
- package/dist/utils/breakpoints.js +1 -1
- package/lib/build-scss.js +188 -0
- package/lib/build-tokens.js +119 -0
- package/lib/help.js +36 -23
- package/lib/replace-variables.js +38 -0
- package/lib/utils.js +30 -0
- package/package.json +25 -10
- package/src/ActionRow/_index.scss +2 -4
- package/src/Alert/index.scss +41 -32
- package/src/Annotation/_mixins.scss +104 -0
- package/src/Annotation/index.scss +130 -103
- package/src/Avatar/index.scss +18 -20
- package/src/AvatarButton/index.scss +3 -5
- package/src/Badge/index.scss +112 -2
- package/src/Breadcrumb/index.scss +14 -16
- package/src/Bubble/index.scss +25 -12
- package/src/Button/README.md +0 -84
- package/src/Button/_mixins.scss +14 -0
- package/src/Button/button-group.scss +126 -0
- package/src/Button/index.jsx +0 -3
- package/src/Button/index.scss +855 -370
- package/src/Card/card-bootstrap.scss +168 -0
- package/src/Card/index.scss +78 -79
- package/src/Carousel/index.scss +168 -2
- package/src/Chip/index.scss +46 -37
- package/src/Chip/mixins.scss +8 -3
- package/src/ChipCarousel/index.scss +4 -4
- package/src/CloseButton/index.scss +31 -2
- package/src/Code/index.scss +47 -2
- package/src/Collapsible/index.scss +15 -15
- package/src/ColorPicker/index.scss +9 -11
- package/src/DataTable/CollapsibleButtonGroup.jsx +2 -2
- package/src/DataTable/index.scss +48 -50
- package/src/Dropdown/README.md +0 -93
- package/src/Dropdown/dropdown-bootstrap.scss +181 -0
- package/src/Dropdown/index.jsx +0 -2
- package/src/Dropdown/index.scss +11 -12
- package/src/Dropzone/index.scss +12 -14
- package/src/Form/_FormText.scss +8 -8
- package/src/Form/_bootstrap-custom-forms.scss +551 -0
- package/src/Form/_bootstrap-forms.scss +381 -0
- package/src/Form/_index.scss +168 -146
- package/src/Form/_input-group.scss +188 -0
- package/src/Form/_mixins.scss +216 -3
- package/src/Hyperlink/index.scss +1 -1
- package/src/Icon/index.scss +10 -12
- package/src/IconButton/README.md +1 -15
- package/src/IconButton/__snapshots__/IconButton.test.jsx.snap +5 -28
- package/src/IconButton/_mixins.scss +4 -0
- package/src/IconButton/index.jsx +6 -13
- package/src/IconButton/index.scss +387 -74
- package/src/IconButtonToggle/index.scss +1 -1
- package/src/Image/index.scss +53 -2
- package/src/Menu/index.scss +25 -27
- package/src/Modal/_ModalDialog.scss +52 -50
- package/src/Modal/index.scss +6 -73
- package/src/Nav/_mixins.scss +4 -4
- package/src/Nav/index.scss +70 -66
- package/src/Navbar/index.scss +276 -2
- package/src/OverflowScroll/data/useOverflowScrollElementAttributes.js +3 -3
- package/src/Overlay/index.jsx +2 -3
- package/src/PageBanner/index.scss +17 -21
- package/src/Pagination/index.scss +32 -34
- package/src/Pagination/pagination-bootstrap.scss +83 -0
- package/src/Popover/index.scss +9 -10
- package/src/Popover/popover-bootstrap.scss +198 -0
- package/src/ProductTour/Checkpoint.scss +71 -43
- package/src/ProgressBar/_mixins.scss +22 -0
- package/src/ProgressBar/bootstrap-progress.scss +49 -0
- package/src/ProgressBar/index.scss +28 -36
- package/src/Scrollable/index.scss +2 -2
- package/src/SearchField/SearchFieldInput.jsx +2 -2
- package/src/SearchField/__snapshots__/SearchField.test.jsx.snap +12 -8
- package/src/SearchField/index.scss +15 -17
- package/src/SelectableBox/index.scss +11 -13
- package/src/Sheet/index.scss +10 -10
- package/src/Spinner/index.scss +57 -2
- package/src/Stack/index.scss +1 -3
- package/src/Stepper/index.scss +19 -20
- package/src/Sticky/index.scss +4 -6
- package/src/Tabs/README.md +1 -23
- package/src/Tabs/index.jsx +0 -3
- package/src/Tabs/index.scss +26 -25
- package/src/Toast/ToastContainer.scss +9 -11
- package/src/Toast/bootstrap-toast.scss +46 -0
- package/src/Toast/index.scss +9 -10
- package/src/Tooltip/index.scss +136 -10
- package/src/TransitionReplace/README.md +4 -4
- package/src/ValidationMessage/index.scss +1 -1
- package/src/index.js +0 -14
- package/src/index.scss +0 -4
- package/src/setupTest.js +0 -6
- package/src/utils/breakpoints.js +1 -1
- package/styles/css/core/custom-media-breakpoints.css +17 -0
- package/styles/css/core/index.css +2 -0
- package/styles/css/core/variables.css +614 -0
- package/styles/css/themes/light/index.css +2 -0
- package/styles/css/themes/light/utility-classes.css +2454 -0
- package/styles/css/themes/light/variables.css +1644 -0
- package/{scss → styles/scss}/core/_functions.scss +1 -1
- package/styles/scss/core/_grid.scss +21 -0
- package/{scss → styles/scss}/core/_utilities.scss +17 -11
- package/styles/scss/core/_variables.scss +869 -0
- package/styles/scss/core/bootstrap-override/_functions.scss +104 -0
- package/styles/scss/core/bootstrap-override/_mixins.scss +4 -0
- package/styles/scss/core/bootstrap-override/_utilities.scss +4 -0
- package/styles/scss/core/bootstrap-override/bootstrap.scss +2 -0
- package/styles/scss/core/bootstrap-override/mixins/_grid-framework.scss +80 -0
- package/styles/scss/core/bootstrap-override/mixins/_grid.scss +69 -0
- package/styles/scss/core/bootstrap-override/mixins/_list-group.scss +22 -0
- package/styles/scss/core/bootstrap-override/utilities/_background.scss +7 -0
- package/styles/scss/core/bootstrap-override/utilities/_borders.scss +67 -0
- package/styles/scss/core/bootstrap-override/utilities/_spacing.scss +70 -0
- package/styles/scss/core/bootstrap-override/utilities/_text.scss +68 -0
- package/styles/scss/core/core.scss +21 -0
- package/{scss → styles/scss}/core/utilities-only.scss +1 -0
- package/tokens/README.md +158 -0
- package/tokens/css-utilities.js +56 -0
- package/tokens/map-scss-to-css.js +24 -0
- package/tokens/replace-variables.js +32 -0
- package/tokens/sass-helpers.js +98 -0
- package/tokens/src/core/alias/size.json +15 -0
- package/tokens/src/core/components/ActionRow.json +10 -0
- package/tokens/src/core/components/Alert.json +30 -0
- package/tokens/src/core/components/Annotation.json +25 -0
- package/tokens/src/core/components/Avatar.json +17 -0
- package/tokens/src/core/components/AvatarButton.json +11 -0
- package/tokens/src/core/components/Badge.json +33 -0
- package/tokens/src/core/components/Breadcrumb.json +37 -0
- package/tokens/src/core/components/Bubble.json +10 -0
- package/tokens/src/core/components/Button/core.json +105 -0
- package/tokens/src/core/components/Card.json +91 -0
- package/tokens/src/core/components/Carousel.json +37 -0
- package/tokens/src/core/components/Chip.json +43 -0
- package/tokens/src/core/components/ChipCarousel.json +15 -0
- package/tokens/src/core/components/CloseButton.json +14 -0
- package/tokens/src/core/components/Code.json +34 -0
- package/tokens/src/core/components/Collapsible.json +29 -0
- package/tokens/src/core/components/ColorPicker.json +8 -0
- package/tokens/src/core/components/Container.json +13 -0
- package/tokens/src/core/components/DataTable.json +27 -0
- package/tokens/src/core/components/Dropdown.json +67 -0
- package/tokens/src/core/components/Dropzone.json +21 -0
- package/tokens/src/core/components/Form/other.json +14 -0
- package/tokens/src/core/components/Form/size.json +233 -0
- package/tokens/src/core/components/Form/spacing.json +155 -0
- package/tokens/src/core/components/Form/transition.json +16 -0
- package/tokens/src/core/components/Form/typography.json +122 -0
- package/tokens/src/core/components/Icon.json +11 -0
- package/tokens/src/core/components/IconButton.json +15 -0
- package/tokens/src/core/components/Image.json +28 -0
- package/tokens/src/core/components/Menu.json +48 -0
- package/tokens/src/core/components/Modal.json +47 -0
- package/tokens/src/core/components/Nav.json +55 -0
- package/tokens/src/core/components/Navbar.json +70 -0
- package/tokens/src/core/components/Pagination.json +70 -0
- package/tokens/src/core/components/Popover.json +48 -0
- package/tokens/src/core/components/ProductTour.json +37 -0
- package/tokens/src/core/components/ProgressBar.json +39 -0
- package/tokens/src/core/components/SearchField.json +23 -0
- package/tokens/src/core/components/SelectableBox.json +9 -0
- package/tokens/src/core/components/Sheet.json +10 -0
- package/tokens/src/core/components/Spinner.json +19 -0
- package/tokens/src/core/components/Stack.json +7 -0
- package/tokens/src/core/components/Stepper.json +42 -0
- package/tokens/src/core/components/Sticky.json +7 -0
- package/tokens/src/core/components/Tab.json +19 -0
- package/tokens/src/core/components/Tabs.json +19 -0
- package/tokens/src/core/components/Toast.json +30 -0
- package/tokens/src/core/components/Tooltip.json +33 -0
- package/tokens/src/core/components/general/caret.json +13 -0
- package/tokens/src/core/components/general/headings.json +16 -0
- package/tokens/src/core/components/general/hr.json +10 -0
- package/tokens/src/core/components/general/input.json +51 -0
- package/tokens/src/core/components/general/link.json +30 -0
- package/tokens/src/core/components/general/list.json +26 -0
- package/tokens/src/core/components/general/text.json +24 -0
- package/tokens/src/core/global/breakpoints.json +12 -0
- package/tokens/src/core/global/display.json +21 -0
- package/tokens/src/core/global/elevation.json +19 -0
- package/tokens/src/core/global/other.json +4 -0
- package/tokens/src/core/global/spacing.json +35 -0
- package/tokens/src/core/global/transition.json +14 -0
- package/tokens/src/core/global/typography.json +91 -0
- package/tokens/src/core/utilities/color.json +12 -0
- package/tokens/src/themes/light/alias/color.json +114 -0
- package/tokens/src/themes/light/components/Alert.json +47 -0
- package/tokens/src/themes/light/components/Annotation.json +29 -0
- package/tokens/src/themes/light/components/Avatar.json +7 -0
- package/tokens/src/themes/light/components/Badge.json +186 -0
- package/tokens/src/themes/light/components/Breadcrumb.json +14 -0
- package/tokens/src/themes/light/components/Bubble.json +18 -0
- package/tokens/src/themes/light/components/Button/brand.json +260 -0
- package/tokens/src/themes/light/components/Button/core.json +24 -0
- package/tokens/src/themes/light/components/Button/danger.json +247 -0
- package/tokens/src/themes/light/components/Button/dark.json +230 -0
- package/tokens/src/themes/light/components/Button/info.json +238 -0
- package/tokens/src/themes/light/components/Button/light.json +236 -0
- package/tokens/src/themes/light/components/Button/primary.json +250 -0
- package/tokens/src/themes/light/components/Button/secondary.json +278 -0
- package/tokens/src/themes/light/components/Button/success.json +253 -0
- package/tokens/src/themes/light/components/Button/tertiary.json +109 -0
- package/tokens/src/themes/light/components/Button/warning.json +276 -0
- package/tokens/src/themes/light/components/Card.json +40 -0
- package/tokens/src/themes/light/components/Carousel.json +45 -0
- package/tokens/src/themes/light/components/Chip.json +50 -0
- package/tokens/src/themes/light/components/CloseButton.json +10 -0
- package/tokens/src/themes/light/components/Code.json +23 -0
- package/tokens/src/themes/light/components/DataTable.json +26 -0
- package/tokens/src/themes/light/components/Dropdown.json +41 -0
- package/tokens/src/themes/light/components/Dropzone.json +23 -0
- package/tokens/src/themes/light/components/Form/color.json +270 -0
- package/tokens/src/themes/light/components/Form/elevation.json +76 -0
- package/tokens/src/themes/light/components/Form/other.json +131 -0
- package/tokens/src/themes/light/components/IconButton.json +451 -0
- package/tokens/src/themes/light/components/Image.json +18 -0
- package/tokens/src/themes/light/components/Menu.json +30 -0
- package/tokens/src/themes/light/components/Modal.json +37 -0
- package/tokens/src/themes/light/components/Nav.json +166 -0
- package/tokens/src/themes/light/components/Navbar.json +136 -0
- package/tokens/src/themes/light/components/OverflowScroll.json +9 -0
- package/tokens/src/themes/light/components/PageBanner.json +24 -0
- package/tokens/src/themes/light/components/Pagination.json +45 -0
- package/tokens/src/themes/light/components/Popover.json +55 -0
- package/tokens/src/themes/light/components/ProductTour.json +35 -0
- package/tokens/src/themes/light/components/ProgressBar.json +20 -0
- package/tokens/src/themes/light/components/Scrollable.json +14 -0
- package/tokens/src/themes/light/components/SearchField.json +25 -0
- package/tokens/src/themes/light/components/Sheet.json +22 -0
- package/tokens/src/themes/light/components/Stepper.json +34 -0
- package/tokens/src/themes/light/components/Sticky.json +18 -0
- package/tokens/src/themes/light/components/Tab.json +62 -0
- package/tokens/src/themes/light/components/Toast.json +33 -0
- package/tokens/src/themes/light/components/Tooltip.json +30 -0
- package/tokens/src/themes/light/components/general/body.json +8 -0
- package/tokens/src/themes/light/components/general/headings.json +7 -0
- package/tokens/src/themes/light/components/general/hr.json +15 -0
- package/tokens/src/themes/light/components/general/input.json +18 -0
- package/tokens/src/themes/light/components/general/link.json +109 -0
- package/tokens/src/themes/light/components/general/list.json +38 -0
- package/tokens/src/themes/light/components/general/text.json +6 -0
- package/tokens/src/themes/light/global/color.json +1661 -0
- package/tokens/src/themes/light/global/elevation.json +201 -0
- package/tokens/src/themes/light/global/other.json +4 -0
- package/tokens/style-dictionary.js +223 -0
- package/tokens/utils.js +210 -0
- package/dist/ActionRow/_variables.scss +0 -2
- package/dist/Alert/_variables.scss +0 -24
- package/dist/Annotation/_variables.scss +0 -18
- package/dist/Avatar/_variables.scss +0 -10
- package/dist/AvatarButton/_variables.scss +0 -3
- package/dist/Badge/_variables.scss +0 -16
- package/dist/Breadcrumb/_variables.scss +0 -27
- package/dist/Bubble/_variables.scss +0 -8
- package/dist/Button/_variables.scss +0 -52
- package/dist/Button/deprecated/index.js +0 -149
- package/dist/Button/deprecated/index.js.map +0 -1
- package/dist/Card/_variables.scss +0 -55
- package/dist/Carousel/_variables.scss +0 -27
- package/dist/CheckBox/index.js +0 -102
- package/dist/CheckBox/index.js.map +0 -1
- package/dist/CheckBoxGroup/index.js +0 -15
- package/dist/CheckBoxGroup/index.js.map +0 -1
- package/dist/Chip/_variables.scss +0 -28
- package/dist/ChipCarousel/_variables.scss +0 -3
- package/dist/CloseButton/_variables.scss +0 -6
- package/dist/Code/_variables.scss +0 -17
- package/dist/Collapsible/_variables.scss +0 -12
- package/dist/ColorPicker/_variables.scss +0 -2
- package/dist/Container/_variables.scss +0 -5
- package/dist/DataTable/_variables.scss +0 -11
- package/dist/Dropdown/_variables.scss +0 -33
- package/dist/Dropdown/deprecated/DropdownButton.js +0 -44
- package/dist/Dropdown/deprecated/DropdownButton.js.map +0 -1
- package/dist/Dropdown/deprecated/DropdownItem.js +0 -33
- package/dist/Dropdown/deprecated/DropdownItem.js.map +0 -1
- package/dist/Dropdown/deprecated/DropdownMenu.js +0 -46
- package/dist/Dropdown/deprecated/DropdownMenu.js.map +0 -1
- package/dist/Dropdown/deprecated/index.js +0 -241
- package/dist/Dropdown/deprecated/index.js.map +0 -1
- package/dist/Dropzone/_variables.scss +0 -9
- package/dist/Fieldset/index.js +0 -117
- package/dist/Fieldset/index.js.map +0 -1
- package/dist/Fieldset/index.scss +0 -12
- package/dist/Form/_variables.scss +0 -267
- package/dist/Icon/_variables.scss +0 -7
- package/dist/Image/_variables.scss +0 -13
- package/dist/Input/index.js +0 -166
- package/dist/Input/index.js.map +0 -1
- package/dist/InputSelect/index.js +0 -105
- package/dist/InputSelect/index.js.map +0 -1
- package/dist/InputText/index.js +0 -45
- package/dist/InputText/index.js.map +0 -1
- package/dist/ListBox/index.js +0 -148
- package/dist/ListBox/index.js.map +0 -1
- package/dist/ListBoxOption/index.js +0 -94
- package/dist/ListBoxOption/index.js.map +0 -1
- package/dist/Menu/_variables.scss +0 -24
- package/dist/Modal/_variables.scss +0 -50
- package/dist/Modal/index.js +0 -292
- package/dist/Modal/index.js.map +0 -1
- package/dist/Nav/_variables.scss +0 -58
- package/dist/Navbar/_variables.scss +0 -40
- package/dist/OverflowScroll/_variables.scss +0 -5
- package/dist/OverflowScroll/index.scss +0 -1
- package/dist/Pagination/_variables.scss +0 -19
- package/dist/Popover/_variables.scss +0 -36
- package/dist/ProductTour/_variables.scss +0 -15
- package/dist/ProgressBar/_variables.scss +0 -23
- package/dist/RadioButtonGroup/index.js +0 -188
- package/dist/RadioButtonGroup/index.js.map +0 -1
- package/dist/SearchField/_variables.scss +0 -14
- package/dist/SelectableBox/_variables.scss +0 -5
- package/dist/Spinner/_variables.scss +0 -9
- package/dist/Stack/_variables.scss +0 -1
- package/dist/StatusAlert/index.js +0 -168
- package/dist/StatusAlert/index.js.map +0 -1
- package/dist/Stepper/_variables.scss +0 -18
- package/dist/Sticky/_variables.scss +0 -3
- package/dist/Table/_variables.scss +0 -34
- package/dist/Table/index.js +0 -267
- package/dist/Table/index.js.map +0 -1
- package/dist/Table/index.scss +0 -12
- package/dist/Tabs/_variables.scss +0 -24
- package/dist/Tabs/deprecated/Tabs.scss +0 -3
- package/dist/Tabs/deprecated/index.js +0 -123
- package/dist/Tabs/deprecated/index.js.map +0 -1
- package/dist/TextArea/index.js +0 -44
- package/dist/TextArea/index.js.map +0 -1
- package/dist/Toast/_variables.scss +0 -19
- package/dist/Tooltip/_variables.scss +0 -21
- package/dist/ValidationFormGroup/index.js +0 -106
- package/dist/ValidationFormGroup/index.js.map +0 -1
- package/dist/paragon.css +0 -45
- package/scss/core/_grid.scss +0 -21
- package/scss/core/_variables.scss +0 -875
- package/scss/core/core.scss +0 -21
- package/src/ActionRow/_variables.scss +0 -2
- package/src/Alert/_variables.scss +0 -24
- package/src/Annotation/_variables.scss +0 -18
- package/src/Avatar/_variables.scss +0 -10
- package/src/AvatarButton/_variables.scss +0 -3
- package/src/Badge/_variables.scss +0 -16
- package/src/Breadcrumb/_variables.scss +0 -27
- package/src/Bubble/_variables.scss +0 -8
- package/src/Button/_variables.scss +0 -52
- package/src/Button/deprecated/Button.test.jsx +0 -34
- package/src/Button/deprecated/index.jsx +0 -145
- package/src/Card/_variables.scss +0 -55
- package/src/Carousel/_variables.scss +0 -27
- package/src/CheckBox/CheckBox.test.jsx +0 -65
- package/src/CheckBox/README.md +0 -93
- package/src/CheckBox/index.jsx +0 -80
- package/src/CheckBoxGroup/CheckBoxGroup.test.jsx +0 -33
- package/src/CheckBoxGroup/README.md +0 -35
- package/src/CheckBoxGroup/index.jsx +0 -19
- package/src/Chip/_variables.scss +0 -28
- package/src/ChipCarousel/_variables.scss +0 -3
- package/src/CloseButton/_variables.scss +0 -6
- package/src/Code/_variables.scss +0 -17
- package/src/Collapsible/_variables.scss +0 -12
- package/src/ColorPicker/_variables.scss +0 -2
- package/src/Container/_variables.scss +0 -5
- package/src/DataTable/_variables.scss +0 -11
- package/src/Dropdown/_variables.scss +0 -33
- package/src/Dropdown/deprecated/Dropdown.test.jsx +0 -238
- package/src/Dropdown/deprecated/DropdownButton.jsx +0 -52
- package/src/Dropdown/deprecated/DropdownItem.jsx +0 -34
- package/src/Dropdown/deprecated/DropdownMenu.jsx +0 -50
- package/src/Dropdown/deprecated/__snapshots__/Dropdown.test.jsx.snap +0 -229
- package/src/Dropdown/deprecated/index.jsx +0 -222
- package/src/Dropzone/_variables.scss +0 -9
- package/src/Fieldset/Fieldset.test.jsx +0 -101
- package/src/Fieldset/README.md +0 -146
- package/src/Fieldset/index.jsx +0 -107
- package/src/Fieldset/index.scss +0 -12
- package/src/Form/_variables.scss +0 -267
- package/src/Icon/_variables.scss +0 -7
- package/src/Image/_variables.scss +0 -13
- package/src/Input/README.md +0 -74
- package/src/Input/__snapshots__/input.test.jsx.snap +0 -53
- package/src/Input/index.jsx +0 -151
- package/src/Input/input.test.jsx +0 -85
- package/src/InputSelect/README.md +0 -136
- package/src/InputSelect/index.jsx +0 -92
- package/src/InputText/InputText.test.jsx +0 -74
- package/src/InputText/README.md +0 -293
- package/src/InputText/index.jsx +0 -49
- package/src/ListBox/ListBox.test.jsx +0 -161
- package/src/ListBox/README.md +0 -185
- package/src/ListBox/index.jsx +0 -115
- package/src/ListBoxOption/ListBoxOption.test.jsx +0 -154
- package/src/ListBoxOption/index.jsx +0 -78
- package/src/Menu/_variables.scss +0 -24
- package/src/Modal/README.md +0 -148
- package/src/Modal/_variables.scss +0 -50
- package/src/Modal/index.jsx +0 -319
- package/src/Modal/tests/Modal.test.jsx +0 -261
- package/src/Nav/_variables.scss +0 -58
- package/src/Navbar/_variables.scss +0 -40
- package/src/OverflowScroll/_variables.scss +0 -5
- package/src/OverflowScroll/index.scss +0 -1
- package/src/Pagination/_variables.scss +0 -19
- package/src/Popover/_variables.scss +0 -36
- package/src/ProductTour/_variables.scss +0 -15
- package/src/ProgressBar/_variables.scss +0 -23
- package/src/RadioButtonGroup/README.md +0 -50
- package/src/RadioButtonGroup/RadioButtonGroup.test.jsx +0 -127
- package/src/RadioButtonGroup/index.jsx +0 -185
- package/src/SearchField/_variables.scss +0 -14
- package/src/SelectableBox/_variables.scss +0 -5
- package/src/Spinner/_variables.scss +0 -9
- package/src/Stack/_variables.scss +0 -1
- package/src/StatusAlert/README.md +0 -149
- package/src/StatusAlert/StatusAlert.test.jsx +0 -150
- package/src/StatusAlert/index.jsx +0 -144
- package/src/Stepper/_variables.scss +0 -18
- package/src/Sticky/_variables.scss +0 -3
- package/src/Table/README.md +0 -506
- package/src/Table/Table.test.jsx +0 -367
- package/src/Table/_variables.scss +0 -34
- package/src/Table/index.jsx +0 -264
- package/src/Table/index.scss +0 -12
- package/src/Tabs/_variables.scss +0 -24
- package/src/Tabs/deprecated/Tabs.scss +0 -3
- package/src/Tabs/deprecated/Tabs.test.jsx +0 -50
- package/src/Tabs/deprecated/index.jsx +0 -117
- package/src/TextArea/README.md +0 -63
- package/src/TextArea/index.jsx +0 -48
- package/src/Toast/_variables.scss +0 -19
- package/src/Tooltip/_variables.scss +0 -21
- package/src/ValidationFormGroup/README.md +0 -116
- package/src/ValidationFormGroup/ValidationFormGroup.test.jsx +0 -146
- package/src/ValidationFormGroup/__snapshots__/ValidationFormGroup.test.jsx.snap +0 -161
- package/src/ValidationFormGroup/index.jsx +0 -114
- /package/{scss → styles/scss}/core/_exports.module.scss +0 -0
- /package/{scss → styles/scss}/core/_typography.scss +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Pagination
|
|
2
|
-
|
|
3
|
-
$pagination-padding-y: .625rem !default;
|
|
4
|
-
$pagination-margin-x: .5rem !default;
|
|
5
|
-
$pagination-line-height: 1.5rem !default;
|
|
6
|
-
$pagination-font-size-sm: .875rem !default;
|
|
7
|
-
|
|
8
|
-
$pagination-icon-width: 2.25rem !default;
|
|
9
|
-
$pagination-icon-height: 2.25rem !default;
|
|
10
|
-
$pagination-toggle-border: .3125rem !default;
|
|
11
|
-
$pagination-toggle-border-sm: .25rem !default;
|
|
12
|
-
$pagination-secondary-height: 2.75rem !default;
|
|
13
|
-
$pagination-secondary-height-sm: 2.25rem !default;
|
|
14
|
-
|
|
15
|
-
$pagination-dropdown-color-inverse: $white !default;
|
|
16
|
-
$pagination-border-width: $border-width !default;
|
|
17
|
-
|
|
18
|
-
$pagination-reduced-dropdown-max-height: 60vh !default;
|
|
19
|
-
$pagination-reduced-dropdown-min-width: 6rem !default;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Popovers
|
|
2
|
-
|
|
3
|
-
$popover-font-size: $font-size-sm !default;
|
|
4
|
-
$popover-bg: $white !default;
|
|
5
|
-
$popover-max-width: 480px !default;
|
|
6
|
-
$popover-border-width: $border-width !default;
|
|
7
|
-
$popover-border-color: rgba($black, .2) !default;
|
|
8
|
-
$popover-border-radius: $border-radius-sm !default;
|
|
9
|
-
$popover-inner-border-radius: subtract($popover-border-radius, $popover-border-width) !default;
|
|
10
|
-
$popover-box-shadow: drop-shadow(0 2px 4px rgba(0, 0, 0, .15))
|
|
11
|
-
drop-shadow(0 2px 8px rgba(0, 0, 0, .15)) !default;
|
|
12
|
-
$popover-icon-margin-right: .5rem;
|
|
13
|
-
$popover-icon-height: 1rem;
|
|
14
|
-
$popover-icon-width: 1rem;
|
|
15
|
-
|
|
16
|
-
$popover-header-bg: $white !default;
|
|
17
|
-
$popover-header-color: $headings-color !default;
|
|
18
|
-
$popover-header-padding-y: .5rem !default;
|
|
19
|
-
$popover-header-padding-x: 1rem !default;
|
|
20
|
-
|
|
21
|
-
$popover-body-color: $body-color !default;
|
|
22
|
-
$popover-body-padding-y: $popover-header-padding-y !default;
|
|
23
|
-
$popover-body-padding-x: $popover-header-padding-x !default;
|
|
24
|
-
|
|
25
|
-
$popover-arrow-width: 1rem !default;
|
|
26
|
-
$popover-arrow-height: .5rem !default;
|
|
27
|
-
$popover-arrow-color: $popover-bg !default;
|
|
28
|
-
|
|
29
|
-
$popover-arrow-outer-color: fade-in($popover-border-color, .05) !default;
|
|
30
|
-
|
|
31
|
-
$popover-success-bg: $success-100 !default;
|
|
32
|
-
$popover-success-icon-color: $success-500 !default;
|
|
33
|
-
$popover-warning-bg: $warning-100 !default;
|
|
34
|
-
$popover-warning-icon-color: $warning-500 !default;
|
|
35
|
-
$popover-danger-bg: $danger-100 !default;
|
|
36
|
-
$popover-danger-icon-color: $danger-500 !default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Checkpoints
|
|
2
|
-
|
|
3
|
-
$checkpoint-background-color: $light-300 !default;
|
|
4
|
-
|
|
5
|
-
$checkpoint-body-color: $gray-700;
|
|
6
|
-
|
|
7
|
-
$checkpoint-border-color: $brand !default;
|
|
8
|
-
$checkpoint-border-width: 8px !default;
|
|
9
|
-
|
|
10
|
-
$checkpoint-breadcrumb-color: $primary !default;
|
|
11
|
-
|
|
12
|
-
$checkpoint-arrow-width: 15px !default;
|
|
13
|
-
$checkpoint-max-width: 480px !default;
|
|
14
|
-
|
|
15
|
-
$checkpoint-z-index: 1060 !default;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Progress bars
|
|
2
|
-
|
|
3
|
-
$progress-height: 1rem !default;
|
|
4
|
-
$annotated-progress-height: .3125rem !default;
|
|
5
|
-
$progress-font-size: $font-size-base * .75 !default;
|
|
6
|
-
$progress-bg: transparent !default;
|
|
7
|
-
$progress-border-radius: 0 !default;
|
|
8
|
-
$progress-box-shadow: none !default;
|
|
9
|
-
$progress-bar-color: $white !default;
|
|
10
|
-
$progress-bar-bg: theme-color("accent-a") !default;
|
|
11
|
-
$annotated-progress-bar-bg: theme-color("dark") !default;
|
|
12
|
-
$progress-bar-animation-timing: 1s linear infinite !default;
|
|
13
|
-
$progress-bar-transition: width .6s ease !default;
|
|
14
|
-
$progress-bar-border-width: 1px !default;
|
|
15
|
-
$progress-bar-border-color: $gray-500 !default;
|
|
16
|
-
$progress-threshold-circle: .5625rem !default;
|
|
17
|
-
$progress-hint-annotation-gap: .5rem !default;
|
|
18
|
-
$progress-colors: (
|
|
19
|
-
"dark": $primary-500,
|
|
20
|
-
"success": $success-500,
|
|
21
|
-
"error": $danger-500,
|
|
22
|
-
"warning": $accent-b,
|
|
23
|
-
) !default;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'RadioButtonGroup'
|
|
3
|
-
type: 'component'
|
|
4
|
-
components:
|
|
5
|
-
- RadioButtonGroup
|
|
6
|
-
categories:
|
|
7
|
-
- Forms (deprecated)
|
|
8
|
-
status: 'Deprecate Soon'
|
|
9
|
-
designStatus: 'To Do'
|
|
10
|
-
devStatus: 'To Do'
|
|
11
|
-
notes: |
|
|
12
|
-
Replaced by Form.Radio and From.RadioSet
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Unselected minimal usage
|
|
16
|
-
|
|
17
|
-
```jsx live
|
|
18
|
-
<RadioButtonGroup
|
|
19
|
-
name="rbg"
|
|
20
|
-
label="Radio Button Group"
|
|
21
|
-
onBlur={() => console.log('blurred')}
|
|
22
|
-
onChange={() => console.log('onChange')}
|
|
23
|
-
onClick={() => console.log('onClick')}
|
|
24
|
-
onFocus={() => console.log('onFocus')}
|
|
25
|
-
onKeyDown={() => console.log('onKeyDown')}
|
|
26
|
-
>
|
|
27
|
-
<RadioButton value="jaebaebae">First Value</RadioButton>
|
|
28
|
-
<RadioButton value="value2">Second Value</RadioButton>
|
|
29
|
-
<RadioButton value="value3">Third Value</RadioButton>
|
|
30
|
-
</RadioButtonGroup>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Selected minimal usage
|
|
34
|
-
|
|
35
|
-
```jsx live
|
|
36
|
-
<RadioButtonGroup
|
|
37
|
-
name="rbg-2"
|
|
38
|
-
label="Radio Button Group"
|
|
39
|
-
onBlur={() => console.log('blurred')}
|
|
40
|
-
onChange={() => console.log('onChange')}
|
|
41
|
-
onClick={() => console.log('onClick')}
|
|
42
|
-
onFocus={() => console.log('onFocus')}
|
|
43
|
-
onKeyDown={() => console.log('onKeyDown')}
|
|
44
|
-
selectedIndex={1}
|
|
45
|
-
>
|
|
46
|
-
<RadioButton value="jaebaebae">First Value</RadioButton>
|
|
47
|
-
<RadioButton value="value2">Second Value</RadioButton>
|
|
48
|
-
<RadioButton value="value3">Third Value</RadioButton>
|
|
49
|
-
</RadioButtonGroup>
|
|
50
|
-
```
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
|
|
5
|
-
import RadioButtonGroup, { RadioButton } from '.';
|
|
6
|
-
|
|
7
|
-
describe('<RadioButton />', () => {
|
|
8
|
-
const text = 'text';
|
|
9
|
-
const index = 0;
|
|
10
|
-
const isChecked = false;
|
|
11
|
-
const name = 'name';
|
|
12
|
-
const onBlur = jest.fn();
|
|
13
|
-
const onClick = jest.fn();
|
|
14
|
-
const onFocus = jest.fn();
|
|
15
|
-
const onKeyDown = jest.fn();
|
|
16
|
-
const value = 'value';
|
|
17
|
-
const props = {
|
|
18
|
-
index,
|
|
19
|
-
isChecked,
|
|
20
|
-
name,
|
|
21
|
-
onBlur,
|
|
22
|
-
onClick,
|
|
23
|
-
onFocus,
|
|
24
|
-
onKeyDown,
|
|
25
|
-
value,
|
|
26
|
-
};
|
|
27
|
-
describe('correct rendering', () => {
|
|
28
|
-
it('renders RadioButton', () => {
|
|
29
|
-
render(
|
|
30
|
-
<RadioButton {...props}>
|
|
31
|
-
{text}
|
|
32
|
-
</RadioButton>,
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const radioButton = screen.getByRole('radio');
|
|
36
|
-
expect(radioButton).toBeInTheDocument();
|
|
37
|
-
expect(radioButton).toHaveAttribute('name', name);
|
|
38
|
-
expect(radioButton).toHaveAttribute('value', value);
|
|
39
|
-
expect(radioButton).toHaveAttribute('aria-checked', isChecked.toString());
|
|
40
|
-
expect(radioButton).toHaveAttribute('data-index', index.toString());
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe('event handlers correctly triggered', () => {
|
|
45
|
-
let spy;
|
|
46
|
-
|
|
47
|
-
beforeEach(() => {
|
|
48
|
-
spy = jest.fn();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
afterEach(() => {
|
|
52
|
-
spy.mockClear();
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should fire onBlur', async () => {
|
|
56
|
-
render((<RadioButton {...props} onBlur={spy} />));
|
|
57
|
-
const radioButton = screen.getByRole('radio');
|
|
58
|
-
radioButton.focus();
|
|
59
|
-
await userEvent.tab();
|
|
60
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
61
|
-
});
|
|
62
|
-
it('should fire onClick', async () => {
|
|
63
|
-
render((<RadioButton {...props} onClick={spy} />));
|
|
64
|
-
const radioButton = screen.getByRole('radio');
|
|
65
|
-
await userEvent.click(radioButton);
|
|
66
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
67
|
-
});
|
|
68
|
-
it('should fire onFocus', async () => {
|
|
69
|
-
render((<RadioButton {...props} onFocus={spy} />));
|
|
70
|
-
const radioButton = screen.getByRole('radio');
|
|
71
|
-
radioButton.focus();
|
|
72
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
73
|
-
});
|
|
74
|
-
it('should fire onKeyDown', async () => {
|
|
75
|
-
render((<RadioButton {...props} onKeyDown={spy} />));
|
|
76
|
-
const radioButton = screen.getByRole('radio');
|
|
77
|
-
radioButton.focus();
|
|
78
|
-
await userEvent.keyboard('{enter}');
|
|
79
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
describe('<RadioButtonGroup />', () => {
|
|
85
|
-
const firstText = 'firstText';
|
|
86
|
-
const secondText = 'secondText';
|
|
87
|
-
const name = 'name';
|
|
88
|
-
const label = 'label';
|
|
89
|
-
const onBlur = jest.fn();
|
|
90
|
-
const onChange = jest.fn();
|
|
91
|
-
const onClick = jest.fn();
|
|
92
|
-
const onFocus = jest.fn();
|
|
93
|
-
const onKeyDown = jest.fn();
|
|
94
|
-
const firstValue = 'firstValue';
|
|
95
|
-
const secondValue = 'secondValue';
|
|
96
|
-
const props = {
|
|
97
|
-
name,
|
|
98
|
-
label,
|
|
99
|
-
onBlur,
|
|
100
|
-
onChange,
|
|
101
|
-
onClick,
|
|
102
|
-
onFocus,
|
|
103
|
-
onKeyDown,
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
it('renders RadioButtonGroup', () => {
|
|
107
|
-
render(
|
|
108
|
-
<RadioButtonGroup {...props}>
|
|
109
|
-
<RadioButton value={firstValue}>{firstText}</RadioButton>
|
|
110
|
-
<RadioButton value={secondValue}>{secondText}</RadioButton>
|
|
111
|
-
</RadioButtonGroup>,
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
const radioButtons = screen.getAllByRole('radio');
|
|
115
|
-
expect(radioButtons.length).toBe(2);
|
|
116
|
-
|
|
117
|
-
radioButtons.forEach((radioButton, index) => {
|
|
118
|
-
expect(radioButton).toHaveAttribute('name', name);
|
|
119
|
-
expect(radioButton).toHaveAttribute('value', index === 0 ? firstValue : secondValue);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
const radioButtonGroupDiv = screen.getByRole('radiogroup');
|
|
123
|
-
expect(radioButtonGroupDiv).toBeInTheDocument();
|
|
124
|
-
expect(radioButtonGroupDiv).toHaveAttribute('aria-label', label);
|
|
125
|
-
expect(radioButtonGroupDiv).toHaveAttribute('tabIndex', '-1');
|
|
126
|
-
});
|
|
127
|
-
});
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/no-multi-comp, max-classes-per-file, max-len */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
class RadioButton extends React.PureComponent {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
super(props);
|
|
8
|
-
|
|
9
|
-
const {
|
|
10
|
-
onBlur,
|
|
11
|
-
onClick,
|
|
12
|
-
onFocus,
|
|
13
|
-
onKeyDown,
|
|
14
|
-
} = props;
|
|
15
|
-
|
|
16
|
-
this.onBlur = onBlur.bind(this);
|
|
17
|
-
this.onClick = onClick.bind(this);
|
|
18
|
-
this.onFocus = onFocus.bind(this);
|
|
19
|
-
this.onKeyDown = onKeyDown.bind(this);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
render() {
|
|
23
|
-
const {
|
|
24
|
-
children,
|
|
25
|
-
index,
|
|
26
|
-
isChecked,
|
|
27
|
-
name,
|
|
28
|
-
value,
|
|
29
|
-
...other
|
|
30
|
-
} = this.props;
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div>
|
|
34
|
-
<input
|
|
35
|
-
type="radio"
|
|
36
|
-
name={name}
|
|
37
|
-
aria-checked={isChecked}
|
|
38
|
-
defaultChecked={isChecked}
|
|
39
|
-
value={value}
|
|
40
|
-
aria-label={children}
|
|
41
|
-
data-index={index}
|
|
42
|
-
onBlur={this.onBlur}
|
|
43
|
-
onClick={this.onClick}
|
|
44
|
-
onFocus={this.onFocus}
|
|
45
|
-
onKeyDown={this.onKeyDown}
|
|
46
|
-
{...other}
|
|
47
|
-
/>{children}
|
|
48
|
-
</div>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
class RadioButtonGroup extends React.Component {
|
|
54
|
-
constructor(props) {
|
|
55
|
-
super();
|
|
56
|
-
// Bind the method to the component context
|
|
57
|
-
this.renderChildren = this.renderChildren.bind(this);
|
|
58
|
-
this.onChange = this.onChange.bind(this);
|
|
59
|
-
|
|
60
|
-
this.state = {
|
|
61
|
-
selectedIndex: props.selectedIndex,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
onChange(event) {
|
|
66
|
-
if (event.target.checked && event.target.hasAttribute('data-index')) {
|
|
67
|
-
this.setState({
|
|
68
|
-
selectedIndex: parseInt(event.target.getAttribute('data-index'), 10),
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
this.props.onChange(event);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
renderChildren() {
|
|
76
|
-
const {
|
|
77
|
-
children,
|
|
78
|
-
name,
|
|
79
|
-
onBlur,
|
|
80
|
-
onClick,
|
|
81
|
-
onFocus,
|
|
82
|
-
onKeyDown,
|
|
83
|
-
} = this.props;
|
|
84
|
-
|
|
85
|
-
return React.Children.map((children), (child, index) => React.cloneElement(child, {
|
|
86
|
-
name,
|
|
87
|
-
value: child.props.value,
|
|
88
|
-
isChecked: index === this.state.selectedIndex,
|
|
89
|
-
onBlur,
|
|
90
|
-
onClick,
|
|
91
|
-
onFocus,
|
|
92
|
-
onKeyDown,
|
|
93
|
-
index,
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
render() {
|
|
98
|
-
const {
|
|
99
|
-
children,
|
|
100
|
-
label,
|
|
101
|
-
name,
|
|
102
|
-
onBlur,
|
|
103
|
-
onChange,
|
|
104
|
-
onClick,
|
|
105
|
-
onFocus,
|
|
106
|
-
onKeyDown,
|
|
107
|
-
selectedIndex,
|
|
108
|
-
...other
|
|
109
|
-
} = this.props;
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<div
|
|
113
|
-
role="radiogroup"
|
|
114
|
-
aria-label={label}
|
|
115
|
-
onChange={this.onChange}
|
|
116
|
-
tabIndex={-1}
|
|
117
|
-
{...other}
|
|
118
|
-
>
|
|
119
|
-
{this.renderChildren()}
|
|
120
|
-
</div>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
RadioButton.defaultProps = {
|
|
126
|
-
children: undefined,
|
|
127
|
-
index: undefined,
|
|
128
|
-
isChecked: false,
|
|
129
|
-
name: undefined,
|
|
130
|
-
onBlur: () => {},
|
|
131
|
-
onClick: () => {},
|
|
132
|
-
onFocus: () => {},
|
|
133
|
-
onKeyDown: () => {},
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
RadioButton.propTypes = {
|
|
137
|
-
children: PropTypes.oneOfType([
|
|
138
|
-
PropTypes.string,
|
|
139
|
-
PropTypes.number,
|
|
140
|
-
PropTypes.bool,
|
|
141
|
-
]),
|
|
142
|
-
index: PropTypes.number,
|
|
143
|
-
isChecked: PropTypes.bool,
|
|
144
|
-
name: PropTypes.string,
|
|
145
|
-
onBlur: PropTypes.func,
|
|
146
|
-
onClick: PropTypes.func,
|
|
147
|
-
onFocus: PropTypes.func,
|
|
148
|
-
onKeyDown: PropTypes.func,
|
|
149
|
-
value: PropTypes.oneOfType([
|
|
150
|
-
PropTypes.string,
|
|
151
|
-
PropTypes.number,
|
|
152
|
-
PropTypes.bool,
|
|
153
|
-
]).isRequired,
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
RadioButtonGroup.defaultProps = {
|
|
157
|
-
onBlur: () => {},
|
|
158
|
-
onChange: () => {},
|
|
159
|
-
onClick: () => {},
|
|
160
|
-
onFocus: () => {},
|
|
161
|
-
onKeyDown: () => {},
|
|
162
|
-
selectedIndex: undefined,
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
RadioButtonGroup.propTypes = {
|
|
166
|
-
children: PropTypes.arrayOf(PropTypes.element).isRequired,
|
|
167
|
-
/** specifies the `aria-label` value for the `RadioButtonGroup` */
|
|
168
|
-
label: PropTypes.string.isRequired,
|
|
169
|
-
/** specifies the `name` value for the `RadioButtonGroup` so that no more than one `RadioButton` can be selected at any given time */
|
|
170
|
-
name: PropTypes.string.isRequired,
|
|
171
|
-
/** specifies the callback for the `onBlur` event for each `RadioButton` within the group. The default value is a no-op function. */
|
|
172
|
-
onBlur: PropTypes.func,
|
|
173
|
-
/** specifies the callback for the onChange event for each RadioButton within the group. The default value is a no-op function. */
|
|
174
|
-
onChange: PropTypes.func,
|
|
175
|
-
/** specifies the callback for the `onClick` event for each `RadioButton` within the group. The default value is a no-op function. */
|
|
176
|
-
onClick: PropTypes.func,
|
|
177
|
-
/** specifies the callback for the `onFocus` event for each `RadioButton` within the group. The default value is a no-op function. */
|
|
178
|
-
onFocus: PropTypes.func,
|
|
179
|
-
/** specifies the callback for the `onKeyDown` event for each `RadioButton` within the group. The default value is a no-op function. */
|
|
180
|
-
onKeyDown: PropTypes.func,
|
|
181
|
-
/** specifies which `RadioButton` is initially selected. The default value is `undefined` which signifies that no `RadioButton` is initially selected. */
|
|
182
|
-
selectedIndex: PropTypes.number,
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
export { RadioButtonGroup as default, RadioButton };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
$search-btn-variants: (
|
|
2
|
-
"light": $primary-500,
|
|
3
|
-
"dark": $brand-500,
|
|
4
|
-
);
|
|
5
|
-
$search-border-radius: 0 !default;
|
|
6
|
-
$search-border-color: $gray-500 !default;
|
|
7
|
-
$search-form-background-color: $white !default;
|
|
8
|
-
$search-border-color-interaction: $black !default;
|
|
9
|
-
$search-border-width: .0625rem !default;
|
|
10
|
-
$search-disabled-opacity: .3 !default;
|
|
11
|
-
$search-button-margin: .5rem !default;
|
|
12
|
-
$input-height-search: calc(#{$input-line-height * 1em} + #{$input-padding-y * 2}) !default;
|
|
13
|
-
$search-border-focus-color: $black !default;
|
|
14
|
-
$search-border-focus-width: .3125rem !default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
$stack-gap: 0 !default;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'StatusAlert'
|
|
3
|
-
type: 'component'
|
|
4
|
-
components:
|
|
5
|
-
- StatusAlert
|
|
6
|
-
categories:
|
|
7
|
-
- Status & metadata
|
|
8
|
-
status: 'Deprecate Soon'
|
|
9
|
-
designStatus: 'Done'
|
|
10
|
-
devStatus: 'Done'
|
|
11
|
-
notes: |
|
|
12
|
-
Alert replaces this component
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## basic usage
|
|
16
|
-
|
|
17
|
-
```jsx live
|
|
18
|
-
<StatusAlert
|
|
19
|
-
dialog="You have a status alert!"
|
|
20
|
-
onClose={() => {}}
|
|
21
|
-
open
|
|
22
|
-
/>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## success alert
|
|
26
|
-
|
|
27
|
-
```jsx live
|
|
28
|
-
<StatusAlert
|
|
29
|
-
alertType="success"
|
|
30
|
-
dialog="Success!"
|
|
31
|
-
onClose={() => {}}
|
|
32
|
-
open
|
|
33
|
-
/>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## danger alert
|
|
37
|
-
|
|
38
|
-
```jsx live
|
|
39
|
-
<StatusAlert
|
|
40
|
-
alertType="danger"
|
|
41
|
-
dialog="Error!"
|
|
42
|
-
onClose={() => {}}
|
|
43
|
-
open
|
|
44
|
-
/>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## informational alert
|
|
48
|
-
|
|
49
|
-
```jsx live
|
|
50
|
-
<StatusAlert
|
|
51
|
-
alertType="info"
|
|
52
|
-
dialog="Get some info here!"
|
|
53
|
-
onClose={() => {}}
|
|
54
|
-
open
|
|
55
|
-
/>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## alert with a custom aria-label on the close button
|
|
59
|
-
|
|
60
|
-
```jsx live
|
|
61
|
-
<StatusAlert
|
|
62
|
-
alertType="info"
|
|
63
|
-
dialog="Some very specific information."
|
|
64
|
-
onClose={() => {}}
|
|
65
|
-
open
|
|
66
|
-
closeButtonAriaLabel="Dismiss this very specific information."
|
|
67
|
-
/>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Non-dismissible alert
|
|
71
|
-
|
|
72
|
-
```jsx live
|
|
73
|
-
<StatusAlert
|
|
74
|
-
alertType="danger"
|
|
75
|
-
dismissible={false}
|
|
76
|
-
dialog="You can't get rid of me!"
|
|
77
|
-
open
|
|
78
|
-
/>
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## alert invoked via a button
|
|
82
|
-
|
|
83
|
-
```jsx live
|
|
84
|
-
class StatusAlertWrapper extends React.Component {
|
|
85
|
-
constructor(props) {
|
|
86
|
-
super(props);
|
|
87
|
-
|
|
88
|
-
this.openStatusAlert = this.openStatusAlert.bind(this);
|
|
89
|
-
this.resetStatusAlertWrapperState = this.resetStatusAlertWrapperState.bind(
|
|
90
|
-
this,
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
this.state = { open: false };
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
openStatusAlert() {
|
|
97
|
-
this.setState({ open: true });
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
resetStatusAlertWrapperState() {
|
|
101
|
-
this.setState({ open: false });
|
|
102
|
-
this.button.focus();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
render() {
|
|
106
|
-
return (
|
|
107
|
-
<div>
|
|
108
|
-
<StatusAlert
|
|
109
|
-
alertType="warning"
|
|
110
|
-
open={this.state.open}
|
|
111
|
-
dialog="You triggered a warning"
|
|
112
|
-
onClose={this.resetStatusAlertWrapperState}
|
|
113
|
-
/>
|
|
114
|
-
<Button
|
|
115
|
-
onClick={this.openStatusAlert}
|
|
116
|
-
variant="light"
|
|
117
|
-
inputRef={input => {
|
|
118
|
-
this.button = input;
|
|
119
|
-
}}
|
|
120
|
-
>
|
|
121
|
-
Click me to open a Status Alert!
|
|
122
|
-
</Button>
|
|
123
|
-
</div>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## alert with a link
|
|
130
|
-
|
|
131
|
-
```jsx live
|
|
132
|
-
<StatusAlert
|
|
133
|
-
alertType="info"
|
|
134
|
-
dialog={
|
|
135
|
-
<div>
|
|
136
|
-
<span>Love cats? </span>
|
|
137
|
-
<a
|
|
138
|
-
href="https://www.factretriever.com/cat-facts"
|
|
139
|
-
target="_blank"
|
|
140
|
-
rel="noopener noreferrer"
|
|
141
|
-
>
|
|
142
|
-
Click me!
|
|
143
|
-
</a>
|
|
144
|
-
</div>
|
|
145
|
-
}
|
|
146
|
-
onClose={() => {}}
|
|
147
|
-
open
|
|
148
|
-
/>
|
|
149
|
-
```
|