@crowdstrike/glide-core 0.9.6 → 0.10.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 (207) hide show
  1. package/README.md +17 -53
  2. package/dist/accordion.d.ts +10 -10
  3. package/dist/accordion.js +1 -1
  4. package/dist/accordion.stories.d.ts +0 -1
  5. package/dist/accordion.styles.js +36 -38
  6. package/dist/accordion.test.basics.js +13 -95
  7. package/dist/accordion.test.events.js +21 -33
  8. package/dist/accordion.test.focus.d.ts +1 -0
  9. package/dist/accordion.test.focus.js +11 -0
  10. package/dist/accordion.test.interactions.d.ts +1 -0
  11. package/dist/accordion.test.interactions.js +75 -0
  12. package/dist/button-group.button.d.ts +2 -4
  13. package/dist/button-group.button.js +1 -1
  14. package/dist/button-group.button.styles.js +6 -14
  15. package/dist/button-group.button.test.basics.js +8 -17
  16. package/dist/button-group.button.test.interactions.js +4 -4
  17. package/dist/button-group.d.ts +0 -2
  18. package/dist/button-group.test.basics.js +10 -10
  19. package/dist/button-group.test.events.js +2 -2
  20. package/dist/button-group.test.interactions.js +1 -1
  21. package/dist/button.d.ts +7 -10
  22. package/dist/button.js +1 -1
  23. package/dist/button.styles.js +4 -7
  24. package/dist/button.test.basics.js +10 -26
  25. package/dist/button.test.events.js +9 -9
  26. package/dist/checkbox-group.d.ts +3 -4
  27. package/dist/checkbox-group.js +1 -1
  28. package/dist/checkbox-group.styles.js +13 -1
  29. package/dist/checkbox-group.test.basics.js +8 -12
  30. package/dist/checkbox-group.test.focus.js +7 -7
  31. package/dist/checkbox-group.test.interactions.d.ts +1 -0
  32. package/dist/checkbox-group.test.interactions.js +82 -0
  33. package/dist/checkbox.d.ts +5 -4
  34. package/dist/checkbox.js +1 -1
  35. package/dist/checkbox.styles.js +35 -15
  36. package/dist/checkbox.test.basics.js +6 -15
  37. package/dist/checkbox.test.focus.js +4 -2
  38. package/dist/checkbox.test.interactions.js +11 -11
  39. package/dist/drawer.d.ts +2 -5
  40. package/dist/drawer.js +1 -1
  41. package/dist/drawer.test.accessibility.js +8 -8
  42. package/dist/drawer.test.basics.js +16 -16
  43. package/dist/drawer.test.closing.js +18 -16
  44. package/dist/drawer.test.events.js +13 -24
  45. package/dist/drawer.test.methods.js +22 -22
  46. package/dist/dropdown.d.ts +7 -5
  47. package/dist/dropdown.js +1 -1
  48. package/dist/dropdown.option.d.ts +1 -3
  49. package/dist/dropdown.option.js +1 -1
  50. package/dist/dropdown.option.styles.js +31 -19
  51. package/dist/dropdown.option.test.basics.js +4 -4
  52. package/dist/dropdown.styles.js +39 -3
  53. package/dist/dropdown.test.basics.js +8 -13
  54. package/dist/dropdown.test.basics.multiple.js +63 -31
  55. package/dist/dropdown.test.basics.single.js +49 -0
  56. package/dist/dropdown.test.focus.filterable.js +12 -3
  57. package/dist/dropdown.test.focus.js +18 -2
  58. package/dist/dropdown.test.interactions.filterable.js +121 -45
  59. package/dist/dropdown.test.interactions.multiple.js +71 -30
  60. package/dist/dropdown.test.interactions.single.js +26 -4
  61. package/dist/form-controls-layout.d.ts +0 -2
  62. package/dist/icon-button.d.ts +2 -4
  63. package/dist/icon-button.js +1 -1
  64. package/dist/icon-button.test.basics.js +14 -82
  65. package/dist/icon-button.test.focus.d.ts +1 -0
  66. package/dist/icon-button.test.focus.js +13 -0
  67. package/dist/input.d.ts +4 -5
  68. package/dist/input.js +1 -1
  69. package/dist/input.styles.js +4 -4
  70. package/dist/input.test.basics.js +0 -52
  71. package/dist/input.test.events.js +27 -27
  72. package/dist/input.test.focus.js +27 -26
  73. package/dist/input.test.form.js +6 -6
  74. package/dist/input.test.validity.js +130 -130
  75. package/dist/label.d.ts +1 -3
  76. package/dist/label.js +1 -1
  77. package/dist/label.styles.js +5 -6
  78. package/dist/label.test.basics.js +4 -4
  79. package/dist/library/ow.js +1 -1
  80. package/dist/menu.button.d.ts +0 -2
  81. package/dist/menu.button.test.basics.js +3 -3
  82. package/dist/menu.d.ts +1 -4
  83. package/dist/menu.js +1 -1
  84. package/dist/menu.link.d.ts +1 -2
  85. package/dist/menu.link.js +1 -1
  86. package/dist/menu.options.d.ts +0 -2
  87. package/dist/menu.test.events.js +6 -6
  88. package/dist/menu.test.focus.js +5 -18
  89. package/dist/menu.test.interactions.js +48 -24
  90. package/dist/modal.d.ts +6 -17
  91. package/dist/modal.icon-button.d.ts +0 -2
  92. package/dist/modal.icon-button.test.basics.js +3 -3
  93. package/dist/modal.js +1 -1
  94. package/dist/modal.styles.js +13 -19
  95. package/dist/modal.tertiary-icon.d.ts +0 -3
  96. package/dist/modal.tertiary-icon.test.basics.js +3 -3
  97. package/dist/modal.test.basics.js +9 -5
  98. package/dist/modal.test.close.js +2 -2
  99. package/dist/modal.test.events.js +2 -2
  100. package/dist/radio-group.d.ts +0 -3
  101. package/dist/radio-group.js +1 -1
  102. package/dist/radio-group.test.basics.js +61 -61
  103. package/dist/radio-group.test.events.js +13 -13
  104. package/dist/radio-group.test.focus.js +1 -1
  105. package/dist/radio-group.test.form.js +2 -2
  106. package/dist/radio-group.test.validity.js +12 -12
  107. package/dist/radio.d.ts +0 -3
  108. package/dist/radio.styles.js +4 -12
  109. package/dist/split-button.d.ts +8 -11
  110. package/dist/split-button.js +1 -1
  111. package/dist/split-button.primary-button.d.ts +21 -0
  112. package/dist/split-button.primary-button.js +1 -0
  113. package/dist/split-button.primary-button.styles.js +96 -0
  114. package/dist/split-button.primary-button.test.basics.d.ts +1 -0
  115. package/dist/split-button.primary-button.test.basics.js +31 -0
  116. package/dist/split-button.primary-button.test.focus.d.ts +1 -0
  117. package/dist/split-button.primary-button.test.focus.js +14 -0
  118. package/dist/split-button.primary-link.d.ts +19 -0
  119. package/dist/split-button.primary-link.js +1 -0
  120. package/dist/split-button.primary-link.test.basics.d.ts +1 -0
  121. package/dist/split-button.primary-link.test.basics.js +30 -0
  122. package/dist/split-button.primary-link.test.focus.d.ts +1 -0
  123. package/dist/split-button.primary-link.test.focus.js +15 -0
  124. package/dist/split-button.secondary-button.d.ts +25 -0
  125. package/dist/split-button.secondary-button.js +1 -0
  126. package/dist/split-button.secondary-button.styles.js +103 -0
  127. package/dist/split-button.secondary-button.test.basics.d.ts +1 -0
  128. package/dist/split-button.secondary-button.test.basics.js +58 -0
  129. package/dist/split-button.secondary-button.test.focus.d.ts +1 -0
  130. package/dist/split-button.secondary-button.test.focus.js +14 -0
  131. package/dist/split-button.secondary-button.test.interactions.d.ts +2 -0
  132. package/dist/split-button.secondary-button.test.interactions.js +30 -0
  133. package/dist/split-button.stories.d.ts +4 -3
  134. package/dist/split-button.styles.js +1 -94
  135. package/dist/split-button.test.basics.d.ts +2 -1
  136. package/dist/split-button.test.basics.js +67 -80
  137. package/dist/split-button.test.interactions.d.ts +4 -0
  138. package/dist/split-button.test.interactions.js +51 -0
  139. package/dist/styles/opacity-and-scale-animation.js +2 -6
  140. package/dist/styles/variables.css +1 -1
  141. package/dist/tab.d.ts +2 -11
  142. package/dist/tab.group.d.ts +2 -5
  143. package/dist/tab.group.styles.js +12 -15
  144. package/dist/tab.group.test.basics.js +49 -34
  145. package/dist/tab.group.test.interactions.js +17 -14
  146. package/dist/tab.panel.d.ts +0 -3
  147. package/dist/tab.test.basics.js +6 -5
  148. package/dist/tag.d.ts +6 -4
  149. package/dist/tag.js +1 -1
  150. package/dist/tag.styles.js +36 -36
  151. package/dist/tag.test.basics.js +16 -109
  152. package/dist/tag.test.events.js +12 -8
  153. package/dist/tag.test.focus.js +2 -3
  154. package/dist/tag.test.interactions.d.ts +1 -0
  155. package/dist/tag.test.interactions.js +34 -0
  156. package/dist/textarea.d.ts +2 -3
  157. package/dist/textarea.js +2 -2
  158. package/dist/textarea.test.basics.js +8 -8
  159. package/dist/textarea.test.events.js +55 -55
  160. package/dist/textarea.test.form.js +9 -9
  161. package/dist/textarea.test.validity.js +167 -135
  162. package/dist/toasts.d.ts +1 -5
  163. package/dist/toasts.test.basics.js +2 -1
  164. package/dist/toasts.toast.d.ts +1 -4
  165. package/dist/toasts.toast.js +1 -1
  166. package/dist/toasts.toast.styles.js +12 -0
  167. package/dist/toggle.d.ts +0 -2
  168. package/dist/toggle.styles.js +1 -5
  169. package/dist/toggle.test.basics.js +2 -2
  170. package/dist/toggle.test.interactions.js +7 -7
  171. package/dist/tooltip.d.ts +2 -1
  172. package/dist/tooltip.js +1 -1
  173. package/dist/tooltip.styles.js +36 -13
  174. package/dist/tooltip.test.basics.d.ts +1 -1
  175. package/dist/tooltip.test.basics.js +19 -19
  176. package/dist/tree.d.ts +0 -2
  177. package/dist/tree.item.d.ts +5 -7
  178. package/dist/tree.item.icon-button.d.ts +1 -4
  179. package/dist/tree.item.js +1 -1
  180. package/dist/tree.item.menu.d.ts +0 -2
  181. package/dist/tree.item.menu.test.basics.js +9 -9
  182. package/dist/tree.item.styles.js +4 -3
  183. package/dist/tree.item.test.basics.js +43 -31
  184. package/dist/tree.test.basics.js +29 -29
  185. package/dist/tree.test.focus.js +77 -74
  186. package/package.json +12 -14
  187. package/dist/split-container.d.ts +0 -31
  188. package/dist/split-container.js +0 -1
  189. package/dist/split-container.styles.js +0 -132
  190. package/dist/split-container.test.basics.d.ts +0 -3
  191. package/dist/split-container.test.basics.js +0 -445
  192. package/dist/split-container.test.interactions.d.ts +0 -1
  193. package/dist/split-container.test.interactions.js +0 -20
  194. package/dist/split-link.d.ts +0 -25
  195. package/dist/split-link.js +0 -1
  196. package/dist/split-link.test.basics.d.ts +0 -1
  197. package/dist/split-link.test.basics.js +0 -93
  198. package/dist/split-link.test.interactions.d.ts +0 -1
  199. package/dist/split-link.test.interactions.js +0 -20
  200. package/dist/status-indicator.d.ts +0 -30
  201. package/dist/status-indicator.js +0 -1
  202. package/dist/status-indicator.stories.d.ts +0 -5
  203. package/dist/status-indicator.styles.js +0 -58
  204. package/dist/status-indicator.test.basics.d.ts +0 -1
  205. package/dist/status-indicator.test.basics.js +0 -102
  206. /package/dist/{split-container.styles.d.ts → split-button.primary-button.styles.d.ts} +0 -0
  207. /package/dist/{status-indicator.styles.d.ts → split-button.secondary-button.styles.d.ts} +0 -0
