@nypl/design-system-react-components 0.25.0 → 0.25.4
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/CHANGELOG.md +142 -1
- package/README.md +98 -50
- package/dist/components/Accordion/Accordion.d.ts +14 -14
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +15 -14
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
- package/dist/components/Button/Button.d.ts +13 -8
- package/dist/components/Button/ButtonTypes.d.ts +3 -1
- package/dist/components/Card/Card.d.ts +36 -52
- package/dist/components/Card/CardTypes.d.ts +2 -17
- package/dist/components/Checkbox/Checkbox.d.ts +17 -13
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +45 -0
- package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +4 -0
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +15 -0
- package/dist/components/DatePicker/DatePicker.d.ts +37 -35
- package/dist/components/Fieldset/Fieldset.d.ts +25 -0
- package/dist/components/Form/Form.d.ts +13 -8
- package/dist/components/Form/FormTypes.d.ts +2 -8
- package/dist/components/Grid/GridTypes.d.ts +9 -0
- package/dist/components/Grid/SimpleGrid.d.ts +14 -0
- package/dist/components/Heading/Heading.d.ts +4 -4
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +17 -14
- package/dist/components/Hero/Hero.d.ts +19 -14
- package/dist/components/Hero/HeroTypes.d.ts +10 -5
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +10 -9
- package/dist/components/Icons/Icon.d.ts +19 -14
- package/dist/components/Icons/IconSvgs.d.ts +11 -0
- package/dist/components/Icons/IconTypes.d.ts +89 -64
- package/dist/components/Image/Image.d.ts +19 -9
- package/dist/components/Image/ImageTypes.d.ts +20 -0
- package/dist/components/Label/Label.d.ts +5 -17
- package/dist/components/Link/Link.d.ts +12 -12
- package/dist/components/List/List.d.ts +19 -14
- package/dist/components/Notification/Notification.d.ts +37 -16
- package/dist/components/Pagination/Pagination.d.ts +16 -13
- package/dist/components/Pagination/Pagination.stories.d.ts +2 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
- package/dist/components/Radio/Radio.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
- package/dist/components/SearchBar/SearchBar.d.ts +45 -27
- package/dist/components/Select/Select.d.ts +34 -35
- package/dist/components/Select/SelectTypes.d.ts +4 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +18 -14
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +2 -2
- package/dist/components/Slider/Slider.d.ts +57 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +8 -6
- package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +5 -0
- package/dist/components/StyleGuide/ColorCard.d.ts +12 -0
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Template/Template.d.ts +91 -0
- package/dist/components/Text/Text.d.ts +16 -0
- package/dist/components/Text/TextTypes.d.ts +6 -0
- package/dist/components/TextInput/TextInput.d.ts +44 -31
- package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +6 -8
- package/dist/components/VideoPlayer/VideoPlayerTypes.d.ts +2 -2
- package/dist/design-system-react-components.cjs.development.js +6473 -2630
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +6463 -2631
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/hooks/tests/useCarouselStyles.test.d.ts +1 -0
- package/dist/hooks/useCarouselStyles.d.ts +16 -0
- package/dist/hooks/useNYPLTheme.d.ts +54 -0
- package/dist/hooks/useWindowSize.d.ts +10 -0
- package/dist/index.d.ts +19 -7
- package/dist/resources.scss +180 -170
- package/dist/styles.css +1 -1
- package/dist/theme/components/accordion.d.ts +25 -0
- package/dist/theme/components/breadcrumb.d.ts +90 -0
- package/dist/theme/components/button.d.ts +39 -15
- package/dist/theme/components/card.d.ts +168 -0
- package/dist/theme/components/checkbox.d.ts +12 -8
- package/dist/theme/components/checkboxGroup.d.ts +12 -0
- package/dist/theme/components/componentWrapper.d.ts +11 -0
- package/dist/theme/components/datePicker.d.ts +16 -0
- package/dist/theme/components/fieldset.d.ts +27 -0
- package/dist/theme/components/global.d.ts +65 -0
- package/dist/theme/components/globalMixins.d.ts +23 -0
- package/dist/theme/components/heading.d.ts +55 -20
- package/dist/theme/components/helperErrorText.d.ts +10 -0
- package/dist/theme/components/hero.d.ts +493 -0
- package/dist/theme/components/horizontalRule.d.ts +14 -0
- package/dist/theme/components/icon.d.ts +13 -0
- package/dist/theme/components/image.d.ts +31 -0
- package/dist/theme/components/label.d.ts +18 -0
- package/dist/theme/components/link.d.ts +49 -0
- package/dist/theme/components/list.d.ts +89 -0
- package/dist/theme/components/notification.d.ts +75 -0
- package/dist/theme/components/pagination.d.ts +19 -0
- package/dist/theme/components/progressIndicator.d.ts +50 -0
- package/dist/theme/components/radio.d.ts +8 -7
- package/dist/theme/components/radioGroup.d.ts +12 -0
- package/dist/theme/components/searchBar.d.ts +20 -0
- package/dist/theme/components/select.d.ts +67 -0
- package/dist/theme/components/skeletonLoader.d.ts +98 -0
- package/dist/theme/components/slider.d.ts +51 -0
- package/dist/theme/components/statusBadge.d.ts +25 -0
- package/dist/theme/components/tabs.d.ts +63 -12
- package/dist/theme/components/template.d.ts +105 -0
- package/dist/theme/components/text.d.ts +20 -0
- package/dist/theme/components/textInput.d.ts +112 -0
- package/dist/theme/components/videoPlayer.d.ts +40 -0
- package/dist/theme/foundations/breakpoints.d.ts +8 -8
- package/dist/theme/foundations/global.d.ts +8 -0
- package/dist/theme/foundations/radii.d.ts +5 -0
- package/dist/theme/foundations/shadows.d.ts +4 -0
- package/dist/theme/foundations/spacing.d.ts +16 -16
- package/dist/utils/utils.d.ts +6 -0
- package/package.json +72 -82
- package/src/__tests__/setup.ts +2 -2
- package/src/components/Accordion/Accordion.stories.mdx +223 -34
- package/src/components/Accordion/Accordion.test.tsx +135 -19
- package/src/components/Accordion/Accordion.tsx +81 -56
- package/src/components/Autosuggest/Autosuggest.stories.mdx +4 -4
- package/src/components/Autosuggest/Autosuggest.stories.tsx +3 -2
- package/src/components/Autosuggest/_Autosuggest.scss +5 -5
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +48 -50
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +54 -25
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +75 -73
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +6 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +298 -0
- package/src/components/Button/Button.stories.mdx +45 -36
- package/src/components/Button/Button.test.tsx +37 -11
- package/src/components/Button/Button.tsx +22 -34
- package/src/components/Button/ButtonTypes.tsx +2 -0
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +50 -8
- package/src/components/Card/Card.stories.mdx +314 -273
- package/src/components/Card/Card.test.tsx +157 -91
- package/src/components/Card/Card.tsx +195 -145
- package/src/components/Card/CardTypes.tsx +2 -19
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +410 -0
- package/src/components/CardEdition/CardEdition.stories.tsx +26 -53
- package/src/components/CardEdition/CardEdition.test.tsx +23 -31
- package/src/components/CardEdition/_CardEdition.scss +22 -23
- package/src/components/Chakra/Box.stories.mdx +15 -16
- package/src/components/Chakra/Center.stories.mdx +56 -24
- package/src/components/Chakra/Grid.stories.mdx +92 -0
- package/src/components/Chakra/Stack.stories.mdx +38 -21
- package/src/components/Checkbox/Checkbox.stories.mdx +33 -11
- package/src/components/Checkbox/Checkbox.test.tsx +47 -2
- package/src/components/Checkbox/Checkbox.tsx +44 -41
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +92 -7
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +329 -0
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +372 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +152 -0
- package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +4 -0
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1326 -0
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +63 -0
- package/src/components/DatePicker/DatePicker.stories.mdx +163 -62
- package/src/components/DatePicker/DatePicker.test.tsx +264 -64
- package/src/components/DatePicker/DatePicker.tsx +165 -134
- package/src/components/DatePicker/_DatePicker.scss +33 -66
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +818 -0
- package/src/components/Fieldset/Fieldset.stories.mdx +55 -0
- package/src/components/Fieldset/Fieldset.test.tsx +125 -0
- package/src/components/Fieldset/Fieldset.tsx +52 -0
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +68 -0
- package/src/components/Form/Form.stories.mdx +70 -27
- package/src/components/Form/Form.test.tsx +58 -45
- package/src/components/Form/Form.tsx +50 -21
- package/src/components/Form/FormTypes.tsx +3 -8
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +24 -14
- package/src/components/Grid/GridTypes.tsx +9 -0
- package/src/components/Grid/SimpleGrid.stories.mdx +268 -0
- package/src/components/Grid/SimpleGrid.test.tsx +66 -0
- package/src/components/Grid/SimpleGrid.tsx +37 -0
- package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +8 -0
- package/src/components/Heading/Heading.stories.mdx +3 -3
- package/src/components/Heading/Heading.tsx +12 -6
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +124 -0
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +39 -44
- package/src/components/HelperErrorText/HelperErrorText.tsx +37 -39
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +25 -0
- package/src/components/Hero/Hero.stories.mdx +198 -121
- package/src/components/Hero/Hero.test.tsx +537 -107
- package/src/components/Hero/Hero.tsx +79 -92
- package/src/components/Hero/HeroTypes.tsx +18 -5
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +8 -6
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +33 -28
- package/src/components/HorizontalRule/HorizontalRule.tsx +27 -29
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +27 -9
- package/src/components/Icons/Icon.stories.mdx +94 -77
- package/src/components/Icons/Icon.test.tsx +48 -22
- package/src/components/Icons/Icon.tsx +78 -61
- package/src/components/Icons/IconSvgs.tsx +22 -0
- package/src/components/Icons/IconTypes.tsx +91 -64
- package/src/components/Image/Image.stories.mdx +220 -0
- package/src/components/Image/Image.test.tsx +131 -29
- package/src/components/Image/Image.tsx +84 -56
- package/src/components/Image/ImageTypes.ts +22 -0
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +190 -0
- package/src/components/Input/Input.stories.tsx +23 -67
- package/src/components/Input/Input.test.tsx +4 -4
- package/src/components/Input/_Input.scss +23 -14
- package/src/components/Label/Label.stories.mdx +28 -7
- package/src/components/Label/Label.test.tsx +43 -12
- package/src/components/Label/Label.tsx +21 -34
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
- package/src/components/Link/Link.stories.mdx +41 -41
- package/src/components/Link/Link.test.tsx +33 -44
- package/src/components/Link/Link.tsx +117 -100
- package/src/components/List/List.stories.mdx +124 -51
- package/src/components/List/List.test.tsx +142 -63
- package/src/components/List/List.tsx +89 -93
- package/src/components/List/__snapshots__/List.test.tsx.snap +109 -0
- package/src/components/Modal/Modal.stories.mdx +3 -3
- package/src/components/Modal/_Modal.scss +2 -2
- package/src/components/Notification/Notification.stories.mdx +119 -111
- package/src/components/Notification/Notification.test.tsx +102 -126
- package/src/components/Notification/Notification.tsx +157 -161
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +159 -8
- package/src/components/Pagination/Pagination.stories.mdx +26 -27
- package/src/components/Pagination/Pagination.stories.tsx +11 -16
- package/src/components/Pagination/Pagination.test.tsx +276 -140
- package/src/components/Pagination/Pagination.tsx +174 -154
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +285 -0
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +292 -0
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +225 -0
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +126 -0
- package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +8 -0
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +357 -0
- package/src/components/Radio/Radio.test.tsx +20 -4
- package/src/components/Radio/Radio.tsx +6 -3
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +3 -0
- package/src/components/RadioGroup/RadioGroup.stories.mdx +4 -5
- package/src/components/RadioGroup/RadioGroup.test.tsx +24 -1
- package/src/components/RadioGroup/RadioGroup.tsx +21 -29
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +42 -72
- package/src/components/SearchBar/SearchBar.Test.tsx +170 -16
- package/src/components/SearchBar/SearchBar.stories.mdx +294 -219
- package/src/components/SearchBar/SearchBar.tsx +161 -46
- package/src/components/Select/Select.stories.mdx +188 -170
- package/src/components/Select/Select.test.tsx +132 -375
- package/src/components/Select/Select.tsx +121 -165
- package/src/components/Select/SelectTypes.tsx +5 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +33 -76
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +97 -177
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +75 -70
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +2 -2
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +739 -0
- package/src/components/Slider/Slider.stories.mdx +529 -0
- package/src/components/Slider/Slider.test.tsx +653 -0
- package/src/components/Slider/Slider.tsx +303 -0
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +1946 -0
- package/src/components/StatusBadge/StatusBadge.stories.mdx +91 -0
- package/src/components/StatusBadge/StatusBadge.test.tsx +35 -7
- package/src/components/StatusBadge/StatusBadge.tsx +24 -25
- package/src/components/StatusBadge/StatusBadgeTypes.tsx +5 -0
- package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +28 -0
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +17 -17
- package/src/components/StyleGuide/Breakpoints.stories.mdx +34 -10
- package/src/components/StyleGuide/Buttons.stories.mdx +102 -86
- package/src/components/StyleGuide/ColorCard.tsx +46 -0
- package/src/components/StyleGuide/Colors.stories.mdx +196 -0
- package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
- package/src/components/StyleGuide/Forms.stories.mdx +9 -7
- package/src/components/StyleGuide/Iconography.stories.mdx +119 -127
- package/src/components/StyleGuide/Spacing.stories.mdx +31 -23
- package/src/components/StyleGuide/Typography.stories.mdx +202 -189
- package/src/components/StyleGuide/UIDocCard.tsx +1 -1
- package/src/components/Tabs/Tabs.stories.mdx +73 -11
- package/src/components/Tabs/Tabs.tsx +88 -67
- package/src/components/Template/Template.stories.mdx +572 -0
- package/src/components/Template/Template.test.tsx +124 -0
- package/src/components/Template/Template.tsx +226 -0
- package/src/components/Text/Text.stories.mdx +70 -0
- package/src/components/Text/Text.test.tsx +63 -0
- package/src/components/Text/Text.tsx +55 -0
- package/src/components/Text/TextTypes.tsx +6 -0
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +33 -0
- package/src/components/TextInput/TextInput.stories.mdx +89 -90
- package/src/components/TextInput/TextInput.test.tsx +84 -85
- package/src/components/TextInput/TextInput.tsx +121 -95
- package/src/components/TextInput/TextInputTypes.tsx +8 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +17 -4
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +54 -53
- package/src/components/VideoPlayer/VideoPlayer.tsx +50 -51
- package/src/components/VideoPlayer/VideoPlayerTypes.tsx +2 -2
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +91 -0
- package/src/docs/Chakra.stories.mdx +246 -65
- package/src/docs/Intro.stories.mdx +18 -13
- package/src/hooks/tests/useCarouselStyles.test.ts +140 -0
- package/src/hooks/tests/useNYPLTheme.test.tsx +36 -0
- package/src/hooks/useCarouselStyles.ts +34 -0
- package/src/hooks/useNYPLTheme.ts +67 -0
- package/src/hooks/useWindowSize.ts +40 -0
- package/src/index.ts +39 -16
- package/src/resources.scss +5 -5
- package/src/styles/base/{_02-breakpoints.scss → _01-breakpoints.scss} +9 -10
- package/src/styles/base/{_03-mixins.scss → _02-mixins.scss} +16 -5
- package/src/styles/base/_03-base.scss +25 -0
- package/src/styles/base/{_05-focus.scss → _04-focus.scss} +0 -15
- package/src/styles/base/_place-holder.scss +14 -3
- package/src/styles/{03-space → space}/_space-inline.scss +14 -14
- package/src/styles/{03-space → space}/_space-inset.scss +10 -10
- package/src/styles/space/_space-stack.scss +116 -0
- package/src/styles.scss +13 -62
- package/src/theme/components/accordion.ts +30 -0
- package/src/theme/components/breadcrumb.ts +77 -0
- package/src/theme/components/button.ts +91 -71
- package/src/theme/components/card.ts +174 -0
- package/src/theme/components/checkbox.ts +22 -29
- package/src/theme/components/checkboxGroup.ts +8 -0
- package/src/theme/components/componentWrapper.ts +10 -0
- package/src/theme/components/datePicker.ts +17 -0
- package/src/theme/components/fieldset.ts +18 -0
- package/src/theme/components/global.ts +82 -0
- package/src/theme/components/globalMixins.ts +24 -0
- package/src/theme/components/heading.ts +25 -13
- package/src/theme/components/helperErrorText.ts +9 -0
- package/src/theme/components/hero.ts +240 -0
- package/src/theme/components/horizontalRule.ts +13 -0
- package/src/theme/components/icon.ts +79 -0
- package/src/theme/components/image.ts +116 -0
- package/src/theme/components/label.ts +10 -0
- package/src/theme/components/link.ts +51 -0
- package/src/theme/components/list.ts +73 -0
- package/src/theme/components/notification.ts +93 -0
- package/src/theme/components/pagination.ts +20 -0
- package/src/theme/components/progressIndicator.ts +62 -0
- package/src/theme/components/radio.ts +22 -33
- package/src/theme/components/radioGroup.ts +8 -0
- package/src/theme/components/searchBar.ts +21 -0
- package/src/theme/components/select.ts +53 -0
- package/src/theme/components/skeletonLoader.ts +107 -0
- package/src/theme/components/slider.ts +79 -0
- package/src/theme/components/statusBadge.ts +26 -0
- package/src/theme/components/tabs.ts +102 -69
- package/src/theme/components/template.ts +114 -0
- package/src/theme/components/text.ts +31 -0
- package/src/theme/components/textInput.ts +62 -0
- package/src/theme/components/videoPlayer.ts +49 -0
- package/src/theme/foundations/breakpoints.ts +8 -8
- package/src/theme/foundations/colors.ts +29 -13
- package/src/theme/foundations/global.ts +8 -0
- package/src/theme/foundations/radii.ts +6 -0
- package/src/theme/foundations/shadows.ts +5 -0
- package/src/theme/foundations/spacing.ts +24 -24
- package/src/theme/index.ts +74 -13
- package/src/utils/componentCategories.ts +12 -5
- package/src/utils/utils.ts +13 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -6
- package/dist/components/HelperErrorText/HelperErrorText.stories.d.ts +0 -16
- package/dist/components/Image/Image.stories.d.ts +0 -18
- package/dist/components/List/List.stories.d.ts +0 -7
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
- package/dist/components/StyleGuide/Colors.stories.d.ts +0 -25
- package/dist/components/Template/Template.stories.d.ts +0 -30
- package/dist/theme/components/customRadioGroup.d.ts +0 -17
- package/src/components/Accordion/Accordion.stories.tsx +0 -66
- package/src/components/Accordion/_Accordion.scss +0 -81
- package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
- package/src/components/Button/_Button.scss +0 -56
- package/src/components/Card/_Card.scss +0 -308
- package/src/components/Form/_Form.scss +0 -67
- package/src/components/HelperErrorText/HelperErrorText.stories.tsx +0 -48
- package/src/components/HelperErrorText/_HelperErrorText.scss +0 -9
- package/src/components/Hero/_Hero.scss +0 -256
- package/src/components/HorizontalRule/_HorizontalRule.scss +0 -15
- package/src/components/Icons/_Icons.scss +0 -116
- package/src/components/Image/Image.stories.tsx +0 -54
- package/src/components/Image/_Image.scss +0 -38
- package/src/components/Label/_Label.scss +0 -22
- package/src/components/Link/_Link.scss +0 -73
- package/src/components/List/List.stories.tsx +0 -139
- package/src/components/List/_List.scss +0 -76
- package/src/components/Notification/_Notification.scss +0 -110
- package/src/components/Pagination/_Pagination.scss +0 -40
- package/src/components/SearchBar/_SearchBar.scss +0 -16
- package/src/components/Select/_Select.scss +0 -82
- package/src/components/SkeletonLoader/_SkeletonLoader.scss +0 -142
- package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -34
- package/src/components/StatusBadge/_StatusBadge.scss +0 -23
- package/src/components/StyleGuide/Colors.stories.tsx +0 -289
- package/src/components/Template/Template.stories.tsx +0 -86
- package/src/components/Template/_Template.scss +0 -63
- package/src/components/TextInput/_TextInput.scss +0 -59
- package/src/components/VideoPlayer/_VideoPlayer.scss +0 -38
- package/src/styles/01-colors/_colors-brand.scss +0 -56
- package/src/styles/01-colors/_colors-utility.scss +0 -65
- package/src/styles/02-typography/_type-scale.css +0 -11
- package/src/styles/02-typography/_type-weight.css +0 -7
- package/src/styles/02-typography/_typefaces.css +0 -4
- package/src/styles/03-space/_space-stack.scss +0 -116
- package/src/styles/03-space/_space.css +0 -30
- package/src/styles/base/_04-base.scss +0 -19
- package/src/styles/base/_card-grid.scss +0 -78
- package/src/styles/base/_typography.scss +0 -11
- package/src/theme/components/customRadioGroup.ts +0 -18
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
Story,
|
|
4
4
|
Canvas,
|
|
5
5
|
ArgsTable,
|
|
6
|
-
Preview,
|
|
7
6
|
Description,
|
|
8
7
|
} from "@storybook/addon-docs/blocks";
|
|
9
8
|
import { withDesign } from "storybook-addon-designs";
|
|
@@ -11,17 +10,19 @@ import { action } from "@storybook/addon-actions";
|
|
|
11
10
|
|
|
12
11
|
import Button from "../Button/Button";
|
|
13
12
|
import { ButtonTypes } from "../Button/ButtonTypes";
|
|
14
|
-
import Card, {
|
|
15
|
-
import {
|
|
13
|
+
import Card, { CardHeading, CardContent, CardActions } from "./Card";
|
|
14
|
+
import { CardLayouts } from "./CardTypes";
|
|
16
15
|
import Link from "../Link/Link";
|
|
17
16
|
import Heading from "../Heading/Heading";
|
|
18
17
|
import HorizontalRule from "../HorizontalRule/HorizontalRule";
|
|
19
18
|
import { LinkTypes } from "../Link/LinkTypes";
|
|
20
19
|
import { HeadingDisplaySizes, HeadingLevels } from "../Heading/HeadingTypes";
|
|
21
20
|
import Icon from "../Icons/Icon";
|
|
22
|
-
import { IconRotationTypes, IconNames } from "../Icons/IconTypes";
|
|
23
21
|
import Image from "../Image/Image";
|
|
22
|
+
import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
|
|
23
|
+
import SimpleGrid from "../Grid/SimpleGrid";
|
|
24
24
|
import { getCategory } from "../../utils/componentCategories";
|
|
25
|
+
import DSProvider from "../../theme/provider";
|
|
25
26
|
|
|
26
27
|
<Meta
|
|
27
28
|
title={getCategory("Card")}
|
|
@@ -31,23 +32,13 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
31
32
|
design: {
|
|
32
33
|
type: "figma",
|
|
33
34
|
url:
|
|
34
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/
|
|
35
|
+
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36835%3A25747",
|
|
35
36
|
},
|
|
36
37
|
}}
|
|
37
38
|
argTypes={{
|
|
38
|
-
blockName: { table: { disable: true } },
|
|
39
39
|
className: { table: { disable: true } },
|
|
40
|
-
modifiers: { table: { disable: true } },
|
|
41
40
|
id: { table: { disable: true } },
|
|
42
41
|
imageComponent: { table: { disable: true } },
|
|
43
|
-
layout: { table: { disable: false } },
|
|
44
|
-
imageSrc: { table: { disable: false } },
|
|
45
|
-
imageAlt: { table: { disable: false } },
|
|
46
|
-
imageSize: { table: { disable: false } },
|
|
47
|
-
imageAspectRatio: { table: { disable: false } },
|
|
48
|
-
imageAtEnd: { table: { disable: false } },
|
|
49
|
-
border: { table: { disable: false } },
|
|
50
|
-
padding: { table: { disable: false } },
|
|
51
42
|
backgroundColor: { control: { type: "color" } },
|
|
52
43
|
foregroundColor: { control: { type: "color" } },
|
|
53
44
|
}}
|
|
@@ -58,7 +49,7 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
58
49
|
| Component Version | DS Version |
|
|
59
50
|
| ----------------- | ---------- |
|
|
60
51
|
| Added | `0.24.0` |
|
|
61
|
-
| Latest | `0.
|
|
52
|
+
| Latest | `0.25.3` |
|
|
62
53
|
|
|
63
54
|
<Description of={Card} />
|
|
64
55
|
|
|
@@ -76,23 +67,27 @@ The `CardActions` component is used to display "call to action" (CTA) buttons an
|
|
|
76
67
|
|
|
77
68
|
The `CardContent` component should be used to display all content other than headings and CTAs.
|
|
78
69
|
|
|
79
|
-
<
|
|
70
|
+
<Canvas withToolbar>
|
|
80
71
|
<Story
|
|
81
72
|
name="Card Props"
|
|
82
73
|
args={{
|
|
83
74
|
id: "custom-card",
|
|
84
|
-
layout: CardLayouts.
|
|
75
|
+
layout: CardLayouts.Row,
|
|
85
76
|
imageSrc: "https://placeimg.com/400/300/animals",
|
|
86
|
-
imageAspectRatio:
|
|
77
|
+
imageAspectRatio: ImageRatios.ThreeByFour,
|
|
78
|
+
imageSize: ImageSizes.Default,
|
|
87
79
|
imageAlt: "Alt text",
|
|
80
|
+
imageAtEnd: false,
|
|
81
|
+
border: false,
|
|
82
|
+
center: false,
|
|
88
83
|
}}
|
|
89
84
|
>
|
|
90
85
|
{(args) => (
|
|
91
86
|
<Card {...args}>
|
|
92
|
-
<CardHeading level={HeadingLevels.Two} id="heading1">
|
|
87
|
+
<CardHeading level={HeadingLevels.Two} id="main-heading1">
|
|
93
88
|
Optional Header
|
|
94
89
|
</CardHeading>
|
|
95
|
-
<CardHeading level={HeadingLevels.
|
|
90
|
+
<CardHeading level={HeadingLevels.Three} id="main-heading2">
|
|
96
91
|
Sollicitudin Lorem Tortor Purus Ornare
|
|
97
92
|
</CardHeading>
|
|
98
93
|
<CardContent>
|
|
@@ -103,7 +98,7 @@ The `CardContent` component should be used to display all content other than hea
|
|
|
103
98
|
<CardActions topBorder bottomBorder>
|
|
104
99
|
<Button
|
|
105
100
|
onClick={action("clicked")}
|
|
106
|
-
id="button1"
|
|
101
|
+
id="main-button1"
|
|
107
102
|
buttonType={ButtonTypes.Primary}
|
|
108
103
|
type="submit"
|
|
109
104
|
>
|
|
@@ -111,7 +106,7 @@ The `CardContent` component should be used to display all content other than hea
|
|
|
111
106
|
</Button>
|
|
112
107
|
<Button
|
|
113
108
|
onClick={action("clicked")}
|
|
114
|
-
id="button2"
|
|
109
|
+
id="main-button2"
|
|
115
110
|
buttonType={ButtonTypes.Secondary}
|
|
116
111
|
type="submit"
|
|
117
112
|
>
|
|
@@ -126,31 +121,28 @@ The `CardContent` component should be used to display all content other than hea
|
|
|
126
121
|
</Card>
|
|
127
122
|
)}
|
|
128
123
|
</Story>
|
|
129
|
-
</
|
|
124
|
+
</Canvas>
|
|
130
125
|
|
|
131
126
|
<ArgsTable story="Card Props" />
|
|
132
127
|
|
|
133
128
|
## Image Position
|
|
134
129
|
|
|
135
|
-
By default, the image is always the first element within a `Card`. This means
|
|
130
|
+
By default, the image is always the first element within a `Card`. This means
|
|
131
|
+
the image is at the top of a `Card` with a column layout and on the left side of
|
|
132
|
+
a `Card` with a row layout. However, you can use the `imageAtEnd` prop to override
|
|
133
|
+
the default placement and move the image to the last element within a `Card`.
|
|
136
134
|
|
|
137
|
-
###
|
|
135
|
+
### Column Cards
|
|
138
136
|
|
|
139
|
-
<
|
|
137
|
+
<Canvas>
|
|
140
138
|
<Story name="Card Image Position">
|
|
141
|
-
<
|
|
142
|
-
style={{
|
|
143
|
-
display: "grid",
|
|
144
|
-
"grid-gap": "2rem",
|
|
145
|
-
"grid-template-columns": "repeat(2, 1fr)",
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
139
|
+
<SimpleGrid columns={2}>
|
|
148
140
|
<Card
|
|
149
141
|
imageSrc="https://placeimg.com/400/200/animals"
|
|
150
142
|
imageAlt="Alt text"
|
|
151
|
-
imageAspectRatio={
|
|
143
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
152
144
|
>
|
|
153
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
145
|
+
<CardHeading level={HeadingLevels.Three} id="props-heading1">
|
|
154
146
|
Image on Top (default)
|
|
155
147
|
</CardHeading>
|
|
156
148
|
<CardContent>
|
|
@@ -161,10 +153,10 @@ By default, the image is always the first element within a `Card`. This means th
|
|
|
161
153
|
<Card
|
|
162
154
|
imageSrc="https://placeimg.com/410/210/animals"
|
|
163
155
|
imageAlt="Alt text"
|
|
164
|
-
imageAspectRatio={
|
|
156
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
165
157
|
imageAtEnd
|
|
166
158
|
>
|
|
167
|
-
<CardHeading level={HeadingLevels.Three} id="
|
|
159
|
+
<CardHeading level={HeadingLevels.Three} id="props-heading2">
|
|
168
160
|
Image on Bottom
|
|
169
161
|
</CardHeading>
|
|
170
162
|
<CardContent>
|
|
@@ -172,82 +164,74 @@ By default, the image is always the first element within a `Card`. This means th
|
|
|
172
164
|
libero, a pharetra augue.
|
|
173
165
|
</CardContent>
|
|
174
166
|
</Card>
|
|
175
|
-
</
|
|
167
|
+
</SimpleGrid>
|
|
176
168
|
</Story>
|
|
177
|
-
</
|
|
169
|
+
</Canvas>
|
|
178
170
|
|
|
179
|
-
###
|
|
171
|
+
### Row Cards
|
|
180
172
|
|
|
181
|
-
<
|
|
182
|
-
<
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
</CardContent>
|
|
221
|
-
</Card>
|
|
222
|
-
</div>
|
|
223
|
-
</Preview>
|
|
173
|
+
<Canvas>
|
|
174
|
+
<DSProvider>
|
|
175
|
+
<SimpleGrid columns={1}>
|
|
176
|
+
<Card
|
|
177
|
+
layout={CardLayouts.Row}
|
|
178
|
+
center
|
|
179
|
+
imageSrc="https://placeimg.com/400/200/animals"
|
|
180
|
+
imageAlt="Alt text"
|
|
181
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
182
|
+
>
|
|
183
|
+
<CardHeading level={HeadingLevels.Four} id="row-heading1">
|
|
184
|
+
Image on Left (default)
|
|
185
|
+
</CardHeading>
|
|
186
|
+
<CardContent>
|
|
187
|
+
Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
|
|
188
|
+
Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
|
|
189
|
+
facilisis in, egestas eget quam.
|
|
190
|
+
</CardContent>
|
|
191
|
+
</Card>
|
|
192
|
+
<Card
|
|
193
|
+
layout={CardLayouts.Row}
|
|
194
|
+
center
|
|
195
|
+
imageSrc="https://placeimg.com/410/210/animals"
|
|
196
|
+
imageAlt="Alt text"
|
|
197
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
198
|
+
imageAtEnd
|
|
199
|
+
>
|
|
200
|
+
<CardHeading level={HeadingLevels.Four} id="row-heading2">
|
|
201
|
+
Image on Right
|
|
202
|
+
</CardHeading>
|
|
203
|
+
<CardContent>
|
|
204
|
+
Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
|
|
205
|
+
Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
|
|
206
|
+
facilisis in, egestas eget quam.
|
|
207
|
+
</CardContent>
|
|
208
|
+
</Card>
|
|
209
|
+
</SimpleGrid>
|
|
210
|
+
</DSProvider>
|
|
211
|
+
</Canvas>
|
|
224
212
|
|
|
225
213
|
## Image Size
|
|
226
214
|
|
|
227
|
-
By default, the image width is `100%` for a
|
|
215
|
+
By default, the image width is `100%` for a `Card` with a column layout and
|
|
216
|
+
`225px` for a `Card` with a row layout. However, you can use the `imageSize`
|
|
217
|
+
prop to override the default width.
|
|
228
218
|
|
|
229
|
-
###
|
|
219
|
+
### Column Cards
|
|
230
220
|
|
|
231
|
-
<
|
|
221
|
+
<Canvas>
|
|
232
222
|
<Story name="Card Image Size">
|
|
233
|
-
<
|
|
234
|
-
style={{
|
|
235
|
-
display: "grid",
|
|
236
|
-
"grid-gap": "4rem",
|
|
237
|
-
"grid-template-columns": "repeat(1, 1fr)",
|
|
238
|
-
}}
|
|
239
|
-
>
|
|
223
|
+
<SimpleGrid columns={1}>
|
|
240
224
|
<Card
|
|
241
225
|
center
|
|
242
226
|
imageSrc="https://placeimg.com/400/200/animals"
|
|
243
227
|
imageAlt="Alt text"
|
|
244
|
-
imageAspectRatio={
|
|
245
|
-
imageSize={
|
|
228
|
+
imageAspectRatio={ImageRatios.Square}
|
|
229
|
+
imageSize={ImageSizes.Small}
|
|
246
230
|
>
|
|
247
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
231
|
+
<CardHeading level={HeadingLevels.Three} id="column-heading1">
|
|
248
232
|
Small Image
|
|
249
233
|
</CardHeading>
|
|
250
|
-
<CardHeading level={HeadingLevels.
|
|
234
|
+
<CardHeading level={HeadingLevels.Four} id="column-heading2">
|
|
251
235
|
Max-Width: 165px
|
|
252
236
|
</CardHeading>
|
|
253
237
|
<CardContent>
|
|
@@ -260,13 +244,13 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
260
244
|
center
|
|
261
245
|
imageSrc="https://placeimg.com/400/200/animals"
|
|
262
246
|
imageAlt="Alt text"
|
|
263
|
-
imageAspectRatio={
|
|
264
|
-
imageSize={
|
|
247
|
+
imageAspectRatio={ImageRatios.Square}
|
|
248
|
+
imageSize={ImageSizes.Medium}
|
|
265
249
|
>
|
|
266
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
250
|
+
<CardHeading level={HeadingLevels.Three} id="column2-heading1">
|
|
267
251
|
Medium Image
|
|
268
252
|
</CardHeading>
|
|
269
|
-
<CardHeading level={HeadingLevels.
|
|
253
|
+
<CardHeading level={HeadingLevels.Four} id="column2-heading2">
|
|
270
254
|
Max-Width: 225px
|
|
271
255
|
</CardHeading>
|
|
272
256
|
<CardContent>
|
|
@@ -274,17 +258,18 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
274
258
|
libero, a pharetra augue.
|
|
275
259
|
</CardContent>
|
|
276
260
|
</Card>
|
|
261
|
+
<HorizontalRule />
|
|
277
262
|
<Card
|
|
278
263
|
center
|
|
279
264
|
imageSrc="https://placeimg.com/410/210/animals"
|
|
280
265
|
imageAlt="Alt text"
|
|
281
|
-
imageAspectRatio={
|
|
282
|
-
imageSize={
|
|
266
|
+
imageAspectRatio={ImageRatios.Square}
|
|
267
|
+
imageSize={ImageSizes.Large}
|
|
283
268
|
>
|
|
284
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
269
|
+
<CardHeading level={HeadingLevels.Three} id="column3-heading1">
|
|
285
270
|
Large Image
|
|
286
271
|
</CardHeading>
|
|
287
|
-
<CardHeading level={HeadingLevels.
|
|
272
|
+
<CardHeading level={HeadingLevels.Four} id="column3-heading2">
|
|
288
273
|
Max-Width: 360px
|
|
289
274
|
</CardHeading>
|
|
290
275
|
<CardContent>
|
|
@@ -292,16 +277,17 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
292
277
|
libero, a pharetra augue.
|
|
293
278
|
</CardContent>
|
|
294
279
|
</Card>
|
|
280
|
+
<HorizontalRule />
|
|
295
281
|
<Card
|
|
296
282
|
center
|
|
297
283
|
imageSrc="https://placeimg.com/410/210/animals"
|
|
298
284
|
imageAlt="Alt text"
|
|
299
|
-
imageAspectRatio={
|
|
285
|
+
imageAspectRatio={ImageRatios.Square}
|
|
300
286
|
>
|
|
301
|
-
<CardHeading level={HeadingLevels.Three} id="
|
|
287
|
+
<CardHeading level={HeadingLevels.Three} id="column-4heading1">
|
|
302
288
|
Default Image
|
|
303
289
|
</CardHeading>
|
|
304
|
-
<CardHeading level={HeadingLevels.
|
|
290
|
+
<CardHeading level={HeadingLevels.Four} id="column-4heading2">
|
|
305
291
|
Width: 100%
|
|
306
292
|
</CardHeading>
|
|
307
293
|
<CardContent>
|
|
@@ -309,116 +295,106 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
309
295
|
libero, a pharetra augue.
|
|
310
296
|
</CardContent>
|
|
311
297
|
</Card>
|
|
312
|
-
</
|
|
298
|
+
</SimpleGrid>
|
|
313
299
|
</Story>
|
|
314
|
-
</
|
|
300
|
+
</Canvas>
|
|
315
301
|
|
|
316
|
-
###
|
|
302
|
+
### Row Cards
|
|
317
303
|
|
|
318
|
-
<
|
|
319
|
-
<
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
</
|
|
358
|
-
<
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
</CardContent>
|
|
401
|
-
</Card>
|
|
402
|
-
</div>
|
|
403
|
-
</Preview>
|
|
304
|
+
<Canvas>
|
|
305
|
+
<DSProvider>
|
|
306
|
+
<SimpleGrid columns={1}>
|
|
307
|
+
<Card
|
|
308
|
+
layout={CardLayouts.Row}
|
|
309
|
+
center
|
|
310
|
+
imageSrc="https://placeimg.com/400/200/animals"
|
|
311
|
+
imageAlt="Alt text"
|
|
312
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
313
|
+
imageSize={ImageSizes.Small}
|
|
314
|
+
>
|
|
315
|
+
<CardHeading level={HeadingLevels.Three} id="row2-heading1">
|
|
316
|
+
Small Image
|
|
317
|
+
</CardHeading>
|
|
318
|
+
<CardHeading level={HeadingLevels.Four} id="row2-heading2">
|
|
319
|
+
Max-Width: 165px
|
|
320
|
+
</CardHeading>
|
|
321
|
+
<CardContent>
|
|
322
|
+
Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
|
|
323
|
+
</CardContent>
|
|
324
|
+
</Card>
|
|
325
|
+
<Card
|
|
326
|
+
layout={CardLayouts.Row}
|
|
327
|
+
center
|
|
328
|
+
imageSrc="https://placeimg.com/410/210/animals"
|
|
329
|
+
imageAlt="Alt text"
|
|
330
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
331
|
+
imageSize={ImageSizes.Medium}
|
|
332
|
+
>
|
|
333
|
+
<CardHeading level={HeadingLevels.Three} id="row3-heading2">
|
|
334
|
+
Medium Image
|
|
335
|
+
</CardHeading>
|
|
336
|
+
<CardHeading level={HeadingLevels.Four} id="row3-heading2">
|
|
337
|
+
Max-Width: 225px
|
|
338
|
+
</CardHeading>
|
|
339
|
+
<CardContent>
|
|
340
|
+
Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
|
|
341
|
+
Sed posuere consectetur est at lobortis.
|
|
342
|
+
</CardContent>
|
|
343
|
+
</Card>
|
|
344
|
+
<Card
|
|
345
|
+
layout={CardLayouts.Row}
|
|
346
|
+
center
|
|
347
|
+
imageSrc="https://placeimg.com/400/250/animals"
|
|
348
|
+
imageAlt="Alt text"
|
|
349
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
350
|
+
imageSize={ImageSizes.Large}
|
|
351
|
+
>
|
|
352
|
+
<CardHeading level={HeadingLevels.Three} id="row4-heading1">
|
|
353
|
+
Large Image
|
|
354
|
+
</CardHeading>
|
|
355
|
+
<CardHeading level={HeadingLevels.Four} id="row4-heading2">
|
|
356
|
+
Max-Width: 360px
|
|
357
|
+
</CardHeading>
|
|
358
|
+
<CardContent>
|
|
359
|
+
Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
|
|
360
|
+
Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
|
|
361
|
+
facilisis in, egestas eget quam.
|
|
362
|
+
</CardContent>
|
|
363
|
+
</Card>
|
|
364
|
+
<Card
|
|
365
|
+
layout={CardLayouts.Row}
|
|
366
|
+
center
|
|
367
|
+
imageSrc="https://placeimg.com/450/250/animals"
|
|
368
|
+
imageAlt="Alt text"
|
|
369
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
370
|
+
>
|
|
371
|
+
<CardHeading level={HeadingLevels.Three} id="row5-heading2">
|
|
372
|
+
Default Image
|
|
373
|
+
</CardHeading>
|
|
374
|
+
<CardHeading level={HeadingLevels.Four} id="row5-heading2">
|
|
375
|
+
Max-Width: 225px
|
|
376
|
+
</CardHeading>
|
|
377
|
+
<CardContent>
|
|
378
|
+
Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
|
|
379
|
+
Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
|
|
380
|
+
facilisis in, egestas eget quam.
|
|
381
|
+
</CardContent>
|
|
382
|
+
</Card>
|
|
383
|
+
</SimpleGrid>
|
|
384
|
+
</DSProvider>
|
|
385
|
+
</Canvas>
|
|
404
386
|
|
|
405
387
|
## Cards in a Grid
|
|
406
388
|
|
|
407
|
-
<
|
|
389
|
+
<Canvas>
|
|
408
390
|
<Story name="Cards in a Grid">
|
|
409
|
-
<
|
|
410
|
-
style={{
|
|
411
|
-
display: "grid",
|
|
412
|
-
"grid-gap": "2rem",
|
|
413
|
-
"grid-template-columns": "repeat(3, 1fr)",
|
|
414
|
-
}}
|
|
415
|
-
>
|
|
391
|
+
<SimpleGrid columns={3}>
|
|
416
392
|
<Card
|
|
417
393
|
imageSrc="https://placeimg.com/400/200/animals"
|
|
418
394
|
imageAlt="Alt text"
|
|
419
|
-
imageAspectRatio={
|
|
395
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
420
396
|
>
|
|
421
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
397
|
+
<CardHeading level={HeadingLevels.Three} id="grid1-heading1">
|
|
422
398
|
Card Heading
|
|
423
399
|
</CardHeading>
|
|
424
400
|
<CardContent>
|
|
@@ -429,9 +405,9 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
429
405
|
<Card
|
|
430
406
|
imageSrc="https://placeimg.com/410/210/animals"
|
|
431
407
|
imageAlt="Alt text"
|
|
432
|
-
imageAspectRatio={
|
|
408
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
433
409
|
>
|
|
434
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
410
|
+
<CardHeading level={HeadingLevels.Three} id="grid2-heading1">
|
|
435
411
|
Card Heading
|
|
436
412
|
</CardHeading>
|
|
437
413
|
<CardContent>
|
|
@@ -442,9 +418,9 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
442
418
|
<Card
|
|
443
419
|
imageSrc="https://placeimg.com/420/220/animals"
|
|
444
420
|
imageAlt="Alt text"
|
|
445
|
-
imageAspectRatio={
|
|
421
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
446
422
|
>
|
|
447
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
423
|
+
<CardHeading level={HeadingLevels.Three} id="grid3-heading1">
|
|
448
424
|
Card Heading
|
|
449
425
|
</CardHeading>
|
|
450
426
|
<CardContent>
|
|
@@ -455,9 +431,9 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
455
431
|
<Card
|
|
456
432
|
imageSrc="https://placeimg.com/430/230/animals"
|
|
457
433
|
imageAlt="Alt text"
|
|
458
|
-
imageAspectRatio={
|
|
434
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
459
435
|
>
|
|
460
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
436
|
+
<CardHeading level={HeadingLevels.Three} id="grid4-heading1">
|
|
461
437
|
Card Heading
|
|
462
438
|
</CardHeading>
|
|
463
439
|
<CardContent>
|
|
@@ -468,9 +444,9 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
468
444
|
<Card
|
|
469
445
|
imageSrc="https://placeimg.com/440/240/animals"
|
|
470
446
|
imageAlt="Alt text"
|
|
471
|
-
imageAspectRatio={
|
|
447
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
472
448
|
>
|
|
473
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
449
|
+
<CardHeading level={HeadingLevels.Three} id="grid5-heading1">
|
|
474
450
|
Card Heading
|
|
475
451
|
</CardHeading>
|
|
476
452
|
<CardContent>
|
|
@@ -481,9 +457,9 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
481
457
|
<Card
|
|
482
458
|
imageSrc="https://placeimg.com/450/250/animals"
|
|
483
459
|
imageAlt="Alt text"
|
|
484
|
-
imageAspectRatio={
|
|
460
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
485
461
|
>
|
|
486
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
462
|
+
<CardHeading level={HeadingLevels.Three} id="grid6-heading1">
|
|
487
463
|
Card Heading
|
|
488
464
|
</CardHeading>
|
|
489
465
|
<CardContent>
|
|
@@ -491,29 +467,23 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
491
467
|
libero, a pharetra augue.
|
|
492
468
|
</CardContent>
|
|
493
469
|
</Card>
|
|
494
|
-
</
|
|
470
|
+
</SimpleGrid>
|
|
495
471
|
</Story>
|
|
496
|
-
</
|
|
472
|
+
</Canvas>
|
|
497
473
|
|
|
498
474
|
## Cards in a Stack
|
|
499
475
|
|
|
500
|
-
<
|
|
476
|
+
<Canvas>
|
|
501
477
|
<Story name="Cards in a Stack">
|
|
502
|
-
<
|
|
503
|
-
style={{
|
|
504
|
-
display: "grid",
|
|
505
|
-
"grid-gap": "2rem",
|
|
506
|
-
"grid-template-columns": "repeat(1, 1fr)",
|
|
507
|
-
}}
|
|
508
|
-
>
|
|
478
|
+
<SimpleGrid columns={1}>
|
|
509
479
|
<Card
|
|
510
|
-
layout={CardLayouts.
|
|
480
|
+
layout={CardLayouts.Row}
|
|
511
481
|
center
|
|
512
482
|
imageSrc="https://placeimg.com/400/200/animals"
|
|
513
483
|
imageAlt="Alt text"
|
|
514
|
-
imageAspectRatio={
|
|
484
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
515
485
|
>
|
|
516
|
-
<CardHeading level={HeadingLevels.Four} id="heading1">
|
|
486
|
+
<CardHeading level={HeadingLevels.Four} id="stack1-heading1">
|
|
517
487
|
Card Heading
|
|
518
488
|
</CardHeading>
|
|
519
489
|
<CardContent>
|
|
@@ -523,13 +493,13 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
523
493
|
</CardContent>
|
|
524
494
|
</Card>
|
|
525
495
|
<Card
|
|
526
|
-
layout={CardLayouts.
|
|
496
|
+
layout={CardLayouts.Row}
|
|
527
497
|
center
|
|
528
498
|
imageSrc="https://placeimg.com/410/210/animals"
|
|
529
499
|
imageAlt="Alt text"
|
|
530
|
-
imageAspectRatio={
|
|
500
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
531
501
|
>
|
|
532
|
-
<CardHeading level={HeadingLevels.Four} id="heading2">
|
|
502
|
+
<CardHeading level={HeadingLevels.Four} id="stack2-heading2">
|
|
533
503
|
Card Heading
|
|
534
504
|
</CardHeading>
|
|
535
505
|
<CardContent>
|
|
@@ -539,13 +509,13 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
539
509
|
</CardContent>
|
|
540
510
|
</Card>
|
|
541
511
|
<Card
|
|
542
|
-
layout={CardLayouts.
|
|
512
|
+
layout={CardLayouts.Row}
|
|
543
513
|
center
|
|
544
514
|
imageSrc="https://placeimg.com/420/220/animals"
|
|
545
515
|
imageAlt="Alt text"
|
|
546
|
-
imageAspectRatio={
|
|
516
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
547
517
|
>
|
|
548
|
-
<CardHeading level={HeadingLevels.Four} id="heading3">
|
|
518
|
+
<CardHeading level={HeadingLevels.Four} id="stack3-heading3">
|
|
549
519
|
Card Heading
|
|
550
520
|
</CardHeading>
|
|
551
521
|
<CardContent>
|
|
@@ -554,27 +524,27 @@ By default, the image width is `100%` for a vertical `Card` and `225px` for a ho
|
|
|
554
524
|
facilisis in, egestas eget quam.
|
|
555
525
|
</CardContent>
|
|
556
526
|
</Card>
|
|
557
|
-
</
|
|
527
|
+
</SimpleGrid>
|
|
558
528
|
</Story>
|
|
559
|
-
</
|
|
529
|
+
</Canvas>
|
|
560
530
|
|
|
561
531
|
## Custom Image Component
|
|
562
532
|
|
|
563
533
|
Instead of passing a path for the `imageSrc` prop, you can pass a custom image component in using the `imageComponent` prop.
|
|
564
534
|
|
|
565
|
-
<
|
|
535
|
+
<Canvas withToolbar>
|
|
566
536
|
<Story name="Custom Image Component">
|
|
567
537
|
<Card
|
|
568
538
|
imageAlt="Alt text"
|
|
569
|
-
imageAspectRatio={
|
|
539
|
+
imageAspectRatio={ImageRatios.SixteenByNine}
|
|
570
540
|
imageComponent={
|
|
571
541
|
<Image src="https://placeimg.com/400/400/animals" alt="Alt text" />
|
|
572
542
|
}
|
|
573
543
|
>
|
|
574
|
-
<CardHeading level={HeadingLevels.Two} id="heading1">
|
|
544
|
+
<CardHeading level={HeadingLevels.Two} id="img1-heading1">
|
|
575
545
|
Card Component with Custom Image Component
|
|
576
546
|
</CardHeading>
|
|
577
|
-
<CardHeading level={HeadingLevels.
|
|
547
|
+
<CardHeading level={HeadingLevels.Three} id="img2-heading2">
|
|
578
548
|
Secondary Heading
|
|
579
549
|
</CardHeading>
|
|
580
550
|
<CardContent>
|
|
@@ -585,7 +555,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
|
|
|
585
555
|
consectetur est at lobortis.
|
|
586
556
|
</CardContent>
|
|
587
557
|
<CardActions>
|
|
588
|
-
<Link type={LinkTypes.Button} href="
|
|
558
|
+
<Link type={LinkTypes.Button} href="#">
|
|
589
559
|
Reserve
|
|
590
560
|
</Link>
|
|
591
561
|
<Link href="#url" type={LinkTypes.Forwards}>
|
|
@@ -594,22 +564,15 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
|
|
|
594
564
|
</CardActions>
|
|
595
565
|
</Card>
|
|
596
566
|
</Story>
|
|
597
|
-
</
|
|
567
|
+
</Canvas>
|
|
598
568
|
|
|
599
569
|
## Cards Without Images
|
|
600
570
|
|
|
601
|
-
<
|
|
571
|
+
<Canvas>
|
|
602
572
|
<Story name="Cards Without Images">
|
|
603
|
-
<
|
|
604
|
-
style={{
|
|
605
|
-
display: "grid",
|
|
606
|
-
"grid-gap": "2rem",
|
|
607
|
-
"grid-template-columns": "repeat(3, 1fr)",
|
|
608
|
-
"margin-bottom": "2rem",
|
|
609
|
-
}}
|
|
610
|
-
>
|
|
573
|
+
<SimpleGrid columns={3}>
|
|
611
574
|
<Card border>
|
|
612
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
575
|
+
<CardHeading level={HeadingLevels.Three} id="no-img1-heading1">
|
|
613
576
|
Card Heading
|
|
614
577
|
</CardHeading>
|
|
615
578
|
<CardContent>
|
|
@@ -619,7 +582,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
|
|
|
619
582
|
</CardContent>
|
|
620
583
|
</Card>
|
|
621
584
|
<Card border>
|
|
622
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
585
|
+
<CardHeading level={HeadingLevels.Three} id="no-img2-heading1">
|
|
623
586
|
Card Heading
|
|
624
587
|
</CardHeading>
|
|
625
588
|
<CardContent>
|
|
@@ -629,7 +592,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
|
|
|
629
592
|
</CardContent>
|
|
630
593
|
</Card>
|
|
631
594
|
<Card border>
|
|
632
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
595
|
+
<CardHeading level={HeadingLevels.Three} id="no-img3-heading1">
|
|
633
596
|
Card Heading
|
|
634
597
|
</CardHeading>
|
|
635
598
|
<CardContent>
|
|
@@ -638,16 +601,11 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
|
|
|
638
601
|
Praesent commodo cursus magna, vel scelerisque nisl.
|
|
639
602
|
</CardContent>
|
|
640
603
|
</Card>
|
|
641
|
-
</
|
|
642
|
-
<
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
"
|
|
646
|
-
"grid-template-columns": "repeat(1, 1fr)",
|
|
647
|
-
}}
|
|
648
|
-
>
|
|
649
|
-
<Card layout={CardLayouts.Horizontal} border>
|
|
650
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
604
|
+
</SimpleGrid>
|
|
605
|
+
<br />
|
|
606
|
+
<SimpleGrid columns={1}>
|
|
607
|
+
<Card layout={CardLayouts.Row} border>
|
|
608
|
+
<CardHeading level={HeadingLevels.Three} id="no-img4-heading1">
|
|
651
609
|
Card Heading
|
|
652
610
|
</CardHeading>
|
|
653
611
|
<CardContent>
|
|
@@ -659,8 +617,8 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
|
|
|
659
617
|
eget metus.
|
|
660
618
|
</CardContent>
|
|
661
619
|
</Card>
|
|
662
|
-
<Card layout={CardLayouts.
|
|
663
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
620
|
+
<Card layout={CardLayouts.Row} border>
|
|
621
|
+
<CardHeading level={HeadingLevels.Three} id="no-img5-heading1">
|
|
664
622
|
Card Heading
|
|
665
623
|
</CardHeading>
|
|
666
624
|
<CardContent>
|
|
@@ -672,8 +630,8 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
|
|
|
672
630
|
eget metus.
|
|
673
631
|
</CardContent>
|
|
674
632
|
</Card>
|
|
675
|
-
<Card layout={CardLayouts.
|
|
676
|
-
<CardHeading level={HeadingLevels.Three} id="heading1">
|
|
633
|
+
<Card layout={CardLayouts.Row} border>
|
|
634
|
+
<CardHeading level={HeadingLevels.Three} id="no-img6-heading1">
|
|
677
635
|
Card Heading
|
|
678
636
|
</CardHeading>
|
|
679
637
|
<CardContent>
|
|
@@ -685,6 +643,89 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
|
|
|
685
643
|
eget metus.
|
|
686
644
|
</CardContent>
|
|
687
645
|
</Card>
|
|
688
|
-
</
|
|
646
|
+
</SimpleGrid>
|
|
647
|
+
</Story>
|
|
648
|
+
</Canvas>
|
|
649
|
+
|
|
650
|
+
## Card With Full-Click Functionality
|
|
651
|
+
|
|
652
|
+
To enable the full-click functionality in the `Card` component, pass a URL in
|
|
653
|
+
the `mainActionLink` prop. This will make the entire `Card` component clickable.
|
|
654
|
+
If the `Card` has action links or buttons, they can still be accessed by tabbing
|
|
655
|
+
through the `Card` and pressing `enter` or clicking like a regular link.
|
|
656
|
+
|
|
657
|
+
Internally, if multiple `CardHeading` components are passed, only the first one
|
|
658
|
+
will have the full-click link. This, however, does not affect the `Card` itself
|
|
659
|
+
from being having the full-click functionality.
|
|
660
|
+
|
|
661
|
+
<Canvas>
|
|
662
|
+
<Story name="Card With Full-Click Functionality">
|
|
663
|
+
<SimpleGrid columns={2}>
|
|
664
|
+
<Card
|
|
665
|
+
imageSrc="https://placeimg.com/400/200/animals"
|
|
666
|
+
imageAlt="Alt text"
|
|
667
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
668
|
+
mainActionLink="http://nypl.org"
|
|
669
|
+
>
|
|
670
|
+
<CardHeading level={HeadingLevels.Three} id="fullclick1-heading1">
|
|
671
|
+
Go to NYPL home page.
|
|
672
|
+
</CardHeading>
|
|
673
|
+
<CardHeading level={HeadingLevels.Four} id="fullclick1-heading2">
|
|
674
|
+
Some other heading.
|
|
675
|
+
</CardHeading>
|
|
676
|
+
<CardContent>
|
|
677
|
+
This entire `Card` component is clickable, but the links below are
|
|
678
|
+
still accessible by tabbing through the `Card` and pressing `enter` or
|
|
679
|
+
clicking with a mouse.
|
|
680
|
+
</CardContent>
|
|
681
|
+
<CardActions>
|
|
682
|
+
<Link href="#" type={LinkTypes.Button}>
|
|
683
|
+
Button
|
|
684
|
+
</Link>
|
|
685
|
+
<Link href="#" type={LinkTypes.Forwards}>
|
|
686
|
+
Other link
|
|
687
|
+
</Link>
|
|
688
|
+
</CardActions>
|
|
689
|
+
</Card>
|
|
690
|
+
<Card
|
|
691
|
+
imageSrc="https://placeimg.com/410/210/animals"
|
|
692
|
+
imageAlt="Alt text"
|
|
693
|
+
imageAspectRatio={ImageRatios.TwoByOne}
|
|
694
|
+
mainActionLink="http://nypl.org"
|
|
695
|
+
imageAtEnd
|
|
696
|
+
>
|
|
697
|
+
<CardHeading level={HeadingLevels.Three} id="fullclick2-heading1">
|
|
698
|
+
Go to NYPL home page.
|
|
699
|
+
</CardHeading>
|
|
700
|
+
<CardContent>
|
|
701
|
+
This `Card` component does not have any extra links.
|
|
702
|
+
</CardContent>
|
|
703
|
+
</Card>
|
|
704
|
+
</SimpleGrid>
|
|
689
705
|
</Story>
|
|
690
|
-
</
|
|
706
|
+
</Canvas>
|
|
707
|
+
|
|
708
|
+
## Accessibility
|
|
709
|
+
|
|
710
|
+
### Headings
|
|
711
|
+
|
|
712
|
+
In general, headings from `h1` through `h6` must be in sequential order in the
|
|
713
|
+
DOM tree. Rendering an `h4` following an `h2` will throw an error. Therefore,
|
|
714
|
+
when adding `CardHeading` components, make sure to add them in sequential order
|
|
715
|
+
with the `level` prop.
|
|
716
|
+
|
|
717
|
+
```tsx
|
|
718
|
+
<CardHeading level={HeadingLevels.Three} id="headingthree">
|
|
719
|
+
Heading level three
|
|
720
|
+
</CardHeading>
|
|
721
|
+
<CardHeading level={HeadingLevels.Four} id="headingfour">
|
|
722
|
+
Heading level four
|
|
723
|
+
</CardHeading>
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
### Full-Click Functionality
|
|
727
|
+
|
|
728
|
+
Passing in a URL in the `mainActionLink` prop will make the entire `Card`
|
|
729
|
+
clickable. Other links in the `CardActions` component can still be accessed by
|
|
730
|
+
tabbing through and pressing "enter" or by clicking as you normally would on a
|
|
731
|
+
link.
|