@crowdstrike/glide-core 0.32.3 → 0.33.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.
Files changed (56) hide show
  1. package/dist/accordion.js +3 -2
  2. package/dist/button-group.button.js +3 -2
  3. package/dist/button-group.js +3 -2
  4. package/dist/button.js +5 -10
  5. package/dist/button.styles.js +0 -12
  6. package/dist/checkbox-group.js +8 -7
  7. package/dist/checkbox.js +8 -7
  8. package/dist/checkbox.styles.js +1 -1
  9. package/dist/drawer.js +3 -2
  10. package/dist/dropdown.js +19 -18
  11. package/dist/dropdown.option.d.ts +2 -0
  12. package/dist/dropdown.option.js +26 -25
  13. package/dist/form-controls-layout.js +3 -2
  14. package/dist/icon-button.js +2 -2
  15. package/dist/inline-alert.js +3 -2
  16. package/dist/input.js +7 -7
  17. package/dist/label.js +3 -2
  18. package/dist/library/assert-slot.js +2 -2
  19. package/dist/library/assert-slot.test.js +92 -0
  20. package/dist/link.js +2 -2
  21. package/dist/menu.js +61 -30
  22. package/dist/menu.styles.js +1 -0
  23. package/dist/modal.icon-button.js +3 -2
  24. package/dist/modal.js +3 -2
  25. package/dist/option.d.ts +5 -0
  26. package/dist/option.js +28 -5
  27. package/dist/options.d.ts +2 -0
  28. package/dist/options.group.js +3 -2
  29. package/dist/options.js +7 -8
  30. package/dist/options.styles.js +0 -6
  31. package/dist/popover.js +3 -2
  32. package/dist/radio-group.js +4 -3
  33. package/dist/radio-group.radio.js +3 -2
  34. package/dist/select.d.ts +90 -0
  35. package/dist/select.js +532 -0
  36. package/dist/slider.js +3 -3
  37. package/dist/spinner.js +2 -2
  38. package/dist/split-button.js +3 -2
  39. package/dist/split-button.primary-button.js +2 -2
  40. package/dist/split-button.primary-link.js +2 -2
  41. package/dist/split-button.secondary-button.js +2 -2
  42. package/dist/styles/opacity-and-scale-animation.js +2 -1
  43. package/dist/styles/variables.css +7 -4
  44. package/dist/tab.group.js +3 -2
  45. package/dist/tab.js +3 -2
  46. package/dist/tab.panel.js +3 -2
  47. package/dist/tag.js +2 -2
  48. package/dist/textarea.js +8 -7
  49. package/dist/toast.js +2 -2
  50. package/dist/toast.toasts.js +3 -2
  51. package/dist/toggle.js +3 -2
  52. package/dist/tooltip.container.js +3 -2
  53. package/dist/tooltip.js +4 -7
  54. package/package.json +4 -4
  55. package/dist/library/shadow-root-mode.d.ts +0 -2
  56. package/dist/library/shadow-root-mode.js +0 -4
@@ -10,7 +10,6 @@ import { customElement, property } from 'lit/decorators.js';
10
10
  import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import packageJson from '../package.json' with { type: 'json' };
12
12
  import styles from './split-button.primary-button.styles.js';
13
- import shadowRootMode from './library/shadow-root-mode.js';
14
13
  import final from './library/final.js';
15
14
  import required from './library/required.js';
16
15
  /**
@@ -36,10 +35,11 @@ let SplitButtonPrimaryButton = class SplitButtonPrimaryButton extends LitElement
36
35
  this.privateVariant = 'primary';
37
36
  this.version = packageJson.version;
38
37
  }
38
+ /* c8 ignore start */
39
39
  static { this.shadowRootOptions = {
40
40
  ...LitElement.shadowRootOptions,
41
41
  delegatesFocus: true,
42
- mode: shadowRootMode,
42
+ mode: window.navigator.webdriver ? 'open' : 'closed',
43
43
  }; }
44
44
  static { this.styles = styles; }
