@object-ui/components 3.3.0 → 3.3.1

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 (321) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +21 -1
  3. package/dist/index.css +6339 -2
  4. package/dist/index.js +17600 -17481
  5. package/dist/index.umd.cjs +36 -36
  6. package/dist/packages/components/src/custom/empty.d.ts +12 -1
  7. package/dist/packages/components/src/renderers/action/action-bar.d.ts +12 -1
  8. package/dist/packages/components/src/ui/chart.d.ts +10 -29
  9. package/package.json +65 -44
  10. package/.turbo/turbo-build.log +0 -84
  11. package/README_SHADCN_SYNC.md +0 -281
  12. package/TESTING.md +0 -335
  13. package/docs/FilterBuilder.md +0 -268
  14. package/metadata/Chart.component.yml +0 -30
  15. package/metadata/FilterBuilder.component.yml +0 -39
  16. package/metadata/GridLayout.component.yml +0 -27
  17. package/metadata/Menu.component.yml +0 -31
  18. package/metadata/ObjectForm.component.yml +0 -34
  19. package/metadata/ObjectGrid.component.yml +0 -72
  20. package/metadata/Page.component.yml +0 -24
  21. package/postcss.config.js +0 -14
  22. package/shadcn-components.json +0 -440
  23. package/src/SchemaRenderer.tsx +0 -28
  24. package/src/__tests__/PageRendererRegions.test.tsx +0 -668
  25. package/src/__tests__/README.md +0 -124
  26. package/src/__tests__/__snapshots__/snapshot-critical.test.tsx.snap +0 -811
  27. package/src/__tests__/__snapshots__/snapshot.test.tsx.snap +0 -327
  28. package/src/__tests__/accessibility.test.tsx +0 -137
  29. package/src/__tests__/action-bar.test.tsx +0 -206
  30. package/src/__tests__/api-consistency.test.tsx +0 -596
  31. package/src/__tests__/basic-renderers.test.tsx +0 -255
  32. package/src/__tests__/color-contrast.test.tsx +0 -212
  33. package/src/__tests__/complex-disclosure-renderers.test.tsx +0 -302
  34. package/src/__tests__/compliance.test.tsx +0 -72
  35. package/src/__tests__/config-field-renderer.test.tsx +0 -307
  36. package/src/__tests__/config-panel-renderer.test.tsx +0 -580
  37. package/src/__tests__/config-primitives.test.tsx +0 -106
  38. package/src/__tests__/edge-cases.test.tsx +0 -285
  39. package/src/__tests__/feedback-overlay-renderers.test.tsx +0 -349
  40. package/src/__tests__/filter-builder.test.tsx +0 -409
  41. package/src/__tests__/form-renderers.test.tsx +0 -364
  42. package/src/__tests__/layout-data-renderers.test.tsx +0 -340
  43. package/src/__tests__/mobile-accessibility.test.tsx +0 -120
  44. package/src/__tests__/navigation-overlay.test.tsx +0 -370
  45. package/src/__tests__/snapshot-critical.test.tsx +0 -317
  46. package/src/__tests__/snapshot.test.tsx +0 -205
  47. package/src/__tests__/test-utils.tsx +0 -190
  48. package/src/__tests__/use-config-draft.test.tsx +0 -295
  49. package/src/__tests__/view-compliance.test.tsx +0 -153
  50. package/src/__tests__/wcag-audit.test.tsx +0 -493
  51. package/src/custom/action-param-dialog.tsx +0 -264
  52. package/src/custom/button-group.tsx +0 -91
  53. package/src/custom/combobox.tsx +0 -104
  54. package/src/custom/config-field-renderer.tsx +0 -276
  55. package/src/custom/config-panel-renderer.tsx +0 -306
  56. package/src/custom/config-row.tsx +0 -50
  57. package/src/custom/date-picker.tsx +0 -61
  58. package/src/custom/empty.tsx +0 -112
  59. package/src/custom/field.tsx +0 -81
  60. package/src/custom/filter-builder.tsx +0 -418
  61. package/src/custom/index.ts +0 -21
  62. package/src/custom/input-group.tsx +0 -53
  63. package/src/custom/item.tsx +0 -201
  64. package/src/custom/kbd.tsx +0 -36
  65. package/src/custom/mobile-dialog-content.tsx +0 -67
  66. package/src/custom/native-select.tsx +0 -33
  67. package/src/custom/navigation-overlay.tsx +0 -334
  68. package/src/custom/section-header.tsx +0 -68
  69. package/src/custom/sort-builder.tsx +0 -129
  70. package/src/custom/spinner.tsx +0 -26
  71. package/src/custom/view-skeleton.tsx +0 -243
  72. package/src/custom/view-states.tsx +0 -153
  73. package/src/debug/DebugPanel.tsx +0 -313
  74. package/src/debug/__tests__/DebugPanel.test.tsx +0 -134
  75. package/src/debug/index.ts +0 -10
  76. package/src/hooks/use-config-draft.ts +0 -127
  77. package/src/hooks/use-mobile.tsx +0 -27
  78. package/src/index.css +0 -245
  79. package/src/index.ts +0 -47
  80. package/src/lib/use-sync-external-store-shim.ts +0 -10
  81. package/src/lib/use-sync-external-store-with-selector-shim.ts +0 -90
  82. package/src/lib/utils.tsx +0 -35
  83. package/src/new-components.test.ts +0 -73
  84. package/src/renderers/action/action-bar.tsx +0 -221
  85. package/src/renderers/action/action-button.tsx +0 -158
  86. package/src/renderers/action/action-group.tsx +0 -270
  87. package/src/renderers/action/action-icon.tsx +0 -150
  88. package/src/renderers/action/action-menu.tsx +0 -203
  89. package/src/renderers/action/index.ts +0 -19
  90. package/src/renderers/action/resolve-icon.ts +0 -35
  91. package/src/renderers/basic/button-group.tsx +0 -79
  92. package/src/renderers/basic/div.tsx +0 -60
  93. package/src/renderers/basic/html.tsx +0 -43
  94. package/src/renderers/basic/icon.tsx +0 -89
  95. package/src/renderers/basic/image.tsx +0 -49
  96. package/src/renderers/basic/index.ts +0 -18
  97. package/src/renderers/basic/navigation-menu.tsx +0 -81
  98. package/src/renderers/basic/pagination.tsx +0 -109
  99. package/src/renderers/basic/separator.tsx +0 -57
  100. package/src/renderers/basic/span.tsx +0 -63
  101. package/src/renderers/basic/text.tsx +0 -52
  102. package/src/renderers/complex/README-KANBAN.md +0 -208
  103. package/src/renderers/complex/TIMELINE.md +0 -353
  104. package/src/renderers/complex/__tests__/data-table-airtable-ux.test.tsx +0 -239
  105. package/src/renderers/complex/__tests__/data-table-batch-editing.test.tsx +0 -275
  106. package/src/renderers/complex/__tests__/data-table-cell-renderer.test.tsx +0 -120
  107. package/src/renderers/complex/__tests__/data-table-editing.test.tsx +0 -221
  108. package/src/renderers/complex/__tests__/data-table.test.ts +0 -76
  109. package/src/renderers/complex/carousel.tsx +0 -69
  110. package/src/renderers/complex/data-table.tsx +0 -1243
  111. package/src/renderers/complex/filter-builder.tsx +0 -77
  112. package/src/renderers/complex/index.ts +0 -16
  113. package/src/renderers/complex/resizable.tsx +0 -66
  114. package/src/renderers/complex/scroll-area.tsx +0 -58
  115. package/src/renderers/complex/table.tsx +0 -95
  116. package/src/renderers/data-display/alert.tsx +0 -46
  117. package/src/renderers/data-display/avatar.tsx +0 -38
  118. package/src/renderers/data-display/badge.tsx +0 -55
  119. package/src/renderers/data-display/breadcrumb.tsx +0 -61
  120. package/src/renderers/data-display/index.ts +0 -18
  121. package/src/renderers/data-display/kbd.tsx +0 -50
  122. package/src/renderers/data-display/list.tsx +0 -75
  123. package/src/renderers/data-display/statistic.tsx +0 -95
  124. package/src/renderers/data-display/table.tsx +0 -78
  125. package/src/renderers/data-display/tree-view.tsx +0 -176
  126. package/src/renderers/disclosure/accordion.tsx +0 -69
  127. package/src/renderers/disclosure/collapsible.tsx +0 -53
  128. package/src/renderers/disclosure/index.ts +0 -11
  129. package/src/renderers/disclosure/toggle-group.tsx +0 -79
  130. package/src/renderers/feedback/empty.tsx +0 -49
  131. package/src/renderers/feedback/index.ts +0 -16
  132. package/src/renderers/feedback/loading.tsx +0 -78
  133. package/src/renderers/feedback/progress.tsx +0 -29
  134. package/src/renderers/feedback/skeleton.tsx +0 -31
  135. package/src/renderers/feedback/sonner.tsx +0 -56
  136. package/src/renderers/feedback/spinner.tsx +0 -55
  137. package/src/renderers/feedback/toast.tsx +0 -59
  138. package/src/renderers/feedback/toaster.tsx +0 -23
  139. package/src/renderers/form/button.tsx +0 -103
  140. package/src/renderers/form/calendar.tsx +0 -34
  141. package/src/renderers/form/checkbox.tsx +0 -71
  142. package/src/renderers/form/combobox.tsx +0 -48
  143. package/src/renderers/form/command.tsx +0 -58
  144. package/src/renderers/form/date-picker.tsx +0 -84
  145. package/src/renderers/form/file-upload.tsx +0 -184
  146. package/src/renderers/form/form.tsx +0 -540
  147. package/src/renderers/form/index.ts +0 -26
  148. package/src/renderers/form/input-otp.tsx +0 -51
  149. package/src/renderers/form/input.tsx +0 -121
  150. package/src/renderers/form/label.tsx +0 -45
  151. package/src/renderers/form/radio-group.tsx +0 -63
  152. package/src/renderers/form/select.tsx +0 -94
  153. package/src/renderers/form/slider.tsx +0 -61
  154. package/src/renderers/form/switch.tsx +0 -48
  155. package/src/renderers/form/textarea.tsx +0 -76
  156. package/src/renderers/form/toggle.tsx +0 -42
  157. package/src/renderers/index.ts +0 -18
  158. package/src/renderers/layout/aspect-ratio.tsx +0 -51
  159. package/src/renderers/layout/card.tsx +0 -85
  160. package/src/renderers/layout/container.tsx +0 -122
  161. package/src/renderers/layout/flex.tsx +0 -132
  162. package/src/renderers/layout/grid.tsx +0 -178
  163. package/src/renderers/layout/index.ts +0 -19
  164. package/src/renderers/layout/page.tsx +0 -466
  165. package/src/renderers/layout/semantic.tsx +0 -48
  166. package/src/renderers/layout/stack.tsx +0 -132
  167. package/src/renderers/layout/tabs.tsx +0 -97
  168. package/src/renderers/navigation/header-bar.tsx +0 -118
  169. package/src/renderers/navigation/index.ts +0 -10
  170. package/src/renderers/navigation/sidebar.tsx +0 -208
  171. package/src/renderers/overlay/alert-dialog.tsx +0 -72
  172. package/src/renderers/overlay/context-menu.tsx +0 -100
  173. package/src/renderers/overlay/dialog.tsx +0 -77
  174. package/src/renderers/overlay/drawer.tsx +0 -77
  175. package/src/renderers/overlay/dropdown-menu.tsx +0 -99
  176. package/src/renderers/overlay/hover-card.tsx +0 -55
  177. package/src/renderers/overlay/index.ts +0 -18
  178. package/src/renderers/overlay/menubar.tsx +0 -76
  179. package/src/renderers/overlay/popover.tsx +0 -56
  180. package/src/renderers/overlay/sheet.tsx +0 -77
  181. package/src/renderers/overlay/tooltip.tsx +0 -67
  182. package/src/renderers/placeholders.tsx +0 -107
  183. package/src/stories/CRMApp.stories.tsx +0 -706
  184. package/src/stories/ConfigPanel.stories.tsx +0 -232
  185. package/src/stories/Guide.mdx +0 -55
  186. package/src/stories/MockedData.stories.tsx +0 -121
  187. package/src/stories/assets/accessibility.png +0 -0
  188. package/src/stories/assets/accessibility.svg +0 -1
  189. package/src/stories/assets/addon-library.png +0 -0
  190. package/src/stories/assets/assets.png +0 -0
  191. package/src/stories/assets/avif-test-image.avif +0 -0
  192. package/src/stories/assets/context.png +0 -0
  193. package/src/stories/assets/discord.svg +0 -1
  194. package/src/stories/assets/docs.png +0 -0
  195. package/src/stories/assets/figma-plugin.png +0 -0
  196. package/src/stories/assets/github.svg +0 -1
  197. package/src/stories/assets/share.png +0 -0
  198. package/src/stories/assets/styling.png +0 -0
  199. package/src/stories/assets/testing.png +0 -0
  200. package/src/stories/assets/theming.png +0 -0
  201. package/src/stories/assets/tutorials.svg +0 -1
  202. package/src/stories/assets/youtube.svg +0 -1
  203. package/src/stories/button.css +0 -30
  204. package/src/stories/header.css +0 -32
  205. package/src/stories/page.css +0 -68
  206. package/src/stories-json/Accessibility.mdx +0 -297
  207. package/src/stories-json/EdgeCases.stories.tsx +0 -160
  208. package/src/stories-json/GettingStarted.mdx +0 -89
  209. package/src/stories-json/Introduction.mdx +0 -127
  210. package/src/stories-json/accordion.stories.tsx +0 -43
  211. package/src/stories-json/aggrid.stories.tsx +0 -103
  212. package/src/stories-json/alert.stories.tsx +0 -39
  213. package/src/stories-json/aspect-ratio.stories.tsx +0 -34
  214. package/src/stories-json/avatar.stories.tsx +0 -38
  215. package/src/stories-json/badge.stories.tsx +0 -53
  216. package/src/stories-json/breadcrumb.stories.tsx +0 -30
  217. package/src/stories-json/button-group.stories.tsx +0 -43
  218. package/src/stories-json/button.stories.tsx +0 -73
  219. package/src/stories-json/calendar.stories.tsx +0 -85
  220. package/src/stories-json/card.stories.tsx +0 -48
  221. package/src/stories-json/carousel.stories.tsx +0 -33
  222. package/src/stories-json/charts.stories.tsx +0 -195
  223. package/src/stories-json/chatbot.stories.tsx +0 -349
  224. package/src/stories-json/code-editor.stories.tsx +0 -92
  225. package/src/stories-json/collapsible.stories.tsx +0 -40
  226. package/src/stories-json/controls.stories.tsx +0 -36
  227. package/src/stories-json/crm-live-data.stories.tsx +0 -154
  228. package/src/stories-json/dashboard.stories.tsx +0 -318
  229. package/src/stories-json/data-table.stories.tsx +0 -136
  230. package/src/stories-json/data_display_extras.stories.tsx +0 -102
  231. package/src/stories-json/date-picker.stories.tsx +0 -28
  232. package/src/stories-json/detail-view.stories.tsx +0 -258
  233. package/src/stories-json/dialog.stories.tsx +0 -43
  234. package/src/stories-json/feedback_extras.stories.tsx +0 -40
  235. package/src/stories-json/feedback_others.stories.tsx +0 -46
  236. package/src/stories-json/form-variants.stories.tsx +0 -210
  237. package/src/stories-json/form_advanced.stories.tsx +0 -117
  238. package/src/stories-json/form_extras.stories.tsx +0 -123
  239. package/src/stories-json/grid.stories.tsx +0 -56
  240. package/src/stories-json/icon.stories.tsx +0 -36
  241. package/src/stories-json/input.stories.tsx +0 -52
  242. package/src/stories-json/kanban.stories.tsx +0 -295
  243. package/src/stories-json/layout_extended.stories.tsx +0 -76
  244. package/src/stories-json/layout_flex.stories.tsx +0 -107
  245. package/src/stories-json/list-view.stories.tsx +0 -97
  246. package/src/stories-json/markdown.stories.tsx +0 -129
  247. package/src/stories-json/menus.stories.tsx +0 -63
  248. package/src/stories-json/metric-card.stories.tsx +0 -143
  249. package/src/stories-json/navigation-menu.stories.tsx +0 -37
  250. package/src/stories-json/object-aggrid-advanced.stories.tsx +0 -389
  251. package/src/stories-json/object-aggrid.stories.tsx +0 -252
  252. package/src/stories-json/object-form.stories.tsx +0 -130
  253. package/src/stories-json/object-gantt.stories.tsx +0 -114
  254. package/src/stories-json/object-grid.stories.tsx +0 -315
  255. package/src/stories-json/object-map.stories.tsx +0 -116
  256. package/src/stories-json/object-view.stories.tsx +0 -118
  257. package/src/stories-json/overlay_extras.stories.tsx +0 -113
  258. package/src/stories-json/overlay_others.stories.tsx +0 -76
  259. package/src/stories-json/page.stories.tsx +0 -55
  260. package/src/stories-json/reports.stories.tsx +0 -163
  261. package/src/stories-json/resizable.stories.tsx +0 -44
  262. package/src/stories-json/select.stories.tsx +0 -34
  263. package/src/stories-json/separator.stories.tsx +0 -41
  264. package/src/stories-json/sidebar.stories.tsx +0 -147
  265. package/src/stories-json/statistic.stories.tsx +0 -44
  266. package/src/stories-json/tabs.stories.tsx +0 -51
  267. package/src/stories-json/timeline.stories.tsx +0 -188
  268. package/src/stories-json/typography.stories.tsx +0 -45
  269. package/src/types/config-panel.ts +0 -101
  270. package/src/ui/accordion.tsx +0 -66
  271. package/src/ui/alert-dialog.tsx +0 -149
  272. package/src/ui/alert.tsx +0 -67
  273. package/src/ui/aspect-ratio.tsx +0 -15
  274. package/src/ui/avatar.tsx +0 -58
  275. package/src/ui/badge.tsx +0 -44
  276. package/src/ui/breadcrumb.tsx +0 -123
  277. package/src/ui/button.tsx +0 -64
  278. package/src/ui/calendar.tsx +0 -221
  279. package/src/ui/card.tsx +0 -87
  280. package/src/ui/carousel.tsx +0 -270
  281. package/src/ui/chart.tsx +0 -377
  282. package/src/ui/checkbox.tsx +0 -38
  283. package/src/ui/collapsible.tsx +0 -19
  284. package/src/ui/command.tsx +0 -161
  285. package/src/ui/context-menu.tsx +0 -208
  286. package/src/ui/dialog.tsx +0 -130
  287. package/src/ui/drawer.tsx +0 -126
  288. package/src/ui/dropdown-menu.tsx +0 -208
  289. package/src/ui/form.tsx +0 -186
  290. package/src/ui/hover-card.tsx +0 -37
  291. package/src/ui/index.ts +0 -56
  292. package/src/ui/input-otp.tsx +0 -79
  293. package/src/ui/input.tsx +0 -30
  294. package/src/ui/label.tsx +0 -34
  295. package/src/ui/menubar.tsx +0 -264
  296. package/src/ui/navigation-menu.tsx +0 -136
  297. package/src/ui/pagination.tsx +0 -125
  298. package/src/ui/popover.tsx +0 -39
  299. package/src/ui/progress.tsx +0 -36
  300. package/src/ui/radio-group.tsx +0 -52
  301. package/src/ui/resizable.tsx +0 -53
  302. package/src/ui/scroll-area.tsx +0 -56
  303. package/src/ui/select.tsx +0 -168
  304. package/src/ui/separator.tsx +0 -39
  305. package/src/ui/sheet.tsx +0 -150
  306. package/src/ui/sidebar.tsx +0 -781
  307. package/src/ui/skeleton.tsx +0 -23
  308. package/src/ui/slider.tsx +0 -39
  309. package/src/ui/sonner.tsx +0 -53
  310. package/src/ui/switch.tsx +0 -37
  311. package/src/ui/table.tsx +0 -125
  312. package/src/ui/tabs.tsx +0 -63
  313. package/src/ui/textarea.tsx +0 -30
  314. package/src/ui/toast.tsx +0 -137
  315. package/src/ui/toggle-group.tsx +0 -69
  316. package/src/ui/toggle.tsx +0 -53
  317. package/src/ui/tooltip.tsx +0 -38
  318. package/src/ui/typography.tsx +0 -85
  319. package/tsconfig.json +0 -19
  320. package/vite.config.ts +0 -71
  321. package/vitest.config.ts +0 -5
