@elmethis/qwik 0.0.2 → 0.0.4
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 +6 -0
- package/.storybook/main.ts +23 -0
- package/.storybook/preview-head.html +4 -0
- package/.storybook/preview.tsx +51 -0
- package/.storybook/sb.scss +13 -0
- package/.storybook/tsconfig.json +24 -0
- package/eslint.config.js +79 -0
- package/package.json +5 -8
- package/src/assets/bg1.webp +0 -0
- package/src/assets/bg2.webp +0 -0
- package/src/assets/images/2.svg +4 -0
- package/src/assets/images/lamdscape.svg +4 -0
- package/src/assets/images/portrait.svg +4 -0
- package/src/assets/images/square.svg +4 -0
- package/src/assets/vite.svg +1 -0
- package/src/assets/vue.svg +1 -0
- package/src/components/code/elm-code-block.module.scss +67 -0
- package/src/components/code/elm-code-block.stories.tsx +44 -0
- package/src/components/code/elm-code-block.tsx +95 -0
- package/src/components/code/elm-katex.stories.tsx +28 -0
- package/src/components/code/elm-katex.tsx +34 -0
- package/src/components/code/elm-shiki-highlighter.global.scss +18 -0
- package/src/components/code/elm-shiki-highlighter.stories.tsx +21 -0
- package/src/components/code/elm-shiki-highlighter.tsx +44 -0
- package/src/components/code/seed/main.rs +24 -0
- package/{lib/qwik31.js → src/components/code/shikiInstance.ts} +8 -11
- package/src/components/containments/elm-toggle.module.scss +132 -0
- package/src/components/containments/elm-toggle.stories.tsx +34 -0
- package/src/components/containments/elm-toggle.tsx +106 -0
- package/src/components/fallback/elm-block-fallback.module.scss +8 -0
- package/src/components/fallback/elm-block-fallback.stories.tsx +14 -0
- package/src/components/fallback/elm-block-fallback.tsx +20 -0
- package/src/components/fallback/elm-rectangle-wave.module.scss +42 -0
- package/src/components/fallback/elm-rectangle-wave.stories.tsx +28 -0
- package/src/components/fallback/elm-rectangle-wave.tsx +11 -0
- package/src/components/icon/elm-dot-loading-icon.module.scss +53 -0
- package/src/components/icon/elm-dot-loading-icon.stories.tsx +15 -0
- package/src/components/icon/elm-dot-loading-icon.tsx +35 -0
- package/src/components/icon/elm-inline-icon.module.scss +21 -0
- package/src/components/icon/elm-inline-icon.stories.tsx +16 -0
- package/src/components/icon/elm-inline-icon.tsx +25 -0
- package/src/components/icon/elm-language-icon.stories.tsx +22 -0
- package/src/components/icon/elm-language-icon.tsx +167 -0
- package/src/components/icon/elm-mdi-icon.module.scss +8 -0
- package/src/components/icon/elm-mdi-icon.stories.tsx +25 -0
- package/src/components/icon/elm-mdi-icon.tsx +34 -0
- package/src/components/icon/languages/bash.module.scss +6 -0
- package/src/components/icon/languages/bash.tsx +27 -0
- package/src/components/icon/languages/c-plus-plus.tsx +33 -0
- package/src/components/icon/languages/c-sharp.tsx +29 -0
- package/src/components/icon/languages/c.tsx +27 -0
- package/src/components/icon/languages/css.tsx +21 -0
- package/src/components/icon/languages/go.tsx +22 -0
- package/src/components/icon/languages/html.tsx +30 -0
- package/src/components/icon/languages/java.tsx +37 -0
- package/src/components/icon/languages/javascript.tsx +22 -0
- package/src/components/icon/languages/json.tsx +53 -0
- package/src/components/icon/languages/kotlin.tsx +36 -0
- package/src/components/icon/languages/language-interface.ts +4 -0
- package/src/components/icon/languages/lua.tsx +29 -0
- package/src/components/icon/languages/npm.tsx +25 -0
- package/src/components/icon/languages/python.tsx +67 -0
- package/src/components/icon/languages/rust.tsx +19 -0
- package/src/components/icon/languages/sql.tsx +21 -0
- package/src/components/icon/languages/terraform.tsx +31 -0
- package/src/components/icon/languages/typescript.tsx +22 -0
- package/src/components/media/elm-block-image.module.scss +68 -0
- package/src/components/media/elm-block-image.stories.tsx +79 -0
- package/src/components/media/elm-block-image.tsx +110 -0
- package/src/components/media/elm-file.module.scss +43 -0
- package/src/components/media/elm-file.stories.tsx +27 -0
- package/src/components/media/elm-file.tsx +75 -0
- package/src/components/navigation/elm-bookmark.module.scss +100 -0
- package/src/components/navigation/elm-bookmark.stories.tsx +87 -0
- package/src/components/navigation/elm-bookmark.tsx +72 -0
- package/src/components/others/elm-jarkup.module.scss +26 -0
- package/src/components/others/elm-jarkup.stories.tsx +18 -0
- package/src/components/others/elm-jarkup.tsx +267 -0
- package/src/components/table/elm-table-body.tsx +14 -0
- package/src/components/table/elm-table-cell.module.scss +41 -0
- package/src/components/table/elm-table-cell.tsx +33 -0
- package/src/components/table/elm-table-header.module.scss +8 -0
- package/src/components/table/elm-table-header.tsx +21 -0
- package/src/components/table/elm-table-row.module.scss +28 -0
- package/src/components/table/elm-table-row.tsx +15 -0
- package/src/components/table/elm-table.module.scss +29 -0
- package/src/components/table/elm-table.stories.tsx +67 -0
- package/src/components/table/elm-table.tsx +63 -0
- package/src/components/typography/elm-block-quote.module.scss +29 -0
- package/src/components/typography/elm-block-quote.stories.tsx +22 -0
- package/src/components/typography/elm-block-quote.tsx +34 -0
- package/src/components/typography/elm-callout.module.scss +36 -0
- package/src/components/typography/elm-callout.stories.tsx +47 -0
- package/src/components/typography/elm-callout.tsx +52 -0
- package/src/components/typography/elm-divider.module.scss +6 -0
- package/src/components/typography/elm-divider.stories.tsx +14 -0
- package/src/components/typography/elm-divider.tsx +14 -0
- package/src/components/typography/elm-fragment-identifier.module.scss +28 -0
- package/src/components/typography/elm-fragment-identifier.stories.tsx +14 -0
- package/src/components/typography/elm-fragment-identifier.tsx +31 -0
- package/src/components/typography/elm-heading.module.scss +120 -0
- package/src/components/typography/elm-heading.stories.tsx +42 -0
- package/src/components/typography/elm-heading.tsx +40 -0
- package/src/components/typography/elm-inline-text.module.scss +114 -0
- package/src/components/typography/elm-inline-text.stories.tsx +70 -0
- package/src/components/typography/elm-inline-text.tsx +147 -0
- package/src/components/typography/elm-list.global.scss +66 -0
- package/src/components/typography/elm-list.stories.tsx +61 -0
- package/src/components/typography/elm-list.tsx +39 -0
- package/src/components/typography/elm-paragraph.module.scss +21 -0
- package/src/components/typography/elm-paragraph.stories.tsx +47 -0
- package/src/components/typography/elm-paragraph.tsx +31 -0
- package/src/entry.dev.tsx +17 -0
- package/{lib-types/entry.ssr.d.ts → src/entry.ssr.tsx} +9 -2
- package/src/global.d.ts +13 -0
- package/src/hooks/useDelayedSignal.ts +27 -0
- package/src/hooks/useInView.tsx +23 -0
- package/src/index.ts +113 -0
- package/src/root.tsx +13 -0
- package/src/styles/text.module.scss +17 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +21 -0
- package/vite.config.ts +36 -0
- package/lib/assets/6FDiDjPb-qwik.css +0 -955
- package/lib/qwik.js +0 -56
- package/lib/qwik10.js +0 -108
- package/lib/qwik11.js +0 -25
- package/lib/qwik12.js +0 -87
- package/lib/qwik13.js +0 -62
- package/lib/qwik14.js +0 -62
- package/lib/qwik15.js +0 -44
- package/lib/qwik16.js +0 -58
- package/lib/qwik17.js +0 -14
- package/lib/qwik18.js +0 -24
- package/lib/qwik19.js +0 -41
- package/lib/qwik2.js +0 -68
- package/lib/qwik20.js +0 -89
- package/lib/qwik21.js +0 -28
- package/lib/qwik22.js +0 -24
- package/lib/qwik23.js +0 -57
- package/lib/qwik24.js +0 -15
- package/lib/qwik25.js +0 -12
- package/lib/qwik26.js +0 -17
- package/lib/qwik27.js +0 -27
- package/lib/qwik28.js +0 -193
- package/lib/qwik29.js +0 -17
- package/lib/qwik3.js +0 -17
- package/lib/qwik30.js +0 -8
- package/lib/qwik33.js +0 -32
- package/lib/qwik34.js +0 -6
- package/lib/qwik35.js +0 -6
- package/lib/qwik36.js +0 -11
- package/lib/qwik37.js +0 -8
- package/lib/qwik38.js +0 -18
- package/lib/qwik39.js +0 -24
- package/lib/qwik4.js +0 -33
- package/lib/qwik40.js +0 -24
- package/lib/qwik41.js +0 -29
- package/lib/qwik42.js +0 -31
- package/lib/qwik43.js +0 -32
- package/lib/qwik44.js +0 -18
- package/lib/qwik45.js +0 -24
- package/lib/qwik46.js +0 -36
- package/lib/qwik47.js +0 -45
- package/lib/qwik48.js +0 -27
- package/lib/qwik49.js +0 -89
- package/lib/qwik5.js +0 -123
- package/lib/qwik50.js +0 -18
- package/lib/qwik51.js +0 -64
- package/lib/qwik52.js +0 -28
- package/lib/qwik53.js +0 -28
- package/lib/qwik54.js +0 -32
- package/lib/qwik55.js +0 -28
- package/lib/qwik56.js +0 -8
- package/lib/qwik57.js +0 -15
- package/lib/qwik58.js +0 -10
- package/lib/qwik59.js +0 -26
- package/lib/qwik6.js +0 -20
- package/lib/qwik60.js +0 -14
- package/lib/qwik61.js +0 -14
- package/lib/qwik62.js +0 -8
- package/lib/qwik63.js +0 -8
- package/lib/qwik64.js +0 -24
- package/lib/qwik65.js +0 -17
- package/lib/qwik67.js +0 -8
- package/lib/qwik68.js +0 -23
- package/lib/qwik69.js +0 -15
- package/lib/qwik7.js +0 -12
- package/lib/qwik70.js +0 -8
- package/lib/qwik71.js +0 -9
- package/lib/qwik72.js +0 -14
- package/lib/qwik73.js +0 -10
- package/lib/qwik74.js +0 -8
- package/lib/qwik8.js +0 -29
- package/lib/qwik9.js +0 -16
- package/lib-types/components/code/elm-code-block.d.ts +0 -21
- package/lib-types/components/code/elm-code-block.stories.d.ts +0 -9
- package/lib-types/components/code/elm-katex.d.ts +0 -15
- package/lib-types/components/code/elm-katex.stories.d.ts +0 -8
- package/lib-types/components/code/elm-shiki-highlighter.d.ts +0 -12
- package/lib-types/components/code/elm-shiki-highlighter.stories.d.ts +0 -6
- package/lib-types/components/code/shikiInstance.d.ts +0 -2
- package/lib-types/components/containments/elm-toggle.d.ts +0 -7
- package/lib-types/components/containments/elm-toggle.stories.d.ts +0 -6
- package/lib-types/components/fallback/elm-block-fallback.d.ts +0 -5
- package/lib-types/components/fallback/elm-block-fallback.stories.d.ts +0 -6
- package/lib-types/components/fallback/elm-rectangle-wave.d.ts +0 -4
- package/lib-types/components/fallback/elm-rectangle-wave.stories.d.ts +0 -6
- package/lib-types/components/icon/elm-dot-loading-icon.d.ts +0 -14
- package/lib-types/components/icon/elm-dot-loading-icon.stories.d.ts +0 -6
- package/lib-types/components/icon/elm-inline-icon.d.ts +0 -11
- package/lib-types/components/icon/elm-inline-icon.stories.d.ts +0 -6
- package/lib-types/components/icon/elm-language-icon.d.ts +0 -14
- package/lib-types/components/icon/elm-language-icon.stories.d.ts +0 -6
- package/lib-types/components/icon/elm-mdi-icon.d.ts +0 -8
- package/lib-types/components/icon/elm-mdi-icon.stories.d.ts +0 -6
- package/lib-types/components/icon/languages/bash.d.ts +0 -2
- package/lib-types/components/icon/languages/c-plus-plus.d.ts +0 -2
- package/lib-types/components/icon/languages/c-sharp.d.ts +0 -2
- package/lib-types/components/icon/languages/c.d.ts +0 -2
- package/lib-types/components/icon/languages/css.d.ts +0 -2
- package/lib-types/components/icon/languages/go.d.ts +0 -2
- package/lib-types/components/icon/languages/html.d.ts +0 -2
- package/lib-types/components/icon/languages/java.d.ts +0 -2
- package/lib-types/components/icon/languages/javascript.d.ts +0 -2
- package/lib-types/components/icon/languages/json.d.ts +0 -2
- package/lib-types/components/icon/languages/kotlin.d.ts +0 -2
- package/lib-types/components/icon/languages/language-interface.d.ts +0 -4
- package/lib-types/components/icon/languages/lua.d.ts +0 -2
- package/lib-types/components/icon/languages/npm.d.ts +0 -2
- package/lib-types/components/icon/languages/python.d.ts +0 -2
- package/lib-types/components/icon/languages/rust.d.ts +0 -2
- package/lib-types/components/icon/languages/sql.d.ts +0 -2
- package/lib-types/components/icon/languages/terraform.d.ts +0 -2
- package/lib-types/components/icon/languages/typescript.d.ts +0 -2
- package/lib-types/components/media/elm-block-image.d.ts +0 -16
- package/lib-types/components/media/elm-block-image.stories.d.ts +0 -12
- package/lib-types/components/media/elm-file.d.ts +0 -15
- package/lib-types/components/media/elm-file.stories.d.ts +0 -7
- package/lib-types/components/navigation/elm-bookmark.d.ts +0 -24
- package/lib-types/components/navigation/elm-bookmark.stories.d.ts +0 -12
- package/lib-types/components/others/elm-jarkup.d.ts +0 -5
- package/lib-types/components/others/elm-jarkup.stories.d.ts +0 -6
- package/lib-types/components/table/elm-table-body.d.ts +0 -2
- package/lib-types/components/table/elm-table-cell.d.ts +0 -12
- package/lib-types/components/table/elm-table-header.d.ts +0 -3
- package/lib-types/components/table/elm-table-row.d.ts +0 -2
- package/lib-types/components/table/elm-table.d.ts +0 -13
- package/lib-types/components/table/elm-table.stories.d.ts +0 -6
- package/lib-types/components/typography/elm-block-quote.d.ts +0 -4
- package/lib-types/components/typography/elm-block-quote.stories.d.ts +0 -6
- package/lib-types/components/typography/elm-callout.d.ts +0 -8
- package/lib-types/components/typography/elm-callout.stories.d.ts +0 -10
- package/lib-types/components/typography/elm-divider.d.ts +0 -8
- package/lib-types/components/typography/elm-divider.stories.d.ts +0 -6
- package/lib-types/components/typography/elm-fragment-identifier.d.ts +0 -7
- package/lib-types/components/typography/elm-fragment-identifier.stories.d.ts +0 -6
- package/lib-types/components/typography/elm-heading.d.ts +0 -6
- package/lib-types/components/typography/elm-heading.stories.d.ts +0 -7
- package/lib-types/components/typography/elm-inline-text.d.ts +0 -54
- package/lib-types/components/typography/elm-inline-text.stories.d.ts +0 -13
- package/lib-types/components/typography/elm-list.d.ts +0 -5
- package/lib-types/components/typography/elm-list.stories.d.ts +0 -8
- package/lib-types/components/typography/elm-paragraph.d.ts +0 -5
- package/lib-types/components/typography/elm-paragraph.stories.d.ts +0 -9
- package/lib-types/entry.dev.d.ts +0 -2
- package/lib-types/hooks/useDelayedSignal.d.ts +0 -6
- package/lib-types/hooks/useInView.d.ts +0 -6
- package/lib-types/index.d.ts +0 -27
- package/lib-types/root.d.ts +0 -2
- /package/{lib-types/components/table/index.d.ts → src/components/table/index.ts} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.file {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 1rem;
|
|
4
|
+
display: grid;
|
|
5
|
+
grid-template-columns: 1.5rem 1fr 1fr 1.5rem;
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.2);
|
|
10
|
+
border-radius: 0.25rem;
|
|
11
|
+
|
|
12
|
+
background-color: rgba(white, 0.2);
|
|
13
|
+
[data-theme="dark"] & {
|
|
14
|
+
background-color: rgba(black, 0.2);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.file-size {
|
|
19
|
+
text-align: right;
|
|
20
|
+
opacity: 0.5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.download-icon {
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
height: 1.5rem;
|
|
28
|
+
width: 1.5rem;
|
|
29
|
+
|
|
30
|
+
padding: 0.125rem;
|
|
31
|
+
border-radius: 0.125rem;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
transition:
|
|
34
|
+
color 200ms,
|
|
35
|
+
background-color 200ms;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background-color: rgba(black, 0.1);
|
|
39
|
+
[data-theme="dark"] & {
|
|
40
|
+
background-color: rgba(white, 0.1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "storybook-framework-qwik";
|
|
2
|
+
import { ElmFile } from "./elm-file";
|
|
3
|
+
|
|
4
|
+
import file from "../../assets/vite.svg";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof ElmFile> = {
|
|
7
|
+
title: "Components/Media/elm-file",
|
|
8
|
+
component: ElmFile,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
args: {},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
|
|
16
|
+
export const Primary: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
src: file,
|
|
19
|
+
filesize: "1.46 KB",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Secondary: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
src: file,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { $, component$ } from "@builder.io/qwik";
|
|
2
|
+
|
|
3
|
+
import styles from "./elm-file.module.scss";
|
|
4
|
+
import { ElmMdiIcon } from "../icon/elm-mdi-icon";
|
|
5
|
+
import { mdiDownload, mdiFile } from "@mdi/js";
|
|
6
|
+
import { ElmInlineText } from "../typography/elm-inline-text";
|
|
7
|
+
|
|
8
|
+
export interface ElmFileProps {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the file.
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The source of the file.
|
|
16
|
+
*/
|
|
17
|
+
src: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The size of the file in bytes.
|
|
21
|
+
*/
|
|
22
|
+
filesize?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getLastPathSegmentWithoutQueryOrHash(
|
|
26
|
+
urlString: string,
|
|
27
|
+
): string | null {
|
|
28
|
+
const cleanedUrl = urlString.split(/[?#]/)[0];
|
|
29
|
+
const pathSegments = cleanedUrl.split("/").filter(Boolean);
|
|
30
|
+
return pathSegments.length > 0 ? pathSegments[pathSegments.length - 1] : null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const ElmFile = component$<ElmFileProps>(({ name, src, filesize }) => {
|
|
34
|
+
const downloadFile = $(async () => {
|
|
35
|
+
let link;
|
|
36
|
+
try {
|
|
37
|
+
const response = await fetch(src);
|
|
38
|
+
if (!response.ok) throw new Error("Failed to download file");
|
|
39
|
+
|
|
40
|
+
const blob = await response.blob();
|
|
41
|
+
|
|
42
|
+
link = document.createElement("a");
|
|
43
|
+
link.href = URL.createObjectURL(blob);
|
|
44
|
+
link.download =
|
|
45
|
+
name ?? getLastPathSegmentWithoutQueryOrHash(src) ?? "file";
|
|
46
|
+
link.click();
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error("ERROR:", error);
|
|
49
|
+
} finally {
|
|
50
|
+
if (link) URL.revokeObjectURL(link.href);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div class={styles.file}>
|
|
56
|
+
<div>
|
|
57
|
+
<ElmMdiIcon d={mdiFile} size="1.25rem" />
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div>
|
|
61
|
+
<ElmInlineText>
|
|
62
|
+
{name ?? getLastPathSegmentWithoutQueryOrHash(src)}
|
|
63
|
+
</ElmInlineText>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class={styles["file-size"]}>
|
|
67
|
+
<ElmInlineText>{filesize}</ElmInlineText>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div class={styles["download-icon"]} onClick$={downloadFile}>
|
|
71
|
+
<ElmMdiIcon d={mdiDownload} size="1.25rem" />
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
.bookmark {
|
|
2
|
+
all: unset;
|
|
3
|
+
display: block;
|
|
4
|
+
container-type: inline-size;
|
|
5
|
+
border-radius: 0.25rem;
|
|
6
|
+
box-shadow: 0 0 0.125rem rgba(black, 0.1);
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
|
|
9
|
+
transition:
|
|
10
|
+
background-color 200ms,
|
|
11
|
+
transform 200ms;
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
background-color: rgba(#6987b8, 0.1);
|
|
15
|
+
transform: translateX(-0.125rem) translateY(-0.125rem);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&:active {
|
|
19
|
+
background-color: rgba(#59b57c, 0.1);
|
|
20
|
+
transform: translateX(0) translateY(0);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.container {
|
|
25
|
+
all: unset;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
width: 100%;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
|
|
31
|
+
@container (max-width: 700px) {
|
|
32
|
+
& {
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.image {
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
height: 100%;
|
|
41
|
+
opacity: 0.9;
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
align-items: center;
|
|
45
|
+
object-fit: cover;
|
|
46
|
+
object-position: center;
|
|
47
|
+
aspect-ratio: 2 / 1;
|
|
48
|
+
width: min-content;
|
|
49
|
+
max-width: 35%;
|
|
50
|
+
|
|
51
|
+
@container (max-width: 700px) {
|
|
52
|
+
& {
|
|
53
|
+
min-width: unset;
|
|
54
|
+
max-width: unset;
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.content {
|
|
61
|
+
flex: 1;
|
|
62
|
+
width: 75%;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
padding: 0.5rem;
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
gap: 0.5rem;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
|
|
70
|
+
transition: background-color 200ms;
|
|
71
|
+
background-color: rgba(white, 0.4);
|
|
72
|
+
|
|
73
|
+
@container (max-width: 700px) {
|
|
74
|
+
& {
|
|
75
|
+
width: 100%;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-theme="dark"] & {
|
|
80
|
+
background-color: rgba(black, 0.2);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.title {
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.description {
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
opacity: 0.7;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.link {
|
|
93
|
+
line-height: 0.75rem;
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: flex-end;
|
|
96
|
+
align-items: center;
|
|
97
|
+
gap: 0.25rem;
|
|
98
|
+
opacity: 0.7;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "storybook-framework-qwik";
|
|
2
|
+
import { ElmBookmark } from "./elm-bookmark";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof ElmBookmark> = {
|
|
5
|
+
title: "Components/Navigation/elm-bookmark",
|
|
6
|
+
component: ElmBookmark,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
args: {
|
|
9
|
+
favicon: "https://pnpm.io/img/favicon.png",
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
|
|
16
|
+
export const Primary: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
title:
|
|
19
|
+
"OGP Checker - Check images for X(Twitter) and Facebook sharing | Web ToolBox",
|
|
20
|
+
description:
|
|
21
|
+
"A tool to check OGP tags and OGP images for SNS shares for a given page in real time, accurately simulating X (formerly Twitter) and Facebook share images on both PC and mobile.",
|
|
22
|
+
image:
|
|
23
|
+
"https://www.ikuma.cloud/api/v2/blog/leather-shoes-painting/og-image",
|
|
24
|
+
url: "https://www.ikuma.cloud/blog/article/leather-shoes-painting",
|
|
25
|
+
favicon: "https://pnpm.io/img/favicon.png",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const WithoutDate: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
title:
|
|
32
|
+
"OGP Checker - Check images for X(Twitter) and Facebook sharing | Web ToolBox",
|
|
33
|
+
description:
|
|
34
|
+
"A tool to check OGP tags and OGP images for SNS shares for a given page in real time, accurately simulating X (formerly Twitter) and Facebook share images on both PC and mobile.",
|
|
35
|
+
image:
|
|
36
|
+
"https://web-toolbox.dev/__og-image__/static/en/tools/ogp-checker/og.png",
|
|
37
|
+
url: "https://web-toolbox.dev/en/tools/ogp-checker",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Card: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
title:
|
|
44
|
+
"OGP Checker - Check images for X(Twitter) and Facebook sharing | Web ToolBox",
|
|
45
|
+
description:
|
|
46
|
+
"A tool to check OGP tags and OGP images for SNS shares for a given page in real time, accurately simulating X (formerly Twitter) and Facebook share images on both PC and mobile.",
|
|
47
|
+
image:
|
|
48
|
+
"https://www.ikuma.cloud/api/v2/blog/leather-shoes-painting/og-image",
|
|
49
|
+
url: "https://www.ikuma.cloud/blog/article/leather-shoes-painting",
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Square: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
url: "https://pnpm.io/",
|
|
56
|
+
title: " Fast, disk space efficient package manager | pnpm",
|
|
57
|
+
description: "Fast, disk space efficient package manager",
|
|
58
|
+
image: "https://pnpm.io/img/ogimage.png",
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const SquareCard: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
url: "https://pnpm.io/",
|
|
65
|
+
title: " Fast, disk space efficient package manager | pnpm",
|
|
66
|
+
description: "Fast, disk space efficient package manager",
|
|
67
|
+
image: "https://pnpm.io/img/ogimage.png",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const InvalidImage: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
url: "https://pnpm.io/",
|
|
74
|
+
title: " Fast, disk space efficient package manager | pnpm",
|
|
75
|
+
description: "Fast, disk space efficient package manager",
|
|
76
|
+
image: "https://pnpm.io/",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const NoImage: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
url: "https://pnpm.io/",
|
|
83
|
+
title: " Fast, disk space efficient package manager | pnpm",
|
|
84
|
+
description: "Fast, disk space efficient package manager",
|
|
85
|
+
favicon: "https://pnpm.io/img/favicon.png",
|
|
86
|
+
},
|
|
87
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* eslint-disable qwik/jsx-img */
|
|
2
|
+
import { component$ } from "@builder.io/qwik";
|
|
3
|
+
|
|
4
|
+
import styles from "./elm-bookmark.module.scss";
|
|
5
|
+
import { ElmInlineText } from "../typography/elm-inline-text";
|
|
6
|
+
import { mdiLinkVariant } from "@mdi/js";
|
|
7
|
+
import { ElmMdiIcon } from "../icon/elm-mdi-icon";
|
|
8
|
+
import { ElmInlineIcon } from "../icon/elm-inline-icon";
|
|
9
|
+
|
|
10
|
+
export interface ElmBookmarkProps {
|
|
11
|
+
/**
|
|
12
|
+
* The title of the bookmark.
|
|
13
|
+
*/
|
|
14
|
+
title?: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The description of the bookmark.
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The image to display.
|
|
23
|
+
* This can be a URL or a base64-encoded image.
|
|
24
|
+
*/
|
|
25
|
+
image?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The URL to navigate to.
|
|
29
|
+
*/
|
|
30
|
+
url?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The URL of the favicon.
|
|
34
|
+
*/
|
|
35
|
+
favicon?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const ElmBookmark = component$<ElmBookmarkProps>(
|
|
39
|
+
({ url, image, title, description, favicon }) => {
|
|
40
|
+
return (
|
|
41
|
+
<div class={styles.bookmark}>
|
|
42
|
+
<a
|
|
43
|
+
class={styles.container}
|
|
44
|
+
href={url}
|
|
45
|
+
target="_blank"
|
|
46
|
+
rel="noopener noreferrer"
|
|
47
|
+
>
|
|
48
|
+
<img class={styles.image} src={image} alt="OGP Image" />
|
|
49
|
+
|
|
50
|
+
<div class={styles.content}>
|
|
51
|
+
<div class={styles.title}>
|
|
52
|
+
<ElmInlineText bold>{title}</ElmInlineText>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div class={styles.description}>
|
|
56
|
+
<ElmInlineText size="0.75rem">{description}</ElmInlineText>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class={styles.link}>
|
|
60
|
+
{favicon ? (
|
|
61
|
+
<ElmInlineIcon src={favicon} />
|
|
62
|
+
) : (
|
|
63
|
+
<ElmMdiIcon d={mdiLinkVariant} color="#6987b8" />
|
|
64
|
+
)}
|
|
65
|
+
<ElmInlineText size="0.75rem">{url}</ElmInlineText>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</a>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.jarkup-body {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 2rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.column-list {
|
|
8
|
+
box-sizing: content-box;
|
|
9
|
+
padding-block: 0.25rem;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
gap: 0.25rem;
|
|
14
|
+
justify-content: space-around;
|
|
15
|
+
overflow: auto;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.column {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
padding: 0.125rem;
|
|
21
|
+
flex: var(--width-ratio, 1);
|
|
22
|
+
|
|
23
|
+
& > * + * {
|
|
24
|
+
margin-block-start: 2em;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "storybook-framework-qwik";
|
|
2
|
+
import { ElmJarkup } from "./elm-jarkup";
|
|
3
|
+
import sampleData from "../../../../vue/src/components/others/ElmJsonComponentRenderer.json";
|
|
4
|
+
import { type Component } from "jarkup-ts";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof ElmJarkup> = {
|
|
7
|
+
title: "Components/Others/elm-jarkup",
|
|
8
|
+
component: ElmJarkup,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
args: {
|
|
11
|
+
jsonComponents: sampleData as Component[],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Primary: Story = {};
|