Skip to content

Commit cf131bb

Browse files
authored
Merge pull request #12 from tableflowhq/input/disabled
Improve disabled states for Checkbox & Input
2 parents 1b8872f + 0ade3a1 commit cf131bb

File tree

5 files changed

+341
-324
lines changed

5 files changed

+341
-324
lines changed

src/Checkbox/Checkbox.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ const Template: ComponentStory<typeof CheckboxComponent> = (args: CheckboxProps)
1313
export const Checkbox = Template.bind({});
1414
Checkbox.args = {
1515
label: "Text",
16+
disabled: false,
1617
};

src/Checkbox/style/Checkbox.module.scss

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,29 @@
3434

3535
&:checked::before {
3636
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
37-
box-shadow: inset 1em 1em var(--color-input-background);
37+
box-shadow: inset 1em 1em var(--color-text-on-primary);
3838
}
3939

40-
//&:not(:disabled) {
41-
// &:focus {
42-
// outline: 1px solid var(--color-border);
43-
// outline-offset: 3px;
44-
// }
45-
//}
40+
&:not(:disabled) {
41+
&:focus-visible {
42+
outline: 1px solid var(--color-border);
43+
outline-offset: 3px;
44+
}
45+
}
4646

4747
&:disabled {
4848
--container-color: var(--container-disabled);
4949
color: var(--container-disabled);
5050
cursor: default;
5151
background-color: var(--color-input-disabled);
52+
border-color: var(--color-border-soft);
53+
54+
&:checked {
55+
&::before {
56+
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
57+
box-shadow: inset 1em 1em var(--color-border-soft);
58+
}
59+
}
5260
}
5361
}
5462
}

src/Input/Input.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ Dropdown.args = {
135135
"Option III": { value: "3" },
136136
"Option IV": { value: "4" },
137137
"Option V": { value: "5" },
138-
"Option V": { value: "required", required: true },
138+
"Option VI": { value: "required", required: true },
139139
},
140140
};

0 commit comments

Comments
 (0)