@jotyping/jo-designsystem 0.1.1-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/.prettierignore +3 -0
- package/.prettierrc +1 -0
- package/.storybook/main.ts +18 -0
- package/.storybook/preview.ts +15 -0
- package/README.md +20 -0
- package/dist/components/button/jd-button.js +42 -0
- package/dist/components/button/jd-button.js.map +1 -0
- package/dist/components/button/jd-button.scss.js +5 -0
- package/dist/components/button/jd-button.scss.js.map +1 -0
- package/dist/components/flash/jd-flash.js +74 -0
- package/dist/components/flash/jd-flash.js.map +1 -0
- package/dist/components/flash/jd-flash.scss.js +5 -0
- package/dist/components/flash/jd-flash.scss.js.map +1 -0
- package/dist/components/footer/jd-footer.js +50 -0
- package/dist/components/footer/jd-footer.js.map +1 -0
- package/dist/components/footer/jd-footer.scss.js +5 -0
- package/dist/components/footer/jd-footer.scss.js.map +1 -0
- package/dist/components/header/jd-header.js +69 -0
- package/dist/components/header/jd-header.js.map +1 -0
- package/dist/components/header/jd-header.scss.js +5 -0
- package/dist/components/header/jd-header.scss.js.map +1 -0
- package/dist/components/heading/jd-heading.js +63 -0
- package/dist/components/heading/jd-heading.js.map +1 -0
- package/dist/components/heading/jd-heading.scss.js +5 -0
- package/dist/components/heading/jd-heading.scss.js.map +1 -0
- package/dist/components/icon/icon-data.js +47 -0
- package/dist/components/icon/icon-data.js.map +1 -0
- package/dist/components/icon/jd-icon.js +58 -0
- package/dist/components/icon/jd-icon.js.map +1 -0
- package/dist/components/icon/jd-icon.scss.js +5 -0
- package/dist/components/icon/jd-icon.scss.js.map +1 -0
- package/dist/components/icon-button/jd-icon-button.js +52 -0
- package/dist/components/icon-button/jd-icon-button.js.map +1 -0
- package/dist/components/icon-button/jd-icon-button.scss.js +5 -0
- package/dist/components/icon-button/jd-icon-button.scss.js.map +1 -0
- package/dist/components/image-link/jd-image-link.js +63 -0
- package/dist/components/image-link/jd-image-link.js.map +1 -0
- package/dist/components/image-link/jd-image-link.scss.js +5 -0
- package/dist/components/image-link/jd-image-link.scss.js.map +1 -0
- package/dist/components/link/jd-link.js +43 -0
- package/dist/components/link/jd-link.js.map +1 -0
- package/dist/components/link/jd-link.scss.js +5 -0
- package/dist/components/link/jd-link.scss.js.map +1 -0
- package/dist/components/modal/jd-modal.js +86 -0
- package/dist/components/modal/jd-modal.js.map +1 -0
- package/dist/components/modal/jd-modal.scss.js +5 -0
- package/dist/components/modal/jd-modal.scss.js.map +1 -0
- package/dist/components/navigation/jd-navigation.js +44 -0
- package/dist/components/navigation/jd-navigation.js.map +1 -0
- package/dist/components/navigation/jd-navigation.scss.js +5 -0
- package/dist/components/navigation/jd-navigation.scss.js.map +1 -0
- package/dist/components/tag/jd-tag.js +36 -0
- package/dist/components/tag/jd-tag.js.map +1 -0
- package/dist/components/tag/jd-tag.scss.js +5 -0
- package/dist/components/tag/jd-tag.scss.js.map +1 -0
- package/dist/fonts/satoshi-black.ttf +0 -0
- package/dist/fonts/satoshi-bold.ttf +0 -0
- package/dist/fonts/satoshi-italic.ttf +0 -0
- package/dist/fonts/satoshi-medium.ttf +0 -0
- package/dist/fonts/satoshi-regular.ttf +0 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/stores/breakpoint-store.js +13 -0
- package/dist/stores/breakpoint-store.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/eslint.config.js +12 -0
- package/index.html +18 -0
- package/license.md +0 -0
- package/package.json +46 -0
- package/public/fonts/satoshi-black.ttf +0 -0
- package/public/fonts/satoshi-bold.ttf +0 -0
- package/public/fonts/satoshi-italic.ttf +0 -0
- package/public/fonts/satoshi-medium.ttf +0 -0
- package/public/fonts/satoshi-regular.ttf +0 -0
- package/public/vite.svg +1 -0
- package/src/assets/lit.svg +1 -0
- package/src/components/button/jd-button.scss +56 -0
- package/src/components/button/jd-button.ts +28 -0
- package/src/components/button/stories/jd-button.stories.ts +44 -0
- package/src/components/flash/jd-flash.scss +47 -0
- package/src/components/flash/jd-flash.ts +65 -0
- package/src/components/flash/stories/jd-flash.stories.ts +62 -0
- package/src/components/footer/jd-footer.scss +42 -0
- package/src/components/footer/jd-footer.ts +42 -0
- package/src/components/footer/stories/jd-footer.stories.ts +20 -0
- package/src/components/header/jd-header.scss +48 -0
- package/src/components/header/jd-header.ts +58 -0
- package/src/components/header/stories/jd-header.stories.ts +52 -0
- package/src/components/heading/jd-heading.scss +48 -0
- package/src/components/heading/jd-heading.ts +49 -0
- package/src/components/heading/stories/jd-heading.stories.ts +47 -0
- package/src/components/icon/icon-data.ts +45 -0
- package/src/components/icon/jd-icon.scss +35 -0
- package/src/components/icon/jd-icon.ts +66 -0
- package/src/components/icon/stories/jd-icon.stories.ts +62 -0
- package/src/components/icon-button/jd-icon-button.scss +36 -0
- package/src/components/icon-button/jd-icon-button.ts +51 -0
- package/src/components/icon-button/stories/jd-icon-button.stories.ts +93 -0
- package/src/components/image-link/jd-image-link.scss +41 -0
- package/src/components/image-link/jd-image-link.ts +36 -0
- package/src/components/image-link/stories/jd-image-link.stories.ts +46 -0
- package/src/components/link/jd-link.scss +29 -0
- package/src/components/link/jd-link.ts +25 -0
- package/src/components/link/stories/jd-link.stories.ts +42 -0
- package/src/components/modal/jd-modal.scss +91 -0
- package/src/components/modal/jd-modal.ts +75 -0
- package/src/components/modal/stories/jd-modal.stories.ts +54 -0
- package/src/components/navigation/jd-navigation.scss +17 -0
- package/src/components/navigation/jd-navigation.ts +32 -0
- package/src/components/navigation/stories/jd-navigation.stories.ts +47 -0
- package/src/components/tag/jd-tag.scss +19 -0
- package/src/components/tag/jd-tag.ts +23 -0
- package/src/components/tag/stories/jd-tag.stories.ts +20 -0
- package/src/components.ts +12 -0
- package/src/index.ts +12 -0
- package/src/stores/breakpoint-store.ts +16 -0
- package/src/styles/_colors.scss +10 -0
- package/src/styles/_fonts.scss +72 -0
- package/src/styles/_mixins.scss +112 -0
- package/src/styles/_reset.scss +62 -0
- package/src/styles/variables.scss +13 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +47 -0
- package/vite.config.ts +26 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@use "/src/styles/mixins.scss" as mixins;
|
|
2
|
+
@use "/src/styles/colors.scss" as colors;
|
|
3
|
+
|
|
4
|
+
.content {
|
|
5
|
+
display: flex;
|
|
6
|
+
background-color: colors.$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
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use "/src/styles/mixins.scss" as mixins;
|
|
2
|
+
@use "/src/styles/colors.scss" as colors;
|
|
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: colors.$color-black;
|
|
18
|
+
background-color: colors.$color-neutral-200;
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./components/button/jd-button.js";
|
|
2
|
+
export * from "./components/flash/jd-flash.js";
|
|
3
|
+
export * from "./components/footer/jd-footer.js";
|
|
4
|
+
export * from "./components/header/jd-header.js";
|
|
5
|
+
export * from "./components/heading/jd-heading.js";
|
|
6
|
+
export * from "./components/icon/jd-icon.js";
|
|
7
|
+
export * from "./components/icon-button/jd-icon-button.js";
|
|
8
|
+
export * from "./components/image-link/jd-image-link.js";
|
|
9
|
+
export * from "./components/link/jd-link.js";
|
|
10
|
+
export * from "./components/modal/jd-modal.js";
|
|
11
|
+
export * from "./components/navigation/jd-navigation.js";
|
|
12
|
+
export * from "./components/tag/jd-tag.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "Satoshi_Bold";
|
|
3
|
+
src:
|
|
4
|
+
local("Satoshi_Bold"),
|
|
5
|
+
url(/fonts/satoshi-bold.ttf) format("truetype");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@font-face {
|
|
9
|
+
font-family: "Satoshi_Black";
|
|
10
|
+
src:
|
|
11
|
+
local("Satoshi_Black"),
|
|
12
|
+
url(/fonts/satoshi-black.ttf) format("truetype");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@font-face {
|
|
16
|
+
font-family: "Satoshi_Medium";
|
|
17
|
+
src:
|
|
18
|
+
local("Satoshi_Medium"),
|
|
19
|
+
url(/fonts/satoshi-medium.ttf) format("truetype");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: "Satoshi_Regular";
|
|
24
|
+
src:
|
|
25
|
+
local("Satoshi_Regular"),
|
|
26
|
+
url(/fonts/satoshi-regular.ttf) format("truetype");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@font-face {
|
|
30
|
+
font-family: "Satoshi_Italic";
|
|
31
|
+
src:
|
|
32
|
+
local("Satoshi_Italic"),
|
|
33
|
+
url(/fonts/satoshi-italic.ttf) format("truetype");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* --- FONT FAMILIES --- */
|
|
37
|
+
$font-regular: "Satoshi_Regular", sans-serif;
|
|
38
|
+
$font-bold: "Satoshi_Bold", sans-serif;
|
|
39
|
+
$font-black: "Satoshi_Black", sans-serif;
|
|
40
|
+
$font-medium: "Satoshi_Medium", sans-serif;
|
|
41
|
+
$font-italic: "Satoshi_Italic", sans-serif;
|
|
42
|
+
|
|
43
|
+
/* --- FONT SIZES & LINE HEIGHTS --- */
|
|
44
|
+
$font-size-01-copy: 34px;
|
|
45
|
+
$line-height-01-copy: 52px;
|
|
46
|
+
|
|
47
|
+
$font-size-02-copy: 28px;
|
|
48
|
+
$line-height-02-copy: 42px;
|
|
49
|
+
|
|
50
|
+
$font-size-03-copy: 22px;
|
|
51
|
+
$line-height-03-copy: 32px;
|
|
52
|
+
|
|
53
|
+
$font-size-button: 24px;
|
|
54
|
+
$line-height-button: 42px;
|
|
55
|
+
|
|
56
|
+
$font-size-01-headline: 130px;
|
|
57
|
+
$line-height-01-headline: 112px;
|
|
58
|
+
|
|
59
|
+
$font-size-02-headline: 100px;
|
|
60
|
+
$line-height-02-headline: 90px;
|
|
61
|
+
|
|
62
|
+
$font-size-03-headline: 80px;
|
|
63
|
+
$line-height-03-headline: 72px;
|
|
64
|
+
|
|
65
|
+
$font-size-01-subheadline: 60px;
|
|
66
|
+
$line-height-01-subheadline: 64px;
|
|
67
|
+
|
|
68
|
+
$font-size-02-subheadline: 46px;
|
|
69
|
+
$line-height-02-subheadline: 50px;
|
|
70
|
+
|
|
71
|
+
$font-size-03-subheadline: 34px;
|
|
72
|
+
$line-height-03-subheadline: 36px;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@use "fonts" as font;
|
|
2
|
+
|
|
3
|
+
/* Regular fonts */
|
|
4
|
+
@mixin font-01-copy {
|
|
5
|
+
font-family: #{font.$font-regular};
|
|
6
|
+
font-size: #{font.$font-size-01-copy}; /* 34x */
|
|
7
|
+
line-height: #{font.$line-height-01-copy}; /* 52px */
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@mixin font-02-copy {
|
|
11
|
+
font-family: #{font.$font-regular};
|
|
12
|
+
font-size: #{font.$font-size-02-copy}; /* 28x */
|
|
13
|
+
line-height: #{font.$line-height-02-copy}; /* 42px */
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@mixin font-03-copy {
|
|
17
|
+
font-family: #{font.$font-regular};
|
|
18
|
+
font-size: #{font.$font-size-03-copy}; /* 22x */
|
|
19
|
+
line-height: #{font.$line-height-03-copy}; /* 32px */
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Italic fonts */
|
|
23
|
+
@mixin font-01-copy-italic {
|
|
24
|
+
font-family: #{font.$font-italic};
|
|
25
|
+
font-size: #{font.$font-size-01-copy}; /* 34x */
|
|
26
|
+
line-height: #{font.$line-height-01-copy}; /* 52px */
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@mixin font-02-copy-italic {
|
|
30
|
+
font-family: #{font.$font-italic};
|
|
31
|
+
font-size: #{font.$font-size-02-copy}; /* 28x */
|
|
32
|
+
line-height: #{font.$line-height-02-copy}; /* 42px */
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin font-03-copy-italic {
|
|
36
|
+
font-family: #{font.$font-italic};
|
|
37
|
+
font-size: #{font.$font-size-03-copy}; /* 22x */
|
|
38
|
+
line-height: #{font.$line-height-03-copy}; /* 32px */
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Button fonts */
|
|
42
|
+
@mixin font-button {
|
|
43
|
+
font-family: #{font.$font-bold};
|
|
44
|
+
font-size: #{font.$font-size-button}; /* 24x */
|
|
45
|
+
line-height: #{font.$line-height-button}; /* 42px */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Headline fonts */
|
|
49
|
+
@mixin font-01-headline {
|
|
50
|
+
font-family: #{font.$font-black};
|
|
51
|
+
font-size: #{font.$font-size-01-headline}; /* 130px */
|
|
52
|
+
line-height: #{font.$line-height-01-headline}; /* 112px */
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@mixin font-02-headline {
|
|
56
|
+
font-family: #{font.$font-black};
|
|
57
|
+
font-size: #{font.$font-size-02-headline}; /* 100x */
|
|
58
|
+
line-height: #{font.$line-height-02-headline}; /* 90px */
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@mixin font-03-headline {
|
|
62
|
+
font-family: #{font.$font-black};
|
|
63
|
+
font-size: #{font.$font-size-03-headline}; /* 80x */
|
|
64
|
+
line-height: #{font.$line-height-03-headline}; /* 72px */
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Subheadline fonts */
|
|
68
|
+
@mixin font-01-subheadline {
|
|
69
|
+
font-family: #{font.$font-italic};
|
|
70
|
+
font-size: #{font.$font-size-01-subheadline}; /* 130x */
|
|
71
|
+
line-height: #{font.$line-height-01-subheadline}; /* 112px */
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@mixin font-02-subheadline {
|
|
75
|
+
font-family: #{font.$font-italic};
|
|
76
|
+
font-size: #{font.$font-size-02-subheadline}; /* 100x */
|
|
77
|
+
line-height: #{font.$line-height-02-subheadline}; /* 90px */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@mixin font-03-subheadline {
|
|
81
|
+
font-family: #{font.$font-italic};
|
|
82
|
+
font-size: #{font.$font-size-03-subheadline}; /* 80x */
|
|
83
|
+
line-height: #{font.$line-height-03-subheadline}; /* 72px */
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Logo font */
|
|
87
|
+
@mixin font-logo {
|
|
88
|
+
font-family: #{font.$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
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* File is defined as partial, which means it won't be compiled into CSS directly
|
|
3
|
+
* It's intended to be used as a building block for the component styles.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
*,
|
|
7
|
+
*::before,
|
|
8
|
+
*::after {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Make form elements inherit fonts for consistent styling.
|
|
16
|
+
*/
|
|
17
|
+
button,
|
|
18
|
+
input,
|
|
19
|
+
select,
|
|
20
|
+
textarea {
|
|
21
|
+
font: inherit;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* Make images and other media easier to work with.
|
|
26
|
+
*/
|
|
27
|
+
img,
|
|
28
|
+
picture,
|
|
29
|
+
video,
|
|
30
|
+
canvas,
|
|
31
|
+
svg {
|
|
32
|
+
display: block;
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* Remove default list styles.
|
|
38
|
+
*/
|
|
39
|
+
ol,
|
|
40
|
+
ul {
|
|
41
|
+
list-style: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* Remove default anchor styles.
|
|
46
|
+
*/
|
|
47
|
+
a {
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
color: inherit;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* Remove default heading styles.
|
|
54
|
+
*/
|
|
55
|
+
h1,
|
|
56
|
+
h2,
|
|
57
|
+
h3,
|
|
58
|
+
h4,
|
|
59
|
+
h5,
|
|
60
|
+
h6 {
|
|
61
|
+
font-weight: normal;
|
|
62
|
+
}
|