@hashicorp/design-system-components 0.12.8 → 0.12.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/addon/components/hds/alert/index.hbs +9 -2
- package/addon/components/hds/alert/index.js +21 -2
- package/addon/components/hds/card/container.js +65 -5
- package/addon/components/hds/form/checkbox/base.hbs +1 -1
- package/addon/components/hds/form/checkbox/field.hbs +1 -1
- package/addon/components/hds/form/checkbox/group.hbs +8 -3
- package/addon/components/hds/form/field/index.hbs +11 -1
- package/addon/components/hds/form/field/index.js +18 -0
- package/addon/components/hds/form/fieldset/index.hbs +7 -1
- package/addon/components/hds/form/fieldset/index.js +18 -0
- package/addon/components/hds/form/indicator/index.hbs +6 -0
- package/addon/components/hds/form/label/index.hbs +1 -0
- package/addon/components/hds/form/legend/index.hbs +1 -0
- package/addon/components/hds/form/radio/base.hbs +1 -1
- package/addon/components/hds/form/radio/field.hbs +1 -1
- package/addon/components/hds/form/radio/group.hbs +10 -3
- package/addon/components/hds/form/select/field.hbs +10 -2
- package/addon/components/hds/form/text-input/field.hbs +10 -2
- package/addon/components/hds/form/textarea/base.hbs +1 -1
- package/addon/components/hds/form/textarea/field.hbs +11 -2
- package/addon/components/hds/form/toggle/base.js +0 -5
- package/addon/components/hds/form/toggle/field.hbs +1 -1
- package/addon/components/hds/form/toggle/group.hbs +14 -0
- package/app/components/hds/form/indicator/index.js +1 -0
- package/app/components/hds/form/toggle/group.js +1 -0
- package/app/styles/components/badge-count.scss +1 -0
- package/app/styles/components/badge.scss +2 -1
- package/app/styles/components/button.scss +16 -0
- package/app/styles/components/card/container.scss +25 -0
- package/app/styles/components/form/_tokens.scss +41 -0
- package/app/styles/components/form/checkbox.scss +28 -41
- package/app/styles/components/form/error.scss +1 -1
- package/app/styles/components/form/group.scss +2 -2
- package/app/styles/components/form/helper-text.scss +1 -1
- package/app/styles/components/form/index.scss +3 -0
- package/app/styles/components/form/indicator.scss +15 -0
- package/app/styles/components/form/label.scss +9 -1
- package/app/styles/components/form/legend.scss +9 -1
- package/app/styles/components/form/radio.scss +25 -42
- package/app/styles/components/form/select.scss +24 -12
- package/app/styles/components/form/text-input.scss +21 -22
- package/app/styles/components/form/textarea.scss +18 -20
- package/app/styles/components/form/toggle.scss +21 -36
- package/package.json +2 -2
- package/addon/components/hds/form/checkbox/base.js +0 -19
- package/addon/components/hds/form/radio/base.js +0 -19
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
@use "sass:math";
|
|
8
8
|
|
|
9
9
|
$hds-form-toggle-control-width: 32px;
|
|
10
|
-
$hds-form-toggle-control-height: 16px;
|
|
10
|
+
$hds-form-toggle-control-height: 16px; // for the other controls we use "--token-form-checkbox-size" but in this case we need a Sass variable to do math operations on it
|
|
11
11
|
$hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
12
12
|
|
|
13
13
|
// "BASE" CONTROL
|
|
@@ -71,7 +71,7 @@ $hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
|
71
71
|
left: -1px;
|
|
72
72
|
position: absolute;
|
|
73
73
|
transform: translate3d(0, 0, 0);
|
|
74
|
-
transition: transform 0.2s cubic-bezier(0.
|
|
74
|
+
transition: transform 0.2s cubic-bezier(0.68, -0.2, 0.265, 1.15), border-color 0.2s ease-in;
|
|
75
75
|
top: -1px;
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -96,12 +96,12 @@ $hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
|
96
96
|
// base (default)
|
|
97
97
|
|
|
98
98
|
:not(:checked) + & {
|
|
99
|
-
--border-color: var(--token-
|
|
100
|
-
background-color: var(--token-color-surface-
|
|
99
|
+
--border-color: var(--token-form-control-border-color-default);
|
|
100
|
+
background-color: var(--token-color-surface-strong); // not like the other controls!
|
|
101
101
|
}
|
|
102
102
|
:checked + & {
|
|
103
|
-
--border-color: var(--token-
|
|
104
|
-
background-color: var(--token-
|
|
103
|
+
--border-color: var(--token-form-control-border-color-checked);
|
|
104
|
+
background-color: var(--token-form-control-background-color-checked);
|
|
105
105
|
// notice: the "tick" color is hardcoded here!
|
|
106
106
|
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M9.78033 3.21967C10.0732 3.51256 10.0732 3.98744 9.78033 4.28033L5.28033 8.78033C4.98744 9.07322 4.51256 9.07322 4.21967 8.78033L2.21967 6.78033C1.92678 6.48744 1.92678 6.01256 2.21967 5.71967C2.51256 5.42678 2.98744 5.42678 3.28033 5.71967L4.75 7.18934L8.71967 3.21967C9.01256 2.92678 9.48744 2.92678 9.78033 3.21967Z' fill='%23FFF'/%3e%3c/svg%3e");
|
|
107
107
|
|
|
@@ -115,56 +115,41 @@ $hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
|
115
115
|
|
|
116
116
|
:hover:not(:checked) + &,
|
|
117
117
|
.mock-hover:not(:checked) + & {
|
|
118
|
-
--border-color: var(--token-color-
|
|
118
|
+
--border-color: var(--token-form-control-border-color-default-hover);
|
|
119
119
|
}
|
|
120
120
|
:hover:checked + &,
|
|
121
121
|
.mock-hover:checked + & {
|
|
122
|
-
--border-color: var(--token-color-
|
|
123
|
-
background-color: var(--token-color-
|
|
122
|
+
--border-color: var(--token-form-control-border-color-checked-hover);
|
|
123
|
+
background-color: var(--token-form-control-background-color-checked-hover);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
// focus (same for all the states)
|
|
127
127
|
|
|
128
128
|
:focus:not(:checked) + &,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
.mock-focus:checked + & {
|
|
132
|
-
--border-color: var(--token-color-palette-blue-400);
|
|
129
|
+
.mock-focus:not(:checked) + & {
|
|
130
|
+
--border-color: var(--token-form-control-border-color-default);
|
|
133
131
|
|
|
134
132
|
&::before {
|
|
135
133
|
border-style: solid;
|
|
136
134
|
border-color: var( --token-color-focus-action-external);
|
|
137
135
|
}
|
|
138
136
|
}
|
|
137
|
+
:focus:checked + &,
|
|
138
|
+
.mock-focus:checked + & {
|
|
139
|
+
--border-color: var(--token-form-control-border-color-checked);
|
|
139
140
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
.hds-form-toggle--is-invalid :checked + & {
|
|
146
|
-
background-color: var(--token-color-palette-red-200);
|
|
147
|
-
--border-color: var(--token-color-palette-red-300);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.hds-form-toggle--is-invalid :hover:not(:checked) + &,
|
|
151
|
-
.hds-form-toggle--is-invalid .mock-hover:not(:checked) + & {
|
|
152
|
-
--border-color: var(--token-color-palette-red-400);
|
|
153
|
-
}
|
|
154
|
-
.hds-form-toggle--is-invalid :hover:checked + &,
|
|
155
|
-
.hds-form-toggle--is-invalid .mock-hover:checked + & {
|
|
156
|
-
--border-color: var(--token-color-palette-red-300);
|
|
157
|
-
background-color: var(--token-color-palette-red-400);
|
|
141
|
+
&::before {
|
|
142
|
+
border-style: solid;
|
|
143
|
+
border-color: var( --token-color-focus-action-external);
|
|
144
|
+
}
|
|
158
145
|
}
|
|
159
146
|
|
|
160
147
|
// DISABLED
|
|
161
148
|
|
|
162
149
|
:disabled:not(:checked) + &,
|
|
163
|
-
:disabled:checked +
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
background-color: var(--token-color-surface-strong);
|
|
167
|
-
--border-color: var(--token-color-border-primary);
|
|
150
|
+
:disabled:checked + & {
|
|
151
|
+
background-color: var(--token-form-control-background-color-disabled);
|
|
152
|
+
--border-color: var(--token-form-control-border-color-disabled);
|
|
168
153
|
// notice: the "tick" color is hardcoded here!
|
|
169
154
|
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M9.78033 3.21967C10.0732 3.51256 10.0732 3.98744 9.78033 4.28033L5.28033 8.78033C4.98744 9.07322 4.51256 9.07322 4.21967 8.78033L2.21967 6.78033C1.92678 6.48744 1.92678 6.01256 2.21967 5.71967C2.51256 5.42678 2.98744 5.42678 3.28033 5.71967L4.75 7.18934L8.71967 3.21967C9.01256 2.92678 9.48744 2.92678 9.78033 3.21967Z' fill='%238C909C'/%3e%3c/svg%3e");
|
|
170
155
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.11",
|
|
4
4
|
"description": "HashiCorp Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@embroider/test-setup": "^1.5.0",
|
|
51
51
|
"@glimmer/component": "^1.0.4",
|
|
52
52
|
"@glimmer/tracking": "^1.0.4",
|
|
53
|
-
"@percy/cli": "^1.
|
|
53
|
+
"@percy/cli": "^1.6.1",
|
|
54
54
|
"@percy/ember": "^3.0.0",
|
|
55
55
|
"babel-eslint": "^10.1.0",
|
|
56
56
|
"broccoli-asset-rev": "^3.0.0",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
|
|
3
|
-
export default class HdsFormCheckboxBaseComponent extends Component {
|
|
4
|
-
/**
|
|
5
|
-
* Get the class names to apply to the component.
|
|
6
|
-
* @method classNames
|
|
7
|
-
* @return {string} The "class" attribute to apply to the component.
|
|
8
|
-
*/
|
|
9
|
-
get classNames() {
|
|
10
|
-
let classes = ['hds-form-checkbox'];
|
|
11
|
-
|
|
12
|
-
// add a class based on the @isInvalid argument
|
|
13
|
-
if (this.args.isInvalid) {
|
|
14
|
-
classes.push(`hds-form-checkbox--is-invalid`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return classes.join(' ');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
|
|
3
|
-
export default class HdsFormRadioBaseComponent extends Component {
|
|
4
|
-
/**
|
|
5
|
-
* Get the class names to apply to the component.
|
|
6
|
-
* @method classNames
|
|
7
|
-
* @return {string} The "class" attribute to apply to the component.
|
|
8
|
-
*/
|
|
9
|
-
get classNames() {
|
|
10
|
-
let classes = ['hds-form-radio'];
|
|
11
|
-
|
|
12
|
-
// add a class based on the @isInvalid argument
|
|
13
|
-
if (this.args.isInvalid) {
|
|
14
|
-
classes.push(`hds-form-radio--is-invalid`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return classes.join(' ');
|
|
18
|
-
}
|
|
19
|
-
}
|