aibos-design-system 1.0.0 → 1.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,70 @@
1
+ /**
2
+ * AIBOS Design System - TypeScript Types for CSS Classes
3
+ *
4
+ * Provides type-safe class names for AIBOS design system
5
+ * Based on NEXTJS_DESIGN_SYSTEM_IMPROVEMENTS.md requirements
6
+ */
7
+
8
+ /**
9
+ * Status variant classes
10
+ * Uses space-separated modifier classes (e.g., "na-status ok")
11
+ */
12
+ export type AIBOSStatusVariant = 'ok' | 'bad' | 'warn' | 'pending';
13
+
14
+ /**
15
+ * Typography classes
16
+ */
17
+ export type AIBOSTypographyClass =
18
+ | 'na-h1'
19
+ | 'na-h2'
20
+ | 'na-h4'
21
+ | 'na-data'
22
+ | 'na-data-large'
23
+ | 'na-metadata';
24
+
25
+ /**
26
+ * Component classes
27
+ */
28
+ export type AIBOSComponentClass =
29
+ | 'na-card'
30
+ | 'na-btn'
31
+ | 'na-btn-primary'
32
+ | 'na-status'
33
+ | 'na-container';
34
+
35
+ /**
36
+ * Status class builder
37
+ * Returns space-separated classes as per AIBOS guidelines
38
+ */
39
+ export type StatusClass = `na-status ${AIBOSStatusVariant}`;
40
+
41
+ /**
42
+ * All AIBOS classes
43
+ */
44
+ export type AIBOSClass =
45
+ | AIBOSTypographyClass
46
+ | AIBOSComponentClass
47
+ | StatusClass
48
+ | `na-status ${AIBOSStatusVariant}`;
49
+
50
+ /**
51
+ * Helper type for building status classes
52
+ */
53
+ export function getStatusClass(variant: AIBOSStatusVariant): StatusClass {
54
+ return `na-status ${variant}` as StatusClass;
55
+ }
56
+
57
+ /**
58
+ * Type guard for status variants
59
+ */
60
+ export function isStatusVariant(value: string): value is AIBOSStatusVariant {
61
+ return ['ok', 'bad', 'warn', 'pending'].includes(value);
62
+ }
63
+
64
+ /**
65
+ * Type guard for typography classes
66
+ */
67
+ export function isTypographyClass(value: string): value is AIBOSTypographyClass {
68
+ return ['na-h1', 'na-h2', 'na-h4', 'na-data', 'na-data-large', 'na-metadata'].includes(value);
69
+ }
70
+
@@ -0,0 +1,83 @@
1
+ /**
2
+ * AIBOS Design System - Enhanced Design Tokens
3
+ *
4
+ * Type-safe design tokens for use in TypeScript/React applications
5
+ * Based on NEXTJS_DESIGN_SYSTEM_IMPROVEMENTS.md requirements
6
+ */
7
+
8
+ /**
9
+ * Color tokens
10
+ */
11
+ export const colors = {
12
+ success: 'var(--color-success)',
13
+ error: 'var(--color-error)',
14
+ warning: 'var(--color-warning)',
15
+ info: 'var(--color-info)',
16
+ primary: 'var(--color-primary)',
17
+ secondary: 'var(--color-secondary)',
18
+ foreground: 'var(--color-foreground)',
19
+ background: 'var(--color-background)',
20
+ muted: 'var(--color-muted)',
21
+ border: 'var(--color-border)',
22
+ } as const;
23
+
24
+ /**
25
+ * Spacing tokens
26
+ */
27
+ export const spacing = {
28
+ xs: 'var(--spacing-1)',
29
+ sm: 'var(--spacing-2)',
30
+ md: 'var(--spacing-4)',
31
+ lg: 'var(--spacing-6)',
32
+ xl: 'var(--spacing-8)',
33
+ '2xl': 'var(--spacing-12)',
34
+ } as const;
35
+
36
+ /**
37
+ * Typography tokens
38
+ */
39
+ export const typography = {
40
+ h1: {
41
+ size: '32px',
42
+ weight: 'semibold',
43
+ class: 'na-h1' as const,
44
+ },
45
+ h2: {
46
+ size: '24px',
47
+ weight: 'semibold',
48
+ class: 'na-h2' as const,
49
+ },
50
+ h4: {
51
+ size: '18px',
52
+ weight: 'semibold',
53
+ class: 'na-h4' as const,
54
+ },
55
+ data: {
56
+ size: '14px',
57
+ family: 'monospace',
58
+ class: 'na-data' as const,
59
+ },
60
+ dataLarge: {
61
+ size: '30px',
62
+ family: 'serif',
63
+ class: 'na-data-large' as const,
64
+ },
65
+ metadata: {
66
+ size: '11px',
67
+ weight: '500',
68
+ transform: 'uppercase',
69
+ class: 'na-metadata' as const,
70
+ },
71
+ } as const;
72
+
73
+ /**
74
+ * Design tokens object
75
+ */
76
+ export const designTokens = {
77
+ colors,
78
+ spacing,
79
+ typography,
80
+ } as const;
81
+
82
+ export type DesignTokens = typeof designTokens;
83
+
package/types/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * AIBOS Design System - TypeScript Types
3
+ *
4
+ * Central export for all TypeScript types
5
+ */
6
+
7
+ export * from './aibos-classes';
8
+ export * from './design-tokens';
9
+