Skip to content

Commit b8bcf11

Browse files
committed
WIP form stories
1 parent d0f527c commit b8bcf11

File tree

6 files changed

+47
-13
lines changed

6 files changed

+47
-13
lines changed

.storybook/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const generateButtonLabel = ({
88
shapeVariant = [],
99
colorVariant = [],
1010
disabled = false,
11-
pressed = false
11+
pressed = false,
1212
}) =>
1313
capitalizeFirstLetter(
1414
[

scss/bitstyles/base/forms/_index.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ legend {
2121
}
2222

2323
label {
24-
display: block;
24+
display: flex;
25+
flex-direction: column;
26+
gap: settings.$label-gap;
2527
margin-bottom: 0;
2628
cursor: pointer;
2729
}

scss/bitstyles/base/forms/_settings.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../../tools/size';
2+
13
//
24
// Fieldset ////////////////////////////////////////
35

@@ -14,3 +16,8 @@ $legend-background-color: transparent !default;
1416
$legend-border: 0 !default;
1517
$legend-border-radius: 0 !default;
1618
$legend-color: inherit !default;
19+
20+
//
21+
// Label ////////////////////////////////////////
22+
23+
$label-gap: size.get('s7');

scss/bitstyles/base/forms/forms.stories.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,31 @@ TextInputInvalid.parameters = {
9191
],
9292
};
9393

94+
export const TextInputInvalidWith = InputTemplate.bind({});
95+
TextInputInvalid.args = {
96+
id: 'input-text',
97+
label: 'Telephone number',
98+
value: generateLabel(['input', 'text']),
99+
placeholder: generateLabel(['input', 'text', 'placeholder']),
100+
ariaInvalid: true,
101+
};
102+
TextInputInvalid.parameters = {
103+
zeplinLink: [
104+
{
105+
name: 'base',
106+
link: 'https://app.zeplin.io/styleguide/63079b90d0bf4a646c46c227/components?coid=6363a29350fae8b712a63460',
107+
},
108+
{
109+
name: 'hover',
110+
link: 'https://app.zeplin.io/styleguide/63079b90d0bf4a646c46c227/components?coid=6363a29350fae8b712a63460',
111+
},
112+
{
113+
name: 'active',
114+
link: 'https://app.zeplin.io/styleguide/63079b90d0bf4a646c46c227/components?coid=6363a29d53bff5b7626b7444',
115+
},
116+
],
117+
};
118+
94119
export const TextInputDisabled = InputTemplate.bind({});
95120
TextInputDisabled.args = {
96121
id: 'input-text',

scss/bitstyles/base/input-checkbox/_index.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
border: settings.$border-width solid settings.$border-color;
2323
border-radius: settings.$border-radius;
2424
background-color: settings.$background-color;
25-
color: settings.$color;
2625
box-shadow: settings.$box-shadow;
26+
color: settings.$color;
2727

2828
&:hover,
2929
&:focus {
3030
border-color: settings.$border-color-hover;
3131
outline: none;
3232
background-color: settings.$background-color-hover;
33-
color: settings.$color-hover;
3433
box-shadow: settings.$box-shadow-hover;
34+
color: settings.$color-hover;
3535
}
3636

3737
&::after {
@@ -54,8 +54,8 @@
5454
&:checked {
5555
border-color: settings.$border-color-checked;
5656
background-color: settings.$background-color-checked;
57-
color: settings.$color-checked;
5857
box-shadow: settings.$box-shadow-checked;
58+
color: settings.$color-checked;
5959

6060
&::after {
6161
transform: scale(1);
@@ -67,21 +67,21 @@
6767
&[aria-invalid='true'] {
6868
border-color: settings.$border-color-invalid;
6969
background-color: settings.$background-color-invalid;
70-
color: settings.$color-invalid;
7170
box-shadow: settings.$box-shadow-invalid;
71+
color: settings.$color-invalid;
7272
}
7373

7474
&[disabled] {
7575
border-color: settings.$border-color-disabled;
7676
background-color: settings.$background-color-disabled;
77-
color: settings.$color-disabled;
7877
box-shadow: settings.$box-shadow-disabled;
78+
color: settings.$color-disabled;
7979

8080
&:checked {
8181
border-color: settings.$border-color-disabled-checked;
8282
background-color: settings.$background-color-disabled-checked;
83-
color: settings.$color-disabled-checked;
8483
box-shadow: settings.$box-shadow-disabled-checked;
84+
color: settings.$color-disabled-checked;
8585
}
8686
}
8787
}

scss/bitstyles/base/input-radio/_index.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
border: settings.$border-width solid settings.$border-color;
2222
border-radius: settings.$border-radius;
2323
background-color: settings.$background-color;
24-
color: settings.$color;
2524
box-shadow: settings.$box-shadow;
25+
color: settings.$color;
2626

2727
&::after {
2828
content: '';
@@ -43,15 +43,15 @@
4343
border-color: settings.$border-color-hover;
4444
outline: none;
4545
background-color: settings.$background-color-hover;
46-
color: settings.$color-hover;
4746
box-shadow: settings.$box-shadow-hover;
47+
color: settings.$color-hover;
4848
}
4949

5050
&:checked {
5151
border-color: settings.$border-color-checked;
5252
background-color: settings.$background-color-checked;
53-
color: settings.$color-checked;
5453
box-shadow: settings.$box-shadow-checked;
54+
color: settings.$color-checked;
5555

5656
&::after {
5757
transform: scale(0.7);
@@ -62,14 +62,14 @@
6262
&[disabled] {
6363
border-color: settings.$border-color-disabled;
6464
background-color: settings.$background-color-disabled;
65-
color: settings.$color-disabled;
6665
box-shadow: settings.$box-shadow-disabled;
66+
color: settings.$color-disabled;
6767

6868
&:checked {
6969
border-color: settings.$border-color-disabled-checked;
7070
background-color: settings.$background-color-disabled-checked;
71-
color: settings.$color-disabled-checked;
7271
box-shadow: settings.$box-shadow-disabled-checked;
72+
color: settings.$color-disabled-checked;
7373
}
7474

7575
&::after {

0 commit comments

Comments
 (0)