@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.
Files changed (122) hide show
  1. package/dist/accordion.js +240 -1
  2. package/dist/accordion.styles.js +13 -7
  3. package/dist/button-group.button.js +143 -1
  4. package/dist/button-group.button.styles.js +43 -15
  5. package/dist/button-group.js +249 -1
  6. package/dist/button-group.styles.js +10 -5
  7. package/dist/button.js +206 -1
  8. package/dist/button.styles.js +12 -7
  9. package/dist/checkbox-group.js +479 -14
  10. package/dist/checkbox-group.styles.js +5 -2
  11. package/dist/checkbox.js +519 -32
  12. package/dist/checkbox.styles.js +10 -5
  13. package/dist/drawer.js +168 -1
  14. package/dist/drawer.styles.js +5 -2
  15. package/dist/dropdown.js +2423 -123
  16. package/dist/dropdown.option.js +536 -1
  17. package/dist/dropdown.option.styles.js +5 -2
  18. package/dist/dropdown.styles.js +15 -8
  19. package/dist/form-controls-layout.js +102 -1
  20. package/dist/form-controls-layout.styles.js +5 -2
  21. package/dist/icon-button.js +139 -1
  22. package/dist/icon-button.styles.js +19 -7
  23. package/dist/icons/checked.js +28 -1
  24. package/dist/icons/chevron.js +21 -1
  25. package/dist/icons/magnifying-glass.js +23 -1
  26. package/dist/icons/pencil.js +21 -1
  27. package/dist/icons/severity-critical.js +20 -1
  28. package/dist/icons/severity-informational.js +20 -1
  29. package/dist/icons/severity-medium.js +20 -1
  30. package/dist/icons/x.js +21 -1
  31. package/dist/inline-alert.js +118 -1
  32. package/dist/inline-alert.styles.js +5 -2
  33. package/dist/input.d.ts +8 -2
  34. package/dist/input.js +505 -41
  35. package/dist/input.styles.js +25 -4
  36. package/dist/label.js +303 -1
  37. package/dist/label.styles.js +11 -5
  38. package/dist/library/assert-slot.js +136 -1
  39. package/dist/library/expect-unhandled-rejection.js +14 -1
  40. package/dist/library/expect-window-error.js +26 -1
  41. package/dist/library/final.js +18 -1
  42. package/dist/library/form-control.js +1 -1
  43. package/dist/library/localize.js +10 -1
  44. package/dist/library/mouse.js +35 -1
  45. package/dist/library/on-resize.js +24 -1
  46. package/dist/library/required.js +35 -1
  47. package/dist/library/shadow-root-mode.js +4 -1
  48. package/dist/library/unique-id.js +3 -1
  49. package/dist/link.js +92 -1
  50. package/dist/link.styles.js +10 -5
  51. package/dist/menu.d.ts +3 -2
  52. package/dist/menu.js +1259 -1
  53. package/dist/menu.styles.js +35 -19
  54. package/dist/modal.d.ts +4 -0
  55. package/dist/modal.icon-button.js +60 -1
  56. package/dist/modal.icon-button.styles.js +5 -2
  57. package/dist/modal.js +473 -1
  58. package/dist/modal.styles.js +71 -22
  59. package/dist/option.d.ts +74 -0
  60. package/dist/option.js +498 -0
  61. package/dist/option.styles.js +140 -0
  62. package/dist/{menu.options.d.ts → options.d.ts} +5 -6
  63. package/dist/options.js +130 -0
  64. package/dist/options.styles.js +21 -0
  65. package/dist/popover.js +620 -1
  66. package/dist/popover.styles.js +11 -5
  67. package/dist/radio-group.js +624 -17
  68. package/dist/radio-group.radio.js +211 -1
  69. package/dist/radio-group.radio.styles.js +9 -4
  70. package/dist/radio-group.styles.js +5 -2
  71. package/dist/slider.js +1040 -61
  72. package/dist/slider.styles.js +9 -4
  73. package/dist/spinner.js +60 -1
  74. package/dist/spinner.styles.js +5 -2
  75. package/dist/split-button.js +116 -1
  76. package/dist/split-button.primary-button.js +100 -1
  77. package/dist/split-button.primary-button.styles.js +13 -6
  78. package/dist/split-button.primary-link.js +102 -1
  79. package/dist/split-button.secondary-button.d.ts +2 -3
  80. package/dist/split-button.secondary-button.js +121 -1
  81. package/dist/split-button.secondary-button.styles.js +12 -7
  82. package/dist/split-button.styles.js +9 -4
  83. package/dist/styles/focus-outline.js +9 -3
  84. package/dist/styles/fonts.css +6 -1
  85. package/dist/styles/opacity-and-scale-animation.js +6 -3
  86. package/dist/styles/skeleton.js +6 -3
  87. package/dist/styles/variables.css +410 -1
  88. package/dist/styles/visually-hidden.js +6 -3
  89. package/dist/tab.group.js +386 -1
  90. package/dist/tab.group.styles.js +5 -2
  91. package/dist/tab.js +133 -1
  92. package/dist/tab.panel.js +93 -1
  93. package/dist/tab.panel.styles.js +11 -5
  94. package/dist/tab.styles.js +9 -4
  95. package/dist/tag.js +207 -1
  96. package/dist/tag.styles.js +10 -5
  97. package/dist/textarea.js +353 -19
  98. package/dist/textarea.styles.js +23 -4
  99. package/dist/toast.js +130 -1
  100. package/dist/toast.toasts.js +248 -25
  101. package/dist/toast.toasts.styles.js +9 -4
  102. package/dist/toggle.js +178 -1
  103. package/dist/toggle.styles.js +25 -5
  104. package/dist/tooltip.container.js +130 -1
  105. package/dist/tooltip.container.styles.js +5 -2
  106. package/dist/tooltip.js +484 -1
  107. package/dist/tooltip.styles.js +21 -5
  108. package/dist/translations/en.js +36 -1
  109. package/dist/translations/fr.js +37 -1
  110. package/dist/translations/ja.js +37 -1
  111. package/package.json +8 -12
  112. package/dist/menu.button.d.ts +0 -42
  113. package/dist/menu.button.js +0 -1
  114. package/dist/menu.button.styles.js +0 -32
  115. package/dist/menu.link.d.ts +0 -44
  116. package/dist/menu.link.js +0 -1
  117. package/dist/menu.link.styles.js +0 -35
  118. package/dist/menu.options.js +0 -1
  119. package/dist/menu.options.styles.d.ts +0 -2
  120. package/dist/menu.options.styles.js +0 -20
  121. /package/dist/{menu.button.styles.d.ts → option.styles.d.ts} +0 -0
  122. /package/dist/{menu.link.styles.d.ts → options.styles.d.ts} +0 -0
