@aurodesignsystem-dev/auro-accordion 0.0.0-pr190.0 → 0.0.0-pr200.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/CHANGELOG.md +16 -0
- package/NOTICE +2 -0
- package/README.md +25 -59
- package/demo/api.js +2 -1
- package/demo/api.md +13 -7
- package/demo/api.min.js +15 -2028
- package/demo/auro-accordion.min.js +727 -0
- package/demo/index.js +12 -14
- package/demo/index.min.js +13 -2024
- package/dist/auro-accordion-B6aPKaGa.js +113 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.js +1 -0
- package/dist/registered.js +1 -0
- package/package.json +40 -129
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.vscode/settings.json +0 -8
- package/apiExamples/accordionGroup.html +0 -47
- package/apiExamples/accordionGroupLg.html +0 -47
- package/apiExamples/accordionGroupSm.html +0 -47
- package/apiExamples/alignChevronRight.html +0 -15
- package/apiExamples/alignRight.html +0 -15
- package/apiExamples/basic.html +0 -15
- package/apiExamples/chevronNone.html +0 -15
- package/apiExamples/chevronRight.html +0 -15
- package/apiExamples/custom.html +0 -15
- package/apiExamples/customGroup.html +0 -47
- package/apiExamples/disabled.html +0 -15
- package/apiExamples/disabledGroup.html +0 -47
- package/apiExamples/emphasis.html +0 -47
- package/apiExamples/expanded.html +0 -17
- package/apiExamples/expanded.js +0 -11
- package/apiExamples/noToggleExpanded.html +0 -47
- package/coverage/lcov-report/auro-accordion-group.js.html +0 -472
- package/coverage/lcov-report/auro-accordion.js.html +0 -664
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/color-css.js.html +0 -91
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/iconVersion.js.html +0 -85
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/auro-accordion-button.js.html +0 -283
- package/coverage/lcov-report/src/auro-accordion-group.js.html +0 -538
- package/coverage/lcov-report/src/auro-accordion.js.html +0 -895
- package/coverage/lcov-report/src/iconVersion.js.html +0 -85
- package/coverage/lcov-report/src/index.html +0 -161
- package/coverage/lcov-report/src/styles/color-css.js.html +0 -91
- package/coverage/lcov-report/src/styles/index.html +0 -161
- package/coverage/lcov-report/src/styles/style-button-css.js.html +0 -91
- package/coverage/lcov-report/src/styles/style-css.js.html +0 -91
- package/coverage/lcov-report/src/styles/tokens-css.js.html +0 -91
- package/coverage/lcov-report/style-css.js.html +0 -91
- package/coverage/lcov-report/tokens-css.js.html +0 -91
- package/coverage/lcov.info +0 -682
- package/dist/auro-accordion-button.d.ts +0 -17
- package/dist/auro-accordion-button.d.ts.map +0 -1
- package/dist/auro-accordion-group.d.ts +0 -61
- package/dist/auro-accordion-group.d.ts.map +0 -1
- package/dist/auro-accordion.d.ts +0 -106
- package/dist/auro-accordion.d.ts.map +0 -1
- package/dist/auro-accordion__bundled.js +0 -2023
- package/dist/color-css.d.ts +0 -3
- package/dist/color-css.d.ts.map +0 -1
- package/dist/iconVersion.d.ts +0 -3
- package/dist/iconVersion.d.ts.map +0 -1
- package/dist/src/auro-accordion-button.d.ts +0 -19
- package/dist/src/auro-accordion-button.d.ts.map +0 -1
- package/dist/src/auro-accordion-group.d.ts +0 -61
- package/dist/src/auro-accordion-group.d.ts.map +0 -1
- package/dist/src/auro-accordion.d.ts +0 -106
- package/dist/src/auro-accordion.d.ts.map +0 -1
- package/dist/src/color-css.d.ts +0 -3
- package/dist/src/color-css.d.ts.map +0 -1
- package/dist/src/iconVersion.d.ts +0 -3
- package/dist/src/iconVersion.d.ts.map +0 -1
- package/dist/src/style-button-css.d.ts +0 -3
- package/dist/src/style-button-css.d.ts.map +0 -1
- package/dist/src/style-css.d.ts +0 -3
- package/dist/src/style-css.d.ts.map +0 -1
- package/dist/src/styles/color-css.d.ts +0 -3
- package/dist/src/styles/color-css.d.ts.map +0 -1
- package/dist/src/styles/style-button-css.d.ts +0 -3
- package/dist/src/styles/style-button-css.d.ts.map +0 -1
- package/dist/src/styles/style-css.d.ts +0 -3
- package/dist/src/styles/style-css.d.ts.map +0 -1
- package/dist/src/styles/tokens-css.d.ts +0 -3
- package/dist/src/styles/tokens-css.d.ts.map +0 -1
- package/dist/src/tokens-css.d.ts +0 -3
- package/dist/src/tokens-css.d.ts.map +0 -1
- package/dist/style-button-css.d.ts +0 -3
- package/dist/style-button-css.d.ts.map +0 -1
- package/dist/style-css.d.ts +0 -3
- package/dist/style-css.d.ts.map +0 -1
- package/dist/test/auro-accordion-group.test.d.ts +0 -2
- package/dist/test/auro-accordion-group.test.d.ts.map +0 -1
- package/dist/test/auro-accordion.test.d.ts +0 -2
- package/dist/test/auro-accordion.test.d.ts.map +0 -1
- package/dist/tokens-css.d.ts +0 -3
- package/dist/tokens-css.d.ts.map +0 -1
- package/index.js +0 -3
- package/packageScripts/postinstall.mjs +0 -28
- package/scripts/version.mjs +0 -3
- package/scripts/wca/auro-accordion.js +0 -12
- package/src/auro-accordion-button.js +0 -66
- package/src/auro-accordion-group.js +0 -151
- package/src/auro-accordion.js +0 -270
- package/src/color-css.js +0 -2
- package/src/color.css +0 -39
- package/src/iconVersion.js +0 -1
- package/src/style-button-css.js +0 -2
- package/src/style-button.css +0 -53
- package/src/style-css.js +0 -2
- package/src/style.css +0 -147
- package/src/styles/color-css.js +0 -2
- package/src/styles/color.css +0 -43
- package/src/styles/color.scss +0 -75
- package/src/styles/style-button-css.js +0 -2
- package/src/styles/style-button.css +0 -63
- package/src/styles/style-button.scss +0 -86
- package/src/styles/style-css.js +0 -2
- package/src/styles/style.css +0 -347
- package/src/styles/style.scss +0 -200
- package/src/styles/tokens-css.js +0 -2
- package/src/styles/tokens.css +0 -7
- package/src/styles/tokens.scss +0 -9
- package/src/tokens-css.js +0 -2
- package/src/tokens.css +0 -7
- package/test/auro-accordion-group.test.js +0 -230
- package/test/auro-accordion.test.js +0 -104
package/src/styles/style.scss
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2023 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2
|
-
// See LICENSE in the project root for license information.
|
|
3
|
-
|
|
4
|
-
// ---------------------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
/* stylelint-disable order/properties-order, selector-max-combinators, selector-max-compound-selectors, declaration-empty-line-before, declaration-no-important, no-descending-specificity */
|
|
7
|
-
|
|
8
|
-
// Import Auro tokens
|
|
9
|
-
@use "@aurodesignsystem/design-tokens/dist/legacy/auro-classic/SCSSVariables" as vac;
|
|
10
|
-
|
|
11
|
-
@use "@aurodesignsystem/webcorestylesheets/dist/bundled/type/classes.alaska.min.css";
|
|
12
|
-
|
|
13
|
-
:host {
|
|
14
|
-
interpolate-size: allow-keywords; // stylelint-disable-line
|
|
15
|
-
|
|
16
|
-
--webkit-fill: -webkit-fill-available;
|
|
17
|
-
|
|
18
|
-
.trigger {
|
|
19
|
-
position: relative;
|
|
20
|
-
|
|
21
|
-
display: inline-block;
|
|
22
|
-
|
|
23
|
-
border-width: 1px;
|
|
24
|
-
border-style: solid;
|
|
25
|
-
border-radius: var(--ds-border-radius, vac.$ds-border-radius);
|
|
26
|
-
|
|
27
|
-
&:hover {
|
|
28
|
-
text-decoration: underline;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
::slotted([slot="trigger"]) {
|
|
33
|
-
padding-left: var(--ds-size-100, vac.$ds-size-100);
|
|
34
|
-
padding-right: var(--ds-size-200, vac.$ds-size-200);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.iconWrapper {
|
|
38
|
-
height: var(--ds-size-300, vac.$ds-size-300);
|
|
39
|
-
margin-top: -2px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
[auro-icon] {
|
|
43
|
-
--ds-auro-icon-size: var(--ds-size-300, #{vac.$ds-size-300});
|
|
44
|
-
|
|
45
|
-
&[hidden] { // stylelint-disable-line selector-max-attribute
|
|
46
|
-
display: none;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.content {
|
|
51
|
-
width: 100%;
|
|
52
|
-
|
|
53
|
-
transition: all 0.5s ease-in-out;
|
|
54
|
-
transition-property: height;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.componentWrapper {
|
|
58
|
-
height: 100%;
|
|
59
|
-
overflow: hidden;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.contentWrapper {
|
|
63
|
-
padding-left: var(--ds-size-400, vac.$ds-size-400);
|
|
64
|
-
padding-bottom: var(--ds-size-300, vac.$ds-size-300);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
:host(:focus) {
|
|
69
|
-
.trigger {
|
|
70
|
-
border-width: 1px;
|
|
71
|
-
border-style: solid;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
:host([chevron="right"]) {
|
|
76
|
-
::slotted([slot="trigger"]) {
|
|
77
|
-
padding-left: 0;
|
|
78
|
-
padding-right: var(--ds-size-100, vac.$ds-size-100);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.contentWrapper {
|
|
82
|
-
padding-left: var(--ds-size-400, vac.$ds-size-400);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
:host([chevron="right"]:not([emphasis])) {
|
|
87
|
-
::slotted([slot="trigger"]) {
|
|
88
|
-
padding-left: var(--ds-size-250, vac.$ds-size-250);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.contentWrapper {
|
|
92
|
-
padding-left: var(--ds-size-250, vac.$ds-size-250);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
:host([alignRight]) {
|
|
97
|
-
.componentWrapper {
|
|
98
|
-
display: flex;
|
|
99
|
-
flex-direction: column;
|
|
100
|
-
align-items: flex-end;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host([fluid]) {
|
|
105
|
-
.trigger {
|
|
106
|
-
width: 100%;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
:host([grouped]) {
|
|
111
|
-
.componentWrapper {
|
|
112
|
-
border-bottom-width: 1px;
|
|
113
|
-
border-bottom-style: solid;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
:host([grouped][chevron="right"]:not([alignright])) {
|
|
118
|
-
.trigger {
|
|
119
|
-
width: var(--webkit-fill, 100%);
|
|
120
|
-
|
|
121
|
-
--trigger-padding-right: var(--ds-size-200, #{vac.$ds-size-200}); // will be passed to the child component
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
:host(:not([expanded])),
|
|
126
|
-
:host([expanded="false"]) {
|
|
127
|
-
.content {
|
|
128
|
-
height: 0 !important;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
:host([expanded]) {
|
|
133
|
-
.content {
|
|
134
|
-
height: auto;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
:host([emphasis]) {
|
|
139
|
-
.trigger {
|
|
140
|
-
border-style: solid;
|
|
141
|
-
border-width: 1px;
|
|
142
|
-
border-left-width: 2px;
|
|
143
|
-
|
|
144
|
-
--trigger-padding-left: var(--ds-size-200, #{vac.$ds-size-200}); // will be passed to the child component
|
|
145
|
-
|
|
146
|
-
&:before {
|
|
147
|
-
display: block;
|
|
148
|
-
|
|
149
|
-
position: absolute;
|
|
150
|
-
|
|
151
|
-
top: -1px;
|
|
152
|
-
left: -2px;
|
|
153
|
-
|
|
154
|
-
width: 1px;
|
|
155
|
-
height: calc(100% + 2px);
|
|
156
|
-
content: '';
|
|
157
|
-
border-left-style: solid;
|
|
158
|
-
border-left-width: 2px;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
&:focus {
|
|
162
|
-
border-left-width: 1px;
|
|
163
|
-
margin-left: 1px;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.content {
|
|
168
|
-
border-left-width: 2px;
|
|
169
|
-
border-left-style: solid;
|
|
170
|
-
padding: unset;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.contentWrapper {
|
|
174
|
-
padding-left: var(--ds-size-200, vac.$ds-size-200);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.iconWrapper {
|
|
178
|
-
padding-right: var(--ds-size-200, vac.$ds-size-200);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
:host([emphasis][variant="lg"]) {
|
|
183
|
-
.trigger,
|
|
184
|
-
.contentWrapper {
|
|
185
|
-
padding-left: calc(var(--ds-size-200, vac.$ds-size-200) + var(--ds-size-50, vac.$ds-size-50));
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
:host([emphasis]:not([expanded]):hover) {
|
|
190
|
-
.trigger {
|
|
191
|
-
text-decoration: unset;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
:host([chevron="none"]) {
|
|
196
|
-
::slotted([slot="trigger"]),
|
|
197
|
-
.contentWrapper {
|
|
198
|
-
padding-left: unset;
|
|
199
|
-
}
|
|
200
|
-
}
|
package/src/styles/tokens-css.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
export default css`:host{--ds-auro-accordion-content-border-color: transparent;--ds-auro-accordion-group-border-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-accordion-trigger-border-color: transparent;--ds-auro-accordion-trigger-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-accordion-trigger-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
package/src/styles/tokens.css
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
--ds-auro-accordion-content-border-color: transparent;
|
|
3
|
-
--ds-auro-accordion-group-border-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));
|
|
4
|
-
--ds-auro-accordion-trigger-border-color: transparent;
|
|
5
|
-
--ds-auro-accordion-trigger-color: var(--ds-basic-color-texticon-default, #2a2a2a);
|
|
6
|
-
--ds-auro-accordion-trigger-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a);
|
|
7
|
-
}
|
package/src/styles/tokens.scss
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
@use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
|
|
2
|
-
|
|
3
|
-
:host {
|
|
4
|
-
--ds-auro-accordion-content-border-color: transparent;
|
|
5
|
-
--ds-auro-accordion-group-border-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
|
|
6
|
-
--ds-auro-accordion-trigger-border-color: transparent;
|
|
7
|
-
--ds-auro-accordion-trigger-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
8
|
-
--ds-auro-accordion-trigger-icon-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
9
|
-
}
|
package/src/tokens-css.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
export default css`:host{--ds-auro-accordion-content-border-color:transparent;--ds-auro-accordion-group-border-color:var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-accordion-trigger-border-color:transparent;--ds-auro-accordion-trigger-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-accordion-trigger-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
package/src/tokens.css
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
:host{
|
|
2
|
-
--ds-auro-accordion-content-border-color:transparent;
|
|
3
|
-
--ds-auro-accordion-group-border-color:var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));
|
|
4
|
-
--ds-auro-accordion-trigger-border-color:transparent;
|
|
5
|
-
--ds-auro-accordion-trigger-color:var(--ds-basic-color-texticon-default, #2a2a2a);
|
|
6
|
-
--ds-auro-accordion-trigger-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);
|
|
7
|
-
}
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { fixture, html, expect, elementUpdated } from '@open-wc/testing';
|
|
2
|
-
import { AuroAccordionGroup } from '../src/auro-accordion-group';
|
|
3
|
-
import { AuroAccordion } from '../src/auro-accordion';
|
|
4
|
-
|
|
5
|
-
AuroAccordion.register();
|
|
6
|
-
AuroAccordionGroup.register();
|
|
7
|
-
|
|
8
|
-
describe('auro-accordion-group', () => {
|
|
9
|
-
it('auro-accordion-group is accessible', async () => {
|
|
10
|
-
const el = await defaultFixture();
|
|
11
|
-
|
|
12
|
-
await expect(el).to.be.accessible();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('auro-accordion-group custom element is defined', async () => {
|
|
16
|
-
const el = await !!customElements.get("auro-accordion-group");
|
|
17
|
-
|
|
18
|
-
await expect(el).to.be.true;
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('accordion has correct attributes when in an accordion group with emphasis attribute', async () => {
|
|
22
|
-
const el = await emphasisFixture();
|
|
23
|
-
const accordion = el.querySelector('auro-accordion');
|
|
24
|
-
|
|
25
|
-
await expect(accordion.emphasis).to.be.true;
|
|
26
|
-
await expect(accordion.getAttribute('chevron') === 'right').to.be.true;
|
|
27
|
-
await expect(accordion.grouped).to.be.true;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('sm attribute is passed down to the accordion', async () => {
|
|
31
|
-
const el = await smFixture();
|
|
32
|
-
const accordion = el.querySelector('auro-accordion');
|
|
33
|
-
|
|
34
|
-
await expect(accordion.getAttribute('variant') === 'sm').to.be.true;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('lg attribute is passed down to the accordion', async () => {
|
|
38
|
-
const el = await lgFixture();
|
|
39
|
-
const accordion = el.querySelector('auro-accordion');
|
|
40
|
-
|
|
41
|
-
await expect(accordion.getAttribute('variant') === 'lg').to.be.true;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('one accordion closes when another accordion opens', async () => {
|
|
45
|
-
const el = await expandedFixture();
|
|
46
|
-
|
|
47
|
-
const firstAccordion = [...el.querySelectorAll('auro-accordion')][0];
|
|
48
|
-
const secondAccordion = [...el.querySelectorAll('auro-accordion')][1];
|
|
49
|
-
|
|
50
|
-
const secondAccordionTrigger = secondAccordion.querySelector('span');
|
|
51
|
-
|
|
52
|
-
await expect(firstAccordion.hasAttribute('expanded')).to.be.true;
|
|
53
|
-
await expect(secondAccordion.hasAttribute('expanded')).to.be.false;
|
|
54
|
-
|
|
55
|
-
secondAccordionTrigger.click();
|
|
56
|
-
|
|
57
|
-
await elementUpdated(el);
|
|
58
|
-
|
|
59
|
-
await expect(firstAccordion.hasAttribute('expanded')).to.be.false;
|
|
60
|
-
await expect(secondAccordion.hasAttribute('expanded')).to.be.true;
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('noToggleExpanded attribute allows for multiple accordions to be open at once', async () => {
|
|
64
|
-
const el = await expandedFixture();
|
|
65
|
-
|
|
66
|
-
el.setAttribute('noToggleExpanded', true);
|
|
67
|
-
|
|
68
|
-
const firstAccordion = [...el.querySelectorAll('auro-accordion')][0];
|
|
69
|
-
const secondAccordion = [...el.querySelectorAll('auro-accordion')][1];
|
|
70
|
-
|
|
71
|
-
const secondAccordionTrigger = secondAccordion.querySelector('span');
|
|
72
|
-
|
|
73
|
-
await expect(firstAccordion.hasAttribute('expanded')).to.be.true;
|
|
74
|
-
await expect(secondAccordion.hasAttribute('expanded')).to.be.false;
|
|
75
|
-
|
|
76
|
-
secondAccordionTrigger.click();
|
|
77
|
-
|
|
78
|
-
await elementUpdated(el);
|
|
79
|
-
|
|
80
|
-
await expect(firstAccordion.hasAttribute('expanded')).to.be.true;
|
|
81
|
-
await expect(secondAccordion.hasAttribute('expanded')).to.be.true;
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('render with disabled attribute', async () => {
|
|
85
|
-
const el = await fixture(html`
|
|
86
|
-
<auro-accordion-group disabled>
|
|
87
|
-
<auro-accordion>
|
|
88
|
-
<span slot="trigger">Trigger</span>
|
|
89
|
-
<p>
|
|
90
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
91
|
-
</p>
|
|
92
|
-
</auro-accordion>
|
|
93
|
-
</auro-accordion-group>
|
|
94
|
-
`);
|
|
95
|
-
|
|
96
|
-
const accordion = el.querySelector('auro-accordion');
|
|
97
|
-
|
|
98
|
-
await expect(accordion.disabled).to.be.true;
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
async function defaultFixture() {
|
|
103
|
-
return await fixture(html`
|
|
104
|
-
<auro-accordion-group>
|
|
105
|
-
<auro-accordion>
|
|
106
|
-
<span slot="trigger">Trigger</span>
|
|
107
|
-
<p>
|
|
108
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
109
|
-
</p>
|
|
110
|
-
<p>
|
|
111
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
112
|
-
</p>
|
|
113
|
-
<p>
|
|
114
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
115
|
-
</p>
|
|
116
|
-
<p>
|
|
117
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
118
|
-
</p>
|
|
119
|
-
</auro-accordion>
|
|
120
|
-
</auro-accordion-group>
|
|
121
|
-
|
|
122
|
-
`);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
async function emphasisFixture() {
|
|
126
|
-
return await fixture(html`
|
|
127
|
-
<auro-accordion-group emphasis>
|
|
128
|
-
<auro-accordion>
|
|
129
|
-
<span slot="trigger">Trigger</span>
|
|
130
|
-
<p>
|
|
131
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
132
|
-
</p>
|
|
133
|
-
<p>
|
|
134
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
135
|
-
</p>
|
|
136
|
-
<p>
|
|
137
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
138
|
-
</p>
|
|
139
|
-
<p>
|
|
140
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
141
|
-
</p>
|
|
142
|
-
</auro-accordion>
|
|
143
|
-
</auro-accordion-group>
|
|
144
|
-
|
|
145
|
-
`);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
async function smFixture() {
|
|
149
|
-
return await fixture(html`
|
|
150
|
-
<auro-accordion-group variant="sm">
|
|
151
|
-
<auro-accordion>
|
|
152
|
-
<span slot="trigger">Trigger</span>
|
|
153
|
-
<p>
|
|
154
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
155
|
-
</p>
|
|
156
|
-
<p>
|
|
157
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
158
|
-
</p>
|
|
159
|
-
<p>
|
|
160
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
161
|
-
</p>
|
|
162
|
-
<p>
|
|
163
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
164
|
-
</p>
|
|
165
|
-
</auro-accordion>
|
|
166
|
-
</auro-accordion-group>
|
|
167
|
-
|
|
168
|
-
`);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
async function lgFixture() {
|
|
172
|
-
return await fixture(html`
|
|
173
|
-
<auro-accordion-group variant="lg">
|
|
174
|
-
<auro-accordion>
|
|
175
|
-
<span slot="trigger">Trigger</span>
|
|
176
|
-
<p>
|
|
177
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
178
|
-
</p>
|
|
179
|
-
<p>
|
|
180
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
181
|
-
</p>
|
|
182
|
-
<p>
|
|
183
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
184
|
-
</p>
|
|
185
|
-
<p>
|
|
186
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
187
|
-
</p>
|
|
188
|
-
</auro-accordion>
|
|
189
|
-
</auro-accordion-group>
|
|
190
|
-
|
|
191
|
-
`);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
async function expandedFixture() {
|
|
195
|
-
return await fixture(html`
|
|
196
|
-
<auro-accordion-group>
|
|
197
|
-
<auro-accordion expanded>
|
|
198
|
-
<span slot="trigger">Trigger</span>
|
|
199
|
-
<p>
|
|
200
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
201
|
-
</p>
|
|
202
|
-
<p>
|
|
203
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
204
|
-
</p>
|
|
205
|
-
<p>
|
|
206
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
207
|
-
</p>
|
|
208
|
-
<p>
|
|
209
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
210
|
-
</p>
|
|
211
|
-
</auro-accordion>
|
|
212
|
-
|
|
213
|
-
<auro-accordion>
|
|
214
|
-
<span slot="trigger">Trigger</span>
|
|
215
|
-
<p>
|
|
216
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
217
|
-
</p>
|
|
218
|
-
<p>
|
|
219
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
220
|
-
</p>
|
|
221
|
-
<p>
|
|
222
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
223
|
-
</p>
|
|
224
|
-
<p>
|
|
225
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
226
|
-
</p>
|
|
227
|
-
</auro-accordion>
|
|
228
|
-
</auro-accordion-group>
|
|
229
|
-
`);
|
|
230
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { fixture, html, expect, elementUpdated } from '@open-wc/testing';
|
|
2
|
-
import { AuroAccordion } from '../src/auro-accordion';
|
|
3
|
-
|
|
4
|
-
AuroAccordion.register();
|
|
5
|
-
|
|
6
|
-
// import './../index.js';
|
|
7
|
-
|
|
8
|
-
describe('auro-accordion', () => {
|
|
9
|
-
it('auro-accordion is accessible', async () => {
|
|
10
|
-
const el = await defaultFixture();
|
|
11
|
-
|
|
12
|
-
await expect(el).to.be.accessible();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('auro-accordion custom element is defined', async () => {
|
|
16
|
-
const el = await !!customElements.get("auro-accordion");
|
|
17
|
-
|
|
18
|
-
await expect(el).to.be.true;
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('toggles the accordion when clicking on the trigger', async () => {
|
|
22
|
-
const el = await defaultFixture();
|
|
23
|
-
|
|
24
|
-
const trigger = el.shadowRoot.querySelector('.trigger');
|
|
25
|
-
const shadowButton = trigger.shadowRoot.querySelector('button');
|
|
26
|
-
|
|
27
|
-
await expect(trigger.hasAttribute('ariaexpanded')).to.be.false;
|
|
28
|
-
await expect(shadowButton.getAttribute('aria-expanded')).to.equal('false');
|
|
29
|
-
|
|
30
|
-
trigger.click();
|
|
31
|
-
|
|
32
|
-
await elementUpdated(trigger);
|
|
33
|
-
|
|
34
|
-
await expect(trigger.hasAttribute('ariaexpanded')).to.be.true;
|
|
35
|
-
await expect(shadowButton.getAttribute('aria-expanded')).to.equal('true');
|
|
36
|
-
|
|
37
|
-
trigger.click();
|
|
38
|
-
|
|
39
|
-
await elementUpdated(trigger);
|
|
40
|
-
|
|
41
|
-
await expect(trigger.hasAttribute('ariaexpanded')).to.be.false;
|
|
42
|
-
await expect(shadowButton.getAttribute('aria-expanded')).to.equal('false');
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('render the disabled attribute', async () => {
|
|
46
|
-
const el = await fixture(html`
|
|
47
|
-
<auro-accordion disabled>
|
|
48
|
-
<span slot="trigger">Trigger</span>
|
|
49
|
-
<p>
|
|
50
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
51
|
-
</p>
|
|
52
|
-
</auro-accordion>
|
|
53
|
-
`);
|
|
54
|
-
|
|
55
|
-
const trigger = el.shadowRoot.querySelector('.trigger');
|
|
56
|
-
|
|
57
|
-
await expect(trigger.hasAttribute('aria-disabled')).to.not.null;
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('test toggle event when disabled is true', async () => {
|
|
61
|
-
const el = await defaultFixture();
|
|
62
|
-
el.disabled = true;
|
|
63
|
-
const trigger = el.shadowRoot.querySelector('.trigger');
|
|
64
|
-
trigger.click();
|
|
65
|
-
|
|
66
|
-
await elementUpdated(trigger);
|
|
67
|
-
await expect(trigger.hasAttribute('aria-expanded')).to.not.null;
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('render with chevron attribute value "none"', async () => {
|
|
71
|
-
const el = await fixture(html`
|
|
72
|
-
<auro-accordion chevron="none">
|
|
73
|
-
<span slot="trigger">Trigger</span>
|
|
74
|
-
<p>
|
|
75
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
76
|
-
</p>
|
|
77
|
-
</auro-accordion>
|
|
78
|
-
`);
|
|
79
|
-
|
|
80
|
-
const trigger = el.shadowRoot.querySelector('.trigger');
|
|
81
|
-
|
|
82
|
-
await expect(trigger.hasAttribute('chevron')).to.be.false;
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
async function defaultFixture() {
|
|
87
|
-
return await fixture(html`
|
|
88
|
-
<auro-accordion>
|
|
89
|
-
<span slot="trigger">Trigger</span>
|
|
90
|
-
<p>
|
|
91
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
92
|
-
</p>
|
|
93
|
-
<p>
|
|
94
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
95
|
-
</p>
|
|
96
|
-
<p>
|
|
97
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
98
|
-
</p>
|
|
99
|
-
<p>
|
|
100
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
101
|
-
</p>
|
|
102
|
-
</auro-accordion>
|
|
103
|
-
`);
|
|
104
|
-
}
|