@famgia/omnify-typescript 0.0.90 → 0.0.91
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.91",
|
|
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.101"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"zod": "^3.0.0"
|
|
@@ -11,6 +11,11 @@ alwaysApply: false
|
|
|
11
11
|
This design system follows **Japanese Business UI principles**: compact, functional, and minimal.
|
|
12
12
|
Primary color: Violet (#7C3AED).
|
|
13
13
|
|
|
14
|
+
> ⚠️ **CRITICAL RULES:**
|
|
15
|
+
> 1. **ALL colors MUST come from Ant Design theme tokens** - Never hardcode colors!
|
|
16
|
+
> 2. **Minimize inline styles** - Use Ant Design components and `styles` prop with tokens
|
|
17
|
+
> 3. **Use 4px grid system** - All spacing must be multiples of 4px
|
|
18
|
+
|
|
14
19
|
## Design Principles
|
|
15
20
|
|
|
16
21
|
### 日本のビジネスUI (Japanese Business UI)
|
|
@@ -431,6 +436,111 @@ Required fonts:
|
|
|
431
436
|
- Inter (English)
|
|
432
437
|
- Be Vietnam Pro (Vietnamese)
|
|
433
438
|
|
|
439
|
+
## 🚫 CRITICAL: Forbidden Practices
|
|
440
|
+
|
|
441
|
+
### ❌ ABSOLUTELY FORBIDDEN: Custom Colors
|
|
442
|
+
|
|
443
|
+
**NEVER add colors that are not from the Ant Design theme system.**
|
|
444
|
+
|
|
445
|
+
```tsx
|
|
446
|
+
// ❌ FORBIDDEN: Hardcoded colors
|
|
447
|
+
<div style={{ color: '#333333' }}>
|
|
448
|
+
<div style={{ backgroundColor: 'blue' }}>
|
|
449
|
+
<div style={{ borderColor: 'rgb(200, 200, 200)' }}>
|
|
450
|
+
<Text style={{ color: '#ff6b6b' }}>Error</Text>
|
|
451
|
+
|
|
452
|
+
// ❌ FORBIDDEN: Tailwind color classes
|
|
453
|
+
<div className="text-gray-500 bg-blue-100">
|
|
454
|
+
<div className="border-red-500">
|
|
455
|
+
|
|
456
|
+
// ✅ CORRECT: Use Ant Design theme tokens
|
|
457
|
+
import { theme } from 'antd';
|
|
458
|
+
const { token } = theme.useToken();
|
|
459
|
+
|
|
460
|
+
<div style={{ color: token.colorText }}>
|
|
461
|
+
<div style={{ backgroundColor: token.colorBgContainer }}>
|
|
462
|
+
<div style={{ borderColor: token.colorBorder }}>
|
|
463
|
+
<Text type="danger">Error</Text> // Use Ant Design's built-in types
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
**Available Ant Design Color Tokens:**
|
|
467
|
+
|
|
468
|
+
| Token | Usage |
|
|
469
|
+
|-------|-------|
|
|
470
|
+
| `token.colorPrimary` | Primary brand color |
|
|
471
|
+
| `token.colorSuccess` | Success states |
|
|
472
|
+
| `token.colorWarning` | Warning states |
|
|
473
|
+
| `token.colorError` | Error states |
|
|
474
|
+
| `token.colorText` | Primary text |
|
|
475
|
+
| `token.colorTextSecondary` | Secondary text |
|
|
476
|
+
| `token.colorTextTertiary` | Tertiary/disabled text |
|
|
477
|
+
| `token.colorBgContainer` | Container background |
|
|
478
|
+
| `token.colorBgLayout` | Layout background |
|
|
479
|
+
| `token.colorBorder` | Borders |
|
|
480
|
+
| `token.colorBorderSecondary` | Subtle borders |
|
|
481
|
+
|
|
482
|
+
### ❌ FORBIDDEN: Excessive Inline Styles
|
|
483
|
+
|
|
484
|
+
**Minimize `style` prop usage. Prefer Ant Design's component API.**
|
|
485
|
+
|
|
486
|
+
```tsx
|
|
487
|
+
// ❌ BAD: Inline styles everywhere
|
|
488
|
+
<Card style={{ padding: 24, margin: 16, borderRadius: 8 }}>
|
|
489
|
+
<div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
|
|
490
|
+
<span style={{ fontSize: 14, fontWeight: 500 }}>Title</span>
|
|
491
|
+
</div>
|
|
492
|
+
</Card>
|
|
493
|
+
|
|
494
|
+
// ✅ GOOD: Use Ant Design component props
|
|
495
|
+
<Card
|
|
496
|
+
styles={{ body: { padding: token.paddingLG } }}
|
|
497
|
+
style={{ marginBottom: token.marginLG }} // Only when necessary
|
|
498
|
+
>
|
|
499
|
+
<Flex gap="middle" align="center">
|
|
500
|
+
<Typography.Text strong>Title</Typography.Text>
|
|
501
|
+
</Flex>
|
|
502
|
+
</Card>
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
**When to use inline styles:**
|
|
506
|
+
|
|
507
|
+
| Situation | Allowed? | Alternative |
|
|
508
|
+
|-----------|----------|-------------|
|
|
509
|
+
| Component layout (flex, grid) | ⚠️ Limited | Use `<Flex>`, `<Space>`, `<Row>`/`<Col>` |
|
|
510
|
+
| Colors | ❌ NO | Use theme tokens or component types |
|
|
511
|
+
| Typography | ❌ NO | Use `<Typography.Text>`, `<Typography.Title>` |
|
|
512
|
+
| Spacing | ⚠️ Limited | Use Ant Design `styles` prop with tokens |
|
|
513
|
+
| Responsive | ❌ NO | Use Ant Design Grid or CSS modules |
|
|
514
|
+
|
|
515
|
+
**Allowed inline style patterns:**
|
|
516
|
+
|
|
517
|
+
```tsx
|
|
518
|
+
// ✅ Allowed: Token-based values only
|
|
519
|
+
<div style={{ marginBottom: token.marginLG }}>
|
|
520
|
+
<div style={{ padding: token.paddingMD }}>
|
|
521
|
+
|
|
522
|
+
// ✅ Allowed: Layout properties
|
|
523
|
+
<div style={{ flex: 1 }}>
|
|
524
|
+
<div style={{ width: '100%', maxWidth: 800 }}>
|
|
525
|
+
|
|
526
|
+
// ✅ Allowed: Component-specific overrides via styles prop
|
|
527
|
+
<Table styles={{ header: { background: token.colorBgLayout } }} />
|
|
528
|
+
<Card styles={{ body: { padding: 0 } }} />
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
### ❌ FORBIDDEN: CSS-in-JS Libraries for Styling
|
|
532
|
+
|
|
533
|
+
```tsx
|
|
534
|
+
// ❌ FORBIDDEN: Don't use styled-components, emotion, etc. for colors/spacing
|
|
535
|
+
const StyledCard = styled.div`
|
|
536
|
+
background: #f5f5f5; // NO!
|
|
537
|
+
padding: 20px; // NO!
|
|
538
|
+
`;
|
|
539
|
+
|
|
540
|
+
// ✅ CORRECT: Use Ant Design components + theme
|
|
541
|
+
<Card styles={{ body: { padding: token.paddingLG } }}>
|
|
542
|
+
```
|
|
543
|
+
|
|
434
544
|
## 🚨 Common Spacing Mistakes
|
|
435
545
|
|
|
436
546
|
### ❌ Mistake 1: Inconsistent Base Unit
|
|
@@ -499,20 +609,26 @@ gap: 16px; /* 4 × 4 */
|
|
|
499
609
|
|
|
500
610
|
### ✅ Do
|
|
501
611
|
|
|
502
|
-
- Use
|
|
612
|
+
- **Colors**: Use ONLY `token.*` from `theme.useToken()`
|
|
613
|
+
- **Spacing**: Use 4px grid (4, 8, 12, 16, 24, 32...)
|
|
614
|
+
- **Layout**: Use Ant Design `<Flex>`, `<Space>`, `<Row>`/`<Col>`
|
|
615
|
+
- **Typography**: Use `<Typography.Text>`, `<Typography.Title>`
|
|
616
|
+
- **Styles**: Use component `styles` prop with tokens
|
|
503
617
|
- Use compact spacing (8-16px for components)
|
|
504
618
|
- Use `gap` for flex/grid layouts
|
|
505
619
|
- Decrease spacing as you nest deeper
|
|
506
620
|
- Maintain consistent spacing ratios
|
|
507
|
-
- Use design tokens from ConfigProvider
|
|
508
621
|
- Keep shadows minimal or none
|
|
509
622
|
- Use subtle border radius (2-6px)
|
|
510
623
|
- Maintain high information density
|
|
511
624
|
- Use locale-specific fonts
|
|
512
|
-
- Follow HSL color harmony
|
|
513
625
|
|
|
514
|
-
### ❌ Don't
|
|
626
|
+
### ❌ Don't (FORBIDDEN)
|
|
515
627
|
|
|
628
|
+
- **NEVER** use hardcoded colors (`#333`, `blue`, `rgb()`)
|
|
629
|
+
- **NEVER** use Tailwind color classes (`text-gray-500`)
|
|
630
|
+
- **NEVER** create custom styled-components for basic styling
|
|
631
|
+
- **AVOID** excessive inline `style` props
|
|
516
632
|
- Use random pixel values (13px, 17px, etc.)
|
|
517
633
|
- Use excessive padding (>24px on components)
|
|
518
634
|
- Use margins on flex children (use gap instead)
|
|
@@ -522,7 +638,6 @@ gap: 16px; /* 4 × 4 */
|
|
|
522
638
|
- Use large border radius (>10px)
|
|
523
639
|
- Leave large empty spaces without purpose
|
|
524
640
|
- Mix warm and cool grays
|
|
525
|
-
- Use colors outside the harmony system
|
|
526
641
|
|
|
527
642
|
## Quick Reference
|
|
528
643
|
|