@react-ui-org/react-ui 0.64.1 → 0.65.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 (292) hide show
  1. package/README.md +3 -6
  2. package/dist/react-ui.css +16 -16
  3. package/dist/react-ui.d.ts +1928 -0
  4. package/dist/react-ui.development.css +2916 -2915
  5. package/dist/react-ui.development.js +2019 -1051
  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} +4 -1
  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.tsx +81 -0
  33. package/src/components/CheckboxField/CheckboxField.types.ts +63 -0
  34. package/src/components/CheckboxField/README.md +67 -42
  35. package/src/components/CheckboxField/index.ts +5 -0
  36. package/src/components/FileInputField/{FileInputField.jsx → FileInputField.tsx} +42 -128
  37. package/src/components/FileInputField/FileInputField.types.ts +100 -0
  38. package/src/components/FileInputField/README.md +1 -1
  39. package/src/components/FileInputField/index.ts +6 -0
  40. package/src/components/FormLayout/FormLayout.module.scss +1 -1
  41. package/src/components/FormLayout/{FormLayout.jsx → FormLayout.tsx} +15 -50
  42. package/src/components/FormLayout/FormLayout.types.ts +55 -0
  43. package/src/components/FormLayout/FormLayoutContext.ts +4 -0
  44. package/src/components/FormLayout/{FormLayoutCustomField.jsx → FormLayoutCustomField.tsx} +10 -65
  45. package/src/components/FormLayout/FormLayoutCustomField.types.ts +59 -0
  46. package/src/components/FormLayout/FormLayoutCustomFieldContext.ts +4 -0
  47. package/src/components/FormLayout/README.md +4 -6
  48. package/src/components/FormLayout/index.ts +14 -0
  49. package/src/components/Grid/Grid.module.scss +1 -1
  50. package/src/components/Grid/Grid.tsx +50 -0
  51. package/src/components/Grid/Grid.types.ts +108 -0
  52. package/src/components/Grid/GridSpan.tsx +36 -0
  53. package/src/components/Grid/README.md +2 -2
  54. package/src/components/Grid/_helpers/generateResponsiveCustomProperties.ts +32 -0
  55. package/src/components/Grid/index.ts +9 -0
  56. package/src/components/InputGroup/{InputGroup.jsx → InputGroup.tsx} +25 -89
  57. package/src/components/InputGroup/InputGroup.types.ts +80 -0
  58. package/src/components/InputGroup/InputGroupContext.ts +4 -0
  59. package/src/components/InputGroup/README.md +5 -1
  60. package/src/components/InputGroup/{index.js → index.ts} +4 -0
  61. package/src/components/Modal/Modal.tsx +172 -0
  62. package/src/components/Modal/Modal.types.ts +181 -0
  63. package/src/components/Modal/ModalBody.tsx +34 -0
  64. package/src/components/Modal/{ModalCloseButton.jsx → ModalCloseButton.tsx} +6 -19
  65. package/src/components/Modal/{ModalContent.jsx → ModalContent.tsx} +4 -15
  66. package/src/components/Modal/ModalFooter.tsx +27 -0
  67. package/src/components/Modal/ModalHeader.tsx +27 -0
  68. package/src/components/Modal/ModalTitle.tsx +29 -0
  69. package/src/components/Modal/README.md +9 -9
  70. package/src/components/Modal/_helpers/{dialogOnCancelHandler.js → dialogOnCancelHandler.ts} +11 -1
  71. package/src/components/Modal/_helpers/{dialogOnClickHandler.js → dialogOnClickHandler.ts} +13 -7
  72. package/src/components/Modal/_helpers/{dialogOnCloseHandler.js → dialogOnCloseHandler.ts} +11 -1
  73. package/src/components/Modal/_helpers/{dialogOnKeyDownHandler.js → dialogOnKeyDownHandler.ts} +19 -6
  74. package/src/components/Modal/_helpers/{getJustifyClassName.js → getJustifyClassName.ts} +4 -1
  75. package/src/components/Modal/_helpers/getPositionClassName.ts +10 -0
  76. package/src/components/Modal/_helpers/getScrollingClassName.ts +14 -0
  77. package/src/components/Modal/_helpers/{getSizeClassName.js → getSizeClassName.ts} +4 -1
  78. package/src/components/Modal/_hooks/{useModalFocus.js → useModalFocus.ts} +9 -5
  79. package/src/components/Modal/_hooks/{useModalScrollPrevention.js → useModalScrollPrevention.ts} +4 -1
  80. package/src/components/Modal/{index.js → index.ts} +14 -0
  81. package/src/components/Paper/{Paper.jsx → Paper.tsx} +6 -26
  82. package/src/components/Paper/Paper.types.ts +19 -0
  83. package/src/components/Paper/README.md +3 -4
  84. package/src/components/Paper/index.ts +2 -0
  85. package/src/components/Popover/Popover.module.scss +1 -1
  86. package/src/components/Popover/Popover.tsx +61 -0
  87. package/src/components/Popover/Popover.types.ts +75 -0
  88. package/src/components/Popover/PopoverWrapper.tsx +27 -0
  89. package/src/components/Popover/README.md +34 -22
  90. package/src/components/Popover/_helpers/{cleanPlacementStyle.js → cleanPlacementStyle.ts} +4 -1
  91. package/src/components/Popover/_helpers/{getRootAlignmentClassName.js → getRootAlignmentClassName.ts} +4 -1
  92. package/src/components/Popover/_helpers/{getRootSideClassName.js → getRootSideClassName.ts} +4 -1
  93. package/src/components/Popover/index.ts +8 -0
  94. package/src/components/Radio/README.md +85 -45
  95. package/src/components/Radio/{Radio.jsx → Radio.tsx} +11 -107
  96. package/src/components/Radio/Radio.types.ts +90 -0
  97. package/src/components/Radio/index.ts +5 -0
  98. package/src/components/ScrollView/README.md +1 -1
  99. package/src/components/ScrollView/ScrollView.module.scss +5 -0
  100. package/src/components/ScrollView/{ScrollView.jsx → ScrollView.tsx} +55 -166
  101. package/src/components/ScrollView/ScrollView.types.ts +121 -0
  102. package/src/components/ScrollView/_helpers/getElementsPositionDifference.ts +17 -0
  103. package/src/components/ScrollView/_hooks/{useLoadResizeHook.js → useLoadResizeHook.ts} +14 -3
  104. package/src/components/ScrollView/_hooks/{useScrollPositionHook.js → useScrollPositionHook.ts} +11 -4
  105. package/src/components/ScrollView/index.ts +6 -0
  106. package/src/components/SelectField/README.md +84 -45
  107. package/src/components/SelectField/SelectField.tsx +139 -0
  108. package/src/components/SelectField/SelectField.types.ts +120 -0
  109. package/src/components/SelectField/_components/Option/Option.tsx +19 -0
  110. package/src/components/SelectField/_components/Option/Option.types.ts +21 -0
  111. package/src/components/SelectField/_components/Option/index.ts +2 -0
  112. package/src/components/SelectField/index.ts +7 -0
  113. package/src/components/Table/README.md +1 -1
  114. package/src/components/Table/{Table.jsx → Table.tsx} +4 -43
  115. package/src/components/Table/Table.types.ts +51 -0
  116. package/src/components/Table/_components/TableBodyCell/TableBodyCell.tsx +20 -0
  117. package/src/components/Table/_components/TableBodyCell/TableBodyCell.types.ts +20 -0
  118. package/src/components/Table/_components/TableBodyCell/index.ts +2 -0
  119. package/src/components/Table/_components/TableHeaderCell/{TableHeaderCell.jsx → TableHeaderCell.tsx} +3 -34
  120. package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.types.ts +20 -0
  121. package/src/components/Table/_components/TableHeaderCell/index.ts +2 -0
  122. package/src/components/Table/index.ts +8 -0
  123. package/src/components/Tabs/README.md +2 -2
  124. package/src/components/Tabs/{Tabs.jsx → Tabs.tsx} +4 -20
  125. package/src/components/Tabs/Tabs.types.ts +19 -0
  126. package/src/components/Tabs/TabsItem.tsx +49 -0
  127. package/src/components/Tabs/TabsItem.types.ts +42 -0
  128. package/src/components/Tabs/index.ts +4 -0
  129. package/src/components/Text/README.md +1 -1
  130. package/src/components/Text/Text.module.scss +5 -7
  131. package/src/components/Text/Text.tsx +46 -0
  132. package/src/components/Text/Text.types.ts +31 -0
  133. package/src/components/Text/_helpers/getRootClampClassName.ts +13 -0
  134. package/src/components/Text/_helpers/getRootHyphensClassName.ts +14 -0
  135. package/src/components/Text/_helpers/getRootWordWrappingClassName.ts +14 -0
  136. package/src/components/Text/index.ts +6 -0
  137. package/src/components/TextArea/README.md +5 -8
  138. package/src/components/TextArea/TextArea.tsx +95 -0
  139. package/src/components/TextArea/TextArea.types.ts +75 -0
  140. package/src/components/TextArea/index.ts +5 -0
  141. package/src/components/TextField/README.md +5 -7
  142. package/src/components/TextField/TextField.tsx +112 -0
  143. package/src/components/TextField/TextField.types.ts +94 -0
  144. package/src/components/TextField/index.ts +6 -0
  145. package/src/components/TextLink/README.md +1 -1
  146. package/src/components/TextLink/{TextLink.jsx → TextLink.tsx} +4 -15
  147. package/src/components/TextLink/TextLink.types.ts +12 -0
  148. package/src/components/TextLink/index.ts +2 -0
  149. package/src/components/Toggle/README.md +67 -42
  150. package/src/components/Toggle/Toggle.tsx +82 -0
  151. package/src/components/Toggle/Toggle.types.ts +58 -0
  152. package/src/components/Toggle/index.ts +5 -0
  153. package/src/components/Toolbar/README.md +3 -3
  154. package/src/components/Toolbar/Toolbar.tsx +41 -0
  155. package/src/components/Toolbar/Toolbar.types.ts +74 -0
  156. package/src/components/Toolbar/ToolbarGroup.tsx +38 -0
  157. package/src/components/Toolbar/{ToolbarItem.jsx → ToolbarItem.tsx} +5 -21
  158. package/src/components/Toolbar/_helpers/{getAlignClassName.js → getAlignClassName.ts} +8 -1
  159. package/src/components/Toolbar/_helpers/{getJustifyClassName.js → getJustifyClassName.ts} +4 -1
  160. package/src/components/Toolbar/{index.js → index.ts} +7 -0
  161. package/src/components/_helpers/{getRootColorClassName.js → getRootColorClassName.ts} +6 -1
  162. package/src/components/_helpers/{getRootPriorityClassName.js → getRootPriorityClassName.ts} +6 -1
  163. package/src/components/_helpers/{getRootSizeClassName.js → getRootSizeClassName.ts} +6 -1
  164. package/src/components/_helpers/{getRootValidationStateClassName.js → getRootValidationStateClassName.ts} +6 -1
  165. package/src/components/_helpers/resolveContextOrProp.ts +13 -0
  166. package/src/helpers/classNames/{classNames.js → classNames.ts} +2 -2
  167. package/src/helpers/isChildrenEmpty/isChildrenEmpty.ts +5 -0
  168. package/src/helpers/transferProps/transferProps.ts +50 -0
  169. package/src/helpers/transferProps/transferProps.types.ts +11 -0
  170. package/src/index.ts +211 -0
  171. package/src/providers/globalProps/GlobalProps.types.ts +30 -0
  172. package/src/providers/globalProps/GlobalPropsContext.ts +6 -0
  173. package/src/providers/globalProps/{GlobalPropsProvider.jsx → GlobalPropsProvider.tsx} +8 -15
  174. package/src/providers/globalProps/{index.js → index.ts} +4 -0
  175. package/src/providers/globalProps/withGlobalProps.tsx +36 -0
  176. package/src/providers/translations/Translations.types.ts +26 -0
  177. package/src/providers/translations/TranslationsContext.ts +7 -0
  178. package/src/providers/translations/{TranslationsProvider.jsx → TranslationsProvider.tsx} +8 -15
  179. package/src/providers/translations/{index.js → index.ts} +5 -0
  180. package/src/styles/tools/_accessibility.scss +2 -2
  181. package/src/translations/{en.js → en.ts} +3 -1
  182. package/src/types/breakpoints.ts +1 -0
  183. package/src/types/colors.ts +7 -0
  184. package/src/types/index.ts +13 -0
  185. package/src/types/labelPositions.ts +1 -0
  186. package/src/types/layouts.ts +1 -0
  187. package/src/types/modules.d.ts +16 -0
  188. package/src/types/priorities.ts +1 -0
  189. package/src/types/sizes.ts +1 -0
  190. package/src/types/styles.ts +4 -0
  191. package/src/types/validationStates.ts +1 -0
  192. package/src/utils/mergeDeep.ts +34 -0
  193. package/src/utils/mergeDeep.types.ts +4 -0
  194. package/.claude/agents/code-reviewer.md +0 -122
  195. package/.claude/rules/code.md +0 -22
  196. package/.claude/rules/docs.md +0 -35
  197. package/.claude/rules/frontend.md +0 -72
  198. package/.claude/rules/git.md +0 -13
  199. package/.claude/rules/safety-guards.md +0 -9
  200. package/.claude/rules/styling.md +0 -32
  201. package/.claude/rules/testing.md +0 -59
  202. package/.claude/settings.json +0 -32
  203. package/.claude/skills/commit/SKILL.md +0 -54
  204. package/.devcontainer/devcontainer.json +0 -23
  205. package/.eslintrc-ts +0 -40
  206. package/.mcp.json +0 -8
  207. package/.nvmrc +0 -1
  208. package/CLAUDE.md +0 -82
  209. package/docker-compose.base.yml +0 -93
  210. package/docker-compose.yml.dist +0 -41
  211. package/jest.config-ts.js +0 -34
  212. package/opencode.json +0 -10
  213. package/playwright-ct.config.ts +0 -68
  214. package/scripts/auto-start-mkdocs.sh +0 -5
  215. package/scripts/auto-start-node.sh +0 -33
  216. package/scripts/mcps/chrome-host/README.md +0 -118
  217. package/scripts/mcps/chrome-host/cdp_proxy.py +0 -90
  218. package/scripts/mcps/chrome-host/mcp-entry.sh +0 -33
  219. package/scripts/mcps/chrome-host/mcp-launch.sh +0 -36
  220. package/scripts/mcps/chrome-host/mcp-setup.sh +0 -70
  221. package/scripts/mcps/chrome-host/start-host-chrome.sh +0 -267
  222. package/setup.sh +0 -107
  223. package/src/CNAME +0 -1
  224. package/src/components/Alert/index.js +0 -1
  225. package/src/components/Badge/Badge.jsx +0 -51
  226. package/src/components/Badge/index.js +0 -1
  227. package/src/components/Button/Button.jsx +0 -203
  228. package/src/components/Button/helpers/getRootPriorityClassName.js +0 -15
  229. package/src/components/Button/index.js +0 -1
  230. package/src/components/ButtonGroup/ButtonGroupContext.js +0 -3
  231. package/src/components/Card/Card.jsx +0 -67
  232. package/src/components/CheckboxField/CheckboxField.jsx +0 -144
  233. package/src/components/CheckboxField/index.js +0 -1
  234. package/src/components/FileInputField/index.js +0 -1
  235. package/src/components/FormLayout/FormLayoutContext.js +0 -3
  236. package/src/components/FormLayout/FormLayoutCustomFieldContext.js +0 -3
  237. package/src/components/FormLayout/index.js +0 -4
  238. package/src/components/Grid/Grid.jsx +0 -225
  239. package/src/components/Grid/GridSpan.jsx +0 -88
  240. package/src/components/Grid/_helpers/generateResponsiveCustomProperties.js +0 -22
  241. package/src/components/Grid/index.js +0 -2
  242. package/src/components/InputGroup/InputGroupContext.js +0 -3
  243. package/src/components/Modal/Modal.jsx +0 -262
  244. package/src/components/Modal/ModalBody.jsx +0 -60
  245. package/src/components/Modal/ModalFooter.jsx +0 -42
  246. package/src/components/Modal/ModalHeader.jsx +0 -42
  247. package/src/components/Modal/ModalTitle.jsx +0 -42
  248. package/src/components/Modal/_helpers/getPositionClassName.js +0 -7
  249. package/src/components/Modal/_helpers/getScrollingClassName.js +0 -11
  250. package/src/components/Paper/index.js +0 -1
  251. package/src/components/Popover/Popover.jsx +0 -124
  252. package/src/components/Popover/PopoverWrapper.jsx +0 -38
  253. package/src/components/Popover/index.js +0 -2
  254. package/src/components/Radio/index.js +0 -1
  255. package/src/components/ScrollView/_helpers/getElementsPositionDifference.js +0 -11
  256. package/src/components/ScrollView/index.js +0 -1
  257. package/src/components/SelectField/SelectField.jsx +0 -272
  258. package/src/components/SelectField/_components/Option/Option.jsx +0 -46
  259. package/src/components/SelectField/_components/Option/index.js +0 -1
  260. package/src/components/SelectField/index.js +0 -1
  261. package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +0 -46
  262. package/src/components/Table/_components/TableBodyCell/index.js +0 -1
  263. package/src/components/Table/_components/TableHeaderCell/index.js +0 -1
  264. package/src/components/Table/index.js +0 -1
  265. package/src/components/Tabs/TabsItem.jsx +0 -91
  266. package/src/components/Tabs/index.js +0 -2
  267. package/src/components/Text/Text.jsx +0 -76
  268. package/src/components/Text/_helpers/getRootClampClassName.js +0 -11
  269. package/src/components/Text/_helpers/getRootHyphensClassName.js +0 -11
  270. package/src/components/Text/_helpers/getRootWordWrappingClassName.js +0 -11
  271. package/src/components/Text/index.js +0 -1
  272. package/src/components/TextArea/TextArea.jsx +0 -174
  273. package/src/components/TextArea/index.js +0 -1
  274. package/src/components/TextField/TextField.jsx +0 -208
  275. package/src/components/TextField/index.js +0 -1
  276. package/src/components/TextLink/index.js +0 -1
  277. package/src/components/Toggle/Toggle.jsx +0 -144
  278. package/src/components/Toggle/index.js +0 -1
  279. package/src/components/Toolbar/Toolbar.jsx +0 -76
  280. package/src/components/Toolbar/ToolbarGroup.jsx +0 -64
  281. package/src/components/_helpers/resolveContextOrProp.js +0 -10
  282. package/src/helpers/isChildrenEmpty/isChildrenEmpty.js +0 -3
  283. package/src/helpers/transferProps/transferProps.js +0 -38
  284. package/src/index.js +0 -67
  285. package/src/providers/globalProps/GlobalPropsContext.jsx +0 -5
  286. package/src/providers/globalProps/withGlobalProps.jsx +0 -38
  287. package/src/providers/translations/TranslationsContext.jsx +0 -6
  288. package/src/utils/mergeDeep.js +0 -28
  289. package/tsconfig.json +0 -27
  290. /package/src/helpers/classNames/{index.js → index.ts} +0 -0
  291. /package/src/helpers/isChildrenEmpty/{index.js → index.ts} +0 -0
  292. /package/src/helpers/transferProps/{index.js → index.ts} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-ui-org/react-ui",
