@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.
Files changed (271) hide show
  1. package/.prettierignore +6 -0
  2. package/.storybook/main.ts +23 -0
  3. package/.storybook/preview-head.html +4 -0
  4. package/.storybook/preview.tsx +51 -0
  5. package/.storybook/sb.scss +13 -0
  6. package/.storybook/tsconfig.json +24 -0
  7. package/eslint.config.js +79 -0
  8. package/package.json +5 -8
  9. package/src/assets/bg1.webp +0 -0
  10. package/src/assets/bg2.webp +0 -0
  11. package/src/assets/images/2.svg +4 -0
  12. package/src/assets/images/lamdscape.svg +4 -0
  13. package/src/assets/images/portrait.svg +4 -0
  14. package/src/assets/images/square.svg +4 -0
  15. package/src/assets/vite.svg +1 -0
  16. package/src/assets/vue.svg +1 -0
  17. package/src/components/code/elm-code-block.module.scss +67 -0
  18. package/src/components/code/elm-code-block.stories.tsx +44 -0
  19. package/src/components/code/elm-code-block.tsx +95 -0
  20. package/src/components/code/elm-katex.stories.tsx +28 -0
  21. package/src/components/code/elm-katex.tsx +34 -0
  22. package/src/components/code/elm-shiki-highlighter.global.scss +18 -0
  23. package/src/components/code/elm-shiki-highlighter.stories.tsx +21 -0
  24. package/src/components/code/elm-shiki-highlighter.tsx +44 -0
  25. package/src/components/code/seed/main.rs +24 -0
  26. package/{lib/qwik31.js → src/components/code/shikiInstance.ts} +8 -11
  27. package/src/components/containments/elm-toggle.module.scss +132 -0
  28. package/src/components/containments/elm-toggle.stories.tsx +34 -0
  29. package/src/components/containments/elm-toggle.tsx +106 -0
  30. package/src/components/fallback/elm-block-fallback.module.scss +8 -0
  31. package/src/components/fallback/elm-block-fallback.stories.tsx +14 -0
  32. package/src/components/fallback/elm-block-fallback.tsx +20 -0
  33. package/src/components/fallback/elm-rectangle-wave.module.scss +42 -0
  34. package/src/components/fallback/elm-rectangle-wave.stories.tsx +28 -0
  35. package/src/components/fallback/elm-rectangle-wave.tsx +11 -0
  36. package/src/components/icon/elm-dot-loading-icon.module.scss +53 -0
  37. package/src/components/icon/elm-dot-loading-icon.stories.tsx +15 -0
  38. package/src/components/icon/elm-dot-loading-icon.tsx +35 -0
  39. package/src/components/icon/elm-inline-icon.module.scss +21 -0
  40. package/src/components/icon/elm-inline-icon.stories.tsx +16 -0
  41. package/src/components/icon/elm-inline-icon.tsx +25 -0
  42. package/src/components/icon/elm-language-icon.stories.tsx +22 -0
  43. package/src/components/icon/elm-language-icon.tsx +167 -0
  44. package/src/components/icon/elm-mdi-icon.module.scss +8 -0
  45. package/src/components/icon/elm-mdi-icon.stories.tsx +25 -0
  46. package/src/components/icon/elm-mdi-icon.tsx +34 -0
  47. package/src/components/icon/languages/bash.module.scss +6 -0
  48. package/src/components/icon/languages/bash.tsx +27 -0
  49. package/src/components/icon/languages/c-plus-plus.tsx +33 -0
  50. package/src/components/icon/languages/c-sharp.tsx +29 -0
  51. package/src/components/icon/languages/c.tsx +27 -0
  52. package/src/components/icon/languages/css.tsx +21 -0
  53. package/src/components/icon/languages/go.tsx +22 -0
  54. package/src/components/icon/languages/html.tsx +30 -0
  55. package/src/components/icon/languages/java.tsx +37 -0
  56. package/src/components/icon/languages/javascript.tsx +22 -0
  57. package/src/components/icon/languages/json.tsx +53 -0
  58. package/src/components/icon/languages/kotlin.tsx +36 -0
  59. package/src/components/icon/languages/language-interface.ts +4 -0
  60. package/src/components/icon/languages/lua.tsx +29 -0
  61. package/src/components/icon/languages/npm.tsx +25 -0
  62. package/src/components/icon/languages/python.tsx +67 -0
  63. package/src/components/icon/languages/rust.tsx +19 -0
  64. package/src/components/icon/languages/sql.tsx +21 -0
  65. package/src/components/icon/languages/terraform.tsx +31 -0
  66. package/src/components/icon/languages/typescript.tsx +22 -0
  67. package/src/components/media/elm-block-image.module.scss +68 -0
  68. package/src/components/media/elm-block-image.stories.tsx +79 -0
  69. package/src/components/media/elm-block-image.tsx +110 -0
  70. package/src/components/media/elm-file.module.scss +43 -0
  71. package/src/components/media/elm-file.stories.tsx +27 -0
  72. package/src/components/media/elm-file.tsx +75 -0
  73. package/src/components/navigation/elm-bookmark.module.scss +100 -0
  74. package/src/components/navigation/elm-bookmark.stories.tsx +87 -0
  75. package/src/components/navigation/elm-bookmark.tsx +72 -0
  76. package/src/components/others/elm-jarkup.module.scss +26 -0
  77. package/src/components/others/elm-jarkup.stories.tsx +18 -0
  78. package/src/components/others/elm-jarkup.tsx +267 -0
  79. package/src/components/table/elm-table-body.tsx +14 -0
  80. package/src/components/table/elm-table-cell.module.scss +41 -0
  81. package/src/components/table/elm-table-cell.tsx +33 -0
  82. package/src/components/table/elm-table-header.module.scss +8 -0
  83. package/src/components/table/elm-table-header.tsx +21 -0
  84. package/src/components/table/elm-table-row.module.scss +28 -0
  85. package/src/components/table/elm-table-row.tsx +15 -0
  86. package/src/components/table/elm-table.module.scss +29 -0
  87. package/src/components/table/elm-table.stories.tsx +67 -0
  88. package/src/components/table/elm-table.tsx +63 -0
  89. package/src/components/typography/elm-block-quote.module.scss +29 -0
  90. package/src/components/typography/elm-block-quote.stories.tsx +22 -0
  91. package/src/components/typography/elm-block-quote.tsx +34 -0
  92. package/src/components/typography/elm-callout.module.scss +36 -0
  93. package/src/components/typography/elm-callout.stories.tsx +47 -0
  94. package/src/components/typography/elm-callout.tsx +52 -0
  95. package/src/components/typography/elm-divider.module.scss +6 -0
  96. package/src/components/typography/elm-divider.stories.tsx +14 -0
  97. package/src/components/typography/elm-divider.tsx +14 -0
  98. package/src/components/typography/elm-fragment-identifier.module.scss +28 -0
  99. package/src/components/typography/elm-fragment-identifier.stories.tsx +14 -0
  100. package/src/components/typography/elm-fragment-identifier.tsx +31 -0
  101. package/src/components/typography/elm-heading.module.scss +120 -0
  102. package/src/components/typography/elm-heading.stories.tsx +42 -0
  103. package/src/components/typography/elm-heading.tsx +40 -0
  104. package/src/components/typography/elm-inline-text.module.scss +114 -0
  105. package/src/components/typography/elm-inline-text.stories.tsx +70 -0
  106. package/src/components/typography/elm-inline-text.tsx +147 -0
  107. package/src/components/typography/elm-list.global.scss +66 -0
  108. package/src/components/typography/elm-list.stories.tsx +61 -0
  109. package/src/components/typography/elm-list.tsx +39 -0
  110. package/src/components/typography/elm-paragraph.module.scss +21 -0
  111. package/src/components/typography/elm-paragraph.stories.tsx +47 -0
  112. package/src/components/typography/elm-paragraph.tsx +31 -0
  113. package/src/entry.dev.tsx +17 -0
  114. package/{lib-types/entry.ssr.d.ts → src/entry.ssr.tsx} +9 -2
  115. package/src/global.d.ts +13 -0
  116. package/src/hooks/useDelayedSignal.ts +27 -0
  117. package/src/hooks/useInView.tsx +23 -0
  118. package/src/index.ts +113 -0
  119. package/src/root.tsx +13 -0
  120. package/src/styles/text.module.scss +17 -0
  121. package/src/vite-env.d.ts +1 -0
  122. package/tsconfig.json +21 -0
  123. package/vite.config.ts +36 -0
  124. package/lib/assets/6FDiDjPb-qwik.css +0 -955
  125. package/lib/qwik.js +0 -56
  126. package/lib/qwik10.js +0 -108
  127. package/lib/qwik11.js +0 -25
  128. package/lib/qwik12.js +0 -87
  129. package/lib/qwik13.js +0 -62
  130. package/lib/qwik14.js +0 -62
  131. package/lib/qwik15.js +0 -44
  132. package/lib/qwik16.js +0 -58
  133. package/lib/qwik17.js +0 -14
  134. package/lib/qwik18.js +0 -24
  135. package/lib/qwik19.js +0 -41
  136. package/lib/qwik2.js +0 -68
  137. package/lib/qwik20.js +0 -89
  138. package/lib/qwik21.js +0 -28
  139. package/lib/qwik22.js +0 -24
  140. package/lib/qwik23.js +0 -57
  141. package/lib/qwik24.js +0 -15
  142. package/lib/qwik25.js +0 -12
  143. package/lib/qwik26.js +0 -17
  144. package/lib/qwik27.js +0 -27
  145. package/lib/qwik28.js +0 -193
  146. package/lib/qwik29.js +0 -17
  147. package/lib/qwik3.js +0 -17
  148. package/lib/qwik30.js +0 -8
  149. package/lib/qwik33.js +0 -32
  150. package/lib/qwik34.js +0 -6
  151. package/lib/qwik35.js +0 -6
  152. package/lib/qwik36.js +0 -11
  153. package/lib/qwik37.js +0 -8
  154. package/lib/qwik38.js +0 -18
  155. package/lib/qwik39.js +0 -24
  156. package/lib/qwik4.js +0 -33
  157. package/lib/qwik40.js +0 -24
  158. package/lib/qwik41.js +0 -29
  159. package/lib/qwik42.js +0 -31
  160. package/lib/qwik43.js +0 -32
  161. package/lib/qwik44.js +0 -18
  162. package/lib/qwik45.js +0 -24
  163. package/lib/qwik46.js +0 -36
  164. package/lib/qwik47.js +0 -45
  165. package/lib/qwik48.js +0 -27
  166. package/lib/qwik49.js +0 -89
  167. package/lib/qwik5.js +0 -123
  168. package/lib/qwik50.js +0 -18
  169. package/lib/qwik51.js +0 -64
  170. package/lib/qwik52.js +0 -28
  171. package/lib/qwik53.js +0 -28
  172. package/lib/qwik54.js +0 -32
  173. package/lib/qwik55.js +0 -28
  174. package/lib/qwik56.js +0 -8
  175. package/lib/qwik57.js +0 -15
  176. package/lib/qwik58.js +0 -10
  177. package/lib/qwik59.js +0 -26
  178. package/lib/qwik6.js +0 -20
  179. package/lib/qwik60.js +0 -14
  180. package/lib/qwik61.js +0 -14
  181. package/lib/qwik62.js +0 -8
  182. package/lib/qwik63.js +0 -8
  183. package/lib/qwik64.js +0 -24
  184. package/lib/qwik65.js +0 -17
  185. package/lib/qwik67.js +0 -8
  186. package/lib/qwik68.js +0 -23
  187. package/lib/qwik69.js +0 -15
  188. package/lib/qwik7.js +0 -12
  189. package/lib/qwik70.js +0 -8
  190. package/lib/qwik71.js +0 -9
  191. package/lib/qwik72.js +0 -14
  192. package/lib/qwik73.js +0 -10
  193. package/lib/qwik74.js +0 -8
  194. package/lib/qwik8.js +0 -29
  195. package/lib/qwik9.js +0 -16
  196. package/lib-types/components/code/elm-code-block.d.ts +0 -21
  197. package/lib-types/components/code/elm-code-block.stories.d.ts +0 -9
  198. package/lib-types/components/code/elm-katex.d.ts +0 -15
  199. package/lib-types/components/code/elm-katex.stories.d.ts +0 -8
  200. package/lib-types/components/code/elm-shiki-highlighter.d.ts +0 -12
  201. package/lib-types/components/code/elm-shiki-highlighter.stories.d.ts +0 -6
  202. package/lib-types/components/code/shikiInstance.d.ts +0 -2
  203. package/lib-types/components/containments/elm-toggle.d.ts +0 -7
  204. package/lib-types/components/containments/elm-toggle.stories.d.ts +0 -6
  205. package/lib-types/components/fallback/elm-block-fallback.d.ts +0 -5
  206. package/lib-types/components/fallback/elm-block-fallback.stories.d.ts +0 -6
  207. package/lib-types/components/fallback/elm-rectangle-wave.d.ts +0 -4
  208. package/lib-types/components/fallback/elm-rectangle-wave.stories.d.ts +0 -6
  209. package/lib-types/components/icon/elm-dot-loading-icon.d.ts +0 -14
  210. package/lib-types/components/icon/elm-dot-loading-icon.stories.d.ts +0 -6
  211. package/lib-types/components/icon/elm-inline-icon.d.ts +0 -11
  212. package/lib-types/components/icon/elm-inline-icon.stories.d.ts +0 -6
  213. package/lib-types/components/icon/elm-language-icon.d.ts +0 -14
  214. package/lib-types/components/icon/elm-language-icon.stories.d.ts +0 -6
  215. package/lib-types/components/icon/elm-mdi-icon.d.ts +0 -8
  216. package/lib-types/components/icon/elm-mdi-icon.stories.d.ts +0 -6
  217. package/lib-types/components/icon/languages/bash.d.ts +0 -2
  218. package/lib-types/components/icon/languages/c-plus-plus.d.ts +0 -2
  219. package/lib-types/components/icon/languages/c-sharp.d.ts +0 -2
  220. package/lib-types/components/icon/languages/c.d.ts +0 -2
  221. package/lib-types/components/icon/languages/css.d.ts +0 -2
  222. package/lib-types/components/icon/languages/go.d.ts +0 -2
  223. package/lib-types/components/icon/languages/html.d.ts +0 -2
  224. package/lib-types/components/icon/languages/java.d.ts +0 -2
  225. package/lib-types/components/icon/languages/javascript.d.ts +0 -2
  226. package/lib-types/components/icon/languages/json.d.ts +0 -2
  227. package/lib-types/components/icon/languages/kotlin.d.ts +0 -2
  228. package/lib-types/components/icon/languages/language-interface.d.ts +0 -4
  229. package/lib-types/components/icon/languages/lua.d.ts +0 -2
  230. package/lib-types/components/icon/languages/npm.d.ts +0 -2
  231. package/lib-types/components/icon/languages/python.d.ts +0 -2
  232. package/lib-types/components/icon/languages/rust.d.ts +0 -2
  233. package/lib-types/components/icon/languages/sql.d.ts +0 -2
  234. package/lib-types/components/icon/languages/terraform.d.ts +0 -2
  235. package/lib-types/components/icon/languages/typescript.d.ts +0 -2
  236. package/lib-types/components/media/elm-block-image.d.ts +0 -16
  237. package/lib-types/components/media/elm-block-image.stories.d.ts +0 -12
  238. package/lib-types/components/media/elm-file.d.ts +0 -15
  239. package/lib-types/components/media/elm-file.stories.d.ts +0 -7
  240. package/lib-types/components/navigation/elm-bookmark.d.ts +0 -24
  241. package/lib-types/components/navigation/elm-bookmark.stories.d.ts +0 -12
  242. package/lib-types/components/others/elm-jarkup.d.ts +0 -5
  243. package/lib-types/components/others/elm-jarkup.stories.d.ts +0 -6
  244. package/lib-types/components/table/elm-table-body.d.ts +0 -2
  245. package/lib-types/components/table/elm-table-cell.d.ts +0 -12
  246. package/lib-types/components/table/elm-table-header.d.ts +0 -3
  247. package/lib-types/components/table/elm-table-row.d.ts +0 -2
  248. package/lib-types/components/table/elm-table.d.ts +0 -13
  249. package/lib-types/components/table/elm-table.stories.d.ts +0 -6
  250. package/lib-types/components/typography/elm-block-quote.d.ts +0 -4
  251. package/lib-types/components/typography/elm-block-quote.stories.d.ts +0 -6
  252. package/lib-types/components/typography/elm-callout.d.ts +0 -8
  253. package/lib-types/components/typography/elm-callout.stories.d.ts +0 -10
  254. package/lib-types/components/typography/elm-divider.d.ts +0 -8
  255. package/lib-types/components/typography/elm-divider.stories.d.ts +0 -6
  256. package/lib-types/components/typography/elm-fragment-identifier.d.ts +0 -7
  257. package/lib-types/components/typography/elm-fragment-identifier.stories.d.ts +0 -6
  258. package/lib-types/components/typography/elm-heading.d.ts +0 -6
  259. package/lib-types/components/typography/elm-heading.stories.d.ts +0 -7
  260. package/lib-types/components/typography/elm-inline-text.d.ts +0 -54
  261. package/lib-types/components/typography/elm-inline-text.stories.d.ts +0 -13
  262. package/lib-types/components/typography/elm-list.d.ts +0 -5
  263. package/lib-types/components/typography/elm-list.stories.d.ts +0 -8
  264. package/lib-types/components/typography/elm-paragraph.d.ts +0 -5
  265. package/lib-types/components/typography/elm-paragraph.stories.d.ts +0 -9
  266. package/lib-types/entry.dev.d.ts +0 -2
  267. package/lib-types/hooks/useDelayedSignal.d.ts +0 -6
  268. package/lib-types/hooks/useInView.d.ts +0 -6
  269. package/lib-types/index.d.ts +0 -27
  270. package/lib-types/root.d.ts +0 -2
  271. /package/{lib-types/components/table/index.d.ts → src/components/table/index.ts} +0 -0
