@crowdstrike/glide-core 0.9.5 → 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.
- package/README.md +17 -53
- package/dist/accordion.d.ts +10 -10
- package/dist/accordion.js +1 -1
- package/dist/accordion.stories.d.ts +0 -1
- package/dist/accordion.styles.js +36 -38
- package/dist/accordion.test.basics.js +13 -95
- package/dist/accordion.test.events.js +21 -33
- package/dist/accordion.test.focus.d.ts +1 -0
- package/dist/accordion.test.focus.js +11 -0
- package/dist/accordion.test.interactions.d.ts +1 -0
- package/dist/accordion.test.interactions.js +75 -0
- package/dist/button-group.button.d.ts +2 -4
- package/dist/button-group.button.js +1 -1
- package/dist/button-group.button.styles.js +6 -14
- package/dist/button-group.button.test.basics.js +8 -17
- package/dist/button-group.button.test.interactions.js +4 -4
- package/dist/button-group.d.ts +0 -2
- package/dist/button-group.test.basics.js +10 -10
- package/dist/button-group.test.events.js +2 -2
- package/dist/button-group.test.interactions.js +1 -1
- package/dist/button.d.ts +7 -10
- package/dist/button.js +1 -1
- package/dist/button.styles.js +4 -7
- package/dist/button.test.basics.js +10 -26
- package/dist/button.test.events.js +9 -9
- package/dist/checkbox-group.d.ts +3 -4
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox-group.styles.js +13 -1
- package/dist/checkbox-group.test.basics.js +8 -12
- package/dist/checkbox-group.test.focus.js +7 -7
- package/dist/checkbox-group.test.interactions.d.ts +1 -0
- package/dist/checkbox-group.test.interactions.js +82 -0
- package/dist/checkbox.d.ts +5 -4
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.styles.js +35 -15
- package/dist/checkbox.test.basics.js +6 -15
- package/dist/checkbox.test.focus.js +4 -2
- package/dist/checkbox.test.interactions.js +11 -11
- package/dist/drawer.d.ts +2 -5
- package/dist/drawer.js +1 -1
- package/dist/drawer.test.accessibility.js +8 -8
- package/dist/drawer.test.basics.js +16 -16
- package/dist/drawer.test.closing.js +18 -16
- package/dist/drawer.test.events.js +13 -24
- package/dist/drawer.test.methods.js +22 -22
- package/dist/dropdown.d.ts +7 -5
- package/dist/dropdown.js +1 -1
- package/dist/dropdown.option.d.ts +1 -3
- package/dist/dropdown.option.js +1 -1
- package/dist/dropdown.option.styles.js +31 -19
- package/dist/dropdown.option.test.basics.js +4 -4
- package/dist/dropdown.styles.js +39 -3
- package/dist/dropdown.test.basics.js +8 -13
- package/dist/dropdown.test.basics.multiple.js +63 -31
- package/dist/dropdown.test.basics.single.js +49 -0
- package/dist/dropdown.test.focus.filterable.js +12 -3
- package/dist/dropdown.test.focus.js +18 -2
- package/dist/dropdown.test.interactions.filterable.js +121 -45
- package/dist/dropdown.test.interactions.multiple.js +71 -30
- package/dist/dropdown.test.interactions.single.js +26 -4
- package/dist/form-controls-layout.d.ts +0 -2
- package/dist/icon-button.d.ts +2 -4
- package/dist/icon-button.js +1 -1
- package/dist/icon-button.test.basics.js +14 -82
- package/dist/icon-button.test.focus.d.ts +1 -0
- package/dist/icon-button.test.focus.js +13 -0
- package/dist/input.d.ts +4 -5
- package/dist/input.js +1 -1
- package/dist/input.styles.js +4 -4
- package/dist/input.test.basics.js +0 -52
- package/dist/input.test.events.js +27 -27
- package/dist/input.test.focus.js +27 -26
- package/dist/input.test.form.js +6 -6
- package/dist/input.test.validity.js +130 -130
- package/dist/label.d.ts +1 -3
- package/dist/label.js +1 -1
- package/dist/label.styles.js +5 -6
- package/dist/label.test.basics.js +4 -4
- package/dist/library/ow.js +1 -1
- package/dist/menu.button.d.ts +0 -2
- package/dist/menu.button.test.basics.js +3 -3
- package/dist/menu.d.ts +1 -4
- package/dist/menu.js +1 -1
- package/dist/menu.link.d.ts +1 -2
- package/dist/menu.link.js +1 -1
- package/dist/menu.options.d.ts +0 -2
- package/dist/menu.test.events.js +6 -6
- package/dist/menu.test.focus.js +5 -18
- package/dist/menu.test.interactions.js +48 -24
- package/dist/modal.d.ts +6 -17
- package/dist/modal.icon-button.d.ts +0 -2
- package/dist/modal.icon-button.test.basics.js +3 -3
- package/dist/modal.js +1 -1
- package/dist/modal.styles.js +13 -19
- package/dist/modal.tertiary-icon.d.ts +0 -3
- package/dist/modal.tertiary-icon.test.basics.js +3 -3
- package/dist/modal.test.basics.js +9 -5
- package/dist/modal.test.close.js +2 -2
- package/dist/modal.test.events.js +2 -2
- package/dist/radio-group.d.ts +0 -3
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.test.basics.js +61 -61
- package/dist/radio-group.test.events.js +13 -13
- package/dist/radio-group.test.focus.js +1 -1
- package/dist/radio-group.test.form.js +2 -2
- package/dist/radio-group.test.validity.js +12 -12
- package/dist/radio.d.ts +0 -3
- package/dist/radio.styles.js +4 -12
- package/dist/split-button.d.ts +8 -11
- package/dist/split-button.js +1 -1
- package/dist/split-button.primary-button.d.ts +21 -0
- package/dist/split-button.primary-button.js +1 -0
- package/dist/split-button.primary-button.styles.js +96 -0
- package/dist/split-button.primary-button.test.basics.d.ts +1 -0
- package/dist/split-button.primary-button.test.basics.js +31 -0
- package/dist/split-button.primary-button.test.focus.d.ts +1 -0
- package/dist/split-button.primary-button.test.focus.js +14 -0
- package/dist/split-button.primary-link.d.ts +19 -0
- package/dist/split-button.primary-link.js +1 -0
- package/dist/split-button.primary-link.test.basics.d.ts +1 -0
- package/dist/split-button.primary-link.test.basics.js +30 -0
- package/dist/split-button.primary-link.test.focus.d.ts +1 -0
- package/dist/split-button.primary-link.test.focus.js +15 -0
- package/dist/split-button.secondary-button.d.ts +25 -0
- package/dist/split-button.secondary-button.js +1 -0
- package/dist/split-button.secondary-button.styles.js +103 -0
- package/dist/split-button.secondary-button.test.basics.d.ts +1 -0
- package/dist/split-button.secondary-button.test.basics.js +58 -0
- package/dist/split-button.secondary-button.test.focus.d.ts +1 -0
- package/dist/split-button.secondary-button.test.focus.js +14 -0
- package/dist/split-button.secondary-button.test.interactions.d.ts +2 -0
- package/dist/split-button.secondary-button.test.interactions.js +30 -0
- package/dist/split-button.stories.d.ts +4 -3
- package/dist/split-button.styles.js +1 -94
- package/dist/split-button.test.basics.d.ts +2 -1
- package/dist/split-button.test.basics.js +67 -80
- package/dist/split-button.test.interactions.d.ts +4 -0
- package/dist/split-button.test.interactions.js +51 -0
- package/dist/styles/opacity-and-scale-animation.js +2 -6
- package/dist/styles/variables.css +1 -1
- package/dist/tab.d.ts +2 -11
- package/dist/tab.group.d.ts +2 -5
- package/dist/tab.group.styles.js +12 -15
- package/dist/tab.group.test.basics.js +49 -34
- package/dist/tab.group.test.interactions.js +17 -14
- package/dist/tab.panel.d.ts +0 -3
- package/dist/tab.test.basics.js +6 -5
- package/dist/tag.d.ts +6 -4
- package/dist/tag.js +1 -1
- package/dist/tag.styles.js +36 -36
- package/dist/tag.test.basics.js +16 -109
- package/dist/tag.test.events.js +12 -8
- package/dist/tag.test.focus.js +2 -3
- package/dist/tag.test.interactions.d.ts +1 -0
- package/dist/tag.test.interactions.js +34 -0
- package/dist/textarea.d.ts +2 -3
- package/dist/textarea.js +2 -2
- package/dist/textarea.test.basics.js +8 -8
- package/dist/textarea.test.events.js +55 -55
- package/dist/textarea.test.form.js +9 -9
- package/dist/textarea.test.validity.js +167 -135
- package/dist/toasts.d.ts +1 -5
- package/dist/toasts.test.basics.js +2 -1
- package/dist/toasts.toast.d.ts +1 -4
- package/dist/toasts.toast.js +1 -1
- package/dist/toasts.toast.styles.js +12 -0
- package/dist/toggle.d.ts +0 -2
- package/dist/toggle.styles.js +1 -5
- package/dist/toggle.test.basics.js +2 -2
- package/dist/toggle.test.interactions.js +7 -7
- package/dist/tooltip.d.ts +2 -1
- package/dist/tooltip.js +1 -1
- package/dist/tooltip.styles.js +37 -14
- package/dist/tooltip.test.basics.d.ts +1 -1
- package/dist/tooltip.test.basics.js +19 -19
- package/dist/tree.d.ts +0 -2
- package/dist/tree.item.d.ts +5 -7
- package/dist/tree.item.icon-button.d.ts +1 -4
- package/dist/tree.item.js +1 -1
- package/dist/tree.item.menu.d.ts +0 -2
- package/dist/tree.item.menu.test.basics.js +9 -9
- package/dist/tree.item.styles.js +4 -3
- package/dist/tree.item.test.basics.js +43 -31
- package/dist/tree.test.basics.js +29 -29
- package/dist/tree.test.focus.js +77 -74
- package/package.json +12 -14
- package/dist/split-container.d.ts +0 -31
- package/dist/split-container.js +0 -1
- package/dist/split-container.styles.js +0 -132
- package/dist/split-container.test.basics.d.ts +0 -3
- package/dist/split-container.test.basics.js +0 -445
- package/dist/split-container.test.interactions.d.ts +0 -1
- package/dist/split-container.test.interactions.js +0 -20
- package/dist/split-link.d.ts +0 -25
- package/dist/split-link.js +0 -1
- package/dist/split-link.test.basics.d.ts +0 -1
- package/dist/split-link.test.basics.js +0 -93
- package/dist/split-link.test.interactions.d.ts +0 -1
- package/dist/split-link.test.interactions.js +0 -20
- package/dist/status-indicator.d.ts +0 -30
- package/dist/status-indicator.js +0 -1
- package/dist/status-indicator.stories.d.ts +0 -5
- package/dist/status-indicator.styles.js +0 -58
- package/dist/status-indicator.test.basics.d.ts +0 -1
- package/dist/status-indicator.test.basics.js +0 -102
- /package/dist/{split-container.styles.d.ts → split-button.primary-button.styles.d.ts} +0 -0
- /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.
|
35
|
-
expect(radios[0]).to.
|
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.
|
38
|
-
expect(radios[0]
|
39
|
-
expect(radios[0]
|
40
|
-
expect(radios[0]
|
41
|
-
expect(radios[0]
|
42
|
-
expect(radios[1]).to.
|
43
|
-
expect(radios[1]).to.
|
44
|
-
expect(radios[1]
|
45
|
-
expect(radios[1]).to.
|
46
|
-
expect(radios[1]
|
47
|
-
expect(radios[1]
|
48
|
-
expect(radios[1]
|
49
|
-
expect(radios[1]
|
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
|
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 =
|
60
|
-
const 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(
|
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]
|
88
|
-
expect(radios[0]
|
89
|
-
expect(radios[1]
|
90
|
-
expect(radios[1]
|
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]
|
101
|
+
expect(radios[0].getAttribute('aria-required')).to.equal('false');
|
102
102
|
expect(radios[1]).to.not.have.attribute('required');
|
103
|
-
expect(radios[1]
|
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.
|
113
|
-
expect(radio
|
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
|
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
|
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.
|
140
|
-
expect(radio
|
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
|
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]
|
159
|
+
expect(radios[0]?.getAttribute('aria-checked')).to.equal('false');
|
160
160
|
expect(radios[1]).to.not.have.attribute('checked');
|
161
|
-
expect(radios[1]
|
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.
|
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.
|
198
|
-
expect(radios[1]).to.
|
199
|
-
expect(radios[2]).to.
|
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.
|
210
|
-
expect(radios[1]).to.
|
211
|
-
expect(radios[2]).to.
|
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.
|
226
|
-
expect(radios[1]).to.
|
227
|
-
expect(radios[2]).to.
|
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.
|
237
|
-
expect(radios[1]).to.
|
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.
|
252
|
-
expect(radios[1]).to.
|
253
|
-
expect(radios[2]).to.
|
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
|
261
|
+
expect(radio?.getAttribute('aria-checked')).to.equal('false');
|
262
262
|
radio?.setAttribute('checked', '');
|
263
263
|
await elementUpdated(radio);
|
264
|
-
expect(radio
|
264
|
+
expect(radio?.getAttribute('aria-checked')).to.equal('true');
|
265
265
|
radio?.removeAttribute('checked');
|
266
266
|
await elementUpdated(radio);
|
267
|
-
expect(radio
|
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
|
275
|
+
expect(radio?.getAttribute('aria-disabled')).to.equal('false');
|
276
276
|
radio?.setAttribute('disabled', '');
|
277
277
|
await elementUpdated(radio);
|
278
|
-
expect(radio
|
278
|
+
expect(radio?.getAttribute('aria-disabled')).to.equal('true');
|
279
279
|
radio?.removeAttribute('disabled');
|
280
280
|
await elementUpdated(radio);
|
281
|
-
expect(radio
|
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
|
289
|
+
expect(radio?.getAttribute('aria-required')).to.equal('false');
|
290
290
|
radio?.setAttribute('required', '');
|
291
291
|
await elementUpdated(radio);
|
292
|
-
expect(radio
|
292
|
+
expect(radio?.getAttribute('aria-required')).to.equal('true');
|
293
293
|
radio?.removeAttribute('required');
|
294
294
|
await elementUpdated(radio);
|
295
|
-
expect(radio
|
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
|
303
|
+
expect(radio?.getAttribute('aria-invalid')).to.equal('false');
|
304
304
|
radio?.setAttribute('invalid', '');
|
305
305
|
await elementUpdated(radio);
|
306
|
-
expect(radio
|
306
|
+
expect(radio?.getAttribute('aria-invalid')).to.equal('true');
|
307
307
|
radio?.removeAttribute('invalid');
|
308
308
|
await elementUpdated(radio);
|
309
|
-
expect(radio
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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]
|
84
|
+
expect(radios[0]?.getAttribute('aria-invalid')).to.equal('true');
|
85
85
|
expect(radios[1]?.invalid).to.be.true;
|
86
|
-
expect(radios[1]
|
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]
|
108
|
+
expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
|
109
109
|
expect(radios[1]?.invalid).to.be.false;
|
110
|
-
expect(radios[1]
|
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]
|
134
|
+
expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
|
135
135
|
expect(radios[1]?.invalid).to.be.false;
|
136
|
-
expect(radios[1]
|
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]
|
160
|
+
expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
|
161
161
|
expect(radios[1]?.invalid).to.be.false;
|
162
|
-
expect(radios[1]
|
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]
|
186
|
+
expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
|
187
187
|
expect(radios[1]?.invalid).to.be.false;
|
188
|
-
expect(radios[1]
|
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]
|
212
|
+
expect(radios[0]?.getAttribute('aria-invalid')).to.equal('false');
|
213
213
|
expect(radios[1]?.invalid).to.be.false;
|
214
|
-
expect(radios[1]
|
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
package/dist/radio.styles.js
CHANGED
@@ -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
|
-
|
78
|
-
|
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
|
}
|
package/dist/split-button.d.ts
CHANGED
@@ -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
|
-
* @
|
8
|
+
* @slot - One of `<glide-core-split-button-primary-button>` or `<glide-core-split-button-primary-link>`.
|
10
9
|
*
|
11
|
-
* @slot
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
}
|
package/dist/split-button.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(t,e,o,
|
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;
|