@aurodesignsystem-dev/auro-accordion 0.0.0-pr190.0 → 0.0.0-pr200.1
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.html +1 -1
- package/demo/api.js +2 -1
- package/demo/api.md +13 -7
- package/demo/api.min.js +16 -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 +44 -134
- 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/dist/color-css.d.ts
DELETED
package/dist/color-css.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color-css.d.ts","sourceRoot":"","sources":["../src/color-css.js"],"names":[],"mappings":""}
|
package/dist/iconVersion.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iconVersion.d.ts","sourceRoot":"","sources":["../src/iconVersion.js"],"names":[],"mappings":"wBAAe,OAAO"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auro-accordion-button is the trigger element for Auro-accordion.
|
|
3
|
-
*/
|
|
4
|
-
export class AuroAccordionButton {
|
|
5
|
-
static get properties(): any;
|
|
6
|
-
static get styles(): any[];
|
|
7
|
-
/**
|
|
8
|
-
* This will register this element with the browser.
|
|
9
|
-
* @param {string} [name="auro-accordion-button"] - The name of element that you want to register to.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* AuroAccordionButton.register("custom-accordion-button") // this will register this element to <custom-accordion-button/>
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
static register(name?: string): void;
|
|
16
|
-
ariaexpanded: boolean;
|
|
17
|
-
updated(changedProperties: any): void;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=auro-accordion-button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auro-accordion provides users a way to have collapsible content on a page.
|
|
3
|
-
* Use auro-accordion-group if you want to have auto closing accordion components when others are selected.
|
|
4
|
-
*
|
|
5
|
-
* @attr {Boolean} emphasis - If set, emphasis styles will be applied to the auro-accordions.
|
|
6
|
-
* @attr {String} variant - Sets accordion variant option. Possible values are: `sm`, `lg`.
|
|
7
|
-
* @attr {Boolean} disabled - If set, the whole accordion inside the group are disabled and have reduced opacity.
|
|
8
|
-
* @attr {Boolean} noToggleExpanded - If set, multiple accordions can be open at the same time.
|
|
9
|
-
*/
|
|
10
|
-
export class AuroAccordionGroup extends LitElement {
|
|
11
|
-
static get properties(): {
|
|
12
|
-
emphasis: {
|
|
13
|
-
type: BooleanConstructor;
|
|
14
|
-
reflect: boolean;
|
|
15
|
-
};
|
|
16
|
-
variant: {
|
|
17
|
-
type: StringConstructor;
|
|
18
|
-
reflect: boolean;
|
|
19
|
-
};
|
|
20
|
-
disabled: {
|
|
21
|
-
type: BooleanConstructor;
|
|
22
|
-
reflect: boolean;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* This will register this element with the browser.
|
|
27
|
-
* @param {string} [name="auro-accordion-group"] - The name of element that you want to register to.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* AuroAccordionGroup.register("custom-accordion-button") // this will register this element to <custom-accordion-group/>
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
static register(name?: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
private runtimeUtils;
|
|
38
|
-
firstUpdated(): void;
|
|
39
|
-
updated(changedProperties: any): void;
|
|
40
|
-
/**
|
|
41
|
-
* Updates the disabled state of all child <auro-accordion> elements
|
|
42
|
-
* to match the disabled state of the <auro-accordion-group> element.
|
|
43
|
-
*/
|
|
44
|
-
updateDisabledState(): void;
|
|
45
|
-
handleSlotContentChange(): void;
|
|
46
|
-
/**
|
|
47
|
-
* Internal function to toggle any expanded panels if it is not the one selected.
|
|
48
|
-
* @private
|
|
49
|
-
* @param {object} event - Standard event parameter.
|
|
50
|
-
*/
|
|
51
|
-
private handleToggleExpanded;
|
|
52
|
-
/**
|
|
53
|
-
* Internal function to add all accordions into an array.
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
56
|
-
private handleItems;
|
|
57
|
-
items: Element[];
|
|
58
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
59
|
-
}
|
|
60
|
-
import { LitElement } from "lit";
|
|
61
|
-
//# sourceMappingURL=auro-accordion-group.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auro-accordion provides users a way to have collapsible content on a page.
|
|
3
|
-
* Use auro-accordion-group if you want to have auto closing accordion components when others are selected.
|
|
4
|
-
*
|
|
5
|
-
* @attr {Boolean} alignRight - If set, the trigger content will align right.
|
|
6
|
-
* @attr {Boolean} expanded - If set, the accordion is expanded.
|
|
7
|
-
* @attr {Boolean} emphasis - If set, emphasis styles will be applied to the auro-accordions.
|
|
8
|
-
* @attr {Boolean} grouped - Attribute will be set on accordion when it appears in an accordion group.
|
|
9
|
-
* @attr {Boolean} disabled - If set, the accordion is disabled and have reduced opacity.
|
|
10
|
-
* @attr {String} chevron - Sets chevron variant option. Possible values are: `none`, `right`.
|
|
11
|
-
* @attr {String} variant - Sets accordion variant option. Possible values are: `sm`, `lg`.
|
|
12
|
-
* @slot - Default slot for the accordion content.
|
|
13
|
-
* @slot trigger - Defines the content of the trigger element.
|
|
14
|
-
* @csspart accordion - Apply CSS to Accordion wrapper.
|
|
15
|
-
* @csspart trigger - Apply CSS to trigger element.
|
|
16
|
-
* @csspart chevron - Apply CSS to chevron icon.
|
|
17
|
-
* @csspart content - Apply CSS to the accordion content.
|
|
18
|
-
* @event toggleExpanded - Notifies that the accordion has been expanded or closed.
|
|
19
|
-
*/
|
|
20
|
-
export class AuroAccordion extends LitElement {
|
|
21
|
-
static get properties(): {
|
|
22
|
-
alignRight: {
|
|
23
|
-
type: BooleanConstructor;
|
|
24
|
-
reflect: boolean;
|
|
25
|
-
};
|
|
26
|
-
expanded: {
|
|
27
|
-
type: BooleanConstructor;
|
|
28
|
-
reflect: boolean;
|
|
29
|
-
};
|
|
30
|
-
emphasis: {
|
|
31
|
-
type: BooleanConstructor;
|
|
32
|
-
reflect: boolean;
|
|
33
|
-
};
|
|
34
|
-
grouped: {
|
|
35
|
-
type: BooleanConstructor;
|
|
36
|
-
reflect: boolean;
|
|
37
|
-
};
|
|
38
|
-
chevron: {
|
|
39
|
-
type: StringConstructor;
|
|
40
|
-
reflect: boolean;
|
|
41
|
-
};
|
|
42
|
-
variant: {
|
|
43
|
-
type: StringConstructor;
|
|
44
|
-
reflect: boolean;
|
|
45
|
-
};
|
|
46
|
-
disabled: {
|
|
47
|
-
type: BooleanConstructor;
|
|
48
|
-
reflect: boolean;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
static get styles(): import("lit").CSSResult[];
|
|
52
|
-
/**
|
|
53
|
-
* This will register this element with the browser.
|
|
54
|
-
* @param {string} [name="auro-accordion"] - The name of element that you want to register to.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* AuroAccordion.register("custom-accordion") // this will register this element to <custom-accordion/>
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
static register(name?: string): void;
|
|
61
|
-
/**
|
|
62
|
-
* @private
|
|
63
|
-
*/
|
|
64
|
-
private iconTag;
|
|
65
|
-
/**
|
|
66
|
-
* @private
|
|
67
|
-
*/
|
|
68
|
-
private buttonNameHash;
|
|
69
|
-
/**
|
|
70
|
-
* @private
|
|
71
|
-
*/
|
|
72
|
-
private buttonTag;
|
|
73
|
-
/**
|
|
74
|
-
* @private
|
|
75
|
-
*/
|
|
76
|
-
private runtimeUtils;
|
|
77
|
-
expanded: boolean;
|
|
78
|
-
firstUpdated(): void;
|
|
79
|
-
updated(changedProperties: any): void;
|
|
80
|
-
/**
|
|
81
|
-
* Renders the chevron icons.
|
|
82
|
-
* @private
|
|
83
|
-
* @returns {TemplateResult} - The html template for the chevron icons.
|
|
84
|
-
*/
|
|
85
|
-
private renderChevronIcons;
|
|
86
|
-
/**
|
|
87
|
-
* Generates a random string of letters.
|
|
88
|
-
* @private
|
|
89
|
-
* @param {number} length - The number of characters to generate in the string.
|
|
90
|
-
* @returns {string} - The generated string.
|
|
91
|
-
*/
|
|
92
|
-
private generateRandomLetters;
|
|
93
|
-
/**
|
|
94
|
-
* Toggles the visibility of the accordion content.
|
|
95
|
-
*/
|
|
96
|
-
toggle(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Toggles the visibility of the accordion content when button gets clicked.
|
|
99
|
-
* @private
|
|
100
|
-
* @param {Event} event - The event object.
|
|
101
|
-
*/
|
|
102
|
-
private handleButtonClick;
|
|
103
|
-
render(): import("lit-html").TemplateResult;
|
|
104
|
-
}
|
|
105
|
-
import { LitElement } from "lit";
|
|
106
|
-
//# sourceMappingURL=auro-accordion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/src/color-css.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color-css.d.ts","sourceRoot":"","sources":["../../src/color-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iconVersion.d.ts","sourceRoot":"","sources":["../../src/iconVersion.js"],"names":[],"mappings":"wBAAe,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-button-css.d.ts","sourceRoot":"","sources":["../../src/style-button-css.js"],"names":[],"mappings":""}
|
package/dist/src/style-css.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-css.d.ts","sourceRoot":"","sources":["../../src/style-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color-css.d.ts","sourceRoot":"","sources":["../../../src/styles/color-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-button-css.d.ts","sourceRoot":"","sources":["../../../src/styles/style-button-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-css.d.ts","sourceRoot":"","sources":["../../../src/styles/style-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens-css.d.ts","sourceRoot":"","sources":["../../../src/styles/tokens-css.js"],"names":[],"mappings":""}
|
package/dist/src/tokens-css.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens-css.d.ts","sourceRoot":"","sources":["../../src/tokens-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-button-css.d.ts","sourceRoot":"","sources":["../src/style-button-css.js"],"names":[],"mappings":""}
|
package/dist/style-css.d.ts
DELETED
package/dist/style-css.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-css.d.ts","sourceRoot":"","sources":["../src/style-css.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auro-accordion-group.test.d.ts","sourceRoot":"","sources":["../../test/auro-accordion-group.test.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auro-accordion.test.d.ts","sourceRoot":"","sources":["../../test/auro-accordion.test.js"],"names":[],"mappings":""}
|
package/dist/tokens-css.d.ts
DELETED
package/dist/tokens-css.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens-css.d.ts","sourceRoot":"","sources":["../src/tokens-css.js"],"names":[],"mappings":""}
|
package/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { createRequire } from 'node:module';
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
|
-
const pjson = require('../package.json');
|
|
7
|
-
|
|
8
|
-
console.log(chalk.hex('#f26135')(`
|
|
9
|
-
|
|
10
|
-
_______ __ __ __
|
|
11
|
-
| __|.---.-.--.--. | |--.-----.| | |.-----.
|
|
12
|
-
|__ || _ | | | | | -__|| | || _ |
|
|
13
|
-
|_______||___._|___ | |__|__|_____||__|__||_____|
|
|
14
|
-
|_____|
|
|
15
|
-
__ _______ __
|
|
16
|
-
| |_.-----. | _ |.--.--.----.-----.| |
|
|
17
|
-
| _| _ | | || | | _| _ ||__|
|
|
18
|
-
|____|_____| |___|___||_____|__| |_____||__|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
╭ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ──────────────────────────────╮
|
|
22
|
-
|
|
23
|
-
Thanks for installing the latest version
|
|
24
|
-
of `) + chalk.hex('#ffd200').bold(`${pjson.name} v${pjson.version}.`) + chalk.hex('#f26135')(`
|
|
25
|
-
|
|
26
|
-
╰─────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
|
|
27
|
-
`),
|
|
28
|
-
);
|
package/scripts/version.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { AuroAccordion } from '../../src/auro-accordion.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Auro-accordion provides users a way to have collapsible content on a page.
|
|
6
|
-
* Use auro-accordion-group if you want to have auto closing accordion components when others are selected.
|
|
7
|
-
*/
|
|
8
|
-
class AuroAccordionWCA extends AuroAccordion {}
|
|
9
|
-
|
|
10
|
-
if (!customElements.get("auro-accordion")) {
|
|
11
|
-
customElements.define("auro-accordion", AuroAccordionWCA);
|
|
12
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2022 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
|
-
import styleButtonCss from "./styles/style-button-css.js";
|
|
7
|
-
import styleCssAuroButton from "@aurodesignsystem/auro-button/src/styles/style-css.js";
|
|
8
|
-
|
|
9
|
-
import { AuroButton } from "@aurodesignsystem/auro-button/src/auro-button.js";
|
|
10
|
-
|
|
11
|
-
import * as RuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Auro-accordion-button is the trigger element for Auro-accordion.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// build the component class
|
|
18
|
-
export class AuroAccordionButton extends AuroButton {
|
|
19
|
-
constructor() {
|
|
20
|
-
super();
|
|
21
|
-
|
|
22
|
-
this.ariaexpanded = false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static get properties() {
|
|
26
|
-
return {
|
|
27
|
-
...super.properties,
|
|
28
|
-
ariaexpanded: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
reflect: true
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static get styles() {
|
|
36
|
-
return [
|
|
37
|
-
styleCssAuroButton,
|
|
38
|
-
styleButtonCss
|
|
39
|
-
];
|
|
40
|
-
}
|
|
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
|
-
|
|
55
|
-
/**
|
|
56
|
-
* This will register this element with the browser.
|
|
57
|
-
* @param {string} [name="auro-accordion-button"] - The name of element that you want to register to.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* AuroAccordionButton.register("custom-accordion-button") // this will register this element to <custom-accordion-button/>
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
static register(name = "auro-accordion-button") {
|
|
64
|
-
RuntimeUtils.default.prototype.registerComponent(name, AuroAccordionButton);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,151 +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
|
-
// If using litElement base class
|
|
7
|
-
import { LitElement, html } from "lit";
|
|
8
|
-
|
|
9
|
-
import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';
|
|
10
|
-
|
|
11
|
-
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
12
|
-
/**
|
|
13
|
-
* Auro-accordion provides users a way to have collapsible content on a page.
|
|
14
|
-
* Use auro-accordion-group if you want to have auto closing accordion components when others are selected.
|
|
15
|
-
*
|
|
16
|
-
* @attr {Boolean} emphasis - If set, emphasis styles will be applied to the auro-accordions.
|
|
17
|
-
* @attr {String} variant - Sets accordion variant option. Possible values are: `sm`, `lg`.
|
|
18
|
-
* @attr {Boolean} disabled - If set, the whole accordion inside the group are disabled and have reduced opacity.
|
|
19
|
-
* @attr {Boolean} noToggleExpanded - If set, multiple accordions can be open at the same time.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
// build the component class
|
|
23
|
-
export class AuroAccordionGroup extends LitElement {
|
|
24
|
-
constructor() {
|
|
25
|
-
super();
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// This function is to define props used within the scope of this component
|
|
34
|
-
// Be sure to review https://lit.dev/docs/components/properties/
|
|
35
|
-
// to understand how to use reflected attributes with your property settings.
|
|
36
|
-
static get properties() {
|
|
37
|
-
return {
|
|
38
|
-
// ...super.properties,
|
|
39
|
-
|
|
40
|
-
emphasis: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
reflect: true
|
|
43
|
-
},
|
|
44
|
-
variant: {
|
|
45
|
-
type: String,
|
|
46
|
-
reflect: true
|
|
47
|
-
},
|
|
48
|
-
disabled: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
reflect: true
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* This will register this element with the browser.
|
|
57
|
-
* @param {string} [name="auro-accordion-group"] - The name of element that you want to register to.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* AuroAccordionGroup.register("custom-accordion-button") // this will register this element to <custom-accordion-group/>
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
static register(name = "auro-accordion-group") {
|
|
64
|
-
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroAccordionGroup);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
firstUpdated() {
|
|
68
|
-
// Add the tag name as an attribute if it is different than the component name
|
|
69
|
-
this.runtimeUtils.handleComponentTagRename(this, 'auro-accordion-group');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
updated(changedProperties) {
|
|
73
|
-
if (changedProperties.has('disabled')) {
|
|
74
|
-
this.updateDisabledState();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Updates the disabled state of all child <auro-accordion> elements
|
|
80
|
-
* to match the disabled state of the <auro-accordion-group> element.
|
|
81
|
-
*/
|
|
82
|
-
updateDisabledState() {
|
|
83
|
-
const accordions = this.querySelectorAll('auro-accordion');
|
|
84
|
-
accordions.forEach((accordion) => {
|
|
85
|
-
accordion.disabled = this.disabled;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
handleSlotContentChange() {
|
|
90
|
-
this.addEventListener('toggleExpanded', this.handleToggleExpanded);
|
|
91
|
-
|
|
92
|
-
this.handleItems();
|
|
93
|
-
|
|
94
|
-
this.items.forEach((item) => {
|
|
95
|
-
if (this.hasAttribute('emphasis')) {
|
|
96
|
-
item.setAttribute('chevron', 'right');
|
|
97
|
-
item.emphasis = true;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (this.hasAttribute('variant') && this.getAttribute('variant') === 'sm') {
|
|
101
|
-
item.setAttribute('variant', 'sm');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (this.hasAttribute('variant') && this.getAttribute('variant') === 'lg') {
|
|
105
|
-
item.setAttribute('variant', 'lg');
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
item.grouped = true;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Internal function to toggle any expanded panels if it is not the one selected.
|
|
114
|
-
* @private
|
|
115
|
-
* @param {object} event - Standard event parameter.
|
|
116
|
-
*/
|
|
117
|
-
handleToggleExpanded(event) {
|
|
118
|
-
if (!this.hasAttribute('noToggleExpanded')) {
|
|
119
|
-
this.items.forEach((item) => {
|
|
120
|
-
if (item !== event.target && item.expanded) {
|
|
121
|
-
item.expanded = false;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
this.scrollIntoView({
|
|
126
|
-
behavior: "smooth",
|
|
127
|
-
block: "nearest",
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Internal function to add all accordions into an array.
|
|
134
|
-
* @private
|
|
135
|
-
*/
|
|
136
|
-
handleItems() {
|
|
137
|
-
const groupTagName = this.tagName.toLowerCase();
|
|
138
|
-
const accordionTagName = groupTagName.substring(0, groupTagName.indexOf('-group'));
|
|
139
|
-
|
|
140
|
-
this.items = Array.from(this.querySelectorAll(accordionTagName));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// function that renders the HTML and CSS into the scope of the component
|
|
144
|
-
render() {
|
|
145
|
-
return html`
|
|
146
|
-
<div>
|
|
147
|
-
<slot @slotchange="${this.handleSlotContentChange}"></slot>
|
|
148
|
-
</div>
|
|
149
|
-
`;
|
|
150
|
-
}
|
|
151
|
-
}
|