Skip to content

refactor: guidelines 3.0 input style #198

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 60 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
8387e0b
refactor: remove headline element – is replaced by base/typography st…
annsch Nov 2, 2022
4ab070c
feat: added textfield sizes and label animation
annsch Oct 12, 2022
0c74cda
feat: textfield variants
annsch Oct 14, 2022
10c662c
refactor: updated db-ui/base
annsch Nov 9, 2022
ccb12ae
style: guidlenes 3.0
annsch Nov 22, 2022
68996da
docs: added id
annsch Nov 23, 2022
5d92911
Merge branch 'dbux-3' into feat-textfield-updated-foundations
annsch Nov 23, 2022
d2d2c23
revert: headline component
annsch Nov 23, 2022
00b6a70
revert: headline component
annsch Nov 23, 2022
9af4b07
Merge branch 'dbux-3' into feat-textfield-updated-foundations
mfranzke Nov 24, 2022
0647806
refactor: remove headline element – is replaced by base/typography st…
annsch Nov 2, 2022
705a1ab
feat: added textfield sizes and label animation
annsch Oct 12, 2022
c7107b9
feat: textfield variants
annsch Oct 14, 2022
79acc76
refactor: updated db-ui/base
annsch Nov 9, 2022
051522b
style: guidlenes 3.0
annsch Nov 22, 2022
4209d42
docs: added id
annsch Nov 23, 2022
4a75042
revert: headline component
annsch Nov 23, 2022
d2fb206
revert: headline component
annsch Nov 23, 2022
32f805e
style: update latest
annsch Nov 24, 2022
5ae7628
Merge branch 'feat-textfield-updated-foundations' of https://github.c…
annsch Nov 29, 2022
64d525d
refactor: added wrapper element for icon styles
annsch Nov 29, 2022
5ca4830
refactor: input type=search
annsch Nov 30, 2022
8a8c2be
chore: merged with dbux-3
annsch Dec 2, 2022
2b11aeb
style: ability for icons
annsch Dec 5, 2022
c086c7b
docs: added backstop urls and migration guide
annsch Dec 5, 2022
9d8a870
chore: merged with dbux-3
annsch Dec 5, 2022
31b18db
Merge branch 'dbux-3' into feat-textfield-updated-foundations
annsch Dec 6, 2022
e61b98e
Merge branch 'dbux-3' into feat-textfield-updated-foundations
annsch Dec 7, 2022
98a633d
Merge branch 'dbux-3' into feat-textfield-updated-foundations
annsch Dec 7, 2022
bd5d0eb
refactor: remove form-element
annsch Dec 7, 2022
a07e58c
Update migrationGuide.adoc
mfranzke Dec 7, 2022
ebc7c3c
Merge branch 'dbux-3' into feat-textfield-updated-foundations
mfranzke Dec 8, 2022
829eabb
refactor: ensure unique IDs programatically
mfranzke Dec 8, 2022
f65346b
Update migrationGuide.adoc
mfranzke Dec 8, 2022
2b9f0a1
Update migrationGuide.adoc
mfranzke Dec 8, 2022
517acb2
Update input-sizes.json
mfranzke Dec 8, 2022
97a806c
Update input.hbs
mfranzke Dec 8, 2022
bc88ba5
Update input.hbs
mfranzke Dec 8, 2022
2b03fbf
docs: added some comment
mfranzke Dec 8, 2022
2efbfda
Merge branch 'feat-textfield-updated-foundations' of https://github.c…
mfranzke Dec 8, 2022
9291c0e
fix: review feedback included
annsch Dec 12, 2022
4db545b
fix: review feedback included
annsch Dec 12, 2022
ae5653a
test: remove variations to reduce test cases
annsch Dec 13, 2022
2f9df9e
refactor: form-element placeholder has been deleted
annsch Dec 13, 2022
bed18b9
Update input.scss
mfranzke Dec 13, 2022
11bfc92
chore: we shouldn't use optional here
mfranzke Dec 13, 2022
db399f5
Update textarea.scss
mfranzke Dec 13, 2022
ea78a4e
Update textarea.scss
mfranzke Dec 13, 2022
a79d481
chore: those would get adapted later
mfranzke Dec 13, 2022
e407dad
chore: those would need to get adapted later
mfranzke Dec 13, 2022
812a03a
chore: reverted removing those testcases
mfranzke Dec 13, 2022
01cef8d
chore: removed this leftover from by previous checkin
mfranzke Dec 13, 2022
ccfb890
refactor: use native behaviour with animated opacity
annsch Dec 14, 2022
dd0ba29
refactor: inserted review feedback
annsch Dec 14, 2022
d5f135f
refactor: merged with origin
annsch Dec 14, 2022
674561a
Merge remote-tracking branch 'origin/dbux-3' into feat-textfield-upda…
annsch Dec 14, 2022
d6504fa
Merge branch 'dbux-3' into feat-textfield-updated-foundations
mfranzke Dec 15, 2022
43e6825
chore: update dependencies
annsch Dec 15, 2022
4b183f6
Merge branch 'feat-textfield-updated-foundations' of https://github.c…
annsch Dec 15, 2022
7f92e18
style: corrected description's position
annsch Dec 15, 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
7 changes: 7 additions & 0 deletions docs/migrationGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ We've remove the deprecated previous HTML implementation of the label by an `out
- The `id`-attributes value on that `label` element needs to match the following attributes values that needs to get added onto the `progress` HTML tag itself:
`aria-describedby="{{ id }}-label"`

