@crowdstrike/glide-core 0.29.1 → 0.30.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/dist/accordion.js +240 -1
- package/dist/accordion.styles.js +13 -7
- package/dist/button-group.button.js +143 -1
- package/dist/button-group.button.styles.js +43 -15
- package/dist/button-group.js +249 -1
- package/dist/button-group.styles.js +10 -5
- package/dist/button.js +206 -1
- package/dist/button.styles.js +12 -7
- package/dist/checkbox-group.js +479 -14
- package/dist/checkbox-group.styles.js +5 -2
- package/dist/checkbox.js +519 -32
- package/dist/checkbox.styles.js +10 -5
- package/dist/drawer.js +168 -1
- package/dist/drawer.styles.js +5 -2
- package/dist/dropdown.js +2423 -123
- package/dist/dropdown.option.js +536 -1
- package/dist/dropdown.option.styles.js +5 -2
- package/dist/dropdown.styles.js +14 -7
- package/dist/form-controls-layout.js +102 -1
- package/dist/form-controls-layout.styles.js +5 -2
- package/dist/icon-button.js +139 -1
- package/dist/icon-button.styles.js +19 -7
- package/dist/icons/checked.js +28 -1
- package/dist/icons/chevron.js +21 -1
- package/dist/icons/magnifying-glass.js +23 -1
- package/dist/icons/pencil.js +21 -1
- package/dist/icons/severity-critical.js +20 -1
- package/dist/icons/severity-informational.js +20 -1
- package/dist/icons/severity-medium.js +20 -1
- package/dist/icons/x.js +21 -1
- package/dist/inline-alert.js +118 -1
- package/dist/inline-alert.styles.js +5 -2
- package/dist/input.d.ts +8 -2
- package/dist/input.js +505 -41
- package/dist/input.styles.js +25 -4
- package/dist/label.js +303 -1
- package/dist/label.styles.js +11 -5
- package/dist/library/assert-slot.js +136 -1
- package/dist/library/expect-unhandled-rejection.js +14 -1
- package/dist/library/expect-window-error.js +26 -1
- package/dist/library/final.js +18 -1
- package/dist/library/form-control.js +1 -1
- package/dist/library/localize.js +10 -1
- package/dist/library/mouse.js +35 -1
- package/dist/library/on-resize.js +24 -1
- package/dist/library/required.js +35 -1
- package/dist/library/shadow-root-mode.js +4 -1
- package/dist/library/unique-id.js +3 -1
- package/dist/link.js +92 -1
- package/dist/link.styles.js +10 -5
- package/dist/menu.d.ts +3 -2
- package/dist/menu.js +1259 -1
- package/dist/menu.styles.js +34 -17
- package/dist/modal.d.ts +4 -0
- package/dist/modal.icon-button.js +60 -1
- package/dist/modal.icon-button.styles.js +5 -2
- package/dist/modal.js +473 -1
- package/dist/modal.styles.js +71 -22
- package/dist/option.d.ts +74 -0
- package/dist/option.js +498 -0
- package/dist/option.styles.js +140 -0
- package/dist/{menu.options.d.ts → options.d.ts} +5 -6
- package/dist/options.js +130 -0
- package/dist/options.styles.js +21 -0
- package/dist/popover.js +620 -1
- package/dist/popover.styles.js +11 -5
- package/dist/radio-group.js +624 -17
- package/dist/radio-group.radio.js +211 -1
- package/dist/radio-group.radio.styles.js +9 -4
- package/dist/radio-group.styles.js +5 -2
- package/dist/slider.js +1040 -61
- package/dist/slider.styles.js +9 -4
- package/dist/spinner.js +60 -1
- package/dist/spinner.styles.js +5 -2
- package/dist/split-button.js +116 -1
- package/dist/split-button.primary-button.js +100 -1
- package/dist/split-button.primary-button.styles.js +13 -6
- package/dist/split-button.primary-link.js +102 -1
- package/dist/split-button.secondary-button.d.ts +2 -3
- package/dist/split-button.secondary-button.js +121 -1
- package/dist/split-button.secondary-button.styles.js +12 -7
- package/dist/split-button.styles.js +9 -4
- package/dist/styles/focus-outline.js +9 -3
- package/dist/styles/fonts.css +6 -1
- package/dist/styles/opacity-and-scale-animation.js +6 -3
- package/dist/styles/skeleton.js +6 -3
- package/dist/styles/variables.css +410 -1
- package/dist/styles/visually-hidden.js +6 -3
- package/dist/tab.group.js +386 -1
- package/dist/tab.group.styles.js +5 -2
- package/dist/tab.js +133 -1
- package/dist/tab.panel.js +93 -1
- package/dist/tab.panel.styles.js +11 -5
- package/dist/tab.styles.js +9 -4
- package/dist/tag.js +207 -1
- package/dist/tag.styles.js +10 -5
- package/dist/textarea.js +353 -19
- package/dist/textarea.styles.js +23 -4
- package/dist/toast.js +130 -1
- package/dist/toast.toasts.js +248 -25
- package/dist/toast.toasts.styles.js +9 -4
- package/dist/toggle.js +178 -1
- package/dist/toggle.styles.js +25 -5
- package/dist/tooltip.container.d.ts +2 -0
- package/dist/tooltip.container.js +130 -1
- package/dist/tooltip.container.styles.js +18 -4
- package/dist/tooltip.d.ts +6 -0
- package/dist/tooltip.js +484 -1
- package/dist/tooltip.styles.js +21 -5
- package/dist/translations/en.js +36 -1
- package/dist/translations/fr.js +37 -1
- package/dist/translations/ja.js +37 -1
- package/package.json +8 -12
- package/dist/menu.button.d.ts +0 -42
- package/dist/menu.button.js +0 -1
- package/dist/menu.button.styles.js +0 -32
- package/dist/menu.link.d.ts +0 -44
- package/dist/menu.link.js +0 -1
- package/dist/menu.link.styles.js +0 -35
- package/dist/menu.options.js +0 -1
- package/dist/menu.options.styles.d.ts +0 -2
- package/dist/menu.options.styles.js +0 -20
- /package/dist/{menu.button.styles.d.ts → option.styles.d.ts} +0 -0
- /package/dist/{menu.link.styles.d.ts → options.styles.d.ts} +0 -0
@@ -1 +1,130 @@
|
|
1
|
-
var __decorate
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
import { html, LitElement } from 'lit';
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
10
|
+
import { map } from 'lit/directives/map.js';
|
11
|
+
import { when } from 'lit/directives/when.js';
|
12
|
+
import styles from './tooltip.container.styles.js';
|
13
|
+
import shadowRootMode from './library/shadow-root-mode.js';
|
14
|
+
import final from './library/final.js';
|
15
|
+
import uniqueId from './library/unique-id.js';
|
16
|
+
// This component exists because Tooltip's target and its tooltip both need to
|
17
|
+
// be in the light DOM so the `aria-describedby` on its target can be associated
|
18
|
+
// with the ID it references. Tooltip adds this element to its light DOM and then
|
19
|
+
// associates it with its target.
|
20
|
+
//
|
21
|
+
// One alternative solution is to ask consumers to add this component to Tooltip's
|
22
|
+
// default slot. But that would be additional work for them and would be a less
|
23
|
+
// natural API because consumers would pass `label`, `shortcut`, and other
|
24
|
+
// attributes to Tooltip Container instead of Tooltip.
|
25
|
+
//
|
26
|
+
// Another is to require that consumers always wrap their default slot content
|
27
|
+
// in an element, such as `<div>`. But an apparently stray `<div>` in our Storybook
|
28
|
+
// code example would beget questions or may be removed by the consumer after
|
29
|
+
// copying the code, resulting in an error from Tooltip and frustration.
|
30
|
+
//
|
31
|
+
// The latter solution would also prevent us from restricting allowed content by
|
32
|
+
// using an attribute (`label`). We'd be forced to allow arbitrary content via a
|
33
|
+
// slot.
|
34
|
+
/**
|
35
|
+
* @attr {string} [description]
|
36
|
+
* @attr {boolean} [disabled=false]
|
37
|
+
* @attr {string} [label]
|
38
|
+
* @attr {'bottom'|'left'|'right'|'top'} [placement]
|
39
|
+
* @attr {boolean} [screenreader-hidden=false]
|
40
|
+
* @attr {string[]} [shortcut=[]]
|
41
|
+
*/
|
42
|
+
let TooltipContainer = class TooltipContainer extends LitElement {
|
43
|
+
constructor() {
|
44
|
+
super(...arguments);
|
45
|
+
this.screenreaderHidden = false;
|
46
|
+
this.shortcut = [];
|
47
|
+
this.#isDisabled = false;
|
48
|
+
}
|
49
|
+
static { this.shadowRootOptions = {
|
50
|
+
...LitElement.shadowRootOptions,
|
51
|
+
mode: shadowRootMode,
|
52
|
+
}; }
|
53
|
+
static { this.styles = styles; }
|
54
|
+
/**
|
55
|
+
* @default false
|
56
|
+
*/
|
57
|
+
get disabled() {
|
58
|
+
return this.#isDisabled;
|
59
|
+
}
|
60
|
+
set disabled(isDisabled) {
|
61
|
+
this.#isDisabled = isDisabled;
|
62
|
+
this.role = isDisabled || this.screenreaderHidden ? 'none' : 'tooltip';
|
63
|
+
}
|
64
|
+
connectedCallback() {
|
65
|
+
super.connectedCallback();
|
66
|
+
this.id = uniqueId();
|
67
|
+
this.role = this.role =
|
68
|
+
this.disabled || this.screenreaderHidden ? 'none' : 'tooltip';
|
69
|
+
this.slot = 'private';
|
70
|
+
}
|
71
|
+
render() {
|
72
|
+
return html `
|
73
|
+
<div
|
74
|
+
aria-hidden=${this.screenreaderHidden}
|
75
|
+
class=${classMap({
|
76
|
+
component: true,
|
77
|
+
})}
|
78
|
+
>
|
79
|
+
<div class="label-and-shortcut">
|
80
|
+
<div class="label">${this.label}</div>
|
81
|
+
|
82
|
+
<kbd
|
83
|
+
class=${classMap({
|
84
|
+
shortcut: true,
|
85
|
+
visible: this.shortcut.length > 0,
|
86
|
+
})}
|
87
|
+
data-test="shortcut"
|
88
|
+
>
|
89
|
+
${this.shortcut.length === 1
|
90
|
+
? this.shortcut.at(0)
|
91
|
+
: map(this.shortcut, (shortcut, index) => {
|
92
|
+
return html `
|
93
|
+
<kbd>${shortcut}</kbd>
|
94
|
+
${index === this.shortcut.length - 1 ? '' : ' + '}
|
95
|
+
`;
|
96
|
+
})}
|
97
|
+
</kbd>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
${when(this.description, () => {
|
101
|
+
return html `<div class="description">${this.description}</div>`;
|
102
|
+
})}
|
103
|
+
</div>
|
104
|
+
`;
|
105
|
+
}
|
106
|
+
#isDisabled;
|
107
|
+
};
|
108
|
+
__decorate([
|
109
|
+
property({ reflect: true })
|
110
|
+
], TooltipContainer.prototype, "description", void 0);
|
111
|
+
__decorate([
|
112
|
+
property({ type: Boolean })
|
113
|
+
], TooltipContainer.prototype, "disabled", null);
|
114
|
+
__decorate([
|
115
|
+
property()
|
116
|
+
], TooltipContainer.prototype, "label", void 0);
|
117
|
+
__decorate([
|
118
|
+
property()
|
119
|
+
], TooltipContainer.prototype, "placement", void 0);
|
120
|
+
__decorate([
|
121
|
+
property({ attribute: 'screenreader-hidden', type: Boolean })
|
122
|
+
], TooltipContainer.prototype, "screenreaderHidden", void 0);
|
123
|
+
__decorate([
|
124
|
+
property({ type: Array })
|
125
|
+
], TooltipContainer.prototype, "shortcut", void 0);
|
126
|
+
TooltipContainer = __decorate([
|
127
|
+
customElement('glide-core-private-tooltip-container'),
|
128
|
+
final
|
129
|
+
], TooltipContainer);
|
130
|
+
export default TooltipContainer;
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import{css}from
|
1
|
+
import { css } from 'lit';
|
2
|
+
export default [
|
3
|
+
css `
|
2
4
|
.component {
|
3
5
|
background-color: var(
|
4
6
|
--glide-core-private-color-tooltip-surface-container
|
5
7
|
);
|
6
8
|
border-radius: var(--glide-core-spacing-base-xs);
|
7
|
-
display: flex;
|
8
9
|
font-family: var(--glide-core-typography-family-primary);
|
9
10
|
font-size: var(--glide-core-typography-size-body-default);
|
10
11
|
font-weight: var(--glide-core-typography-weight-regular);
|
@@ -14,15 +15,27 @@ import{css}from"lit";export default[css`
|
|
14
15
|
var(--glide-core-spacing-base-xs);
|
15
16
|
}
|
16
17
|
|
18
|
+
.label-and-shortcut {
|
19
|
+
display: flex;
|
20
|
+
}
|
21
|
+
|
17
22
|
.label {
|
18
23
|
color: var(--glide-core-color-static-text-onsolid);
|
19
|
-
display: block;
|
20
24
|
hyphens: auto;
|
21
25
|
max-inline-size: 11.25rem;
|
22
26
|
min-inline-size: 1.875rem;
|
23
27
|
overflow-wrap: anywhere;
|
24
28
|
}
|
25
29
|
|
30
|
+
.description {
|
31
|
+
color: var(--glide-core-color-static-text-onsolid);
|
32
|
+
hyphens: auto;
|
33
|
+
margin-block-start: var(--glide-core-spacing-base-xs);
|
34
|
+
max-inline-size: 11.25rem;
|
35
|
+
min-inline-size: 1.875rem;
|
36
|
+
overflow-wrap: anywhere;
|
37
|
+
}
|
38
|
+
|
26
39
|
.shortcut {
|
27
40
|
color: var(--glide-core-private-color-tooltip-text-shortcut);
|
28
41
|
display: none;
|
@@ -37,4 +50,5 @@ import{css}from"lit";export default[css`
|
|
37
50
|
kbd {
|
38
51
|
font-family: var(--glide-core-typography-family-primary);
|
39
52
|
}
|
40
|
-
|
53
|
+
`,
|
54
|
+
];
|
package/dist/tooltip.d.ts
CHANGED
@@ -7,6 +7,7 @@ declare global {
|
|
7
7
|
}
|
8
8
|
/**
|
9
9
|
* @attr {string} label
|
10
|
+
* @attr {string} [description]
|
10
11
|
* @attr {boolean} [disabled=false]
|
11
12
|
* @attr {number} [offset=4]
|
12
13
|
* @attr {boolean} [open=false]
|
@@ -31,6 +32,11 @@ export default class Tooltip extends LitElement {
|
|
31
32
|
*/
|
32
33
|
get label(): string | undefined;
|
33
34
|
set label(label: string);
|
35
|
+
/**
|
36
|
+
* @default undefined
|
37
|
+
*/
|
38
|
+
get description(): string | undefined;
|
39
|
+
set description(description: string);
|
34
40
|
/**
|
35
41
|
* @default false
|
36
42
|
*/
|