@faststore/ui 2.0.33-alpha.0 → 2.0.34-alpha.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.
Files changed (100) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/components/molecules/Accordion/AccordionItem.d.ts +1 -7
  3. package/dist/components/molecules/Accordion/AccordionItem.js +1 -7
  4. package/dist/components/molecules/Accordion/AccordionItem.js.map +1 -1
  5. package/package.json +6 -19
  6. package/src/components/molecules/Accordion/AccordionItem.tsx +42 -42
  7. package/dist/components/atoms/Incentive/stories/assets/Icons.d.ts +0 -2
  8. package/dist/components/atoms/Incentive/stories/assets/Icons.js +0 -6
  9. package/dist/components/atoms/Incentive/stories/assets/Icons.js.map +0 -1
  10. package/dist/components/molecules/Dropdown/stories/assets/Caret.d.ts +0 -2
  11. package/dist/components/molecules/Dropdown/stories/assets/Caret.js +0 -4
  12. package/dist/components/molecules/Dropdown/stories/assets/Caret.js.map +0 -1
  13. package/dist/components/molecules/PaymentMethods/stories/assets/Icons.d.ts +0 -9
  14. package/dist/components/molecules/PaymentMethods/stories/assets/Icons.js +0 -26
  15. package/dist/components/molecules/PaymentMethods/stories/assets/Icons.js.map +0 -1
  16. package/dist/components/molecules/QuantitySelector/stories/assets/Icons.d.ts +0 -7
  17. package/dist/components/molecules/QuantitySelector/stories/assets/Icons.js +0 -11
  18. package/dist/components/molecules/QuantitySelector/stories/assets/Icons.js.map +0 -1
  19. package/dist/components/molecules/SearchInput/stories/assets/CustomIcon.d.ts +0 -3
  20. package/dist/components/molecules/SearchInput/stories/assets/CustomIcon.js +0 -7
  21. package/dist/components/molecules/SearchInput/stories/assets/CustomIcon.js.map +0 -1
  22. package/src/components/atoms/Badge/Badge.stories.mdx +0 -156
  23. package/src/components/atoms/Incentive/stories/Incentive.mdx +0 -24
  24. package/src/components/atoms/Incentive/stories/Incentive.stories.tsx +0 -26
  25. package/src/components/atoms/Incentive/stories/assets/Icons.tsx +0 -14
  26. package/src/components/atoms/Input/Input.stories.mdx +0 -34
  27. package/src/components/atoms/Label/Label.stories.mdx +0 -65
  28. package/src/components/atoms/Link/Link.stories.mdx +0 -134
  29. package/src/components/atoms/Popover/stories/Popover.mdx +0 -18
  30. package/src/components/atoms/Popover/stories/Popover.stories.tsx +0 -50
  31. package/src/components/atoms/Radio/Radio.stories.mdx +0 -101
  32. package/src/components/atoms/Skeleton/stories/Skeleton.mdx +0 -18
  33. package/src/components/atoms/Skeleton/stories/Skeleton.stories.tsx +0 -21
  34. package/src/components/atoms/Slider/stories/Slider.mdx +0 -29
  35. package/src/components/atoms/Slider/stories/Slider.stories.tsx +0 -32
  36. package/src/components/atoms/Spinner/stories/Spinner.mdx +0 -18
  37. package/src/components/atoms/Spinner/stories/Spinner.stories.tsx +0 -21
  38. package/src/components/atoms/TextArea/stories/TextArea.mdx +0 -22
  39. package/src/components/atoms/TextArea/stories/TextArea.stories.tsx +0 -49
  40. package/src/components/molecules/Accordion/stories/Accordion.mdx +0 -62
  41. package/src/components/molecules/Accordion/stories/Accordion.stories.tsx +0 -160
  42. package/src/components/molecules/AggregateRating/stories/AggregateRating.mdx +0 -33
  43. package/src/components/molecules/AggregateRating/stories/AggregateRating.stories.tsx +0 -111
  44. package/src/components/molecules/Alert/stories/Alert.mdx +0 -26
  45. package/src/components/molecules/Alert/stories/Alert.stories.tsx +0 -36
  46. package/src/components/molecules/Banner/stories/Banner.mdx +0 -63
  47. package/src/components/molecules/Banner/stories/Banner.stories.tsx +0 -66
  48. package/src/components/molecules/Breadcrumb/stories/Breadcrumb.mdx +0 -27
  49. package/src/components/molecules/Breadcrumb/stories/Breadcrumb.stories.tsx +0 -55
  50. package/src/components/molecules/Bullets/stories/Bullets.mdx +0 -25
  51. package/src/components/molecules/Bullets/stories/Bullets.stories.tsx +0 -64
  52. package/src/components/molecules/Card/stories/Card.mdx +0 -54
  53. package/src/components/molecules/Card/stories/Card.stories.tsx +0 -63
  54. package/src/components/molecules/Carousel/stories/Carousel.mdx +0 -35
  55. package/src/components/molecules/Carousel/stories/Carousel.stories.tsx +0 -56
  56. package/src/components/molecules/CartItem/stories/CartItem.mdx +0 -79
  57. package/src/components/molecules/CartItem/stories/CartItem.stories.tsx +0 -70
  58. package/src/components/molecules/CheckboxField/CheckboxField.stories.mdx +0 -38
  59. package/src/components/molecules/DiscountBadge/DiscountBadge.stories.mdx +0 -38
  60. package/src/components/molecules/Dropdown/stories/Dropdown.mdx +0 -63
  61. package/src/components/molecules/Dropdown/stories/Dropdown.stories.tsx +0 -94
  62. package/src/components/molecules/Dropdown/stories/assets/Caret.tsx +0 -19
  63. package/src/components/molecules/Form/stories/Form.mdx +0 -23
  64. package/src/components/molecules/Form/stories/Form.stories.tsx +0 -65
  65. package/src/components/molecules/Gift/stories/Gift.mdx +0 -40
  66. package/src/components/molecules/Gift/stories/Gift.stories.tsx +0 -66
  67. package/src/components/molecules/IconButton/IconButton.stories.mdx +0 -46
  68. package/src/components/molecules/InputField/InputField.stories.mdx +0 -116
  69. package/src/components/molecules/LoadingButton/stories/LoadingButton.mdx +0 -20
  70. package/src/components/molecules/LoadingButton/stories/LoadingButton.stories.tsx +0 -36
  71. package/src/components/molecules/Modal/stories/Modal.mdx +0 -18
  72. package/src/components/molecules/Modal/stories/Modal.stories.tsx +0 -45
  73. package/src/components/molecules/OrderSummary/stories/OrderSummary.mdx +0 -29
  74. package/src/components/molecules/OrderSummary/stories/OrderSummary.stories.tsx +0 -29
  75. package/src/components/molecules/PaymentMethods/stories/PaymentMethods.mdx +0 -19
  76. package/src/components/molecules/PaymentMethods/stories/PaymentMethods.stories.tsx +0 -41
  77. package/src/components/molecules/PaymentMethods/stories/assets/Icons.tsx +0 -89
  78. package/src/components/molecules/PriceRange/stories/PriceRange.mdx +0 -28
  79. package/src/components/molecules/PriceRange/stories/PriceRange.stories.tsx +0 -45
  80. package/src/components/molecules/ProductCard/stories/ProductCard.mdx +0 -55
  81. package/src/components/molecules/ProductCard/stories/ProductCard.stories.tsx +0 -60
  82. package/src/components/molecules/ProductTitle/stories/ProductTitle.mdx +0 -26
  83. package/src/components/molecules/ProductTitle/stories/ProductTitle.stories.tsx +0 -27
  84. package/src/components/molecules/QuantitySelector/stories/QuantitySelector.mdx +0 -26
  85. package/src/components/molecules/QuantitySelector/stories/QuantitySelector.stories.tsx +0 -77
  86. package/src/components/molecules/QuantitySelector/stories/assets/Icons.tsx +0 -52
  87. package/src/components/molecules/RadioField/RadioField.stories.mdx +0 -38
  88. package/src/components/molecules/RadioGroup/stories/RadioGroup.mdx +0 -39
  89. package/src/components/molecules/RadioGroup/stories/RadioGroup.stories.tsx +0 -108
  90. package/src/components/molecules/SearchInput/stories/SearchInput.mdx +0 -28
  91. package/src/components/molecules/SearchInput/stories/SearchInput.stories.tsx +0 -45
  92. package/src/components/molecules/SearchInput/stories/assets/CustomIcon.tsx +0 -22
  93. package/src/components/molecules/SkuSelector/stories/SkuSelector.mdx +0 -24
  94. package/src/components/molecules/SkuSelector/stories/SkuSelector.stories.tsx +0 -52
  95. package/src/components/molecules/Tag/Tag.stories.mdx +0 -31
  96. package/src/components/organisms/OutOfStock/stories/OutOfStock.mdx +0 -37
  97. package/src/components/organisms/OutOfStock/stories/OutOfStock.stories.tsx +0 -71
  98. package/src/components/organisms/Tiles/stories/Tiles.mdx +0 -39
  99. package/src/components/organisms/Tiles/stories/Tiles.stories.tsx +0 -38
  100. package/src/typings/utils.d.ts +0 -5
