@react-ui-org/react-ui 0.52.1 → 0.53.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 (260) hide show
  1. package/CODEOWNERS +23 -0
  2. package/README.md +10 -7
  3. package/dist/react-ui.css +5 -3
  4. package/dist/react-ui.js +1 -1
  5. package/package.json +64 -77
  6. package/src/{lib/components → components}/Alert/Alert.jsx +1 -1
  7. package/src/{lib/components/Alert/README.mdx → components/Alert/README.md} +84 -100
  8. package/src/{lib/components → components}/Badge/Badge.jsx +1 -1
  9. package/src/{lib/components → components}/Badge/Badge.scss +1 -1
  10. package/src/components/Badge/README.md +103 -0
  11. package/src/{lib/components → components}/Button/Button.jsx +1 -1
  12. package/src/components/Button/README.md +580 -0
  13. package/src/{lib/components → components}/ButtonGroup/ButtonGroup.jsx +11 -9
  14. package/src/{lib/components/ButtonGroup/README.mdx → components/ButtonGroup/README.md} +128 -134
  15. package/src/{lib/components → components}/Card/Card.jsx +1 -1
  16. package/src/components/Card/README.md +314 -0
  17. package/src/{lib/components/CheckboxField/README.mdx → components/CheckboxField/README.md} +96 -108
  18. package/src/{lib/components/FileInputField/README.mdx → components/FileInputField/README.md} +83 -95
  19. package/src/{lib/components → components}/FormLayout/FormLayout.jsx +4 -4
  20. package/src/components/FormLayout/README.md +462 -0
  21. package/src/{lib/components → components}/Grid/Grid.jsx +2 -2
  22. package/src/components/Grid/README.md +281 -0
  23. package/src/{lib/components → components}/InputGroup/InputGroup.jsx +20 -19
  24. package/src/{lib/components → components}/InputGroup/InputGroup.scss +0 -5
  25. package/src/{lib/components/InputGroup/README.mdx → components/InputGroup/README.md} +145 -163
  26. package/src/{lib/components → components}/Modal/Modal.jsx +6 -6
  27. package/src/components/Modal/README.md +1090 -0
  28. package/src/components/Modal/_hooks/useModalScrollPrevention.js +37 -0
  29. package/src/{lib/components/Paper/README.mdx → components/Paper/README.md} +18 -30
  30. package/src/{lib/components/Popover/README.mdx → components/Popover/README.md} +102 -132
  31. package/src/{lib/components/Radio/README.mdx → components/Radio/README.md} +122 -134
  32. package/src/{lib/components → components}/Radio/Radio.jsx +11 -12
  33. package/src/{lib/components → components}/Radio/Radio.scss +0 -5
  34. package/src/components/ScrollView/README.md +503 -0
  35. package/src/{lib/components → components}/ScrollView/ScrollView.jsx +12 -3
  36. package/src/components/SelectField/README.md +681 -0
  37. package/src/components/Table/README.md +259 -0
  38. package/src/{lib/components → components}/Table/Table.jsx +4 -1
  39. package/src/{lib/components → components}/Table/_components/TableHeaderCell/TableHeaderCell.jsx +1 -1
  40. package/src/{lib/components/Tabs/README.mdx → components/Tabs/README.md} +117 -134
  41. package/src/{lib/components → components}/Tabs/TabsItem.jsx +3 -3
  42. package/src/components/Text/README.md +220 -0
  43. package/src/components/TextArea/README.md +359 -0
  44. package/src/{lib/components/TextField/README.mdx → components/TextField/README.md} +336 -342
  45. package/src/{lib/components/TextLink/README.mdx → components/TextLink/README.md} +19 -31
  46. package/src/{lib/components/Toggle/README.mdx → components/Toggle/README.md} +98 -110
  47. package/src/components/Toolbar/README.md +359 -0
  48. package/src/{lib/components → components}/Toolbar/_helpers/getAlignClassName.js +12 -4
  49. package/src/components/_helpers/getRootPriorityClassName.js +15 -0
  50. package/src/{lib/index.js → index.js} +6 -0
  51. package/src/{lib/provider → provider}/RUIProvider.jsx +17 -11
  52. package/src/{lib/styles → styles}/tools/_caret.scss +1 -1
  53. package/src/{lib/styles → styles}/tools/form-fields/_box-field-elements.scss +1 -1
  54. package/src/{lib/styles → styles}/tools/form-fields/_inline-field-elements.scss +2 -2
  55. package/src/{lib/theme.scss → theme.scss} +4 -3
  56. package/CONTRIBUTING.md +0 -137
  57. package/dist/lib.development.js +0 -3179
  58. package/dist/lib.js +0 -1
  59. package/public/racom.svg +0 -11
  60. package/src/lib/components/Badge/README.mdx +0 -126
  61. package/src/lib/components/Button/README.mdx +0 -581
  62. package/src/lib/components/Card/README.mdx +0 -326
  63. package/src/lib/components/FormLayout/README.mdx +0 -501
  64. package/src/lib/components/Grid/README.mdx +0 -299
  65. package/src/lib/components/Modal/README.mdx +0 -1360
  66. package/src/lib/components/Modal/_hooks/useModalScrollPrevention.js +0 -35
  67. package/src/lib/components/ScrollView/README.mdx +0 -521
  68. package/src/lib/components/SelectField/README.mdx +0 -693
  69. package/src/lib/components/Table/README.mdx +0 -275
  70. package/src/lib/components/Text/README.mdx +0 -241
  71. package/src/lib/components/TextArea/README.mdx +0 -366
  72. package/src/lib/components/Toolbar/README.mdx +0 -386
  73. package/src/{lib/components → components}/Alert/Alert.scss +0 -0
  74. package/src/{lib/components → components}/Alert/_settings.scss +0 -0
  75. package/src/{lib/components → components}/Alert/_theme.scss +0 -0
  76. package/src/{lib/components → components}/Alert/_tools.scss +0 -0
  77. package/src/{lib/components → components}/Alert/index.js +0 -0
  78. package/src/{lib/components → components}/Badge/index.js +0 -0
  79. package/src/{lib/components → components}/Button/Button.scss +0 -0
  80. package/src/{lib/components → components}/Button/_base.scss +0 -0
  81. package/src/{lib/components → components}/Button/_priorities.scss +0 -0
  82. package/src/{lib/components → components}/Button/_settings.scss +0 -0
  83. package/src/{lib/components → components}/Button/_theme.scss +0 -0
  84. package/src/{lib/components → components}/Button/_tools.scss +0 -0
  85. package/src/{lib/components → components}/Button/helpers/getRootLabelVisibilityClassName.js +0 -0
  86. package/src/{lib/components/_helpers → components/Button/helpers}/getRootPriorityClassName.js +0 -0
  87. package/src/{lib/components → components}/Button/index.js +0 -0
  88. package/src/{lib/components → components}/ButtonGroup/ButtonGroup.scss +0 -0
  89. package/src/{lib/components → components}/ButtonGroup/ButtonGroupContext.js +0 -0
  90. package/src/{lib/components → components}/ButtonGroup/_theme.scss +0 -0
  91. package/src/{lib/components → components}/ButtonGroup/index.js +0 -0
  92. package/src/{lib/components → components}/Card/Card.scss +0 -0
  93. package/src/{lib/components → components}/Card/CardBody.jsx +0 -0
  94. package/src/{lib/components → components}/Card/CardFooter.jsx +0 -0
  95. package/src/{lib/components → components}/Card/_theme.scss +0 -0
  96. package/src/{lib/components → components}/Card/_tools.scss +0 -0
  97. package/src/{lib/components → components}/Card/index.js +0 -0
  98. package/src/{lib/components → components}/CheckboxField/CheckboxField.jsx +0 -0
  99. package/src/{lib/components → components}/CheckboxField/CheckboxField.scss +0 -0
  100. package/src/{lib/components → components}/CheckboxField/index.js +0 -0
  101. package/src/{lib/components → components}/FileInputField/FileInputField.jsx +0 -0
  102. package/src/{lib/components → components}/FileInputField/FileInputField.scss +0 -0
  103. package/src/{lib/components → components}/FileInputField/index.js +0 -0
  104. package/src/{lib/components → components}/FormLayout/FormLayout.scss +0 -0
  105. package/src/{lib/components → components}/FormLayout/FormLayoutContext.js +0 -0
  106. package/src/{lib/components → components}/FormLayout/FormLayoutCustomField.jsx +4 -4
  107. package/src/{lib/components → components}/FormLayout/FormLayoutCustomField.scss +0 -0
  108. package/src/{lib/components → components}/FormLayout/_theme.scss +0 -0
  109. package/src/{lib/components → components}/FormLayout/index.js +0 -0
  110. package/src/{lib/components → components}/Grid/Grid.scss +0 -0
  111. package/src/{lib/components → components}/Grid/GridSpan.jsx +0 -0
  112. package/src/{lib/components → components}/Grid/_helpers/generateResponsiveCustomProperties.js +0 -0
  113. package/src/{lib/components → components}/Grid/_settings.scss +0 -0
  114. package/src/{lib/components → components}/Grid/_tools.scss +0 -0
  115. package/src/{lib/components → components}/Grid/index.js +0 -0
  116. package/src/{lib/components → components}/InputGroup/InputGroupContext.js +0 -0
  117. package/src/{lib/components → components}/InputGroup/_theme.scss +0 -0
  118. package/src/{lib/components → components}/InputGroup/index.js +0 -0
  119. package/src/{lib/components → components}/Modal/Modal.scss +0 -0
  120. package/src/{lib/components → components}/Modal/ModalBody.jsx +0 -0
  121. package/src/{lib/components → components}/Modal/ModalBody.scss +0 -0
  122. package/src/{lib/components → components}/Modal/ModalCloseButton.jsx +1 -1
  123. package/src/{lib/components → components}/Modal/ModalCloseButton.scss +0 -0
  124. package/src/{lib/components → components}/Modal/ModalContent.jsx +0 -0
  125. package/src/{lib/components → components}/Modal/ModalContent.scss +0 -0
  126. package/src/{lib/components → components}/Modal/ModalFooter.jsx +0 -0
  127. package/src/{lib/components → components}/Modal/ModalFooter.scss +0 -0
  128. package/src/{lib/components → components}/Modal/ModalHeader.jsx +0 -0
  129. package/src/{lib/components → components}/Modal/ModalHeader.scss +0 -0
  130. package/src/{lib/components → components}/Modal/ModalTitle.jsx +0 -0
  131. package/src/{lib/components → components}/Modal/ModalTitle.scss +0 -0
  132. package/src/{lib/components → components}/Modal/_helpers/getJustifyClassName.js +0 -0
  133. package/src/{lib/components → components}/Modal/_helpers/getPositionClassName.js +0 -0
  134. package/src/{lib/components → components}/Modal/_helpers/getScrollingClassName.js +0 -0
  135. package/src/{lib/components → components}/Modal/_helpers/getSizeClassName.js +0 -0
  136. package/src/{lib/components → components}/Modal/_hooks/useModalFocus.js +0 -0
  137. package/src/{lib/components → components}/Modal/_settings.scss +0 -0
  138. package/src/{lib/components → components}/Modal/_theme.scss +0 -0
  139. package/src/{lib/components → components}/Modal/index.js +0 -0
  140. package/src/{lib/components → components}/Paper/Paper.jsx +0 -0
  141. package/src/{lib/components → components}/Paper/Paper.scss +0 -0
  142. package/src/{lib/components → components}/Paper/_theme.scss +0 -0
  143. package/src/{lib/components → components}/Paper/index.js +0 -0
  144. package/src/{lib/components → components}/Popover/Popover.jsx +0 -0
  145. package/src/{lib/components → components}/Popover/Popover.scss +0 -0
  146. package/src/{lib/components → components}/Popover/PopoverWrapper.jsx +0 -0
  147. package/src/{lib/components → components}/Popover/PopoverWrapper.scss +0 -0
  148. package/src/{lib/components → components}/Popover/_helpers/getRootAlignmentClassName.js +0 -0
  149. package/src/{lib/components → components}/Popover/_helpers/getRootSideClassName.js +0 -0
  150. package/src/{lib/components → components}/Popover/_theme.scss +0 -0
  151. package/src/{lib/components → components}/Popover/index.js +0 -0
  152. package/src/{lib/components → components}/Radio/index.js +0 -0
  153. package/src/{lib/components → components}/ScrollView/ScrollView.scss +0 -0
  154. package/src/{lib/components → components}/ScrollView/_helpers/getElementsPositionDifference.js +0 -0
  155. package/src/{lib/components → components}/ScrollView/_hooks/useLoadResizeHook.js +0 -0
  156. package/src/{lib/components → components}/ScrollView/_hooks/useScrollPositionHook.js +0 -0
  157. package/src/{lib/components → components}/ScrollView/index.js +0 -0
  158. package/src/{lib/components → components}/SelectField/SelectField.jsx +0 -0
  159. package/src/{lib/components → components}/SelectField/SelectField.scss +0 -0
  160. package/src/{lib/components → components}/SelectField/_components/Option/Option.jsx +0 -0
  161. package/src/{lib/components → components}/SelectField/_components/Option/index.js +0 -0
  162. package/src/{lib/components → components}/SelectField/index.js +0 -0
  163. package/src/{lib/components → components}/Table/Table.scss +0 -0
  164. package/src/{lib/components → components}/Table/_components/TableBodyCell/TableBodyCell.jsx +0 -0
  165. package/src/{lib/components → components}/Table/_components/TableBodyCell/index.js +0 -0
  166. package/src/{lib/components → components}/Table/_components/TableCell.scss +0 -0
  167. package/src/{lib/components → components}/Table/_components/TableHeaderCell/index.js +0 -0
  168. package/src/{lib/components → components}/Table/_settings.scss +0 -0
  169. package/src/{lib/components → components}/Table/index.js +0 -0
  170. package/src/{lib/components → components}/Tabs/Tabs.jsx +0 -0
  171. package/src/{lib/components → components}/Tabs/Tabs.scss +0 -0
  172. package/src/{lib/components → components}/Tabs/TabsItem.scss +0 -0
  173. package/src/{lib/components → components}/Tabs/_theme.scss +0 -0
  174. package/src/{lib/components → components}/Tabs/index.js +0 -0
  175. package/src/{lib/components → components}/Text/Text.jsx +0 -0
  176. package/src/{lib/components → components}/Text/Text.scss +0 -0
  177. package/src/{lib/components → components}/Text/_helpers/getRootClampClassName.js +0 -0
  178. package/src/{lib/components → components}/Text/_helpers/getRootHyphensClassName.js +0 -0
  179. package/src/{lib/components → components}/Text/_helpers/getRootWordWrappingClassName.js +0 -0
  180. package/src/{lib/components → components}/Text/index.js +0 -0
  181. package/src/{lib/components → components}/TextArea/TextArea.jsx +0 -0
  182. package/src/{lib/components → components}/TextArea/TextArea.scss +0 -0
  183. package/src/{lib/components → components}/TextArea/index.js +0 -0
  184. package/src/{lib/components → components}/TextField/TextField.jsx +0 -0
  185. package/src/{lib/components → components}/TextField/TextField.scss +0 -0
  186. package/src/{lib/components → components}/TextField/index.js +0 -0
  187. package/src/{lib/components → components}/TextLink/TextLink.jsx +1 -1
  188. /package/src/{lib/components → components}/TextLink/TextLink.scss +0 -0
  189. /package/src/{lib/components → components}/TextLink/_theme.scss +0 -0
  190. /package/src/{lib/components → components}/TextLink/index.js +0 -0
  191. /package/src/{lib/components → components}/Toggle/Toggle.jsx +0 -0
  192. /package/src/{lib/components → components}/Toggle/Toggle.scss +0 -0
  193. /package/src/{lib/components → components}/Toggle/index.js +0 -0
  194. /package/src/{lib/components → components}/Toolbar/Toolbar.jsx +0 -0
  195. /package/src/{lib/components → components}/Toolbar/Toolbar.scss +0 -0
  196. /package/src/{lib/components → components}/Toolbar/ToolbarGroup.jsx +0 -0
  197. /package/src/{lib/components → components}/Toolbar/ToolbarItem.jsx +0 -0
  198. /package/src/{lib/components → components}/Toolbar/_helpers/getJustifyClassName.js +0 -0
  199. /package/src/{lib/components → components}/Toolbar/_theme.scss +0 -0
  200. /package/src/{lib/components → components}/Toolbar/index.js +0 -0
  201. /package/src/{lib/components → components}/_helpers/getRootColorClassName.js +0 -0
  202. /package/src/{lib/components → components}/_helpers/getRootSizeClassName.js +0 -0
  203. /package/src/{lib/components → components}/_helpers/getRootValidationStateClassName.js +0 -0
  204. /package/src/{lib/components → components}/_helpers/isChildrenEmpty.js +0 -0
  205. /package/src/{lib/components → components}/_helpers/resolveContextOrProp.js +0 -0
  206. /package/src/{lib/components → components}/_helpers/transferProps.js +0 -0
  207. /package/src/{lib/foundation.scss → foundation.scss} +0 -0
  208. /package/src/{lib/helpers.scss → helpers.scss} +0 -0
  209. /package/src/{lib/provider → provider}/RUIContext.jsx +0 -0
  210. /package/src/{lib/provider → provider}/index.js +0 -0
  211. /package/src/{lib/provider → provider}/withGlobalProps.jsx +0 -0
  212. /package/src/{lib/styles → styles}/_utilities.scss +0 -0
  213. /package/src/{lib/styles → styles}/elements/_code.scss +0 -0
  214. /package/src/{lib/styles → styles}/elements/_links.scss +0 -0
  215. /package/src/{lib/styles → styles}/elements/_lists.scss +0 -0
  216. /package/src/{lib/styles → styles}/elements/_page.scss +0 -0
  217. /package/src/{lib/styles → styles}/elements/_rulers.scss +0 -0
  218. /package/src/{lib/styles → styles}/elements/_small.scss +0 -0
  219. /package/src/{lib/styles → styles}/generic/_box-sizing.scss +0 -0
  220. /package/src/{lib/styles → styles}/generic/_focus.scss +0 -0
  221. /package/src/{lib/styles → styles}/generic/_forms.scss +0 -0
  222. /package/src/{lib/styles → styles}/generic/_reset.scss +0 -0
  223. /package/src/{lib/styles → styles}/generic/_shared.scss +0 -0
  224. /package/src/{lib/styles → styles}/helpers/_animation.scss +0 -0
  225. /package/src/{lib/styles → styles}/settings/_animations.scss +0 -0
  226. /package/src/{lib/styles → styles}/settings/_breakpoints.scss +0 -0
  227. /package/src/{lib/styles → styles}/settings/_escaped-characters.scss +0 -0
  228. /package/src/{lib/styles → styles}/settings/_form-fields.scss +0 -0
  229. /package/src/{lib/styles → styles}/settings/_forms.scss +0 -0
  230. /package/src/{lib/styles → styles}/settings/_utilities.scss +0 -0
  231. /package/src/{lib/styles → styles}/settings/_z-indexes.scss +0 -0
  232. /package/src/{lib/styles → styles}/theme/_accessibility.scss +0 -0
  233. /package/src/{lib/styles → styles}/theme/_borders.scss +0 -0
  234. /package/src/{lib/styles → styles}/theme/_code.scss +0 -0
  235. /package/src/{lib/styles → styles}/theme/_form-fields.scss +0 -0
  236. /package/src/{lib/styles → styles}/theme/_links.scss +0 -0
  237. /package/src/{lib/styles → styles}/theme/_lists.scss +0 -0
  238. /package/src/{lib/styles → styles}/theme/_page.scss +0 -0
  239. /package/src/{lib/styles → styles}/theme/_spacing.scss +0 -0
  240. /package/src/{lib/styles → styles}/theme/_typography.scss +0 -0
  241. /package/src/{lib/styles → styles}/theme-constants/_breakpoints.scss +0 -0
  242. /package/src/{lib/styles → styles}/theme-constants/_colors.scss +0 -0
  243. /package/src/{lib/styles → styles}/theme-constants/_svg.scss +0 -0
  244. /package/src/{lib/styles → styles}/tools/_accessibility.scss +0 -0
  245. /package/src/{lib/styles → styles}/tools/_breakpoint.scss +0 -0
  246. /package/src/{lib/styles → styles}/tools/_colors.scss +0 -0
  247. /package/src/{lib/styles → styles}/tools/_reset.scss +0 -0
  248. /package/src/{lib/styles → styles}/tools/_scrollbar.scss +0 -0
  249. /package/src/{lib/styles → styles}/tools/_spacing.scss +0 -0
  250. /package/src/{lib/styles → styles}/tools/_string.scss +0 -0
  251. /package/src/{lib/styles → styles}/tools/_svg.scss +0 -0
  252. /package/src/{lib/styles → styles}/tools/_transition.scss +0 -0
  253. /package/src/{lib/styles → styles}/tools/_utilities.scss +0 -0
  254. /package/src/{lib/styles → styles}/tools/form-fields/_box-field-layout.scss +0 -0
  255. /package/src/{lib/styles → styles}/tools/form-fields/_box-field-sizes.scss +0 -0
  256. /package/src/{lib/styles → styles}/tools/form-fields/_foundation.scss +0 -0
  257. /package/src/{lib/styles → styles}/tools/form-fields/_inline-field-layout.scss +0 -0
  258. /package/src/{lib/styles → styles}/tools/form-fields/_variants.scss +0 -0
  259. /package/src/{lib/translations → translations}/en.js +0 -0
  260. /package/src/{lib/utils → utils}/classNames.js +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.52.1",
