@jotyping/jo-designsystem 0.1.20-alpha → 0.1.21-alpha
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/package.json +7 -2
- package/.prettierignore +0 -3
- package/.prettierrc +0 -1
- package/.storybook/main.ts +0 -18
- package/.storybook/preview.ts +0 -15
- package/eslint.config.js +0 -12
- package/index.html +0 -19
- package/public/assets/satoshi-black.ttf +0 -0
- package/public/assets/satoshi-bold.ttf +0 -0
- package/public/assets/satoshi-italic.ttf +0 -0
- package/public/assets/satoshi-regular.ttf +0 -0
- package/public/vite.svg +0 -1
- package/src/assets/lit.svg +0 -1
- package/src/assets/satoshi-black.ttf +0 -0
- package/src/assets/satoshi-bold.ttf +0 -0
- package/src/assets/satoshi-italic.ttf +0 -0
- package/src/assets/satoshi-regular.ttf +0 -0
- package/src/components/button/jd-button.scss +0 -56
- package/src/components/button/jd-button.ts +0 -28
- package/src/components/button/stories/jd-button.stories.ts +0 -44
- package/src/components/flash/jd-flash.scss +0 -47
- package/src/components/flash/jd-flash.ts +0 -65
- package/src/components/flash/stories/jd-flash.stories.ts +0 -62
- package/src/components/footer/jd-footer.scss +0 -42
- package/src/components/footer/jd-footer.ts +0 -42
- package/src/components/footer/stories/jd-footer.stories.ts +0 -20
- package/src/components/header/jd-header.scss +0 -48
- package/src/components/header/jd-header.ts +0 -58
- package/src/components/header/stories/jd-header.stories.ts +0 -52
- package/src/components/heading/jd-heading.scss +0 -48
- package/src/components/heading/jd-heading.ts +0 -49
- package/src/components/heading/stories/jd-heading.stories.ts +0 -47
- package/src/components/icon/icon-data.ts +0 -45
- package/src/components/icon/jd-icon.scss +0 -35
- package/src/components/icon/jd-icon.ts +0 -66
- package/src/components/icon/stories/jd-icon.stories.ts +0 -62
- package/src/components/icon-button/jd-icon-button.scss +0 -36
- package/src/components/icon-button/jd-icon-button.ts +0 -51
- package/src/components/icon-button/stories/jd-icon-button.stories.ts +0 -93
- package/src/components/image-link/jd-image-link.scss +0 -41
- package/src/components/image-link/jd-image-link.ts +0 -36
- package/src/components/image-link/stories/jd-image-link.stories.ts +0 -46
- package/src/components/link/jd-link.scss +0 -29
- package/src/components/link/jd-link.ts +0 -25
- package/src/components/link/stories/jd-link.stories.ts +0 -42
- package/src/components/modal/jd-modal.scss +0 -91
- package/src/components/modal/jd-modal.ts +0 -75
- package/src/components/modal/stories/jd-modal.stories.ts +0 -54
- package/src/components/navigation/jd-navigation.scss +0 -17
- package/src/components/navigation/jd-navigation.ts +0 -32
- package/src/components/navigation/stories/jd-navigation.stories.ts +0 -47
- package/src/components/tag/jd-tag.scss +0 -19
- package/src/components/tag/jd-tag.ts +0 -23
- package/src/components/tag/stories/jd-tag.stories.ts +0 -20
- package/src/components.ts +0 -12
- package/src/index.ts +0 -20
- package/src/stores/breakpoint-store.ts +0 -16
- package/src/styles/_mixins.scss +0 -112
- package/src/styles/_reset.scss +0 -62
- package/src/styles/_tokens.scss +0 -50
- package/src/styles/fonts.css +0 -31
- package/src/styles/variables.scss +0 -12
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.build.json +0 -12
- package/tsconfig.json +0 -47
- package/vite.config.ts +0 -34
- /package/{license.md → LICENCE.md} +0 -0
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import "../jd-image-link.ts";
|
|
4
|
-
|
|
5
|
-
type JdImageLinkArgs = {
|
|
6
|
-
href: string;
|
|
7
|
-
target: "_blank" | "_bla";
|
|
8
|
-
description: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const meta: Meta<JdImageLinkArgs> = {
|
|
12
|
-
title: "Components/ImageLink",
|
|
13
|
-
component: "jd-image-link",
|
|
14
|
-
argTypes: {
|
|
15
|
-
href: {
|
|
16
|
-
control: { type: "text" },
|
|
17
|
-
description: "href of the link",
|
|
18
|
-
defaultValue: "",
|
|
19
|
-
},
|
|
20
|
-
target: {
|
|
21
|
-
control: { type: "select" },
|
|
22
|
-
options: ["_blank", "_bla"],
|
|
23
|
-
description: "href of the link",
|
|
24
|
-
defaultValue: "",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default meta;
|
|
30
|
-
type Story = StoryObj<JdImageLinkArgs>;
|
|
31
|
-
|
|
32
|
-
const DefaultExample = (args: JdImageLinkArgs) => {
|
|
33
|
-
return html` <jd-image-link
|
|
34
|
-
href=${args.href}
|
|
35
|
-
target=${args.target}
|
|
36
|
-
description="This is a link"
|
|
37
|
-
>
|
|
38
|
-
Click me
|
|
39
|
-
</jd-image-link>`;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const DefaultStory: Story = {
|
|
43
|
-
name: "Default",
|
|
44
|
-
render: DefaultExample.bind({}),
|
|
45
|
-
args: { href: "https://www.google.com", target: "_blank" },
|
|
46
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
@use "/src/styles/mixins.scss" as mixins;
|
|
2
|
-
@use "/src/styles/tokens.scss" as tokens;
|
|
3
|
-
|
|
4
|
-
:host {
|
|
5
|
-
display: inline-block;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.link-wrapper {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
gap: 4px;
|
|
12
|
-
width: auto;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
a {
|
|
16
|
-
color: tokens.$color-black;
|
|
17
|
-
text-decoration: none;
|
|
18
|
-
background-color: transparent;
|
|
19
|
-
&:hover {
|
|
20
|
-
color: tokens.$color-black;
|
|
21
|
-
text-decoration: underline;
|
|
22
|
-
text-decoration-thickness: 2px;
|
|
23
|
-
text-underline-offset: 6px;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.title {
|
|
28
|
-
@include mixins.font-03-copy;
|
|
29
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
import style from "./jd-link.scss?inline";
|
|
4
|
-
|
|
5
|
-
@customElement("jd-link")
|
|
6
|
-
export class JdLink extends LitElement {
|
|
7
|
-
static styles = unsafeCSS(style);
|
|
8
|
-
@property({ type: String }) href = "";
|
|
9
|
-
@property({ type: String }) target: "_blank" | "_bla" = "_blank";
|
|
10
|
-
@property({ type: String }) description = "";
|
|
11
|
-
|
|
12
|
-
render() {
|
|
13
|
-
return html`
|
|
14
|
-
<div>
|
|
15
|
-
<a href="${this.href}" target="${this.target}">
|
|
16
|
-
<div class="link-wrapper">
|
|
17
|
-
<div class="title">
|
|
18
|
-
<slot></slot>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</a>
|
|
22
|
-
</div>
|
|
23
|
-
`;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import "../jd-link.ts";
|
|
4
|
-
|
|
5
|
-
type JdLinkArgs = {
|
|
6
|
-
href: string;
|
|
7
|
-
target: "_blank" | "_bla";
|
|
8
|
-
description: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const meta: Meta<JdLinkArgs> = {
|
|
12
|
-
title: "Components/Link",
|
|
13
|
-
component: "jd-link",
|
|
14
|
-
argTypes: {
|
|
15
|
-
href: {
|
|
16
|
-
control: { type: "text" },
|
|
17
|
-
description: "href of the link",
|
|
18
|
-
defaultValue: "",
|
|
19
|
-
},
|
|
20
|
-
target: {
|
|
21
|
-
control: { type: "select" },
|
|
22
|
-
options: ["_blank", "_bla"],
|
|
23
|
-
description: "href of the link",
|
|
24
|
-
defaultValue: "",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default meta;
|
|
30
|
-
type Story = StoryObj<JdLinkArgs>;
|
|
31
|
-
|
|
32
|
-
const DefaultExample = (args: JdLinkArgs) => {
|
|
33
|
-
return html` <jd-link href=${args.href} target=${args.target}>
|
|
34
|
-
Click me
|
|
35
|
-
</jd-link>`;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const DefaultStory: Story = {
|
|
39
|
-
name: "Default",
|
|
40
|
-
render: DefaultExample.bind({}),
|
|
41
|
-
args: { href: "https://www.google.com", target: "_blank" },
|
|
42
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
@use "/src/styles/mixins.scss" as mixins;
|
|
2
|
-
@use "/src/styles/tokens.scss" as tokens;
|
|
3
|
-
|
|
4
|
-
.content {
|
|
5
|
-
display: flex;
|
|
6
|
-
background-color: tokens.$color-white;
|
|
7
|
-
position: fixed;
|
|
8
|
-
&.s {
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
height: 100vh;
|
|
12
|
-
width: 100vw;
|
|
13
|
-
}
|
|
14
|
-
&.m {
|
|
15
|
-
top: 70px;
|
|
16
|
-
left: 70px;
|
|
17
|
-
height: calc(100vh - 140px);
|
|
18
|
-
width: calc(100vw - 140px);
|
|
19
|
-
}
|
|
20
|
-
&.l {
|
|
21
|
-
top: 150px;
|
|
22
|
-
left: 150px;
|
|
23
|
-
height: calc(100vh - 300px);
|
|
24
|
-
width: calc(100vw - 300px);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&.hidden {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
z-index: 1001;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.content-wrapper {
|
|
34
|
-
width: 100%;
|
|
35
|
-
height: inherit;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.content-header {
|
|
40
|
-
@include mixins.font-button;
|
|
41
|
-
width: 100%;
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: row;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
align-items: center;
|
|
46
|
-
height: 90px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.content-body {
|
|
50
|
-
@include mixins.font-03-copy;
|
|
51
|
-
display: flex;
|
|
52
|
-
padding: 40px;
|
|
53
|
-
overflow-y: auto;
|
|
54
|
-
&.s {
|
|
55
|
-
height: calc(100vh - 90px - 80px);
|
|
56
|
-
width: calc(100vw - 80px);
|
|
57
|
-
}
|
|
58
|
-
&.m {
|
|
59
|
-
height: calc(100vh - 230px);
|
|
60
|
-
width: calc(100vw - 140px - 80px);
|
|
61
|
-
}
|
|
62
|
-
&.l {
|
|
63
|
-
height: calc(100vh - 390px);
|
|
64
|
-
width: calc(100vw - 300px - 80px);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.backdrop {
|
|
69
|
-
position: fixed;
|
|
70
|
-
top: 0;
|
|
71
|
-
left: 0;
|
|
72
|
-
width: 100vw;
|
|
73
|
-
height: 100vh;
|
|
74
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
75
|
-
z-index: 999;
|
|
76
|
-
display: block;
|
|
77
|
-
&.hidden {
|
|
78
|
-
display: none;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.btn-close-wrapper {
|
|
83
|
-
position: absolute;
|
|
84
|
-
z-index: 1000;
|
|
85
|
-
top: 20px;
|
|
86
|
-
right: 20px;
|
|
87
|
-
&.header.s {
|
|
88
|
-
top: 60px;
|
|
89
|
-
right: 32px;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
import style from "./jd-modal.scss?inline";
|
|
4
|
-
import { SignalWatcher } from "@lit-labs/signals";
|
|
5
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
6
|
-
import "../../components";
|
|
7
|
-
import { breakpoint } from "../../stores/breakpoint-store";
|
|
8
|
-
|
|
9
|
-
@customElement("jd-modal")
|
|
10
|
-
export class JdModal extends SignalWatcher(LitElement) {
|
|
11
|
-
static styles = unsafeCSS(style);
|
|
12
|
-
|
|
13
|
-
@property({ type: Boolean }) show = false;
|
|
14
|
-
@property({ type: String, reflect: true })
|
|
15
|
-
type: "default" | "header" = "default";
|
|
16
|
-
|
|
17
|
-
render() {
|
|
18
|
-
const backdropClasses = {
|
|
19
|
-
backdrop: true,
|
|
20
|
-
hidden: !this.show || breakpoint.get() === "s",
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const contentClasses = {
|
|
24
|
-
content: true,
|
|
25
|
-
[breakpoint.get()]: true,
|
|
26
|
-
hidden: !this.show,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const btnCloseClasses = {
|
|
30
|
-
"btn-close-wrapper": true,
|
|
31
|
-
[this.type]: true,
|
|
32
|
-
[breakpoint.get()]: true,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const contentBodyClasses = {
|
|
36
|
-
"content-body": true,
|
|
37
|
-
[breakpoint.get()]: true,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return html`<slot name="button" @click=${() => (this.show = true)}></slot>
|
|
41
|
-
<div
|
|
42
|
-
class=${classMap(backdropClasses)}
|
|
43
|
-
@click=${() => {
|
|
44
|
-
this.show = false;
|
|
45
|
-
}}
|
|
46
|
-
></div>
|
|
47
|
-
<div class=${classMap(contentClasses)}>
|
|
48
|
-
<div class=${classMap(btnCloseClasses)}>
|
|
49
|
-
<jd-icon-button
|
|
50
|
-
iconName="x"
|
|
51
|
-
color="black"
|
|
52
|
-
type="borderless"
|
|
53
|
-
@click=${() => {
|
|
54
|
-
this.show = false;
|
|
55
|
-
}}
|
|
56
|
-
></jd-icon-button>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="content-wrapper">
|
|
59
|
-
<slot></slot>
|
|
60
|
-
<div class="content-header">
|
|
61
|
-
<slot name="header"></slot>
|
|
62
|
-
</div>
|
|
63
|
-
<div class=${classMap(contentBodyClasses)}>
|
|
64
|
-
<slot name="content"></slot>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
declare global {
|
|
72
|
-
interface HTMLElementTagNameMap {
|
|
73
|
-
"jd-modal": JdModal;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import "../jd-modal.ts";
|
|
4
|
-
|
|
5
|
-
type JdModalArgs = {
|
|
6
|
-
show: boolean;
|
|
7
|
-
type: "default" | "header";
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const meta: Meta<JdModalArgs> = {
|
|
11
|
-
title: "Components/Modal",
|
|
12
|
-
component: "jd-modal",
|
|
13
|
-
argTypes: {
|
|
14
|
-
show: {
|
|
15
|
-
control: "boolean",
|
|
16
|
-
options: ["true", "false"],
|
|
17
|
-
description: "Show or hide the modal",
|
|
18
|
-
defaultValue: "false",
|
|
19
|
-
},
|
|
20
|
-
type: {
|
|
21
|
-
control: { type: "select" },
|
|
22
|
-
options: ["default", "header"],
|
|
23
|
-
description: "Modal type",
|
|
24
|
-
defaultValue: "default",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default meta;
|
|
30
|
-
type Story = StoryObj<JdModalArgs>;
|
|
31
|
-
|
|
32
|
-
const DefaultExample = (args: JdModalArgs) => {
|
|
33
|
-
return html`
|
|
34
|
-
<jd-modal .show=${args.show} .type=${args.type} id="modal">
|
|
35
|
-
<div slot="button">
|
|
36
|
-
<jd-button>Open Modal</jd-button>
|
|
37
|
-
</div>
|
|
38
|
-
<div slot="header">This is the Headline</div>
|
|
39
|
-
<div slot="content">
|
|
40
|
-
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo
|
|
41
|
-
ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis
|
|
42
|
-
dis parturient montes, nascetur ridiculus mus. Donec quam felis,
|
|
43
|
-
ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat
|
|
44
|
-
massa.
|
|
45
|
-
</div></jd-modal
|
|
46
|
-
>
|
|
47
|
-
`;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const DefaultStory: Story = {
|
|
51
|
-
name: "Default",
|
|
52
|
-
render: DefaultExample.bind({}),
|
|
53
|
-
args: { show: false, type: "default" },
|
|
54
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: inline-block;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.navi-wrapper {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: row;
|
|
8
|
-
gap: 12px;
|
|
9
|
-
flex-wrap: wrap;
|
|
10
|
-
&.s {
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
gap: 16px;
|
|
13
|
-
width: 100%;
|
|
14
|
-
align-items: center;
|
|
15
|
-
margin-top: 100px;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement } from "lit/decorators.js";
|
|
3
|
-
import style from "./jd-navigation.scss?inline";
|
|
4
|
-
import { SignalWatcher } from "@lit-labs/signals";
|
|
5
|
-
import { breakpoint } from "../../stores/breakpoint-store";
|
|
6
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
7
|
-
import "../../components";
|
|
8
|
-
|
|
9
|
-
@customElement("jd-navigation")
|
|
10
|
-
export class JdNavigation extends SignalWatcher(LitElement) {
|
|
11
|
-
static styles = unsafeCSS(style);
|
|
12
|
-
|
|
13
|
-
render() {
|
|
14
|
-
const naviWrapperClass = {
|
|
15
|
-
"navi-wrapper": true,
|
|
16
|
-
[breakpoint.get()]: true,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return html`
|
|
20
|
-
<div class=${classMap(naviWrapperClass)}>
|
|
21
|
-
<slot></slot>
|
|
22
|
-
<div class="border-slider"></div>
|
|
23
|
-
</div>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
declare global {
|
|
29
|
-
interface HTMLElementTagNameMap {
|
|
30
|
-
"jd-navigation": JdNavigation;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import "../jd-navigation.ts";
|
|
4
|
-
import "../../button/jd-button.ts";
|
|
5
|
-
|
|
6
|
-
const meta: Meta = {
|
|
7
|
-
title: "Components/Navigation",
|
|
8
|
-
component: "jd-navigation",
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj;
|
|
13
|
-
|
|
14
|
-
const DefaultExample = () => {
|
|
15
|
-
const buttons = ["Work", "About", "Hello"];
|
|
16
|
-
let activeIndex = 0;
|
|
17
|
-
|
|
18
|
-
function handleClick(index: number) {
|
|
19
|
-
activeIndex = index;
|
|
20
|
-
document.querySelectorAll("jd-button").forEach((btn, i) => {
|
|
21
|
-
btn.toggleAttribute("active", i === activeIndex);
|
|
22
|
-
});
|
|
23
|
-
console.log(`Button clicked: Index ${index}, Label ${buttons[index]}`);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
document.querySelectorAll("jd-button").forEach((btn, i) => {
|
|
28
|
-
btn.toggleAttribute("active", i === activeIndex);
|
|
29
|
-
btn.addEventListener("click", () => handleClick(i));
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
return html`<jd-navigation>
|
|
34
|
-
${buttons.map(
|
|
35
|
-
(label, index) => html`
|
|
36
|
-
<jd-button type="secondary" ?active=${index === activeIndex}>
|
|
37
|
-
${label}
|
|
38
|
-
</jd-button>
|
|
39
|
-
`,
|
|
40
|
-
)}
|
|
41
|
-
</jd-navigation>`;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const DefaultStory: Story = {
|
|
45
|
-
name: "Default",
|
|
46
|
-
render: DefaultExample.bind({}),
|
|
47
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
@use "/src/styles/mixins.scss" as mixins;
|
|
2
|
-
@use "/src/styles/tokens.scss" as tokens;
|
|
3
|
-
|
|
4
|
-
:host {
|
|
5
|
-
display: inline-block;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.tag-wrapper {
|
|
9
|
-
@include mixins.font-button;
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
padding: 0 20px;
|
|
14
|
-
border-radius: 32px;
|
|
15
|
-
height: 64px;
|
|
16
|
-
border: none;
|
|
17
|
-
color: tokens.$color-black;
|
|
18
|
-
background-color: tokens.$color-neutral-200;
|
|
19
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement } from "lit/decorators.js";
|
|
3
|
-
import style from "./jd-tag.scss?inline";
|
|
4
|
-
import "../../components";
|
|
5
|
-
|
|
6
|
-
@customElement("jd-tag")
|
|
7
|
-
export class JdTag extends LitElement {
|
|
8
|
-
static styles = unsafeCSS(style);
|
|
9
|
-
|
|
10
|
-
render() {
|
|
11
|
-
return html`
|
|
12
|
-
<div class="tag-wrapper">
|
|
13
|
-
<slot></slot>
|
|
14
|
-
</div>
|
|
15
|
-
`;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare global {
|
|
20
|
-
interface HTMLElementTagNameMap {
|
|
21
|
-
"jd-tag": JdTag;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import "../jd-tag.ts";
|
|
4
|
-
|
|
5
|
-
const meta: Meta = {
|
|
6
|
-
title: "Components/Tag",
|
|
7
|
-
component: "jd-tag",
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj;
|
|
12
|
-
|
|
13
|
-
const DefaultExample = () => {
|
|
14
|
-
return html`<jd-tag>Petrol head</jd-tag>`;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const DefaultStory: Story = {
|
|
18
|
-
name: "Default",
|
|
19
|
-
render: DefaultExample.bind({}),
|
|
20
|
-
};
|
package/src/components.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import "./components/button/jd-button";
|
|
2
|
-
import "./components/flash/jd-flash";
|
|
3
|
-
import "./components/footer/jd-footer";
|
|
4
|
-
import "./components/header/jd-header";
|
|
5
|
-
import "./components/heading/jd-heading";
|
|
6
|
-
import "./components/icon/jd-icon";
|
|
7
|
-
import "./components/icon-button/jd-icon-button";
|
|
8
|
-
import "./components/image-link/jd-image-link";
|
|
9
|
-
import "./components/link/jd-link";
|
|
10
|
-
import "./components/modal/jd-modal";
|
|
11
|
-
import "./components/navigation/jd-navigation";
|
|
12
|
-
import "./components/tag/jd-tag";
|
package/src/index.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "./styles/variables.scss";
|
|
2
|
-
import "./styles/fonts.css";
|
|
3
|
-
import "./assets/satoshi-regular.ttf";
|
|
4
|
-
import "./assets/satoshi-bold.ttf";
|
|
5
|
-
import "./assets/satoshi-black.ttf";
|
|
6
|
-
import "./assets/satoshi-italic.ttf";
|
|
7
|
-
|
|
8
|
-
export * from "./components/button/jd-button.js";
|
|
9
|
-
export * from "./components/flash/jd-flash.js";
|
|
10
|
-
export * from "./components/footer/jd-footer.js";
|
|
11
|
-
export * from "./components/header/jd-header.js";
|
|
12
|
-
export * from "./components/heading/jd-heading.js";
|
|
13
|
-
export * from "./components/icon/jd-icon.js";
|
|
14
|
-
export * from "./components/icon-button/jd-icon-button.js";
|
|
15
|
-
export * from "./components/image-link/jd-image-link.js";
|
|
16
|
-
export * from "./components/link/jd-link.js";
|
|
17
|
-
export * from "./components/modal/jd-modal.js";
|
|
18
|
-
export * from "./components/navigation/jd-navigation.js";
|
|
19
|
-
export * from "./components/tag/jd-tag.js";
|
|
20
|
-
export * from "./components";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { signal } from "@lit-labs/signals";
|
|
2
|
-
|
|
3
|
-
export const breakpoint = signal<string>(getBreakpoint(window.innerWidth));
|
|
4
|
-
|
|
5
|
-
function getBreakpoint(width: number): string {
|
|
6
|
-
if (width < 600) return "s";
|
|
7
|
-
if (width < 1024) return "m";
|
|
8
|
-
return "l";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
window.addEventListener("resize", () => {
|
|
12
|
-
const newBp = getBreakpoint(window.innerWidth);
|
|
13
|
-
if (newBp !== breakpoint.get()) {
|
|
14
|
-
breakpoint.set(newBp);
|
|
15
|
-
}
|
|
16
|
-
});
|
package/src/styles/_mixins.scss
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
@use "tokens" as token;
|
|
2
|
-
|
|
3
|
-
/* Regular tokens */
|
|
4
|
-
@mixin font-01-copy {
|
|
5
|
-
font-family: #{token.$font-regular};
|
|
6
|
-
font-size: #{token.$font-size-01-copy}; /* 34x */
|
|
7
|
-
line-height: #{token.$line-height-01-copy}; /* 52px */
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@mixin font-02-copy {
|
|
11
|
-
font-family: #{token.$font-regular};
|
|
12
|
-
font-size: #{token.$font-size-02-copy}; /* 28x */
|
|
13
|
-
line-height: #{token.$line-height-02-copy}; /* 42px */
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@mixin font-03-copy {
|
|
17
|
-
font-family: #{token.$font-regular};
|
|
18
|
-
font-size: #{token.$font-size-03-copy}; /* 22x */
|
|
19
|
-
line-height: #{token.$line-height-03-copy}; /* 32px */
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* Italic fonts */
|
|
23
|
-
@mixin font-01-copy-italic {
|
|
24
|
-
font-family: #{token.$font-italic};
|
|
25
|
-
font-size: #{token.$font-size-01-copy}; /* 34x */
|
|
26
|
-
line-height: #{token.$line-height-01-copy}; /* 52px */
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@mixin font-02-copy-italic {
|
|
30
|
-
font-family: #{token.$font-italic};
|
|
31
|
-
font-size: #{token.$font-size-02-copy}; /* 28x */
|
|
32
|
-
line-height: #{token.$line-height-02-copy}; /* 42px */
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@mixin font-03-copy-italic {
|
|
36
|
-
font-family: #{token.$font-italic};
|
|
37
|
-
font-size: #{token.$font-size-03-copy}; /* 22x */
|
|
38
|
-
line-height: #{token.$line-height-03-copy}; /* 32px */
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/* Button fonts */
|
|
42
|
-
@mixin font-button {
|
|
43
|
-
font-family: #{token.$font-bold};
|
|
44
|
-
font-size: #{token.$font-size-button}; /* 24x */
|
|
45
|
-
line-height: #{token.$line-height-button}; /* 42px */
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Headline fonts */
|
|
49
|
-
@mixin font-01-headline {
|
|
50
|
-
font-family: #{token.$font-black};
|
|
51
|
-
font-size: #{token.$font-size-01-headline}; /* 130px */
|
|
52
|
-
line-height: #{token.$line-height-01-headline}; /* 112px */
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@mixin font-02-headline {
|
|
56
|
-
font-family: #{token.$font-black};
|
|
57
|
-
font-size: #{token.$font-size-02-headline}; /* 100x */
|
|
58
|
-
line-height: #{token.$line-height-02-headline}; /* 90px */
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@mixin font-03-headline {
|
|
62
|
-
font-family: #{token.$font-black};
|
|
63
|
-
font-size: #{token.$font-size-03-headline}; /* 80x */
|
|
64
|
-
line-height: #{token.$line-height-03-headline}; /* 72px */
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* Subheadline fonts */
|
|
68
|
-
@mixin font-01-subheadline {
|
|
69
|
-
font-family: #{token.$font-italic};
|
|
70
|
-
font-size: #{token.$font-size-01-subheadline}; /* 130x */
|
|
71
|
-
line-height: #{token.$line-height-01-subheadline}; /* 112px */
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@mixin font-02-subheadline {
|
|
75
|
-
font-family: #{token.$font-italic};
|
|
76
|
-
font-size: #{token.$font-size-02-subheadline}; /* 100x */
|
|
77
|
-
line-height: #{token.$line-height-02-subheadline}; /* 90px */
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@mixin font-03-subheadline {
|
|
81
|
-
font-family: #{token.$font-italic};
|
|
82
|
-
font-size: #{token.$font-size-03-subheadline}; /* 80x */
|
|
83
|
-
line-height: #{token.$line-height-03-subheadline}; /* 72px */
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* Logo font */
|
|
87
|
-
@mixin font-logo {
|
|
88
|
-
font-family: #{token.$font-black};
|
|
89
|
-
font-size: 30px;
|
|
90
|
-
line-height: 168px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* Reset all browser default styles */
|
|
94
|
-
@mixin reset {
|
|
95
|
-
all: unset;
|
|
96
|
-
margin: 0;
|
|
97
|
-
padding: 0;
|
|
98
|
-
min-width: 0;
|
|
99
|
-
box-sizing: border-box;
|
|
100
|
-
font-size: 100%;
|
|
101
|
-
font-family: inherit;
|
|
102
|
-
line-height: 1.5;
|
|
103
|
-
color: inherit;
|
|
104
|
-
list-style: none;
|
|
105
|
-
quotes: none;
|
|
106
|
-
border-collapse: collapse;
|
|
107
|
-
border-spacing: 0;
|
|
108
|
-
border-radius: 0;
|
|
109
|
-
text-decoration: none;
|
|
110
|
-
background-color: transparent;
|
|
111
|
-
vertical-align: baseline;
|
|
112
|
-
}
|