@crowdstrike/glide-core 0.32.2 → 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 (59) 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 +7 -11
  5. package/dist/button.styles.js +10 -8
  6. package/dist/checkbox-group.js +8 -7
  7. package/dist/checkbox.d.ts +1 -0
  8. package/dist/checkbox.js +26 -17
  9. package/dist/checkbox.styles.js +1 -1
  10. package/dist/drawer.js +3 -2
  11. package/dist/dropdown.js +19 -18
  12. package/dist/dropdown.option.d.ts +2 -0
  13. package/dist/dropdown.option.js +26 -25
  14. package/dist/form-controls-layout.js +3 -2
  15. package/dist/icon-button.js +2 -2
  16. package/dist/inline-alert.js +3 -2
  17. package/dist/input.js +9 -9
  18. package/dist/label.js +3 -2
  19. package/dist/library/assert-slot.js +2 -2
  20. package/dist/library/assert-slot.test.js +92 -0
  21. package/dist/link.js +2 -2
  22. package/dist/menu.js +83 -44
  23. package/dist/menu.styles.js +1 -0
  24. package/dist/modal.icon-button.js +3 -2
  25. package/dist/modal.js +3 -2
  26. package/dist/option.d.ts +5 -0
  27. package/dist/option.js +28 -5
  28. package/dist/options.d.ts +2 -0
  29. package/dist/options.group.js +3 -2
  30. package/dist/options.js +7 -8
  31. package/dist/options.styles.js +0 -6
  32. package/dist/popover.js +3 -2
  33. package/dist/radio-group.js +4 -3
  34. package/dist/radio-group.radio.js +3 -2
  35. package/dist/select.d.ts +90 -0
  36. package/dist/select.js +532 -0
  37. package/dist/slider.js +7 -7
  38. package/dist/spinner.js +2 -2
  39. package/dist/split-button.js +3 -2
  40. package/dist/split-button.primary-button.js +2 -2
  41. package/dist/split-button.primary-link.js +2 -2
  42. package/dist/split-button.secondary-button.js +2 -2
  43. package/dist/styles/opacity-and-scale-animation.js +2 -1
  44. package/dist/styles/variables.css +7 -4
  45. package/dist/tab.group.js +3 -2
  46. package/dist/tab.js +3 -2
  47. package/dist/tab.panel.js +3 -2
  48. package/dist/tag.js +2 -2
  49. package/dist/textarea.d.ts +1 -0
  50. package/dist/textarea.js +19 -10
  51. package/dist/toast.js +2 -2
  52. package/dist/toast.toasts.js +3 -2
  53. package/dist/toggle.d.ts +1 -0
  54. package/dist/toggle.js +13 -4
  55. package/dist/tooltip.container.js +3 -2
  56. package/dist/tooltip.js +4 -7
  57. package/package.json +4 -4
  58. package/dist/library/shadow-root-mode.d.ts +0 -2
  59. package/dist/library/shadow-root-mode.js +0 -4
package/dist/options.js CHANGED
@@ -5,14 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { html, LitElement } from 'lit';
8
- import { classMap } from 'lit/directives/class-map.js';
9
8
  import { customElement, property } from 'lit/decorators.js';
10
9
  import { map } from 'lit/directives/map.js';
11
10
  import { when } from 'lit/directives/when.js';
12
11
  import { range } from 'lit/directives/range.js';
13
12
  import packageJson from '../package.json' with { type: 'json' };
14
13
  import styles from './options.styles.js';
15
- import shadowRootMode from './library/shadow-root-mode.js';
16
14
  import final from './library/final.js';
17
15
  import uniqueId from './library/unique-id.js';
18
16
  import assertSlot from './library/assert-slot.js';
@@ -47,6 +45,8 @@ import OptionsGroup from './options.group.js';
47
45
  * @attr {string} [version]
48
46
  *
49
47
  * @slot {Option | Text}
48
+ *
49
+ * @fires {Event} slotchange
50
50
  */
