@polastack/design-system 0.1.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.
@@ -0,0 +1,395 @@
1
+ @import 'tailwindcss';
2
+
3
+ /* ============================================================
4
+ Dark Mode Variant
5
+ .dark クラスベースのダークモード切替
6
+ ============================================================ */
7
+
8
+ @custom-variant dark (&:where(.dark, .dark *));
9
+
10
+ /* ============================================================
11
+ Polastack Design System - Design Tokens
12
+ Tailwind CSS v4 @theme directive
13
+ ============================================================ */
14
+
15
+ @theme {
16
+ /* --------------------------------------------------------
17
+ Colors: Brand (Primary)
18
+ Teal系 - #1BA491をベースにしたPolastackブランドカラー
19
+ -------------------------------------------------------- */
20
+ --color-primary-50: #f0fdfb;
21
+ --color-primary-100: #cdfbf0;
22
+ --color-primary-200: #9bf7e2;
23
+ --color-primary-300: #61ebd0;
24
+ --color-primary-400: #2fd4ba;
25
+ --color-primary-500: #1BA491;
26
+ --color-primary-600: #138575;
27
+ --color-primary-700: #146b5f;
28
+ --color-primary-800: #15564e;
29
+ --color-primary-900: #134841;
30
+ --color-primary-950: #042c28;
31
+
32
+ /* --------------------------------------------------------
33
+ Colors: Neutral (Zinc系)
34
+ 高密度UIでの微妙なコントラスト差を表現する広いグレースケール
35
+ -------------------------------------------------------- */
36
+ --color-neutral-50: #fafafa;
37
+ --color-neutral-100: #f4f4f5;
38
+ --color-neutral-200: #e4e4e7;
39
+ --color-neutral-300: #d4d4d8;
40
+ --color-neutral-400: #a1a1aa;
41
+ --color-neutral-500: #71717a;
42
+ --color-neutral-600: #52525b;
43
+ --color-neutral-700: #3f3f46;
44
+ --color-neutral-800: #27272a;
45
+ --color-neutral-900: #18181b;
46
+ --color-neutral-950: #09090b;
47
+
48
+ /* --------------------------------------------------------
49
+ Colors: Semantic - Success (Green)
50
+ Primaryのティールと区別しやすい純粋なグリーン系
51
+ -------------------------------------------------------- */
52
+ --color-success-50: #f0fdf4;
53
+ --color-success-100: #dcfce7;
54
+ --color-success-200: #bbf7d0;
55
+ --color-success-300: #86efac;
56
+ --color-success-400: #4ade80;
57
+ --color-success-500: #22c55e;
58
+ --color-success-600: #16a34a;
59
+ --color-success-700: #15803d;
60
+ --color-success-800: #166534;
61
+ --color-success-900: #14532d;
62
+ --color-success-950: #052e16;
63
+
64
+ /* --------------------------------------------------------
65
+ Colors: Semantic - Warning (Amber)
66
+ -------------------------------------------------------- */
67
+ --color-warning-50: #fffbeb;
68
+ --color-warning-100: #fef3c7;
69
+ --color-warning-200: #fde68a;
70
+ --color-warning-300: #fcd34d;
71
+ --color-warning-400: #fbbf24;
72
+ --color-warning-500: #f59e0b;
73
+ --color-warning-600: #d97706;
74
+ --color-warning-700: #b45309;
75
+ --color-warning-800: #92400e;
76
+ --color-warning-900: #78350f;
77
+ --color-warning-950: #451a03;
78
+
79
+ /* --------------------------------------------------------
80
+ Colors: Semantic - Error (Red)
81
+ -------------------------------------------------------- */
82
+ --color-error-50: #fef2f2;
83
+ --color-error-100: #fee2e2;
84
+ --color-error-200: #fecaca;
85
+ --color-error-300: #fca5a5;
86
+ --color-error-400: #f87171;
87
+ --color-error-500: #ef4444;
88
+ --color-error-600: #dc2626;
89
+ --color-error-700: #b91c1c;
90
+ --color-error-800: #991b1b;
91
+ --color-error-900: #7f1d1d;
92
+ --color-error-950: #450a0a;
93
+
94
+ /* --------------------------------------------------------
95
+ Colors: Semantic - Info (Blue)
96
+ -------------------------------------------------------- */
97
+ --color-info-50: #eff6ff;
98
+ --color-info-100: #dbeafe;
99
+ --color-info-200: #bfdbfe;
100
+ --color-info-300: #93c5fd;
101
+ --color-info-400: #60a5fa;
102
+ --color-info-500: #3b82f6;
103
+ --color-info-600: #2563eb;
104
+ --color-info-700: #1d4ed8;
105
+ --color-info-800: #1e40af;
106
+ --color-info-900: #1e3a8a;
107
+ --color-info-950: #172554;
108
+
109
+ /* --------------------------------------------------------
110
+ Typography: Font Families
111
+ Inter(欧文) + Noto Sans JP(和文) で混在表示を最適化
112
+ -------------------------------------------------------- */
113
+ --font-sans: 'Inter', 'Noto Sans JP', ui-sans-serif, system-ui, sans-serif;
114
+ --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
115
+
116
+ /* --------------------------------------------------------
117
+ Typography: Font Sizes
118
+ base=14px - BtoB業務アプリの高密度表示に最適化
119
+ -------------------------------------------------------- */
120
+ --text-xs: 0.75rem;
121
+ --text-xs--line-height: 1rem;
122
+ --text-sm: 0.8125rem;
123
+ --text-sm--line-height: 1.25rem;
124
+ --text-base: 0.875rem;
125
+ --text-base--line-height: 1.25rem;
126
+ --text-lg: 1rem;
127
+ --text-lg--line-height: 1.5rem;
128
+ --text-xl: 1.125rem;
129
+ --text-xl--line-height: 1.75rem;
130
+ --text-2xl: 1.25rem;
131
+ --text-2xl--line-height: 1.75rem;
132
+ --text-3xl: 1.5rem;
133
+ --text-3xl--line-height: 2rem;
134
+
135
+ /* --------------------------------------------------------
136
+ Spacing: 4px Grid
137
+ -------------------------------------------------------- */
138
+ --spacing-0: 0px;
139
+ --spacing-px: 1px;
140
+ --spacing-0_5: 0.125rem;
141
+ --spacing-1: 0.25rem;
142
+ --spacing-1_5: 0.375rem;
143
+ --spacing-2: 0.5rem;
144
+ --spacing-2_5: 0.625rem;
145
+ --spacing-3: 0.75rem;
146
+ --spacing-3_5: 0.875rem;
147
+ --spacing-4: 1rem;
148
+ --spacing-5: 1.25rem;
149
+ --spacing-6: 1.5rem;
150
+ --spacing-7: 1.75rem;
151
+ --spacing-8: 2rem;
152
+ --spacing-9: 2.25rem;
153
+ --spacing-10: 2.5rem;
154
+ --spacing-11: 2.75rem;
155
+ --spacing-12: 3rem;
156
+ --spacing-14: 3.5rem;
157
+ --spacing-16: 4rem;
158
+ --spacing-20: 5rem;
159
+ --spacing-24: 6rem;
160
+
161
+ /* --------------------------------------------------------
162
+ Elevation: Shadows
163
+ -------------------------------------------------------- */
164
+ --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
165
+ --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
166
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
167
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
168
+ --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
169
+ --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
170
+ --shadow-drawer: 0 0 48px rgb(0 0 0 / 0.16);
171
+
172
+ /* --------------------------------------------------------
173
+ Elevation: Border Radius
174
+ -------------------------------------------------------- */
175
+ --radius-none: 0px;
176
+ --radius-sm: 0.25rem;
177
+ --radius-md: 0.375rem;
178
+ --radius-lg: 0.5rem;
179
+ --radius-xl: 0.75rem;
180
+ --radius-2xl: 1rem;
181
+ --radius-full: 9999px;
182
+
183
+ /* --------------------------------------------------------
184
+ Animation: Duration
185
+ -------------------------------------------------------- */
186
+ --duration-fast: 100ms;
187
+ --duration-normal: 200ms;
188
+ --duration-slow: 300ms;
189
+
190
+ /* --------------------------------------------------------
191
+ Animation: Easing
192
+ -------------------------------------------------------- */
193
+ --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
194
+ --ease-in: cubic-bezier(0.4, 0, 1, 1);
195
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
196
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
197
+
198
+ /* --------------------------------------------------------
199
+ Z-Index Scale
200
+ Drawer重ね表示パターン対応
201
+ -------------------------------------------------------- */
202
+ --z-dropdown: 50;
203
+ --z-sticky: 100;
204
+ --z-drawer: 200;
205
+ --z-modal: 300;
206
+ --z-popover: 400;
207
+ --z-toast: 500;
208
+ --z-tooltip: 600;
209
+
210
+ /* --------------------------------------------------------
211
+ PWA: Safe Area Insets
212
+ ノッチ端末・ホームバー端末のSafe Area対応
213
+ -------------------------------------------------------- */
214
+ --safe-area-top: env(safe-area-inset-top, 0px);
215
+ --safe-area-right: env(safe-area-inset-right, 0px);
216
+ --safe-area-bottom: env(safe-area-inset-bottom, 0px);
217
+ --safe-area-left: env(safe-area-inset-left, 0px);
218
+
219
+ /* --------------------------------------------------------
220
+ PWA: Touch Target
221
+ WCAG 2.5.5 準拠の最小タッチターゲットサイズ
222
+ -------------------------------------------------------- */
223
+ --touch-target-min: 44px;
224
+ --touch-target-comfortable: 48px;
225
+
226
+ /* --------------------------------------------------------
227
+ PWA: Bottom Navigation
228
+ -------------------------------------------------------- */
229
+ --bottom-nav-height: 56px;
230
+
231
+ /* --------------------------------------------------------
232
+ Animation: Keyframes
233
+ -------------------------------------------------------- */
234
+ --animate-fade-in: fade-in var(--duration-normal) var(--ease-out);
235
+ --animate-fade-out: fade-out var(--duration-normal) var(--ease-in);
236
+ --animate-slide-in-right: slide-in-right var(--duration-slow) var(--ease-out);
237
+ --animate-slide-out-right: slide-out-right var(--duration-slow) var(--ease-in);
238
+ --animate-slide-in-left: slide-in-left var(--duration-slow) var(--ease-out);
239
+ --animate-slide-out-left: slide-out-left var(--duration-slow) var(--ease-in);
240
+ }
241
+
242
+ /* ============================================================
243
+ Semantic Color Tokens
244
+ ライト/ダークモードで自動切替されるセマンティック変数
245
+ ============================================================ */
246
+
247
+ :root {
248
+ --color-surface: #ffffff;
249
+ --color-surface-raised: #ffffff;
250
+ --color-surface-sunken: var(--color-neutral-50);
251
+ --color-surface-muted: var(--color-neutral-100);
252
+ --color-on-surface: var(--color-neutral-900);
253
+ --color-on-surface-secondary: var(--color-neutral-600);
254
+ --color-on-surface-muted: var(--color-neutral-500);
255
+ --color-border: var(--color-neutral-200);
256
+ --color-border-input: var(--color-neutral-300);
257
+ --color-ring: var(--color-primary-500);
258
+ --color-ring-offset: #ffffff;
259
+ --color-surface-overlay: rgb(0 0 0 / 0.5);
260
+ --color-tooltip-bg: var(--color-neutral-900);
261
+ --color-tooltip-text: #ffffff;
262
+ --color-skeleton: var(--color-neutral-200);
263
+ }
264
+
265
+ .dark {
266
+ --color-surface: var(--color-neutral-950);
267
+ --color-surface-raised: var(--color-neutral-900);
268
+ --color-surface-sunken: var(--color-neutral-950);
269
+ --color-surface-muted: var(--color-neutral-800);
270
+ --color-on-surface: var(--color-neutral-50);
271
+ --color-on-surface-secondary: var(--color-neutral-400);
272
+ --color-on-surface-muted: var(--color-neutral-400);
273
+ --color-border: var(--color-neutral-800);
274
+ --color-border-input: var(--color-neutral-700);
275
+ --color-ring: var(--color-primary-400);
276
+ --color-ring-offset: var(--color-neutral-950);
277
+ --color-surface-overlay: rgb(0 0 0 / 0.6);
278
+ --color-tooltip-bg: var(--color-neutral-100);
279
+ --color-tooltip-text: var(--color-neutral-900);
280
+ --color-skeleton: var(--color-neutral-800);
281
+ color-scheme: dark;
282
+ }
283
+
284
+ @keyframes fade-in {
285
+ from { opacity: 0; }
286
+ to { opacity: 1; }
287
+ }
288
+
289
+ @keyframes fade-out {
290
+ from { opacity: 1; }
291
+ to { opacity: 0; }
292
+ }
293
+
294
+ @keyframes slide-in-right {
295
+ from { transform: translateX(100%); }
296
+ to { transform: translateX(0); }
297
+ }
298
+
299
+ @keyframes slide-out-right {
300
+ from { transform: translateX(0); }
301
+ to { transform: translateX(100%); }
302
+ }
303
+
304
+ @keyframes slide-in-left {
305
+ from { transform: translateX(-100%); }
306
+ to { transform: translateX(0); }
307
+ }
308
+
309
+ @keyframes slide-out-left {
310
+ from { transform: translateX(0); }
311
+ to { transform: translateX(-100%); }
312
+ }
313
+
314
+ /* ============================================================
315
+ Base Styles
316
+ ============================================================ */
317
+
318
+ @layer base {
319
+ *,
320
+ *::before,
321
+ *::after {
322
+ border-color: var(--color-border);
323
+ }
324
+
325
+ body {
326
+ font-family: var(--font-sans);
327
+ font-size: var(--text-base);
328
+ line-height: var(--text-base--line-height);
329
+ color: var(--color-on-surface);
330
+ background-color: var(--color-surface);
331
+ -webkit-font-smoothing: antialiased;
332
+ -moz-osx-font-smoothing: grayscale;
333
+ }
334
+ }
335
+
336
+ /* ============================================================
337
+ PWA: Standalone Mode
338
+ ============================================================ */
339
+
340
+ @media (display-mode: standalone) {
341
+ body {
342
+ /* PWAスタンドアロンモードではoverscrollを無効化 */
343
+ overscroll-behavior-y: contain;
344
+ /* ユーザー選択を制限(ネイティブアプリ的な挙動) */
345
+ -webkit-user-select: none;
346
+ user-select: none;
347
+ }
348
+
349
+ /* テキスト入力要素ではユーザー選択を許可 */
350
+ input,
351
+ textarea,
352
+ [contenteditable='true'] {
353
+ -webkit-user-select: text;
354
+ user-select: text;
355
+ }
356
+ }
357
+
358
+ /* ============================================================
359
+ PWA: Viewport Height
360
+ モバイルブラウザのアドレスバーを考慮した実高さ
361
+ ============================================================ */
362
+
363
+ @supports (height: 100dvh) {
364
+ :root {
365
+ --vh-full: 100dvh;
366
+ }
367
+ }
368
+
369
+ @supports not (height: 100dvh) {
370
+ :root {
371
+ --vh-full: 100vh;
372
+ }
373
+ }
374
+
375
+ /* ============================================================
376
+ PWA: Touch Device Variant
377
+ タッチデバイスでのタッチターゲット最適化
378
+ ============================================================ */
379
+
380
+ @custom-variant touch (@media (pointer: coarse));
381
+
382
+ /* ============================================================
383
+ Accessibility: Reduced Motion
384
+ ============================================================ */
385
+
386
+ @media (prefers-reduced-motion: reduce) {
387
+ *,
388
+ *::before,
389
+ *::after {
390
+ animation-duration: 0.01ms !important;
391
+ animation-iteration-count: 1 !important;
392
+ transition-duration: 0.01ms !important;
393
+ scroll-behavior: auto !important;
394
+ }
395
+ }