Skip to content

refactor: guidelines 3.0 button style #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 71 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
3e4e674
chore: label correction
mfranzke Sep 8, 2022
c91e9ed
refactor: primary becomes secondary inverted
mfranzke Sep 8, 2022
36d270c
refactor: tertiary plain becomes ghost
mfranzke Sep 8, 2022
7728cf4
refactor: secondary solid becomes tertiary
mfranzke Sep 8, 2022
f7b0144
refactor: secondary outline becomes secondary
mfranzke Sep 8, 2022
0c4f69d
refactor: brand primary becomes the regular primary button
mfranzke Sep 8, 2022
d89637e
refactor: corrected the order
mfranzke Sep 8, 2022
aff7fcb
refactor: the button are all supposed to be styled in bold font-weight
mfranzke Sep 8, 2022
baf9e15
chore: we've removed this in total
mfranzke Sep 8, 2022
5a6ff02
refactor: enabling dark backgrounds for the styleguide
mfranzke Sep 8, 2022
d0516f5
chore: adding missing default additions
mfranzke Sep 8, 2022
2d2275e
chore: adapted the correct styles
mfranzke Sep 8, 2022
bfb737c
refactor: adapted styles
mfranzke Sep 8, 2022
7021f79
refactor: adapted the disabled state
mfranzke Sep 8, 2022
79b1ee3
refactor: removed those obsolete variants
mfranzke Sep 8, 2022
85429b1
refactor: renaming regular size to medium
mfranzke Sep 8, 2022
7b6709a
refactor: added xsmall size and other size related aspects out of the…
mfranzke Sep 8, 2022
01ea42c
docs: reordered
mfranzke Sep 8, 2022
5ac4b1a
docs: reordered
mfranzke Sep 8, 2022
9202b21
refactor: added button width
mfranzke Sep 8, 2022
3382b33
Merge branch 'main' into refactor-guidelines-3.0-button-style
mfranzke Sep 8, 2022
a6c1514
Merge branch 'main' into refactor-guidelines-3.0-button-style
mfranzke Sep 8, 2022
cf6288f
docs: added missing SCSS placeholders
mfranzke Sep 8, 2022
cd269e1
refactor: checked all of the hover and active background-colors again
mfranzke Sep 8, 2022
35c752f
refactor: background-color should change on hover hover with a transi…
mfranzke Sep 8, 2022
5297d94
feat: added new sizes and let smallest buttons include 16px icon sizes
mfranzke Sep 21, 2022
4ea8449
refactor: using DB UI Base variable
mfranzke Sep 28, 2022
6106646
Merge branch 'v3' into refactor-guidelines-3.0-button-style
mfranzke Sep 28, 2022
b3e81b2
Merge branch 'v3' into refactor-guidelines-3.0-button-style
mfranzke Sep 29, 2022
617d18d
Merge branch 'v3' into refactor-guidelines-3.0-button-style
mfranzke Sep 29, 2022
0e28db7
refactor: transition declaration
mfranzke Sep 29, 2022
2893f82
chore: slightly increased the paragraphs width
mfranzke Sep 29, 2022
74b111b
Merge branch 'v3' into refactor-guidelines-3.0-button-style
mfranzke Sep 29, 2022
5f89e50
refactor: added those dirty hacks for the small icon sizes
mfranzke Sep 29, 2022
d02b655
Merge branch 'refactor-guidelines-3.0-button-style' of https://github…
mfranzke Sep 29, 2022
996c6e5
refactor: simplified the testcases
mfranzke Sep 30, 2022
2ab37d4
feat: added loading state
mfranzke Sep 30, 2022
1c8aaaa
Update button.scss
mfranzke Oct 12, 2022
460a9a1
Merge branch 'main' into refactor-guidelines-3-button-style
mfranzke Oct 23, 2022
e263e0d
chore: stylelint feedback
mfranzke Oct 23, 2022
45d2cd2
refactor: removed plugin-node-wrappable plugin again
mfranzke Nov 8, 2022
ee00504
refactor: not using sg-wrapper anymore
mfranzke Nov 8, 2022
62ed75f
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 8, 2022
9d66928
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 8, 2022
e691ad6
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 8, 2022
3ae468b
chore: removed the (now) obsolete sizes
mfranzke Nov 8, 2022
9164f69
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 9, 2022
f515cce
fix: removed that redundant (and incorrect) declaration
mfranzke Nov 9, 2022
d3d48f0
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 10, 2022
189e75b
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 15, 2022
c10abe8
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 15, 2022
eb33c8f
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 15, 2022
0960223
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 16, 2022
c629f27
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 21, 2022
93c3faa
chore: prevent HTML errors
mfranzke Nov 21, 2022
deccee1
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 21, 2022
b2b26fe
chore: adapted the necessary changes
mfranzke Nov 21, 2022
6b8188d
Merge branch 'refactor-guidelines-3-button-style' of https://github.c…
mfranzke Nov 21, 2022
83e5c4b
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 21, 2022
112d566
chore: added a variation for the id value
mfranzke Nov 21, 2022
413f97b
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 21, 2022
99ec457
Refactor dbux 3 button new (#155)
nmerget Nov 21, 2022
b77f143
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 22, 2022
acb9c2e
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
nmerget Nov 23, 2022
e49c51b
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 24, 2022
984b986
Update _buttons.md
mfranzke Nov 24, 2022
d90b021
Merge branch 'dbux-3' into refactor-guidelines-3-button-style
mfranzke Nov 24, 2022
5485796
refactor: removed obsolete variables
mfranzke Nov 24, 2022
98b57a9
refactor: removed obsolete file
mfranzke Nov 24, 2022
bf8b085
Update migrationGuide.adoc
mfranzke Nov 24, 2022
fcd7020
Update migrationGuide.adoc
mfranzke Nov 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/migrationGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ We've removed the following files, that we already deprecated within the previou
- `@db-ui/core/sources/css/enterprise/db-ui-core-rollup.scss`
- `@db-ui/core/sources/css/enterprise/db-ui-core-webpack.scss`

=== progress
=== `button`

- The `large` size has been removed; it became obsolete mainly due to our `tonality` introduction
- And renamed `regular` size to `medium`
- Made some changes regarding the variants:
- `Brand primary` becomes the regular `Primary` button
- `Primary` becomes `Secondary Inverted`
- `Secondary Outline` becomes `Secondary`
- `Secondary Solid` becomes `Tertiary`
- `Tertiary Plain` becomes `Ghost`

=== `progress`

We've remove the deprecated previous HTML implementation of the label by an `output` element and replaced it by an actual `label` element. Necessary changes:

Expand Down
9 changes: 9 additions & 0 deletions source/_patterns/00-base/_init.demonstration.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
@use "@db-ui/base/build/scss/variables" as *;

body.styleguide {
display: initial;
}

.sg-wrapper-dark-background {
background-color: $db-colors-secondary-enabled;

margin: -1rem -0.5rem;
padding: 1rem 0.5rem;
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{!-- TODO: let's not use those modifier classes, but inherit their meaning via CSS correctly and introduce sample classes for the styleguide --}}
<p>
{{> elements-button variant='primary' value='Primary' icon='add' }}
{{> elements-button variant='primary' value='Primary (disabled)' disabled='true' icon='add' }}
{{> elements-button variant='primary' value='Primary' }}
{{> elements-button variant='primary' value='Primary (disabled)' disabled='true' }}
</p>
<p>
{{> elements-button variant='primary' value='Primary with icon' icon-after='add'}}
{{> elements-button variant='primary' value='Primary with icon (disabled)' disabled='true' icon-after='add' }}
</p>
<p>
{{> elements-button variant='primary' value='Primary without icon' }}
{{> elements-button variant='primary' value='Primary without icon (disabled)' disabled='true' }}
{{> elements-button variant='primary' value='Primary' icon='add'}}
{{> elements-button variant='primary' value='Primary' disabled='true' icon='add' }}
</p>
<p>
{{> elements-button variant='primary' title='Check' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
{{> elements-button variant='primary' title='Check' value='Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }}
</p>
<p>
{{> elements-button variant='primary' title='Check' value='loading' state='loading' }}
</p>
21 changes: 21 additions & 0 deletions source/_patterns/01-elements/buttons/02-button-secondary.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<p>
{{> elements-button variant='secondary' value='Secondary' }}
{{> elements-button variant='secondary' value='Secondary (disabled)' disabled='true' }}
</p>
<p>
{{> elements-button variant='secondary' value='Secondary' icon='add' }}
{{> elements-button variant='secondary' value='Secondary (disabled)' disabled='true' icon='add' }}
</p>
<p>
{{> elements-button variant='secondary' title='Check' value='Secondary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
{{> elements-button variant='secondary' title='Check' value='Secondary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }}
</p>
<p>
{{> elements-button variant='secondary' title='Check' value='loading' state='loading' }}
</p>


<p class="db-bg-success-light-ia">
{{> elements-button variant='secondary' value='Secondary' }}
{{> elements-button variant='secondary' value='Secondary (disabled)' disabled='true' }}
</p>

This file was deleted.

This file was deleted.

20 changes: 20 additions & 0 deletions source/_patterns/01-elements/buttons/05-button-tertiary.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<p>
{{> elements-button variant='tertiary' value='Tertiary' }}
{{> elements-button variant='tertiary' value='Tertiary (disabled)' disabled='true' }}
</p>
<p>
{{> elements-button variant='tertiary' value='Tertiary' icon='add' }}
{{> elements-button variant='tertiary' value='Tertiary (disabled)' disabled='true' icon='add' }}
</p>
<p>
{{> elements-button variant='tertiary' title='Check' value='Tertiary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
{{> elements-button variant='tertiary' title='Check' value='Tertiary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }}
</p>
<p>
{{> elements-button variant='tertiary' title='Check' value='loading' state='loading' }}
</p>

<p class="db-bg-success-light-ia">
{{> elements-button variant='tertiary' value='Tertiary' }}
{{> elements-button variant='tertiary' value='Tertiary (disabled)' disabled='true' }}
</p>
20 changes: 20 additions & 0 deletions source/_patterns/01-elements/buttons/06-button-ghost.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<p>
{{> elements-button variant='ghost' value='Ghost' }}
{{> elements-button variant='ghost' value='Ghost (disabled)' disabled='true' }}
</p>
<p>
{{> elements-button variant='ghost' value='Ghost' }}
{{> elements-button variant='ghost' value='Ghost' disabled='true' }}
</p>
<p>
{{> elements-button variant='ghost' title='Check' value='Ghost displaying only the icon' icon='done' styleModifier='is-icon-text-replace' }}
{{> elements-button variant='ghost' title='Check' value='Ghost displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' }}
</p>
<p>
{{> elements-button variant='ghost' title='Check' value='loading' state='loading' }}
</p>

<p class="db-bg-success-light-ia">
{{> elements-button variant='ghost' value='Ghost' }}
{{> elements-button variant='ghost' value='Ghost (disabled)' disabled='true' }}
</p>

This file was deleted.

16 changes: 6 additions & 10 deletions source/_patterns/01-elements/buttons/09-button-sizes.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
<!-- [html-validate-disable-next heading-level] -->
<h2>{{ label }}</h2>
<p>
{{> elements-button variant='brand-primary' value='Brand Primary' icon='add' size=size }}
{{> elements-button variant='brand-primary' value='Brand Primary (disabled)' disabled='true' icon='add' size=size }}
{{> elements-button variant='primary' value='Primary' size=size }}
{{> elements-button variant='primary' value='Primary (disabled)' disabled='true' size=size }}
</p>
<p>
{{> elements-button variant='brand-primary' value='Brand Primary with right icon' icon-after='add' size=size }}
{{> elements-button variant='brand-primary' value='Brand Primary with right icon(disabled)' disabled='true' icon-after='add' size=size }}
{{> elements-button variant='primary' value='Primary' icon='add' size=size }}
{{> elements-button variant='primary' value='Primary (disabled)' disabled='true' icon='add' size=size }}
</p>
<p>
{{> elements-button variant='brand-primary' value='Brand Primary without icon' size=size }}
{{> elements-button variant='brand-primary' value='Brand Primary without icon (disabled)' disabled='true' size=size }}
</p>
<p>
{{> elements-button variant='brand-primary' title='Done' value='Brand Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' size=size }}
{{> elements-button variant='brand-primary' title='Done' value='Brand Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' size=size }}
{{> elements-button variant='primary' title='Done' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' size=size }}
{{> elements-button variant='primary' title='Done' value='Primary displaying only the icon' disabled='true' icon='done' styleModifier='is-icon-text-replace' size=size }}
</p>
{{/each }}
8 changes: 2 additions & 6 deletions source/_patterns/01-elements/buttons/09-button-sizes.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
"label": "Small"
},
{
"size": "regular",
"label": "Regular (default, data-size attribute is optional)"
},
{
"size": "large",
"label": "Large"
"size": "medium",
"label": "Medium (default, data-size attribute is optional)"
}
]
}
13 changes: 13 additions & 0 deletions source/_patterns/01-elements/buttons/10-button-width.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{#each width }}
<!-- [html-validate-disable-next heading-level] -->
<h2>{{ label }}</h2>
<p>
{{> elements-button variant='primary' value='Primary' width=width }}
</p>
<p>
{{> elements-button variant='primary' value='Primary' icon='add' width=width }}
</p>
<p>
{{> elements-button variant='primary' title='Done' value='Primary displaying only the icon' icon='done' styleModifier='is-icon-text-replace' width=width }}
</p>
{{/each }}
8 changes: 8 additions & 0 deletions source/_patterns/01-elements/buttons/10-button-width.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"width": [
{
"width": "full",
"label": "FullWidth"
}
]
}
3 changes: 3 additions & 0 deletions source/_patterns/01-elements/buttons/10-button-width.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Button width
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* stylelint-disable selector-max-id */
#elements-button-width {
.pl-js-pattern-example {
p {
/* stylelint-enable selector-max-id */
width: 300px;
}
}
}
35 changes: 0 additions & 35 deletions source/_patterns/01-elements/buttons/_button.variables.scss

This file was deleted.

16 changes: 13 additions & 3 deletions source/_patterns/01-elements/buttons/_buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ state: complete

#### SCSS (recommended)

Extend one of the variant placeholders: `%variant-primary`, `%variant-secondary` or `%variant-tertiary`
Extend one of the variant placeholders: `%variant-primary`, `%variant-secondary`, `%variant-tertiary` or `%variant-ghost`

#### HTML attribute

Expand All @@ -19,11 +19,21 @@ You could set the different button variants via the `data-variant` attribute.

#### SCSS (recommended)

Extend one of the size SCSS placeholders in case that you don't want the default (regular): `%size-Small` or `%size-Large`
Extend the size SCSS placeholder in case that you don't want the default (medium): `%size-Small`

#### HTML attribute

You could set the different button sizes via the `data-size` attribute, the default is "regular" and in that case is optional.
You could set the different button sizes via the `data-size` attribute, the default is "medium" and in that case is optional.

### Width

#### SCSS (recommended)

Extend the width placeholders in case that you don't want the default (content-length sized): `%width-full`

#### HTML attribute

You could differentiate the button width via the `data-width` attribute, choose value "full" for a button taking the whole containers width; the default is "auto" and in that case is optional.

## Usability

Expand Down
5 changes: 4 additions & 1 deletion source/_patterns/01-elements/buttons/button.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<button class="elm-button {{ styleModifier }}"
{{#if variant }}data-variant="{{ variant }}"{{/if }}
{{#if size }} data-size="{{ size }}"{{/if }}
{{#if width }} data-width="{{ width }}"{{/if }}
title="{{ title }}"
type="{{#if buttontype }}{{ buttontype }}{{else}}button{{/if }}"
{{#if role }} role="{{ role }}"{{/if }}
{{#if disabled }} disabled{{/if }}
{{#if icon}} data-icon="{{ icon }}"{{/if}}
{{#if icon-after}} data-icon-after="{{ icon-after }}"{{/if}}>
{{#if icon-after}} data-icon-after="{{ icon-after }}"{{/if}}
{{#if state}} data-state="{{ state }}"{{/if}}>
{{{ value }}}
{{#if_eq state "loading" }}{{> elements-loading-indicator size="xs" id=variant }}{{/if_eq }}
</button>
4 changes: 2 additions & 2 deletions source/_patterns/01-elements/buttons/button.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"variant": "brand-primary",
"variant": "primary",
"title": "Done",
"value": "Red 500"
"value": "Button"
}
Loading