@papillonarts/components 0.8.0 → 0.10.0
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/build/index.ts +1 -0
- package/build/primer/Alert/Alert.mdx +88 -0
- package/build/primer/Alert/Alert.prop.ts +45 -0
- package/build/primer/Alert/Alert.tsx +101 -0
- package/build/primer/Alert/__tests__/Alert.int.story.tsx +86 -0
- package/build/primer/Alert/__tests__/Alert.int.test.ts +37 -0
- package/build/primer/Alert/index.ts +2 -0
- package/build/primer/Blankslate/Blankslate.mdx +57 -0
- package/build/primer/Blankslate/Blankslate.prop.ts +26 -0
- package/build/primer/Blankslate/Blankslate.tsx +26 -0
- package/build/primer/Blankslate/__tests__/Blankslate.int.story.tsx +43 -0
- package/build/primer/Blankslate/__tests__/Blankslate.int.test.ts +29 -0
- package/build/primer/Blankslate/index.ts +2 -0
- package/build/primer/Breadcrumb/Breadcrumb.mdx +23 -0
- package/build/primer/Breadcrumb/Breadcrumb.prop.ts +28 -0
- package/build/primer/Breadcrumb/Breadcrumb.tsx +57 -0
- package/build/primer/Breadcrumb/__tests__/Breadcrumb.int.story.tsx +40 -0
- package/build/primer/Breadcrumb/__tests__/Breadcrumb.int.test.ts +40 -0
- package/build/primer/Breadcrumb/index.ts +2 -0
- package/build/primer/Button/Button.mdx +239 -0
- package/build/primer/Button/Button.prop.ts +77 -0
- package/build/primer/Button/Button.tsx +91 -0
- package/build/primer/Button/__tests__/Button.int.story.tsx +173 -0
- package/build/primer/Button/__tests__/Button.int.test.ts +191 -0
- package/build/primer/Button/index.ts +2 -0
- package/build/primer/Dropdown/Dropdown.mdx +19 -0
- package/build/primer/Dropdown/Dropdown.prop.ts +33 -0
- package/build/primer/Dropdown/Dropdown.tsx +102 -0
- package/build/primer/Dropdown/__tests__/Dropdown.int.story.tsx +43 -0
- package/build/primer/Dropdown/__tests__/Dropdown.int.test.ts +53 -0
- package/build/primer/Dropdown/index.ts +2 -0
- package/build/primer/ErrorBoundary/ErrorBoundary.prop.ts +5 -0
- package/build/primer/ErrorBoundary/ErrorBoundary.tsx +35 -0
- package/build/primer/ErrorBoundary/__tests__/ErrorBoundary.int.story.tsx +23 -0
- package/build/primer/ErrorBoundary/__tests__/ErrorBoundary.int.test.ts +9 -0
- package/build/primer/ErrorBoundary/index.ts +1 -0
- package/build/primer/Form/Checkbox/Checkbox.prop.ts +34 -0
- package/build/primer/Form/Checkbox/Checkbox.tsx +40 -0
- package/build/primer/Form/Checkbox/__tests__/Checkbox.int.story.tsx +50 -0
- package/build/primer/Form/Checkbox/__tests__/Checkbox.int.test.ts +23 -0
- package/build/primer/Form/Checkbox/index.ts +2 -0
- package/build/primer/Form/Input/Input.prop.ts +43 -0
- package/build/primer/Form/Input/Input.tsx +43 -0
- package/build/primer/Form/Input/__tests__/Input.int.story.tsx +54 -0
- package/build/primer/Form/Input/__tests__/Input.int.test.ts +15 -0
- package/build/primer/Form/Input/index.ts +2 -0
- package/build/primer/Form/Radio/Radio.prop.ts +30 -0
- package/build/primer/Form/Radio/Radio.tsx +38 -0
- package/build/primer/Form/Radio/__tests__/Radio.int.story.tsx +42 -0
- package/build/primer/Form/Radio/__tests__/Radio.int.test.ts +13 -0
- package/build/primer/Form/Radio/index.ts +2 -0
- package/build/primer/Form/index.ts +19 -0
- package/build/primer/Grid/DisplayTable/DisplayTable.prop.ts +21 -0
- package/build/primer/Grid/DisplayTable/DisplayTable.tsx +68 -0
- package/build/primer/Grid/DisplayTable/__tests__/DisplayTable.int.data.ts +289 -0
- package/build/primer/Grid/DisplayTable/__tests__/DisplayTable.int.story.tsx +27 -0
- package/build/primer/Grid/DisplayTable/__tests__/DisplayTable.int.test.ts +9 -0
- package/build/primer/Grid/DisplayTable/index.ts +1 -0
- package/build/primer/Grid/FlexGrid/FlexGrid.prop.ts +59 -0
- package/build/primer/Grid/FlexGrid/FlexGrid.tsx +274 -0
- package/build/primer/Grid/FlexGrid/__tests__/FlexGrid.int.data.ts +289 -0
- package/build/primer/Grid/FlexGrid/__tests__/FlexGrid.int.story.tsx +146 -0
- package/build/primer/Grid/FlexGrid/__tests__/FlexGrid.int.test.ts +46 -0
- package/build/primer/Grid/FlexGrid/index.ts +2 -0
- package/build/primer/Grid/index.ts +9 -0
- package/build/primer/Icon/Icon.part.ts +1289 -0
- package/build/primer/Icon/Icon.prop.ts +1337 -0
- package/build/primer/Icon/Icon.tsx +49 -0
- package/build/primer/Icon/__tests__/Icon.int.story.tsx +58 -0
- package/build/primer/Icon/__tests__/Icon.int.test.ts +13 -0
- package/build/primer/Icon/index.ts +2 -0
- package/build/primer/Label/Label.mdx +13 -0
- package/build/primer/Label/Label.prop.ts +31 -0
- package/build/primer/Label/Label.tsx +27 -0
- package/build/primer/Label/__tests__/Label.int.story.tsx +19 -0
- package/build/primer/Label/__tests__/Label.int.test.ts +9 -0
- package/build/primer/Label/index.ts +1 -0
- package/build/primer/Loader/Loader.mdx +31 -0
- package/build/primer/Loader/Loader.prop.ts +16 -0
- package/build/primer/Loader/Loader.tsx +43 -0
- package/build/primer/Loader/__tests__/Loader.int.story.tsx +34 -0
- package/build/primer/Loader/__tests__/Loader.int.test.ts +21 -0
- package/build/primer/Loader/index.ts +2 -0
- package/build/primer/Navigation/Menu/Menu.prop.ts +26 -0
- package/build/primer/Navigation/Menu/Menu.tsx +42 -0
- package/build/primer/Navigation/Menu/__tests__/Menu.int.story.tsx +55 -0
- package/build/primer/Navigation/Menu/__tests__/Menu.int.test.ts +57 -0
- package/build/primer/Navigation/Menu/index.ts +1 -0
- package/build/primer/Navigation/TabNav/TabNav.prop.ts +39 -0
- package/build/primer/Navigation/TabNav/TabNav.tsx +105 -0
- package/build/primer/Navigation/TabNav/__tests__/TabNav.int.story.tsx +168 -0
- package/build/primer/Navigation/TabNav/__tests__/TabNav.int.test.ts +55 -0
- package/build/primer/Navigation/TabNav/index.ts +2 -0
- package/build/primer/Navigation/UnderlineNav/UnderlineNav.prop.ts +41 -0
- package/build/primer/Navigation/UnderlineNav/UnderlineNav.tsx +106 -0
- package/build/primer/Navigation/UnderlineNav/__tests__/UnderlineNav.int.story.tsx +140 -0
- package/build/primer/Navigation/UnderlineNav/__tests__/UnderlineNav.int.test.ts +81 -0
- package/build/primer/Navigation/UnderlineNav/index.ts +2 -0
- package/build/primer/Navigation/index.ts +12 -0
- package/build/primer/Pagination/PreviousNext/PreviousNext.prop.ts +53 -0
- package/build/primer/Pagination/PreviousNext/PreviousNext.tsx +71 -0
- package/build/primer/Pagination/PreviousNext/__tests__/PreviousNext.int.story.tsx +48 -0
- package/build/primer/Pagination/PreviousNext/__tests__/PreviousNext.int.test.ts +15 -0
- package/build/primer/Pagination/PreviousNext/index.ts +2 -0
- package/build/primer/Pagination/index.ts +6 -0
- package/build/primer/Popover/Popover.mdx +190 -0
- package/build/primer/Popover/Popover.prop.ts +49 -0
- package/build/primer/Popover/Popover.tsx +80 -0
- package/build/primer/Popover/__tests__/Popover.int.story.tsx +216 -0
- package/build/primer/Popover/__tests__/Popover.int.test.ts +71 -0
- package/build/primer/Popover/index.ts +2 -0
- package/build/primer/Progress/Progress.mdx +31 -0
- package/build/primer/Progress/Progress.prop.ts +16 -0
- package/build/primer/Progress/Progress.tsx +19 -0
- package/build/primer/Progress/__tests__/Progress.int.story.tsx +28 -0
- package/build/primer/Progress/__tests__/Progress.int.test.ts +17 -0
- package/build/primer/Progress/index.ts +2 -0
- package/build/primer/Select/Select.mdx +19 -0
- package/build/primer/Select/Select.prop.ts +24 -0
- package/build/primer/Select/Select.tsx +58 -0
- package/build/primer/Select/__tests__/Select.int.story.tsx +38 -0
- package/build/primer/Select/__tests__/Select.int.test.ts +42 -0
- package/build/primer/Select/index.ts +2 -0
- package/build/primer/SelectMenu/SelectMenu.mdx +13 -0
- package/build/primer/SelectMenu/SelectMenu.prop.ts +25 -0
- package/build/primer/SelectMenu/SelectMenu.tsx +68 -0
- package/build/primer/SelectMenu/__tests__/SelectMenu.int.story.tsx +50 -0
- package/build/primer/SelectMenu/__tests__/SelectMenu.int.test.ts +56 -0
- package/build/primer/SelectMenu/index.ts +1 -0
- package/build/primer/Subhead/Subhead.mdx +20 -0
- package/build/primer/Subhead/Subhead.prop.ts +10 -0
- package/build/primer/Subhead/Subhead.tsx +15 -0
- package/build/primer/Subhead/__tests__/Subhead.int.story.tsx +23 -0
- package/build/primer/Subhead/__tests__/Subhead.int.test.ts +13 -0
- package/build/primer/Subhead/index.ts +1 -0
- package/build/primer/Toast/Toast.prop.ts +21 -0
- package/build/primer/Toast/Toast.tsx +38 -0
- package/build/primer/Toast/__tests__/Toast.int.story.tsx +50 -0
- package/build/primer/Toast/__tests__/Toast.int.test.ts +25 -0
- package/build/primer/Toast/index.ts +2 -0
- package/build/primer/index.ts +83 -0
- package/package.json +4 -4
- package/build/index.js +0 -12
- package/build/primer/Alert/Alert.js +0 -121
- package/build/primer/Alert/Alert.prop.js +0 -38
- package/build/primer/Alert/index.js +0 -19
- package/build/primer/Blankslate/Blankslate.js +0 -31
- package/build/primer/Blankslate/Blankslate.prop.js +0 -26
- package/build/primer/Blankslate/index.js +0 -19
- package/build/primer/Breadcrumb/Breadcrumb.js +0 -74
- package/build/primer/Breadcrumb/Breadcrumb.prop.js +0 -29
- package/build/primer/Breadcrumb/index.js +0 -19
- package/build/primer/Button/Button.js +0 -99
- package/build/primer/Button/Button.prop.js +0 -67
- package/build/primer/Button/index.js +0 -49
- package/build/primer/Dropdown/Dropdown.js +0 -104
- package/build/primer/Dropdown/Dropdown.prop.js +0 -34
- package/build/primer/Dropdown/index.js +0 -19
- package/build/primer/ErrorBoundary/ErrorBoundary.js +0 -59
- package/build/primer/ErrorBoundary/ErrorBoundary.prop.js +0 -11
- package/build/primer/ErrorBoundary/index.js +0 -12
- package/build/primer/Form/Checkbox/Checkbox.js +0 -49
- package/build/primer/Form/Checkbox/Checkbox.prop.js +0 -36
- package/build/primer/Form/Checkbox/index.js +0 -19
- package/build/primer/Form/Input/Input.js +0 -56
- package/build/primer/Form/Input/Input.prop.js +0 -43
- package/build/primer/Form/Input/index.js +0 -25
- package/build/primer/Form/Radio/Radio.js +0 -48
- package/build/primer/Form/Radio/Radio.prop.js +0 -34
- package/build/primer/Form/Radio/index.js +0 -19
- package/build/primer/Form/index.js +0 -24
- package/build/primer/Grid/DisplayTable/DisplayTable.js +0 -58
- package/build/primer/Grid/DisplayTable/DisplayTable.prop.js +0 -18
- package/build/primer/Grid/DisplayTable/index.js +0 -12
- package/build/primer/Grid/FlexGrid/FlexGrid.js +0 -244
- package/build/primer/Grid/FlexGrid/FlexGrid.prop.js +0 -49
- package/build/primer/Grid/FlexGrid/index.js +0 -25
- package/build/primer/Grid/index.js +0 -14
- package/build/primer/Icon/Icon.js +0 -70
- package/build/primer/Icon/Icon.part.js +0 -1295
- package/build/primer/Icon/Icon.prop.js +0 -689
- package/build/primer/Icon/index.js +0 -25
- package/build/primer/Label/Label.js +0 -31
- package/build/primer/Label/Label.prop.js +0 -34
- package/build/primer/Label/index.js +0 -12
- package/build/primer/Loader/Loader.js +0 -65
- package/build/primer/Loader/Loader.prop.js +0 -21
- package/build/primer/Loader/index.js +0 -19
- package/build/primer/Navigation/Menu/Menu.js +0 -70
- package/build/primer/Navigation/Menu/Menu.prop.js +0 -28
- package/build/primer/Navigation/Menu/index.js +0 -12
- package/build/primer/Navigation/TabNav/TabNav.js +0 -125
- package/build/primer/Navigation/TabNav/TabNav.prop.js +0 -36
- package/build/primer/Navigation/TabNav/index.js +0 -19
- package/build/primer/Navigation/UnderlineNav/UnderlineNav.js +0 -121
- package/build/primer/Navigation/UnderlineNav/UnderlineNav.prop.js +0 -41
- package/build/primer/Navigation/UnderlineNav/index.js +0 -25
- package/build/primer/Navigation/index.js +0 -17
- package/build/primer/Pagination/PreviousNext/PreviousNext.js +0 -76
- package/build/primer/Pagination/PreviousNext/PreviousNext.prop.js +0 -56
- package/build/primer/Pagination/PreviousNext/index.js +0 -19
- package/build/primer/Pagination/index.js +0 -11
- package/build/primer/Popover/Popover.js +0 -63
- package/build/primer/Popover/Popover.prop.js +0 -41
- package/build/primer/Popover/index.js +0 -25
- package/build/primer/Progress/Progress.js +0 -31
- package/build/primer/Progress/Progress.prop.js +0 -21
- package/build/primer/Progress/index.js +0 -19
- package/build/primer/Select/Select.js +0 -66
- package/build/primer/Select/Select.prop.js +0 -27
- package/build/primer/Select/index.js +0 -19
- package/build/primer/SelectMenu/SelectMenu.js +0 -95
- package/build/primer/SelectMenu/SelectMenu.prop.js +0 -26
- package/build/primer/SelectMenu/index.js +0 -12
- package/build/primer/Subhead/Subhead.js +0 -27
- package/build/primer/Subhead/Subhead.prop.js +0 -16
- package/build/primer/Subhead/index.js +0 -12
- package/build/primer/Toast/Toast.js +0 -55
- package/build/primer/Toast/Toast.prop.js +0 -26
- package/build/primer/Toast/index.js +0 -19
- package/build/primer/index.js +0 -87
- /package/build/primer/Form/Checkbox/{Checkbox.md → Checkbox.mdx} +0 -0
- /package/build/primer/Form/Checkbox/__tests__/__snapshots__/{Checkbox.int.test.js.snap → Checkbox.int.test.ts.snap} +0 -0
- /package/build/primer/Form/Input/{Input.md → Input.mdx} +0 -0
- /package/build/primer/Form/Input/__tests__/__snapshots__/{Input.int.test.js.snap → Input.int.test.ts.snap} +0 -0
- /package/build/primer/Form/Radio/{Radio.md → Radio.mdx} +0 -0
- /package/build/primer/Form/Radio/__tests__/__snapshots__/{Radio.int.test.js.snap → Radio.int.test.ts.snap} +0 -0
- /package/build/primer/Grid/DisplayTable/{DisplayTable.md → DisplayTable.mdx} +0 -0
- /package/build/primer/Grid/DisplayTable/__tests__/__snapshots__/{DisplayTable.int.test.js.snap → DisplayTable.int.test.ts.snap} +0 -0
- /package/build/primer/Grid/FlexGrid/{FlexGrid.md → FlexGrid.mdx} +0 -0
- /package/build/primer/Grid/FlexGrid/__tests__/__snapshots__/{FlexGrid.int.test.js.snap → FlexGrid.int.test.ts.snap} +0 -0
- /package/build/primer/Navigation/Menu/{Menu.md → Menu.mdx} +0 -0
- /package/build/primer/Navigation/Menu/__tests__/__snapshots__/{Menu.int.test.js.snap → Menu.int.test.ts.snap} +0 -0
- /package/build/primer/Navigation/TabNav/{TabNav.md → TabNav.mdx} +0 -0
- /package/build/primer/Navigation/TabNav/__tests__/__snapshots__/{TabNav.int.test.js.snap → TabNav.int.test.ts.snap} +0 -0
- /package/build/primer/Navigation/UnderlineNav/{UnderlineNav.md → UnderlineNav.mdx} +0 -0
- /package/build/primer/Navigation/UnderlineNav/__tests__/__snapshots__/{UnderlineNav.int.test.js.snap → UnderlineNav.int.test.ts.snap} +0 -0
- /package/build/primer/Pagination/PreviousNext/{PreviousNext.md → PreviousNext.mdx} +0 -0
- /package/build/primer/Pagination/PreviousNext/__tests__/__snapshots__/{PreviousNext.int.test.js.snap → PreviousNext.int.test.ts.snap} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { action } from 'storybook/actions'
|
|
2
|
+
import { withTests } from '@storybook/addon-jest'
|
|
3
|
+
import { breadcrumbState } from '../Breadcrumb.prop'
|
|
4
|
+
import results from '../../../../../../.jest-test-results.json'
|
|
5
|
+
|
|
6
|
+
const Breadcrumb =
|
|
7
|
+
process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
|
|
8
|
+
? require('../../../index').primer.Breadcrumb.Breadcrumb
|
|
9
|
+
: require('../../../../build').primer.Breadcrumb.Breadcrumb
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Primer/Atom/Breadcrumb',
|
|
13
|
+
component: Breadcrumb,
|
|
14
|
+
decorators: [withTests({ results })],
|
|
15
|
+
parameters: { jest: ['Breadcrumb.int.test.js'] },
|
|
16
|
+
excludeStories: ['ariaAttr', 'items', 'custom'],
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const ariaAttr = {
|
|
20
|
+
label: 'Breadcrumb',
|
|
21
|
+
current: 'page',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const items = [
|
|
25
|
+
{ href: '/fantastic-folder', text: 'Fantastic Folder', isSelected: false },
|
|
26
|
+
{ href: '/fantastic-folder/another-fantastic-folder', text: 'Another Fantastic folder', isSelected: false },
|
|
27
|
+
{ href: '', text: 'One More Fantastic Folder', isSelected: true },
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
export function custom(onClick) {
|
|
31
|
+
return <Breadcrumb ariaAttr={ariaAttr} items={items} onClick={onClick} />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function regular() {
|
|
35
|
+
return <Breadcrumb ariaAttr={ariaAttr} items={items} onClick={action('onClick')} />
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function inactive() {
|
|
39
|
+
return <Breadcrumb ariaAttr={ariaAttr} items={items} onClick={action('onClick')} state={breadcrumbState.inactive} />
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { items, regular, inactive } from './Breadcrumb.int.story'
|
|
2
|
+
|
|
3
|
+
jest.mock('@papillonarts/library/array', () => ({
|
|
4
|
+
getIndexItems: () => {},
|
|
5
|
+
getIndexItemsWithSelected: () => {},
|
|
6
|
+
}))
|
|
7
|
+
|
|
8
|
+
const libraryArrayMockObject = require('@papillonarts/library/array')
|
|
9
|
+
|
|
10
|
+
describe('<Breadcrumb />', () => {
|
|
11
|
+
const indexItemsDataObject = [
|
|
12
|
+
{ ...items[0], index: 0 },
|
|
13
|
+
{ ...items[1], index: 1 },
|
|
14
|
+
{ ...items[2], index: 2 },
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
const newIndexItemsWithSelectedDataObject = [
|
|
18
|
+
{ ...items[0], index: 0, isSelected: true },
|
|
19
|
+
{ ...items[1], index: 1, isSelected: false },
|
|
20
|
+
{ ...items[2], index: 2, isSelected: false },
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
jest.spyOn(libraryArrayMockObject, 'getIndexItems').mockReturnValue(indexItemsDataObject)
|
|
25
|
+
|
|
26
|
+
jest.spyOn(libraryArrayMockObject, 'getIndexItemsWithSelected').mockReturnValue(newIndexItemsWithSelectedDataObject)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
afterEach(() => jest.clearAllMocks())
|
|
30
|
+
|
|
31
|
+
describe('Render', () => {
|
|
32
|
+
test('must match regular()', () => {
|
|
33
|
+
expect(global.renderToJSON(regular())).toMatchSnapshot()
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test('must match inactive()', () => {
|
|
37
|
+
expect(global.renderToJSON(inactive())).toMatchSnapshot()
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
})
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
> Buttons are used for actions, like in forms, while textual hyperlinks are used for destinations, or moving from one page to another.
|
|
4
|
+
|
|
5
|
+
# Variants
|
|
6
|
+
|
|
7
|
+
> - DefaultButton, DefaultSmallButton, DefaultLargeButton, DefaultInactiveButton, DefaultIconButtonLeftAligned, DefaultIconButtonRightAligned, DefaultLinkButton
|
|
8
|
+
>
|
|
9
|
+
> - PrimaryButton, PrimarySmallButton, PrimaryLargeButton, PrimaryInactiveButton, PrimaryIconButtonLeftAligned, PrimaryIconButtonRightAligned
|
|
10
|
+
>
|
|
11
|
+
> - DangerButton, DangerSmallButton, DangerLargeButton, DangerInactiveButton, DangerIconButtonLeftAligned, DangerIconButtonRightAligned
|
|
12
|
+
>
|
|
13
|
+
> - OutlineButton, OutlineSmallButton, OutlineLargeButton, OutlineInactiveButton, OutlineIconButtonLeftAligned, OutlineIconButtonRightAligned
|
|
14
|
+
>
|
|
15
|
+
> - BlueButton, BlueSmallButton, BlueLargeButton, BlueInactiveButton, BlueIconButtonLeftAligned, BlueIconButtonRightAligned
|
|
16
|
+
>
|
|
17
|
+
> - OrangeButton, OrangeSmallButton, OrangeLargeButton, OrangeInactiveButton, OrangeIconButtonLeftAligned, OrangeIconButtonRightAligned
|
|
18
|
+
|
|
19
|
+
## DefaultButton
|
|
20
|
+
|
|
21
|
+
```jsx
|
|
22
|
+
<Button text="Default button" onClick={action('onClick')} />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## DefaultSmallButton
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
<Button text="Default small button" size={buttonSize.small} onClick={action('onClick')} />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## DefaultLargeButton
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
<Button text="Default large button" size={buttonSize.large} onClick={action('onClick')} />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## DefaultInactiveButton
|
|
38
|
+
|
|
39
|
+
```jsx
|
|
40
|
+
<Button text="Default inactive button" state={buttonState.inactive} onClick={action('onClick')} />
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## DefaultIconButtonLeftAligned
|
|
44
|
+
|
|
45
|
+
```jsx
|
|
46
|
+
<Button text="Default icon button" icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## DefaultIconButtonRightAligned
|
|
50
|
+
|
|
51
|
+
```jsx
|
|
52
|
+
<Button text="Default icon button" icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## DefaultLinkButton
|
|
56
|
+
|
|
57
|
+
```jsx
|
|
58
|
+
<Button element={buttonElement.a} href="#url" text="Default link button" onClick={action('onClick')} />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## PrimaryButton
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
<Button text="Primary button" variant={buttonVariant.primary} onClick={action('onClick')} />
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## PrimarySmallButton
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
<Button text="Primary small button" variant={buttonVariant.primary} size={buttonSize.small} onClick={action('onClick')} />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## PrimaryLargeButton
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
<Button text="Primary large button" variant={buttonVariant.primary} size={buttonSize.large} onClick={action('onClick')} />
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## PrimaryInactiveButton
|
|
80
|
+
|
|
81
|
+
```jsx
|
|
82
|
+
<Button text="Primary inactive button" variant={buttonVariant.primary} state={buttonState.inactive} onClick={action('onClick')} />
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## PrimaryIconButtonLeftAligned
|
|
86
|
+
|
|
87
|
+
```jsx
|
|
88
|
+
<Button text="Primary icon button" variant={buttonVariant.primary} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## PrimaryIconButtonRightAligned
|
|
92
|
+
|
|
93
|
+
```jsx
|
|
94
|
+
<Button text="Primary icon button" variant={buttonVariant.primary} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## DangerButton
|
|
98
|
+
|
|
99
|
+
```jsx
|
|
100
|
+
<Button text="Danger button" variant={buttonVariant.danger} onClick={action('onClick')} />
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## DangerSmallButton
|
|
104
|
+
|
|
105
|
+
```jsx
|
|
106
|
+
<Button text="Danger small button" variant={buttonVariant.danger} size={buttonSize.small} onClick={action('onClick')} />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## DangerLargeButton
|
|
110
|
+
|
|
111
|
+
```jsx
|
|
112
|
+
<Button text="Danger large button" variant={buttonVariant.danger} size={buttonSize.large} onClick={action('onClick')} />
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## DangerInactiveButton
|
|
116
|
+
|
|
117
|
+
```jsx
|
|
118
|
+
<Button text="Danger inactive button" variant={buttonVariant.danger} state={buttonState.inactive} onClick={action('onClick')} />
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## DangerIconButtonLeftAligned
|
|
122
|
+
|
|
123
|
+
```jsx
|
|
124
|
+
<Button text="Danger icon button" variant={buttonVariant.danger} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## DangerIconButtonRightAligned
|
|
128
|
+
|
|
129
|
+
```jsx
|
|
130
|
+
<Button text="Danger icon button" variant={buttonVariant.danger} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## OutlineButton
|
|
134
|
+
|
|
135
|
+
```jsx
|
|
136
|
+
<Button text="Outline button" variant={buttonVariant.outline} onClick={action('onClick')} />
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## OutlineSmallButton
|
|
140
|
+
|
|
141
|
+
```jsx
|
|
142
|
+
<Button text="Outline small button" variant={buttonVariant.outline} size={buttonSize.small} onClick={action('onClick')} />
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## OutlineLargeButton
|
|
146
|
+
|
|
147
|
+
```jsx
|
|
148
|
+
<Button text="Outline large button" variant={buttonVariant.outline} size={buttonSize.large} onClick={action('onClick')} />
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## OutlineInactiveButton
|
|
152
|
+
|
|
153
|
+
```jsx
|
|
154
|
+
<Button text="Outline inactive button" variant={buttonVariant.outline} state={buttonState.inactive} onClick={action('onClick')} />
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## OutlineIconButtonLeftAligned
|
|
158
|
+
|
|
159
|
+
```jsx
|
|
160
|
+
<Button text="Outline icon button" variant={buttonVariant.outline} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## OutlineIconButtonRightAligned
|
|
164
|
+
|
|
165
|
+
```jsx
|
|
166
|
+
<Button text="Outline icon button" variant={buttonVariant.outline} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## BlueButton
|
|
170
|
+
|
|
171
|
+
```jsx
|
|
172
|
+
<Button text="Blue button" variant={buttonVariant.blue} onClick={action('onClick')} />
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## BlueSmallButton
|
|
176
|
+
|
|
177
|
+
```jsx
|
|
178
|
+
<Button text="Blue small button" variant={buttonVariant.blue} size={buttonSize.small} onClick={action('onClick')} />
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## BlueLargeButton
|
|
182
|
+
|
|
183
|
+
```jsx
|
|
184
|
+
<Button text="Blue large button" variant={buttonVariant.blue} size={buttonSize.large} onClick={action('onClick')} />
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## BlueInactiveButton
|
|
188
|
+
|
|
189
|
+
```jsx
|
|
190
|
+
<Button text="Blue inactive button" variant={buttonVariant.blue} state={buttonState.inactive} onClick={action('onClick')} />
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## BlueIconButtonLeftAligned
|
|
194
|
+
|
|
195
|
+
```jsx
|
|
196
|
+
<Button text="Blue icon button" variant={buttonVariant.blue} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## BlueIconButtonRightAligned
|
|
200
|
+
|
|
201
|
+
```jsx
|
|
202
|
+
<Button text="Blue icon button" variant={buttonVariant.blue} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## OrangeButton
|
|
206
|
+
|
|
207
|
+
```jsx
|
|
208
|
+
<Button text="Orange button" variant={buttonVariant.orange} onClick={action('onClick')} />
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## OrangeSmallButton
|
|
212
|
+
|
|
213
|
+
```jsx
|
|
214
|
+
<Button text="Orange small button" variant={buttonVariant.orange} size={buttonSize.small} onClick={action('onClick')} />
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## OrangeLargeButton
|
|
218
|
+
|
|
219
|
+
```jsx
|
|
220
|
+
<Button text="Orange large button" variant={buttonVariant.orange} size={buttonSize.large} onClick={action('onClick')} />
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## OrangeInactiveButton
|
|
224
|
+
|
|
225
|
+
```jsx
|
|
226
|
+
<Button text="Orange inactive button" variant={buttonVariant.orange} state={buttonState.inactive} onClick={action('onClick')} />
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## OrangeIconButtonLeftAligned
|
|
230
|
+
|
|
231
|
+
```jsx
|
|
232
|
+
<Button text="Orange icon button" variant={buttonVariant.orange} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## OrangeIconButtonRightAligned
|
|
236
|
+
|
|
237
|
+
```jsx
|
|
238
|
+
<Button text="Orange icon button" variant={buttonVariant.orange} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
239
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { IconNameType } from '../Icon/Icon.prop'
|
|
2
|
+
|
|
3
|
+
export const buttonElement = {
|
|
4
|
+
button: 'button',
|
|
5
|
+
a: 'a',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const buttonVariant = {
|
|
9
|
+
default: 'default',
|
|
10
|
+
primary: 'primary',
|
|
11
|
+
danger: 'danger',
|
|
12
|
+
outline: 'outline',
|
|
13
|
+
blue: 'blue',
|
|
14
|
+
orange: 'orange',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const buttonSize = {
|
|
18
|
+
small: 'small',
|
|
19
|
+
normal: 'normal',
|
|
20
|
+
large: 'large',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const buttonState = {
|
|
24
|
+
active: 'active',
|
|
25
|
+
inactive: 'inactive',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const iconAlignment = {
|
|
29
|
+
left: 'left',
|
|
30
|
+
right: 'right',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const buttonInputType = {
|
|
34
|
+
file: 'file',
|
|
35
|
+
submit: 'submit',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const defaultProps = {
|
|
39
|
+
dataTest: null,
|
|
40
|
+
id: null,
|
|
41
|
+
className: null,
|
|
42
|
+
element: buttonElement.button,
|
|
43
|
+
href: null,
|
|
44
|
+
variant: buttonVariant.default,
|
|
45
|
+
size: buttonSize.normal,
|
|
46
|
+
state: buttonState.active,
|
|
47
|
+
icon: null,
|
|
48
|
+
inputType: null,
|
|
49
|
+
autoFocus: false,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface IconType {
|
|
53
|
+
name?: IconNameType
|
|
54
|
+
alignment?: typeof iconAlignment.left | typeof iconAlignment.right
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ButtonProps {
|
|
58
|
+
dataTest?: string
|
|
59
|
+
id?: string
|
|
60
|
+
className?: string
|
|
61
|
+
element?: typeof buttonElement.button | typeof buttonElement.a
|
|
62
|
+
href?: string
|
|
63
|
+
text: string
|
|
64
|
+
variant?:
|
|
65
|
+
| typeof buttonVariant.default
|
|
66
|
+
| typeof buttonVariant.primary
|
|
67
|
+
| typeof buttonVariant.danger
|
|
68
|
+
| typeof buttonVariant.outline
|
|
69
|
+
| typeof buttonVariant.blue
|
|
70
|
+
| typeof buttonVariant.orange
|
|
71
|
+
size?: typeof buttonSize.small | typeof buttonSize.normal | typeof buttonSize.large
|
|
72
|
+
state?: typeof buttonState.active | typeof buttonState.inactive
|
|
73
|
+
icon?: IconType
|
|
74
|
+
onClick: (value?: string) => void
|
|
75
|
+
inputType?: typeof buttonInputType.file | typeof buttonInputType.submit
|
|
76
|
+
autoFocus?: boolean
|
|
77
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import cx from 'classnames'
|
|
2
|
+
import { useRef } from '@papillonarts/library/hooks'
|
|
3
|
+
import utilityStyles from '@papillonarts/css/build/primer/utilities/margin.scss'
|
|
4
|
+
import {
|
|
5
|
+
ButtonProps,
|
|
6
|
+
defaultProps,
|
|
7
|
+
buttonElement,
|
|
8
|
+
buttonVariant,
|
|
9
|
+
buttonSize,
|
|
10
|
+
buttonState,
|
|
11
|
+
iconAlignment,
|
|
12
|
+
buttonInputType,
|
|
13
|
+
} from './Button.prop'
|
|
14
|
+
import styles from './Button.scss'
|
|
15
|
+
import { Icon, iconSize } from '../Icon'
|
|
16
|
+
|
|
17
|
+
export function Button({
|
|
18
|
+
dataTest = defaultProps.dataTest,
|
|
19
|
+
id = defaultProps.id,
|
|
20
|
+
className = defaultProps.className,
|
|
21
|
+
element = defaultProps.element,
|
|
22
|
+
href = defaultProps.href,
|
|
23
|
+
text,
|
|
24
|
+
variant = defaultProps.variant,
|
|
25
|
+
size = defaultProps.size,
|
|
26
|
+
state = defaultProps.state,
|
|
27
|
+
icon = defaultProps.icon,
|
|
28
|
+
onClick,
|
|
29
|
+
inputType = defaultProps.inputType,
|
|
30
|
+
autoFocus = defaultProps.autoFocus,
|
|
31
|
+
}: ButtonProps) {
|
|
32
|
+
const stateProps = state === buttonState.inactive ? { ...{ disabled: 'true', 'aria-disabled': 'true' } } : null
|
|
33
|
+
const fileInputRef = useRef(null)
|
|
34
|
+
|
|
35
|
+
if (element === buttonElement.button) {
|
|
36
|
+
return (
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
<button
|
|
39
|
+
data-test={dataTest}
|
|
40
|
+
id={id}
|
|
41
|
+
className={cx(className, styles.btn, {
|
|
42
|
+
[styles['btn-sm']]: size === buttonSize.small,
|
|
43
|
+
[styles['btn-large']]: size === buttonSize.large,
|
|
44
|
+
[styles['btn-primary']]: variant === buttonVariant.primary,
|
|
45
|
+
[styles['btn-danger']]: variant === buttonVariant.danger,
|
|
46
|
+
[styles['btn-outline']]: variant === buttonVariant.outline,
|
|
47
|
+
[styles['btn-blue']]: variant === buttonVariant.blue,
|
|
48
|
+
[styles['btn-orange']]: variant === buttonVariant.orange,
|
|
49
|
+
[styles['button-inactive']]: state === buttonState.inactive,
|
|
50
|
+
})}
|
|
51
|
+
type="button"
|
|
52
|
+
autoFocus={autoFocus} // eslint-disable-line
|
|
53
|
+
onClick={() => {
|
|
54
|
+
if (inputType === buttonInputType.file) {
|
|
55
|
+
fileInputRef.current.click()
|
|
56
|
+
}
|
|
57
|
+
if (!inputType) {
|
|
58
|
+
onClick()
|
|
59
|
+
}
|
|
60
|
+
}}
|
|
61
|
+
{...stateProps}
|
|
62
|
+
>
|
|
63
|
+
{icon?.alignment === iconAlignment.left && <Icon className={utilityStyles['mr-2']} icon={icon.name} size={iconSize.small} />}
|
|
64
|
+
{text}
|
|
65
|
+
{icon?.alignment === iconAlignment.right && <Icon className={utilityStyles['ml-2']} icon={icon.name} size={iconSize.small} />}
|
|
66
|
+
{inputType && inputType === buttonInputType.file && (
|
|
67
|
+
<input
|
|
68
|
+
onChange={() => {
|
|
69
|
+
onClick(fileInputRef.current.files)
|
|
70
|
+
}}
|
|
71
|
+
ref={fileInputRef}
|
|
72
|
+
type="file"
|
|
73
|
+
autoFocus={autoFocus} // eslint-disable-line
|
|
74
|
+
multiple
|
|
75
|
+
style={{ display: 'none' }}
|
|
76
|
+
/>
|
|
77
|
+
)}
|
|
78
|
+
</button>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
if (element === buttonElement.a) {
|
|
84
|
+
return (
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
<a className={cx(className, styles.btn)} href={href} role="button" onClick={onClick} {...stateProps}>
|
|
87
|
+
{text}
|
|
88
|
+
</a>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { action } from 'storybook/actions'
|
|
2
|
+
import { withTests } from '@storybook/addon-jest'
|
|
3
|
+
import { buttonElement, buttonVariant, buttonSize, buttonState, iconAlignment } from '../Button.prop'
|
|
4
|
+
import { iconName } from '../../Icon/Icon.prop'
|
|
5
|
+
import results from '../../../../../../.jest-test-results.json'
|
|
6
|
+
|
|
7
|
+
const Button =
|
|
8
|
+
process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
|
|
9
|
+
? require('../../../index').primer.Button.Button
|
|
10
|
+
: require('../../../../build').primer.Button.Button
|
|
11
|
+
|
|
12
|
+
const plusIconLeftAligned = { name: iconName.Plus16, alignment: iconAlignment.left }
|
|
13
|
+
const plusIconRightAligned = { name: iconName.Plus16, alignment: iconAlignment.right }
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Primer/Atom/Button',
|
|
17
|
+
component: Button,
|
|
18
|
+
decorators: [withTests({ results })],
|
|
19
|
+
parameters: { jest: ['Button.int.test.js'] },
|
|
20
|
+
excludeStories: ['custom'],
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function custom(element, onClick) {
|
|
24
|
+
return <Button text="Custom button" element={element} onClick={onClick} />
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function defaultNormal() {
|
|
28
|
+
return <Button text="Default normal button" onClick={action('onClick')} />
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function defaultSmall() {
|
|
32
|
+
return <Button text="Default small button" size={buttonSize.small} onClick={action('onClick')} />
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function defaultLarge() {
|
|
36
|
+
return <Button text="Default large button" size={buttonSize.large} onClick={action('onClick')} />
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function defaultInactive() {
|
|
40
|
+
return <Button text="Default inactive button" state={buttonState.inactive} onClick={action('onClick')} />
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function defaultIconLeftAligned() {
|
|
44
|
+
return <Button text="Default icon button" icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function defaultIconRightAligned() {
|
|
48
|
+
return <Button text="Default icon button" icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function defaultLink() {
|
|
52
|
+
return <Button element={buttonElement.a} href="#url" text="Default link button" onClick={action('onClick')} />
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function primary() {
|
|
56
|
+
return <Button text="Primary button" variant={buttonVariant.primary} onClick={action('onClick')} />
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function primarySmall() {
|
|
60
|
+
return <Button text="Primary small button" variant={buttonVariant.primary} size={buttonSize.small} onClick={action('onClick')} />
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function primaryLarge() {
|
|
64
|
+
return <Button text="Primary large button" variant={buttonVariant.primary} size={buttonSize.large} onClick={action('onClick')} />
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function primaryInactive() {
|
|
68
|
+
return <Button text="Primary inactive button" variant={buttonVariant.primary} state={buttonState.inactive} onClick={action('onClick')} />
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function primaryIconLeftAligned() {
|
|
72
|
+
return <Button text="Primary icon button" variant={buttonVariant.primary} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function primaryIconRightAligned() {
|
|
76
|
+
return <Button text="Primary icon button" variant={buttonVariant.primary} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function danger() {
|
|
80
|
+
return <Button text="Danger button" variant={buttonVariant.danger} onClick={action('onClick')} />
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function dangerSmall() {
|
|
84
|
+
return <Button text="Danger small button" variant={buttonVariant.danger} size={buttonSize.small} onClick={action('onClick')} />
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function dangerLarge() {
|
|
88
|
+
return <Button text="Danger large button" variant={buttonVariant.danger} size={buttonSize.large} onClick={action('onClick')} />
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function dangerInactive() {
|
|
92
|
+
return <Button text="Danger inactive button" variant={buttonVariant.danger} state={buttonState.inactive} onClick={action('onClick')} />
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function dangerIconLeftAligned() {
|
|
96
|
+
return <Button text="Danger icon button" variant={buttonVariant.danger} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function dangerIconRightAligned() {
|
|
100
|
+
return <Button text="Danger icon button" variant={buttonVariant.danger} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function outline() {
|
|
104
|
+
return <Button text="Outline button" variant={buttonVariant.outline} onClick={action('onClick')} />
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function outlineSmall() {
|
|
108
|
+
return <Button text="Outline small button" variant={buttonVariant.outline} size={buttonSize.small} onClick={action('onClick')} />
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function outlineLarge() {
|
|
112
|
+
return <Button text="Outline large button" variant={buttonVariant.outline} size={buttonSize.large} onClick={action('onClick')} />
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function outlineInactive() {
|
|
116
|
+
return <Button text="Outline inactive button" variant={buttonVariant.outline} state={buttonState.inactive} onClick={action('onClick')} />
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function outlineIconLeftAligned() {
|
|
120
|
+
return <Button text="Outline icon button" variant={buttonVariant.outline} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function outlineIconRightAligned() {
|
|
124
|
+
return <Button text="Outline icon button" variant={buttonVariant.outline} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function blue() {
|
|
128
|
+
return <Button text="Blue button" variant={buttonVariant.blue} onClick={action('onClick')} />
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function blueSmall() {
|
|
132
|
+
return <Button text="Blue small button" variant={buttonVariant.blue} size={buttonSize.small} onClick={action('onClick')} />
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function blueLarge() {
|
|
136
|
+
return <Button text="Blue large button" variant={buttonVariant.blue} size={buttonSize.large} onClick={action('onClick')} />
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function blueInactive() {
|
|
140
|
+
return <Button text="Blue inactive button" variant={buttonVariant.blue} state={buttonState.inactive} onClick={action('onClick')} />
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function blueIconLeftAligned() {
|
|
144
|
+
return <Button text="Blue icon button" variant={buttonVariant.blue} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function blueIconRightAligned() {
|
|
148
|
+
return <Button text="Blue icon button" variant={buttonVariant.blue} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function orange() {
|
|
152
|
+
return <Button text="Orange button" variant={buttonVariant.orange} onClick={action('onClick')} />
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function orangeSmall() {
|
|
156
|
+
return <Button text="Orange small button" variant={buttonVariant.orange} size={buttonSize.small} onClick={action('onClick')} />
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function orangeLarge() {
|
|
160
|
+
return <Button text="Orange large button" variant={buttonVariant.orange} size={buttonSize.large} onClick={action('onClick')} />
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function orangeInactive() {
|
|
164
|
+
return <Button text="Orange inactive button" variant={buttonVariant.orange} state={buttonState.inactive} onClick={action('onClick')} />
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function orangeIconLeftAligned() {
|
|
168
|
+
return <Button text="Orange icon button" variant={buttonVariant.orange} icon={plusIconLeftAligned} onClick={action('onClick')} />
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function orangeIconRightAligned() {
|
|
172
|
+
return <Button text="Orange icon button" variant={buttonVariant.orange} icon={plusIconRightAligned} onClick={action('onClick')} />
|
|
173
|
+
}
|