@triptease/tt-accordion 0.0.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/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # \<tt-accordion>
2
+
3
+ This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ yarn add @triptease/tt-accordion
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <script type="module">
15
+ import '@triptease/tt-accordion';
16
+ </script>
17
+
18
+ <tt-accordion label="Section title">
19
+ <p>Content goes here.</p>
20
+ </tt-accordion>
21
+ ```
22
+
23
+ ### Attributes
24
+
25
+ | Attribute | Type | Default | Description |
26
+ |-----------|---------|---------|--------------------------------------|
27
+ | `label` | string | `""` | The header text shown on the trigger |
28
+ | `open` | boolean | `false` | Whether the accordion is expanded |
29
+
30
+ ## Testing
31
+
32
+ To execute a single test run:
33
+
34
+ ```bash
35
+ yarn test
36
+ ```
37
+
38
+ To run the tests in interactive watch mode:
39
+
40
+ ```bash
41
+ yarn test:watch
42
+ ```
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.TtAccordion = void 0;
10
+ const lit_1 = require("lit");
11
+ const decorators_js_1 = require("lit/decorators.js");
12
+ const unsafe_svg_js_1 = require("lit/directives/unsafe-svg.js");
13
+ const icons_1 = require("@triptease/icons");
14
+ const styles_js_1 = require("./styles.js");
15
+ class TtAccordion extends lit_1.LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.label = '';
19
+ this.open = false;
20
+ }
21
+ _toggle() {
22
+ this.open = !this.open;
23
+ }
24
+ render() {
25
+ return (0, lit_1.html) `
26
+ <button
27
+ id="trigger"
28
+ aria-expanded=${this.open}
29
+ aria-controls="content"
30
+ @click=${this._toggle}
31
+ >
32
+ <span>${this.label}</span>
33
+ <span class="icon" aria-hidden="true">${(0, unsafe_svg_js_1.unsafeSVG)(icons_1.chevronDown)}</span>
34
+ </button>
35
+ <div id="content" class="content" role="region" aria-labelledby="trigger">
36
+ <slot></slot>
37
+ </div>
38
+ `;
39
+ }
40
+ }
41
+ exports.TtAccordion = TtAccordion;
42
+ TtAccordion.styles = styles_js_1.styles;
43
+ __decorate([
44
+ (0, decorators_js_1.property)({ type: String })
45
+ ], TtAccordion.prototype, "label", void 0);
46
+ __decorate([
47
+ (0, decorators_js_1.property)({ type: Boolean, reflect: true })
48
+ ], TtAccordion.prototype, "open", void 0);
49
+ //# sourceMappingURL=TtAccordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TtAccordion.js","sourceRoot":"","sources":["../../../src/TtAccordion.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6BAAuC;AACvC,qDAA6C;AAC7C,gEAAyD;AACzD,4CAA+C;AAC/C,2CAAqC;AAErC,MAAa,WAAY,SAAQ,gBAAU;IAA3C;;QAIE,UAAK,GAAG,EAAE,CAAC;QAGX,SAAI,GAAG,KAAK,CAAC;IAsBf,CAAC;IApBS,OAAO;QACb,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,OAAO,IAAA,UAAI,EAAA;;;wBAGS,IAAI,CAAC,IAAI;;iBAEhB,IAAI,CAAC,OAAO;;gBAEb,IAAI,CAAC,KAAK;gDACsB,IAAA,yBAAS,EAAC,mBAAW,CAAC;;;;;KAKjE,CAAC;IACJ,CAAC;;AA5BH,kCA6BC;AA5BQ,kBAAM,GAAG,kBAAM,AAAT,CAAU;AAGvB;IADC,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAChB;AAGX;IADC,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAC9B","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { chevronDown } from '@triptease/icons';\nimport { styles } from './styles.js';\n\nexport class TtAccordion extends LitElement {\n static styles = styles;\n\n @property({ type: String })\n label = '';\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n private _toggle() {\n this.open = !this.open;\n }\n\n render() {\n return html`\n <button\n id=\"trigger\"\n aria-expanded=${this.open}\n aria-controls=\"content\"\n @click=${this._toggle}\n >\n <span>${this.label}</span>\n <span class=\"icon\" aria-hidden=\"true\">${unsafeSVG(chevronDown)}</span>\n </button>\n <div id=\"content\" class=\"content\" role=\"region\" aria-labelledby=\"trigger\">\n <slot></slot>\n </div>\n `;\n }\n}\n"]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.TtAccordion = void 0;
18
+ var tt_accordion_js_1 = require("./tt-accordion.js");
19
+ Object.defineProperty(exports, "TtAccordion", { enumerable: true, get: function () { return tt_accordion_js_1.TtAccordion; } });
20
+ __exportStar(require("./types.js"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAgD;AAAvC,8GAAA,WAAW,OAAA;AACpB,6CAA2B","sourcesContent":["export { TtAccordion } from './tt-accordion.js';\nexport * from './types.js';\n"]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.styles = void 0;
4
+ const lit_1 = require("lit");
5
+ exports.styles = (0, lit_1.css) `
6
+ :host {
7
+ display: block;
8
+ background-color: var(--color-surface-300);
9
+ }
10
+
11
+ button {
12
+ all: unset;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: space-between;
16
+ width: 100%;
17
+ cursor: pointer;
18
+ padding: var(--space-scale-2) var(--space-scale-3);
19
+ font-size: var(--font-size-200);
20
+ font-weight: var(--font-weight-semibold);
21
+ color: var(--color-text-500);
22
+ box-sizing: border-box;
23
+ border-bottom: 1px solid var(--color-border-200);
24
+ }
25
+
26
+ button:focus-visible {
27
+ outline: 4px solid rgba(1, 150, 237, 0.24);
28
+ outline-offset: -2px;
29
+ }
30
+
31
+ .icon {
32
+ transition: transform 200ms ease;
33
+ flex-shrink: 0;
34
+ color: var(--color-text-300);
35
+ }
36
+
37
+ :host([open]) .icon {
38
+ transform: rotate(180deg);
39
+ }
40
+
41
+ .content {
42
+ display: none;
43
+ padding: var(--space-scale-2) var(--space-scale-3);
44
+ font-size: var(--font-size-200);
45
+ color: var(--color-text-400);
46
+ }
47
+
48
+ :host([open]) .content {
49
+ display: block;
50
+ }
51
+ `;
52
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/styles.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAEb,QAAA,MAAM,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: block;\n background-color: var(--color-surface-300);\n }\n\n button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n cursor: pointer;\n padding: var(--space-scale-2) var(--space-scale-3);\n font-size: var(--font-size-200);\n font-weight: var(--font-weight-semibold);\n color: var(--color-text-500);\n box-sizing: border-box;\n border-bottom: 1px solid var(--color-border-200);\n }\n\n button:focus-visible {\n outline: 4px solid rgba(1, 150, 237, 0.24);\n outline-offset: -2px;\n }\n\n .icon {\n transition: transform 200ms ease;\n flex-shrink: 0;\n color: var(--color-text-300);\n }\n\n :host([open]) .icon {\n transform: rotate(180deg);\n }\n\n .content {\n display: none;\n padding: var(--space-scale-2) var(--space-scale-3);\n font-size: var(--font-size-200);\n color: var(--color-text-400);\n }\n\n :host([open]) .content {\n display: block;\n }\n`;\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TtAccordion = void 0;
4
+ const TtAccordion_js_1 = require("./TtAccordion.js");
5
+ Object.defineProperty(exports, "TtAccordion", { enumerable: true, get: function () { return TtAccordion_js_1.TtAccordion; } });
6
+ if (typeof window !== 'undefined') {
7
+ if (!window.customElements.get('tt-accordion')) {
8
+ window.customElements.define('tt-accordion', TtAccordion_js_1.TtAccordion);
9
+ }
10
+ }
11
+ //# sourceMappingURL=tt-accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-accordion.js","sourceRoot":"","sources":["../../../src/tt-accordion.ts"],"names":[],"mappings":";;;AAAA,qDAA+C;AAQtC,4FARA,4BAAW,OAQA;AANpB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/C,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,4BAAW,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC","sourcesContent":["import { TtAccordion } from './TtAccordion.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-accordion')) {\n window.customElements.define('tt-accordion', TtAccordion);\n }\n}\n\nexport { TtAccordion };\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { TtAccordion } from './TtAccordion.js';\n\ninterface TtAccordionExternalAttributes {\n label?: string;\n open?: boolean;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-accordion': TtAccordion;\n }\n namespace JSX {\n interface IntrinsicElements {\n 'tt-accordion': TtAccordionExternalAttributes & { style?: string };\n }\n }\n\n namespace React {\n namespace JSX {\n interface IntrinsicElements {\n 'tt-accordion': TtAccordionExternalAttributes & {\n key?: string;\n ref?: React.Ref<unknown>;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n };\n }\n }\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class TtAccordion extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ label: string;
5
+ open: boolean;
6
+ private _toggle;
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ }
@@ -0,0 +1,45 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, LitElement } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
10
+ import { chevronDown } from '@triptease/icons';
11
+ import { styles } from './styles.js';
12
+ export class TtAccordion extends LitElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.label = '';
16
+ this.open = false;
17
+ }
18
+ _toggle() {
19
+ this.open = !this.open;
20
+ }
21
+ render() {
22
+ return html `
23
+ <button
24
+ id="trigger"
25
+ aria-expanded=${this.open}
26
+ aria-controls="content"
27
+ @click=${this._toggle}
28
+ >
29
+ <span>${this.label}</span>
30
+ <span class="icon" aria-hidden="true">${unsafeSVG(chevronDown)}</span>
31
+ </button>
32
+ <div id="content" class="content" role="region" aria-labelledby="trigger">
33
+ <slot></slot>
34
+ </div>
35
+ `;
36
+ }
37
+ }
38
+ TtAccordion.styles = styles;
39
+ __decorate([
40
+ property({ type: String })
41
+ ], TtAccordion.prototype, "label", void 0);
42
+ __decorate([
43
+ property({ type: Boolean, reflect: true })
44
+ ], TtAccordion.prototype, "open", void 0);
45
+ //# sourceMappingURL=TtAccordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TtAccordion.js","sourceRoot":"","sources":["../../../src/TtAccordion.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,OAAO,WAAY,SAAQ,UAAU;IAA3C;;QAIE,UAAK,GAAG,EAAE,CAAC;QAGX,SAAI,GAAG,KAAK,CAAC;IAsBf,CAAC;IApBS,OAAO;QACb,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;wBAGS,IAAI,CAAC,IAAI;;iBAEhB,IAAI,CAAC,OAAO;;gBAEb,IAAI,CAAC,KAAK;gDACsB,SAAS,CAAC,WAAW,CAAC;;;;;KAKjE,CAAC;IACJ,CAAC;;AA3BM,kBAAM,GAAG,MAAM,AAAT,CAAU;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAC9B","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { chevronDown } from '@triptease/icons';\nimport { styles } from './styles.js';\n\nexport class TtAccordion extends LitElement {\n static styles = styles;\n\n @property({ type: String })\n label = '';\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n private _toggle() {\n this.open = !this.open;\n }\n\n render() {\n return html`\n <button\n id=\"trigger\"\n aria-expanded=${this.open}\n aria-controls=\"content\"\n @click=${this._toggle}\n >\n <span>${this.label}</span>\n <span class=\"icon\" aria-hidden=\"true\">${unsafeSVG(chevronDown)}</span>\n </button>\n <div id=\"content\" class=\"content\" role=\"region\" aria-labelledby=\"trigger\">\n <slot></slot>\n </div>\n `;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { TtAccordion } from './tt-accordion.js';
2
+ export * from './types.js';
@@ -0,0 +1,3 @@
1
+ export { TtAccordion } from './tt-accordion.js';
2
+ export * from './types.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,cAAc,YAAY,CAAC","sourcesContent":["export { TtAccordion } from './tt-accordion.js';\nexport * from './types.js';\n"]}
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,49 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ display: block;
5
+ background-color: var(--color-surface-300);
6
+ }
7
+
8
+ button {
9
+ all: unset;
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: space-between;
13
+ width: 100%;
14
+ cursor: pointer;
15
+ padding: var(--space-scale-2) var(--space-scale-3);
16
+ font-size: var(--font-size-200);
17
+ font-weight: var(--font-weight-semibold);
18
+ color: var(--color-text-500);
19
+ box-sizing: border-box;
20
+ border-bottom: 1px solid var(--color-border-200);
21
+ }
22
+
23
+ button:focus-visible {
24
+ outline: 4px solid rgba(1, 150, 237, 0.24);
25
+ outline-offset: -2px;
26
+ }
27
+
28
+ .icon {
29
+ transition: transform 200ms ease;
30
+ flex-shrink: 0;
31
+ color: var(--color-text-300);
32
+ }
33
+
34
+ :host([open]) .icon {
35
+ transform: rotate(180deg);
36
+ }
37
+
38
+ .content {
39
+ display: none;
40
+ padding: var(--space-scale-2) var(--space-scale-3);
41
+ font-size: var(--font-size-200);
42
+ color: var(--color-text-400);
43
+ }
44
+
45
+ :host([open]) .content {
46
+ display: block;
47
+ }
48
+ `;
49
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: block;\n background-color: var(--color-surface-300);\n }\n\n button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n cursor: pointer;\n padding: var(--space-scale-2) var(--space-scale-3);\n font-size: var(--font-size-200);\n font-weight: var(--font-weight-semibold);\n color: var(--color-text-500);\n box-sizing: border-box;\n border-bottom: 1px solid var(--color-border-200);\n }\n\n button:focus-visible {\n outline: 4px solid rgba(1, 150, 237, 0.24);\n outline-offset: -2px;\n }\n\n .icon {\n transition: transform 200ms ease;\n flex-shrink: 0;\n color: var(--color-text-300);\n }\n\n :host([open]) .icon {\n transform: rotate(180deg);\n }\n\n .content {\n display: none;\n padding: var(--space-scale-2) var(--space-scale-3);\n font-size: var(--font-size-200);\n color: var(--color-text-400);\n }\n\n :host([open]) .content {\n display: block;\n }\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ import { TtAccordion } from './TtAccordion.js';
2
+ export { TtAccordion };
@@ -0,0 +1,8 @@
1
+ import { TtAccordion } from './TtAccordion.js';
2
+ if (typeof window !== 'undefined') {
3
+ if (!window.customElements.get('tt-accordion')) {
4
+ window.customElements.define('tt-accordion', TtAccordion);
5
+ }
6
+ }
7
+ export { TtAccordion };
8
+ //# sourceMappingURL=tt-accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tt-accordion.js","sourceRoot":"","sources":["../../../src/tt-accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/C,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { TtAccordion } from './TtAccordion.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-accordion')) {\n window.customElements.define('tt-accordion', TtAccordion);\n }\n}\n\nexport { TtAccordion };\n"]}
@@ -0,0 +1,30 @@
1
+ import { TtAccordion } from './TtAccordion.js';
2
+ interface TtAccordionExternalAttributes {
3
+ label?: string;
4
+ open?: boolean;
5
+ }
6
+ declare global {
7
+ interface HTMLElementTagNameMap {
8
+ 'tt-accordion': TtAccordion;
9
+ }
10
+ namespace JSX {
11
+ interface IntrinsicElements {
12
+ 'tt-accordion': TtAccordionExternalAttributes & {
13
+ style?: string;
14
+ };
15
+ }
16
+ }
17
+ namespace React {
18
+ namespace JSX {
19
+ interface IntrinsicElements {
20
+ 'tt-accordion': TtAccordionExternalAttributes & {
21
+ key?: string;
22
+ ref?: React.Ref<unknown>;
23
+ style?: React.CSSProperties;
24
+ children?: React.ReactNode;
25
+ };
26
+ }
27
+ }
28
+ }
29
+ }
30
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { TtAccordion } from './TtAccordion.js';\n\ninterface TtAccordionExternalAttributes {\n label?: string;\n open?: boolean;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-accordion': TtAccordion;\n }\n namespace JSX {\n interface IntrinsicElements {\n 'tt-accordion': TtAccordionExternalAttributes & { style?: string };\n }\n }\n\n namespace React {\n namespace JSX {\n interface IntrinsicElements {\n 'tt-accordion': TtAccordionExternalAttributes & {\n key?: string;\n ref?: React.Ref<unknown>;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n };\n }\n }\n }\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@triptease/tt-accordion",
3
+ "description": "Webcomponent tt-accordion following open-wc recommendations",
4
+ "license": "MIT",
5
+ "author": "@triptease",
6
+ "version": "0.0.1",
7
+ "type": "module",
8
+ "main": "dist/esm/src/index.js",
9
+ "module": "dist/esm/src/index.js",
10
+ "exports": {
11
+ ".": {
12
+ "source": "./src/index.ts",
13
+ "types": "./dist/esm/src/index.d.ts",
14
+ "import": "./dist/esm/src/index.js",
15
+ "require": "./dist/cjs/src/index.js"
16
+ },
17
+ "./types": {
18
+ "source": "./src/types.ts",
19
+ "types": "./dist/esm/src/types.d.ts",
20
+ "import": "./dist/esm/src/types.js",
21
+ "require": "./dist/cjs/src/types.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist/esm",
26
+ "dist/cjs"
27
+ ],
28
+ "scripts": {
29
+ "analyze": "cem analyze --litelement",
30
+ "build": "yarn build:node && yarn build:web && yarn analyze --exclude dist",
31
+ "build:esm": "tsc",
32
+ "build:cjs": "tsc -p tsconfig.cjs.json && node ../../scripts/create-cjs-package.mjs",
33
+ "build:node": "yarn build:esm && yarn build:cjs",
34
+ "build:node:watch": "tsc --watch",
35
+ "build:web": "node ../../scripts/esbuild.mjs",
36
+ "prepublish": "tsc && yarn analyze --exclude dist",
37
+ "test": "yarn playwright install chromium && vitest run --config=./vitest.browser.config.mjs",
38
+ "test:watch": "vitest --config=./vitest.browser.config.mjs"
39
+ },
40
+ "dependencies": {
41
+ "@triptease/icons": "1.6.0",
42
+ "lit": "^3.3.0"
43
+ },
44
+ "devDependencies": {
45
+ "@custom-elements-manifest/analyzer": "^0.10.3",
46
+ "@vitest/browser-playwright": "4.1.2",
47
+ "concurrently": "^8.2.2",
48
+ "playwright": "^1.57.0",
49
+ "tslib": "^2.6.3",
50
+ "typescript": "^5.7.2",
51
+ "vitest-browser-lit": "^1.0.1"
52
+ },
53
+ "customElements": "custom-elements.json",
54
+ "publishConfig": {
55
+ "access": "public"
56
+ }
57
+ }