doom-design-system 0.5.0 → 0.6.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.
Files changed (211) hide show
  1. package/dist/components/Accordion/Accordion.module.css +121 -124
  2. package/dist/components/ActionRow/ActionRow.module.css +25 -24
  3. package/dist/components/Alert/Alert.module.css +74 -76
  4. package/dist/components/Avatar/Avatar.module.css +66 -66
  5. package/dist/components/Badge/Badge.module.css +50 -48
  6. package/dist/components/Breadcrumbs/Breadcrumbs.module.css +32 -33
  7. package/dist/components/Button/Button.d.ts +2 -2
  8. package/dist/components/Button/Button.js +1 -1
  9. package/dist/components/Button/Button.module.css +150 -152
  10. package/dist/components/Card/Card.module.css +37 -39
  11. package/dist/components/Chart/Chart.module.css +213 -245
  12. package/dist/components/Chart/behaviors/DraggablePuck.d.ts +36 -0
  13. package/dist/components/Chart/behaviors/DraggablePuck.js +94 -0
  14. package/dist/components/Chart/behaviors/Markers.js +6 -4
  15. package/dist/components/Chart/behaviors/SelectionUpdate.js +2 -4
  16. package/dist/components/Chart/behaviors/index.d.ts +1 -1
  17. package/dist/components/Chart/behaviors/index.js +1 -1
  18. package/dist/components/Chart/engine/CoordinateSystem.d.ts +59 -0
  19. package/dist/components/Chart/engine/CoordinateSystem.js +126 -0
  20. package/dist/components/Chart/engine/Engine.d.ts +102 -0
  21. package/dist/components/Chart/engine/Engine.js +226 -0
  22. package/dist/components/Chart/engine/Scheduler.d.ts +59 -0
  23. package/dist/components/Chart/engine/Scheduler.js +139 -0
  24. package/dist/components/Chart/engine/SpatialMap.d.ts +114 -0
  25. package/dist/components/Chart/engine/SpatialMap.js +270 -0
  26. package/dist/components/Chart/engine/index.d.ts +13 -0
  27. package/dist/components/Chart/engine/index.js +9 -0
  28. package/dist/components/Chart/engine/types.d.ts +137 -0
  29. package/dist/components/Chart/engine/types.js +47 -0
  30. package/dist/components/Chart/hooks/useEngine.d.ts +43 -0
  31. package/dist/components/Chart/hooks/useEngine.js +128 -0
  32. package/dist/components/Chart/sensors/DataHoverSensor/DataHoverSensor.d.ts +17 -19
  33. package/dist/components/Chart/sensors/DataHoverSensor/DataHoverSensor.js +38 -51
  34. package/dist/components/Chart/sensors/DragSensor/DragSensor.d.ts +38 -0
  35. package/dist/components/Chart/sensors/DragSensor/DragSensor.js +105 -0
  36. package/dist/components/Chart/sensors/DragSensor/index.d.ts +2 -0
  37. package/dist/components/Chart/sensors/DragSensor/index.js +1 -0
  38. package/dist/components/Chart/sensors/{KeyboardSensor.d.ts → KeyboardSensor/KeyboardSensor.d.ts} +1 -1
  39. package/dist/components/Chart/sensors/KeyboardSensor/KeyboardSensor.js +86 -0
  40. package/dist/components/Chart/sensors/KeyboardSensor/index.d.ts +1 -0
  41. package/dist/components/Chart/sensors/KeyboardSensor/index.js +1 -0
  42. package/dist/components/Chart/sensors/{SelectionSensor.d.ts → SelectionSensor/SelectionSensor.d.ts} +2 -2
  43. package/dist/components/Chart/sensors/SelectionSensor/SelectionSensor.js +39 -0
  44. package/dist/components/Chart/sensors/SelectionSensor/index.d.ts +1 -0
  45. package/dist/components/Chart/sensors/SelectionSensor/index.js +1 -0
  46. package/dist/components/Chart/sensors/SensorManager/SensorManager.js +36 -41
  47. package/dist/components/Chart/sensors/index.d.ts +1 -0
  48. package/dist/components/Chart/sensors/index.js +3 -2
  49. package/dist/components/Chart/sensors/utils/search.d.ts +1 -1
  50. package/dist/components/Chart/sensors/utils/search.js +25 -4
  51. package/dist/components/Chart/state/store/chart.store.js +18 -0
  52. package/dist/components/Chart/state/store/slices/series.slice.d.ts +1 -0
  53. package/dist/components/Chart/state/store/slices/series.slice.js +3 -2
  54. package/dist/components/Chart/subcomponents/Axis/Axis.module.css +32 -33
  55. package/dist/components/Chart/subcomponents/BarSeries/BarSeries.js +6 -1
  56. package/dist/components/Chart/subcomponents/BarSeries/BarSeries.module.css +11 -9
  57. package/dist/components/Chart/subcomponents/Cursor/Cursor.js +8 -1
  58. package/dist/components/Chart/subcomponents/Cursor/Cursor.module.css +14 -13
  59. package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.js +4 -0
  60. package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.module.css +5 -3
  61. package/dist/components/Chart/subcomponents/Footer/Footer.module.css +5 -3
  62. package/dist/components/Chart/subcomponents/Grid/Grid.module.css +12 -11
  63. package/dist/components/Chart/subcomponents/Header/Header.module.css +8 -7
  64. package/dist/components/Chart/subcomponents/InteractionLayer/InteractionLayer.d.ts +4 -4
  65. package/dist/components/Chart/subcomponents/InteractionLayer/InteractionLayer.js +39 -76
  66. package/dist/components/Chart/subcomponents/Legend/Legend.module.css +30 -32
  67. package/dist/components/Chart/subcomponents/LineSeries/LineSeries.js +9 -3
  68. package/dist/components/Chart/subcomponents/LineSeries/LineSeries.module.css +21 -21
  69. package/dist/components/Chart/subcomponents/Root/Root.js +113 -7
  70. package/dist/components/Chart/subcomponents/Root/Root.module.css +70 -82
  71. package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.js +6 -1
  72. package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.module.css +7 -5
  73. package/dist/components/Chart/subcomponents/Series/Series.module.css +118 -128
  74. package/dist/components/Chart/subcomponents/SeriesPoint/SeriesPoint.module.css +10 -8
  75. package/dist/components/Chart/subcomponents/Tooltip/Tooltip.js +2 -3
  76. package/dist/components/Chart/subcomponents/Tooltip/Tooltip.module.css +52 -67
  77. package/dist/components/Chart/types/context.d.ts +9 -0
  78. package/dist/components/Chart/types/events.d.ts +5 -7
  79. package/dist/components/Chart/types/interaction.d.ts +24 -2
  80. package/dist/components/Chart/types/interaction.js +1 -0
  81. package/dist/components/Checkbox/Checkbox.module.css +57 -59
  82. package/dist/components/Chip/Chip.module.css +105 -115
  83. package/dist/components/Combobox/Combobox.d.ts +2 -1
  84. package/dist/components/Combobox/Combobox.js +2 -2
  85. package/dist/components/Combobox/Combobox.module.css +233 -210
  86. package/dist/components/CopyButton/CopyButton.module.css +84 -90
  87. package/dist/components/Drawer/Drawer.module.css +126 -145
  88. package/dist/components/Dropdown/Dropdown.d.ts +3 -1
  89. package/dist/components/Dropdown/Dropdown.js +3 -3
  90. package/dist/components/Dropdown/Dropdown.module.css +52 -32
  91. package/dist/components/FileUpload/FileUpload.js +24 -0
  92. package/dist/components/FileUpload/FileUpload.module.css +295 -313
  93. package/dist/components/Form/Form.module.css +35 -39
  94. package/dist/components/Image/Image.module.css +53 -54
  95. package/dist/components/Input/Input.d.ts +4 -2
  96. package/dist/components/Input/Input.js +2 -2
  97. package/dist/components/Input/Input.module.css +135 -119
  98. package/dist/components/Label/Label.module.css +17 -15
  99. package/dist/components/Layout/Layout.module.css +95 -111
  100. package/dist/components/Link/Link.module.css +67 -65
  101. package/dist/components/Modal/Modal.module.css +112 -132
  102. package/dist/components/Page/Page.module.css +21 -21
  103. package/dist/components/Pagination/Pagination.module.css +56 -56
  104. package/dist/components/Popover/Popover.module.css +17 -16
  105. package/dist/components/ProgressBar/ProgressBar.module.css +36 -37
  106. package/dist/components/RadioGroup/RadioGroup.module.css +74 -77
  107. package/dist/components/Select/Select.d.ts +2 -1
  108. package/dist/components/Select/Select.js +2 -2
  109. package/dist/components/Select/Select.module.css +133 -98
  110. package/dist/components/Sheet/Sheet.module.css +134 -154
  111. package/dist/components/Sidebar/Sidebar.module.css +72 -74
  112. package/dist/components/Sidebar/subcomponents/Footer/Footer.module.css +7 -5
  113. package/dist/components/Sidebar/subcomponents/Group/Group.module.css +80 -85
  114. package/dist/components/Sidebar/subcomponents/Header/Header.module.css +12 -10
  115. package/dist/components/Sidebar/subcomponents/Item/Item.module.css +54 -55
  116. package/dist/components/Sidebar/subcomponents/MobileOverlay/MobileOverlay.module.css +38 -38
  117. package/dist/components/Sidebar/subcomponents/MobileTrigger/MobileTrigger.module.css +5 -3
  118. package/dist/components/Sidebar/subcomponents/Nav/Nav.module.css +13 -11
  119. package/dist/components/Sidebar/subcomponents/Rail/Rail.module.css +62 -63
  120. package/dist/components/Sidebar/subcomponents/Section/Section.module.css +86 -91
  121. package/dist/components/Skeleton/Skeleton.module.css +28 -26
  122. package/dist/components/Slat/Slat.module.css +93 -94
  123. package/dist/components/Slider/Slider.module.css +116 -121
  124. package/dist/components/Spinner/Spinner.module.css +28 -27
  125. package/dist/components/SplitButton/SplitButton.d.ts +3 -1
  126. package/dist/components/SplitButton/SplitButton.js +2 -2
  127. package/dist/components/SplitButton/SplitButton.module.css +104 -87
  128. package/dist/components/Switch/Switch.module.css +64 -63
  129. package/dist/components/Table/FilterBuilder/FilterBuilder.module.css +36 -36
  130. package/dist/components/Table/FilterBuilder/FilterConditionRow.js +1 -1
  131. package/dist/components/Table/FilterBuilder/FilterConditionRow.module.css +21 -22
  132. package/dist/components/Table/FilterBuilder/FilterGroup.js +4 -4
  133. package/dist/components/Table/FilterBuilder/FilterGroup.module.css +355 -389
  134. package/dist/components/Table/FilterBuilder/FilterSheet.module.css +68 -71
  135. package/dist/components/Table/Table.d.ts +4 -2
  136. package/dist/components/Table/Table.js +50 -13
  137. package/dist/components/Table/Table.module.css +210 -188
  138. package/dist/components/Table/TableHeaderFilter.js +1 -1
  139. package/dist/components/Table/TableHeaderFilter.module.css +51 -57
  140. package/dist/components/Tabs/Tabs.module.css +79 -80
  141. package/dist/components/Text/Text.module.css +108 -131
  142. package/dist/components/Textarea/Textarea.d.ts +3 -1
  143. package/dist/components/Textarea/Textarea.js +2 -2
  144. package/dist/components/Textarea/Textarea.module.css +114 -94
  145. package/dist/components/Toast/Toast.module.css +82 -82
  146. package/dist/components/Tooltip/Tooltip.module.css +17 -16
  147. package/dist/styles/globals.css +1677 -1691
  148. package/dist/styles/palettes.d.ts +0 -5
  149. package/dist/styles/palettes.js +0 -8
  150. package/dist/styles/themes/definitions.d.ts +0 -8
  151. package/dist/styles/themes/definitions.js +117 -5
  152. package/dist/styles/types.d.ts +2 -0
  153. package/dist/styles/types.js +1 -0
  154. package/dist/tsconfig.build.tsbuildinfo +1 -1
  155. package/package.json +4 -4
  156. package/.agent/skills/doom/a2ui/a2ui-examples.md +0 -289
  157. package/.agent/skills/doom/a2ui/a2ui-principles.md +0 -49
  158. package/.agent/skills/doom/a2ui/a2ui-protocol.md +0 -191
  159. package/.agent/skills/doom/components/a2ui.md +0 -46
  160. package/.agent/skills/doom/components/accordion.md +0 -44
  161. package/.agent/skills/doom/components/actionrow.md +0 -33
  162. package/.agent/skills/doom/components/alert.md +0 -35
  163. package/.agent/skills/doom/components/avatar.md +0 -36
  164. package/.agent/skills/doom/components/badge.md +0 -29
  165. package/.agent/skills/doom/components/breadcrumbs.md +0 -33
  166. package/.agent/skills/doom/components/button.md +0 -43
  167. package/.agent/skills/doom/components/card.md +0 -41
  168. package/.agent/skills/doom/components/chart.md +0 -106
  169. package/.agent/skills/doom/components/checkbox.md +0 -38
  170. package/.agent/skills/doom/components/chip.md +0 -35
  171. package/.agent/skills/doom/components/combobox.md +0 -50
  172. package/.agent/skills/doom/components/copybutton.md +0 -41
  173. package/.agent/skills/doom/components/drawer.md +0 -69
  174. package/.agent/skills/doom/components/dropdown.md +0 -33
  175. package/.agent/skills/doom/components/fileupload.md +0 -49
  176. package/.agent/skills/doom/components/form.md +0 -55
  177. package/.agent/skills/doom/components/icon.md +0 -47
  178. package/.agent/skills/doom/components/image.md +0 -48
  179. package/.agent/skills/doom/components/input.md +0 -54
  180. package/.agent/skills/doom/components/label.md +0 -32
  181. package/.agent/skills/doom/components/layout.md +0 -92
  182. package/.agent/skills/doom/components/link.md +0 -39
  183. package/.agent/skills/doom/components/modal.md +0 -71
  184. package/.agent/skills/doom/components/page.md +0 -41
  185. package/.agent/skills/doom/components/pagination.md +0 -32
  186. package/.agent/skills/doom/components/popover.md +0 -45
  187. package/.agent/skills/doom/components/progressbar.md +0 -37
  188. package/.agent/skills/doom/components/radiogroup.md +0 -45
  189. package/.agent/skills/doom/components/select.md +0 -43
  190. package/.agent/skills/doom/components/sheet.md +0 -71
  191. package/.agent/skills/doom/components/sidebar.md +0 -92
  192. package/.agent/skills/doom/components/skeleton.md +0 -35
  193. package/.agent/skills/doom/components/slat.md +0 -46
  194. package/.agent/skills/doom/components/slider.md +0 -51
  195. package/.agent/skills/doom/components/spinner.md +0 -34
  196. package/.agent/skills/doom/components/splitbutton.md +0 -35
  197. package/.agent/skills/doom/components/switch.md +0 -40
  198. package/.agent/skills/doom/components/table.md +0 -82
  199. package/.agent/skills/doom/components/tabs.md +0 -65
  200. package/.agent/skills/doom/components/text.md +0 -42
  201. package/.agent/skills/doom/components/textarea.md +0 -46
  202. package/.agent/skills/doom/components/toast.md +0 -59
  203. package/.agent/skills/doom/components/tooltip.md +0 -35
  204. package/.agent/skills/doom/index.md +0 -167
  205. package/.agent/skills/doom/styles/aesthetic.md +0 -151
  206. package/.agent/skills/doom/styles/css-variables.md +0 -80
  207. package/.agent/skills/doom/styles/mixins.md +0 -97
  208. package/.agent/skills/doom/styles/tokens.md +0 -129
  209. package/.agent/skills/doom/styles/utilities.md +0 -84
  210. package/dist/components/Chart/sensors/KeyboardSensor.js +0 -82
  211. package/dist/components/Chart/sensors/SelectionSensor.js +0 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doom-design-system",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Neubrutalist and comic book inspired design system",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -14,8 +14,7 @@
