@hashicorp/design-system-components 0.12.13 → 1.0.0
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 +49 -0
- package/NEW-COMPONENT-CHECKLIST.md +6 -6
- package/addon/components/hds/button-set/index.hbs +3 -0
- package/addon/components/hds/form/checkbox/field.hbs +2 -0
- package/addon/components/hds/form/checkbox/group.hbs +13 -2
- package/addon/components/hds/form/field/index.hbs +1 -1
- package/addon/components/hds/form/field/index.js +11 -3
- package/addon/components/hds/form/fieldset/index.hbs +2 -2
- package/addon/components/hds/form/fieldset/index.js +7 -3
- package/addon/components/hds/form/indicator/index.hbs +2 -2
- package/addon/components/hds/form/indicator/index.js +22 -0
- package/addon/components/hds/form/radio/field.hbs +2 -0
- package/addon/components/hds/form/radio/group.hbs +13 -2
- package/addon/components/hds/form/select/field.hbs +1 -0
- package/addon/components/hds/form/text-input/field.hbs +1 -0
- package/addon/components/hds/form/textarea/field.hbs +1 -0
- package/addon/components/hds/form/toggle/field.hbs +1 -0
- package/addon/components/hds/form/toggle/group.hbs +4 -1
- package/addon/components/hds/form/utils/setAriaDescribedBy.js +10 -0
- package/addon/components/hds/stepper/step/indicator.hbs +19 -0
- package/addon/components/hds/stepper/step/indicator.js +54 -0
- package/addon/components/hds/stepper/task/indicator.hbs +3 -0
- package/addon/components/hds/stepper/task/indicator.js +69 -0
- package/addon/components/hds/tag/index.hbs +26 -0
- package/addon/components/hds/tag/index.js +76 -0
- package/app/components/hds/button-set/index.js +1 -0
- package/app/components/hds/stepper/step/indicator.js +1 -0
- package/app/components/hds/stepper/task/indicator.js +1 -0
- package/app/components/hds/tag/index.js +1 -0
- package/app/styles/@hashicorp/design-system-components.scss +3 -0
- package/app/styles/components/button-set.scss +13 -0
- package/app/styles/components/form/checkbox.scss +20 -29
- package/app/styles/components/form/error.scss +3 -3
- package/app/styles/components/form/helper-text.scss +1 -1
- package/app/styles/components/form/index.scss +0 -3
- package/app/styles/components/form/indicator.scss +1 -6
- package/app/styles/components/form/label.scss +1 -1
- package/app/styles/components/form/legend.scss +1 -1
- package/app/styles/components/form/radio.scss +21 -30
- package/app/styles/components/form/select.scss +46 -16
- package/app/styles/components/form/text-input.scss +26 -29
- package/app/styles/components/form/textarea.scss +14 -14
- package/app/styles/components/form/toggle.scss +46 -52
- package/app/styles/components/stepper/index.scss +2 -0
- package/app/styles/components/stepper/step-indicator.scss +180 -0
- package/app/styles/components/stepper/task-indicator.scss +70 -0
- package/app/styles/components/tag.scss +103 -0
- package/package.json +4 -4
- package/addon/components/hds/form/utils/getAriaDescribedBy.js +0 -21
- package/app/styles/components/form/_tokens.scss +0 -41
|
@@ -4,11 +4,6 @@
|
|
|
4
4
|
// properties within each class are sorted alphabetically
|
|
5
5
|
//
|
|
6
6
|
|
|
7
|
-
@use "sass:math";
|
|
8
|
-
|
|
9
|
-
$hds-form-toggle-control-width: 32px;
|
|
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
|
-
$hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
12
7
|
|
|
13
8
|
// "BASE" CONTROL
|
|
14
9
|
|
|
@@ -47,41 +42,54 @@ $hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
|
47
42
|
// facade (visible)
|
|
48
43
|
|
|
49
44
|
.hds-form-toggle__facade {
|
|
45
|
+
background-image: var(--token-form-toggle-background-image-data-url);
|
|
50
46
|
background-repeat: no-repeat;
|
|
51
|
-
background-position:
|
|
52
|
-
background-size:
|
|
53
|
-
border-radius:
|
|
47
|
+
background-position: var(--token-form-toggle-background-image-position-x) 50%;
|
|
48
|
+
background-size: var(--token-form-toggle-background-image-size) var(--token-form-toggle-background-image-size);
|
|
49
|
+
border-radius: calc(var(--token-form-toggle-height) / 2);
|
|
54
50
|
// notice: we want to share the border color between the "thumb" and the "track" so we use a local CSS prop for this
|
|
55
|
-
border:
|
|
51
|
+
border: var(--token-form-radio-border-width) solid var(--border-color);
|
|
56
52
|
display: block;
|
|
57
|
-
height:
|
|
53
|
+
height: var(--token-form-toggle-height);
|
|
58
54
|
position: relative;
|
|
59
|
-
width:
|
|
60
|
-
|
|
55
|
+
width: var(--token-form-toggle-width);
|
|
56
|
+
|
|
57
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
58
|
+
transition-property: all;
|
|
59
|
+
transition-duration: var(--token-form-toggle-transition-duration);
|
|
60
|
+
transition-timing-function: var(--token-form-toggle-transition-timing-function);
|
|
61
|
+
}
|
|
61
62
|
|
|
62
63
|
// used for the "thumb"
|
|
63
64
|
|
|
64
65
|
&::after {
|
|
65
|
-
background-color:
|
|
66
|
+
background-color: var(--token-form-control-base-surface-color-default);
|
|
66
67
|
border-radius: 50%;
|
|
67
|
-
border:
|
|
68
|
-
width:
|
|
69
|
-
height:
|
|
68
|
+
border: var(--token-form-radio-border-width) solid var(--border-color);
|
|
69
|
+
width: var(--token-form-toggle-thumb-size);
|
|
70
|
+
height: var(--token-form-toggle-thumb-size);
|
|
70
71
|
content: '';
|
|
71
|
-
left: -
|
|
72
|
+
left: calc(var(--token-form-radio-border-width) * -1);
|
|
72
73
|
position: absolute;
|
|
73
74
|
transform: translate3d(0, 0, 0);
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
top: calc(var(--token-form-radio-border-width) * -1);;
|
|
76
|
+
|
|
77
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
78
|
+
transition-property: all;
|
|
79
|
+
transition-duration: var(--token-form-toggle-transition-duration);
|
|
80
|
+
transition-timing-function: var(--token-form-toggle-transition-timing-function);
|
|
81
|
+
}
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
// used for the focus
|
|
79
85
|
|
|
80
86
|
&::before {
|
|
81
|
-
|
|
82
|
-
$
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
// notice: to avoid too many nested calc() operation, we have decided to compute directly the values in Sass
|
|
88
|
+
$outline-width: 3px;
|
|
89
|
+
$outline-offset: 1px;
|
|
90
|
+
$shift: $outline-width + $outline-offset + 1px; // here 1px refers to "--token-form-radio-border-width"
|
|
91
|
+
border-radius: calc(var(--token-form-toggle-height) / 2 + $outline-width + $outline-offset);
|
|
92
|
+
border-width: $outline-width;
|
|
85
93
|
bottom: -$shift;
|
|
86
94
|
content: "";
|
|
87
95
|
left: -$shift;
|
|
@@ -96,18 +104,16 @@ $hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
|
96
104
|
// base (default)
|
|
97
105
|
|
|
98
106
|
:not(:checked) + & {
|
|
99
|
-
--border-color: var(--token-form-control-border-color-default);
|
|
100
|
-
background-color: var(--token-
|
|
107
|
+
--border-color: var(--token-form-control-base-border-color-default);
|
|
108
|
+
background-color: var(--token-form-toggle-base-surface-color-default); // this is specific for "toggle", is not like the other controls!
|
|
101
109
|
}
|
|
102
110
|
:checked + & {
|
|
103
|
-
--border-color: var(--token-form-control-border-color-
|
|
104
|
-
background-color: var(--token-form-control-
|
|
105
|
-
// notice: the "tick" color is hardcoded here!
|
|
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");
|
|
111
|
+
--border-color: var(--token-form-control-checked-border-color-default);
|
|
112
|
+
background-color: var(--token-form-control-checked-surface-color-default);
|
|
107
113
|
|
|
108
114
|
&::after {
|
|
109
|
-
$
|
|
110
|
-
transform: translate3d($
|
|
115
|
+
$translation: calc(var(--token-form-toggle-width) - var(--token-form-toggle-thumb-size));
|
|
116
|
+
transform: translate3d($translation, 0, 0);
|
|
111
117
|
}
|
|
112
118
|
}
|
|
113
119
|
|
|
@@ -115,32 +121,21 @@ $hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
|
115
121
|
|
|
116
122
|
:hover:not(:checked) + &,
|
|
117
123
|
.mock-hover:not(:checked) + & {
|
|
118
|
-
--border-color: var(--token-form-control-border-color-
|
|
124
|
+
--border-color: var(--token-form-control-base-border-color-hover);
|
|
119
125
|
}
|
|
120
126
|
:hover:checked + &,
|
|
121
127
|
.mock-hover:checked + & {
|
|
122
|
-
--border-color: var(--token-form-control-border-color-
|
|
123
|
-
background-color: var(--token-form-control-
|
|
128
|
+
--border-color: var(--token-form-control-checked-border-color-hover);
|
|
129
|
+
background-color: var(--token-form-control-checked-border-color-default);
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
// focus (same for all the states)
|
|
127
133
|
|
|
128
|
-
:focus
|
|
129
|
-
.mock-focus
|
|
130
|
-
--border-color: var(--token-form-control-border-color-default);
|
|
131
|
-
|
|
132
|
-
&::before {
|
|
133
|
-
border-style: solid;
|
|
134
|
-
border-color: var( --token-color-focus-action-external);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
:focus:checked + &,
|
|
138
|
-
.mock-focus:checked + & {
|
|
139
|
-
--border-color: var(--token-form-control-border-color-checked);
|
|
140
|
-
|
|
134
|
+
:focus + &,
|
|
135
|
+
.mock-focus + & {
|
|
141
136
|
&::before {
|
|
142
137
|
border-style: solid;
|
|
143
|
-
border-color: var(
|
|
138
|
+
border-color: var(--token-color-focus-action-external);
|
|
144
139
|
}
|
|
145
140
|
}
|
|
146
141
|
|
|
@@ -148,9 +143,8 @@ $hds-form-toggle-border-radius: math.div($hds-form-toggle-control-height, 2);
|
|
|
148
143
|
|
|
149
144
|
:disabled:not(:checked) + &,
|
|
150
145
|
:disabled:checked + & {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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");
|
|
146
|
+
--border-color: var(--token-form-control-disabled-border-color);
|
|
147
|
+
background-color: var(--token-form-control-disabled-surface-color);
|
|
148
|
+
background-image: var(--token-form-toggle-background-image-data-url-disabled);
|
|
155
149
|
}
|
|
156
150
|
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
//
|
|
2
|
+
// STEPPER > INDICATOR > STEP
|
|
3
|
+
//
|
|
4
|
+
// properties within each class are sorted alphabetically
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
$hds-stepper-indicator-step-statuses: ( "incomplete", "progress", "processing", "complete" );
|
|
8
|
+
$hds-stepper-indicator-step-size: 24px;
|
|
9
|
+
|
|
10
|
+
// Base stepper indicator styling
|
|
11
|
+
.hds-stepper-indicator-step {
|
|
12
|
+
height: $hds-stepper-indicator-step-size;
|
|
13
|
+
position: relative;
|
|
14
|
+
width: $hds-stepper-indicator-step-size;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.hds-stepper-indicator-step__svg-hexagon {
|
|
18
|
+
filter: drop-shadow(0 1px 1px rgba(101, 106, 118, 0.05));
|
|
19
|
+
height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
path {
|
|
22
|
+
fill: --status-fill-color;
|
|
23
|
+
stroke: --status-stroke-color;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.hds-stepper-indicator-step__status {
|
|
28
|
+
align-items: center;
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
bottom: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.hds-stepper-indicator-step__icon {
|
|
39
|
+
color: --status-text-color;
|
|
40
|
+
width: 12px;
|
|
41
|
+
height: 12px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.hds-stepper-indicator-step__text {
|
|
45
|
+
color: --status-text-color;
|
|
46
|
+
font-family: var(--token-typography-font-stack-text);
|
|
47
|
+
font-weight: var(--token-typography-font-weight-medium);
|
|
48
|
+
font-size: 0.8125rem;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-align: center;
|
|
51
|
+
user-select: none;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
width: 20px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// STATUS
|
|
57
|
+
|
|
58
|
+
// Non-interactive (default)
|
|
59
|
+
|
|
60
|
+
// Non-interactive props that correspond with status
|
|
61
|
+
$non-interactive-props: (
|
|
62
|
+
"incomplete": (
|
|
63
|
+
"text-color": var(--token-color-foreground-strong),
|
|
64
|
+
"fill-color": var(--token-color-surface-faint),
|
|
65
|
+
"stroke-color": var(--token-color-foreground-strong),
|
|
66
|
+
),
|
|
67
|
+
"progress": (
|
|
68
|
+
"text-color": var(--token-color-foreground-high-contrast),
|
|
69
|
+
"fill-color": var(--token-color-foreground-strong),
|
|
70
|
+
"stroke-color": var(--token-color-foreground-strong),
|
|
71
|
+
),
|
|
72
|
+
"processing": (
|
|
73
|
+
"text-color": var(--token-color-foreground-high-contrast),
|
|
74
|
+
"fill-color": var(--token-color-foreground-strong),
|
|
75
|
+
"stroke-color": var(--token-color-foreground-strong),
|
|
76
|
+
),
|
|
77
|
+
"complete": (
|
|
78
|
+
"text-color": var(--token-color-foreground-high-contrast),
|
|
79
|
+
"fill-color": var(--token-color-foreground-strong),
|
|
80
|
+
"stroke-color": var(--token-color-foreground-strong),
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
@each $status in $hds-stepper-indicator-step-statuses {
|
|
85
|
+
// For each status of the non-interactive variant, set the text color, svg fill, and svg stroke colors based on $non-interactive-props
|
|
86
|
+
.hds-stepper-indicator-step--status-#{$status} {
|
|
87
|
+
.hds-stepper-indicator-step__status {
|
|
88
|
+
color: map-get($non-interactive-props, $status, "text-color");
|
|
89
|
+
};
|
|
90
|
+
.hds-stepper-indicator-step__svg-hexagon path {
|
|
91
|
+
fill: map-get($non-interactive-props, $status, "fill-color");
|
|
92
|
+
stroke: map-get($non-interactive-props, $status, "stroke-color");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Interactive
|
|
98
|
+
|
|
99
|
+
// Determine states/status and corresponding styles
|
|
100
|
+
$status-props: (
|
|
101
|
+
"incomplete": (
|
|
102
|
+
"text-color-default": var(--token-color-foreground-primary),
|
|
103
|
+
"fill-color-default": var(--token-color-surface-interactive),
|
|
104
|
+
"stroke-color-default": var(--token-color-border-strong),
|
|
105
|
+
"fill-color-hover": var(--token-color-surface-interactive-hover),
|
|
106
|
+
"fill-color-active": var(--token-color-surface-interactive-active),
|
|
107
|
+
),
|
|
108
|
+
"progress": (
|
|
109
|
+
"text-color-default": var(--token-color-foreground-high-contrast),
|
|
110
|
+
"fill-color-default": var(--token-color-palette-blue-200),
|
|
111
|
+
"stroke-color-default": var(--token-color-palette-blue-300),
|
|
112
|
+
"fill-color-hover": var(--token-color-palette-blue-300),
|
|
113
|
+
"stroke-color-hover": var(--token-color-palette-blue-400),
|
|
114
|
+
"fill-color-active": var(--token-color-palette-blue-400),
|
|
115
|
+
"stroke-color-active": var(--token-color-palette-blue-400),
|
|
116
|
+
),
|
|
117
|
+
"processing": (
|
|
118
|
+
"text-color-default": var(--token-color-foreground-high-contrast),
|
|
119
|
+
"fill-color-default": var(--token-color-palette-blue-200),
|
|
120
|
+
"stroke-color-default": var(--token-color-palette-blue-300),
|
|
121
|
+
"fill-color-hover": var(--token-color-palette-blue-300),
|
|
122
|
+
"stroke-color-hover": var(--token-color-palette-blue-400),
|
|
123
|
+
"fill-color-active": var(--token-color-palette-blue-400),
|
|
124
|
+
"stroke-color-active": var(--token-color-palette-blue-400),
|
|
125
|
+
),
|
|
126
|
+
"complete": (
|
|
127
|
+
"text-color-default": var(--token-color-palette-blue-200),
|
|
128
|
+
"fill-color-default": var(--token-color-palette-blue-50),
|
|
129
|
+
"stroke-color-default": var(--token-color-palette-blue-300),
|
|
130
|
+
"text-color-hover": var(--token-color-palette-blue-300),
|
|
131
|
+
"fill-color-hover": var(--token-color-palette-blue-100),
|
|
132
|
+
"stroke-color-hover": var(--token-color-palette-blue-400),
|
|
133
|
+
"text-color-active": var(--token-color-palette-blue-400),
|
|
134
|
+
"fill-color-active": var(--token-color-palette-blue-100),
|
|
135
|
+
"stroke-color-active": var(--token-color-palette-blue-400),
|
|
136
|
+
)
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
.hds-stepper-indicator-step--is-interactive {
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
|
|
142
|
+
@each $status in $hds-stepper-indicator-step-statuses {
|
|
143
|
+
// For each status set the text, svg fill, and svg stroke color based on $status-props
|
|
144
|
+
&.hds-stepper-indicator-step--status-#{$status} {
|
|
145
|
+
.hds-stepper-indicator-step__status {
|
|
146
|
+
color: map-get($status-props, $status, "text-color-default");
|
|
147
|
+
}
|
|
148
|
+
.hds-stepper-indicator-step__svg-hexagon path {
|
|
149
|
+
fill: map-get($status-props, $status, "fill-color-default");
|
|
150
|
+
stroke: map-get($status-props, $status, "stroke-color-default");
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&:hover,
|
|
154
|
+
&.mock-hover {
|
|
155
|
+
.hds-stepper-indicator-step__status {
|
|
156
|
+
color: map-get($status-props, $status, "text-color-hover");
|
|
157
|
+
}
|
|
158
|
+
.hds-stepper-indicator-step__svg-hexagon {
|
|
159
|
+
path {
|
|
160
|
+
fill: map-get($status-props, $status, "fill-color-hover");
|
|
161
|
+
stroke: map-get($status-props, $status, "stroke-color-hover");
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&:active,
|
|
167
|
+
&.mock-active {
|
|
168
|
+
.hds-stepper-indicator-step__status {
|
|
169
|
+
color: map-get($status-props, $status, "text-color-active");
|
|
170
|
+
}
|
|
171
|
+
.hds-stepper-indicator-step__svg-hexagon {
|
|
172
|
+
path {
|
|
173
|
+
fill: map-get($status-props, $status, "fill-color-active");
|
|
174
|
+
stroke: map-get($status-props, $status, "stroke-color-active");
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//
|
|
2
|
+
// STEPPER > INDICATOR > TASK
|
|
3
|
+
//
|
|
4
|
+
// properties within each class are sorted alphabetically
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
$hds-stepper-indicator-task-statuses: ( "incomplete", "progress", "processing", "complete" );
|
|
8
|
+
$hds-stepper-indicator-task-size: 16px;
|
|
9
|
+
|
|
10
|
+
// Determine states and corresponding styles
|
|
11
|
+
$status-props: (
|
|
12
|
+
"incomplete": (
|
|
13
|
+
"color-default": var(--token-color-palette-neutral-300),
|
|
14
|
+
"color-hover": var(--token-color-palette-blue-300),
|
|
15
|
+
"color-active": var(--token-color-palette-blue-400),
|
|
16
|
+
),
|
|
17
|
+
"progress": (
|
|
18
|
+
"color-default": var(--token-color-palette-blue-200),
|
|
19
|
+
"color-hover": var(--token-color-palette-blue-300),
|
|
20
|
+
"color-active": var(--token-color-palette-blue-400),
|
|
21
|
+
),
|
|
22
|
+
"processing": (
|
|
23
|
+
"color-default": var(--token-color-palette-blue-200),
|
|
24
|
+
"color-hover": var(--token-color-palette-blue-300),
|
|
25
|
+
"color-active": var(--token-color-palette-blue-400),
|
|
26
|
+
),
|
|
27
|
+
"complete": (
|
|
28
|
+
"color-default": var(--token-color-palette-green-200),
|
|
29
|
+
"color-hover": var(--token-color-palette-green-300),
|
|
30
|
+
"color-active": var(--token-color-palette-green-400),
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// Base styling for indicator::task
|
|
35
|
+
.hds-stepper-indicator-task {
|
|
36
|
+
align-items: center;
|
|
37
|
+
color: var(--token-color-foreground-strong);
|
|
38
|
+
display: flex;
|
|
39
|
+
height: $hds-stepper-indicator-task-size;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
position: relative;
|
|
42
|
+
width: $hds-stepper-indicator-task-size;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.hds-stepper-indicator-task__icon {
|
|
46
|
+
height: 12px;
|
|
47
|
+
width: 12px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.hds-stepper-indicator-task--is-interactive {
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
|
|
53
|
+
@each $status in $hds-stepper-indicator-task-statuses {
|
|
54
|
+
// For each status set the icon color based on the $status-props
|
|
55
|
+
&.hds-stepper-indicator-task--status-#{$status} {
|
|
56
|
+
color: map-get($status-props, $status, "color-default");
|
|
57
|
+
&:hover,
|
|
58
|
+
&.mock-hover {
|
|
59
|
+
color: map-get($status-props, $status, "color-hover");
|
|
60
|
+
};
|
|
61
|
+
&:active,
|
|
62
|
+
&.mock-active {
|
|
63
|
+
color: map-get($status-props, $status, "color-active");
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TAG COMPONENT
|
|
3
|
+
//
|
|
4
|
+
// properties within each class are sorted alphabetically
|
|
5
|
+
//
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
@use "../mixins/focus-ring" as *;
|
|
9
|
+
|
|
10
|
+
// we set a higher value than the line-height (~13px) to accommodate cases where the text wraps
|
|
11
|
+
$hds-tag-border-radius: 50px;
|
|
12
|
+
|
|
13
|
+
.hds-tag {
|
|
14
|
+
align-items: stretch;
|
|
15
|
+
background-color: var(--token-color-surface-interactive);
|
|
16
|
+
border: 1px solid var(--token-color-border-strong);
|
|
17
|
+
border-radius: $hds-tag-border-radius;
|
|
18
|
+
color: var(--token-color-foreground-primary);
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
font-family: var(--token-typography-font-stack-text);
|
|
21
|
+
font-size: 0.8125rem; // 13px
|
|
22
|
+
font-weight: var(--token-typography-font-weight-medium);
|
|
23
|
+
line-height: 1rem; // 16px
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.hds-tag__dismiss {
|
|
28
|
+
flex: 0 0 auto;
|
|
29
|
+
border-radius: inherit;
|
|
30
|
+
border-top-right-radius: 0;
|
|
31
|
+
border-bottom-right-radius: 0;
|
|
32
|
+
border: none; // reset default button border
|
|
33
|
+
margin: 0; // reset default button margin
|
|
34
|
+
padding: 6px 2px 6px 8px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.hds-tag__dismiss-icon {
|
|
38
|
+
color: var(--token-color-foreground-primary);
|
|
39
|
+
height: 12px;
|
|
40
|
+
width: 12px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.hds-tag__text,
|
|
44
|
+
.hds-tag__link {
|
|
45
|
+
border-radius: inherit;
|
|
46
|
+
flex: 1 0 0;
|
|
47
|
+
padding: 3px 10px 5px 10px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.hds-tag__dismiss ~ .hds-tag__text,
|
|
51
|
+
.hds-tag__dismiss ~ .hds-tag__link {
|
|
52
|
+
border-top-left-radius: 0;
|
|
53
|
+
border-bottom-left-radius: 0;
|
|
54
|
+
padding: 3px 8px 5px 6px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// INTERACTIVE ELEMENTS
|
|
58
|
+
|
|
59
|
+
.hds-tag__dismiss,
|
|
60
|
+
.hds-tag__link {
|
|
61
|
+
background-color: var(--token-color-surface-interactive);
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
|
|
64
|
+
&:hover,
|
|
65
|
+
&.mock-hover {
|
|
66
|
+
background-color: var(--token-color-surface-interactive-hover);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:active,
|
|
70
|
+
&.mock-active{
|
|
71
|
+
background-color: var(--token-color-surface-interactive-active);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:focus,
|
|
75
|
+
&.mock-focus {
|
|
76
|
+
@include hds-focus-ring-basic();
|
|
77
|
+
z-index: 1; // ensures focus is not obscured by adjacent elements
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// COLORS (FOR LINK)
|
|
82
|
+
|
|
83
|
+
.hds-tag--color-primary {
|
|
84
|
+
.hds-tag__link {
|
|
85
|
+
color: var(--token-color-foreground-action);
|
|
86
|
+
|
|
87
|
+
&:hover,
|
|
88
|
+
&.mock-hover {
|
|
89
|
+
color: var(--token-color-foreground-action-hover);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:active,
|
|
93
|
+
&.mock-active{
|
|
94
|
+
color: var(--token-color-foreground-action-active);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.hds-tag--color-secondary {
|
|
100
|
+
.hds-tag__link {
|
|
101
|
+
color: var(--token-color-foreground-strong);
|
|
102
|
+
}
|
|
103
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "HashiCorp Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"test:ember:percy": "percy exec ember test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@hashicorp/design-system-tokens": "^0.
|
|
38
|
-
"@hashicorp/ember-flight-icons": "^2.0.
|
|
37
|
+
"@hashicorp/design-system-tokens": "^1.0.0",
|
|
38
|
+
"@hashicorp/ember-flight-icons": "^2.0.10",
|
|
39
39
|
"ember-auto-import": "^2.4.1",
|
|
40
40
|
"ember-cli-babel": "^7.26.11",
|
|
41
41
|
"ember-cli-htmlbars": "^6.0.1",
|
|
@@ -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.6.
|
|
53
|
+
"@percy/cli": "^1.6.3",
|
|
54
54
|
"@percy/ember": "^3.0.0",
|
|
55
55
|
"babel-eslint": "^10.1.0",
|
|
56
56
|
"broccoli-asset-rev": "^3.0.0",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function getAriaDescribedBy(element) {
|
|
2
|
-
let ariaDescribedBy = [];
|
|
3
|
-
|
|
4
|
-
// append descriptor's IDs, if provided
|
|
5
|
-
if (element.descriptors) {
|
|
6
|
-
element.descriptors.forEach((descriptor) =>
|
|
7
|
-
ariaDescribedBy.push(descriptor)
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// append @extraAriaDescribedBy arg, if provided
|
|
12
|
-
if (element.args.extraAriaDescribedBy) {
|
|
13
|
-
ariaDescribedBy.push(element.args.extraAriaDescribedBy);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (ariaDescribedBy.length) {
|
|
17
|
-
return ariaDescribedBy.join(' ');
|
|
18
|
-
} else {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// FORM > TOKENS
|
|
3
|
-
//
|
|
4
|
-
// TODO: this will be removed once we define the correct component-level tokens for the "form controls" component
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
:root {
|
|
8
|
-
// INPUT / DEFAULT
|
|
9
|
-
--token-form-control-foreground-color-default: var(--token-color-foreground-strong);
|
|
10
|
-
--token-form-control-background-color-default: var(--token-color-surface-interactive);
|
|
11
|
-
--token-form-control-background-color-default-hover: var(--token-color-surface-interactive-hover);
|
|
12
|
-
--token-form-control-border-color-default: #8c909c;
|
|
13
|
-
--token-form-control-border-color-default-hover: #656a76;
|
|
14
|
-
// INPUT / CHECKED
|
|
15
|
-
--token-form-control-background-color-checked: #1060FF;
|
|
16
|
-
--token-form-control-background-color-checked-hover: #0C56E9;
|
|
17
|
-
--token-form-control-border-color-checked: #0C56E9;
|
|
18
|
-
--token-form-control-border-color-checked-hover: #0046D1;
|
|
19
|
-
// INPUT / READONLY
|
|
20
|
-
--token-form-control-foreground-color-readonly: var(--token-color-foreground-primary);
|
|
21
|
-
--token-form-control-background-color-readonly: var(--token-color-surface-strong);
|
|
22
|
-
--token-form-control-border-color-readonly: var(--token-color-border-faint);
|
|
23
|
-
// INPUT / DISABLED
|
|
24
|
-
--token-form-control-foreground-color-disabled: var(--token-color-foreground-disabled);
|
|
25
|
-
--token-form-control-background-color-disabled: var(--token-color-surface-interactive-disabled);
|
|
26
|
-
--token-form-control-border-color-disabled: var(--token-color-border-primary);
|
|
27
|
-
// INPUT / INVALID
|
|
28
|
-
--token-form-control-foreground-color-critical: var(--token-color-foreground-critical-on-surface);
|
|
29
|
-
--token-form-control-border-color-critical: #c00005;
|
|
30
|
-
--token-form-control-border-color-critical-hover: #940004;
|
|
31
|
-
// INPUT / PLACEHOLDER
|
|
32
|
-
--token-form-control-placeholder-color: var(--token-color-foreground-faint);
|
|
33
|
-
// INPUT / BORDER SIZING
|
|
34
|
-
--token-form-control-border-radius: 5px;
|
|
35
|
-
// LABEL/HELPER-TEXT
|
|
36
|
-
--token-form-label-foreground-color: var(--token-color-foreground-strong);
|
|
37
|
-
--token-form-helper-text-foreground-color: var(--token-color-foreground-faint);
|
|
38
|
-
// CHECKBOX
|
|
39
|
-
--token-form-checkbox-size: 16px;
|
|
40
|
-
--token-form-checkbox-border-radius: 3px;
|
|
41
|
-
}
|