@triptease/tt-navbar 0.0.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/.editorconfig +29 -0
- package/.husky/pre-commit +1 -0
- package/.storybook/main.js +8 -0
- package/LICENSE +21 -0
- package/README.md +76 -0
- package/demo/index.html +30 -0
- package/dist/src/TtNavbar.d.ts +8 -0
- package/dist/src/TtNavbar.js +33 -0
- package/dist/src/TtNavbar.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/tt-navbar.d.ts +1 -0
- package/dist/src/tt-navbar.js +3 -0
- package/dist/src/tt-navbar.js.map +1 -0
- package/dist/stories/index.stories.d.ts +33 -0
- package/dist/stories/index.stories.js +37 -0
- package/dist/stories/index.stories.js.map +1 -0
- package/dist/test/tt-navbar.test.d.ts +1 -0
- package/dist/test/tt-navbar.test.js +24 -0
- package/dist/test/tt-navbar.test.js.map +1 -0
- package/dist/web/TtNavbar.js +733 -0
- package/dist/web/TtNavbar.js.map +7 -0
- package/dist/web/index.js +733 -0
- package/dist/web/index.js.map +7 -0
- package/dist/web/tt-navbar.js +733 -0
- package/dist/web/tt-navbar.js.map +7 -0
- package/package.json +92 -0
- package/src/TtNavbar.ts +27 -0
- package/src/index.ts +1 -0
- package/src/tt-navbar.ts +3 -0
- package/stories/index.stories.ts +60 -0
- package/test/tt-navbar.test.ts +32 -0
- package/tsconfig.json +22 -0
- package/web-dev-server.config.js +27 -0
- package/web-test-runner.config.js +41 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# EditorConfig helps developers define and maintain consistent
|
|
2
|
+
# coding styles between different editors and IDEs
|
|
3
|
+
# editorconfig.org
|
|
4
|
+
|
|
5
|
+
root = true
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
[*]
|
|
9
|
+
|
|
10
|
+
# Change these settings to your own preference
|
|
11
|
+
indent_style = space
|
|
12
|
+
indent_size = 2
|
|
13
|
+
|
|
14
|
+
# We recommend you to keep these unchanged
|
|
15
|
+
end_of_line = lf
|
|
16
|
+
charset = utf-8
|
|
17
|
+
trim_trailing_whitespace = true
|
|
18
|
+
insert_final_newline = true
|
|
19
|
+
|
|
20
|
+
[*.md]
|
|
21
|
+
trim_trailing_whitespace = false
|
|
22
|
+
|
|
23
|
+
[*.json]
|
|
24
|
+
indent_size = 2
|
|
25
|
+
|
|
26
|
+
[*.{html,js,md}]
|
|
27
|
+
block_comment_start = /**
|
|
28
|
+
block_comment = *
|
|
29
|
+
block_comment_end = */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
./node_modules/.bin/lint-staged
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 tt-navbar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# \<tt-navbar>
|
|
2
|
+
|
|
3
|
+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i tt-navbar
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script type="module">
|
|
15
|
+
import 'tt-navbar/tt-navbar.js';
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<tt-navbar></tt-navbar>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Linting and formatting
|
|
22
|
+
|
|
23
|
+
To scan the project for linting and formatting errors, run
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run lint
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
To automatically fix linting and formatting errors, run
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run format
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Testing with Web Test Runner
|
|
36
|
+
|
|
37
|
+
To execute a single test run:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm run test
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
To run the tests in interactive watch mode run:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm run test:watch
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Demoing with Storybook
|
|
50
|
+
|
|
51
|
+
To run a local instance of Storybook for your component, run
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm run storybook
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
To build a production version of Storybook, run
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm run storybook:build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Tooling configs
|
|
65
|
+
|
|
66
|
+
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
67
|
+
|
|
68
|
+
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
69
|
+
|
|
70
|
+
## Local Demo with `web-dev-server`
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm start
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
To run a local development server that serves the basic demo located in `demo/index.html`
|
package/demo/index.html
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
background: #fafafa;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="demo"></div>
|
|
14
|
+
|
|
15
|
+
<script type="module">
|
|
16
|
+
import { html, render } from 'lit';
|
|
17
|
+
import '../dist/src/tt-navbar.js';
|
|
18
|
+
|
|
19
|
+
const header = 'Hello owc World!';
|
|
20
|
+
render(
|
|
21
|
+
html`
|
|
22
|
+
<tt-navbar .header=${header}>
|
|
23
|
+
some light-dom
|
|
24
|
+
</tt-navbar>
|
|
25
|
+
`,
|
|
26
|
+
document.querySelector('#demo')
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
</body>
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css, LitElement } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
export class TtNavbar extends LitElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.header = 'Hey there';
|
|
8
|
+
this.counter = 5;
|
|
9
|
+
}
|
|
10
|
+
__increment() {
|
|
11
|
+
this.counter += 1;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return html `
|
|
15
|
+
<h2>${this.header} Nr. ${this.counter}!</h2>
|
|
16
|
+
<button @click=${this.__increment}>increment</button>
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
TtNavbar.styles = css `
|
|
21
|
+
:host {
|
|
22
|
+
display: block;
|
|
23
|
+
padding: 25px;
|
|
24
|
+
color: var(--tt-navbar-text-color, #000);
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
__decorate([
|
|
28
|
+
property({ type: String })
|
|
29
|
+
], TtNavbar.prototype, "header", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
property({ type: Number })
|
|
32
|
+
], TtNavbar.prototype, "counter", void 0);
|
|
33
|
+
//# sourceMappingURL=TtNavbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TtNavbar.js","sourceRoot":"","sources":["../../src/TtNavbar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,OAAO,QAAS,SAAQ,UAAU;IAAxC;;QAS8B,WAAM,GAAG,WAAW,CAAC;QAErB,YAAO,GAAG,CAAC,CAAC;IAY1C,CAAC;IAVC,WAAW;QACT,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;YACH,IAAI,CAAC,MAAM,QAAQ,IAAI,CAAC,OAAO;uBACpB,IAAI,CAAC,WAAW;KAClC,CAAC;IACJ,CAAC;;AArBM,eAAM,GAAG,GAAG,CAAA;;;;;;GAMlB,AANY,CAMX;AAE0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAsB;AAErB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAa","sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nexport class TtNavbar extends LitElement {\n static styles = css`\n :host {\n display: block;\n padding: 25px;\n color: var(--tt-navbar-text-color, #000);\n }\n `;\n\n @property({ type: String }) header = 'Hey there';\n\n @property({ type: Number }) counter = 5;\n\n __increment() {\n this.counter += 1;\n }\n\n render() {\n return html`\n <h2>${this.header} Nr. ${this.counter}!</h2>\n <button @click=${this.__increment}>increment</button>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TtNavbar } from './TtNavbar.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { TtNavbar } from './TtNavbar.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-navbar.js","sourceRoot":"","sources":["../../src/tt-navbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import { TtNavbar } from './TtNavbar.js';\n\nwindow.customElements.define('tt-navbar', TtNavbar);\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import '../src/tt-navbar.js';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
argTypes: {
|
|
7
|
+
header: {
|
|
8
|
+
control: string;
|
|
9
|
+
};
|
|
10
|
+
counter: {
|
|
11
|
+
control: string;
|
|
12
|
+
};
|
|
13
|
+
textColor: {
|
|
14
|
+
control: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
19
|
+
interface Story<T> {
|
|
20
|
+
(args: T): TemplateResult;
|
|
21
|
+
args?: Partial<T>;
|
|
22
|
+
argTypes?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
interface ArgTypes {
|
|
25
|
+
header?: string;
|
|
26
|
+
counter?: number;
|
|
27
|
+
textColor?: string;
|
|
28
|
+
slot?: TemplateResult;
|
|
29
|
+
}
|
|
30
|
+
export declare const Regular: Story<ArgTypes>;
|
|
31
|
+
export declare const CustomHeader: Story<ArgTypes>;
|
|
32
|
+
export declare const CustomCounter: Story<ArgTypes>;
|
|
33
|
+
export declare const SlottedContent: Story<ArgTypes>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import '../src/tt-navbar.js';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'TtNavbar',
|
|
5
|
+
component: 'tt-navbar',
|
|
6
|
+
argTypes: {
|
|
7
|
+
header: { control: 'text' },
|
|
8
|
+
counter: { control: 'number' },
|
|
9
|
+
textColor: { control: 'color' },
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
const Template = ({ header = 'Hello world', counter = 5, textColor, slot, }) => html `
|
|
13
|
+
<tt-navbar
|
|
14
|
+
style="--tt-navbar-text-color: ${textColor || 'black'}"
|
|
15
|
+
.header=${header}
|
|
16
|
+
.counter=${counter}
|
|
17
|
+
>
|
|
18
|
+
${slot}
|
|
19
|
+
</tt-navbar>
|
|
20
|
+
`;
|
|
21
|
+
export const Regular = Template.bind({});
|
|
22
|
+
export const CustomHeader = Template.bind({});
|
|
23
|
+
CustomHeader.args = {
|
|
24
|
+
header: 'My header',
|
|
25
|
+
};
|
|
26
|
+
export const CustomCounter = Template.bind({});
|
|
27
|
+
CustomCounter.args = {
|
|
28
|
+
counter: 123456,
|
|
29
|
+
};
|
|
30
|
+
export const SlottedContent = Template.bind({});
|
|
31
|
+
SlottedContent.args = {
|
|
32
|
+
slot: html `<p>Slotted content</p>`,
|
|
33
|
+
};
|
|
34
|
+
SlottedContent.argTypes = {
|
|
35
|
+
slot: { table: { disable: true } },
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=index.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../stories/index.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,OAAO,qBAAqB,CAAC;AAE7B,eAAe;IACb,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE;QACR,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC3B,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9B,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KAChC;CACF,CAAC;AAeF,MAAM,QAAQ,GAAoB,CAAC,EACjC,MAAM,GAAG,aAAa,EACtB,OAAO,GAAG,CAAC,EACX,SAAS,EACT,IAAI,GACK,EAAE,EAAE,CAAC,IAAI,CAAA;;qCAEiB,SAAS,IAAI,OAAO;cAC3C,MAAM;eACL,OAAO;;MAEhB,IAAI;;CAET,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9C,YAAY,CAAC,IAAI,GAAG;IAClB,MAAM,EAAE,WAAW;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/C,aAAa,CAAC,IAAI,GAAG;IACnB,OAAO,EAAE,MAAM;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,cAAc,CAAC,IAAI,GAAG;IACpB,IAAI,EAAE,IAAI,CAAA,wBAAwB;CACnC,CAAC;AACF,cAAc,CAAC,QAAQ,GAAG;IACxB,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CACnC,CAAC","sourcesContent":["import { html, TemplateResult } from 'lit';\nimport '../src/tt-navbar.js';\n\nexport default {\n title: 'TtNavbar',\n component: 'tt-navbar',\n argTypes: {\n header: { control: 'text' },\n counter: { control: 'number' },\n textColor: { control: 'color' },\n },\n};\n\ninterface Story<T> {\n (args: T): TemplateResult;\n args?: Partial<T>;\n argTypes?: Record<string, unknown>;\n}\n\ninterface ArgTypes {\n header?: string;\n counter?: number;\n textColor?: string;\n slot?: TemplateResult;\n}\n\nconst Template: Story<ArgTypes> = ({\n header = 'Hello world',\n counter = 5,\n textColor,\n slot,\n}: ArgTypes) => html`\n <tt-navbar\n style=\"--tt-navbar-text-color: ${textColor || 'black'}\"\n .header=${header}\n .counter=${counter}\n >\n ${slot}\n </tt-navbar>\n`;\n\nexport const Regular = Template.bind({});\n\nexport const CustomHeader = Template.bind({});\nCustomHeader.args = {\n header: 'My header',\n};\n\nexport const CustomCounter = Template.bind({});\nCustomCounter.args = {\n counter: 123456,\n};\n\nexport const SlottedContent = Template.bind({});\nSlottedContent.args = {\n slot: html`<p>Slotted content</p>`,\n};\nSlottedContent.argTypes = {\n slot: { table: { disable: true } },\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../src/tt-navbar.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { fixture, expect } from '@open-wc/testing';
|
|
3
|
+
import '../src/tt-navbar.js';
|
|
4
|
+
describe('TtNavbar', () => {
|
|
5
|
+
it('has a default header "Hey there" and counter 5', async () => {
|
|
6
|
+
const el = await fixture(html `<tt-navbar></tt-navbar>`);
|
|
7
|
+
expect(el.header).to.equal('Hey there');
|
|
8
|
+
expect(el.counter).to.equal(5);
|
|
9
|
+
});
|
|
10
|
+
it('increases the counter on button click', async () => {
|
|
11
|
+
const el = await fixture(html `<tt-navbar></tt-navbar>`);
|
|
12
|
+
el.shadowRoot.querySelector('button').click();
|
|
13
|
+
expect(el.counter).to.equal(6);
|
|
14
|
+
});
|
|
15
|
+
it('can override the header via attribute', async () => {
|
|
16
|
+
const el = await fixture(html `<tt-navbar header="attribute header"></tt-navbar>`);
|
|
17
|
+
expect(el.header).to.equal('attribute header');
|
|
18
|
+
});
|
|
19
|
+
it('passes the a11y audit', async () => {
|
|
20
|
+
const el = await fixture(html `<tt-navbar></tt-navbar>`);
|
|
21
|
+
await expect(el).shadowDom.to.be.accessible();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=tt-navbar.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-navbar.test.js","sourceRoot":"","sources":["../../test/tt-navbar.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,qBAAqB,CAAC;AAE7B,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,EAAE,GAAG,MAAM,OAAO,CAAW,IAAI,CAAA,yBAAyB,CAAC,CAAC;QAElE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACxC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAW,IAAI,CAAA,yBAAyB,CAAC,CAAC;QAClE,EAAE,CAAC,UAAW,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC,KAAK,EAAE,CAAC;QAEhD,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAW,IAAI,CAAA,mDAAmD,CAAC,CAAC;QAE5F,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAW,IAAI,CAAA,yBAAyB,CAAC,CAAC;QAElE,MAAM,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { fixture, expect } from '@open-wc/testing';\nimport { TtNavbar } from '../src/TtNavbar.js';\nimport '../src/tt-navbar.js';\n\ndescribe('TtNavbar', () => {\n it('has a default header \"Hey there\" and counter 5', async () => {\n const el = await fixture<TtNavbar>(html`<tt-navbar></tt-navbar>`);\n\n expect(el.header).to.equal('Hey there');\n expect(el.counter).to.equal(5);\n });\n\n it('increases the counter on button click', async () => {\n const el = await fixture<TtNavbar>(html`<tt-navbar></tt-navbar>`);\n el.shadowRoot!.querySelector('button')!.click();\n\n expect(el.counter).to.equal(6);\n });\n\n it('can override the header via attribute', async () => {\n const el = await fixture<TtNavbar>(html`<tt-navbar header=\"attribute header\"></tt-navbar>`);\n\n expect(el.header).to.equal('attribute header');\n });\n\n it('passes the a11y audit', async () => {\n const el = await fixture<TtNavbar>(html`<tt-navbar></tt-navbar>`);\n\n await expect(el).shadowDom.to.be.accessible();\n });\n});\n"]}
|