51
51
  let Options = class Options extends LitElement {
52
52
  constructor() {
@@ -66,10 +66,12 @@ let Options = class Options extends LitElement {
66
66
  this.tabIndex = -1;
67
67
  this.version = packageJson.version;
68
68
  }
69
+ /* c8 ignore start */
69
70
  static { this.shadowRootOptions = {
70
71
  ...LitElement.shadowRootOptions,
71
- mode: shadowRootMode,
72
+ mode: window.navigator.webdriver ? 'open' : 'closed',
72
73
  }; }
74
+ /* c8 ignore end */
73
75
  static { this.styles = styles; }
74
76
  render() {
75
77
  // Without `role="none"` VoiceOver doesn't announce how many options are available.
@@ -78,10 +80,7 @@ let Options = class Options extends LitElement {
78
80
  // `role="option"`).
79
81
  return html `<div class="component" role="none">
80
82
  <slot
81
- class=${classMap({
82
- 'default-slot': true,
83
- loading: this.privateLoading,
84
- })}
83
+ ?hidden=${this.privateLoading}
85
84
  @slotchange=${this.#onDefaultSlotChange}
86
85
  ${assertSlot([OptionsGroup, Option, Text], true)}
87
86
  >
@@ -96,7 +95,7 @@ let Options = class Options extends LitElement {
96
95
  </div>`;
97
96
  }
98
97
  #onDefaultSlotChange() {
99
- this.dispatchEvent(new Event('private-slot-change', { bubbles: true }));
98
+ this.dispatchEvent(new Event('slotchange', { bubbles: true }));
100
99
  }
101
100
  };
102
101
  __decorate([
@@ -11,11 +11,5 @@ export default [
11
11
  */
12
12
  display: block;
13
13
  }
14
-
15
- .default-slot {
16
- &.loading {
17
- display: none;
18
- }
19
- }
20
14
  `,
21
15
  ];
package/dist/popover.js CHANGED
@@ -13,7 +13,6 @@ import { customElement, property, state } from 'lit/decorators.js';
13
13
  import packageJson from '../package.json' with { type: 'json' };
14
14
  import styles from './popover.styles.js';
15
15
  import assertSlot from './library/assert-slot.js';
16
- import shadowRootMode from './library/shadow-root-mode.js';
17
16
  import final from './library/final.js';
18
17
  /**
19
18
  * @attr {boolean} [disabled=false]
@@ -76,10 +75,12 @@ let Popover = class Popover extends LitElement {
76
75
  this.open = false;
77
76
  };
78
77
  }
78
+ /* c8 ignore start */
79
79
  static { this.shadowRootOptions = {
80
80
  ...LitElement.shadowRootOptions,
81
- mode: shadowRootMode,
81
+ mode: window.navigator.webdriver ? 'open' : 'closed',
82
82
  }; }
83
+ /* c8 ignore end */
83
84
  static { this.styles = styles; }
84
85
  /**
85
86
  * @default false
@@ -17,7 +17,6 @@ import packageJson from '../package.json' with { type: 'json' };
17
17
  import RadioGroupRadio from './radio-group.radio.js';
18
18
  import styles from './radio-group.styles.js';
19
19
  import assertSlot from './library/assert-slot.js';
20
- import shadowRootMode from './library/shadow-root-mode.js';
21
20
  import final from './library/final.js';
22
21
  import required from './library/required.js';
23
22
  /**
@@ -64,10 +63,12 @@ import required from './library/required.js';
64
63
  */
65
64
  let RadioGroup = class RadioGroup extends LitElement {
66
65
  static { this.formAssociated = true; }
66
+ /* c8 ignore start */
67
67
  static { this.shadowRootOptions = {
68
68
  ...LitElement.shadowRootOptions,
69
- mode: shadowRootMode,
69
+ mode: window.navigator.webdriver ? 'open' : 'closed',
70
70
  }; }
71
+ /* c8 ignore end */
71
72
  static { this.styles = styles; }
72
73
  /**
73
74
  * @default false
@@ -334,7 +335,7 @@ let RadioGroup = class RadioGroup extends LitElement {
334
335
  reportValidity() {
335
336
  this.isReportValidityOrSubmit = true;
336
337
  const isValid = this.#internals.reportValidity();
337
- // Ensures that getters referencing `this.validity.valid` are updated.
338
+ // Ensures getters referencing `this.validity.valid` re-run.
338
339
  this.requestUpdate();
339
340
  return isValid;
340
341
  }
@@ -9,7 +9,6 @@ import { classMap } from 'lit/directives/class-map.js';
9
9
  import { customElement, property, state } from 'lit/decorators.js';
10
10
  import packageJson from '../package.json' with { type: 'json' };
11
11
  import styles from './radio-group.radio.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
  /**
@@ -34,10 +33,12 @@ let RadioGroupRadio = class RadioGroupRadio extends LitElement {
34
33
  this.#privateRequired = false;
35
34
  this.#value = '';
36
35
  }
36
+ /* c8 ignore start */
37
37
  static { this.shadowRootOptions = {
38
38
  ...LitElement.shadowRootOptions,
39
- mode: shadowRootMode,
39
+ mode: window.navigator.webdriver ? 'open' : 'closed',
40
40
  }; }
41
+ /* c8 ignore end */
41
42
  static { this.styles = styles; }
42
43
  /**
43
44
  * @default undefined
@@ -0,0 +1,90 @@
1
+ import { LitElement } from 'lit';
2
+ import type FormControl from './library/form-control.js';
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'glide-core-select': Select;
6
+ }
7
+ }
8
+ /**
9
+ * @attr {boolean} [disabled=false]
10
+ * @attr {boolean} [loading=false]
11
+ * @attr {string} [name='']
12
+ * @attr {number} [offset=4]
13
+ * @attr {boolean} [open=false]
14
+ * @attr {'bottom'|'left'|'right'|'top'|'bottom-start'|'bottom-end'|'left-start'|'left-end'|'right-start'|'right-end'|'top-start'|'top-end'} [placement='bottom-start'] - Select will try to move itself to the opposite of this value if not doing so would result in overflow. For example, if "bottom" results in overflow Menu will try "top" but not "right" or "left".
15
+ * @attr {boolean} [required=false]
16
+ * @attr {string[]} [value=[]]
17
+ *
18
+ * @readonly
19
+ * @attr {string} [version]
20
+ *
21
+ * @slot {Element}
22
+ * @slot {Element} target - The element to which Select will anchor. Can be any focusable element. If you want Select to be filterable, put an Input in this slot. Listen for Input's "input" event, then add and remove Option(s) from Select's default slot based on Input's value.
23
+ *
24
+ * @fires {Event} change
25
+ * @fires {Event} input
26
+ *
27
+ * @readonly
28
+ * @prop {HTMLFormElement | null} form
29
+ *
30
+ * @readonly
31
+ * @prop {ValidityState} validity
32
+ *
33
+ * @method checkValidity
34
+ * @returns boolean
35
+ *
36
+ * @method formAssociatedCallback
37
+ * @method formResetCallback
38
+ *
39
+ * @method reportValidity
40
+ * @returns boolean
41
+ *
42
+ * @method setValidity
43
+ * @param {ValidityStateFlags} [flags]
44
+ */
45
+ export default class Select extends LitElement implements Omit<FormControl, 'hideLabel' | 'orientation' | 'resetValidityFeedback' | 'setCustomValidity'> {
46
+ #private;
47
+ static formAssociated: boolean;
48
+ static shadowRootOptions: ShadowRootInit;
49
+ static styles: import("lit").CSSResult[];
50
+ disabled: boolean;
51
+ loading: boolean;
52
+ name: string;
53
+ /**
54
+ * @default 4
55
+ */
56
+ get offset(): number;
57
+ set offset(offset: number);
58
+ /**
59
+ * @default false
60
+ */
61
+ get open(): boolean;
62
+ set open(isOpen: boolean);
63
+ /**
64
+ * Select will try to move itself to the opposite of this value if not doing so would result in overflow.
65
+ * For example, if "bottom" results in overflow Menu will try "top" but not "right" or "left".
66
+ */
67
+ placement: 'bottom' | 'left' | 'right' | 'top' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end' | 'top-start' | 'top-end';
68
+ /**
69
+ * @default false
70
+ */
71
+ get required(): boolean;
72
+ set required(isRequired: boolean);
73
+ /**
74
+ * @default []
75
+ */
76
+ get value(): string[];
77
+ set value(value: string[]);
78
+ readonly version: string;
79
+ get form(): HTMLFormElement | null;
80
+ checkValidity(): boolean;
81
+ firstUpdated(): void;
82
+ formAssociatedCallback(): void;
83
+ formResetCallback(): void;
84
+ render(): import("lit").TemplateResult<1>;
85
+ reportValidity(): boolean;
86
+ setValidity(flags?: ValidityStateFlags): void;
87
+ get validity(): ValidityState;
88
+ constructor();
89
+ private isCheckingValidity;
90
+ }