@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,36 +0,0 @@
1
- .callout {
2
- position: relative;
3
- padding: 1rem;
4
-
5
- &::after {
6
- position: absolute;
7
- content: "";
8
- inset: 0 auto auto 0;
9
- height: 100%;
10
- width: 0.25rem;
11
- background-color: var(--callout-color);
12
- }
13
-
14
- &::before {
15
- position: absolute;
16
- content: "";
17
- inset: 0 0 auto auto;
18
- height: 100%;
19
- width: 100%;
20
- background-color: var(--callout-color);
21
- opacity: 0.15;
22
- z-index: -1;
23
- pointer-events: none;
24
- }
25
- }
26
-
27
- .header {
28
- display: flex;
29
- align-items: center;
30
- gap: 0.5rem;
31
- }
32
-
33
- .content {
34
- padding-block-start: 1rem;
35
- padding-block-end: 0.25rem;
36
- }
@@ -1,47 +0,0 @@
1
- import type { Meta, StoryObj } from "storybook-framework-qwik";
2
- import { ElmCallout } from "./elm-callout";
3
- import { ElmInlineText } from "./elm-inline-text";
4
-
5
- const lorem =
6
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec purus nec nunc tincidunt aliquam. Nullam nec purus nec nunc tincidunt aliquam.";
7
-
8
- const meta: Meta<typeof ElmCallout> = {
9
- title: "Components/Typography/elm-callout",
10
- component: ElmCallout,
11
- tags: ["autodocs"],
12
- argTypes: {
13
- type: {
14
- control: "radio",
15
- options: ["note", "tip", "important", "warning", "caution"],
16
- },
17
- },
18
- args: {},
19
- render() {
20
- return (
21
- <ElmCallout {...this.args}>
22
- <ElmInlineText text={lorem} />
23
- </ElmCallout>
24
- );
25
- },
26
- };
27
-
28
- export default meta;
29
- type Story = StoryObj<typeof meta>;
30
-
31
- export const Primary: Story = {};
32
-
33
- export const Tip: Story = {
34
- args: { type: "tip" },
35
- };
36
-
37
- export const Important: Story = {
38
- args: { type: "important" },
39
- };
40
-
41
- export const Warning: Story = {
42
- args: { type: "warning" },
43
- };
44
-
45
- export const Caution: Story = {
46
- args: { type: "caution" },
47
- };
@@ -1,52 +0,0 @@
1
- import { component$, Slot } from "@builder.io/qwik";
2
-
3
- import styles from "./elm-callout.module.scss";
4
- import {
5
- mdiAlert,
6
- mdiAlertOctagram,
7
- mdiInformation,
8
- mdiLightbulbOn,
9
- mdiShieldAlert,
10
- } from "@mdi/js";
11
- import { ElmMdiIcon } from "../icon/elm-mdi-icon";
12
- import { ElmInlineText } from "./elm-inline-text";
13
-
14
- export type AlertType = "note" | "tip" | "important" | "warning" | "caution";
15
-
16
- const COLOR_MAP: Record<AlertType, { code: string; icon: string }> =
17
- Object.freeze({
18
- note: { code: "#6987b8", icon: mdiInformation },
19
- tip: { code: "#59b57c", icon: mdiLightbulbOn },
20
- important: { code: "#9771bd", icon: mdiShieldAlert },
21
- warning: { code: "#b8a36e", icon: mdiAlert },
22
- caution: { code: "#b36472", icon: mdiAlertOctagram },
23
- } as const);
24
-
25
- export interface ElmCalloutProps {
26
- /**
27
- * Type of alert
28
- */
29
- type?: AlertType;
30
- }
31
-
32
- export const ElmCallout = component$<ElmCalloutProps>(({ type = "note" }) => {
33
- return (
34
- <aside
35
- class={styles.callout}
36
- style={{ "--callout-color": COLOR_MAP[type].code }}
37
- >
38
- <div class={styles.header}>
39
- <ElmMdiIcon
40
- d={COLOR_MAP[type].icon}
41
- color={COLOR_MAP[type].code}
42
- size="1.25rem"
43
- />
44
- <ElmInlineText>{type.toLocaleUpperCase()}</ElmInlineText>
45
- </div>
46
-
47
- <div class={styles.content}>
48
- <Slot />
49
- </div>
50
- </aside>
51
- );
52
- });
@@ -1,6 +0,0 @@
1
- .hr {
2
- margin: 0;
3
- width: 100%;
4
- border: none;
5
- border-bottom: dashed 1px #868e9c;
6
- }
@@ -1,14 +0,0 @@
1
- import type { Meta, StoryObj } from "storybook-framework-qwik";
2
- import { ElmDivider } from "./elm-divider";
3
-
4
- const meta: Meta<typeof ElmDivider> = {
5
- title: "Components/Typography/elm-divider",
6
- component: ElmDivider,
7
- tags: ["autodocs"],
8
- args: {},
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
-
14
- export const Primary: Story = {};
@@ -1,14 +0,0 @@
1
- import { component$, CSSProperties } from "@builder.io/qwik";
2
-
3
- import styles from "./elm-divider.module.scss";
4
-
5
- export type ElmDividerProps = {
6
- /**
7
- * The margin of the divider.
8
- */
9
- margin?: CSSProperties["margin-block"];
10
- };
11
-
12
- export const ElmDivider = component$<ElmDividerProps>(({ margin }) => {
13
- return <hr class={styles.hr} style={{ marginBlock: margin }} />;
14
- });
@@ -1,28 +0,0 @@
1
- .fragment {
2
- font-size: 1rem;
3
- width: 1rem;
4
- height: 1rem;
5
- padding: 0.125rem;
6
- margin-inline-start: 0.5rem;
7
- border-radius: 0.125rem;
8
- display: inline-flex;
9
- justify-content: center;
10
- align-items: center;
11
- color: #b69545;
12
- cursor: pointer;
13
- user-select: none;
14
- opacity: 1;
15
- transition:
16
- background-color 200ms,
17
- opacity 100ms,
18
- transform 100ms;
19
-
20
- &:hover {
21
- background-color: rgba(#868e9c, 0.2);
22
- }
23
-
24
- &:active {
25
- opacity: 0.5;
26
- transform: translateX(1px) translateY(1px);
27
- }
28
- }
@@ -1,14 +0,0 @@
1
- import type { Meta, StoryObj } from "storybook-framework-qwik";
2
- import { ElmFragmentIdentifier } from "./elm-fragment-identifier";
3
-
4
- const meta: Meta<typeof ElmFragmentIdentifier> = {
5
- title: "Components/Typography/elm-fragment-identifier",
6
- component: ElmFragmentIdentifier,
7
- tags: ["autodocs"],
8
- args: {},
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
-
14
- export const Primary: Story = {};
@@ -1,31 +0,0 @@
1
- import { $, component$ } from "@builder.io/qwik";
2
-
3
- import styles from "./elm-fragment-identifier.module.scss";
4
-
5
- export interface ElmFragmentIdentifierProps {
6
- /**
7
- * ID of the heading element.
8
- */
9
- id: string;
10
- }
11
-
12
- export const ElmFragmentIdentifier = component$<ElmFragmentIdentifierProps>(
13
- ({ id }) => {
14
- const handleHashClick = $((id: string) => {
15
- const url = new URL(window.location.href);
16
- url.hash = id;
17
- window.history.replaceState(null, "", url.toString());
18
-
19
- const target = document.getElementById(id);
20
- if (target != null) {
21
- target.scrollIntoView({ behavior: "smooth" });
22
- }
23
- });
24
-
25
- return (
26
- <span class={styles.fragment} onClick$={() => handleHashClick(id)}>
27
- #
28
- </span>
29
- );
30
- },
31
- );
@@ -1,120 +0,0 @@
1
- .heading-common {
2
- margin: 0;
3
-
4
- position: relative;
5
- font-size: var(--font-size);
6
- line-height: var(--font-size);
7
- opacity: var(--opacity);
8
-
9
- transition:
10
- color 400ms,
11
- opacity 800ms;
12
- }
13
-
14
- .h1 {
15
- &::after {
16
- position: absolute;
17
- content: "";
18
- bottom: -4px;
19
- left: 0;
20
- width: 100%;
21
- height: 0.25px;
22
- background-color: rgba(0, 0, 0, 0.5);
23
-
24
- transition: transform 800ms;
25
- transform: scaleX(var(--scale));
26
-
27
- [data-theme="dark"] & {
28
- background-color: rgba(255, 255, 255, 0.5);
29
- }
30
- }
31
-
32
- &::before {
33
- position: absolute;
34
- content: "";
35
- bottom: -6px;
36
- left: 45%;
37
- width: 10%;
38
- height: 2px;
39
- background-color: rgba(0, 0, 0, 0.6);
40
-
41
- transition: transform 800ms;
42
- transform: scaleY(var(--scale));
43
- transform-origin: top;
44
-
45
- [data-theme="dark"] & {
46
- background-color: rgba(255, 255, 255, 0.6);
47
- }
48
- }
49
- }
50
-
51
- .h2 {
52
- border-bottom: solid 1px rgba(0, 0, 0, 0.5);
53
-
54
- [data-theme="dark"] & {
55
- border-color: rgba(255, 255, 255, 0.5);
56
- }
57
-
58
- &::after {
59
- position: absolute;
60
- content: "";
61
- right: 2px;
62
- bottom: -4px;
63
- width: 6px;
64
- height: 8px;
65
- opacity: 0.8;
66
- transform: skewX(-25deg);
67
-
68
- background-color: rgba(0, 0, 0, 0.8);
69
- [data-theme="dark"] & {
70
- background-color: rgba(255, 255, 255, 0.8);
71
- }
72
- }
73
-
74
- &::before {
75
- position: absolute;
76
- content: "";
77
- right: 10px;
78
- bottom: -4px;
79
- width: 6px;
80
- height: 8px;
81
- opacity: 0.8;
82
- transform: skewX(-25deg);
83
-
84
- background-color: rgba(0, 0, 0, 0.8);
85
- [data-theme="dark"] & {
86
- background-color: rgba(255, 255, 255, 0.8);
87
- }
88
- }
89
- }
90
-
91
- .h3 {
92
- box-sizing: border-box;
93
- padding-left: 0.75rem;
94
-
95
- &::after {
96
- position: absolute;
97
- content: "";
98
- width: 3px;
99
- height: 12px;
100
- top: calc(50% - 8px);
101
- left: 0;
102
-
103
- background-color: rgba(0, 0, 0, 0.5);
104
- [data-theme="dark"] & {
105
- background-color: rgba(255, 255, 255, 0.5);
106
- }
107
- }
108
- }
109
-
110
- .h4 {
111
- position: relative;
112
- }
113
-
114
- .h5 {
115
- position: relative;
116
- }
117
-
118
- .h6 {
119
- position: relative;
120
- }
@@ -1,42 +0,0 @@
1
- import type { Meta, StoryObj } from "storybook-framework-qwik";
2
-
3
- import { ElmHeading } from "./elm-heading";
4
- import { ElmInlineText } from "./elm-inline-text";
5
-
6
- const meta: Meta<typeof ElmHeading> = {
7
- title: "Components/Typography/elm-heading",
8
- component: ElmHeading,
9
- tags: ["autodocs"],
10
- argTypes: {
11
- level: {
12
- options: [1, 2, 3, 4, 5, 6],
13
- control: "radio",
14
- },
15
- },
16
- };
17
-
18
- export default meta;
19
- type Story = StoryObj<typeof meta>;
20
-
21
- export const Primary: Story = {
22
- args: {
23
- level: 1,
24
- text: "Heading",
25
- id: "heading-id",
26
- },
27
- };
28
-
29
- export const Slot: Story = {
30
- args: {
31
- level: 1,
32
- id: "heading-id",
33
- },
34
- render() {
35
- return (
36
- <ElmHeading {...this.args}>
37
- <ElmInlineText text="This" color="crimson" /> is{" "}
38
- <ElmInlineText text="code" code /> !
39
- </ElmHeading>
40
- );
41
- },
42
- };
@@ -1,40 +0,0 @@
1
- import { component$, Slot } from "@builder.io/qwik";
2
-
3
- import styles from "./elm-heading.module.scss";
4
- import textStyles from "../../styles/text.module.scss";
5
- import { ElmFragmentIdentifier } from "./elm-fragment-identifier";
6
-
7
- export interface ElmHeadingProps {
8
- level: 1 | 2 | 3 | 4 | 5 | 6;
9
-
10
- text?: string;
11
-
12
- id?: string;
13
- }
14
-
15
- const SIZE_MAP: Record<1 | 2 | 3 | 4 | 5 | 6, number> = Object.freeze({
16
- 1: 1.5,
17
- 2: 1.4,
18
- 3: 1.3,
19
- 4: 1.2,
20
- 5: 1.15,
21
- 6: 1.1,
22
- } as const);
23
-
24
- export const ElmHeading = component$<ElmHeadingProps>(({ level, text, id }) => {
25
- const Tag = `h${level}` as "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
26
- return (
27
- <Tag
28
- class={[styles["heading-common"], textStyles.text, styles[`h${level}`]]}
29
- style={{ "--font-size": `${SIZE_MAP[level]}em` }}
30
- >
31
- {text}
32
- <Slot />
33
- {id && (
34
- <span style={{ padding: "0.5rem" }}>
35
- <ElmFragmentIdentifier id={id} />
36
- </span>
37
- )}
38
- </Tag>
39
- );
40
- });
@@ -1,114 +0,0 @@
1
- .text {
2
- padding: 0;
3
- margin: 0;
4
- white-space: pre-line;
5
- font-size: var(--font-size, 1em);
6
- line-height: var(--font-size, 1em);
7
- background-color: var(--background-color);
8
- transition: color 200ms;
9
- text-decoration-color: var(--color);
10
- }
11
-
12
- .code {
13
- margin-inline: 0.25rem;
14
- padding: 2px 0.5em;
15
- font-size: calc(1em - 2px);
16
- border-radius: 0.125rem;
17
- background-color: rgba(0, 0, 0, 0.075);
18
- font-family: "Source Code Pro" monospace;
19
- }
20
-
21
- .kbd {
22
- padding: 0.125rem 0.25rem;
23
- position: relative;
24
- border-radius: 0.125rem;
25
- background-color: #e6e6e6;
26
-
27
- [data-theme="dark"] & {
28
- background-color: #404040;
29
- }
30
-
31
- &::before {
32
- z-index: -1;
33
- position: absolute;
34
- content: "";
35
- bottom: -0.25em;
36
- left: 0;
37
- height: 100%;
38
- width: 100%;
39
- background-color: #ccc;
40
- border-radius: 0 0 0.125rem 0.125rem;
41
- box-shadow: 0 0 0.125em rgba(black, 0.5);
42
-
43
- [data-theme="dark"] & {
44
- background-color: #595959;
45
- box-shadow: 0 0 0.125em rgba(white, 0.5);
46
- }
47
- }
48
- }
49
-
50
- .link {
51
- all: unset;
52
- box-sizing: border-box;
53
- padding: 0 0.25rem;
54
- font-size: var(--font-size);
55
- display: inline-flex;
56
- align-items: center;
57
- gap: 0.25rem;
58
- cursor: pointer;
59
- color: #6987b8;
60
- border-radius: 0.125rem;
61
- transition:
62
- background-color 200ms,
63
- color 200ms,
64
- opacity 200ms;
65
-
66
- &:hover {
67
- background-color: rgba($color: #6987b8, $alpha: 0.2);
68
- }
69
-
70
- &:active {
71
- opacity: 0.5;
72
- }
73
-
74
- &:visited {
75
- color: #9771bd;
76
- border-bottom: dashed 1px #9771bd;
77
-
78
- &:hover {
79
- background-color: rgba($color: #9771bd, $alpha: 0.2);
80
- }
81
- }
82
- }
83
-
84
- .ogp {
85
- display: flex;
86
- flex-direction: column;
87
- gap: 0.25rem;
88
- overflow: hidden;
89
-
90
- border-radius: 0.25rem;
91
- box-shadow: 0 0 0.125rem rgba(black, 0.3);
92
-
93
- background-color: rgba(white, 0.8);
94
-
95
- [data-theme="dark"] & {
96
- background-color: rgba(white, 0.1);
97
- }
98
- }
99
-
100
- .ogp-text {
101
- box-sizing: border-box;
102
- padding: 0.5rem;
103
- }
104
-
105
- .ogp-title {
106
- box-sizing: border-box;
107
- font-weight: bold;
108
- padding-block-end: 0.25rem;
109
- }
110
-
111
- .ogp-description {
112
- opacity: 0.7;
113
- padding: 0.25rem;
114
- }
@@ -1,70 +0,0 @@
1
- import type { Meta, StoryObj } from "storybook-framework-qwik";
2
- import { ElmInlineText } from "./elm-inline-text";
3
- import { opacify } from "polished";
4
-
5
- const meta: Meta<typeof ElmInlineText> = {
6
- title: "Components/Typography/elm-inline-text",
7
- component: ElmInlineText,
8
- tags: ["autodocs"],
9
- argTypes: {
10
- color: { control: "color" },
11
- backgroundColor: { control: "color" },
12
- bold: { control: "boolean" },
13
- italic: { control: "boolean" },
14
- underline: { control: "boolean" },
15
- strikethrough: { control: "boolean" },
16
- code: { control: "boolean" },
17
- kbd: { control: "boolean" },
18
- },
19
-
20
- args: {
21
- text: "Inline Text",
22
- bold: false,
23
- italic: false,
24
- underline: false,
25
- strikethrough: false,
26
- code: false,
27
- kbd: false,
28
- },
29
- };
30
-
31
- export default meta;
32
- type Story = StoryObj<typeof meta>;
33
-
34
- export const Primary: Story = {};
35
-
36
- export const Colored: Story = {
37
- args: { color: "#b36472" },
38
- };
39
-
40
- export const Code: Story = {
41
- args: { code: true, text: "const x = 10;" },
42
- };
43
-
44
- export const Kbd: Story = {
45
- args: { text: "Ctrl", kbd: true },
46
- };
47
-
48
- export const Background: Story = {
49
- args: { backgroundColor: opacify(-0.5, "#6987b8") },
50
- };
51
-
52
- export const Ruby: Story = {
53
- args: { text: "国際連合", ruby: "こくさいれんごう" },
54
- };
55
-
56
- export const Link: Story = {
57
- args: {
58
- text: "Google Search",
59
- href: "https://google.com",
60
- favicon: "https://www.google.com/favicon.ico",
61
- },
62
- };
63
-
64
- export const LinkWithOgp: Story = {
65
- args: {
66
- text: "Visual Studio Code - Code Editing. Redefined",
67
- href: "https://code.visualstudio.com/",
68
- favicon: "https://code.visualstudio.com/assets/favicon.ico",
69
- },
70
- };