14
14
  "./package.json": "./package.json"
15
15
  },
16
16
  "files": [
17
- "dist",
18
- ".agent/skills"
17
+ "dist"
19
18
  ],
20
19
  "scripts": {
21
20
  "build": "rimraf dist && tsc -p tsconfig.build.json && sass components:dist/components styles:dist/styles --no-source-map && node scripts/fix-imports.cjs",
@@ -24,7 +23,8 @@
24
23
  "storybook": "storybook dev -p 6006",
25
24
  "build-storybook": "storybook build -o storybook-static",
26
25
  "deploy-build": "rimraf build && mkdir -p build && cp website/index.html website/doom.png build/ && storybook build -o build/storybook",
27
- "test": "vitest",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
28
  "test:integration": "vitest run --config vitest.integration.config.ts",
29
29
  "lint:package": "publint",
30
30
  "lint": "eslint .",
@@ -1,289 +0,0 @@
1
- # A2UI Examples
2
-
3
- ## ⚠️ Text Prop Usage
4
-
5
- **IMPORTANT**: Not all components support `text: { literalString }`. Check which prop to use:
6
-
7
- | Component | ✅ Correct Prop | ❌ Don't Use |
8
- | -------------------------------------------------- | ------------------------- | ------------ |
9
- | `text`, `button`, `badge`, `chip`, `label`, `link` | `text: { literalString }` | - |
10
- | `slat` | `label`, `secondaryLabel` | `text` |
11
- | `alert` | `title`, `description` | `text` |
12
- | `input` | `label`, `placeholder` | `text` |
13
-
14
- ---
15
-
16
- ## Example 1: Login Card
17
-
18
- **User Request**: "A login card with email and password fields, and a submit button."
19
-
20
- ```json
21
- {
22
- "surfaceId": "login",
23
- "components": [
24
- {
25
- "id": "root",
26
- "component": {
27
- "card": {
28
- "className": "p-6 w-full",
29
- "style": { "maxWidth": "24rem" },
30
- "child": "content"
31
- }
32
- }
33
- },
34
- {
35
- "id": "content",
36
- "component": {
37
- "stack": {
38
- "gap": 4,
39
- "children": {
40
- "explicitList": ["title", "email", "password", "submit"]
41
- }
42
- }
43
- }
44
- },
45
- {
46
- "id": "title",
47
- "component": {
48
- "text": { "variant": "h3", "text": { "literalString": "Login" } }
49
- }
50
- },
51
- {
52
- "id": "email",
53
- "component": {
54
- "input": { "label": "Email", "placeholder": "you@example.com" }
55
- }
56
- },
57
- {
58
- "id": "password",
59
- "component": {
60
- "input": { "label": "Password", "type": "password" }
61
- }
62
- },
63
- {
64
- "id": "submit",
65
- "component": {
66
- "button": {
67
- "variant": "primary",
68
- "className": "w-full",
69
- "text": { "literalString": "Sign In" }
70
- }
71
- }
72
- }
73
- ]
74
- }
75
- ```
76
-
77
- ## Example 2: Dashboard with Slats and Alerts
78
-
79
- **User Request**: "Dashboard stats using slat components and a warning alert."
80
-
81
- ```json
82
- {
83
- "surfaceId": "dashboard",
84
- "components": [
85
- {
86
- "id": "root",
87
- "component": {
88
- "stack": {
89
- "gap": 4,
90
- "children": { "explicitList": ["stats-grid", "warning"] }
91
- }
92
- }
93
- },
94
- {
95
- "id": "stats-grid",
96
- "component": {
97
- "grid": {
98
- "columns": 3,
99
- "gap": 4,
100
- "children": {
101
- "explicitList": ["users-slat", "revenue-slat", "growth-slat"]
102
- }
103
- }
104
- }
105
- },
106
- {
107
- "id": "users-slat",
108
- "component": {
109
- "slat": {
110
- "label": "Total Users",
111
- "secondaryLabel": "1,234"
112
- }
113
- }
114
- },
115
- {
116
- "id": "revenue-slat",
117
- "component": {
118
- "slat": {
119
- "label": "Revenue",
120
- "secondaryLabel": "$45.2k"
121
- }
122
- }
123
- },
124
- {
125
- "id": "growth-slat",
126
- "component": {
127
- "slat": {
128
- "variant": "success",
129
- "label": "Growth",
130
- "secondaryLabel": "+12%"
131
- }
132
- }
133
- },
134
- {
135
- "id": "warning",
136
- "component": {
137
- "alert": {
138
- "variant": "warning",
139
- "title": "Maintenance Scheduled",
140
- "description": "System will be down for maintenance at 2:00 AM UTC."
141
- }
142
- }
143
- }
144
- ]
145
- }
146
- ```
147
-
148
- ## Example 3: Data Binding
149
-
150
- **User Request**: "A user greeting that displays the user's name from data."
151
-
152
- ```json
153
- {
154
- "surfaceId": "greeting",
155
- "components": [
156
- {
157
- "id": "root",
158
- "component": {
159
- "card": {
160
- "className": "p-6",
161
- "children": { "explicitList": ["welcome", "name"] }
162
- }
163
- }
164
- },
165
- {
166
- "id": "welcome",
167
- "component": {
168
- "text": {
169
- "variant": "small",
170
- "className": "text-muted",
171
- "text": { "literalString": "Welcome back," }
172
- }
173
- }
174
- },
175
- {
176
- "id": "name",
177
- "component": {
178
- "text": {
179
- "variant": "h2",
180
- "text": { "path": "/user/name" }
181
- }
182
- }
183
- }
184
- ]
185
- }
186
- ```
187
-
188
- **Data Model:**
189
-
190
- ```json
191
- {
192
- "user": { "name": "Alice Chen" }
193
- }
194
- ```
195
-
196
- ## Example 4: Navigation with Tabs
197
-
198
- **User Request**: "A tabbed interface with Overview and Settings tabs."
199
-
200
- ```json
201
- {
202
- "surfaceId": "tabbed-ui",
203
- "components": [
204
- {
205
- "id": "root",
206
- "component": {
207
- "tabs": {
208
- "defaultValue": "overview",
209
- "children": { "explicitList": ["tab-list", "tab-body"] }
210
- }
211
- }
212
- },
213
- {
214
- "id": "tab-list",
215
- "component": {
216
- "tabs-list": {
217
- "children": { "explicitList": ["tab-overview", "tab-settings"] }
218
- }
219
- }
220
- },
221
- {
222
- "id": "tab-overview",
223
- "component": {
224
- "tabs-trigger": {
225
- "value": "overview",
226
- "text": { "literalString": "Overview" }
227
- }
228
- }
229
- },
230
- {
231
- "id": "tab-settings",
232
- "component": {
233
- "tabs-trigger": {
234
- "value": "settings",
235
- "text": { "literalString": "Settings" }
236
- }
237
- }
238
- },
239
- {
240
- "id": "tab-body",
241
- "component": {
242
- "tabs-body": {
243
- "children": {
244
- "explicitList": ["content-overview", "content-settings"]
245
- }
246
- }
247
- }
248
- },
249
- {
250
- "id": "content-overview",
251
- "component": {
252
- "tabs-content": { "value": "overview", "child": "overview-text" }
253
- }
254
- },
255
- {
256
- "id": "overview-text",
257
- "component": {
258
- "text": { "text": { "literalString": "This is the overview content." } }
259
- }
260
- },
261
- {
262
- "id": "content-settings",
263
- "component": {
264
- "tabs-content": { "value": "settings", "child": "settings-text" }
265
- }
266
- },
267
- {
268
- "id": "settings-text",
269
- "component": {
270
- "text": { "text": { "literalString": "This is the settings content." } }
271
- }
272
- }
273
- ]
274
- }
275
- ```
276
-
277
- ---
278
-
279
- ## Quick Reference
280
-
281
- **Supports `text` prop (→ children):**
282
- `text`, `label`, `button`, `badge`, `chip`, `link`, `tabs-trigger`, `breadcrumb-item`
283
-
284
- **Use specific props instead:**
285
-
286
- - `slat` → `label` + `secondaryLabel`
287
- - `alert` → `title` + `description`
288
- - `input` → `label` + `placeholder`
289
- - `avatar` → `fallback`
@@ -1,49 +0,0 @@
1
- # A2UI Principles
2
-
3
- ## 1. Aesthetic
4
-
5
- - **Borders**: All interactive elements (cards, buttons, inputs) already have borders built-in. Do not add `border` classes manually.
6
- - **Shadows**: Use `shadow-hard` for a brutalist look if you are creating a custom container, but prefer using `<Card>` which handles this for you.
7
- - **Radius**: Default radius is `4px`. Avoid `rounded-full` unless creating a badge or avatar.
8
-
9
- ## 2. Layout & Spacing
10
-
11
- - **Do NOT** use `margin` or `padding` on individual items to space them out.
12
- - **DO** use `Stack` (vertical) or `Flex` (horizontal) with the `gap` prop.
13
- - `gap={1}` = 4px
14
- - `gap={4}` = 16px (Standard)
15
- - `gap={6}` = 24px (Section separation)
16
- - Use `Grid` for complex 2D layouts. `columns` prop accepts numbers (`3`) or CSS strings (`"1fr 2fr"`).
17
-
18
- ## 3. Typography
19
-
20
- - Use the `<Text>` component for all text.
21
- - **Variants**:
22
- - `h1`-`h3`: Page/Section titles (Bold, Uppercase)
23
- - `body`: Default text
24
- - `small`: Metadata/Labels (Muted)
25
- - Do not use `<h1>` tags inside HTML strings.
26
-
27
- ## 4. Colors & Variables
28
-
29
- - Use CSS variables for all custom styling.
30
- - **Primary**: `var(--primary)` (Brand color)
31
- - **Backgrounds**: `var(--card-bg)`, `var(--background)`
32
- - **Text**: `var(--foreground)`, `var(--muted-foreground)`
33
- - **Status**: `var(--success)`, `var(--error)`, `var(--warning)`
34
-
35
- ## 5. Components
36
-
37
- - **Inputs**: Always provide a `label`.
38
- - **Buttons**: Use `variant="ghost"` for secondary/tertiary actions to reduce visual noise.
39
- - **Charts**: Use the `style` prop to set explicit height (e.g., `{ height: 400 }`).
40
-
41
- ## 6. Utilities
42
-
43
- - **WE ARE NOT A TAILWIND SYSTEM**. Do not use generic Tailwind classes (e.g., `max-w-sm`, `bg-red-500`, `rounded-lg`).
44
- - **ONLY** use the specific utility classes defined in the Doom system:
45
- - Spacing: `p-0` to `p-10`, `m-0` to `m-10` (4px increments)
46
- - Sizing: `w-full`, `h-full`, `h-screen`
47
- - Flex: `flex`, `flex-col`, `items-center`, `justify-between`
48
- - Typography: `text-{size}`, `text-{color}`, `uppercase`, `text-center`, `text-left`, `text-right`
49
- - For specific visuals not covered by utilities, use the `style` prop.
@@ -1,191 +0,0 @@
1
- # A2UI Protocol Reference
2
-
3
- ## Message Schema
4
-
5
- A2UI uses a flat adjacency list format where components reference children by ID.
6
-
7
- ### Component Structure
8
-
9
- ```json
10
- {
11
- "surfaceId": "main",
12
- "components": [
13
- {
14
- "id": "unique-id",
15
- "component": {
16
- "component-type": {
17
- "propName": "value",
18
- "text": { "literalString": "Static text" },
19
- "children": { "explicitList": ["child-id-1", "child-id-2"] }
20
- }
21
- }
22
- }
23
- ]
24
- }
25
- ```
26
-
27
- ### Value Types
28
-
29
- | Type | Format | Example |
30
- | ----------------- | ---------------------------- | -------------------------------- |
31
- | Literal String | `{ "literalString": "..." }` | `{ "literalString": "Hello" }` |
32
- | Data Binding | `{ "path": "/..." }` | `{ "path": "/user/name" }` |
33
- | Single Child | `"child-id"` | `"header-component"` |
34
- | Multiple Children | `{ "explicitList": [...] }` | `{ "explicitList": ["a", "b"] }` |
35
-
36
- ---
37
-
38
- ## Text Content: IMPORTANT
39
-
40
- **Not all components use `text` prop.** Only components marked with ✅ below support `text: { literalString }` or `text: { path }`:
41
-
42
- | Supports `text` prop | Component | Text Prop |
43
- | :------------------: | ----------------- | ------------------------------ |
44
- | ✅ | `label` | `text` |
45
- | ✅ | `text` | `text` → maps to children |
46
- | ✅ | `button` | `text` → maps to children |
47
- | ✅ | `badge` | `text` → maps to children |
48
- | ✅ | `chip` | `text` → maps to children |
49
- | ✅ | `link` | `text` → maps to children |
50
- | ✅ | `tabs-trigger` | `text` → maps to children |
51
- | ✅ | `breadcrumb-item` | `text` → maps to children |
52
- | ❌ | `slat` | Use `label` + `secondaryLabel` |
53
- | ❌ | `alert` | Use `title` + `description` |
54
- | ❌ | `input` | Use `label` + `placeholder` |
55
- | ❌ | `avatar` | Use `fallback` for initials |
56
-
57
- ### Common Mistakes
58
-
59
- ```json
60
- // ❌ WRONG - slat doesn't support text prop
61
- { "slat": { "label": "Trips", "text": { "literalString": "4" } } }
62
-
63
- // ✅ CORRECT - use secondaryLabel
64
- { "slat": { "label": "Trips", "secondaryLabel": "4" } }
65
-
66
- // ❌ WRONG - alert doesn't support text prop
67
- { "alert": { "variant": "warning", "text": { "literalString": "Warning message" } } }
68
-
69
- // ✅ CORRECT - use title and description
70
- { "alert": { "variant": "warning", "title": "Warning", "description": "Message details" } }
71
- ```
72
-
73
- ---
74
-
75
- ## Component Reference
76
-
77
- ### Primitives
78
-
79
- | Type | Key Props | Notes |
80
- | ---------- | ------------------------------------ | ------------------------------ |
81
- | `label` | `text` ✅ | Simple text label |
82
- | `text` | `variant`, `text` ✅ | Typography: h1-h6/body/small |
83
- | `button` | `variant`, `text` ✅ | primary/secondary/ghost/danger |
84
- | `badge` | `variant`, `text` ✅ | Status indicator |
85
- | `chip` | `variant`, `text` ✅ | Tag element |
86
- | `avatar` | `src`, `fallback`, `size` | User avatar |
87
- | `alert` | `title` ⚠️, `description`, `variant` | title is REQUIRED |
88
- | `card` | `className`, `child`/`children` | Container |
89
- | `input` | `label`, `placeholder`, `value` | Text field |
90
- | `textarea` | `label`, `placeholder`, `rows` | Multi-line |
91
- | `checkbox` | `label`, `checked` | Checkbox |
92
- | `switch` | `label`, `checked` | Toggle |
93
- | `link` | `href`, `text` ✅ | Hyperlink |
94
- | `spinner` | `size` | Loading indicator |
95
-
96
- ### Layout
97
-
98
- | Type | Key Props |
99
- | ----------- | -------------------------------------------------- |
100
- | `flex` | `direction`, `gap`, `align`, `justify`, `children` |
101
- | `stack` | `gap`, `children` |
102
- | `grid` | `columns`, `gap`, `children` |
103
- | `container` | `size`, `children` |
104
- | `box` | `className`, `children` |
105
-
106
- ### Data Display
107
-
108
- | Type | Key Props | Notes |
109
- | ---------------- | --------------------------------------- | ------------------------------- |
110
- | `slat` | `label` ⚠️, `secondaryLabel`, `variant` | label is REQUIRED, NO text prop |
111
- | `table` | `data`, `columns` | Each column needs `accessorKey` |
112
- | `chart` | `type`, `data`, `xKey`, `yKey` | line/area/bar |
113
- | `accordion` | `type`, `defaultValue`, `children` | single/multiple |
114
- | `accordion-item` | `value`, `trigger`, `children` | |
115
- | `image` | `src`, `alt` | |
116
-
117
- ### Navigation
118
-
119
- | Type | Key Props |
120
- | ----------------- | --------------------------- |
121
- | `tabs` | `defaultValue`, `children` |
122
- | `tabs-list` | `children` |
123
- | `tabs-trigger` | `value`, `text` ✅ |
124
- | `tabs-body` | `children` |
125
- | `tabs-content` | `value`, `child`/`children` |
126
- | `breadcrumbs` | `children` |
127
- | `breadcrumb-item` | `href`, `text` ✅ |
128
-
129
- ### Feedback
130
-
131
- | Type | Key Props |
132
- | -------------- | ------------------ |
133
- | `progress-bar` | `value`, `variant` |
134
- | `skeleton` | `width`, `height` |
135
-
136
- ### Actions
137
-
138
- | Type | Key Props |
139
- | -------------- | ---------- |
140
- | `action-row` | `children` |
141
- | `split-button` | `options` |
142
-
143
- ---
144
-
145
- ## Complete Example
146
-
147
- ```json
148
- {
149
- "surfaceId": "demo",
150
- "components": [
151
- {
152
- "id": "root",
153
- "component": {
154
- "card": {
155
- "className": "p-6",
156
- "children": { "explicitList": ["header", "stats", "warning"] }
157
- }
158
- }
159
- },
160
- {
161
- "id": "header",
162
- "component": {
163
- "text": {
164
- "variant": "h2",
165
- "text": { "literalString": "Dashboard" }
166
- }
167
- }
168
- },
169
- {
170
- "id": "stats",
171
- "component": {
172
- "slat": {
173
- "label": "Active Users",
174
- "secondaryLabel": "1,234",
175
- "variant": "success"
176
- }
177
- }
178
- },
179
- {
180
- "id": "warning",
181
- "component": {
182
- "alert": {
183
- "variant": "warning",
184
- "title": "Maintenance Scheduled",
185
- "description": "System will be down at 2:00 AM UTC."
186
- }
187
- }
188
- }
189
- ]
190
- }
191
- ```
@@ -1,46 +0,0 @@
1
- # A2UI
2
-
3
- The `A2UI` component renders a UI tree from a declarative JSON structure, enabling AI agents and external sources to generate Doom Design System interfaces dynamically.
4
-
5
- ## Import
6
-
7
- ```tsx
8
- import { A2UI } from "doom-design-system";
9
- ```
10
-
11
- ## Usage
12
-
13
- Pass the JSON tree to the `data` prop. The JSON must adhere to the [A2UI Protocol Schema](a2ui-protocol.md).
14
-
15
- ```tsx
16
- const data = {
17
- type: "card",
18
- props: { className: "p-6" },
19
- children: [
20
- {
21
- type: "button",
22
- props: { variant: "primary" },
23
- children: ["Rendered from JSON"],
24
- },
25
- ],
26
- };
27
-
28
- return <A2UI data={data} />;
29
- ```
30
-
31
- ## Props
32
-
33
- | Prop | Type | Description |
34
- | ------ | ---------- | -------------------------------------------- |
35
- | `data` | `A2UINode` | The JSON tree root node to render. Required. |
36
-
37
- ## Types
38
-
39
- ```tsx
40
- interface A2UINode {
41
- id?: string;
42
- type: string;
43
- props?: Record<string, unknown>;
44
- children?: (A2UINode | string)[];
45
- }
46
- ```
@@ -1,44 +0,0 @@
1
- # Accordion Component
2
-
3
- ## Import
4
-
5
- ```tsx
6
- import { Accordion, AccordionItem } from "doom-design-system";
7
- ```
8
-
9
- ## Props
10
-
11
- ### Accordion
12
-
13
- | Prop | Type | Default | Description |
14
- | --------------- | ------------------------ | ---------- | -------------------------- |
15
- | `type` | `"single" \| "multiple"` | `"single"` | Allow one or multiple open |
16
- | `defaultValue` | `string \| string[]` | — | Initial open item(s) |
17
- | `value` | `string \| string[]` | — | Controlled value |
18
- | `onValueChange` | `(value) => void` | — | Change callback |
19
-
20
- ### AccordionItem
21
-
22
- | Prop | Type | Description |
23
- | ---------- | ----------- | ----------------- |
24
- | `value` | `string` | Unique identifier |
25
- | `trigger` | `string` | Header text |
26
- | `children` | `ReactNode` | Panel content |
27
-
28
- ## Usage
29
-
30
- ```tsx
31
- <Accordion type="single" defaultValue="item-1">
32
- <AccordionItem value="item-1" trigger="Section 1">
33
- Content for section 1
34
- </AccordionItem>
35
- <AccordionItem value="item-2" trigger="Section 2">
36
- Content for section 2
37
- </AccordionItem>
38
- </Accordion>
39
- ```
40
-
41
- ## Guidelines
42
-
43
- - Use `type="multiple"` for FAQ sections where users may want multiple open.
44
- - Use `type="single"` (default) for navigation or settings panels.
@@ -1,33 +0,0 @@
1
- # ActionRow Component
2
-
3
- ## Import
4
-
5
- ```tsx
6
- import { ActionRow } from "doom-design-system";
7
- ```
8
-
9
- ## Props
10
-
11
- | Prop | Type | Description |
12
- | ------------- | ------------ | ----------------------- |
13
- | `icon` | `ReactNode` | Icon on the left |
14
- | `title` | `string` | Main label |
15
- | `description` | `string` | Optional secondary text |
16
- | `onClick` | `() => void` | Click handler |
17
-
18
- ## Usage
19
-
20
- ```tsx
21
- <ActionRow
22
- icon={<Settings size={20} />}
23
- title="Account Settings"
24
- description="Manage your profile and preferences"
25
- onClick={() => navigate("/settings")}
26
- />
27
- ```
28
-
29
- ## Guidelines
30
-
31
- - Use for settings menus, navigation lists, or action items.
32
- - Always provide an icon for visual consistency.
33
- - Renders with a chevron indicator on the right.