@react-ui-org/react-ui 0.64.1 → 0.66.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 (311) hide show
  1. package/README.md +3 -6
  2. package/dist/react-ui.css +16 -16
  3. package/dist/react-ui.d.ts +1936 -0
  4. package/dist/react-ui.development.css +3591 -3003
  5. package/dist/react-ui.development.js +2028 -1060
  6. package/dist/react-ui.js +1 -1
  7. package/package.json +74 -70
  8. package/src/components/Alert/{Alert.jsx → Alert.tsx} +8 -43
  9. package/src/components/Alert/Alert.types.ts +34 -0
  10. package/src/components/Alert/README.md +1 -1
  11. package/src/components/Alert/index.ts +2 -0
  12. package/src/components/Badge/Badge.tsx +30 -0
  13. package/src/components/Badge/Badge.types.ts +24 -0
  14. package/src/components/Badge/README.md +1 -1
  15. package/src/components/Badge/index.ts +5 -0
  16. package/src/components/Button/Button.tsx +110 -0
  17. package/src/components/Button/Button.types.ts +93 -0
  18. package/src/components/Button/README.md +1 -1
  19. package/src/components/Button/helpers/{getRootLabelVisibilityClassName.js → getRootLabelVisibilityClassName.ts} +5 -2
  20. package/src/components/Button/index.ts +6 -0
  21. package/src/components/ButtonGroup/{ButtonGroup.jsx → ButtonGroup.tsx} +9 -40
  22. package/src/components/ButtonGroup/ButtonGroup.types.ts +45 -0
  23. package/src/components/ButtonGroup/ButtonGroupContext.ts +4 -0
  24. package/src/components/ButtonGroup/README.md +1 -1
  25. package/src/components/ButtonGroup/{index.js → index.ts} +4 -0
  26. package/src/components/Card/Card.tsx +33 -0
  27. package/src/components/Card/Card.types.ts +46 -0
  28. package/src/components/Card/{CardBody.jsx → CardBody.tsx} +4 -11
  29. package/src/components/Card/{CardFooter.jsx → CardFooter.tsx} +4 -15
  30. package/src/components/Card/README.md +6 -7
  31. package/src/components/Card/{index.js → index.ts} +5 -0
  32. package/src/components/CheckboxField/CheckboxField.module.scss +7 -3
  33. package/src/components/CheckboxField/CheckboxField.tsx +81 -0
  34. package/src/components/CheckboxField/CheckboxField.types.ts +64 -0
  35. package/src/components/CheckboxField/README.md +92 -45
  36. package/src/components/CheckboxField/index.ts +5 -0
  37. package/src/components/FileInputField/FileInputField.module.scss +7 -3
  38. package/src/components/FileInputField/{FileInputField.jsx → FileInputField.tsx} +43 -129
  39. package/src/components/FileInputField/FileInputField.types.ts +101 -0
  40. package/src/components/FileInputField/README.md +21 -4
  41. package/src/components/FileInputField/index.ts +6 -0
  42. package/src/components/FormLayout/FormLayout.module.scss +5 -7
  43. package/src/components/FormLayout/{FormLayout.jsx → FormLayout.tsx} +15 -50
  44. package/src/components/FormLayout/FormLayout.types.ts +55 -0
  45. package/src/components/FormLayout/FormLayoutContext.ts +4 -0
  46. package/src/components/FormLayout/FormLayoutCustomField.module.scss +7 -3
  47. package/src/components/FormLayout/{FormLayoutCustomField.jsx → FormLayoutCustomField.tsx} +12 -67
  48. package/src/components/FormLayout/FormLayoutCustomField.types.ts +60 -0
  49. package/src/components/FormLayout/FormLayoutCustomFieldContext.ts +4 -0
  50. package/src/components/FormLayout/README.md +6 -15
  51. package/src/components/FormLayout/index.ts +14 -0
  52. package/src/components/Grid/Grid.module.scss +1 -1
  53. package/src/components/Grid/Grid.tsx +50 -0
  54. package/src/components/Grid/Grid.types.ts +108 -0
  55. package/src/components/Grid/GridSpan.tsx +36 -0
  56. package/src/components/Grid/README.md +2 -2
  57. package/src/components/Grid/_helpers/generateResponsiveCustomProperties.ts +33 -0
  58. package/src/components/Grid/index.ts +9 -0
  59. package/src/components/InputGroup/InputGroup.module.scss +7 -3
  60. package/src/components/InputGroup/{InputGroup.jsx → InputGroup.tsx} +25 -95
  61. package/src/components/InputGroup/InputGroup.types.ts +80 -0
  62. package/src/components/InputGroup/InputGroupContext.ts +4 -0
  63. package/src/components/InputGroup/README.md +40 -8
  64. package/src/components/InputGroup/{index.js → index.ts} +4 -0
  65. package/src/components/Modal/Modal.tsx +172 -0
  66. package/src/components/Modal/Modal.types.ts +181 -0
  67. package/src/components/Modal/ModalBody.tsx +34 -0
  68. package/src/components/Modal/{ModalCloseButton.jsx → ModalCloseButton.tsx} +6 -19
  69. package/src/components/Modal/{ModalContent.jsx → ModalContent.tsx} +4 -15
  70. package/src/components/Modal/ModalFooter.tsx +27 -0
  71. package/src/components/Modal/ModalHeader.tsx +27 -0
  72. package/src/components/Modal/ModalTitle.tsx +29 -0
  73. package/src/components/Modal/README.md +9 -9
  74. package/src/components/Modal/_helpers/{dialogOnCancelHandler.js → dialogOnCancelHandler.ts} +11 -1
  75. package/src/components/Modal/_helpers/{dialogOnClickHandler.js → dialogOnClickHandler.ts} +13 -7
  76. package/src/components/Modal/_helpers/{dialogOnCloseHandler.js → dialogOnCloseHandler.ts} +11 -1
  77. package/src/components/Modal/_helpers/{dialogOnKeyDownHandler.js → dialogOnKeyDownHandler.ts} +19 -6
  78. package/src/components/Modal/_helpers/{getJustifyClassName.js → getJustifyClassName.ts} +4 -1
  79. package/src/components/Modal/_helpers/getPositionClassName.ts +10 -0
  80. package/src/components/Modal/_helpers/getScrollingClassName.ts +14 -0
  81. package/src/components/Modal/_helpers/{getSizeClassName.js → getSizeClassName.ts} +4 -1
  82. package/src/components/Modal/_hooks/{useModalFocus.js → useModalFocus.ts} +9 -5
  83. package/src/components/Modal/_hooks/{useModalScrollPrevention.js → useModalScrollPrevention.ts} +4 -1
  84. package/src/components/Modal/{index.js → index.ts} +14 -0
  85. package/src/components/Paper/{Paper.jsx → Paper.tsx} +6 -26
  86. package/src/components/Paper/Paper.types.ts +19 -0
  87. package/src/components/Paper/README.md +3 -4
  88. package/src/components/Paper/index.ts +2 -0
  89. package/src/components/Popover/Popover.module.scss +1 -1
  90. package/src/components/Popover/Popover.tsx +61 -0
  91. package/src/components/Popover/Popover.types.ts +75 -0
  92. package/src/components/Popover/PopoverWrapper.tsx +27 -0
  93. package/src/components/Popover/README.md +34 -22
  94. package/src/components/Popover/_helpers/{cleanPlacementStyle.js → cleanPlacementStyle.ts} +4 -1
  95. package/src/components/Popover/_helpers/{getRootAlignmentClassName.js → getRootAlignmentClassName.ts} +4 -1
  96. package/src/components/Popover/_helpers/{getRootSideClassName.js → getRootSideClassName.ts} +4 -1
  97. package/src/components/Popover/index.ts +8 -0
  98. package/src/components/Radio/README.md +125 -48
  99. package/src/components/Radio/Radio.module.scss +7 -3
  100. package/src/components/Radio/Radio.tsx +116 -0
  101. package/src/components/Radio/Radio.types.ts +91 -0
  102. package/src/components/Radio/index.ts +5 -0
  103. package/src/components/ScrollView/README.md +1 -1
  104. package/src/components/ScrollView/ScrollView.module.scss +5 -0
  105. package/src/components/ScrollView/{ScrollView.jsx → ScrollView.tsx} +55 -166
  106. package/src/components/ScrollView/ScrollView.types.ts +121 -0
  107. package/src/components/ScrollView/_helpers/getElementsPositionDifference.ts +17 -0
  108. package/src/components/ScrollView/_hooks/{useLoadResizeHook.js → useLoadResizeHook.ts} +14 -3
  109. package/src/components/ScrollView/_hooks/{useScrollPositionHook.js → useScrollPositionHook.ts} +11 -4
  110. package/src/components/ScrollView/index.ts +6 -0
  111. package/src/components/SelectField/README.md +137 -51
  112. package/src/components/SelectField/SelectField.module.scss +7 -3
  113. package/src/components/SelectField/SelectField.tsx +139 -0
  114. package/src/components/SelectField/SelectField.types.ts +121 -0
  115. package/src/components/SelectField/_components/Option/Option.tsx +19 -0
  116. package/src/components/SelectField/_components/Option/Option.types.ts +21 -0
  117. package/src/components/SelectField/_components/Option/index.ts +2 -0
  118. package/src/components/SelectField/index.ts +7 -0
  119. package/src/components/Table/README.md +1 -1
  120. package/src/components/Table/{Table.jsx → Table.tsx} +4 -43
  121. package/src/components/Table/Table.types.ts +51 -0
  122. package/src/components/Table/_components/TableBodyCell/TableBodyCell.tsx +20 -0
  123. package/src/components/Table/_components/TableBodyCell/TableBodyCell.types.ts +20 -0
  124. package/src/components/Table/_components/TableBodyCell/index.ts +2 -0
  125. package/src/components/Table/_components/TableHeaderCell/{TableHeaderCell.jsx → TableHeaderCell.tsx} +3 -34
  126. package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.types.ts +20 -0
  127. package/src/components/Table/_components/TableHeaderCell/index.ts +2 -0
  128. package/src/components/Table/index.ts +8 -0
  129. package/src/components/Tabs/README.md +2 -2
  130. package/src/components/Tabs/{Tabs.jsx → Tabs.tsx} +4 -20
  131. package/src/components/Tabs/Tabs.types.ts +19 -0
  132. package/src/components/Tabs/TabsItem.tsx +49 -0
  133. package/src/components/Tabs/TabsItem.types.ts +42 -0
  134. package/src/components/Tabs/index.ts +4 -0
  135. package/src/components/Text/README.md +1 -1
  136. package/src/components/Text/Text.module.scss +5 -7
  137. package/src/components/Text/Text.tsx +46 -0
  138. package/src/components/Text/Text.types.ts +31 -0
  139. package/src/components/Text/_helpers/getRootClampClassName.ts +13 -0
  140. package/src/components/Text/_helpers/getRootHyphensClassName.ts +14 -0
  141. package/src/components/Text/_helpers/getRootWordWrappingClassName.ts +14 -0
  142. package/src/components/Text/index.ts +6 -0
  143. package/src/components/TextArea/README.md +35 -14
  144. package/src/components/TextArea/TextArea.module.scss +7 -3
  145. package/src/components/TextArea/TextArea.tsx +95 -0
  146. package/src/components/TextArea/TextArea.types.ts +76 -0
  147. package/src/components/TextArea/index.ts +5 -0
  148. package/src/components/TextField/README.md +35 -13
  149. package/src/components/TextField/TextField.module.scss +7 -3
  150. package/src/components/TextField/TextField.tsx +112 -0
  151. package/src/components/TextField/TextField.types.ts +95 -0
  152. package/src/components/TextField/index.ts +6 -0
  153. package/src/components/TextLink/README.md +2 -2
  154. package/src/components/TextLink/{TextLink.jsx → TextLink.tsx} +4 -15
  155. package/src/components/TextLink/TextLink.types.ts +12 -0
  156. package/src/components/TextLink/index.ts +2 -0
  157. package/src/components/Toggle/README.md +92 -45
  158. package/src/components/Toggle/Toggle.module.scss +7 -3
  159. package/src/components/Toggle/Toggle.tsx +82 -0
  160. package/src/components/Toggle/Toggle.types.ts +59 -0
  161. package/src/components/Toggle/index.ts +5 -0
  162. package/src/components/Toolbar/README.md +3 -3
  163. package/src/components/Toolbar/Toolbar.tsx +41 -0
  164. package/src/components/Toolbar/Toolbar.types.ts +74 -0
  165. package/src/components/Toolbar/ToolbarGroup.tsx +38 -0
  166. package/src/components/Toolbar/{ToolbarItem.jsx → ToolbarItem.tsx} +5 -21
  167. package/src/components/Toolbar/_helpers/{getAlignClassName.js → getAlignClassName.ts} +8 -1
  168. package/src/components/Toolbar/_helpers/{getJustifyClassName.js → getJustifyClassName.ts} +4 -1
  169. package/src/components/Toolbar/{index.js → index.ts} +7 -0
  170. package/src/components/_helpers/{getRootColorClassName.js → getRootColorClassName.ts} +7 -2
  171. package/src/components/_helpers/{getRootPriorityClassName.js → getRootPriorityClassName.ts} +7 -2
  172. package/src/components/_helpers/{getRootSizeClassName.js → getRootSizeClassName.ts} +7 -2
  173. package/src/components/_helpers/getRootStateClassName.ts +24 -0
  174. package/src/components/_helpers/resolveContextOrProp.ts +13 -0
  175. package/src/helpers/classNames/{classNames.js → classNames.ts} +2 -2
  176. package/src/helpers/isChildrenEmpty/isChildrenEmpty.ts +5 -0
  177. package/src/helpers/transferProps/transferProps.ts +50 -0
  178. package/src/helpers/transferProps/transferProps.types.ts +11 -0
  179. package/src/index.ts +211 -0
  180. package/src/providers/globalProps/GlobalProps.types.ts +30 -0
  181. package/src/providers/globalProps/GlobalPropsContext.ts +6 -0
  182. package/src/providers/globalProps/{GlobalPropsProvider.jsx → GlobalPropsProvider.tsx} +8 -15
  183. package/src/providers/globalProps/{index.js → index.ts} +4 -0
  184. package/src/providers/globalProps/withGlobalProps.tsx +36 -0
  185. package/src/providers/translations/Translations.types.ts +26 -0
  186. package/src/providers/translations/TranslationsContext.ts +7 -0
  187. package/src/providers/translations/{TranslationsProvider.jsx → TranslationsProvider.tsx} +8 -15
  188. package/src/providers/translations/{index.js → index.ts} +5 -0
  189. package/src/styles/settings/_form-fields.scss +2 -1
  190. package/src/styles/theme/_form-fields.scss +16 -11
  191. package/src/styles/theme-constants/_colors.scss +21 -0
  192. package/src/styles/tools/_accessibility.scss +2 -2
  193. package/src/styles/tools/form-fields/_box-field-layout.scss +5 -8
  194. package/src/styles/tools/form-fields/_inline-field-elements.scss +0 -7
  195. package/src/styles/tools/form-fields/_inline-field-layout.scss +0 -8
  196. package/src/styles/tools/form-fields/_variants.scss +7 -7
  197. package/src/theme.scss +37 -12
  198. package/src/translations/{en.js → en.ts} +3 -1
  199. package/src/types/breakpoints.ts +1 -0
  200. package/src/types/colors.ts +7 -0
  201. package/src/types/index.ts +13 -0
  202. package/src/types/labelPositions.ts +1 -0
  203. package/src/types/layouts.ts +1 -0
  204. package/src/types/modules.d.ts +16 -0
  205. package/src/types/priorities.ts +1 -0
  206. package/src/types/sizes.ts +1 -0
  207. package/src/types/states.ts +1 -0
  208. package/src/types/styles.ts +4 -0
  209. package/src/utils/mergeDeep.ts +34 -0
  210. package/src/utils/mergeDeep.types.ts +4 -0
  211. package/.claude/agents/code-reviewer.md +0 -122
  212. package/.claude/rules/code.md +0 -22
  213. package/.claude/rules/docs.md +0 -35
  214. package/.claude/rules/frontend.md +0 -72
  215. package/.claude/rules/git.md +0 -13
  216. package/.claude/rules/safety-guards.md +0 -9
  217. package/.claude/rules/styling.md +0 -32
  218. package/.claude/rules/testing.md +0 -59
  219. package/.claude/settings.json +0 -32
  220. package/.claude/skills/commit/SKILL.md +0 -54
  221. package/.devcontainer/devcontainer.json +0 -23
  222. package/.eslintrc-ts +0 -40
  223. package/.mcp.json +0 -8
  224. package/.nvmrc +0 -1
  225. package/CLAUDE.md +0 -82
  226. package/docker-compose.base.yml +0 -93
  227. package/docker-compose.yml.dist +0 -41
  228. package/jest.config-ts.js +0 -34
  229. package/opencode.json +0 -10
  230. package/playwright-ct.config.ts +0 -68
  231. package/scripts/auto-start-mkdocs.sh +0 -5
  232. package/scripts/auto-start-node.sh +0 -33
  233. package/scripts/mcps/chrome-host/README.md +0 -118
  234. package/scripts/mcps/chrome-host/cdp_proxy.py +0 -90
  235. package/scripts/mcps/chrome-host/mcp-entry.sh +0 -33
  236. package/scripts/mcps/chrome-host/mcp-launch.sh +0 -36
  237. package/scripts/mcps/chrome-host/mcp-setup.sh +0 -70
  238. package/scripts/mcps/chrome-host/start-host-chrome.sh +0 -267
  239. package/setup.sh +0 -107
  240. package/src/CNAME +0 -1
  241. package/src/components/Alert/index.js +0 -1
  242. package/src/components/Badge/Badge.jsx +0 -51
  243. package/src/components/Badge/index.js +0 -1
  244. package/src/components/Button/Button.jsx +0 -203
  245. package/src/components/Button/helpers/getRootPriorityClassName.js +0 -15
  246. package/src/components/Button/index.js +0 -1
  247. package/src/components/ButtonGroup/ButtonGroupContext.js +0 -3
  248. package/src/components/Card/Card.jsx +0 -67
  249. package/src/components/CheckboxField/CheckboxField.jsx +0 -144
  250. package/src/components/CheckboxField/index.js +0 -1
  251. package/src/components/FileInputField/index.js +0 -1
  252. package/src/components/FormLayout/FormLayoutContext.js +0 -3
  253. package/src/components/FormLayout/FormLayoutCustomFieldContext.js +0 -3
  254. package/src/components/FormLayout/index.js +0 -4
  255. package/src/components/Grid/Grid.jsx +0 -225
  256. package/src/components/Grid/GridSpan.jsx +0 -88
  257. package/src/components/Grid/_helpers/generateResponsiveCustomProperties.js +0 -22
  258. package/src/components/Grid/index.js +0 -2
  259. package/src/components/InputGroup/InputGroupContext.js +0 -3
  260. package/src/components/Modal/Modal.jsx +0 -262
  261. package/src/components/Modal/ModalBody.jsx +0 -60
  262. package/src/components/Modal/ModalFooter.jsx +0 -42
  263. package/src/components/Modal/ModalHeader.jsx +0 -42
  264. package/src/components/Modal/ModalTitle.jsx +0 -42
  265. package/src/components/Modal/_helpers/getPositionClassName.js +0 -7
  266. package/src/components/Modal/_helpers/getScrollingClassName.js +0 -11
  267. package/src/components/Paper/index.js +0 -1
  268. package/src/components/Popover/Popover.jsx +0 -124
  269. package/src/components/Popover/PopoverWrapper.jsx +0 -38
  270. package/src/components/Popover/index.js +0 -2
  271. package/src/components/Radio/Radio.jsx +0 -212
  272. package/src/components/Radio/index.js +0 -1
  273. package/src/components/ScrollView/_helpers/getElementsPositionDifference.js +0 -11
  274. package/src/components/ScrollView/index.js +0 -1
  275. package/src/components/SelectField/SelectField.jsx +0 -272
  276. package/src/components/SelectField/_components/Option/Option.jsx +0 -46
  277. package/src/components/SelectField/_components/Option/index.js +0 -1
  278. package/src/components/SelectField/index.js +0 -1
  279. package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +0 -46
  280. package/src/components/Table/_components/TableBodyCell/index.js +0 -1
  281. package/src/components/Table/_components/TableHeaderCell/index.js +0 -1
  282. package/src/components/Table/index.js +0 -1
  283. package/src/components/Tabs/TabsItem.jsx +0 -91
  284. package/src/components/Tabs/index.js +0 -2
  285. package/src/components/Text/Text.jsx +0 -76
  286. package/src/components/Text/_helpers/getRootClampClassName.js +0 -11
  287. package/src/components/Text/_helpers/getRootHyphensClassName.js +0 -11
  288. package/src/components/Text/_helpers/getRootWordWrappingClassName.js +0 -11
  289. package/src/components/Text/index.js +0 -1
  290. package/src/components/TextArea/TextArea.jsx +0 -174
  291. package/src/components/TextArea/index.js +0 -1
  292. package/src/components/TextField/TextField.jsx +0 -208
  293. package/src/components/TextField/index.js +0 -1
  294. package/src/components/TextLink/index.js +0 -1
  295. package/src/components/Toggle/Toggle.jsx +0 -144
  296. package/src/components/Toggle/index.js +0 -1
  297. package/src/components/Toolbar/Toolbar.jsx +0 -76
  298. package/src/components/Toolbar/ToolbarGroup.jsx +0 -64
  299. package/src/components/_helpers/getRootValidationStateClassName.js +0 -15
  300. package/src/components/_helpers/resolveContextOrProp.js +0 -10
  301. package/src/helpers/isChildrenEmpty/isChildrenEmpty.js +0 -3
  302. package/src/helpers/transferProps/transferProps.js +0 -38
  303. package/src/index.js +0 -67
  304. package/src/providers/globalProps/GlobalPropsContext.jsx +0 -5
  305. package/src/providers/globalProps/withGlobalProps.jsx +0 -38
  306. package/src/providers/translations/TranslationsContext.jsx +0 -6
  307. package/src/utils/mergeDeep.js +0 -28
  308. package/tsconfig.json +0 -27
  309. /package/src/helpers/classNames/{index.js → index.ts} +0 -0
  310. /package/src/helpers/isChildrenEmpty/{index.js → index.ts} +0 -0
  311. /package/src/helpers/transferProps/{index.js → index.ts} +0 -0
