@jotyping/jo-designsystem 0.1.19-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,52 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import "../jd-header.ts";
|
|
4
|
-
|
|
5
|
-
const meta: Meta = {
|
|
6
|
-
title: "Components/Header",
|
|
7
|
-
component: "jd-header",
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "fullscreen",
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj;
|
|
15
|
-
|
|
16
|
-
const DefaultExample = () => {
|
|
17
|
-
const buttons = ["Work", "About", "Hello"];
|
|
18
|
-
let activeIndex = 0;
|
|
19
|
-
|
|
20
|
-
function handleClick(index: number) {
|
|
21
|
-
activeIndex = index;
|
|
22
|
-
document.querySelectorAll("jd-button").forEach((btn, i) => {
|
|
23
|
-
btn.toggleAttribute("active", i === activeIndex);
|
|
24
|
-
});
|
|
25
|
-
console.log(`Button clicked: Index ${index}, Label ${buttons[index]}`);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
setTimeout(() => {
|
|
29
|
-
document.querySelectorAll("jd-button").forEach((btn, i) => {
|
|
30
|
-
btn.toggleAttribute("active", i === activeIndex);
|
|
31
|
-
btn.addEventListener("click", () => handleClick(i));
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
return html`<jd-header
|
|
35
|
-
><div style="width: 100%; display: flex; justify-content: center;">
|
|
36
|
-
<jd-navigation>
|
|
37
|
-
${buttons.map(
|
|
38
|
-
(label, index) => html`
|
|
39
|
-
<jd-button type="secondary" ?active=${index === activeIndex}>
|
|
40
|
-
${label}
|
|
41
|
-
</jd-button>
|
|
42
|
-
`,
|
|
43
|
-
)}
|
|
44
|
-
</jd-navigation>
|
|
45
|
-
</div></jd-header
|
|
46
|
-
>`;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const DefaultStory: Story = {
|
|
50
|
-
name: "Default",
|
|
51
|
-
render: DefaultExample.bind({}),
|
|
52
|
-
};
|
|
@@ -1,48 +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
|
-
.heading-wrapper {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
gap: 32px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.title-wrapper {
|
|
15
|
-
color: tokens.$color-black;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
gap: 0px;
|
|
19
|
-
&.l {
|
|
20
|
-
@include mixins.font-01-headline;
|
|
21
|
-
}
|
|
22
|
-
&.m {
|
|
23
|
-
@include mixins.font-02-headline;
|
|
24
|
-
}
|
|
25
|
-
&.s {
|
|
26
|
-
@include mixins.font-03-headline;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.subtitle-wrapper {
|
|
31
|
-
color: tokens.$color-black;
|
|
32
|
-
&.l {
|
|
33
|
-
@include mixins.font-01-subheadline;
|
|
34
|
-
}
|
|
35
|
-
&.m {
|
|
36
|
-
@include mixins.font-02-subheadline;
|
|
37
|
-
}
|
|
38
|
-
&.s {
|
|
39
|
-
@include mixins.font-03-subheadline;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.title-line-two-wrapper {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: row;
|
|
46
|
-
gap: 30px;
|
|
47
|
-
align-items: baseline;
|
|
48
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
import style from "./jd-heading.scss?inline";
|
|
4
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
5
|
-
import { SignalWatcher } from "@lit-labs/signals";
|
|
6
|
-
import { breakpoint } from "../../stores/breakpoint-store";
|
|
7
|
-
import "../../components";
|
|
8
|
-
|
|
9
|
-
@customElement("jd-heading")
|
|
10
|
-
export class JdHeading extends SignalWatcher(LitElement) {
|
|
11
|
-
static styles = unsafeCSS(style);
|
|
12
|
-
|
|
13
|
-
@property({ type: String }) size: "l" | "m" | "s" | "auto" = "auto";
|
|
14
|
-
|
|
15
|
-
render() {
|
|
16
|
-
const titleWrapperClasses = {
|
|
17
|
-
"title-wrapper": true,
|
|
18
|
-
[this.size === "auto" ? breakpoint.get() : this.size]: true,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const subTitleWrapperClasses = {
|
|
22
|
-
"subtitle-wrapper": true,
|
|
23
|
-
[this.size === "auto" ? breakpoint.get() : this.size]: true,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return html`
|
|
27
|
-
<div class="heading-wrapper">
|
|
28
|
-
<div class=${classMap(titleWrapperClasses)}>
|
|
29
|
-
<slot name="title-line-one"></slot>
|
|
30
|
-
<div class="title-line-two-wrapper">
|
|
31
|
-
<slot name="title-line-two"></slot>
|
|
32
|
-
<div class=${classMap(subTitleWrapperClasses)}>
|
|
33
|
-
<slot name="subtitle-right"></slot>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
<div class=${classMap(subTitleWrapperClasses)}>
|
|
38
|
-
<slot name="subtitle-bottom"></slot>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
declare global {
|
|
46
|
-
interface HTMLElementTagNameMap {
|
|
47
|
-
"jd-heading": JdHeading;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import "../jd-heading";
|
|
4
|
-
|
|
5
|
-
const meta: Meta = {
|
|
6
|
-
title: "Components/Heading",
|
|
7
|
-
component: "jd-heading",
|
|
8
|
-
argTypes: {
|
|
9
|
-
size: {
|
|
10
|
-
control: { type: "select" },
|
|
11
|
-
options: ["l", "m", "s", "auto"],
|
|
12
|
-
description: "Size of the heading",
|
|
13
|
-
defaultValue: "auto",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj;
|
|
20
|
-
|
|
21
|
-
const DefaultExample = ({ ...args }) => {
|
|
22
|
-
return html`<jd-heading size=${args.size}>
|
|
23
|
-
<div slot="title-line-one">Sweat &</div>
|
|
24
|
-
<div slot="title-line-two">coffee</div>
|
|
25
|
-
<div slot="subtitle-bottom">Latest work<br />and crafts</div></jd-heading
|
|
26
|
-
>`;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const DetailExample = ({ ...args }) => {
|
|
30
|
-
return html`<jd-heading size=${args.size}>
|
|
31
|
-
<div slot="title-line-one">Crash</div>
|
|
32
|
-
<div slot="title-line-two">Mate</div>
|
|
33
|
-
<div slot="subtitle-right">iOS App</div></jd-heading
|
|
34
|
-
>`;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const DefaultStory: Story = {
|
|
38
|
-
name: "Default",
|
|
39
|
-
render: DefaultExample.bind({}),
|
|
40
|
-
args: { size: "auto" },
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const DetailStory: Story = {
|
|
44
|
-
name: "Detail",
|
|
45
|
-
render: DetailExample.bind({}),
|
|
46
|
-
args: { ...DefaultStory.args },
|
|
47
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const icons = {
|
|
2
|
-
fire: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" class="size-6">
|
|
3
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M15.362 5.214A8.252 8.252 0 0 1 12 21 8.25 8.25 0 0 1 6.038 7.047 8.287 8.287 0 0 0 9 9.601a8.983 8.983 0 0 1 3.361-6.867 8.21 8.21 0 0 0 3 2.48Z" />
|
|
4
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M12 18a3.75 3.75 0 0 0 .495-7.468 5.99 5.99 0 0 0-1.925 3.547 5.975 5.975 0 0 1-2.133-1.001A3.75 3.75 0 0 0 12 18Z" />
|
|
5
|
-
</svg>`,
|
|
6
|
-
lightning: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" class="size-6">
|
|
7
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z" />
|
|
8
|
-
</svg>
|
|
9
|
-
`,
|
|
10
|
-
chat: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" class="size-6">
|
|
11
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z" />
|
|
12
|
-
</svg>
|
|
13
|
-
`,
|
|
14
|
-
puzzle: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" class="size-6">
|
|
15
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z" />
|
|
16
|
-
</svg>
|
|
17
|
-
`,
|
|
18
|
-
"arrow-circle-left": `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" class="size-6">
|
|
19
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="m11.25 9-3 3m0 0 3 3m-3-3h7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
|
20
|
-
</svg>
|
|
21
|
-
`,
|
|
22
|
-
"arrow-right": `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" class="size-6">
|
|
23
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3" />
|
|
24
|
-
</svg>
|
|
25
|
-
`,
|
|
26
|
-
"burger-menu": `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.6" stroke="currentColor" class="size-6">
|
|
27
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M6 8h12M6 16h12" />
|
|
28
|
-
</svg>
|
|
29
|
-
`,
|
|
30
|
-
x: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
|
31
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
|
32
|
-
</svg>
|
|
33
|
-
`,
|
|
34
|
-
circle: `<svg
|
|
35
|
-
width="8"
|
|
36
|
-
height="8"
|
|
37
|
-
viewBox="0 0 8 8"
|
|
38
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
39
|
-
>
|
|
40
|
-
<circle cx="4" cy="4" r="4" fill="currentColor" />
|
|
41
|
-
</svg>
|
|
42
|
-
`,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export { icons };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
@use "/src/styles/tokens.scss" as tokens;
|
|
2
|
-
|
|
3
|
-
:host {
|
|
4
|
-
display: inline-block;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.icon-wrapper {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
&.blue {
|
|
12
|
-
color: tokens.$color-accent-blue;
|
|
13
|
-
}
|
|
14
|
-
&.red {
|
|
15
|
-
color: tokens.$color-accent-red;
|
|
16
|
-
}
|
|
17
|
-
&.purple {
|
|
18
|
-
color: tokens.$color-accent-purple;
|
|
19
|
-
}
|
|
20
|
-
&.black {
|
|
21
|
-
color: tokens.$color-black;
|
|
22
|
-
}
|
|
23
|
-
&.white {
|
|
24
|
-
color: tokens.$color-white;
|
|
25
|
-
}
|
|
26
|
-
&.neutral-200 {
|
|
27
|
-
color: tokens.$color-neutral-200;
|
|
28
|
-
}
|
|
29
|
-
&.neutral-400 {
|
|
30
|
-
color: tokens.$color-neutral-400;
|
|
31
|
-
}
|
|
32
|
-
&.neutral-600 {
|
|
33
|
-
color: tokens.$color-neutral-600;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
import { icons } from "./icon-data.ts";
|
|
4
|
-
import style from "./jd-icon.scss?inline";
|
|
5
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
6
|
-
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
7
|
-
import "../../components";
|
|
8
|
-
|
|
9
|
-
export type IconName =
|
|
10
|
-
| "circle"
|
|
11
|
-
| "x"
|
|
12
|
-
| "fire"
|
|
13
|
-
| "puzzle"
|
|
14
|
-
| "lightning"
|
|
15
|
-
| "arrow-right"
|
|
16
|
-
| "arrow-circle-left"
|
|
17
|
-
| "burger-menu"
|
|
18
|
-
| "chat";
|
|
19
|
-
|
|
20
|
-
@customElement("jd-icon")
|
|
21
|
-
export class JdIcon extends LitElement {
|
|
22
|
-
static styles = unsafeCSS(style);
|
|
23
|
-
|
|
24
|
-
@property({ type: String }) iconName: IconName = "fire";
|
|
25
|
-
|
|
26
|
-
@property({ type: String }) size:
|
|
27
|
-
| "72px"
|
|
28
|
-
| "56px"
|
|
29
|
-
| "48px"
|
|
30
|
-
| "40px"
|
|
31
|
-
| "32px"
|
|
32
|
-
| "24px"
|
|
33
|
-
| "16px" = "48px";
|
|
34
|
-
|
|
35
|
-
@property({ type: String }) color:
|
|
36
|
-
| "red"
|
|
37
|
-
| "purple"
|
|
38
|
-
| "blue"
|
|
39
|
-
| "black"
|
|
40
|
-
| "white"
|
|
41
|
-
| "neutral-200"
|
|
42
|
-
| "neutral-400"
|
|
43
|
-
| "neutral-600" = "black";
|
|
44
|
-
|
|
45
|
-
render() {
|
|
46
|
-
const iconWrapperClasses = {
|
|
47
|
-
"icon-wrapper": true,
|
|
48
|
-
[this.color]: true,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return html`
|
|
52
|
-
<div
|
|
53
|
-
class=${classMap(iconWrapperClasses)}
|
|
54
|
-
style="height: ${this.size}; width: ${this.size};"
|
|
55
|
-
>
|
|
56
|
-
${unsafeHTML(icons[this.iconName])}
|
|
57
|
-
</div>
|
|
58
|
-
`;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
declare global {
|
|
63
|
-
interface HTMLElementTagNameMap {
|
|
64
|
-
"jd-icon": JdIcon;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import "../jd-icon";
|
|
4
|
-
|
|
5
|
-
const meta: Meta = {
|
|
6
|
-
title: "Components/Icon",
|
|
7
|
-
component: "jd-icon",
|
|
8
|
-
argTypes: {
|
|
9
|
-
size: {
|
|
10
|
-
control: { type: "select" },
|
|
11
|
-
options: ["72px", "56px", "48px", "32px", "24px", "16px"],
|
|
12
|
-
description: "Size of icon",
|
|
13
|
-
defaultValue: "48px",
|
|
14
|
-
},
|
|
15
|
-
color: {
|
|
16
|
-
control: { type: "select" },
|
|
17
|
-
options: [
|
|
18
|
-
"red",
|
|
19
|
-
"purple",
|
|
20
|
-
"blue",
|
|
21
|
-
"black",
|
|
22
|
-
"white",
|
|
23
|
-
"neutral-200",
|
|
24
|
-
"neutral-400",
|
|
25
|
-
"neutral-600",
|
|
26
|
-
],
|
|
27
|
-
description: "Color of the icon",
|
|
28
|
-
defaultValue: "red",
|
|
29
|
-
},
|
|
30
|
-
iconName: {
|
|
31
|
-
control: { type: "select" },
|
|
32
|
-
options: [
|
|
33
|
-
"fire",
|
|
34
|
-
"lightning",
|
|
35
|
-
"arrow-right",
|
|
36
|
-
"arrow-circle-left",
|
|
37
|
-
"burger-menu",
|
|
38
|
-
"puzzle",
|
|
39
|
-
"chat",
|
|
40
|
-
],
|
|
41
|
-
description: "Icon name",
|
|
42
|
-
defaultValue: "puzzle",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default meta;
|
|
48
|
-
type Story = StoryObj;
|
|
49
|
-
|
|
50
|
-
const DefaultExample = ({ ...args }) => {
|
|
51
|
-
return html`<jd-icon
|
|
52
|
-
iconName=${args.iconName}
|
|
53
|
-
color=${args.color}
|
|
54
|
-
size=${args.size}
|
|
55
|
-
></jd-icon>`;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const DefaultStory: Story = {
|
|
59
|
-
name: "Default",
|
|
60
|
-
render: DefaultExample.bind({}),
|
|
61
|
-
args: { iconName: "puzzle", color: "blue", size: "48px" },
|
|
62
|
-
};
|
|
@@ -1,36 +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
|
-
height: 48px;
|
|
7
|
-
width: 48px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:host([active]) button {
|
|
11
|
-
&.borderless {
|
|
12
|
-
color: tokens.$color-black;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
button {
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
border: none;
|
|
19
|
-
padding: 0;
|
|
20
|
-
width: 48px;
|
|
21
|
-
height: 48px;
|
|
22
|
-
&.borderless {
|
|
23
|
-
color: tokens.$color-black;
|
|
24
|
-
background-color: tokens.$color-white;
|
|
25
|
-
&:hover {
|
|
26
|
-
color: tokens.$color-accent-red;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
&.border {
|
|
30
|
-
color: #3a3a3a;
|
|
31
|
-
background-color: tokens.$color-white;
|
|
32
|
-
outline: 2px solid tokens.$color-black;
|
|
33
|
-
outline-offset: -2px;
|
|
34
|
-
border-radius: 24px;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
import style from "./jd-icon-button.scss?inline";
|
|
4
|
-
import { IconName } from "../icon/jd-icon.ts";
|
|
5
|
-
import "../../components";
|
|
6
|
-
|
|
7
|
-
@customElement("jd-icon-button")
|
|
8
|
-
export class JdIconButton extends LitElement {
|
|
9
|
-
static styles = unsafeCSS(style);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Button type, can be "primary" or "secondary".
|
|
13
|
-
*/
|
|
14
|
-
@property({ type: String }) type: "borderless" | "border" = "borderless";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Icon name.
|
|
18
|
-
*/
|
|
19
|
-
@property({ type: String }) iconName: IconName = "puzzle";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Icon color.
|
|
23
|
-
*/
|
|
24
|
-
@property({ type: String }) color:
|
|
25
|
-
| "red"
|
|
26
|
-
| "purple"
|
|
27
|
-
| "blue"
|
|
28
|
-
| "black"
|
|
29
|
-
| "white"
|
|
30
|
-
| "neutral-200"
|
|
31
|
-
| "neutral-400"
|
|
32
|
-
| "neutral-600" = "black";
|
|
33
|
-
|
|
34
|
-
render() {
|
|
35
|
-
return html`
|
|
36
|
-
<button class=${this.type}>
|
|
37
|
-
<jd-icon
|
|
38
|
-
iconName=${this.iconName}
|
|
39
|
-
color=${this.color}
|
|
40
|
-
size=${this.type === "borderless" ? "48px" : "32px"}
|
|
41
|
-
></jd-icon>
|
|
42
|
-
</button>
|
|
43
|
-
`;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare global {
|
|
48
|
-
interface HTMLElementTagNameMap {
|
|
49
|
-
"jd-icon-button": JdIconButton;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components-vite";
|
|
2
|
-
import { html } from "lit-html";
|
|
3
|
-
import { IconName } from "../../icon/jd-icon.ts";
|
|
4
|
-
import "../jd-icon-button.ts";
|
|
5
|
-
|
|
6
|
-
type JdIconButtonArgs = {
|
|
7
|
-
type: "borderless" | "border";
|
|
8
|
-
iconName: IconName;
|
|
9
|
-
color:
|
|
10
|
-
| "red"
|
|
11
|
-
| "purple"
|
|
12
|
-
| "blue"
|
|
13
|
-
| "black"
|
|
14
|
-
| "white"
|
|
15
|
-
| "neutral-200"
|
|
16
|
-
| "neutral-400"
|
|
17
|
-
| "neutral-600";
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const meta: Meta<JdIconButtonArgs> = {
|
|
21
|
-
title: "Components/IconButton",
|
|
22
|
-
component: "jd-icon-button",
|
|
23
|
-
argTypes: {
|
|
24
|
-
type: {
|
|
25
|
-
control: { type: "select" },
|
|
26
|
-
options: ["borderless", "border"],
|
|
27
|
-
description: "Type of the button",
|
|
28
|
-
defaultValue: "borderless",
|
|
29
|
-
},
|
|
30
|
-
iconName: {
|
|
31
|
-
control: { type: "select" },
|
|
32
|
-
options: [
|
|
33
|
-
"x",
|
|
34
|
-
"puzzle",
|
|
35
|
-
"home",
|
|
36
|
-
"settings",
|
|
37
|
-
"user",
|
|
38
|
-
"search",
|
|
39
|
-
"notification",
|
|
40
|
-
"message",
|
|
41
|
-
"help",
|
|
42
|
-
"logout",
|
|
43
|
-
],
|
|
44
|
-
description: "Name of the icon",
|
|
45
|
-
defaultValue: "puzzle",
|
|
46
|
-
},
|
|
47
|
-
color: {
|
|
48
|
-
control: { type: "select" },
|
|
49
|
-
options: [
|
|
50
|
-
"red",
|
|
51
|
-
"purple",
|
|
52
|
-
"blue",
|
|
53
|
-
"black",
|
|
54
|
-
"white",
|
|
55
|
-
"neutral-200",
|
|
56
|
-
"neutral-400",
|
|
57
|
-
"neutral-600",
|
|
58
|
-
],
|
|
59
|
-
description: "Color of the icon",
|
|
60
|
-
defaultValue: "black",
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export default meta;
|
|
66
|
-
type Story = StoryObj<JdIconButtonArgs>;
|
|
67
|
-
|
|
68
|
-
const DefaultExample = (args: JdIconButtonArgs) => {
|
|
69
|
-
const onClick = () => {
|
|
70
|
-
console.log("Button clicked!");
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
return html`
|
|
74
|
-
<jd-icon-button
|
|
75
|
-
type=${args.type}
|
|
76
|
-
color=${args.color}
|
|
77
|
-
icon-name=${args.iconName}
|
|
78
|
-
@click=${onClick}
|
|
79
|
-
></jd-icon-button>
|
|
80
|
-
`;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const DefaultStory: Story = {
|
|
84
|
-
name: "Default",
|
|
85
|
-
render: DefaultExample.bind({}),
|
|
86
|
-
args: { type: "borderless", iconName: "puzzle", color: "black" },
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export const SecondaryStory: Story = {
|
|
90
|
-
name: "Border",
|
|
91
|
-
render: DefaultExample.bind({}),
|
|
92
|
-
args: { ...DefaultStory.args, type: "border" },
|
|
93
|
-
};
|
|
@@ -1,41 +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
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.title {
|
|
25
|
-
&.l {
|
|
26
|
-
@include mixins.font-01-copy-italic;
|
|
27
|
-
}
|
|
28
|
-
&.m,
|
|
29
|
-
&.s {
|
|
30
|
-
@include mixins.font-02-copy-italic;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.divider {
|
|
35
|
-
border-bottom: solid 2px tokens.$color-black;
|
|
36
|
-
height: 1px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.description {
|
|
40
|
-
@include mixins.font-03-copy;
|
|
41
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
import style from "./jd-image-link.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-image-link")
|
|
10
|
-
export class JdImageLink extends SignalWatcher(LitElement) {
|
|
11
|
-
static styles = unsafeCSS(style);
|
|
12
|
-
@property({ type: String }) href = "";
|
|
13
|
-
@property({ type: String }) target: "_blank" | "_bla" = "_blank";
|
|
14
|
-
@property({ type: String }) description = "";
|
|
15
|
-
|
|
16
|
-
render() {
|
|
17
|
-
const titleClass = {
|
|
18
|
-
title: true,
|
|
19
|
-
[breakpoint.get()]: true,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
return html`
|
|
23
|
-
<div>
|
|
24
|
-
<a href="${this.href}" target="${this.target}">
|
|
25
|
-
<div class="link-wrapper">
|
|
26
|
-
<div class=${classMap(titleClass)}>
|
|
27
|
-
<slot></slot>
|
|
28
|
-
</div>
|
|
29
|
-
<div class="divider"></div>
|
|
30
|
-
<div class="description">${this.description}</div>
|
|
31
|
-
</div>
|
|
32
|
-
</a>
|
|
33
|
-
</div>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
}
|