Skip to content

Commit

Permalink
feat: disabled cursor for form inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Sep 19, 2021
1 parent 486e4ec commit 0f5ada6
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/button/bem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
.utrecht-button--disabled {
background-color: var(--utrecht-button-disabled-background-color);
color: var(--utrecht-button-disabled-color);
cursor: var(--utrecht-action-disabled-cursor);
}

.utrecht-button--focus,
Expand Down
2 changes: 1 addition & 1 deletion components/checkbox/bem.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const defaultArgs = {
};

export const Checkbox = ({ checked = false, disabled = false }) =>
`<input type="checkbox"${checked ? ' checked' : ''} class="${clsx(
`<input type="checkbox"${checked ? ' checked' : ''}${disabled ? ' disabled' : ''} class="${clsx(
'utrecht-checkbox',
checked && 'utrecht-checkbox--checked',
disabled && 'utrecht-checkbox--disabled',
Expand Down
4 changes: 4 additions & 0 deletions components/checkbox/bem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
margin-inline-end: 0;
margin-inline-start: 0;
}

.utrecht-checkbox--disabled {
cursor: var(--utrecht-action-disabled-cursor);
}
14 changes: 14 additions & 0 deletions components/common/action.tokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"utrecht": {
"action": {
"disabled": {
"cursor": {
"css": {
"syntax": "*",
"inherits": true
}
}
}
}
}
}
1 change: 1 addition & 0 deletions components/form-toggle/bem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
border-color: var(--utrecht-form-toggle-disabled-border-color, var(--utrecht-form-toggle-border-color, currentColor));
border-style: var(--utrecht-form-toggle-disabled-border-style, var(--utrecht-form-toggle-border-style, solid));
border-width: var(--utrecht-form-toggle-disabled-border-width, var(--utrecht-form-toggle-border-width, 1px));
cursor: var(--utrecht-action-disabled-cursor);
}

.utrecht-form-toggle__thumb {
Expand Down
4 changes: 4 additions & 0 deletions components/radio-button/bem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
margin-inline-end: 0;
margin-inline-start: 0;
}

.utrecht-radio-button--disabled {
cursor: var(--utrecht-action-disabled-cursor);
}
1 change: 1 addition & 0 deletions components/select/bem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
--utrecht-select-disabled-color,
var(--utrecht-form-input-disabled-color, var(--utrecht-select-color, var(--utrecht-form-input-color)))
);
cursor: var(--utrecht-action-disabled-cursor);
}

.utrecht-select--focus {
Expand Down
1 change: 1 addition & 0 deletions components/textarea/bem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
--utrecht-textarea-disabled-color,
var(--utrecht-form-input-disabled-color, var(--utrecht-textarea-color, var(--utrecht-form-input-color)))
);
cursor: var(--utrecht-action-disabled-cursor);
}

.utrecht-textarea--focus {
Expand Down
1 change: 1 addition & 0 deletions components/textbox/bem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
--utrecht-textbox-disabled-color,
var(--utrecht-form-input-disabled-color, var(--utrecht-textarea-color, var(--utrecht-form-input-color)))
);
cursor: var(--utrecht-action-disabled-cursor);
}

.utrecht-textbox--focus {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"utrecht": {
"action": {
"disabled": { "cursor": { "value": "not-allowed" } }
}
}
}

0 comments on commit 0f5ada6

Please sign in to comment.