@elmethis/qwik 0.0.6 → 0.0.8

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.
Files changed (202) hide show
  1. package/lib/index.qwik.cjs +1678 -0
  2. package/lib/index.qwik.mjs +1678 -0
  3. package/lib/shikiInstance-BxkUyfqr.cjs +79 -0
  4. package/{src/components/code/shikiInstance.ts → lib/shikiInstance-igs7t2fe.js} +11 -8
  5. package/lib-types/components/code/elm-code-block.d.ts +21 -0
  6. package/lib-types/components/code/elm-code-block.stories.d.ts +9 -0
  7. package/lib-types/components/code/elm-katex.d.ts +15 -0
  8. package/lib-types/components/code/elm-katex.stories.d.ts +8 -0
  9. package/lib-types/components/code/elm-shiki-highlighter.d.ts +11 -0
  10. package/lib-types/components/code/elm-shiki-highlighter.stories.d.ts +6 -0
  11. package/lib-types/components/code/shikiInstance.d.ts +2 -0
  12. package/lib-types/components/containments/elm-toggle.d.ts +7 -0
  13. package/lib-types/components/containments/elm-toggle.stories.d.ts +6 -0
  14. package/lib-types/components/fallback/elm-block-fallback.d.ts +5 -0
  15. package/lib-types/components/fallback/elm-block-fallback.stories.d.ts +6 -0
  16. package/lib-types/components/fallback/elm-rectangle-wave.d.ts +4 -0
  17. package/lib-types/components/fallback/elm-rectangle-wave.stories.d.ts +6 -0
  18. package/lib-types/components/icon/elm-dot-loading-icon.d.ts +14 -0
  19. package/lib-types/components/icon/elm-dot-loading-icon.stories.d.ts +6 -0
  20. package/lib-types/components/icon/elm-inline-icon.d.ts +11 -0
  21. package/lib-types/components/icon/elm-inline-icon.stories.d.ts +6 -0
  22. package/lib-types/components/icon/elm-language-icon.d.ts +14 -0
  23. package/lib-types/components/icon/elm-language-icon.stories.d.ts +6 -0
  24. package/lib-types/components/icon/elm-mdi-icon.d.ts +8 -0
  25. package/lib-types/components/icon/elm-mdi-icon.stories.d.ts +6 -0
  26. package/lib-types/components/icon/languages/bash.d.ts +2 -0
  27. package/lib-types/components/icon/languages/c-plus-plus.d.ts +2 -0
  28. package/lib-types/components/icon/languages/c-sharp.d.ts +2 -0
  29. package/lib-types/components/icon/languages/c.d.ts +2 -0
  30. package/lib-types/components/icon/languages/css.d.ts +2 -0
  31. package/lib-types/components/icon/languages/go.d.ts +2 -0
  32. package/lib-types/components/icon/languages/html.d.ts +2 -0
  33. package/lib-types/components/icon/languages/java.d.ts +2 -0
  34. package/lib-types/components/icon/languages/javascript.d.ts +2 -0
  35. package/lib-types/components/icon/languages/json.d.ts +2 -0
  36. package/lib-types/components/icon/languages/kotlin.d.ts +2 -0
  37. package/lib-types/components/icon/languages/language-interface.d.ts +4 -0
  38. package/lib-types/components/icon/languages/lua.d.ts +2 -0
  39. package/lib-types/components/icon/languages/npm.d.ts +2 -0
  40. package/lib-types/components/icon/languages/python.d.ts +2 -0
  41. package/lib-types/components/icon/languages/rust.d.ts +2 -0
  42. package/lib-types/components/icon/languages/sql.d.ts +2 -0
  43. package/lib-types/components/icon/languages/terraform.d.ts +2 -0
  44. package/lib-types/components/icon/languages/typescript.d.ts +2 -0
  45. package/lib-types/components/media/elm-block-image.d.ts +16 -0
  46. package/lib-types/components/media/elm-block-image.stories.d.ts +12 -0
  47. package/lib-types/components/media/elm-file.d.ts +15 -0
  48. package/lib-types/components/media/elm-file.stories.d.ts +7 -0
  49. package/lib-types/components/navigation/elm-bookmark.d.ts +24 -0
  50. package/lib-types/components/navigation/elm-bookmark.stories.d.ts +12 -0
  51. package/lib-types/components/others/elm-jarkup.d.ts +5 -0
  52. package/lib-types/components/others/elm-jarkup.stories.d.ts +6 -0
  53. package/lib-types/components/table/elm-table-body.d.ts +2 -0
  54. package/lib-types/components/table/elm-table-cell.d.ts +12 -0
  55. package/lib-types/components/table/elm-table-header.d.ts +3 -0
  56. package/lib-types/components/table/elm-table-row.d.ts +2 -0
  57. package/lib-types/components/table/elm-table.d.ts +13 -0
  58. package/lib-types/components/table/elm-table.stories.d.ts +6 -0
  59. package/lib-types/components/typography/elm-block-quote.d.ts +4 -0
  60. package/lib-types/components/typography/elm-block-quote.stories.d.ts +6 -0
  61. package/lib-types/components/typography/elm-callout.d.ts +8 -0
  62. package/lib-types/components/typography/elm-callout.stories.d.ts +10 -0
  63. package/lib-types/components/typography/elm-divider.d.ts +8 -0
  64. package/lib-types/components/typography/elm-divider.stories.d.ts +6 -0
  65. package/lib-types/components/typography/elm-fragment-identifier.d.ts +7 -0
  66. package/lib-types/components/typography/elm-fragment-identifier.stories.d.ts +6 -0
  67. package/lib-types/components/typography/elm-heading.d.ts +6 -0
  68. package/lib-types/components/typography/elm-heading.stories.d.ts +7 -0
  69. package/lib-types/components/typography/elm-inline-text.d.ts +54 -0
  70. package/lib-types/components/typography/elm-inline-text.stories.d.ts +13 -0
  71. package/lib-types/components/typography/elm-list.d.ts +4 -0
  72. package/lib-types/components/typography/elm-list.stories.d.ts +8 -0
  73. package/lib-types/components/typography/elm-paragraph.d.ts +5 -0
  74. package/lib-types/components/typography/elm-paragraph.stories.d.ts +9 -0
  75. package/lib-types/entry.dev.d.ts +2 -0
  76. package/{src/entry.ssr.tsx → lib-types/entry.ssr.d.ts} +2 -9
  77. package/lib-types/hooks/useDelayedSignal.d.ts +6 -0
  78. package/lib-types/hooks/useInView.d.ts +6 -0
  79. package/lib-types/index.d.ts +27 -0
  80. package/lib-types/root.d.ts +2 -0
  81. package/package.json +5 -1
  82. package/.prettierignore +0 -6
  83. package/.storybook/main.ts +0 -23
  84. package/.storybook/preview-head.html +0 -4
  85. package/.storybook/preview.tsx +0 -51
  86. package/.storybook/sb.scss +0 -13
  87. package/.storybook/tsconfig.json +0 -24
  88. package/eslint.config.js +0 -79
  89. package/src/assets/bg1.webp +0 -0
  90. package/src/assets/bg2.webp +0 -0
  91. package/src/assets/images/2.svg +0 -4
  92. package/src/assets/images/lamdscape.svg +0 -4
  93. package/src/assets/images/portrait.svg +0 -4
  94. package/src/assets/images/square.svg +0 -4
  95. package/src/assets/vite.svg +0 -1
  96. package/src/assets/vue.svg +0 -1
  97. package/src/components/code/elm-code-block.module.scss +0 -67
  98. package/src/components/code/elm-code-block.stories.tsx +0 -44
  99. package/src/components/code/elm-code-block.tsx +0 -95
  100. package/src/components/code/elm-katex.stories.tsx +0 -28
  101. package/src/components/code/elm-katex.tsx +0 -34
  102. package/src/components/code/elm-shiki-highlighter.global.scss +0 -18
  103. package/src/components/code/elm-shiki-highlighter.stories.tsx +0 -21
  104. package/src/components/code/elm-shiki-highlighter.tsx +0 -44
  105. package/src/components/code/seed/main.rs +0 -24
  106. package/src/components/containments/elm-toggle.module.scss +0 -132
  107. package/src/components/containments/elm-toggle.stories.tsx +0 -34
  108. package/src/components/containments/elm-toggle.tsx +0 -106
  109. package/src/components/fallback/elm-block-fallback.module.scss +0 -8
  110. package/src/components/fallback/elm-block-fallback.stories.tsx +0 -14
  111. package/src/components/fallback/elm-block-fallback.tsx +0 -20
  112. package/src/components/fallback/elm-rectangle-wave.module.scss +0 -42
  113. package/src/components/fallback/elm-rectangle-wave.stories.tsx +0 -28
  114. package/src/components/fallback/elm-rectangle-wave.tsx +0 -11
  115. package/src/components/icon/elm-dot-loading-icon.module.scss +0 -53
  116. package/src/components/icon/elm-dot-loading-icon.stories.tsx +0 -15
  117. package/src/components/icon/elm-dot-loading-icon.tsx +0 -35
  118. package/src/components/icon/elm-inline-icon.module.scss +0 -21
  119. package/src/components/icon/elm-inline-icon.stories.tsx +0 -16
  120. package/src/components/icon/elm-inline-icon.tsx +0 -25
  121. package/src/components/icon/elm-language-icon.stories.tsx +0 -22
  122. package/src/components/icon/elm-language-icon.tsx +0 -167
  123. package/src/components/icon/elm-mdi-icon.module.scss +0 -8
  124. package/src/components/icon/elm-mdi-icon.stories.tsx +0 -25
  125. package/src/components/icon/elm-mdi-icon.tsx +0 -34
  126. package/src/components/icon/languages/bash.module.scss +0 -6
  127. package/src/components/icon/languages/bash.tsx +0 -27
  128. package/src/components/icon/languages/c-plus-plus.tsx +0 -33
  129. package/src/components/icon/languages/c-sharp.tsx +0 -29
  130. package/src/components/icon/languages/c.tsx +0 -27
  131. package/src/components/icon/languages/css.tsx +0 -21
  132. package/src/components/icon/languages/go.tsx +0 -22
  133. package/src/components/icon/languages/html.tsx +0 -30
  134. package/src/components/icon/languages/java.tsx +0 -37
  135. package/src/components/icon/languages/javascript.tsx +0 -22
  136. package/src/components/icon/languages/json.tsx +0 -53
  137. package/src/components/icon/languages/kotlin.tsx +0 -36
  138. package/src/components/icon/languages/language-interface.ts +0 -4
  139. package/src/components/icon/languages/lua.tsx +0 -29
  140. package/src/components/icon/languages/npm.tsx +0 -25
  141. package/src/components/icon/languages/python.tsx +0 -67
  142. package/src/components/icon/languages/rust.tsx +0 -19
  143. package/src/components/icon/languages/sql.tsx +0 -21
  144. package/src/components/icon/languages/terraform.tsx +0 -31
  145. package/src/components/icon/languages/typescript.tsx +0 -22
  146. package/src/components/media/elm-block-image.module.scss +0 -68
  147. package/src/components/media/elm-block-image.stories.tsx +0 -79
  148. package/src/components/media/elm-block-image.tsx +0 -110
  149. package/src/components/media/elm-file.module.scss +0 -43
  150. package/src/components/media/elm-file.stories.tsx +0 -27
  151. package/src/components/media/elm-file.tsx +0 -75
  152. package/src/components/navigation/elm-bookmark.module.scss +0 -100
  153. package/src/components/navigation/elm-bookmark.stories.tsx +0 -87
  154. package/src/components/navigation/elm-bookmark.tsx +0 -72
  155. package/src/components/others/elm-jarkup.module.scss +0 -26
  156. package/src/components/others/elm-jarkup.stories.tsx +0 -18
  157. package/src/components/others/elm-jarkup.tsx +0 -267
  158. package/src/components/table/elm-table-body.tsx +0 -14
  159. package/src/components/table/elm-table-cell.module.scss +0 -41
  160. package/src/components/table/elm-table-cell.tsx +0 -33
  161. package/src/components/table/elm-table-header.module.scss +0 -8
  162. package/src/components/table/elm-table-header.tsx +0 -21
  163. package/src/components/table/elm-table-row.module.scss +0 -28
  164. package/src/components/table/elm-table-row.tsx +0 -15
  165. package/src/components/table/elm-table.module.scss +0 -29
  166. package/src/components/table/elm-table.stories.tsx +0 -67
  167. package/src/components/table/elm-table.tsx +0 -63
  168. package/src/components/typography/elm-block-quote.module.scss +0 -29
  169. package/src/components/typography/elm-block-quote.stories.tsx +0 -22
  170. package/src/components/typography/elm-block-quote.tsx +0 -34
  171. package/src/components/typography/elm-callout.module.scss +0 -36
  172. package/src/components/typography/elm-callout.stories.tsx +0 -47
  173. package/src/components/typography/elm-callout.tsx +0 -52
  174. package/src/components/typography/elm-divider.module.scss +0 -6
  175. package/src/components/typography/elm-divider.stories.tsx +0 -14
  176. package/src/components/typography/elm-divider.tsx +0 -14
  177. package/src/components/typography/elm-fragment-identifier.module.scss +0 -28
  178. package/src/components/typography/elm-fragment-identifier.stories.tsx +0 -14
  179. package/src/components/typography/elm-fragment-identifier.tsx +0 -31
  180. package/src/components/typography/elm-heading.module.scss +0 -120
  181. package/src/components/typography/elm-heading.stories.tsx +0 -42
  182. package/src/components/typography/elm-heading.tsx +0 -40
  183. package/src/components/typography/elm-inline-text.module.scss +0 -114
  184. package/src/components/typography/elm-inline-text.stories.tsx +0 -70
  185. package/src/components/typography/elm-inline-text.tsx +0 -147
  186. package/src/components/typography/elm-list.global.scss +0 -66
  187. package/src/components/typography/elm-list.stories.tsx +0 -61
  188. package/src/components/typography/elm-list.tsx +0 -39
  189. package/src/components/typography/elm-paragraph.module.scss +0 -21
  190. package/src/components/typography/elm-paragraph.stories.tsx +0 -47
  191. package/src/components/typography/elm-paragraph.tsx +0 -31
  192. package/src/entry.dev.tsx +0 -17
  193. package/src/global.d.ts +0 -13
  194. package/src/hooks/useDelayedSignal.ts +0 -27
  195. package/src/hooks/useInView.tsx +0 -23
  196. package/src/index.ts +0 -113
  197. package/src/root.tsx +0 -13
  198. package/src/styles/text.module.scss +0 -17
  199. package/src/vite-env.d.ts +0 -1
  200. package/tsconfig.json +0 -21
  201. package/vite.config.ts +0 -36
  202. /package/{src/components/table/index.ts → lib-types/components/table/index.d.ts} +0 -0