@@ -31,36 +31,36 @@ it('renders appropriate attributes on glide-core-radio', async () => {
31
31
  </glide-core-radio-group>
32
32
  `);
33
33
  const radios = document.querySelectorAll('glide-core-radio');
34
- expect(radios[0]).to.have.attribute('value', 'value-1');
35
- expect(radios[0]).to.have.attribute('tabindex', '-1');
34
+ expect(radios[0].getAttribute('value')).to.equal('value-1');
35
+ expect(radios[0].getAttribute('tabindex')).to.equal('-1');
36
36
  expect(radios[0]).to.not.have.attribute('checked');
37
- expect(radios[0]).to.have.attribute('role', 'radio');
38
- expect(radios[0]).to.have.attribute('aria-checked', 'false');
39
- expect(radios[0]).to.have.attribute('aria-disabled', 'false');
40
- expect(radios[0]).to.have.attribute('aria-invalid', 'false');
41
- expect(radios[0]).to.have.attribute('aria-required', 'false');
42
- expect(radios[1]).to.have.attribute('value', 'value-2');
43
- expect(radios[1]).to.have.attribute('tabindex', '0');
44
- expect(radios[1]).to.have.attribute('checked');
45
- expect(radios[1]).to.have.attribute('role', 'radio');
46
- expect(radios[1]).to.have.attribute('aria-checked', 'true');
47
- expect(radios[1]).to.have.attribute('aria-disabled', 'false');
48
- expect(radios[1]).to.have.attribute('aria-invalid', 'false');
49
- expect(radios[1]).to.have.attribute('aria-required', 'false');
37
+ expect(radios[0].getAttribute('role')).to.equal('radio');
38
+ expect(radios[0].getAttribute('aria-checked')).to.equal('false');
39
+ expect(radios[0].getAttribute('aria-disabled')).to.equal('false');
40
+ expect(radios[0].getAttribute('aria-invalid')).to.equal('false');
41
+ expect(radios[0].getAttribute('aria-required')).to.equal('false');
42
+ expect(radios[1].getAttribute('value')).to.equal('value-2');
43
+ expect(radios[1].getAttribute('tabindex')).to.equal('0');
44
+ expect(radios[1].hasAttribute('checked')).to.be.true;
45
+ expect(radios[1].getAttribute('role')).to.equal('radio');
46
+ expect(radios[1].getAttribute('aria-checked')).to.equal('true');
47
+ expect(radios[1].getAttribute('aria-disabled')).to.equal('false');
48
+ expect(radios[1].getAttribute('aria-invalid')).to.equal('false');
49
+ expect(radios[1].getAttribute('aria-required')).to.equal('false');
50
50
  });
51
51
  it('renders a label, radio group, description, and tooltip when given', async () => {
52
- const group = await fixture(html `
52
+ const component = await fixture(html `
53
53
  <glide-core-radio-group label="label" name="name" value="value-1">
54
54
  <glide-core-radio value="value-1" label="One"></glide-core-radio>
55
55
  <span slot="tooltip" data-test="tooltip">Tooltip</span>
56
56
  <div slot="description" data-test="description">Description</div>
57
57
  </glide-core-radio-group>
58
58
  `);
59
- const label = group.shadowRoot?.querySelector('[data-test="label"]');
60
- const radioGroup = group?.shadowRoot?.querySelector('[role="radiogroup"]');
59
+ const label = component.shadowRoot?.querySelector('[data-test="label"]');
60
+ const radioGroup = component?.shadowRoot?.querySelector('[role="radiogroup"]');
61
61
  const tooltip = document.querySelector('[data-test="tooltip"]');
62
62
  const description = document?.querySelector('[data-test="description"]');
63
- expect(group).to.not.be.null;
63
+ expect(component).to.not.be.null;
64
64
  expect(label).to.not.be.null;
65
65
  expect(radioGroup).to.not.be.null;
66
66
  expect(tooltip).to.not.be.null;
@@ -84,10 +84,10 @@ it('sets "required" attributes on radios when "required" is set on the group', a
84
84
  </glide-core-radio-group>
85
85
  `);
86
86
  const radios = document.querySelectorAll('glide-core-radio');
87
- expect(radios[0]).to.have.attribute('required');
88
- expect(radios[0]).to.have.attribute('aria-required', 'true');
89
- expect(radios[1]).to.have.attribute('required');
90
- expect(radios[1]).to.have.attribute('aria-required', 'true');
87
+ expect(radios[0].hasAttribute('required')).to.be.true;
88
+ expect(radios[0].getAttribute('aria-required')).to.equal('true');
89
+ expect(radios[1].hasAttribute('required')).to.be.true;
90
+ expect(radios[1].getAttribute('aria-required')).to.equal('true');
91
91
  });
92
92
  it('does not set "required" attributes on radios when "required" is not set on the group', async () => {
93
93
  await fixture(html `
@@ -98,9 +98,9 @@ it('does not set "required" attributes on radios when "required" is not set on t
98
98
  `);
99
99
  const radios = document.querySelectorAll('glide-core-radio');
100
100
  expect(radios[0]).to.not.have.attribute('required');
101
- expect(radios[0]).to.have.attribute('aria-required', 'false');
101
+ expect(radios[0].getAttribute('aria-required')).to.equal('false');
102
102
  expect(radios[1]).to.not.have.attribute('required');
103
- expect(radios[1]).to.have.attribute('aria-required', 'false');
103
+ expect(radios[1].getAttribute('aria-required')).to.equal('false');
104
104
  });
105
105
  it('renders radios as "disabled" when "disabled" is set on the group', async () => {
106
106
  await fixture(html `
@@ -109,8 +109,8 @@ it('renders radios as "disabled" when "disabled" is set on the group', async ()
109
109
  </glide-core-radio-group>
110
110
  `);
111
111
  const radio = document.querySelector('glide-core-radio');
112
- expect(radio).to.have.attribute('disabled');
113
- expect(radio).to.have.attribute('aria-disabled', 'true');
112
+ expect(radio?.hasAttribute('disabled')).to.be.true;
113
+ expect(radio?.getAttribute('aria-disabled')).to.equal('true');
114
114
  expect(radio?.shadowRoot?.querySelector('.disabled')).to.be.not.null;
115
115
  });
116
116
  it('does not render radios as "disabled" when "disabled" is not set on the group', async () => {
@@ -121,7 +121,7 @@ it('does not render radios as "disabled" when "disabled" is not set on the group
121
121
  `);
122
122
  const radio = document.querySelector('glide-core-radio');
123
123
  expect(radio).to.not.have.attribute('disabled');
124
- expect(radio).to.have.attribute('aria-disabled', 'false');
124
+ expect(radio?.getAttribute('aria-disabled')).to.equal('false');
125
125
  expect(radio?.shadowRoot?.querySelector('.disabled')).to.be.null;
126
126
  });
127
127
  it('renders radios as "disabled" when "disabled" is dynamically set and removed on the group', async () => {
@@ -132,17 +132,17 @@ it('renders radios as "disabled" when "disabled" is dynamically set and removed
132
132
  `);
133
133
  const radio = document.querySelector('glide-core-radio');
134
134
  expect(radio).to.not.have.attribute('disabled');
135
- expect(radio).to.have.attribute('aria-disabled', 'false');
135
+ expect(radio?.getAttribute('aria-disabled')).to.equal('false');
136
136
  expect(radio?.shadowRoot?.querySelector('.disabled')).to.be.null;
137
137
  component.disabled = true;
138
138
  await elementUpdated(component);
139
- expect(radio).to.have.attribute('disabled');
140
- expect(radio).to.have.attribute('aria-disabled', 'true');
139
+ expect(radio?.hasAttribute('disabled')).to.be.true;
140
+ expect(radio?.getAttribute('aria-disabled')).to.equal('true');
141
141
  expect(radio?.shadowRoot?.querySelector('.disabled')).to.be.not.null;
142
142
  component.disabled = false;
143
143
  await elementUpdated(component);
144
144
  expect(radio).to.not.have.attribute('disabled');
145
- expect(radio).to.have.attribute('aria-disabled', 'false');
145
+ expect(radio?.getAttribute('aria-disabled')).to.equal('false');
146
146
  expect(radio?.shadowRoot?.querySelector('.disabled')).to.be.null;
147
147
  });
148
148
  it('sets the radio group to an empty value when no radio is "checked"', async () => {
@@ -156,9 +156,9 @@ it('sets the radio group to an empty value when no radio is "checked"', async ()
156
156
  expect(component.value).to.equal('');
157
157
  expect(radios.length).to.equal(2);
158
158
  expect(radios[0]).to.not.have.attribute('checked');
159
- expect(radios[0]).to.have.attribute('aria-checked', 'false');
159
+ expect(radios[0]?.getAttribute('aria-checked')).to.equal('false');
160
160
  expect(radios[1]).to.not.have.attribute('checked');
161
- expect(radios[1]).to.have.attribute('aria-checked', 'false');
161
+ expect(radios[1]?.getAttribute('aria-checked')).to.equal('false');
162
162
  });
163
163
  it('sets the group "value" when a radio is set as "checked"', async () => {
164
164
  await fixture(html `
@@ -168,7 +168,7 @@ it('sets the group "value" when a radio is set as "checked"', async () => {
168
168
  </glide-core-radio-group>
169
169
  `);
170
170
  const group = document.querySelector('glide-core-radio-group');
171
- expect(group).to.have.attribute('value', 'value-2');
171
+ expect(group?.getAttribute('value')).to.equal('value-2');
172
172
  });
173
173
  it('throws an error when an component other than `glide-core-radio` is a child of the default slot', async () => {
174
174
  await expectArgumentError(() => {
@@ -194,9 +194,9 @@ it('sets the first radio to be tabbable when none are checked', async () => {
194
194
  </glide-core-radio-group>`);
195
195
  const radios = document.querySelectorAll('glide-core-radio');
196
196
  expect(radios.length).to.equal(3);
197
- expect(radios[0]).to.have.attribute('tabindex', '0');
198
- expect(radios[1]).to.have.attribute('tabindex', '-1');
199
- expect(radios[2]).to.have.attribute('tabindex', '-1');
197
+ expect(radios[0]?.getAttribute('tabindex')).to.equal('0');
198
+ expect(radios[1]?.getAttribute('tabindex')).to.equal('-1');
199
+ expect(radios[2]?.getAttribute('tabindex')).to.equal('-1');
200
200
  });
201
201
  it('sets the first non-disabled radio as tabbable when none are checked', async () => {
202
202
  await fixture(html `<glide-core-radio-group name="name">
@@ -206,9 +206,9 @@ it('sets the first non-disabled radio as tabbable when none are checked', async
206
206
  </glide-core-radio-group>`);
207
207
  const radios = document.querySelectorAll('glide-core-radio');
208
208
  expect(radios.length).to.equal(3);
209
- expect(radios[0]).to.have.attribute('tabindex', '-1');
210
- expect(radios[1]).to.have.attribute('tabindex', '0');
211
- expect(radios[2]).to.have.attribute('tabindex', '-1');
209
+ expect(radios[0]?.getAttribute('tabindex')).to.equal('-1');
210
+ expect(radios[1]?.getAttribute('tabindex')).to.equal('0');
211
+ expect(radios[2]?.getAttribute('tabindex')).to.equal('-1');
212
212
  });
213
213
  it('no radios are tabbable when the group is "disabled"', async () => {
214
214
  await fixture(html `<glide-core-radio-group name="name" disabled>
@@ -222,9 +222,9 @@ it('no radios are tabbable when the group is "disabled"', async () => {
222
222
  </glide-core-radio-group>`);
223
223
  const radios = document.querySelectorAll('glide-core-radio');
224
224
  expect(radios.length).to.equal(3);
225
- expect(radios[0]).to.have.attribute('tabindex', '-1');
226
- expect(radios[1]).to.have.attribute('tabindex', '-1');
227
- expect(radios[2]).to.have.attribute('tabindex', '-1');
225
+ expect(radios[0]?.getAttribute('tabindex')).to.equal('-1');
226
+ expect(radios[1]?.getAttribute('tabindex')).to.equal('-1');
227
+ expect(radios[2]?.getAttribute('tabindex')).to.equal('-1');
228
228
  });
229
229
  it('disabled radios are not tabbable', async () => {
230
230
  await fixture(html `<glide-core-radio-group name="name">
@@ -233,8 +233,8 @@ it('disabled radios are not tabbable', async () => {
233
233
  </glide-core-radio-group>`);
234
234
  const radios = document.querySelectorAll('glide-core-radio');
235
235
  expect(radios.length).to.equal(2);
236
- expect(radios[0]).to.have.attribute('tabindex', '-1');
237
- expect(radios[1]).to.have.attribute('tabindex', '-1');
236
+ expect(radios[0]?.getAttribute('tabindex')).to.equal('-1');
237
+ expect(radios[1]?.getAttribute('tabindex')).to.equal('-1');
238
238
  });
239
239
  it('sets only the "checked" radio as tabbable', async () => {
240
240
  await fixture(html `<glide-core-radio-group name="name">
@@ -248,9 +248,9 @@ it('sets only the "checked" radio as tabbable', async () => {
248
248
  </glide-core-radio-group>`);
249
249
  const radios = document.querySelectorAll('glide-core-radio');
250
250
  expect(radios.length).to.equal(3);
251
- expect(radios[0]).to.have.attribute('tabindex', '-1');
252
- expect(radios[1]).to.have.attribute('tabindex', '-1');
253
- expect(radios[2]).to.have.attribute('tabindex', '0');
251
+ expect(radios[0]?.getAttribute('tabindex')).to.equal('-1');
252
+ expect(radios[1]?.getAttribute('tabindex')).to.equal('-1');
253
+ expect(radios[2]?.getAttribute('tabindex')).to.equal('0');
254
254
  });
255
255
  it('has reactive radio attribute "aria-checked"', async () => {
256
256
  await fixture(html `<glide-core-radio-group name="name">
@@ -258,13 +258,13 @@ it('has reactive radio attribute "aria-checked"', async () => {
258
258
  </glide-core-radio-group>`);
259
259
  const radio = document.querySelector('glide-core-radio');
260
260
  expect(radio).to.not.be.null;
261
- expect(radio).to.have.attribute('aria-checked', 'false');
261
+ expect(radio?.getAttribute('aria-checked')).to.equal('false');
262
262
  radio?.setAttribute('checked', '');
263
263
  await elementUpdated(radio);
264
- expect(radio).to.have.attribute('aria-checked', 'true');
264
+ expect(radio?.getAttribute('aria-checked')).to.equal('true');
265
265
  radio?.removeAttribute('checked');
266
266
  await elementUpdated(radio);
267
- expect(radio).to.have.attribute('aria-checked', 'false');
267
+ expect(radio?.getAttribute('aria-checked')).to.equal('false');
268
268
  });
269
269
  it('has reactive radio attribute "aria-disabled"', async () => {
270
270
  await fixture(html `<glide-core-radio-group name="name">
@@ -272,13 +272,13 @@ it('has reactive radio attribute "aria-disabled"', async () => {
272
272
  </glide-core-radio-group>`);
273
273
  const radio = document.querySelector('glide-core-radio');
274
274
  expect(radio).to.not.be.null;
275
- expect(radio).to.have.attribute('aria-disabled', 'false');
275
+ expect(radio?.getAttribute('aria-disabled')).to.equal('false');
276
276
  radio?.setAttribute('disabled', '');
277
277
  await elementUpdated(radio);
278
- expect(radio).to.have.attribute('aria-disabled', 'true');
278
+ expect(radio?.getAttribute('aria-disabled')).to.equal('true');
279
279
  radio?.removeAttribute('disabled');
280
280
  await elementUpdated(radio);
281
- expect(radio).to.have.attribute('aria-disabled', 'false');
281
+ expect(radio?.getAttribute('aria-disabled')).to.equal('false');
282
282
  });
283
283
  it('has reactive radio attribute "aria-required"', async () => {
284
284
  await fixture(html `<glide-core-radio-group name="name">
@@ -286,13 +286,13 @@ it('has reactive radio attribute "aria-required"', async () => {
286
286
  </glide-core-radio-group>`);
287
287
  const radio = document.querySelector('glide-core-radio');
288
288
  expect(radio).to.not.be.null;
289
- expect(radio).to.have.attribute('aria-required', 'false');
289
+ expect(radio?.getAttribute('aria-required')).to.equal('false');
290
290
  radio?.setAttribute('required', '');
291
291
  await elementUpdated(radio);
292
- expect(radio).to.have.attribute('aria-required', 'true');
292
+ expect(radio?.getAttribute('aria-required')).to.equal('true');
293
293
  radio?.removeAttribute('required');
294
294
  await elementUpdated(radio);
295
- expect(radio).to.have.attribute('aria-required', 'false');
295
+ expect(radio?.getAttribute('aria-required')).to.equal('false');
296
296
  });
297
297
  it('has reactive radio attribute "aria-invalid"', async () => {
298
298
  await fixture(html `<glide-core-radio-group name="name">
@@ -300,13 +300,13 @@ it('has reactive radio attribute "aria-invalid"', async () => {
300
300
  </glide-core-radio-group>`);
301
301
  const radio = document.querySelector('glide-core-radio');
302
302
  expect(radio).to.not.be.null;
303
- expect(radio).to.have.attribute('aria-invalid', 'false');
303
+ expect(radio?.getAttribute('aria-invalid')).to.equal('false');
304
304
  radio?.setAttribute('invalid', '');
305
305
  await elementUpdated(radio);
306
- expect(radio).to.have.attribute('aria-invalid', 'true');
306
+ expect(radio?.getAttribute('aria-invalid')).to.equal('true');
307
307
  radio?.removeAttribute('invalid');
308
308
  await elementUpdated(radio);
309
- expect(radio).to.have.attribute('aria-invalid', 'false');
309
+ expect(radio?.getAttribute('aria-invalid')).to.equal('false');
310
310
  });
311
311
  it('adds a label to radio when given', async () => {
312
312
  const component = await fixture(html `<glide-core-radio value="value-1" label="One"></glide-core-radio>`);
@@ -188,7 +188,7 @@ it('changes the "checked" attribute when clicking', async () => {
188
188
  radios[2].click();
189
189
  await elementUpdated(component);
190
190
  expect(radios[2]).to.have.focus;
191
- expect(radios[2]).to.have.attribute('checked');
191
+ expect(radios[2]?.hasAttribute('checked')).to.be.true;
192
192
  expect(radios[0]).to.not.have.attribute('checked');
193
193
  });
194
194
  it('does not change focus nor the "checked" attribute when clicking a disabled radio', async () => {
@@ -201,7 +201,7 @@ it('does not change focus nor the "checked" attribute when clicking a disabled r
201
201
  radios[1].click();
202
202
  await elementUpdated(component);
203
203
  expect(radios[0]).to.have.focus;
204
- expect(radios[0]).to.have.attribute('checked');
204
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
205
205
  expect(radios[1]).to.not.have.attribute('checked');
206
206
  });
207
207
  it('does not change focus nor the "checked" attribute when clicking a disabled group', async () => {
@@ -214,7 +214,7 @@ it('does not change focus nor the "checked" attribute when clicking a disabled g
214
214
  radios[1].click();
215
215
  await elementUpdated(component);
216
216
  expect(radios[0]).to.not.have.focus;
217
- expect(radios[0]).to.have.attribute('checked');
217
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
218
218
  expect(radios[1]).to.not.have.attribute('checked');
219
219
  });
220
220
  it('changes the "checked" attribute when pressing arrow and space keys', async () => {
@@ -227,24 +227,24 @@ it('changes the "checked" attribute when pressing arrow and space keys', async (
227
227
  await sendKeys({ press: 'Tab' });
228
228
  await sendKeys({ press: 'ArrowRight' });
229
229
  expect(radios[1]).to.have.focus;
230
- expect(radios[1]).to.have.attribute('checked');
230
+ expect(radios[1]?.hasAttribute('checked')).to.be.true;
231
231
  expect(radios[0]).to.not.have.attribute('checked');
232
232
  await sendKeys({ press: 'ArrowDown' });
233
233
  expect(radios[2]).to.have.focus;
234
- expect(radios[2]).to.have.attribute('checked');
234
+ expect(radios[2]?.hasAttribute('checked')).to.be.true;
235
235
  expect(radios[1]).to.not.have.attribute('checked');
236
236
  await sendKeys({ press: 'ArrowUp' });
237
237
  expect(radios[1]).to.have.focus;
238
- expect(radios[1]).to.have.attribute('checked');
238
+ expect(radios[1]?.hasAttribute('checked')).to.be.true;
239
239
  expect(radios[2]).to.not.have.attribute('checked');
240
240
  await sendKeys({ press: 'ArrowLeft' });
241
241
  expect(radios[0]).to.have.focus;
242
- expect(radios[0]).to.have.attribute('checked');
242
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
243
243
  expect(radios[1]).to.not.have.attribute('checked');
244
244
  radios[2].focus();
245
245
  await sendKeys({ press: ' ' });
246
246
  expect(radios[2]).to.have.focus;
247
- expect(radios[2]).to.have.attribute('checked');
247
+ expect(radios[2]?.hasAttribute('checked')).to.be.true;
248
248
  expect(radios[0]).to.not.have.attribute('checked');
249
249
  });
250
250
  it('does not change the "checked" attribute nor focus when pressing arrow and space keys when the group is disabled', async () => {
@@ -257,22 +257,22 @@ it('does not change the "checked" attribute nor focus when pressing arrow and sp
257
257
  radios[0].focus();
258
258
  await sendKeys({ press: 'ArrowRight' });
259
259
  expect(radios[0]).to.have.focus;
260
- expect(radios[0]).to.have.attribute('checked');
260
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
261
261
  expect(radios[2]).to.not.have.attribute('checked');
262
262
  await sendKeys({ press: 'ArrowDown' });
263
263
  expect(radios[0]).to.have.focus;
264
- expect(radios[0]).to.have.attribute('checked');
264
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
265
265
  expect(radios[2]).to.not.have.attribute('checked');
266
266
  await sendKeys({ press: 'ArrowUp' });
267
267
  expect(radios[0]).to.have.focus;
268
- expect(radios[0]).to.have.attribute('checked');
268
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
269
269
  expect(radios[1]).to.not.have.attribute('checked');
270
270
  await sendKeys({ press: 'ArrowLeft' });
271
271
  expect(radios[0]).to.have.focus;
272
- expect(radios[0]).to.have.attribute('checked');
272
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
273
273
  expect(radios[1]).to.not.have.attribute('checked');
274
274
  radios[1].focus();
275
275
  await sendKeys({ press: ' ' });
276
- expect(radios[0]).to.have.attribute('checked');
276
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
277
277
  expect(radios[1]).to.not.have.attribute('checked');
278
278
  });
@@ -88,7 +88,7 @@ it('reports validity if blurred', async () => {
88
88
  ?.hasAttribute('error')).to.be.false;
89
89
  await sendKeys({ press: 'Tab' });
90
90
  expect(document.activeElement === document.body).to.be.true;
91
- expect(component.validity.valid).to.equal(false);
91
+ expect(component.validity.valid).to.be.false;
92
92
  expect(component.shadowRoot
93
93
  ?.querySelector('glide-core-private-label')
94
94
  ?.hasAttribute('error')).to.be.true;
@@ -41,13 +41,13 @@ it('can reset correctly when the checked radios are changed', async () => {
41
41
  const radios = component.querySelectorAll('glide-core-radio');
42
42
  radios[0].click();
43
43
  await elementUpdated(component);
44
- expect(radios[0]).to.have.attribute('checked');
44
+ expect(radios[0]?.hasAttribute('checked')).to.be.true;
45
45
  expect(radios[1]).to.not.have.attribute('checked');
46
46
  expect(component.value).to.equal('value-1');
47
47
  form.reset();
48
48
  await elementUpdated(component);
49
49
  expect(radios[0]).to.not.have.attribute('checked');
50
- expect(radios[1]).to.have.attribute('checked');
50
+ expect(radios[1]?.hasAttribute('checked')).to.be.true;
51
51
  expect(component.value).to.equal('value-2');
52
52
  });
53
53
  it('has `formData` when a radio is checked', async () => {
@@ -81,9 +81,9 @@ it('adds an error class after `reportValidity` is called when invalid and requir
81
81
  expect(isComponentErrorClass).to.be.true;
82
82
  const radios = document.querySelectorAll('glide-core-radio');
83
83
  expect(radios[0]?.invalid).to.be.true;
84
- expect(radios[0]).to.have.attribute('aria-invalid', 'true');
84
+ expect(radios[0]?.getAttribute('aria-invalid')).to.equal('true');
85
85
  expect(radios[1]?.invalid).to.be.true;
86
- expect(radios[1]).to.have.attribute('aria-invalid', 'true');
86
+ expect(radios[1]?.getAttribute('aria-invalid')).to.equal('true');
87
87
  });
88
88
  it('does not add an error class by default', async () => {
89
89
  const form = document.createElement('form');
@@ -105,9 +105,9 @@ it('does not add an error class by default', async () => {
105
105
  ?.classList.contains('invalid');
106
106
  expect(isRadioError).to.be.false;
107
107
  expect(radios[0]?.invalid).to.be.false;
108
- expect(radios[0]).to.have.attribute('aria-invalid', 'false');
108
+ expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
109
109
  expect(radios[1]?.invalid).to.be.false;
110
- expect(radios[1]).to.have.attribute('aria-invalid', 'false');
110
+ expect(radios[1]?.getAttribute('aria-invalid')).to.equal('false');
111
111
  });
112
112
  it('does not add an error class after `reportValidity` is called when not required', async () => {
113
113
  const form = document.createElement('form');
@@ -131,9 +131,9 @@ it('does not add an error class after `reportValidity` is called when not requir
131
131
  ?.classList.contains('invalid');
132
132
  expect(isRadioError).to.be.false;
133
133
  expect(radios[0]?.invalid).to.be.false;
134
- expect(radios[0]).to.have.attribute('aria-invalid', 'false');
134
+ expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
135
135
  expect(radios[1]?.invalid).to.be.false;
136
- expect(radios[1]).to.have.attribute('aria-invalid', 'false');
136
+ expect(radios[1]?.getAttribute('aria-invalid')).to.equal('false');
137
137
  });
138
138
  it('does not add an error class after `reportValidity` is called when required and a radio is checked', async () => {
139
139
  const form = document.createElement('form');
@@ -157,9 +157,9 @@ it('does not add an error class after `reportValidity` is called when required a
157
157
  ?.classList.contains('invalid');
158
158
  expect(isRadioError).to.be.false;
159
159
  expect(radios[0]?.invalid).to.be.false;
160
- expect(radios[0]).to.have.attribute('aria-invalid', 'false');
160
+ expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
161
161
  expect(radios[1]?.invalid).to.be.false;
162
- expect(radios[1]).to.have.attribute('aria-invalid', 'false');
162
+ expect(radios[1]?.getAttribute('aria-invalid')).to.equal('false');
163
163
  });
164
164
  it('does not add an error class after `reportValidity` is called when required but disabled', async () => {
165
165
  const form = document.createElement('form');
@@ -183,9 +183,9 @@ it('does not add an error class after `reportValidity` is called when required b
183
183
  ?.classList.contains('invalid');
184
184
  expect(isRadioError).to.be.false;
185
185
  expect(radios[0]?.invalid).to.be.false;
186
- expect(radios[0]).to.have.attribute('aria-invalid', 'false');
186
+ expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
187
187
  expect(radios[1]?.invalid).to.be.false;
188
- expect(radios[1]).to.have.attribute('aria-invalid', 'false');
188
+ expect(radios[1]?.getAttribute('aria-invalid')).to.equal('false');
189
189
  });
190
190
  it('does not add an error class after `checkValidity` is called when required', async () => {
191
191
  const form = document.createElement('form');
@@ -209,9 +209,9 @@ it('does not add an error class after `checkValidity` is called when required',
209
209
  ?.classList.contains('invalid');
210
210
  expect(isRadioError).to.be.false;
211
211
  expect(radios[0]?.invalid).to.be.false;
212
- expect(radios[0]).to.have.attribute('aria-invalid', 'false');
212
+ expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
213
213
  expect(radios[1]?.invalid).to.be.false;
214
- expect(radios[1]).to.have.attribute('aria-invalid', 'false');
214
+ expect(radios[1]?.getAttribute('aria-invalid')).to.equal('false');
215
215
  });
216
216
  it('sets radios as valid initially when required', async () => {
217
217
  const form = document.createElement('form');
package/dist/radio.d.ts CHANGED
@@ -4,9 +4,6 @@ declare global {
4
4
  'glide-core-radio': GlideCoreRadio;
5
5
  }
6
6
  }
7
- /**
8
- * @description A radio element for use with `<glide-core-radio-group>`.
9
- */
10
7
  export default class GlideCoreRadio extends LitElement {
11
8
  #private;
12
9
  static shadowRootOptions: ShadowRootInit;
@@ -13,16 +13,6 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
13
13
  }
14
14
  }
15
15
 
16
- @media (prefers-reduced-motion: reduce) {
17
- /**
18
- ':host' is targeted here to increase specificity so that
19
- we don't need to use '!important' to turn off the animation.
20
- */
21
- :host .component .radio-circle.checked.animate::after {
22
- animation: none;
23
- }
24
- }
25
-
26
16
  :host {
27
17
  display: flex;
28
18
  outline: none;
@@ -74,8 +64,10 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
74
64
 
75
65
  &.animate {
76
66
  &.checked {
77
- &::after {
78
- animation: animate-radio 250ms cubic-bezier(0.25, 0, 0.3, 1);
67
+ @media (prefers-reduced-motion: no-preference) {
68
+ &::after {
69
+ animation: animate-radio 250ms cubic-bezier(0.25, 0, 0.3, 1);
70
+ }
79
71
  }
80
72
  }
81
73
  }
@@ -1,4 +1,3 @@
1
- import './menu.js';
2
1
  import { LitElement } from 'lit';
3
2
  declare global {
4
3
  interface HTMLElementTagNameMap {
@@ -6,22 +5,20 @@ declare global {
6
5
  }
7
6
  }
8
7
  /**
9
- * @description A button to be used in the `primary-action` slot of `glide-core-split-container`.
8
+ * @slot - One of `<glide-core-split-button-primary-button>` or `<glide-core-split-button-primary-link>`.
10
9
  *
11
- * @slot prefix - An optional icon slot to display before the label.
12
- * @slot - A label for the contents of the button.
10
+ * @slot secondary-button - One of `<glide-core-split-button-secondary-button>`.
13
11
  */
14
12
  export default class GlideCoreSplitButton extends LitElement {
15
13
  #private;
16
14
  static shadowRootOptions: ShadowRootInit;
17
15
  static styles: import("lit").CSSResult[];
18
- ariaControls: string | null;
19
- ariaExpanded: 'true' | 'false' | null;
20
- ariaHasPopup: 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | null;
21
- disabled: boolean;
22
- variant: 'primary' | 'secondary';
23
- size: 'large' | 'small';
16
+ get size(): 'large' | 'small';
17
+ set size(size: 'large' | 'small');
18
+ get variant(): 'primary' | 'secondary';
19
+ set variant(variant: 'primary' | 'secondary');
24
20
  firstUpdated(): void;
21
+ private get secondaryButtonElement();
22
+ private get primaryButtonElement();
25
23
  render(): import("lit").TemplateResult<1>;
26
- private hasPrefixSlot;
27
24
  }
@@ -1 +1 @@
1
- var __decorate=this&&this.__decorate||function(t,e,o,i){var l,r=arguments.length,a=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,i);else for(var s=t.length-1;s>=0;s--)(l=t[s])&&(a=(r<3?l(a):r>3?l(e,o,a):l(e,o))||a);return r>3&&a&&Object.defineProperty(e,o,a),a};import"./menu.js";import{LitElement,html}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{owSlot,owSlotType}from"./library/ow.js";import styles from"./split-button.styles.js";let GlideCoreSplitButton=class GlideCoreSplitButton extends LitElement{constructor(){super(...arguments),this.ariaControls=null,this.ariaExpanded=null,this.ariaHasPopup=null,this.disabled=!1,this.variant="primary",this.size="large",this.hasPrefixSlot=!1,this.#t=createRef(),this.#e=createRef()}static{this.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0,mode:"closed"}}static{this.styles=styles}firstUpdated(){owSlot(this.#t.value),owSlotType(this.#t.value,[Text])}render(){return html`<button aria-controls="${ifDefined(this.ariaControls??void 0)}" aria-expanded="${ifDefined(this.ariaExpanded??void 0)}" aria-haspopup="${ifDefined(this.ariaHasPopup??void 0)}" class="${classMap({component:!0,disabled:this.disabled,[this.variant]:!0,[this.size]:!0,"has-prefix":this.hasPrefixSlot})}" data-test="split-button" type="button" ?disabled="${this.disabled}"><slot name="prefix" @slotchange="${this.#o}" ${ref(this.#e)} data-test="prefix-slot"></slot><slot @slotchange="${this.#i}" ${ref(this.#t)} data-test="default-slot"></slot></button>`}#t;#e;#i(){owSlot(this.#t.value),owSlotType(this.#t.value,[Text])}#o(){const t=this.#e.value?.assignedNodes();this.hasPrefixSlot=!!(t&&t.length>0)}};__decorate([property({attribute:"aria-controls",reflect:!0})],GlideCoreSplitButton.prototype,"ariaControls",void 0),__decorate([property({attribute:"aria-expanded",reflect:!0})],GlideCoreSplitButton.prototype,"ariaExpanded",void 0),__decorate([property({attribute:"aria-haspopup",reflect:!0})],GlideCoreSplitButton.prototype,"ariaHasPopup",void 0),__decorate([property({type:Boolean,reflect:!0})],GlideCoreSplitButton.prototype,"disabled",void 0),__decorate([property({reflect:!0})],GlideCoreSplitButton.prototype,"variant",void 0),__decorate([property({reflect:!0})],GlideCoreSplitButton.prototype,"size",void 0),__decorate([state()],GlideCoreSplitButton.prototype,"hasPrefixSlot",void 0),GlideCoreSplitButton=__decorate([customElement("glide-core-split-button")],GlideCoreSplitButton);export default GlideCoreSplitButton;
1
+ var __decorate=this&&this.__decorate||function(t,e,o,n){var i,r=arguments.length,l=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(l=(r<3?i(l):r>3?i(e,o,l):i(e,o))||l);return r>3&&l&&Object.defineProperty(e,o,l),l};import{LitElement,html}from"lit";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import{owSlot,owSlotType}from"./library/ow.js";import GlideCoreSplitButtonPrimaryButton from"./split-button.primary-button.js";import GlideCoreSplitButtonPrimaryLink from"./split-button.primary-link.js";import GlideCoreSplitButtonSecondaryButton from"./split-button.secondary-button.js";import styles from"./split-button.styles.js";let GlideCoreSplitButton=class GlideCoreSplitButton extends LitElement{static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:"closed"}}static{this.styles=styles}get size(){return this.#t}set size(t){this.#t=t,this.primaryButtonElement&&(this.primaryButtonElement.privateSize=t),this.secondaryButtonElement&&(this.secondaryButtonElement.privateSize=t)}get variant(){return this.#e}set variant(t){this.#e=t,this.primaryButtonElement&&(this.primaryButtonElement.privateVariant=t),this.secondaryButtonElement&&(this.secondaryButtonElement.privateVariant=t)}firstUpdated(){owSlot(this.#o.value),owSlot(this.#n.value),owSlotType(this.#o.value,[GlideCoreSplitButtonPrimaryButton,GlideCoreSplitButtonPrimaryLink]),owSlotType(this.#n.value,[GlideCoreSplitButtonSecondaryButton])}get secondaryButtonElement(){const t=this.#n.value?.assignedElements().at(0);if(t instanceof GlideCoreSplitButtonSecondaryButton)return t}get primaryButtonElement(){const t=this.#o.value?.assignedElements().at(0);if(t instanceof GlideCoreSplitButtonPrimaryButton||t instanceof GlideCoreSplitButtonPrimaryLink)return t}render(){return html`<div class="component"><slot @slotchange="${this.#i}" ${ref(this.#o)}></slot><slot name="secondary-button" @slotchange="${this.#r}" ${ref(this.#n)}></slot></div>`}#o=createRef();#n=createRef();#t="large";#e="primary";#i(){owSlot(this.#o.value),owSlotType(this.#o.value,[GlideCoreSplitButtonPrimaryButton,GlideCoreSplitButtonPrimaryLink]),this.primaryButtonElement&&(this.primaryButtonElement.privateSize=this.size,this.primaryButtonElement.privateVariant=this.variant)}#r(){owSlotType(this.#n.value,[GlideCoreSplitButtonSecondaryButton]),this.secondaryButtonElement&&(this.secondaryButtonElement.privateSize=this.size,this.secondaryButtonElement.privateVariant=this.variant)}};__decorate([property({reflect:!0})],GlideCoreSplitButton.prototype,"size",null),__decorate([property({reflect:!0})],GlideCoreSplitButton.prototype,"variant",null),GlideCoreSplitButton=__decorate([customElement("glide-core-split-button")],GlideCoreSplitButton);export default GlideCoreSplitButton;
@@ -0,0 +1,21 @@
1
+ import { LitElement } from 'lit';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'glide-core-split-button-primary-button': GlideCoreSplitButtonPrimaryButton;
5
+ }
6
+ }
7
+ /**
8
+ * @slot icon - An optional icon before the label.
9
+ */
10
+ export default class GlideCoreSplitButtonPrimaryButton extends LitElement {
11
+ static shadowRootOptions: ShadowRootInit;
12
+ static styles: import("lit").CSSResult[];
13
+ ariaControls: string | null;
14
+ ariaExpanded: 'true' | 'false' | null;
15
+ ariaHasPopup: 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | null;
16
+ disabled: boolean;
17
+ label?: string;
18
+ privateSize: 'large' | 'small';
19
+ privateVariant: 'primary' | 'secondary';
20
+ render(): import("lit").TemplateResult<1>;
21
+ }
@@ -0,0 +1 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,o,r){var i,a=arguments.length,l=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,r);else for(var p=t.length-1;p>=0;p--)(i=t[p])&&(l=(a<3?i(l):a>3?i(e,o,l):i(e,o))||l);return a>3&&l&&Object.defineProperty(e,o,l),l};import{LitElement,html}from"lit";import{classMap}from"lit/directives/class-map.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import styles from"./split-button.primary-button.styles.js";let GlideCoreSplitButtonPrimaryButton=class GlideCoreSplitButtonPrimaryButton extends LitElement{constructor(){super(...arguments),this.ariaControls=null,this.ariaExpanded=null,this.ariaHasPopup=null,this.disabled=!1,this.privateSize="large",this.privateVariant="primary"}static{this.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0,mode:"closed"}}static{this.styles=styles}render(){return html`<button aria-controls="${ifDefined(this.ariaControls??void 0)}" aria-expanded="${ifDefined(this.ariaExpanded??void 0)}" aria-haspopup="${ifDefined(this.ariaHasPopup??void 0)}" class="${classMap({component:!0,disabled:this.disabled,[this.privateVariant]:!0,[this.privateSize]:!0})}" data-test="component" type="button" ?disabled="${this.disabled}"><slot name="icon"></slot>${this.label}</button>`}};__decorate([property({attribute:"aria-controls",reflect:!0})],GlideCoreSplitButtonPrimaryButton.prototype,"ariaControls",void 0),__decorate([property({attribute:"aria-expanded",reflect:!0})],GlideCoreSplitButtonPrimaryButton.prototype,"ariaExpanded",void 0),__decorate([property({attribute:"aria-haspopup",reflect:!0})],GlideCoreSplitButtonPrimaryButton.prototype,"ariaHasPopup",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreSplitButtonPrimaryButton.prototype,"disabled",void 0),__decorate([property({reflect:!0})],GlideCoreSplitButtonPrimaryButton.prototype,"label",void 0),__decorate([state()],GlideCoreSplitButtonPrimaryButton.prototype,"privateSize",void 0),__decorate([state()],GlideCoreSplitButtonPrimaryButton.prototype,"privateVariant",void 0),GlideCoreSplitButtonPrimaryButton=__decorate([customElement("glide-core-split-button-primary-button")],GlideCoreSplitButtonPrimaryButton);export default GlideCoreSplitButtonPrimaryButton;