@hashicorp/design-system-components 3.3.0 → 3.4.1
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 +95 -20
- package/addon/components/hds/app-footer/legal-links.js +2 -1
- package/addon/components/hds/button/index.ts +10 -4
- package/addon/components/hds/code-block/index.hbs +3 -6
- package/addon/components/hds/code-block/index.js +24 -20
- package/addon/components/hds/flyout/index.hbs +1 -0
- package/addon/components/hds/flyout/index.js +20 -7
- package/addon/components/hds/modal/index.hbs +1 -0
- package/addon/components/hds/modal/index.js +35 -22
- package/addon/components/hds/table/index.js +2 -2
- package/addon/components/hds/tabs/panel.js +1 -1
- package/addon/components/hds/tabs/tab.js +1 -1
- package/app/styles/components/app-footer.scss +2 -2
- package/app/styles/components/button.scss +8 -4
- package/app/styles/components/code-block/index.scss +1 -1
- package/app/styles/components/form/group.scss +1 -1
- package/app/styles/components/segmented-group.scss +3 -3
- package/app/styles/components/table.scss +4 -0
- package/app/styles/components/tooltip.scss +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,89 @@
|
|
|
1
1
|
# @hashicorp/design-system-components
|
|
2
2
|
|
|
3
|
+
## 3.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
`Modal` - Removed `close` event listener on destroy
|
|
8
|
+
`Flyout` - Removed `close` event listener on destroy
|
|
9
|
+
|
|
10
|
+
<small class="doc-whats-new-changelog-metadata">[#1887](https://github.com/hashicorp/design-system/pull/1887)</small>
|
|
11
|
+
|
|
12
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
13
|
+
|
|
14
|
+
`CodeBlock` - Fixed issues with dynamic content, compile warning, and line number alignment
|
|
15
|
+
|
|
16
|
+
<small class="doc-whats-new-changelog-metadata">[#1853](https://github.com/hashicorp/design-system/pull/1853)</small>
|
|
17
|
+
|
|
18
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
19
|
+
|
|
20
|
+
`SegmentedGroup` - Fixed issue with border-radius of single child element being overridden
|
|
21
|
+
|
|
22
|
+
<small class="doc-whats-new-changelog-metadata">[#1892](https://github.com/hashicorp/design-system/pull/1892)</small>
|
|
23
|
+
|
|
24
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
25
|
+
|
|
26
|
+
## 3.4.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
`Button` - Added `@isInline` argument
|
|
31
|
+
|
|
32
|
+
<small class="doc-whats-new-changelog-metadata">[#1854](https://github.com/hashicorp/design-system/pull/1854)</small>
|
|
33
|
+
|
|
34
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
35
|
+
|
|
36
|
+
`Table` - Added support for `baseline` vertical alignment
|
|
37
|
+
|
|
38
|
+
<small class="doc-whats-new-changelog-metadata">[#1861](https://github.com/hashicorp/design-system/pull/1861)</small>
|
|
39
|
+
|
|
40
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
`AppFooter` - Changed visual alignment from right-aligned to centered.
|
|
45
|
+
|
|
46
|
+
<small class="doc-whats-new-changelog-metadata">[#1867](https://github.com/hashicorp/design-system/pull/1867)</small>
|
|
47
|
+
|
|
48
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
49
|
+
|
|
50
|
+
`Tooltip` - Fixed issue with text alignment, which was inherited from the parent container (now it's always left aligned).
|
|
51
|
+
|
|
52
|
+
<small class="doc-whats-new-changelog-metadata">[#1869](https://github.com/hashicorp/design-system/pull/1869)</small>
|
|
53
|
+
|
|
54
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
55
|
+
|
|
56
|
+
`Tabs` - Fixed subcomponents' backing-class names
|
|
57
|
+
|
|
58
|
+
<small class="doc-whats-new-changelog-metadata">[#1883](https://github.com/hashicorp/design-system/pull/1883)</small>
|
|
59
|
+
|
|
60
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
61
|
+
|
|
62
|
+
`AppFooter` - Updated default accessibility URL to https://hashicorp.com/accessibility
|
|
63
|
+
|
|
64
|
+
<small class="doc-whats-new-changelog-metadata">[#1811](https://github.com/hashicorp/design-system/pull/1811)</small>
|
|
65
|
+
|
|
66
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
67
|
+
|
|
68
|
+
`Form::Fieldset` as consumed by `Form::Checkbox::Group`, `Form::Radio::Group`, `Form::RadioCard::Group`, and `Form::Toggle::Group` - Changed spacing between `legend` and content from 4px to 8px
|
|
69
|
+
|
|
70
|
+
<small class="doc-whats-new-changelog-metadata">[#1856](https://github.com/hashicorp/design-system/pull/1856)</small>
|
|
71
|
+
|
|
72
|
+
<div class="doc-whats-new-changelog-separator"></div>
|
|
73
|
+
|
|
74
|
+
**🔄 Updated dependencies:**
|
|
75
|
+
|
|
76
|
+
- @hashicorp/ember-flight-icons@4.0.5
|
|
77
|
+
|
|
3
78
|
## 3.3.0
|
|
4
79
|
|
|
5
80
|
### Minor Changes
|
|
6
81
|
|
|
7
|
-
`
|
|
8
|
-
`
|
|
9
|
-
`
|
|
10
|
-
`
|
|
11
|
-
`
|
|
82
|
+
`Form::CharacterCount` - Added new component
|
|
83
|
+
`Form::Field` - Added `CharacterCount` contextual component
|
|
84
|
+
`Form::MaskedInput::Field` - Added `CharacterCount` contextual component
|
|
85
|
+
`Form::TextInput::Field` - Added `CharacterCount` contextual component
|
|
86
|
+
`Form::Textarea::Field` - Added `CharacterCount` contextual component
|
|
12
87
|
|
|
13
88
|
<small class="doc-whats-new-changelog-metadata">[#1802](https://github.com/hashicorp/design-system/pull/1802)</small>
|
|
14
89
|
|
|
@@ -16,11 +91,11 @@
|
|
|
16
91
|
|
|
17
92
|
### Patch Changes
|
|
18
93
|
|
|
19
|
-
`Button` -
|
|
94
|
+
`Button` - Updated DOM structure to contain only `span` elements
|
|
20
95
|
|
|
21
|
-
`Dropdown` -
|
|
96
|
+
`Dropdown` - Updated button elements DOM structure to contain only `span` elements
|
|
22
97
|
|
|
23
|
-
`Link::Standalone` -
|
|
98
|
+
`Link::Standalone` - Updated DOM structure to contain only `span` elements
|
|
24
99
|
|
|
25
100
|
<small class="doc-whats-new-changelog-metadata">[#1840](https://github.com/hashicorp/design-system/pull/1840)</small>
|
|
26
101
|
|
|
@@ -36,9 +111,9 @@
|
|
|
36
111
|
|
|
37
112
|
<div class="doc-whats-new-changelog-separator"></div>
|
|
38
113
|
|
|
39
|
-
`
|
|
114
|
+
`Table` - Updated `@columns` object to support `isVisuallyHidden` argument
|
|
40
115
|
|
|
41
|
-
- `
|
|
116
|
+
- `Table::Th` - Updated to support `isVisuallyHidden` argument
|
|
42
117
|
|
|
43
118
|
<small class="doc-whats-new-changelog-metadata">[#1819](https://github.com/hashicorp/design-system/pull/1819)</small>
|
|
44
119
|
|
|
@@ -147,7 +222,7 @@ Upgraded the following dependencies:
|
|
|
147
222
|
|
|
148
223
|
### Patch Changes
|
|
149
224
|
|
|
150
|
-
|
|
225
|
+
Explicitly added `ember-element-helper` as dependency for the `components` package
|
|
151
226
|
|
|
152
227
|
<small class="doc-whats-new-changelog-metadata">[#1751](https://github.com/hashicorp/design-system/pull/1751)</small>
|
|
153
228
|
|
|
@@ -165,33 +240,33 @@ explicitly added `ember-element-helper` as dependency for the `components` packa
|
|
|
165
240
|
|
|
166
241
|
### Major Changes
|
|
167
242
|
|
|
168
|
-
|
|
243
|
+
Dropped support for Node 14
|
|
169
244
|
|
|
170
245
|
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
171
246
|
|
|
172
247
|
<div class="doc-whats-new-changelog-separator"></div>
|
|
173
248
|
|
|
174
|
-
`
|
|
249
|
+
`Form::VisibilityToggle` - Added component as a form base element
|
|
175
250
|
|
|
176
|
-
`
|
|
251
|
+
`Form::TextInput::Field` - Added `Form::VisibilityToggle` to password inputs (controlled via `@hasVisibilityToggle` - Notice that this is set to be visible by default now)
|
|
177
252
|
|
|
178
|
-
`
|
|
253
|
+
`Form::MaskedInput` - Refactored to use `Form::VisibilityToggle`
|
|
179
254
|
|
|
180
|
-
`
|
|
255
|
+
`Form::MaskedInput` - Renamed `@isMasked` to `@isContentMasked`
|
|
181
256
|
|
|
182
257
|
To migrate:
|
|
183
258
|
|
|
184
|
-
- in `
|
|
259
|
+
- in `Form::MaskedInput` instances replace `@isMasked` arguments with `@isContentMasked`
|
|
185
260
|
|
|
186
261
|
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
187
262
|
|
|
188
263
|
<div class="doc-whats-new-changelog-separator"></div>
|
|
189
264
|
|
|
190
|
-
`
|
|
265
|
+
`Dropdown` – Removed `@listPosition` `left` and `right` (use `bottom-left` and `bottom-right`, respectively).
|
|
191
266
|
|
|
192
267
|
To migrate:
|
|
193
268
|
|
|
194
|
-
- in `
|
|
269
|
+
- in `Dropdown` instances:
|
|
195
270
|
- replace `@listPosition="left"` with `@listPosition="bottom-left"`
|
|
196
271
|
- replace `@listPosition="right"` with `@listPosition="bottom-right"`
|
|
197
272
|
|
|
@@ -203,7 +278,7 @@ To migrate:
|
|
|
203
278
|
|
|
204
279
|
To migrate:
|
|
205
280
|
|
|
206
|
-
- rename all the `extraBefore/After` instances yielded within the
|
|
281
|
+
- rename all the `extraBefore/After` instances yielded within the `SideNav` component to `ExtraBefore/After`
|
|
207
282
|
|
|
208
283
|
<small class="doc-whats-new-changelog-metadata">[#1634](https://github.com/hashicorp/design-system/pull/1634)</small>
|
|
209
284
|
|
|
@@ -60,7 +60,8 @@ export default class HdsAppFooterLegalLinksComponent extends Component {
|
|
|
60
60
|
*/
|
|
61
61
|
get hrefForAccessibility() {
|
|
62
62
|
return (
|
|
63
|
-
this.args.hrefForAccessibility ??
|
|
63
|
+
this.args.hrefForAccessibility ??
|
|
64
|
+
'https://www.hashicorp.com/accessibility'
|
|
64
65
|
);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -26,6 +26,7 @@ export interface HdsButtonSignature {
|
|
|
26
26
|
icon?: string;
|
|
27
27
|
iconPosition?: HdsButtonIconPosition;
|
|
28
28
|
isIconOnly?: boolean;
|
|
29
|
+
isInline?: boolean;
|
|
29
30
|
isFullWidth?: boolean;
|
|
30
31
|
};
|
|
31
32
|
Element: HdsInteractiveSignature['Element'];
|
|
@@ -165,9 +166,6 @@ export default class HdsButtonIndexComponent extends Component<HdsButtonSignatur
|
|
|
165
166
|
get classNames() {
|
|
166
167
|
let classes = ['hds-button'];
|
|
167
168
|
|
|
168
|
-
// add a class based on the @size argument
|
|
169
|
-
classes.push(`hds-button--size-${this.size}`);
|
|
170
|
-
|
|
171
169
|
// add a class based on the @color argument
|
|
172
170
|
classes.push(`hds-button--color-${this.color}`);
|
|
173
171
|
|
|
@@ -176,11 +174,19 @@ export default class HdsButtonIndexComponent extends Component<HdsButtonSignatur
|
|
|
176
174
|
classes.push('hds-button--width-full');
|
|
177
175
|
}
|
|
178
176
|
|
|
179
|
-
// add a class
|
|
177
|
+
// add a class based on isIconOnly argument
|
|
180
178
|
if (this.isIconOnly) {
|
|
181
179
|
classes.push('hds-button--is-icon-only');
|
|
182
180
|
}
|
|
183
181
|
|
|
182
|
+
// add a class based on the @isInline argument
|
|
183
|
+
if (this.args.isInline) {
|
|
184
|
+
classes.push('hds-button--is-inline');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// add a class based on the @size argument
|
|
188
|
+
classes.push(`hds-button--size-${this.size}`);
|
|
189
|
+
|
|
184
190
|
return classes.join(' ');
|
|
185
191
|
}
|
|
186
192
|
}
|
|
@@ -9,19 +9,16 @@
|
|
|
9
9
|
{{~yield (hash Description=(component "hds/code-block/description"))~}}
|
|
10
10
|
</div>
|
|
11
11
|
<div class="hds-code-block__body">
|
|
12
|
+
{{! content within pre tag is whitespace-sensitive; do not add new lines! }}
|
|
12
13
|
<pre
|
|
13
14
|
class="hds-code-block__code"
|
|
14
15
|
{{style maxHeight=@maxHeight}}
|
|
15
16
|
data-line={{@highlightLines}}
|
|
16
17
|
id={{this.preCodeId}}
|
|
17
18
|
tabindex="0"
|
|
18
|
-
>
|
|
19
|
-
{{~! ~}}
|
|
20
|
-
<code {{did-insert this.setPrismCode}} {{did-update this.setPrismCode this.code @language}}>
|
|
19
|
+
><code {{did-insert this.setPrismCode}} {{did-update this.setPrismCode this.code @language}}>
|
|
21
20
|
{{~this.prismCode~}}
|
|
22
|
-
</code>
|
|
23
|
-
{{~! ~}}
|
|
24
|
-
</pre>
|
|
21
|
+
</code></pre>
|
|
25
22
|
|
|
26
23
|
{{#if @hasCopyButton}}
|
|
27
24
|
<Hds::CodeBlock::CopyButton @targetToCopy="#{{this.preCodeId}}" aria-describedby={{this.preCodeId}} />
|
|
@@ -7,6 +7,7 @@ import Component from '@glimmer/component';
|
|
|
7
7
|
import { action } from '@ember/object';
|
|
8
8
|
import { tracked } from '@glimmer/tracking';
|
|
9
9
|
import { assert } from '@ember/debug';
|
|
10
|
+
import { next, schedule } from '@ember/runloop';
|
|
10
11
|
import { htmlSafe } from '@ember/template';
|
|
11
12
|
import { guidFor } from '@ember/object/internals';
|
|
12
13
|
|
|
@@ -107,27 +108,30 @@ export default class HdsCodeBlockIndexComponent extends Component {
|
|
|
107
108
|
const grammar = Prism.languages[language];
|
|
108
109
|
|
|
109
110
|
if (code) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
next(() => {
|
|
112
|
+
if (language && grammar) {
|
|
113
|
+
this.prismCode = htmlSafe(Prism.highlight(code, grammar, language));
|
|
114
|
+
} else {
|
|
115
|
+
this.prismCode = htmlSafe(Prism.util.encode(code));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Force prism-line-numbers plugin initialization, required for Prism.highlight usage
|
|
119
|
+
// See https://github.com/PrismJS/prism/issues/1234
|
|
120
|
+
Prism.hooks.run('complete', {
|
|
121
|
+
code,
|
|
122
|
+
element,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// Force prism-line-highlight plugin initialization
|
|
126
|
+
// Context: https://github.com/hashicorp/design-system/pull/1749#discussion_r1374288785
|
|
127
|
+
if (this.args.highlightLines) {
|
|
128
|
+
// we need to delay re-evaluating the context for prism-line-highlight for as much as possible, and `afterRender` is the 'latest' we can use in the component lifecycle
|
|
129
|
+
schedule('afterRender', () => {
|
|
130
|
+
// we piggy-back on the plugin's `resize` event listener to trigger a new call of the `highlightLines` function: https://github.com/PrismJS/prism/blob/master/plugins/line-highlight/prism-line-highlight.js#L337
|
|
131
|
+
if (window) window.dispatchEvent(new Event('resize'));
|
|
132
|
+
});
|
|
133
|
+
}
|
|
121
134
|
});
|
|
122
|
-
|
|
123
|
-
// Force prism-line-highlight plugin initialization
|
|
124
|
-
// Context: https://github.com/hashicorp/design-system/pull/1749#discussion_r1374288785
|
|
125
|
-
if (this.args.highlightLines) {
|
|
126
|
-
setTimeout(() => {
|
|
127
|
-
// we piggy-back on the plugin's `resize` event listener to trigger a new call of the `highlightLines` function: https://github.com/PrismJS/prism/blob/master/plugins/line-highlight/prism-line-highlight.js#L337
|
|
128
|
-
if (window) window.dispatchEvent(new Event('resize'));
|
|
129
|
-
}, 100);
|
|
130
|
-
}
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
137
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
...attributes
|
|
8
8
|
aria-labelledby={{this.id}}
|
|
9
9
|
{{did-insert this.didInsert}}
|
|
10
|
+
{{will-destroy this.willDestroyNode}}
|
|
10
11
|
{{focus-trap isActive=this.isOpen focusTrapOptions=(hash onDeactivate=this.onDismiss clickOutsideDeactivates=true)}}
|
|
11
12
|
>
|
|
12
13
|
{{yield (hash Header=(component "hds/flyout/header" id=this.id onDismiss=this.onDismiss))}}
|
|
@@ -67,6 +67,14 @@ export default class HdsFlyoutIndexComponent extends Component {
|
|
|
67
67
|
return classes.join(' ');
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
@action registerOnCloseCallback() {
|
|
71
|
+
if (this.args.onClose && typeof this.args.onClose === 'function') {
|
|
72
|
+
this.args.onClose();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
this.isOpen = false;
|
|
76
|
+
}
|
|
77
|
+
|
|
70
78
|
@action
|
|
71
79
|
didInsert(element) {
|
|
72
80
|
// Store references of `<dialog>` and `<body>` elements
|
|
@@ -94,13 +102,7 @@ export default class HdsFlyoutIndexComponent extends Component {
|
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
// Register "onClose" callback function to be called when a native 'close' event is dispatched
|
|
97
|
-
this.element.addEventListener('close',
|
|
98
|
-
if (this.args.onClose && typeof this.args.onClose === 'function') {
|
|
99
|
-
this.args.onClose();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
this.isOpen = false;
|
|
103
|
-
});
|
|
105
|
+
this.element.addEventListener('close', this.registerOnCloseCallback, true);
|
|
104
106
|
|
|
105
107
|
// If the flyout dialog is not already open
|
|
106
108
|
if (!this.element.open) {
|
|
@@ -108,6 +110,17 @@ export default class HdsFlyoutIndexComponent extends Component {
|
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
@action
|
|
114
|
+
willDestroyNode() {
|
|
115
|
+
if (this.element) {
|
|
116
|
+
this.element.removeEventListener(
|
|
117
|
+
'close',
|
|
118
|
+
this.registerOnCloseCallback,
|
|
119
|
+
true
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
111
124
|
@action
|
|
112
125
|
open() {
|
|
113
126
|
// Make flyout dialog visible using the native `showModal` method
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
...attributes
|
|
8
8
|
aria-labelledby={{this.id}}
|
|
9
9
|
{{did-insert this.didInsert}}
|
|
10
|
+
{{will-destroy this.willDestroyNode}}
|
|
10
11
|
{{focus-trap isActive=this.isOpen focusTrapOptions=(hash onDeactivate=this.onDismiss clickOutsideDeactivates=true)}}
|
|
11
12
|
>
|
|
12
13
|
{{yield (hash Header=(component "hds/modal/header" id=this.id onDismiss=this.onDismiss))}}
|
|
@@ -93,6 +93,29 @@ export default class HdsModalIndexComponent extends Component {
|
|
|
93
93
|
return classes.join(' ');
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
@action registerOnCloseCallback() {
|
|
97
|
+
if (
|
|
98
|
+
!this.isDismissDisabled &&
|
|
99
|
+
this.args.onClose &&
|
|
100
|
+
typeof this.args.onClose === 'function'
|
|
101
|
+
) {
|
|
102
|
+
this.args.onClose();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// If the dismissal of the modal is disabled, we keep the modal open/visible otherwise we mark it as closed
|
|
106
|
+
if (this.isDismissDisabled) {
|
|
107
|
+
// If, in a chain of events, the element is not attached to the DOM, the `showModal` would fail
|
|
108
|
+
// so we add this safeguard condition that checks for the `<dialog>` to have a parent
|
|
109
|
+
if (this.element.parentElement) {
|
|
110
|
+
// As there is no way to `preventDefault` on `close` events, we call the `showModal` function
|
|
111
|
+
// preserving the state of the modal dialog
|
|
112
|
+
this.element.showModal();
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
this.isOpen = false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
96
119
|
@action
|
|
97
120
|
didInsert(element) {
|
|
98
121
|
// Store references of `<dialog>` and `<body>` elements
|
|
@@ -120,28 +143,7 @@ export default class HdsModalIndexComponent extends Component {
|
|
|
120
143
|
}
|
|
121
144
|
|
|
122
145
|
// Register "onClose" callback function to be called when a native 'close' event is dispatched
|
|
123
|
-
this.element.addEventListener('close',
|
|
124
|
-
if (
|
|
125
|
-
!this.isDismissDisabled &&
|
|
126
|
-
this.args.onClose &&
|
|
127
|
-
typeof this.args.onClose === 'function'
|
|
128
|
-
) {
|
|
129
|
-
this.args.onClose();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// If the dismissal of the modal is disabled, we keep the modal open/visible otherwise we mark it as closed
|
|
133
|
-
if (this.isDismissDisabled) {
|
|
134
|
-
// If, in a chain of events, the element is not attached to the DOM, the `showModal` would fail
|
|
135
|
-
// so we add this safeguard condition that checks for the `<dialog>` to have a parent
|
|
136
|
-
if (this.element.parentElement) {
|
|
137
|
-
// As there is no way to `preventDefault` on `close` events, we call the `showModal` function
|
|
138
|
-
// preserving the state of the modal dialog
|
|
139
|
-
this.element.showModal();
|
|
140
|
-
}
|
|
141
|
-
} else {
|
|
142
|
-
this.isOpen = false;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
146
|
+
this.element.addEventListener('close', this.registerOnCloseCallback, true);
|
|
145
147
|
|
|
146
148
|
// If the modal dialog is not already open
|
|
147
149
|
if (!this.element.open) {
|
|
@@ -149,6 +151,17 @@ export default class HdsModalIndexComponent extends Component {
|
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
153
|
|
|
154
|
+
@action
|
|
155
|
+
willDestroyNode() {
|
|
156
|
+
if (this.element) {
|
|
157
|
+
this.element.removeEventListener(
|
|
158
|
+
'close',
|
|
159
|
+
this.registerOnCloseCallback,
|
|
160
|
+
true
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
152
165
|
@action
|
|
153
166
|
open() {
|
|
154
167
|
// Make modal dialog visible using the native `showModal` method
|
|
@@ -10,7 +10,7 @@ import { assert } from '@ember/debug';
|
|
|
10
10
|
|
|
11
11
|
const DENSITIES = ['short', 'medium', 'tall'];
|
|
12
12
|
const DEFAULT_DENSITY = 'medium';
|
|
13
|
-
const VALIGNMENTS = ['top', 'middle'];
|
|
13
|
+
const VALIGNMENTS = ['top', 'middle', 'baseline'];
|
|
14
14
|
const DEFAULT_VALIGN = 'top';
|
|
15
15
|
|
|
16
16
|
export default class HdsTableIndexComponent extends Component {
|
|
@@ -116,7 +116,7 @@ export default class HdsTableIndexComponent extends Component {
|
|
|
116
116
|
* @param valign
|
|
117
117
|
* @type {string}
|
|
118
118
|
* @default 'top'
|
|
119
|
-
* @description Determines the vertical alignment of the table cells; options are: "top", "middle". If no valign is defined, "top" is used.
|
|
119
|
+
* @description Determines the vertical alignment of the table cells; options are: "top", "middle", "baseline". If no valign is defined, "top" is used.
|
|
120
120
|
*/
|
|
121
121
|
get valign() {
|
|
122
122
|
let { valign = DEFAULT_VALIGN } = this.args;
|
|
@@ -8,7 +8,7 @@ import { cached } from '@glimmer/tracking';
|
|
|
8
8
|
import { guidFor } from '@ember/object/internals';
|
|
9
9
|
import { action } from '@ember/object';
|
|
10
10
|
|
|
11
|
-
export default class
|
|
11
|
+
export default class HdsTabsPanelComponent extends Component {
|
|
12
12
|
/**
|
|
13
13
|
* Generate a unique ID for the Panel
|
|
14
14
|
* @return {string}
|
|
@@ -8,7 +8,7 @@ import { cached } from '@glimmer/tracking';
|
|
|
8
8
|
import { guidFor } from '@ember/object/internals';
|
|
9
9
|
import { action } from '@ember/object';
|
|
10
10
|
|
|
11
|
-
export default class
|
|
11
|
+
export default class HdsTabsTabComponent extends Component {
|
|
12
12
|
/**
|
|
13
13
|
* Generate a unique ID for the Tab
|
|
14
14
|
* @return {string}
|
|
@@ -14,7 +14,7 @@ $app-footer-icon-text-gap: 6px;
|
|
|
14
14
|
display: flex;
|
|
15
15
|
flex-wrap: wrap;
|
|
16
16
|
gap: $app-footer-gap;
|
|
17
|
-
justify-content:
|
|
17
|
+
justify-content: center;
|
|
18
18
|
padding: 24px;
|
|
19
19
|
color: var(--app-footer-foreground-color);
|
|
20
20
|
border-top: 1px solid var(--app-footer-border-top-color);
|
|
@@ -31,7 +31,7 @@ $app-footer-icon-text-gap: 6px;
|
|
|
31
31
|
flex-wrap: wrap;
|
|
32
32
|
gap: $app-footer-gap;
|
|
33
33
|
align-items: center;
|
|
34
|
-
justify-content:
|
|
34
|
+
justify-content: center;
|
|
35
35
|
width: fit-content;
|
|
36
36
|
min-width: 0;
|
|
37
37
|
margin: 0;
|
|
@@ -73,10 +73,6 @@
|
|
|
73
73
|
text-align: center;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
// SIZE
|
|
78
|
-
@include hds-button-size-classes("hds-button");
|
|
79
|
-
|
|
80
76
|
// COLORS & STATES
|
|
81
77
|
// Note: the order of the pseuo-selectors need to stay the way they are; it doesn't match the Figma file but it's the correct order for browsers to render the styles correctly.
|
|
82
78
|
|
|
@@ -96,6 +92,14 @@
|
|
|
96
92
|
@include hds-button-color-critical();
|
|
97
93
|
}
|
|
98
94
|
|
|
95
|
+
// SIZE
|
|
96
|
+
@include hds-button-size-classes("hds-button");
|
|
97
|
+
|
|
98
|
+
// ISINLINE
|
|
99
|
+
.hds-button--is-inline {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
}
|
|
102
|
+
|
|
99
103
|
|
|
100
104
|
// SPECIAL
|
|
101
105
|
|
|
@@ -131,7 +131,7 @@ $code-block-code-padding: 16px;
|
|
|
131
131
|
padding: $code-block-code-padding;
|
|
132
132
|
overflow: auto;
|
|
133
133
|
font-size: 0.8125rem;
|
|
134
|
-
font-family: var(--
|
|
134
|
+
font-family: var(--token-typography-code-200-font-family);
|
|
135
135
|
border-radius: inherit;
|
|
136
136
|
|
|
137
137
|
::selection {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
> .hds-dropdown,
|
|
15
15
|
> .hds-form-select,
|
|
16
16
|
> .hds-form-text-input {
|
|
17
|
-
&:first-child {
|
|
17
|
+
&:first-child:not(:only-child) {
|
|
18
18
|
border-top-right-radius: 0;
|
|
19
19
|
border-bottom-right-radius: 0;
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
&:last-child {
|
|
29
|
+
&:last-child:not(:only-child) {
|
|
30
30
|
margin-left: -1px;
|
|
31
31
|
border-top-left-radius: 0;
|
|
32
32
|
border-bottom-left-radius: 0;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
&:not(:first-child, :last-child) {
|
|
42
|
+
&:not(:first-child, :last-child, :only-child) {
|
|
43
43
|
margin-left: -1px;
|
|
44
44
|
border-radius: 0;
|
|
45
45
|
|
|
@@ -150,6 +150,10 @@ $hds-table-cell-padding-tall: 22px 16px 21px 16px; // the 1px difference is to a
|
|
|
150
150
|
.hds-table--valign-middle & {
|
|
151
151
|
vertical-align: middle;
|
|
152
152
|
}
|
|
153
|
+
|
|
154
|
+
.hds-table--valign-baseline & {
|
|
155
|
+
vertical-align: baseline;
|
|
156
|
+
}
|
|
153
157
|
}
|
|
154
158
|
|
|
155
159
|
// TABLE CELL TEXT ALIGNMENT (LEFT IS DEFAULT)
|
|
@@ -79,6 +79,8 @@
|
|
|
79
79
|
// prevent this container from potentially inheriting other values
|
|
80
80
|
// such as `white-space: nowrap` that would cause content overflow
|
|
81
81
|
white-space: normal;
|
|
82
|
+
// we want to have the text always aligned to the left (by design
|
|
83
|
+
text-align: left;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
// works with Tippy's custom SVG arrow variation:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/design-system-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "Helios Design System Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hashicorp",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@ember/string": "^3.1.1",
|
|
45
45
|
"@ember/test-waiters": "^3.1.0",
|
|
46
46
|
"@hashicorp/design-system-tokens": "^1.9.0",
|
|
47
|
-
"@hashicorp/ember-flight-icons": "^4.0.
|
|
47
|
+
"@hashicorp/ember-flight-icons": "^4.0.5",
|
|
48
48
|
"dialog-polyfill": "^0.5.6",
|
|
49
49
|
"ember-a11y-refocus": "^3.0.2",
|
|
50
50
|
"ember-auto-import": "^2.6.3",
|