4
+ "version": "0.53.0",
5
5
  "keywords": [
6
6
  "react",
7
7
  "ui",
@@ -23,95 +23,82 @@
23
23
  "bugs": {
24
24
  "url": "https://github.com/react-ui-org/react-ui/issues"
25
25
  },
26
- "main": "dist/lib.js",
26
+ "main": "dist/react-ui.js",
27
27
  "repository": {
28
28
  "type": "git",
29
29
  "url": "https://github.com/react-ui-org/react-ui"
30
30
  },
31
31
  "engines": {
32
- "node": ">=16.14.0 <17",
33
- "npm": ">=8.3.0"
32
+ "node": ">=18",
33
+ "npm": ">=9"
34
+ },
35
+ "scripts": {
36
+ "build": "webpack --mode=production",
37
+ "copy": "cp \"src/docs/_assets/generated/react-ui.css\" dist & cp \"src/docs/_assets/generated/react-ui.js\" dist",
38
+ "eslint": "eslint --ext js,jsx src",
39
+ "jest": "jest src --coverage",
40
+ "lint": "npm run eslint && npm run markdownlint && npm run stylelint",
41
+ "markdownlint": "markdownlint-cli2 \"CONTRIBUTING.md\" \"README.md\" \"RELEASING.md\" \"src/**/*.md\"",
42
+ "postbuild": "npm run copy",
43
+ "precopy": "rm -rf dist && mkdir dist",
44
+ "prepublishOnly": "npm run build",
45
+ "start": "webpack --watch --mode=development",
46
+ "stylelint": "stylelint \"src/**/*.scss\" --config stylelint.config.js",
47
+ "test": "npm run jest"
34
48
  },
35
49
  "dependencies": {
36
50
  "normalize.css": "^8.0.1"
37
51
  },
52
+ "peerDependencies": {
53
+ "prop-types": "^15.8.0",
54
+ "react": "^18.0.0",
55
+ "react-dom": "^18.0.0"
56
+ },
38
57
  "devDependencies": {
39
- "@babel/cli": "^7.16.0",
40
- "@babel/core": "^7.16.0",
41
- "@babel/eslint-parser": "^7.16.3",
42
- "@babel/plugin-proposal-class-properties": "^7.16.0",
43
- "@babel/plugin-transform-spread": "^7.16.0",
44
- "@babel/preset-env": "^7.16.0",
45
- "@babel/preset-react": "^7.16.0",
46
- "@babel/register": "^7.16.0",
47
- "@floating-ui/react-dom": "^0.7.1",
48
- "@nejcm/docz-theme-extended": "^2.0.14",
49
- "@testing-library/jest-dom": "^5.15.0",
50
- "@testing-library/react": "^12.1.2",
51
- "@testing-library/user-event": "^13.5.0",
52
- "@visionappscz/eslint-config-visionapps": "^1.5.0",
53
- "@visionappscz/stylelint-config": "^3.0.0-rc1",
54
- "autoprefixer": "^10.4.2",
55
- "babel-core": "^7.0.0-bridge.0",
56
- "babel-jest": "^27.3.1",
57
- "babel-loader": "^8.2.3",
58
- "concurrently": "^6.4.0",
59
- "core-js": "^3.19.1",
60
- "css-loader": "^5.2.7",
61
- "docz": "^2.3.3-alpha.0",
62
- "eslint": "^7.32.0",
63
- "eslint-config-airbnb": "^19.0.0",
64
- "eslint-loader": "^4.0.2",
65
- "eslint-plugin-import": "^2.25.3",
66
- "eslint-plugin-jsx-a11y": "^6.5.1",
67
- "eslint-plugin-markdown": "^2.2.1",
68
- "eslint-plugin-mdx": "^1.16.0",
69
- "eslint-plugin-react": "^7.27.0",
70
- "eslint-plugin-react-hooks": "^4.3.0",
71
- "gatsby-plugin-sass": "^3.2.0",
58
+ "@babel/cli": "^7.22.10",
59
+ "@babel/core": "^7.22.11",
60
+ "@babel/eslint-parser": "^7.22.11",
61
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
62
+ "@babel/plugin-transform-spread": "^7.22.5",
63
+ "@babel/preset-env": "^7.22.14",
64
+ "@babel/preset-react": "^7.22.5",
65
+ "@babel/register": "^7.22.5",
66
+ "@svgr/webpack": "^8.1.0",
67
+ "@testing-library/jest-dom": "^6.1.2",
68
+ "@testing-library/react": "^14.0.0",
69
+ "@testing-library/user-event": "^14.4.3",
70
+ "@visionappscz/eslint-config-visionapps": "^1.7.0",
71
+ "@visionappscz/stylelint-config": "^3.0.0",
72
+ "autoprefixer": "^10.4.15",
73
+ "babel-jest": "^29.6.4",
74
+ "babel-loader": "^9.1.3",
75
+ "core-js": "^3.32.1",
76
+ "css-loader": "^6.8.1",
77
+ "eslint": "^8.48.0",
78
+ "eslint-config-airbnb": "^19.0.4",
79
+ "eslint-plugin-import": "^2.28.1",
80
+ "eslint-plugin-jsx-a11y": "^6.7.1",
81
+ "eslint-plugin-markdown": "^3.0.1",
82
+ "eslint-plugin-react": "^7.33.2",
83
+ "eslint-plugin-react-hooks": "^4.6.0",
72
84
  "identity-obj-proxy": "^3.0.0",
73
- "jest": "^27.3.1",
74
- "markdownlint-cli2": "~0.3.2",
75
- "nodemon": "^2.0.15",
76
- "postcss": "^8.4.5",
77
- "postcss-loader": "^4.3.0",
78
- "prism-react-renderer": "^1.2.1",
79
- "prop-types": "^15.7.2",
80
- "react": "^17.0.2",
81
- "react-dom": "^17.0.2",
82
- "rimraf": "^3.0.2",
83
- "sass": "^1.47.0",
84
- "sass-loader": "^10.2.0",
85
- "sinon": "^12.0.1",
86
- "style-loader": "^2.0.0",
87
- "stylelint": "^14.2.0",
88
- "stylelint-webpack-plugin": "^2.3.2",
89
- "webpack": "^4.46.0",
90
- "webpack-cli": "^3.3.12",
91
- "webpack-visualizer-plugin": "^0.1.11"
92
- },
93
- "peerDependencies": {
94
- "prop-types": "^15.7.2",
95
- "react": "^17.0.2",
96
- "react-dom": "^17.0.2"
85
+ "jest": "^29.6.4",
86
+ "jest-environment-jsdom": "^29.6.4",
87
+ "markdownlint-cli2": "~0.9.2",
88
+ "mini-css-extract-plugin": "^2.7.6",
89
+ "postcss": "^8.4.29",
90
+ "postcss-loader": "^7.3.3",
91
+ "prop-types": "^15.8.1",
92
+ "sass": "^1.66.1",
93
+ "sass-loader": "^13.3.2",
94
+ "stylelint": "^14.16.1",
95
+ "stylelint-webpack-plugin": "^4.1.1",
96
+ "terser-webpack-plugin": "^5.3.9",
97
+ "webpack": "^5.69.1",
98
+ "webpack-cli": "^5.1.4",
99
+ "webpack-visualizer-plugin2": "^1.0.0"
97
100
  },
98
101
  "resolutions": {
99
102
  "@babel/plugin-transform-spread": "7.12.1"
100
- },
101
- "scripts": {
102
- "build": "concurrently \"npm run lib:build\" \"npm run docs:build\"",
103
- "docs:build": "rimraf .docz docs && docz build --dest docs",
104
- "docs:dev": "rimraf .docz && docz dev",
105
- "docs:serve": "rimraf .docz && npm run docs:build && docz serve",
106
- "lib:build": "concurrently \"webpack --mode development --config webpack.config.js\" \"webpack --mode production --config webpack.config.js\"",
107
- "lib:jest": "jest",
108
- "lib:test:js": "concurrently \"eslint --ext js,jsx src/lib tests/propTests\" \"npm run lib:jest\"",
109
- "lib:test:css": "stylelint \"src/**/*.scss\" --config stylelint.config.js",
110
- "markdown:lint": "markdownlint-cli2 \"**/*.md?(x)\" \"#.docz\" \"#dist\" \"#node_modules\" && eslint \"**/*.md?(x)\"",
111
- "markdown:watch": "nodemon --watch . --ext md,mdx --exec \"npm run markdown:lint\"",
112
- "prepublishOnly": "npm run lib:build",
113
- "start": "concurrently --kill-others \"npm run watch\" \"npm run docs:dev\"",
114
- "test": "concurrently \"npm run markdown:lint\" \"npm run lib:test:js\" \"npm run lib:test:css\"",
115
- "watch": "npm run markdown:watch"
116
103
  }
117
104
  }
