@crowdstrike/glide-core 0.33.0 → 0.34.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/checkbox.js CHANGED
@@ -238,7 +238,8 @@ let Checkbox = class Checkbox extends LitElement {
238
238
  disabled: this.disabled,
239
239
  })}
240
240
  >
241
- <div class="checked-icon">${checkedIcon}</div>
241
+ <div class="checked-icon" role="none">${checkedIcon}</div>
242
+
242
243
  ${icons.indeterminate}
243
244
  </div>
244
245
  </div>
@@ -288,7 +289,7 @@ let Checkbox = class Checkbox extends LitElement {
288
289
  Screenreaders will come across the tooltip naturally as focus moves toward
289
290
  the Checkbox.
290
291
  -->
291
- <div class="input-and-checkbox" slot="control">
292
+ <div class="input-and-checkbox" slot="control" role="none">
292
293
  <input
293
294
  aria-describedby="summary description"
294
295
  aria-invalid=${this.#isShowValidationFeedback}
package/dist/dropdown.js CHANGED
@@ -568,6 +568,7 @@ let Dropdown = class Dropdown extends LitElement {
568
568
  removable
569
569
  ?disabled=${this.disabled || this.readonly}
570
570
  ?private-editable=${option.editable}
571
+ ?private-readonly=${this.readonly}
571
572
  @edit=${this.#onTagEdit}
572
573
  @remove=${this.#onTagRemove.bind(this, option)}
573
574
  >
@@ -598,7 +599,11 @@ let Dropdown = class Dropdown extends LitElement {
598
599
  this.selectedAndEnabledOptions.length > this.tagOverflowLimit, () => {
599
600
  return html `<div
600
601
  aria-hidden="true"
601
- class="tag-overflow-text"
602
+ class=${classMap({
603
+ 'tag-overflow-text': true,
604
+ disabled: this.disabled,
605
+ readonly: this.readonly,
606
+ })}
602
607
  id="tag-overflow-text"
603
608
  >
604
609
  +
@@ -650,6 +655,7 @@ let Dropdown = class Dropdown extends LitElement {
650
655
  .isCommunicateItemCountToScreenreaders
651
656
  ? 'item-count'
652
657
  : ''}"
658
+ aria-required=${this.required}
653
659
  autocapitalize="off"
654
660
  autocomplete="off"
655
661
  class=${classMap({
@@ -755,32 +761,31 @@ let Dropdown = class Dropdown extends LitElement {
755
761
  ${pencilIcon}
756
762
  </glide-core-icon-button>`;
757
763
  })}
758
-
759
- <button
760
- aria-controls="options"
761
- aria-describedby="description"
762
- aria-expanded=${this.open && !this.disabled}
763
- aria-haspopup="listbox"
764
- aria-hidden=${this.filterable || this.isFilterable}
765
- aria-labelledby="selected-option-labels label loading-feedback"
766
- class="primary-button"
767
- data-test="primary-button"
768
- id="primary-button"
769
- tabindex=${this.filterable || this.isFilterable || this.disabled
770
- ? '-1'
771
- : '0'}
772
- type="button"
773
- ?disabled=${this.disabled}
774
- @focusin=${this.#onPrimaryButtonFocusin}
775
- @focusout=${this.#onPrimaryButtonFocusout}
776
- ${ref(this.#primaryButtonElementRef)}
777
- >
778
- ${when(this.isFiltering, () => {
779
- return html `<div data-test="magnifying-glass-icon">
780
- ${magnifyingGlassIcon}
781
- </div>`;
782
- }, () => chevronIcon)}
783
- </button>
764
+ ${when(!(this.disabled || this.readonly), () => {
765
+ return html `<button
766
+ aria-controls="options"
767
+ aria-describedby="description"
768
+ aria-expanded=${this.open}
769
+ aria-haspopup="listbox"
770
+ aria-hidden=${this.filterable || this.isFilterable}
771
+ aria-labelledby="selected-option-labels label loading-feedback"
772
+ aria-required=${this.required}
773
+ class="primary-button"
774
+ data-test="primary-button"
775
+ id="primary-button"
776
+ tabindex=${this.filterable || this.isFilterable ? '-1' : '0'}
777
+ type="button"
778
+ @focusin=${this.#onPrimaryButtonFocusin}
779
+ @focusout=${this.#onPrimaryButtonFocusout}
780
+ ${ref(this.#primaryButtonElementRef)}
781
+ >
782
+ ${when(this.isFiltering, () => {
783
+ return html `<div data-test="magnifying-glass-icon">
784
+ ${magnifyingGlassIcon}
785
+ </div>`;
786
+ }, () => chevronIcon)}
787
+ </button>`;
788
+ })}
784
789
  </div>
785
790
  </div>
786
791
 
@@ -93,9 +93,10 @@ export default [
93
93
  }
94
94
 
95
95
  &.readonly {
96
- background-color: transparent;
96
+ background-color: var(
97
+ --glide-core-color-interactive-surface-container--disabled
98
+ );
97
99
  border-color: transparent;
98
- padding-inline-start: 0;
99
100
  }
100
101
 
101
102
  &.quiet {
@@ -249,6 +250,14 @@ export default [
249
250
  align-content: center;
250
251
  color: var(--glide-core-color-interactive-text-link);
251
252
  white-space: nowrap;
253
+
254
+ &.disabled {
255
+ color: var(--glide-core-color-interactive-text-link--disabled);
256
+ }
257
+
258
+ &.readonly {
259
+ color: var(--glide-core-color-interactive-text-default);
260
+ }
252
261
  }
253
262
 
254
263
  .single-select-icon-slot {
@@ -11,6 +11,9 @@ declare global {
11
11
  * @attr {string} [version]
12
12
  *
13
13
  * @slot {Element | string} - The content of the alert
14
+ *
15
+ * @readonly
16
+ * @prop {string} ariaLabel
14
17
  */
15
18
  export default class InlineAlert extends LitElement {
16
19
  #private;
@@ -18,6 +21,7 @@ export default class InlineAlert extends LitElement {
18
21
  static styles: import("lit").CSSResult[];
19
22
  variant: 'informational' | 'medium' | 'high' | 'critical';
20
23
  readonly version: string;
24
+ get ariaLabel(): string;
21
25
  firstUpdated(): void;
22
26
  render(): import("lit").TemplateResult<1>;
23
27
  }
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { html, LitElement } from 'lit';
8
8
  import { classMap } from 'lit/directives/class-map.js';
9
9
  import { createRef, ref } from 'lit/directives/ref.js';
10
- import { customElement, property } from 'lit/decorators.js';
10
+ import { customElement, property, state } from 'lit/decorators.js';
11
11
  import { styleMap } from 'lit/directives/style-map.js';
12
12
  import packageJson from '../package.json' with { type: 'json' };
13
13
  import styles from './inline-alert.styles.js';
@@ -16,6 +16,7 @@ import severityMediumIcon from './icons/severity-medium.js';
16
16
  import severityCriticalIcon from './icons/severity-critical.js';
17
17
  import assertSlot from './library/assert-slot.js';
18
18
  import final from './library/final.js';
19
+ import { LocalizeController } from './library/localize.js';
19
20
  /**
20
21
  * @attr {'informational'|'medium'|'high'|'critical'} [variant='informational']
21
22
  *
@@ -23,6 +24,9 @@ import final from './library/final.js';
23
24
  * @attr {string} [version]
24
25
  *
25
26
  * @slot {Element | string} - The content of the alert
27
+ *
28
+ * @readonly
29
+ * @prop {string} ariaLabel
26
30
  */
27
31
  let InlineAlert = class InlineAlert extends LitElement {
28
32
  constructor() {
@@ -31,6 +35,7 @@ let InlineAlert = class InlineAlert extends LitElement {
31
35
  this.version = packageJson.version;
32
36
  this.#animationDuration = 100;
33
37
  this.#componentElementRef = createRef();
38
+ this.#localize = new LocalizeController(this);
34
39
  }
35
40
  /* c8 ignore start */
36
41
  static { this.shadowRootOptions = {
@@ -39,6 +44,15 @@ let InlineAlert = class InlineAlert extends LitElement {
39
44
  }; }
40
45
  /* c8 ignore end */
41
46
  static { this.styles = styles; }
47
+ get ariaLabel() {
48
+ return this.#localize.term(this.variant === 'informational'
49
+ ? 'severityInformational'
50
+ : this.variant === 'medium'
51
+ ? 'severityMedium'
52
+ : this.variant === 'high'
53
+ ? 'severityHigh'
54
+ : 'severityCritical');
55
+ }
42
56
  firstUpdated() {
43
57
  this.#componentElementRef.value?.addEventListener('animationend', () => {
44
58
  this.#componentElementRef.value?.classList.remove('added');
@@ -47,14 +61,14 @@ let InlineAlert = class InlineAlert extends LitElement {
47
61
  render() {
48
62
  return html `
49
63
  <div
64
+ aria-label=${this.ariaLabel}
50
65
  class=${classMap({
51
66
  component: true,
52
67
  added: true,
53
68
  [this.variant]: true,
54
69
  })}
55
- role="alert"
56
- aria-labelledby="label"
57
70
  data-test="component"
71
+ role="alert"
58
72
  style="--private-animation-duration: ${this.#animationDuration}ms"
59
73
  ${ref(this.#componentElementRef)}
60
74
  >
@@ -68,7 +82,7 @@ let InlineAlert = class InlineAlert extends LitElement {
68
82
  ${icons[this.variant]}
69
83
  </div>
70
84
 
71
- <div id="label" class="content">
85
+ <div class="content">
72
86
  <slot ${assertSlot()}>
73
87
  <!--
74
88
  The content of the alert
@@ -82,6 +96,7 @@ let InlineAlert = class InlineAlert extends LitElement {
82
96
  }
83
97
  #animationDuration;
84
98
  #componentElementRef;
99
+ #localize;
85
100
  };
86
101
  __decorate([
87
102
  property({ reflect: true, useDefault: true })
@@ -89,6 +104,9 @@ __decorate([
89
104
  __decorate([
90
105
  property({ reflect: true })
91
106
  ], InlineAlert.prototype, "version", void 0);
107
+ __decorate([
108
+ state()
109
+ ], InlineAlert.prototype, "ariaLabel", null);
92
110
  InlineAlert = __decorate([
93
111
  customElement('glide-core-inline-alert'),
94
112
  final
@@ -86,9 +86,10 @@ export default [
86
86
  with ":read-only": https://bugs.chromium.org/p/chromium/issues/detail?id=1519649
87
87
  */
88
88
  &.readonly {
89
- background-color: transparent;
89
+ background-color: var(
90
+ --glide-core-color-interactive-surface-container--disabled
91
+ );
90
92
  border: 1px solid transparent;
91
- padding-inline-start: 0;
92
93
  }
93
94
 
94
95
  &.disabled {
@@ -18,6 +18,7 @@ export interface Translation extends DefaultTranslation {
18
18
  severityInformational: string;
19
19
  severityCritical: string;
20
20
  severityMedium: string;
21
+ severityHigh: string;
21
22
  success: string;
22
23
  error: string;
23
24
  informational: string;
@@ -118,9 +118,7 @@ export default [
118
118
  }
119
119
 
120
120
  .handle {
121
- background-color: var(
122
- --glide-core-private-color-slider-and-scrollbar-surface-handle
123
- );
121
+ background-color: var(--glide-core-private-color-slider-surface-handle);
124
122
  block-size: 1.5rem;
125
123
  border: 2px solid var(--glide-core-color-interactive-stroke-active);
126
124
  border-radius: var(--glide-core-rounding-base-radius-round);
@@ -123,7 +123,7 @@
123
123
  --glide-core-color-severity-stroke-high: #ffbf66;
124
124
  --glide-core-color-severity-stroke-medium: #ffcc00;
125
125
  --glide-core-color-severity-stroke-low: #c9c9c9;
126
- --glide-core-color-severity-text-citical: #2c0907;
126
+ --glide-core-color-severity-text-critical: #2c0907;
127
127
  --glide-core-color-severity-text-high: #331e00;
128
128
  --glide-core-color-severity-text-medium: #332900;
129
129
  --glide-core-color-severity-text-low: #212121;
@@ -153,7 +153,7 @@
153
153
  --glide-core-private-color-dialog-and-modal-surface-overlay: #0000008c;
154
154
  --glide-core-private-color-skeleton-loader-surface-linear-gradient-sides: #0000000d;
155
155
  --glide-core-private-color-skeleton-loader-surface-linear-gradient-middle: #0000001a;
156
- --glide-core-private-color-slider-and-scrollbar-surface-handle: #f0f0f0;
156
+ --glide-core-private-color-slider-surface-handle: #f0f0f0;
157
157
  --glide-core-private-color-tabs-stroke-underline: #e3e3e3;
158
158
  --glide-core-private-color-template-surface-container-detail: #ffffffe5;
159
159
  --glide-core-private-color-tooltip-surface-container: #212121;
@@ -284,7 +284,7 @@
284
284
  --glide-core-color-severity-stroke-high: #e7a649;
285
285
  --glide-core-color-severity-stroke-medium: #f0cf4f;
286
286
  --glide-core-color-severity-stroke-low: #727272;
287
- --glide-core-color-severity-text-citical: #e67873;
287
+ --glide-core-color-severity-text-critical: #e67873;
288
288
  --glide-core-color-severity-text-high: #ffb64f;
289
289
  --glide-core-color-severity-text-medium: #f0cf4f;
290
290
  --glide-core-color-severity-text-low: #f9f9f9;
@@ -314,7 +314,7 @@
314
314
  --glide-core-private-color-dialog-and-modal-surface-overlay: #141414d9;
315
315
  --glide-core-private-color-skeleton-loader-surface-linear-gradient-sides: #ffffff0d;
316
316
  --glide-core-private-color-skeleton-loader-surface-linear-gradient-middle: #ffffff1a;
317
- --glide-core-private-color-slider-and-scrollbar-surface-handle: #2c2c2c;
317
+ --glide-core-private-color-slider-surface-handle: #2c2c2c;
318
318
  --glide-core-private-color-tabs-stroke-underline: #ffffff26;
319
319
  --glide-core-private-color-template-surface-container-detail: #222222;
320
320
  --glide-core-private-color-tooltip-surface-container: #dcdcdc;
@@ -337,12 +337,18 @@
337
337
  --glide-core-duration-fast-02: 100ms;
338
338
  --glide-core-duration-moderate-01: 150ms;
339
339
  --glide-core-duration-moderate-02: 250ms;
340
+ --glide-core-duration-moderate-03: 325ms;
340
341
  --glide-core-duration-slow-01: 400ms;
341
342
  --glide-core-duration-slow-02: 900ms;
342
343
  }
343
344
 
344
345
  /* src/styles/variables/miscellaneous.css */
345
346
  :root {
347
+ --glide-core-typography-family-primary: "Nunito", system-ui;
348
+ --glide-core-typography-family-monospace:
349
+ "Oxygen Mono",
350
+ ui-monospace,
351
+ monospace;
346
352
  --glide-core-effect-hovered: 0px 0px 2px 0px var(--glide-core-color-effect-color-elevation-hovered);
347
353
  --glide-core-effect-lifted: 0px 2px 8px 0px var(--glide-core-color-effect-color-elevation-lifted);
348
354
  --glide-core-effect-raised: 0px 3px 1px 0px var(--glide-core-color-effect-color-elevation-raised-1), 0px 3px 8px 0 var(--glide-core-color-effect-color-elevation-raised-2);
@@ -394,11 +400,6 @@
394
400
  --glide-core-typography-size-body-default: 0.875rem;
395
401
  --glide-core-typography-size-body-small: 0.75rem;
396
402
  --glide-core-typography-size-component-chartlabel-md: 0.625rem;
397
- --glide-core-typography-family-primary: "Nunito", system-ui;
398
- --glide-core-typography-family-monospace:
399
- "Oxygen Mono",
400
- ui-monospace,
401
- monospace;
402
403
  --glide-core-typography-weight-light: 300;
403
404
  --glide-core-typography-weight-regular: 400;
404
405
  --glide-core-typography-weight-semibold: 600;
package/dist/tag.d.ts CHANGED
@@ -24,6 +24,7 @@ export default class Tag extends LitElement {
24
24
  label?: string;
25
25
  disabled: boolean;
26
26
  privateEditable: boolean;
27
+ privateReadonly: boolean;
27
28
  removable: boolean;
28
29
  readonly version: string;
29
30
  click(): void;
package/dist/tag.js CHANGED
@@ -35,6 +35,8 @@ let Tag = class Tag extends LitElement {
35
35
  this.disabled = false;
36
36
  // Private because it's only meant to be used by Dropdown.
37
37
  this.privateEditable = false;
38
+ // Private because it's only meant to be used by Dropdown.
39
+ this.privateReadonly = false;
38
40
  this.removable = false;
39
41
  this.version = packageJson.version;
40
42
  this.#animationDuration = 100;
@@ -78,6 +80,7 @@ let Tag = class Tag extends LitElement {
78
80
  component: true,
79
81
  added: true,
80
82
  disabled: this.disabled,
83
+ readonly: this.privateReadonly,
81
84
  })}
82
85
  data-test="component"
83
86
  data-animation-duration=${this.#animationDuration}
@@ -194,6 +197,9 @@ __decorate([
194
197
  __decorate([
195
198
  property({ attribute: 'private-editable', reflect: true, type: Boolean })
196
199
  ], Tag.prototype, "privateEditable", void 0);
200
+ __decorate([
201
+ property({ attribute: 'private-readonly', reflect: true, type: Boolean })
202
+ ], Tag.prototype, "privateReadonly", void 0);
197
203
  __decorate([
198
204
  property({ reflect: true, type: Boolean })
199
205
  ], Tag.prototype, "removable", void 0);
@@ -54,11 +54,19 @@ export default [
54
54
  }
55
55
 
56
56
  &.disabled {
57
- background: var(--glide-core-color-static-surface-container-secondary);
57
+ background-color: var(
58
+ --glide-core-color-static-surface-container-secondary
59
+ );
58
60
  border-color: var(--glide-core-color-interactive-stroke-primary);
59
61
  color: var(--glide-core-color-interactive-icon-default--disabled);
60
62
  }
61
63
 
64
+ &.readonly {
65
+ background-color: var(--glide-core-color-static-surface-container);
66
+ border-color: var(--glide-core-color-interactive-stroke-primary);
67
+ color: var(--glide-core-color-interactive-text-default);
68
+ }
69
+
62
70
  &.removed {
63
71
  @media (prefers-reduced-motion: no-preference) {
64
72
  animation-duration: var(--private-animation-duration);
@@ -114,10 +114,11 @@ export default [
114
114
  }
115
115
 
116
116
  &[readonly] {
117
- background-color: transparent;
117
+ background-color: var(
118
+ --glide-core-color-interactive-surface-container--disabled
119
+ );
118
120
  border-color: transparent;
119
121
  outline: none;
120
- padding-inline-start: 0;
121
122
  resize: none;
122
123
  transition: none;
123
124
  }
package/dist/tooltip.js CHANGED
@@ -330,8 +330,8 @@ let Tooltip = class Tooltip extends LitElement {
330
330
  #onTargetSlotChange() {
331
331
  const container = this.querySelector('glide-core-private-tooltip-container');
332
332
  const target = this.#targetSlotElementRef.value?.assignedElements().at(0);
333
- if (container && target && !this.disabled && !this.screenreaderHidden) {
334
- target.setAttribute('aria-describedby', container.id);
333
+ if (container && !this.disabled && !this.screenreaderHidden) {
334
+ target?.setAttribute('aria-describedby', container.id);
335
335
  }
336
336
  }
337
337
  #onTargetSlotFocusIn() {
@@ -16,6 +16,7 @@ const translation = {
16
16
  severityInformational: 'Severity: Informational',
17
17
  severityCritical: 'Severity: Critical',
18
18
  severityMedium: 'Severity: Medium',
19
+ severityHigh: 'Severity: High',
19
20
  success: 'Success:',
20
21
  error: 'Error:',
21
22
  informational: 'Informational:',
@@ -1,5 +1,5 @@
1
1
  import type { Translation } from '../library/localize.js';
2
- export declare const PENDING_STRINGS: readonly ["severityInformational", "severityCritical", "severityMedium", "success", "error", "informational", "loading", "noAvailableOptions", "noMatchingOptions", "maximum", "setMaximum", "minimum", "setMinimum", "add"];
2
+ export declare const PENDING_STRINGS: readonly ["severityInformational", "severityCritical", "severityMedium", "severityHigh", "success", "error", "informational", "loading", "noAvailableOptions", "noMatchingOptions", "maximum", "setMaximum", "minimum", "setMinimum", "add"];
3
3
  type PendingTranslation = (typeof PENDING_STRINGS)[number];
4
4
  declare const translation: Omit<Translation, PendingTranslation>;
5
5
  export default translation;
@@ -2,6 +2,7 @@ export const PENDING_STRINGS = [
2
2
  'severityInformational',
3
3
  'severityCritical',
4
4
  'severityMedium',
5
+ 'severityHigh',
5
6
  'success',
6
7
  'error',
7
8
  'informational',
@@ -1,5 +1,5 @@
1
1
  import type { Translation } from '../library/localize.js';
2
- export declare const PENDING_STRINGS: readonly ["severityInformational", "severityCritical", "severityMedium", "success", "error", "informational", "loading", "noAvailableOptions", "noMatchingOptions", "maximum", "setMaximum", "minimum", "setMinimum", "add"];
2
+ export declare const PENDING_STRINGS: readonly ["severityInformational", "severityCritical", "severityMedium", "severityHigh", "success", "error", "informational", "loading", "noAvailableOptions", "noMatchingOptions", "maximum", "setMaximum", "minimum", "setMinimum", "add"];
3
3
  type PendingTranslation = (typeof PENDING_STRINGS)[number];
4
4
  declare const translation: Omit<Translation, PendingTranslation>;
5
5
  export default translation;
@@ -2,6 +2,7 @@ export const PENDING_STRINGS = [
2
2
  'severityInformational',
3
3
  'severityCritical',
4
4
  'severityMedium',
5
+ 'severityHigh',
5
6
  'success',
6
7
  'error',
7
8
  'informational',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdstrike/glide-core",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "A Web Component design system",
5
5
  "author": "CrowdStrike UX Team",
6
6
  "license": "Apache-2.0",