@nypl/design-system-react-components 0.23.4 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +98 -1
- package/README.md +46 -11
- package/dist/components/Accordion/Accordion.d.ts +14 -14
- package/dist/components/Autosuggest/Autosuggest.stories.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -14
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
- package/dist/components/Button/Button.d.ts +6 -13
- package/dist/components/Button/ButtonTypes.d.ts +5 -3
- package/dist/components/Card/Card.d.ts +59 -10
- package/dist/components/Card/CardTypes.d.ts +19 -0
- package/dist/components/CardEdition/CardEdition.d.ts +21 -0
- package/dist/components/{StyleGuide/Colors.stories.d.ts → CardEdition/CardEdition.stories.d.ts} +5 -2
- package/dist/components/Checkbox/Checkbox.d.ts +21 -16
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +43 -0
- package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.d.ts +79 -0
- package/dist/components/DatePicker/DatePickerTypes.d.ts +5 -0
- package/dist/components/Form/Form.d.ts +16 -8
- package/dist/components/Form/FormTypes.d.ts +2 -0
- 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 +9 -11
- package/dist/components/Heading/{HeadingDisplaySizes.d.ts → HeadingTypes.d.ts} +8 -0
- package/dist/components/HelperErrorText/HelperErrorText.stories.d.ts +2 -1
- package/dist/components/Hero/Hero.d.ts +19 -14
- package/dist/components/Hero/HeroTypes.d.ts +10 -5
- package/dist/components/Icons/Icon.d.ts +13 -16
- package/dist/components/Icons/IconSvgs.d.ts +4 -0
- package/dist/components/Icons/IconTypes.d.ts +78 -60
- package/dist/components/Image/Image.stories.d.ts +2 -1
- package/dist/components/Label/Label.d.ts +10 -26
- package/dist/components/Link/Link.d.ts +8 -12
- package/dist/components/List/List.stories.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +30 -24
- package/dist/components/RadioGroup/RadioGroup.d.ts +40 -0
- package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +4 -0
- 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 +1 -1
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +2 -2
- package/dist/components/StatusBadge/StatusBadge.d.ts +8 -6
- package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +5 -0
- package/dist/components/Tabs/Tabs.d.ts +25 -0
- 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 +37 -30
- package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
- package/dist/design-system-react-components.cjs.development.js +4102 -917
- 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 +4023 -920
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +23 -5
- package/dist/resources.scss +133 -24
- 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 +109 -0
- package/dist/theme/components/checkbox.d.ts +91 -0
- package/dist/theme/components/customCheckboxGroup.d.ts +18 -0
- package/dist/theme/components/customRadioGroup.d.ts +18 -0
- package/dist/theme/components/global.d.ts +55 -0
- package/dist/theme/components/globalMixins.d.ts +15 -0
- package/dist/theme/components/heading.d.ts +110 -0
- package/dist/theme/components/hero.d.ts +492 -0
- package/dist/theme/components/icon.d.ts +13 -0
- package/dist/theme/components/label.d.ts +16 -0
- package/dist/theme/components/link.d.ts +45 -0
- package/dist/theme/components/radio.d.ts +95 -0
- package/dist/theme/components/searchBar.d.ts +20 -0
- package/dist/theme/components/select.d.ts +58 -0
- package/dist/theme/components/statusBadge.d.ts +25 -0
- package/dist/theme/components/tabs.d.ts +85 -0
- 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 +105 -0
- package/dist/theme/foundations/breakpoints.d.ts +23 -0
- package/dist/theme/foundations/colors.d.ts +3 -0
- package/dist/theme/foundations/global.d.ts +23 -0
- package/dist/theme/foundations/shadows.d.ts +4 -0
- package/dist/theme/foundations/spacing.d.ts +77 -0
- package/dist/theme/foundations/typography.d.ts +8 -0
- package/dist/theme/index.d.ts +20 -0
- package/dist/theme/provider.d.ts +5 -0
- package/dist/theme/types.d.ts +1 -0
- package/dist/utils/utils.d.ts +6 -0
- package/package.json +9 -2
- package/src/components/Accordion/Accordion.stories.mdx +233 -33
- 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 -3
- package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -1
- package/src/components/Autosuggest/_Autosuggest.scss +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +57 -56
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +31 -25
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +71 -73
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +6 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +100 -0
- package/src/components/Button/Button.stories.mdx +125 -138
- package/src/components/Button/Button.test.tsx +65 -11
- package/src/components/Button/Button.tsx +72 -68
- package/src/components/Button/ButtonTypes.tsx +4 -2
- package/src/components/Button/_Button.scss +7 -92
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +58 -3
- package/src/components/Card/Card.stories.mdx +694 -0
- package/src/components/Card/Card.test.tsx +97 -102
- package/src/components/Card/Card.tsx +182 -31
- package/src/components/Card/CardTypes.tsx +21 -0
- package/src/components/Card/_Card.scss +234 -49
- package/src/components/{Card/Card.stories.tsx → CardEdition/CardEdition.stories.tsx} +32 -22
- package/src/components/CardEdition/CardEdition.test.tsx +395 -0
- package/src/components/CardEdition/CardEdition.tsx +60 -0
- package/src/components/CardEdition/_CardEdition.scss +138 -0
- package/src/components/Chakra/Box.stories.mdx +57 -0
- package/src/components/Chakra/Center.stories.mdx +99 -0
- package/src/components/Chakra/Grid.stories.mdx +79 -0
- package/src/components/Chakra/Stack.stories.mdx +93 -0
- package/src/components/Checkbox/Checkbox.stories.mdx +57 -35
- package/src/components/Checkbox/Checkbox.test.tsx +117 -147
- package/src/components/Checkbox/Checkbox.tsx +76 -50
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +325 -0
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +249 -0
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +345 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +148 -0
- package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +4 -0
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1360 -0
- package/src/components/DatePicker/DatePicker.stories.mdx +284 -0
- package/src/components/DatePicker/DatePicker.test.tsx +657 -0
- package/src/components/DatePicker/DatePicker.tsx +396 -0
- package/src/components/DatePicker/DatePickerTypes.tsx +5 -0
- package/src/components/DatePicker/_DatePicker.scss +76 -0
- package/src/components/Form/Form.stories.mdx +130 -27
- package/src/components/Form/Form.test.tsx +78 -36
- package/src/components/Form/Form.tsx +53 -19
- package/src/components/Form/FormTypes.tsx +3 -0
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +38 -0
- package/src/components/Grid/GridTypes.tsx +9 -0
- package/src/components/Grid/SimpleGrid.stories.mdx +275 -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 +63 -33
- package/src/components/Heading/Heading.test.tsx +24 -16
- package/src/components/Heading/Heading.tsx +54 -38
- package/src/components/Heading/{HeadingDisplaySizes.tsx → HeadingTypes.tsx} +9 -0
- package/src/components/HelperErrorText/HelperErrorText.stories.tsx +2 -1
- package/src/components/HelperErrorText/_HelperErrorText.scss +1 -1
- package/src/components/Hero/Hero.stories.mdx +195 -85
- package/src/components/Hero/Hero.test.tsx +544 -113
- package/src/components/Hero/Hero.tsx +80 -93
- package/src/components/Hero/HeroTypes.tsx +17 -5
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +6 -1
- package/src/components/HorizontalRule/_HorizontalRule.scss +1 -1
- package/src/components/Icons/Icon.stories.mdx +89 -74
- package/src/components/Icons/Icon.test.tsx +30 -22
- package/src/components/Icons/Icon.tsx +63 -61
- package/src/components/Icons/IconSvgs.tsx +8 -0
- package/src/components/Icons/IconTypes.tsx +80 -60
- package/src/components/Image/Image.stories.tsx +2 -1
- package/src/components/Input/_Input.scss +2 -2
- package/src/components/Label/Label.stories.mdx +77 -0
- package/src/components/Label/Label.test.tsx +43 -12
- package/src/components/Label/Label.tsx +28 -45
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
- package/src/components/Link/Link.stories.mdx +47 -41
- package/src/components/Link/Link.test.tsx +33 -44
- package/src/components/Link/Link.tsx +114 -100
- package/src/components/List/List.stories.mdx +7 -3
- package/src/components/List/List.stories.tsx +14 -9
- package/src/components/List/List.test.tsx +12 -8
- package/src/components/List/List.tsx +9 -7
- package/src/components/List/_List.scss +3 -3
- package/src/components/Modal/Modal.stories.mdx +7 -3
- package/src/components/Modal/_Modal.scss +1 -1
- package/src/components/Notification/Notification.stories.mdx +99 -65
- package/src/components/Notification/Notification.test.tsx +3 -16
- package/src/components/Notification/Notification.tsx +12 -12
- package/src/components/Notification/_Notification.scss +5 -4
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +1 -1
- package/src/components/Pagination/Pagination.stories.mdx +7 -1
- package/src/components/Pagination/Pagination.test.tsx +16 -10
- package/src/components/Radio/Radio.stories.mdx +57 -46
- package/src/components/Radio/Radio.test.tsx +92 -138
- package/src/components/Radio/Radio.tsx +70 -69
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +250 -0
- package/src/components/RadioGroup/RadioGroup.stories.mdx +247 -0
- package/src/components/RadioGroup/RadioGroup.test.tsx +327 -0
- package/src/components/RadioGroup/RadioGroup.tsx +154 -0
- package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +4 -0
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1101 -0
- package/src/components/SearchBar/SearchBar.Test.tsx +151 -16
- package/src/components/SearchBar/SearchBar.stories.mdx +196 -224
- package/src/components/SearchBar/SearchBar.tsx +151 -46
- package/src/components/Select/Select.stories.mdx +193 -168
- package/src/components/Select/Select.test.tsx +129 -324
- package/src/components/Select/Select.tsx +120 -160
- package/src/components/Select/SelectTypes.tsx +4 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +18 -29
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -7
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +4 -2
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +2 -2
- package/src/components/SkeletonLoader/_SkeletonLoader.scss +3 -3
- 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 +112 -90
- package/src/components/StyleGuide/Buttons.stories.mdx +98 -100
- package/src/components/StyleGuide/Colors.stories.mdx +336 -0
- package/src/components/StyleGuide/Forms.stories.mdx +85 -0
- package/src/components/StyleGuide/Iconography.stories.mdx +86 -93
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
- package/src/components/StyleGuide/Typography.stories.mdx +164 -166
- package/src/components/StyleGuide/UIDocCard.tsx +4 -4
- package/src/components/Tabs/Tabs.stories.mdx +221 -0
- package/src/components/Tabs/Tabs.test.tsx +264 -0
- package/src/components/Tabs/Tabs.tsx +220 -0
- package/src/components/Template/Template.stories.mdx +574 -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 +90 -90
- package/src/components/TextInput/TextInput.test.tsx +103 -83
- package/src/components/TextInput/TextInput.tsx +108 -91
- package/src/components/TextInput/TextInputTypes.tsx +6 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -1
- package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
- package/src/components/VideoPlayer/_VideoPlayer.scss +1 -1
- package/src/docs/Chakra.stories.mdx +341 -0
- package/src/docs/Intro.stories.mdx +31 -24
- package/src/index.ts +70 -5
- package/src/styles/01-colors/_colors-brand.scss +6 -4
- package/src/styles/01-colors/_colors-utility.scss +14 -15
- package/src/styles/03-space/_space-inline.scss +47 -7
- package/src/styles/03-space/_space-inset.scss +33 -5
- package/src/styles/03-space/_space-stack.scss +48 -8
- package/src/styles/base/_02-breakpoints.scss +5 -4
- package/src/styles/base/_04-base.scss +2 -1
- package/src/styles/base/_place-holder.scss +1 -1
- package/src/styles/base/_typography.scss +1 -29
- package/src/styles.scss +22 -25
- package/src/theme/components/accordion.ts +30 -0
- package/src/theme/components/breadcrumb.ts +77 -0
- package/src/theme/components/button.ts +125 -0
- package/src/theme/components/checkbox.ts +107 -0
- package/src/theme/components/customCheckboxGroup.ts +12 -0
- package/src/theme/components/customRadioGroup.ts +12 -0
- package/src/theme/components/global.ts +71 -0
- package/src/theme/components/globalMixins.ts +16 -0
- package/src/theme/components/heading.ts +72 -0
- package/src/theme/components/hero.ts +239 -0
- package/src/theme/components/icon.ts +79 -0
- package/src/theme/components/label.ts +17 -0
- package/src/theme/components/link.ts +47 -0
- package/src/theme/components/radio.ts +106 -0
- package/src/theme/components/searchBar.ts +21 -0
- package/src/theme/components/select.ts +50 -0
- package/src/theme/components/statusBadge.ts +27 -0
- package/src/theme/components/tabs.ts +79 -0
- package/src/theme/components/template.ts +114 -0
- package/src/theme/components/text.ts +31 -0
- package/src/theme/components/textInput.ts +61 -0
- package/src/theme/foundations/breakpoints.ts +24 -0
- package/src/theme/foundations/colors.ts +208 -0
- package/src/theme/foundations/global.ts +26 -0
- package/src/theme/foundations/shadows.ts +5 -0
- package/src/theme/foundations/spacing.ts +85 -0
- package/src/theme/foundations/typography.ts +35 -0
- package/src/theme/index.ts +88 -0
- package/src/theme/provider.tsx +9 -0
- package/src/theme/types.ts +1 -0
- package/src/utils/componentCategories.ts +56 -21
- package/src/utils/utils.ts +13 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -5
- package/dist/components/Card/Card.stories.d.ts +0 -27
- package/dist/components/Label/Label.stories.d.ts +0 -12
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
- package/dist/components/Template/Template.stories.d.ts +0 -29
- package/src/components/Accordion/Accordion.stories.tsx +0 -65
- package/src/components/Accordion/_Accordion.scss +0 -81
- package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
- package/src/components/Checkbox/_Checkbox.scss +0 -97
- package/src/components/Form/_Form.scss +0 -28
- package/src/components/Heading/_Heading.scss +0 -163
- package/src/components/Hero/_Hero.scss +0 -256
- package/src/components/Icons/_Icons.scss +0 -116
- package/src/components/Label/Label.stories.tsx +0 -30
- package/src/components/Label/_Label.scss +0 -22
- package/src/components/Link/_Link.scss +0 -73
- package/src/components/Radio/_Radio.scss +0 -84
- package/src/components/SearchBar/_SearchBar.scss +0 -16
- package/src/components/Select/_Select.scss +0 -82
- package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -33
- package/src/components/StatusBadge/_StatusBadge.scss +0 -23
- package/src/components/StyleGuide/Colors.stories.tsx +0 -288
- package/src/components/Template/Template.stories.tsx +0 -85
- package/src/components/Template/_Template.scss +0 -63
- package/src/components/TextInput/_TextInput.scss +0 -59
|
@@ -3,18 +3,22 @@ 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";
|
|
10
9
|
|
|
11
|
-
import Button from "./Button";
|
|
10
|
+
import Button, { ButtonGroup } from "./Button";
|
|
12
11
|
import { ButtonTypes } from "./ButtonTypes";
|
|
13
12
|
import Icon from "../Icons/Icon";
|
|
14
|
-
import {
|
|
15
|
-
|
|
13
|
+
import {
|
|
14
|
+
IconNames,
|
|
15
|
+
IconRotationTypes,
|
|
16
|
+
IconAlign,
|
|
17
|
+
IconSizes,
|
|
18
|
+
} from "../Icons/IconTypes";
|
|
16
19
|
import getCSSVariable from "../../helpers/getCSSVariable";
|
|
17
20
|
import { getCategory } from "../../utils/componentCategories";
|
|
21
|
+
import DSProvider from "../../theme/provider";
|
|
18
22
|
|
|
19
23
|
<Meta
|
|
20
24
|
title={getCategory("Button")}
|
|
@@ -32,61 +36,51 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
32
36
|
|
|
33
37
|
# Button
|
|
34
38
|
|
|
39
|
+
| Component Version | DS Version |
|
|
40
|
+
| ----------------- | ---------- |
|
|
41
|
+
| Added | `0.0.4` |
|
|
42
|
+
| Latest | `0.25.0` |
|
|
43
|
+
|
|
35
44
|
<Description of={Button} />
|
|
36
45
|
|
|
37
46
|
Update the `buttonType` in the Controls section to see the types of buttons
|
|
38
47
|
that can be rendered.
|
|
39
48
|
|
|
40
49
|
- `ButtonTypes.Primary` is used for actions that move the user forward.
|
|
41
|
-
- `ButtonTypes.Secondary` is used for actions
|
|
42
|
-
- `ButtonTypes.Pill` is used for equally weighted actions within cards and always in a set
|
|
43
|
-
- `ButtonTypes.Link` is used for equally weighted actions in a text based list
|
|
50
|
+
- `ButtonTypes.Secondary` is used for actions that move the user back, such as cancellations.
|
|
51
|
+
- `ButtonTypes.Pill` is used for equally weighted actions within cards and always in a set.
|
|
52
|
+
- `ButtonTypes.Link` is used for equally weighted actions in a text based list.
|
|
53
|
+
|
|
54
|
+
When one and only one `Icon` component is passed inside a `Button` component,
|
|
55
|
+
it will automatically be configured to use the `"icon-only"` type.
|
|
44
56
|
|
|
45
|
-
<
|
|
57
|
+
<Canvas withToolbar>
|
|
46
58
|
<Story name="Basic">{(args) => <Button {...args}>Button Text</Button>}</Story>
|
|
47
|
-
</
|
|
59
|
+
</Canvas>
|
|
48
60
|
|
|
49
61
|
<ArgsTable story="Basic" />
|
|
50
62
|
|
|
51
63
|
## Button Groups
|
|
52
64
|
|
|
53
|
-
Primary and secondary buttons
|
|
65
|
+
Primary and secondary buttons should be grouped like in the following example.
|
|
66
|
+
The `ButtonGroup` component, which is directly exported from Chakra UI, should
|
|
67
|
+
be used to wrap the `Button` cmoponent.
|
|
54
68
|
|
|
55
69
|
<Canvas>
|
|
56
70
|
<Story name="Button Groups">
|
|
57
|
-
<
|
|
58
|
-
style={{
|
|
59
|
-
display: "flex",
|
|
60
|
-
justifyContent: "space-between",
|
|
61
|
-
width: "180px",
|
|
62
|
-
}}
|
|
63
|
-
>
|
|
71
|
+
<ButtonGroup>
|
|
64
72
|
<Button buttonType={ButtonTypes.Secondary}>Button</Button>
|
|
65
73
|
<Button buttonType={ButtonTypes.Primary}>Submit</Button>
|
|
66
|
-
</
|
|
67
|
-
<br />
|
|
68
|
-
<div
|
|
69
|
-
style={{
|
|
70
|
-
display: "flex",
|
|
71
|
-
justifyContent: "space-between",
|
|
72
|
-
width: "280px",
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
<Button buttonType={ButtonTypes.Secondary}>
|
|
76
|
-
<span style={{ width: "100px" }}>Button</span>
|
|
77
|
-
</Button>
|
|
78
|
-
<Button buttonType={ButtonTypes.Primary}>
|
|
79
|
-
<span style={{ width: "100px" }}>Submit</span>
|
|
80
|
-
</Button>
|
|
81
|
-
</div>
|
|
74
|
+
</ButtonGroup>
|
|
82
75
|
</Story>
|
|
83
76
|
</Canvas>
|
|
84
77
|
|
|
85
78
|
## With Icons
|
|
86
79
|
|
|
87
80
|
The `Icon` component collaborates great with the `Button` component. Check out
|
|
88
|
-
`src/components/Icons/IconTypes`
|
|
89
|
-
|
|
81
|
+
[`src/components/Icons/IconTypes`](https://github.com/NYPL/nypl-design-system/blob/development/src/components/Icons/IconTypes.tsx)
|
|
82
|
+
to see the full list of icon and logo names that can be rendered. Use the
|
|
83
|
+
Controls for this Story section to preview a `Button` with the selected icon.
|
|
90
84
|
|
|
91
85
|
<Canvas>
|
|
92
86
|
<Story
|
|
@@ -94,14 +88,14 @@ can be rendered or check out the Controls section for this story.
|
|
|
94
88
|
args={{
|
|
95
89
|
displayLeft: true,
|
|
96
90
|
buttonText: "Button Text",
|
|
97
|
-
iconType: IconNames.
|
|
91
|
+
iconType: IconNames.Search,
|
|
98
92
|
}}
|
|
99
93
|
argTypes={{
|
|
100
94
|
iconType: {
|
|
101
95
|
control: {
|
|
102
96
|
type: "select",
|
|
103
|
-
options: IconNames,
|
|
104
97
|
},
|
|
98
|
+
options: Object.values(IconNames).map((value) => value),
|
|
105
99
|
},
|
|
106
100
|
}}
|
|
107
101
|
>
|
|
@@ -110,16 +104,16 @@ can be rendered or check out the Controls section for this story.
|
|
|
110
104
|
{args.displayLeft && (
|
|
111
105
|
<Icon
|
|
112
106
|
name={args.iconType}
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
align={IconAlign.Left}
|
|
108
|
+
size={IconSizes.Small}
|
|
115
109
|
/>
|
|
116
110
|
)}
|
|
117
111
|
{args.buttonText}
|
|
118
112
|
{!args.displayLeft && (
|
|
119
113
|
<Icon
|
|
120
114
|
name={args.iconType}
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
align={IconAlign.Right}
|
|
116
|
+
size={IconSizes.Small}
|
|
123
117
|
/>
|
|
124
118
|
)}
|
|
125
119
|
</Button>
|
|
@@ -130,32 +124,28 @@ can be rendered or check out the Controls section for this story.
|
|
|
130
124
|
The icon can be placed to the left or the right of the button text.
|
|
131
125
|
|
|
132
126
|
<Canvas>
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
modifiers={["small", "icon-right"]}
|
|
156
|
-
/>
|
|
157
|
-
</Button>
|
|
158
|
-
</div>
|
|
127
|
+
<DSProvider>
|
|
128
|
+
<ButtonGroup>
|
|
129
|
+
<Button buttonType={ButtonTypes.Secondary}>
|
|
130
|
+
<Icon
|
|
131
|
+
name={IconNames.Arrow}
|
|
132
|
+
iconRotation={IconRotationTypes.Rotate90}
|
|
133
|
+
align={IconAlign.Left}
|
|
134
|
+
size={IconSizes.Small}
|
|
135
|
+
/>
|
|
136
|
+
Previous
|
|
137
|
+
</Button>
|
|
138
|
+
<Button buttonType={ButtonTypes.Secondary}>
|
|
139
|
+
Next
|
|
140
|
+
<Icon
|
|
141
|
+
name={IconNames.Arrow}
|
|
142
|
+
iconRotation={IconRotationTypes.Rotate270}
|
|
143
|
+
align={IconAlign.Right}
|
|
144
|
+
size={IconSizes.Small}
|
|
145
|
+
/>
|
|
146
|
+
</Button>
|
|
147
|
+
</ButtonGroup>
|
|
148
|
+
</DSProvider>
|
|
159
149
|
</Canvas>
|
|
160
150
|
|
|
161
151
|
Text in a button is optional if an icon is rendered, but make sure that there
|
|
@@ -163,94 +153,91 @@ is an `aria-label` passed to the `Button` component through the `attributes` pro
|
|
|
163
153
|
`attributes={{ "aria-label": "Previous" }}`
|
|
164
154
|
|
|
165
155
|
<Canvas>
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
"aria-label": "Close",
|
|
203
|
-
}}
|
|
204
|
-
>
|
|
205
|
-
<Icon name={IconNames.close} decorative={true} modifiers={["small"]} />
|
|
206
|
-
</Button>
|
|
207
|
-
</div>
|
|
156
|
+
<DSProvider>
|
|
157
|
+
<ButtonGroup>
|
|
158
|
+
<Button
|
|
159
|
+
buttonType={ButtonTypes.Secondary}
|
|
160
|
+
attributes={{
|
|
161
|
+
"aria-label": "Previous",
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
<Icon
|
|
165
|
+
name={IconNames.Arrow}
|
|
166
|
+
iconRotation={IconRotationTypes.Rotate90}
|
|
167
|
+
size={IconSizes.Small}
|
|
168
|
+
/>
|
|
169
|
+
</Button>
|
|
170
|
+
<Button
|
|
171
|
+
buttonType={ButtonTypes.Secondary}
|
|
172
|
+
attributes={{
|
|
173
|
+
"aria-label": "Next",
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<Icon
|
|
177
|
+
name={IconNames.Arrow}
|
|
178
|
+
iconRotation={IconRotationTypes.Rotate270}
|
|
179
|
+
size={IconSizes.Small}
|
|
180
|
+
/>
|
|
181
|
+
</Button>
|
|
182
|
+
<Button
|
|
183
|
+
buttonType={ButtonTypes.Secondary}
|
|
184
|
+
attributes={{
|
|
185
|
+
"aria-label": "Close",
|
|
186
|
+
}}
|
|
187
|
+
>
|
|
188
|
+
<Icon name={IconNames.Close} size={IconSizes.Small} />
|
|
189
|
+
</Button>
|
|
190
|
+
</ButtonGroup>
|
|
191
|
+
</DSProvider>
|
|
208
192
|
</Canvas>
|
|
209
193
|
|
|
210
194
|
## Patterns
|
|
211
195
|
|
|
212
|
-
Buttons are blue by default but should be red when it is intended
|
|
213
|
-
The "Back to Top" button must be of `ButtonTypes` `Secondary` and
|
|
196
|
+
Buttons are blue by default but should be red when it is intended to be used as
|
|
197
|
+
a call out. The "Back to Top" button must be of `ButtonTypes` `Secondary` and
|
|
198
|
+
must include an up arrow icon on the right side.
|
|
214
199
|
|
|
215
200
|
<Canvas>
|
|
216
201
|
<Story name="Patterns">
|
|
217
|
-
<
|
|
218
|
-
buttonType={ButtonTypes.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
<Icon
|
|
231
|
-
name={IconNames.arrow}
|
|
232
|
-
decorative={true}
|
|
233
|
-
iconRotation={IconRotationTypes.rotate180}
|
|
234
|
-
modifiers={["small", "icon-right"]}
|
|
235
|
-
/>
|
|
236
|
-
</Button>
|
|
202
|
+
<ButtonGroup>
|
|
203
|
+
<Button buttonType={ButtonTypes.Callout}>Donate to this library</Button>
|
|
204
|
+
<Button buttonType={ButtonTypes.Secondary}>
|
|
205
|
+
Back to Top
|
|
206
|
+
<Icon
|
|
207
|
+
name={IconNames.Arrow}
|
|
208
|
+
iconRotation={IconRotationTypes.Rotate180}
|
|
209
|
+
size={IconSizes.Small}
|
|
210
|
+
className="right"
|
|
211
|
+
align={IconAlign.Right}
|
|
212
|
+
/>
|
|
213
|
+
</Button>
|
|
214
|
+
</ButtonGroup>
|
|
237
215
|
</Story>
|
|
238
216
|
</Canvas>
|
|
239
217
|
|
|
240
218
|
## Other Examples
|
|
241
219
|
|
|
242
|
-
|
|
220
|
+
The different `ButtonTypes` modified by the `buttonType` prop:
|
|
243
221
|
|
|
244
222
|
<Canvas>
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
223
|
+
<DSProvider>
|
|
224
|
+
<ButtonGroup>
|
|
225
|
+
<Button buttonType={ButtonTypes.Primary}>Primary</Button>
|
|
226
|
+
<Button buttonType={ButtonTypes.Secondary}>Secondary</Button>
|
|
227
|
+
<Button buttonType={ButtonTypes.Callout}>Callout</Button>
|
|
228
|
+
<Button buttonType={ButtonTypes.Pill}>Pill</Button>
|
|
229
|
+
<Button buttonType={ButtonTypes.Link}>Link</Button>
|
|
230
|
+
</ButtonGroup>
|
|
231
|
+
</DSProvider>
|
|
249
232
|
</Canvas>
|
|
250
233
|
|
|
251
234
|
Modifying the `disabled` prop:
|
|
252
235
|
|
|
253
236
|
<Canvas>
|
|
254
|
-
<
|
|
255
|
-
|
|
237
|
+
<DSProvider>
|
|
238
|
+
<ButtonGroup>
|
|
239
|
+
<Button disabled={false}>Enabled</Button>
|
|
240
|
+
<Button disabled={true}>Disabled</Button>
|
|
241
|
+
</ButtonGroup>
|
|
242
|
+
</DSProvider>
|
|
256
243
|
</Canvas>
|
|
@@ -6,7 +6,8 @@ import renderer from "react-test-renderer";
|
|
|
6
6
|
|
|
7
7
|
import Button from "./Button";
|
|
8
8
|
import Icon from "../Icons/Icon";
|
|
9
|
-
import { IconNames } from "../Icons/IconTypes";
|
|
9
|
+
import { IconAlign, IconNames, IconSizes } from "../Icons/IconTypes";
|
|
10
|
+
import { ButtonTypes } from "./ButtonTypes";
|
|
10
11
|
|
|
11
12
|
describe("Button Accessibility", () => {
|
|
12
13
|
it("passes axe accessibility test", async () => {
|
|
@@ -79,39 +80,92 @@ describe("rendering content from its children prop", () => {
|
|
|
79
80
|
it("should render element children", () => {
|
|
80
81
|
const { container } = render(
|
|
81
82
|
<Button id="button3" onClick={onClick}>
|
|
82
|
-
<em>I'm
|
|
83
|
+
<em>I'm an em element</em>
|
|
83
84
|
</Button>
|
|
84
85
|
);
|
|
85
|
-
expect(screen.getByText(/
|
|
86
|
+
expect(screen.getByText(/an em element/i)).toBeInTheDocument();
|
|
86
87
|
expect(container.querySelector("em")).toBeInTheDocument();
|
|
87
88
|
});
|
|
88
89
|
});
|
|
89
90
|
|
|
90
91
|
describe("padding for icon only button", () => {
|
|
91
|
-
it("button has proper
|
|
92
|
+
it("button has proper child svg for the icon only button", () => {
|
|
92
93
|
const onClick = jest.fn();
|
|
93
94
|
const { container } = render(
|
|
94
95
|
<Button id="button" onClick={onClick} type="button">
|
|
95
96
|
<Icon
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
align={IconAlign.Left}
|
|
98
|
+
name={IconNames.Check}
|
|
99
|
+
size={IconSizes.Small}
|
|
99
100
|
/>
|
|
100
101
|
</Button>
|
|
101
102
|
);
|
|
102
|
-
expect(container.querySelector(".button
|
|
103
|
+
expect(container.querySelector(".button svg")).toBeInTheDocument();
|
|
103
104
|
});
|
|
104
105
|
});
|
|
105
106
|
|
|
106
107
|
describe("Button Snapshot", () => {
|
|
107
108
|
it("Renders the UI snapshot correctly", () => {
|
|
108
|
-
const
|
|
109
|
+
const primary = renderer
|
|
109
110
|
.create(
|
|
110
111
|
<Button id="button" onClick={jest.fn()}>
|
|
111
|
-
|
|
112
|
+
Primary
|
|
112
113
|
</Button>
|
|
113
114
|
)
|
|
114
115
|
.toJSON();
|
|
115
|
-
|
|
116
|
+
const secondary = renderer
|
|
117
|
+
.create(
|
|
118
|
+
<Button
|
|
119
|
+
id="button"
|
|
120
|
+
onClick={jest.fn()}
|
|
121
|
+
buttonType={ButtonTypes.Secondary}
|
|
122
|
+
>
|
|
123
|
+
Seconday
|
|
124
|
+
</Button>
|
|
125
|
+
)
|
|
126
|
+
.toJSON();
|
|
127
|
+
const callout = renderer
|
|
128
|
+
.create(
|
|
129
|
+
<Button
|
|
130
|
+
id="button"
|
|
131
|
+
onClick={jest.fn()}
|
|
132
|
+
buttonType={ButtonTypes.Callout}
|
|
133
|
+
>
|
|
134
|
+
Callout
|
|
135
|
+
</Button>
|
|
136
|
+
)
|
|
137
|
+
.toJSON();
|
|
138
|
+
const pill = renderer
|
|
139
|
+
.create(
|
|
140
|
+
<Button id="button" onClick={jest.fn()} buttonType={ButtonTypes.Pill}>
|
|
141
|
+
Pill
|
|
142
|
+
</Button>
|
|
143
|
+
)
|
|
144
|
+
.toJSON();
|
|
145
|
+
const link = renderer
|
|
146
|
+
.create(
|
|
147
|
+
<Button id="button" onClick={jest.fn()} buttonType={ButtonTypes.Link}>
|
|
148
|
+
Link
|
|
149
|
+
</Button>
|
|
150
|
+
)
|
|
151
|
+
.toJSON();
|
|
152
|
+
const searchBar = renderer
|
|
153
|
+
.create(
|
|
154
|
+
<Button
|
|
155
|
+
id="button"
|
|
156
|
+
onClick={jest.fn()}
|
|
157
|
+
buttonType={ButtonTypes.SearchBar}
|
|
158
|
+
>
|
|
159
|
+
SearchBar
|
|
160
|
+
</Button>
|
|
161
|
+
)
|
|
162
|
+
.toJSON();
|
|
163
|
+
|
|
164
|
+
expect(primary).toMatchSnapshot();
|
|
165
|
+
expect(secondary).toMatchSnapshot();
|
|
166
|
+
expect(callout).toMatchSnapshot();
|
|
167
|
+
expect(pill).toMatchSnapshot();
|
|
168
|
+
expect(link).toMatchSnapshot();
|
|
169
|
+
expect(searchBar).toMatchSnapshot();
|
|
116
170
|
});
|
|
117
171
|
});
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Button as ChakraButton,
|
|
4
|
+
ButtonGroup,
|
|
5
|
+
useStyleConfig,
|
|
6
|
+
} from "@chakra-ui/react";
|
|
7
|
+
|
|
2
8
|
import bem from "../../utils/bem";
|
|
3
9
|
import { ButtonTypes } from "./ButtonTypes";
|
|
4
10
|
import Icon from "../Icons/Icon";
|
|
5
11
|
|
|
12
|
+
type ButtonElementType = "submit" | "button" | "reset";
|
|
13
|
+
|
|
6
14
|
interface ButtonProps {
|
|
7
15
|
/** Additional attributes passed to the button */
|
|
8
16
|
attributes?: { [key: string]: any };
|
|
9
|
-
/** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
10
|
-
blockName?: string;
|
|
11
17
|
/** The kind of button assigned through the `ButtonTypes` enum */
|
|
12
18
|
buttonType?: ButtonTypes;
|
|
13
19
|
/** Additional className for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
@@ -16,84 +22,82 @@ interface ButtonProps {
|
|
|
16
22
|
disabled?: boolean;
|
|
17
23
|
/** ID that other components can cross reference for accessibility purposes */
|
|
18
24
|
id?: string;
|
|
19
|
-
/** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
20
|
-
modifiers?: string[];
|
|
21
25
|
/** Trigger the Button's action through the `mouseDown` event handler instead of `onClick`. `false` by default. */
|
|
22
26
|
mouseDown?: boolean;
|
|
23
27
|
/** The action to perform on the `<button>`'s onClick function */
|
|
24
28
|
onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
25
29
|
/** The html button attribute */
|
|
26
|
-
type?:
|
|
30
|
+
type?: ButtonElementType;
|
|
27
31
|
}
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
constructor(props: ButtonProps) {
|
|
36
|
-
super(props);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
render(): JSX.Element {
|
|
40
|
-
const {
|
|
41
|
-
attributes,
|
|
42
|
-
blockName,
|
|
43
|
-
buttonType,
|
|
44
|
-
children,
|
|
45
|
-
className,
|
|
46
|
-
disabled,
|
|
47
|
-
id,
|
|
48
|
-
modifiers = [],
|
|
49
|
-
mouseDown,
|
|
50
|
-
onClick,
|
|
51
|
-
type = "submit",
|
|
52
|
-
} = this.props;
|
|
53
|
-
|
|
54
|
-
const buttonModifiers = modifiers ? modifiers : [];
|
|
55
|
-
if (!buttonModifiers.find((modifier) => modifier === buttonType)) {
|
|
56
|
-
buttonModifiers.push(buttonType);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const baseClass = "button";
|
|
33
|
+
// Used to map between ButtonTypes enum values and Chakra variant options.
|
|
34
|
+
const variantMap = {};
|
|
35
|
+
for (const type in ButtonTypes) {
|
|
36
|
+
variantMap[ButtonTypes[type]] = ButtonTypes[type];
|
|
37
|
+
}
|
|
60
38
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Map the ButtonType to the Button Chakra theme variant object. If a wrong
|
|
41
|
+
* value is passed (typically in non-Typescript scenarios), then the default
|
|
42
|
+
* is the "primary" variant.
|
|
43
|
+
*/
|
|
44
|
+
const getVariant = (buttonType) =>
|
|
45
|
+
variantMap[buttonType] || ButtonTypes.Primary;
|
|
64
46
|
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
/** Renders a simple `button` element with custom classes and modifiers. */
|
|
48
|
+
function Button(props: React.PropsWithChildren<ButtonProps>) {
|
|
49
|
+
const {
|
|
50
|
+
attributes,
|
|
51
|
+
buttonType,
|
|
52
|
+
children,
|
|
53
|
+
className = "",
|
|
54
|
+
disabled,
|
|
55
|
+
id,
|
|
56
|
+
mouseDown = false,
|
|
57
|
+
onClick,
|
|
58
|
+
type = "button",
|
|
59
|
+
} = props;
|
|
60
|
+
const baseClass = "button";
|
|
61
|
+
const btnCallback = mouseDown ? { onMouseDown: onClick } : { onClick };
|
|
62
|
+
let childCount = 0;
|
|
63
|
+
let hasIcon = false;
|
|
64
|
+
let variant;
|
|
65
|
+
let styles;
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
67
|
+
React.Children.map(children, (child: React.ReactElement) => {
|
|
68
|
+
childCount++;
|
|
69
|
+
if (child !== undefined && child !== null) {
|
|
70
|
+
if (
|
|
71
|
+
child.type === Icon ||
|
|
72
|
+
(child.props && child.props.mdxType === "Icon")
|
|
73
|
+
) {
|
|
74
|
+
hasIcon = true;
|
|
77
75
|
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
if (childCount === 1 && hasIcon) {
|
|
81
|
-
buttonModifiers.push("icon-only");
|
|
82
76
|
}
|
|
77
|
+
});
|
|
83
78
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
className,
|
|
89
|
-
])}`}
|
|
90
|
-
type={type}
|
|
91
|
-
disabled={disabled}
|
|
92
|
-
{...attributes}
|
|
93
|
-
{...btnCallback}
|
|
94
|
-
>
|
|
95
|
-
{children}
|
|
96
|
-
</button>
|
|
97
|
-
);
|
|
79
|
+
if (childCount === 1 && hasIcon) {
|
|
80
|
+
variant = "icon-only";
|
|
81
|
+
} else {
|
|
82
|
+
variant = getVariant(buttonType);
|
|
98
83
|
}
|
|
84
|
+
|
|
85
|
+
styles = useStyleConfig("Button", { variant });
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<ChakraButton
|
|
89
|
+
id={id}
|
|
90
|
+
className={bem(baseClass, [], "", [className])}
|
|
91
|
+
type={type}
|
|
92
|
+
disabled={disabled}
|
|
93
|
+
__css={styles}
|
|
94
|
+
{...attributes}
|
|
95
|
+
{...btnCallback}
|
|
96
|
+
>
|
|
97
|
+
{children}
|
|
98
|
+
</ChakraButton>
|
|
99
|
+
);
|
|
99
100
|
}
|
|
101
|
+
|
|
102
|
+
export { ButtonGroup };
|
|
103
|
+
export default Button;
|