@elsahafy/ux-mcp-server 2.0.1 → 4.0.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.
- package/dist/index.js +2130 -8
- package/knowledge/ai-ml-patterns.json +192 -0
- package/knowledge/analytics-metrics.json +521 -0
- package/knowledge/angular-patterns.json +347 -0
- package/knowledge/ar-vr-interfaces.json +139 -0
- package/knowledge/color-theory.json +499 -0
- package/knowledge/data-viz.json +527 -0
- package/knowledge/design-system-advanced.json +533 -0
- package/knowledge/ecommerce-patterns.json +616 -0
- package/knowledge/ethical-design.json +484 -0
- package/knowledge/finance-ux.json +208 -0
- package/knowledge/forms.json +641 -0
- package/knowledge/haptic-feedback.json +102 -0
- package/knowledge/healthcare-ux.json +209 -0
- package/knowledge/information-architecture.json +494 -0
- package/knowledge/microcopy.json +743 -0
- package/knowledge/mobile-patterns.json +537 -0
- package/knowledge/neurodiversity.json +228 -0
- package/knowledge/pwa-patterns.json +429 -0
- package/knowledge/saas-patterns.json +613 -0
- package/knowledge/testing-validation.json +561 -0
- package/knowledge/typography.json +509 -0
- package/knowledge/voice-ui.json +359 -0
- package/knowledge/vue-patterns.json +279 -0
- package/knowledge/web-components.json +148 -0
- package/package.json +1 -1
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Advanced Design System Patterns",
|
|
3
|
+
"description": "Advanced concepts for building, scaling, and maintaining enterprise design systems",
|
|
4
|
+
"note": "Builds on ux://design-systems/tokens. This covers advanced topics like theming, multi-brand, versioning, and governance.",
|
|
5
|
+
"advanced_token_patterns": {
|
|
6
|
+
"semantic_tokens": {
|
|
7
|
+
"description": "Tokens that reference other tokens and carry meaning",
|
|
8
|
+
"layers": {
|
|
9
|
+
"tier_1_core": {
|
|
10
|
+
"description": "Raw values, never change",
|
|
11
|
+
"examples": {
|
|
12
|
+
"color_blue_500": "#3b82f6",
|
|
13
|
+
"spacing_4": "16px",
|
|
14
|
+
"font_size_4": "16px"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"tier_2_semantic": {
|
|
18
|
+
"description": "Reference core, describe purpose",
|
|
19
|
+
"examples": {
|
|
20
|
+
"color_primary": "var(--color-blue-500)",
|
|
21
|
+
"spacing_content_padding": "var(--spacing-4)",
|
|
22
|
+
"font_size_body": "var(--font-size-4)"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"tier_3_component": {
|
|
26
|
+
"description": "Reference semantic, component-specific",
|
|
27
|
+
"examples": {
|
|
28
|
+
"button_background": "var(--color-primary)",
|
|
29
|
+
"button_padding_horizontal": "var(--spacing-content-padding)",
|
|
30
|
+
"button_font_size": "var(--font-size-body)"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"benefits": [
|
|
35
|
+
"Change theme by swapping semantic tokens",
|
|
36
|
+
"Single source of truth for colors/spacing",
|
|
37
|
+
"Easier maintenance (change blue-500 once, updates everywhere)",
|
|
38
|
+
"Theming support (light/dark mode)"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"theming": {
|
|
42
|
+
"light_dark_mode": {
|
|
43
|
+
"approach_1_separate_tokens": {
|
|
44
|
+
"description": "Define separate tokens for light and dark",
|
|
45
|
+
"example": ":root { --bg-primary: #ffffff; --text-primary: #000000; }\n[data-theme='dark'] { --bg-primary: #000000; --text-primary: #ffffff; }",
|
|
46
|
+
"pros": ["Simple", "Full control"],
|
|
47
|
+
"cons": ["Duplication", "Hard to maintain"]
|
|
48
|
+
},
|
|
49
|
+
"approach_2_single_source": {
|
|
50
|
+
"description": "Core tokens + theme-specific semantic tokens",
|
|
51
|
+
"example": "--gray-100: #f7f7f7; /* light bg */\n--gray-900: #1a1a1a; /* dark bg */\n:root { --bg-primary: var(--gray-100); }\n[data-theme='dark'] { --bg-primary: var(--gray-900); }",
|
|
52
|
+
"pros": ["DRY", "Easier maintenance"],
|
|
53
|
+
"cons": ["More abstraction"],
|
|
54
|
+
"recommended": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"multi_brand": {
|
|
58
|
+
"description": "Support multiple brands from one design system",
|
|
59
|
+
"structure": {
|
|
60
|
+
"shared_core": "Spacing, typography scale (consistent across brands)",
|
|
61
|
+
"brand_specific": "Colors, logos, border radius, fonts (per brand)",
|
|
62
|
+
"semantic_layer": "Maps brand-specific to semantic (--color-primary)"
|
|
63
|
+
},
|
|
64
|
+
"implementation": {
|
|
65
|
+
"css_custom_properties": "[data-brand='acme'] { --color-primary: #ff6b35; }\n[data-brand='globex'] { --color-primary: #3b82f6; }",
|
|
66
|
+
"build_time": "Generate separate CSS bundles per brand (webpack, Sass)",
|
|
67
|
+
"runtime": "Swap theme object in JavaScript (Styled Components, Emotion)"
|
|
68
|
+
},
|
|
69
|
+
"example": "Carbon Design System (IBM), multiple product brands"
|
|
70
|
+
},
|
|
71
|
+
"theme_switching": {
|
|
72
|
+
"user_preference": {
|
|
73
|
+
"implementation": "const theme = localStorage.getItem('theme') || 'light';\ndocument.documentElement.setAttribute('data-theme', theme);",
|
|
74
|
+
"accessibility": "Respect prefers-color-scheme media query",
|
|
75
|
+
"best_practice": "Provide theme toggle, remember preference"
|
|
76
|
+
},
|
|
77
|
+
"system_preference": {
|
|
78
|
+
"implementation": "const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;",
|
|
79
|
+
"override": "Allow user to override system preference"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"responsive_tokens": {
|
|
84
|
+
"description": "Tokens that change based on viewport",
|
|
85
|
+
"fluid_typography": {
|
|
86
|
+
"description": "Font size scales smoothly between min and max viewport",
|
|
87
|
+
"formula": "clamp(min, preferred, max)",
|
|
88
|
+
"example": "font-size: clamp(1rem, 2.5vw, 2rem);",
|
|
89
|
+
"tool": "https://modern-fluid-typography.vercel.app/"
|
|
90
|
+
},
|
|
91
|
+
"responsive_spacing": {
|
|
92
|
+
"description": "Spacing that adapts to viewport",
|
|
93
|
+
"approach_1_breakpoints": "--spacing-4: 16px; @media (min-width: 768px) { --spacing-4: 24px; }",
|
|
94
|
+
"approach_2_fluid": "--spacing-4: clamp(16px, 2vw, 24px);",
|
|
95
|
+
"recommended": "Approach 1 for discrete jumps, Approach 2 for smooth scaling"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"component_patterns": {
|
|
100
|
+
"compound_components": {
|
|
101
|
+
"description": "Components that work together with shared context",
|
|
102
|
+
"example": {
|
|
103
|
+
"tabs": "Tabs container shares state with Tab and TabPanel children",
|
|
104
|
+
"dropdown": "Dropdown provides context to Trigger and Menu",
|
|
105
|
+
"accordion": "Accordion manages state for multiple AccordionItem children"
|
|
106
|
+
},
|
|
107
|
+
"benefits": [
|
|
108
|
+
"Flexible composition",
|
|
109
|
+
"Clear relationships",
|
|
110
|
+
"Encapsulated state",
|
|
111
|
+
"Better DX (developer experience)"
|
|
112
|
+
],
|
|
113
|
+
"implementation": {
|
|
114
|
+
"react": "Use Context API to share state between parent and children",
|
|
115
|
+
"vue": "Use provide/inject",
|
|
116
|
+
"web_components": "Use slots and custom events"
|
|
117
|
+
},
|
|
118
|
+
"code_example": "// React\nconst TabsContext = createContext();\n\nfunction Tabs({ children, defaultTab }) {\n const [activeTab, setActiveTab] = useState(defaultTab);\n return <TabsContext.Provider value={{ activeTab, setActiveTab }}>{children}</TabsContext.Provider>;\n}\n\nfunction Tab({ value, children }) {\n const { activeTab, setActiveTab } = useContext(TabsContext);\n return <button onClick={() => setActiveTab(value)}>{children}</button>;\n}\n\nfunction TabPanel({ value, children }) {\n const { activeTab } = useContext(TabsContext);\n return activeTab === value ? <div>{children}</div> : null;\n}"
|
|
119
|
+
},
|
|
120
|
+
"polymorphic_components": {
|
|
121
|
+
"description": "Components that can render as different HTML elements",
|
|
122
|
+
"use_case": "Button component that can render as <button>, <a>, or <Link>",
|
|
123
|
+
"api": "<Button as='a' href='/'>Link Button</Button>",
|
|
124
|
+
"benefits": ["Semantic HTML", "Accessibility", "Flexibility"],
|
|
125
|
+
"implementation": "TypeScript + 'as' prop polymorphism"
|
|
126
|
+
},
|
|
127
|
+
"render_props_slots": {
|
|
128
|
+
"description": "Allow users to customize rendering",
|
|
129
|
+
"react_render_props": "<DataTable data={items} renderRow={(item) => <CustomRow item={item} />} />",
|
|
130
|
+
"vue_slots": "<template #item='{ item }'><CustomItem :item='item' /></template>",
|
|
131
|
+
"benefits": ["Maximum flexibility", "Custom rendering", "Inversion of control"]
|
|
132
|
+
},
|
|
133
|
+
"controlled_uncontrolled": {
|
|
134
|
+
"description": "Support both controlled and uncontrolled modes",
|
|
135
|
+
"controlled": {
|
|
136
|
+
"description": "Parent manages state",
|
|
137
|
+
"example": "<Input value={value} onChange={setValue} />",
|
|
138
|
+
"use_when": "Need to validate, transform, or sync with other state"
|
|
139
|
+
},
|
|
140
|
+
"uncontrolled": {
|
|
141
|
+
"description": "Component manages own state",
|
|
142
|
+
"example": "<Input defaultValue='hello' />",
|
|
143
|
+
"use_when": "Simple forms, don't need to control state"
|
|
144
|
+
},
|
|
145
|
+
"hybrid": {
|
|
146
|
+
"description": "Support both modes",
|
|
147
|
+
"pattern": "If 'value' prop provided, use it (controlled). Else, use internal state (uncontrolled).",
|
|
148
|
+
"code": "const [internalValue, setInternalValue] = useState(defaultValue);\nconst isControlled = value !== undefined;\nconst currentValue = isControlled ? value : internalValue;"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"versioning_migration": {
|
|
153
|
+
"semantic_versioning": {
|
|
154
|
+
"description": "MAJOR.MINOR.PATCH (e.g., 2.3.1)",
|
|
155
|
+
"major": {
|
|
156
|
+
"description": "Breaking changes",
|
|
157
|
+
"examples": ["Rename prop", "Remove component", "Change default behavior"],
|
|
158
|
+
"release": "Quarterly or bi-annually (plan carefully)"
|
|
159
|
+
},
|
|
160
|
+
"minor": {
|
|
161
|
+
"description": "New features (backward compatible)",
|
|
162
|
+
"examples": ["New component", "New prop", "New variant"],
|
|
163
|
+
"release": "Monthly or as needed"
|
|
164
|
+
},
|
|
165
|
+
"patch": {
|
|
166
|
+
"description": "Bug fixes",
|
|
167
|
+
"examples": ["Fix accessibility issue", "Fix visual bug", "Performance improvement"],
|
|
168
|
+
"release": "As needed (can be frequent)"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"deprecation_strategy": {
|
|
172
|
+
"process": {
|
|
173
|
+
"1_announce": "Announce deprecation in release notes, changelog",
|
|
174
|
+
"2_warn": "Add console warnings in deprecated components/props",
|
|
175
|
+
"3_document": "Migration guide with examples",
|
|
176
|
+
"4_grace_period": "At least 2 minor versions before removal (e.g., deprecated in 2.1, removed in 3.0)",
|
|
177
|
+
"5_remove": "Remove in next major version"
|
|
178
|
+
},
|
|
179
|
+
"console_warning_example": "if (process.env.NODE_ENV === 'development') {\n console.warn('<OldButton> is deprecated. Use <Button> instead. Will be removed in v3.0.');\n}",
|
|
180
|
+
"codemods": {
|
|
181
|
+
"description": "Automated migration scripts",
|
|
182
|
+
"tools": ["jscodeshift", "ast-grep"],
|
|
183
|
+
"use_when": "Large breaking changes affecting many consumers"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"changelog": {
|
|
187
|
+
"description": "Document all changes",
|
|
188
|
+
"format": "Keep a Changelog (https://keepachangelog.com/)",
|
|
189
|
+
"sections": ["Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"],
|
|
190
|
+
"example": "## [2.1.0] - 2024-01-15\n### Added\n- New `Toast` component for notifications\n- `size` prop to `Button` component\n\n### Fixed\n- `Modal` close button now keyboard accessible\n\n### Deprecated\n- `OldButton` (use `Button` instead)"
|
|
191
|
+
},
|
|
192
|
+
"migration_guides": {
|
|
193
|
+
"description": "Step-by-step guides for major version upgrades",
|
|
194
|
+
"include": [
|
|
195
|
+
"Breaking changes list",
|
|
196
|
+
"Before/after code examples",
|
|
197
|
+
"Find-and-replace patterns",
|
|
198
|
+
"Codemod scripts",
|
|
199
|
+
"Estimated time to migrate",
|
|
200
|
+
"Support contact"
|
|
201
|
+
],
|
|
202
|
+
"example": "Material-UI v4 to v5 migration guide (comprehensive)"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"documentation": {
|
|
206
|
+
"component_docs": {
|
|
207
|
+
"essential_sections": {
|
|
208
|
+
"overview": "What the component does, when to use",
|
|
209
|
+
"examples": "Interactive examples (Storybook)",
|
|
210
|
+
"props_api": "All props, types, defaults, descriptions",
|
|
211
|
+
"accessibility": "ARIA attributes, keyboard support, screen reader behavior",
|
|
212
|
+
"theming": "How to customize (CSS vars, props)",
|
|
213
|
+
"best_practices": "Do's and don'ts",
|
|
214
|
+
"related_components": "Links to related components"
|
|
215
|
+
},
|
|
216
|
+
"interactive_examples": {
|
|
217
|
+
"tool": "Storybook, Docusaurus, custom docs site",
|
|
218
|
+
"features": ["Live code editor", "Props playground", "Theme switcher", "Accessibility tab"],
|
|
219
|
+
"benefits": ["Learn by doing", "Visual testing", "QA reference"]
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"getting_started": {
|
|
223
|
+
"sections": [
|
|
224
|
+
"Installation instructions",
|
|
225
|
+
"Setup (provider, theme, global styles)",
|
|
226
|
+
"First component example",
|
|
227
|
+
"Common patterns",
|
|
228
|
+
"Troubleshooting"
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
"design_guidelines": {
|
|
232
|
+
"description": "For designers using the system",
|
|
233
|
+
"include": [
|
|
234
|
+
"When to use each component",
|
|
235
|
+
"Layout patterns",
|
|
236
|
+
"Spacing guidelines",
|
|
237
|
+
"Color usage",
|
|
238
|
+
"Typography scale",
|
|
239
|
+
"Accessibility requirements",
|
|
240
|
+
"Figma/Sketch library link"
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
"contribution_guide": {
|
|
244
|
+
"description": "How to contribute to the design system",
|
|
245
|
+
"include": [
|
|
246
|
+
"Proposal process (RFC for new components)",
|
|
247
|
+
"Code standards",
|
|
248
|
+
"Testing requirements",
|
|
249
|
+
"Documentation requirements",
|
|
250
|
+
"Review process",
|
|
251
|
+
"Design review process"
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"tooling": {
|
|
256
|
+
"storybook": {
|
|
257
|
+
"description": "Component explorer and documentation",
|
|
258
|
+
"features": ["Component isolation", "Props playground", "Accessibility checks", "Visual regression testing"],
|
|
259
|
+
"addons": ["@storybook/addon-a11y", "@storybook/addon-docs", "chromatic (visual testing)"],
|
|
260
|
+
"best_practices": [
|
|
261
|
+
"Story per component variant",
|
|
262
|
+
"Accessibility tab for all components",
|
|
263
|
+
"Interactive controls for props",
|
|
264
|
+
"Documentation MDX pages"
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
"design_tokens_tools": {
|
|
268
|
+
"style_dictionary": {
|
|
269
|
+
"description": "Transform design tokens to multiple platforms",
|
|
270
|
+
"input": "JSON tokens",
|
|
271
|
+
"output": "CSS, Sass, JS, iOS, Android, etc.",
|
|
272
|
+
"use": "Single source of truth for all platforms"
|
|
273
|
+
},
|
|
274
|
+
"figma_tokens": {
|
|
275
|
+
"description": "Sync tokens between Figma and code",
|
|
276
|
+
"plugin": "Figma Tokens plugin",
|
|
277
|
+
"workflow": "Design in Figma → Export tokens → Generate code"
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"testing": {
|
|
281
|
+
"unit_tests": {
|
|
282
|
+
"description": "Test component logic",
|
|
283
|
+
"framework": "Jest, Vitest",
|
|
284
|
+
"library": "@testing-library/react (or Vue, Svelte)",
|
|
285
|
+
"coverage_target": "> 80%"
|
|
286
|
+
},
|
|
287
|
+
"visual_regression": {
|
|
288
|
+
"description": "Detect unintended visual changes",
|
|
289
|
+
"tools": ["Chromatic", "Percy", "BackstopJS"],
|
|
290
|
+
"workflow": "Take screenshots → Compare with baseline → Approve/reject"
|
|
291
|
+
},
|
|
292
|
+
"accessibility_testing": {
|
|
293
|
+
"automated": "axe-core, jest-axe",
|
|
294
|
+
"manual": "Keyboard navigation, screen reader testing",
|
|
295
|
+
"ci": "Run axe in CI, fail on violations"
|
|
296
|
+
},
|
|
297
|
+
"cross_browser": {
|
|
298
|
+
"tools": "BrowserStack, Sauce Labs",
|
|
299
|
+
"browsers": "Chrome, Firefox, Safari, Edge",
|
|
300
|
+
"devices": "iOS, Android (real devices)"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"linting": {
|
|
304
|
+
"eslint": "Code quality, best practices",
|
|
305
|
+
"stylelint": "CSS/Sass linting",
|
|
306
|
+
"prettier": "Code formatting",
|
|
307
|
+
"custom_rules": "Enforce design system usage (no hardcoded colors, use tokens)"
|
|
308
|
+
},
|
|
309
|
+
"build_tools": {
|
|
310
|
+
"bundlers": ["Rollup (libraries)", "Webpack", "Vite", "esbuild"],
|
|
311
|
+
"outputs": ["ESM (modern)", "CJS (Node)", "UMD (browser)"],
|
|
312
|
+
"tree_shaking": "Ensure components can be tree-shaken (ESM + sideEffects: false)"
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"governance": {
|
|
316
|
+
"design_system_team": {
|
|
317
|
+
"roles": {
|
|
318
|
+
"core_team": {
|
|
319
|
+
"description": "Full-time design system engineers and designers",
|
|
320
|
+
"responsibilities": ["Build and maintain components", "Review contributions", "Roadmap planning", "Support"]
|
|
321
|
+
},
|
|
322
|
+
"working_group": {
|
|
323
|
+
"description": "Representatives from product teams",
|
|
324
|
+
"responsibilities": ["Provide feedback", "Propose new components", "Champion adoption"]
|
|
325
|
+
},
|
|
326
|
+
"contributors": {
|
|
327
|
+
"description": "Anyone contributing components, fixes, docs",
|
|
328
|
+
"responsibilities": ["Follow contribution guide", "Respond to feedback"]
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
"rfc_process": {
|
|
333
|
+
"description": "Request for Comments - propose new components/changes",
|
|
334
|
+
"process": {
|
|
335
|
+
"1_proposal": "Write RFC document (problem, solution, alternatives, API)",
|
|
336
|
+
"2_review": "Core team + working group review, provide feedback",
|
|
337
|
+
"3_iteration": "Revise based on feedback",
|
|
338
|
+
"4_approval": "Core team approves or rejects",
|
|
339
|
+
"5_implementation": "Build, test, document, release"
|
|
340
|
+
},
|
|
341
|
+
"example": "React RFC process (https://github.com/reactjs/rfcs)"
|
|
342
|
+
},
|
|
343
|
+
"adoption_metrics": {
|
|
344
|
+
"track": [
|
|
345
|
+
"Component usage (which components, how often)",
|
|
346
|
+
"Design system version (how many on latest)",
|
|
347
|
+
"Custom implementations (teams not using DS)",
|
|
348
|
+
"Accessibility violations",
|
|
349
|
+
"Performance metrics"
|
|
350
|
+
],
|
|
351
|
+
"tools": ["Telemetry (anonymous usage data)", "Static analysis (scan codebases)", "Surveys"]
|
|
352
|
+
},
|
|
353
|
+
"support_model": {
|
|
354
|
+
"slack_channel": "Real-time support and discussion",
|
|
355
|
+
"office_hours": "Weekly sessions with core team",
|
|
356
|
+
"documentation": "Self-service docs and guides",
|
|
357
|
+
"github_issues": "Bug reports and feature requests",
|
|
358
|
+
"training": "Onboarding sessions for new teams"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"scaling_challenges": {
|
|
362
|
+
"multi_framework": {
|
|
363
|
+
"problem": "Teams use React, Vue, Angular, Svelte, etc.",
|
|
364
|
+
"solutions": {
|
|
365
|
+
"web_components": {
|
|
366
|
+
"description": "Framework-agnostic components",
|
|
367
|
+
"pros": ["Works everywhere", "Encapsulation"],
|
|
368
|
+
"cons": ["Limited React support (historically)", "Learning curve"],
|
|
369
|
+
"tools": ["Lit", "Stencil"]
|
|
370
|
+
},
|
|
371
|
+
"multiple_implementations": {
|
|
372
|
+
"description": "Build for each framework",
|
|
373
|
+
"pros": ["Native feel", "Best DX per framework"],
|
|
374
|
+
"cons": ["Maintenance burden", "Divergence risk"],
|
|
375
|
+
"example": "Carbon Design System (React, Vue, Angular, Svelte, Web Components)"
|
|
376
|
+
},
|
|
377
|
+
"headless_components": {
|
|
378
|
+
"description": "Logic without styles (BYO styles)",
|
|
379
|
+
"pros": ["Framework adapters easy", "Separation of concerns"],
|
|
380
|
+
"cons": ["No visual consistency out of box"],
|
|
381
|
+
"libraries": ["Radix UI", "Headless UI", "React Aria"]
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
"global_teams": {
|
|
386
|
+
"challenges": ["Time zones", "Language barriers", "Different processes"],
|
|
387
|
+
"solutions": [
|
|
388
|
+
"Clear documentation (reduce synchronous communication)",
|
|
389
|
+
"Async communication (GitHub, Slack threads)",
|
|
390
|
+
"Recorded demos and trainings",
|
|
391
|
+
"Internationalization support in DS"
|
|
392
|
+
]
|
|
393
|
+
},
|
|
394
|
+
"legacy_migration": {
|
|
395
|
+
"problem": "Migrating old products to design system",
|
|
396
|
+
"strategy": {
|
|
397
|
+
"incremental": {
|
|
398
|
+
"description": "Migrate page by page, component by component",
|
|
399
|
+
"pros": ["Lower risk", "Continuous value"],
|
|
400
|
+
"cons": ["Takes time", "Inconsistency during migration"]
|
|
401
|
+
},
|
|
402
|
+
"big_bang": {
|
|
403
|
+
"description": "Rewrite entire product at once",
|
|
404
|
+
"pros": ["Fully consistent", "Clean slate"],
|
|
405
|
+
"cons": ["High risk", "Long development time"],
|
|
406
|
+
"use_when": "Small apps or major redesign"
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
"coexistence": {
|
|
410
|
+
"description": "Run old and new design system side-by-side",
|
|
411
|
+
"technique": "CSS scoping, namespacing, Shadow DOM",
|
|
412
|
+
"example": "Namespace old styles with .legacy, new with .ds"
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
"advanced_patterns": {
|
|
417
|
+
"component_composition": {
|
|
418
|
+
"description": "Building complex components from primitives",
|
|
419
|
+
"example": "Card component built from Box, Text, Button primitives",
|
|
420
|
+
"benefits": ["Flexibility", "Consistency", "Smaller bundle (reuse)"],
|
|
421
|
+
"approach": "Provide both primitives (low-level) and compositions (high-level)"
|
|
422
|
+
},
|
|
423
|
+
"css_in_js_vs_css_modules": {
|
|
424
|
+
"css_in_js": {
|
|
425
|
+
"pros": ["Dynamic theming", "Scoped styles", "Type-safe"],
|
|
426
|
+
"cons": ["Runtime overhead", "Larger bundle"],
|
|
427
|
+
"libraries": ["Styled Components", "Emotion", "Stitches", "Vanilla Extract (zero-runtime)"]
|
|
428
|
+
},
|
|
429
|
+
"css_modules": {
|
|
430
|
+
"pros": ["No runtime", "Familiar CSS"],
|
|
431
|
+
"cons": ["Less dynamic", "Theming harder"],
|
|
432
|
+
"use_when": "Performance critical, simple theming"
|
|
433
|
+
},
|
|
434
|
+
"utility_first": {
|
|
435
|
+
"pros": ["Fast development", "Small bundle (purge unused)"],
|
|
436
|
+
"cons": ["Verbose HTML", "Harder to change globally"],
|
|
437
|
+
"libraries": ["Tailwind CSS", "UnoCSS"],
|
|
438
|
+
"use_with_ds": "Use for layout, DS for components"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"accessibility_primitives": {
|
|
442
|
+
"description": "Low-level accessible components (no styling)",
|
|
443
|
+
"examples": {
|
|
444
|
+
"focus_trap": "Trap focus within modal",
|
|
445
|
+
"visually_hidden": "Hide content visually, keep for screen readers",
|
|
446
|
+
"keyboard_navigation": "Arrow key navigation for lists/menus"
|
|
447
|
+
},
|
|
448
|
+
"libraries": ["Radix Primitives", "React Aria", "Reach UI"]
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"case_studies": {
|
|
452
|
+
"material_ui": {
|
|
453
|
+
"scale": "Most popular React UI library",
|
|
454
|
+
"approach": "Themeable, extensive component set, multiple packages",
|
|
455
|
+
"lessons": ["Theming is critical", "Documentation is make-or-break", "Community contributions scale"]
|
|
456
|
+
},
|
|
457
|
+
"carbon_ibm": {
|
|
458
|
+
"scale": "Multiple frameworks (React, Vue, Angular, Svelte, Web Components)",
|
|
459
|
+
"approach": "Design tokens, extensive guidelines, governance model",
|
|
460
|
+
"lessons": ["Multi-framework is possible but complex", "Governance essential at scale"]
|
|
461
|
+
},
|
|
462
|
+
"polaris_shopify": {
|
|
463
|
+
"scale": "Powers all Shopify admin interfaces",
|
|
464
|
+
"approach": "Opinionated, accessibility-first, React-only",
|
|
465
|
+
"lessons": ["Opinionated DS can work (less choice = consistency)", "Invest in tools (Polaris Icons, etc.)"]
|
|
466
|
+
},
|
|
467
|
+
"atlassian_design_system": {
|
|
468
|
+
"scale": "Jira, Confluence, Trello, etc.",
|
|
469
|
+
"approach": "Extensive token system, dark mode, rigorous accessibility",
|
|
470
|
+
"lessons": ["Tokens enable flexibility", "Accessibility testing in CI", "Versioning and migration matter"]
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
"best_practices": [
|
|
474
|
+
"Use semantic tokens (3-tier: core → semantic → component)",
|
|
475
|
+
"Support theming (light/dark, multi-brand)",
|
|
476
|
+
"Version semantically (MAJOR.MINOR.PATCH)",
|
|
477
|
+
"Deprecate gracefully (warn, document, grace period)",
|
|
478
|
+
"Write migration guides for major versions",
|
|
479
|
+
"Document extensively (API, examples, accessibility, guidelines)",
|
|
480
|
+
"Use Storybook or similar for component explorer",
|
|
481
|
+
"Test accessibility (automated + manual)",
|
|
482
|
+
"Visual regression testing (Chromatic, Percy)",
|
|
483
|
+
"Provide both primitives and compositions",
|
|
484
|
+
"Support controlled and uncontrolled components",
|
|
485
|
+
"Use compound components for related UI",
|
|
486
|
+
"Establish governance (core team, RFC process)",
|
|
487
|
+
"Track adoption metrics",
|
|
488
|
+
"Provide multiple support channels",
|
|
489
|
+
"Internationalize (i18n)",
|
|
490
|
+
"Consider multi-framework if needed (Web Components or multiple implementations)",
|
|
491
|
+
"Incremental migration strategy for legacy apps",
|
|
492
|
+
"Keep changelog up-to-date",
|
|
493
|
+
"Publish to npm with proper versioning"
|
|
494
|
+
],
|
|
495
|
+
"anti_patterns": [
|
|
496
|
+
"Hardcoded values in components (use tokens)",
|
|
497
|
+
"No versioning strategy (breaks consumers)",
|
|
498
|
+
"Breaking changes without warning (no deprecation)",
|
|
499
|
+
"Poor documentation (unmaintainable)",
|
|
500
|
+
"No accessibility testing (violates WCAG)",
|
|
501
|
+
"No governance (design system anarchy)",
|
|
502
|
+
"Ignoring feedback from consumers",
|
|
503
|
+
"Building components no one needs (ivory tower)",
|
|
504
|
+
"Over-abstracting (too many layers of tokens)",
|
|
505
|
+
"Under-abstracting (no tokens, hardcoded)",
|
|
506
|
+
"No testing (unit, visual, a11y)",
|
|
507
|
+
"Inconsistent API across components",
|
|
508
|
+
"Forcing adoption (mandate without buy-in)",
|
|
509
|
+
"Not tracking adoption (blind to usage)",
|
|
510
|
+
"No migration guides (consumers stuck on old versions)",
|
|
511
|
+
"Releasing breaking changes in minor versions",
|
|
512
|
+
"Not supporting theming (inflexible)",
|
|
513
|
+
"Single framework lock-in (when org uses multiple)",
|
|
514
|
+
"No changelog (consumers don't know what changed)",
|
|
515
|
+
"Skipping visual regression tests (unintended changes ship)"
|
|
516
|
+
],
|
|
517
|
+
"resources": [
|
|
518
|
+
"Design Systems Handbook (DesignBetter.co)",
|
|
519
|
+
"Atomic Design (Brad Frost)",
|
|
520
|
+
"Component-Driven Development (Storybook)",
|
|
521
|
+
"Design Tokens W3C Community Group",
|
|
522
|
+
"Style Dictionary (token transformation)",
|
|
523
|
+
"Storybook Documentation",
|
|
524
|
+
"Chromatic (visual testing)",
|
|
525
|
+
"Radix UI (headless components)",
|
|
526
|
+
"Material-UI (mature example)",
|
|
527
|
+
"Carbon Design System (IBM)",
|
|
528
|
+
"Polaris (Shopify)",
|
|
529
|
+
"Atlassian Design System",
|
|
530
|
+
"Keep a Changelog (changelog format)",
|
|
531
|
+
"Semantic Versioning (semver.org)"
|
|
532
|
+
]
|
|
533
|
+
}
|