@hashicorp/design-system-components 2.1.0 → 2.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 +48 -0
- package/HOW-TO-TEST-A-COMPONENT-IN-CLOUD-UI.md +28 -3
- package/addon/components/hds/app-frame/index.hbs +24 -0
- package/addon/components/hds/app-frame/index.js +52 -0
- package/addon/components/hds/app-frame/parts/footer.hbs +7 -0
- package/addon/components/hds/app-frame/parts/header.hbs +7 -0
- package/addon/components/hds/app-frame/parts/main.hbs +7 -0
- package/addon/components/hds/app-frame/parts/modals.hbs +6 -0
- package/addon/components/hds/app-frame/parts/sidebar.hbs +7 -0
- package/addon/components/hds/application-state/footer.js +5 -0
- package/addon/components/hds/dropdown/index.hbs +2 -2
- package/addon/components/hds/dropdown/index.js +18 -2
- package/addon/components/hds/flyout/footer.hbs +7 -0
- package/addon/components/hds/flyout/index.hbs +1 -0
- package/addon/components/hds/form/checkbox/field.hbs +0 -1
- package/addon/components/hds/form/field/index.hbs +3 -1
- package/addon/components/hds/form/radio/field.hbs +0 -1
- package/addon/components/hds/form/select/field.hbs +0 -1
- package/addon/components/hds/form/text-input/field.hbs +0 -1
- package/addon/components/hds/form/textarea/field.hbs +0 -1
- package/addon/components/hds/form/toggle/base.hbs +1 -1
- package/addon/components/hds/form/toggle/field.hbs +0 -2
- package/addon/components/hds/segmented-group/index.hbs +15 -0
- package/addon/components/hds/side-nav/base.hbs +14 -0
- package/addon/components/hds/side-nav/{home-link.js → header/home-link.js} +2 -2
- package/addon/components/hds/side-nav/{icon-button.js → header/icon-button.js} +2 -2
- package/addon/components/hds/side-nav/{header.hbs → header/index.hbs} +2 -2
- package/addon/components/hds/side-nav/index.hbs +40 -0
- package/addon/components/hds/side-nav/index.js +107 -0
- package/addon/components/hds/side-nav/list/index.hbs +2 -0
- package/addon/components/hds/side-nav/portal/index.hbs +12 -0
- package/addon/components/hds/side-nav/portal/target.hbs +14 -0
- package/addon/components/hds/side-nav/portal/target.js +153 -0
- package/addon/components/hds/tooltip-button/index.hbs +11 -0
- package/addon/components/hds/tooltip-button/index.js +86 -0
- package/addon/modifiers/hds-tooltip.js +164 -0
- package/app/components/hds/{side-nav/wrapper.js → app-frame/index.js} +1 -1
- package/app/components/hds/app-frame/parts/footer.js +6 -0
- package/app/components/hds/app-frame/parts/header.js +6 -0
- package/app/components/hds/{side-nav/icon-button.js → app-frame/parts/main.js} +1 -1
- package/app/components/hds/app-frame/parts/modals.js +6 -0
- package/app/components/hds/app-frame/parts/sidebar.js +6 -0
- package/app/components/hds/{side-nav/home-link.js → flyout/footer.js} +1 -1
- package/app/components/hds/segmented-group/index.js +6 -0
- package/app/components/hds/side-nav/base.js +6 -0
- package/app/components/hds/side-nav/header/home-link.js +6 -0
- package/app/components/hds/side-nav/header/icon-button.js +6 -0
- package/app/components/hds/side-nav/index.js +6 -0
- package/app/components/hds/side-nav/portal/index.js +6 -0
- package/app/components/hds/side-nav/portal/target.js +6 -0
- package/app/components/hds/tooltip-button/index.js +6 -0
- package/app/modifiers/hds-tooltip.js +6 -0
- package/app/styles/@hashicorp/design-system-components.scss +3 -0
- package/app/styles/@hashicorp/design-system-power-select-overrides.scss +32 -2
- package/app/styles/components/app-frame.scss +60 -0
- package/app/styles/components/dropdown.scss +11 -0
- package/app/styles/components/flyout.scss +15 -1
- package/app/styles/components/form/field.scss +4 -1
- package/app/styles/components/form/textarea.scss +1 -0
- package/app/styles/components/segmented-group.scss +59 -0
- package/app/styles/components/side-nav/a11y-refocus.scss +30 -0
- package/app/styles/components/side-nav/content.scss +159 -0
- package/app/styles/components/side-nav/header.scss +103 -0
- package/app/styles/components/side-nav/index.scss +10 -0
- package/app/styles/components/side-nav/main.scss +202 -0
- package/app/styles/components/side-nav/vars.scss +36 -0
- package/app/styles/components/tooltip.scss +84 -0
- package/package.json +7 -4
- package/addon/components/hds/form/toggle/base.js +0 -27
- package/addon/components/hds/side-nav/wrapper.hbs +0 -18
- package/app/styles/components/side-nav.scss +0 -275
- /package/addon/components/hds/side-nav/{home-link.hbs → header/home-link.hbs} +0 -0
- /package/addon/components/hds/side-nav/{icon-button.hbs → header/icon-button.hbs} +0 -0
- /package/app/components/hds/side-nav/{header.js → header/index.js} +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { inject as service } from '@ember/service';
|
|
8
|
+
import { tracked } from '@glimmer/tracking';
|
|
9
|
+
import { action } from '@ember/object';
|
|
10
|
+
import { DEBUG } from '@glimmer/env';
|
|
11
|
+
import Ember from 'ember';
|
|
12
|
+
import { debounce } from '@ember/runloop';
|
|
13
|
+
|
|
14
|
+
export default class SidenavPortalTarget extends Component {
|
|
15
|
+
@service router;
|
|
16
|
+
|
|
17
|
+
@tracked numSubnavs = 0;
|
|
18
|
+
|
|
19
|
+
static get prefersReducedMotionOverride() {
|
|
20
|
+
return Ember.testing;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
prefersReducedMotionMQ = window.matchMedia(
|
|
24
|
+
'(prefers-reduced-motion: reduce)'
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
get prefersReducedMotion() {
|
|
28
|
+
return (
|
|
29
|
+
this.constructor.prefersReducedMotionOverride ||
|
|
30
|
+
(this.prefersReducedMotionMQ && this.prefersReducedMotionMQ.matches)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@action
|
|
35
|
+
panelsChanged(portalCount) {
|
|
36
|
+
this.numSubnavs = portalCount;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@action
|
|
40
|
+
didUpdateSubnav(element, [count]) {
|
|
41
|
+
debounce(this, 'animateSubnav', element, [count], 100);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@action
|
|
45
|
+
animateSubnav(element, [count]) {
|
|
46
|
+
/*
|
|
47
|
+
* Here is what the layout looks like for this setup
|
|
48
|
+
*
|
|
49
|
+
|
|
50
|
+
SideNav
|
|
51
|
+
+----------------------+
|
|
52
|
+
| +------------------+ |
|
|
53
|
+
| | ("header") | |
|
|
54
|
+
| +------------------+ |
|
|
55
|
+
| |
|
|
56
|
+
| +------------------+ |
|
|
57
|
+
| | ("body") | |
|
|
58
|
+
(PortalTarget) | | | |
|
|
59
|
+
+----------------------------------------------+ | |
|
|
60
|
+
| +----------+ +----------+ | +----------+ | | |
|
|
61
|
+
| | (Portal) | | (Portal) | | (Portal) | | | |
|
|
62
|
+
| | | | | | | | | | |
|
|
63
|
+
| | hidden | | hidden | | *active* | | | |
|
|
64
|
+
| | panel | | panel | | | panel | | | |
|
|
65
|
+
| | | | | | | | | |
|
|
66
|
+
| | | | | | | | | | |
|
|
67
|
+
| | | | | | | | | |
|
|
68
|
+
| | | | | | | | | | |
|
|
69
|
+
| | | | | | | | | |
|
|
70
|
+
| | | | | | | | | | |
|
|
71
|
+
| | | | | | | | | |
|
|
72
|
+
| +----------+ +----------+ | +----------+ | | |
|
|
73
|
+
+----------------------------------------------+ | |
|
|
74
|
+
| | | |
|
|
75
|
+
| +------------------+ |
|
|
76
|
+
| |
|
|
77
|
+
| +------------------+ |
|
|
78
|
+
| | ("footer") | |
|
|
79
|
+
| +------------------+ |
|
|
80
|
+
+----------------------+
|
|
81
|
+
|
|
82
|
+
*
|
|
83
|
+
* every time `HcAppFrame::SideNav::Portal` renders, it contains a portaled "panel"
|
|
84
|
+
* that is rendered into the `hds-side-nav__content-panels` (inside the PortalTarget).
|
|
85
|
+
*
|
|
86
|
+
* Rendering or unrendering other `HcAppFrame::SideNav::Portal`s triggers the number of
|
|
87
|
+
* subnavs to change (via `numSubnavs`), so this function runs and slides
|
|
88
|
+
* `hds-side-nav__content-panels` left or right using the `element.animate` api.
|
|
89
|
+
*
|
|
90
|
+
* */
|
|
91
|
+
|
|
92
|
+
let activeIndex = count - 1;
|
|
93
|
+
let targetElement = element;
|
|
94
|
+
let { prefersReducedMotion } = this;
|
|
95
|
+
|
|
96
|
+
let styles = getComputedStyle(targetElement);
|
|
97
|
+
let columnWidth = styles.getPropertyValue(
|
|
98
|
+
'--hds-app-sidenav-width-expanded'
|
|
99
|
+
);
|
|
100
|
+
let slideDuration = prefersReducedMotion ? 0 : 150;
|
|
101
|
+
let fadeDuration = prefersReducedMotion ? 0 : 175;
|
|
102
|
+
let fadeDelay = prefersReducedMotion ? 0 : 50;
|
|
103
|
+
|
|
104
|
+
// slide entire parent panel
|
|
105
|
+
let start = styles.transform;
|
|
106
|
+
let end = `translateX(-${activeIndex * parseInt(columnWidth, 10)}px)`;
|
|
107
|
+
let anim = targetElement.animate(
|
|
108
|
+
[{ transform: start }, { transform: end }],
|
|
109
|
+
{
|
|
110
|
+
duration: slideDuration,
|
|
111
|
+
easing: 'cubic-bezier(0.65, 0, 0.35, 1)',
|
|
112
|
+
fill: 'forwards',
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
anim.finished.then(() => {
|
|
117
|
+
// uncomment this if we need/want to scroll the element to the top
|
|
118
|
+
// targetElement.scrollIntoView(true);
|
|
119
|
+
if (activeIndex > 0) {
|
|
120
|
+
let allPrev = Array.from(targetElement.children).slice(0, activeIndex);
|
|
121
|
+
for (let ele of allPrev) {
|
|
122
|
+
ele.ariaHidden = 'true';
|
|
123
|
+
ele.style.setProperty('visibility', 'hidden');
|
|
124
|
+
ele.style.setProperty('opacity', '0');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Notice: we don't add the styles by default because it writes a `style` attribute to the element and it causes an additional re-render
|
|
128
|
+
if (DEBUG) {
|
|
129
|
+
// Check the visibility of the element before attempting to commitStyles.
|
|
130
|
+
if (targetElement.offsetParent !== null) {
|
|
131
|
+
anim.commitStyles();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// fade in next panel
|
|
137
|
+
let nextPanelEl = targetElement.children[activeIndex];
|
|
138
|
+
if (nextPanelEl) {
|
|
139
|
+
nextPanelEl.ariaHidden = 'false';
|
|
140
|
+
nextPanelEl.style.setProperty('visibility', 'visible');
|
|
141
|
+
// this eliminates a flicker if there's only 1 subnav rendering
|
|
142
|
+
if (activeIndex === 0) {
|
|
143
|
+
fadeDelay = 0;
|
|
144
|
+
fadeDuration = 0;
|
|
145
|
+
}
|
|
146
|
+
nextPanelEl.animate([{ opacity: '0' }, { opacity: '1' }], {
|
|
147
|
+
delay: fadeDelay,
|
|
148
|
+
duration: fadeDuration,
|
|
149
|
+
fill: 'forwards',
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import Component from '@glimmer/component';
|
|
7
|
+
import { assert } from '@ember/debug';
|
|
8
|
+
|
|
9
|
+
export const PLACEMENTS = [
|
|
10
|
+
'top',
|
|
11
|
+
'top-start',
|
|
12
|
+
'top-end',
|
|
13
|
+
'right',
|
|
14
|
+
'right-start',
|
|
15
|
+
'right-end',
|
|
16
|
+
'bottom',
|
|
17
|
+
'bottom-start',
|
|
18
|
+
'bottom-end',
|
|
19
|
+
'left',
|
|
20
|
+
'left-start',
|
|
21
|
+
'left-end',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export default class HdsTooltipIndexComponent extends Component {
|
|
25
|
+
/**
|
|
26
|
+
* @param text
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @description text content for tooltip
|
|
29
|
+
*/
|
|
30
|
+
get text() {
|
|
31
|
+
let { text } = this.args;
|
|
32
|
+
|
|
33
|
+
assert(
|
|
34
|
+
'@text for "Hds::TooltipButton" must have a valid value',
|
|
35
|
+
text !== undefined
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return text;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get options() {
|
|
42
|
+
let { placement } = this.args;
|
|
43
|
+
|
|
44
|
+
assert(
|
|
45
|
+
'@placement for "Hds::TooltipButton" must have a valid value',
|
|
46
|
+
placement == undefined || PLACEMENTS.includes(placement)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
...this.args.extraTippyOptions,
|
|
51
|
+
// takes string
|
|
52
|
+
placement: placement,
|
|
53
|
+
// takes array of 2 numbers (skidding, distance): array(0, 0)
|
|
54
|
+
offset: this.args.offset,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param isInline
|
|
60
|
+
* @type {boolean}
|
|
61
|
+
* @default true
|
|
62
|
+
* @description sets display for the button
|
|
63
|
+
*/
|
|
64
|
+
get isInline() {
|
|
65
|
+
let { isInline = true } = this.args;
|
|
66
|
+
return isInline;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Get the class names to apply to the component.
|
|
71
|
+
* @method classNames
|
|
72
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
73
|
+
*/
|
|
74
|
+
get classNames() {
|
|
75
|
+
let classes = ['hds-tooltip-button'];
|
|
76
|
+
|
|
77
|
+
// add a class based on the @isInline argument
|
|
78
|
+
if (this.isInline) {
|
|
79
|
+
classes.push('hds-tooltip-button--is-inline');
|
|
80
|
+
} else {
|
|
81
|
+
classes.push('hds-tooltip-button--is-block');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return classes.join(' ');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Note: the majority of this code is a porting of the existing tooltip implementation in Cloud UI
|
|
7
|
+
// (which was initially implemented in Structure)
|
|
8
|
+
|
|
9
|
+
import Modifier from 'ember-modifier';
|
|
10
|
+
import { assert } from '@ember/debug';
|
|
11
|
+
import { registerDestructor } from '@ember/destroyable';
|
|
12
|
+
|
|
13
|
+
import tippy, { followCursor } from 'tippy.js';
|
|
14
|
+
// used by custom SVG arrow:
|
|
15
|
+
import 'tippy.js/dist/svg-arrow.css';
|
|
16
|
+
|
|
17
|
+
function cleanup(instance) {
|
|
18
|
+
const { interval, needsTabIndex, tooltip } = instance;
|
|
19
|
+
if (needsTabIndex) {
|
|
20
|
+
tooltip?.reference?.removeAttribute('tabindex');
|
|
21
|
+
}
|
|
22
|
+
clearInterval(interval);
|
|
23
|
+
tooltip?.destroy();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* `Tooltip` implements a modifier that uses Tippy.js to display a tooltip.
|
|
29
|
+
*
|
|
30
|
+
* Sample usage:
|
|
31
|
+
* ```
|
|
32
|
+
* <div {{hds-tooltip 'Text' options=(hash )}}>Hover me!</div>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see https://atomiks.github.io/tippyjs
|
|
36
|
+
* @class TooltipModifier
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
export default class HdsTooltipModifier extends Modifier {
|
|
40
|
+
didSetup = false;
|
|
41
|
+
|
|
42
|
+
interval = null;
|
|
43
|
+
needsTabIndex = false;
|
|
44
|
+
tooltip = null;
|
|
45
|
+
|
|
46
|
+
constructor(owner, args) {
|
|
47
|
+
super(owner, args);
|
|
48
|
+
registerDestructor(this, cleanup);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
hideOnEsc = {
|
|
52
|
+
name: 'hideOnEsc',
|
|
53
|
+
defaultValue: true,
|
|
54
|
+
fn({ hide }) {
|
|
55
|
+
function onKeyDown(event) {
|
|
56
|
+
if (event.keyCode === 27) {
|
|
57
|
+
hide();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
onShow() {
|
|
63
|
+
document.addEventListener('keydown', onKeyDown);
|
|
64
|
+
},
|
|
65
|
+
onHide() {
|
|
66
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
modify(element, positional, named) {
|
|
73
|
+
assert('Tooltip must have an element', element);
|
|
74
|
+
|
|
75
|
+
if (!this.didSetup) {
|
|
76
|
+
this.#setup(element, positional, named);
|
|
77
|
+
this.didSetup = true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
this.#update(element, positional, named);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
#setup(element, positional, named) {
|
|
84
|
+
const tooltipProps = this.#getTooltipProps(element, positional, named);
|
|
85
|
+
this.tooltip = tippy(element, tooltipProps);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#update(element, positional, named) {
|
|
89
|
+
const tooltipProps = this.#getTooltipProps(element, positional, named);
|
|
90
|
+
this.tooltip.setProps(tooltipProps);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#getTooltipProps(element, positional, named) {
|
|
94
|
+
const { options = {} } = named;
|
|
95
|
+
let [content] = positional;
|
|
96
|
+
|
|
97
|
+
let $anchor = element;
|
|
98
|
+
|
|
99
|
+
// Make it easy to specify the modified element as the actual tooltip.
|
|
100
|
+
if (typeof options.triggerTarget === 'string') {
|
|
101
|
+
const $el = $anchor;
|
|
102
|
+
switch (options.triggerTarget) {
|
|
103
|
+
case 'parentNode':
|
|
104
|
+
$anchor = $anchor.parentNode;
|
|
105
|
+
break;
|
|
106
|
+
default:
|
|
107
|
+
$anchor = $anchor.querySelectorAll(options.triggerTarget);
|
|
108
|
+
}
|
|
109
|
+
content = $anchor.cloneNode(true);
|
|
110
|
+
$el.remove();
|
|
111
|
+
options.triggerTarget = undefined;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// The {{hds-tooltip}} will just use the HTML content.
|
|
115
|
+
if (typeof content === 'undefined') {
|
|
116
|
+
content = $anchor.innerHTML;
|
|
117
|
+
$anchor.innerHTML = '';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (options.trigger === 'manual') {
|
|
121
|
+
// If we are manually triggering, a out delay means only show for the
|
|
122
|
+
// amount of time specified by the delay.
|
|
123
|
+
const delay = options.delay || [];
|
|
124
|
+
|
|
125
|
+
if (typeof delay[1] !== 'undefined') {
|
|
126
|
+
options.onShown = (tooltip) => {
|
|
127
|
+
clearInterval(this.interval);
|
|
128
|
+
this.interval = setTimeout(() => {
|
|
129
|
+
tooltip.hide();
|
|
130
|
+
}, delay[1]);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const $trigger = $anchor;
|
|
136
|
+
|
|
137
|
+
if (!$trigger.hasAttribute('tabindex')) {
|
|
138
|
+
this.needsTabIndex = true;
|
|
139
|
+
$trigger.setAttribute('tabindex', '0');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
theme: 'hds',
|
|
144
|
+
triggerTarget: $trigger,
|
|
145
|
+
arrow: `
|
|
146
|
+
<svg class="hds-tooltip-pointer" width="16" height="7" viewBox="0 0 16 7" xmlns="http://www.w3.org/2000/svg">
|
|
147
|
+
<path d="M0 7H16L9.11989 0.444571C8.49776 -0.148191 7.50224 -0.148191 6.88011 0.444572L0 7Z" />
|
|
148
|
+
</svg>`,
|
|
149
|
+
// keeps tooltip itself open on hover:
|
|
150
|
+
interactive: true,
|
|
151
|
+
// fix accessibility features that get messed up with setting interactive: true
|
|
152
|
+
aria: {
|
|
153
|
+
content: 'describedby',
|
|
154
|
+
expanded: null,
|
|
155
|
+
},
|
|
156
|
+
content: () => content,
|
|
157
|
+
plugins: [
|
|
158
|
+
typeof options.followCursor !== 'undefined' ? followCursor : undefined,
|
|
159
|
+
this.hideOnEsc,
|
|
160
|
+
].filter((item) => Boolean(item)),
|
|
161
|
+
...options,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// Notice: this list can be automatically edited by the Ember blueprint, please don't remove the start/end comments
|
|
14
14
|
// START COMPONENTS CSS FILES IMPORTS
|
|
15
15
|
@use "../components/alert";
|
|
16
|
+
@use "../components/app-frame";
|
|
16
17
|
@use "../components/application-state";
|
|
17
18
|
@use "../components/avatar";
|
|
18
19
|
@use "../components/badge";
|
|
@@ -30,12 +31,14 @@
|
|
|
30
31
|
@use "../components/link"; // multiple components
|
|
31
32
|
@use "../components/modal";
|
|
32
33
|
@use "../components/pagination";
|
|
34
|
+
@use "../components/segmented-group";
|
|
33
35
|
@use "../components/side-nav";
|
|
34
36
|
@use "../components/stepper";
|
|
35
37
|
@use "../components/table";
|
|
36
38
|
@use "../components/tabs";
|
|
37
39
|
@use "../components/tag";
|
|
38
40
|
@use "../components/toast";
|
|
41
|
+
@use "../components/tooltip";
|
|
39
42
|
// END COMPONENT CSS FILES IMPORTS
|
|
40
43
|
|
|
41
44
|
// stylelint-disable-next-line selector-class-pattern
|
|
@@ -193,6 +193,17 @@
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
+
.ember-power-select-option--no-matches-message {
|
|
197
|
+
padding: 8px;
|
|
198
|
+
|
|
199
|
+
&:hover {
|
|
200
|
+
color: inherit;
|
|
201
|
+
background-color: inherit;
|
|
202
|
+
border-color: transparent;
|
|
203
|
+
cursor: default;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
196
207
|
.ember-power-select-multiple-trigger {
|
|
197
208
|
padding-top: calc(var(--token-form-control-padding) - 3px);
|
|
198
209
|
padding-bottom: calc(var(--token-form-control-padding) - 3px);
|
|
@@ -203,7 +214,6 @@
|
|
|
203
214
|
.ember-power-select-multiple-option {
|
|
204
215
|
display: inline-flex;
|
|
205
216
|
align-items: stretch;
|
|
206
|
-
float: none;
|
|
207
217
|
margin: 4px 4px 4px 0;
|
|
208
218
|
padding: 3px 10px 5px 10px;
|
|
209
219
|
color: var(--token-color-foreground-primary);
|
|
@@ -212,7 +222,7 @@
|
|
|
212
222
|
font-family: var(--token-typography-font-stack-text);
|
|
213
223
|
line-height: 1rem; // 16px
|
|
214
224
|
vertical-align: middle;
|
|
215
|
-
background-color:
|
|
225
|
+
background-color: inherit;
|
|
216
226
|
border: 1px solid var(--token-color-border-strong);
|
|
217
227
|
border-radius: 50px;
|
|
218
228
|
}
|
|
@@ -232,6 +242,26 @@
|
|
|
232
242
|
}
|
|
233
243
|
}
|
|
234
244
|
|
|
245
|
+
.ember-power-select-trigger-multiple-input {
|
|
246
|
+
margin: 4px 4px 4px 0;
|
|
247
|
+
|
|
248
|
+
&:disabled {
|
|
249
|
+
display: none;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&::-webkit-search-cancel-button {
|
|
253
|
+
width: var(--token-form-text-input-background-image-size);
|
|
254
|
+
height: var(--token-form-text-input-background-image-size);
|
|
255
|
+
background-image: var(--token-form-text-input-background-image-data-url-search-cancel);
|
|
256
|
+
background-position: center center;
|
|
257
|
+
background-size: var(--token-form-text-input-background-image-size);
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
// stylelint-disable-next-line property-no-vendor-prefix
|
|
260
|
+
-webkit-appearance: none;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
|
|
235
265
|
.hds-power-select__after-options {
|
|
236
266
|
padding: 8px;
|
|
237
267
|
color: var(--token-color-foreground-primary);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
//
|
|
7
|
+
// APP-FRAME
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
.hds-app-frame {
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-areas:
|
|
13
|
+
"header header"
|
|
14
|
+
"sidebar main"
|
|
15
|
+
"sidebar footer";
|
|
16
|
+
grid-template-rows: auto 1fr auto;
|
|
17
|
+
grid-template-columns: auto 1fr;
|
|
18
|
+
min-height: 100vh;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
// FRAME'S CONTAINERS
|
|
23
|
+
|
|
24
|
+
.hds-app-frame__header {
|
|
25
|
+
z-index: 7;
|
|
26
|
+
grid-area: header;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.hds-app-frame__sidebar {
|
|
30
|
+
z-index: 6;
|
|
31
|
+
grid-area: sidebar;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.hds-app-frame__main {
|
|
35
|
+
grid-area: main;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.hds-app-frame__footer {
|
|
39
|
+
z-index: 5;
|
|
40
|
+
grid-area: footer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
// MODALS "CONTAINER"
|
|
45
|
+
|
|
46
|
+
.hds-app-frame__modals {
|
|
47
|
+
position: fixed;
|
|
48
|
+
top: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
z-index: 100;
|
|
51
|
+
width: 100vw;
|
|
52
|
+
height: 100vh;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
|
|
55
|
+
// since the content is injected via DOM manipulation, there's no issues of whitespace generated by Ember
|
|
56
|
+
// that make this approach unreliable (in some cases), so we can safely use it to controls its display
|
|
57
|
+
&:empty {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
}
|