@@ -70,7 +70,7 @@ Alert.propTypes = {
70
70
  */
71
71
  children: PropTypes.node.isRequired,
72
72
  /**
73
- * [Color variant](/foundation/colors#component-colors) to clarify importance and meaning of the alert.
73
+ * [Color variant](/docs/foundation/colors#component-colors) to clarify importance and meaning of the alert.
74
74
  */
75
75
  color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark']),
76
76
  /**
@@ -1,22 +1,5 @@
1
- ---
2
- name: Alert
3
- menu: 'Miscellaneous'
4
- route: /components/alert
5
- ---
6
-
7
1
  # Alert
8
2
 
9
- import {
10
- Playground,
11
- Props,
12
- } from 'docz'
13
- import Icon from '../../../docs/_components/Icon'
14
- import Placeholder from '../../../docs/_components/Placeholder'
15
- import {
16
- Button,
17
- Alert,
18
- } from '../..'
19
-
20
3
  Alert presents feedback or important information to users.
21
4
 
22
5
  ## Basic Usage
@@ -29,11 +12,11 @@ import { Alert } from '@react-ui-org/react-ui';
29
12
 
30
13
  And use it:
31
14
 
32
- <Playground>
33
- <Alert>
34
- <strong>Hello!</strong> This is an alert.
35
- </Alert>
36
- </Playground>
15
+ ```docoff-react-preview
16
+ <Alert>
17
+ <strong>Hello!</strong> This is an alert.
18
+ </Alert>
19
+ ```
37
20
 
38
21
  See [API](#api) for all available options.
39
22
 
@@ -48,31 +31,31 @@ See [API](#api) for all available options.
48
31
 
49
32
  ## Color Variants
50
33
 
51
- All [component colors](/foundation/colors#component-colors) are supported by
34
+ All [component colors](/docs/foundation/colors#component-colors) are supported by
52
35
  alert to cover all possible needs of your project.
53
36
 
54
37
  ### Success
55
38
 
56
39
  Success alerts confirm that an operation has been processed successfully.
57
40
 
58
- <Playground>
59
- <Alert color="success">
60
- <strong>Success:</strong> Settings have been successfully saved.
61
- </Alert>
62
- </Playground>
41
+ ```docoff-react-preview
42
+ <Alert color="success">
43
+ <strong>Success:</strong> Settings have been successfully saved.
44
+ </Alert>
45
+ ```
63
46
 
64
47
  ### Warning
65
48
 
66
49
  Use warning alerts when a potentially unfavourable situation may occur. You may
67
50
  suggest an action to resolve the problem.
68
51
 
69
- <Playground>
70
- <Alert color="warning">
71
- <strong>Warning:</strong> Your credit card is going to expire soon.
72
- {' '}
73
- <a href="/">Update my payment options</a>
74
- </Alert>
75
- </Playground>
52
+ ```docoff-react-preview
53
+ <Alert color="warning">
54
+ <strong>Warning:</strong> Your credit card is going to expire soon.
55
+ {' '}
56
+ <a href="/">Update my payment options</a>
57
+ </Alert>
58
+ ```
76
59
 
77
60
  ### Danger
78
61
 
@@ -80,109 +63,110 @@ Danger alerts say there is something that block users from continuing that
80
63
  requires their immediate attention. The alert should offer a solution to the
81
64
  problem.
82
65
 
83
- <Playground>
84
- <Alert color="danger">
85
- <strong>Error:</strong> Cannot connect to the server. Is your internet
86
- connection working fine?
87
- {' '}
88
- <a href="/">Try again</a>
89
- </Alert>
90
- </Playground>
66
+ ```docoff-react-preview
67
+ <Alert color="danger">
68
+ <strong>Error:</strong> Cannot connect to the server. Is your internet
69
+ connection working fine?
70
+ {' '}
71
+ <a href="/">Try again</a>
72
+ </Alert>
73
+ ```
91
74
 
92
75
  ### Help
93
76
 
94
77
  This kind of alert can be used to display helpful information.
95
78
 
96
- <Playground>
97
- <Alert color="help">
98
- <strong>Help:</strong> You should choose a password you don&apos;t use
99
- anywhere else.
100
- </Alert>
101
- </Playground>
79
+ ```docoff-react-preview
80
+ <Alert color="help">
81
+ <strong>Help:</strong> You should choose a password you don&apos;t use
82
+ anywhere else.
83
+ </Alert>
84
+ ```
102
85
 
103
86
  ### Info
104
87
 
105
88
  Another common, informative alert.
106
89
 
107
- <Playground>
108
- <Alert color="info">
109
- <strong>Info:</strong> This feature depends on user&apos;s OS preferences.
110
- </Alert>
111
- </Playground>
90
+ ```docoff-react-preview
91
+ <Alert color="info">
92
+ <strong>Info:</strong> This feature depends on user&apos;s OS preferences.
93
+ </Alert>
94
+ ```
112
95
 
113
96
  ### Note (Default)
114
97
 
115
98
  Neutral informative alert.
116
99
 
117
- <Playground>
118
- <Alert>
119
- <strong>Note:</strong> This feature may not be available in all regions.
120
- </Alert>
121
- </Playground>
100
+ ```docoff-react-preview
101
+ <Alert>
102
+ <strong>Note:</strong> This feature may not be available in all regions.
103
+ </Alert>
104
+ ```
122
105
 
123
106
  ### Light
124
107
 
125
108
  Light alert variant.
126
109
 
127
- <Playground>
128
- <Placeholder dark>
129
- <Alert color="light">
130
- <strong>Light alert:</strong> Stands out on dark backgrounds.
131
- </Alert>
132
- </Placeholder>
133
- </Playground>
110
+ ```docoff-react-preview
111
+ <docoff-placeholder dark>
112
+ <Alert color="light">
113
+ <strong>Light alert:</strong> Stands out on dark backgrounds.
114
+ </Alert>
115
+ </docoff-placeholder>
116
+ ```
134
117
 
135
118
  ### Dark
136
119
 
137
120
  Dark alert variant.
138
121
 
139
- <Playground>
140
- <Alert color="dark">
141
- <strong>Dark alert:</strong> Stands out on light backgrounds.
142
- </Alert>
143
- </Playground>
122
+ ```docoff-react-preview
123
+ <Alert color="dark">
124
+ <strong>Dark alert:</strong> Stands out on light backgrounds.
125
+ </Alert>
126
+ ```
144
127
 
145
128
  ## Alerts with Icons
146
129
 
147
130
  An icon can (and should) accompany the message.
148
131
 
149
132
  👉 Please note there are no icons pre-packed in React UI. Visit
150
- [Icons](/foundation/icons) to see how it works.
133
+ [Icons](/docs/foundation/icons) to see how it works.
151
134
 
152
- <Playground>
153
- <Alert color="success" icon={<Icon icon="success" />}>
154
- <strong>Success:</strong> Settings have been successfully saved.
155
- </Alert>
156
- </Playground>
135
+ ```docoff-react-preview
136
+ <Alert color="success" icon={<rui-icon icon="success" />}>
137
+ <strong>Success:</strong> Settings have been successfully saved.
138
+ </Alert>
139
+ ```
157
140
 
158
141
  ## Dismissible Alerts
159
142
 
160
143
  You can make an alert dismissible by providing a function that closes it on
161
144
  click on the close button:
162
145
 
163
- <Playground>
164
- {() => {
165
- const [isAlertVisible, setIsAlertVisible] = React.useState(true);
146
+ ```docoff-react-preview
147
+ React.createElement(() => {
148
+ const [isAlertVisible, setIsAlertVisible] = React.useState(true);
149
+
150
+ if (isAlertVisible) {
166
151
  return (
167
- <>
168
- {isAlertVisible ? (
169
- <Alert
170
- color="success"
171
- icon={<Icon icon="success" />}
172
- onClose={() => setIsAlertVisible(false)}
173
- >
174
- <strong>Success:</strong> Settings have been successfully saved.
175
- </Alert>
176
- ) : (
177
- <Button
178
- label="Bring the alert back!"
179
- onClick={() => setIsAlertVisible(true)}
180
- />
181
- )}
182
- </>
152
+ <Alert
153
+ color="success"
154
+ icon={<rui-icon icon="success" />}
155
+ onClose={() => setIsAlertVisible(false)}
156
+ >
157
+ <strong>Success:</strong> Settings have been successfully saved.
158
+ </Alert>
183
159
  );
184
- }}
185
- </Playground>
160
+ }
161
+
162
+ return (
163
+ <Button
164
+ label="Bring the alert back!"
165
+ onClick={() => setIsAlertVisible(true)}
166
+ />
167
+ );
168
+ });
169
+ ```
186
170
 
187
171
  ## Forwarding HTML Attributes
188
172
 
@@ -197,7 +181,7 @@ its accessibility.
197
181
 
198
182
  ## API
199
183
 
200
- <Props table of={Alert} />
184
+ <docoff-react-props src="/components/Alert/Alert.jsx" />
201
185
 
202
186
  ## Theming
203
187
 
@@ -222,7 +206,7 @@ convention looks as follows:
222
206
  Where:
223
207
 
224
208
  - `<COLOR>` is one of supported
225
- [component colors](/foundation/colors#component-colors)
209
+ [component colors](/docs/foundation/colors#component-colors)
226
210
  (see alert [color variants](#color-variants) and [API](#api)),
227
211
  - `<PROPERTY>` is one of `color` (color of text), `foreground-color` (color of
228
212
  border, icon, links, and emphasis), or `background-color`.
@@ -31,7 +31,7 @@ Badge.defaultProps = {
31
31
 
32
32
  Badge.propTypes = {
33
33
  /**
34
- * [Color variant](/foundation/colors#component-colors) to clarify importance and meaning of the badge.
34
+ * [Color variant](/docs/foundation/colors#component-colors) to clarify importance and meaning of the badge.
35
35
  */
36
36
  color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark']),
37
37
  /**
@@ -71,7 +71,7 @@ $_badge-size: 1.25rem;
71
71
 
72
72
  padding-top: 0.1875rem;
73
73
  padding-bottom: 0.1875rem;
74
- border: borders.$width solid currentColor;
74
+ border: borders.$width solid currentcolor;
75
75
  }
76
76
 
77
77
  .isRootPriorityOutline.isRootColorSuccess {
@@ -0,0 +1,103 @@
1
+ # Badge
2
+
3
+ ## Basic Usage
4
+
5
+ To implement the Badge component, you need to import it first:
6
+
7
+ ```js
8
+ import { Badge } from '@react-ui-org/react-ui';
9
+ ```
10
+
11
+ And use it:
12
+
13
+ ```docoff-react-preview
14
+ <Badge label="Hello!" />
15
+ ```
16
+
17
+ See [API](#api) for all available options.
18
+
19
+ ## General Guidelines
20
+
21
+ Use badges to highlight content with a **short and brief** additional
22
+ information: a number, a word, but no more than two words.
23
+
24
+ ## Priorities
25
+
26
+ There are two **visual priorities** of badges to choose from, from highest to
27
+ lowest:
28
+
29
+ 1. filled
30
+ 2. outline
31
+
32
+ All priorities come in supported
33
+ [component colors](/docs/foundation/colors#component-colors).
34
+
35
+ ### Filled
36
+
37
+ High-emphasis priority to draw user's attention.
38
+
39
+ ```docoff-react-preview
40
+ <Badge label="3" color="success" />
41
+ <Badge label="4" color="warning" />
42
+ <Badge label="5" color="danger" />
43
+ <Badge label="10" color="help" />
44
+ <Badge label="34" color="info" />
45
+ <Badge label="99+" />
46
+ <Badge label="365" color="light" />
47
+ <Badge label="999+" color="dark" />
48
+ ```
49
+
50
+ ```docoff-react-preview
51
+ <Badge label="Success" color="success" />
52
+ <Badge label="Warning" color="warning" />
53
+ <Badge label="Danger" color="danger" />
54
+ <Badge label="Help" color="help" />
55
+ <Badge label="Info" color="info" />
56
+ <Badge label="Note" />
57
+ <Badge label="Light" color="light" />
58
+ <Badge label="Dark" color="dark" />
59
+ ```
60
+
61
+ ### Outline
62
+
63
+ Medium-emphasis priority to provide additional context in an unobtrusive way.
64
+
65
+ ```docoff-react-preview
66
+ <Badge priority="outline" label="3" color="success" />
67
+ <Badge priority="outline" label="4" color="warning" />
68
+ <Badge priority="outline" label="5" color="danger" />
69
+ <Badge priority="outline" label="10" color="help" />
70
+ <Badge priority="outline" label="34" color="info" />
71
+ <Badge priority="outline" label="99+" />
72
+ <Badge priority="outline" label="365" color="light" />
73
+ <Badge priority="outline" label="999+" color="dark" />
74
+ ```
75
+
76
+ ```docoff-react-preview
77
+ <Badge priority="outline" label="Success" color="success" />
78
+ <Badge priority="outline" label="Warning" color="warning" />
79
+ <Badge priority="outline" label="Danger" color="danger" />
80
+ <Badge priority="outline" label="Help" color="help" />
81
+ <Badge priority="outline" label="Info" color="info" />
82
+ <Badge priority="outline" label="Note" />
83
+ <Badge priority="outline" label="Light" color="light" />
84
+ <Badge priority="outline" label="Dark" color="dark" />
85
+ ```
86
+
87
+ ## Forwarding HTML Attributes
88
+
89
+ In addition to the options below in the [component's API](#api) section, you
90
+ can specify [React synthetic events] or **any HTML attribute you like.** All
91
+ attributes that don't interfere with the API are forwarded to the root `<div>`
92
+ HTML element. This enables making the component interactive and helps to improve
93
+ its accessibility.
94
+
95
+ 👉 Refer to the MDN reference for the full list of supported attributes of the
96
+ [div] element.
97
+
98
+ ## API
99
+
100
+ <docoff-react-props src="/components/Badge/Badge.jsx" />
101
+
102
+ [React synthetic events]: https://reactjs.org/docs/events.html
103
+ [div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
@@ -133,7 +133,7 @@ Button.propTypes = {
133
133
  */
134
134
  block: PropTypes.bool,
135
135
  /**
136
- * [Color variant](/foundation/colors#component-colors) to clarify importance and meaning of the button.
136
+ * [Color variant](/docs/foundation/colors#component-colors) to clarify importance and meaning of the button.
137
137
  */
138
138
  color: PropTypes.oneOf(
139
139
  ['primary', 'secondary', 'selected', 'success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark'],