@aurodesignsystem/auro-accordion 5.2.1 → 5.2.2
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 +14 -0
- package/README.md +1 -1
- package/coverage/lcov-report/index.html +23 -113
- package/coverage/lcov-report/{auro-accordion-button.js.html → src/auro-accordion-button.js.html} +89 -20
- package/coverage/lcov-report/{auro-accordion-group.js.html → src/auro-accordion-group.js.html} +10 -10
- package/coverage/lcov-report/{auro-accordion.js.html → src/auro-accordion.js.html} +127 -52
- package/coverage/lcov-report/{iconVersion.js.html → src/iconVersion.js.html} +11 -11
- package/coverage/lcov-report/src/index.html +161 -0
- package/coverage/lcov-report/{color-css.js.html → src/styles/color-css.js.html} +11 -11
- package/coverage/lcov-report/src/styles/index.html +161 -0
- package/coverage/lcov-report/{style-button-css.js.html → src/styles/style-button-css.js.html} +11 -11
- package/coverage/lcov-report/src/styles/style-css.js.html +91 -0
- package/coverage/lcov-report/{tokens-css.js.html → src/styles/tokens-css.js.html} +11 -11
- package/coverage/lcov.info +214 -146
- package/demo/api.html +18 -10
- package/demo/api.md +6 -6
- package/demo/api.min.js +967 -175
- package/demo/index.html +17 -10
- package/demo/index.min.js +967 -175
- package/dist/auro-accordion__bundled.js +967 -175
- package/dist/{auro-accordion-button.d.ts → src/auro-accordion-button.d.ts} +2 -0
- package/dist/src/auro-accordion-button.d.ts.map +1 -0
- package/dist/src/auro-accordion-group.d.ts.map +1 -0
- package/dist/{auro-accordion.d.ts → src/auro-accordion.d.ts} +4 -4
- package/dist/src/auro-accordion.d.ts.map +1 -0
- package/dist/src/iconVersion.d.ts +3 -0
- package/dist/src/iconVersion.d.ts.map +1 -0
- package/dist/{color-css.d.ts.map → src/styles/color-css.d.ts.map} +1 -1
- package/dist/src/styles/style-button-css.d.ts.map +1 -0
- package/dist/{style-css.d.ts.map → src/styles/style-css.d.ts.map} +1 -1
- package/dist/{tokens-css.d.ts.map → src/styles/tokens-css.d.ts.map} +1 -1
- package/dist/test/auro-accordion-group.test.d.ts +2 -0
- package/dist/test/auro-accordion-group.test.d.ts.map +1 -0
- package/dist/test/auro-accordion.test.d.ts +2 -0
- package/dist/test/auro-accordion.test.d.ts.map +1 -0
- package/package.json +37 -36
- package/src/auro-accordion-button.js +25 -2
- package/src/auro-accordion.js +49 -24
- package/src/iconVersion.js +1 -1
- package/src/styles/color-css.js +2 -0
- package/src/styles/color.css +43 -0
- package/src/{color.scss → styles/color.scss} +11 -7
- package/src/styles/style-button-css.js +2 -0
- package/src/styles/style-button.css +61 -0
- package/src/{style-button.scss → styles/style-button.scss} +16 -11
- package/src/styles/style-css.js +2 -0
- package/src/styles/style.css +347 -0
- package/src/{style.scss → styles/style.scss} +19 -33
- package/src/styles/tokens-css.js +2 -0
- package/src/styles/tokens.css +7 -0
- package/src/{tokens.scss → styles/tokens.scss} +4 -4
- package/coverage/lcov-report/style-css.js.html +0 -91
- package/dist/auro-accordion-button.d.ts.map +0 -1
- package/dist/auro-accordion-group.d.ts.map +0 -1
- package/dist/auro-accordion.d.ts.map +0 -1
- package/dist/iconVersion.d.ts +0 -3
- package/dist/iconVersion.d.ts.map +0 -1
- package/dist/style-button-css.d.ts.map +0 -1
- package/src/color-css.js +0 -2
- package/src/color.css +0 -39
- 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/tokens-css.js +0 -2
- package/src/tokens.css +0 -7
- /package/dist/{auro-accordion-group.d.ts → src/auro-accordion-group.d.ts} +0 -0
- /package/dist/{color-css.d.ts → src/styles/color-css.d.ts} +0 -0
- /package/dist/{style-button-css.d.ts → src/styles/style-button-css.d.ts} +0 -0
- /package/dist/{style-css.d.ts → src/styles/style-css.d.ts} +0 -0
- /package/dist/{tokens-css.d.ts → src/styles/tokens-css.d.ts} +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Auro-accordion-button is the trigger element for Auro-accordion.
|
|
3
3
|
*/
|
|
4
4
|
export class AuroAccordionButton {
|
|
5
|
+
static get properties(): any;
|
|
5
6
|
static get styles(): any[];
|
|
6
7
|
/**
|
|
7
8
|
* This will register this element with the browser.
|
|
@@ -13,5 +14,6 @@ export class AuroAccordionButton {
|
|
|
13
14
|
*/
|
|
14
15
|
static register(name?: string): void;
|
|
15
16
|
ariaexpanded: boolean;
|
|
17
|
+
updated(changedProperties: any): void;
|
|
16
18
|
}
|
|
17
19
|
//# sourceMappingURL=auro-accordion-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auro-accordion-button.d.ts","sourceRoot":"","sources":["../../src/auro-accordion-button.js"],"names":[],"mappings":"AAYA;;GAEG;AAGH;IAOE,6BAQC;IAED,2BAKC;IAeD;;;;;;;OAOG;IACH,uBANW,MAAM,QAQhB;IA3CC,sBAAyB;IAsB3B,sCASC;CAaF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auro-accordion-group.d.ts","sourceRoot":"","sources":["../../src/auro-accordion-group.js"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AAGH;IAaE;;;;;;;;;;;;;MAiBC;IAED;;;;;;;OAOG;IACH,uBANW,MAAM,QAQhB;IAtCC;;OAEG;IACH,qBAAiD;IAqCnD,qBAGC;IAED,sCAIC;IAED;;;OAGG;IACH,4BAKC;IAED,gCAqBC;IAED;;;;OAIG;IACH,6BAaC;IAED;;;OAGG;IACH,oBAKC;IADC,iBAAgE;IAIlE,+CAMC;CACF;2BAhJgC,KAAK"}
|
|
@@ -76,13 +76,13 @@ export class AuroAccordion extends LitElement {
|
|
|
76
76
|
private runtimeUtils;
|
|
77
77
|
expanded: boolean;
|
|
78
78
|
firstUpdated(): void;
|
|
79
|
+
updated(changedProperties: any): void;
|
|
79
80
|
/**
|
|
80
|
-
*
|
|
81
|
+
* Renders the chevron icons.
|
|
81
82
|
* @private
|
|
82
|
-
* @
|
|
83
|
-
* @returns {TemplateResult} - The html template for the icon.
|
|
83
|
+
* @returns {TemplateResult} - The html template for the chevron icons.
|
|
84
84
|
*/
|
|
85
|
-
private
|
|
85
|
+
private renderChevronIcons;
|
|
86
86
|
/**
|
|
87
87
|
* Generates a random string of letters.
|
|
88
88
|
* @private
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auro-accordion.d.ts","sourceRoot":"","sources":["../../src/auro-accordion.js"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;;;;;;;GAkBG;AAGH;IAgCE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiCC;IAED,+CAMC;IAED;;;;;;;OAOG;IACH,uBANW,MAAM,QAUhB;IAjFC;;OAEG;IACH,gBAAyE;IAEzE;;OAEG;IACH,uBAAmD;IAEnD;;OAEG;IACH,kBAA0G;IAE1G;;OAEG;IACH,qBAAiD;IAEjD,kBAAqB;IA+DvB,qBAGC;IAED,sCAQC;IAED;;;;OAIG;IACH,2BAgBC;IAED;;;;;OAKG;IACH,8BASC;IAED;;OAEG;IACH,eAUC;IAED;;;;OAIG;IACH,0BAMC;IAGD,4CA2CC;CACF;2BArQmC,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconVersion.d.ts","sourceRoot":"","sources":["../../src/iconVersion.js"],"names":[],"mappings":"wBAAe,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-css.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"color-css.d.ts","sourceRoot":"","sources":["../../../src/styles/color-css.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-button-css.d.ts","sourceRoot":"","sources":["../../../src/styles/style-button-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-css.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"style-css.d.ts","sourceRoot":"","sources":["../../../src/styles/style-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens-css.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"tokens-css.d.ts","sourceRoot":"","sources":["../../../src/styles/tokens-css.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auro-accordion-group.test.d.ts","sourceRoot":"","sources":["../../test/auro-accordion-group.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auro-accordion.test.d.ts","sourceRoot":"","sources":["../../test/auro-accordion.test.js"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"================================================================================"
|
|
8
8
|
],
|
|
9
9
|
"name": "@aurodesignsystem/auro-accordion",
|
|
10
|
-
"version": "5.2.
|
|
10
|
+
"version": "5.2.2",
|
|
11
11
|
"description": "auro-accordion HTML custom element",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -20,53 +20,54 @@
|
|
|
20
20
|
"node": "^20.x || ^22.x "
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@alaskaairux/icons": "5.
|
|
24
|
-
"@aurodesignsystem/auro-button": "
|
|
25
|
-
"@aurodesignsystem/auro-icon": "8.
|
|
26
|
-
"@aurodesignsystem/auro-library": "
|
|
23
|
+
"@alaskaairux/icons": "5.6.0",
|
|
24
|
+
"@aurodesignsystem/auro-button": "11.3.2",
|
|
25
|
+
"@aurodesignsystem/auro-icon": "8.1.1",
|
|
26
|
+
"@aurodesignsystem/auro-library": "5.3.2",
|
|
27
27
|
"chalk": "^5.4.1",
|
|
28
|
-
"lit": "^3.
|
|
29
|
-
"@aurodesignsystem/webcorestylesheets": "
|
|
30
|
-
"@aurodesignsystem/design-tokens": "
|
|
28
|
+
"lit": "^3.3.1",
|
|
29
|
+
"@aurodesignsystem/webcorestylesheets": "10.0.2",
|
|
30
|
+
"@aurodesignsystem/design-tokens": "8.3.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@aurodesignsystem/eslint-config": "1.3.
|
|
34
|
-
"@commitlint/cli": "^19.8.
|
|
35
|
-
"@commitlint/config-conventional": "^19.8.
|
|
33
|
+
"@aurodesignsystem/eslint-config": "1.3.5",
|
|
34
|
+
"@commitlint/cli": "^19.8.1",
|
|
35
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
36
36
|
"@open-wc/testing": "^4.0.0",
|
|
37
|
-
"@rollup/plugin-node-resolve": "^
|
|
37
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
38
38
|
"@semantic-release/changelog": "^6.0.3",
|
|
39
39
|
"@semantic-release/git": "^10.0.1",
|
|
40
|
-
"@semantic-release/npm": "^12.0.
|
|
40
|
+
"@semantic-release/npm": "^12.0.2",
|
|
41
|
+
"@types/mocha": "^10.0.10",
|
|
41
42
|
"@web/dev-server": "^0.4.6",
|
|
42
|
-
"@web/test-runner": "^0.20.
|
|
43
|
+
"@web/test-runner": "^0.20.2",
|
|
43
44
|
"autoprefixer": "^10.4.21",
|
|
44
|
-
"compression": "^1.8.
|
|
45
|
+
"compression": "^1.8.1",
|
|
45
46
|
"concat": "^1.0.3",
|
|
46
|
-
"concurrently": "^9.
|
|
47
|
+
"concurrently": "^9.2.0",
|
|
47
48
|
"copyfiles": "^2.4.1",
|
|
48
|
-
"core-js": "^3.
|
|
49
|
-
"eslint": "^9.
|
|
50
|
-
"eslint-plugin-jsdoc": "^
|
|
49
|
+
"core-js": "^3.44.0",
|
|
50
|
+
"eslint": "^9.32.0",
|
|
51
|
+
"eslint-plugin-jsdoc": "^52.0.0",
|
|
51
52
|
"husky": "^9.1.7",
|
|
52
53
|
"lodash": "^4.17.21",
|
|
53
|
-
"markdown-magic": "^
|
|
54
|
-
"nodemon": "^3.1.
|
|
54
|
+
"markdown-magic": "^3.7.0",
|
|
55
|
+
"nodemon": "^3.1.10",
|
|
55
56
|
"npm-run-all": "^4.1.5",
|
|
56
|
-
"postcss": "^8.5.
|
|
57
|
-
"postcss-discard-comments": "^7.0.
|
|
57
|
+
"postcss": "^8.5.6",
|
|
58
|
+
"postcss-discard-comments": "^7.0.4",
|
|
58
59
|
"postcss-selector-replace": "^1.0.2",
|
|
59
|
-
"rollup": "^4.
|
|
60
|
-
"rollup-plugin-serve": "^
|
|
61
|
-
"sass": "^1.
|
|
62
|
-
"semantic-release": "^24.2.
|
|
63
|
-
"stylelint": "^16.
|
|
60
|
+
"rollup": "^4.46.1",
|
|
61
|
+
"rollup-plugin-serve": "^3.0.0",
|
|
62
|
+
"sass": "^1.89.2",
|
|
63
|
+
"semantic-release": "^24.2.7",
|
|
64
|
+
"stylelint": "^16.22.0",
|
|
64
65
|
"stylelint-config-idiomatic-order": "^10.0.0",
|
|
65
66
|
"stylelint-config-standard": "^38.0.0",
|
|
66
|
-
"stylelint-config-standard-scss": "^
|
|
67
|
-
"stylelint-order": "^
|
|
68
|
-
"stylelint-scss": "^6.
|
|
69
|
-
"typescript": "^5.8.
|
|
67
|
+
"stylelint-config-standard-scss": "^15.0.1",
|
|
68
|
+
"stylelint-order": "^7.0.0",
|
|
69
|
+
"stylelint-scss": "^6.12.1",
|
|
70
|
+
"typescript": "^5.8.3",
|
|
70
71
|
"wc-sass-render": "^1.4.0",
|
|
71
72
|
"web-component-analyzer": "^2.0.0",
|
|
72
73
|
"whatwg-fetch": "^3.6.20",
|
|
@@ -149,7 +150,7 @@
|
|
|
149
150
|
"build:dev:assets": "npm-run-all build:sass:component postCss:component sass:render build:docs",
|
|
150
151
|
"build:docs": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/generateDocs.mjs",
|
|
151
152
|
"build:sass": "npm-run-all build:sass:component postCss:component sass:render",
|
|
152
|
-
"build:sass:component": "sass --no-source-map src:src",
|
|
153
|
+
"build:sass:component": "sass --load-path=node_modules --no-source-map src:src",
|
|
153
154
|
"build:version": "node scripts/version.mjs",
|
|
154
155
|
"build:watch": "nodemon -e scss,js,html --watch src --watch apiExamples/**/* --exec npm run build:dev:assets",
|
|
155
156
|
"bundler": "rollup -c",
|
|
@@ -162,9 +163,9 @@
|
|
|
162
163
|
"preCommit": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/pre-commit.mjs",
|
|
163
164
|
"postCss:component": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/postCss.mjs",
|
|
164
165
|
"postinstall": "node packageScripts/postinstall.mjs",
|
|
165
|
-
"sass:render": "sass-render src/*.css -t ./node_modules/@aurodesignsystem/auro-library/scripts/build/staticStyles-template.js",
|
|
166
|
-
"serve": "web-dev-server --open
|
|
167
|
-
"sweep": "rm -rf ./demo/css ./dist | rm ./src/*.css ./src/*-css.js",
|
|
166
|
+
"sass:render": "sass-render src/styles/*.css -t ./node_modules/@aurodesignsystem/auro-library/scripts/build/staticStyles-template.js",
|
|
167
|
+
"serve": "web-dev-server --open --node-resolve --watch",
|
|
168
|
+
"sweep": "rm -rf ./demo/css ./dist | rm ./src/styles/*.css ./src/styles/*-css.js",
|
|
168
169
|
"test": "wtr --coverage",
|
|
169
170
|
"test:watch": "wtr --watch",
|
|
170
171
|
"types": "tsc",
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
// ---------------------------------------------------------------------
|
|
5
5
|
|
|
6
|
-
import styleButtonCss from "./style-button-css.js";
|
|
7
|
-
import styleCssAuroButton from "@aurodesignsystem/auro-button/src/style-css.js";
|
|
6
|
+
import styleButtonCss from "./styles/style-button-css.js";
|
|
7
|
+
import styleCssAuroButton from "@aurodesignsystem/auro-button/src/styles/style-css.js";
|
|
8
8
|
|
|
9
9
|
import { AuroButton } from "@aurodesignsystem/auro-button/src/auro-button.js";
|
|
10
10
|
|
|
@@ -22,6 +22,16 @@ export class AuroAccordionButton extends AuroButton {
|
|
|
22
22
|
this.ariaexpanded = false;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
static get properties() {
|
|
26
|
+
return {
|
|
27
|
+
...super.properties,
|
|
28
|
+
ariaexpanded: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
reflect: true
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
static get styles() {
|
|
26
36
|
return [
|
|
27
37
|
styleCssAuroButton,
|
|
@@ -29,6 +39,19 @@ export class AuroAccordionButton extends AuroButton {
|
|
|
29
39
|
];
|
|
30
40
|
}
|
|
31
41
|
|
|
42
|
+
|
|
43
|
+
// Sync aria-expanded changes
|
|
44
|
+
updated(changedProperties) {
|
|
45
|
+
super.updated(changedProperties);
|
|
46
|
+
|
|
47
|
+
if (changedProperties.has('ariaexpanded')) {
|
|
48
|
+
const button = this.shadowRoot.querySelector('button');
|
|
49
|
+
if (button) {
|
|
50
|
+
button.setAttribute('aria-expanded', this.ariaexpanded ? 'true' : 'false');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
32
55
|
/**
|
|
33
56
|
* This will register this element with the browser.
|
|
34
57
|
* @param {string} [name="auro-accordion-button"] - The name of element that you want to register to.
|
package/src/auro-accordion.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { LitElement, nothing } from "lit";
|
|
10
10
|
import { html } from 'lit/static-html.js';
|
|
11
11
|
import { classMap } from 'lit/directives/class-map.js';
|
|
12
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
12
13
|
|
|
13
14
|
import { AuroAccordionGroup } from './auro-accordion-group.js';
|
|
14
15
|
import { AuroAccordionButton } from './auro-accordion-button.js';
|
|
@@ -23,9 +24,9 @@ import iconVersion from './iconVersion.js';
|
|
|
23
24
|
import chevronUp from "@alaskaairux/icons/dist/icons/interface/chevron-up.mjs";
|
|
24
25
|
import chevronDown from "@alaskaairux/icons/dist/icons/interface/chevron-down.mjs";
|
|
25
26
|
|
|
26
|
-
import styleCss from "./style-css.js";
|
|
27
|
-
import colorCss from "./color-css.js";
|
|
28
|
-
import tokensCss from "./tokens-css.js";
|
|
27
|
+
import styleCss from "./styles/style-css.js";
|
|
28
|
+
import colorCss from "./styles/color-css.js";
|
|
29
|
+
import tokensCss from "./styles/tokens-css.js";
|
|
29
30
|
|
|
30
31
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
31
32
|
/**
|
|
@@ -143,19 +144,37 @@ export class AuroAccordion extends LitElement {
|
|
|
143
144
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-accordion');
|
|
144
145
|
}
|
|
145
146
|
|
|
147
|
+
updated(changedProperties) {
|
|
148
|
+
// Update button when ariaexpanded changes
|
|
149
|
+
if (changedProperties.has('expanded')) {
|
|
150
|
+
const button = this.shadowRoot.querySelector('#accordionTrigger');
|
|
151
|
+
if (button) {
|
|
152
|
+
button.ariaexpanded = this.expanded;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
146
157
|
/**
|
|
147
|
-
*
|
|
158
|
+
* Renders the chevron icons.
|
|
148
159
|
* @private
|
|
149
|
-
* @
|
|
150
|
-
* @returns {TemplateResult} - The html template for the icon.
|
|
160
|
+
* @returns {TemplateResult} - The html template for the chevron icons.
|
|
151
161
|
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
162
|
+
renderChevronIcons() {
|
|
163
|
+
if (this.chevron === 'none') {
|
|
164
|
+
return nothing;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const iconSvg = this.expanded ? chevronUp.svg : chevronDown.svg;
|
|
168
|
+
|
|
169
|
+
return html`
|
|
170
|
+
<${this.iconTag}
|
|
171
|
+
customSvg
|
|
172
|
+
customColor
|
|
173
|
+
?disabled="${this.disabled}"
|
|
174
|
+
part="chevron">
|
|
175
|
+
<div slot="svg">${unsafeHTML(iconSvg)}</div>
|
|
176
|
+
</${this.iconTag}>
|
|
177
|
+
`;
|
|
159
178
|
}
|
|
160
179
|
|
|
161
180
|
/**
|
|
@@ -208,33 +227,39 @@ export class AuroAccordion extends LitElement {
|
|
|
208
227
|
const buttonClasses = {
|
|
209
228
|
"trigger": true,
|
|
210
229
|
"iconRight": this.getAttribute('chevron') === 'right',
|
|
230
|
+
"iconNone": this.getAttribute('chevron') === 'none',
|
|
211
231
|
"sm": this.getAttribute('variant') === 'sm',
|
|
212
232
|
"lg": this.getAttribute('variant') === 'lg',
|
|
213
233
|
};
|
|
214
234
|
|
|
235
|
+
const variantClassMap = {
|
|
236
|
+
'sm': 'body-default',
|
|
237
|
+
'lg': 'heading-xs'
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const triggerSlotClass = variantClassMap[this.variant] || 'heading-2xs';
|
|
241
|
+
|
|
242
|
+
// Generate unique ID & apply aria-controls
|
|
243
|
+
const accordionContentId = `accordionContent-${this.buttonNameHash}`;
|
|
244
|
+
|
|
215
245
|
return html`
|
|
216
246
|
<div class="componentWrapper" part="accordion">
|
|
217
247
|
<${this.buttonTag}
|
|
218
248
|
?fluid="${this.emphasis}"
|
|
219
249
|
class="${classMap(buttonClasses)}"
|
|
220
250
|
id="accordionTrigger"
|
|
221
|
-
aria-controls="
|
|
251
|
+
aria-controls="${accordionContentId}"
|
|
222
252
|
?ariaexpanded="${this.expanded}"
|
|
223
253
|
?aria-disabled="${this.disabled}"
|
|
224
254
|
?disabled="${this.disabled}"
|
|
225
255
|
@click="${this.handleButtonClick}"
|
|
226
256
|
part="trigger">
|
|
227
|
-
${this.chevron === '
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
</${this.iconTag}>
|
|
231
|
-
<${this.iconTag} slot="icon" customSvg customColor ?hidden="${this.expanded}">
|
|
232
|
-
${this.generateIconHtml(chevronDown.svg)}
|
|
233
|
-
</${this.iconTag}>
|
|
234
|
-
`}
|
|
235
|
-
<slot name="trigger" part="triggerSlot"></slot>
|
|
257
|
+
${this.chevron === 'right' ? nothing : this.renderChevronIcons()}
|
|
258
|
+
<slot name="trigger" part="triggerSlot" class="${triggerSlotClass}"></slot>
|
|
259
|
+
${this.chevron === 'right' ? this.renderChevronIcons() : nothing}
|
|
236
260
|
</${this.buttonTag}>
|
|
237
|
-
|
|
261
|
+
|
|
262
|
+
<div class="content body-default" id="${accordionContentId}" aria-labelledby="accordionTrigger" inert="${!this.expanded || nothing}" part="content">
|
|
238
263
|
<div class="contentWrapper" part="contentWrapper">
|
|
239
264
|
<slot></slot>
|
|
240
265
|
</div>
|
package/src/iconVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '8.
|
|
1
|
+
export default '8.1.1'
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export default css`:host .trigger{color:var(--ds-auro-accordion-trigger-color);border-color:var(--ds-auro-accordion-trigger-border-color)}:host [auro-icon]{color:var(--ds-auro-accordion-trigger-icon-color)}:host([disabled]){--ds-auro-accordion-trigger-color: var(--ds-basic-color-texticon-disabled, v.$ds-basic-color-texticon-disabled)}:host([disabled]) [auro-icon]{color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:focus){--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([grouped]) .componentWrapper{border-bottom-color:var(--ds-auro-accordion-group-border-color)}:host([emphasis]) .trigger:before{border-color:var(--ds-auro-accordion-trigger-border-color)}:host([emphasis]) .trigger:focus:before,:host([emphasis]) .trigger:hover:before{--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-selected, #01426a)}:host([emphasis]) .trigger:focus{--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([emphasis]) .content{border-left-color:var(--ds-auro-accordion-content-border-color)}:host([emphasis][expanded]) .trigger:before{--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-selected, #01426a)}:host([emphasis][expanded]) .content{--ds-auro-accordion-content-border-color: var(--ds-basic-color-border-subtle, #dddddd)}`;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* stylelint-disable max-nesting-depth, order/properties-order, selector-max-combinators, selector-max-compound-selectors, declaration-empty-line-before, declaration-no-important, no-descending-specificity */
|
|
2
|
+
:host .trigger {
|
|
3
|
+
color: var(--ds-auro-accordion-trigger-color);
|
|
4
|
+
border-color: var(--ds-auro-accordion-trigger-border-color);
|
|
5
|
+
}
|
|
6
|
+
:host [auro-icon] {
|
|
7
|
+
color: var(--ds-auro-accordion-trigger-icon-color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([disabled]) {
|
|
11
|
+
--ds-auro-accordion-trigger-color: var(--ds-basic-color-texticon-disabled, v.$ds-basic-color-texticon-disabled);
|
|
12
|
+
}
|
|
13
|
+
:host([disabled]) [auro-icon] {
|
|
14
|
+
color: var(--ds-basic-color-texticon-disabled, #d0d0d0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host(:focus) {
|
|
18
|
+
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([grouped]) .componentWrapper {
|
|
22
|
+
border-bottom-color: var(--ds-auro-accordion-group-border-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([emphasis]) .trigger:before {
|
|
26
|
+
border-color: var(--ds-auro-accordion-trigger-border-color);
|
|
27
|
+
}
|
|
28
|
+
:host([emphasis]) .trigger:focus:before, :host([emphasis]) .trigger:hover:before {
|
|
29
|
+
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-selected, #01426a);
|
|
30
|
+
}
|
|
31
|
+
:host([emphasis]) .trigger:focus {
|
|
32
|
+
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);
|
|
33
|
+
}
|
|
34
|
+
:host([emphasis]) .content {
|
|
35
|
+
border-left-color: var(--ds-auro-accordion-content-border-color);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([emphasis][expanded]) .trigger:before {
|
|
39
|
+
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-selected, #01426a);
|
|
40
|
+
}
|
|
41
|
+
:host([emphasis][expanded]) .content {
|
|
42
|
+
--ds-auro-accordion-content-border-color: var(--ds-basic-color-border-subtle, #dddddd);
|
|
43
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/* stylelint-disable max-nesting-depth, order/properties-order, selector-max-combinators, selector-max-compound-selectors, declaration-empty-line-before, declaration-no-important, no-descending-specificity */
|
|
7
7
|
|
|
8
8
|
// Import Auro tokens
|
|
9
|
-
@
|
|
9
|
+
@use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
|
|
10
10
|
|
|
11
11
|
:host {
|
|
12
12
|
.trigger {
|
|
@@ -22,11 +22,15 @@
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
:host([disabled]) {
|
|
25
|
-
--ds-auro-accordion-trigger-color: var(--ds-basic-color-texticon-disabled,
|
|
25
|
+
--ds-auro-accordion-trigger-color: var(--ds-basic-color-texticon-disabled, v.$ds-basic-color-texticon-disabled);
|
|
26
|
+
|
|
27
|
+
[auro-icon] {
|
|
28
|
+
color: var(--ds-basic-color-texticon-disabled, v.$ds-basic-color-texticon-disabled);
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
:host(:focus) {
|
|
29
|
-
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-focused, #{
|
|
33
|
+
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-focused, #{v.$ds-advanced-color-state-focused});
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
:host([grouped]) {
|
|
@@ -44,12 +48,12 @@
|
|
|
44
48
|
&:focus,
|
|
45
49
|
&:hover {
|
|
46
50
|
&:before {
|
|
47
|
-
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-selected, #{
|
|
51
|
+
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-selected, #{v.$ds-advanced-color-state-selected});
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
&:focus {
|
|
52
|
-
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-focused, #{
|
|
56
|
+
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-focused, #{v.$ds-advanced-color-state-focused});
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
|
|
@@ -61,11 +65,11 @@
|
|
|
61
65
|
:host([emphasis][expanded]) {
|
|
62
66
|
.trigger {
|
|
63
67
|
&:before {
|
|
64
|
-
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-selected, #{
|
|
68
|
+
--ds-auro-accordion-trigger-border-color: var(--ds-advanced-color-state-selected, #{v.$ds-advanced-color-state-selected});
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
.content {
|
|
69
|
-
--ds-auro-accordion-content-border-color: var(--ds-basic-color-border-subtle, #{
|
|
73
|
+
--ds-auro-accordion-content-border-color: var(--ds-basic-color-border-subtle, #{v.$ds-basic-color-border-subtle});
|
|
70
74
|
}
|
|
71
75
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export default css`:focus:not(:focus-visible){outline:3px solid transparent}:host{border:unset;cursor:pointer;overflow:visible}:host .auro-button{all:unset;width:100%;padding:var(--ds-size-200, 1rem) var(--trigger-padding-right, 0) var(--ds-size-200, 1rem) var(--trigger-padding-left, 0);box-sizing:border-box}:host .auro-button:focus,:host .auro-button:focus-visible,:host .auro-button:focus-within{outline:0}:host .auro-button:after{border-color:transparent}:host .contentWrapper{display:flex;flex-direction:row-reverse;margin-left:0 !important;margin-right:0 !important}:host .textSlot{display:flex;flex:1}:host([disabled]){cursor:not-allowed;text-decoration:none !important}:host([disabled]) .auro-button{pointer-events:none}:host(.sm) .auro-button{padding-top:var(--ds-size-150, 0.75rem);padding-bottom:var(--ds-size-150, 0.75rem)}:host(.lg) .auro-button{padding-top:var(--ds-size-250, 1.25rem);padding-bottom:var(--ds-size-250, 1.25rem)}:host([fluid]) .textSlot{width:100%}:host(.iconRight) .textSlot{display:flex;flex-direction:row;justify-content:space-between}`;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
:focus:not(:focus-visible) {
|
|
2
|
+
outline: 3px solid transparent;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* stylelint-disable order/properties-order, declaration-empty-line-before, selector-class-pattern */
|
|
6
|
+
:host {
|
|
7
|
+
border: unset;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
overflow: visible;
|
|
10
|
+
}
|
|
11
|
+
:host .auro-button {
|
|
12
|
+
all: unset;
|
|
13
|
+
width: 100%;
|
|
14
|
+
padding: var(--ds-size-200, 1rem) var(--trigger-padding-right, 0) var(--ds-size-200, 1rem) var(--trigger-padding-left, 0);
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
:host .auro-button:focus, :host .auro-button:focus-visible, :host .auro-button:focus-within {
|
|
18
|
+
outline: 0;
|
|
19
|
+
}
|
|
20
|
+
:host .auro-button:after {
|
|
21
|
+
border-color: transparent;
|
|
22
|
+
}
|
|
23
|
+
:host .contentWrapper {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row-reverse;
|
|
26
|
+
/* stylelint-disable declaration-no-important */
|
|
27
|
+
margin-left: 0 !important;
|
|
28
|
+
margin-right: 0 !important;
|
|
29
|
+
}
|
|
30
|
+
:host .textSlot {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([disabled]) {
|
|
36
|
+
cursor: not-allowed;
|
|
37
|
+
text-decoration: none !important;
|
|
38
|
+
}
|
|
39
|
+
:host([disabled]) .auro-button {
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host(.sm) .auro-button {
|
|
44
|
+
padding-top: var(--ds-size-150, 0.75rem);
|
|
45
|
+
padding-bottom: var(--ds-size-150, 0.75rem);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host(.lg) .auro-button {
|
|
49
|
+
padding-top: var(--ds-size-250, 1.25rem);
|
|
50
|
+
padding-bottom: var(--ds-size-250, 1.25rem);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([fluid]) .textSlot {
|
|
54
|
+
width: 100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host(.iconRight) .textSlot {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
}
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
// ---------------------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
// Import Auro tokens
|
|
7
|
-
@
|
|
8
|
-
@
|
|
9
|
-
@import './../node_modules/@aurodesignsystem/webcorestylesheets/src/core';
|
|
7
|
+
@use "@aurodesignsystem/design-tokens/dist/legacy/auro-classic/SCSSVariables" as vac;
|
|
8
|
+
@use "@aurodesignsystem/webcorestylesheets/src/core";
|
|
10
9
|
|
|
11
10
|
/* stylelint-disable order/properties-order, declaration-empty-line-before, selector-class-pattern */
|
|
12
11
|
|
|
13
12
|
:host {
|
|
14
13
|
border: unset;
|
|
15
14
|
cursor: pointer;
|
|
15
|
+
overflow: visible; // override WCSS Global styles for :host to allow ::before element to be visible
|
|
16
16
|
|
|
17
17
|
.auro-button {
|
|
18
18
|
all: unset;
|
|
19
19
|
width: 100%;
|
|
20
|
-
padding: var(--ds-size-200,
|
|
21
|
-
var(--ds-size-200,
|
|
20
|
+
padding: var(--ds-size-200, vac.$ds-size-200) var(--trigger-padding-right, 0)
|
|
21
|
+
var(--ds-size-200, vac.$ds-size-200) var(--trigger-padding-left, 0);
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
|
|
24
24
|
&:focus,
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
.contentWrapper {
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: row-reverse;
|
|
38
|
+
/* stylelint-disable declaration-no-important */
|
|
39
|
+
margin-left: 0 !important; // override auro-button default
|
|
40
|
+
margin-right: 0 !important; // override auro-button default
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
.textSlot {
|
|
@@ -45,6 +48,7 @@
|
|
|
45
48
|
|
|
46
49
|
:host([disabled]) {
|
|
47
50
|
cursor: not-allowed;
|
|
51
|
+
text-decoration: none !important; // override button default
|
|
48
52
|
|
|
49
53
|
.auro-button {
|
|
50
54
|
pointer-events: none;
|
|
@@ -53,27 +57,28 @@
|
|
|
53
57
|
|
|
54
58
|
:host(.sm) {
|
|
55
59
|
.auro-button {
|
|
56
|
-
padding-top: var(--ds-size-150,
|
|
57
|
-
padding-bottom: var(--ds-size-150,
|
|
60
|
+
padding-top: var(--ds-size-150, vac.$ds-size-150);
|
|
61
|
+
padding-bottom: var(--ds-size-150, vac.$ds-size-150);
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
:host(.lg) {
|
|
62
66
|
.auro-button {
|
|
63
|
-
padding-top: var(--ds-size-250,
|
|
64
|
-
padding-bottom: var(--ds-size-250,
|
|
67
|
+
padding-top: var(--ds-size-250, vac.$ds-size-250);
|
|
68
|
+
padding-bottom: var(--ds-size-250, vac.$ds-size-250);
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
:host([fluid]) {
|
|
69
|
-
.
|
|
73
|
+
.textSlot {
|
|
70
74
|
width: 100%;
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
:host(.iconRight) {
|
|
75
|
-
.
|
|
79
|
+
.textSlot {
|
|
76
80
|
display: flex;
|
|
77
81
|
flex-direction: row;
|
|
82
|
+
justify-content: space-between;
|
|
78
83
|
}
|
|
79
84
|
}
|