@@ -1,68 +0,0 @@
1
- .block-image {
2
- margin: 0;
3
- display: flex;
4
- justify-content: center;
5
- align-items: center;
6
- flex-direction: column;
7
- gap: 0.5rem;
8
- width: 100%;
9
- }
10
-
11
- .image-container {
12
- width: 100%;
13
- height: 100%;
14
- position: relative;
15
-
16
- display: flex;
17
- justify-content: center;
18
- align-items: center;
19
- }
20
-
21
- .image {
22
- max-width: 100%;
23
- max-height: 100%;
24
- border-radius: 0.25rem;
25
- box-shadow: 0 0 0.125rem rgba(black, 0.1);
26
- transition: opacity 400ms;
27
- opacity: var(--opacity, 1);
28
- user-select: none;
29
-
30
- cursor: var(--cursor);
31
- }
32
-
33
- .fallback {
34
- width: 100%;
35
- height: 100%;
36
- inset: 0 0 auto auto;
37
- position: absolute;
38
- transition: opacity 400ms;
39
- opacity: var(--opacity, 1);
40
- pointer-events: none;
41
- }
42
-
43
- .caption-box {
44
- box-sizing: border-box;
45
- padding: 0rem 1rem;
46
- display: flex;
47
- justify-content: center;
48
- align-items: center;
49
- gap: 1rem;
50
- opacity: 0.75;
51
- opacity: var(--opacity, 1);
52
- transition: opacity 400ms;
53
- }
54
-
55
- .modal-container {
56
- width: 100vw;
57
- height: 100vh;
58
- display: flex;
59
- justify-content: center;
60
- align-items: center;
61
- position: fixed;
62
- inset: 0 0 auto auto;
63
- z-index: 100;
64
- background-color: rgba(#23262a, 0.8);
65
- cursor: zoom-out;
66
- opacity: var(--opacity, 1);
67
- transition: opacity 200ms;
68
- }
@@ -1,79 +0,0 @@
1
- import type { Meta, StoryObj } from "storybook-framework-qwik";
2
- import { ElmBlockImage } from "./elm-block-image";
3
-
4
- import landscape from "../../assets/images/lamdscape.svg?url";
5
- import portrait from "../../assets/images/portrait.svg?url";
6
- import square from "../../assets/images/square.svg?url";
7
-
8
- const meta: Meta<typeof ElmBlockImage> = {
9
- title: "Components/Media/elm-block-image",
10
- component: ElmBlockImage,
11
- tags: ["autodocs"],
12
- args: {
13
- src: "https://images.unsplash.com/photo-1556983703-27576e5afa24?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb",
14
- block: true,
15
- enableModal: true,
16
- },
17
- };
18
-
19
- export default meta;
20
- type Story = StoryObj<typeof meta>;
21
-
22
- export const Primary: Story = {
23
- render() {
24
- return (
25
- <>
26
- <ElmBlockImage {...this.args} />
27
- <div>Some text below the image to demonstrate block display.</div>
28
- </>
29
- );
30
- },
31
- };
32
-
33
- export const Svg: Story = {
34
- args: {
35
- src: "https://nuxt.com/cdn-cgi/image/w=1024,h=878/assets/landing/deploy.svg",
36
- alt: "Deploy your app anywhere",
37
- },
38
- };
39
-
40
- export const LongAlt: Story = {
41
- args: {
42
- src: "https://www.ikuma.cloud/api/v2/blog/leather-shoes-painting/og-image?lang=en",
43
- caption:
44
- "One-command deployments and zero-configuration options make it easy to get your Nuxt app live. Choose your platform, and let Nuxt handle the rest, allowing you to focus on building great applications rather than managing complex deployments.",
45
- },
46
- };
47
-
48
- export const Invalid: Story = {
49
- args: {
50
- src: "invalid",
51
- },
52
- };
53
-
54
- export const Landscape: Story = {
55
- args: {
56
- src: landscape,
57
- caption: "A landscape image",
58
- width: 400,
59
- height: 100,
60
- },
61
- };
62
-
63
- export const Portrait: Story = {
64
- args: {
65
- src: portrait,
66
- caption: "A portrait image",
67
- width: 100,
68
- height: 200,
69
- },
70
- };
71
-
72
- export const Square: Story = {
73
- args: {
74
- src: square,
75
- caption: "A square image",
76
- width: 200,
77
- height: 200,
78
- },
79
- };
@@ -1,110 +0,0 @@
1
- import { $, component$, useSignal, type Numberish } from "@builder.io/qwik";
2
-
3
- import styles from "./elm-block-image.module.scss";
4
- import { ElmInlineText } from "../typography/elm-inline-text";
5
- import { ElmMdiIcon } from "../icon/elm-mdi-icon";
6
- import { ElmRectangleWave } from "../fallback/elm-rectangle-wave";
7
- import { mdiMessageImageOutline } from "@mdi/js";
8
-
9
- export interface ElmBlockImageProps {
10
- /**
11
- * Image source URL
12
- */
13
- src: string;
14
-
15
- /**
16
- * Image alt text
17
- */
18
- alt?: string;
19
-
20
- enableModal?: boolean;
21
-
22
- caption?: string;
23
-
24
- width?: Numberish;
25
-
26
- height?: Numberish;
27
- }
28
-
29
- export const ElmBlockImage = component$<ElmBlockImageProps>(
30
- ({ src, alt, caption, width, height, enableModal = true }) => {
31
- const isLoading = useSignal(true);
32
- const isShowModal = useSignal(false);
33
-
34
- const handleImageLoad = $(() => {
35
- isLoading.value = false;
36
- });
37
-
38
- const handleToggleModal = $(() => {
39
- if (enableModal) {
40
- isShowModal.value = !isShowModal.value;
41
- }
42
- });
43
-
44
- const ImageComponent = (
45
- <img
46
- class={[styles.image]}
47
- src={src}
48
- alt={alt ?? caption ?? "Image"}
49
- width={width}
50
- height={height}
51
- onLoad$={handleImageLoad}
52
- style={{
53
- "--opacity": isLoading.value ? 0 : 1,
54
- "--cursor": enableModal
55
- ? isShowModal.value
56
- ? "zoom-out"
57
- : "zoom-in"
58
- : "default",
59
- }}
60
- />
61
- );
62
-
63
- const Modal = (
64
- <div
65
- class={styles["modal-container"]}
66
- style={{
67
- pointerEvents: isShowModal.value ? "auto" : "none",
68
- "--opacity": isShowModal.value ? 1 : 0,
69
- }}
70
- onClick$={handleToggleModal}
71
- >
72
- {ImageComponent}
73
- </div>
74
- );
75
-
76
- return (
77
- <figure class={styles["block-image"]}>
78
- <div
79
- class={styles["image-container"]}
80
- style={{ "--opacity": isLoading.value ? 1 : 0 }}
81
- onClick$={handleToggleModal}
82
- >
83
- {ImageComponent}
84
-
85
- <div class={styles["fallback"]}>
86
- <ElmRectangleWave />
87
- </div>
88
- </div>
89
-
90
- {caption && (
91
- <figcaption
92
- class={styles["caption-box"]}
93
- style={{ "--opacity": isLoading.value ? 0 : 1 }}
94
- >
95
- <span style={{ flex: "1" }}>
96
- <ElmMdiIcon
97
- d={mdiMessageImageOutline}
98
- color="#cdb57b"
99
- size="1.25rem"
100
- />
101
- </span>
102
- <ElmInlineText size="1rem">{caption}</ElmInlineText>
103
- </figcaption>
104
- )}
105
-
106
- {Modal}
107
- </figure>
108
- );
109
- },
110
- );
@@ -1,43 +0,0 @@
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
- }
@@ -1,27 +0,0 @@
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
- };
@@ -1,75 +0,0 @@
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
- });
@@ -1,100 +0,0 @@
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
- }
@@ -1,87 +0,0 @@
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
- };
@@ -1,72 +0,0 @@
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
- );
@@ -1,26 +0,0 @@
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
- }
@@ -1,18 +0,0 @@
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 = {};