3
3
  "description": "React UI is a themeable UI library for React apps.",
4
- "version": "0.64.1",
4
+ "version": "0.65.0",
5
5
  "keywords": [
6
6
  "react",
7
7
  "ui",
@@ -24,6 +24,21 @@
24
24
  "url": "https://github.com/react-ui-org/react-ui/issues"
25
25
  },
26
26
  "main": "dist/react-ui.js",
27
+ "types": "dist/react-ui.d.ts",
28
+ "files": [
29
+ "dist/react-ui.css",
30
+ "dist/react-ui.d.ts",
31
+ "dist/react-ui.development.css",
32
+ "dist/react-ui.development.js",
33
+ "dist/react-ui.js",
34
+ "scripts/write-lockfile-hash.sh",
35
+ "src",
36
+ "!src/**/__tests__",
37
+ "!src/CNAME",
38
+ "!src/docs",
39
+ "!src/docsCustomProperties.ts",
40
+ "!src/index.md"
41
+ ],
27
42
  "repository": {
28
43
  "type": "git",
29
44
  "url": "https://github.com/react-ui-org/react-ui"
@@ -34,105 +49,94 @@
34
49
  "devEngines": {
35
50
  "runtime": {
36
51
  "name": "node",
37
- "version": "^22.11.0 || ^24.11.0",
52
+ "version": "^22.23.0 || ^24.17.0",
38
53
  "onFail": "error"
39
54
  },
40
55
  "packageManager": {
41
56
  "name": "npm",
42
- "version": "^11.6.1",
57
+ "version": "^11.13.0",
43
58
  "onFail": "error"
44
59
  }
45
60
  },
46
61
  "scripts": {
47
62
  "build": "webpack --mode=production && webpack --mode=development",
63
+ "build:types": "node node_modules/@typescript/native/bin/tsc -p tsconfig.build.json && dts-bundle-generator --project tsconfig.build.json --no-check -o dist/react-ui.d.ts dist/types/index.d.ts",
48
64
  "copy": "npm run copy:css && npm run copy:js",
49
65
  "copy:css": "cp src/docs/_assets/generated/react-ui.css dist && cp src/docs/_assets/generated/react-ui.development.css dist",
50
66
  "copy:js": "cp src/docs/_assets/generated/react-ui.js dist && cp src/docs/_assets/generated/react-ui.development.js dist",
51
- "eslint": "npm run eslint:ts && npm run eslint:js",
52
- "eslint:js": "eslint --ext js,jsx src",
53
- "eslint:ts": "eslint --ext ts,tsx -c .eslintrc-ts src tests",
54
- "lint": "npm run eslint && npm run markdownlint && npm run stylelint",
67
+ "eslint": "eslint src tests",
68
+ "lint": "npm run eslint && npm run markdownlint && npm run stylelint && npm run typecheck",
55
69
  "markdownlint": "markdownlint-cli2 \"README.md\" \"src/**/*.md\"",
56
- "postbuild": "npm run copy",
70
+ "postbuild": "npm run copy && npm run build:types",
57
71
  "postinstall": "sh scripts/write-lockfile-hash.sh",
58
72
  "precopy": "rm -rf dist && mkdir dist",
59
73
  "prepublishOnly": "npm run build",
60
74
  "start": "webpack --watch --mode=development",
61
75
  "start:chrome": "sh scripts/mcps/chrome-host/start-host-chrome.sh",
62
- "stylelint": "stylelint \"src/**/*.{css,scss}\" \"!src/docs/_assets/generated/**\" --config stylelint.config.js",
76
+ "stylelint": "stylelint \"src/**/*.{css,scss}\" \"!src/docs/_assets/generated/**\" --config stylelint.config.mjs",
63
77
  "test": "npm run test:jest",
64
- "test:jest": "npm run test:jest:ts && npm run test:jest:js",
65
- "test:jest:js": "jest --coverage",
66
- "test:jest:ts": "jest -c jest.config-ts.js --coverage",
78
+ "test:jest": "jest --coverage",
67
79
  "test:playwright-ct:all": "playwright test -c playwright-ct.config.ts",
68
80
  "test:playwright-ct:all-with-update": "playwright test -c playwright-ct.config.ts --update-snapshots",
69
- "test:playwright-ct:show-report": "playwright show-report --host=0.0.0.0 --port=9323"
81
+ "test:playwright-ct:show-report": "playwright show-report --host=0.0.0.0 --port=9323",
82
+ "typecheck": "node node_modules/@typescript/native/bin/tsc --noEmit"
70
83
  },
71
84
  "dependencies": {
72
85
  "normalize.css": "^8.0.1"
73
86
  },
74
87
  "peerDependencies": {
75
- "prop-types": "^15.8.0",
76
- "react": "~18.2.0",
77
- "react-dom": "~18.2.0"
88
+ "react": "^18.2.0",
89
+ "react-dom": "^18.2.0"
78
90
  },
79
91
  "devDependencies": {
80
- "@babel/cli": "^7.28.3",
81
- "@babel/core": "^7.28.5",
82
- "@babel/eslint-parser": "^7.28.5",
83
- "@babel/plugin-proposal-class-properties": "^7.18.6",
84
- "@babel/plugin-transform-spread": "^7.27.1",
85
- "@babel/preset-env": "^7.28.5",
86
- "@babel/preset-react": "^7.28.5",
87
- "@babel/register": "^7.28.3",
88
- "@happy-dom/jest-environment": "^20.0.11",
89
- "@playwright/experimental-ct-react": "^1.57.0",
90
- "@stylistic/stylelint-config": "^1.0.1",
91
- "@svgr/webpack": "^8.1.0",
92
- "@testing-library/jest-dom": "^6.9.1",
93
- "@testing-library/react": "^16.3.0",
94
- "@testing-library/user-event": "^14.6.1",
92
+ "@babel/core": "^8.0.5",
93
+ "@babel/preset-env": "^8.0.5",
94
+ "@babel/preset-react": "^8.0.1",
95
+ "@babel/preset-typescript": "^8.0.1",
96
+ "@happy-dom/jest-environment": "^20.14.5",
97
+ "@playwright/test": "~1.63.0",
98
+ "@react-ui-org/eslint-config": "^1.1.0",
99
+ "@react-ui-org/stylelint-config": "^1.0.0",
100
+ "@testing-library/dom": "^10.4.2",
101
+ "@testing-library/jest-dom": "^7.0.1",
102
+ "@testing-library/react": "^16.3.3",
103
+ "@testing-library/user-event": "^14.6.7",
95
104
  "@types/jest": "^30.0.0",
96
- "@types/node": "^22.19.1",
97
- "@types/react": "^19.2.7",
98
- "@types/react-dom": "^19.2.3",
99
- "@typescript-eslint/eslint-plugin": "^7.18.0",
100
- "@typescript-eslint/parser": "^7.18.0",
101
- "@visionappscz/eslint-config-visionapps": "^1.7.0",
102
- "@visionappscz/stylelint-config": "^4.0.0",
103
- "autoprefixer": "^10.4.22",
104
- "babel-jest": "^30.2.0",
105
- "babel-loader": "^10.0.0",
106
- "core-js": "^3.47.0",
107
- "css-loader": "^7.1.2",
108
- "dotenv": "^17.2.3",
109
- "eslint": "^8.57.0",
110
- "eslint-config-airbnb": "^19.0.4",
111
- "eslint-config-airbnb-typescript": "^18.0.0",
112
- "eslint-plugin-deprecation": "^3.0.0",
113
- "eslint-plugin-import": "^2.29.1",
114
- "eslint-plugin-jsx-a11y": "^6.9.0",
115
- "eslint-plugin-markdown": "^3.0.1",
116
- "eslint-plugin-react": "^7.34.3",
117
- "eslint-plugin-react-hooks": "^4.6.2",
118
- "eslint-plugin-typescript-sort-keys": "^3.3.0",
105
+ "@types/node": "^26.5.1",
106
+ "@types/react": "^19.3.0",
107
+ "@types/react-dom": "^19.3.0",
108
+ "@typescript/native": "npm:typescript@^7.0.2",
109
+ "autoprefixer": "^10.6.0",
110
+ "babel-jest": "^30.5.1",
111
+ "babel-loader": "^10.1.1",
112
+ "babel-plugin-polyfill-corejs3": "^1.0.0",
113
+ "core-js": "^3.50.0",
114
+ "css-loader": "^7.1.5",
115
+ "dotenv": "^17.4.2",
116
+ "dts-bundle-generator": "^9.5.1",
117
+ "eslint": "^9.39.5",
119
118
  "identity-obj-proxy": "^3.0.0",
120
- "jest": "^30.2.0",
121
- "markdownlint-cli2": "^0.19.1",
122
- "mini-css-extract-plugin": "^2.9.4",
123
- "postcss": "^8.5.6",
124
- "postcss-loader": "^8.2.0",
125
- "prop-types": "^15.8.1",
126
- "react": "~18.2.0",
127
- "react-dom": "~18.2.0",
128
- "sass": "^1.94.2",
129
- "sass-loader": "^16.0.6",
130
- "stylelint": "^16.7.0",
131
- "stylelint-webpack-plugin": "^5.0.1",
132
- "terser-webpack-plugin": "^5.3.15",
133
- "ts-jest": "^29.4.6",
134
- "webpack": "^5.103.0",
135
- "webpack-cli": "^6.0.1",
119
+ "jest": "^30.5.1",
120
+ "markdownlint-cli2": "^0.23.3",
121
+ "mini-css-extract-plugin": "^2.10.2",
122
+ "postcss": "^8.5.28",
123
+ "postcss-loader": "^8.2.1",
124
+ "react": "^18.3.1",
125
+ "react-dom": "^18.3.1",
126
+ "sass": "^1.104.1",
127
+ "sass-loader": "^17.0.1",
128
+ "stylelint": "^17.15.0",
129
+ "stylelint-webpack-plugin": "^5.1.0",
130
+ "terser-webpack-plugin": "^5.6.1",
131
+ "typescript": "npm:@typescript/typescript6@^6.0.2",
132
+ "webpack": "^5.111.0",
133
+ "webpack-cli": "^7.2.3",
134
+ "webpack-dev-server": "^6.0.0",
136
135
  "webpack-visualizer-plugin2": "^2.0.0"
136
+ },
137
+ "overrides": {
138
+ "babel-preset-current-node-syntax": {
139
+ "@babel/core": "$@babel/core"
140
+ }
137
141
  }
138
142
  }
