ds-one 0.2.5-alpha.1 → 0.2.5-alpha.11
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/DS1/0-face/device.ts +10 -6
- package/DS1/0-face/i18n.ts +39 -90
- package/DS1/1-root/fonts/Iosevka-Regular.woff2 +0 -0
- package/DS1/1-root/one.css +76 -107
- package/DS1/2-core/ds-banner.ts +3 -0
- package/DS1/2-core/ds-button.ts +12 -15
- package/DS1/2-core/ds-cycle.ts +67 -21
- package/DS1/2-core/ds-date.ts +1 -2
- package/DS1/2-core/ds-icon.ts +4 -4
- package/DS1/2-core/ds-text.ts +27 -3
- package/DS1/2-core/ds-tooltip.ts +6 -12
- package/DS1/3-unit/ds-list.ts +7 -0
- package/DS1/3-unit/ds-row.ts +4 -5
- package/DS1/3-unit/ds-table.ts +5 -6
- package/DS1/4-page/ds-grid.ts +9 -59
- package/DS1/4-page/ds-layout.ts +123 -18
- package/LICENSE +1 -1
- package/README.md +43 -133
- package/dist/0-face/device.d.ts.map +1 -1
- package/dist/0-face/device.js +7 -3
- package/dist/0-face/i18n.d.ts +0 -2
- package/dist/0-face/i18n.d.ts.map +1 -1
- package/dist/0-face/i18n.js +37 -74
- package/dist/2-core/ds-banner.d.ts +1 -0
- package/dist/2-core/ds-banner.d.ts.map +1 -0
- package/dist/2-core/ds-banner.js +2 -0
- package/dist/2-core/ds-button.d.ts +2 -7
- package/dist/2-core/ds-button.d.ts.map +1 -1
- package/dist/2-core/ds-button.js +11 -13
- package/dist/2-core/ds-cycle.d.ts +2 -0
- package/dist/2-core/ds-cycle.d.ts.map +1 -1
- package/dist/2-core/ds-cycle.js +65 -19
- package/dist/2-core/ds-date.js +1 -1
- package/dist/2-core/ds-icon.js +4 -4
- package/dist/2-core/ds-text.d.ts +2 -0
- package/dist/2-core/ds-text.d.ts.map +1 -1
- package/dist/2-core/ds-text.js +26 -3
- package/dist/2-core/ds-tooltip.d.ts +1 -1
- package/dist/2-core/ds-tooltip.d.ts.map +1 -1
- package/dist/2-core/ds-tooltip.js +6 -12
- package/dist/3-unit/ds-list.d.ts.map +1 -1
- package/dist/3-unit/ds-list.js +3 -0
- package/dist/3-unit/ds-portfolio-panel.d.ts.map +1 -1
- package/dist/3-unit/ds-portfolio-singlenav.js +3 -3
- package/dist/3-unit/ds-row.js +4 -4
- package/dist/3-unit/ds-table.d.ts.map +1 -1
- package/dist/3-unit/ds-table.js +5 -6
- package/dist/4-page/ds-grid.d.ts +0 -7
- package/dist/4-page/ds-grid.d.ts.map +1 -1
- package/dist/4-page/ds-grid.js +9 -54
- package/dist/4-page/ds-layout.d.ts +1 -1
- package/dist/4-page/ds-layout.d.ts.map +1 -1
- package/dist/4-page/ds-layout.js +126 -17
- package/dist/ds-one.bundle.js +347 -265
- package/dist/ds-one.bundle.js.map +4 -4
- package/dist/ds-one.bundle.min.js +204 -80
- package/dist/ds-one.bundle.min.js.map +4 -4
- package/package.json +7 -8
- package/DS1/3-unit/doublenav-v1.ts +0 -105
- package/DS1/3-unit/ds-portfolio-doublenav.ts +0 -105
- package/DS1/3-unit/ds-portfolio-panel.ts +0 -27
- package/DS1/3-unit/ds-portfolio-singlenav.ts +0 -79
- package/DS1/3-unit/list-v1.ts +0 -24
- package/DS1/3-unit/panel-v1.ts +0 -26
- package/DS1/3-unit/row-v1.ts +0 -52
- package/DS1/3-unit/singlenav-v1.ts +0 -78
- /package/DS1/x-icon/{row..svg → row.svg} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ds-one",
|
|
3
|
-
"version": "0.2.5-alpha.
|
|
3
|
+
"version": "0.2.5-alpha.11",
|
|
4
4
|
"description": "A component-based design system built with TypeScript and LitElement that provides reusable UI components with built-in theming, internationalization, and accessibility features.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist/**/*.js"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
-
"dev": "vite",
|
|
30
|
+
"dev": "vite --host",
|
|
31
31
|
"build": "bun run build:bundle",
|
|
32
32
|
"build:bundle": "bunx tsc && bunx esbuild dist/index.js --bundle --format=esm --outfile=dist/ds-one.bundle.js --sourcemap --platform=browser --target=es2020 && bunx esbuild dist/index.js --bundle --format=esm --outfile=dist/ds-one.bundle.min.js --minify --sourcemap --platform=browser --target=es2020",
|
|
33
33
|
"build:types": "tsc --noEmit",
|
|
@@ -45,12 +45,11 @@
|
|
|
45
45
|
"release:minor": "bun run scripts/release.ts minor",
|
|
46
46
|
"release:major": "bun run scripts/release.ts major",
|
|
47
47
|
"release:pre:alpha": "bun run scripts/release.ts prerelease --preid=alpha",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"docs:
|
|
51
|
-
"docs:
|
|
52
|
-
"docs:
|
|
53
|
-
"docs:deploy": "cd web && bun run deploy"
|
|
48
|
+
"publish": "npm publish --tag alpha",
|
|
49
|
+
"docs:dev": "cd website && bun run dev",
|
|
50
|
+
"docs:build": "cd website && bun run build",
|
|
51
|
+
"docs:preview": "cd website && bun run preview",
|
|
52
|
+
"docs:deploy": "cd website && bun run deploy"
|
|
54
53
|
},
|
|
55
54
|
"keywords": [
|
|
56
55
|
"design-system",
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from "lit";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A component for double navigation (previous/next)
|
|
5
|
-
*
|
|
6
|
-
* @element doublenav-v1
|
|
7
|
-
* @prop {string} previous - URL for previous link
|
|
8
|
-
* @prop {string} next - URL for next link
|
|
9
|
-
* @prop {string} previousText - Text for previous link
|
|
10
|
-
* @prop {string} nextText - Text for next link
|
|
11
|
-
* @prop {string} overlay - Overlay color (blue, red, orange, green, yellow)
|
|
12
|
-
*/
|
|
13
|
-
export class DoubleNav extends LitElement {
|
|
14
|
-
static get properties() {
|
|
15
|
-
return {
|
|
16
|
-
previous: { type: String, reflect: true },
|
|
17
|
-
next: { type: String, reflect: true },
|
|
18
|
-
previousText: { type: String, reflect: true, attribute: "previous-text" },
|
|
19
|
-
nextText: { type: String, reflect: true, attribute: "next-text" },
|
|
20
|
-
overlay: { type: String, reflect: true },
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare previous: string;
|
|
25
|
-
declare next: string;
|
|
26
|
-
declare previousText: string;
|
|
27
|
-
declare nextText: string;
|
|
28
|
-
declare overlay?: string;
|
|
29
|
-
|
|
30
|
-
constructor() {
|
|
31
|
-
super();
|
|
32
|
-
this.previous = "";
|
|
33
|
-
this.next = "";
|
|
34
|
-
this.previousText = "";
|
|
35
|
-
this.nextText = "";
|
|
36
|
-
this.overlay = "";
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static styles = css`
|
|
40
|
-
:host {
|
|
41
|
-
display: flex;
|
|
42
|
-
justify-content: space-between;
|
|
43
|
-
gap: calc(5px * var(--scaling-factor));
|
|
44
|
-
padding: calc(2px * var(--scaling-factor));
|
|
45
|
-
align-items: center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
a {
|
|
49
|
-
display: inline-flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
gap: calc(5px * var(--scaling-factor));
|
|
52
|
-
text-decoration: none;
|
|
53
|
-
color: inherit;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.nav-previous {
|
|
57
|
-
justify-self: start;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.nav-next {
|
|
61
|
-
justify-self: end;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.nav-previous icon-v1 {
|
|
65
|
-
order: -1;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.nav-next icon-v1 {
|
|
69
|
-
padding-top: 3px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.nav-previous icon-v1 {
|
|
73
|
-
padding-top: 3px;
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
|
|
77
|
-
render() {
|
|
78
|
-
return html`
|
|
79
|
-
${this.previous
|
|
80
|
-
? html`
|
|
81
|
-
<a href="${this.previous}" class="nav-previous">
|
|
82
|
-
<icon-v1 type="left"></icon-v1>
|
|
83
|
-
<ds-text>${this.previousText || "Previous"}</ds-text>
|
|
84
|
-
</a>
|
|
85
|
-
`
|
|
86
|
-
: html`<div></div>`}
|
|
87
|
-
${this.next
|
|
88
|
-
? html`
|
|
89
|
-
<a href="${this.next}" class="nav-next">
|
|
90
|
-
<ds-text>${this.nextText || "Next"}</ds-text>
|
|
91
|
-
<icon-v1 type="right"></icon-v1>
|
|
92
|
-
</a>
|
|
93
|
-
`
|
|
94
|
-
: html`<div></div>`}
|
|
95
|
-
`;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
customElements.define("doublenav-v1", DoubleNav);
|
|
100
|
-
|
|
101
|
-
declare global {
|
|
102
|
-
interface HTMLElementTagNameMap {
|
|
103
|
-
"doublenav-v1": DoubleNav;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from "lit";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A component for double navigation (previous/next)
|
|
5
|
-
*
|
|
6
|
-
* @element portfolio-doublenav
|
|
7
|
-
* @prop {string} previous - URL for previous link
|
|
8
|
-
* @prop {string} next - URL for next link
|
|
9
|
-
* @prop {string} previousText - Text for previous link
|
|
10
|
-
* @prop {string} nextText - Text for next link
|
|
11
|
-
* @prop {string} overlay - Overlay color (blue, red, orange, green, yellow)
|
|
12
|
-
*/
|
|
13
|
-
export class PortfolioDoubleNav extends LitElement {
|
|
14
|
-
static get properties() {
|
|
15
|
-
return {
|
|
16
|
-
previous: { type: String, reflect: true },
|
|
17
|
-
next: { type: String, reflect: true },
|
|
18
|
-
previousText: { type: String, reflect: true, attribute: "previous-text" },
|
|
19
|
-
nextText: { type: String, reflect: true, attribute: "next-text" },
|
|
20
|
-
overlay: { type: String, reflect: true },
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare previous: string;
|
|
25
|
-
declare next: string;
|
|
26
|
-
declare previousText: string;
|
|
27
|
-
declare nextText: string;
|
|
28
|
-
declare overlay?: string;
|
|
29
|
-
|
|
30
|
-
constructor() {
|
|
31
|
-
super();
|
|
32
|
-
this.previous = "";
|
|
33
|
-
this.next = "";
|
|
34
|
-
this.previousText = "";
|
|
35
|
-
this.nextText = "";
|
|
36
|
-
this.overlay = "";
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static styles = css`
|
|
40
|
-
:host {
|
|
41
|
-
display: flex;
|
|
42
|
-
justify-content: space-between;
|
|
43
|
-
gap: calc(5px * var(--scaling-factor));
|
|
44
|
-
padding: calc(2px * var(--scaling-factor));
|
|
45
|
-
align-items: center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
a {
|
|
49
|
-
display: inline-flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
gap: calc(5px * var(--scaling-factor));
|
|
52
|
-
text-decoration: none;
|
|
53
|
-
color: inherit;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.nav-previous {
|
|
57
|
-
justify-self: start;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.nav-next {
|
|
61
|
-
justify-self: end;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.nav-previous ds-icon {
|
|
65
|
-
order: -1;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.nav-next ds-icon {
|
|
69
|
-
padding-top: 3px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.nav-previous ds-icon {
|
|
73
|
-
padding-top: 3px;
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
|
|
77
|
-
render() {
|
|
78
|
-
return html`
|
|
79
|
-
${this.previous
|
|
80
|
-
? html`
|
|
81
|
-
<a href="${this.previous}" class="nav-previous">
|
|
82
|
-
<ds-icon type="left"></ds-icon>
|
|
83
|
-
<ds-text>${this.previousText || "Previous"}</ds-text>
|
|
84
|
-
</a>
|
|
85
|
-
`
|
|
86
|
-
: html`<div></div>`}
|
|
87
|
-
${this.next
|
|
88
|
-
? html`
|
|
89
|
-
<a href="${this.next}" class="nav-next">
|
|
90
|
-
<ds-text>${this.nextText || "Next"}</ds-text>
|
|
91
|
-
<ds-icon type="right"></ds-icon>
|
|
92
|
-
</a>
|
|
93
|
-
`
|
|
94
|
-
: html`<div></div>`}
|
|
95
|
-
`;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
customElements.define("portfolio-doublenav", PortfolioDoubleNav);
|
|
100
|
-
|
|
101
|
-
declare global {
|
|
102
|
-
interface HTMLElementTagNameMap {
|
|
103
|
-
"portfolio-doublenav": PortfolioDoubleNav;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { LitElement, html, css } from "lit";
|
|
3
|
-
|
|
4
|
-
export class PortfolioPanel extends LitElement {
|
|
5
|
-
static styles = css`
|
|
6
|
-
:host {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
height: var(--08);
|
|
10
|
-
align-items: end;
|
|
11
|
-
gap: var(--025);
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
render() {
|
|
16
|
-
return html`<slot></slot>`;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
customElements.define("portfolio-panel", PortfolioPanel);
|
|
21
|
-
|
|
22
|
-
declare global {
|
|
23
|
-
interface HTMLElementTagNameMap {
|
|
24
|
-
"portfolio-panel": PortfolioPanel;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from "lit";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A component for single navigation links
|
|
5
|
-
*
|
|
6
|
-
* @element portfolio-singlenav
|
|
7
|
-
* @prop {string} type - Type of navigation: "projects" or "work"
|
|
8
|
-
* @prop {string} to - Optional custom destination URL
|
|
9
|
-
*/
|
|
10
|
-
export class PortfolioSingleNav extends LitElement {
|
|
11
|
-
static get properties() {
|
|
12
|
-
return {
|
|
13
|
-
type: { type: String, reflect: true },
|
|
14
|
-
to: { type: String, reflect: true },
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
declare type: "projects" | "work";
|
|
19
|
-
declare to?: string;
|
|
20
|
-
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
this.type = "work";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static styles = css`
|
|
27
|
-
:host {
|
|
28
|
-
display: flex;
|
|
29
|
-
justify-content: end;
|
|
30
|
-
gap: calc(5px * var(--scaling-factor));
|
|
31
|
-
padding: calc(2px * var(--scaling-factor));
|
|
32
|
-
align-items: center;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
a {
|
|
36
|
-
display: inline-flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
gap: calc(5px * var(--scaling-factor));
|
|
39
|
-
text-decoration: none;
|
|
40
|
-
color: inherit;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
const navConfig = this.getNavConfig();
|
|
46
|
-
const href = this.to || navConfig.href;
|
|
47
|
-
|
|
48
|
-
return html`
|
|
49
|
-
<a href="${href}">
|
|
50
|
-
<ds-text key="${navConfig.key}"></ds-text>
|
|
51
|
-
<ds-icon type="right"></ds-icon>
|
|
52
|
-
</a>
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
private getNavConfig() {
|
|
57
|
-
switch (this.type) {
|
|
58
|
-
case "projects":
|
|
59
|
-
return {
|
|
60
|
-
href: "/projects",
|
|
61
|
-
key: "projects",
|
|
62
|
-
};
|
|
63
|
-
case "work":
|
|
64
|
-
return {
|
|
65
|
-
href: "/",
|
|
66
|
-
key: "workExperience",
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
customElements.define("portfolio-singlenav", PortfolioSingleNav);
|
|
73
|
-
|
|
74
|
-
declare global {
|
|
75
|
-
interface HTMLElementTagNameMap {
|
|
76
|
-
"portfolio-singlenav": PortfolioSingleNav;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
package/DS1/3-unit/list-v1.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from "lit";
|
|
2
|
-
|
|
3
|
-
export class List extends LitElement {
|
|
4
|
-
static styles = css`
|
|
5
|
-
:host {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
gap: 0;
|
|
9
|
-
width: 100%;
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
render() {
|
|
14
|
-
return html`<slot></slot>`;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
customElements.define("list-v1", List);
|
|
19
|
-
|
|
20
|
-
declare global {
|
|
21
|
-
interface HTMLElementTagNameMap {
|
|
22
|
-
"list-v1": List;
|
|
23
|
-
}
|
|
24
|
-
}
|
package/DS1/3-unit/panel-v1.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { LitElement, html, css } from "lit";
|
|
3
|
-
|
|
4
|
-
export class Panel extends LitElement {
|
|
5
|
-
static styles = css`
|
|
6
|
-
:host {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
height: var(--08);
|
|
10
|
-
align-items: end;
|
|
11
|
-
gap: var(--025);
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
render() {
|
|
16
|
-
return html`<slot></slot>`;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
customElements.define("panel-v1", Panel);
|
|
21
|
-
|
|
22
|
-
declare global {
|
|
23
|
-
interface HTMLElementTagNameMap {
|
|
24
|
-
"panel-v1": Panel;
|
|
25
|
-
}
|
|
26
|
-
}
|
package/DS1/3-unit/row-v1.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from "lit";
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
interface CustomElementRegistry {
|
|
5
|
-
define(name: string, constructor: typeof LitElement): void;
|
|
6
|
-
}
|
|
7
|
-
var customElements: CustomElementRegistry;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export class Row extends LitElement {
|
|
11
|
-
static properties = {
|
|
12
|
-
type: { type: String, reflect: true },
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
declare type: "fill" | "centered";
|
|
16
|
-
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this.type = "fill";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static styles = css`
|
|
23
|
-
:host {
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: end;
|
|
26
|
-
width: calc(240px * var(--scaling-factor));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:host([type="fill"]) {
|
|
30
|
-
justify-content: space-between;
|
|
31
|
-
height: calc(var(--1) * var(--scaling-factor));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host([type="centered"]) {
|
|
35
|
-
justify-content: center;
|
|
36
|
-
height: calc(var(--1) * var(--scaling-factor));
|
|
37
|
-
gap: calc(var(--025) * var(--scaling-factor));
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
|
-
render() {
|
|
42
|
-
return html`<slot></slot>`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
customElements.define("row-v1", Row);
|
|
47
|
-
|
|
48
|
-
declare global {
|
|
49
|
-
interface HTMLElementTagNameMap {
|
|
50
|
-
"row-v1": Row;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from "lit";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A component for single navigation links
|
|
5
|
-
*
|
|
6
|
-
* @element singlenav-v1
|
|
7
|
-
* @prop {string} type - Type of navigation: "projects" or "work"
|
|
8
|
-
* @prop {string} to - Optional custom destination URL
|
|
9
|
-
*/
|
|
10
|
-
export class SingleNav extends LitElement {
|
|
11
|
-
static get properties() {
|
|
12
|
-
return {
|
|
13
|
-
type: { type: String, reflect: true },
|
|
14
|
-
to: { type: String, reflect: true },
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
declare type: "projects" | "work";
|
|
19
|
-
declare to?: string;
|
|
20
|
-
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
this.type = "work";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static styles = css`
|
|
27
|
-
:host {
|
|
28
|
-
display: flex;
|
|
29
|
-
justify-content: end;
|
|
30
|
-
gap: calc(5px * var(--scaling-factor));
|
|
31
|
-
padding: calc(2px * var(--scaling-factor));
|
|
32
|
-
align-items: center;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
a {
|
|
36
|
-
display: inline-flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
gap: calc(5px * var(--scaling-factor));
|
|
39
|
-
text-decoration: none;
|
|
40
|
-
color: inherit;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
const navConfig = this.getNavConfig();
|
|
46
|
-
const href = this.to || navConfig.href;
|
|
47
|
-
|
|
48
|
-
return html`
|
|
49
|
-
<a href="${href}">
|
|
50
|
-
<ds-text key="${navConfig.key}"></ds-text>
|
|
51
|
-
<icon-v1 type="right"></icon-v1>
|
|
52
|
-
</a>
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
private getNavConfig() {
|
|
57
|
-
switch (this.type) {
|
|
58
|
-
case "projects":
|
|
59
|
-
return {
|
|
60
|
-
href: "/projects",
|
|
61
|
-
key: "projects",
|
|
62
|
-
};
|
|
63
|
-
case "work":
|
|
64
|
-
return {
|
|
65
|
-
href: "/",
|
|
66
|
-
key: "workExperience",
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
customElements.define("singlenav-v1", SingleNav);
|
|
73
|
-
|
|
74
|
-
declare global {
|
|
75
|
-
interface HTMLElementTagNameMap {
|
|
76
|
-
"singlenav-v1": SingleNav;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
File without changes
|