@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,11 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+
3
+ import styles from "./elm-rectangle-wave.module.scss";
4
+
5
+ export interface ElmRectangleWaveProps {
6
+ placeholder?: string;
7
+ }
8
+
9
+ export const ElmRectangleWave = component$<ElmRectangleWaveProps>(() => {
10
+ return <div aria-hidden="true" class={styles["rectangle-wave"]}></div>;
11
+ });
@@ -0,0 +1,53 @@
1
+ @keyframes bounce {
2
+ 0% {
3
+ transform: translateY(0%) scaleY(0.3) scaleX(1.5);
4
+ }
5
+
6
+ 10% {
7
+ transform: scaleY(0.8) scaleX(1.2);
8
+ }
9
+
10
+ 100% {
11
+ transform: translateY(-400%) scaleY(1.1);
12
+ }
13
+ }
14
+
15
+ .wrapper {
16
+ width: var(--size);
17
+ height: var(--size);
18
+ user-select: none;
19
+ position: relative;
20
+ display: flex;
21
+ justify-content: space-around;
22
+ align-items: flex-end;
23
+ }
24
+
25
+ .dot {
26
+ width: 20%;
27
+ height: 20%;
28
+ border-radius: 50%;
29
+ animation-name: bounce;
30
+ animation-duration: 0.4s;
31
+ animation-iteration-count: infinite;
32
+ animation-direction: alternate;
33
+ animation-timing-function: ease-out;
34
+
35
+ transition: background-color 400ms;
36
+ background-color: var(--color, #606875);
37
+
38
+ [data-theme="dark"] & {
39
+ background-color: #b0b5be;
40
+ }
41
+
42
+ &:nth-last-of-type(1) {
43
+ animation-delay: -100ms;
44
+ }
45
+
46
+ &:nth-last-of-type(2) {
47
+ animation-delay: 0ms;
48
+ }
49
+
50
+ &:nth-last-of-type(3) {
51
+ animation-delay: 100ms;
52
+ }
53
+ }
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from "storybook-framework-qwik";
2
+ import { ElmDotLoadingIcon } from "./elm-dot-loading-icon";
3
+
4
+ const meta: Meta<typeof ElmDotLoadingIcon> = {
5
+ title: "Components/Icon/elm-dot-loading-icon",
6
+ component: ElmDotLoadingIcon,
7
+ tags: ["autodocs"],
8
+ argTypes: { color: { control: "color" } },
9
+ args: { size: "4em" },
10
+ };
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const Primary: Story = {};
@@ -0,0 +1,35 @@
1
+ import { component$, type CSSProperties } from "@builder.io/qwik";
2
+
3
+ import styles from "./elm-dot-loading-icon.module.scss";
4
+
5
+ export interface ElmDotLoadingIconProps {
6
+ /**
7
+ * Specifies the color of the dot.
8
+ *
9
+ * e.g.) `'red'`, `'#ff0000'`, `'rgba(255, 0, 0, 0.5)'`
10
+ */
11
+ color?: CSSProperties["backgroundColor"];
12
+
13
+ /**
14
+ * Specifies the size of the dot.
15
+ */
16
+ size?: CSSProperties["width"];
17
+ }
18
+
19
+ export const ElmDotLoadingIcon = component$<ElmDotLoadingIconProps>(
20
+ ({ size = "4em", color = "#606875" }) => {
21
+ return (
22
+ <div
23
+ class={styles.wrapper}
24
+ style={{
25
+ "--size": size,
26
+ "--color": color,
27
+ }}
28
+ >
29
+ <div class={styles.dot} aria-hidden="true"></div>
30
+ <div class={styles.dot} aria-hidden="true"></div>
31
+ <div class={styles.dot} aria-hidden="true"></div>
32
+ </div>
33
+ );
34
+ },
35
+ );
@@ -0,0 +1,21 @@
1
+ .icon {
2
+ margin: 0;
3
+ padding: 0;
4
+ display: inline-block;
5
+ vertical-align: middle;
6
+ height: 1em;
7
+
8
+ &::selection {
9
+ filter: brightness(1000%);
10
+ background-color: var(--color, rgba(black, 0.25));
11
+ }
12
+
13
+ [data-theme="dark"] & {
14
+ color: var(--color, rgba(white, 0.7));
15
+
16
+ &::selection {
17
+ color: rgba(black, 0.7);
18
+ background-color: var(--color, rgba(white, 0.25));
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from "storybook-framework-qwik";
2
+ import { ElmInlineIcon } from "./elm-inline-icon";
3
+
4
+ const meta: Meta<typeof ElmInlineIcon> = {
5
+ title: "Components/Icon/elm-inline-icon",
6
+ component: ElmInlineIcon,
7
+ tags: ["autodocs"],
8
+ args: {
9
+ src: "https://rust-lang.org/logos/rust-logo-512x512.png",
10
+ },
11
+ };
12
+
13
+ export default meta;
14
+ type Story = StoryObj<typeof meta>;
15
+
16
+ export const Primary: Story = {};
@@ -0,0 +1,25 @@
1
+ /* eslint-disable qwik/jsx-img */
2
+
3
+ import { component$ } from "@builder.io/qwik";
4
+
5
+ import styles from "./elm-inline-icon.module.scss";
6
+
7
+ export interface ElmInlineIconProps {
8
+ /**
9
+ * The source URL of the icon.
10
+ */
11
+ src: string;
12
+
13
+ /**
14
+ * The alt text for the icon.
15
+ */
16
+ alt?: string;
17
+ }
18
+
19
+ export const ElmInlineIcon = component$<ElmInlineIconProps>(({ src, alt }) => {
20
+ return (
21
+ <div class={styles.icon}>
22
+ <img src={src} alt={alt} class={styles.icon} />
23
+ </div>
24
+ );
25
+ });
@@ -0,0 +1,22 @@
1
+ import type { Meta, StoryObj } from "storybook-framework-qwik";
2
+ import { ElmLanguageIcon, LANGUAGES } from "./elm-language-icon";
3
+
4
+ const meta: Meta<typeof ElmLanguageIcon> = {
5
+ title: "Components/Icon/elm-language-icon",
6
+ component: ElmLanguageIcon,
7
+ tags: ["autodocs"],
8
+ args: {},
9
+ argTypes: {
10
+ language: {
11
+ control: "radio",
12
+ options: LANGUAGES,
13
+ },
14
+ },
15
+ };
16
+
17
+ export default meta;
18
+ type Story = StoryObj<typeof meta>;
19
+
20
+ export const Primary: Story = {
21
+ args: { language: "rust" },
22
+ };
@@ -0,0 +1,167 @@
1
+ import { Component, component$ } from "@builder.io/qwik";
2
+
3
+ // import styles from "./elm-language-icon.module.scss";
4
+
5
+ import { type CommonLanguageProps } from "./languages/language-interface";
6
+
7
+ import { Rust } from "./languages/rust";
8
+ import { Javascript } from "./languages/javascript";
9
+ import { Typescript } from "./languages/typescript";
10
+ import { Bash } from "./languages/bash";
11
+ import { Terraform } from "./languages/terraform";
12
+ import { Html } from "./languages/html";
13
+ import { Css } from "./languages/css";
14
+ import { Npm } from "./languages/npm";
15
+ import { Java } from "./languages/java";
16
+ import { Kotlin } from "./languages/kotlin";
17
+ import { Go } from "./languages/go";
18
+ import { Python } from "./languages/python";
19
+ import { Sql } from "./languages/sql";
20
+ import { Json } from "./languages/json";
21
+ import { Lua } from "./languages/lua";
22
+ import { Csharp } from "./languages/c-sharp";
23
+ import { Cplusplus } from "./languages/c-plus-plus";
24
+ import { C } from "./languages/c";
25
+
26
+ export const LANGUAGES = [
27
+ "rust",
28
+ "javascript",
29
+ "typescript",
30
+ "shell",
31
+ "terraform",
32
+ "html",
33
+ "css",
34
+ "npm",
35
+ "java",
36
+ "kotlin",
37
+ "go",
38
+ "python",
39
+ "sql",
40
+ "json",
41
+ "lua",
42
+ "csharp",
43
+ "cpp",
44
+ "c",
45
+ "file",
46
+ ] as const;
47
+
48
+ export type Language = (typeof LANGUAGES)[number];
49
+
50
+ export interface ElmLanguageIconProps {
51
+ /**
52
+ * The size of the icon.
53
+ */
54
+ size?: number;
55
+
56
+ /**
57
+ * The language of the icon.
58
+ */
59
+ language: Language | string;
60
+ }
61
+
62
+ const normalizeLanguage = (language: string): Language => {
63
+ switch (language) {
64
+ case "rust":
65
+ case "rs":
66
+ return "rust";
67
+
68
+ case "javascript":
69
+ case "js":
70
+ return "javascript";
71
+
72
+ case "typescript":
73
+ case "ts":
74
+ return "typescript";
75
+
76
+ case "bash":
77
+ case "sh":
78
+ case "shell":
79
+ return "shell";
80
+
81
+ case "tf":
82
+ case "terraform":
83
+ case "hcl":
84
+ return "terraform";
85
+
86
+ case "html":
87
+ case "html5":
88
+ return "html";
89
+
90
+ case "css":
91
+ case "css3":
92
+ return "css";
93
+
94
+ case "npm":
95
+ return "npm";
96
+
97
+ case "java":
98
+ return "java";
99
+
100
+ case "kotlin":
101
+ case "kt":
102
+ return "kotlin";
103
+
104
+ case "go":
105
+ case "golang":
106
+ return "go";
107
+
108
+ case "python":
109
+ case "py":
110
+ return "python";
111
+
112
+ case "sql":
113
+ return "sql";
114
+
115
+ case "json":
116
+ return "json";
117
+
118
+ case "lua":
119
+ return "lua";
120
+
121
+ case "cs":
122
+ case "c#":
123
+ case "csharp":
124
+ return "csharp";
125
+
126
+ case "cpp":
127
+ case "c++":
128
+ return "cpp";
129
+
130
+ case "c":
131
+ case "clang":
132
+ return "c";
133
+
134
+ default:
135
+ return "file";
136
+ }
137
+ };
138
+
139
+ const renderMap: Record<Language, Component<CommonLanguageProps>> = {
140
+ rust: Rust,
141
+ javascript: Javascript,
142
+ typescript: Typescript,
143
+ shell: Bash,
144
+ terraform: Terraform,
145
+ html: Html,
146
+ css: Css,
147
+ npm: Npm,
148
+ java: Java,
149
+ kotlin: Kotlin,
150
+ go: Go,
151
+ python: Python,
152
+ sql: Sql,
153
+ json: Json,
154
+ lua: Lua,
155
+ csharp: Csharp,
156
+ cpp: Cplusplus,
157
+ c: C,
158
+ file: () => null,
159
+ };
160
+
161
+ export const ElmLanguageIcon = component$<ElmLanguageIconProps>(
162
+ ({ size = 24, language }) => {
163
+ const Component = renderMap[normalizeLanguage(language)];
164
+
165
+ return <Component size={size} />;
166
+ },
167
+ );
@@ -0,0 +1,8 @@
1
+ .icon {
2
+ fill: var(--color, #555b67);
3
+ transition: fill 200ms;
4
+
5
+ [data-theme="dark"] & {
6
+ fill: var(--dark-color, #b0b5be);
7
+ }
8
+ }
@@ -0,0 +1,25 @@
1
+ import { type Meta, type StoryObj } from "storybook-framework-qwik";
2
+ import { ElmMdiIcon } from "./elm-mdi-icon";
3
+ import { mdiTag } from "@mdi/js";
4
+
5
+ const meta: Meta<typeof ElmMdiIcon> = {
6
+ title: "Components/Icon/elm-mdi-icon",
7
+ component: ElmMdiIcon,
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ color: { control: "color" },
11
+ lightColor: { control: "color" },
12
+ darkColor: { control: "color" },
13
+ },
14
+ args: {},
15
+ };
16
+
17
+ export default meta;
18
+ type Story = StoryObj<typeof meta>;
19
+
20
+ export const Primary: Story = {
21
+ args: {
22
+ size: "1.25rem",
23
+ d: mdiTag,
24
+ },
25
+ };
@@ -0,0 +1,34 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+
3
+ import styles from "./elm-mdi-icon.module.scss";
4
+
5
+ export interface ElmMdiIconProps {
6
+ d: string;
7
+ size?: string;
8
+ color?: string;
9
+ lightColor?: string;
10
+ darkColor?: string;
11
+ }
12
+
13
+ export const ElmMdiIcon = component$<ElmMdiIconProps>(
14
+ ({ d, size = "1em", color, lightColor, darkColor }) => {
15
+ return (
16
+ <svg
17
+ class={styles.icon}
18
+ style={{
19
+ "--color": lightColor ?? color,
20
+ "--dark-color": darkColor ?? color,
21
+ }}
22
+ width={size}
23
+ height={size}
24
+ viewBox="0 0 24 24"
25
+ fill={color}
26
+ xmlns="http://www.w3.org/2000/svg"
27
+ focusable="false"
28
+ role="img"
29
+ >
30
+ <path d={d} />
31
+ </svg>
32
+ );
33
+ },
34
+ );
@@ -0,0 +1,6 @@
1
+ .path {
2
+ fill: #293138;
3
+ [data-theme="dark"] & {
4
+ fill: #d2dbe3;
5
+ }
6
+ }
@@ -0,0 +1,27 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+ import styles from "./bash.module.scss";
3
+ import type { CommonLanguageProps } from "./language-interface";
4
+
5
+ export const Bash = component$<CommonLanguageProps>(
6
+ ({ size = 24, ...props }) => {
7
+ return (
8
+ <svg
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ viewBox="0 0 128 128"
11
+ width={size}
12
+ height={size}
13
+ {...props}
14
+ >
15
+ <path fill="none" d="M4.24 4.24h119.53v119.53H4.24z" />
16
+ <path
17
+ class={styles.path}
18
+ d="M109.01 28.64L71.28 6.24c-2.25-1.33-4.77-2-7.28-2s-5.03.67-7.28 2.01l-37.74 22.4c-4.5 2.67-7.28 7.61-7.28 12.96v44.8c0 5.35 2.77 10.29 7.28 12.96l37.73 22.4c2.25 1.34 4.76 2 7.28 2c2.51 0 5.03-.67 7.28-2l37.74-22.4c4.5-2.67 7.28-7.62 7.28-12.96V41.6c0-5.34-2.77-10.29-7.28-12.96M79.79 98.59l.06 3.22c0 .39-.25.83-.55.99l-1.91 1.1c-.3.15-.56-.03-.56-.42l-.03-3.17c-1.63.68-3.29.84-4.34.42c-.2-.08-.29-.37-.21-.71l.69-2.91c.06-.23.18-.46.34-.6c.06-.06.12-.1.18-.13c.11-.06.22-.07.31-.03c1.14.38 2.59.2 3.99-.5c1.78-.9 2.97-2.72 2.95-4.52c-.02-1.64-.9-2.31-3.05-2.33c-2.74.01-5.3-.53-5.34-4.57c-.03-3.32 1.69-6.78 4.43-8.96l-.03-3.25c0-.4.24-.84.55-1l1.85-1.18c.3-.15.56.04.56.43l.03 3.25c1.36-.54 2.54-.69 3.61-.44c.23.06.34.38.24.75l-.72 2.88c-.06.22-.18.44-.33.58a.8.8 0 0 1-.19.14c-.1.05-.19.06-.28.05c-.49-.11-1.65-.36-3.48.56c-1.92.97-2.59 2.64-2.58 3.88c.02 1.48.77 1.93 3.39 1.97c3.49.06 4.99 1.58 5.03 5.09c.05 3.44-1.79 7.15-4.61 9.41m26.34-60.5l-35.7 22.05c-4.45 2.6-7.73 5.52-7.74 10.89v43.99c0 3.21 1.3 5.29 3.29 5.9c-.65.11-1.32.19-1.98.19c-2.09 0-4.15-.57-5.96-1.64l-37.73-22.4c-3.69-2.19-5.98-6.28-5.98-10.67V41.6c0-4.39 2.29-8.48 5.98-10.67l37.74-22.4c1.81-1.07 3.87-1.64 5.96-1.64s4.15.57 5.96 1.64l37.74 22.4c3.11 1.85 5.21 5.04 5.8 8.63c-1.27-2.67-4.09-3.39-7.38-1.47"
19
+ />
20
+ <path
21
+ fill="#4fa847"
22
+ d="m99.12 90.73l-9.4 5.62c-.25.15-.43.31-.43.61v2.46c0 .3.2.43.45.28l9.54-5.8c.25-.15.29-.42.29-.72v-2.17c0-.3-.2-.42-.45-.28"
23
+ />
24
+ </svg>
25
+ );
26
+ },
27
+ );
@@ -0,0 +1,33 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+ import type { CommonLanguageProps } from "./language-interface";
3
+
4
+ export const Cplusplus = component$<CommonLanguageProps>(
5
+ ({ size = 24, ...props }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 128 128"
10
+ width={size}
11
+ height={size}
12
+ {...props}
13
+ >
14
+ <path
15
+ fill="#00599c"
16
+ d="M118.766 95.82c.89-1.543 1.441-3.28 1.441-4.843V36.78c0-1.558-.55-3.297-1.441-4.84l-55.32 31.94Zm0 0"
17
+ />
18
+ <path
19
+ fill="#004482"
20
+ d="m68.36 126.586l46.933-27.094c1.352-.781 2.582-2.129 3.473-3.672l-55.32-31.94L8.12 95.82c.89 1.543 2.121 2.89 3.473 3.672l46.933 27.094c2.703 1.562 7.13 1.562 9.832 0Zm0 0"
21
+ />
22
+ <path
23
+ fill="#659ad2"
24
+ d="M118.766 31.941c-.891-1.546-2.121-2.894-3.473-3.671L68.359 1.172c-2.703-1.563-7.129-1.563-9.832 0L11.594 28.27C8.89 29.828 6.68 33.66 6.68 36.78v54.196c0 1.562.55 3.3 1.441 4.843L63.445 63.88Zm0 0"
25
+ />
26
+ <path
27
+ fill="#fff"
28
+ d="M63.445 26.035c-20.867 0-37.843 16.977-37.843 37.844s16.976 37.844 37.843 37.844c13.465 0 26.024-7.247 32.77-18.91L79.84 73.335c-3.38 5.84-9.66 9.465-16.395 9.465c-10.433 0-18.922-8.488-18.922-18.922s8.49-18.922 18.922-18.922c6.73 0 13.017 3.629 16.39 9.465l16.38-9.477c-6.75-11.664-19.305-18.91-32.77-18.91zM92.88 57.57v4.207h-4.207v4.203h4.207v4.207h4.203V65.98h4.203v-4.203h-4.203V57.57zm15.766 0v4.207h-4.204v4.203h4.204v4.207h4.207V65.98h4.203v-4.203h-4.203V57.57z"
29
+ />
30
+ </svg>
31
+ );
32
+ },
33
+ );
@@ -0,0 +1,29 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+ import type { CommonLanguageProps } from "./language-interface";
3
+
4
+ export const Csharp = component$<CommonLanguageProps>(
5
+ ({ size = 24, ...props }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 128 128"
10
+ width={size}
11
+ height={size}
12
+ {...props}
13
+ >
14
+ <path
15
+ fill="#9b4f96"
16
+ d="M115.4 30.7L67.1 2.9c-.8-.5-1.9-.7-3.1-.7s-2.3.3-3.1.7l-48 27.9c-1.7 1-2.9 3.5-2.9 5.4v55.7c0 1.1.2 2.4 1 3.5l106.8-62c-.6-1.2-1.5-2.1-2.4-2.7"
17
+ />
18
+ <path
19
+ fill="#68217a"
20
+ d="M10.7 95.3c.5.8 1.2 1.5 1.9 1.9l48.2 27.9c.8.5 1.9.7 3.1.7s2.3-.3 3.1-.7l48-27.9c1.7-1 2.9-3.5 2.9-5.4V36.1c0-.9-.1-1.9-.6-2.8z"
21
+ />
22
+ <path
23
+ fill="#fff"
24
+ d="M85.3 76.1C81.1 83.5 73.1 88.5 64 88.5c-13.5 0-24.5-11-24.5-24.5s11-24.5 24.5-24.5c9.1 0 17.1 5 21.3 12.5l13-7.5c-6.8-11.9-19.6-20-34.3-20c-21.8 0-39.5 17.7-39.5 39.5s17.7 39.5 39.5 39.5c14.6 0 27.4-8 34.2-19.8zM97 66.2l.9-4.3h-4.2v-4.7h5.1L100 51h4.9l-1.2 6.1h3.8l1.2-6.1h4.8l-1.2 6.1h2.4v4.7h-3.3l-.9 4.3h4.2v4.7h-5.1l-1.2 6h-4.9l1.2-6h-3.8l-1.2 6h-4.8l1.2-6h-2.4v-4.7H97zm4.8 0h3.8l.9-4.3h-3.8z"
25
+ />
26
+ </svg>
27
+ );
28
+ },
29
+ );
@@ -0,0 +1,27 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+ import type { CommonLanguageProps } from "./language-interface";
3
+
4
+ export const C = component$<CommonLanguageProps>(({ size = 24, ...props }) => {
5
+ return (
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 128 128"
9
+ width={size}
10
+ height={size}
11
+ {...props}
12
+ >
13
+ <path
14
+ fill="#659ad3"
15
+ d="M115.4 30.7L67.1 2.9c-.8-.5-1.9-.7-3.1-.7s-2.3.3-3.1.7l-48 27.9c-1.7 1-2.9 3.5-2.9 5.4v55.7c0 1.1.2 2.4 1 3.5l106.8-62c-.6-1.2-1.5-2.1-2.4-2.7"
16
+ />
17
+ <path
18
+ fill="#03599c"
19
+ d="M10.7 95.3c.5.8 1.2 1.5 1.9 1.9l48.2 27.9c.8.5 1.9.7 3.1.7s2.3-.3 3.1-.7l48-27.9c1.7-1 2.9-3.5 2.9-5.4V36.1c0-.9-.1-1.9-.6-2.8z"
20
+ />
21
+ <path
22
+ fill="#fff"
23
+ d="M85.3 76.1C81.1 83.5 73.1 88.5 64 88.5c-13.5 0-24.5-11-24.5-24.5s11-24.5 24.5-24.5c9.1 0 17.1 5 21.3 12.5l13-7.5c-6.8-11.9-19.6-20-34.3-20c-21.8 0-39.5 17.7-39.5 39.5s17.7 39.5 39.5 39.5c14.6 0 27.4-8 34.2-19.8z"
24
+ />
25
+ </svg>
26
+ );
27
+ });
@@ -0,0 +1,21 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+ import type { CommonLanguageProps } from "./language-interface";
3
+
4
+ export const Css = component$<CommonLanguageProps>(
5
+ ({ size = 24, ...props }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 24 24"
10
+ width={size}
11
+ height={size}
12
+ {...props}
13
+ >
14
+ <path
15
+ fill="#3f9de9"
16
+ d="m5 3l-.65 3.34h13.59L17.5 8.5H3.92l-.66 3.33h13.59l-.76 3.81l-5.48 1.81l-4.75-1.81l.33-1.64H2.85l-.79 4l7.85 3l9.05-3l1.2-6.03l.24-1.21L21.94 3z"
17
+ />
18
+ </svg>
19
+ );
20
+ },
21
+ );
@@ -0,0 +1,22 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+ import type { CommonLanguageProps } from "./language-interface";
3
+
4
+ export const Go = component$<CommonLanguageProps>(({ size = 24, ...props }) => {
5
+ return (
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ width={size}
9
+ height={size}
10
+ viewBox="0 0 128 128"
11
+ {...props}
12
+ >
13
+ <g fill="#00acd7" fill-rule="evenodd">
14
+ <path d="M11.156 54.829c-.243 0-.303-.122-.182-.303l1.273-1.637c.12-.182.424-.303.666-.303H34.55c.243 0 .303.182.182.364l-1.03 1.576c-.121.181-.424.363-.606.363zm-9.152 5.575c-.242 0-.303-.12-.182-.303l1.273-1.636c.121-.182.424-.303.667-.303h27.636c.242 0 .364.182.303.364l-.485 1.454c-.06.243-.303.364-.545.364zM16.67 65.98c-.242 0-.302-.182-.181-.364l.848-1.515c.122-.182.364-.363.607-.363h12.12c.243 0 .364.181.364.424l-.12 1.454c0 .243-.243.425-.425.425zm62.91-12.242c-3.819.97-6.425 1.697-10.182 2.666c-.91.243-.97.303-1.758-.606c-.909-1.03-1.576-1.697-2.848-2.303c-3.819-1.878-7.516-1.333-10.97.91c-4.121 2.666-6.242 6.605-6.182 11.514c.06 4.849 3.394 8.849 8.182 9.516c4.121.545 7.576-.91 10.303-4c.545-.667 1.03-1.394 1.636-2.243H56.064c-1.272 0-1.575-.788-1.151-1.818c.788-1.879 2.242-5.03 3.09-6.606c.183-.364.607-.97 1.516-.97h22.06c-.12 1.637-.12 3.273-.363 4.91c-.667 4.363-2.303 8.363-4.97 11.878c-4.364 5.758-10.06 9.333-17.273 10.303c-5.939.788-11.454-.364-16.302-4c-4.485-3.394-7.03-7.879-7.697-13.454c-.788-6.606 1.151-12.546 5.151-17.758c4.303-5.636 10-9.212 16.97-10.485c5.697-1.03 11.151-.363 16.06 2.97c3.212 2.121 5.515 5.03 7.03 8.545c.364.546.122.849-.606 1.03z" />
15
+ <path
16
+ fill-rule="nonzero"
17
+ d="M99.64 87.253c-5.515-.122-10.546-1.697-14.788-5.334c-3.576-3.09-5.818-7.03-6.545-11.697c-1.091-6.848.787-12.909 4.909-18.302c4.424-5.819 9.757-8.849 16.97-10.122c6.181-1.09 12-.484 17.272 3.091c4.788 3.273 7.757 7.697 8.545 13.515c1.03 8.182-1.333 14.849-6.97 20.546c-4 4.06-8.909 6.606-14.545 7.757c-1.636.303-3.273.364-4.848.546m14.424-24.485c-.06-.788-.06-1.394-.182-2c-1.09-6-6.606-9.394-12.363-8.06c-5.637 1.272-9.273 4.848-10.606 10.545c-1.091 4.727 1.212 9.515 5.575 11.454c3.334 1.455 6.667 1.273 9.879-.363c4.788-2.485 7.394-6.364 7.697-11.576"
18
+ />
19
+ </g>
20
+ </svg>
21
+ );
22
+ });
@@ -0,0 +1,30 @@
1
+ import { component$ } from "@builder.io/qwik";
2
+ import type { CommonLanguageProps } from "./language-interface";
3
+
4
+ export const Html = component$<CommonLanguageProps>(
5
+ ({ size = 24, ...props }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width={size}
10
+ height={size}
11
+ viewBox="0 0 128 128"
12
+ {...props}
13
+ >
14
+ <path
15
+ fill="#e44d26"
16
+ d="M19.037 113.876L9.032 1.661h109.936l-10.016 112.198l-45.019 12.48z"
17
+ />
18
+ <path fill="#f16529" d="m64 116.8l36.378-10.086l8.559-95.878H64z" />
19
+ <path
20
+ fill="#ebebeb"
21
+ d="M64 52.455H45.788L44.53 38.361H64V24.599H29.489l.33 3.692l3.382 37.927H64zm0 35.743l-.061.017l-15.327-4.14l-.979-10.975H33.816l1.928 21.609l28.193 7.826l.063-.017z"
22
+ />
23
+ <path
24
+ fill="#fff"
25
+ d="M63.952 52.455v13.763h16.947l-1.597 17.849l-15.35 4.143v14.319l28.215-7.82l.207-2.325l3.234-36.233l.335-3.696h-3.708zm0-27.856v13.762h33.244l.276-3.092l.628-6.978l.329-3.692z"
26
+ />
27
+ </svg>
28
+ );
29
+ },
30
+ );