@@ -0,0 +1,147 @@
1
+ import { component$, Slot, type CSSProperties } from "@builder.io/qwik";
2
+
3
+ import styles from "./elm-inline-text.module.scss";
4
+ import textStyles from "../../styles/text.module.scss";
5
+
6
+ import { ElmInlineIcon } from "../icon/elm-inline-icon";
7
+
8
+ export interface ElmInlineTextProps {
9
+ /**
10
+ * The text to display.
11
+ */
12
+ text?: string;
13
+
14
+ /**
15
+ * Specifies the color of the text.
16
+ *
17
+ * e.g.) `'red'`, `'#ff0000'`, `'rgba(255, 0, 0, 0.5)'`
18
+ */
19
+ color?: CSSProperties["color"];
20
+
21
+ /**
22
+ * Specifies the font size of the text.
23
+ */
24
+ size?: CSSProperties["fontSize"];
25
+
26
+ /**
27
+ * Specifies whether the text should be bold.
28
+ */
29
+ bold?: boolean;
30
+
31
+ /**
32
+ * Specifies whether the text should be italic.
33
+ */
34
+ italic?: boolean;
35
+
36
+ /**
37
+ * Specifies whether the text should be underlined.
38
+ */
39
+ underline?: boolean;
40
+
41
+ /**
42
+ * Specifies whether the text should be strikethrough.
43
+ */
44
+ strikethrough?: boolean;
45
+
46
+ /**
47
+ * Specifies whether the text should be displayed as code.
48
+ */
49
+ code?: boolean;
50
+
51
+ kbd?: boolean;
52
+
53
+ /**
54
+ * Specifies the background color of the text.
55
+ */
56
+ backgroundColor?: CSSProperties["backgroundColor"];
57
+
58
+ /**
59
+ * The ruby text to display.
60
+ */
61
+ ruby?: string;
62
+
63
+ /**
64
+ * The URL to navigate to.
65
+ *
66
+ * e.g. `https://example.com`
67
+ */
68
+ href?: string;
69
+
70
+ favicon?: string;
71
+ }
72
+
73
+ export const ElmInlineText = component$<ElmInlineTextProps>((props) => {
74
+ const {
75
+ bold = false,
76
+ italic = false,
77
+ underline = false,
78
+ strikethrough = false,
79
+ code = false,
80
+ size = "1em",
81
+ } = props;
82
+
83
+ let vnode = props.text ? <span>{props.text}</span> : <Slot />;
84
+
85
+ if (props.kbd) {
86
+ vnode = <kbd class={styles.kbd}>{vnode}</kbd>;
87
+ }
88
+
89
+ if (strikethrough) {
90
+ vnode = <del>{vnode}</del>;
91
+ }
92
+
93
+ if (italic) {
94
+ vnode = <em>{vnode}</em>;
95
+ }
96
+
97
+ if (underline) {
98
+ vnode = <ins>{vnode}</ins>;
99
+ }
100
+
101
+ if (bold) {
102
+ vnode = <strong>{vnode}</strong>;
103
+ }
104
+
105
+ if (code) {
106
+ vnode = <code class={styles.code}>{vnode}</code>;
107
+ }
108
+
109
+ if (props.ruby) {
110
+ vnode = (
111
+ <ruby class={styles.text}>
112
+ <span>{vnode}</span>
113
+ <rt>{props.ruby}</rt>
114
+ </ruby>
115
+ );
116
+ }
117
+
118
+ const wrappedVnode = (
119
+ <span
120
+ class={[styles.text, textStyles.text]}
121
+ style={{
122
+ "--color": props.color,
123
+ "--font-size": size,
124
+ "--background-color": props.backgroundColor,
125
+ }}
126
+ >
127
+ {vnode}
128
+ </span>
129
+ );
130
+
131
+ if (props.href) {
132
+ return (
133
+ <a
134
+ class={styles.link}
135
+ href={props.href}
136
+ style={{ "--font-size": size }}
137
+ target="_blank"
138
+ rel="noopener noreferrer"
139
+ >
140
+ {props.favicon && <ElmInlineIcon src={props.favicon} />}
141
+ {wrappedVnode}
142
+ </a>
143
+ );
144
+ }
145
+
146
+ return wrappedVnode;
147
+ });
@@ -0,0 +1,66 @@
1
+ .elmethis-list-common {
2
+ margin-block: 1rem;
3
+ opacity: var(--opacity);
4
+ transition: opacity 800ms;
5
+ box-sizing: border-box;
6
+ padding-left: 1.25rem;
7
+ }
8
+
9
+ .elmethis-bulleted-list {
10
+ li {
11
+ box-sizing: border-box;
12
+ padding-left: 0.5rem;
13
+ margin-block: 0.75rem;
14
+
15
+ &::marker {
16
+ content: url("data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMTYgMTYnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICA+CiAgICA8cGF0aAogICAgICBmaWxsPScjNDQ5NzYzJwogICAgICBvcGFjaXR5PScwLjgnCiAgICAgIGQ9J00zIDMuNzMyYTEuNSAxLjUgMCAwIDEgMi4zMDUtMS4yNjVsNi43MDYgNC4yNjdhMS41IDEuNSAwIDAgMSAwIDIuNTMxbC02LjcwNiA0LjI2OEExLjUgMS41IDAgMCAxIDMgMTIuMjY3VjMuNzMyWicKICAgIC8+CiAgPC9zdmc+");
17
+ }
18
+
19
+ ul {
20
+ li {
21
+ &::marker {
22
+ content: url("data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjQgMjQnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9J3RyYW5zcGFyZW50JwogID4KICAgIDxwYXRoCiAgICAgIHN0cm9rZUxpbmVjYXA9J3JvdW5kJwogICAgICBzdHJva2VMaW5lam9pbj0ncm91bmQnCiAgICAgIGQ9J001LjI1IDUuNjUzYzAtLjg1Ni45MTctMS4zOTggMS42NjctLjk4NmwxMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMSAwIDEuOTcybC0xMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMS0xLjY2Ny0uOTg2VjUuNjUzWicKICAgIC8+CiAgPC9zdmc+");
23
+ }
24
+ ul {
25
+ li {
26
+ &::marker {
27
+ content: url("data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjAgMjAnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9JyM0NDk3NjMnCiAgPgogICAgPHBhdGgKICAgICAgZmlsbFJ1bGU9J2V2ZW5vZGQnCiAgICAgIGQ9J004LjIyIDUuMjJhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0LjI1IDQuMjVhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNC4yNSA0LjI1YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTEuOTQgMTAgOC4yMiA2LjI4YS43NS43NSAwIDAgMSAwLTEuMDZaJwogICAgICBjbGlwUnVsZT0nZXZlbm9kZCcKICAgIC8+CiAgPC9zdmc+");
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+
36
+ .elmethis-numbered-list {
37
+ li {
38
+ box-sizing: border-box;
39
+ padding-left: 0.25rem;
40
+ margin-block: 0.75rem;
41
+ margin-left: 0.25rem;
42
+
43
+ list-style-type: decimal;
44
+
45
+ &::marker {
46
+ font-weight: bold;
47
+ color: #9771bd;
48
+ }
49
+
50
+ ol {
51
+ li {
52
+ list-style-type: lower-alpha;
53
+ ol {
54
+ li {
55
+ list-style-type: lower-roman;
56
+ ol {
57
+ li {
58
+ list-style-type: lower-greek;
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,61 @@
1
+ import type { Meta, StoryObj } from "storybook-framework-qwik";
2
+ import { ElmList } from "./elm-list";
3
+
4
+ const meta: Meta<typeof ElmList> = {
5
+ title: "Components/Typography/elm-list",
6
+ component: ElmList,
7
+ tags: ["autodocs"],
8
+ argTypes: {
9
+ listStyle: {
10
+ options: ["unordered", "ordered"],
11
+ control: "radio",
12
+ },
13
+ },
14
+ render() {
15
+ return (
16
+ <ElmList {...this.args}>
17
+ <li>Item 1</li>
18
+ <li>Item 2</li>
19
+ <li>Item 3</li>
20
+ </ElmList>
21
+ );
22
+ },
23
+ };
24
+
25
+ export default meta;
26
+ type Story = StoryObj<typeof meta>;
27
+
28
+ export const Unordered: Story = {
29
+ args: { listStyle: "unordered" },
30
+ };
31
+
32
+ export const Ordered: Story = {
33
+ args: { listStyle: "ordered" },
34
+ };
35
+
36
+ export const Nested: Story = {
37
+ args: { listStyle: "unordered" },
38
+ render() {
39
+ return (
40
+ <ElmList {...this.args}>
41
+ <li>Item 1</li>
42
+ <li>
43
+ Item 2
44
+ <ElmList {...this.args}>
45
+ <li>Item 2.1</li>
46
+ <li>
47
+ Item 2.2
48
+ <ElmList {...this.args}>
49
+ <li>Item 2.2.1</li>
50
+ <li>Item 2.2.2</li>
51
+ <li>Item 2.2.3</li>
52
+ </ElmList>
53
+ </li>
54
+ <li>Item 2.3</li>
55
+ </ElmList>
56
+ </li>
57
+ <li>Item 3</li>
58
+ </ElmList>
59
+ );
60
+ },
61
+ };
@@ -0,0 +1,39 @@
1
+ import { component$, Slot } from "@builder.io/qwik";
2
+
3
+ import "./elm-list.global.scss";
4
+
5
+ import textStyle from "../../styles/text.module.scss";
6
+
7
+ export interface ElmListProps {
8
+ listStyle: "unordered" | "ordered";
9
+ }
10
+
11
+ export const ElmList = component$<ElmListProps>(
12
+ ({ listStyle = "unordered" }) => {
13
+ if (listStyle === "ordered") {
14
+ return (
15
+ <ol
16
+ class={[
17
+ textStyle.text,
18
+ "elmethis-list-common",
19
+ "elmethis-numbered-list",
20
+ ]}
21
+ >
22
+ <Slot />
23
+ </ol>
24
+ );
25
+ } else {
26
+ return (
27
+ <ul
28
+ class={[
29
+ textStyle.text,
30
+ "elmethis-list-common",
31
+ "elmethis-bulleted-list",
32
+ ]}
33
+ >
34
+ <Slot />
35
+ </ul>
36
+ );
37
+ }
38
+ },
39
+ );
@@ -0,0 +1,21 @@
1
+ .paragraph {
2
+ opacity: var(--opacity, 0);
3
+ opacity: var(--opacity);
4
+ transition: opacity 800ms;
5
+ color: var(--color, #606875);
6
+ background-color: var(--background-color, inherit);
7
+
8
+ &::selection {
9
+ color: rgba(255, 255, 255, 0.7);
10
+ background-color: rgba(0, 0, 0, 0.7);
11
+ }
12
+
13
+ [data-theme="dark"] & {
14
+ color: rgba(255, 255, 255, 0.7);
15
+
16
+ &::selection {
17
+ color: rgba(0, 0, 0, 0.7);
18
+ background-color: rgba(255, 255, 255, 0.7);
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,47 @@
1
+ import type { Meta, StoryObj } from "storybook-framework-qwik";
2
+ import { ElmParagraph } from "./elm-paragraph";
3
+
4
+ const meta: Meta<typeof ElmParagraph> = {
5
+ title: "Components/Typography/elm-paragraph",
6
+ component: ElmParagraph,
7
+ tags: ["autodocs"],
8
+ args: {},
9
+ argTypes: {
10
+ color: { control: "color" },
11
+ backgroundColor: { control: "color" },
12
+ },
13
+ render() {
14
+ return (
15
+ <ElmParagraph {...this.args}>
16
+ This is a paragraph with an inline text component.
17
+ </ElmParagraph>
18
+ );
19
+ },
20
+ };
21
+
22
+ export default meta;
23
+ type Story = StoryObj<typeof meta>;
24
+
25
+ export const Primary: Story = {};
26
+
27
+ export const Color: Story = {
28
+ args: {
29
+ color: "#4b9ba9",
30
+ },
31
+ };
32
+
33
+ export const BackgroundColor: Story = {
34
+ args: {
35
+ backgroundColor: "#b1d6dc",
36
+ },
37
+ };
38
+
39
+ export const Many: Story = {
40
+ render() {
41
+ return Array.from({ length: 50 }, (_, i) => (
42
+ <ElmParagraph key={i} {...this.args}>
43
+ This is a paragraph with an inline text component.
44
+ </ElmParagraph>
45
+ ));
46
+ },
47
+ };
@@ -0,0 +1,31 @@
1
+ import { component$, Slot } from "@builder.io/qwik";
2
+
3
+ import styles from "./elm-paragraph.module.scss";
4
+ import textStyles from "../../styles/text.module.scss";
5
+ import { useInView } from "../../hooks/useInView";
6
+
7
+ export interface ElmParagraphProps {
8
+ color?: string;
9
+
10
+ backgroundColor?: string;
11
+ }
12
+
13
+ export const ElmParagraph = component$<ElmParagraphProps>(
14
+ ({ color, backgroundColor }) => {
15
+ const { ref, isVisible } = useInView();
16
+
17
+ return (
18
+ <p
19
+ ref={ref}
20
+ class={[styles.paragraph, textStyles.text]}
21
+ style={{
22
+ "--color": color,
23
+ "--background-color": backgroundColor,
24
+ "--opacity": isVisible.value ? 1 : 0,
25
+ }}
26
+ >
27
+ <Slot />
28
+ </p>
29
+ );
30
+ },
31
+ );
@@ -0,0 +1,17 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * Development entry point using only client-side modules:
5
+ * - Do not use this mode in production!
6
+ * - No SSR
7
+ * - No portion of the application is pre-rendered on the server.
8
+ * - All of the application is running eagerly in the browser.
9
+ * - More code is transferred to the browser than in SSR mode.
10
+ * - Optimizer/Serialization/Deserialization code is not exercised!
11
+ */
12
+ import { render, type RenderOptions } from "@builder.io/qwik";
13
+ import Root from "./root";
14
+
15
+ export default function (opts: RenderOptions) {
16
+ return render(document, <Root />, opts);
17
+ }
@@ -10,5 +10,12 @@
10
10
  * - npm run build
11
11
  *
12
12
  */
13
- import { type RenderToStreamOptions } from "@builder.io/qwik/server";
14
- export default function (opts: RenderToStreamOptions): Promise<import("@builder.io/qwik/server").RenderToStreamResult>;
13
+ import {
14
+ renderToStream,
15
+ type RenderToStreamOptions,
16
+ } from "@builder.io/qwik/server";
17
+ import Root from "./root";
18
+
19
+ export default function (opts: RenderToStreamOptions) {
20
+ return renderToStream(<Root />, opts);
21
+ }
@@ -0,0 +1,13 @@
1
+ declare module "*.module.scss" {
2
+ const classes: { [key: string]: string };
3
+ export default classes;
4
+ }
5
+
6
+ declare module "*.scss";
7
+
8
+ declare module "*.module.css" {
9
+ const classes: { [key: string]: string };
10
+ export default classes;
11
+ }
12
+
13
+ declare module "*.css";
@@ -0,0 +1,27 @@
1
+ import { $, useSignal } from "@builder.io/qwik";
2
+
3
+ export const useDelayedSignal = <T>(
4
+ initialValue: Parameters<typeof useSignal<T>>[0],
5
+ ) => {
6
+ const signal = useSignal<T>(initialValue);
7
+ const delayedSignal = useSignal<T>(initialValue);
8
+ const isSignalChanging = useSignal(false);
9
+
10
+ const dispatch = $((value: T, delay?: number) => {
11
+ isSignalChanging.value = true;
12
+ signal.value = value;
13
+
14
+ if (delay === undefined || delay <= 0) {
15
+ delayedSignal.value = value;
16
+ isSignalChanging.value = false;
17
+ } else {
18
+ const timerId = setTimeout(() => {
19
+ delayedSignal.value = value;
20
+ isSignalChanging.value = false;
21
+ clearTimeout(timerId);
22
+ }, delay);
23
+ }
24
+ });
25
+
26
+ return { signal, delayedSignal, dispatch };
27
+ };
@@ -0,0 +1,23 @@
1
+ import { useSignal, useVisibleTask$ } from "@builder.io/qwik";
2
+
3
+ export const useInView = (props?: { defaultValue?: boolean }) => {
4
+ const ref = useSignal<Element>();
5
+ const isVisible = useSignal(props?.defaultValue ?? false);
6
+
7
+ // eslint-disable-next-line qwik/no-use-visible-task
8
+ useVisibleTask$(() => {
9
+ if (!ref.value) return;
10
+
11
+ const observer = new IntersectionObserver(
12
+ ([entry]) => {
13
+ isVisible.value = entry.isIntersecting;
14
+ },
15
+ { rootMargin: "100px", threshold: 0.1 },
16
+ );
17
+
18
+ observer.observe(ref.value);
19
+ return () => observer.disconnect();
20
+ });
21
+
22
+ return { ref, isVisible };
23
+ };
package/src/index.ts ADDED
@@ -0,0 +1,113 @@
1
+ // | Code |
2
+ export {
3
+ ElmCodeBlock,
4
+ type ElmCodeBlockProps,
5
+ } from "./components/code/elm-code-block";
6
+ export { ElmKatex, type ElmKatexProps } from "./components/code/elm-katex";
7
+ export {
8
+ ElmShikiHighlighter,
9
+ type ElmShikiHighlighterProps,
10
+ } from "./components/code/elm-shiki-highlighter";
11
+
12
+ // | Containments |
13
+ export {
14
+ ElmToggle,
15
+ type ElmToggleProps,
16
+ } from "./components/containments/elm-toggle";
17
+
18
+ // | Fallback |
19
+ export {
20
+ ElmBlockFallback,
21
+ type ElmBlockFallbackProps,
22
+ } from "./components/fallback/elm-block-fallback";
23
+ export {
24
+ ElmRectangleWave,
25
+ type ElmRectangleWaveProps,
26
+ } from "./components/fallback/elm-rectangle-wave";
27
+
28
+ // | Icon |
29
+ export {
30
+ ElmDotLoadingIcon,
31
+ type ElmDotLoadingIconProps,
32
+ } from "./components/icon/elm-dot-loading-icon";
33
+
34
+ export {
35
+ ElmInlineIcon,
36
+ type ElmInlineIconProps,
37
+ } from "./components/icon/elm-inline-icon";
38
+
39
+ export {
40
+ ElmLanguageIcon,
41
+ type ElmLanguageIconProps,
42
+ } from "./components/icon/elm-language-icon";
43
+
44
+ export {
45
+ ElmMdiIcon,
46
+ type ElmMdiIconProps,
47
+ } from "./components/icon/elm-mdi-icon";
48
+
49
+ // | Media |
50
+ export {
51
+ ElmBlockImage,
52
+ type ElmBlockImageProps,
53
+ } from "./components/media/elm-block-image";
54
+ export { ElmFile, type ElmFileProps } from "./components/media/elm-file";
55
+
56
+ // | Navigation |
57
+ export {
58
+ ElmBookmark,
59
+ type ElmBookmarkProps,
60
+ } from "./components/navigation/elm-bookmark";
61
+
62
+ // | Typography |
63
+ export {
64
+ ElmBlockQuote,
65
+ type ElmBlockQuoteProps,
66
+ } from "./components/typography/elm-block-quote";
67
+ export {
68
+ ElmCallout,
69
+ type ElmCalloutProps,
70
+ } from "./components/typography/elm-callout";
71
+ export {
72
+ ElmDivider,
73
+ type ElmDividerProps,
74
+ } from "./components/typography/elm-divider";
75
+ export {
76
+ ElmFragmentIdentifier,
77
+ type ElmFragmentIdentifierProps,
78
+ } from "./components/typography/elm-fragment-identifier";
79
+ export {
80
+ ElmHeading,
81
+ type ElmHeadingProps,
82
+ } from "./components/typography/elm-heading";
83
+ export {
84
+ ElmInlineText,
85
+ type ElmInlineTextProps,
86
+ } from "./components/typography/elm-inline-text";
87
+ export { ElmList, type ElmListProps } from "./components/typography/elm-list";
88
+ export {
89
+ ElmParagraph,
90
+ type ElmParagraphProps,
91
+ } from "./components/typography/elm-paragraph";
92
+
93
+ // | Table |
94
+ export { ElmTable, type ElmTableProps } from "./components/table/elm-table";
95
+ export {
96
+ ElmTableHeader,
97
+ type ElmTableHeaderProps,
98
+ } from "./components/table/elm-table-header";
99
+ export {
100
+ ElmTableBody,
101
+ type ElmTableBodyProps,
102
+ } from "./components/table/elm-table-body";
103
+ export {
104
+ ElmTableRow,
105
+ type ElmTableRowProps,
106
+ } from "./components/table/elm-table-row";
107
+ export {
108
+ ElmTableCell,
109
+ type ElmTableCellProps,
110
+ } from "./components/table/elm-table-cell";
111
+
112
+ // | Others |
113
+ export { ElmJarkup, type ElmJarkupProps } from "./components/others/elm-jarkup";
package/src/root.tsx ADDED
@@ -0,0 +1,13 @@
1
+ export default () => {
2
+ return (
3
+ <>
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <title>Qwik Blank App</title>
7
+ </head>
8
+ <body>
9
+ <h1>Qwik Blank App</h1>
10
+ </body>
11
+ </>
12
+ );
13
+ };
@@ -0,0 +1,17 @@
1
+ .text {
2
+ color: var(--color, #606875);
3
+
4
+ &::selection {
5
+ color: #cccfd5;
6
+ background-color: var(--color, #3e434b);
7
+ }
8
+
9
+ [data-theme="dark"] & {
10
+ color: var(--color, #b0b5be);
11
+
12
+ &::selection {
13
+ color: #3e434b;
14
+ background-color: var(--color, #cccfd5);
15
+ }
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "target": "ES2020",
5
+ "module": "ES2020",
6
+ "lib": ["es2020", "DOM"],
7
+ "jsx": "react-jsx",
8
+ "jsxImportSource": "@builder.io/qwik",
9
+ "strict": true,
10
+ "declaration": true,
11
+ "declarationDir": "lib-types",
12
+ "resolveJsonModule": true,
13
+ "moduleResolution": "Bundler",
14
+ "esModuleInterop": true,
15
+ "skipLibCheck": true,
16
+ "incremental": true,
17
+ "isolatedModules": true,
18
+ "types": ["vite/client"]
19
+ },
20
+ "include": ["src"]
21
+ }