@@ -2,13 +2,13 @@ import type { CSSProperties } from 'react';
2
2
3
3
import type { StoryObj } from '@storybook/react' ;
4
4
5
- import { Grid , GridItem } from './index' ;
6
- import type { GridBaseProps } from './index.js ' ;
5
+ import { Grid } from './index' ;
6
+ import type { GridBaseProps } from './index' ;
7
7
8
8
const meta = {
9
9
title : 'Components/Grid' ,
10
10
component : Grid ,
11
- subcomponents : { GridItem } ,
11
+ subcomponents : { 'Grid.Item' : Grid . Item } ,
12
12
} ;
13
13
14
14
export default meta ;
@@ -25,39 +25,39 @@ const itemStyle = {
25
25
export const Base : Story = {
26
26
render : ( args : GridBaseProps ) => (
27
27
< Grid cols = { 3 } gap = "m" { ...args } >
28
- < GridItem style = { itemStyle } > 01</ GridItem >
29
- < GridItem style = { itemStyle } col = { 2 } >
28
+ < Grid . Item style = { itemStyle } > 01</ Grid . Item >
29
+ < Grid . Item style = { itemStyle } col = { 2 } >
30
30
02
31
- </ GridItem >
32
- < GridItem style = { itemStyle } col = { 2 } >
31
+ </ Grid . Item >
32
+ < Grid . Item style = { itemStyle } col = { 2 } >
33
33
03
34
- </ GridItem >
35
- < GridItem style = { itemStyle } > 04</ GridItem >
36
- < GridItem style = { itemStyle } > 05</ GridItem >
37
- < GridItem style = { itemStyle } > 06</ GridItem >
38
- < GridItem style = { itemStyle } > 07</ GridItem >
34
+ </ Grid . Item >
35
+ < Grid . Item style = { itemStyle } > 04</ Grid . Item >
36
+ < Grid . Item style = { itemStyle } > 05</ Grid . Item >
37
+ < Grid . Item style = { itemStyle } > 06</ Grid . Item >
38
+ < Grid . Item style = { itemStyle } > 07</ Grid . Item >
39
39
</ Grid >
40
40
) ,
41
41
} ;
42
42
43
43
export const Cols : Story = {
44
44
render : ( args : GridBaseProps ) => (
45
45
< Grid gap = "m" cols = { 4 } { ...args } >
46
- < GridItem style = { itemStyle } > 01</ GridItem >
47
- < GridItem style = { itemStyle } > 02</ GridItem >
48
- < GridItem style = { itemStyle } > 03</ GridItem >
49
- < GridItem style = { itemStyle } > 04</ GridItem >
46
+ < Grid . Item style = { itemStyle } > 01</ Grid . Item >
47
+ < Grid . Item style = { itemStyle } > 02</ Grid . Item >
48
+ < Grid . Item style = { itemStyle } > 03</ Grid . Item >
49
+ < Grid . Item style = { itemStyle } > 04</ Grid . Item >
50
50
</ Grid >
51
51
) ,
52
52
} ;
53
53
54
54
export const Gap : Story = {
55
55
render : ( args : GridBaseProps ) => (
56
56
< Grid gap = "m" rowGap = "xxl" cols = { 2 } { ...args } >
57
- < GridItem style = { itemStyle } > 01</ GridItem >
58
- < GridItem style = { itemStyle } > 02</ GridItem >
59
- < GridItem style = { itemStyle } > 03</ GridItem >
60
- < GridItem style = { itemStyle } > 04</ GridItem >
57
+ < Grid . Item style = { itemStyle } > 01</ Grid . Item >
58
+ < Grid . Item style = { itemStyle } > 02</ Grid . Item >
59
+ < Grid . Item style = { itemStyle } > 03</ Grid . Item >
60
+ < Grid . Item style = { itemStyle } > 04</ Grid . Item >
61
61
</ Grid >
62
62
) ,
63
63
} ;
@@ -66,29 +66,29 @@ export const AlignmentItems: Story = {
66
66
name : 'Alignment items' ,
67
67
render : ( args : GridBaseProps ) => (
68
68
< Grid gap = "m" justifyItems = "center" cols = { 2 } { ...args } >
69
- < GridItem style = { itemStyle } > 01</ GridItem >
70
- < GridItem style = { itemStyle } > 02</ GridItem >
71
- < GridItem style = { itemStyle } > 03</ GridItem >
72
- < GridItem style = { itemStyle } > 04</ GridItem >
69
+ < Grid . Item style = { itemStyle } > 01</ Grid . Item >
70
+ < Grid . Item style = { itemStyle } > 02</ Grid . Item >
71
+ < Grid . Item style = { itemStyle } > 03</ Grid . Item >
72
+ < Grid . Item style = { itemStyle } > 04</ Grid . Item >
73
73
</ Grid >
74
74
) ,
75
75
} ;
76
76
77
77
export const Col : Story = {
78
78
render : ( args : GridBaseProps ) => (
79
79
< Grid gap = "m" cols = { 4 } { ...args } >
80
- < GridItem style = { itemStyle } col = { 3 } >
80
+ < Grid . Item style = { itemStyle } col = { 3 } >
81
81
01
82
- </ GridItem >
83
- < GridItem style = { itemStyle } col = { 1 } >
82
+ </ Grid . Item >
83
+ < Grid . Item style = { itemStyle } col = { 1 } >
84
84
02
85
- </ GridItem >
86
- < GridItem style = { itemStyle } col = { 1 } >
85
+ </ Grid . Item >
86
+ < Grid . Item style = { itemStyle } col = { 1 } >
87
87
03
88
- </ GridItem >
89
- < GridItem style = { itemStyle } col = { 3 } >
88
+ </ Grid . Item >
89
+ < Grid . Item style = { itemStyle } col = { 3 } >
90
90
04
91
- </ GridItem >
91
+ </ Grid . Item >
92
92
</ Grid >
93
93
) ,
94
94
} ;
@@ -97,34 +97,34 @@ export const ColStart: Story = {
97
97
name : 'ColStart' ,
98
98
render : ( args : GridBaseProps ) => (
99
99
< Grid gap = "m" cols = { 4 } { ...args } >
100
- < GridItem style = { itemStyle } col = { 2 } colStart = { 2 } >
100
+ < Grid . Item style = { itemStyle } col = { 2 } colStart = { 2 } >
101
101
01
102
- </ GridItem >
103
- < GridItem style = { itemStyle } col = { 1 } colStart = { 2 } >
102
+ </ Grid . Item >
103
+ < Grid . Item style = { itemStyle } col = { 1 } colStart = { 2 } >
104
104
02
105
- </ GridItem >
106
- < GridItem style = { itemStyle } col = { 1 } >
105
+ </ Grid . Item >
106
+ < Grid . Item style = { itemStyle } col = { 1 } >
107
107
03
108
- </ GridItem >
108
+ </ Grid . Item >
109
109
</ Grid >
110
110
) ,
111
111
} ;
112
112
113
113
export const Row : Story = {
114
114
render : ( args : GridBaseProps ) => (
115
115
< Grid gap = "m" cols = { 4 } { ...args } >
116
- < GridItem style = { itemStyle } col = { 2 } row = { 2 } >
116
+ < Grid . Item style = { itemStyle } col = { 2 } row = { 2 } >
117
117
01
118
- </ GridItem >
119
- < GridItem style = { itemStyle } col = { 1 } >
118
+ </ Grid . Item >
119
+ < Grid . Item style = { itemStyle } col = { 1 } >
120
120
02
121
- </ GridItem >
122
- < GridItem style = { itemStyle } col = { 1 } >
121
+ </ Grid . Item >
122
+ < Grid . Item style = { itemStyle } col = { 1 } >
123
123
03
124
- </ GridItem >
125
- < GridItem style = { itemStyle } col = { 2 } >
124
+ </ Grid . Item >
125
+ < Grid . Item style = { itemStyle } col = { 2 } >
126
126
04
127
- </ GridItem >
127
+ </ Grid . Item >
128
128
</ Grid >
129
129
) ,
130
130
} ;
@@ -133,18 +133,18 @@ export const RowStart: Story = {
133
133
name : 'RowStart' ,
134
134
render : ( args : GridBaseProps ) => (
135
135
< Grid gap = "xl" cols = { 4 } { ...args } >
136
- < GridItem style = { itemStyle } col = { 2 } >
136
+ < Grid . Item style = { itemStyle } col = { 2 } >
137
137
01
138
- </ GridItem >
139
- < GridItem style = { itemStyle } col = { 2 } >
138
+ </ Grid . Item >
139
+ < Grid . Item style = { itemStyle } col = { 2 } >
140
140
02
141
- </ GridItem >
142
- < GridItem rowStart = { 3 } style = { itemStyle } col = { 2 } >
141
+ </ Grid . Item >
142
+ < Grid . Item rowStart = { 3 } style = { itemStyle } col = { 2 } >
143
143
03
144
- </ GridItem >
145
- < GridItem rowStart = { 3 } style = { itemStyle } col = { 2 } >
144
+ </ Grid . Item >
145
+ < Grid . Item rowStart = { 3 } style = { itemStyle } col = { 2 } >
146
146
04
147
- </ GridItem >
147
+ </ Grid . Item >
148
148
</ Grid >
149
149
) ,
150
150
} ;
@@ -153,27 +153,27 @@ export const SelfAlignment: Story = {
153
153
name : 'Self-alignment' ,
154
154
render : ( args : GridBaseProps ) => (
155
155
< Grid gap = "m" cols = { 2 } { ...args } >
156
- < GridItem style = { itemStyle } alignSelf = "center" justifySelf = "center" >
156
+ < Grid . Item style = { itemStyle } alignSelf = "center" justifySelf = "center" >
157
157
01
158
- </ GridItem >
159
- < GridItem style = { itemStyle } > 02</ GridItem >
160
- < GridItem style = { itemStyle } > 03</ GridItem >
161
- < GridItem style = { itemStyle } > 04</ GridItem >
158
+ </ Grid . Item >
159
+ < Grid . Item style = { itemStyle } > 02</ Grid . Item >
160
+ < Grid . Item style = { itemStyle } > 03</ Grid . Item >
161
+ < Grid . Item style = { itemStyle } > 04</ Grid . Item >
162
162
</ Grid >
163
163
) ,
164
164
} ;
165
165
166
166
export const Nested : Story = {
167
167
render : ( args : GridBaseProps ) => (
168
168
< Grid gap = "xl" cols = { 3 } { ...args } >
169
- < GridItem style = { itemStyle } > 01</ GridItem >
170
- < GridItem style = { itemStyle } > 02</ GridItem >
171
- < GridItem >
169
+ < Grid . Item style = { itemStyle } > 01</ Grid . Item >
170
+ < Grid . Item style = { itemStyle } > 02</ Grid . Item >
171
+ < Grid . Item >
172
172
< Grid cols = { 1 } gap = "xl" >
173
- < GridItem style = { itemStyle } > 03</ GridItem >
174
- < GridItem style = { itemStyle } > 04</ GridItem >
173
+ < Grid . Item style = { itemStyle } > 03</ Grid . Item >
174
+ < Grid . Item style = { itemStyle } > 04</ Grid . Item >
175
175
</ Grid >
176
- </ GridItem >
176
+ </ Grid . Item >
177
177
</ Grid >
178
178
) ,
179
179
} ;
@@ -182,10 +182,10 @@ export const ResponsiveValues: Story = {
182
182
name : 'Responsive values' ,
183
183
render : ( args : GridBaseProps ) => (
184
184
< Grid gap = { { xs : 'xl' , l : '6xl' } } cols = { { m : 4 , xs : 1 } } { ...args } >
185
- < GridItem style = { itemStyle } > 01</ GridItem >
186
- < GridItem style = { itemStyle } > 02</ GridItem >
187
- < GridItem style = { itemStyle } > 03</ GridItem >
188
- < GridItem style = { itemStyle } > 04</ GridItem >
185
+ < Grid . Item style = { itemStyle } > 01</ Grid . Item >
186
+ < Grid . Item style = { itemStyle } > 02</ Grid . Item >
187
+ < Grid . Item style = { itemStyle } > 03</ Grid . Item >
188
+ < Grid . Item style = { itemStyle } > 04</ Grid . Item >
189
189
</ Grid >
190
190
) ,
191
191
} ;
@@ -194,18 +194,18 @@ export const ResponsiveValuesItems: Story = {
194
194
name : 'Responsive values for items' ,
195
195
render : ( args : GridBaseProps ) => (
196
196
< Grid gap = "m" cols = { 2 } { ...args } >
197
- < GridItem style = { itemStyle } col = { { xs : 2 , m : 1 } } >
197
+ < Grid . Item style = { itemStyle } col = { { xs : 2 , m : 1 } } >
198
198
01
199
- </ GridItem >
200
- < GridItem style = { itemStyle } col = { { xs : 2 , m : 1 } } >
199
+ </ Grid . Item >
200
+ < Grid . Item style = { itemStyle } col = { { xs : 2 , m : 1 } } >
201
201
02
202
- </ GridItem >
203
- < GridItem style = { itemStyle } col = { { xs : 2 , m : 1 } } >
202
+ </ Grid . Item >
203
+ < Grid . Item style = { itemStyle } col = { { xs : 2 , m : 1 } } >
204
204
03
205
- </ GridItem >
206
- < GridItem style = { itemStyle } col = { { xs : 2 , m : 1 } } >
205
+ </ Grid . Item >
206
+ < Grid . Item style = { itemStyle } col = { { xs : 2 , m : 1 } } >
207
207
04
208
- </ GridItem >
208
+ </ Grid . Item >
209
209
</ Grid >
210
210
) ,
211
211
} ;
0 commit comments