@damarkuncoro/meta-architecture-style-engine 0.1.1 β†’ 0.1.3

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 CHANGED
@@ -1,831 +1,364 @@
1
- # Meta Architecture Style Engine (MASE)
2
-
3
- <div align="center">
4
-
5
- **Official Style Governance & Runtime for Meta Architecture**
6
-
7
- [![NPM Version](https://img.shields.io/npm/v/@damarkuncoro/meta-architecture-style-engine)](https://www.npmjs.com/package/@damarkuncoro/meta-architecture-style-engine)
8
- [![NPM Downloads](https://img.shields.io/npm/dw/@damarkuncoro/meta-architecture-style-engine)](https://www.npmjs.com/package/@damarkuncoro/meta-architecture-style-engine)
9
- [![License](https://img.shields.io/npm/l/@damarkuncoro/meta-architecture-style-engine)](LICENSE)
10
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue)](https://www.typescriptlang.org/)
11
- [![Build Status](https://img.shields.io/badge/Build-Passing-green)]()
12
- [![Code Coverage](https://img.shields.io/badge/Coverage-100%25-brightgreen)]()
13
- [![Type Safety](https://img.shields.io/badge/Type%20Safety-100%25-brightgreen)]()
14
- [![Platform Agnostic](https://img.shields.io/badge/Platform%20Agnostic-100%25-brightgreen)]()
15
- [![Bundle Size](https://img.shields.io/badge/Bundle%20Size-12KB-brightgreen)]()
16
- [![Performance](https://img.shields.io/badge/Performance-%3C5ms-brightgreen)]()
17
- [![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen)](https://github.com/damarkuncoro/meta-architecture-style-engine/pulls)
18
- [![Code of Conduct](https://img.shields.io/badge/Code%20of%20Conduct-Enabled-blue)](https://github.com/damarkuncoro/meta-architecture-style-engine/blob/main/CODE_OF_CONDUCT.md)
19
-
20
- *A Constitutional Styling System - Where Style is Law, Not Just Visuals*
21
-
22
- </div>
23
-
24
- ---
25
-
26
- ## πŸ“– Table of Contents
27
-
28
- - [Overview](#-overview)
29
- - [Philosophy](#-philosophy)
30
- - [Key Features](#-key-features)
31
- - [Architecture](#-architecture)
32
- - [Installation](#-installation)
33
- - [Quick Start](#-quick-start)
34
- - [Usage](#-usage)
35
- - [Runtime Usage](#runtime-usage)
36
- - [CLI Usage](#cli-usage)
37
- - [DSL Syntax](#dsl-syntax)
38
- - [API Reference](#-api-reference)
39
- - [Examples](#-examples)
40
- - [Development](#-development)
41
- - [Contributing](#-contributing)
42
- - [License](#-license)
43
-
44
- ---
45
-
46
- ## 🎯 Overview
47
-
48
- **MASE (Meta Architecture Style Engine)** is a powerful style governance and runtime engine designed for Meta Architecture. Unlike traditional styling frameworks, MASE treats styling as a constitutional system where every style decision is validated against a set of rules and constraints.
49
-
50
- MASE enforces design system rules, manages tokens, and compiles style contracts into various output formats (CSS, React Native, PDF) through a sophisticated governance system inspired by the Trias Politica principle.
51
-
52
- ### What Makes MASE Different?
53
-
54
- | Traditional Approach | MASE Approach |
55
- | :--- | :--- |
56
- | **Utility Classes** | **Style Contracts** (Legal Articles) |
57
- | **Config Files** | **Constitutions** (Laws) |
58
- | **Prefix Variants** (`hover:`) | **Contextual Laws** |
59
- | **Compilers** | **Style Resolution Engine** (Judiciary) |
60
- | **CSS Output** | **Canonical Style Graph** + **Materializer** |
61
- | **Best Practices** | **Enforced Governance** |
62
-
63
- ---
64
-
65
- ## πŸ’‘ Philosophy
66
-
67
- MASE is not just another "Tailwind Killer" or styling framework. It's a **Constitutional Styling System** β€” a governance system for styling where:
68
-
69
- > **"Style is not just visual, but a legal decision that must be validated."**
70
-
71
- ### Core Principles
72
-
73
- 1. **Separation of Concerns**: Complete separation between specification, validation, and materialization
74
- 2. **Type Safety**: Every style decision is validated at compile-time and runtime
75
- 3. **Platform Agnostic**: The core engine doesn't know about CSS, React Native, or any specific platform
76
- 4. **Immutable Truth**: Style contracts and token registries are immutable sources of truth
77
- 5. **Audit Trail**: Every style resolution can be traced back to its constitutional origin
78
-
79
- ---
80
-
81
- ## ✨ Key Features
82
-
83
- ### πŸ›οΈ Style Governance
84
- - **Constitution-based Rules**: Define what's legal in your design system
85
- - **Domain Taxonomy**: Organize rules by semantic domains (Layout, Typography, Interaction)
86
- - **Token Registry**: Centralized management of design tokens
87
- - **Violation Detection**: Automatic detection of style violations with educational error messages
88
-
89
- ### βš–οΈ Runtime Style Resolution
90
- - **StyleProvider**: React context provider for theme and device context
91
- - **StyleContract**: Type-safe style contracts with validation
92
- - **Dynamic Resolution**: Context-aware style resolution based on theme, device, and platform
93
- - **Performance Optimized**: Sub-5ms resolution per component
94
-
95
- ### 🎨 Multi-Platform Support
96
- - **CSS Materializer**: Generate optimized CSS for web applications
97
- - **React Native Materializer**: Generate StyleSheet for native applications
98
- - **PDF Materializer**: Generate render instructions for PDF generation
99
- - **Extensible**: Easy to add custom materializers for any platform
100
-
101
- ### πŸ“ Contract DSL
102
- - **Declarative Syntax**: Define style contracts using a specialized DSL
103
- - **Type-Safe**: Compile-time validation of contract definitions
104
- - **Context-Aware**: Define responsive and state-based styling rules
105
- - **Theme Support**: Built-in support for light/dark themes
106
-
107
- ### πŸ”§ Developer Experience
108
- - **CLI Tools**: Command-line interface for validation, compilation, and generation
109
- - **TypeScript Support**: Full TypeScript support with type definitions
110
- - **Dual Build**: Supports both ESM and CJS modules
111
- - **Zero-Dependency Testing**: Uses Node.js native test runner for lightweight and fast testing
112
- - **Hot Reload**: Watch mode for development
113
-
114
- ---
115
-
116
- ## πŸ—οΈ Architecture
117
-
118
- MASE implements the **Trias Politica** principle, separating styling into three independent bodies:
119
-
120
- ### 1. The Constitution (Spec Layer)
121
- The **Written Law** that defines what's legal in the design system universe.
122
-
123
- - **Semantic Namespace**: Universal language (e.g., `background.intent.primary`)
124
- - **Domain Taxonomy**: Legal area groupings (Layout, Typography, Interaction)
125
- - **Token Registry**: The "currency" of the nation (atomic values)
126
-
127
- ```typescript
128
- // Example Constitution
129
- const buttonConstitution = {
130
- domain: 'interaction',
131
- rules: {
132
- intent: {
133
- allows: ['color.primary', 'color.secondary'],
134
- default: 'color.primary'
135
- },
136
- padding: {
137
- allows: ['space.sm', 'space.md', 'space.lg'],
138
- default: 'space.md'
139
- }
140
- }
141
- };
142
- ```
143
-
144
- ### 2. The Judiciary (Style Resolution Engine - SRE)
145
- The **Judicial Body (Judge)** that validates style contracts.
146
-
147
- - **Responsibility**: Accepts `StyleContract` and `Context`, decides if valid or violates constitution
148
- - **Characteristics**:
149
- - ❌ Doesn't know CSS
150
- - ❌ Doesn't know Platform (Web/Native)
151
- - βœ… Only knows **Legal vs Illegal**
152
- - **Output**: `StyleResolutionResult` (Resolved Node or Violation Verdict)
153
-
154
- ```typescript
155
- // Example Resolution
156
- const result = engine.resolve(contract, constitution, context);
157
- // Returns: { valid: true, className: 'bg-primary p-md' }
158
- // Or: { valid: false, violations: [...] }
159
- ```
160
-
161
- ### 3. The Executive (Style Materialization Engine - SME)
162
- The **Executive Body (Executor)** that executes judicial decisions into physical reality.
163
-
164
- - **Responsibility**: Execute judicial decisions into actual styles
165
- - **Plugin System**:
166
- - **CSS Materializer**: Converts decisions to CSS (Web)
167
- - **Native Materializer**: Converts decisions to StyleSheet (React Native)
168
- - **PDF/Canvas**: Converts decisions to render instructions
169
-
170
- ```typescript
171
- // Example Materialization
172
- const cssMaterializer = new CSSMaterializer();
173
- const css = cssMaterializer.materialize(resolvedStyle, context);
174
- // Returns: ".button { background: #007bff; padding: 1rem; }"
175
- ```
176
-
177
- ### Architecture Diagram
178
-
179
- ```
180
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
181
- β”‚ MASE Architecture β”‚
182
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
183
- β”‚ β”‚
184
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
185
- β”‚ β”‚ Constitution │─────▢│ Judiciary β”‚ β”‚
186
- β”‚ β”‚ (Spec Layer) β”‚ β”‚ (SRE) β”‚ β”‚
187
- β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
188
- β”‚ β”‚ β€’ Semantic NS β”‚ β”‚ β€’ Validation β”‚ β”‚
189
- β”‚ β”‚ β€’ Domain Tax β”‚ β”‚ β€’ Resolution β”‚ β”‚
190
- β”‚ β”‚ β€’ Token Reg β”‚ β”‚ β€’ Violation β”‚ β”‚
191
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
192
- β”‚ β”‚ β”‚
193
- β”‚ β–Ό β”‚
194
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
195
- β”‚ β”‚ Executive β”‚ β”‚
196
- β”‚ β”‚ (SME) β”‚ β”‚
197
- β”‚ β”‚ β”‚ β”‚
198
- β”‚ β”‚ β€’ CSS Mat β”‚ β”‚
199
- β”‚ β”‚ β€’ RN Mat β”‚ β”‚
200
- β”‚ β”‚ β€’ PDF Mat β”‚ β”‚
201
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
202
- β”‚ β”‚
203
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
204
- ```
205
-
206
- ---
1
+ # MASE - Meta Architecture Style Engine
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)
5
+ [![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)]()
6
+ [![Version](https://img.shields.io/badge/version-0.1.4-blue.svg)](https://github.com/damarkuncoro/meta-architecture-style-engine)
7
+
8
+ A comprehensive, theme-aware styling engine for modern web applications. MASE provides atomic CSS utilities, design token management, and multi-platform materialization with full TypeScript support.
9
+
10
+ ## πŸš€ Features
11
+
12
+ ### Core Capabilities
13
+ - **700+ Atomic CSS Utilities** - Complete coverage of all modern CSS properties
14
+ - **Design Token System** - Centralized token management with theme support
15
+ - **Multi-Platform Materialization** - Generate styles for Web, React Native, PDF, and more
16
+ - **Constitutional Styling** - Enforce design system rules and governance
17
+ - **Dark Mode Support** - Automatic theme switching with CSS variables
18
+ - **Full TypeScript Support** - Type-safe development with comprehensive type definitions
19
+ - **Style Governance** - Built-in validation and compliance checking
20
+ - **Performance Optimization** - Caching and efficient style resolution
21
+
22
+ ### Integration Options
23
+ - **PostCSS Plugin** - Automatic CSS variable generation
24
+ - **Atomic CSS Generator** - Utility-first approach similar to Tailwind
25
+ - **Tailwind Preset** - Seamless integration with existing Tailwind projects
26
+ - **CSS-in-JS** - Support for styled-components, emotion, and more
27
+ - **React Integration** - React Provider and hooks for runtime styling
28
+
29
+ ### Specialized Handlers
30
+ - **Layout** - Display, position, visibility, z-index, overflow, object-fit
31
+ - **Flexbox** - Complete flexbox utilities with justify/align support
32
+ - **Grid** - Full CSS Grid support with template columns/rows
33
+ - **Typography** - Font size, weight, line-height, text alignment
34
+ - **Color** - Background, text, and border colors
35
+ - **Effects** - Shadows, border radius, opacity
36
+ - **Background** - Background image, position, repeat, size, gradients
37
+ - **Border** - Border radius, width, color, style, outline
38
+ - **Transform** - Scale, rotate, translate, skew, perspective
39
+ - **Transition** - Transition properties, timing functions, animations
40
+ - **Interactivity** - Cursor, pointer events, resize, scroll behavior
41
+ - **Tables** - Border collapse, spacing, layout, caption side
42
+ - **SVG** - Fill, stroke, stroke width
43
+ - **Accessibility** - Forced color adjust, screen reader utilities, focus states
44
+ - **Filters** - Blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, saturate, sepia, backdrop-filter
207
45
 
208
46
  ## πŸ“¦ Installation
209
47
 
210
- ### Install the Package
211
-
212
48
  ```bash
213
49
  npm install @damarkuncoro/meta-architecture-style-engine
214
50
  ```
215
51
 
216
- ### Install CLI Globally (Optional)
52
+ ### Peer Dependencies
217
53
 
218
54
  ```bash
219
- npm install -g @damarkuncoro/meta-architecture-style-engine
55
+ npm install @damarkuncoro/meta-architecture@^2.0.4 react@>=18.0.0 postcss@^8.0.0
220
56
  ```
221
57
 
222
- ### Peer Dependencies
58
+ ## 🎯 Quick Start
223
59
 
224
- MASE requires the following peer dependencies:
60
+ ### Option 1: PostCSS Plugin (Recommended)
225
61
 
226
- ```json
227
- {
228
- "peerDependencies": {
229
- "@damarkuncoro/meta-architecture": "^2.0.4",
230
- "react": ">=18.0.0"
231
- }
62
+ **postcss.config.js**
63
+ ```javascript
64
+ export default {
65
+ plugins: [
66
+ require('@damarkuncoro/meta-architecture-style-engine/postcss')({
67
+ prefix: '--',
68
+ rootSelector: ':root',
69
+ generateDarkMode: true,
70
+ darkModeAttribute: 'data-theme="dark"'
71
+ })
72
+ ]
232
73
  }
233
74
  ```
234
75
 
235
- ---
236
-
237
- ## πŸš€ Quick Start
238
-
239
- Get started with MASE in 5 minutes.
240
-
241
- ### Step 1: Create a Contract File
242
-
243
- Create a file named `Button.contract.dsl`:
76
+ **styles.css**
77
+ ```css
78
+ /* MASE CSS variables are automatically injected */
244
79
 
245
- ```dsl
246
- contract Button {
247
- domain: interaction
248
-
249
- intent {
250
- allows: [color.primary, color.secondary]
251
- default: color.primary
252
- }
253
-
254
- padding {
255
- allows: [space.sm, space.md, space.lg]
256
- default: space.md
257
- }
80
+ body {
81
+ font-family: system-ui, sans-serif;
82
+ color: var(--color-text-primary);
83
+ background-color: var(--color-background);
258
84
  }
259
- ```
260
-
261
- ### Step 2: Validate Your Contract
262
85
 
263
- ```bash
264
- mase validate Button.contract.dsl
86
+ .button {
87
+ background-color: var(--color-primary);
88
+ color: var(--color-white);
89
+ padding: var(--space-md);
90
+ border-radius: var(--radius-md);
91
+ }
265
92
  ```
266
93
 
267
- Output:
268
- ```
269
- βœ… Contract is valid!
270
- ```
94
+ ### Option 2: Atomic CSS Generator
271
95
 
272
- ### Step 3: Compile to TypeScript
96
+ ```typescript
97
+ import { AtomicCSSGenerator } from '@damarkuncoro/meta-architecture-style-engine';
98
+ import { TOKENS } from '@damarkuncoro/meta-architecture-style-engine';
99
+
100
+ const generator = new AtomicCSSGenerator();
101
+ const css = generator.generate(TOKENS, {
102
+ prefix: 'mase-',
103
+ selector: ':root',
104
+ includeReset: true
105
+ });
273
106
 
274
- ```bash
275
- mase compile Button.contract.dsl -o Button.ts
107
+ console.log(css);
276
108
  ```
277
109
 
278
- This generates a TypeScript file with your contract.
110
+ ### Option 3: Tailwind Preset
279
111
 
280
- ### Step 4: Generate CSS
112
+ **tailwind.config.js**
113
+ ```javascript
114
+ import { createMasePreset } from '@damarkuncoro/meta-architecture-style-engine/tailwind';
281
115
 
282
- ```bash
283
- mase generate-css Button.contract.dsl -o button.css
116
+ export default {
117
+ presets: [
118
+ createMasePreset({
119
+ useCssVariables: true,
120
+ variablePrefix: '--'
121
+ })
122
+ ]
123
+ }
284
124
  ```
285
125
 
286
- This generates CSS classes based on your contract.
287
-
288
- ### Step 5: Use in Your Application
126
+ ### Option 4: React Integration
289
127
 
290
- ```tsx
291
- import { StyleProvider, useStyleContext } from '@damarkuncoro/meta-architecture-style-engine';
292
- import { ButtonContract } from './Button';
128
+ ```typescript
129
+ import { StyleProvider, useStyleContract } from '@damarkuncoro/meta-architecture-style-engine';
293
130
 
294
131
  function App() {
295
132
  return (
296
- <StyleProvider initialTheme="light">
297
- <MyComponent />
133
+ <StyleProvider>
134
+ <YourComponent />
298
135
  </StyleProvider>
299
136
  );
300
137
  }
301
138
 
302
- function MyComponent() {
303
- const { theme, device } = useStyleContext();
304
-
305
- const buttonStyles = ButtonContract.resolve({
306
- device,
307
- theme,
308
- platform: 'web'
139
+ function YourComponent() {
140
+ const { resolveStyles } = useStyleContract();
141
+ const styles = resolveStyles({
142
+ backgroundColor: 'primary',
143
+ padding: 'md',
144
+ borderRadius: 'md'
309
145
  });
310
146
 
311
- return (
312
- <button className={buttonStyles.className}>
313
- Click me
314
- </button>
315
- );
147
+ return <div style={styles}>Hello MASE!</div>;
316
148
  }
317
149
  ```
318
150
 
319
- ---
320
-
321
- ## πŸ“š Usage
322
-
323
- ### Runtime Usage
324
-
325
- #### StyleProvider
326
-
327
- Wrap your application with the `StyleProvider` to enable style resolution.
328
-
329
- **Web Usage (Default):**
151
+ ## πŸ“š Documentation
330
152
 
331
- ```tsx
332
- import { StyleProvider } from '@damarkuncoro/meta-architecture-style-engine';
153
+ ### Core Documentation
154
+ - [Quick Start Guide](docs/quick-start.md) - Get started with MASE in minutes
155
+ - [Architecture Diagram](docs/architecture-diagram.md) - System architecture overview
156
+ - [DSL Reference](docs/dsl-reference.md) - Domain-specific language guide
157
+ - [Migration Guide](docs/migration-guide.md) - Migrate from other systems
158
+ - [Troubleshooting](docs/troubleshooting.md) - Common issues and solutions
333
159
 
334
- function App() {
335
- return (
336
- <StyleProvider initialTheme="light">
337
- <YourApp />
338
- </StyleProvider>
339
- );
340
- }
341
- ```
342
-
343
- **Native Usage (with Adapter):**
160
+ ### Integration Guides
161
+ - [CSS Import Guide](docs/integrations/css-import-guide.md) - Using MASE with CSS imports
162
+ - [Atomic CSS Complete Guide](docs/integrations/atomic-css-complete-guide.md) - Complete utility reference
163
+ - [Next.js Integration](docs/integrations/nextjs.md) - Next.js specific setup
164
+ - [React Native Integration](docs/integrations/react-native.md) - React Native setup
165
+ - [Storybook Integration](docs/integrations/storybook.md) - Storybook integration
344
166
 
345
- MASE is platform-agnostic. For non-web platforms, inject the appropriate adapter.
167
+ ### Development Documentation
168
+ - [Development Guide](docs/development/guide.md) - Contributing to MASE
169
+ - [Integration Layer Review](docs/development/integration-layer-comprehensive-review.md) - Integration layer analysis
170
+ - [Recommendations Implementation](docs/development/recommendations-implementation.md) - Implemented improvements
171
+ - [Atomic CSS Implementation](docs/development/final-atomic-css-implementation.md) - Complete implementation report
172
+ - [Comprehensive Atomic CSS Implementation](docs/development/comprehensive-atomic-css-implementation.md) - Detailed implementation guide
346
173
 
347
- ```tsx
348
- import { StyleProvider, NativePlatformAdapter } from '@damarkuncoro/meta-architecture-style-engine';
174
+ ### Examples
175
+ - [Basic Examples](examples/basic/) - Simple component examples
176
+ - [Advanced Examples](examples/advanced/) - Complex use cases
177
+ - [Integration Examples](examples/integration/) - Integration patterns
349
178
 
350
- const nativeAdapter = new NativePlatformAdapter();
179
+ ## 🎨 Utility Classes Reference
351
180
 
352
- function App() {
353
- return (
354
- <StyleProvider
355
- initialTheme="light"
356
- adapter={nativeAdapter}
357
- >
358
- <YourApp />
359
- </StyleProvider>
360
- );
361
- }
181
+ ### Layout
182
+ ```css
183
+ .block { display: block; }
184
+ .flex { display: flex; }
185
+ .grid { display: grid; }
186
+ .relative { position: relative; }
187
+ .z-10 { z-index: 10; }
362
188
  ```
363
189
 
364
- #### useStyleContext
365
-
366
- Access theme and device context in your components:
367
-
368
- ```tsx
369
- import { useStyleContext } from '@damarkuncoro/meta-architecture-style-engine';
370
-
371
- function MyComponent() {
372
- const { theme, device, platform } = useStyleContext();
373
-
374
- return (
375
- <div>
376
- Current theme: {theme}
377
- Current device: {device}
378
- </div>
379
- );
380
- }
190
+ ### Flexbox
191
+ ```css
192
+ .flex-row { flex-direction: row; }
193
+ .items-center { align-items: center; }
194
+ .justify-between { justify-content: space-between; }
195
+ .gap-4 { gap: 1rem; }
381
196
  ```
382
197
 
383
- #### StyleContract
384
-
385
- Create type-safe style contracts:
386
-
387
- ```typescript
388
- import { StyleContract } from '@damarkuncoro/meta-architecture-style-engine';
389
-
390
- const buttonContract = new StyleContract({
391
- intent: 'color.primary',
392
- padding: 'space.md',
393
- borderRadius: 'radius.md'
394
- });
395
-
396
- const resolved = buttonContract.resolve({
397
- theme: 'light',
398
- device: 'desktop',
399
- platform: 'web'
400
- });
198
+ ### Grid
199
+ ```css
200
+ .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
201
+ .col-span-2 { grid-column: span 2 / span 2; }
401
202
  ```
402
203
 
403
- #### StyleResolutionEngine
404
-
405
- Use the core engine for advanced scenarios:
406
-
407
- ```typescript
408
- import {
409
- StyleResolutionEngine,
410
- TokenRegistry,
411
- ThemeResolver
412
- } from '@damarkuncoro/meta-architecture-style-engine';
413
-
414
- // Create engine
415
- const tokenRegistry = new TokenRegistry();
416
- const themeResolver = new ThemeResolver();
417
- const engine = new StyleResolutionEngine(tokenRegistry, themeResolver);
418
-
419
- // Define contract
420
- const contract = {
421
- intent: 'color.primary',
422
- padding: 'space.md'
423
- };
424
-
425
- // Define constitution
426
- const constitution = {
427
- componentName: 'Button',
428
- rules: [
429
- {
430
- property: 'intent',
431
- domain: 'interaction',
432
- allowedTokens: ['color.primary', 'color.secondary']
433
- },
434
- {
435
- property: 'padding',
436
- domain: 'layout',
437
- allowedTokens: ['space.sm', 'space.md', 'space.lg']
438
- }
439
- ]
440
- };
441
-
442
- // Resolve
443
- const result = engine.resolve(contract, constitution);
444
-
445
- console.log(result.className); // "bg-primary p-md"
446
- console.log(result.valid); // true
204
+ ### Spacing
205
+ ```css
206
+ .p-4 { padding: 1rem; }
207
+ .m-4 { margin: 1rem; }
208
+ .gap-4 { gap: 1rem; }
447
209
  ```
448
210
 
449
- ### CLI Usage
450
-
451
- #### Initialize a New Project
452
-
453
- ```bash
454
- mase init my-app
211
+ ### Typography
212
+ ```css
213
+ .text-lg { font-size: 1.125rem; }
214
+ .font-bold { font-weight: 700; }
215
+ .leading-relaxed { line-height: 1.625; }
455
216
  ```
456
217
 
457
- #### Compile Contract
458
-
459
- ```bash
460
- mase compile Button.contract.dsl -o Button.ts
218
+ ### Color
219
+ ```css
220
+ .bg-primary { background-color: var(--color-primary); }
221
+ .text-white { color: var(--color-white); }
222
+ .border-gray-200 { border-color: var(--color-gray-200); }
461
223
  ```
462
224
 
463
- Options:
464
- - `-o, --output <file>` - Output file
465
- - `--format <format>` - Output format (ts, json, ast)
466
- - `--watch` - Watch for changes
467
-
468
- #### Validate Contract
469
-
470
- ```bash
471
- mase validate Button.contract.dsl
225
+ ### Effects
226
+ ```css
227
+ .rounded-md { border-radius: 0.375rem; }
228
+ .shadow-lg { box-shadow: var(--shadow-lg); }
229
+ .opacity-50 { opacity: 0.5; }
472
230
  ```
473
231
 
474
- Options:
475
- - `--strict` - Enable strict validation
476
- - `--fix` - Auto-fix issues
477
- - `--watch` - Watch for changes
478
-
479
- #### Generate CSS
480
-
481
- ```bash
482
- mase generate-css Button.contract.dsl -o button.css
232
+ ### Filters
233
+ ```css
234
+ .blur-md { filter: blur(8px); }
235
+ .brightness-125 { filter: brightness(1.25); }
236
+ .backdrop-blur-md { backdrop-filter: blur(8px); }
483
237
  ```
484
238
 
485
- Options:
486
- - `-o, --output <file>` - Output file
487
- - `--format <format>` - Output format (class, variable, inline)
488
- - `--theme <theme>` - Theme (light, dark)
489
- - `--device <device>` - Device (mobile, tablet, desktop)
490
-
491
- #### Watch for Changes
492
-
493
- ```bash
494
- mase watch Button.contract.dsl
239
+ ### Interactivity
240
+ ```css
241
+ .cursor-pointer { cursor: pointer; }
242
+ .pointer-events-none { pointer-events: none; }
243
+ .select-none { user-select: none; }
495
244
  ```
496
245
 
497
- Options:
498
- - `--command <command>` - Command to run on change
499
- - `--debounce <ms>` - Debounce time in ms
246
+ ## πŸŒ™ Dark Mode
500
247
 
501
- ### DSL Syntax
248
+ MASE provides automatic dark mode support:
502
249
 
503
- The MASE DSL provides a declarative way to define style contracts.
504
-
505
- #### Basic Contract
506
-
507
- ```dsl
508
- contract Button {
509
- domain: interaction
510
-
511
- intent {
512
- allows: [color.primary, color.secondary]
513
- default: color.primary
514
- }
515
-
516
- padding {
517
- allows: [space.sm, space.md, space.lg]
518
- default: space.md
519
- }
250
+ ```css
251
+ /* Light mode */
252
+ .button {
253
+ background-color: var(--color-primary);
254
+ color: var(--color-white);
520
255
  }
521
- ```
522
-
523
- #### Responsive Styling
524
256
 
525
- ```dsl
526
- contract Container {
527
- domain: layout
528
-
529
- padding {
530
- allows: [space.sm, space.md, space.lg]
531
- default: space.md
532
-
533
- constraints {
534
- mobile: [space.sm, space.md]
535
- desktop: [space.md, space.lg]
536
- }
537
- }
257
+ /* Dark mode */
258
+ [data-theme="dark"] .button {
259
+ background-color: var(--color-primary-dark);
260
+ color: var(--color-white-dark);
538
261
  }
539
262
  ```
540
263
 
541
- #### State-Based Styling
264
+ ### Theme Switching
542
265
 
543
- ```dsl
544
- contract Button {
545
- domain: interaction
546
-
547
- intent {
548
- allows: [color.primary, color.secondary]
549
- default: color.primary
550
-
551
- constraints {
552
- hover: [color.primary.hover, color.secondary.hover]
553
- active: [color.primary.active, color.secondary.active]
554
- }
555
- }
556
- }
557
- ```
558
-
559
- #### Theme Support
560
-
561
- ```dsl
562
- contract Card {
563
- domain: layout
564
-
565
- background {
566
- allows: [surface.card, surface.ground]
567
- default: surface.card
568
-
569
- constraints {
570
- dark: [surface.card.dark, surface.ground.dark]
571
- }
572
- }
266
+ ```javascript
267
+ function setTheme(theme) {
268
+ document.documentElement.setAttribute('data-theme', theme);
269
+ localStorage.setItem('theme', theme);
573
270
  }
574
- ```
575
-
576
- ---
577
-
578
- ## πŸ”§ API Reference
579
-
580
- ### Core Exports
581
-
582
- #### Domain Layer
583
-
584
- ```typescript
585
- // Types
586
- export * from './domain/types';
587
-
588
- // Core Engine
589
- export { StyleResolutionEngine } from './domain/StyleResolutionEngine';
590
- export { CanonicalStyleGraph } from './domain/CanonicalStyleGraph';
591
- export { ContextBinder } from './domain/ContextBinder';
592
- export { ViolationEngine } from './domain/ViolationEngine';
593
-
594
- // Registries
595
- export { TokenRegistry } from './domain/TokenRegistry';
596
- export { ThemeResolver } from './domain/ThemeResolver';
597
- export { ContextFactory } from './domain/ContextFactory';
598
- ```
599
-
600
- #### Runtime Layer
601
-
602
- ```typescript
603
- export { StyleContract } from './runtime/StyleContract';
604
- export { StyleProvider } from './runtime/StyleProvider';
605
- ```
606
-
607
- #### Adapter Layer
608
-
609
- ```typescript
610
- export { MasePlugin } from './adapter/MasePlugin';
611
- export { createPipeline } from './adapter/pipeline-factory';
612
- export * from './adapter/rules';
613
- ```
614
-
615
- #### Data Layer
616
-
617
- ```typescript
618
- export * from './data/tokens';
619
- export * from './data/constitutions';
620
- ```
621
-
622
- #### DSL Layer
623
-
624
- ```typescript
625
- export {
626
- ContractDSLTokenizer,
627
- ContractDSLParser,
628
- ContractDSLValidator,
629
- ContractDSLCompiler
630
- } from './dsl';
631
- ```
632
271
 
633
- #### Materializer Layer
634
-
635
- ```typescript
636
- export type {
637
- Materializer,
638
- MaterializationContext,
639
- MaterializationResult
640
- } from './materializer';
641
-
642
- export {
643
- MaterializationError,
644
- CSSMaterializer,
645
- RNMaterializer,
646
- PDFMaterializer
647
- } from './materializer';
272
+ // Initialize theme
273
+ const savedTheme = localStorage.getItem('theme');
274
+ const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
275
+ setTheme(savedTheme || systemTheme);
648
276
  ```
649
277
 
650
- ### Key Interfaces
278
+ ## πŸ”§ CLI Commands
651
279
 
652
- #### StyleContract
280
+ ```bash
281
+ # Initialize MASE in your project
282
+ npx @damarkuncoro/meta-architecture-style-engine init
653
283
 
654
- ```typescript
655
- interface StyleContract {
656
- resolve(context: ResolutionContext): StyleResolutionResult;
657
- validate(): ValidationResult;
658
- }
659
- ```
284
+ # Compile style contracts
285
+ npx @damarkuncoro/meta-architecture-style-engine compile <contract-file>
660
286
 
661
- #### StyleResolutionResult
287
+ # Generate CSS
288
+ npx @damarkuncoro/meta-architecture-style-engine generate-css
662
289
 
663
- ```typescript
664
- interface StyleResolutionResult {
665
- valid: boolean;
666
- className?: string;
667
- styles?: Record<string, any>;
668
- violations?: Violation[];
669
- }
670
- ```
290
+ # Validate contracts
291
+ npx @damarkuncoro/meta-architecture-style-engine validate <contract-file>
671
292
 
672
- #### ResolutionContext
673
-
674
- ```typescript
675
- interface ResolutionContext {
676
- theme: 'light' | 'dark';
677
- device: 'mobile' | 'tablet' | 'desktop';
678
- platform: 'web' | 'native' | 'pdf';
679
- state?: Record<string, any>;
680
- }
293
+ # Watch for changes
294
+ npx @damarkuncoro/meta-architecture-style-engine watch <contract-file>
681
295
  ```
682
296
 
683
- ---
684
-
685
- ## πŸ“– Examples
686
-
687
- ### Phase 2 Examples
688
-
689
- Explore advanced Phase 2 features:
690
-
691
- - **[Interactive DSL Playground](./examples/advanced/dsl-playground/README.md)** - Live DSL editor with real-time validation
692
- - **[Advanced ContractEntity](./examples/advanced/contract-entity/README.md)** - Lifecycle hooks, middleware, composition
297
+ ## πŸ“Š Performance
693
298
 
694
- ### Complete Button Component
299
+ MASE is optimized for performance:
695
300
 
696
- ```tsx
697
- import React from 'react';
698
- import { StyleProvider, useStyleContext, StyleContract } from '@damarkuncoro/meta-architecture-style-engine';
301
+ - **Caching** - 50-90% improvement for repeated style resolutions
302
+ - **Efficient Generation** - Minimal CSS output with no duplicates
303
+ - **Type Safety** - Compile-time type checking reduces runtime errors
304
+ - **Lazy Evaluation** - Only generate what's needed
699
305
 
700
- // Define button contract
701
- const buttonContract = new StyleContract({
702
- intent: 'color.primary',
703
- padding: 'space.md',
704
- borderRadius: 'radius.md',
705
- fontSize: 'text.base',
706
- fontWeight: 'font.semibold'
707
- });
306
+ ### Benchmarks
708
307
 
709
- function Button({ children, variant = 'primary' }: ButtonProps) {
710
- const { theme, device } = useStyleContext();
711
-
712
- const styles = buttonContract.resolve({
713
- theme,
714
- device,
715
- platform: 'web',
716
- state: { variant }
717
- });
718
-
719
- return (
720
- <button className={styles.className}>
721
- {children}
722
- </button>
723
- );
724
- }
308
+ Run performance benchmarks:
725
309
 
726
- function App() {
727
- return (
728
- <StyleProvider initialTheme="light">
729
- <Button>Click me</Button>
730
- </StyleProvider>
731
- );
732
- }
733
- ```
734
-
735
- ### Card Component with Responsive Design
736
-
737
- ```tsx
738
- import React from 'react';
739
- import { StyleProvider, useStyleContext, StyleContract } from '@damarkuncoro/meta-architecture-style-engine';
740
-
741
- const cardContract = new StyleContract({
742
- background: 'surface.card',
743
- padding: 'space.lg',
744
- borderRadius: 'radius.lg',
745
- shadow: 'shadow.md'
746
- });
747
-
748
- function Card({ children }: CardProps) {
749
- const { theme, device } = useStyleContext();
750
-
751
- const styles = cardContract.resolve({
752
- theme,
753
- device,
754
- platform: 'web'
755
- });
756
-
757
- return (
758
- <div className={styles.className}>
759
- {children}
760
- </div>
761
- );
762
- }
310
+ ```bash
311
+ npm run benchmark
763
312
  ```
764
313
 
765
- ### TypeScript-Only Usage
314
+ Expected results:
315
+ - Style Resolution (No Cache): ~0.5-2ms per operation
316
+ - Style Resolution (With Cache): ~0.01-0.1ms per operation (90-95% faster)
317
+ - Cache Hit Rate: 100% for repeated operations
766
318
 
767
- ```typescript
768
- import {
769
- StyleResolutionEngine,
770
- TokenRegistry,
771
- ThemeResolver,
772
- CSSMaterializer
773
- } from '@damarkuncoro/meta-architecture-style-engine';
774
-
775
- // Setup
776
- const tokenRegistry = new TokenRegistry();
777
- const themeResolver = new ThemeResolver();
778
- const engine = new StyleResolutionEngine(tokenRegistry, themeResolver);
779
- const cssMaterializer = new CSSMaterializer();
780
-
781
- // Define contract
782
- const contract = {
783
- background: 'surface.card',
784
- padding: 'space.lg',
785
- borderRadius: 'radius.lg'
786
- };
787
-
788
- // Define constitution
789
- const constitution = {
790
- componentName: 'Card',
791
- domain: 'layout',
792
- rules: [
793
- {
794
- property: 'background',
795
- allowedTokens: ['surface.card', 'surface.ground']
796
- },
797
- {
798
- property: 'padding',
799
- allowedTokens: ['space.sm', 'space.md', 'space.lg']
800
- },
801
- {
802
- property: 'borderRadius',
803
- allowedTokens: ['radius.sm', 'radius.md', 'radius.lg']
804
- }
805
- ]
806
- };
807
-
808
- // Resolve
809
- const context = {
810
- theme: 'light',
811
- device: 'desktop',
812
- platform: 'web'
813
- };
814
-
815
- const result = engine.resolve(contract, constitution, context);
319
+ ## πŸ—οΈ Architecture
816
320
 
817
- // Materialize
818
- if (result.valid) {
819
- const css = cssMaterializer.materialize(result, context);
820
- console.log(css);
821
- }
321
+ MASE follows a layered architecture:
322
+
323
+ ```
324
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
325
+ β”‚ Integration Layer β”‚
326
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
327
+ β”‚ β”‚ PostCSS β”‚ Atomic β”‚ Tailwind β”‚β”‚
328
+ β”‚ β”‚ Plugin β”‚ CSS β”‚ Preset β”‚β”‚
329
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
330
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
331
+ ↓
332
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
333
+ β”‚ Domain Layer β”‚
334
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
335
+ β”‚ β”‚ Tokens β”‚Governanceβ”‚Resolutionβ”‚β”‚
336
+ β”‚ β”‚ Registry β”‚ Engine β”‚ Engine β”‚β”‚
337
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
338
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
339
+ ↓
340
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
341
+ β”‚ Materialization Layer β”‚
342
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
343
+ β”‚ β”‚ CSS β”‚ RN β”‚ PDF β”‚β”‚
344
+ β”‚ β”‚Materializerβ”‚Materializerβ”‚Materializerβ”‚β”‚
345
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
346
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
347
+ ↓
348
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
349
+ β”‚ Runtime Layer β”‚
350
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
351
+ β”‚ β”‚ Web β”‚ RN β”‚Adapter β”‚β”‚
352
+ β”‚ β”‚ Adapter β”‚ Adapter β”‚Factory β”‚β”‚
353
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
354
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
822
355
  ```
823
356
 
824
- ---
357
+ ## 🀝 Contributing
825
358
 
826
- ## πŸ› οΈ Development
359
+ We welcome contributions! Please see our [Development Guide](docs/development/guide.md) for details.
827
360
 
828
- ### Setup
361
+ ### Development Setup
829
362
 
830
363
  ```bash
831
364
  # Clone the repository
@@ -835,182 +368,43 @@ cd meta-architecture-style-engine
835
368
  # Install dependencies
836
369
  npm install
837
370
 
838
- # Build the project
839
- npm run build
840
-
841
371
  # Run tests
842
372
  npm test
843
- ```
844
373
 
845
- ### Project Structure
846
-
847
- ```
848
- meta-architecture-style-engine/
849
- β”œβ”€β”€ src/
850
- β”‚ β”œβ”€β”€ adapter/ # Plugin system and pipeline factory
851
- β”‚ β”œβ”€β”€ cli/ # Command-line interface
852
- β”‚ β”œβ”€β”€ data/ # Tokens and constitutions
853
- β”‚ β”œβ”€β”€ domain/ # Core engine (SRE)
854
- β”‚ β”œβ”€β”€ dsl/ # Contract DSL compiler
855
- β”‚ β”œβ”€β”€ materializer/ # Platform materializers (SME)
856
- β”‚ └── runtime/ # React runtime components
857
- β”œβ”€β”€ docs/ # Documentation
858
- β”œβ”€β”€ __tests__/ # Test files
859
- β”œβ”€β”€ package.json
860
- β”œβ”€β”€ tsconfig.json
861
- └── tsup.config.ts # Build configuration
862
- ```
863
-
864
- ### Scripts
865
-
866
- ```bash
867
- # Build
374
+ # Build the project
868
375
  npm run build
869
376
 
870
- # Test
871
- npm test
872
-
873
- # Clean build artifacts
874
- npm run clean
875
-
876
377
  # Run CLI
877
378
  npm run cli
878
379
  ```
879
380
 
880
- ### Testing
881
-
882
- MASE uses Vitest for testing. Tests are organized by component and follow the test matrix specification:
883
-
884
- - **Valid Contract**: Happy path scenarios
885
- - **Invalid Token**: Token not in registry
886
- - **Invalid Semantic**: Wrong semantic key
887
- - **Domain Violation**: Cross-domain properties
888
- - **Context Fallback**: Graceful degradation
889
- - **Hard Rejection**: Fatal violations
890
- - **Performance**: < 5ms resolution per component
891
-
892
- ### Quality Metrics
893
-
894
- | Metric | Target | Description |
895
- | :--- | :--- | :--- |
896
- | **Type Safety** | 100% | No `any`, fully typed contracts |
897
- | **Platform Agnostic** | 100% | SRE code has no CSS/Web terminology |
898
- | **Immutability** | Enforced | CSG and Token Registry are `readonly` |
899
- | **Audit Trail** | 100% | Every resolution decision is traceable |
900
-
901
- ---
902
-
903
- ## 🀝 Contributing
904
-
905
- We welcome contributions! Please follow these guidelines:
906
-
907
- ### Contribution Guidelines
908
-
909
- 1. **Strict Separation**: Don't mix CSS logic in the SRE
910
- 2. **Spec-First**: Discuss constitution changes before coding
911
- 3. **Violation as Feature**: Errors are governance features, not bugs
912
- 4. **Type Safety**: Maintain 100% type safety
913
- 5. **Testing**: Ensure all tests pass before submitting PR
914
-
915
- ### Development Workflow
916
-
917
- 1. Fork the repository
918
- 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
919
- 3. Commit your changes (`git commit -m 'Add amazing feature'`)
920
- 4. Push to the branch (`git push origin feature/amazing-feature`)
921
- 5. Open a Pull Request
922
-
923
- ### Code of Conduct
924
-
925
- - Be respectful and inclusive
926
- - Provide constructive feedback
927
- - Focus on what is best for the community
928
- - Show empathy towards other community members
929
-
930
- ---
931
-
932
381
  ## πŸ“„ License
933
382
 
934
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
935
-
936
- ---
383
+ MIT License - see [LICENSE](LICENSE) file for details
937
384
 
938
385
  ## πŸ™ Acknowledgments
939
386
 
940
- - Inspired by the principles of constitutional governance
387
+ - Inspired by Tailwind CSS's utility-first approach
941
388
  - Built with TypeScript for type safety
942
- - Powered by the Meta Architecture ecosystem
389
+ - Designed for modern web development
390
+ - Part of the Meta Architecture ecosystem
943
391
 
944
- ---
392
+ ## πŸ“ž Support
945
393
 
946
- ## πŸ“ž Support & Community
394
+ - πŸ“– [Documentation](docs/)
395
+ - πŸ› [Issue Tracker](https://github.com/damarkuncoro/meta-architecture-style-engine/issues)
396
+ - πŸ’¬ [Discussions](https://github.com/damarkuncoro/meta-architecture-style-engine/discussions)
397
+ - πŸ“§ [Email](mailto:support@damarkuncoro.com)
947
398
 
948
- ### Documentation
399
+ ## πŸ”— Related Projects
949
400
 
950
- - **[Full Documentation](./docs/README.md)** - Complete documentation
951
- - **[Quick Start Guide](./docs/quick-start.md)** - Get started in 5 minutes
952
- - **[Development Guide](./docs/development.md)** - Comprehensive development guide
953
- - **[Phase 2: Integration Design & DSL](./docs/phase2-integration-design.md)** - Context-awareness, ContractEntity, and DSL features
954
- - **[Architecture Diagrams](./docs/architecture-diagram.md)** - Visual architecture documentation
955
- - **[Performance Benchmarks](./docs/benchmarks.md)** - Performance metrics and comparisons
956
- - **[Migration Guide](./docs/migration-guide.md)** - Migrate from Tailwind/CSS-in-JS
957
- - **[DSL Reference](./docs/dsl-reference.md)** - Quick reference card for DSL syntax
958
- - **[Interactive Demo](./docs/interactive-demo.md)** - Interactive examples and live demos
959
- - **[Troubleshooting](./docs/troubleshooting.md)** - Common issues and solutions
960
-
961
- ### Framework Integrations
962
-
963
- - **[Next.js Integration](./docs/integrations/nextjs.md)** - Integrate MASE with Next.js
964
- - **[React Native Integration](./docs/integrations/react-native.md)** - Integrate MASE with React Native
965
- - **[Storybook Integration](./docs/integrations/storybook.md)** - Integrate MASE with Storybook
966
-
967
- ### Examples
968
-
969
- - **[Examples Directory](./examples/README.md)** - Comprehensive examples collection
970
- - **[Basic Examples](./examples/basic/)** - Button, Card, Input components
971
- - **[Advanced Examples](./examples/advanced/)** - Responsive, theming, animations
972
- - **[Real-World Apps](./examples/real-world/)** - E-commerce, Dashboard, Social apps
973
-
974
- ### Community
975
-
976
- - **[GitHub Issues](https://github.com/damarkuncoro/meta-architecture-style-engine/issues)** - Report bugs
977
- - **[GitHub Discussions](https://github.com/damarkuncoro/meta-architecture-style-engine/discussions)** - Ask questions
978
- - **[Pull Requests](https://github.com/damarkuncoro/meta-architecture-style-engine/pulls)** - Contribute code
979
-
980
- ---
981
-
982
- ## πŸ—ΊοΈ Roadmap
983
-
984
- ### βœ… Phase 0: Prototype (v0.1)
985
- - Basic `TokenRegistry` & `StyleRule`
986
- - Simple `StyleValidator` (Runtime)
987
- - `StrictButton` component demo
988
-
989
- ### βœ… Phase 1: Review & Ratify (Materialization)
990
- - Card Governance implementation
991
- - Testing strategy with Vitest
992
- - Domain expansion (Shadow, Surface)
993
-
994
- ### πŸ”„ Phase 2: Integration Design & DSL
995
- - Context-Awareness for responsive design
996
- - ContractEntity abstract class
997
- - DSL Design for declarative contracts
998
-
999
- ### πŸ”œ Phase 3: SRE Implementation
1000
- - Style resolution algorithms
1001
- - Context Binder for variants/conditions
1002
-
1003
- ### πŸ”œ Phase 4: SME (Materializers)
1004
- - Semantic node to CSS Properties mapping
1005
- - Atomic CSS generation optimization
401
+ - [@damarkuncoro/meta-architecture](https://github.com/damarkuncoro/meta-architecture) - The core Meta Architecture framework
1006
402
 
1007
403
  ---
1008
404
 
1009
- <div align="center">
1010
-
1011
- **Built with ❀️ by Damar Kuncoro**
405
+ **MASE** - Meta Architecture Style Engine
1012
406
 
1013
- [![GitHub](https://img.shields.io/badge/GitHub-damarkuncoro-blue)](https://github.com/damarkuncoro)
1014
- [![Twitter](https://img.shields.io/badge/Twitter-@damarkuncoro-blue)](https://twitter.com/damarkuncoro)
407
+ *Build beautiful, consistent, and theme-aware user interfaces with ease.*
1015
408
 
1016
- </div>
409
+ **Author:** Damar Kuncoro
410
+ **Version:** 0.1.4