@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
package/dist/tree.test.focus.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
1
2
|
import './tree.js';
|
2
3
|
import { assert, expect, fixture, html } from '@open-wc/testing';
|
3
4
|
import { sendKeys } from '@web/test-runner-commands';
|
@@ -7,7 +8,7 @@ import GlideCoreTreeItemIconButton from './tree.item.icon-button.js';
|
|
7
8
|
import GlideCoreTreeItemMenu from './tree.item.menu.js';
|
8
9
|
GlideCoreTree.shadowRootOptions.mode = 'open';
|
9
10
|
it('focuses the first tree item when tree is focused, if there are no selected items', async () => {
|
10
|
-
const
|
11
|
+
const component = await fixture(html `
|
11
12
|
<glide-core-tree>
|
12
13
|
<glide-core-tree-item label="Child Item 1">
|
13
14
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -15,27 +16,27 @@ it('focuses the first tree item when tree is focused, if there are no selected i
|
|
15
16
|
<glide-core-tree-item label="Child Item 2"></glide-core-tree-item>
|
16
17
|
</glide-core-tree>
|
17
18
|
`);
|
18
|
-
|
19
|
-
const childItems =
|
19
|
+
component.dispatchEvent(new Event('focusin'));
|
20
|
+
const childItems = component.slotElements;
|
20
21
|
assert(document.activeElement instanceof GlideCoreTreeItem);
|
21
22
|
expect(document.activeElement?.label).to.equal(childItems[0].label);
|
22
23
|
});
|
23
24
|
it('focuses the selected tree item on `focus()`, if there is one', async () => {
|
24
|
-
const
|
25
|
+
const component = await fixture(html `
|
25
26
|
<glide-core-tree>
|
26
27
|
<glide-core-tree-item label="Child Item 1"></glide-core-tree-item>
|
27
28
|
<glide-core-tree-item label="Child Item 2"></glide-core-tree-item>
|
28
29
|
</glide-core-tree>
|
29
30
|
`);
|
30
|
-
const childItems =
|
31
|
-
|
32
|
-
|
33
|
-
await
|
31
|
+
const childItems = component.slotElements;
|
32
|
+
component.selectItem(childItems[1]);
|
33
|
+
component.dispatchEvent(new Event('focusin'));
|
34
|
+
await component.updateComplete;
|
34
35
|
assert(document.activeElement instanceof GlideCoreTreeItem);
|
35
36
|
expect(document.activeElement?.label).to.equal(childItems[1].label);
|
36
37
|
});
|
37
38
|
it('does not focus the selected tree item on `focus()` if collapsed', async () => {
|
38
|
-
const
|
39
|
+
const component = await fixture(html `
|
39
40
|
<glide-core-tree>
|
40
41
|
<glide-core-tree-item label="Child Item 1"> </glide-core-tree-item>
|
41
42
|
<glide-core-tree-item label="Child Item 2">
|
@@ -46,13 +47,13 @@ it('does not focus the selected tree item on `focus()` if collapsed', async () =
|
|
46
47
|
</glide-core-tree-item>
|
47
48
|
</glide-core-tree>
|
48
49
|
`);
|
49
|
-
const childItems =
|
50
|
-
|
51
|
-
await
|
52
|
-
expect(document.activeElement === childItems[0]).to.
|
50
|
+
const childItems = component.slotElements;
|
51
|
+
component.dispatchEvent(new Event('focusin'));
|
52
|
+
await component.updateComplete;
|
53
|
+
expect(document.activeElement === childItems[0]).to.be.true;
|
53
54
|
});
|
54
55
|
it('expands a tree item if right arrow is pressed', async () => {
|
55
|
-
const
|
56
|
+
const component = await fixture(html `
|
56
57
|
<glide-core-tree>
|
57
58
|
<glide-core-tree-item label="Child Item 1">
|
58
59
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -60,15 +61,15 @@ it('expands a tree item if right arrow is pressed', async () => {
|
|
60
61
|
<glide-core-tree-item label="Child Item 2"></glide-core-tree-item>
|
61
62
|
</glide-core-tree>
|
62
63
|
`);
|
63
|
-
const childItems =
|
64
|
-
|
64
|
+
const childItems = component.slotElements;
|
65
|
+
component.dispatchEvent(new Event('focusin'));
|
65
66
|
await sendKeys({ press: 'ArrowRight' });
|
66
|
-
expect(childItems[0].expanded).to.
|
67
|
+
expect(childItems[0].expanded).to.be.true;
|
67
68
|
assert(document.activeElement instanceof GlideCoreTreeItem);
|
68
69
|
expect(document.activeElement?.label).to.equal(childItems[0].label, 'focus does not move');
|
69
70
|
});
|
70
71
|
it(`focuses on an expanded tree item's child if right arrow is pressed`, async () => {
|
71
|
-
const
|
72
|
+
const component = await fixture(html `
|
72
73
|
<glide-core-tree>
|
73
74
|
<glide-core-tree-item label="Child Item 1" expanded>
|
74
75
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -76,14 +77,14 @@ it(`focuses on an expanded tree item's child if right arrow is pressed`, async (
|
|
76
77
|
<glide-core-tree-item label="Child Item 2"></glide-core-tree-item>
|
77
78
|
</glide-core-tree>
|
78
79
|
`);
|
79
|
-
const childItems =
|
80
|
-
|
80
|
+
const childItems = component.slotElements;
|
81
|
+
component.dispatchEvent(new Event('focusin'));
|
81
82
|
await sendKeys({ press: 'ArrowRight' });
|
82
83
|
assert(document.activeElement instanceof GlideCoreTreeItem);
|
83
84
|
expect(document.activeElement?.label).to.equal(childItems[0].slotElements[0].label);
|
84
85
|
});
|
85
86
|
it('collapses an expanded tree item if left arrow is pressed', async () => {
|
86
|
-
const
|
87
|
+
const component = await fixture(html `
|
87
88
|
<glide-core-tree>
|
88
89
|
<glide-core-tree-item label="Child Item 1" expanded>
|
89
90
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -91,15 +92,15 @@ it('collapses an expanded tree item if left arrow is pressed', async () => {
|
|
91
92
|
<glide-core-tree-item label="Child Item 2"></glide-core-tree-item>
|
92
93
|
</glide-core-tree>
|
93
94
|
`);
|
94
|
-
const childItems =
|
95
|
-
|
95
|
+
const childItems = component.slotElements;
|
96
|
+
component.dispatchEvent(new Event('focusin'));
|
96
97
|
await sendKeys({ press: 'ArrowLeft' });
|
97
|
-
expect(childItems[0].expanded).to.
|
98
|
+
expect(childItems[0].expanded).to.be.false;
|
98
99
|
assert(document.activeElement instanceof GlideCoreTreeItem);
|
99
100
|
expect(document.activeElement?.label).to.equal(childItems[0].label, 'focus does not move');
|
100
101
|
});
|
101
102
|
it(`focuses on a non-collapsible tree item's parent if left arrow is pressed`, async () => {
|
102
|
-
const
|
103
|
+
const component = await fixture(html `
|
103
104
|
<glide-core-tree>
|
104
105
|
<glide-core-tree-item label="Child Item 1" expanded non-collapsible>
|
105
106
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -107,7 +108,7 @@ it(`focuses on a non-collapsible tree item's parent if left arrow is pressed`, a
|
|
107
108
|
<glide-core-tree-item label="Child Item 2"></glide-core-tree-item>
|
108
109
|
</glide-core-tree>
|
109
110
|
`);
|
110
|
-
const childItems =
|
111
|
+
const childItems = component.slotElements;
|
111
112
|
const grandchildItems = childItems[0].slotElements;
|
112
113
|
grandchildItems[0].focus();
|
113
114
|
await sendKeys({ press: 'ArrowLeft' });
|
@@ -115,7 +116,7 @@ it(`focuses on a non-collapsible tree item's parent if left arrow is pressed`, a
|
|
115
116
|
expect(document.activeElement?.label).to.equal(childItems[0].label);
|
116
117
|
});
|
117
118
|
it(`focuses on a collapsed tree item's parent if left arrow is pressed`, async () => {
|
118
|
-
const
|
119
|
+
const component = await fixture(html `
|
119
120
|
<glide-core-tree>
|
120
121
|
<glide-core-tree-item expanded label="Child Item 1">
|
121
122
|
<glide-core-tree-item label="Grandchild Item 1">
|
@@ -127,14 +128,14 @@ it(`focuses on a collapsed tree item's parent if left arrow is pressed`, async (
|
|
127
128
|
<glide-core-tree-item label="Child Item 2"></glide-core-tree-item>
|
128
129
|
</glide-core-tree>
|
129
130
|
`);
|
130
|
-
const childItems =
|
131
|
+
const childItems = component.slotElements;
|
131
132
|
const grandchildItems = childItems[0].slotElements;
|
132
133
|
grandchildItems[0].focus();
|
133
134
|
await sendKeys({ press: 'ArrowLeft' });
|
134
|
-
expect(document.activeElement === childItems[0]).to.
|
135
|
+
expect(document.activeElement === childItems[0]).to.be.true;
|
135
136
|
});
|
136
137
|
it('moves down the non-expanded tree items with down arrow', async () => {
|
137
|
-
const
|
138
|
+
const component = await fixture(html `
|
138
139
|
<glide-core-tree>
|
139
140
|
<glide-core-tree-item label="Child Item 1" expanded>
|
140
141
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -145,8 +146,8 @@ it('moves down the non-expanded tree items with down arrow', async () => {
|
|
145
146
|
<glide-core-tree-item label="Child Item 3"></glide-core-tree-item>
|
146
147
|
</glide-core-tree>
|
147
148
|
`);
|
148
|
-
const childItems =
|
149
|
-
|
149
|
+
const childItems = component.slotElements;
|
150
|
+
component.dispatchEvent(new Event('focusin'));
|
150
151
|
await sendKeys({ press: 'ArrowDown' });
|
151
152
|
assert(document.activeElement instanceof GlideCoreTreeItem);
|
152
153
|
expect(document.activeElement?.label).to.equal(childItems[0].slotElements[0].label, 'moves to child item if expanded');
|
@@ -158,7 +159,7 @@ it('moves down the non-expanded tree items with down arrow', async () => {
|
|
158
159
|
expect(document.activeElement?.label).to.equal(childItems[2].label, 'Does not move if at the last item');
|
159
160
|
});
|
160
161
|
it('moves up the non-expanded tree items with up arrow', async () => {
|
161
|
-
const
|
162
|
+
const component = await fixture(html `
|
162
163
|
<glide-core-tree>
|
163
164
|
<glide-core-tree-item label="Child Item 1">
|
164
165
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -168,7 +169,7 @@ it('moves up the non-expanded tree items with up arrow', async () => {
|
|
168
169
|
</glide-core-tree-item>
|
169
170
|
</glide-core-tree>
|
170
171
|
`);
|
171
|
-
const childItems =
|
172
|
+
const childItems = component.slotElements;
|
172
173
|
// Start at the last item
|
173
174
|
childItems[1].slotElements[0].focus();
|
174
175
|
await sendKeys({ press: 'ArrowUp' });
|
@@ -180,7 +181,7 @@ it('moves up the non-expanded tree items with up arrow', async () => {
|
|
180
181
|
expect(document.activeElement?.label).to.equal(childItems[0].label, 'Does not move if at the first item');
|
181
182
|
});
|
182
183
|
it('moves to the first item when Home is pressed', async () => {
|
183
|
-
const
|
184
|
+
const component = await fixture(html `
|
184
185
|
<glide-core-tree>
|
185
186
|
<glide-core-tree-item label="Child Item 1">
|
186
187
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -190,7 +191,7 @@ it('moves to the first item when Home is pressed', async () => {
|
|
190
191
|
</glide-core-tree-item>
|
191
192
|
</glide-core-tree>
|
192
193
|
`);
|
193
|
-
const childItems =
|
194
|
+
const childItems = component.slotElements;
|
194
195
|
// Start at the last item
|
195
196
|
childItems[1].slotElements[0].focus();
|
196
197
|
await sendKeys({ press: 'Home' });
|
@@ -198,7 +199,7 @@ it('moves to the first item when Home is pressed', async () => {
|
|
198
199
|
expect(document.activeElement?.label).to.equal(childItems[0].label);
|
199
200
|
});
|
200
201
|
it('moves to the last item when End is pressed', async () => {
|
201
|
-
const
|
202
|
+
const component = await fixture(html `
|
202
203
|
<glide-core-tree>
|
203
204
|
<glide-core-tree-item label="Child Item 1">
|
204
205
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -208,7 +209,7 @@ it('moves to the last item when End is pressed', async () => {
|
|
208
209
|
</glide-core-tree-item>
|
209
210
|
</glide-core-tree>
|
210
211
|
`);
|
211
|
-
const childItems =
|
212
|
+
const childItems = component.slotElements;
|
212
213
|
// Start at the first item
|
213
214
|
childItems[0].focus();
|
214
215
|
await sendKeys({ press: 'End' });
|
@@ -216,7 +217,7 @@ it('moves to the last item when End is pressed', async () => {
|
|
216
217
|
expect(document.activeElement?.label).to.equal(childItems[1].slotElements[0].label);
|
217
218
|
});
|
218
219
|
it('selects or expands/collapses node when Enter is pressed', async () => {
|
219
|
-
const
|
220
|
+
const component = await fixture(html `
|
220
221
|
<glide-core-tree>
|
221
222
|
<glide-core-tree-item label="Child Item 1"></glide-core-tree-item>
|
222
223
|
<glide-core-tree-item label="Child Item 2">
|
@@ -224,42 +225,42 @@ it('selects or expands/collapses node when Enter is pressed', async () => {
|
|
224
225
|
</glide-core-tree-item>
|
225
226
|
</glide-core-tree>
|
226
227
|
`);
|
227
|
-
const childItems =
|
228
|
+
const childItems = component.slotElements;
|
228
229
|
const grandchildItems = childItems?.[1].slotElements;
|
229
230
|
// For an item that doesn't have children, selects it
|
230
231
|
childItems[0].focus();
|
231
232
|
await sendKeys({ press: 'Enter' });
|
232
|
-
expect(childItems[0].selected).to.
|
233
|
-
expect(childItems[1].selected).to.
|
234
|
-
expect(grandchildItems[0].selected).to.
|
235
|
-
expect(childItems[1].expanded).to.
|
233
|
+
expect(childItems[0].selected).to.be.true;
|
234
|
+
expect(childItems[1].selected).to.be.false;
|
235
|
+
expect(grandchildItems[0].selected).to.be.false;
|
236
|
+
expect(childItems[1].expanded).to.be.false;
|
236
237
|
// For an item that has children, expands it
|
237
238
|
childItems[1].focus();
|
238
239
|
await sendKeys({ press: 'Enter' });
|
239
|
-
expect(childItems[1].expanded).to.
|
240
|
+
expect(childItems[1].expanded).to.be.true;
|
240
241
|
// Can select a grandchild item
|
241
242
|
grandchildItems[0].focus();
|
242
243
|
await sendKeys({ press: 'Enter' });
|
243
|
-
expect(grandchildItems[0].selected).to.
|
244
|
+
expect(grandchildItems[0].selected).to.be.true;
|
244
245
|
});
|
245
246
|
it('selects a non-collapsible parent node when Enter is pressed', async () => {
|
246
|
-
const
|
247
|
+
const component = await fixture(html `
|
247
248
|
<glide-core-tree>
|
248
249
|
<glide-core-tree-item label="Child Item 1" expanded non-collapsible>
|
249
250
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
250
251
|
</glide-core-tree-item>
|
251
252
|
</glide-core-tree>
|
252
253
|
`);
|
253
|
-
const childItems =
|
254
|
+
const childItems = component.slotElements;
|
254
255
|
const grandchildItems = childItems?.[0].slotElements;
|
255
256
|
grandchildItems[0].focus();
|
256
257
|
childItems[0].focus();
|
257
258
|
await sendKeys({ press: 'Enter' });
|
258
|
-
expect(grandchildItems[0].selected).to.
|
259
|
-
expect(childItems[0].selected).to.
|
259
|
+
expect(grandchildItems[0].selected).to.be.false;
|
260
|
+
expect(childItems[0].selected).to.be.true;
|
260
261
|
});
|
261
262
|
it('does nothing if some other key is pressed', async () => {
|
262
|
-
const
|
263
|
+
const component = await fixture(html `
|
263
264
|
<glide-core-tree>
|
264
265
|
<glide-core-tree-item label="Child Item 1">
|
265
266
|
<glide-core-tree-item label="Grandchild Item 1"></glide-core-tree-item>
|
@@ -269,7 +270,7 @@ it('does nothing if some other key is pressed', async () => {
|
|
269
270
|
</glide-core-tree-item>
|
270
271
|
</glide-core-tree>
|
271
272
|
`);
|
272
|
-
const childItems =
|
273
|
+
const childItems = component.slotElements;
|
273
274
|
// Start at the first item
|
274
275
|
childItems[0].focus();
|
275
276
|
await sendKeys({ press: 'a' });
|
@@ -277,7 +278,7 @@ it('does nothing if some other key is pressed', async () => {
|
|
277
278
|
expect(document.activeElement?.label).to.equal(childItems[0].label);
|
278
279
|
});
|
279
280
|
it('can use the keyboard to navigate to a tree item icon button', async () => {
|
280
|
-
const
|
281
|
+
const component = await fixture(html `
|
281
282
|
<glide-core-tree>
|
282
283
|
<glide-core-tree-item label="Child Item 1">
|
283
284
|
<glide-core-tree-item-icon-button slot="suffix">
|
@@ -288,14 +289,14 @@ it('can use the keyboard to navigate to a tree item icon button', async () => {
|
|
288
289
|
</glide-core-tree-item>
|
289
290
|
</glide-core-tree>
|
290
291
|
`);
|
291
|
-
|
292
|
-
const childItems =
|
292
|
+
component.dispatchEvent(new Event('focusin'));
|
293
|
+
const childItems = component.slotElements;
|
293
294
|
childItems[0].focus();
|
294
295
|
await sendKeys({ press: 'Tab' });
|
295
296
|
assert(document.activeElement instanceof GlideCoreTreeItemIconButton);
|
296
297
|
});
|
297
298
|
it('can use the keyboard to navigate to a tree item menu', async () => {
|
298
|
-
const
|
299
|
+
const component = await fixture(html `
|
299
300
|
<glide-core-tree>
|
300
301
|
<glide-core-tree-item label="Child Item 1">
|
301
302
|
<glide-core-tree-item-menu slot="menu">
|
@@ -305,14 +306,14 @@ it('can use the keyboard to navigate to a tree item menu', async () => {
|
|
305
306
|
</glide-core-tree-item>
|
306
307
|
</glide-core-tree>
|
307
308
|
`);
|
308
|
-
|
309
|
-
const childItems =
|
309
|
+
component.dispatchEvent(new Event('focusin'));
|
310
|
+
const childItems = component.slotElements;
|
310
311
|
childItems[0].focus();
|
311
312
|
await sendKeys({ press: 'Tab' });
|
312
313
|
assert(document.activeElement instanceof GlideCoreTreeItemMenu);
|
313
314
|
});
|
314
315
|
it('does not focus on a tree item icon button unless that tree item is focused', async () => {
|
315
|
-
const
|
316
|
+
const component = await fixture(html `
|
316
317
|
<glide-core-tree>
|
317
318
|
<glide-core-tree-item label="Child Item 1"> </glide-core-tree-item>
|
318
319
|
<glide-core-tree-item label="Child Item 2">
|
@@ -324,21 +325,22 @@ it('does not focus on a tree item icon button unless that tree item is focused',
|
|
324
325
|
</glide-core-tree-item>
|
325
326
|
</glide-core-tree>
|
326
327
|
`);
|
327
|
-
|
328
|
-
const childItems =
|
328
|
+
component.dispatchEvent(new Event('focusin'));
|
329
|
+
const childItems = component.slotElements;
|
329
330
|
childItems[0].focus();
|
330
331
|
await sendKeys({ press: 'Tab' });
|
331
|
-
expect(document.activeElement === document.body).to.
|
332
|
+
expect(document.activeElement === document.body).to.be.true;
|
332
333
|
childItems[1].focus();
|
333
334
|
await sendKeys({ press: 'Tab' });
|
334
|
-
expect(document.activeElement instanceof GlideCoreTreeItemIconButton).to.
|
335
|
+
expect(document.activeElement instanceof GlideCoreTreeItemIconButton).to.be
|
336
|
+
.true;
|
335
337
|
await sendKeys({ down: 'Shift' });
|
336
338
|
await sendKeys({ press: 'Tab' });
|
337
339
|
await sendKeys({ up: 'Shift' });
|
338
|
-
expect(document.activeElement === childItems[1]).to.
|
340
|
+
expect(document.activeElement === childItems[1]).to.be.true;
|
339
341
|
});
|
340
342
|
it('does not focus on a tree item menu unless that tree item is focused', async () => {
|
341
|
-
const
|
343
|
+
const component = await fixture(html `
|
342
344
|
<glide-core-tree>
|
343
345
|
<glide-core-tree-item label="Child Item 1"> </glide-core-tree-item>
|
344
346
|
<glide-core-tree-item label="Child Item 2">
|
@@ -349,17 +351,17 @@ it('does not focus on a tree item menu unless that tree item is focused', async
|
|
349
351
|
</glide-core-tree-item>
|
350
352
|
</glide-core-tree>
|
351
353
|
`);
|
352
|
-
|
353
|
-
const childItems =
|
354
|
+
component.dispatchEvent(new Event('focusin'));
|
355
|
+
const childItems = component.slotElements;
|
354
356
|
childItems[0].focus();
|
355
357
|
await sendKeys({ press: 'Tab' });
|
356
|
-
expect(document.activeElement === document.body).to.
|
358
|
+
expect(document.activeElement === document.body).to.be.true;
|
357
359
|
childItems[1].focus();
|
358
360
|
await sendKeys({ press: 'Tab' });
|
359
|
-
expect(document.activeElement instanceof GlideCoreTreeItemMenu).to.
|
361
|
+
expect(document.activeElement instanceof GlideCoreTreeItemMenu).to.be.true;
|
360
362
|
});
|
361
363
|
it('does not select a tree item if Enter is pressed while its tree item icon button is focused', async () => {
|
362
|
-
const
|
364
|
+
const component = await fixture(html `
|
363
365
|
<glide-core-tree>
|
364
366
|
<glide-core-tree-item label="Child Item 1">
|
365
367
|
<glide-core-tree-item-icon-button slot="suffix">
|
@@ -370,11 +372,12 @@ it('does not select a tree item if Enter is pressed while its tree item icon but
|
|
370
372
|
</glide-core-tree-item>
|
371
373
|
</glide-core-tree>
|
372
374
|
`);
|
373
|
-
|
374
|
-
const childItems =
|
375
|
+
component.dispatchEvent(new Event('focusin'));
|
376
|
+
const childItems = component.slotElements;
|
375
377
|
childItems[0].focus();
|
376
378
|
await sendKeys({ press: 'Tab' });
|
377
|
-
expect(document.activeElement instanceof GlideCoreTreeItemIconButton).to.
|
379
|
+
expect(document.activeElement instanceof GlideCoreTreeItemIconButton).to.be
|
380
|
+
.true;
|
378
381
|
await sendKeys({ press: 'Enter' });
|
379
|
-
expect(childItems[0].hasAttribute('selected')).to.
|
382
|
+
expect(childItems[0].hasAttribute('selected')).to.be.false;
|
380
383
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@crowdstrike/glide-core",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.10.0",
|
4
4
|
"description": "CrowdStrike's Glide Design System components package for providing web components",
|
5
5
|
"author": "CrowdStrike UX Team",
|
6
6
|
"license": "Apache-2.0",
|
@@ -48,15 +48,15 @@
|
|
48
48
|
"@eslint/js": "^8.56.0",
|
49
49
|
"@open-wc/testing": "^3.2.2",
|
50
50
|
"@rollup/plugin-commonjs": "^25.0.7",
|
51
|
-
"@storybook/addon-essentials": "^8.
|
52
|
-
"@storybook/addon-links": "^8.
|
53
|
-
"@storybook/blocks": "^8.
|
54
|
-
"@storybook/core-events": "^8.
|
55
|
-
"@storybook/manager-api": "^8.
|
56
|
-
"@storybook/preview-api": "^8.
|
57
|
-
"@storybook/theming": "^8.
|
58
|
-
"@storybook/web-components": "^8.
|
59
|
-
"@storybook/web-components-vite": "^8.
|
51
|
+
"@storybook/addon-essentials": "^8.3.4",
|
52
|
+
"@storybook/addon-links": "^8.3.4",
|
53
|
+
"@storybook/blocks": "^8.3.4",
|
54
|
+
"@storybook/core-events": "^8.3.4",
|
55
|
+
"@storybook/manager-api": "^8.3.4",
|
56
|
+
"@storybook/preview-api": "^8.3.4",
|
57
|
+
"@storybook/theming": "^8.3.4",
|
58
|
+
"@storybook/web-components": "^8.3.4",
|
59
|
+
"@storybook/web-components-vite": "^8.3.4",
|
60
60
|
"@stylistic/eslint-plugin": "^1.7.0",
|
61
61
|
"@types/eslint": "^8.56.7",
|
62
62
|
"@types/mocha": "^10.0.6",
|
@@ -70,7 +70,6 @@
|
|
70
70
|
"@web/test-runner-commands": "^0.9.0",
|
71
71
|
"@web/test-runner-playwright": "^0.11.0",
|
72
72
|
"chalk": "^5.3.0",
|
73
|
-
"cheerio": "^1.0.0",
|
74
73
|
"esbuild": "^0.19.12",
|
75
74
|
"eslint": "^8.56.0",
|
76
75
|
"eslint-config-prettier": "^9.1.0",
|
@@ -95,7 +94,7 @@
|
|
95
94
|
"prettier": "3.1.0",
|
96
95
|
"rimraf": "^5.0.7",
|
97
96
|
"sinon": "^17.0.1",
|
98
|
-
"storybook": "^8.
|
97
|
+
"storybook": "^8.3.4",
|
99
98
|
"stylelint": "^16.3.1",
|
100
99
|
"stylelint-config-standard": "^36.0.0",
|
101
100
|
"stylelint-order": "^6.0.4",
|
@@ -114,8 +113,7 @@
|
|
114
113
|
},
|
115
114
|
"scripts": {
|
116
115
|
"start": "per-env",
|
117
|
-
"start:development": "storybook dev --config-dir .storybook --disable-telemetry --port 6006
|
118
|
-
"start:development:comment": "Upon running this script, a new tab will **not** automatically open due to the `--ci` flag. This may be a bit unexpected as it is not the default behavior. One must manually navigate to the Storybook URL provided in the terminal.",
|
116
|
+
"start:development": "storybook dev --config-dir .storybook --disable-telemetry --no-open --port 6006",
|
119
117
|
"start:production": "rimraf ./dist && npm-run-all --parallel start:production:components start:production:storybook start:production:stylesheets --aggregate-output --print-label",
|
120
118
|
"start:production:components": "tsc --outDir ./dist && node ./terser.js",
|
121
119
|
"start:production:figma": "pnpm dt export-variables && pnpm dt build-tokens && pnpm dt build-styles",
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import './menu.js';
|
2
|
-
import './menu.options.js';
|
3
|
-
import { LitElement, type PropertyValueMap } from 'lit';
|
4
|
-
import { type Placement } from '@floating-ui/dom';
|
5
|
-
declare global {
|
6
|
-
interface HTMLElementTagNameMap {
|
7
|
-
'glide-core-split-container': GlideCoreSplitContainer;
|
8
|
-
}
|
9
|
-
}
|
10
|
-
/**
|
11
|
-
* @description A pair of buttons. One is the primary action. The other controls a menu of alternate actions.
|
12
|
-
*
|
13
|
-
* @slot - One or more of `<glide-core-menu-link>` or `<glide-core-menu-button>`.
|
14
|
-
* @slot primary-action - One of either `<glide-core-split-button>` or `<glide-core-split-link>`.
|
15
|
-
*
|
16
|
-
*/
|
17
|
-
export default class GlideCoreSplitContainer extends LitElement {
|
18
|
-
#private;
|
19
|
-
static shadowRootOptions: ShadowRootInit;
|
20
|
-
static styles: import("lit").CSSResult[];
|
21
|
-
menulabel: string;
|
22
|
-
open: boolean;
|
23
|
-
disabled: boolean;
|
24
|
-
placement: Placement;
|
25
|
-
variant: 'primary' | 'secondary';
|
26
|
-
size: 'large' | 'small';
|
27
|
-
firstUpdated(): void;
|
28
|
-
focus(options?: FocusOptions): void;
|
29
|
-
render(): import("lit").TemplateResult<1>;
|
30
|
-
willUpdate(changedProperties: PropertyValueMap<GlideCoreSplitContainer>): void;
|
31
|
-
}
|
package/dist/split-container.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,i,o){var l,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(l=e[s])&&(n=(r<3?l(n):r>3?l(t,i,n):l(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};import"./menu.js";import"./menu.options.js";import{LitElement,html}from"lit";import{}from"@floating-ui/dom";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import{owSlot,owSlotType}from"./library/ow.js";import GlideCoreMenuButton from"./menu.button.js";import GlideCoreMenuLink from"./menu.link.js";import GlideCoreSplitButton from"./split-button.js";import GlideCoreSplitLink from"./split-link.js";import styles from"./split-container.styles.js";let GlideCoreSplitContainer=class GlideCoreSplitContainer extends LitElement{constructor(){super(...arguments),this.menulabel="",this.open=!1,this.disabled=!1,this.placement="bottom-end",this.variant="primary",this.size="large",this.#e=createRef(),this.#t=createRef(),this.#i=createRef()}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:"closed"}}static{this.styles=styles}firstUpdated(){this.#o(),this.#l();const e=this.#i.value?.assignedNodes().at(0);(e instanceof GlideCoreSplitButton||e instanceof GlideCoreSplitLink)&&(e.disabled=this.disabled,e.variant=this.variant,e.size=this.size)}focus(e){const t=this.#i.value?.assignedNodes()?.at(0);t instanceof HTMLElement&&t.focus(e)}render(){return html`<div class="${classMap({component:!0,disabled:this.disabled})}"><slot name="primary-action" @slotchange="${this.#r}" ${ref(this.#i)} data-test="primary-action"></slot><span class="${classMap({divider:!0,[this.variant]:!0})}" data-test="split-divider"></span><glide-core-menu ?open="${this.open}" size="${this.size}" placement="${this.placement}"><button slot="target" type="button" class="${classMap({"menu-button":!0,[this.variant]:!0,[this.size]:!0})}" ?disabled="${this.disabled}" aria-label="${this.menulabel}" data-test="split-menu-button" ${ref(this.#t)}><svg width="16" height="16" viewBox="0 0 24 24" fill="none" role="presentation"><path d="M6 9L12 15L18 9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button><glide-core-menu-options><slot @slotchange="${this.#n}" ${ref(this.#e)}></slot></glide-core-menu-options></glide-core-menu></div>`}willUpdate(e){const t=this.#i.value?.assignedNodes().at(0);this.hasUpdated&&(t instanceof GlideCoreSplitButton||t instanceof GlideCoreSplitLink)&&(e.has("disabled")&&(t.disabled=this.disabled),e.has("variant")&&(t.variant=this.variant),e.has("size")&&(t.size=this.size))}#e;#t;#i;#n(){this.#o()}#r(){this.#l()}#o(){owSlot(this.#e.value),owSlotType(this.#e.value,[GlideCoreMenuButton,GlideCoreMenuLink])}#l(){owSlot(this.#i.value),owSlotType(this.#i.value,[GlideCoreSplitButton,GlideCoreSplitLink])}};__decorate([property({attribute:"menu-label",reflect:!0})],GlideCoreSplitContainer.prototype,"menulabel",void 0),__decorate([property({type:Boolean,reflect:!0})],GlideCoreSplitContainer.prototype,"open",void 0),__decorate([property({type:Boolean,reflect:!0})],GlideCoreSplitContainer.prototype,"disabled",void 0),__decorate([property({attribute:"menu-placement",reflect:!0})],GlideCoreSplitContainer.prototype,"placement",void 0),__decorate([property({reflect:!0})],GlideCoreSplitContainer.prototype,"variant",void 0),__decorate([property({reflect:!0})],GlideCoreSplitContainer.prototype,"size",void 0),GlideCoreSplitContainer=__decorate([customElement("glide-core-split-container")],GlideCoreSplitContainer);export default GlideCoreSplitContainer;
|
@@ -1,132 +0,0 @@
|
|
1
|
-
import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export default[css`
|
2
|
-
${focusOutline(".menu-button:focus-visible")}
|
3
|
-
`,css`
|
4
|
-
.component {
|
5
|
-
display: inline-flex;
|
6
|
-
position: relative;
|
7
|
-
|
8
|
-
& .divider {
|
9
|
-
inline-size: 1px;
|
10
|
-
|
11
|
-
&.primary {
|
12
|
-
background-color: var(--glide-core-border-base-light);
|
13
|
-
}
|
14
|
-
|
15
|
-
&.secondary {
|
16
|
-
background-color: var(--glide-core-border-primary);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
&:not(.disabled):hover {
|
21
|
-
& .divider {
|
22
|
-
background-color: transparent;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
&.disabled,
|
27
|
-
&.disabled:hover {
|
28
|
-
cursor: not-allowed;
|
29
|
-
|
30
|
-
& .divider {
|
31
|
-
background-color: var(--glide-core-border-base-light);
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
& .menu-button {
|
36
|
-
align-items: center;
|
37
|
-
border-color: transparent;
|
38
|
-
border-radius: 0 0.75rem 0.75rem 0;
|
39
|
-
border-style: solid;
|
40
|
-
border-width: 1px 1px 1px 0;
|
41
|
-
cursor: pointer;
|
42
|
-
display: inline-flex;
|
43
|
-
font-family: var(--glide-core-heading-xxs-font-family);
|
44
|
-
font-style: var(--glide-core-heading-xxs-font-style);
|
45
|
-
font-weight: var(--glide-core-heading-xxs-font-weight);
|
46
|
-
gap: 0.625rem;
|
47
|
-
justify-content: center;
|
48
|
-
padding-block: var(--glide-core-spacing-xs);
|
49
|
-
padding-inline: var(--glide-core-spacing-xs);
|
50
|
-
text-decoration: none;
|
51
|
-
transition-duration: 150ms;
|
52
|
-
transition-property: color, background-color, border-color, fill, stroke;
|
53
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
54
|
-
user-select: none;
|
55
|
-
|
56
|
-
&:focus {
|
57
|
-
outline: none;
|
58
|
-
}
|
59
|
-
|
60
|
-
&:disabled {
|
61
|
-
cursor: default;
|
62
|
-
opacity: 1;
|
63
|
-
pointer-events: none;
|
64
|
-
}
|
65
|
-
|
66
|
-
&.primary {
|
67
|
-
background-color: var(--glide-core-surface-primary);
|
68
|
-
border-color: transparent;
|
69
|
-
color: var(--glide-core-text-selected);
|
70
|
-
|
71
|
-
&:disabled {
|
72
|
-
background-color: var(--glide-core-surface-disabled);
|
73
|
-
border-color: transparent;
|
74
|
-
color: var(--glide-core-text-tertiary-disabled);
|
75
|
-
}
|
76
|
-
|
77
|
-
&:not(:disabled):active {
|
78
|
-
background-color: var(--glide-core-surface-selected-hover);
|
79
|
-
border-color: transparent;
|
80
|
-
color: var(--glide-core-text-selected);
|
81
|
-
}
|
82
|
-
|
83
|
-
&:not(:active):hover:not(:disabled) {
|
84
|
-
background-color: var(--glide-core-surface-hover);
|
85
|
-
border-color: transparent;
|
86
|
-
box-shadow: var(--glide-core-glow-sm);
|
87
|
-
color: var(--glide-core-text-primary);
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
&.secondary {
|
92
|
-
background-color: transparent;
|
93
|
-
border-color: var(--glide-core-border-primary);
|
94
|
-
color: var(--glide-core-text-primary);
|
95
|
-
|
96
|
-
&:disabled {
|
97
|
-
background-color: var(--glide-core-surface-disabled);
|
98
|
-
border-color: transparent;
|
99
|
-
color: var(--glide-core-text-tertiary-disabled);
|
100
|
-
}
|
101
|
-
|
102
|
-
&:not(:disabled):active {
|
103
|
-
background-color: var(--glide-core-surface-selected-hover);
|
104
|
-
border-color: transparent;
|
105
|
-
color: var(--glide-core-text-selected);
|
106
|
-
}
|
107
|
-
|
108
|
-
&:not(:active):hover:not(:disabled) {
|
109
|
-
background-color: var(--glide-core-surface-hover);
|
110
|
-
border-color: transparent;
|
111
|
-
box-shadow: var(--glide-core-glow-sm);
|
112
|
-
color: var(--glide-core-text-primary);
|
113
|
-
}
|
114
|
-
}
|
115
|
-
|
116
|
-
&.small {
|
117
|
-
block-size: 1.75rem;
|
118
|
-
box-sizing: border-box;
|
119
|
-
font-size: var(--glide-core-body-xs-font-size);
|
120
|
-
line-height: 1rem;
|
121
|
-
min-inline-size: fit-content;
|
122
|
-
}
|
123
|
-
|
124
|
-
&.large {
|
125
|
-
block-size: 2.125rem;
|
126
|
-
box-sizing: border-box;
|
127
|
-
font-size: var(--glide-core-body-xxs-font-size);
|
128
|
-
line-height: 1.5rem;
|
129
|
-
}
|
130
|
-
}
|
131
|
-
}
|
132
|
-
`];
|