package/TESTING.md DELETED
@@ -1,335 +0,0 @@
1
- # Component and Renderer Testing Guide
2
-
3
- ## Overview
4
-
5
- This document describes the comprehensive automated testing infrastructure for ObjectUI components and renderers. The tests are designed to automatically discover display, accessibility, and structural issues in UI components.
6
-
7
- ## Test Architecture
8
-
9
- ### Test Utilities (`test-utils.tsx`)
10
-
11
- A suite of helper functions that provide automated checks for common display issues:
12
-
13
- #### `renderComponent(schema, options)`
14
- Renders a component from its schema definition for testing.
15
-
16
- ```typescript
17
- const { container } = renderComponent({
18
- type: 'button',
19
- label: 'Click Me',
20
- });
21
- ```
22
-
23
- #### `checkAccessibility(element)`
24
- Validates accessibility attributes and identifies common a11y issues:
25
- - Missing ARIA labels on interactive elements
26
- - Missing form labels
27
- - Missing alt attributes on images
28
-
29
- Returns:
30
- ```typescript
31
- {
32
- hasRole: boolean;
33
- hasAriaLabel: boolean;
34
- hasAriaDescribedBy: boolean;
35
- issues: string[]; // List of detected issues
36
- }
37
- ```
38
-
39
- #### `checkDOMStructure(container)`
40
- Analyzes DOM structure for potential issues:
41
- - Empty components
42
- - Excessive nesting (>20 levels)
43
- - Missing content
44
-
45
- Returns:
46
- ```typescript
47
- {
48
- hasContent: boolean;
49
- isEmpty: boolean;
50
- hasChildren: boolean;
51
- nestedDepth: number;
52
- issues: string[]; // List of detected issues
53
- }
54
- ```
55
-
56
- #### `checkStyling(element)`
57
- Validates component styling:
58
- - Class presence
59
- - Tailwind CSS usage
60
- - Inline styles
61
-
62
- Returns:
63
- ```typescript
64
- {
65
- hasClasses: boolean;
66
- hasTailwindClasses: boolean;
67
- hasInlineStyles: boolean;
68
- classes: string[];
69
- }
70
- ```
71
-
72
- #### `validateComponentRegistration(componentType)`
73
- Verifies component registration in ComponentRegistry:
74
- - Component is registered
75
- - Has configuration
76
- - Has renderer function
77
- - Has label and inputs
78
- - Has default props
79
-
80
- Returns:
81
- ```typescript
82
- {
83
- isRegistered: boolean;
84
- hasConfig: boolean;
85
- hasRenderer: boolean;
86
- hasLabel: boolean;
87
- hasInputs: boolean;
88
- hasDefaultProps: boolean;
89
- config: any;
90
- }
91
- ```
92
-
93
- #### `getAllDisplayIssues(container)`
94
- Comprehensive check that runs all validation checks and returns aggregated issues:
95
-
96
- ```typescript
97
- const issues = getAllDisplayIssues(container);
98
- // Returns array of issue descriptions
99
- ```
100
-
101
- ## Test Coverage
102
-
103
- ### Component Categories
104
-
105
- The test suite covers all major component categories:
106
-
107
- 1. **Basic Components** (`basic-renderers.test.tsx`)
108
- - Text, Div, Span, Image, Icon, Separator, HTML
109
-
110
- 2. **Form Components** (`form-renderers.test.tsx`)
111
- - Button, Input, Textarea, Select, Checkbox, Switch
112
- - Radio Group, Slider, Label, Email, Password
113
-
114
- 3. **Layout Components** (`layout-data-renderers.test.tsx`)
115
- - Container, Grid, Flex
116
-
117
- 4. **Data Display Components** (`layout-data-renderers.test.tsx`)
118
- - List, Tree View, Badge, Avatar, Alert
119
- - Breadcrumb, Statistic, Kbd
120
-
121
- 5. **Feedback Components** (`feedback-overlay-renderers.test.tsx`)
122
- - Loading, Spinner, Progress, Skeleton, Empty, Toast
123
-
124
- 6. **Overlay Components** (`feedback-overlay-renderers.test.tsx`)
125
- - Dialog, Alert Dialog, Sheet, Drawer
126
- - Popover, Tooltip, Dropdown Menu, Context Menu
127
- - Hover Card, Menubar
128
-
129
- 7. **Disclosure Components** (`complex-disclosure-renderers.test.tsx`)
130
- - Accordion, Collapsible, Toggle Group
131
-
132
- 8. **Complex Components** (`complex-disclosure-renderers.test.tsx`)
133
- - Timeline, Data Table, Chatbot, Carousel
134
- - Scroll Area, Resizable, Filter Builder, Calendar View, Table
135
-
136
- ## What the Tests Check
137
-
138
- ### 1. Component Registration
139
- Every component should be properly registered:
140
- ```typescript
141
- it('should be properly registered', () => {
142
- const validation = validateComponentRegistration('button');
143
- expect(validation.isRegistered).toBe(true);
144
- expect(validation.hasConfig).toBe(true);
145
- expect(validation.hasLabel).toBe(true);
146
- });
147
- ```
148
-
149
- ### 2. Rendering Without Errors
150
- Components should render without throwing errors:
151
- ```typescript
152
- it('should render without issues', () => {
153
- const { container } = renderComponent({
154
- type: 'button',
155
- label: 'Test',
156
- });
157
- expect(container).toBeDefined();
158
- });
159
- ```
160
-
161
- ### 3. Accessibility
162
- Components should be accessible:
163
- ```typescript
164
- it('should have proper accessibility', () => {
165
- const { container } = renderComponent({
166
- type: 'button',
167
- label: 'Click Me',
168
- });
169
-
170
- const issues = getAllDisplayIssues(container);
171
- const a11yIssues = issues.filter(i => i.includes('accessible'));
172
- expect(a11yIssues).toHaveLength(0);
173
- });
174
- ```
175
-
176
- ### 4. DOM Structure
177
- Components should have valid DOM structure:
178
- ```typescript
179
- it('should have valid structure', () => {
180
- const { container } = renderComponent({
181
- type: 'container',
182
- body: [{ type: 'text', content: 'Content' }],
183
- });
184
-
185
- const domCheck = checkDOMStructure(container);
186
- expect(domCheck.hasContent).toBe(true);
187
- expect(domCheck.isEmpty).toBe(false);
188
- expect(domCheck.nestedDepth).toBeLessThan(20);
189
- });
190
- ```
191
-
192
- ### 5. Props and Variants
193
- Components should support their documented props:
194
- ```typescript
195
- it('should support variants', () => {
196
- const variants = ['default', 'secondary', 'destructive'];
197
-
198
- variants.forEach(variant => {
199
- const { container } = renderComponent({
200
- type: 'button',
201
- label: 'Test',
202
- variant,
203
- });
204
- expect(container).toBeDefined();
205
- });
206
- });
207
- ```
208
-
209
- ## Running Tests
210
-
211
- ### Run All Tests
212
- ```bash
213
- pnpm test
214
- ```
215
-
216
- ### Run Component Tests Only
217
- ```bash
218
- pnpm vitest run packages/components/src/__tests__/
219
- ```
220
-
221
- ### Run Specific Test File
222
- ```bash
223
- pnpm vitest run packages/components/src/__tests__/form-renderers.test.tsx
224
- ```
225
-
226
- ### Watch Mode
227
- ```bash
228
- pnpm test:watch
229
- ```
230
-
231
- ### Coverage Report
232
- ```bash
233
- pnpm test:coverage
234
- ```
235
-
236
- ### Interactive UI
237
- ```bash
238
- pnpm test:ui
239
- ```
240
-
241
- ## Test Results
242
-
243
- Current test coverage:
244
- - **150 total tests** across all component categories
245
- - **140 passing** (93% pass rate)
246
- - **10 failing** - identifying real schema/prop mismatches that need fixing
247
-
248
- The failing tests are valuable as they automatically discovered:
249
- - Components with missing props
250
- - Schema mismatches (e.g., `content` vs `html`, `text` vs `content`)
251
- - Missing default values
252
- - Incorrect prop expectations
253
-
254
- ## Adding New Tests
255
-
256
- ### For New Components
257
-
258
- When adding a new component, create tests following this pattern:
259
-
260
- ```typescript
261
- describe('MyComponent Renderer', () => {
262
- it('should be properly registered', () => {
263
- const validation = validateComponentRegistration('my-component');
264
- expect(validation.isRegistered).toBe(true);
265
- expect(validation.hasConfig).toBe(true);
266
- });
267
-
268
- it('should render without issues', () => {
269
- const { container } = renderComponent({
270
- type: 'my-component',
271
- // ... required props
272
- });
273
-
274
- expect(container).toBeDefined();
275
- const issues = getAllDisplayIssues(container);
276
- expect(issues).toHaveLength(0);
277
- });
278
-
279
- it('should support required props', () => {
280
- const { container } = renderComponent({
281
- type: 'my-component',
282
- requiredProp: 'value',
283
- });
284
-
285
- expect(container.textContent).toContain('value');
286
- });
287
- });
288
- ```
289
-
290
- ### For Display Issue Detection
291
-
292
- Add specific checks for known issues:
293
-
294
- ```typescript
295
- it('should not have excessive nesting', () => {
296
- const { container } = renderComponent({
297
- type: 'complex-component',
298
- data: complexData,
299
- });
300
-
301
- const domCheck = checkDOMStructure(container);
302
- expect(domCheck.nestedDepth).toBeLessThan(20);
303
- });
304
-
305
- it('should have proper ARIA attributes', () => {
306
- const { container } = renderComponent({
307
- type: 'interactive-component',
308
- });
309
-
310
- const button = container.querySelector('button');
311
- const a11y = checkAccessibility(button);
312
- expect(a11y.issues).toHaveLength(0);
313
- });
314
- ```
315
-
316
- ## Benefits
317
-
318
- This testing infrastructure provides:
319
-
320
- 1. **Automated Issue Detection** - Tests automatically find display and accessibility issues
321
- 2. **Regression Prevention** - Catches breaking changes in component rendering
322
- 3. **Documentation** - Tests serve as examples of how components should be used
323
- 4. **Confidence** - High test coverage ensures components work as expected
324
- 5. **Quick Feedback** - Fast test execution helps during development
325
-
326
- ## Future Enhancements
327
-
328
- Potential improvements:
329
-
330
- 1. Visual regression testing with screenshot comparison
331
- 2. Performance benchmarking for complex components
332
- 3. Cross-browser testing
333
- 4. Responsive design testing
334
- 5. Theme variation testing
335
- 6. Integration tests with SchemaRenderer
@@ -1,268 +0,0 @@
1
- # Filter Builder Component
2
-
3
- An Airtable-like filter builder component for building complex query conditions in Object UI.
4
-
5
- ## Overview
6
-
7
- The Filter Builder component provides a user-friendly interface for creating and managing filter conditions. It supports:
8
-
9
- - ✅ Dynamic add/remove filter conditions
10
- - ✅ Field selection from configurable list
11
- - ✅ Type-aware operators (text, number, boolean, date, select)
12
- - ✅ AND/OR logic toggling
13
- - ✅ Clear all filters button
14
- - ✅ Date picker support for date fields
15
- - ✅ Dropdown support for select fields
16
- - ✅ Schema-driven configuration
17
- - ✅ Tailwind CSS styled with Shadcn UI components
18
-
19
- ## Usage
20
-
21
- ### Basic Example
22
-
23
- ```typescript
24
- {
25
- type: 'filter-builder',
26
- name: 'userFilters',
27
- label: 'User Filters',
28
- fields: [
29
- { value: 'name', label: 'Name', type: 'text' },
30
- { value: 'email', label: 'Email', type: 'text' },
31
- { value: 'age', label: 'Age', type: 'number' },
32
- { value: 'status', label: 'Status', type: 'text' }
33
- ],
34
- value: {
35
- id: 'root',
36
- logic: 'and',
37
- conditions: [
38
- {
39
- id: 'cond-1',
40
- field: 'status',
41
- operator: 'equals',
42
- value: 'active'
43
- }
44
- ]
45
- }
46
- }
47
- ```
48
-
49
- ### With Select Fields
50
-
51
- ```typescript
52
- {
53
- type: 'filter-builder',
54
- name: 'productFilters',
55
- label: 'Product Filters',
56
- fields: [
57
- { value: 'name', label: 'Product Name', type: 'text' },
58
- { value: 'price', label: 'Price', type: 'number' },
59
- {
60
- value: 'category',
61
- label: 'Category',
62
- type: 'select',
63
- options: [
64
- { value: 'electronics', label: 'Electronics' },
65
- { value: 'clothing', label: 'Clothing' },
66
- { value: 'food', label: 'Food' }
67
- ]
68
- },
69
- { value: 'inStock', label: 'In Stock', type: 'boolean' }
70
- ],
71
- value: {
72
- id: 'root',
73
- logic: 'and',
74
- conditions: []
75
- }
76
- }
77
- ```
78
-
79
- ### With Date Fields
80
-
81
- ```typescript
82
- {
83
- type: 'filter-builder',
84
- name: 'orderFilters',
85
- label: 'Order Filters',
86
- fields: [
87
- { value: 'orderId', label: 'Order ID', type: 'text' },
88
- { value: 'amount', label: 'Amount', type: 'number' },
89
- { value: 'orderDate', label: 'Order Date', type: 'date' },
90
- { value: 'shipped', label: 'Shipped', type: 'boolean' }
91
- ],
92
- showClearAll: true
93
- }
94
- ```
95
-
96
- ## Props
97
-
98
- ### Schema Properties
99
-
100
- | Property | Type | Required | Description |
101
- |----------|------|----------|-------------|
102
- | `type` | `string` | ✅ | Must be `'filter-builder'` |
103
- | `name` | `string` | ✅ | Form field name for the filter value |
104
- | `label` | `string` | ❌ | Label displayed above the filter builder |
105
- | `fields` | `Field[]` | ✅ | Array of available fields for filtering |
106
- | `value` | `FilterGroup` | ❌ | Initial filter configuration |
107
- | `showClearAll` | `boolean` | ❌ | Show "Clear all" button (default: true) |
108
-
109
- ### Field Type
110
-
111
- ```typescript
112
- interface Field {
113
- value: string; // Field identifier
114
- label: string; // Display label
115
- type?: string; // Field type: 'text' | 'number' | 'boolean' | 'date' | 'select'
116
- options?: Array<{ value: string; label: string }> // For select fields
117
- }
118
- ```
119
-
120
- ### FilterGroup Type
121
-
122
- ```typescript
123
- interface FilterGroup {
124
- id: string; // Group identifier
125
- logic: 'and' | 'or'; // Logic operator
126
- conditions: FilterCondition[]; // Array of conditions
127
- }
128
-
129
- interface FilterCondition {
130
- id: string; // Condition identifier
131
- field: string; // Field value
132
- operator: string; // Operator (see below)
133
- value: string | number | boolean; // Filter value
134
- }
135
- ```
136
-
137
- ## Operators
138
-
139
- The available operators change based on the field type:
140
-
141
- ### Text Fields
142
- - `equals` - Equals
143
- - `notEquals` - Does not equal
144
- - `contains` - Contains
145
- - `notContains` - Does not contain
146
- - `isEmpty` - Is empty
147
- - `isNotEmpty` - Is not empty
148
-
149
- ### Number Fields
150
- - `equals` - Equals
151
- - `notEquals` - Does not equal
152
- - `greaterThan` - Greater than
153
- - `lessThan` - Less than
154
- - `greaterOrEqual` - Greater than or equal
155
- - `lessOrEqual` - Less than or equal
156
- - `isEmpty` - Is empty
157
- - `isNotEmpty` - Is not empty
158
-
159
- ### Boolean Fields
160
- - `equals` - Equals
161
- - `notEquals` - Does not equal
162
-
163
- ### Date Fields
164
- - `equals` - Equals
165
- - `notEquals` - Does not equal
166
- - `before` - Before
167
- - `after` - After
168
- - `between` - Between
169
- - `isEmpty` - Is empty
170
- - `isNotEmpty` - Is not empty
171
-
172
- ### Select Fields
173
- - `equals` - Equals
174
- - `notEquals` - Does not equal
175
- - `in` - In
176
- - `notIn` - Not in
177
- - `isEmpty` - Is empty
178
- - `isNotEmpty` - Is not empty
179
-
180
- ## Events
181
-
182
- The component emits change events when the filter configuration is modified:
183
-
184
- ```typescript
185
- {
186
- target: {
187
- name: 'filters',
188
- value: {
189
- id: 'root',
190
- logic: 'and',
191
- conditions: [...]
192
- }
193
- }
194
- }
195
- ```
196
-
197
- ## Demo
198
-
199
- To see the filter builder in action:
200
-
201
- ```bash
202
- pnpm --filter prototype dev
203
- # Visit http://localhost:5173/?demo=filter-builder
204
- ```
205
-
206
- ## Styling
207
-
208
- The component is fully styled with Tailwind CSS and follows the Object UI design system. All Shadcn UI components are used for consistent look and feel.
209
-
210
- You can customize the appearance using the `className` prop or by overriding Tailwind classes.
211
-
212
- ## Integration
213
-
214
- The Filter Builder integrates seamlessly with Object UI's schema system and can be used in:
215
-
216
- - Forms
217
- - Data tables
218
- - Search interfaces
219
- - Admin panels
220
- - Dashboard filters
221
-
222
- ## Example in Context
223
-
224
- ```typescript
225
- const pageSchema = {
226
- type: 'page',
227
- title: 'User Management',
228
- body: [
229
- {
230
- type: 'card',
231
- body: [
232
- {
233
- type: 'filter-builder',
234
- name: 'userFilters',
235
- label: 'Filter Users',
236
- fields: [
237
- { value: 'name', label: 'Name', type: 'text' },
238
- { value: 'email', label: 'Email', type: 'text' },
239
- { value: 'age', label: 'Age', type: 'number' },
240
- { value: 'department', label: 'Department', type: 'text' },
241
- { value: 'active', label: 'Active', type: 'boolean' }
242
- ]
243
- }
244
- ]
245
- },
246
- {
247
- type: 'table',
248
- // table configuration...
249
- }
250
- ]
251
- };
252
- ```
253
-
254
- ## Technical Details
255
-
256
- - Built with React 18+ hooks
257
- - Uses Radix UI primitives (Select, Popover)
258
- - Type-safe with TypeScript
259
- - Accessible keyboard navigation
260
- - Responsive design
261
-
262
- ## Browser Support
263
-
264
- Works in all modern browsers that support:
265
- - ES6+
266
- - CSS Grid
267
- - Flexbox
268
- - crypto.randomUUID()
@@ -1,30 +0,0 @@
1
- name: Chart
2
- label: Chart
3
- description: Data visualization component based on Recharts/ECharts
4
- category: visualization
5
- version: 1.0.0
6
- framework: react
7
-
8
- props:
9
- - name: type
10
- type: string
11
- enum: [bar, line, pie, area, radar]
12
- required: true
13
- - name: data
14
- type: array
15
- required: true
16
- - name: series
17
- type: array
18
- description: Configuration for data series
19
- - name: xAxis
20
- type: object
21
- - name: yAxis
22
- type: object
23
-
24
- events:
25
- - name: onClick
26
- payload: "{ dataIndex: number, value: any }"
27
-
28
- features:
29
- responsive: true
30
- dark_mode: true
@@ -1,39 +0,0 @@
1
- name: FilterBuilder
2
- label: Filter Builder
3
- description: Airtable-like filter builder for creating complex query conditions
4
- category: complex
5
- version: 1.0.0
6
- framework: react
7
-
8
- props:
9
- - name: label
10
- type: string
11
- description: Label text displayed above the filter builder
12
- - name: name
13
- type: string
14
- required: true
15
- description: Form field name for the filter value
16
- - name: fields
17
- type: array
18
- required: true
19
- description: Available fields for filtering
20
- schema:
21
- - value: string
22
- - label: string
23
- - type: string
24
- - name: value
25
- type: object
26
- description: Current filter configuration
27
- schema:
28
- - id: string
29
- - logic: enum[and, or]
30
- - conditions: array
31
-
32
- events:
33
- - name: onChange
34
- payload: "{ name: string, value: FilterGroup }"
35
-
36
- features:
37
- dynamic_conditions: true
38
- multiple_operators: true
39
- field_type_aware: true
@@ -1,27 +0,0 @@
1
- name: GridLayout
2
- label: Grid Layout
3
- description: 12-column grid layout system
4
- category: layout
5
- version: 1.0.0
6
- framework: react
7
-
8
- props:
9
- - name: columns
10
- type: number
11
- default: 12
12
- - name: gap
13
- type: string
14
- default: md
15
- - name: items
16
- type: array
17
- description: list of widgets to render in the grid
18
- schema:
19
- - x: number
20
- - y: number
21
- - w: number
22
- - h: number
23
- - component: object # SchemaNode
24
-
25
- features:
26
- responsive: true
27
- drag_and_drop: true