@openedx/paragon 22.6.0 → 23.0.0-alpha.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/README.md +61 -21
- 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 +15 -40
- package/dist/Button/index.js.map +1 -1
- package/dist/Button/index.scss +855 -372
- 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/ChipIcon.d.ts +2 -2
- package/dist/Chip/ChipIcon.js.map +1 -1
- package/dist/Chip/index.d.ts +2 -2
- package/dist/Chip/index.js +2 -2
- package/dist/Chip/index.js.map +1 -1
- package/dist/Chip/index.scss +48 -38
- 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.js +32 -20
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Hyperlink/index.scss +1 -1
- package/dist/Icon/index.d.ts +2 -4
- package/dist/Icon/index.js +1 -1
- package/dist/Icon/index.js.map +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 -54
- 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 +20 -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 +29 -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 +16777 -0
- package/dist/core.css.map +1 -0
- package/dist/core.min.css +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -18
- 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 +133 -0
- package/lib/help.js +36 -23
- package/lib/replace-variables.js +38 -0
- package/lib/utils.js +30 -0
- package/package.json +30 -14
- 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/{Button.test.tsx → Button.test.jsx} +2 -14
- package/src/Button/README.md +0 -84
- package/src/Button/__snapshots__/{Button.test.tsx.snap → Button.test.jsx.snap} +2 -19
- package/src/Button/_mixins.scss +14 -0
- package/src/Button/button-group.scss +126 -0
- package/src/Button/index.jsx +113 -0
- package/src/Button/index.scss +855 -372
- 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/ChipIcon.tsx +1 -1
- package/src/Chip/index.scss +48 -38
- package/src/Chip/index.tsx +5 -5
- 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/{Hyperlink.test.tsx → Hyperlink.test.jsx} +10 -21
- package/src/Hyperlink/{index.tsx → index.jsx} +37 -41
- package/src/Hyperlink/index.scss +1 -1
- package/src/Icon/index.d.ts +2 -4
- package/src/Icon/index.jsx +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 -54
- 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 +20 -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 +29 -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.d.ts +2 -2
- package/src/index.js +4 -18
- package/src/index.scss +0 -4
- package/src/{setupTest.ts → setupTest.js} +0 -7
- 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 +603 -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 +868 -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 +157 -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 +23 -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 +96 -0
- package/tokens/src/core/components/Carousel.json +37 -0
- package/tokens/src/core/components/Chip.json +41 -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 +229 -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 +52 -0
- package/tokens/src/core/components/Navbar.json +70 -0
- package/tokens/src/core/components/Pagination.json +66 -0
- package/tokens/src/core/components/Popover.json +48 -0
- package/tokens/src/core/components/ProductTour.json +32 -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 +22 -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 +37 -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 +38 -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 +13 -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 +36 -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 +12 -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 +229 -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/Button/index.d.ts +0 -35
- 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/Hyperlink/index.d.ts +0 -24
- 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/dist/setupTest.d.ts +0 -2
- package/dist/setupTest.js.map +0 -1
- package/dist/utils/types/bootstrap.d.ts +0 -39
- package/dist/utils/types/bootstrap.js +0 -2
- package/dist/utils/types/bootstrap.js.map +0 -1
- 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/Button/index.tsx +0 -159
- 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/src/utils/types/bootstrap.test.tsx +0 -86
- package/src/utils/types/bootstrap.ts +0 -43
- /package/src/Button/{ButtonGroup.test.tsx → ButtonGroup.test.jsx} +0 -0
- /package/src/Button/{ButtonToolbar.test.tsx → ButtonToolbar.test.jsx} +0 -0
- /package/src/Button/__snapshots__/{ButtonGroup.test.tsx.snap → ButtonGroup.test.jsx.snap} +0 -0
- /package/src/Button/__snapshots__/{ButtonToolbar.test.tsx.snap → ButtonToolbar.test.jsx.snap} +0 -0
- /package/{scss → styles/scss}/core/_exports.module.scss +0 -0
- /package/{scss → styles/scss}/core/_typography.scss +0 -0
package/scss/core/core.scss
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
@import "functions";
|
|
2
|
-
@import "variables";
|
|
3
|
-
@import "~bootstrap/scss/mixins";
|
|
4
|
-
@import "~bootstrap/scss/root";
|
|
5
|
-
@import "~bootstrap/scss/reboot";
|
|
6
|
-
@import "typography";
|
|
7
|
-
@import "grid";
|
|
8
|
-
// The react-loading-skeleton package.json defines an 'exports' field which specifies a '.css'
|
|
9
|
-
// extension on this export. Without the '.css' on the end of this line, webpack can't find the file
|
|
10
|
-
// and the build fails.
|
|
11
|
-
// See https://webpack.js.org/guides/package-exports/ for more information on how webpack uses
|
|
12
|
-
// the 'exports' field.
|
|
13
|
-
@import "~react-loading-skeleton/dist/skeleton.css";
|
|
14
|
-
@import "~bootstrap/scss/transitions";
|
|
15
|
-
@import "utilities";
|
|
16
|
-
@import "~bootstrap/scss/media";
|
|
17
|
-
@import "~bootstrap/scss/list-group";
|
|
18
|
-
@import "~bootstrap/scss/print";
|
|
19
|
-
|
|
20
|
-
// Paragon components
|
|
21
|
-
@import "../../src/index";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Alerts
|
|
2
|
-
//
|
|
3
|
-
// Define alert colors, border radius, and padding.
|
|
4
|
-
|
|
5
|
-
$alert-padding-y: 1.5rem !default;
|
|
6
|
-
$alert-padding-x: 1.5rem !default;
|
|
7
|
-
$alert-margin-bottom: 1rem !default;
|
|
8
|
-
$alert-border-radius: $border-radius !default;
|
|
9
|
-
$alert-link-font-weight: $font-weight-normal !default;
|
|
10
|
-
$alert-border-width: 0 !default;
|
|
11
|
-
$alert-title-color: #000000 !default;
|
|
12
|
-
$alert-box-shadow: 0 1px 2px rgba(0, 0, 0, .15), 0 1px 4px rgba(0, 0, 0, .15) !default;
|
|
13
|
-
|
|
14
|
-
$alert-bg-level: -10 !default;
|
|
15
|
-
$alert-border-level: -9 !default;
|
|
16
|
-
$alert-color-level: 6 !default;
|
|
17
|
-
|
|
18
|
-
$alert-icon-space: .8rem !default;
|
|
19
|
-
|
|
20
|
-
$alert-font-size: .875rem !default;
|
|
21
|
-
$alert-line-height: 1.5rem !default;
|
|
22
|
-
$alert-content-color: $gray-700 !default;
|
|
23
|
-
|
|
24
|
-
$alert-actions-gap: map-get($spacers, 3);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
$annotation-padding: .5rem !default;
|
|
2
|
-
$annotation-box-shadow: drop-shadow(0 2px 4px rgba(0, 0, 0, .15))
|
|
3
|
-
drop-shadow(0 2px 8px rgba(0, 0, 0, .15)) !default;
|
|
4
|
-
$annotation-border-radius: .25rem !default;
|
|
5
|
-
$annotation-max-width: 18.75rem !default;
|
|
6
|
-
$annotation-font-size: $font-size-sm !default;
|
|
7
|
-
$annotation-line-height: $line-height-sm !default;
|
|
8
|
-
|
|
9
|
-
$annotation-variants: (
|
|
10
|
-
"success": ( "background-color": $success, "color": $white ),
|
|
11
|
-
"warning": ( "background-color": $accent-b, "color": $black ),
|
|
12
|
-
"error": ( "background-color": $danger, "color": $white ),
|
|
13
|
-
"light": ( "background-color": $white, "color": $primary-500 ),
|
|
14
|
-
"dark": ( "background-color": $dark, "color": $white ),
|
|
15
|
-
) !default;
|
|
16
|
-
|
|
17
|
-
$annotation-arrow-side-margin: .25rem !default;
|
|
18
|
-
$annotation-arrow-border-width: .5rem !default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
$avatar-border-radius: 100% !default;
|
|
2
|
-
$avatar-border: solid 1px $light-300 !default;
|
|
3
|
-
|
|
4
|
-
$avatar-size-xs: 1.5rem !default;
|
|
5
|
-
$avatar-size-sm: 2.25rem !default;
|
|
6
|
-
$avatar-size: 3rem !default;
|
|
7
|
-
$avatar-size-lg: 4rem !default;
|
|
8
|
-
$avatar-size-xl: 6rem !default;
|
|
9
|
-
$avatar-size-xxl: 11.5rem !default;
|
|
10
|
-
$avatar-size-huge: 18.75rem !default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Badges
|
|
2
|
-
|
|
3
|
-
$badge-font-size: 75% !default;
|
|
4
|
-
$badge-font-weight: $font-weight-bold !default;
|
|
5
|
-
$badge-padding-y: .125rem !default;
|
|
6
|
-
$badge-padding-x: .5rem !default;
|
|
7
|
-
$badge-border-radius: .25rem !default;
|
|
8
|
-
|
|
9
|
-
$badge-transition: none !default;
|
|
10
|
-
$badge-focus-width: $input-btn-focus-width !default;
|
|
11
|
-
|
|
12
|
-
$badge-pill-padding-x: .6em !default;
|
|
13
|
-
|
|
14
|
-
// Use a higher than normal value to ensure completely rounded edges when
|
|
15
|
-
// customizing padding or font-size on labels.
|
|
16
|
-
$badge-pill-border-radius: 10rem !default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Breadcrumbs
|
|
2
|
-
|
|
3
|
-
$breadcrumb-font-size: null !default;
|
|
4
|
-
|
|
5
|
-
$breadcrumb-padding-y: .75rem !default;
|
|
6
|
-
$breadcrumb-padding-x: 1rem !default;
|
|
7
|
-
$breadcrumb-item-padding: .5rem !default;
|
|
8
|
-
|
|
9
|
-
$breadcrumb-margin-bottom: 1rem !default;
|
|
10
|
-
$breadcrumb-margin-left: .5rem !default;
|
|
11
|
-
|
|
12
|
-
$breadcrumb-border-focus-axis-x: .25rem !default;
|
|
13
|
-
$breadcrumb-border-focus-axis-y: .5rem !default;
|
|
14
|
-
|
|
15
|
-
$breadcrumb-border-focus-width: .0625rem !default;
|
|
16
|
-
|
|
17
|
-
$breadcrumb-bg: $gray-200 !default;
|
|
18
|
-
$breadcrumb-divider-color: $gray-600 !default;
|
|
19
|
-
$breadcrumb-active-color: $gray-500 !default;
|
|
20
|
-
$breadcrumb-inverse-active: $light-500 !default;
|
|
21
|
-
$breadcrumb-inverse-spacer: $light-700 !default;
|
|
22
|
-
$breadcrumb-color: $primary-500 !default;
|
|
23
|
-
$breadcrumb-inverse-color: $white !default;
|
|
24
|
-
$breadcrumb-divider: "/" !default;
|
|
25
|
-
|
|
26
|
-
$breadcrumb-border-radius: $border-radius !default;
|
|
27
|
-
$breadcrumb-focus-border-radius: .125rem !default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
$bubble-variants: (
|
|
2
|
-
"success": ( "background-color": $success, "color": $white ),
|
|
3
|
-
"warning": ( "background-color": $warning, "color": $white ),
|
|
4
|
-
"error": ( "background-color": $danger, "color": $white ),
|
|
5
|
-
"primary": ( "background-color": $primary, "color": $white ),
|
|
6
|
-
) !default;
|
|
7
|
-
$bubble-expandable-padding-x: .25rem !default;
|
|
8
|
-
$bubble-expandable-padding-y: 0 !default;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
$btn-padding-y: $input-btn-padding-y !default;
|
|
2
|
-
$btn-padding-x: $input-btn-padding-x !default;
|
|
3
|
-
$btn-font-family: $input-btn-font-family !default;
|
|
4
|
-
$btn-font-size: $input-btn-font-size !default;
|
|
5
|
-
$btn-line-height: $input-btn-line-height !default;
|
|
6
|
-
|
|
7
|
-
$btn-padding-y-sm: $input-btn-padding-y-sm !default;
|
|
8
|
-
$btn-padding-x-sm: $input-btn-padding-x-sm !default;
|
|
9
|
-
$btn-font-size-sm: $input-btn-font-size-sm !default;
|
|
10
|
-
$btn-line-height-sm: $input-btn-line-height-sm !default;
|
|
11
|
-
|
|
12
|
-
$btn-padding-y-lg: $input-btn-padding-y-lg !default;
|
|
13
|
-
$btn-padding-x-lg: $input-btn-padding-x-lg !default;
|
|
14
|
-
$btn-font-size-lg: $input-btn-font-size-lg !default;
|
|
15
|
-
$btn-line-height-lg: $input-btn-line-height-lg !default;
|
|
16
|
-
|
|
17
|
-
$btn-border-width: $input-btn-border-width !default;
|
|
18
|
-
|
|
19
|
-
$btn-font-weight: $font-weight-normal !default;
|
|
20
|
-
$btn-box-shadow: inset 0 1px 0 rgba($white, .15), 0 1px 1px rgba($black, .075) !default;
|
|
21
|
-
$btn-focus-width: 2px !default;
|
|
22
|
-
$btn-focus-gap: $btn-focus-width !default;
|
|
23
|
-
$btn-focus-box-shadow: $input-btn-focus-box-shadow !default;
|
|
24
|
-
$btn-disabled-opacity: .65 !default;
|
|
25
|
-
$btn-active-box-shadow: none;
|
|
26
|
-
|
|
27
|
-
$btn-tertiary-color: $gray-700 !default;
|
|
28
|
-
$btn-tertiary-bg: transparent !default;
|
|
29
|
-
$btn-tertiary-hover-bg: $light-500 !default;
|
|
30
|
-
$btn-tertiary-active-bg: $light-500 !default;
|
|
31
|
-
$btn-inverse-tertiary-color: $white !default;
|
|
32
|
-
$btn-inverse-tertiary-bg: transparent !default;
|
|
33
|
-
$btn-inverse-tertiary-hover-bg: rgba(255, 255, 255, .1) !default;
|
|
34
|
-
$btn-inverse-tertiary-active-bg: rgba(255, 255, 255, .1) !default;
|
|
35
|
-
|
|
36
|
-
$btn-link-disabled-color: theme-color("gray", "light-text") !default;
|
|
37
|
-
|
|
38
|
-
$btn-block-spacing-y: .5rem !default;
|
|
39
|
-
|
|
40
|
-
// Allows for customizing button radius independently from global border radius
|
|
41
|
-
$btn-border-radius: $border-radius !default;
|
|
42
|
-
$btn-border-radius-lg: $border-radius-lg !default;
|
|
43
|
-
$btn-border-radius-sm: $border-radius-sm !default;
|
|
44
|
-
|
|
45
|
-
$btn-transition: null;
|
|
46
|
-
|
|
47
|
-
$btn-focus-border-gap: $btn-focus-width + $btn-focus-gap !default;
|
|
48
|
-
$btn-focus-distance-to-border: $btn-focus-border-gap + $btn-border-width !default;
|
|
49
|
-
|
|
50
|
-
$btn-focus-border-radius: calc(#{$btn-border-radius} + #{$btn-focus-border-gap}) !default;
|
|
51
|
-
$btn-focus-border-radius-lg: $btn-focus-border-radius !default;
|
|
52
|
-
$btn-focus-border-radius-sm: $btn-border-radius !default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import Button from '.';
|
|
5
|
-
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
label: 'Click me!',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
describe('<Button />', () => {
|
|
11
|
-
it('renders', () => {
|
|
12
|
-
const { getByText } = render(<Button {...defaultProps} />);
|
|
13
|
-
const button = getByText(defaultProps.label);
|
|
14
|
-
expect(button).toBeInTheDocument();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('puts focus on button on click', () => {
|
|
18
|
-
const { getByText } = render(<Button {...defaultProps} />);
|
|
19
|
-
const button = getByText(defaultProps.label);
|
|
20
|
-
|
|
21
|
-
expect(button).not.toHaveFocus();
|
|
22
|
-
userEvent.click(button);
|
|
23
|
-
expect(button).toHaveFocus();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('calls onClick prop on click', () => {
|
|
27
|
-
const onClickSpy = jest.fn();
|
|
28
|
-
const { getByText } = render(<Button {...defaultProps} onClick={onClickSpy} />);
|
|
29
|
-
const button = getByText(defaultProps.label);
|
|
30
|
-
|
|
31
|
-
userEvent.click(button);
|
|
32
|
-
expect(onClickSpy).toHaveBeenCalledTimes(1);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import withDeprecatedProps, { DeprTypes } from '../../withDeprecatedProps';
|
|
6
|
-
|
|
7
|
-
class DeprecatedButton extends React.Component {
|
|
8
|
-
constructor(props) {
|
|
9
|
-
super(props);
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
onBlur,
|
|
13
|
-
onKeyDown,
|
|
14
|
-
} = props;
|
|
15
|
-
|
|
16
|
-
this.onBlur = onBlur.bind(this);
|
|
17
|
-
this.onKeyDown = onKeyDown.bind(this);
|
|
18
|
-
this.onClick = this.onClick.bind(this);
|
|
19
|
-
this.setRefs = this.setRefs.bind(this);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/*
|
|
23
|
-
The button component is given focus explicitly in its onClick to account
|
|
24
|
-
for the fact that an HTML <button> element in Firefox and Safari does not get
|
|
25
|
-
focus on onClick.
|
|
26
|
-
|
|
27
|
-
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button.
|
|
28
|
-
*/
|
|
29
|
-
onClick(e) {
|
|
30
|
-
this.buttonRef.focus();
|
|
31
|
-
this.props.onClick(e);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/*
|
|
35
|
-
The button component needs a ref to itself to be able to force
|
|
36
|
-
focus in its onClick function (buttonRef). It also needs to accept
|
|
37
|
-
a callback function from parent components to give those parents
|
|
38
|
-
a reference to their child button (e.g. for the modal component).
|
|
39
|
-
Therefore, both have been wrapped in a function bound on the class,
|
|
40
|
-
since one cannot set two ref attributes on a component.
|
|
41
|
-
*/
|
|
42
|
-
setRefs(input) {
|
|
43
|
-
this.buttonRef = input;
|
|
44
|
-
this.props.inputRef(input);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
render() {
|
|
48
|
-
const {
|
|
49
|
-
buttonType,
|
|
50
|
-
className,
|
|
51
|
-
children,
|
|
52
|
-
isClose,
|
|
53
|
-
type,
|
|
54
|
-
/* inputRef is not used directly in the render, but it needs to be assigned
|
|
55
|
-
here to prevent it from being passed to the HTML button component as part
|
|
56
|
-
of other.
|
|
57
|
-
*/
|
|
58
|
-
inputRef,
|
|
59
|
-
...other
|
|
60
|
-
} = this.props;
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<button
|
|
64
|
-
{...other}
|
|
65
|
-
className={classNames([
|
|
66
|
-
'btn',
|
|
67
|
-
className,
|
|
68
|
-
], {
|
|
69
|
-
[`btn-${buttonType}`]: buttonType !== undefined,
|
|
70
|
-
}, {
|
|
71
|
-
close: isClose,
|
|
72
|
-
})}
|
|
73
|
-
onBlur={this.onBlur}
|
|
74
|
-
onClick={this.onClick}
|
|
75
|
-
onKeyDown={this.onKeyDown}
|
|
76
|
-
// eslint-disable-next-line react/button-has-type
|
|
77
|
-
type={type}
|
|
78
|
-
ref={this.setRefs}
|
|
79
|
-
|
|
80
|
-
>
|
|
81
|
-
{children}
|
|
82
|
-
</button>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export const buttonPropTypes = {
|
|
88
|
-
/** Used to determine the type of button to be rendered. See [Bootstrap's buttons documentation](https://getbootstrap.com/docs/4.0/components/buttons/) for a list of applicable button types. For example, `buttonType="light"`. The default is `undefined`. */
|
|
89
|
-
buttonType: PropTypes.string,
|
|
90
|
-
/** Specifies Bootstrap class names to apply to the button. See [Bootstrap's buttons documentation](https://getbootstrap.com/docs/4.0/components/buttons/) for a list of applicable class names. The default is an empty array. */
|
|
91
|
-
className: PropTypes.string,
|
|
92
|
-
/** Specifies the text that is displayed within the button. */
|
|
93
|
-
children: PropTypes.node.isRequired,
|
|
94
|
-
// eslint-disable-next-line max-len
|
|
95
|
-
/** A function that defines a reference for the button. An example `inputRef` from the calling component could look something like: `inputRef={(input) => { this.button = input; }}`. The default is an empty function. */
|
|
96
|
-
inputRef: PropTypes.oneOfType([
|
|
97
|
-
PropTypes.func,
|
|
98
|
-
PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),
|
|
99
|
-
]),
|
|
100
|
-
/** Used to determine if the button is a "Close" style button to leverage bootstrap styling. Example use case is with the Status Alert [dismiss button](https://getbootstrap.com/docs/4.0/components/alerts/#dismissing). The default is false. */
|
|
101
|
-
isClose: PropTypes.bool,
|
|
102
|
-
// eslint-disable-next-line max-len
|
|
103
|
-
/** A function that would specify what the button should do when the `onBlur` event is triggered. For example, the button could change in color or `buttonType` when focus is changed. The default is an empty function. */
|
|
104
|
-
onBlur: PropTypes.func,
|
|
105
|
-
// eslint-disable-next-line max-len
|
|
106
|
-
/** A function that would specify what the button should do when the `onClick` event is triggered. For example, the button could launch a `Modal`. The default is an empty function. */
|
|
107
|
-
onClick: PropTypes.func,
|
|
108
|
-
// eslint-disable-next-line max-len
|
|
109
|
-
/** A function that would specify what the button should do when the `onKeyDown` event is triggered. For example, this could handle using the `Escape` key to trigger the button's action. The default is an empty function. */
|
|
110
|
-
onKeyDown: PropTypes.func,
|
|
111
|
-
/** Used to set the `type` attribute on the `button` tag. The default type is `button`. */
|
|
112
|
-
type: PropTypes.string,
|
|
113
|
-
/** Specifies variant to use. */
|
|
114
|
-
variant: PropTypes.oneOf([
|
|
115
|
-
'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light', 'link', 'outline-primary',
|
|
116
|
-
'outline-secondary', 'outline-success', 'outline-danger', 'outline-warning', 'outline-info', 'outline-dark', 'outline-light',
|
|
117
|
-
]),
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
DeprecatedButton.propTypes = buttonPropTypes;
|
|
121
|
-
|
|
122
|
-
DeprecatedButton.defaultProps = {
|
|
123
|
-
buttonType: undefined,
|
|
124
|
-
className: undefined,
|
|
125
|
-
inputRef: () => {},
|
|
126
|
-
isClose: false,
|
|
127
|
-
onBlur: () => {},
|
|
128
|
-
onKeyDown: () => {},
|
|
129
|
-
onClick: () => {},
|
|
130
|
-
type: 'button',
|
|
131
|
-
variant: 'outline-primary',
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export default withDeprecatedProps(DeprecatedButton, 'Button', {
|
|
135
|
-
label: {
|
|
136
|
-
deprType: DeprTypes.MOVED,
|
|
137
|
-
newName: 'children',
|
|
138
|
-
},
|
|
139
|
-
className: {
|
|
140
|
-
deprType: DeprTypes.FORMAT,
|
|
141
|
-
expect: value => typeof value === 'string',
|
|
142
|
-
transform: value => (Array.isArray(value) ? value.join(' ') : value),
|
|
143
|
-
message: 'It should be a string.',
|
|
144
|
-
},
|
|
145
|
-
});
|
package/src/Button/index.tsx
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes, { type Requireable } from 'prop-types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import BaseButton, { type ButtonProps as BaseButtonProps } from 'react-bootstrap/Button';
|
|
5
|
-
import BaseButtonGroup, { type ButtonGroupProps as BaseButtonGroupProps } from 'react-bootstrap/ButtonGroup';
|
|
6
|
-
import BaseButtonToolbar, { type ButtonToolbarProps } from 'react-bootstrap/ButtonToolbar';
|
|
7
|
-
import type { ComponentWithAsProp } from '../utils/types/bootstrap';
|
|
8
|
-
// @ts-ignore - we're not going to bother adding types for the deprecated button
|
|
9
|
-
import ButtonDeprecated from './deprecated';
|
|
10
|
-
|
|
11
|
-
import Icon from '../Icon';
|
|
12
|
-
|
|
13
|
-
interface ButtonProps extends Omit<BaseButtonProps, 'size'> {
|
|
14
|
-
/**
|
|
15
|
-
* An icon component to render. Example:
|
|
16
|
-
* ```
|
|
17
|
-
* import { Close } from '@openedx/paragon/icons';
|
|
18
|
-
* <Button iconBefore={Close}>Close</Button>
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
iconBefore?: React.ComponentType;
|
|
22
|
-
/**
|
|
23
|
-
* An icon component to render. Example:
|
|
24
|
-
* ```
|
|
25
|
-
* import { Close } from '@openedx/paragon/icons';
|
|
26
|
-
* <Button iconAfter={Close}>Close</Button>
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
iconAfter?: React.ComponentType;
|
|
30
|
-
size?: 'sm' | 'md' | 'lg' | 'inline';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
type ButtonType = ComponentWithAsProp<'button', ButtonProps> & { Deprecated?: any };
|
|
34
|
-
|
|
35
|
-
const Button: ButtonType = React.forwardRef<HTMLButtonElement, ButtonProps>(({
|
|
36
|
-
children,
|
|
37
|
-
iconAfter,
|
|
38
|
-
iconBefore,
|
|
39
|
-
size,
|
|
40
|
-
...props
|
|
41
|
-
}, ref) => (
|
|
42
|
-
<BaseButton
|
|
43
|
-
size={size as 'sm' | 'lg' | undefined} // Bootstrap's <Button> types do not allow 'md' or 'inline', but we do.
|
|
44
|
-
{...props}
|
|
45
|
-
className={classNames(props.className)}
|
|
46
|
-
ref={ref}
|
|
47
|
-
>
|
|
48
|
-
{iconBefore && <Icon className="btn-icon-before" size={size} src={iconBefore} />}
|
|
49
|
-
{children}
|
|
50
|
-
{iconAfter && <Icon className="btn-icon-after" size={size} src={iconAfter} />}
|
|
51
|
-
</BaseButton>
|
|
52
|
-
));
|
|
53
|
-
|
|
54
|
-
Button.propTypes = {
|
|
55
|
-
/** Specifies class name to apply to the button */
|
|
56
|
-
className: PropTypes.string,
|
|
57
|
-
/** Disables the Button, preventing mouse events, even if the underlying component is an `<a>` element */
|
|
58
|
-
disabled: PropTypes.bool,
|
|
59
|
-
/** Specifies the text that is displayed within the button. */
|
|
60
|
-
children: PropTypes.node.isRequired,
|
|
61
|
-
/** A function that would specify what the button should do when the `onClick` event is triggered.
|
|
62
|
-
* For example, the button could launch a `Modal`. The default is an empty function. */
|
|
63
|
-
onClick: PropTypes.func,
|
|
64
|
-
/** A function that would specify what the button should do when the `onKeyDown` event is triggered.
|
|
65
|
-
* For example, this could handle using the `Escape` key to trigger the button's action.
|
|
66
|
-
* The default is an empty function. */
|
|
67
|
-
onKeyDown: PropTypes.func,
|
|
68
|
-
/** Used to set the `type` attribute on the `button` tag. The default type is `button`. */
|
|
69
|
-
type: PropTypes.string,
|
|
70
|
-
/** Specifies variant to use.
|
|
71
|
-
* Can be on of the base variants: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `dark`,
|
|
72
|
-
* `light`, `link`
|
|
73
|
-
*
|
|
74
|
-
* as well as one of the customized variants (= base variant prefixed with `inverse-`, `outline-`
|
|
75
|
-
* or `inverse-outline-`)
|
|
76
|
-
* */
|
|
77
|
-
variant: PropTypes.string,
|
|
78
|
-
/** An icon component to render.
|
|
79
|
-
* Example import of a Paragon icon component: `import { Check } from '@openedx/paragon/icons';` */
|
|
80
|
-
iconBefore: PropTypes.elementType as Requireable<React.ComponentType>,
|
|
81
|
-
/** An icon component to render.
|
|
82
|
-
* Example import of a Paragon icon component: `import { Check } from '@openedx/paragon/icons';` */
|
|
83
|
-
iconAfter: PropTypes.elementType as Requireable<React.ComponentType>,
|
|
84
|
-
// The 'as' type casting above is required for TypeScript checking, because the 'PropTypes.elementType' type normally
|
|
85
|
-
// allows strings as a value (for use cases like 'div') but we don't support that for <Icon />/iconBefore/iconAfter.
|
|
86
|
-
// The React TypeScript type definitions are more specific (React.ComponentType vs React.ElementType).
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
Button.defaultProps = {
|
|
90
|
-
...Button.defaultProps,
|
|
91
|
-
children: undefined,
|
|
92
|
-
className: undefined,
|
|
93
|
-
iconBefore: undefined,
|
|
94
|
-
iconAfter: undefined,
|
|
95
|
-
disabled: false,
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
Button.Deprecated = ButtonDeprecated;
|
|
99
|
-
|
|
100
|
-
// We could just re-export 'ButtonGroup' and 'ButtonToolbar', but we currently
|
|
101
|
-
// override them to add propTypes validation at runtime, since most Paragon
|
|
102
|
-
// consumers aren't using TypeScript yet. We also force ButtonGroup's 'size'
|
|
103
|
-
// prop to accept our custom values of 'md' and 'inline' which are used in
|
|
104
|
-
// Paragon but not used in the base Bootstrap classes.
|
|
105
|
-
|
|
106
|
-
interface ButtonGroupProps extends Omit<BaseButtonGroupProps, 'size'> {
|
|
107
|
-
size?: 'sm' | 'md' | 'lg' | 'inline';
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const ButtonGroup: ComponentWithAsProp<'div', ButtonGroupProps> = (
|
|
111
|
-
React.forwardRef<HTMLButtonElement, ButtonGroupProps>(({ size, ...props }, ref) => (
|
|
112
|
-
<BaseButtonGroup size={size as 'sm' | 'lg'} {...props} ref={ref} />
|
|
113
|
-
))
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
ButtonGroup.propTypes = {
|
|
117
|
-
/** Specifies element type for this component. */
|
|
118
|
-
as: PropTypes.elementType,
|
|
119
|
-
/** An ARIA role describing the button group. */
|
|
120
|
-
role: PropTypes.string,
|
|
121
|
-
/** Specifies the size for all Buttons in the group. */
|
|
122
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg', 'inline']),
|
|
123
|
-
/** Display as a button toggle group. */
|
|
124
|
-
toggle: PropTypes.bool,
|
|
125
|
-
/** Specifies if the set of Buttons should appear vertically stacked. */
|
|
126
|
-
vertical: PropTypes.bool,
|
|
127
|
-
/** Overrides underlying component base CSS class name */
|
|
128
|
-
bsPrefix: PropTypes.string,
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
ButtonGroup.defaultProps = {
|
|
132
|
-
as: 'div',
|
|
133
|
-
role: 'group',
|
|
134
|
-
toggle: false,
|
|
135
|
-
vertical: false,
|
|
136
|
-
bsPrefix: 'btn-group',
|
|
137
|
-
size: 'md',
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
const ButtonToolbar: ComponentWithAsProp<'div', ButtonToolbarProps> = (
|
|
141
|
-
React.forwardRef<HTMLButtonElement, ButtonToolbarProps>((props, ref) => (
|
|
142
|
-
<BaseButtonToolbar {...props} ref={ref} />
|
|
143
|
-
))
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
ButtonToolbar.propTypes = {
|
|
147
|
-
/** An ARIA role describing the button group. */
|
|
148
|
-
role: PropTypes.string,
|
|
149
|
-
/** Overrides underlying component base CSS class name */
|
|
150
|
-
bsPrefix: PropTypes.string,
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
ButtonToolbar.defaultProps = {
|
|
154
|
-
role: 'toolbar',
|
|
155
|
-
bsPrefix: 'btn-toolbar',
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export default Button;
|
|
159
|
-
export { ButtonGroup, ButtonToolbar };
|
package/src/Card/_variables.scss
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// Card
|
|
2
|
-
|
|
3
|
-
$card-spacer-y: .75rem !default;
|
|
4
|
-
$card-spacer-x: 1.25rem !default;
|
|
5
|
-
$card-border-width: $border-width !default;
|
|
6
|
-
$card-border-radius: $border-radius !default;
|
|
7
|
-
$card-border-color: rgba($black, .125) !default;
|
|
8
|
-
$card-border-focus-color: $primary-500 !default;
|
|
9
|
-
$card-border-focus-color-dark: theme-color("primary", "focus") !default;
|
|
10
|
-
$card-inner-border-radius: subtract($card-border-radius, $card-border-width) !default;
|
|
11
|
-
$card-cap-bg: rgba($black, .03) !default;
|
|
12
|
-
$card-cap-color: null !default;
|
|
13
|
-
$card-height: null !default;
|
|
14
|
-
$card-color: null !default;
|
|
15
|
-
$card-bg: $white !default;
|
|
16
|
-
$card-bg-dark: $primary-500 !default;
|
|
17
|
-
$card-bg-muted: $light-200 !default;
|
|
18
|
-
|
|
19
|
-
$card-img-overlay-padding: 1.25rem !default;
|
|
20
|
-
|
|
21
|
-
$card-group-margin: calc($grid-gutter-width / 2) !default;
|
|
22
|
-
$card-deck-margin: $card-group-margin !default;
|
|
23
|
-
$card-grid-margin: $card-group-margin !default;
|
|
24
|
-
$card-deck-margin-bottom: map_get($spacers, 3) !default;
|
|
25
|
-
$card-grid-margin-bottom: map_get($spacers, 3) !default;
|
|
26
|
-
|
|
27
|
-
$card-columns-count: 3 !default;
|
|
28
|
-
$card-columns-gap: 1.25rem !default;
|
|
29
|
-
$card-columns-margin: $card-spacer-y !default;
|
|
30
|
-
|
|
31
|
-
$card-divider-bg: $light-400 !default;
|
|
32
|
-
|
|
33
|
-
$card-footer-actions-gap: .5rem !default;
|
|
34
|
-
|
|
35
|
-
$card-logo-left-offset: 1.5rem !default;
|
|
36
|
-
$card-logo-bottom-offset: 1rem !default;
|
|
37
|
-
$card-logo-left-offset-horizontal: .4375rem !default;
|
|
38
|
-
$card-logo-bottom-offset-horizontal: .4375rem !default;
|
|
39
|
-
|
|
40
|
-
$card-logo-width: 7.25rem !default;
|
|
41
|
-
$card-logo-height: 4.125rem !default;
|
|
42
|
-
|
|
43
|
-
$card-image-border-radius: $card-border-radius !default;
|
|
44
|
-
$card-logo-border-radius: .25rem !default;
|
|
45
|
-
|
|
46
|
-
$card-footer-text-font-size: $x-small-font-size;
|
|
47
|
-
|
|
48
|
-
$card-image-horizontal-max-width: 240px !default;
|
|
49
|
-
$card-image-horizontal-min-width: $card-image-horizontal-max-width !default;
|
|
50
|
-
$card-image-vertical-max-height: 140px !default;
|
|
51
|
-
$loading-skeleton-spacer: .313rem !default;
|
|
52
|
-
|
|
53
|
-
$card-focus-border-offset: 5px !default;
|
|
54
|
-
$card-focus-border-width: 2px !default;
|
|
55
|
-
$card-focus-border-radius: calc($card-focus-border-offset + $card-border-radius) !default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Carousel
|
|
2
|
-
|
|
3
|
-
$carousel-control-color: $white !default;
|
|
4
|
-
$carousel-control-width: 15% !default;
|
|
5
|
-
$carousel-control-opacity: .5 !default;
|
|
6
|
-
$carousel-control-hover-opacity: .9 !default;
|
|
7
|
-
$carousel-control-transition: opacity .15s ease !default;
|
|
8
|
-
|
|
9
|
-
$carousel-indicator-width: 30px !default;
|
|
10
|
-
$carousel-indicator-height: 3px !default;
|
|
11
|
-
$carousel-indicator-hit-area-height: 10px !default;
|
|
12
|
-
$carousel-indicator-spacer: 3px !default;
|
|
13
|
-
$carousel-indicator-active-bg: $white !default;
|
|
14
|
-
$carousel-indicator-transition: opacity .6s ease !default;
|
|
15
|
-
|
|
16
|
-
$carousel-caption-width: 70% !default;
|
|
17
|
-
$carousel-caption-color: $white !default;
|
|
18
|
-
|
|
19
|
-
$carousel-control-icon-width: 20px !default;
|
|
20
|
-
|
|
21
|
-
$carousel-control-prev-icon-bg: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3e%3c/svg%3e"), "#", "%23") !default;
|
|
22
|
-
$carousel-control-next-icon-bg: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3e%3c/svg%3e"), "#", "%23") !default;
|
|
23
|
-
|
|
24
|
-
$carousel-transition-duration: .6s !default;
|
|
25
|
-
|
|
26
|
-
// Define transform transition first if using multiple transitions (e.g., `transform 2s ease, opacity .5s ease-out`)
|
|
27
|
-
$carousel-transition: transform $carousel-transition-duration ease-in-out !default;
|