@crowdstrike/glide-core 0.29.2 → 0.30.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/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 +15 -8
- 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 +35 -19
- 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,211 @@
|
|
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, state } from 'lit/decorators.js';
|
10
|
+
import packageJson from '../package.json' with { type: 'json' };
|
11
|
+
import styles from './radio-group.radio.styles.js';
|
12
|
+
import shadowRootMode from './library/shadow-root-mode.js';
|
13
|
+
import final from './library/final.js';
|
14
|
+
import required from './library/required.js';
|
15
|
+
/**
|
16
|
+
* @attr {string} label
|
17
|
+
* @attr {boolean} [checked=false]
|
18
|
+
* @attr {boolean} [disabled=false]
|
19
|
+
* @attr {string} [value='']
|
20
|
+
*
|
21
|
+
* @readonly
|
22
|
+
* @attr {string} [version]
|
23
|
+
*
|
24
|
+
* @fires {Event} change
|
25
|
+
* @fires {Event} input
|
26
|
+
*/
|
27
|
+
let RadioGroupRadio = class RadioGroupRadio extends LitElement {
|
28
|
+
constructor() {
|
29
|
+
super(...arguments);
|
30
|
+
this.version = packageJson.version;
|
31
|
+
this.#checked = false;
|
32
|
+
this.#disabled = false;
|
33
|
+
this.#privateInvalid = false;
|
34
|
+
this.#privateRequired = false;
|
35
|
+
this.#value = '';
|
36
|
+
}
|
37
|
+
static { this.shadowRootOptions = {
|
38
|
+
...LitElement.shadowRootOptions,
|
39
|
+
mode: shadowRootMode,
|
40
|
+
}; }
|
41
|
+
static { this.styles = styles; }
|
42
|
+
/**
|
43
|
+
* @default undefined
|
44
|
+
*/
|
45
|
+
get label() {
|
46
|
+
return this.#label;
|
47
|
+
}
|
48
|
+
set label(label) {
|
49
|
+
this.#label = label;
|
50
|
+
this.ariaLabel = label.toString();
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* @default false
|
54
|
+
*/
|
55
|
+
get checked() {
|
56
|
+
return this.#checked;
|
57
|
+
}
|
58
|
+
set checked(isChecked) {
|
59
|
+
const wasChecked = this.#checked;
|
60
|
+
this.#checked = isChecked;
|
61
|
+
this.ariaChecked = isChecked && !this.disabled ? 'true' : 'false';
|
62
|
+
if (isChecked && wasChecked !== isChecked) {
|
63
|
+
this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
64
|
+
this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
|
65
|
+
}
|
66
|
+
// `this.checked` can be set programmatically. Radio Group needs to know when
|
67
|
+
// that happens so it can update its own `this.value`.
|
68
|
+
this.dispatchEvent(new CustomEvent('private-checked-change', {
|
69
|
+
bubbles: true,
|
70
|
+
detail: {
|
71
|
+
// Without knowing what the old value was, Radio Group would be unable to
|
72
|
+
// update `this.value`.
|
73
|
+
old: wasChecked,
|
74
|
+
new: isChecked,
|
75
|
+
},
|
76
|
+
}));
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* @default false
|
80
|
+
*/
|
81
|
+
get disabled() {
|
82
|
+
return this.#disabled;
|
83
|
+
}
|
84
|
+
set disabled(isDisabled) {
|
85
|
+
this.#disabled = isDisabled;
|
86
|
+
this.ariaDisabled = isDisabled.toString();
|
87
|
+
this.ariaChecked = this.checked && !isDisabled ? 'true' : 'false';
|
88
|
+
// `this.disabled` can be changed programmatically. Radio Group needs to know when
|
89
|
+
// that happens so it can make radios tabbable or untabbable.
|
90
|
+
this.dispatchEvent(new CustomEvent('private-disabled-change', {
|
91
|
+
bubbles: true,
|
92
|
+
}));
|
93
|
+
}
|
94
|
+
// Private because it's only meant to be used by Radio Group.
|
95
|
+
get privateInvalid() {
|
96
|
+
return this.#privateInvalid;
|
97
|
+
}
|
98
|
+
// Private because it's only meant to be used by Radio Group.
|
99
|
+
set privateInvalid(invalid) {
|
100
|
+
this.#privateInvalid = invalid;
|
101
|
+
this.ariaInvalid = invalid.toString();
|
102
|
+
}
|
103
|
+
// Private because it's only meant to be used by Radio Group.
|
104
|
+
get privateRequired() {
|
105
|
+
return this.#privateRequired;
|
106
|
+
}
|
107
|
+
// Private because it's only meant to be used by Radio Group.
|
108
|
+
set privateRequired(required) {
|
109
|
+
this.#privateRequired = required;
|
110
|
+
this.ariaRequired = required.toString();
|
111
|
+
}
|
112
|
+
/**
|
113
|
+
* @default ''
|
114
|
+
*/
|
115
|
+
get value() {
|
116
|
+
return this.#value;
|
117
|
+
}
|
118
|
+
set value(value) {
|
119
|
+
const old = this.#value;
|
120
|
+
this.#value = value;
|
121
|
+
// `this.value` can be set programmatically. Radio Group needs to know when
|
122
|
+
// that happens so it can update its own `this.value`.
|
123
|
+
this.dispatchEvent(new CustomEvent('private-value-change', {
|
124
|
+
bubbles: true,
|
125
|
+
detail: {
|
126
|
+
// Without knowing what the old value was, Radio Group would be unable to
|
127
|
+
// update `this.value`.
|
128
|
+
old,
|
129
|
+
new: value,
|
130
|
+
},
|
131
|
+
}));
|
132
|
+
}
|
133
|
+
firstUpdated() {
|
134
|
+
this.ariaChecked =
|
135
|
+
this.checked && !this.disabled && this === this.lastCheckedRadio
|
136
|
+
? 'true'
|
137
|
+
: 'false';
|
138
|
+
this.ariaDisabled = this.disabled.toString();
|
139
|
+
this.ariaInvalid = this.privateInvalid.toString();
|
140
|
+
this.ariaRequired = this.privateRequired.toString();
|
141
|
+
this.role = 'radio';
|
142
|
+
if (this.label) {
|
143
|
+
this.ariaLabel = this.label;
|
144
|
+
}
|
145
|
+
}
|
146
|
+
get lastCheckedRadio() {
|
147
|
+
const radios = this.parentElement?.querySelectorAll('glide-core-radio-group-radio');
|
148
|
+
if (radios && radios.length > 0) {
|
149
|
+
return [...radios].findLast((radio) => radio.checked);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
render() {
|
153
|
+
return html `
|
154
|
+
<div
|
155
|
+
class=${classMap({
|
156
|
+
component: true,
|
157
|
+
disabled: this.disabled,
|
158
|
+
})}
|
159
|
+
data-test="component"
|
160
|
+
>
|
161
|
+
<div
|
162
|
+
class=${classMap({
|
163
|
+
circle: true,
|
164
|
+
checked: this.checked && this === this.lastCheckedRadio && !this.disabled,
|
165
|
+
disabled: this.disabled,
|
166
|
+
animate: this.hasUpdated,
|
167
|
+
})}
|
168
|
+
data-test="radio"
|
169
|
+
></div>
|
170
|
+
|
171
|
+
${this.#label}
|
172
|
+
</div>
|
173
|
+
`;
|
174
|
+
}
|
175
|
+
#checked;
|
176
|
+
#disabled;
|
177
|
+
#label;
|
178
|
+
#privateInvalid;
|
179
|
+
#privateRequired;
|
180
|
+
#value;
|
181
|
+
};
|
182
|
+
__decorate([
|
183
|
+
property({ reflect: true }),
|
184
|
+
required
|
185
|
+
], RadioGroupRadio.prototype, "label", null);
|
186
|
+
__decorate([
|
187
|
+
property({ type: Boolean, reflect: true })
|
188
|
+
], RadioGroupRadio.prototype, "checked", null);
|
189
|
+
__decorate([
|
190
|
+
property({ type: Boolean, reflect: true })
|
191
|
+
], RadioGroupRadio.prototype, "disabled", null);
|
192
|
+
__decorate([
|
193
|
+
property({ type: Boolean })
|
194
|
+
], RadioGroupRadio.prototype, "privateInvalid", null);
|
195
|
+
__decorate([
|
196
|
+
property({ type: Boolean, reflect: true })
|
197
|
+
], RadioGroupRadio.prototype, "privateRequired", null);
|
198
|
+
__decorate([
|
199
|
+
property()
|
200
|
+
], RadioGroupRadio.prototype, "value", null);
|
201
|
+
__decorate([
|
202
|
+
property({ reflect: true })
|
203
|
+
], RadioGroupRadio.prototype, "version", void 0);
|
204
|
+
__decorate([
|
205
|
+
state()
|
206
|
+
], RadioGroupRadio.prototype, "lastCheckedRadio", null);
|
207
|
+
RadioGroupRadio = __decorate([
|
208
|
+
customElement('glide-core-radio-group-radio'),
|
209
|
+
final
|
210
|
+
], RadioGroupRadio);
|
211
|
+
export default RadioGroupRadio;
|
@@ -1,6 +1,10 @@
|
|
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(':host(:focus-visible) .component .circle')}
|
6
|
+
`,
|
7
|
+
css `
|
4
8
|
:host {
|
5
9
|
outline: none;
|
6
10
|
}
|
@@ -108,4 +112,5 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
108
112
|
.label {
|
109
113
|
line-height: 1;
|
110
114
|
}
|
111
|
-
|
115
|
+
`,
|
116
|
+
];
|
@@ -1,4 +1,6 @@
|
|
1
|
-
import{css}from
|
1
|
+
import { css } from 'lit';
|
2
|
+
export default [
|
3
|
+
css `
|
2
4
|
.component {
|
3
5
|
color: var(--glide-core-color-static-text-default);
|
4
6
|
font-family: var(--glide-core-typography-family-primary);
|
@@ -32,4 +34,5 @@ import{css}from"lit";export default[css`
|
|
32
34
|
display: none;
|
33
35
|
}
|
34
36
|
}
|
35
|
-
|
37
|
+
`,
|
38
|
+
];
|