@@ -3,7 +3,6 @@ import type {Meta} from '@storybook/react-vite'
3
3
import {
4
4
Autocomplete ,
5
5
BaseStyles ,
6
- Box ,
7
6
Button ,
8
7
Checkbox ,
9
8
CheckboxGroup ,
@@ -22,6 +21,7 @@ import {
22
21
import { MarkGithubIcon , TriangleDownIcon } from '@primer/octicons-react'
23
22
import type { ItemInput } from '../deprecated/ActionList/List'
24
23
import { Stack } from '../Stack'
24
+ import classes from './FormControl.features.stories.module.css'
25
25
26
26
export default {
27
27
title : 'Components/FormControl/Features' ,
@@ -78,7 +78,7 @@ export const WithComplexInputs = () => {
78
78
}
79
79
80
80
return (
81
- < Box display = "grid" >
81
+ < div className = { classes . GridContainer } >
82
82
< FormControl >
83
83
< FormControl . Label id = "form-label" > TextInputWithTokens</ FormControl . Label >
84
84
< TextInputWithTokens onTokenRemove = { onTokenRemove } tokens = { tokens } />
@@ -117,7 +117,7 @@ export const WithComplexInputs = () => {
117
117
< FormControl . Label > Textarea</ FormControl . Label >
118
118
< Textarea />
119
119
</ FormControl >
120
- </ Box >
120
+ </ div >
121
121
)
122
122
}
123
123
@@ -149,7 +149,7 @@ export const FormControlWithCustomInput = () => {
149
149
} , [ value ] )
150
150
151
151
return (
152
- < Box display = "grid" >
152
+ < div className = { classes . GridContainer } >
153
153
< FormControl >
154
154
< FormControl . Label htmlFor = "custom-input" > GitHub handle</ FormControl . Label >
155
155
< CustomTextInput
@@ -194,13 +194,13 @@ export const FormControlWithCustomInput = () => {
194
194
< FormControl . Caption id = "custom-checkbox-two-caption" > Hint text for checkbox two</ FormControl . Caption >
195
195
</ FormControl >
196
196
</ CheckboxGroup >
197
- </ Box >
197
+ </ div >
198
198
)
199
199
}
200
200
201
201
export const WithCheckboxAndRadioInputs = ( ) => {
202
202
return (
203
- < Box display = "grid" sx = { { gap : 3 } } >
203
+ < div className = { classes . GapContainer } >
204
204
< CheckboxGroup >
205
205
< CheckboxGroup . Label > Checkboxes</ CheckboxGroup . Label >
206
206
< FormControl >
@@ -232,7 +232,7 @@ export const WithCheckboxAndRadioInputs = () => {
232
232
< FormControl . Label > Radio three</ FormControl . Label >
233
233
</ FormControl >
234
234
</ RadioGroup >
235
- </ Box >
235
+ </ div >
236
236
)
237
237
}
238
238
@@ -280,16 +280,11 @@ export const ValidationExample = () => {
280
280
function getColorCircle ( color : string ) {
281
281
return function ( ) {
282
282
return (
283
- < Box
284
- sx = { {
283
+ < span
284
+ className = { classes . ColorCircle }
285
+ style = { {
285
286
backgroundColor : color ,
286
287
borderColor : color ,
287
- width : 14 ,
288
- height : 14 ,
289
- borderRadius : 10 ,
290
- margin : 'auto' ,
291
- borderWidth : '1px' ,
292
- borderStyle : 'solid' ,
293
288
} }
294
289
/>
295
290
)
@@ -379,7 +374,7 @@ export const WithLeadingVisual = () => (
379
374
)
380
375
381
376
export const DisabledInputs = ( ) => (
382
- < Box sx = { { display : 'flex' , flexDirection : 'column' , gap : '1rem' } } >
377
+ < div className = { classes . FlexColumnGapContainer } >
383
378
< FormControl disabled >
384
379
< FormControl . Label > Disabled checkbox</ FormControl . Label >
385
380
< Checkbox />
@@ -397,18 +392,18 @@ export const DisabledInputs = () => (
397
392
< Select . Option value = "pvc" > Primer ViewComponents</ Select . Option >
398
393
</ Select >
399
394
</ FormControl >
400
- </ Box >
395
+ </ div >
401
396
)
402
397
403
398
export const CustomRequired = ( ) => (
404
- < Box sx = { { display : 'flex' , flexDirection : 'column' , gap : '1rem' } } >
399
+ < div className = { classes . FlexColumnGapContainer } >
405
400
< FormControl required = { true } >
406
401
< FormControl . Label requiredText = "(required)" > Form Input Label</ FormControl . Label >
407
402
< FormControl . Caption > This is a form field with a custom required indicator</ FormControl . Caption >
408
403
< TextInput />
409
404
</ FormControl >
410
405
411
- < Text sx = { { fontSize : 1 } } > Required fields are marked with an asterisk (*)</ Text >
406
+ < Text className = { classes . RequiredFieldsNote } > Required fields are marked with an asterisk (*)</ Text >
412
407
< FormControl required = { true } >
413
408
< FormControl . Label requiredIndicator = { false } > Form Input Label</ FormControl . Label >
414
409
< FormControl . Caption >
@@ -424,7 +419,7 @@ export const CustomRequired = () => (
424
419
< FormControl . Caption > This is a form field that is marked as optional, it is not required</ FormControl . Caption >
425
420
< TextInput />
426
421
</ FormControl >
427
- </ Box >
422
+ </ div >
428
423
)
429
424
430
425
export const WithCaption = ( ) => (
0 commit comments