@stamcat/craftsman 0.0.24 → 0.0.26
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 +49 -2
- package/package.json +1 -1
- package/src/components/Button.esm.js +1 -0
- package/src/components/Checkbox.esm.js +1 -0
- package/src/components/Input.esm.js +1 -0
- package/src/components/InputPassword.esm.js +1 -0
- package/src/components/Loader.esm.js +1 -0
- package/src/components/Modal.esm.js +1 -0
- package/src/components/RadioButton.esm.js +1 -0
- package/src/styles/index.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @stamcat/craftsman
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Craftsman design system components and styling utilities.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @stamcat/craftsman
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## RSC-safe setup
|
|
12
|
+
|
|
13
|
+
Use this pattern in React Server Component architectures (for example Next.js App Router):
|
|
14
|
+
|
|
15
|
+
1. Import package global styles once at the application root.
|
|
16
|
+
2. Render `ThemeProvider` at the root with your theme object.
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { ThemeProvider } from "@stamcat/craftsman/styles";
|
|
20
|
+
import "@stamcat/craftsman/styles";
|
|
21
|
+
|
|
22
|
+
const appTheme = {
|
|
23
|
+
root: {
|
|
24
|
+
"--w-gutter": "16px",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
29
|
+
return (
|
|
30
|
+
<html lang="en">
|
|
31
|
+
<body>
|
|
32
|
+
<ThemeProvider theme={appTheme}>{children}</ThemeProvider>
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Component imports
|
|
40
|
+
|
|
41
|
+
Use component entry points:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { Button } from "@stamcat/craftsman/Button";
|
|
45
|
+
import { Input } from "@stamcat/craftsman/Input";
|
|
46
|
+
import { Modal } from "@stamcat/craftsman/Modal";
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Styling notes
|
|
50
|
+
|
|
51
|
+
- `ThemeProvider` injects theme CSS variables and component override rules.
|
|
52
|
+
- Global styles should be loaded once at app root.
|
package/package.json
CHANGED
package/src/styles/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export * from './utilities/constants';
|
|
|
3
3
|
export * from './utilities/layout';
|
|
4
4
|
export * from './utilities/types';
|
|
5
5
|
export * from './theme/theme';
|
|
6
|
-
export
|
|
6
|
+
export { globalStyles } from './global/globalStyles';
|
|
7
7
|
export { ThemeProvider } from './components/ThemeProvider';
|