@famgia/omnify-typescript 0.0.89 → 0.0.90
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@famgia/omnify-typescript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.90",
|
|
4
4
|
"description": "TypeScript type definitions generator for Omnify schemas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"directory": "packages/typescript-generator"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@famgia/omnify-types": "0.0.
|
|
51
|
+
"@famgia/omnify-types": "0.0.100"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"zod": "^3.0.0"
|
|
@@ -100,25 +100,212 @@ const fontFamilies = {
|
|
|
100
100
|
|
|
101
101
|
## Spacing System
|
|
102
102
|
|
|
103
|
-
###
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
103
|
+
### 間 (Ma) - Japanese Whitespace Philosophy
|
|
104
|
+
|
|
105
|
+
Japanese design embraces **間 (Ma)** - the concept of meaningful negative space. Unlike Western design that fills every gap, Japanese design uses whitespace purposefully:
|
|
106
|
+
|
|
107
|
+
1. **機能的余白 (Functional Whitespace)** - Empty space that guides the eye
|
|
108
|
+
2. **呼吸 (Breathing Room)** - Allowing elements to "breathe"
|
|
109
|
+
3. **密度バランス (Density Balance)** - High info density WITH visual rest
|
|
110
|
+
|
|
111
|
+
> **Key Insight**: Japanese business UIs are compact but NOT cramped. Every margin has purpose.
|
|
112
|
+
|
|
113
|
+
### 4px Base Grid System
|
|
114
|
+
|
|
115
|
+
All spacing values are multiples of **4px** for consistency and alignment:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
Base Unit: 4px
|
|
119
|
+
Scale: 4, 8, 12, 16, 24, 32, 48, 64, 96
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Spacing Scale
|
|
123
|
+
|
|
124
|
+
| Token | Value | px | Usage |
|
|
125
|
+
| ----------- | ----- | ---- | ---------------------------------- |
|
|
126
|
+
| `space-1` | 0.25 | 4px | Micro spacing (icon-text gap) |
|
|
127
|
+
| `space-2` | 0.5 | 8px | Tight spacing (related items) |
|
|
128
|
+
| `space-3` | 0.75 | 12px | Default internal spacing |
|
|
129
|
+
| `space-4` | 1 | 16px | Component spacing |
|
|
130
|
+
| `space-6` | 1.5 | 24px | Section spacing |
|
|
131
|
+
| `space-8` | 2 | 32px | Large section gaps |
|
|
132
|
+
| `space-12` | 3 | 48px | Page section dividers |
|
|
133
|
+
| `space-16` | 4 | 64px | Major layout sections |
|
|
134
|
+
|
|
135
|
+
### Ant Design Token Mapping
|
|
136
|
+
|
|
137
|
+
| Token | Value | Usage |
|
|
138
|
+
| --------------- | ----- | ------------------------ |
|
|
139
|
+
| `paddingXXS` | 4px | Micro padding |
|
|
140
|
+
| `paddingXS` | 8px | Tight padding |
|
|
141
|
+
| `paddingSM` | 12px | Small padding |
|
|
142
|
+
| `padding` | 16px | Default padding |
|
|
143
|
+
| `paddingMD` | 20px | Medium padding |
|
|
144
|
+
| `paddingLG` | 24px | Large padding |
|
|
145
|
+
| `paddingXL` | 32px | Extra large padding |
|
|
146
|
+
| `marginXXS` | 4px | Micro margin |
|
|
147
|
+
| `marginXS` | 8px | Tight margin |
|
|
148
|
+
| `marginSM` | 12px | Small margin |
|
|
149
|
+
| `margin` | 16px | Default margin |
|
|
150
|
+
| `marginMD` | 20px | Medium margin |
|
|
151
|
+
| `marginLG` | 24px | Large margin |
|
|
152
|
+
| `marginXL` | 32px | Extra large margin |
|
|
153
|
+
|
|
154
|
+
### Layout Spacing Guidelines
|
|
155
|
+
|
|
156
|
+
#### Content Areas
|
|
157
|
+
|
|
158
|
+
| Element | Padding | Margin |
|
|
159
|
+
| -------------------- | ------------- | -------------- |
|
|
160
|
+
| Page content | 24px | - |
|
|
161
|
+
| Card content | 16px | 0 0 16px |
|
|
162
|
+
| Modal content | 24px | - |
|
|
163
|
+
| Sidebar content | 12px | - |
|
|
164
|
+
| Table cell | 8px 12px | - |
|
|
165
|
+
| Form item | - | 0 0 16px |
|
|
166
|
+
| Button | 4px 12px | - |
|
|
167
|
+
| Input | 4px 8px | - |
|
|
168
|
+
|
|
169
|
+
#### Vertical Rhythm (Japanese Business UI)
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
Header height: 48px (compact)
|
|
173
|
+
Breadcrumb: 36px
|
|
174
|
+
Page title area: 48px
|
|
175
|
+
Card title: 40px
|
|
176
|
+
Table header: 40px
|
|
177
|
+
Table row: 44px (compact)
|
|
178
|
+
Form row: 40px
|
|
179
|
+
Footer: 48px
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Component Internal Spacing
|
|
183
|
+
|
|
184
|
+
#### Cards
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
// Japanese business style - compact but clear
|
|
188
|
+
Card: {
|
|
189
|
+
paddingLG: 16, // ✅ NOT 24px (too spacious)
|
|
190
|
+
headerHeight: 40,
|
|
191
|
+
actionsBorderTop: true,
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### Forms
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
// Dense but organized
|
|
199
|
+
Form: {
|
|
200
|
+
itemMarginBottom: 16, // Row spacing
|
|
201
|
+
verticalLabelPadding: "0 0 4px", // Label-input gap
|
|
202
|
+
labelHeight: 24,
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### Tables
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
// High-density data display
|
|
210
|
+
Table: {
|
|
211
|
+
cellPaddingBlock: 8, // Vertical
|
|
212
|
+
cellPaddingInline: 12, // Horizontal
|
|
213
|
+
headerBg: "#F8F7FA",
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Spacing Patterns
|
|
218
|
+
|
|
219
|
+
#### 親子関係 (Parent-Child Relationship)
|
|
220
|
+
|
|
221
|
+
```css
|
|
222
|
+
/* Parent containers have larger padding than children */
|
|
223
|
+
.page-container { padding: 24px; } /* Outer */
|
|
224
|
+
.section { padding: 16px; margin-bottom: 24px; } /* Middle */
|
|
225
|
+
.card { padding: 16px; margin-bottom: 16px; } /* Inner */
|
|
226
|
+
.card-item { padding: 8px; } /* Deepest */
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### 近接の法則 (Law of Proximity)
|
|
230
|
+
|
|
231
|
+
Related items should be closer together than unrelated items:
|
|
232
|
+
|
|
233
|
+
```css
|
|
234
|
+
/* ✅ GOOD: Related items grouped */
|
|
235
|
+
.form-group { margin-bottom: 24px; } /* Group separation */
|
|
236
|
+
.form-item { margin-bottom: 12px; } /* Item separation within group */
|
|
237
|
+
|
|
238
|
+
/* ❌ BAD: Equal spacing loses relationship */
|
|
239
|
+
.form-item { margin-bottom: 16px; } /* Everything looks the same */
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
#### 段落間隔 (Section Spacing)
|
|
243
|
+
|
|
244
|
+
```css
|
|
245
|
+
/* Page sections */
|
|
246
|
+
.section + .section { margin-top: 32px; }
|
|
247
|
+
|
|
248
|
+
/* Card sections */
|
|
249
|
+
.card + .card { margin-top: 16px; }
|
|
250
|
+
|
|
251
|
+
/* Within card sections */
|
|
252
|
+
.card-section + .card-section { margin-top: 16px; }
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Gap Utilities (CSS/Tailwind)
|
|
256
|
+
|
|
257
|
+
Use `gap` instead of margins for flex/grid layouts:
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
// ✅ GOOD: Use gap
|
|
261
|
+
<Space size={8}> {/* or "small" */}
|
|
262
|
+
<Flex gap={12}>
|
|
263
|
+
<div style={{ display: 'flex', gap: '16px' }}>
|
|
264
|
+
|
|
265
|
+
// ❌ BAD: Margin on children
|
|
266
|
+
<div style={{ marginRight: 16 }}>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
| Ant Design Space | Value | Usage |
|
|
270
|
+
| ---------------- | ----- | ------------------- |
|
|
271
|
+
| `small` | 8px | Tight grouping |
|
|
272
|
+
| `middle` | 16px | Default grouping |
|
|
273
|
+
| `large` | 24px | Loose grouping |
|
|
274
|
+
|
|
275
|
+
### Responsive Spacing
|
|
276
|
+
|
|
277
|
+
Japanese design maintains density across breakpoints:
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
const responsiveSpacing = {
|
|
281
|
+
// Mobile-first, then scale up slightly
|
|
282
|
+
mobile: {
|
|
283
|
+
pagePadding: 16,
|
|
284
|
+
cardPadding: 12,
|
|
285
|
+
gap: 12,
|
|
286
|
+
},
|
|
287
|
+
tablet: {
|
|
288
|
+
pagePadding: 20,
|
|
289
|
+
cardPadding: 16,
|
|
290
|
+
gap: 16,
|
|
291
|
+
},
|
|
292
|
+
desktop: {
|
|
293
|
+
pagePadding: 24,
|
|
294
|
+
cardPadding: 16,
|
|
295
|
+
gap: 16,
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
> **Note**: Japanese business UIs don't dramatically increase spacing on larger screens. Maintain density.
|
|
301
|
+
|
|
302
|
+
### Layout Structure
|
|
303
|
+
|
|
304
|
+
- Content margin: `24px` (page level)
|
|
305
|
+
- Content padding: `16px` (component level)
|
|
120
306
|
- Header height: `48px`
|
|
121
|
-
- Sidebar width: `
|
|
307
|
+
- Sidebar width: `200px`
|
|
308
|
+
- Gutter (column gap): `16px`
|
|
122
309
|
|
|
123
310
|
## Border Radius
|
|
124
311
|
|
|
@@ -244,11 +431,80 @@ Required fonts:
|
|
|
244
431
|
- Inter (English)
|
|
245
432
|
- Be Vietnam Pro (Vietnamese)
|
|
246
433
|
|
|
434
|
+
## 🚨 Common Spacing Mistakes
|
|
435
|
+
|
|
436
|
+
### ❌ Mistake 1: Inconsistent Base Unit
|
|
437
|
+
|
|
438
|
+
```css
|
|
439
|
+
/* ❌ BAD: Random values */
|
|
440
|
+
padding: 13px;
|
|
441
|
+
margin: 7px;
|
|
442
|
+
gap: 15px;
|
|
443
|
+
|
|
444
|
+
/* ✅ GOOD: 4px multiples */
|
|
445
|
+
padding: 12px; /* 4 × 3 */
|
|
446
|
+
margin: 8px; /* 4 × 2 */
|
|
447
|
+
gap: 16px; /* 4 × 4 */
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### ❌ Mistake 2: Too Much Whitespace
|
|
451
|
+
|
|
452
|
+
```css
|
|
453
|
+
/* ❌ BAD: Western "airy" design */
|
|
454
|
+
.card { padding: 32px; }
|
|
455
|
+
.section { margin-bottom: 48px; }
|
|
456
|
+
|
|
457
|
+
/* ✅ GOOD: Japanese compact design */
|
|
458
|
+
.card { padding: 16px; }
|
|
459
|
+
.section { margin-bottom: 24px; }
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### ❌ Mistake 3: Using Margin Instead of Gap
|
|
463
|
+
|
|
464
|
+
```tsx
|
|
465
|
+
// ❌ BAD: Margin on each child (last-child issues)
|
|
466
|
+
{items.map(item => <Item style={{ marginRight: 16 }} />)}
|
|
467
|
+
|
|
468
|
+
// ✅ GOOD: Gap on parent
|
|
469
|
+
<Flex gap={16}>
|
|
470
|
+
{items.map(item => <Item />)}
|
|
471
|
+
</Flex>
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### ❌ Mistake 4: Ignoring Visual Hierarchy
|
|
475
|
+
|
|
476
|
+
```css
|
|
477
|
+
/* ❌ BAD: Same spacing everywhere */
|
|
478
|
+
.page { padding: 16px; }
|
|
479
|
+
.card { padding: 16px; }
|
|
480
|
+
.item { padding: 16px; }
|
|
481
|
+
|
|
482
|
+
/* ✅ GOOD: Decreasing spacing as you nest deeper */
|
|
483
|
+
.page { padding: 24px; }
|
|
484
|
+
.card { padding: 16px; }
|
|
485
|
+
.item { padding: 8px; }
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### ❌ Mistake 5: Fixed Padding Everywhere
|
|
489
|
+
|
|
490
|
+
```typescript
|
|
491
|
+
// ❌ BAD: Hardcoding
|
|
492
|
+
<Card style={{ padding: 24 }}>
|
|
493
|
+
|
|
494
|
+
// ✅ GOOD: Use design tokens
|
|
495
|
+
<Card styles={{ body: { padding: token.paddingLG } }}>
|
|
496
|
+
```
|
|
497
|
+
|
|
247
498
|
## Do's and Don'ts
|
|
248
499
|
|
|
249
500
|
### ✅ Do
|
|
250
501
|
|
|
251
|
-
- Use
|
|
502
|
+
- Use 4px grid (4, 8, 12, 16, 24, 32...)
|
|
503
|
+
- Use compact spacing (8-16px for components)
|
|
504
|
+
- Use `gap` for flex/grid layouts
|
|
505
|
+
- Decrease spacing as you nest deeper
|
|
506
|
+
- Maintain consistent spacing ratios
|
|
507
|
+
- Use design tokens from ConfigProvider
|
|
252
508
|
- Keep shadows minimal or none
|
|
253
509
|
- Use subtle border radius (2-6px)
|
|
254
510
|
- Maintain high information density
|
|
@@ -257,10 +513,14 @@ Required fonts:
|
|
|
257
513
|
|
|
258
514
|
### ❌ Don't
|
|
259
515
|
|
|
260
|
-
- Use
|
|
516
|
+
- Use random pixel values (13px, 17px, etc.)
|
|
517
|
+
- Use excessive padding (>24px on components)
|
|
518
|
+
- Use margins on flex children (use gap instead)
|
|
519
|
+
- Apply same spacing at all nesting levels
|
|
520
|
+
- Hardcode spacing values in components
|
|
261
521
|
- Use heavy shadows
|
|
262
522
|
- Use large border radius (>10px)
|
|
263
|
-
- Leave large empty spaces
|
|
523
|
+
- Leave large empty spaces without purpose
|
|
264
524
|
- Mix warm and cool grays
|
|
265
525
|
- Use colors outside the harmony system
|
|
266
526
|
|
|
@@ -282,8 +542,37 @@ const textPrimary = "#1E1B2E";
|
|
|
282
542
|
const bgLayout = "#F8F7FA";
|
|
283
543
|
const border = "#E5E7EB";
|
|
284
544
|
|
|
285
|
-
//
|
|
545
|
+
// Control sizes
|
|
286
546
|
const controlHeight = 32;
|
|
287
547
|
const borderRadius = 4;
|
|
288
|
-
|
|
548
|
+
|
|
549
|
+
// Spacing (4px grid) - 間 (Ma)
|
|
550
|
+
const spacing = {
|
|
551
|
+
xxs: 4, // Micro
|
|
552
|
+
xs: 8, // Tight
|
|
553
|
+
sm: 12, // Small
|
|
554
|
+
md: 16, // Default ⭐
|
|
555
|
+
lg: 24, // Large
|
|
556
|
+
xl: 32, // Extra large
|
|
557
|
+
xxl: 48, // Section divider
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
// Common use cases
|
|
561
|
+
const pagePadding = 24; // Page content
|
|
562
|
+
const cardPadding = 16; // Card body
|
|
563
|
+
const componentGap = 16; // Between components
|
|
564
|
+
const itemGap = 8; // Between items in list
|
|
565
|
+
const iconTextGap = 4; // Icon to text
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Spacing Cheat Sheet
|
|
569
|
+
|
|
570
|
+
```
|
|
571
|
+
Icon ↔ Text: 4px
|
|
572
|
+
Related items: 8px
|
|
573
|
+
Form items: 12px
|
|
574
|
+
Components: 16px
|
|
575
|
+
Sections: 24px
|
|
576
|
+
Page sections: 32px
|
|
577
|
+
Major areas: 48px
|
|
289
578
|
```
|