@@ -1,65 +0,0 @@
1
- import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
-
3
- import { Label } from '@faststore/components'
4
-
5
- <Meta
6
- title="Atoms/Label"
7
- component={Label}
8
- argTypes={{
9
- children: {
10
- control: { type: 'text' },
11
- defaultValue: 'Label',
12
- },
13
- }}
14
- />
15
-
16
- export const Template = (args) => <Label {...args} />
17
-
18
- <header>
19
-
20
- # Label
21
-
22
- A label allows the user to understand a single element. It is often in the form of information, and can have an implied instruction. Usually used to describe the meaning of input fields.
23
-
24
- </header>
25
-
26
- ## Overview
27
-
28
- <Canvas>
29
- <Story
30
- name="overview-label"
31
- args={{
32
- id: 'overview-label',
33
- }}
34
- >
35
- {Template.bind({})}
36
- </Story>
37
- </Canvas>
38
-
39
- ---
40
-
41
- ## Usage
42
-
43
- ```jsx
44
- import Label from '@faststore/ui'
45
- ```
46
-
47
- <Canvas>
48
- <Story
49
- name="default"
50
- args={{
51
- id: 'label-default',
52
- }}
53
- >
54
- {Template.bind({})}
55
- </Story>
56
- </Canvas>
57
-
58
- <ArgsTable story="default" />
59
-
60
- ## CSS Selectors
61
-
62
- ```css
63
- [data-fs-label] {
64
- }
65
- ```
@@ -1,134 +0,0 @@
1
- import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
-
3
- import { Link } from '@faststore/components'
4
-
5
- <Meta
6
- title="Atoms/Link/Default"
7
- component={Link}
8
- argTypes={{
9
- children: {
10
- name: 'content',
11
- },
12
- variant: {
13
- options: [
14
- 'default',
15
- 'display',
16
- 'footer',
17
- 'inline',
18
- ],
19
- control: { type: 'select' },
20
- },
21
- size: {
22
- options: [
23
- 'regular',
24
- 'small',
25
- ],
26
- control: { type: 'select' },
27
- defaultValue: 'regular',
28
- },
29
- inverse: {
30
- type: {
31
- name: 'boolean',
32
- },
33
- description: 'Should use inverse color',
34
- defaultValue: false,
35
- },
36
- as: {
37
- description: 'Html tag or Link component to be used as Polymorphic way',
38
- as: 'a',
39
- },
40
- testId: {
41
- table: {
42
- disable: true,
43
- },
44
- },
45
- }}
46
- />
47
-
48
- export const Template = ({ children, ...args }) => (
49
- <Link {...args}>{children}</Link>
50
- )
51
-
52
- <header>
53
-
54
- # Link
55
-
56
- Link performs the same behavior of a regular anchor tag (`a`), but can be used as any HTML tag and component, including specific Frameworks link components.
57
-
58
- </header>
59
-
60
- ## Overview
61
-
62
- <Canvas>
63
- <Story
64
- name="overview-default"
65
- args={{
66
- children: 'Default',
67
- variant: 'neutral',
68
- }}
69
- >
70
- {Template.bind({})}
71
- </Story>
72
- <Story
73
- name="overview-display"
74
- args={{
75
- children: 'Display',
76
- variant: 'display',
77
- }}
78
- >
79
- {Template.bind({})}
80
- </Story>
81
- <Story
82
- name="overview-inline"
83
- args={{
84
- children: 'Inline',
85
- variant: 'inline',
86
- }}
87
- >
88
- {Template.bind({})}
89
- </Story>
90
- <Story
91
- name="overview-small"
92
- args={{
93
- children: 'Small',
94
- variant: 'display',
95
- size: "small",
96
- }}
97
- >
98
- {Template.bind({})}
99
- </Story>
100
- <Story
101
- name="overview-inverse"
102
- args={{
103
- children: 'Inverse',
104
- inverse: true,
105
- }}
106
- >
107
- {Template.bind({})}
108
- </Story>
109
- </Canvas>
110
-
111
- ---
112
-
113
- ## Usage
114
-
115
- ```jsx
116
- import Link from '@faststore/ui'
117
-
118
- // Styles
119
- import @faststore/ui/src/components/atoms/Link/styles.scss
120
- ```
121
-
122
- <Canvas>
123
- <Story
124
- name="default"
125
- args={{
126
- children: 'Link',
127
- variant: 'default',
128
- }}
129
- >
130
- {Template.bind({})}
131
- </Story>
132
- </Canvas>
133
-
134
- <ArgsTable story="default" />
@@ -1,18 +0,0 @@
1
- import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'
2
- import Popover from '../Popover'
3
-
4
- # Popover
5
-
6
- <Canvas>
7
- <Story id="atoms-popover--popover" />
8
- </Canvas>
9
-
10
- ## Props
11
-
12
- <ArgsTable of={Popover} />
13
-
14
- ## CSS Selectors
15
-
16
- ```css
17
- [data-fs-popover] {}
18
- ```
@@ -1,50 +0,0 @@
1
- import React, { useRef, useState } from 'react'
2
- import type { Story } from '@storybook/react'
3
-
4
- import Component from '../Popover'
5
- import { Input } from '@faststore/components'
6
- import type { PopoverProps } from '../Popover'
7
- import mdx from './Popover.mdx'
8
- import type { ComponentArgTypes } from '../../../../typings/utils'
9
-
10
- const PopoverTemplate: Story<PopoverProps> = ({ children }) => {
11
- const ref = useRef(null)
12
- const [value, setValue] = useState('')
13
-
14
- return (
15
- <div>
16
- <label>
17
- <span>Type for a special message</span>
18
- <Input
19
- type="text"
20
- onChange={(event) => setValue(event.target.value)}
21
- ref={ref}
22
- />
23
- </label>
24
- {value.length > 0 && <Component targetRef={ref}>{children}</Component>}
25
- </div>
26
- )
27
- }
28
-
29
- export const Popover = PopoverTemplate.bind({})
30
- Popover.args = {
31
- children: 'Whoa! Look at me!',
32
- }
33
-
34
- const argTypes: ComponentArgTypes<Omit<PopoverProps, 'targetRef'>> = {
35
- children: {
36
- table: { disable: true },
37
- },
38
- }
39
-
40
- const story = {
41
- title: 'Atoms/Popover',
42
- argTypes,
43
- parameters: {
44
- docs: {
45
- page: mdx,
46
- },
47
- },
48
- }
49
-
50
- export default story
@@ -1,101 +0,0 @@
1
- import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
-
3
- import { Radio, Label } from '@faststore/components'
4
-
5
- <Meta
6
- title="Atoms/Radio"
7
- component={Radio}
8
- argTypes={{
9
- disabled: {
10
- type: {
11
- name: 'boolean',
12
- },
13
- description: 'Disabled this input. <br/> `boolean`',
14
- defaultValue: false,
15
- },
16
- testId: {
17
- table: {
18
- disable: true,
19
- },
20
- },
21
- }}
22
- />
23
-
24
- export const Template = (args) => (
25
- <>
26
- <Radio {...args} onChange={() => {}} />
27
- <Label htmlFor="radio-default">Radio</Label>
28
- </>
29
- )
30
-
31
- <header>
32
-
33
- # Radio
34
-
35
- Radios allow users to select one option from a set.
36
-
37
- </header>
38
-
39
- ## Overview
40
-
41
- <Canvas>
42
- <Story
43
- name="overview-default-1"
44
- args={{
45
- id: 'overview-radio-default-1',
46
- }}
47
- >
48
- {Template.bind({})}
49
- </Story>
50
- <Story
51
- name="overview-default-2"
52
- args={{
53
- id: 'overview-radio-default-2',
54
- checked: true,
55
- }}
56
- >
57
- {Template.bind({})}
58
- </Story>
59
- <Story
60
- name="overview-default-3"
61
- args={{
62
- id: 'overview-radio-default-3',
63
- disabled: true,
64
- }}
65
- >
66
- {Template.bind({})}
67
- </Story>
68
- <Story
69
- name="overview-default-4"
70
- args={{
71
- id: 'overview-radio-default-4',
72
- disabled: true,
73
- checked: true,
74
- }}
75
- >
76
- {Template.bind({})}
77
- </Story>
78
- </Canvas>
79
-
80
- ---
81
-
82
- ## Usage
83
-
84
- ```jsx
85
- import Radio from '@faststore/ui'
86
- // Styles
87
- import '@faststore/ui/src/components/atoms/Radio/styles.scss'
88
- ```
89
-
90
- <Canvas>
91
- <Story
92
- name="default"
93
- args={{
94
- id: 'radio-default',
95
- }}
96
- >
97
- {Template.bind({})}
98
- </Story>
99
- </Canvas>
100
-
101
- <ArgsTable story="default" />
@@ -1,18 +0,0 @@
1
- import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'
2
- import Skeleton from '../Skeleton'
3
-
4
- # Skeleton
5
-
6
- <Canvas>
7
- <Story id="atoms-skeleton--skeleton" />
8
- </Canvas>
9
-
10
- ## Props
11
-
12
- <ArgsTable of={Skeleton} />
13
-
14
- ## CSS Selectors
15
-
16
- ```css
17
- [data-fs-skeleton] {}
18
- ```
@@ -1,21 +0,0 @@
1
- import type { Story } from '@storybook/react'
2
- import React from 'react'
3
-
4
- import type { SkeletonProps } from '../Skeleton'
5
- import Component from '../Skeleton'
6
- import mdx from './Skeleton.mdx'
7
-
8
- const SkeletonTemplate: Story<SkeletonProps> = ({ testId, ...otherProps }) => (
9
- <Component testId={testId} {...otherProps} />
10
- )
11
-
12
- export const Skeleton = SkeletonTemplate.bind({})
13
-
14
- export default {
15
- title: 'Atoms/Skeleton',
16
- parameters: {
17
- docs: {
18
- page: mdx,
19
- },
20
- },
21
- }
@@ -1,29 +0,0 @@
1
- import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'
2
- import Slider from '../Slider'
3
-
4
- # Slider
5
-
6
- <Canvas>
7
- <Story id="atoms-slider--slider" />
8
- </Canvas>
9
-
10
- # Props
11
-
12
- <ArgsTable of={Slider} />
13
-
14
- # CSS Selectors
15
-
16
- ```css
17
- [data-fs-slider] {
18
- }
19
- [data-slider-range] {
20
- }
21
- [data-slider-thumb='(left|right)'] {
22
- }
23
- ```
24
-
25
- # TODO
26
-
27
- - [ ] [Keyboard Interaction](https://www.w3.org/TR/wai-aria-practices-1.2/#slidertwothumb_kbd_interaction)
28
- - [ ] More test cases
29
- - [ ] Support to orientation
@@ -1,32 +0,0 @@
1
- import type { Meta, Story } from '@storybook/react'
2
- import React from 'react'
3
-
4
- import type { ComponentArgTypes } from '../../../../typings/utils'
5
- import type { SliderProps } from '../Slider'
6
- import Component from '../Slider'
7
- import mdx from './Slider.mdx'
8
-
9
- const SliderTemplate: Story<SliderProps> = (props) => <Component {...props} />
10
-
11
- export const Slider = SliderTemplate.bind({})
12
-
13
- const argTypes: ComponentArgTypes<SliderProps> = {
14
- min: {
15
- control: { type: 'number', min: 0 },
16
- defaultValue: 0,
17
- },
18
- max: {
19
- control: { type: 'number', min: 1 },
20
- defaultValue: 500,
21
- },
22
- }
23
-
24
- export default {
25
- title: 'Atoms/Slider',
26
- argTypes,
27
- parameters: {
28
- docs: {
29
- page: mdx,
30
- },
31
- },
32
- } as Meta
@@ -1,18 +0,0 @@
1
- import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'
2
- import Spinner from '../Spinner'
3
-
4
- # Spinner
5
-
6
- <Canvas>
7
- <Story id="atoms-spinner--spinner" />
8
- </Canvas>
9
-
10
- ## Props
11
-
12
- <ArgsTable of={Spinner} />
13
-
14
- ## CSS Selectors
15
-
16
- ```css
17
- [data-fs-spinner] {}
18
- ```
@@ -1,21 +0,0 @@
1
- import type { Story } from '@storybook/react'
2
- import React from 'react'
3
-
4
- import type { SpinnerProps } from '../Spinner'
5
- import Component from '../Spinner'
6
- import mdx from './Spinner.mdx'
7
-
8
- const SpinnerTemplate: Story<SpinnerProps> = ({ testId }) => (
9
- <Component testId={testId} />
10
- )
11
-
12
- export const Spinner = SpinnerTemplate.bind({})
13
-
14
- export default {
15
- title: 'Atoms/Spinner',
16
- parameters: {
17
- docs: {
18
- page: mdx,
19
- },
20
- },
21
- }
@@ -1,22 +0,0 @@
1
- import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'
2
- import TextArea from '../TextArea'
3
-
4
- # TextArea
5
-
6
- <Canvas>
7
- <Story id="atoms-textarea--textarea" />
8
- </Canvas>
9
-
10
- ## Props
11
-
12
- <ArgsTable of={TextArea} />
13
-
14
- ## CSS Selectors
15
-
16
- ```css
17
- [data-fs-textarea] {}
18
-
19
- [data-success] {}
20
-
21
- [data-error] {}
22
- ```
@@ -1,49 +0,0 @@
1
- import React from 'react'
2
- import type { Story, Meta } from '@storybook/react'
3
-
4
- import Component from '../TextArea'
5
- import type { TextAreaProps } from '../TextArea'
6
- import mdx from './TextArea.mdx'
7
- import type { ComponentArgTypes } from '../../../../typings/utils'
8
-
9
- const TextAreaTemplate: Story<TextAreaProps> = (props) => (
10
- <Component {...props} aria-label="Textarea" />
11
- )
12
-
13
- export const Textarea = TextAreaTemplate.bind({})
14
- Textarea.args = {
15
- defaultValue: 'Write something here',
16
- }
17
-
18
- const controls: ComponentArgTypes<TextAreaProps> = {
19
- variant: {
20
- options: ['default', 'success', 'error'],
21
- defaultValue: 'default',
22
- control: { type: 'select' },
23
- },
24
- value: {
25
- control: {
26
- type: 'text',
27
- },
28
- },
29
- defaultValue: {
30
- table: { disable: true },
31
- },
32
- }
33
-
34
- const actions: ComponentArgTypes<TextAreaProps> = {
35
- onChange: { action: 'changed', table: { disable: true } },
36
- }
37
-
38
- export default {
39
- title: 'Atoms/Textarea',
40
- argTypes: {
41
- ...controls,
42
- ...actions,
43
- },
44
- parameters: {
45
- docs: {
46
- page: mdx,
47
- },
48
- },
49
- } as Meta
@@ -1,62 +0,0 @@
1
- import { Canvas, Props, Story, ArgsTable } from '@storybook/addon-docs'
2
-
3
- import Accordion from '../Accordion'
4
- import { StorybookAccordionItem } from '../AccordionItem'
5
- import AccordionButton from '../AccordionButton'
6
- import AccordionPanel from '../AccordionPanel'
7
-
8
- # Accordion
9
-
10
- ## Multiple And Collapsible
11
-
12
- <Canvas>
13
- <Story id="molecules-accordion--multiple-and-collapsible" />
14
- </Canvas>
15
-
16
- ## Toggle With Icon
17
-
18
- <Canvas>
19
- <Story id="molecules-accordion--toggle-with-icon" />
20
- </Canvas>
21
-
22
- ## Components
23
-
24
- The `Accordion` uses the [Compound Component](https://kentcdodds.com/blog/compound-components-with-react-hooks) pattern, its components are:
25
-
26
- - `Accordion`: the wrapper component.
27
- - `AccordionItem`: the component that wraps an item of the `Accordion`, which is composed of an `AccordionButton` and an `AccordionPanel`.
28
- - `AccordionButton`: the button used to interact with its related `AccordionItem`, opening or closing the `AccordionPanel`.
29
- - `AccordionPanel`: the panel that contains the contents of the `AccordionItem`.
30
-
31
- ## Props
32
-
33
- All accordion-related components support all attributes also supported by the `<div>` tag, except for the `AccordionButton`, which renders the `<button>` tag.
34
-
35
- Besides those attributes, the following props are also supported:
36
-
37
- ### `Accordion`
38
-
39
- <ArgsTable of={Accordion} />
40
-
41
- ### `AccordionItem`
42
-
43
- <ArgsTable of={StorybookAccordionItem} />
44
-
45
- ### `AccordionButton`
46
-
47
- <ArgsTable of={AccordionButton} />
48
-
49
- ### `AccordionPanel`
50
-
51
- <ArgsTable of={AccordionPanel} />
52
-
53
- ## CSS Selectors
54
-
55
- ```css
56
- [data-fs-accordion] {}
57
- [data-accordion-item] {}
58
- [data-accordion-button] {}
59
- [data-accordion-panel] {}
60
- ```
61
-
62
- The `AccordionButton` component inherits [Button](?path=/docs/atoms-button--button#css-selectors) css selectors.