@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/src/Tabs/_variables.scss
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
$tab-notification-height: 1rem !default;
|
|
2
|
-
$tab-notification-width: 1rem !default;
|
|
3
|
-
$tab-notification-font-size: $font-size-xs !default;
|
|
4
|
-
$tab-more-link-dropdown-toggle-padding-x: .7rem !default;
|
|
5
|
-
$tab-more-link-dropdown-toggle-padding-y: $spacer !default;
|
|
6
|
-
$tab-more-link-dropdown-toggle-focus-bg: $primary-500 !default;
|
|
7
|
-
$tab-more-link-dropdown-toggle-focus-border-color: $tab-more-link-dropdown-toggle-focus-bg !default;
|
|
8
|
-
$tab-more-link-dropdown-toggle-focus-color: $white !default;
|
|
9
|
-
$tab-more-link-dropdown-toggle-btn-focus-color: $tab-more-link-dropdown-toggle-focus-color !default;
|
|
10
|
-
$tab-more-link-dropdown-toggle-btn-focus-border-color: $tab-more-link-dropdown-toggle-focus-bg !default;
|
|
11
|
-
$tab-more-link-dropdown-toggle-active-color: $tab-more-link-dropdown-toggle-focus-color !default;
|
|
12
|
-
$tab-more-link-dropdown-toggle-hover-color: $tab-more-link-dropdown-toggle-focus-bg !default;
|
|
13
|
-
$tab-inverse-pills-link-dropdown-toggle-padding-x: .625rem !default;
|
|
14
|
-
$tab-inverse-pills-link-dropdown-toggle-padding-y: $spacer !default;
|
|
15
|
-
$tab-inverse-pills-link-dropdown-toggle-focus-bg: $white !default;
|
|
16
|
-
$tab-inverse-pills-link-dropdown-toggle-focus-color: $primary-500 !default;
|
|
17
|
-
$tab-inverse-pills-link-dropdown-toggle-focus-border-color: $tab-inverse-pills-link-dropdown-toggle-focus-bg !default;
|
|
18
|
-
$tab-inverse-pills-link-dropdown-toggle-active-color: $tab-inverse-pills-link-dropdown-toggle-focus-color !default;
|
|
19
|
-
$tab-inverse-pills-link-dropdown-toggle-active-hover-color: $tab-inverse-pills-link-dropdown-toggle-focus-bg !default;
|
|
20
|
-
$tab-inverse-pills-link-dropdown-toggle-active-hover-bg: $primary-300 !default;
|
|
21
|
-
$tab-inverse-pills-link-dropdown-distance: 5px !default;
|
|
22
|
-
$tab-inverse-tabs-link-dropdown-toggle-padding-x: .625rem !default;
|
|
23
|
-
$tab-inverse-tabs-link-dropdown-toggle-padding-y: $spacer !default;
|
|
24
|
-
$tab-inverse-tabs-link-dropdown-toggle-hover-bg: transparent !default;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
|
|
5
|
-
import Tabs from '.';
|
|
6
|
-
|
|
7
|
-
const props = {
|
|
8
|
-
labels: [
|
|
9
|
-
'first',
|
|
10
|
-
'second',
|
|
11
|
-
'third',
|
|
12
|
-
],
|
|
13
|
-
children: [
|
|
14
|
-
<div key="first">first</div>,
|
|
15
|
-
<div key="second">second</div>,
|
|
16
|
-
<div key="third">third</div>,
|
|
17
|
-
],
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const tabSelectedAtIndex = (index, container) => {
|
|
21
|
-
const tabButtons = container.querySelectorAll('button');
|
|
22
|
-
const tabPanes = container.querySelectorAll('.tab-pane');
|
|
23
|
-
|
|
24
|
-
tabButtons.forEach((node, i) => {
|
|
25
|
-
expect(node.getAttribute('aria-selected')).toEqual(i === index ? 'true' : 'false');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
tabPanes.forEach((node, i) => {
|
|
29
|
-
expect(node.classList.contains('active')).toEqual(i === index);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
describe('<Tabs />', () => {
|
|
34
|
-
it('renders with first tab selected', () => {
|
|
35
|
-
const { container } = render(<Tabs {...props} />);
|
|
36
|
-
tabSelectedAtIndex(0, container);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe('switches tab selection', () => {
|
|
40
|
-
it('on click', () => {
|
|
41
|
-
const { container } = render(<Tabs {...props} />);
|
|
42
|
-
const tabButtons = container.querySelectorAll('button');
|
|
43
|
-
|
|
44
|
-
tabButtons.forEach((node, i) => {
|
|
45
|
-
userEvent.click(node);
|
|
46
|
-
tabSelectedAtIndex(i, container);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// TODO: @jaebradley fix these eslint errors
|
|
2
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
4
|
-
/* eslint-disable max-len */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
|
|
9
|
-
import newId from '../../utils/newId';
|
|
10
|
-
|
|
11
|
-
class Tabs extends React.Component {
|
|
12
|
-
constructor(props) {
|
|
13
|
-
super(props);
|
|
14
|
-
|
|
15
|
-
this.toggle = this.toggle.bind(this);
|
|
16
|
-
this.state = {
|
|
17
|
-
activeTab: 0,
|
|
18
|
-
uuid: newId('tabInterface'),
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
toggle(tab) {
|
|
23
|
-
if (this.state.activeTab !== tab) {
|
|
24
|
-
this.setState({
|
|
25
|
-
activeTab: tab,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
genLabelId(index) {
|
|
31
|
-
return `tab-label-${this.state.uuid}-${index}`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
genPanelId(index) {
|
|
35
|
-
return `tab-panel-${this.state.uuid}-${index}`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
buildLabels() {
|
|
39
|
-
return this.props.labels.map((label, i) => {
|
|
40
|
-
const selected = this.state.activeTab === i;
|
|
41
|
-
const labelId = this.genLabelId(i);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<li key={labelId}>
|
|
45
|
-
{/* eslint-disable-next-line react/button-has-type */}
|
|
46
|
-
<button
|
|
47
|
-
role="tab"
|
|
48
|
-
aria-selected={selected}
|
|
49
|
-
aria-controls={this.genPanelId(i)}
|
|
50
|
-
id={labelId}
|
|
51
|
-
onClick={() => { this.toggle(i); }}
|
|
52
|
-
className={classNames('nav-link nav-item', {
|
|
53
|
-
active: selected,
|
|
54
|
-
})}
|
|
55
|
-
>
|
|
56
|
-
{label}
|
|
57
|
-
</button>
|
|
58
|
-
</li>
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
buildPanels() {
|
|
64
|
-
return this.props.children.map((panel, i) => {
|
|
65
|
-
const selected = this.state.activeTab === i;
|
|
66
|
-
const panelId = this.genPanelId(i);
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<div
|
|
70
|
-
aria-hidden={!selected}
|
|
71
|
-
aria-labelledby={this.genLabelId(i)}
|
|
72
|
-
className={classNames(
|
|
73
|
-
'tab-pane',
|
|
74
|
-
{ active: selected },
|
|
75
|
-
)}
|
|
76
|
-
id={panelId}
|
|
77
|
-
key={panelId}
|
|
78
|
-
role="tabpanel"
|
|
79
|
-
>
|
|
80
|
-
{panel}
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
render() {
|
|
87
|
-
const labels = this.buildLabels();
|
|
88
|
-
const panels = this.buildPanels();
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<div className="tabs">
|
|
92
|
-
<ul
|
|
93
|
-
role="tablist"
|
|
94
|
-
className={classNames([
|
|
95
|
-
'nav',
|
|
96
|
-
'nav-tabs',
|
|
97
|
-
])}
|
|
98
|
-
>
|
|
99
|
-
{labels}
|
|
100
|
-
</ul>
|
|
101
|
-
<div role="tabpanel" className="tab-content">
|
|
102
|
-
{panels}
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// TODO: custom validator that ensures labels and panels are the same length
|
|
109
|
-
Tabs.propTypes = {
|
|
110
|
-
/** specifies the list of elements that will be displayed within each of the tabbed views. It is the content relevant to each label. Children should not be passed as Props, but should instead be nested between the opening and closing `<Tabs> </Tabs>` tags. */
|
|
111
|
-
labels: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
112
|
-
/** specifies the list of headings that will appear on all of the tabs that will be created.
|
|
113
|
-
*/
|
|
114
|
-
children: PropTypes.arrayOf(PropTypes.element).isRequired,
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export default Tabs;
|
package/src/TextArea/README.md
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'TextArea'
|
|
3
|
-
type: 'component'
|
|
4
|
-
components:
|
|
5
|
-
- TextArea
|
|
6
|
-
categories:
|
|
7
|
-
- Forms (deprecated)
|
|
8
|
-
status: 'Deprecate Soon'
|
|
9
|
-
designStatus: 'TBD'
|
|
10
|
-
devStatus: 'To Do'
|
|
11
|
-
notes: |
|
|
12
|
-
Replaced by Form.Control
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Minimal usage
|
|
16
|
-
|
|
17
|
-
```jsx live
|
|
18
|
-
<TextArea
|
|
19
|
-
name="name"
|
|
20
|
-
label="First Name"
|
|
21
|
-
value="Foo Bar"
|
|
22
|
-
/>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Scrollable
|
|
26
|
-
|
|
27
|
-
```jsx live
|
|
28
|
-
<TextArea
|
|
29
|
-
name="name"
|
|
30
|
-
label="Information"
|
|
31
|
-
value="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
32
|
-
/>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Validation
|
|
36
|
-
|
|
37
|
-
```jsx live
|
|
38
|
-
<TextArea
|
|
39
|
-
name="username"
|
|
40
|
-
label="Username"
|
|
41
|
-
description="The unique name that identifies you throughout the site."
|
|
42
|
-
validator={value => {
|
|
43
|
-
let feedback = { isValid: true };
|
|
44
|
-
if (value.length < 3) {
|
|
45
|
-
feedback = {
|
|
46
|
-
isValid: false,
|
|
47
|
-
validationMessage: 'Username must be at least 3 characters in length.',
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
return feedback;
|
|
51
|
-
}}
|
|
52
|
-
/>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Label as element
|
|
56
|
-
|
|
57
|
-
```jsx live
|
|
58
|
-
<TextArea
|
|
59
|
-
name="username"
|
|
60
|
-
label={<span lang="en">Element</span>}
|
|
61
|
-
value="Label is wrapped in language span"
|
|
62
|
-
/>
|
|
63
|
-
```
|
package/src/TextArea/index.jsx
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import asInput from '../asInput';
|
|
6
|
-
import withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';
|
|
7
|
-
|
|
8
|
-
function Text(props) {
|
|
9
|
-
const {
|
|
10
|
-
className,
|
|
11
|
-
inputRef,
|
|
12
|
-
...others
|
|
13
|
-
} = props;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<textarea
|
|
17
|
-
{...others}
|
|
18
|
-
className={className}
|
|
19
|
-
ref={inputRef}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Text.propTypes = {
|
|
25
|
-
className: PropTypes.string,
|
|
26
|
-
/** specifies all of the properties that are necessary from the included `asInput` component. Please see details for input requirements within that component.
|
|
27
|
-
*/
|
|
28
|
-
inputRef: PropTypes.oneOfType([
|
|
29
|
-
PropTypes.func,
|
|
30
|
-
PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),
|
|
31
|
-
]),
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
Text.defaultProps = {
|
|
35
|
-
className: undefined,
|
|
36
|
-
inputRef: undefined,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const TextArea = asInput(withDeprecatedProps(Text, 'TextArea', {
|
|
40
|
-
className: {
|
|
41
|
-
deprType: DeprTypes.FORMAT,
|
|
42
|
-
expect: value => typeof value === 'string',
|
|
43
|
-
transform: value => (Array.isArray(value) ? value.join(' ') : value),
|
|
44
|
-
message: 'It should be a string.',
|
|
45
|
-
},
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
export default TextArea;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Toasts
|
|
2
|
-
|
|
3
|
-
$toast-max-width: 400px !default;
|
|
4
|
-
$toast-padding-x: .75rem !default;
|
|
5
|
-
$toast-padding-y: .25rem !default;
|
|
6
|
-
$toast-font-size: .875rem !default;
|
|
7
|
-
$toast-color: null !default;
|
|
8
|
-
$toast-background-color: $gray-700 !default;
|
|
9
|
-
$toast-border-width: 1px !default;
|
|
10
|
-
$toast-border-color: rgba(0, 0, 0, .1) !default;
|
|
11
|
-
$toast-border-radius: .25rem !default;
|
|
12
|
-
$toast-box-shadow: 0 1.25rem 2.5rem rgba($black, .15), 0 .5rem 3rem rgba($black, .15) !default;
|
|
13
|
-
|
|
14
|
-
$toast-header-color: $white !default;
|
|
15
|
-
$toast-header-background-color: $gray-700 !default;
|
|
16
|
-
$toast-header-border-color: rgba(0, 0, 0, .5) !default;
|
|
17
|
-
|
|
18
|
-
$toast-container-gutter-lg: 1.25rem !default;
|
|
19
|
-
$toast-container-gutter-sm: .625rem !default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Tooltips
|
|
2
|
-
|
|
3
|
-
$tooltip-font-size: $font-size-sm !default;
|
|
4
|
-
$tooltip-max-width: 200px !default;
|
|
5
|
-
$tooltip-color: $white !default;
|
|
6
|
-
$tooltip-bg: $black !default;
|
|
7
|
-
$tooltip-border-radius: $border-radius !default;
|
|
8
|
-
$tooltip-opacity: 1 !default;
|
|
9
|
-
$tooltip-padding-y: .5rem !default;
|
|
10
|
-
$tooltip-padding-x: .5rem !default;
|
|
11
|
-
$tooltip-margin: 0 !default;
|
|
12
|
-
$tooltip-box-shadow: drop-shadow(0 2px 4px rgba(0, 0, 0, .15))
|
|
13
|
-
drop-shadow(0 2px 8px rgba(0, 0, 0, .15)) !default;
|
|
14
|
-
|
|
15
|
-
$tooltip-arrow-width: .8rem !default;
|
|
16
|
-
$tooltip-arrow-height: .4rem !default;
|
|
17
|
-
$tooltip-arrow-color: $tooltip-bg !default;
|
|
18
|
-
|
|
19
|
-
$tooltip-color-light: $black !default;
|
|
20
|
-
$tooltip-bg-light: $white !default;
|
|
21
|
-
$tooltip-arrow-color-light: $white !default;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'ValidationFormGroup'
|
|
3
|
-
type: 'component'
|
|
4
|
-
components:
|
|
5
|
-
- ValidationFormGroup
|
|
6
|
-
categories:
|
|
7
|
-
- Forms (deprecated)
|
|
8
|
-
status: 'Deprecate Soon'
|
|
9
|
-
designStatus: 'Done'
|
|
10
|
-
devStatus: 'Done'
|
|
11
|
-
notes: |
|
|
12
|
-
Replaced by Form.Group
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
Handles bootstrap style field validation and handles related aria attributes.
|
|
16
|
-
|
|
17
|
-
Manages the rendering of bootstrap-style:
|
|
18
|
-
|
|
19
|
-
- Help text
|
|
20
|
-
- Valid and invalid feedback
|
|
21
|
-
|
|
22
|
-
For children of type input, textarea, and select:
|
|
23
|
-
|
|
24
|
-
- Appends bootstrap validation class names
|
|
25
|
-
- Appends aria-describedby attributes (for help text and feedback)
|
|
26
|
-
|
|
27
|
-
## basic usage
|
|
28
|
-
|
|
29
|
-
```jsx live
|
|
30
|
-
<ValidationFormGroup
|
|
31
|
-
for="firstName"
|
|
32
|
-
helpText="This is your name."
|
|
33
|
-
>
|
|
34
|
-
<label htmlFor="firstName">First Name</label>
|
|
35
|
-
<Input
|
|
36
|
-
type="text"
|
|
37
|
-
id="firstName"
|
|
38
|
-
name="first-name"
|
|
39
|
-
value="Casey"
|
|
40
|
-
onChange={() => {}}
|
|
41
|
-
/>
|
|
42
|
-
</ValidationFormGroup>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## invalid message
|
|
46
|
-
|
|
47
|
-
```jsx live
|
|
48
|
-
<ValidationFormGroup
|
|
49
|
-
for="firstName"
|
|
50
|
-
invalid
|
|
51
|
-
invalidMessage="Wrong!"
|
|
52
|
-
>
|
|
53
|
-
<label htmlFor="firstName">First Name</label>
|
|
54
|
-
<Input
|
|
55
|
-
type="text"
|
|
56
|
-
id="firstName"
|
|
57
|
-
name="first-name"
|
|
58
|
-
value="Casey"
|
|
59
|
-
onChange={() => {}}
|
|
60
|
-
/>
|
|
61
|
-
</ValidationFormGroup>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## valid message
|
|
65
|
-
|
|
66
|
-
```jsx live
|
|
67
|
-
<ValidationFormGroup
|
|
68
|
-
for="firstName"
|
|
69
|
-
valid
|
|
70
|
-
validMessage="What a nice name!"
|
|
71
|
-
>
|
|
72
|
-
<label htmlFor="firstName">First Name</label>
|
|
73
|
-
<Input
|
|
74
|
-
type="text"
|
|
75
|
-
id="firstName"
|
|
76
|
-
name="first-name"
|
|
77
|
-
value="Casey"
|
|
78
|
-
onChange={() => {}}
|
|
79
|
-
/>
|
|
80
|
-
</ValidationFormGroup>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## with any kind of input
|
|
84
|
-
|
|
85
|
-
```jsx live
|
|
86
|
-
<>
|
|
87
|
-
<ValidationFormGroup
|
|
88
|
-
for="weatherToday"
|
|
89
|
-
helpText="Look out the window to see."
|
|
90
|
-
valid
|
|
91
|
-
validMessage="Correct!"
|
|
92
|
-
>
|
|
93
|
-
<label htmlFor="weatherToday">How is the weather today?</label>
|
|
94
|
-
<select
|
|
95
|
-
className="form-control"
|
|
96
|
-
id="weatherToday"
|
|
97
|
-
name="weather"
|
|
98
|
-
value="Sunny"
|
|
99
|
-
onChange={() => {}}
|
|
100
|
-
>
|
|
101
|
-
<option>Sunny</option>
|
|
102
|
-
<option>Cloudy</option>
|
|
103
|
-
<option>Rainy</option>
|
|
104
|
-
<option>Snowy</option>
|
|
105
|
-
</select>
|
|
106
|
-
</ValidationFormGroup>
|
|
107
|
-
<ValidationFormGroup
|
|
108
|
-
for="weatherTomorrow"
|
|
109
|
-
helpText="Incoming weather."
|
|
110
|
-
invalid
|
|
111
|
-
invalidMessage="No good!"
|
|
112
|
-
>
|
|
113
|
-
<Form.Control type='text' value='Cloudy' />
|
|
114
|
-
</ValidationFormGroup>
|
|
115
|
-
</>
|
|
116
|
-
```
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import renderer from 'react-test-renderer';
|
|
3
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
-
|
|
5
|
-
import Input from '../Input';
|
|
6
|
-
import { FormControl, Form } from '..';
|
|
7
|
-
import ValidationFormGroup from '.';
|
|
8
|
-
|
|
9
|
-
describe('ValidationFormGroup', () => {
|
|
10
|
-
const labelAndInputComponents = (
|
|
11
|
-
<>
|
|
12
|
-
<label htmlFor="firstName">First Name</label>
|
|
13
|
-
<input
|
|
14
|
-
className="form-control"
|
|
15
|
-
type="text"
|
|
16
|
-
id="firstName"
|
|
17
|
-
name="first-name"
|
|
18
|
-
value="Adam"
|
|
19
|
-
onChange={() => {}}
|
|
20
|
-
/>
|
|
21
|
-
</>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
it('renders', () => {
|
|
25
|
-
const tree = renderer.create((
|
|
26
|
-
<ValidationFormGroup
|
|
27
|
-
for="firstName"
|
|
28
|
-
>
|
|
29
|
-
{labelAndInputComponents}
|
|
30
|
-
</ValidationFormGroup>
|
|
31
|
-
)).toJSON();
|
|
32
|
-
expect(tree).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('renders with help text', () => {
|
|
36
|
-
const tree = renderer.create((
|
|
37
|
-
<ValidationFormGroup
|
|
38
|
-
for="firstName"
|
|
39
|
-
helpText="This is your first name."
|
|
40
|
-
>
|
|
41
|
-
{labelAndInputComponents}
|
|
42
|
-
</ValidationFormGroup>
|
|
43
|
-
)).toJSON();
|
|
44
|
-
expect(tree).toMatchSnapshot();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('renders an invalid message', () => {
|
|
48
|
-
const tree = renderer.create((
|
|
49
|
-
<ValidationFormGroup
|
|
50
|
-
for="firstName"
|
|
51
|
-
helpText="This is your first name."
|
|
52
|
-
invalid
|
|
53
|
-
invalidMessage="This is not your name."
|
|
54
|
-
>
|
|
55
|
-
{labelAndInputComponents}
|
|
56
|
-
</ValidationFormGroup>
|
|
57
|
-
)).toJSON();
|
|
58
|
-
expect(tree).toMatchSnapshot();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('renders a valid message', () => {
|
|
62
|
-
const tree = renderer.create((
|
|
63
|
-
<ValidationFormGroup
|
|
64
|
-
for="firstName"
|
|
65
|
-
helpText="This is your first name."
|
|
66
|
-
valid
|
|
67
|
-
validMessage="What a nice name."
|
|
68
|
-
>
|
|
69
|
-
{labelAndInputComponents}
|
|
70
|
-
</ValidationFormGroup>
|
|
71
|
-
)).toJSON();
|
|
72
|
-
expect(tree).toMatchSnapshot();
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('renders an invalid message with a select input', () => {
|
|
76
|
-
const tree = renderer.create((
|
|
77
|
-
<ValidationFormGroup
|
|
78
|
-
for="weatherToday"
|
|
79
|
-
helpText="Look out the window to see."
|
|
80
|
-
valid
|
|
81
|
-
validMessage="Correct!"
|
|
82
|
-
>
|
|
83
|
-
<label htmlFor="weatherToday">How is the weather today?</label>
|
|
84
|
-
<select id="weatherToday" name="weather" value="Sunny" onChange={() => {}}>
|
|
85
|
-
<option>Sunny</option>
|
|
86
|
-
<option>Cloudy</option>
|
|
87
|
-
<option>Rainy</option>
|
|
88
|
-
<option>Snowy</option>
|
|
89
|
-
</select>
|
|
90
|
-
</ValidationFormGroup>
|
|
91
|
-
)).toJSON();
|
|
92
|
-
expect(tree).toMatchSnapshot();
|
|
93
|
-
});
|
|
94
|
-
[
|
|
95
|
-
{ Component: Input, name: 'Input' },
|
|
96
|
-
{ Component: FormControl, name: 'FormControl' },
|
|
97
|
-
{ Component: Form.Control, name: 'Form.Control' },
|
|
98
|
-
].forEach(({ Component, name }) => {
|
|
99
|
-
const formControlId = 'bestForm';
|
|
100
|
-
const formControlHelp = 'So helpful';
|
|
101
|
-
const validMessage = 'Valid feedback';
|
|
102
|
-
const invalidMessage = 'Exterminate, Exterminate';
|
|
103
|
-
|
|
104
|
-
it(`renders a ${name} child with the correct aria attributes and helptext`, () => {
|
|
105
|
-
render(
|
|
106
|
-
<ValidationFormGroup
|
|
107
|
-
for={formControlId}
|
|
108
|
-
helpText={formControlHelp}
|
|
109
|
-
validMessage={validMessage}
|
|
110
|
-
valid
|
|
111
|
-
>
|
|
112
|
-
<Component id={formControlId} />
|
|
113
|
-
</ValidationFormGroup>,
|
|
114
|
-
);
|
|
115
|
-
const component = screen.getByRole('textbox');
|
|
116
|
-
expect(component.getAttribute('aria-describedby')).toBe(`${formControlId}-help-text ${formControlId}-valid-feedback`);
|
|
117
|
-
expect(screen.getByText(formControlHelp)).toBeTruthy();
|
|
118
|
-
});
|
|
119
|
-
it(`renders a ${name} child with the correct valid message`, () => {
|
|
120
|
-
render(
|
|
121
|
-
<ValidationFormGroup
|
|
122
|
-
for={formControlId}
|
|
123
|
-
helpText={formControlHelp}
|
|
124
|
-
validMessage={validMessage}
|
|
125
|
-
valid
|
|
126
|
-
>
|
|
127
|
-
<Component id={formControlId} />
|
|
128
|
-
</ValidationFormGroup>,
|
|
129
|
-
);
|
|
130
|
-
expect(screen.getByText(validMessage)).toBeTruthy();
|
|
131
|
-
});
|
|
132
|
-
it(`renders a ${name} child with the correct invalid message`, () => {
|
|
133
|
-
render(
|
|
134
|
-
<ValidationFormGroup
|
|
135
|
-
for={formControlId}
|
|
136
|
-
helpText={formControlHelp}
|
|
137
|
-
invalidMessage={invalidMessage}
|
|
138
|
-
invalid
|
|
139
|
-
>
|
|
140
|
-
<Component id={formControlId} />
|
|
141
|
-
</ValidationFormGroup>,
|
|
142
|
-
);
|
|
143
|
-
expect(screen.getByText(invalidMessage)).toBeTruthy();
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
});
|