@hashicorp/design-system-components 3.2.0 → 3.3.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 +145 -119
- package/addon/components/hds/button/index.hbs +12 -12
- package/addon/components/hds/dropdown/list-item/checkmark.hbs +3 -3
- package/addon/components/hds/dropdown/list-item/interactive.hbs +3 -3
- package/addon/components/hds/form/character-count/index.hbs +28 -0
- package/addon/components/hds/form/character-count/index.js +178 -0
- package/addon/components/hds/form/field/index.hbs +10 -0
- package/addon/components/hds/form/masked-input/field.hbs +1 -1
- package/addon/components/hds/form/text-input/field.hbs +1 -1
- package/addon/components/hds/form/textarea/field.hbs +1 -1
- package/addon/components/hds/link/standalone.hbs +8 -8
- package/app/components/hds/form/character-count/index.js +6 -0
- package/app/styles/components/button.scss +5 -0
- package/app/styles/components/dropdown.scss +2 -0
- package/app/styles/components/form/character-count.scss +12 -0
- package/app/styles/components/form/field.scss +4 -0
- package/app/styles/components/form/index.scss +1 -0
- package/app/styles/components/link/standalone.scss +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,30 +1,56 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
`Hds::Form::CharacterCount` - Added new component
|
|
8
|
+
`Hds::Form::Field` - Added `CharacterCount` contextual component
|
|
9
|
+
`Hds::Form::MaskedInput::Field` - Added `CharacterCount` contextual component
|
|
10
|
+
`Hds::Form::TextInput::Field` - Added `CharacterCount` contextual component
|
|
11
|
+
`Hds::Form::Textarea::Field` - Added `CharacterCount` contextual component
|
|
12
|
+
|
|
13
|
+
<small class="doc-whats-new-changelog-metadata">[#1802](https://github.com/hashicorp/design-system/pull/1802)</small>
|
|
14
|
+
|
|
15
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
`Button` - updated DOM structure to contain only `span` elements
|
|
20
|
+
|
|
21
|
+
`Dropdown` - updated button elements DOM structure to contain only `span` elements
|
|
22
|
+
|
|
23
|
+
`Link::Standalone` - updated DOM structure to contain only `span` elements
|
|
24
|
+
|
|
25
|
+
<small class="doc-whats-new-changelog-metadata">[#1840](https://github.com/hashicorp/design-system/pull/1840)</small>
|
|
26
|
+
|
|
27
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
28
|
+
|
|
3
29
|
## 3.2.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
6
32
|
|
|
7
33
|
`CodeBlock` - Added language support for Ruby syntax
|
|
8
34
|
|
|
9
|
-
<small>[#1834](https://github.com/hashicorp/design-system/pull/1834)</small>
|
|
35
|
+
<small class="doc-whats-new-changelog-metadata">[#1834](https://github.com/hashicorp/design-system/pull/1834)</small>
|
|
10
36
|
|
|
11
|
-
|
|
37
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
12
38
|
|
|
13
39
|
`Hds::Table` - updated `@columns` object to support `isVisuallyHidden` argument
|
|
14
40
|
|
|
15
41
|
- `Hds::Table::Th` - updated to support `isVisuallyHidden` argument
|
|
16
42
|
|
|
17
|
-
<small>[#1819](https://github.com/hashicorp/design-system/pull/1819)</small>
|
|
43
|
+
<small class="doc-whats-new-changelog-metadata">[#1819](https://github.com/hashicorp/design-system/pull/1819)</small>
|
|
18
44
|
|
|
19
|
-
|
|
45
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
20
46
|
|
|
21
47
|
### Patch Changes
|
|
22
48
|
|
|
23
49
|
`SideNav` - Reduced the width of `SideNav::ToggleButton`
|
|
24
50
|
|
|
25
|
-
<small>[#1807](https://github.com/hashicorp/design-system/pull/1807)</small>
|
|
51
|
+
<small class="doc-whats-new-changelog-metadata">[#1807](https://github.com/hashicorp/design-system/pull/1807)</small>
|
|
26
52
|
|
|
27
|
-
|
|
53
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
28
54
|
|
|
29
55
|
**🔄 Updated dependencies:**
|
|
30
56
|
|
|
@@ -36,21 +62,21 @@
|
|
|
36
62
|
|
|
37
63
|
`AppFooter` – Fixed predefined statuses by replacing `critical` with `outage` and prevented `statusIconColor` from being overridden by `status`
|
|
38
64
|
|
|
39
|
-
<small>[#1790](https://github.com/hashicorp/design-system/pull/1790)</small>
|
|
65
|
+
<small class="doc-whats-new-changelog-metadata">[#1790](https://github.com/hashicorp/design-system/pull/1790)</small>
|
|
40
66
|
|
|
41
|
-
|
|
67
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
42
68
|
|
|
43
69
|
`SideNav` - Fixed visible scrollbar in collapsed SideNav when scroll bar is set to be always visible
|
|
44
70
|
|
|
45
|
-
<small>[#1786](https://github.com/hashicorp/design-system/pull/1786)</small>
|
|
71
|
+
<small class="doc-whats-new-changelog-metadata">[#1786](https://github.com/hashicorp/design-system/pull/1786)</small>
|
|
46
72
|
|
|
47
|
-
|
|
73
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
48
74
|
|
|
49
75
|
`CodeBlock` - Fixed `@hasLineWrapping` style to make long strings wrap when they overflow the container
|
|
50
76
|
|
|
51
|
-
<small>[#1798](https://github.com/hashicorp/design-system/pull/1798)</small>
|
|
77
|
+
<small class="doc-whats-new-changelog-metadata">[#1798](https://github.com/hashicorp/design-system/pull/1798)</small>
|
|
52
78
|
|
|
53
|
-
|
|
79
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
54
80
|
|
|
55
81
|
## 3.1.1
|
|
56
82
|
|
|
@@ -58,9 +84,9 @@
|
|
|
58
84
|
|
|
59
85
|
Added `@ember/string` as a direct dependency
|
|
60
86
|
|
|
61
|
-
<small>[#1782](https://github.com/hashicorp/design-system/pull/1782)</small>
|
|
87
|
+
<small class="doc-whats-new-changelog-metadata">[#1782](https://github.com/hashicorp/design-system/pull/1782)</small>
|
|
62
88
|
|
|
63
|
-
|
|
89
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
64
90
|
|
|
65
91
|
**🔄 Updated dependencies:**
|
|
66
92
|
|
|
@@ -72,9 +98,9 @@ Added `@ember/string` as a direct dependency
|
|
|
72
98
|
|
|
73
99
|
`CodeBlock` - Added new component
|
|
74
100
|
|
|
75
|
-
<small>[#1687](https://github.com/hashicorp/design-system/pull/1687)</small>
|
|
101
|
+
<small class="doc-whats-new-changelog-metadata">[#1687](https://github.com/hashicorp/design-system/pull/1687)</small>
|
|
76
102
|
|
|
77
|
-
|
|
103
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
78
104
|
|
|
79
105
|
### Patch Changes
|
|
80
106
|
|
|
@@ -86,15 +112,15 @@ Upgraded the following dependencies:
|
|
|
86
112
|
- `ember-keyboard` from `8.2.0` to `8.2.1`
|
|
87
113
|
- `sass` from `1.62.1` to `1.69.5`
|
|
88
114
|
|
|
89
|
-
<small>[#1756](https://github.com/hashicorp/design-system/pull/1756)</small>
|
|
115
|
+
<small class="doc-whats-new-changelog-metadata">[#1756](https://github.com/hashicorp/design-system/pull/1756)</small>
|
|
90
116
|
|
|
91
|
-
|
|
117
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
92
118
|
|
|
93
119
|
`Breadcrumb` - Added support for external links
|
|
94
120
|
|
|
95
|
-
<small>[#1774](https://github.com/hashicorp/design-system/pull/1774)</small>
|
|
121
|
+
<small class="doc-whats-new-changelog-metadata">[#1774](https://github.com/hashicorp/design-system/pull/1774)</small>
|
|
96
122
|
|
|
97
|
-
|
|
123
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
98
124
|
|
|
99
125
|
Upgraded the following dependencies:
|
|
100
126
|
|
|
@@ -103,15 +129,15 @@ Upgraded the following dependencies:
|
|
|
103
129
|
- `ember-cli-sass` from `10.0.1` to `11.0.1`
|
|
104
130
|
- `ember-composable-helpers` from `4.5.0` to `5.0.0`
|
|
105
131
|
|
|
106
|
-
<small>[#1761](https://github.com/hashicorp/design-system/pull/1761)</small>
|
|
132
|
+
<small class="doc-whats-new-changelog-metadata">[#1761](https://github.com/hashicorp/design-system/pull/1761)</small>
|
|
107
133
|
|
|
108
|
-
|
|
134
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
109
135
|
|
|
110
136
|
`Button` - Fixed `HdsInteractiveSignature` type import
|
|
111
137
|
|
|
112
|
-
<small>[#1769](https://github.com/hashicorp/design-system/pull/1769)</small>
|
|
138
|
+
<small class="doc-whats-new-changelog-metadata">[#1769](https://github.com/hashicorp/design-system/pull/1769)</small>
|
|
113
139
|
|
|
114
|
-
|
|
140
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
115
141
|
|
|
116
142
|
**🔄 Updated dependencies:**
|
|
117
143
|
|
|
@@ -123,9 +149,9 @@ Upgraded the following dependencies:
|
|
|
123
149
|
|
|
124
150
|
explicitly added `ember-element-helper` as dependency for the `components` package
|
|
125
151
|
|
|
126
|
-
<small>[#1751](https://github.com/hashicorp/design-system/pull/1751)</small>
|
|
152
|
+
<small class="doc-whats-new-changelog-metadata">[#1751](https://github.com/hashicorp/design-system/pull/1751)</small>
|
|
127
153
|
|
|
128
|
-
|
|
154
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
129
155
|
|
|
130
156
|
## 3.0.1
|
|
131
157
|
|
|
@@ -141,9 +167,9 @@ explicitly added `ember-element-helper` as dependency for the `components` packa
|
|
|
141
167
|
|
|
142
168
|
Drop support for Node 14
|
|
143
169
|
|
|
144
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
170
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
145
171
|
|
|
146
|
-
|
|
172
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
147
173
|
|
|
148
174
|
`Hds::Form::VisibilityToggle` - Added component as a form base element
|
|
149
175
|
|
|
@@ -157,9 +183,9 @@ To migrate:
|
|
|
157
183
|
|
|
158
184
|
- in `Hds::Form::MaskedInput` instances replace `@isMasked` arguments with `@isContentMasked`
|
|
159
185
|
|
|
160
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
186
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
161
187
|
|
|
162
|
-
|
|
188
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
163
189
|
|
|
164
190
|
`Hds::Dropdown` – Removed `@listPosition` `left` and `right` (use `bottom-left` and `bottom-right`, respectively).
|
|
165
191
|
|
|
@@ -169,9 +195,9 @@ To migrate:
|
|
|
169
195
|
- replace `@listPosition="left"` with `@listPosition="bottom-left"`
|
|
170
196
|
- replace `@listPosition="right"` with `@listPosition="bottom-right"`
|
|
171
197
|
|
|
172
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
198
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
173
199
|
|
|
174
|
-
|
|
200
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
175
201
|
|
|
176
202
|
`SideNav` - Renamed `extraBefore/After` generic containers to `ExtraBefore/After` (uppercase `E`).
|
|
177
203
|
|
|
@@ -179,9 +205,9 @@ To migrate:
|
|
|
179
205
|
|
|
180
206
|
- rename all the `extraBefore/After` instances yielded within the `<Hds::SideNav>` component to `ExtraBefore/After`
|
|
181
207
|
|
|
182
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
208
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
183
209
|
|
|
184
|
-
|
|
210
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
185
211
|
|
|
186
212
|
`Form::RadioCard` - Remove the `@layout` property.
|
|
187
213
|
|
|
@@ -192,9 +218,9 @@ To migrate `Form::RadioCard` and `Form::RadioCard::Group` instances without enco
|
|
|
192
218
|
- make sure all instances with `@layout="fixed"` have a `@maxWidth` defined, then remove the `@layout="fixed"` definition
|
|
193
219
|
- remove all `@layout="fluid"` definitions
|
|
194
220
|
|
|
195
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
221
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
196
222
|
|
|
197
|
-
|
|
223
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
198
224
|
|
|
199
225
|
### Minor Changes
|
|
200
226
|
|
|
@@ -202,15 +228,15 @@ To migrate `Form::RadioCard` and `Form::RadioCard::Group` instances without enco
|
|
|
202
228
|
|
|
203
229
|
_Consumers should review the defaults values for this (sub)component in their codebases, to make sure they match the intended visual designs._
|
|
204
230
|
|
|
205
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
231
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
206
232
|
|
|
207
|
-
|
|
233
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
208
234
|
|
|
209
235
|
`Button`, `Interactive` - Converted components to TypeScript.
|
|
210
236
|
|
|
211
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
237
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
212
238
|
|
|
213
|
-
|
|
239
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
214
240
|
|
|
215
241
|
`Copy::Snippet` - Fixed the way in which “width/full-width” is applied to the component + Internal update to the “truncation” implementation.
|
|
216
242
|
|
|
@@ -219,9 +245,9 @@ _Consumers should review the defaults values for this (sub)component in their co
|
|
|
219
245
|
|
|
220
246
|
_Consumers should review the pages where this component is used to make sure its width matches the intended visual designs (in case, use the `@isFullWidth` argument to control its full-width). In case they're using the `hds-copy-snippet__text--truncated` class name, they should also update their code to adapt to the new implementation._
|
|
221
247
|
|
|
222
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
248
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
223
249
|
|
|
224
|
-
|
|
250
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
225
251
|
|
|
226
252
|
Removed `ember-cli-clipboard` as dependency and introduced a custom `hds-clipboard` modifier (using the web [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API))
|
|
227
253
|
|
|
@@ -240,23 +266,23 @@ Removed `ember-cli-clipboard` as dependency and introduced a custom `hds-clipboa
|
|
|
240
266
|
|
|
241
267
|
_Consumers should remove the `@container` argument from all the instances of `Copy::Button` (not needed anymore) and double check that the `Copy::Button/Snippet` instances work exactly as before._
|
|
242
268
|
|
|
243
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
269
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
244
270
|
|
|
245
|
-
|
|
271
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
246
272
|
|
|
247
273
|
### Patch Changes
|
|
248
274
|
|
|
249
275
|
`Copy::Snippet` - Fixed background colors for different states according to Figma specs (main change is the default/base background is now transparent, not white).
|
|
250
276
|
|
|
251
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
277
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
252
278
|
|
|
253
|
-
|
|
279
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
254
280
|
|
|
255
281
|
`Form::MaskedInput` - Changed copy logic for `CopyButton` used inside the component.
|
|
256
282
|
|
|
257
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
283
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
258
284
|
|
|
259
|
-
|
|
285
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
260
286
|
|
|
261
287
|
`Accordion` - Replaced internal text styling (using `Text` component).
|
|
262
288
|
|
|
@@ -282,15 +308,15 @@ _Consumers should remove the `@container` argument from all the instances of `Co
|
|
|
282
308
|
|
|
283
309
|
_No impact is expected on the consumers' applications._
|
|
284
310
|
|
|
285
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
311
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
286
312
|
|
|
287
|
-
|
|
313
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
288
314
|
|
|
289
315
|
`Button` - Applied explicit text alignment to the text to fix alignment on "link" buttons.
|
|
290
316
|
|
|
291
|
-
<small>[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
317
|
+
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
292
318
|
|
|
293
|
-
|
|
319
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
294
320
|
|
|
295
321
|
**🔄 Updated dependencies:**
|
|
296
322
|
|
|
@@ -304,13 +330,13 @@ _No impact is expected on the consumers' applications._
|
|
|
304
330
|
|
|
305
331
|
`Dropdown::ToggleIcon` - updated sizing of the "small" variant to match the height of the "small" variant `Button`
|
|
306
332
|
|
|
307
|
-
<small>[#1690](https://github.com/hashicorp/design-system/pull/1690)</small>
|
|
333
|
+
<small class="doc-whats-new-changelog-metadata">[#1690](https://github.com/hashicorp/design-system/pull/1690)</small>
|
|
308
334
|
|
|
309
335
|
### Patch Changes
|
|
310
336
|
|
|
311
337
|
`Pagination` - Removed handling of query parameters from `onPageSizeChange` function.
|
|
312
338
|
|
|
313
|
-
<small>[#1736](https://github.com/hashicorp/design-system/pull/1736)</small>
|
|
339
|
+
<small class="doc-whats-new-changelog-metadata">[#1736](https://github.com/hashicorp/design-system/pull/1736)</small>
|
|
314
340
|
|
|
315
341
|
_Notice: while technically this is a breaking change, we consider this a fast-follow fix for the previous release._
|
|
316
342
|
|
|
@@ -320,13 +346,13 @@ _Notice: while technically this is a breaking change, we consider this a fast-fo
|
|
|
320
346
|
|
|
321
347
|
`Pagination` - updated the logic for “Compact” variant to expose `@currentPageSize` and handle controlled/uncontrolled changes
|
|
322
348
|
|
|
323
|
-
<small>[#1724](https://github.com/hashicorp/design-system/pull/1724)</small>
|
|
349
|
+
<small class="doc-whats-new-changelog-metadata">[#1724](https://github.com/hashicorp/design-system/pull/1724)</small>
|
|
324
350
|
|
|
325
|
-
|
|
351
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
326
352
|
|
|
327
353
|
`Tabs` - replace `assert` with `warn` in `setIndicator` function
|
|
328
354
|
|
|
329
|
-
<small>[#1716](https://github.com/hashicorp/design-system/pull/1716)</small>
|
|
355
|
+
<small class="doc-whats-new-changelog-metadata">[#1716](https://github.com/hashicorp/design-system/pull/1716)</small>
|
|
330
356
|
|
|
331
357
|
## 2.14.1
|
|
332
358
|
|
|
@@ -334,7 +360,7 @@ _Notice: while technically this is a breaking change, we consider this a fast-fo
|
|
|
334
360
|
|
|
335
361
|
`Tabs` - Fixed issue with `@isSelected` dynamically changed within `#each` loops
|
|
336
362
|
|
|
337
|
-
<small>[#1709](https://github.com/hashicorp/design-system/pull/1709)</small>
|
|
363
|
+
<small class="doc-whats-new-changelog-metadata">[#1709](https://github.com/hashicorp/design-system/pull/1709)</small>
|
|
338
364
|
|
|
339
365
|
## 2.14.0
|
|
340
366
|
|
|
@@ -342,9 +368,9 @@ _Notice: while technically this is a breaking change, we consider this a fast-fo
|
|
|
342
368
|
|
|
343
369
|
`Pagination::Compact` - Added option to show "SizeSelector" element
|
|
344
370
|
|
|
345
|
-
<small>[#1700](https://github.com/hashicorp/design-system/pull/1700)</small>
|
|
371
|
+
<small class="doc-whats-new-changelog-metadata">[#1700](https://github.com/hashicorp/design-system/pull/1700)</small>
|
|
346
372
|
|
|
347
|
-
|
|
373
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
348
374
|
|
|
349
375
|
`Tabs` - Refactored logic for `Tabs` component + `Tab/Panel` sub-components to support more complex use cases:
|
|
350
376
|
|
|
@@ -352,7 +378,7 @@ _Notice: while technically this is a breaking change, we consider this a fast-fo
|
|
|
352
378
|
- fixed issue with nested tabs not initializing the "selected" indicator correctly
|
|
353
379
|
- fixed issue with dynamic tab content not updating the "selected" indicator correctly
|
|
354
380
|
|
|
355
|
-
<small>[#1688](https://github.com/hashicorp/design-system/pull/1688)</small>
|
|
381
|
+
<small class="doc-whats-new-changelog-metadata">[#1688](https://github.com/hashicorp/design-system/pull/1688)</small>
|
|
356
382
|
|
|
357
383
|
## 2.13.0
|
|
358
384
|
|
|
@@ -360,27 +386,27 @@ _Notice: while technically this is a breaking change, we consider this a fast-fo
|
|
|
360
386
|
|
|
361
387
|
`AppFooter` - Added new component
|
|
362
388
|
|
|
363
|
-
<small>[#1623](https://github.com/hashicorp/design-system/pull/1623)</small>
|
|
389
|
+
<small class="doc-whats-new-changelog-metadata">[#1623](https://github.com/hashicorp/design-system/pull/1623)</small>
|
|
364
390
|
|
|
365
|
-
|
|
391
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
366
392
|
|
|
367
393
|
`SideNav` - add `@isCollapsible` (to control if users can collapse the sidenav on 'desktop' viewports) and `@isMinimized` (to control the default state on 'desktop' viewports) arguments
|
|
368
394
|
|
|
369
|
-
<small>[#1630](https://github.com/hashicorp/design-system/pull/1630)</small>
|
|
395
|
+
<small class="doc-whats-new-changelog-metadata">[#1630](https://github.com/hashicorp/design-system/pull/1630)</small>
|
|
370
396
|
|
|
371
397
|
### Patch Changes
|
|
372
398
|
|
|
373
399
|
`Tag` - Updated padding for dismiss button for WCAG conformance
|
|
374
400
|
|
|
375
|
-
<small>[#1696](https://github.com/hashicorp/design-system/pull/1696)</small>
|
|
401
|
+
<small class="doc-whats-new-changelog-metadata">[#1696](https://github.com/hashicorp/design-system/pull/1696)</small>
|
|
376
402
|
|
|
377
|
-
|
|
403
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
378
404
|
|
|
379
405
|
`Link::Standalone` – increase target size
|
|
380
406
|
|
|
381
|
-
<small>[#1678](https://github.com/hashicorp/design-system/pull/1678)</small>
|
|
407
|
+
<small class="doc-whats-new-changelog-metadata">[#1678](https://github.com/hashicorp/design-system/pull/1678)</small>
|
|
382
408
|
|
|
383
|
-
|
|
409
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
384
410
|
|
|
385
411
|
**🔄 Updated dependencies:**
|
|
386
412
|
|
|
@@ -392,15 +418,15 @@ _Notice: while technically this is a breaking change, we consider this a fast-fo
|
|
|
392
418
|
|
|
393
419
|
`PowerSelect` - fix style overrides when the list is positioned above
|
|
394
420
|
|
|
395
|
-
<small>[#1655](https://github.com/hashicorp/design-system/pull/1655)</small>
|
|
421
|
+
<small class="doc-whats-new-changelog-metadata">[#1655](https://github.com/hashicorp/design-system/pull/1655)</small>
|
|
396
422
|
|
|
397
|
-
|
|
423
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
398
424
|
|
|
399
425
|
`Text` - Fixed issue with whitespace adding extra underline when used in links (eg. inside a `Link::Inline`)
|
|
400
426
|
|
|
401
|
-
<small>[#1652](https://github.com/hashicorp/design-system/pull/1652)</small>
|
|
427
|
+
<small class="doc-whats-new-changelog-metadata">[#1652](https://github.com/hashicorp/design-system/pull/1652)</small>
|
|
402
428
|
|
|
403
|
-
|
|
429
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
404
430
|
|
|
405
431
|
**🔄 Updated dependencies:**
|
|
406
432
|
|
|
@@ -412,13 +438,13 @@ _Notice: while technically this is a breaking change, we consider this a fast-fo
|
|
|
412
438
|
|
|
413
439
|
`Pagination` - Bugfix `aria-label` on the component
|
|
414
440
|
|
|
415
|
-
<small>[#1627](https://github.com/hashicorp/design-system/pull/1627)</small>
|
|
441
|
+
<small class="doc-whats-new-changelog-metadata">[#1627](https://github.com/hashicorp/design-system/pull/1627)</small>
|
|
416
442
|
|
|
417
|
-
|
|
443
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
418
444
|
|
|
419
445
|
`Dropdown` - changed `@height` property to use `max-height` instead of a fixed height.
|
|
420
446
|
|
|
421
|
-
<small>[#1635](https://github.com/hashicorp/design-system/pull/1635)</small>
|
|
447
|
+
<small class="doc-whats-new-changelog-metadata">[#1635](https://github.com/hashicorp/design-system/pull/1635)</small>
|
|
422
448
|
|
|
423
449
|
## 2.12.0
|
|
424
450
|
|
|
@@ -426,33 +452,33 @@ _Notice: while technically this is a breaking change, we consider this a fast-fo
|
|
|
426
452
|
|
|
427
453
|
`IconTile` - updated component to include `vault-secrets` product option
|
|
428
454
|
|
|
429
|
-
<small>[#1640](https://github.com/hashicorp/design-system/pull/1640)</small>
|
|
455
|
+
<small class="doc-whats-new-changelog-metadata">[#1640](https://github.com/hashicorp/design-system/pull/1640)</small>
|
|
430
456
|
|
|
431
457
|
### Patch Changes
|
|
432
458
|
|
|
433
459
|
`Text` - Removed leftover `console.log` from code
|
|
434
460
|
|
|
435
|
-
<small>[#1615](https://github.com/hashicorp/design-system/pull/1615)</small>
|
|
461
|
+
<small class="doc-whats-new-changelog-metadata">[#1615](https://github.com/hashicorp/design-system/pull/1615)</small>
|
|
436
462
|
|
|
437
|
-
|
|
463
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
438
464
|
|
|
439
465
|
Refactored the layout of the `Dropdown` checkbox and radio inputs to make the gap between the inputs and the associated text, as well as the icon and count, clickable.
|
|
440
466
|
|
|
441
|
-
<small>[#1618](https://github.com/hashicorp/design-system/pull/1618)</small>
|
|
467
|
+
<small class="doc-whats-new-changelog-metadata">[#1618](https://github.com/hashicorp/design-system/pull/1618)</small>
|
|
442
468
|
|
|
443
|
-
|
|
469
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
444
470
|
|
|
445
471
|
`Hds::Link::Standalone` - Changed font-weight from 500 to 400 to match font-weight of `Hds::Button`.
|
|
446
472
|
|
|
447
|
-
<small>[#1617](https://github.com/hashicorp/design-system/pull/1617)</small>
|
|
473
|
+
<small class="doc-whats-new-changelog-metadata">[#1617](https://github.com/hashicorp/design-system/pull/1617)</small>
|
|
448
474
|
|
|
449
|
-
|
|
475
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
450
476
|
|
|
451
477
|
`Stepper` - removed some CSS declarations that were not used/applied
|
|
452
478
|
|
|
453
|
-
<small>[#1628](https://github.com/hashicorp/design-system/pull/1628)</small>
|
|
479
|
+
<small class="doc-whats-new-changelog-metadata">[#1628](https://github.com/hashicorp/design-system/pull/1628)</small>
|
|
454
480
|
|
|
455
|
-
|
|
481
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
456
482
|
|
|
457
483
|
**🔄 Updated dependencies:**
|
|
458
484
|
|
|
@@ -465,33 +491,33 @@ Refactored the layout of the `Dropdown` checkbox and radio inputs to make the ga
|
|
|
465
491
|
|
|
466
492
|
`Hds::Text` - Added new `Text` component
|
|
467
493
|
|
|
468
|
-
<small>[#1490](https://github.com/hashicorp/design-system/pull/1490)</small>
|
|
494
|
+
<small class="doc-whats-new-changelog-metadata">[#1490](https://github.com/hashicorp/design-system/pull/1490)</small>
|
|
469
495
|
|
|
470
|
-
|
|
496
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
471
497
|
|
|
472
498
|
`Hds::Form::MaskedInput` - Add `hasCopyButton` argument
|
|
473
499
|
|
|
474
|
-
<small>[#1587](https://github.com/hashicorp/design-system/pull/1587)</small>
|
|
500
|
+
<small class="doc-whats-new-changelog-metadata">[#1587](https://github.com/hashicorp/design-system/pull/1587)</small>
|
|
475
501
|
|
|
476
502
|
### Patch Changes
|
|
477
503
|
|
|
478
504
|
`Form::Indicator` - Remove aria-hidden from the "optional" `<span>`
|
|
479
505
|
|
|
480
|
-
<small>[#1577](https://github.com/hashicorp/design-system/pull/1577) - Thanks [@DingoEatingFuzz](https://github.com/DingoEatingFuzz) for the contribution! 🙏</small>
|
|
506
|
+
<small class="doc-whats-new-changelog-metadata">[#1577](https://github.com/hashicorp/design-system/pull/1577) - Thanks [@DingoEatingFuzz](https://github.com/DingoEatingFuzz) for the contribution! 🙏</small>
|
|
481
507
|
|
|
482
|
-
|
|
508
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
483
509
|
|
|
484
510
|
Removed `ember-named-blocks-polyfill` as all consumers of HDS are on Ember 3.25 or later now. This can be installed locally if it is still needed.
|
|
485
511
|
|
|
486
|
-
<small>[#1606](https://github.com/hashicorp/design-system/pull/1606)</small>
|
|
512
|
+
<small class="doc-whats-new-changelog-metadata">[#1606](https://github.com/hashicorp/design-system/pull/1606)</small>
|
|
487
513
|
|
|
488
|
-
|
|
514
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
489
515
|
|
|
490
516
|
`Alert`, `Toast`: Fixed an issue with anchor tag color styles within Description that had been overriding `Hds::Link` color; changed the default color for HTML links within Description to "neutral" to better align with existing guidance for links in the actions and improve accessible contrast.
|
|
491
517
|
|
|
492
|
-
<small>[#1576](https://github.com/hashicorp/design-system/pull/1576)</small>
|
|
518
|
+
<small class="doc-whats-new-changelog-metadata">[#1576](https://github.com/hashicorp/design-system/pull/1576)</small>
|
|
493
519
|
|
|
494
|
-
|
|
520
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
495
521
|
|
|
496
522
|
**🔄 Updated dependencies:**
|
|
497
523
|
|
|
@@ -503,51 +529,51 @@ Removed `ember-named-blocks-polyfill` as all consumers of HDS are on Ember 3.25
|
|
|
503
529
|
|
|
504
530
|
Added new `FileInput` component
|
|
505
531
|
|
|
506
|
-
<small>[#1535](https://github.com/hashicorp/design-system/pull/1535)</small>
|
|
532
|
+
<small class="doc-whats-new-changelog-metadata">[#1535](https://github.com/hashicorp/design-system/pull/1535)</small>
|
|
507
533
|
|
|
508
534
|
### Patch Changes
|
|
509
535
|
|
|
510
536
|
Remove unnecessary export of `hds/copy/index.js`
|
|
511
537
|
|
|
512
|
-
<small>[#1570](https://github.com/hashicorp/design-system/pull/1570)</small>
|
|
538
|
+
<small class="doc-whats-new-changelog-metadata">[#1570](https://github.com/hashicorp/design-system/pull/1570)</small>
|
|
513
539
|
|
|
514
|
-
|
|
540
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
515
541
|
|
|
516
542
|
`Hds::Tabs` - Fix missing tab indicator when used in Modal or Flyout
|
|
517
543
|
|
|
518
|
-
<small>[#1575](https://github.com/hashicorp/design-system/pull/1575)</small>
|
|
544
|
+
<small class="doc-whats-new-changelog-metadata">[#1575](https://github.com/hashicorp/design-system/pull/1575)</small>
|
|
519
545
|
|
|
520
|
-
|
|
546
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
521
547
|
|
|
522
548
|
`Copy::Snippet` - Added support for container and updated API docs
|
|
523
549
|
|
|
524
|
-
<small>[#1567](https://github.com/hashicorp/design-system/pull/1567)</small>
|
|
550
|
+
<small class="doc-whats-new-changelog-metadata">[#1567](https://github.com/hashicorp/design-system/pull/1567)</small>
|
|
525
551
|
|
|
526
|
-
|
|
552
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
527
553
|
|
|
528
554
|
`Hds::Tabs` - Fixed tabs and panels misbehaving on route change
|
|
529
555
|
|
|
530
|
-
<small>[#1571](https://github.com/hashicorp/design-system/pull/1571)</small>
|
|
556
|
+
<small class="doc-whats-new-changelog-metadata">[#1571](https://github.com/hashicorp/design-system/pull/1571)</small>
|
|
531
557
|
|
|
532
|
-
|
|
558
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
533
559
|
|
|
534
|
-
<small>[#1568](https://github.com/hashicorp/design-system/pull/1568)</small>
|
|
560
|
+
<small class="doc-whats-new-changelog-metadata">[#1568](https://github.com/hashicorp/design-system/pull/1568)</small>
|
|
535
561
|
|
|
536
562
|
`Copy::Button`, `Copy::Snippet` - Updated error icon
|
|
537
563
|
|
|
538
|
-
|
|
564
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
539
565
|
|
|
540
566
|
`Hds::SegmentedGroup` - Prevent `border-radius` from interfering with underlying elements
|
|
541
567
|
|
|
542
|
-
<small>[#1555](https://github.com/hashicorp/design-system/pull/1555)</small>
|
|
568
|
+
<small class="doc-whats-new-changelog-metadata">[#1555](https://github.com/hashicorp/design-system/pull/1555)</small>
|
|
543
569
|
|
|
544
|
-
|
|
570
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
545
571
|
|
|
546
572
|
`Table` - Resolved issue where `ThSort` was not supporting right-aligned text properly
|
|
547
573
|
|
|
548
|
-
<small>[#1565](https://github.com/hashicorp/design-system/pull/1565)</small>
|
|
574
|
+
<small class="doc-whats-new-changelog-metadata">[#1565](https://github.com/hashicorp/design-system/pull/1565)</small>
|
|
549
575
|
|
|
550
|
-
|
|
576
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
551
577
|
|
|
552
578
|
**🔄 Updated dependencies:**
|
|
553
579
|
|
|
@@ -559,39 +585,39 @@ Remove unnecessary export of `hds/copy/index.js`
|
|
|
559
585
|
|
|
560
586
|
Added the `Hds::CopyButton` and `Hds::CopySnippet` components.
|
|
561
587
|
|
|
562
|
-
<small>[#1488](https://github.com/hashicorp/design-system/pull/1488)</small>
|
|
588
|
+
<small class="doc-whats-new-changelog-metadata">[#1488](https://github.com/hashicorp/design-system/pull/1488)</small>
|
|
563
589
|
|
|
564
590
|
### Patch Changes
|
|
565
591
|
|
|
566
592
|
Adjusted closing brace on copywrite headers to avoid terminal noise
|
|
567
593
|
|
|
568
|
-
<small>[#1539](https://github.com/hashicorp/design-system/pull/1539)</small>
|
|
594
|
+
<small class="doc-whats-new-changelog-metadata">[#1539](https://github.com/hashicorp/design-system/pull/1539)</small>
|
|
569
595
|
|
|
570
|
-
|
|
596
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
571
597
|
|
|
572
598
|
`Hds::Modal` - reduce test flakiness around closing Modal when using `@ember/test-helpers`
|
|
573
599
|
|
|
574
|
-
<small>[#1549](https://github.com/hashicorp/design-system/pull/1549) - Thanks [@fivetanley](https://github.com/fivetanley) for the contribution! 🙏</small>
|
|
600
|
+
<small class="doc-whats-new-changelog-metadata">[#1549](https://github.com/hashicorp/design-system/pull/1549) - Thanks [@fivetanley](https://github.com/fivetanley) for the contribution! 🙏</small>
|
|
575
601
|
|
|
576
|
-
|
|
602
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
577
603
|
|
|
578
604
|
Fix Embroider warnings caused by incorrect export of internal utility functions
|
|
579
605
|
|
|
580
|
-
<small>[#1530](https://github.com/hashicorp/design-system/pull/1530)</small>
|
|
606
|
+
<small class="doc-whats-new-changelog-metadata">[#1530](https://github.com/hashicorp/design-system/pull/1530)</small>
|
|
581
607
|
|
|
582
|
-
|
|
608
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
583
609
|
|
|
584
610
|
`Hds::Flyout` - reduce test flakiness around closing Flyout when using `@ember/test-helpers`
|
|
585
611
|
|
|
586
|
-
<small>[#1552](https://github.com/hashicorp/design-system/pull/1552)</small>
|
|
612
|
+
<small class="doc-whats-new-changelog-metadata">[#1552](https://github.com/hashicorp/design-system/pull/1552)</small>
|
|
587
613
|
|
|
588
|
-
|
|
614
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
589
615
|
|
|
590
616
|
`Hds::Form::Field` - Fix error message for unexpected `@layout` values
|
|
591
617
|
|
|
592
|
-
<small>[#1529](https://github.com/hashicorp/design-system/pull/1529)</small>
|
|
618
|
+
<small class="doc-whats-new-changelog-metadata">[#1529](https://github.com/hashicorp/design-system/pull/1529)</small>
|
|
593
619
|
|
|
594
|
-
|
|
620
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
595
621
|
|
|
596
622
|
**🔄 Updated dependencies:**
|
|
597
623
|
|
|
@@ -16,30 +16,30 @@
|
|
|
16
16
|
aria-label={{if this.isIconOnly this.text null}}
|
|
17
17
|
>
|
|
18
18
|
{{#if this.isIconOnly}}
|
|
19
|
-
<
|
|
19
|
+
<span class="hds-button__icon">
|
|
20
20
|
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
21
|
-
</
|
|
21
|
+
</span>
|
|
22
22
|
{{else}}
|
|
23
23
|
{{#if this.icon}}
|
|
24
24
|
{{#if (eq this.iconPosition "leading")}}
|
|
25
|
-
<
|
|
25
|
+
<span class="hds-button__icon">
|
|
26
26
|
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
27
|
-
</
|
|
28
|
-
<
|
|
27
|
+
</span>
|
|
28
|
+
<span class="hds-button__text">
|
|
29
29
|
{{this.text}}
|
|
30
|
-
</
|
|
30
|
+
</span>
|
|
31
31
|
{{else}}
|
|
32
|
-
<
|
|
32
|
+
<span class="hds-button__text">
|
|
33
33
|
{{this.text}}
|
|
34
|
-
</
|
|
35
|
-
<
|
|
34
|
+
</span>
|
|
35
|
+
<span class="hds-button__icon">
|
|
36
36
|
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
37
|
-
</
|
|
37
|
+
</span>
|
|
38
38
|
{{/if}}
|
|
39
39
|
{{else}}
|
|
40
|
-
<
|
|
40
|
+
<span class="hds-button__text">
|
|
41
41
|
{{this.text}}
|
|
42
|
-
</
|
|
42
|
+
</span>
|
|
43
43
|
{{/if}}
|
|
44
44
|
{{/if}}
|
|
45
45
|
</Hds::Interactive>
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
aria-selected={{if @selected "true" "false"}}
|
|
21
21
|
>
|
|
22
22
|
{{#if @icon}}
|
|
23
|
-
<
|
|
23
|
+
<span class="hds-dropdown-list-item__interactive-icon">
|
|
24
24
|
<FlightIcon @name={{@icon}} @isInlineBlock={{false}} />
|
|
25
|
-
</
|
|
25
|
+
</span>
|
|
26
26
|
{{/if}}
|
|
27
|
-
<Hds::Text::Body @tag="
|
|
27
|
+
<Hds::Text::Body @tag="span" @size="200" @weight="medium" class="hds-dropdown-list-item__interactive-text">
|
|
28
28
|
{{yield}}
|
|
29
29
|
</Hds::Text::Body>
|
|
30
30
|
{{#if @count}}
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
...attributes
|
|
26
26
|
>
|
|
27
27
|
{{#if @icon}}
|
|
28
|
-
<
|
|
28
|
+
<span class="hds-dropdown-list-item__interactive-icon">
|
|
29
29
|
<FlightIcon @name={{@icon}} @isInlineBlock={{false}} />
|
|
30
|
-
</
|
|
30
|
+
</span>
|
|
31
31
|
{{/if}}
|
|
32
|
-
<Hds::Text::Body class="hds-dropdown-list-item__interactive-text" @tag="
|
|
32
|
+
<Hds::Text::Body class="hds-dropdown-list-item__interactive-text" @tag="span" @size="200" @weight="medium">
|
|
33
33
|
{{this.text}}
|
|
34
34
|
</Hds::Text::Body>
|
|
35
35
|
</Hds::Interactive>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{{!
|
|
2
|
+
Copyright (c) HashiCorp, Inc.
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
}}
|
|
5
|
+
<Hds::Text::Body
|
|
6
|
+
@tag="div"
|
|
7
|
+
@size="100"
|
|
8
|
+
class={{this.classNames}}
|
|
9
|
+
id={{this.id}}
|
|
10
|
+
{{did-insert this.onInsert}}
|
|
11
|
+
{{will-destroy this.willDestroyNode}}
|
|
12
|
+
...attributes
|
|
13
|
+
aria-live="polite"
|
|
14
|
+
>
|
|
15
|
+
{{#if (has-block)}}
|
|
16
|
+
{{yield
|
|
17
|
+
(hash
|
|
18
|
+
minLength=this.minLength
|
|
19
|
+
maxLength=this.maxLength
|
|
20
|
+
currentLength=this.currentLength
|
|
21
|
+
remaining=this.remaining
|
|
22
|
+
shortfall=this.shortfall
|
|
23
|
+
)
|
|
24
|
+
}}
|
|
25
|
+
{{else}}
|
|
26
|
+
{{this.message}}
|
|
27
|
+
{{/if}}
|
|
28
|
+
</Hds::Text::Body>
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { tracked } from '@glimmer/tracking';
|
|
8
|
+
import { action } from '@ember/object';
|
|
9
|
+
|
|
10
|
+
const ID_PREFIX = 'character-count-';
|
|
11
|
+
const NOOP = () => {};
|
|
12
|
+
|
|
13
|
+
export default class HdsFormCharacterCountIndexComponent extends Component {
|
|
14
|
+
// The current number of characters in the associated input
|
|
15
|
+
@tracked currentLength;
|
|
16
|
+
inputControl = document.getElementById(this.args.controlId);
|
|
17
|
+
|
|
18
|
+
// Inflector utility function to determine plural or singular for 'character' noun
|
|
19
|
+
pluralize(count, prefix = '', noun = 'character', suffix = 's') {
|
|
20
|
+
return `${count}${prefix ? ' ' + prefix : ''} ${noun}${
|
|
21
|
+
count !== 1 ? suffix : ''
|
|
22
|
+
}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @param maxLength
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @default null
|
|
29
|
+
* @description The maximum number of characters allowed.
|
|
30
|
+
*/
|
|
31
|
+
get maxLength() {
|
|
32
|
+
let { maxLength } = this.args;
|
|
33
|
+
return parseInt(maxLength);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param minLength
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @default null
|
|
40
|
+
* @description The minimum number of characters allowed.
|
|
41
|
+
*/
|
|
42
|
+
get minLength() {
|
|
43
|
+
let { minLength } = this.args;
|
|
44
|
+
return parseInt(minLength);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @param remaining
|
|
49
|
+
* @type {number}
|
|
50
|
+
* @default null
|
|
51
|
+
* @description The remaining number of characters.
|
|
52
|
+
*/
|
|
53
|
+
get remaining() {
|
|
54
|
+
return this.maxLength - this.currentLength;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @param shortfall
|
|
59
|
+
* @type {number}
|
|
60
|
+
* @default null
|
|
61
|
+
* @description The number of characters the content is falling short of.
|
|
62
|
+
*/
|
|
63
|
+
get shortfall() {
|
|
64
|
+
return this.minLength - this.currentLength;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @param message
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @default null
|
|
71
|
+
* @description The character count message presented to users
|
|
72
|
+
*/
|
|
73
|
+
get message() {
|
|
74
|
+
let messageText = '';
|
|
75
|
+
if (this.minLength && this.currentLength === 0) {
|
|
76
|
+
messageText = `${this.pluralize(this.minLength)} required`;
|
|
77
|
+
} else if (this.minLength && this.currentLength < this.minLength) {
|
|
78
|
+
messageText = `${this.pluralize(this.shortfall, 'more')} required`;
|
|
79
|
+
} else if (this.maxLength && this.currentLength === 0) {
|
|
80
|
+
messageText = `${this.pluralize(this.maxLength)} allowed`;
|
|
81
|
+
} else if (this.maxLength && this.currentLength <= this.maxLength) {
|
|
82
|
+
messageText = `${this.pluralize(this.remaining)} remaining`;
|
|
83
|
+
} else if (this.currentLength > this.maxLength) {
|
|
84
|
+
messageText = `Exceeded by ${this.pluralize(-this.remaining)}`;
|
|
85
|
+
} else {
|
|
86
|
+
messageText = `${this.pluralize(this.currentLength)} entered`;
|
|
87
|
+
}
|
|
88
|
+
return messageText;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Determines the unique ID to assign to the element
|
|
93
|
+
* @method id
|
|
94
|
+
* @return {(string|null)} The "id" attribute to apply to the element or null, if no controlId is provided
|
|
95
|
+
*/
|
|
96
|
+
get id() {
|
|
97
|
+
let { controlId } = this.args;
|
|
98
|
+
if (controlId) {
|
|
99
|
+
return `${ID_PREFIX}${controlId}`;
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @param onInsert
|
|
106
|
+
* @type {function}
|
|
107
|
+
* @default () => {}
|
|
108
|
+
*/
|
|
109
|
+
get onInsert() {
|
|
110
|
+
let { onInsert } = this.args;
|
|
111
|
+
|
|
112
|
+
if (!this.inputControl || this.inputControl.value === undefined) {
|
|
113
|
+
console.error(
|
|
114
|
+
'`Hds::Form::CharacterCount` component - `@controlId` selector provided does not point to a valid input element, check the id',
|
|
115
|
+
this.args.controlId
|
|
116
|
+
);
|
|
117
|
+
} else {
|
|
118
|
+
this.updateCurrentLength();
|
|
119
|
+
this.inputControl.addEventListener(
|
|
120
|
+
'input',
|
|
121
|
+
this.updateCurrentLength,
|
|
122
|
+
true
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// notice: this is a guard used to prevent triggering an error when the component is used as standalone element
|
|
127
|
+
if (typeof onInsert === 'function') {
|
|
128
|
+
return onInsert;
|
|
129
|
+
} else {
|
|
130
|
+
return NOOP;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@action
|
|
135
|
+
willDestroyNode() {
|
|
136
|
+
if (this.inputControl) {
|
|
137
|
+
this.inputControl.removeEventListener(
|
|
138
|
+
'input',
|
|
139
|
+
this.updateCurrentLength,
|
|
140
|
+
true
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@action
|
|
146
|
+
updateCurrentLength() {
|
|
147
|
+
this.currentLength = this.inputControl?.value?.length;
|
|
148
|
+
|
|
149
|
+
if (typeof this.args.onInput === 'function') {
|
|
150
|
+
this.args.onInput({
|
|
151
|
+
inputControl: this.inputControl,
|
|
152
|
+
currentLength: this.currentLength,
|
|
153
|
+
maxLength: this.maxLength,
|
|
154
|
+
minLength: this.minLength,
|
|
155
|
+
remaining: this.remaining,
|
|
156
|
+
shortfall: this.shortfall,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Get the class names to apply to the component.
|
|
163
|
+
* @method classNames
|
|
164
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
165
|
+
*/
|
|
166
|
+
get classNames() {
|
|
167
|
+
let classes = ['hds-form-character-count'];
|
|
168
|
+
|
|
169
|
+
// add a class based on the @contextualClass argument
|
|
170
|
+
// notice: this will *not* be documented for public use
|
|
171
|
+
// the reason for this is that the contextual component declarations don't pass attributes to the component
|
|
172
|
+
if (this.args.contextualClass) {
|
|
173
|
+
classes.push(this.args.contextualClass);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return classes.join(' ');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -27,6 +27,16 @@
|
|
|
27
27
|
<div class="hds-form-field__control">
|
|
28
28
|
{{yield (hash Control=(component "hds/yield") id=this.id ariaDescribedBy=this.ariaDescribedBy)}}
|
|
29
29
|
</div>
|
|
30
|
+
{{yield
|
|
31
|
+
(hash
|
|
32
|
+
CharacterCount=(component
|
|
33
|
+
"hds/form/character-count"
|
|
34
|
+
controlId=this.id
|
|
35
|
+
onInsert=this.appendDescriptor
|
|
36
|
+
contextualClass="hds-form-field__character-count"
|
|
37
|
+
)
|
|
38
|
+
)
|
|
39
|
+
}}
|
|
30
40
|
{{yield
|
|
31
41
|
(hash
|
|
32
42
|
Error=(component
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
>
|
|
13
13
|
{{! Notice: the order of the elements is not relevant here, because is controlled at "Hds::Form::Field" component level }}
|
|
14
14
|
{{yield (hash Label=F.Label isRequired=F.isRequired isOptional=F.isOptional)}}
|
|
15
|
-
{{yield (hash HelperText=F.HelperText Error=F.Error)}}
|
|
15
|
+
{{yield (hash HelperText=F.HelperText Error=F.Error CharacterCount=F.CharacterCount)}}
|
|
16
16
|
<F.Control>
|
|
17
17
|
<Hds::Form::MaskedInput::Base
|
|
18
18
|
@hasCopyButton={{@hasCopyButton}}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
>
|
|
13
13
|
{{! Notice: the order of the elements is not relevant here, because is controlled at "Hds::Form::Field" component level }}
|
|
14
14
|
{{yield (hash Label=F.Label isRequired=F.isRequired isOptional=F.isOptional)}}
|
|
15
|
-
{{yield (hash HelperText=F.HelperText Error=F.Error)}}
|
|
15
|
+
{{yield (hash HelperText=F.HelperText Error=F.Error CharacterCount=F.CharacterCount)}}
|
|
16
16
|
<F.Control>
|
|
17
17
|
<div class="hds-form-text-input__wrapper" {{style width=@width}}>
|
|
18
18
|
<Hds::Form::TextInput::Base
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
>
|
|
13
13
|
{{! Notice: the order of the elements is not relevant here, because is controlled at "Hds::Form::Field" component level }}
|
|
14
14
|
{{yield (hash Label=F.Label isRequired=F.isRequired isOptional=F.isOptional)}}
|
|
15
|
-
{{yield (hash HelperText=F.HelperText Error=F.Error)}}
|
|
15
|
+
{{yield (hash HelperText=F.HelperText Error=F.Error CharacterCount=F.CharacterCount)}}
|
|
16
16
|
<F.Control>
|
|
17
17
|
<Hds::Form::Textarea::Base
|
|
18
18
|
@value={{@value}}
|
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
...attributes
|
|
12
12
|
>
|
|
13
13
|
{{#if (eq this.iconPosition "leading")}}
|
|
14
|
-
<
|
|
14
|
+
<span class="hds-link-standalone__icon">
|
|
15
15
|
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
16
|
-
</
|
|
17
|
-
<
|
|
16
|
+
</span>
|
|
17
|
+
<span class="hds-link-standalone__text">
|
|
18
18
|
{{this.text}}
|
|
19
|
-
</
|
|
19
|
+
</span>
|
|
20
20
|
{{else}}
|
|
21
|
-
<
|
|
21
|
+
<span class="hds-link-standalone__text">
|
|
22
22
|
{{this.text}}
|
|
23
|
-
</
|
|
24
|
-
<
|
|
23
|
+
</span>
|
|
24
|
+
<span class="hds-link-standalone__icon">
|
|
25
25
|
<FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />
|
|
26
|
-
</
|
|
26
|
+
</span>
|
|
27
27
|
{{/if}}
|
|
28
28
|
</Hds::Interactive>
|
|
@@ -409,11 +409,13 @@ $hds-dropdown-toggle-border-radius: $hds-button-border-radius;
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
.hds-dropdown-list-item__interactive-icon {
|
|
412
|
+
display: block;
|
|
412
413
|
margin-top: 2px;
|
|
413
414
|
margin-right: 8px;
|
|
414
415
|
}
|
|
415
416
|
|
|
416
417
|
.hds-dropdown-list-item__interactive-text {
|
|
418
|
+
display: block;
|
|
417
419
|
flex: 1;
|
|
418
420
|
text-align: left; // the button element was centering text
|
|
419
421
|
}
|
|
@@ -31,7 +31,12 @@ $hds-link-standalone-border-width: 1px;
|
|
|
31
31
|
text-decoration-color: transparent;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
.hds-link-standalone__icon {
|
|
35
|
+
display: block;
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
.hds-link-standalone__text {
|
|
39
|
+
display: block;
|
|
35
40
|
flex: 1 0 0;
|
|
36
41
|
text-decoration: underline;
|
|
37
42
|
text-decoration-color: transparent;
|