Skip to content

Commit

Permalink
Some feedback resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
dlnr committed Feb 7, 2024
1 parent 05288f0 commit f69cd3e
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
19 changes: 9 additions & 10 deletions packages/css/src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2023 Gemeente Amsterdam
*/

@mixin amsterdam-button {
.amsterdam-button {
border: none;
cursor: var(--amsterdam-action-activate-cursor);
display: inline-flex;
Expand All @@ -21,14 +21,14 @@
line-height: var(--amsterdam-breadcrumb-compact-line-height);
}

&:hover {
cursor: var(--amsterdam-action-activate-cursor);
}

&:disabled,
&[aria-disabled="true"] {
cursor: var(--amsterdam-action-disabled-cursor);
}

&:hover:not(:disabled, [aria-disabled="true"]) {
cursor: var(--amsterdam-action-activate-cursor);
}
}

@mixin amsterdam-button-forced-color-mode {
Expand All @@ -37,24 +37,26 @@
}
}

.amsterdam-button--busy {
.amsterdam-button--busy:hover {
cursor: var(--amsterdam-action-busy-cursor);
}

.amsterdam-button--primary {
background-color: var(--amsterdam-button-primary-background-color);
box-shadow: var(--amsterdam-button-primary-box-shadow);
color: var(--amsterdam-button-primary-color);

&:disabled,
[aria-disabled="true"] {
background-color: var(--amsterdam-button-primary-disabled-background-color);
box-shadow: var(--amsterdam-button-primary-disabled-box-shadow);
}

&:hover:not(:disabled, [aria-disabled="true"]) {
background-color: var(--amsterdam-button-primary-hover-background-color);
box-shadow: var(--amsterdam-button-primary-hover-box-shadow);
}

@include amsterdam-button;
@include amsterdam-button-forced-color-mode;
}

Expand All @@ -75,7 +77,6 @@
color: var(--amsterdam-button-secondary-hover-color);
}

@include amsterdam-button;
@include amsterdam-button-forced-color-mode;
}

Expand All @@ -93,6 +94,4 @@
box-shadow: var(--amsterdam-button-tertiary-hover-box-shadow);
color: var(--amsterdam-button-tertiary-hover-color);
}

@include amsterdam-button;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
},
"primary": {
"background-color": { "value": "{amsterdam.color.primary-blue}" },
"box-shadow": { "value": "inset 0 0 0 2px {amsterdam.color.primary-blue}" },
"color": { "value": "{amsterdam.color.primary-white}" },
"disabled": {
"background-color": { "value": "{amsterdam.color.neutral-grey2}" }
"background-color": { "value": "{amsterdam.color.neutral-grey2}" },
"box-shadow": { "value": "inset 0 0 0 2px {amsterdam.color.neutral-grey2}" }
},
"hover": {
"background-color": { "value": "{amsterdam.color.dark-blue}" }
"background-color": { "value": "{amsterdam.color.dark-blue}" },
"box-shadow": { "value": "inset 0 0 0 2px {amsterdam.color.dark-blue}" }
}
},
"secondary": {
Expand Down
14 changes: 14 additions & 0 deletions storybook/storybook-react/src/Button/Button.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,17 @@ Use tertiary buttons for unimportant calls to action – as many as necessary.
### Tertiary

<Canvas of={ButtonStories.TertiaryDisabled} />

## Busy

### Primary

<Canvas of={ButtonStories.PrimaryBusy} />

### Secondary

<Canvas of={ButtonStories.SecondaryBusy} />

### Tertiary

<Canvas of={ButtonStories.TertiaryBusy} />
23 changes: 23 additions & 0 deletions storybook/storybook-react/src/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,26 @@ export const TertiaryDisabled: Story = {
variant: 'tertiary',
},
}

export const PrimaryBusy: Story = {
args: {
children: 'Primary',
busy: true,
},
}

export const SecondaryBusy: Story = {
args: {
children: 'Secondary',
busy: true,
variant: 'secondary',
},
}

export const TertiaryBusy: Story = {
args: {
children: 'Tertiary',
busy: true,
variant: 'tertiary',
},
}

0 comments on commit f69cd3e

Please sign in to comment.