@elmethis/qwik 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -37
- package/lib/index.qwik.cjs +570 -62
- package/lib/index.qwik.mjs +572 -64
- package/lib/style.css +18 -0
- package/lib-types/components/icon/elm-toggle-theme.d.ts +7 -0
- package/lib-types/components/icon/elm-toggle-theme.stories.d.ts +6 -0
- package/lib-types/hooks/useElmethisTheme.d.ts +4 -0
- package/lib-types/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,55 +1,108 @@
|
|
|
1
|
-
# Qwik Library
|
|
1
|
+
# Qwik Library
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
- [Discord](https://qwik.dev/chat)
|
|
5
|
-
- [Qwik on GitHub](https://github.com/QwikDev/qwik)
|
|
6
|
-
- [@QwikDev](https://twitter.com/QwikDev)
|
|
7
|
-
- [Vite](https://vitejs.dev/)
|
|
8
|
-
- [Partytown](https://partytown.qwik.dev/)
|
|
9
|
-
- [Mitosis](https://github.com/BuilderIO/mitosis)
|
|
10
|
-
- [Builder.io](https://www.builder.io/)
|
|
3
|
+
This package provides reusable UI building blocks for the Qwik web framework.
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
## Directory structure
|
|
13
6
|
|
|
14
|
-
|
|
7
|
+
This package is one of the workspace packages managed by pnpm.
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
The package lives at `./packages/qwik`.
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
- `.storybook/` - Storybook configuration
|
|
12
|
+
- `lib/` - build output
|
|
13
|
+
- `lib-types/` - build output (TypeScript types)
|
|
14
|
+
- `src/` - source root
|
|
15
|
+
- `assets/` - static assets
|
|
16
|
+
- `components/` - Qwik components
|
|
17
|
+
- `<category>/`
|
|
18
|
+
- `elm-x.module.scss`
|
|
19
|
+
- `elm-x.stories.tsx`
|
|
20
|
+
- `elm-x.tsx`
|
|
21
|
+
- `hooks/` - custom Qwik hooks
|
|
22
|
+
- `styles/` - shared styles (SCSS)
|
|
23
|
+
- `index.ts` - package exports (re-export components)
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
## Coding style
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
### Module structure
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Each component module should include:
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
- **Component**: TypeScript JSX (`.tsx`)
|
|
32
|
+
- **Styles**: SCSS Modules (`.module.scss`)
|
|
33
|
+
- **Storybook**: a Storybook meta file (`.stories.tsx`)
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
pnpm dev
|
|
37
|
-
```
|
|
35
|
+
### Component (TypeScript JSX)
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
File: `elm-my-something.tsx`
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
```tsx
|
|
40
|
+
import { component$ } from "@builder.io/qwik";
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
import styles from "./elm-my-something.module.scss";
|
|
44
43
|
|
|
44
|
+
export interface ElmMySomethingProps {
|
|
45
|
+
placeholder?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const ElmMySomething = component$<ElmMySomethingProps>(
|
|
49
|
+
({ placeholder = "Howdy" }) => {
|
|
50
|
+
return <div class={styles["elm-my-something"]}>{placeholder}</div>;
|
|
51
|
+
},
|
|
52
|
+
);
|
|
45
53
|
```
|
|
46
|
-
|
|
54
|
+
|
|
55
|
+
### Styles (SCSS Modules)
|
|
56
|
+
|
|
57
|
+
File: `elm-my-something.module.scss`
|
|
58
|
+
|
|
59
|
+
```scss
|
|
60
|
+
.elm-my-something {
|
|
61
|
+
}
|
|
47
62
|
```
|
|
48
63
|
|
|
49
|
-
|
|
64
|
+
### Storybook
|
|
50
65
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
File: `elm-my-something.stories.tsx`
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import type { Meta, StoryObj } from "storybook-framework-qwik";
|
|
70
|
+
import { ElmMySomething } from "./elm-my-something";
|
|
71
|
+
|
|
72
|
+
const meta: Meta<typeof ElmMySomething> = {
|
|
73
|
+
// Replace the <Category> placeholder
|
|
74
|
+
title: "Components/<Category>/elm-my-something",
|
|
75
|
+
component: ElmMySomething,
|
|
76
|
+
tags: ["autodocs"],
|
|
77
|
+
args: {},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default meta;
|
|
81
|
+
|
|
82
|
+
type Story = StoryObj<typeof meta>;
|
|
83
|
+
|
|
84
|
+
export const Primary: Story = {};
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Bulk Exports
|
|
88
|
+
|
|
89
|
+
We export all components and their prop types in `src/index.ts`.
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
// | Code |
|
|
93
|
+
export {
|
|
94
|
+
ElmCodeBlock,
|
|
95
|
+
type ElmCodeBlockProps,
|
|
96
|
+
} from "./components/code/elm-code-block";
|
|
97
|
+
export { ElmKatex, type ElmKatexProps } from "./components/code/elm-katex";
|
|
98
|
+
export {
|
|
99
|
+
ElmShikiHighlighter,
|
|
100
|
+
type ElmShikiHighlighterProps,
|
|
101
|
+
} from "./components/code/elm-shiki-highlighter";
|
|
102
|
+
|
|
103
|
+
// | Containments |
|
|
104
|
+
export {
|
|
105
|
+
ElmParallax,
|
|
106
|
+
type ElmParallaxProps,
|
|
107
|
+
} from "./components/containments/elm-parallax";
|
|
108
|
+
```
|