@tmorrow/cre8-wc 1.0.20 → 1.0.23
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/lib/Caret_Down-VI6aytYo.js +7 -0
- package/lib/Caret_Right-DZH0BlfG.js +7 -0
- package/lib/Error-aYunUubM.js +7 -0
- package/lib/components/accordion/accordion.js +90 -0
- package/lib/components/accordion-item/accordion-item.js +337 -0
- package/lib/components/alert/alert.js +321 -0
- package/lib/components/badge/badge.js +184 -0
- package/lib/components/band/band.js +66 -0
- package/lib/components/breadcrumbs/breadcrumbs.js +53 -0
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js +72 -0
- package/lib/components/button/button.js +1082 -0
- package/lib/components/button-group/button-group.js +62 -0
- package/lib/components/card/card.js +154 -0
- package/lib/components/chart/chart.js +465 -0
- package/lib/components/checkbox-field/checkbox-field.js +100 -0
- package/lib/components/checkbox-field-item/checkbox-field-item.js +382 -0
- package/lib/components/cre8-field.js +11 -0
- package/lib/components/{components/cre8-form-element/components/cre8-form-element.js → cre8-form-element.js} +1 -1
- package/lib/components/danger-button/danger-button.js +704 -0
- package/lib/components/date-picker/date-picker.js +1059 -7
- package/lib/components/divider/divider.js +77 -0
- package/lib/components/dropdown/dropdown.js +143 -0
- package/lib/components/dropdown-item/dropdown-item.js +64 -0
- package/lib/components/feature/feature.js +104 -0
- package/lib/{field-N_97it7L.js → components/field/field.js} +77 -167
- package/lib/components/field-note/field-note.js +94 -0
- package/lib/components/footer/footer.js +52 -0
- package/lib/components/global-nav/global-nav.js +66 -0
- package/lib/components/global-nav-item/global-nav-item.js +218 -0
- package/lib/components/grid/grid.js +371 -0
- package/lib/components/grid-item/grid-item.js +27 -0
- package/lib/components/header/header.js +112 -0
- package/lib/components/heading/heading.js +215 -0
- package/lib/components/hero/hero.js +181 -0
- package/lib/components/icon/icon.js +5 -4
- package/lib/components/inline-alert/inline-alert.js +276 -0
- package/lib/components/layout/layout.js +64 -0
- package/lib/components/layout-container/layout-container.js +54 -0
- package/lib/components/layout-section/layout-section.js +46 -0
- package/lib/components/linelength-container/linelength-container.js +27 -0
- package/lib/components/link/link.js +307 -0
- package/lib/components/link-list/link-list.js +155 -0
- package/lib/components/link-list-item/link-list-item.js +109 -0
- package/lib/components/list/list.js +86 -0
- package/lib/components/list-item/list-item.js +29 -0
- package/lib/components/loading-spinner/loading-spinner.js +240 -0
- package/lib/components/logo/logo.js +39 -0
- package/lib/components/main/main.js +51 -0
- package/lib/components/modal/modal.js +311 -0
- package/lib/components/multi-select/multi-select.js +448 -0
- package/lib/components/nav-container/nav-container.js +54 -0
- package/lib/components/page-header/page-header.js +76 -0
- package/lib/components/pagination/pagination.js +413 -0
- package/lib/components/percent-bar/percent-bar.js +100 -0
- package/lib/components/popover/popover.js +363 -0
- package/lib/components/primary-nav/primary-nav.js +77 -0
- package/lib/components/primary-nav-item/primary-nav-item.js +319 -0
- package/lib/components/progress-meter/progress-meter.js +172 -0
- package/lib/components/progress-steps-item/progress-steps-item.js +143 -0
- package/lib/components/radio-field/radio-field.js +99 -0
- package/lib/components/radio-field-item/radio-field-item.js +338 -0
- package/lib/components/remove-tag/remove-tag.js +165 -0
- package/lib/components/section/section.js +68 -0
- package/lib/components/select/select.js +264 -0
- package/lib/components/select-tile/select-tile.js +686 -0
- package/lib/components/select-tile-list/select-tile-list.js +118 -0
- package/lib/components/skeleton-loader/skeleton-loader.js +97 -0
- package/lib/components/split-button/split-button.js +87 -0
- package/lib/components/submenu/submenu.js +29 -0
- package/lib/components/submenu-item/submenu-item.js +56 -0
- package/lib/components/tab/tab.js +157 -0
- package/lib/components/tab-panel/tab-panel.js +81 -0
- package/lib/components/table/table.js +97 -0
- package/lib/components/table-body/table-body.js +31 -0
- package/lib/components/table-cell/table-cell.js +83 -0
- package/lib/components/table-header/table-header.js +50 -0
- package/lib/components/table-header-cell/table-header-cell.js +57 -0
- package/lib/components/table-object/table-object.js +50 -0
- package/lib/components/table-row/table-row.js +173 -0
- package/lib/components/tabs/tabs.js +428 -0
- package/lib/components/tag/tag.js +300 -0
- package/lib/components/tag-list/tag-list.js +73 -0
- package/lib/components/tertiary-nav/tertiary-nav.js +72 -0
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js +102 -0
- package/lib/components/text-link/text-link.js +112 -0
- package/lib/components/text-passage/text-passage.js +221 -0
- package/lib/components/tooltip/tooltip.js +385 -0
- package/lib/components/utility-nav/utility-nav.js +72 -0
- package/lib/components/utility-nav-item/utility-nav-item.js +120 -0
- package/lib/{icon-XzqcRw6G.js → icon-DImqxDiW.js} +19 -22
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +166 -12356
- package/lib/vite.config.d.ts.map +1 -1
- package/package.json +9 -19
- package/lib/components/cre8-field/cre8-field.js +0 -10
- package/lib/date-picker-BzaTU8x7.js +0 -2366
- /package/lib/components/{components/cre8-element/components/cre8-element.js → cre8-element.js} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const C = `<svg fill="currentColor" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M15.7867 4.87812L8.51454 12.1503C8.447 12.2179 8.36679 12.2716 8.27851 12.3082C8.19023 12.3448 8.0956 12.3636 8.00003 12.3636C7.90446 12.3636 7.80983 12.3448 7.72155 12.3082C7.63327 12.2716 7.55306 12.2179 7.48552 12.1503L0.213345 4.87812C0.111526 4.77642 0.0421733 4.64679 0.014066 4.50565C-0.0140413 4.36451 0.000361008 4.2182 0.0554496 4.08525C0.110538 3.95229 0.203836 3.83868 0.323531 3.75878C0.443227 3.67888 0.583938 3.63629 0.727852 3.6364L15.2722 3.6364C15.4161 3.63629 15.5568 3.67888 15.6765 3.75878C15.7962 3.83868 15.8895 3.95229 15.9446 4.08525C15.9997 4.2182 16.0141 4.36451 15.986 4.50565C15.9579 4.64679 15.8885 4.77642 15.7867 4.87812Z"/>
|
|
3
|
+
</svg>
|
|
4
|
+
`;
|
|
5
|
+
export {
|
|
6
|
+
C as s
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const C = `<svg fill="currentColor" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M12.1506 8.51452L4.87827 15.7869C4.8107 15.8544 4.73049 15.908 4.6422 15.9446C4.55392 15.9812 4.4593 16 4.36375 16C4.26819 16 4.17357 15.9812 4.08529 15.9446C3.99701 15.908 3.9168 15.8544 3.84923 15.7869C3.78166 15.7193 3.72806 15.6391 3.6915 15.5508C3.65493 15.4625 3.63611 15.3679 3.63611 15.2724C3.63611 15.1768 3.65493 15.0822 3.6915 14.9939C3.72806 14.9056 3.78166 14.8254 3.84923 14.7578L10.608 8L3.84923 1.24216C3.71277 1.1057 3.63611 0.920622 3.63611 0.72764C3.63611 0.534658 3.71277 0.34958 3.84923 0.213121C3.98569 0.0766618 4.17077 1.43783e-09 4.36375 0C4.55673 -1.43783e-09 4.74181 0.0766618 4.87827 0.213121L12.1506 7.48548C12.2182 7.55302 12.2719 7.63323 12.3085 7.72151C12.3451 7.8098 12.3639 7.90443 12.3639 8C12.3639 8.09557 12.3451 8.1902 12.3085 8.27849C12.2719 8.36677 12.2182 8.44698 12.1506 8.51452Z"/>
|
|
3
|
+
</svg>
|
|
4
|
+
`;
|
|
5
|
+
export {
|
|
6
|
+
C as s
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const C = `<svg fill="currentColor" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8 0C6.41775 0 4.87103 0.469192 3.55544 1.34824C2.23985 2.22729 1.21447 3.47672 0.608967 4.93853C0.00346628 6.40034 -0.15496 8.00887 0.153721 9.56072C0.462403 11.1126 1.22433 12.538 2.34315 13.6569C3.46197 14.7757 4.88743 15.5376 6.43928 15.8463C7.99113 16.155 9.59966 15.9965 11.0615 15.391C12.5233 14.7855 13.7727 13.7602 14.6518 12.4446C15.5308 11.129 16 9.58225 16 8C15.9978 5.87895 15.1542 3.84542 13.6544 2.34562C12.1546 0.845814 10.121 0.00223986 8 0ZM7.38462 4.30769C7.38462 4.14448 7.44945 3.98796 7.56486 3.87255C7.68027 3.75714 7.83679 3.69231 8 3.69231C8.16321 3.69231 8.31974 3.75714 8.43514 3.87255C8.55055 3.98796 8.61539 4.14448 8.61539 4.30769V8.61538C8.61539 8.77859 8.55055 8.93512 8.43514 9.05053C8.31974 9.16593 8.16321 9.23077 8 9.23077C7.83679 9.23077 7.68027 9.16593 7.56486 9.05053C7.44945 8.93512 7.38462 8.77859 7.38462 8.61538V4.30769ZM8 12.3077C7.81743 12.3077 7.63897 12.2536 7.48717 12.1521C7.33537 12.0507 7.21706 11.9065 7.14719 11.7379C7.07732 11.5692 7.05904 11.3836 7.09466 11.2045C7.13028 11.0255 7.21819 10.861 7.34729 10.7319C7.47638 10.6028 7.64086 10.5149 7.81992 10.4793C7.99898 10.4437 8.18458 10.4619 8.35325 10.5318C8.52192 10.6017 8.66608 10.72 8.76751 10.8718C8.86894 11.0236 8.92308 11.202 8.92308 11.3846C8.92308 11.6294 8.82583 11.8642 8.65271 12.0373C8.4796 12.2104 8.24482 12.3077 8 12.3077Z"/>
|
|
3
|
+
</svg>
|
|
4
|
+
`;
|
|
5
|
+
export {
|
|
6
|
+
C as s
|
|
7
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { css as l, html as b } from "lit";
|
|
2
|
+
import { property as n } from "lit/decorators.js";
|
|
3
|
+
import { Cre8Element as u } from "../cre8-element.js";
|
|
4
|
+
const v = l`@import '../../design-tokens/core/scss/theming/component';
|
|
5
|
+
|
|
6
|
+
//## ACCORDION
|
|
7
|
+
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.cre8-c-accordion {
|
|
13
|
+
--cre8-accordion-border-top: var(--cre8-border-width-none);
|
|
14
|
+
--cre8-accordion-border-bottom: var(--cre8-border-width-none);
|
|
15
|
+
::slotted(cre8-accordion:not(:last-child)) {
|
|
16
|
+
--cre8-accordion-border-bottom: var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-default);
|
|
17
|
+
}
|
|
18
|
+
border: var(--cre8-border-width-none);
|
|
19
|
+
border-radius: var(--cre8-border-radius-none);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.cre8-c-inner-divider {
|
|
23
|
+
::slotted(cre8-accordion-item:last-child) {
|
|
24
|
+
border-bottom: var(--cre8-border-width-none);
|
|
25
|
+
}
|
|
26
|
+
::slotted(cre8-accordion-item:not(first-child)) {
|
|
27
|
+
border-top: var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-default);
|
|
28
|
+
}
|
|
29
|
+
::slotted(cre8-accordion-item:first-child) {
|
|
30
|
+
border-top: var(--cre8-border-width-none);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.cre8-c-accordion--border-rectangle {
|
|
35
|
+
border: var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-default);
|
|
36
|
+
border-radius: var(--cre8-border-radius-none);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.cre8-c-accordion--border-rounded-bottom {
|
|
40
|
+
border: var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-default);
|
|
41
|
+
border-radius: 0 0 var(--cre8-border-radius-default) var(--cre8-border-radius-default);
|
|
42
|
+
}
|
|
43
|
+
.cre8-c-accordion--border-rounded {
|
|
44
|
+
border: var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-border-default);
|
|
45
|
+
border-radius: var(--cre8-border-radius-default);
|
|
46
|
+
}
|
|
47
|
+
.cre8-c-accordiong-group--list {
|
|
48
|
+
list-style: none;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
var f = Object.defineProperty, s = (t, o, a, h) => {
|
|
52
|
+
for (var r = void 0, d = t.length - 1, i; d >= 0; d--)
|
|
53
|
+
(i = t[d]) && (r = i(o, a, r) || r);
|
|
54
|
+
return r && f(o, a, r), r;
|
|
55
|
+
};
|
|
56
|
+
const c = class c extends u {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments), this.hasDivider = !1;
|
|
59
|
+
}
|
|
60
|
+
connectedCallback() {
|
|
61
|
+
super.connectedCallback();
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
const o = this.componentClassNames("cre8-c-accordion", {
|
|
65
|
+
"cre8-c-inner-divider": this.hasDivider === !0,
|
|
66
|
+
"cre8-c-accordion--border-none": this.borderType === void 0 || this.borderType === "none",
|
|
67
|
+
"cre8-c-accordion--border-rectangle": this.borderType === "rectangle",
|
|
68
|
+
"cre8-c-accordion--border-rounded-bottom": this.borderType === "rounded-bottom",
|
|
69
|
+
"cre8-c-accordion--border-rounded": this.borderType === "rounded"
|
|
70
|
+
});
|
|
71
|
+
return b`
|
|
72
|
+
<div class="${o}">
|
|
73
|
+
<slot> </slot>
|
|
74
|
+
</div>
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
c.styles = [v];
|
|
79
|
+
let e = c;
|
|
80
|
+
s([
|
|
81
|
+
n()
|
|
82
|
+
], e.prototype, "borderType");
|
|
83
|
+
s([
|
|
84
|
+
n({ type: Boolean, reflect: !0 })
|
|
85
|
+
], e.prototype, "hasDivider");
|
|
86
|
+
customElements.get("cre8-accordion") === void 0 && customElements.define("cre8-accordion", e);
|
|
87
|
+
export {
|
|
88
|
+
e as Cre8Accordion,
|
|
89
|
+
e as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { a as h } from "../../icon-DImqxDiW.js";
|
|
2
|
+
import { css as b, html as i } from "lit";
|
|
3
|
+
import { property as o, state as p } from "lit/decorators.js";
|
|
4
|
+
import { ifDefined as m } from "lit-html/directives/if-defined.js";
|
|
5
|
+
import u from "classnames";
|
|
6
|
+
import { Cre8Element as v } from "../cre8-element.js";
|
|
7
|
+
import "../button/button.js";
|
|
8
|
+
const g = b`@import '../../design-tokens/core/scss/theming/component';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Accordion Item panel button
|
|
12
|
+
* 1) Icon rotating on open was causing scrollbar to continuously appear/disappear
|
|
13
|
+
* during the animation, overflow-x: hidden; prevents this from happening
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
::slotted(*) {
|
|
19
|
+
text-align: left;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cre8-c-accordion-item {
|
|
25
|
+
border-bottom: var(--cre8-accordion-item-border-bottom);
|
|
26
|
+
border-radius: var(--cre8-border-radius-none);
|
|
27
|
+
--cre8-u-icon-display: flex;
|
|
28
|
+
--cre8-u-icon-align-items: center;
|
|
29
|
+
--cre8-u-icon-justify-content: center;
|
|
30
|
+
padding: calc(8px * 3) calc(8px * 1);
|
|
31
|
+
}
|
|
32
|
+
.cre8-c-accordion-item--small cre8-heading button {
|
|
33
|
+
@include cre8-typography-title-default();
|
|
34
|
+
}
|
|
35
|
+
.cre8-c-accordion-item--large cre8-heading button {
|
|
36
|
+
@include cre8-typography-title-large();
|
|
37
|
+
}
|
|
38
|
+
.cre8-c-accordion-item__body {
|
|
39
|
+
margin-right: calc(8px * 0);
|
|
40
|
+
margin-left: calc(8px * 0);
|
|
41
|
+
padding: calc(8px * 0);
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
visibility: hidden;
|
|
44
|
+
transition: height var(--cre8-anim-fade-quick) var(--cre8-anim-ease), visibility var(--cre8-anim-fade-quick) var(--cre8-anim-ease);
|
|
45
|
+
|
|
46
|
+
.cre8-c-accordion-item.cre8-is-active & {
|
|
47
|
+
visibility: visible;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.cre8-c-accordion-item__body-inner {
|
|
52
|
+
display: flex;
|
|
53
|
+
@include cre8-typography-body-default();
|
|
54
|
+
padding: calc(8px * 1) calc(8px * 6) calc(8px * 0) calc(8px * 1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
cre8-icon {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
height: calc(8px * 3);
|
|
62
|
+
min-height: calc(8px * 3);
|
|
63
|
+
min-width: calc(8px * 3);
|
|
64
|
+
transition: transform var(--cre8-anim-fade-quick) var(--cre8-anim-ease);
|
|
65
|
+
width: calc(8px * 3);
|
|
66
|
+
|
|
67
|
+
.cre8-c-accordion-item.cre8-is-active & {
|
|
68
|
+
transform: rotate(180deg);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.cre8-c-accordion-item__icon {
|
|
73
|
+
align-items: center;
|
|
74
|
+
background: var(--cre8-color-bg-brand-strong);
|
|
75
|
+
border-radius: var(--cre8-border-radius-round);
|
|
76
|
+
color: var(--cre8-color-content-knockout);
|
|
77
|
+
display: flex;
|
|
78
|
+
height: calc(8px * 4);
|
|
79
|
+
justify-content: center;
|
|
80
|
+
margin-left: calc(8px * 1);
|
|
81
|
+
margin-right: calc(8px * 0.25);
|
|
82
|
+
min-height: calc(8px * 4);
|
|
83
|
+
min-width: calc(8px * 4);
|
|
84
|
+
width: calc(8px * 4);
|
|
85
|
+
|
|
86
|
+
.cre8-c-accordion-item.cre8-is-active & {
|
|
87
|
+
background: var(--cre8-color-button-secondary-bg);
|
|
88
|
+
border: var(--cre8-border-width-default) var(--cre8-border-style-default) var(--cre8-color-button-secondary-border);
|
|
89
|
+
color: var(--cre8-color-button-secondary-content);
|
|
90
|
+
|
|
91
|
+
&:hover {
|
|
92
|
+
border-color: var(--cre8-color-button-secondary-border-hover);
|
|
93
|
+
background-color: var(--cre8-color-button-secondary-bg-hover);
|
|
94
|
+
color: var(--cre8-color-button-secondary-content-hover);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:focus {
|
|
98
|
+
border-radius: var(--cre8-border-radius-default);
|
|
99
|
+
box-shadow: calc(8px * 0) calc(8px * 0) calc(8px * 0) calc(8px * 0.25) var(--cre8-color-border-active-outline);
|
|
100
|
+
outline: none;
|
|
101
|
+
|
|
102
|
+
.cre8-c-accordion-item__icon {
|
|
103
|
+
border-color: var(--cre8-color-button-secondary-border-active);
|
|
104
|
+
color: var(--cre8-color-button-secondary-content-active);
|
|
105
|
+
background-color: var(--cre8-color-button-secondary-bg-active);
|
|
106
|
+
}
|
|
107
|
+
.cre8-c-accordion-item__tertiary-icon {
|
|
108
|
+
border-color: var(--cre8-color-border-transparent);
|
|
109
|
+
color: var(--cre8-color-button-tertiary-content-active);
|
|
110
|
+
background-color: var(--cre8-color-bg-transparent);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.cre8-c-accordion-item__button {
|
|
117
|
+
color: var(--cre8-color-content-default);
|
|
118
|
+
display: block;
|
|
119
|
+
appearance: none;
|
|
120
|
+
background-color: var(--cre8-color-bg-transparent);
|
|
121
|
+
border: var(--cre8-border-width-none);
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
padding: calc(8px * 0.5) calc(8px * 1);
|
|
124
|
+
overflow-x: hidden;
|
|
125
|
+
transition: color var(--cre8-anim-fade-quick) var(--cre8-anim-ease);
|
|
126
|
+
width: 100%;
|
|
127
|
+
|
|
128
|
+
&.cre8-brand-color {
|
|
129
|
+
color: var(--cre8-color-content-brand-strong);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.cre8-u-justify-content-start {
|
|
133
|
+
justify-content: flex-start;
|
|
134
|
+
.cre8-c-accordion-item__icon-before {
|
|
135
|
+
margin-left: calc(8px * 0);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:hover {
|
|
140
|
+
.cre8-c-accordion-item__icon {
|
|
141
|
+
border-color: var(--cre8-color-button-primary-border-hover);
|
|
142
|
+
background-color: var(--cre8-color-button-primary-bg-hover);
|
|
143
|
+
color: var(--cre8-color-button-primary-content-hover);
|
|
144
|
+
.cre8-c-accordion-item.cre8-is-active & {
|
|
145
|
+
border-color: var(--cre8-color-button-secondary-border-hover);
|
|
146
|
+
background-color: var(--cre8-color-button-secondary-bg-hover);
|
|
147
|
+
color: var(--cre8-color-button-secondary-content-hover);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
.cre8-c-accordion-item__tertiary-icon {
|
|
151
|
+
border-color: var(--cre8-color-border-transparent);
|
|
152
|
+
color: var(--cre8-color-button-tertiary-content-hover);
|
|
153
|
+
background-color: var(--cre8-color-bg-transparent);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&:focus {
|
|
158
|
+
border-radius: var(--cre8-border-radius-default);
|
|
159
|
+
box-shadow: calc(8px * 0) calc(8px * 0) calc(8px * 0) calc(8px * 0.25) var(--cre8-color-border-active-outline);
|
|
160
|
+
outline: none;
|
|
161
|
+
|
|
162
|
+
.cre8-c-accordion-item__icon {
|
|
163
|
+
border-color: var(--cre8-color-button-primary-border-active);
|
|
164
|
+
color: var(--cre8-color-button-primary-content-active);
|
|
165
|
+
background-color: var(--cre8-color-button-primary-bg-active);
|
|
166
|
+
}
|
|
167
|
+
.cre8-c-accordion-item__tertiary-icon {
|
|
168
|
+
border-color: var(--cre8-color-border-transparent);
|
|
169
|
+
color: var(--cre8-color-button-tertiary-content-active);
|
|
170
|
+
background-color: var(--cre8-color-bg-transparent);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
.cre8-c-accordion-item--icon-before {
|
|
175
|
+
.cre8-c-accordion-item__body {
|
|
176
|
+
margin-left: calc(8px * 5);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.cre8-c-accordion-item__icon-before {
|
|
181
|
+
margin-right: calc(8px * 1.5);
|
|
182
|
+
|
|
183
|
+
h4[slot='header'] {
|
|
184
|
+
display: block;
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.cre8-c-accordion-item__button slot {
|
|
190
|
+
display: contents;
|
|
191
|
+
text-align: initial;
|
|
192
|
+
}
|
|
193
|
+
.cre8-c-accordion-item--icon-before-heading-text{
|
|
194
|
+
display: flex;
|
|
195
|
+
text-align: left;
|
|
196
|
+
flex-direction: row;
|
|
197
|
+
justify-content: flex-start;
|
|
198
|
+
align-items: center;
|
|
199
|
+
width: 100%;
|
|
200
|
+
min-width: 100%
|
|
201
|
+
}
|
|
202
|
+
.cre8-c-accordion-item--icon-after-heading-text{
|
|
203
|
+
display: flex;
|
|
204
|
+
text-align: left;
|
|
205
|
+
flex-direction: row;
|
|
206
|
+
justify-content: space-between;
|
|
207
|
+
align-items: center;
|
|
208
|
+
width: 100%;
|
|
209
|
+
min-width: 100%
|
|
210
|
+
}
|
|
211
|
+
`;
|
|
212
|
+
var f = Object.defineProperty, r = (d, t, a, y) => {
|
|
213
|
+
for (var c = void 0, n = d.length - 1, l; n >= 0; n--)
|
|
214
|
+
(l = d[n]) && (c = l(t, a, c) || c);
|
|
215
|
+
return c && f(t, a, c), c;
|
|
216
|
+
};
|
|
217
|
+
const s = class s extends v {
|
|
218
|
+
constructor() {
|
|
219
|
+
super(), this.isActive = !1, this.size = "sm", this.headingTagVariant = "h3";
|
|
220
|
+
const t = Math.floor(Math.random() * 9e5) + 1e5;
|
|
221
|
+
this._ariaControls = `cre8-accordion-item-details-${t}`, this.accordionItemId = this.accordionItemId ?? `cre8-accordion-item-${t}`;
|
|
222
|
+
}
|
|
223
|
+
connectedCallback() {
|
|
224
|
+
super.connectedCallback(), this._setContentHeight(), this.isActive && (this._fullyOpen = !0, this._setContentHeight());
|
|
225
|
+
}
|
|
226
|
+
async _setContentHeight() {
|
|
227
|
+
await this.updateComplete, this.isActive && !this._fullyOpen || !this.isActive && this._fullyOpen ? this._height = `${this.shadowRoot?.querySelector(".cre8-c-accordion-item__body-inner")?.scrollHeight}px` : this.isActive && this._fullyOpen ? this._height = "auto" : !this.isActive && !this._fullyOpen && (this._height = "0");
|
|
228
|
+
}
|
|
229
|
+
_toggleAccordionItem() {
|
|
230
|
+
this.isActive = !this.isActive, this.isActive ? (this._setContentHeight(), setTimeout(() => {
|
|
231
|
+
this._fullyOpen = !0, this._setContentHeight();
|
|
232
|
+
}, 350)) : (this._setContentHeight(), setTimeout(() => {
|
|
233
|
+
this._fullyOpen = !1, this._setContentHeight();
|
|
234
|
+
}, 50));
|
|
235
|
+
}
|
|
236
|
+
render() {
|
|
237
|
+
const t = this.componentClassNames("cre8-c-accordion-item", {
|
|
238
|
+
"cre8-is-active": this.isActive,
|
|
239
|
+
"cre8-c-accordion-item--icon-before": this.iconBefore,
|
|
240
|
+
"cre8-c-accordion-item--small": this.size === "sm",
|
|
241
|
+
"cre8-c-accordion-item--large": this.size === "lg"
|
|
242
|
+
}), a = u("cre8-c-accordion-item__button", {
|
|
243
|
+
"cre8-is-active": this.isActive,
|
|
244
|
+
"cre8-u-justify-content-start": this.iconBefore,
|
|
245
|
+
"cre8-brand-color": this.brandHeader === !0
|
|
246
|
+
});
|
|
247
|
+
return i` <div id=${this.accordionItemId} class="${t}">
|
|
248
|
+
<cre8-heading
|
|
249
|
+
type=${this.size === "lg" ? "title-large" : "title-default"}
|
|
250
|
+
part="heading"
|
|
251
|
+
?brandColor=${this.brandHeader}
|
|
252
|
+
tagVariant="${this.headingTagVariant ?? "h3"}"
|
|
253
|
+
class="cre8-c-accordion-item__header"
|
|
254
|
+
>
|
|
255
|
+
<button
|
|
256
|
+
class="${a}"
|
|
257
|
+
aria-expanded="${m(this.isActive)}"
|
|
258
|
+
aria-controls="${this._ariaControls}"
|
|
259
|
+
part="button"
|
|
260
|
+
role="button"
|
|
261
|
+
id="${this.id}"
|
|
262
|
+
@click=${this._toggleAccordionItem}
|
|
263
|
+
>
|
|
264
|
+
${this.iconBefore ? i`
|
|
265
|
+
<div class="cre8-c-accordion-item--icon-before-heading-text">
|
|
266
|
+
<div
|
|
267
|
+
class=${this.tertiaryIcon ? "cre8-c-accordion-item__tertiary-icon cre8-c-accordion-item__icon-before" : "cre8-c-accordion-item__icon cre8-c-accordion-item__icon-before"}
|
|
268
|
+
>
|
|
269
|
+
<cre8-icon rotate="180" svg=${h} aria-hidden="true"></cre8-icon>
|
|
270
|
+
</div>
|
|
271
|
+
${this.heading ?? i` <slot name="heading"></slot>`}
|
|
272
|
+
</div>
|
|
273
|
+
` : i`
|
|
274
|
+
<div class="cre8-c-accordion-item--icon-after-heading-text">
|
|
275
|
+
${this.heading ?? i` <slot name="heading"></slot>`}
|
|
276
|
+
<div
|
|
277
|
+
class=${this.tertiaryIcon ? "cre8-c-accordion-item__tertiary-icon cre8-c-accordion-item__icon-after" : "cre8-c-accordion-item__icon cre8-c-accordion-item__icon-after"}
|
|
278
|
+
>
|
|
279
|
+
<cre8-icon rotate="180" svg='${h}' aria-hidden="true"></cre8-icon>
|
|
280
|
+
</div>
|
|
281
|
+
</div>`}
|
|
282
|
+
</button>
|
|
283
|
+
</cre8-heading>
|
|
284
|
+
<div
|
|
285
|
+
class="cre8-c-accordion-item__body"
|
|
286
|
+
aria-hidden="${!this.isActive}"
|
|
287
|
+
id="${this._ariaControls}"
|
|
288
|
+
part="body"
|
|
289
|
+
style=${`height: ${this._height}`}
|
|
290
|
+
>
|
|
291
|
+
<div class="cre8-c-accordion-item__body-inner" part="body-inner">
|
|
292
|
+
<slot></slot>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
</div>`;
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
s.styles = [g];
|
|
299
|
+
let e = s;
|
|
300
|
+
r([
|
|
301
|
+
o({ type: Boolean, reflect: !0 })
|
|
302
|
+
], e.prototype, "isActive");
|
|
303
|
+
r([
|
|
304
|
+
o({ type: String, reflect: !0 })
|
|
305
|
+
], e.prototype, "accordionItemId");
|
|
306
|
+
r([
|
|
307
|
+
o({ type: Boolean, reflect: !0 })
|
|
308
|
+
], e.prototype, "iconBefore");
|
|
309
|
+
r([
|
|
310
|
+
o({ type: Boolean, reflect: !0 })
|
|
311
|
+
], e.prototype, "tertiaryIcon");
|
|
312
|
+
r([
|
|
313
|
+
o({ reflect: !0 })
|
|
314
|
+
], e.prototype, "size");
|
|
315
|
+
r([
|
|
316
|
+
o({ reflect: !0 })
|
|
317
|
+
], e.prototype, "headingTagVariant");
|
|
318
|
+
r([
|
|
319
|
+
o({ type: String })
|
|
320
|
+
], e.prototype, "heading");
|
|
321
|
+
r([
|
|
322
|
+
o({ type: Boolean })
|
|
323
|
+
], e.prototype, "brandHeader");
|
|
324
|
+
r([
|
|
325
|
+
o({ attribute: "aria-controls" })
|
|
326
|
+
], e.prototype, "_ariaControls");
|
|
327
|
+
r([
|
|
328
|
+
p()
|
|
329
|
+
], e.prototype, "_height");
|
|
330
|
+
r([
|
|
331
|
+
p()
|
|
332
|
+
], e.prototype, "_fullyOpen");
|
|
333
|
+
customElements.get("cre8-accordion-item") === void 0 && customElements.define("cre8-accordion-item", e);
|
|
334
|
+
export {
|
|
335
|
+
e as Cre8AccordionItem,
|
|
336
|
+
e as default
|
|
337
|
+
};
|