@@ -0,0 +1,130 @@
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 { map } from 'lit/directives/map.js';
11
+ import { when } from 'lit/directives/when.js';
12
+ import { range } from 'lit/directives/range.js';
13
+ import packageJson from '../package.json' with { type: 'json' };
14
+ import styles from './options.styles.js';
15
+ import shadowRootMode from './library/shadow-root-mode.js';
16
+ import final from './library/final.js';
17
+ import uniqueId from './library/unique-id.js';
18
+ import assertSlot from './library/assert-slot.js';
19
+ import Option from './option.js';
20
+ // This component exists because Menu's target and its menu (`"role="menu"` or
21
+ // `role="listbox"`) both need to be in the light DOM so the target and menu can
22
+ // reference each other's IDs in ARIA attributes.
23
+ //
24
+ // Tooltip is in a similar situation but has no default slot. So we can simply take
25
+ // the value of its `label` attribute, pass it to Tooltip Container, then dump
26
+ // Tooltip Container into Tooltip's light DOM for consumers. We can't do the same
27
+ // for Menu because it necessarily has a default slot for Option(s) and arbitrary
28
+ // content.
29
+ //
30
+ // An alternative solution would be to require that consumers wrap their default
31
+ // slot content in any element. But doing so would be arguably more awkward than
32
+ // asking them to slot an element specifically for the purpose.
33
+ /**
34
+ * @attr {string} [aria-activedescendant='']
35
+ * @attr {string} [aria-labelledby='']
36
+ *
37
+ * @readonly
38
+ * @attr {string} [id]
39
+ *
40
+ * @attr {'menu'|'listbox'} [role='menu']
41
+ *
42
+ * @readonly
43
+ * @attr {number} [tabindex=-1]
44
+ *
45
+ * @readonly
46
+ * @attr {string} [version]
47
+ *
48
+ * @slot {Option | Text}
49
+ */
50
+ let Options = class Options extends LitElement {
51
+ constructor() {
52
+ super(...arguments);
53
+ // On the host because `role` is on the host.
54
+ this.ariaActivedescendant = '';
55
+ // On the host because `role` is on the host.
56
+ this.ariaLabelledby = '';
57
+ // On the host instead so screenreaders can find it when Menu's target references
58
+ // it via `aria-controls`.
59
+ this.id = uniqueId();
60
+ this.privateLoading = false;
61
+ // On the host because otherwise VoiceOver won't recongize it as belonging to
62
+ // Menu's target.
63
+ this.role = 'menu';
64
+ // On the host because `role` is on the host.
65
+ this.tabIndex = -1;
66
+ this.version = packageJson.version;
67
+ }
68
+ static { this.shadowRootOptions = {
69
+ ...LitElement.shadowRootOptions,
70
+ mode: shadowRootMode,
71
+ }; }
72
+ static { this.styles = styles; }
73
+ render() {
74
+ // Without `role="none"` VoiceOver doesn't announce how many options are available.
75
+ // Presumably because this element sits between the host (which has `role="menu" or
76
+ // `role="listbox"`) and Option(s) (which have `role="menuitem"` or
77
+ // `role="option"`).
78
+ return html `<div class="component" role="none">
79
+ <slot
80
+ class=${classMap({
81
+ 'default-slot': true,
82
+ loading: this.privateLoading,
83
+ })}
84
+ @slotchange=${this.#onDefaultSlotChange}
85
+ ${assertSlot([Option, Text], true)}
86
+ >
87
+ <!-- @type {Option | Text} -->
88
+ </slot>
89
+
90
+ ${when(this.privateLoading, () => {
91
+ return html `<div class="loading-feedback" data-test="loading-feedback">
92
+ ${map(range(7), () => html `<div></div>`)}
93
+ </div>`;
94
+ })}
95
+ </div>`;
96
+ }
97
+ #onDefaultSlotChange() {
98
+ this.dispatchEvent(new Event('private-slot-change', { bubbles: true }));
99
+ }
100
+ };
101
+ __decorate([
102
+ property({
103
+ attribute: 'aria-activedescendant',
104
+ reflect: true,
105
+ useDefault: true,
106
+ })
107
+ ], Options.prototype, "ariaActivedescendant", void 0);
108
+ __decorate([
109
+ property({ attribute: 'aria-labelledby', reflect: true, useDefault: true })
110
+ ], Options.prototype, "ariaLabelledby", void 0);
111
+ __decorate([
112
+ property({ reflect: true })
113
+ ], Options.prototype, "id", void 0);
114
+ __decorate([
115
+ property({ type: Boolean })
116
+ ], Options.prototype, "privateLoading", void 0);
117
+ __decorate([
118
+ property({ reflect: true })
119
+ ], Options.prototype, "role", void 0);
120
+ __decorate([
121
+ property({ attribute: 'tabindex', reflect: true, type: Number })
122
+ ], Options.prototype, "tabIndex", void 0);
123
+ __decorate([
124
+ property({ reflect: true })
125
+ ], Options.prototype, "version", void 0);
126
+ Options = __decorate([
127
+ customElement('glide-core-options'),
128
+ final
129
+ ], Options);
130
+ export default Options;
@@ -0,0 +1,21 @@
1
+ import { css } from 'lit';
2
+ import skeleton from './styles/skeleton.js';
3
+ export default [
4
+ css `
5
+ ${skeleton('.loading-feedback')}
6
+ `,
7
+ css `
8
+ :host {
9
+ /*
10
+ So consumers don't have to or don't forget to set it when they set "max-block-size".
11
+ */
12
+ display: block;
13
+ }
14
+
15
+ .default-slot {
16
+ &.loading {
17
+ display: none;
18
+ }
19
+ }
20
+ `,
21
+ ];