@crowdstrike/glide-core 0.29.2 → 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.js +130 -1
- package/dist/tooltip.container.styles.js +5 -2
- 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,24 @@
|
|
1
|
-
import{LitElement,
|
1
|
+
import { LitElement, noChange } from 'lit';
|
2
|
+
import { Directive, directive } from 'lit/directive.js';
|
3
|
+
class OnResize extends Directive {
|
4
|
+
render(
|
5
|
+
// This method is required, both by `Directive` and so the directive's
|
6
|
+
// options are typed at `onResize()` callsite.
|
7
|
+
//
|
8
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
9
|
+
callback, options) {
|
10
|
+
return noChange;
|
11
|
+
}
|
12
|
+
update(part, [callback, options]) {
|
13
|
+
if (part.options?.host instanceof LitElement &&
|
14
|
+
!part.options.host.hasUpdated) {
|
15
|
+
this.#observer = new ResizeObserver(callback);
|
16
|
+
this.#observer.observe(part.element, options);
|
17
|
+
}
|
18
|
+
// Purely for test coverage purposes. If `update()` doesn't call `render()`,
|
19
|
+
// nothing will because `update()` exists.
|
20
|
+
return this.render(callback, options);
|
21
|
+
}
|
22
|
+
#observer;
|
23
|
+
}
|
24
|
+
export default directive(OnResize);
|
package/dist/library/required.js
CHANGED
@@ -1 +1,35 @@
|
|
1
|
-
import{ReactiveElement
|
1
|
+
import { ReactiveElement, } from 'lit';
|
2
|
+
const isThrow = ['localhost', '127.0.0.1'].some((host) => {
|
3
|
+
return window.location.host.includes(host);
|
4
|
+
});
|
5
|
+
class RequiredController {
|
6
|
+
hostUpdate() {
|
7
|
+
const isNullOrUndefined =
|
8
|
+
// @ts-expect-error `ReactiveControllerHost` doesn't have an index type.
|
9
|
+
this.#host[this.#key] === undefined || this.#host[this.#key] === null;
|
10
|
+
if (isNullOrUndefined && isThrow) {
|
11
|
+
// We throw in `hostUpdate()` instead of `hostUpdated()`, which is called
|
12
|
+
// after render, so it's obvious something has gone wrong. Sometimes a log
|
13
|
+
// gets lost in the noise. A component that has failed to render has a better
|
14
|
+
// chance of catching developers' attention.
|
15
|
+
throw new TypeError(`Expected ${this.#name} to have a \`${this.#key}\` property.`);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
constructor(host, key, name) {
|
19
|
+
host.addController(this);
|
20
|
+
this.#host = host;
|
21
|
+
this.#key = key;
|
22
|
+
this.#name = name;
|
23
|
+
}
|
24
|
+
#host;
|
25
|
+
#key;
|
26
|
+
#name;
|
27
|
+
}
|
28
|
+
export default function (prototype, key) {
|
29
|
+
if (Object.prototype.isPrototypeOf.call(ReactiveElement, prototype.constructor)) {
|
30
|
+
const constructor = prototype.constructor;
|
31
|
+
constructor.addInitializer((instance) => {
|
32
|
+
new RequiredController(instance, key, prototype.constructor.name);
|
33
|
+
});
|
34
|
+
}
|
35
|
+
}
|
package/dist/link.js
CHANGED
@@ -1 +1,92 @@
|
|
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 { classMap } from 'lit/directives/class-map.js';
|
9
|
+
import { customElement, property } from 'lit/decorators.js';
|
10
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
11
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
12
|
+
import packageJson from '../package.json' with { type: 'json' };
|
13
|
+
import styles from './link.styles.js';
|
14
|
+
import shadowRootMode from './library/shadow-root-mode.js';
|
15
|
+
import final from './library/final.js';
|
16
|
+
import required from './library/required.js';
|
17
|
+
/**
|
18
|
+
* @attr {string} label
|
19
|
+
* @attr {boolean} [disabled=false]
|
20
|
+
* @attr {string} [download]
|
21
|
+
* @attr {string} [href]
|
22
|
+
* @attr {'_blank'|'_parent'|'_self'|'_top'} [target]
|
23
|
+
*
|
24
|
+
* @readonly
|
25
|
+
* @attr {string} [version]
|
26
|
+
*/
|
27
|
+
let Link = class Link extends LitElement {
|
28
|
+
constructor() {
|
29
|
+
super(...arguments);
|
30
|
+
this.disabled = false;
|
31
|
+
this.version = packageJson.version;
|
32
|
+
this.#componentElementRef = createRef();
|
33
|
+
}
|
34
|
+
static { this.shadowRootOptions = {
|
35
|
+
...LitElement.shadowRootOptions,
|
36
|
+
delegatesFocus: true,
|
37
|
+
mode: shadowRootMode,
|
38
|
+
}; }
|
39
|
+
static { this.styles = styles; }
|
40
|
+
click() {
|
41
|
+
this.#componentElementRef.value?.click();
|
42
|
+
}
|
43
|
+
render() {
|
44
|
+
return html `<a
|
45
|
+
aria-disabled=${this.disabled}
|
46
|
+
class=${classMap({
|
47
|
+
component: true,
|
48
|
+
disabled: this.disabled,
|
49
|
+
href: Boolean(this.href),
|
50
|
+
})}
|
51
|
+
data-test="component"
|
52
|
+
download=${ifDefined(this.download)}
|
53
|
+
href=${ifDefined(this.href)}
|
54
|
+
target=${ifDefined(this.target)}
|
55
|
+
@click=${this.#onClick}
|
56
|
+
${ref(this.#componentElementRef)}
|
57
|
+
>
|
58
|
+
${this.label}
|
59
|
+
</a>`;
|
60
|
+
}
|
61
|
+
#componentElementRef;
|
62
|
+
#onClick(event) {
|
63
|
+
if (this.disabled) {
|
64
|
+
event.preventDefault();
|
65
|
+
event.stopPropagation();
|
66
|
+
}
|
67
|
+
}
|
68
|
+
};
|
69
|
+
__decorate([
|
70
|
+
property({ reflect: true }),
|
71
|
+
required
|
72
|
+
], Link.prototype, "label", void 0);
|
73
|
+
__decorate([
|
74
|
+
property({ reflect: true, type: Boolean })
|
75
|
+
], Link.prototype, "disabled", void 0);
|
76
|
+
__decorate([
|
77
|
+
property({ reflect: true })
|
78
|
+
], Link.prototype, "download", void 0);
|
79
|
+
__decorate([
|
80
|
+
property({ reflect: true })
|
81
|
+
], Link.prototype, "href", void 0);
|
82
|
+
__decorate([
|
83
|
+
property({ reflect: true })
|
84
|
+
], Link.prototype, "target", void 0);
|
85
|
+
__decorate([
|
86
|
+
property({ reflect: true })
|
87
|
+
], Link.prototype, "version", void 0);
|
88
|
+
Link = __decorate([
|
89
|
+
customElement('glide-core-link'),
|
90
|
+
final
|
91
|
+
], Link);
|
92
|
+
export default Link;
|
package/dist/link.styles.js
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
-
import{css}from
|
2
|
-
|
3
|
-
|
1
|
+
import { css } from 'lit';
|
2
|
+
import focusOutline from './styles/focus-outline.js';
|
3
|
+
export default [
|
4
|
+
css `
|
5
|
+
${focusOutline('.component:focus-visible')}
|
6
|
+
`,
|
7
|
+
css `
|
4
8
|
.component {
|
5
9
|
border-radius: var(--glide-core-rounding-base-radius-xxs);
|
6
10
|
color: var(--glide-core-color-interactive-text-link);
|
7
11
|
font-family: var(--glide-core-typography-family-primary);
|
8
|
-
font-size: var(--glide-core-typography-size-body-
|
12
|
+
font-size: var(--glide-core-typography-size-body-default);
|
9
13
|
font-weight: var(--glide-core-typography-weight-regular);
|
10
14
|
text-decoration: none;
|
11
15
|
|
@@ -24,4 +28,5 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
24
28
|
}
|
25
29
|
}
|
26
30
|
}
|
27
|
-
|
31
|
+
`,
|
32
|
+
];
|
package/dist/menu.d.ts
CHANGED
@@ -13,8 +13,8 @@ declare global {
|
|
13
13
|
* @readonly
|
14
14
|
* @attr {string} [version]
|
15
15
|
*
|
16
|
-
* @slot {
|
17
|
-
* @slot {Element}
|
16
|
+
* @slot {Element}
|
17
|
+
* @slot {Element} target - The element to which Menu will anchor. Can be any focusable element unless it's the target of a sub-Menu, in which case the element shouldn't be focusable. If you want Menu to be filterable, put an Input in this slot. Listen for Input's "input" event, then add and remove Option(s) from Menu's default slot based on Input's value.
|
18
18
|
*
|
19
19
|
* @fires {Event} toggle
|
20
20
|
*/
|
@@ -38,6 +38,7 @@ export default class Menu extends LitElement {
|
|
38
38
|
get open(): boolean;
|
39
39
|
set open(isOpen: boolean);
|
40
40
|
placement: 'bottom' | 'left' | 'right' | 'top' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end' | 'top-start' | 'top-end';
|
41
|
+
privateOpenedViaKeyboard: boolean;
|
41
42
|
readonly version: string;
|
42
43
|
connectedCallback(): void;
|
43
44
|
createRenderRoot(): ShadowRoot;
|