45
45
  render() {
@@ -10,7 +10,6 @@ import { customElement, property } from 'lit/decorators.js';
10
10
  import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import packageJson from '../package.json' with { type: 'json' };
12
12
  import styles from './split-button.primary-button.styles.js';
13
- import shadowRootMode from './library/shadow-root-mode.js';
14
13
  import final from './library/final.js';
15
14
  import required from './library/required.js';
16
15
  /**
@@ -31,10 +30,11 @@ let SplitButtonPrimaryLink = class SplitButtonPrimaryLink extends LitElement {
31
30
  this.privateVariant = 'primary';
32
31
  this.version = packageJson.version;
33
32
  }
33
+ /* c8 ignore start */
34
34
  static { this.shadowRootOptions = {
35
35
  ...LitElement.shadowRootOptions,
36
36
  delegatesFocus: true,
37
- mode: shadowRootMode,
37
+ mode: window.navigator.webdriver ? 'open' : 'closed',
38
38
  }; }
39
39
  static { this.styles = styles; }
40
40
  render() {
@@ -15,7 +15,6 @@ import Menu from './menu.js';
15
15
  import chevronIcon from './icons/chevron.js';
16
16
  import styles from './split-button.secondary-button.styles.js';
17
17
  import assertSlot from './library/assert-slot.js';
18
- import shadowRootMode from './library/shadow-root-mode.js';
19
18
  import final from './library/final.js';
20
19
  import required from './library/required.js';
21
20
  import Option from './option.js';
@@ -42,10 +41,11 @@ let SplitButtonSecondaryButton = class SplitButtonSecondaryButton extends LitEle
42
41
  this.#buttonElementRef = createRef();
43
42
  this.#menuElementRef = createRef();
44
43
  }
44
+ /* c8 ignore start */
45
45
  static { this.shadowRootOptions = {
46
46
  ...LitElement.shadowRootOptions,
47
47
  delegatesFocus: true,
48
- mode: shadowRootMode,
48
+ mode: window.navigator.webdriver ? 'open' : 'closed',
49
49
  }; }
50
50
  static { this.styles = styles; }
51
51
  click() {
@@ -16,7 +16,8 @@ export default (selector) => {
16
16
 
17
17
  ${unsafeCSS(selector)} {
18
18
  @media (prefers-reduced-motion: no-preference) {
19
- animation: opacity-and-scale 250ms cubic-bezier(0.25, 0, 0.3, 1);
19
+ animation: opacity-and-scale var(--glide-core-duration-moderate-02)
20
+ var(--glide-core-animation-swoop);
20
21
  }
21
22
  }
22
23
  `;
@@ -145,7 +145,7 @@
145
145
  --glide-core-private-color-button-stroke-default: #006ad4;
146
146
  --glide-core-private-color-button-text-primary: #ffffff;
147
147
  --glide-core-private-color-button-icon-primary: #ffffff;
148
- --glide-core-private-color-checkbox-surface-background-selected--default: #ffffff;
148
+ --glide-core-private-color-checkbox-surface-background-selected: #ffffff;
149
149
  --glide-core-private-color-checkbox-surface-background-idle: #ffffff;
150
150
  --glide-core-private-color-checkbox-icon-default--disabled: #d9d9d9;
151
151
  --glide-core-private-color-radio-icon-default--disabled: #d9d9d9;
@@ -306,7 +306,7 @@
306
306
  --glide-core-private-color-button-stroke-default: #5394d5;
307
307
  --glide-core-private-color-button-text-primary: #f9f9f9;
308
308
  --glide-core-private-color-button-icon-primary: #f9f9f9;
309
- --glide-core-private-color-checkbox-surface-background-selected--default: #ffffff;
309
+ --glide-core-private-color-checkbox-surface-background-selected: #ffffff;
310
310
  --glide-core-private-color-checkbox-surface-background-idle: #1414144d;
311
311
  --glide-core-private-color-checkbox-icon-default--disabled: #434343;
312
312
  --glide-core-private-color-radio-icon-default--disabled: #434343;
@@ -394,8 +394,11 @@
394
394
  --glide-core-typography-size-body-default: 0.875rem;
395
395
  --glide-core-typography-size-body-small: 0.75rem;
396
396
  --glide-core-typography-size-component-chartlabel-md: 0.625rem;
397
- --glide-core-typography-family-primary: "Nunito";
398
- --glide-core-typography-family-monospace: "Oxygen Mono";
397
+ --glide-core-typography-family-primary: "Nunito", system-ui;
398
+ --glide-core-typography-family-monospace:
399
+ "Oxygen Mono",
400
+ ui-monospace,
401
+ monospace;
399
402
  --glide-core-typography-weight-light: 300;
400
403
  --glide-core-typography-weight-regular: 400;
401
404
  --glide-core-typography-weight-semibold: 600;
package/dist/tab.group.js CHANGED
@@ -18,7 +18,6 @@ import chevronIcon from './icons/chevron.js';
18
18
  import onResize from './library/on-resize.js';
19
19
  import styles from './tab.group.styles.js';
20
20
  import assertSlot from './library/assert-slot.js';
21
- import shadowRootMode from './library/shadow-root-mode.js';
22
21
  import final from './library/final.js';
23
22
  /**
24
23
  * @readonly
@@ -47,10 +46,12 @@ let TabGroup = class TabGroup extends LitElement {
47
46
  this.#selectedTabIndicatorElementRef = createRef();
48
47
  this.#tabListElementRef = createRef();
49
48
  }
49
+ /* c8 ignore start */
50
50
  static { this.shadowRootOptions = {
51
51
  ...LitElement.shadowRootOptions,
52
- mode: shadowRootMode,
52
+ mode: window.navigator.webdriver ? 'open' : 'closed',
53
53
  }; }
54
+ /* c8 ignore end */
54
55
  static { this.styles = styles; }
55
56
  render() {
56
57
  return html `<div
package/dist/tab.js CHANGED
@@ -9,7 +9,6 @@ import { classMap } from 'lit/directives/class-map.js';
9
9
  import { customElement, property } from 'lit/decorators.js';
10
10
  import packageJson from '../package.json' with { type: 'json' };
11
11
  import styles from './tab.styles.js';
12
- import shadowRootMode from './library/shadow-root-mode.js';
13
12
  import final from './library/final.js';
14
13
  import required from './library/required.js';
15
14
  import uniqueId from './library/unique-id.js';
@@ -42,10 +41,12 @@ let Tab = class Tab extends LitElement {
42
41
  this.role = 'tab';
43
42
  this.#isSelected = false;
44
43
  }
44
+ /* c8 ignore start */
45
45
  static { this.shadowRootOptions = {
46
46
  ...LitElement.shadowRootOptions,
47
- mode: shadowRootMode,
47
+ mode: window.navigator.webdriver ? 'open' : 'closed',
48
48
  }; }
49
+ /* c8 ignore end */
49
50
  static { this.styles = styles; }
50
51
  /**
51
52
  * @default false
package/dist/tab.panel.js CHANGED
@@ -9,7 +9,6 @@ import { classMap } from 'lit/directives/class-map.js';
9
9
  import { customElement, property } from 'lit/decorators.js';
10
10
  import packageJson from '../package.json' with { type: 'json' };
11
11
  import styles from './tab.panel.styles.js';
12
- import shadowRootMode from './library/shadow-root-mode.js';
13
12
  import final from './library/final.js';
14
13
  import required from './library/required.js';
15
14
  import uniqueId from './library/unique-id.js';
@@ -38,10 +37,12 @@ let TabPanel = class TabPanel extends LitElement {
38
37
  this.id = uniqueId();
39
38
  this.#isSelected = false;
40
39
  }
40
+ /* c8 ignore start */
41
41
  static { this.shadowRootOptions = {
42
42
  ...LitElement.shadowRootOptions,
43
- mode: shadowRootMode,
43
+ mode: window.navigator.webdriver ? 'open' : 'closed',
44
44
  }; }
45
+ /* c8 ignore end */
45
46
  static { this.styles = styles; }
46
47
  // Private because it's only meant to be used by Tab Group.
47
48
  get privateIsSelected() {
package/dist/tag.js CHANGED
@@ -14,7 +14,6 @@ import { LocalizeController } from './library/localize.js';
14
14
  import pencilIcon from './icons/pencil.js';
15
15
  import styles from './tag.styles.js';
16
16
  import xIcon from './icons/x.js';
17
- import shadowRootMode from './library/shadow-root-mode.js';
18
17
  import final from './library/final.js';
19
18
  import required from './library/required.js';
20
19
  /**
@@ -54,10 +53,11 @@ let Tag = class Tag extends LitElement {
54
53
  this.#localize = new LocalizeController(this);
55
54
  this.#removalButtonElementRef = createRef();
56
55
  }
56
+ /* c8 ignore start */
57
57
  static { this.shadowRootOptions = {
58
58
  ...LitElement.shadowRootOptions,
59
59
  delegatesFocus: true,
60
- mode: shadowRootMode,
60
+ mode: window.navigator.webdriver ? 'open' : 'closed',
61
61
  }; }
62
62
  static { this.styles = styles; }
63
63
  click() {
package/dist/textarea.js CHANGED
@@ -15,7 +15,6 @@ import { when } from 'lit/directives/when.js';
15
15
  import packageJson from '../package.json' with { type: 'json' };
16
16
  import { LocalizeController } from './library/localize.js';
17
17
  import styles from './textarea.styles.js';
18
- import shadowRootMode from './library/shadow-root-mode.js';
19
18
  import final from './library/final.js';
20
19
  import required from './library/required.js';
21
20
  /**
@@ -69,11 +68,13 @@ import required from './library/required.js';
69
68
  */
70
69
  let Textarea = class Textarea extends LitElement {
71
70
  static { this.formAssociated = true; }
71
+ /* c8 ignore start */
72
72
  static { this.shadowRootOptions = {
73
73
  ...LitElement.shadowRootOptions,
74
- mode: shadowRootMode,
74
+ mode: window.navigator.webdriver ? 'open' : 'closed',
75
75
  delegatesFocus: true,
76
76
  }; }
77
+ /* c8 ignore end */
77
78
  static { this.styles = styles; }
78
79
  checkValidity() {
79
80
  this.isCheckingValidity = true;
@@ -196,7 +197,7 @@ let Textarea = class Textarea extends LitElement {
196
197
  reportValidity() {
197
198
  this.isReportValidityOrSubmit = true;
198
199
  const isValid = this.#internals.reportValidity();
199
- // Ensures that getters referencing `this.validity.valid` are updated.
200
+ // Ensures getters referencing `this.validity.valid` re-run.
200
201
  this.requestUpdate();
201
202
  return isValid;
202
203
  }
@@ -263,12 +264,12 @@ let Textarea = class Textarea extends LitElement {
263
264
  this.isReportValidityOrSubmit = true;
264
265
  const isFirstInvalidFormElement = this.form?.querySelector(':invalid') === this;
265
266
  if (isFirstInvalidFormElement) {
266
- // - `this.#internals.delegatesFocus` is preferred because it's declarative. But
267
- // it's limited to focusing the first focusable element. That doesn't work for
268
- // us because our first focusable element is the tooltip when it's present.
267
+ // - `delegatesFocus` is preferred because it's declarative. But it's limited to
268
+ // focusing the first focusable element. That doesn't work for us because the first
269
+ // focusable element is the Tooltip when it's present.
269
270
  //
270
271
  // - Canceling this event means the input won't get focus, even if we were to use
271
- // `this.#internals.delegatesFocus`.
272
+ // `delegatesFocus`.
272
273
  //
273
274
  // - The browser will ignore this if Input isn't the first invalid form control.
274
275
  //
package/dist/toast.js CHANGED
@@ -9,7 +9,6 @@ import { LitElement, html } from 'lit';
9
9
  import { customElement, property } from 'lit/decorators.js';
10
10
  import packageJson from '../package.json' with { type: 'json' };
11
11
  import Toasts from './toast.toasts.js';
12
- import shadowRootMode from './library/shadow-root-mode.js';
13
12
  import final from './library/final.js';
14
13
  import required from './library/required.js';
15
14
  import Link from './link.js';
@@ -46,9 +45,10 @@ let Toast = class Toast extends LitElement {
46
45
  this.variant = 'informational';
47
46
  this.version = packageJson.version;
48
47
  }
48
+ /* c8 ignore start */
49
49
  static { this.shadowRootOptions = {
50
50
  ...LitElement.shadowRootOptions,
51
- mode: shadowRootMode,
51
+ mode: window.navigator.webdriver ? 'open' : 'closed',
52
52
  }; }
53
53
  dismiss() {
54
54
  this.dispatchEvent(new Event('dismiss', { bubbles: true, composed: true }));
@@ -17,7 +17,6 @@ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
17
17
  import xIcon from './icons/x.js';
18
18
  import { LocalizeController } from './library/localize.js';
19
19
  import styles from './toast.toasts.styles.js';
20
- import shadowRootMode from './library/shadow-root-mode.js';
21
20
  import final from './library/final.js';
22
21
  import Toast from './toast.js';
23
22
  import Link from './link.js';
@@ -40,10 +39,12 @@ let Toasts = class Toasts extends LitElement {
40
39
  this.#componentElementRef = createRef();
41
40
  this.#localize = new LocalizeController(this);
42
41
  }
42
+ /* c8 ignore start */
43
43
  static { this.shadowRootOptions = {
44
44
  ...LitElement.shadowRootOptions,
45
- mode: shadowRootMode,
45
+ mode: window.navigator.webdriver ? 'open' : 'closed',
46
46
  }; }
47
+ /* c8 ignore end */
47
48
  static { this.styles = styles; }
48
49
  dismiss(toast) {
49
50
  const index = this.toasts.indexOf(toast);
package/dist/toggle.js CHANGED
@@ -12,7 +12,6 @@ import { ifDefined } from 'lit/directives/if-defined.js';
12
12
  import { when } from 'lit/directives/when.js';
13
13
  import packageJson from '../package.json' with { type: 'json' };
14
14
  import styles from './toggle.styles.js';
15
- import shadowRootMode from './library/shadow-root-mode.js';
16
15
  import final from './library/final.js';
17
16
  import required from './library/required.js';
18
17
  /**
@@ -42,10 +41,12 @@ let Toggle = class Toggle extends LitElement {
42
41
  this.version = packageJson.version;
43
42
  this.#inputElementRef = createRef();
44
43
  }
44
+ /* c8 ignore start */
45
45
  static { this.shadowRootOptions = {
46
46
  ...LitElement.shadowRootOptions,
47
- mode: shadowRootMode,
47
+ mode: window.navigator.webdriver ? 'open' : 'closed',
48
48
  }; }
49
+ /* c8 ignore end */
49
50
  static { this.styles = styles; }
50
51
  click() {
51
52
  this.#inputElementRef.value?.click();
@@ -10,7 +10,6 @@ import { classMap } from 'lit/directives/class-map.js';
10
10
  import { map } from 'lit/directives/map.js';
11
11
  import { when } from 'lit/directives/when.js';
12
12
  import styles from './tooltip.container.styles.js';
13
- import shadowRootMode from './library/shadow-root-mode.js';
14
13
  import final from './library/final.js';
15
14
  import uniqueId from './library/unique-id.js';
16
15
  // This component exists because Tooltip's target and its tooltip both need to
@@ -46,10 +45,12 @@ let TooltipContainer = class TooltipContainer extends LitElement {
46
45
  this.shortcut = [];
47
46
  this.#isDisabled = false;
48
47
  }
48
+ /* c8 ignore start */
49
49
  static { this.shadowRootOptions = {
50
50
  ...LitElement.shadowRootOptions,
51
- mode: shadowRootMode,
51
+ mode: window.navigator.webdriver ? 'open' : 'closed',
52
52
  }; }
53
+ /* c8 ignore end */
53
54
  static { this.styles = styles; }
54
55
  /**
55
56
  * @default false
package/dist/tooltip.js CHANGED
@@ -14,7 +14,6 @@ import packageJson from '../package.json' with { type: 'json' };
14
14
  import styles from './tooltip.styles.js';
15
15
  import './tooltip.container.js';
16
16
  import assertSlot from './library/assert-slot.js';
17
- import shadowRootMode from './library/shadow-root-mode.js';
18
17
  import final from './library/final.js';
19
18
  import required from './library/required.js';
20
19
  /**
@@ -48,10 +47,12 @@ let Tooltip = class Tooltip extends LitElement {
48
47
  this.#targetSlotElementRef = createRef();
49
48
  this.#tooltipElementRef = createRef();
50
49
  }
50
+ /* c8 ignore start */
51
51
  static { this.shadowRootOptions = {
52
52
  ...LitElement.shadowRootOptions,
53
- mode: shadowRootMode,
53
+ mode: window.navigator.webdriver ? 'open' : 'closed',
54
54
  }; }
55
+ /* c8 ignore end */
55
56
  static { this.styles = styles; }
56
57
  /**
57
58
  * @default undefined
@@ -265,11 +266,7 @@ let Tooltip = class Tooltip extends LitElement {
265
266
  ])}
266
267
  </div>
267
268
 
268
- <div
269
- class=${classMap({
270
- content: true,
271
- })}
272
- >
269
+ <div class="content">
273
270
  <slot class="default-slot" name="private">
274
271
  <!--
275
272
  @type {TooltipContainer}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdstrike/glide-core",
3
- "version": "0.32.3",
3
+ "version": "0.33.0",
4
4
  "description": "A Web Component design system",
5
5
  "author": "CrowdStrike UX Team",
6
6
  "license": "Apache-2.0",
@@ -68,7 +68,6 @@
68
68
  "@figma/rest-api-spec": "^0.32.0",
69
69
  "@html-eslint/eslint-plugin": "^0.41.0",
70
70
  "@jridgewell/trace-mapping": "^0.3.29",
71
- "@lit-labs/ssr": "^3.3.1",
72
71
  "@open-wc/testing": "^4.0.0",
73
72
  "@playwright/test": "^1.54.2",
74
73
  "@rollup/plugin-commonjs": "^28.0.2",
@@ -90,8 +89,8 @@
90
89
  "@types/istanbul-lib-report": "^3.0.3",
91
90
  "@types/istanbul-reports": "^3.0.4",
92
91
  "@types/mocha": "^10.0.10",
92
+ "@types/serialize-javascript": "^5.0.4",
93
93
  "@types/sinon": "^17.0.3",
94
- "@typescript-eslint/rule-tester": "^8.33.0",
95
94
  "@typescript-eslint/types": "^8.33.0",
96
95
  "@typescript-eslint/utils": "^8.33.0",
97
96
  "@web/dev-server-esbuild": "^1.0.4",
@@ -135,6 +134,7 @@
135
134
  "react": "^19.1.0",
136
135
  "react-dom": "^19.1.0",
137
136
  "rimraf": "^6.0.1",
137
+ "serialize-javascript": "^6.0.2",
138
138
  "sinon": "^19.0.2",
139
139
  "storybook": "^8.6.14",
140
140
  "stylelint": "^16.21.1",
@@ -189,7 +189,7 @@
189
189
  "test:development:playwright": "npm-run-all --parallel test:development:playwright:coverage test:development:playwright:ui",
190
190
  "test:development:playwright:coverage": "http-server ./dist/playwright/coverage-report --port 6008 --silent",
191
191
  "test:development:playwright:ui": "playwright test --config ./src/playwright/playwright.config.ts --ui-port 6007 --update-snapshots --update-source-method=overwrite",
192
- "test:development:playwright:update": "PLAYWRIGHT_SKIP_COVERAGE=true playwright test --config ./src/playwright/playwright.config.ts --quiet --project accessibility --update-snapshots --update-source-method=overwrite --workers 100%",
192
+ "test:development:playwright:update": "PLAYWRIGHT_SKIP_COVERAGE=true playwright test --config ./src/playwright/playwright.config.ts --quiet --grep @accessibility --update-snapshots --update-source-method=overwrite --workers 100%",
193
193
  "test:development:web-test-runner": "web-test-runner --watch",
194
194
  "test:production": "pnpm start:production:esbuild && npm-run-all --aggregate-output --print-label --parallel test:production:*",
195
195
  "test:production:playwright": "playwright test --config ./src/playwright/playwright.config.ts --grep 'is accessible|@eslint|@events|@forms|@keyboard|@miscellaneous|@mouse|@stylelint'",
@@ -1,2 +0,0 @@
1
- declare const _default: "open" | "closed";
2
- export default _default;
@@ -1,4 +0,0 @@
1
- // This one-liner exists for code coverage purposes. Components
2
- // can't inline the ternary because the alternate branch is
3
- // untestable.
4
- export default window.navigator.webdriver ? 'open' : 'closed';