@tinyrack/themes 0.0.0
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 +179 -0
- package/dist/astro/starlight/index.d.ts +2 -0
- package/dist/astro/starlight/index.d.ts.map +1 -0
- package/dist/astro/starlight/index.js +2 -0
- package/dist/astro/starlight/index.js.map +1 -0
- package/dist/astro/starlight/starlight-theme.d.ts +11 -0
- package/dist/astro/starlight/starlight-theme.d.ts.map +1 -0
- package/dist/astro/starlight/starlight-theme.js +11 -0
- package/dist/astro/starlight/starlight-theme.js.map +1 -0
- package/dist/astro/starlight/theme.css +46 -0
- package/dist/daisyui/index.d.ts +2 -0
- package/dist/daisyui/index.d.ts.map +1 -0
- package/dist/daisyui/index.js +2 -0
- package/dist/daisyui/index.js.map +1 -0
- package/dist/daisyui/theme.css +59 -0
- package/dist/daisyui/themes.d.ts +66 -0
- package/dist/daisyui/themes.d.ts.map +1 -0
- package/dist/daisyui/themes.js +62 -0
- package/dist/daisyui/themes.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/mantine/create-tinyrack-mantine-theme.d.ts +155 -0
- package/dist/mantine/create-tinyrack-mantine-theme.d.ts.map +1 -0
- package/dist/mantine/create-tinyrack-mantine-theme.js +59 -0
- package/dist/mantine/create-tinyrack-mantine-theme.js.map +1 -0
- package/dist/mantine/index.d.ts +3 -0
- package/dist/mantine/index.d.ts.map +1 -0
- package/dist/mantine/index.js +3 -0
- package/dist/mantine/index.js.map +1 -0
- package/dist/mantine/provider.d.ts +10 -0
- package/dist/mantine/provider.d.ts.map +1 -0
- package/dist/mantine/provider.js +7 -0
- package/dist/mantine/provider.js.map +1 -0
- package/dist/mantine/styles.css +18 -0
- package/dist/showcase/daisyui-showcase.d.ts +3 -0
- package/dist/showcase/daisyui-showcase.d.ts.map +1 -0
- package/dist/showcase/daisyui-showcase.js +410 -0
- package/dist/showcase/daisyui-showcase.js.map +1 -0
- package/dist/showcase/gallery.d.ts +15 -0
- package/dist/showcase/gallery.d.ts.map +1 -0
- package/dist/showcase/gallery.js +21 -0
- package/dist/showcase/gallery.js.map +1 -0
- package/dist/showcase/index.d.ts +6 -0
- package/dist/showcase/index.d.ts.map +1 -0
- package/dist/showcase/index.js +6 -0
- package/dist/showcase/index.js.map +1 -0
- package/dist/showcase/mantine-showcase.d.ts +8 -0
- package/dist/showcase/mantine-showcase.d.ts.map +1 -0
- package/dist/showcase/mantine-showcase.js +670 -0
- package/dist/showcase/mantine-showcase.js.map +1 -0
- package/dist/showcase/scenarios.d.ts +8 -0
- package/dist/showcase/scenarios.d.ts.map +1 -0
- package/dist/showcase/scenarios.js +153 -0
- package/dist/showcase/scenarios.js.map +1 -0
- package/dist/showcase/showcase.css +240 -0
- package/dist/showcase/types.d.ts +17 -0
- package/dist/showcase/types.d.ts.map +1 -0
- package/dist/showcase/types.js +2 -0
- package/dist/showcase/types.js.map +1 -0
- package/dist/tailwind/daisyui.css +8 -0
- package/dist/tailwind/mantine.css +2 -0
- package/dist/tailwind/theme.css +41 -0
- package/dist/tokens/colors.d.ts +73 -0
- package/dist/tokens/colors.d.ts.map +1 -0
- package/dist/tokens/colors.js +72 -0
- package/dist/tokens/colors.js.map +1 -0
- package/dist/tokens/index.d.ts +173 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +24 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/motion.d.ts +12 -0
- package/dist/tokens/motion.d.ts.map +1 -0
- package/dist/tokens/motion.js +12 -0
- package/dist/tokens/motion.js.map +1 -0
- package/dist/tokens/radii.d.ts +9 -0
- package/dist/tokens/radii.d.ts.map +1 -0
- package/dist/tokens/radii.js +9 -0
- package/dist/tokens/radii.js.map +1 -0
- package/dist/tokens/semantic.d.ts +43 -0
- package/dist/tokens/semantic.d.ts.map +1 -0
- package/dist/tokens/semantic.js +41 -0
- package/dist/tokens/semantic.js.map +1 -0
- package/dist/tokens/shadows.d.ts +7 -0
- package/dist/tokens/shadows.d.ts.map +1 -0
- package/dist/tokens/shadows.js +7 -0
- package/dist/tokens/shadows.js.map +1 -0
- package/dist/tokens/spacing.d.ts +9 -0
- package/dist/tokens/spacing.d.ts.map +1 -0
- package/dist/tokens/spacing.js +9 -0
- package/dist/tokens/spacing.js.map +1 -0
- package/dist/tokens/typography.d.ts +20 -0
- package/dist/tokens/typography.d.ts.map +1 -0
- package/dist/tokens/typography.js +20 -0
- package/dist/tokens/typography.js.map +1 -0
- package/docs/npm-publishing.md +96 -0
- package/docs/setup-guide.md +352 -0
- package/docs/storybook-deployment.md +84 -0
- package/package.json +105 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# npm publishing
|
|
2
|
+
|
|
3
|
+
`@tinyrack/themes` is published to npm from GitHub Actions when a version tag is pushed.
|
|
4
|
+
|
|
5
|
+
This follows the release workflow shape used by sibling Tinyrack packages:
|
|
6
|
+
|
|
7
|
+
- `tinyrack/tinyauth`: publishes from `refs/tags/v*` with npm registry setup.
|
|
8
|
+
- `tinyrack/dotweave` and `tinyrack/proxer`: verify package contents with `pack --dry-run` and publish with npm provenance.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
The workflow is `.github/workflows/publish-npm.yml`.
|
|
13
|
+
|
|
14
|
+
It runs only for semantic version tags:
|
|
15
|
+
|
|
16
|
+
```txt
|
|
17
|
+
v*.*.*
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Example:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git tag v0.1.0
|
|
24
|
+
git push origin v0.1.0
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Required npm setup
|
|
28
|
+
|
|
29
|
+
The workflow uses npm trusted publishing with provenance, not a checked-in token.
|
|
30
|
+
|
|
31
|
+
Configure the package on npm with this trusted publisher:
|
|
32
|
+
|
|
33
|
+
| Field | Value |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| Package | `@tinyrack/themes` |
|
|
36
|
+
| Repository owner | `tinyrack-net` |
|
|
37
|
+
| Repository name | `themes` |
|
|
38
|
+
| Workflow file | `.github/workflows/publish-npm.yml` |
|
|
39
|
+
| Environment | leave empty unless npm requires one later |
|
|
40
|
+
|
|
41
|
+
Because the workflow uses OIDC trusted publishing, do not add or commit an npm token. The workflow intentionally does not reference `NPM_TOKEN`.
|
|
42
|
+
|
|
43
|
+
## What the workflow checks
|
|
44
|
+
|
|
45
|
+
Before publishing, CI does the following:
|
|
46
|
+
|
|
47
|
+
1. Check out the repository.
|
|
48
|
+
2. Install pnpm `11.3.0` and Node.js `24`.
|
|
49
|
+
3. Configure npm registry access with `registry-url: https://registry.npmjs.org`.
|
|
50
|
+
4. Install dependencies with `pnpm install --frozen-lockfile`.
|
|
51
|
+
5. Install browser test runtime with `pnpm exec playwright install --with-deps chromium`.
|
|
52
|
+
6. Verify the pushed tag matches `package.json` version.
|
|
53
|
+
7. Run `pnpm run test`.
|
|
54
|
+
8. Run `pnpm run biome`.
|
|
55
|
+
9. Run `pnpm run build`.
|
|
56
|
+
10. Verify package contents with `pnpm pack --dry-run`.
|
|
57
|
+
11. Publish with `pnpm publish --provenance --access public --no-git-checks`.
|
|
58
|
+
|
|
59
|
+
## Local validation
|
|
60
|
+
|
|
61
|
+
Before pushing a release tag, validate locally:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pnpm run test
|
|
65
|
+
pnpm run biome
|
|
66
|
+
pnpm run build
|
|
67
|
+
pnpm pack --dry-run
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The package includes only:
|
|
71
|
+
|
|
72
|
+
- `dist`
|
|
73
|
+
- `README.md`
|
|
74
|
+
- `docs`
|
|
75
|
+
|
|
76
|
+
This is controlled by `package.json` `files`.
|
|
77
|
+
|
|
78
|
+
## Version/tag contract
|
|
79
|
+
|
|
80
|
+
The pushed tag must equal the package version prefixed with `v`.
|
|
81
|
+
|
|
82
|
+
For example, if `package.json` contains:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"version": "0.1.0"
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
then the publish tag must be:
|
|
91
|
+
|
|
92
|
+
```txt
|
|
93
|
+
v0.1.0
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
If the tag and package version do not match, the workflow fails before publishing.
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
# Tinyrack Themes setup guide
|
|
2
|
+
|
|
3
|
+
`@tinyrack/themes`는 컴포넌트 라이브러리가 아니라 Tinyrack 브랜드 토큰과 UI 라이브러리별 adapter를 제공하는 패키지입니다.
|
|
4
|
+
|
|
5
|
+
지원하는 사용 환경은 다음과 같습니다.
|
|
6
|
+
|
|
7
|
+
| 환경 | 권장 import |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Tailwind CSS 4 only | `@tinyrack/themes/tailwind.css` |
|
|
10
|
+
| Tailwind CSS 4 + daisyUI | `@tinyrack/themes/tailwind/daisyui.css` |
|
|
11
|
+
| Mantine only | `@tinyrack/themes/mantine`, `@tinyrack/themes/mantine.css` |
|
|
12
|
+
| Tailwind CSS 4 + Mantine | `@tinyrack/themes/tailwind/mantine.css` + Mantine provider |
|
|
13
|
+
| Tailwind CSS 4 + daisyUI + Mantine | explicit composition: Tailwind tokens + daisyUI theme + Mantine CSS |
|
|
14
|
+
| Astro Starlight | `withTinyrackStarlightTheme()` or `@tinyrack/themes/astro/starlight.css` |
|
|
15
|
+
|
|
16
|
+
## 1. 공통 설치
|
|
17
|
+
|
|
18
|
+
먼저 공통 테마 패키지를 설치합니다.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @tinyrack/themes
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
그 다음 사용하는 UI 환경에 맞는 peer dependency를 추가합니다.
|
|
25
|
+
|
|
26
|
+
| 환경 | 추가 패키지 |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| Tailwind CSS 4 | `tailwindcss` |
|
|
29
|
+
| Vite + Tailwind CSS 4 | `tailwindcss @tailwindcss/vite` |
|
|
30
|
+
| daisyUI | `tailwindcss daisyui` |
|
|
31
|
+
| Mantine | `@mantine/core @mantine/hooks react react-dom` |
|
|
32
|
+
| Astro Starlight | `astro @astrojs/starlight` |
|
|
33
|
+
|
|
34
|
+
예시:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm add tailwindcss daisyui
|
|
38
|
+
pnpm add @mantine/core @mantine/hooks react react-dom
|
|
39
|
+
pnpm add astro @astrojs/starlight
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 2. Tailwind CSS 4 only
|
|
43
|
+
|
|
44
|
+
Tailwind utility에서 Tinyrack 토큰만 쓰고 싶은 경우입니다.
|
|
45
|
+
|
|
46
|
+
### CSS entry
|
|
47
|
+
|
|
48
|
+
```css
|
|
49
|
+
@import "tailwindcss";
|
|
50
|
+
@import "@tinyrack/themes/tailwind.css";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 사용 가능한 utility 예시
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<section class="bg-tinyrack-surface text-tinyrack-text rounded-tinyrack-box">
|
|
57
|
+
<h1 class="font-tinyrack-heading text-tinyrack-primary">Tinyrack</h1>
|
|
58
|
+
<p class="text-tinyrack-text-muted">Dark brand surface</p>
|
|
59
|
+
</section>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 제공되는 대표 토큰
|
|
63
|
+
|
|
64
|
+
| 종류 | 예시 |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| color | `bg-tinyrack-surface`, `text-tinyrack-primary`, `border-tinyrack-border` |
|
|
67
|
+
| font | `font-tinyrack-body`, `font-tinyrack-heading`, `font-tinyrack-mono` |
|
|
68
|
+
| radius | `rounded-tinyrack-field`, `rounded-tinyrack-box` |
|
|
69
|
+
|
|
70
|
+
`tailwind.css`는 Tailwind CSS 4의 `@theme static`을 사용하므로, 토큰 기반 utility가 안정적으로 생성됩니다.
|
|
71
|
+
|
|
72
|
+
## 3. Tailwind CSS 4 + daisyUI
|
|
73
|
+
|
|
74
|
+
Tailwind utility와 daisyUI 컴포넌트를 같이 쓰는 일반적인 제품 사이트 환경입니다.
|
|
75
|
+
|
|
76
|
+
### 권장 CSS entry
|
|
77
|
+
|
|
78
|
+
```css
|
|
79
|
+
@import "tailwindcss";
|
|
80
|
+
@import "@tinyrack/themes/tailwind/daisyui.css";
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`tailwind/daisyui.css`는 아래를 함께 포함합니다.
|
|
84
|
+
|
|
85
|
+
- Tinyrack Tailwind `@theme static` 토큰
|
|
86
|
+
- `tinyrack-light`, `tinyrack-dark` daisyUI theme 변수
|
|
87
|
+
- daisyUI plugin theme 등록
|
|
88
|
+
|
|
89
|
+
### 테마 선택
|
|
90
|
+
|
|
91
|
+
기본 dark theme는 `tinyrack-dark`입니다. 명시적으로 전환하려면 root에 `data-theme`를 둡니다.
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<html data-theme="tinyrack-dark">
|
|
95
|
+
<body>
|
|
96
|
+
<button class="btn btn-primary">Deploy</button>
|
|
97
|
+
</body>
|
|
98
|
+
</html>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Light theme가 필요한 화면:
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<html data-theme="tinyrack-light">
|
|
105
|
+
<body>
|
|
106
|
+
<button class="btn btn-primary">Deploy</button>
|
|
107
|
+
</body>
|
|
108
|
+
</html>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 명시적 composition이 필요한 경우
|
|
112
|
+
|
|
113
|
+
프로젝트에서 daisyUI plugin 순서를 직접 관리해야 한다면 combined preset 대신 아래처럼 구성할 수 있습니다.
|
|
114
|
+
|
|
115
|
+
```css
|
|
116
|
+
@import "tailwindcss";
|
|
117
|
+
@import "@tinyrack/themes/tailwind.css";
|
|
118
|
+
@import "@tinyrack/themes/daisyui.css";
|
|
119
|
+
|
|
120
|
+
@plugin "daisyui" {
|
|
121
|
+
themes:
|
|
122
|
+
tinyrack-light --default,
|
|
123
|
+
tinyrack-dark --prefersdark;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## 4. Mantine only
|
|
128
|
+
|
|
129
|
+
Mantine 기반 앱에서 Tinyrack Mantine theme만 쓰는 경우입니다.
|
|
130
|
+
|
|
131
|
+
### App entry
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
import '@mantine/core/styles.css';
|
|
135
|
+
import '@tinyrack/themes/mantine.css';
|
|
136
|
+
import { TinyrackMantineProvider } from '@tinyrack/themes/mantine';
|
|
137
|
+
|
|
138
|
+
export function App({ children }: { children: React.ReactNode }) {
|
|
139
|
+
return <TinyrackMantineProvider>{children}</TinyrackMantineProvider>;
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`TinyrackMantineProvider`는 기본적으로 `defaultColorScheme="dark"`를 사용합니다.
|
|
144
|
+
|
|
145
|
+
### 기존 MantineProvider를 유지하고 싶은 경우
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
import '@mantine/core/styles.css';
|
|
149
|
+
import '@tinyrack/themes/mantine.css';
|
|
150
|
+
import { MantineProvider } from '@mantine/core';
|
|
151
|
+
import { tinyrackMantineTheme } from '@tinyrack/themes/mantine';
|
|
152
|
+
|
|
153
|
+
export function App({ children }: { children: React.ReactNode }) {
|
|
154
|
+
return (
|
|
155
|
+
<MantineProvider defaultColorScheme="dark" theme={tinyrackMantineTheme}>
|
|
156
|
+
{children}
|
|
157
|
+
</MantineProvider>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Scoped CSS variables
|
|
163
|
+
|
|
164
|
+
브라우저 extension/content script처럼 theme 변수 scope를 제한해야 하는 경우:
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
import { TinyrackMantineProvider } from '@tinyrack/themes/mantine';
|
|
168
|
+
|
|
169
|
+
export function ExtensionRoot() {
|
|
170
|
+
return (
|
|
171
|
+
<TinyrackMantineProvider cssVariablesSelector="#tiny-translate-root">
|
|
172
|
+
<div id="tiny-translate-root">
|
|
173
|
+
<App />
|
|
174
|
+
</div>
|
|
175
|
+
</TinyrackMantineProvider>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## 5. Tailwind CSS 4 + Mantine
|
|
181
|
+
|
|
182
|
+
Tailwind utility와 Mantine 컴포넌트를 같은 앱에서 쓰는 경우입니다.
|
|
183
|
+
|
|
184
|
+
### CSS entry
|
|
185
|
+
|
|
186
|
+
```css
|
|
187
|
+
@import "tailwindcss";
|
|
188
|
+
@import "@tinyrack/themes/tailwind/mantine.css";
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
`tailwind/mantine.css`는 아래를 포함합니다.
|
|
192
|
+
|
|
193
|
+
- Tinyrack Tailwind `@theme static` 토큰
|
|
194
|
+
- Mantine 주변부에서 공유할 Tinyrack CSS variables
|
|
195
|
+
|
|
196
|
+
### App entry
|
|
197
|
+
|
|
198
|
+
```tsx
|
|
199
|
+
import '@mantine/core/styles.css';
|
|
200
|
+
import { TinyrackMantineProvider } from '@tinyrack/themes/mantine';
|
|
201
|
+
import './styles.css';
|
|
202
|
+
|
|
203
|
+
export function App({ children }: { children: React.ReactNode }) {
|
|
204
|
+
return <TinyrackMantineProvider>{children}</TinyrackMantineProvider>;
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Tailwind token과 Mantine theme는 서로 다른 시스템입니다. 따라서 Tailwind CSS import만으로 Mantine component theme가 적용되지 않습니다. Mantine component에는 반드시 `TinyrackMantineProvider` 또는 `MantineProvider theme={tinyrackMantineTheme}`가 필요합니다.
|
|
209
|
+
|
|
210
|
+
## 6. Tailwind CSS 4 + daisyUI + Mantine
|
|
211
|
+
|
|
212
|
+
세 시스템을 모두 함께 쓰는 앱에서는 combined preset 두 개를 동시에 import하지 말고, 명시적 composition을 권장합니다. `tailwind/daisyui.css`와 `tailwind/mantine.css`를 둘 다 import하면 Tailwind theme token을 중복 import하게 됩니다.
|
|
213
|
+
|
|
214
|
+
### CSS entry
|
|
215
|
+
|
|
216
|
+
```css
|
|
217
|
+
@import "tailwindcss";
|
|
218
|
+
@import "@tinyrack/themes/tailwind.css";
|
|
219
|
+
@import "@tinyrack/themes/daisyui.css";
|
|
220
|
+
@import "@tinyrack/themes/mantine.css";
|
|
221
|
+
|
|
222
|
+
@plugin "daisyui" {
|
|
223
|
+
themes:
|
|
224
|
+
tinyrack-light --default,
|
|
225
|
+
tinyrack-dark --prefersdark;
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### App entry
|
|
230
|
+
|
|
231
|
+
```tsx
|
|
232
|
+
import '@mantine/core/styles.css';
|
|
233
|
+
import { TinyrackMantineProvider } from '@tinyrack/themes/mantine';
|
|
234
|
+
import './styles.css';
|
|
235
|
+
|
|
236
|
+
export function App({ children }: { children: React.ReactNode }) {
|
|
237
|
+
return (
|
|
238
|
+
<TinyrackMantineProvider>
|
|
239
|
+
<main data-theme="tinyrack-dark">{children}</main>
|
|
240
|
+
</TinyrackMantineProvider>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### 사용 예시
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
import { Button } from '@mantine/core';
|
|
249
|
+
|
|
250
|
+
export function MixedSurface() {
|
|
251
|
+
return (
|
|
252
|
+
<section className="bg-tinyrack-surface text-tinyrack-text rounded-tinyrack-box p-6">
|
|
253
|
+
<button className="btn btn-primary" type="button">
|
|
254
|
+
daisyUI action
|
|
255
|
+
</button>
|
|
256
|
+
<Button mt="md">Mantine action</Button>
|
|
257
|
+
</section>
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## 7. Astro Starlight
|
|
263
|
+
|
|
264
|
+
Starlight docs site에서 Tinyrack docs theme를 쓰는 경우입니다.
|
|
265
|
+
|
|
266
|
+
### 권장 config
|
|
267
|
+
|
|
268
|
+
```js
|
|
269
|
+
import starlight from '@astrojs/starlight';
|
|
270
|
+
import { defineConfig } from 'astro/config';
|
|
271
|
+
import { withTinyrackStarlightTheme } from '@tinyrack/themes/astro/starlight';
|
|
272
|
+
|
|
273
|
+
export default defineConfig({
|
|
274
|
+
integrations: [
|
|
275
|
+
starlight(
|
|
276
|
+
withTinyrackStarlightTheme({
|
|
277
|
+
title: 'Docs',
|
|
278
|
+
customCss: ['./src/styles/global.css'],
|
|
279
|
+
}),
|
|
280
|
+
),
|
|
281
|
+
],
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
`withTinyrackStarlightTheme()`는 `@tinyrack/themes/astro/starlight.css`를 site-local CSS 앞에 prepend합니다. 따라서 site-local CSS에서 필요한 override를 계속 둘 수 있습니다.
|
|
286
|
+
|
|
287
|
+
### subpath CSS resolution이 안 되는 경우
|
|
288
|
+
|
|
289
|
+
Astro/Starlight 버전에 따라 package subpath CSS를 `customCss`에서 직접 resolve하지 못하면, site-local global CSS에서 import합니다.
|
|
290
|
+
|
|
291
|
+
```css
|
|
292
|
+
@import "@tinyrack/themes/astro/starlight.css";
|
|
293
|
+
|
|
294
|
+
:root {
|
|
295
|
+
--sl-font: var(--tinyrack-font-body);
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## 8. JS token metadata
|
|
300
|
+
|
|
301
|
+
테스트, 문서 생성, design tooling에서는 JS token export를 직접 사용할 수 있습니다.
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
import { tinyrackPalettes, tinyrackTokens } from '@tinyrack/themes/tokens';
|
|
305
|
+
import { tinyrackDaisyUiThemes } from '@tinyrack/themes/daisyui';
|
|
306
|
+
import { tinyrackMantineTheme } from '@tinyrack/themes/mantine';
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## 9. Import decision table
|
|
310
|
+
|
|
311
|
+
| 내가 원하는 것 | CSS import | JS/React setup |
|
|
312
|
+
| --- | --- | --- |
|
|
313
|
+
| Tailwind utility만 | `@tinyrack/themes/tailwind.css` | 없음 |
|
|
314
|
+
| daisyUI 컴포넌트 + Tailwind utility | `@tinyrack/themes/tailwind/daisyui.css` | `data-theme="tinyrack-dark"` 선택 가능 |
|
|
315
|
+
| Mantine 컴포넌트만 | `@tinyrack/themes/mantine.css` | `TinyrackMantineProvider` |
|
|
316
|
+
| Tailwind utility + Mantine | `@tinyrack/themes/tailwind/mantine.css` | `TinyrackMantineProvider` |
|
|
317
|
+
| Tailwind utility + daisyUI + Mantine | `tailwind.css` + `daisyui.css` + `mantine.css` + daisyUI `@plugin` | `TinyrackMantineProvider` + `data-theme` |
|
|
318
|
+
| Starlight docs | `astro/starlight.css` | `withTinyrackStarlightTheme()` |
|
|
319
|
+
|
|
320
|
+
## 10. Common pitfalls
|
|
321
|
+
|
|
322
|
+
### `@plugin "daisyui"`를 두 번 선언하지 마세요
|
|
323
|
+
|
|
324
|
+
`@tinyrack/themes/tailwind/daisyui.css`는 이미 daisyUI plugin registration을 포함합니다. 이 preset을 쓸 때는 앱 CSS에서 별도로 `@plugin "daisyui"`를 다시 선언하지 않는 것을 권장합니다.
|
|
325
|
+
|
|
326
|
+
### `tailwind/daisyui.css`와 `tailwind/mantine.css`를 동시에 import하지 마세요
|
|
327
|
+
|
|
328
|
+
둘 다 `tailwind.css`를 포함하는 combined preset입니다. 세 시스템을 모두 쓸 때는 explicit composition을 사용하세요.
|
|
329
|
+
|
|
330
|
+
### Mantine은 provider가 필요합니다
|
|
331
|
+
|
|
332
|
+
Tailwind CSS 변수와 utility가 있어도 Mantine component theme는 자동 적용되지 않습니다. `TinyrackMantineProvider` 또는 `MantineProvider theme={tinyrackMantineTheme}`를 사용하세요.
|
|
333
|
+
|
|
334
|
+
### CSS import 순서
|
|
335
|
+
|
|
336
|
+
Tailwind CSS 4 환경에서는 대체로 아래 순서를 지키세요.
|
|
337
|
+
|
|
338
|
+
1. `@import "tailwindcss";`
|
|
339
|
+
2. Tinyrack Tailwind/theme CSS
|
|
340
|
+
3. library-specific CSS variables
|
|
341
|
+
4. library plugin registration, 필요 시
|
|
342
|
+
5. app-local overrides
|
|
343
|
+
|
|
344
|
+
## 11. Verification checklist
|
|
345
|
+
|
|
346
|
+
새 앱에 적용한 뒤 최소한 아래를 확인합니다.
|
|
347
|
+
|
|
348
|
+
- Tailwind utility: `bg-tinyrack-surface`, `text-tinyrack-primary`, `rounded-tinyrack-box`가 실제 CSS로 생성되는가?
|
|
349
|
+
- daisyUI: `btn btn-primary`가 `tinyrack-dark`에서 blue primary로 보이는가?
|
|
350
|
+
- Mantine: `Button`, `Card`, `Stepper`가 dark surface에서 Tinyrack blue primary를 쓰는가?
|
|
351
|
+
- Starlight: docs shell 배경/텍스트/primary accent가 Tinyrack palette와 맞는가?
|
|
352
|
+
- build: `pnpm build` 또는 앱의 production build가 package subpath CSS를 resolve하는가?
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Storybook Cloudflare deployment
|
|
2
|
+
|
|
3
|
+
The Storybook for `@tinyrack/themes` is deployed as Cloudflare Workers static assets. This follows the same pattern used by `tinyrack/tinyauth` and `tinyrack/dotweave` homepages:
|
|
4
|
+
|
|
5
|
+
- build static output with Storybook
|
|
6
|
+
- point `wrangler.jsonc` assets at the generated directory
|
|
7
|
+
- deploy with `wrangler deploy` from GitHub Actions
|
|
8
|
+
|
|
9
|
+
## Cloudflare project
|
|
10
|
+
|
|
11
|
+
Wrangler config lives at the repository root:
|
|
12
|
+
|
|
13
|
+
```jsonc
|
|
14
|
+
{
|
|
15
|
+
"name": "tinyrack-themes-storybook",
|
|
16
|
+
"assets": {
|
|
17
|
+
"directory": "./storybook-static",
|
|
18
|
+
"html_handling": "auto-trailing-slash",
|
|
19
|
+
"not_found_handling": "404-page"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The Worker name is `tinyrack-themes-storybook`.
|
|
25
|
+
|
|
26
|
+
## Required GitHub secrets
|
|
27
|
+
|
|
28
|
+
Set these repository secrets before pushing a release tag:
|
|
29
|
+
|
|
30
|
+
| Secret | Purpose |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `CLOUDFLARE_API_TOKEN` | API token allowed to deploy Workers/static assets |
|
|
33
|
+
| `CLOUDFLARE_ACCOUNT_ID` | Cloudflare account ID for the target Worker |
|
|
34
|
+
|
|
35
|
+
Do not commit token or account values to the repository.
|
|
36
|
+
|
|
37
|
+
## GitHub Actions
|
|
38
|
+
|
|
39
|
+
The deploy workflow is `.github/workflows/deploy-storybook.yml`.
|
|
40
|
+
|
|
41
|
+
It runs only on release version tags:
|
|
42
|
+
|
|
43
|
+
- `v*.*.*` tag pushes
|
|
44
|
+
|
|
45
|
+
It does not run on `main` pushes or manual dispatch.
|
|
46
|
+
|
|
47
|
+
The workflow does the following:
|
|
48
|
+
|
|
49
|
+
1. Check out the repository.
|
|
50
|
+
2. Install pnpm `11.3.0` and Node.js `24`.
|
|
51
|
+
3. Install dependencies with `pnpm install --frozen-lockfile`.
|
|
52
|
+
4. Install browser test runtime with `pnpm exec playwright install --with-deps chromium`.
|
|
53
|
+
5. Run `pnpm run test`.
|
|
54
|
+
6. Run `pnpm run biome`.
|
|
55
|
+
7. Run `pnpm run build`.
|
|
56
|
+
8. Run `pnpm run storybook:build`.
|
|
57
|
+
9. Validate Wrangler packaging with `pnpm run deploy:storybook:dry-run`.
|
|
58
|
+
10. Deploy `storybook-static` with `pnpm run deploy:storybook`.
|
|
59
|
+
|
|
60
|
+
## Local validation
|
|
61
|
+
|
|
62
|
+
Build Storybook locally:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pnpm run storybook:build
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Validate Wrangler packaging without publishing:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pnpm run deploy:storybook:dry-run
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Deploy manually, when authenticated with Wrangler:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pnpm run deploy:storybook
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Notes
|
|
81
|
+
|
|
82
|
+
- `storybook-static` is a generated build output and should not be committed.
|
|
83
|
+
- `not_found_handling: "404-page"` keeps Cloudflare behavior aligned with the existing Tinyrack homepage Workers.
|
|
84
|
+
- The workflow uses the same `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` secret names as tinyauth and dotweave.
|
package/package.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tinyrack/themes",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Tinyrack design system themes for Mantine, daisyUI, and Astro Starlight.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Tinyrack",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"docs"
|
|
12
|
+
],
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"@astrojs/starlight": ">=0.40.0",
|
|
15
|
+
"@mantine/core": ">=9.0.0",
|
|
16
|
+
"astro": ">=6.0.0",
|
|
17
|
+
"daisyui": ">=5.0.0",
|
|
18
|
+
"react": ">=19.0.0",
|
|
19
|
+
"react-dom": ">=19.0.0",
|
|
20
|
+
"tailwindcss": ">=4.0.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@astrojs/starlight": "^0.40.0",
|
|
24
|
+
"@biomejs/biome": "^2.5.0",
|
|
25
|
+
"@mantine/core": "^9.3.2",
|
|
26
|
+
"@playwright/test": "^1.61.0",
|
|
27
|
+
"@storybook/addon-docs": "latest",
|
|
28
|
+
"@storybook/react-vite": "latest",
|
|
29
|
+
"@tailwindcss/vite": "^4.3.1",
|
|
30
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
31
|
+
"@testing-library/react": "^16.3.2",
|
|
32
|
+
"@types/node": "^24.13.2",
|
|
33
|
+
"@types/react": "^19.2.17",
|
|
34
|
+
"@types/react-dom": "^19.2.3",
|
|
35
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
36
|
+
"@vitest/browser-playwright": "^4.1.9",
|
|
37
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
38
|
+
"astro": "^6.4.8",
|
|
39
|
+
"daisyui": "^5.5.23",
|
|
40
|
+
"playwright": "^1.61.0",
|
|
41
|
+
"react": "^19.2.7",
|
|
42
|
+
"react-dom": "^19.2.7",
|
|
43
|
+
"storybook": "latest",
|
|
44
|
+
"tailwindcss": "^4.3.1",
|
|
45
|
+
"typescript": "^6.0.3",
|
|
46
|
+
"vite": "^8.0.16",
|
|
47
|
+
"vitest": "^4.1.9",
|
|
48
|
+
"vitest-browser-react": "^2.2.0",
|
|
49
|
+
"wrangler": "4.101.0"
|
|
50
|
+
},
|
|
51
|
+
"sideEffects": [
|
|
52
|
+
"**/*.css"
|
|
53
|
+
],
|
|
54
|
+
"exports": {
|
|
55
|
+
".": {
|
|
56
|
+
"types": "./dist/index.d.ts",
|
|
57
|
+
"import": "./dist/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./tokens": {
|
|
60
|
+
"types": "./dist/tokens/index.d.ts",
|
|
61
|
+
"import": "./dist/tokens/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./tailwind.css": "./dist/tailwind/theme.css",
|
|
64
|
+
"./tailwind/daisyui.css": "./dist/tailwind/daisyui.css",
|
|
65
|
+
"./tailwind/mantine.css": "./dist/tailwind/mantine.css",
|
|
66
|
+
"./mantine": {
|
|
67
|
+
"types": "./dist/mantine/index.d.ts",
|
|
68
|
+
"import": "./dist/mantine/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./mantine.css": "./dist/mantine/styles.css",
|
|
71
|
+
"./daisyui": {
|
|
72
|
+
"types": "./dist/daisyui/index.d.ts",
|
|
73
|
+
"import": "./dist/daisyui/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./daisyui.css": "./dist/daisyui/theme.css",
|
|
76
|
+
"./astro/starlight": {
|
|
77
|
+
"types": "./dist/astro/starlight/index.d.ts",
|
|
78
|
+
"import": "./dist/astro/starlight/index.js"
|
|
79
|
+
},
|
|
80
|
+
"./astro/starlight.css": "./dist/astro/starlight/theme.css",
|
|
81
|
+
"./package.json": "./package.json"
|
|
82
|
+
},
|
|
83
|
+
"publishConfig": {
|
|
84
|
+
"access": "public"
|
|
85
|
+
},
|
|
86
|
+
"scripts": {
|
|
87
|
+
"dev": "storybook dev -p 6006 --host 0.0.0.0",
|
|
88
|
+
"build": "pnpm build:types && pnpm build:css",
|
|
89
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
90
|
+
"build:css": "node scripts/copy-css.mjs",
|
|
91
|
+
"test": "pnpm test:unit && pnpm test:component",
|
|
92
|
+
"test:unit": "vitest run --project unit",
|
|
93
|
+
"test:component": "vitest run --project browser",
|
|
94
|
+
"test:coverage": "vitest run --project unit --project browser --coverage",
|
|
95
|
+
"storybook": "storybook dev -p 6006 --host 0.0.0.0",
|
|
96
|
+
"storybook:build": "storybook build",
|
|
97
|
+
"biome": "biome check .",
|
|
98
|
+
"biome:fix": "biome check --write .",
|
|
99
|
+
"test:astro-fixture": "pnpm --dir test/fixtures/astro-starlight-site build",
|
|
100
|
+
"test:showcase": "vitest run --project unit src/showcase/__tests__/showcase-registry.test.ts && vitest run --project browser src/showcase/__tests__/showcase-render.browser.test.tsx",
|
|
101
|
+
"generate:stories": "node scripts/generate-showcase-stories.mjs",
|
|
102
|
+
"deploy:storybook": "wrangler deploy",
|
|
103
|
+
"deploy:storybook:dry-run": "wrangler deploy --dry-run"
|
|
104
|
+
}
|
|
105
|
+
}
|