=== `input`

- The input background style variations `semitransparent`, `solid`, `white` and `outline` have been removed. Input fields have only one background style left.
- Introducing 3 different sizes of input fields according to our `tonality` introduction: `functional`, `regular`, `expressive
- Integration of `data-icon-before` and `data-icon-after` property for enabling use of custom icons in input fields
- Introducing new variations: `error`, `warning`, `success` and `information` following the new guidelines 3.0 color system

== DB UI Core 2.2.0 Migration Guide

=== progress element
Expand Down
18 changes: 18 additions & 0 deletions helpers/unique-id.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint unicorn/prefer-module: 0, eqeqeq: 0 */
module.exports = function (Handlebars) {
Handlebars.registerHelper('unique-id', function () {
// Adapted from https://www.codingdeft.com/posts/generate-uuid-javascript/
const crypto = require('node:crypto');

const buf = crypto.randomBytes(16);

// Convert the buffer to a hexadecimal string
const hex = buf.toString('hex');

// Return the hexadecimal string as a UUID
return `id-${hex.slice(
0,
7
)}-${hex.slice(8, 15)}-${hex.slice(16, 23)}-${hex.slice(24, 31)}`;
});
};
1 change: 1 addition & 0 deletions source/_patterns/01-elements/_form-element.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO common styles for formfields adopted from input
85 changes: 0 additions & 85 deletions source/_patterns/01-elements/_form-elements.scss

This file was deleted.

40 changes: 0 additions & 40 deletions source/_patterns/01-elements/_form-elements.variables.scss

This file was deleted.

5 changes: 0 additions & 5 deletions source/_patterns/01-elements/input/_input.variables.scss

This file was deleted.

6 changes: 6 additions & 0 deletions source/_patterns/01-elements/input/input-sizes.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<dl>
{{#each sizes}}
<dt>{{size}}:</dt>
<dd class="db-ui-{{size}}">{{> elements-input type=../type label=../label placeholder=../placeholder id=(unique-id) }}</dd>
{{/each }}
</dl>
19 changes: 19 additions & 0 deletions source/_patterns/01-elements/input/input-sizes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"sizes": [
{
"size": "functional",
"label": "Functional"
},
{
"size": "regular",
"label": "Regular (default, data-size attribute is optional)"
},
{
"size": "expressive",
"label": "Expressive"
}
],
"type": "text",
"placeholder": "e.g. DB User",
"label": "Textlabel"
}
4 changes: 4 additions & 0 deletions source/_patterns/01-elements/input/input-sizes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Input sizes
order: 1
---
8 changes: 6 additions & 2 deletions source/_patterns/01-elements/input/input-variations.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<dl>
<dl class="db-ui-normal">
{{#each variations}}
<dt>{{variant}}:</dt>
<dd>{{> elements-input type=../type label=../label placeholder=../placeholder }}</dd>
<dd class="db-ui-functional">{{> elements-input type=../type label=../label placeholder=../placeholder id=(unique-id) }}</dd>
<dt>&nbsp;</dt>
<dd class="db-ui-normal">{{> elements-input type=../type label=../label placeholder=../placeholder id=(unique-id) }}</dd>
<dt>&nbsp;</dt>
<dd class="db-ui-expressive">{{> elements-input type=../type label=../label placeholder=../placeholder id=(unique-id) }}</dd>
{{/each }}
</dl>
20 changes: 12 additions & 8 deletions source/_patterns/01-elements/input/input-variations.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"variations": [
{
"variant": "semitransparent",
"id": "input16"
"variant": "error",
"message": "Error Message",
"description": "Error Message Description"
},
{
"variant": "white",
"id": "input17"
"variant": "warning",
"message": "Warning Message",
"description": "Warning Message Description"
},
{
"variant": "solid",
"id": "input18"
"variant": "success",
"message": "Success Message",
"description": "Success Message Description"
},
{
"variant": "outline",
"id": "input19"
"variant": "information",
"message": "Information",
"description": "Information Message Description"
}
],
"type": "text",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
[id|="elements-input"] {
dl {
display: grid;
grid-template-columns: 1fr 5fr;
align-items: center;
}

dd {
margin-bottom: 2rem;
margin: 1rem 0;
}
}

Expand Down
59 changes: 34 additions & 25 deletions source/_patterns/01-elements/input/input.hbs
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
<!-- The aria-labelledby attribute on the input and related id on the label as well as aria-hidden="true" are being set for correct support within assistive tools like screenreaders //-->
<!-- [html-validate-disable-next input-missing-label] -->
<input type="{{ type }}"
class="elm-input {{ styleModifier }}"
placeholder="{{ placeholder }}"
name="{{ id }}"
id="{{ id }}"
{{#if disabled}} disabled{{/if }}
value="{{ value }}"
{{#if describedbyid }} aria-describedby="{{ describedbyid }}"{{/if }}
{{#if aria-invalid }} aria-invalid="{{ aria-invalid }}"{{/if }}
{{{ validation }}}
{{#if datalist }} list="datalist{{ id }}"{{/if }}
aria-labelledby="{{ id }}-label"
{{#if variant}} data-variant="{{variant}}"{{/if }}>
<label class="elm-label"
for="{{ id }}"
aria-hidden="true"
id="{{ id }}-label">{{ label }}</label>
{{#if description }}<p{{#if describedbyid }} id="{{ describedbyid }}"{{/if }} class="description">{{{ description }}}</p>{{/if }}
{{#if datalist }}<datalist id="datalist{{ id }}">
{{#each datalistItems }}
<option{{#if value }} value="{{ value }}"{{/if }}>{{ text }}</option>
{{/each }}
</datalist>{{/if }}
<div class="elm-input"
{{#if variant}} data-variant="{{variant}}"{{/if }}
{{#if icon-before}} data-icon-before="{{icon-before}}"{{/if}}
{{#if icon-before}} data-icon-after="{{icon-after}}"{{/if}}>
<!-- The aria-labelledby attribute on the input and related id on the label as well as aria-hidden="true" are being set for correct support within assistive tools like screenreaders //-->
<!-- [html-validate-disable-next input-missing-label] -->
<input type="{{ type }}"
{{#if styleModifier }}class="{{ styleModifier }}"{{/if }}
placeholder="{{ placeholder }}"
name="{{ id }}"
id="{{ id }}"
{{#if disabled}} disabled{{/if }}
value="{{ value }}"
{{#if describedbyid }} aria-describedby="{{ describedbyid }}"{{/if }}
{{#if aria-invalid }} aria-invalid="{{ aria-invalid }}"{{/if }}
{{{ validation }}}
{{#if datalist }} list="datalist{{ id }}"{{/if }}
aria-labelledby="{{ id }}-label">
<label for="{{ id }}"
aria-hidden="true"
id="{{ id }}-label">{{ label }}</label>

{{#if description }}<p{{#if describedbyid }} id="{{ describedbyid }}"{{/if }} class="description">{{{ description }}}</p>{{/if }}

{{#if datalist }}<datalist id="datalist-{{ id }}">
{{#each datalistItems }}
<option{{#if value }} value="{{ value }}"{{/if }}>{{ text }}</option>
{{/each }}
</datalist>
{{/if }}

{{!-- icon for data-variants like error or success --}}
<span class="elm-state-icon"></span>
</div>
Loading