@@ -1,32 +0,0 @@
1
- ---
2
- paths:
3
- - "src/**/*.scss"
4
- - "src/**/*.css"
5
- ---
6
-
7
- # Styling
8
-
9
- ## Commands
10
-
11
- Run `npm run stylelint` after changes (add `-- --fix` to autofix).
12
-
13
- ## Styling
14
-
15
- Styles use SCSS with CSS Modules (`.module.scss`) with camelCase class names. A
16
- component's styles live next to it as `Foo.module.scss` and are imported as a
17
- module.
18
-
19
- Class naming convention:
20
-
21
- * `root` for the root element.
22
- * Modifiers follow `isRootXxx` (state), `hasRootXxx` (has feature),
23
- `isRootInXxx` (context), `isRootLayoutXxx` (layout variant).
24
-
25
- `src/styles/` contains the global theming system: settings (variables), tools
26
- (mixins), and a large set of CSS custom properties for theming. Component SCSS
27
- files `@use` their own `_settings`, `_theme`, `_tools` partials plus the shared
28
- styles from `src/styles/`. Theme tokens are exposed as CSS custom properties.
29
-
30
- ## Reference
31
-
32
- * [CSS Guidelines](../../src/docs/contribute/css.md)
@@ -1,59 +0,0 @@
1
- ---
2
- paths:
3
- - "**/*.spec.tsx"
4
- - "**/*.story.tsx"
5
- - "**/__tests__/**"
6
- - "tests/**"
7
- ---
8
-
9
- # Testing
10
-
11
- ## Commands
12
-
13
- * Run all Jest unit tests with `npm run test:jest` (TS + JS). For a single file:
14
- `npm run test:jest:ts -- <file>` or `npm run test:jest:js -- <file>`.
15
- * Run all Playwright component tests with `npm run test:playwright-ct:all`; for
16
- one component, `npm run test:playwright-ct:all -- -- src/components/Button`.
17
- * Update Playwright snapshots with `npm run test:playwright-ct:all-with-update`.
18
- * Serve the report with `npm run test:playwright-ct:show-report`.
19
-
20
- ## Testing
21
-
22
- Create/update tests for added or changed components and helpers, and remove
23
- obsolete tests when functionality is removed. Never leave a component or helper
24
- without tests. When fixing a bug, add a test that fails before the fix and
25
- passes after it.
26
-
27
- ### Organization
28
-
29
- Jest unit/component tests are co-located in a component's `__tests__/` folder.
30
-
31
- ### Playwright component tests
32
-
33
- `.spec.tsx` specs use a table-driven pattern:
34
-
35
- * Import arrays of test cases from `_propTests/` directories and from shared
36
- `tests/playwright/propTests/`.
37
- * Each test case is `{ name, props, onBeforeTest?, onBeforeSnapshot? }`; custom
38
- field tests add `customFieldLayoutProps`, `customFieldProps`, etc.
39
- * `mixPropTests([...arrays])` generates the cartesian product of multiple prop
40
- arrays.
41
- * `propTests` from `tests/playwright/` provides standard reusable test sets
42
- (e.g. `layoutPropTest`, `sizePropTest`, `disabledPropTest`).
43
- * Snapshot images are stored alongside the spec file in
44
- `<ComponentName>.spec.tsx-snapshots/`.
45
-
46
- **Story components** (`.story.tsx`) wrap the real component in a minimal fixture
47
- (sometimes inside a context provider) and are imported only by `.spec.tsx`
48
- files. Naming convention: `<ComponentName>ForTest`, `<ComponentName>ForRefTest`,
49
- `<ComponentName>ForFormLayoutTests` — the FormLayout story component is always
50
- last.
51
-
52
- **Test describe structure:** `test.describe('ComponentName')` →
53
- `test.describe('base')` (if present) → `visual` / `non-visual` /
54
- `functionality`; the `formLayout` describe is always the last block at the same
55
- level as `base`.
56
-
57
- ## Reference
58
-
59
- * [Testing Guidelines](../../src/docs/contribute/testing-guidelines.md)
@@ -1,32 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
- "permissions": {
4
- "allow": [
5
- "Bash(git diff:*)",
6
- "Bash(git log:*)",
7
- "Bash(git rev-parse:*)",
8
- "Bash(git show:*)",
9
- "Bash(git status:*)",
10
- "Bash(npm audit)",
11
- "Bash(npm audit signatures)",
12
- "Bash(npm ci)",
13
- "Bash(npm run build:*)",
14
- "Bash(npm run lint)",
15
- "Bash(npm run eslint:*)",
16
- "Bash(npm run stylelint:*)",
17
- "Bash(npm run markdownlint:*)",
18
- "Bash(npm start)",
19
- "Bash(npm run start:*)",
20
- "Bash(npm test)",
21
- "Bash(npm run test:jest:*)",
22
- "Bash(npm run test:playwright-ct:*)"
23
- ]
24
- },
25
- "enabledMcpjsonServers": [
26
- "chrome-host"
27
- ],
28
- "enabledPlugins": {
29
- "github@claude-plugins-official": true,
30
- "context7@claude-plugins-official": true
31
- }
32
- }
@@ -1,54 +0,0 @@
1
- ---
2
- description: Draft a commit message and commit staged changes, following the project git conventions
3
- allowed-tools: Bash(git status), Bash(git diff:*), Bash(git log:*), Bash(git blame:*), Bash(git merge-base:*), Bash(git rev-parse:*), Bash(git add:*), Bash(git commit:*)
4
- ---
5
-
6
- # Commit
7
-
8
- Draft a commit message and commit the staged changes, following the project's
9
- git conventions.
10
-
11
- ## When to use
12
-
13
- * You invoke this to commit staged work. User-only — never auto-invoked.
14
-
15
- ## Context
16
-
17
- Status:
18
-
19
- !`git status`
20
-
21
- Staged diff:
22
-
23
- !`git diff --staged`
24
-
25
- Branch:
26
-
27
- !`git rev-parse --abbrev-ref HEAD`
28
-
29
- Branch commits since `master`:
30
-
31
- !`git log master..HEAD --oneline 2>/dev/null | head -20`
32
-
33
- ## Steps
34
-
35
- Each commit must be atomic and never leave the app broken.
36
-
37
- If nothing is staged, stop and tell the user.
38
-
39
- Before committing, check the following (see [Commands](../../../CLAUDE.md#commands)):
40
-
41
- * `npm run build` passes
42
- * `mkdocs build` passes
43
- * `npm run lint` passes
44
- * `npm run test:jest` passes
45
- * `npm run test:playwright-ct:all` passes
46
-
47
- Write a commit message for the staged changes following the project's git
48
- conventions ([General Guidelines › Git Workflow](../../../src/docs/contribute/general-guidelines.md#git-workflow)):
49
-
50
- Do not append `Co-Authored-By`.
51
-
52
- ## Reference
53
-
54
- * [General Guidelines › Git Workflow](../../../src/docs/contribute/general-guidelines.md#git-workflow)
@@ -1,23 +0,0 @@
1
- {
2
- "name": "React UI (${localWorkspaceFolderBasename})",
3
- "initializeCommand": "bash ./setup.sh",
4
- "dockerComposeFile": [
5
- "../docker-compose.yml"
6
- ],
7
- "service": "devcontainer",
8
- "shutdownAction": "stopCompose",
9
- "workspaceFolder": "/workspace",
10
- "forwardPorts": [
11
- "docs:8000"
12
- ],
13
- "portsAttributes": {
14
- "docs:8000": {
15
- "label": "Docs server",
16
- "protocol": "http",
17
- "onAutoForward": "openBrowser"
18
- }
19
- },
20
- "otherPortsAttributes": {
21
- "onAutoForward": "ignore"
22
- }
23
- }
package/.eslintrc-ts DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "extends": [
3
- "@visionappscz/eslint-config-visionapps",
4
- "airbnb-typescript",
5
- "plugin:@typescript-eslint/recommended",
6
- "plugin:@typescript-eslint/recommended-type-checked",
7
- "plugin:deprecation/recommended",
8
- "plugin:typescript-sort-keys/recommended",
9
- ],
10
- "env": {
11
- "browser": true,
12
- "jest": true
13
- },
14
- "overrides": [
15
- {
16
- "files": [
17
- "*.spec.tsx",
18
- "*.story.tsx",
19
- ],
20
- "rules": {
21
- "@typescript-eslint/unbound-method": "off"
22
- }
23
- }
24
- ],
25
- "parser": "@typescript-eslint/parser",
26
- "parserOptions": {
27
- "projectService": true,
28
- "project": "./tsconfig.json"
29
- },
30
- "plugins": [
31
- "@typescript-eslint"
32
- ],
33
- "rules": {
34
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
35
- "@typescript-eslint/consistent-type-exports": ["error"],
36
- "@typescript-eslint/consistent-type-imports": ["error"],
37
- "import/prefer-default-export": "off",
38
- "no-console": ["error"]
39
- }
40
- }
package/.mcp.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "chrome-host": {
4
- "command": "sh",
5
- "args": ["scripts/mcps/chrome-host/mcp-entry.sh"]
6
- }
7
- }
8
- }
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 24
package/CLAUDE.md DELETED
@@ -1,82 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository
4
-
5
- ## Environment
6
-
7
- This project is developed inside a Docker container called `devcontainer`.
8
- The commands below assume you are running inside the `devcontainer`.
9
-
10
- From the host, run them inside it with
11
- `docker compose exec -T devcontainer <command>` (start it first with
12
- `docker compose up -d`). The other service containers (`node`, `playwright`,
13
- `docs`) are implementation details — do not call them directly.
14
-
15
- If file `/.dockerenv` is present, you are in a Docker container.
16
-
17
- For details, see the
18
- [Contributing Guide](src/docs/contribute/general-guidelines.md#development-environment).
19
-
20
- ## Commands
21
-
22
- Run these inside the `devcontainer` (from the host, prefix with
23
- `docker compose exec -T devcontainer`). For details, see the
24
- [Contributing Guide](src/docs/contribute/general-guidelines.md).
25
-
26
- | Task | Command |
27
- |-----------------------------------|---------------------------------------------------------------------|
28
- | Install JS | `npm ci` |
29
- | Build library | `npm run build` |
30
- | Run static checks | `npm run lint` |
31
- | Run unit tests | `npm run test:jest` |
32
- | Run a single unit test file | `npm run test:jest:ts -- <file>` / `npm run test:jest:js -- <file>` |
33
- | Run component tests | `npm run test:playwright-ct:all` |
34
- | Component tests for one component | `npm run test:playwright-ct:all -- -- src/components/Button` |
35
- | Update component snapshots | `npm run test:playwright-ct:all-with-update` |
36
- | Start build watcher | `npm start` |
37
- | Build documentation | `mkdocs build` |
38
- | Serve documentation | `mkdocs serve` |
39
-
40
- Notes:
41
-
42
- * Commands like `npm`, `playwright` run in specific Docker containers.
43
- Normally, when you run those commands, they are executed within dedicated
44
- containers. If you need to communicate directly with specific Docker container,
45
- use `sudo docker compose ...`. It can be useful when stopping server that is
46
- running within `node` container even though it is started from `devcontainer`.
47
- * See the `scripts` section in `package.json` for the full list of commands.
48
-
49
- ## Topics (Claude Rules)
50
-
51
- Project rules live in [.claude/rules/](.claude/rules/). There are two kinds.
52
-
53
- **Always-on** (no frontmatter) — apply to every change:
54
-
55
- * [code.md](.claude/rules/code.md) — scope discipline, minimal changes.
56
- * [git.md](.claude/rules/git.md) — branches, commits, PRs.
57
- * [safety-guards.md](.claude/rules/safety-guards.md) — hard guard rails.
58
-
59
- **Path-scoped** — each carries a `paths:` glob declaring the files it governs;
60
- consult it when touching those files:
61
-
62
- * [frontend.md](.claude/rules/frontend.md) — `src/**/*.js`, `src/**/*.jsx`:
63
- stack, component structure, implementation pattern.
64
- * [styling.md](.claude/rules/styling.md) — `src/**/*.scss`, `src/**/*.css`:
65
- CSS Modules, class naming, theming.
66
- * [testing.md](.claude/rules/testing.md) — `*.spec.tsx`, `*.story.tsx`,
67
- `__tests__/**`, `tests/**`: Jest and table-driven Playwright tests.
68
- * [docs.md](.claude/rules/docs.md) — `src/docs/**`, component `README.md`.
69
-
70
- ## Agents (Claude Agents)
71
-
72
- Specialized agents live in [.claude/agents/](.claude/agents/).
73
-
74
- * `code-reviewer` — review a change against this repo's rules (uncommitted work,
75
- or a whole branch vs its base).
76
-
77
- ## AI Integration
78
-
79
- MCP-capable assistants in the `devcontainer` can drive host Chrome to verify the
80
- docs site and rendered components. See
81
- [AI Integration](src/docs/contribute/ai-integration.md) and
82
- [scripts/mcps/chrome-host/README.md](scripts/mcps/chrome-host/README.md).
@@ -1,93 +0,0 @@
1
- services:
2
- # This service is responsible for providing the main development environment for developers
3
- devcontainer:
4
- hostname: ${COMPOSE_PROJECT_NAME:-react-ui}_devcontainer
5
- build:
6
- context: docker/react_ui_devcontainer/
7
- dockerfile: Dockerfile
8
- # Start dependent services before starting the `devcontainer` service to ensure that the necessary environments
9
- # and tools are available when the `devcontainer` starts.
10
- depends_on:
11
- node:
12
- condition: service_started
13
- playwright:
14
- condition: service_started
15
- docs:
16
- condition: service_started
17
- # Run as host UID/GID so files created in mounted volumes are owned correctly on the host.
18
- # The images use `fixuid` (https://github.com/boxboat/fixuid) to remap the built-in `developer`
19
- # user to these IDs at startup — the `user:` directive is required for that remap to work.
20
- # Applied to all services below for the same reason.
21
- user: ${COMPOSE_UID}:${COMPOSE_GID}
22
- # Keep the container running indefinitely to allow developers to attach to it and use it as their development environment
23
- command: sleep infinity
24
- # Injects environment variables from the `.env` file into the `devcontainer` service,
25
- # making them accessible within the container's environment.
26
- env_file:
27
- - .env
28
- environment:
29
- # This must be set correctly for the `devcontainer` to be able to access the host's Docker daemon,
30
- # enabling Docker-from-Docker capabilities (e.g., running Docker commands from within the `devcontainer`).
31
- COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME:-react-ui}
32
- init: true
33
- volumes:
34
- - .:/workspace:z
35
- # The following volume is used to allow the `devcontainer` to access the host's Docker daemon,
36
- # enabling Docker-from-Docker capabilities (e.g., running Docker commands from within the `devcontainer`).
37
- - /var/run/docker.sock:/var/run/docker.sock
38
- # The following named volumes persist data (e.g. terminal history, AI tools data, etc.) across container restarts.
39
- # Using separate named volumes (instead of a single volume with subpaths) allows Docker to automatically
40
- # seed the volume with data from the image on first use.
41
- - terminal-history:/home/developer/.terminal_history
42
- - claude-config:/home/developer/.config/claude
43
- - claude-state:/home/developer/.local/state/claude
44
- - copilot:/home/developer/.copilot
45
- - copilot-config:/home/developer/.config/copilot
46
- - opencode-config:/home/developer/.config/opencode
47
- - opencode-share:/home/developer/.local/share/opencode
48
- - opencode-state:/home/developer/.local/state/opencode
49
-
50
- # This service provides Node environment and NPM
51
- node:
52
- build: docker/node
53
- user: ${COMPOSE_UID}:${COMPOSE_GID}
54
- entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/auto-start-node.sh; else sleep infinity; fi'
55
- env_file:
56
- - .env
57
- volumes:
58
- - .:/workspace:z
59
-
60
- # This service provides Playwright environment and tools for browser automation and testing
61
- playwright:
62
- build: docker/playwright
63
- user: ${COMPOSE_UID}:${COMPOSE_GID}
64
- command: sleep infinity
65
- env_file:
66
- - .env
67
- ports:
68
- - ${COMPOSE_PLAYWRIGHT_REPORT_PORT}:9323
69
- volumes:
70
- - .:/workspace:z
71
-
72
- # This provides server for documentation
73
- docs:
74
- build: docker/mkdocs
75
- user: ${COMPOSE_UID}:${COMPOSE_GID}
76
- entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/auto-start-mkdocs.sh; else sleep infinity; fi'
77
- env_file:
78
- - .env
79
- ports:
80
- - ${COMPOSE_DOCS_SERVER_PORT}:8000
81
- volumes:
82
- - .:/workspace:z
83
-
84
- volumes:
85
- # The following volumes are used to persist data (e.g. terminal history, AI tools data, etc.) across container restarts
86
- terminal-history:
87
- claude-config:
88
- claude-state:
89
- copilot:
90
- copilot-config:
91
- opencode-config:
92
- opencode-share:
93
- opencode-state:
@@ -1,41 +0,0 @@
1
- services:
2
- # This service is responsible for providing the main development environment for developers
3
- devcontainer:
4
- extends:
5
- file: docker-compose.base.yml
6
- service: devcontainer
7
- # Use `build` when you want to customize the devcontainer using `docker/react_ui_devcontainer_local/Dockerfile`
8
- # build:
9
- # context: ./docker/react_ui_devcontainer_local/
10
- # dockerfile: Dockerfile
11
- # Use `image` when you want to use the default devcontainer
12
- image: react-ui_devcontainer
13
-
14
- # This service provides Node environment and NPM
15
- node:
16
- extends:
17
- file: docker-compose.base.yml
18
- service: node
19
-
20
- # This service provides Playwright environment and tools for browser automation and testing
21
- playwright:
22
- extends:
23
- file: docker-compose.base.yml
24
- service: playwright
25
-
26
- # This provides server for documentation
27
- docs:
28
- extends:
29
- file: docker-compose.base.yml
30
- service: docs
31
-
32
- volumes:
33
- # The following volumes are used to persist data (e.g. terminal history, AI tools data, etc.) across container restarts
34
- terminal-history:
35
- claude-config:
36
- claude-state:
37
- copilot:
38
- copilot-config:
39
- opencode-config:
40
- opencode-share:
41
- opencode-state:
package/jest.config-ts.js DELETED
@@ -1,34 +0,0 @@
1
-
2
- module.exports = {
3
- extensionsToTreatAsEsm: [
4
- '.ts',
5
- '.tsx',
6
- ],
7
- moduleFileExtensions: [
8
- 'js',
9
- 'jsx',
10
- 'ts',
11
- 'tsx',
12
- ],
13
- moduleNameMapper: {
14
- '\\.scss$': 'identity-obj-proxy',
15
- '\\.svg$': '<rootDir>/tests/jest/mocks/svgrMock.jsx',
16
- },
17
- preset: 'ts-jest',
18
- setupFiles: [
19
- '<rootDir>/tests/jest/setupJest.js',
20
- ],
21
- setupFilesAfterEnv: [
22
- ],
23
- testEnvironment: '@happy-dom/jest-environment',
24
- testMatch: [
25
- '**/*.test.{ts,tsx}',
26
- ],
27
- transform: {
28
- '^.+\\.(ts|tsx)$': [
29
- 'ts-jest',
30
- { useESM: true },
31
- ],
32
- },
33
- verbose: true,
34
- };
package/opencode.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://opencode.ai/config.json",
3
- "mcp": {
4
- "chrome-host": {
5
- "type": "local",
6
- "command": ["sh", "scripts/mcps/chrome-host/mcp-entry.sh"],
7
- "enabled": true
8
- }
9
- }
10
- }
@@ -1,68 +0,0 @@
1
- import {
2
- defineConfig,
3
- devices,
4
- } from '@playwright/experimental-ct-react';
5
- import { parseEnvironment } from './tests/playwright/env/parseEnvironment';
6
-
7
- const environment = parseEnvironment();
8
-
9
- const isCI = !!process.env.CI;
10
-
11
- /**
12
- * @see https://playwright.dev/docs/test-configuration
13
- */
14
- module.exports = defineConfig({
15
- // Fail the build on CI if you accidentally left test.only in the source code
16
- forbidOnly: isCI,
17
- // Run tests in files in parallel
18
- fullyParallel: true,
19
- // Directory where the output generated by Playwright is stored
20
- outputDir: './tests/playwright/.temp/playwright-ct-output/',
21
- // Run tests for following projects
22
- projects: [
23
- {
24
- name: 'chromium',
25
- use: { ...devices['Desktop Chrome'] },
26
- },
27
- ],
28
- /* Reporter to use. See https://playwright.dev/docs/test-reporters */
29
- reporter: 'html',
30
- // Retry failed tests once to eliminate flakiness
31
- retries: 1,
32
- // Directory where the snapshots are located
33
- // (must be same as testDir to save snapshots in place where tests are located)
34
- snapshotDir: './src/',
35
- // Directory where the tests are located
36
- testDir: './src/',
37
- // Pattern to search for test files
38
- testMatch: '*/*.spec.{ts,tsx}',
39
- // Timeout for each test
40
- timeout: 10 * 1000,
41
- // Do not update snapshots automatically
42
- updateSnapshots: 'none',
43
- // Configuration for Playwright component testing
44
- use: {
45
- // Directory where the cache is stored
46
- ctCacheDir: './tests/playwright/.temp/playwright-ct-cache',
47
- // Port to use for Playwright component endpoint
48
- ctPort: environment.CT_PORT,
49
- // Directory where the templates are stored
50
- ctTemplateDir: './tests/playwright/templates',
51
- // Launch options for Playwright
52
- launchOptions: {
53
- args: [
54
- '--use-gl=egl',
55
- // # Must be set to `new` to enable new version of Chromium Headless to obtain correct snapshots
56
- '--headless=new',
57
- ],
58
- ignoreDefaultArgs: [
59
- // # Must be ignored to enable new version of Chromium Headless to obtain correct snapshots
60
- '--headless',
61
- ],
62
- },
63
- // Collect trace on all retries
64
- trace: 'on-all-retries',
65
- },
66
- // Number of workers to use
67
- workers: environment.WORKERS,
68
- });
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
-
3
- # Start the docs server
4
- echo "Starting the docs server..."
5
- mkdocs serve
@@ -1,33 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -e
4
-
5
- # File to read the hash of the package-lock.json
6
- LOCK_HASH_FILE="node_modules/.package-lock-hash"
7
-
8
- # Parent directory of the script
9
- SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
10
-
11
- # Change to the parent directory of the script
12
- cd "$SCRIPT_DIR/.."
13
-
14
- # Install dependencies if node_modules is missing or out of date
15
- CURRENT_HASH=$(sha256sum package-lock.json | awk '{print $1}')
16
- if [ ! -d "node_modules" ]; then
17
- echo "Installing dependencies (node_modules directory is missing)..."
18
- npm ci
19
- elif [ ! -f "$LOCK_HASH_FILE" ]; then
20
- echo "Installing dependencies (lockfile of package-lock.json is missing)..."
21
- npm ci
22
- elif [ "$(cat "$LOCK_HASH_FILE")" != "$CURRENT_HASH" ]; then
23
- echo "Installing dependencies (package-lock.json has changed)..."
24
- npm ci
25
- fi
26
-
27
- # Build the application (must be run prior to starting the server to ensure the latest code is used)
28
- echo "Building the application..."
29
- npm run build
30
-
31
- # Start the application
32
- echo "Starting the application..."
33
- npm start