@@ -1,4 +1,3 @@
1
- import PropTypes from 'prop-types';
2
1
  import React, { useContext } from 'react';
3
2
  import { withGlobalProps } from '../../providers/globalProps';
4
3
  import { TranslationsContext } from '../../providers/translations';
@@ -6,15 +5,16 @@ import { classNames } from '../../helpers/classNames/classNames';
6
5
  import { transferProps } from '../../helpers/transferProps';
7
6
  import { getRootColorClassName } from '../_helpers/getRootColorClassName';
8
7
  import styles from './Alert.module.scss';
8
+ import type { AlertProps } from './Alert.types';
9
9
 
10
- export const Alert = ({
10
+ export const Alert: React.FunctionComponent<AlertProps> = ({
11
11
  children,
12
- color,
12
+ color = 'note',
13
13
  icon,
14
14
  id,
15
15
  onClose,
16
16
  ...restProps
17
- }) => {
17
+ }: AlertProps) => {
18
18
  const translations = useContext(TranslationsContext);
19
19
 
20
20
  return (
@@ -22,7 +22,7 @@ export const Alert = ({
22
22
  {...transferProps(restProps)}
23
23
  className={classNames(
24
24
  styles.root,
25
- getRootColorClassName(color, styles),
25
+ getRootColorClassName(styles, color),
26
26
  )}
27
27
  id={id}
28
28
  role="alert"
@@ -44,8 +44,9 @@ export const Alert = ({
44
44
  {...(id && { id: `${id}__close` })}
45
45
  className={styles.close}
46
46
  onClick={() => onClose()}
47
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
47
48
  onKeyPress={() => onClose()}
48
- tabIndex="0"
49
+ tabIndex={0}
49
50
  title={translations.Alert.close}
50
51
  >
51
52
  <span className={styles.closeSign}>×</span>
@@ -55,42 +56,6 @@ export const Alert = ({
55
56
  );
56
57
  };
57
58
 
58
- Alert.defaultProps = {
59
- color: 'note',
60
- icon: undefined,
61
- id: undefined,
62
- onClose: undefined,
63
- };
64
-
65
- Alert.propTypes = {
66
- /**
67
- * Alert body.
68
- */
69
- children: PropTypes.node.isRequired,
70
- /**
71
- * Color variant to clarify importance and meaning of the alert. Implements
72
- * [Feedback color collection](/docs/foundation/collections#colors).
73
- */
74
- color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note']),
75
- /**
76
- * Optional element to be displayed next to the alert body.
77
- */
78
- icon: PropTypes.node,
79
- /**
80
- * ID of the root HTML element.
81
- *
82
- * Also serves as base for ids of nested elements:
83
- * * `<ID>__close`
84
- * * `<ID>__content`
85
- */
86
- id: PropTypes.string,
87
- /**
88
- * Function to call when the close button is clicked. If not provided, close buttons will be
89
- * hidden.
90
- */
91
- onClose: PropTypes.func,
92
- };
93
-
94
- export const AlertWithGlobalProps = withGlobalProps(Alert, 'Alert');
59
+ export const AlertWithGlobalProps = withGlobalProps<AlertProps, never>(Alert, 'Alert');
95
60
 
96
61
  export default AlertWithGlobalProps;
@@ -0,0 +1,34 @@
1
+ import type {
2
+ HTMLAttributes,
3
+ ReactNode,
4
+ } from 'react';
5
+ import type { FeedbackColor } from '../../types';
6
+
7
+ export type AlertProps = Omit<HTMLAttributes<HTMLDivElement>, 'color'> & {
8
+ /**
9
+ * Alert body.
10
+ */
11
+ children: ReactNode;
12
+ /**
13
+ * Color variant to clarify importance and meaning of the alert. Implements
14
+ * [Feedback color collection](/docs/foundation/collections#colors).
15
+ */
16
+ color?: FeedbackColor;
17
+ /**
18
+ * Optional element to be displayed next to the alert body.
19
+ */
20
+ icon?: ReactNode;
21
+ /**
22
+ * ID of the root HTML element.
23
+ *
24
+ * Also serves as base for ids of nested elements:
25
+ * * `<ID>__close`
26
+ * * `<ID>__content`
27
+ */
28
+ id?: string;
29
+ /**
30
+ * Function to call when the close button is clicked. If not provided, close buttons will be
31
+ * hidden.
32
+ */
33
+ onClose?: () => void;
34
+ };
@@ -170,7 +170,7 @@ helps to improve its accessibility.
170
170
 
171
171
  ## API
172
172
 
173
- <docoff-react-props src="/components/Alert/Alert.jsx" />
173
+ <docoff-react-props src="/components/Alert/Alert.tsx" name="Alert" />
174
174
 
175
175
  ## Theming
176
176
 
@@ -0,0 +1,2 @@
1
+ export { default as Alert } from './Alert';
2
+ export type { AlertProps } from './Alert.types';
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { withGlobalProps } from '../../providers/globalProps';
3
+ import { classNames } from '../../helpers/classNames/classNames';
4
+ import { transferProps } from '../../helpers/transferProps';
5
+ import { getRootColorClassName } from '../_helpers/getRootColorClassName';
6
+ import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName';
7
+ import styles from './Badge.module.scss';
8
+ import type { BadgeProps } from './Badge.types';
9
+
10
+ export const Badge: React.FunctionComponent<BadgeProps> = ({
11
+ color = 'note',
12
+ label,
13
+ priority = 'filled',
14
+ ...restProps
15
+ }: BadgeProps) => (
16
+ <div
17
+ {...transferProps(restProps)}
18
+ className={classNames(
19
+ styles.root,
20
+ getRootPriorityClassName(styles, priority),
21
+ getRootColorClassName(styles, color),
22
+ )}
23
+ >
24
+ {label}
25
+ </div>
26
+ );
27
+
28
+ export const BadgeWithGlobalProps = withGlobalProps<BadgeProps, never>(Badge, 'Badge');
29
+
30
+ export default BadgeWithGlobalProps;
@@ -0,0 +1,24 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import type {
3
+ FeedbackColor,
4
+ NeutralColor,
5
+ Priority,
6
+ } from '../../types';
7
+
8
+ export type BadgePriority = Exclude<Priority, 'flat'>;
9
+
10
+ export type BadgeProps = Omit<HTMLAttributes<HTMLDivElement>, 'color'> & {
11
+ /**
12
+ * Color to clarify importance and meaning of the badge. Implements
13
+ * [Feedback and Neutral color collections](/docs/foundation/collections#colors).
14
+ */
15
+ color?: FeedbackColor | NeutralColor;
16
+ /**
17
+ * Text to be displayed.
18
+ */
19
+ label: string;
20
+ /**
21
+ * Visual priority to highlight or suppress the badge.
22
+ */
23
+ priority?: BadgePriority;
24
+ };
@@ -101,7 +101,7 @@ helps to improve its accessibility.
101
101
 
102
102
  ## API
103
103
 
104
- <docoff-react-props src="/components/Badge/Badge.jsx" />
104
+ <docoff-react-props src="/components/Badge/Badge.tsx" name="Badge" />
105
105
 
106
106
  ## Theming
107
107
 
@@ -0,0 +1,5 @@
1
+ export { default as Badge } from './Badge';
2
+ export type {
3
+ BadgePriority,
4
+ BadgeProps,
5
+ } from './Badge.types';
@@ -0,0 +1,110 @@
1
+ import React, { useContext } from 'react';
2
+ import { withGlobalProps } from '../../providers/globalProps';
3
+ import { classNames } from '../../helpers/classNames/classNames';
4
+ import { transferProps } from '../../helpers/transferProps';
5
+ import { getRootColorClassName } from '../_helpers/getRootColorClassName';
6
+ import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName';
7
+ import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
8
+ import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
9
+ import { ButtonGroupContext } from '../ButtonGroup/ButtonGroupContext';
10
+ import { FormLayoutContext } from '../FormLayout/FormLayoutContext';
11
+ import { InputGroupContext } from '../InputGroup/InputGroupContext';
12
+ import getRootLabelVisibilityClassName from './helpers/getRootLabelVisibilityClassName';
13
+ import styles from './Button.module.scss';
14
+ import type { ButtonProps } from './Button.types';
15
+
16
+ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(({
17
+ afterLabel,
18
+ beforeLabel,
19
+ block = false,
20
+ disabled = false,
21
+ endCorner,
22
+ feedbackIcon,
23
+ id,
24
+ label,
25
+ labelVisibility = 'xs',
26
+ priority = 'filled',
27
+ size = 'medium',
28
+ startCorner,
29
+ color = 'primary',
30
+ type = 'button',
31
+ ...restProps
32
+ }, ref) => {
33
+ const buttonGroupContext = useContext(ButtonGroupContext);
34
+ const formLayoutContext = useContext(FormLayoutContext);
35
+ const inputGroupContext = useContext(InputGroupContext);
36
+
37
+ if (buttonGroupContext && inputGroupContext) {
38
+ throw new Error('Button cannot be placed both in `ButtonGroup` and `InputGroup`.');
39
+ }
40
+
41
+ const primaryContext = buttonGroupContext ?? inputGroupContext;
42
+
43
+ return (
44
+ /* No worries, `type` is always assigned correctly through props. */
45
+ /* eslint-disable react/button-has-type */
46
+ <button
47
+ {...transferProps(restProps)}
48
+ className={classNames(
49
+ styles.root,
50
+ getRootPriorityClassName(
51
+ styles,
52
+ resolveContextOrProp(buttonGroupContext && buttonGroupContext.priority, priority),
53
+ ),
54
+ getRootColorClassName(styles, color),
55
+ getRootSizeClassName(
56
+ styles,
57
+ resolveContextOrProp(primaryContext && primaryContext.size, size),
58
+ ),
59
+ getRootLabelVisibilityClassName(styles, labelVisibility),
60
+ resolveContextOrProp(buttonGroupContext && buttonGroupContext.block, block) && styles.isRootBlock,
61
+ buttonGroupContext && styles.isRootInButtonGroup,
62
+ inputGroupContext && styles.isRootInInputGroup,
63
+ formLayoutContext && styles.isRootInFormLayout,
64
+ formLayoutContext && formLayoutContext.layout === 'horizontal' && styles.isRootLayoutHorizontal,
65
+ feedbackIcon && styles.hasRootFeedback,
66
+ )}
67
+ disabled={resolveContextOrProp(primaryContext && primaryContext.disabled, disabled) || !!feedbackIcon}
68
+ id={id}
69
+ ref={ref}
70
+ type={type}
71
+ >
72
+ {startCorner && (
73
+ <span className={styles.startCorner}>
74
+ {startCorner}
75
+ </span>
76
+ )}
77
+ {beforeLabel && (
78
+ <span className={styles.beforeLabel}>
79
+ {beforeLabel}
80
+ </span>
81
+ )}
82
+ <span
83
+ className={styles.label}
84
+ {...(id && { id: `${id}__labelText` })}
85
+ >
86
+ {label}
87
+ </span>
88
+ {afterLabel && (
89
+ <span className={styles.afterLabel}>
90
+ {afterLabel}
91
+ </span>
92
+ )}
93
+ {endCorner && (
94
+ <span className={styles.endCorner}>
95
+ {endCorner}
96
+ </span>
97
+ )}
98
+ {feedbackIcon && (
99
+ <span className={styles.feedbackIcon}>
100
+ {feedbackIcon}
101
+ </span>
102
+ )}
103
+ </button>
104
+ /* eslint-enable react/button-has-type */
105
+ );
106
+ });
107
+
108
+ export const ButtonWithGlobalProps = withGlobalProps<ButtonProps, HTMLButtonElement>(Button, 'Button');
109
+
110
+ export default ButtonWithGlobalProps;
@@ -0,0 +1,93 @@
1
+ import type {
2
+ ButtonHTMLAttributes,
3
+ ReactNode,
4
+ } from 'react';
5
+ import type {
6
+ Breakpoint,
7
+ Color,
8
+ Priority,
9
+ Size,
10
+ } from '../../types';
11
+
12
+ export type ButtonLabelVisibility = Breakpoint | 'none';
13
+
14
+ export type ButtonType = 'button' | 'submit';
15
+
16
+ /**
17
+ * Props of the `Button` component.
18
+ */
19
+ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'type'> & {
20
+ /**
21
+ * Element to be displayed after label, eg. an icon.
22
+ */
23
+ afterLabel?: ReactNode;
24
+ /**
25
+ * Element to be displayed before label, eg. an icon.
26
+ */
27
+ beforeLabel?: ReactNode;
28
+ /**
29
+ * If `true`, the button will span the full width of its parent.
30
+ *
31
+ * Ignored if the component is rendered within `ButtonGroup` component
32
+ * as the value is inherited in such case.
33
+ */
34
+ block?: boolean;
35
+ /**
36
+ * Color variant to clarify importance and meaning of the alert. Implements
37
+ * [Action, Feedback and Neutral color collections](/docs/foundation/collections#colors).
38
+ */
39
+ color?: Color;
40
+ /**
41
+ * If `true`, the button will be disabled.
42
+ *
43
+ * Ignored if the component is rendered within `ButtonGroup` component
44
+ * as the value is inherited in such case.
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Element to be displayed in the top right corner.
49
+ */
50
+ endCorner?: ReactNode;
51
+ /**
52
+ * Element to be displayed as a feedback icon on top of button label. When defined, it implies the
53
+ * button is in feedback state.
54
+ */
55
+ feedbackIcon?: ReactNode;
56
+ /**
57
+ * ID of the root HTML element.
58
+ *
59
+ * Also serves as base for ids of nested elements:
60
+ * * `<ID>__labelText`
61
+ */
62
+ id?: string;
63
+ /**
64
+ * Button label.
65
+ */
66
+ label: string;
67
+ /**
68
+ * Defines minimum breakpoint from which the button label will be visible.
69
+ */
70
+ labelVisibility?: ButtonLabelVisibility;
71
+ /**
72
+ * Visual priority to highlight or suppress the button.
73
+ *
74
+ * Ignored if the component is rendered within `ButtonGroup` component
75
+ * as the value is inherited in such case.
76
+ */
77
+ priority?: Priority;
78
+ /**
79
+ * Size of the button.
80
+ *
81
+ * Ignored if the component is rendered within `ButtonGroup` or `InputGroup` component as the value is inherited in
82
+ * such case.
83
+ */
84
+ size?: Size;
85
+ /**
86
+ * Element to be displayed in the top left corner.
87
+ */
88
+ startCorner?: ReactNode;
89
+ /**
90
+ * Set the HTML `type` attribute of the `button` element.
91
+ */
92
+ type?: ButtonType;
93
+ };
@@ -407,7 +407,7 @@ If you provide [ref], it is forwarded to the native HTML `<button>` element.
407
407
 
408
408
  ## API
409
409
 
410
- <docoff-react-props src="/components/Button/Button.jsx"></docoff-react-props>
410
+ <docoff-react-props src="/components/Button/Button.tsx" name="Button"></docoff-react-props>
411
411
 
412
412
  ## Theming
413
413
 
@@ -1,4 +1,7 @@
1
- export default (labelVisibility, styles) => {
1
+ import type { CssModuleClasses } from '../../../types';
2
+ import type { ButtonLabelVisibility } from '../Button.types';
3
+
4
+ export default (styles: CssModuleClasses, labelVisibility?: ButtonLabelVisibility) => {
2
5
  // Intentionally omitting `xs` which means label is visible on all screen sizes.
3
6
 
4
7
  if (labelVisibility === 'sm') {
@@ -0,0 +1,6 @@
1
+ export { default as Button } from './Button';
2
+ export type {
3
+ ButtonLabelVisibility,
4
+ ButtonProps,
5
+ ButtonType,
6
+ } from './Button.types';