@fpkit/acss 0.5.4 → 0.5.5
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/libs/chunk-QHIABQNQ.js +8 -0
- package/libs/chunk-QHIABQNQ.js.map +1 -0
- package/libs/chunk-ZOHIKF6I.cjs +31 -0
- package/libs/chunk-ZOHIKF6I.cjs.map +1 -0
- package/libs/components/breadcrumbs/breadcrumb.css +1 -1
- package/libs/components/breadcrumbs/breadcrumb.min.css +1 -1
- package/libs/components/buttons/button.css +1 -1
- package/libs/components/buttons/button.css.map +1 -1
- package/libs/components/buttons/button.min.css +2 -2
- package/libs/components/details/details.css +1 -1
- package/libs/components/details/details.css.map +1 -1
- package/libs/components/details/details.min.css +2 -2
- package/libs/components/dialog/dialog.css +1 -0
- package/libs/components/dialog/dialog.css.map +1 -0
- package/libs/components/dialog/dialog.min.css +3 -0
- package/libs/components/icons/icon.css +1 -1
- package/libs/components/icons/icon.css.map +1 -1
- package/libs/components/icons/icon.min.css +2 -2
- package/libs/{icons-2f29127c.d.ts → icons-1f5afc0c.d.ts} +1 -32
- package/libs/icons.cjs +2 -2
- package/libs/icons.d.cts +1 -1
- package/libs/icons.d.ts +1 -1
- package/libs/icons.js +1 -1
- package/libs/index.cjs +39 -39
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +27 -28
- package/libs/index.d.ts +27 -28
- package/libs/index.js +6 -6
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/alert-dialog/alert-dialog.stories.tsx +35 -0
- package/src/components/alert-dialog/alert-dialog.tsx +76 -0
- package/src/components/badge/badge.stories.tsx +21 -23
- package/src/components/breadcrumbs/breadcrumb.scss +2 -2
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +42 -47
- package/src/components/buttons/button.scss +40 -15
- package/src/components/buttons/button.stories.tsx +8 -1
- package/src/components/cards/card.stories.tsx +15 -15
- package/src/components/details/details.scss +6 -5
- package/src/components/details/details.stories.tsx +33 -30
- package/src/components/details/details.tsx +17 -17
- package/src/components/dialog/dialog.scss +61 -0
- package/src/components/dialog/dialog.stories.tsx +61 -0
- package/src/components/dialog/dialog.tsx +83 -0
- package/src/components/dialog/view/dialog-header.stories.tsx +43 -0
- package/src/components/dialog/view/dialog-header.tsx +32 -0
- package/src/components/form/form.stories.tsx +16 -16
- package/src/components/form/input.stories.tsx +62 -62
- package/src/components/form/select.stories.tsx +22 -15
- package/src/components/heading/heading.stories.tsx +32 -33
- package/src/components/heading/heading.tsx +1 -1
- package/src/components/icons/components/svg.tsx +0 -1
- package/src/components/icons/icon.scss +1 -3
- package/src/components/icons/icon.stories.tsx +45 -78
- package/src/components/icons/icon.tsx +0 -11
- package/src/components/icons/types.ts +1 -1
- package/src/components/images/figure.stories.tsx +13 -13
- package/src/components/images/img.stories.tsx +12 -12
- package/src/components/link/link.stories.tsx +32 -35
- package/src/components/link/link.tsx +27 -14
- package/src/components/list/list.stories.tsx +16 -16
- package/src/components/modal/dialog.tsx +13 -12
- package/src/components/modal/modal.tsx +28 -30
- package/src/components/nav/nav.stories.tsx +25 -24
- package/src/components/popover/popover.stories.tsx +17 -18
- package/src/components/progress/progress.stories.tsx +14 -20
- package/src/components/tag/tag.stories.tsx +17 -18
- package/src/components/text/text.stories.tsx +28 -29
- package/src/components/text-to-speech/TextToSpeech.stories.tsx +100 -101
- package/src/index.scss +22 -22
- package/src/index.ts +31 -30
- package/src/patterns/page/page-header.stories.tsx +17 -21
- package/src/sass/_globals.scss +7 -31
- package/src/sass/_styles.scss +2 -1
- package/src/sass/styles/_colors.scss +13 -0
- package/src/styles/breadcrumbs/breadcrumb.css +1 -1
- package/src/styles/buttons/button.css +25 -2
- package/src/styles/buttons/button.css.map +1 -1
- package/src/styles/details/details.css +5 -3
- package/src/styles/details/details.css.map +1 -1
- package/src/styles/dialog/dialog.css +61 -0
- package/src/styles/dialog/dialog.css.map +1 -0
- package/src/styles/icons/icon.css +1 -3
- package/src/styles/icons/icon.css.map +1 -1
- package/src/styles/index.css +107 -47
- package/src/styles/index.css.map +1 -1
- package/libs/chunk-TBM2QIVT.js +0 -8
- package/libs/chunk-TBM2QIVT.js.map +0 -1
- package/libs/chunk-VAH6X2DZ.cjs +0 -31
- package/libs/chunk-VAH6X2DZ.cjs.map +0 -1
- package/src/components/readme.stories.mdx +0 -7
|
@@ -1,75 +1,74 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, expect } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import Heading from './heading'
|
|
4
|
+
import Heading from "./heading";
|
|
6
5
|
|
|
7
6
|
const meta: Meta<typeof Heading> = {
|
|
8
|
-
title:
|
|
7
|
+
title: "FP.REACT Components/Heading",
|
|
9
8
|
component: Heading,
|
|
9
|
+
tags: ["version:1.0.0"],
|
|
10
10
|
parameters: {
|
|
11
|
-
actions: { argTypesRegex:
|
|
11
|
+
actions: { argTypesRegex: "^on.*" },
|
|
12
12
|
docs: {
|
|
13
13
|
description: {
|
|
14
|
-
component:
|
|
14
|
+
component: "Heading description here...",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
args: {
|
|
19
|
-
|
|
20
|
-
children: 'Default title',
|
|
19
|
+
children: "Default title",
|
|
21
20
|
},
|
|
22
|
-
} as Story
|
|
21
|
+
} as Story;
|
|
23
22
|
|
|
24
|
-
export default meta
|
|
25
|
-
type Story = StoryObj<typeof Heading
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof Heading>;
|
|
26
25
|
|
|
27
26
|
export const HeadingComponent: Story = {
|
|
28
27
|
args: {},
|
|
29
28
|
play: async ({ canvasElement }) => {
|
|
30
|
-
const canvas = within(canvasElement)
|
|
31
|
-
expect(canvas.getByText(/default title/i)).toBeInTheDocument()
|
|
29
|
+
const canvas = within(canvasElement);
|
|
30
|
+
expect(canvas.getByText(/default title/i)).toBeInTheDocument();
|
|
32
31
|
},
|
|
33
|
-
}
|
|
32
|
+
};
|
|
34
33
|
|
|
35
34
|
export const HeadingOne: Story = {
|
|
36
35
|
args: {
|
|
37
|
-
type:
|
|
38
|
-
children:
|
|
36
|
+
type: "h1",
|
|
37
|
+
children: "Heading One",
|
|
39
38
|
},
|
|
40
|
-
} as Story
|
|
39
|
+
} as Story;
|
|
41
40
|
|
|
42
41
|
export const HeadingTwo: Story = {
|
|
43
42
|
args: {
|
|
44
|
-
type:
|
|
45
|
-
children:
|
|
43
|
+
type: "h2",
|
|
44
|
+
children: "Heading Two",
|
|
46
45
|
},
|
|
47
|
-
} as Story
|
|
46
|
+
} as Story;
|
|
48
47
|
|
|
49
48
|
export const HeadingThree: Story = {
|
|
50
49
|
args: {
|
|
51
|
-
type:
|
|
52
|
-
children:
|
|
50
|
+
type: "h3",
|
|
51
|
+
children: "Heading Three",
|
|
53
52
|
},
|
|
54
|
-
} as Story
|
|
53
|
+
} as Story;
|
|
55
54
|
|
|
56
55
|
export const HeadingFour: Story = {
|
|
57
56
|
args: {
|
|
58
|
-
type:
|
|
59
|
-
children:
|
|
57
|
+
type: "h4",
|
|
58
|
+
children: "Heading Four",
|
|
60
59
|
},
|
|
61
|
-
} as Story
|
|
60
|
+
} as Story;
|
|
62
61
|
|
|
63
62
|
export const HeadingFive: Story = {
|
|
64
63
|
args: {
|
|
65
|
-
type:
|
|
66
|
-
children:
|
|
64
|
+
type: "h5",
|
|
65
|
+
children: "Heading Five",
|
|
67
66
|
},
|
|
68
|
-
} as Story
|
|
67
|
+
} as Story;
|
|
69
68
|
|
|
70
69
|
export const HeadingSix: Story = {
|
|
71
70
|
args: {
|
|
72
|
-
type:
|
|
73
|
-
children:
|
|
71
|
+
type: "h6",
|
|
72
|
+
children: "Heading Six",
|
|
74
73
|
},
|
|
75
|
-
} as Story
|
|
74
|
+
} as Story;
|
|
@@ -5,13 +5,11 @@
|
|
|
5
5
|
--icon-width: max-content;
|
|
6
6
|
--icon-gap: 0.2rem;
|
|
7
7
|
--icon-height: max-content;
|
|
8
|
-
--icon-fs: inherit;
|
|
9
8
|
|
|
10
9
|
display: var(--icon-display);
|
|
11
10
|
flex-direction: var(--icon-direction);
|
|
12
11
|
gap: var(--icon-gap);
|
|
13
|
-
|
|
12
|
+
place-items: var(--icons-placement);
|
|
14
13
|
width: var(--icon-width);
|
|
15
14
|
height: var(--icon-height);
|
|
16
|
-
font-size: var(--icon-fs);
|
|
17
15
|
}
|
|
@@ -1,96 +1,63 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
4
4
|
|
|
5
|
-
import { Button } from
|
|
6
|
-
import { Icon } from
|
|
7
|
-
import
|
|
8
|
-
// import './icon.scss'
|
|
9
|
-
|
|
5
|
+
import { Button } from "#components/buttons/button";
|
|
6
|
+
import { Icon } from "./icon";
|
|
7
|
+
import "./icon.scss";
|
|
10
8
|
|
|
11
9
|
const meta: Meta<typeof Icon> = {
|
|
12
10
|
component: Icon,
|
|
13
|
-
title:
|
|
11
|
+
title: "FP.React Components/Icons",
|
|
12
|
+
tags: ["rc"],
|
|
14
13
|
args: {
|
|
15
14
|
// styles: Icon.styles,
|
|
16
15
|
},
|
|
17
16
|
decorators: [
|
|
18
17
|
(Story) => (
|
|
19
|
-
<section style={{ minWidth:
|
|
18
|
+
<section style={{ minWidth: "60vw", textAlign: "center" }}>
|
|
20
19
|
<Story />
|
|
21
20
|
</section>
|
|
22
21
|
),
|
|
23
22
|
],
|
|
24
|
-
} as Meta
|
|
23
|
+
} as Meta;
|
|
25
24
|
|
|
26
|
-
export default meta
|
|
27
|
-
type Story = StoryObj<typeof Icon
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof Icon>;
|
|
28
27
|
|
|
29
28
|
export const IconSet = {
|
|
30
29
|
args: {},
|
|
31
|
-
render: (
|
|
30
|
+
render: () => {
|
|
32
31
|
return (
|
|
33
32
|
<Icon>
|
|
34
33
|
<Icon.Code styles={Icon.Code.styles} />
|
|
35
|
-
Code Icon{
|
|
34
|
+
Code Icon{" "}
|
|
36
35
|
</Icon>
|
|
37
|
-
)
|
|
36
|
+
);
|
|
38
37
|
},
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export const IconSizes = {
|
|
43
|
-
args: {},
|
|
44
|
-
render: (...args: any) => {
|
|
45
|
-
return (
|
|
46
|
-
<Icon>
|
|
47
|
-
<Icon.ArrowUp size={16} />
|
|
48
|
-
<Icon.ArrowUp size={24} />
|
|
49
|
-
<Icon.ArrowUp size={32} />
|
|
50
|
-
<Icon.ArrowUp size={48} />
|
|
51
|
-
<Icon.ArrowUp size={64} />
|
|
52
|
-
<Icon.ArrowUp size={96} />
|
|
53
|
-
<Icon.ArrowUp size={128} />
|
|
54
|
-
</Icon>
|
|
55
|
-
)
|
|
56
|
-
},
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const HeadingIcon = {
|
|
60
|
-
args: {},
|
|
61
|
-
render: (...args: any) => {
|
|
62
|
-
return (
|
|
63
|
-
<Heading type="h1">
|
|
64
|
-
<Icon>
|
|
65
|
-
<Icon.Code size={32} /> Code Icon
|
|
66
|
-
</Icon>
|
|
67
|
-
</Heading>
|
|
68
|
-
)
|
|
69
|
-
},
|
|
70
|
-
}
|
|
38
|
+
};
|
|
71
39
|
|
|
72
40
|
export const IconButton = {
|
|
73
41
|
args: {},
|
|
74
|
-
render: (
|
|
42
|
+
render: () => {
|
|
75
43
|
return (
|
|
76
|
-
|
|
44
|
+
<>
|
|
77
45
|
<Button type="button">
|
|
78
46
|
<Icon>
|
|
79
47
|
<Icon.Code />
|
|
80
48
|
</Icon>
|
|
81
49
|
Click Me
|
|
82
50
|
</Button>
|
|
83
|
-
|
|
84
|
-
)
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
85
53
|
},
|
|
86
|
-
}
|
|
87
|
-
|
|
54
|
+
};
|
|
88
55
|
|
|
89
56
|
export const Code: Story = {
|
|
90
57
|
args: {
|
|
91
58
|
children: <Icon.Code role="img" aria-label="code icon" />,
|
|
92
59
|
},
|
|
93
|
-
} as Story
|
|
60
|
+
} as Story;
|
|
94
61
|
|
|
95
62
|
export const Home: Story = {
|
|
96
63
|
args: {
|
|
@@ -101,142 +68,142 @@ export const Home: Story = {
|
|
|
101
68
|
</>
|
|
102
69
|
),
|
|
103
70
|
},
|
|
104
|
-
} as Story
|
|
71
|
+
} as Story;
|
|
105
72
|
|
|
106
73
|
export const Add: Story = {
|
|
107
74
|
args: {
|
|
108
75
|
children: <Icon.Add />,
|
|
109
76
|
},
|
|
110
|
-
} as Story
|
|
77
|
+
} as Story;
|
|
111
78
|
|
|
112
79
|
export const ArrowDown: Story = {
|
|
113
80
|
args: {
|
|
114
81
|
children: <Icon.ArrowDown />,
|
|
115
82
|
},
|
|
116
|
-
} as Story
|
|
83
|
+
} as Story;
|
|
117
84
|
|
|
118
85
|
export const ArrowLeft: Story = {
|
|
119
86
|
args: {
|
|
120
87
|
children: <Icon.ArrowLeft />,
|
|
121
88
|
},
|
|
122
|
-
} as Story
|
|
89
|
+
} as Story;
|
|
123
90
|
|
|
124
91
|
export const ArrowRight: Story = {
|
|
125
92
|
args: {
|
|
126
93
|
children: <Icon.ArrowRight />,
|
|
127
94
|
},
|
|
128
|
-
} as Story
|
|
95
|
+
} as Story;
|
|
129
96
|
|
|
130
97
|
export const ArrowUp: Story = {
|
|
131
98
|
args: {
|
|
132
99
|
children: <Icon.ArrowUp />,
|
|
133
100
|
},
|
|
134
|
-
} as Story
|
|
101
|
+
} as Story;
|
|
135
102
|
|
|
136
103
|
export const Chat: Story = {
|
|
137
104
|
args: {
|
|
138
105
|
children: <Icon.Chat />,
|
|
139
106
|
},
|
|
140
|
-
} as Story
|
|
107
|
+
} as Story;
|
|
141
108
|
|
|
142
109
|
export const User: Story = {
|
|
143
110
|
args: {
|
|
144
111
|
children: <Icon.User />,
|
|
145
112
|
},
|
|
146
|
-
} as Story
|
|
113
|
+
} as Story;
|
|
147
114
|
|
|
148
115
|
export const Left: Story = {
|
|
149
116
|
args: {
|
|
150
117
|
children: <Icon.Left />,
|
|
151
118
|
},
|
|
152
|
-
} as Story
|
|
119
|
+
} as Story;
|
|
153
120
|
|
|
154
121
|
export const Right: Story = {
|
|
155
122
|
args: {
|
|
156
123
|
children: <Icon.Right />,
|
|
157
124
|
},
|
|
158
|
-
} as Story
|
|
125
|
+
} as Story;
|
|
159
126
|
|
|
160
127
|
export const Up: Story = {
|
|
161
128
|
args: {
|
|
162
129
|
children: <Icon.Up />,
|
|
163
130
|
},
|
|
164
|
-
} as Story
|
|
131
|
+
} as Story;
|
|
165
132
|
|
|
166
133
|
export const Down: Story = {
|
|
167
134
|
args: {
|
|
168
135
|
children: <Icon.Down />,
|
|
169
136
|
},
|
|
170
|
-
} as Story
|
|
137
|
+
} as Story;
|
|
171
138
|
|
|
172
139
|
export const Minus: Story = {
|
|
173
140
|
args: {
|
|
174
141
|
children: <Icon.Minus />,
|
|
175
142
|
},
|
|
176
|
-
} as Story
|
|
143
|
+
} as Story;
|
|
177
144
|
|
|
178
145
|
export const Remove: Story = {
|
|
179
146
|
args: {
|
|
180
147
|
children: <Icon.Remove />,
|
|
181
148
|
},
|
|
182
|
-
} as Story
|
|
149
|
+
} as Story;
|
|
183
150
|
|
|
184
151
|
export const Star: Story = {
|
|
185
152
|
args: {
|
|
186
153
|
children: <Icon.Star />,
|
|
187
154
|
},
|
|
188
|
-
} as Story
|
|
155
|
+
} as Story;
|
|
189
156
|
|
|
190
157
|
export const Copy: Story = {
|
|
191
158
|
args: {
|
|
192
159
|
children: <Icon.Copy />,
|
|
193
160
|
},
|
|
194
|
-
} as Story
|
|
161
|
+
} as Story;
|
|
195
162
|
|
|
196
163
|
export const Play: Story = {
|
|
197
164
|
args: {
|
|
198
165
|
children: <Icon.Play />,
|
|
199
166
|
},
|
|
200
|
-
} as Story
|
|
167
|
+
} as Story;
|
|
201
168
|
|
|
202
169
|
export const Pause: Story = {
|
|
203
170
|
args: {
|
|
204
171
|
children: <Icon.Pause />,
|
|
205
172
|
},
|
|
206
|
-
} as Story
|
|
173
|
+
} as Story;
|
|
207
174
|
|
|
208
175
|
export const Resume: Story = {
|
|
209
176
|
args: {
|
|
210
177
|
children: <Icon.Resume />,
|
|
211
178
|
},
|
|
212
|
-
} as Story
|
|
179
|
+
} as Story;
|
|
213
180
|
|
|
214
181
|
export const Stop: Story = {
|
|
215
182
|
args: {
|
|
216
183
|
children: <Icon.Stop />,
|
|
217
184
|
},
|
|
218
|
-
} as Story
|
|
185
|
+
} as Story;
|
|
219
186
|
|
|
220
187
|
export const PlaySolid: Story = {
|
|
221
188
|
args: {
|
|
222
189
|
children: <Icon.PlaySolid />,
|
|
223
190
|
},
|
|
224
|
-
} as Story
|
|
191
|
+
} as Story;
|
|
225
192
|
|
|
226
193
|
export const PauseSolid: Story = {
|
|
227
194
|
args: {
|
|
228
195
|
children: <Icon.PauseSolid />,
|
|
229
196
|
},
|
|
230
|
-
} as Story
|
|
197
|
+
} as Story;
|
|
231
198
|
|
|
232
199
|
export const ResumeSolid: Story = {
|
|
233
200
|
args: {
|
|
234
201
|
children: <Icon.ResumeSolid />,
|
|
235
202
|
},
|
|
236
|
-
} as Story
|
|
203
|
+
} as Story;
|
|
237
204
|
|
|
238
205
|
export const StopSolid: Story = {
|
|
239
206
|
args: {
|
|
240
207
|
children: <Icon.StopSolid />,
|
|
241
208
|
},
|
|
242
|
-
} as Story
|
|
209
|
+
} as Story;
|
|
@@ -48,17 +48,6 @@ const defaultStyles = {
|
|
|
48
48
|
|
|
49
49
|
export type IconProps = React.ComponentProps<typeof UI>
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
* A component for rendering icons with consistent styling and behavior.
|
|
53
|
-
*
|
|
54
|
-
* @param {object} props - The component props
|
|
55
|
-
* @param {string} [props.id] - Optional unique identifier for the icon
|
|
56
|
-
* @param {string} [props.classes] - CSS classes to apply to the icon
|
|
57
|
-
* @param {React.ReactNode} [props.children] - Child elements to render inside the icon
|
|
58
|
-
* @param {object} [props.styles] - Custom styles to apply to the icon
|
|
59
|
-
* @param {...any} [props.props] - Additional props to spread to the underlying UI component
|
|
60
|
-
* @returns {JSX.Element} The rendered icon component
|
|
61
|
-
*/
|
|
62
51
|
export const Icon = ({
|
|
63
52
|
id,
|
|
64
53
|
classes,
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, expect } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import Figure from './figure'
|
|
4
|
+
import Figure from "./figure";
|
|
6
5
|
|
|
7
6
|
const meta: Meta<typeof Figure> = {
|
|
8
|
-
title:
|
|
7
|
+
title: "FP.REACT Components/Figure",
|
|
9
8
|
component: Figure,
|
|
9
|
+
tags: ["version:1.0.0"],
|
|
10
10
|
parameters: {
|
|
11
|
-
actions: { argTypesRegex:
|
|
11
|
+
actions: { argTypesRegex: "^on.*" },
|
|
12
12
|
docs: {
|
|
13
13
|
description: {
|
|
14
|
-
component:
|
|
14
|
+
component: "Figure description here...",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
args: {},
|
|
19
|
-
} as Story
|
|
19
|
+
} as Story;
|
|
20
20
|
|
|
21
|
-
export default meta
|
|
22
|
-
type Story = StoryObj<typeof Figure
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof Figure>;
|
|
23
23
|
|
|
24
24
|
export const FigureComponent: Story = {
|
|
25
25
|
args: {},
|
|
26
26
|
play: async ({ canvasElement }) => {
|
|
27
|
-
const canvas = within(canvasElement)
|
|
27
|
+
const canvas = within(canvasElement);
|
|
28
28
|
// await expect(canvas.getByRole('img')).toBeInTheDocument()
|
|
29
|
-
expect(canvas.getByRole(
|
|
29
|
+
expect(canvas.getByRole("figure")).toBeInTheDocument();
|
|
30
30
|
},
|
|
31
|
-
}
|
|
31
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
2
|
-
import { within, expect } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import { within, expect } from "@storybook/test";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import Img from './img'
|
|
4
|
+
import Img from "./img";
|
|
6
5
|
|
|
7
6
|
const meta: Meta<typeof Img> = {
|
|
8
|
-
title:
|
|
7
|
+
title: "FP.REACT Components/Img",
|
|
9
8
|
component: Img,
|
|
9
|
+
tags: ["version:1.0.0"],
|
|
10
10
|
args: {
|
|
11
|
-
src:
|
|
11
|
+
src: "//",
|
|
12
12
|
},
|
|
13
|
-
} as Story
|
|
13
|
+
} as Story;
|
|
14
14
|
|
|
15
|
-
export default meta
|
|
16
|
-
type Story = StoryObj<typeof Img
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof Img>;
|
|
17
17
|
|
|
18
18
|
export const ImgComponent: Story = {
|
|
19
19
|
args: {},
|
|
20
20
|
play: async ({ canvasElement }) => {
|
|
21
|
-
const canvas = within(canvasElement)
|
|
22
|
-
await expect(canvas.getByRole(
|
|
21
|
+
const canvas = within(canvasElement);
|
|
22
|
+
await expect(canvas.getByRole("img")).toBeInTheDocument();
|
|
23
23
|
},
|
|
24
|
-
}
|
|
24
|
+
};
|
|
@@ -1,74 +1,71 @@
|
|
|
1
|
-
import { StoryObj, Meta } from
|
|
1
|
+
import { StoryObj, Meta } from "@storybook/react";
|
|
2
2
|
|
|
3
|
-
import { within, expect } from
|
|
3
|
+
import { within, expect } from "@storybook/test";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import Link from './link'
|
|
8
|
-
import '../../styles/link/link.css'
|
|
5
|
+
import Link from "./link";
|
|
6
|
+
import "../../styles/link/link.css";
|
|
9
7
|
|
|
10
8
|
const meta: Meta<typeof Link> = {
|
|
11
|
-
title:
|
|
9
|
+
title: "FP.React Components/Links",
|
|
10
|
+
tags: ["version:1.0.0"],
|
|
12
11
|
component: Link,
|
|
13
12
|
args: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children: 'Link',
|
|
13
|
+
href: "/",
|
|
14
|
+
children: "Link",
|
|
17
15
|
},
|
|
18
|
-
} as Meta
|
|
16
|
+
} as Meta;
|
|
19
17
|
|
|
20
|
-
export default meta
|
|
21
|
-
type Story = StoryObj<typeof Link
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof Link>;
|
|
22
20
|
|
|
23
21
|
export const LinkComponent: Story = {
|
|
24
22
|
args: {},
|
|
25
23
|
play: async ({ canvasElement }) => {
|
|
26
|
-
const canvas = within(canvasElement)
|
|
27
|
-
const link = canvas.getByRole(
|
|
28
|
-
expect(link).toBeInTheDocument()
|
|
29
|
-
expect(link).toHaveTextContent(
|
|
24
|
+
const canvas = within(canvasElement);
|
|
25
|
+
const link = canvas.getByRole("link");
|
|
26
|
+
expect(link).toBeInTheDocument();
|
|
27
|
+
expect(link).toHaveTextContent("Link");
|
|
30
28
|
},
|
|
31
|
-
}
|
|
29
|
+
};
|
|
32
30
|
|
|
33
31
|
export const ExternalLink: Story = {
|
|
34
32
|
args: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
rel: 'noopener noreferrer',
|
|
33
|
+
href: "https://www.google.com",
|
|
34
|
+
target: "_blank",
|
|
35
|
+
rel: "noopener noreferrer",
|
|
39
36
|
prefetch: true,
|
|
40
|
-
children:
|
|
37
|
+
children: "Google",
|
|
41
38
|
},
|
|
42
39
|
play: async ({ canvasElement }) => {
|
|
43
|
-
const canvas = within(canvasElement)
|
|
44
|
-
const link = canvas.getByRole(
|
|
45
|
-
expect(link).toBeInTheDocument()
|
|
46
|
-
expect(link).toHaveTextContent(
|
|
47
|
-
expect(link).toHaveAttribute(
|
|
48
|
-
expect(link).toHaveAttribute(
|
|
49
|
-
expect(link).toHaveAttribute(
|
|
40
|
+
const canvas = within(canvasElement);
|
|
41
|
+
const link = canvas.getByRole("link");
|
|
42
|
+
expect(link).toBeInTheDocument();
|
|
43
|
+
expect(link).toHaveTextContent("Google");
|
|
44
|
+
expect(link).toHaveAttribute("href", "https://www.google.com");
|
|
45
|
+
expect(link).toHaveAttribute("target", "_blank");
|
|
46
|
+
expect(link).toHaveAttribute("rel", "noopener noreferrer prefetch");
|
|
50
47
|
},
|
|
51
|
-
}
|
|
48
|
+
} as Story;
|
|
52
49
|
|
|
53
50
|
export const ButtonLink: Story = {
|
|
54
51
|
args: {
|
|
55
52
|
...LinkComponent.args,
|
|
56
53
|
children: <b>Button Link</b>,
|
|
57
54
|
},
|
|
58
|
-
} as Story
|
|
55
|
+
} as Story;
|
|
59
56
|
|
|
60
57
|
export const ButtonPill: Story = {
|
|
61
58
|
args: {
|
|
62
59
|
...LinkComponent.args,
|
|
63
60
|
children: <i>Button Link</i>,
|
|
64
61
|
},
|
|
65
|
-
} as Story
|
|
62
|
+
} as Story;
|
|
66
63
|
|
|
67
64
|
export const ButtonRounded: Story = {
|
|
68
65
|
args: {
|
|
69
66
|
...ButtonLink.args,
|
|
70
67
|
styles: {
|
|
71
|
-
|
|
68
|
+
"--link-radius": "initial",
|
|
72
69
|
},
|
|
73
70
|
},
|
|
74
|
-
} as Story
|
|
71
|
+
} as Story;
|