@crowdstrike/glide-core 0.29.2 → 0.30.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 (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 +14 -7
  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 +34 -17
  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
@@ -1 +1,211 @@
1
- var __decorate=this&&this.__decorate||function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{customElement,property,state}from"lit/decorators.js";import packageJson from"../package.json"with{type:"json"};import styles from"./radio-group.radio.styles.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let RadioGroupRadio=class RadioGroupRadio extends LitElement{constructor(){super(...arguments),this.version=packageJson.version,this.#e=!1,this.#t=!1,this.#i=!1,this.#a=!1,this.#r=""}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}get label(){return this.#o}set label(e){this.#o=e,this.ariaLabel=e.toString()}get checked(){return this.#e}set checked(e){const t=this.#e;this.#e=e,this.ariaChecked=e&&!this.disabled?"true":"false",e&&t!==e&&(this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.dispatchEvent(new CustomEvent("private-checked-change",{bubbles:!0,detail:{old:t,new:e}}))}get disabled(){return this.#t}set disabled(e){this.#t=e,this.ariaDisabled=e.toString(),this.ariaChecked=this.checked&&!e?"true":"false",this.dispatchEvent(new CustomEvent("private-disabled-change",{bubbles:!0}))}get privateInvalid(){return this.#i}set privateInvalid(e){this.#i=e,this.ariaInvalid=e.toString()}get privateRequired(){return this.#a}set privateRequired(e){this.#a=e,this.ariaRequired=e.toString()}get value(){return this.#r}set value(e){const t=this.#r;this.#r=e,this.dispatchEvent(new CustomEvent("private-value-change",{bubbles:!0,detail:{old:t,new:e}}))}firstUpdated(){this.ariaChecked=this.checked&&!this.disabled&&this===this.lastCheckedRadio?"true":"false",this.ariaDisabled=this.disabled.toString(),this.ariaInvalid=this.privateInvalid.toString(),this.ariaRequired=this.privateRequired.toString(),this.role="radio",this.label&&(this.ariaLabel=this.label)}get lastCheckedRadio(){const e=this.parentElement?.querySelectorAll("glide-core-radio-group-radio");if(e&&e.length>0)return[...e].findLast((e=>e.checked))}render(){return html`<div class="${classMap({component:!0,disabled:this.disabled})}" data-test="component"><div class="${classMap({circle:!0,checked:this.checked&&this===this.lastCheckedRadio&&!this.disabled,disabled:this.disabled,animate:this.hasUpdated})}" data-test="radio"></div>${this.#o}</div>`}#e;#t;#o;#i;#a;#r};__decorate([property({reflect:!0}),required],RadioGroupRadio.prototype,"label",null),__decorate([property({type:Boolean,reflect:!0})],RadioGroupRadio.prototype,"checked",null),__decorate([property({type:Boolean,reflect:!0})],RadioGroupRadio.prototype,"disabled",null),__decorate([property({type:Boolean})],RadioGroupRadio.prototype,"privateInvalid",null),__decorate([property({type:Boolean,reflect:!0})],RadioGroupRadio.prototype,"privateRequired",null),__decorate([property()],RadioGroupRadio.prototype,"value",null),__decorate([property({reflect:!0})],RadioGroupRadio.prototype,"version",void 0),__decorate([state()],RadioGroupRadio.prototype,"lastCheckedRadio",null),RadioGroupRadio=__decorate([customElement("glide-core-radio-group-radio"),final],RadioGroupRadio);export default RadioGroupRadio;
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"lit";import focusOutline from"./styles/focus-outline.js";export default[css`
2
- ${focusOutline(":host(:focus-visible) .component .circle")}
3
- `,css`
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"lit";export default[css`
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
+ ];