@onewelcome/react-lib-components 0.2.1 → 0.2.4

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 (284) hide show
  1. package/dist/Breadcrumbs/Breadcrumbs.d.ts +4 -4
  2. package/dist/Button/BaseButton.d.ts +4 -4
  3. package/dist/Button/Button.d.ts +3 -3
  4. package/dist/Button/IconButton.d.ts +4 -4
  5. package/dist/ContextMenu/ContextMenu.d.ts +5 -5
  6. package/dist/ContextMenu/ContextMenuItem.d.ts +2 -2
  7. package/dist/DataGrid/DataGrid.d.ts +6 -6
  8. package/dist/DataGrid/DataGridActions/DataGridActions.d.ts +4 -4
  9. package/dist/DataGrid/DataGridActions/DataGridColumnsToggle.d.ts +3 -3
  10. package/dist/DataGrid/DataGridBody/DataGridBody.d.ts +3 -3
  11. package/dist/DataGrid/DataGridBody/DataGridCell.d.ts +2 -2
  12. package/dist/DataGrid/DataGridBody/DataGridRow.d.ts +3 -3
  13. package/dist/DataGrid/DataGridHeader/DataGridHeader.d.ts +3 -3
  14. package/dist/DataGrid/DataGridHeader/DataGridHeaderCell.d.ts +3 -3
  15. package/dist/DataGrid/datagrid.interfaces.d.ts +1 -1
  16. package/dist/Form/Checkbox/Checkbox.d.ts +5 -5
  17. package/dist/Form/Fieldset/Fieldset.d.ts +3 -3
  18. package/dist/Form/Form.d.ts +1 -1
  19. package/dist/Form/FormControl/FormControl.d.ts +3 -3
  20. package/dist/Form/FormGroup/FormGroup.d.ts +5 -5
  21. package/dist/Form/FormHelperText/FormHelperText.d.ts +3 -3
  22. package/dist/Form/FormSelectorWrapper/FormSelectorWrapper.d.ts +6 -6
  23. package/dist/Form/Input/Input.d.ts +5 -5
  24. package/dist/Form/Label/Label.d.ts +2 -2
  25. package/dist/Form/Radio/Radio.d.ts +5 -5
  26. package/dist/Form/Select/Option.d.ts +2 -2
  27. package/dist/Form/Select/Select.d.ts +5 -5
  28. package/dist/Form/Textarea/Textarea.d.ts +6 -6
  29. package/dist/Form/Toggle/Toggle.d.ts +3 -3
  30. package/dist/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.d.ts +4 -4
  31. package/dist/Form/Wrapper/InputWrapper/InputWrapper.d.ts +4 -4
  32. package/dist/Form/Wrapper/RadioWrapper/RadioWrapper.d.ts +4 -4
  33. package/dist/Form/Wrapper/SelectWrapper/SelectWrapper.d.ts +4 -4
  34. package/dist/Form/Wrapper/TextareaWrapper/TextareaWrapper.d.ts +4 -4
  35. package/dist/Form/Wrapper/Wrapper/Wrapper.d.ts +6 -6
  36. package/dist/Form/form.interfaces.d.ts +2 -2
  37. package/dist/Icon/Icon.d.ts +3 -3
  38. package/dist/Link/Link.d.ts +7 -7
  39. package/dist/Notifications/BaseModal/BaseModal.d.ts +4 -4
  40. package/dist/Notifications/BaseModal/BaseModalActions/BaseModalActions.d.ts +2 -2
  41. package/dist/Notifications/BaseModal/BaseModalContent/BaseModalContent.d.ts +2 -2
  42. package/dist/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.d.ts +2 -2
  43. package/dist/Notifications/Dialog/Dialog.d.ts +5 -5
  44. package/dist/Notifications/Dialog/DialogActions/DialogActions.d.ts +3 -3
  45. package/dist/Notifications/Dialog/DialogTitle/DialogTitle.d.ts +2 -2
  46. package/dist/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.d.ts +3 -3
  47. package/dist/Notifications/DiscardChangesModal/DiscardChangesModal.d.ts +7 -7
  48. package/dist/Notifications/Modal/Modal.d.ts +1 -1
  49. package/dist/Notifications/Modal/ModalActions/ModalActions.d.ts +1 -1
  50. package/dist/Notifications/Modal/ModalContent/ModalContent.d.ts +1 -1
  51. package/dist/Notifications/Modal/ModalHeader/ModalHeader.d.ts +1 -1
  52. package/dist/Notifications/SlideInModal/SlideInModal.d.ts +3 -3
  53. package/dist/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +3 -3
  54. package/dist/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +2 -2
  55. package/dist/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +3 -3
  56. package/dist/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +2 -2
  57. package/dist/Notifications/Snackbar/interfaces.d.ts +2 -2
  58. package/dist/Pagination/Pagination.d.ts +3 -3
  59. package/dist/Popover/Popover.d.ts +3 -3
  60. package/dist/Skeleton/Skeleton.d.ts +3 -3
  61. package/dist/StatusIndicator/StatusIndicator.d.ts +5 -5
  62. package/dist/Tabs/Tab.d.ts +1 -1
  63. package/dist/Tabs/TabButton.d.ts +2 -2
  64. package/dist/Tabs/TabPanel.d.ts +2 -2
  65. package/dist/Tabs/Tabs.d.ts +4 -4
  66. package/dist/TextEllipsis/TextEllipsis.d.ts +2 -2
  67. package/dist/Tiles/Tile.d.ts +5 -5
  68. package/dist/Tiles/Tiles.d.ts +2 -2
  69. package/dist/Tooltip/Tooltip.d.ts +3 -3
  70. package/dist/Typography/Typography.d.ts +3 -3
  71. package/dist/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +2 -2
  72. package/dist/Wizard/Wizard.d.ts +3 -3
  73. package/dist/Wizard/WizardActions/WizardActions.d.ts +2 -2
  74. package/dist/Wizard/WizardStateProvider.d.ts +2 -2
  75. package/dist/Wizard/WizardSteps/WizardSteps.d.ts +2 -2
  76. package/dist/Wizard/wizardStateReducer.d.ts +5 -5
  77. package/dist/_BaseStyling_/BaseStyling.d.ts +1 -1
  78. package/dist/hooks/usePosition.d.ts +5 -5
  79. package/dist/hooks/useRepeater.d.ts +1 -1
  80. package/dist/hooks/useScroll.d.ts +1 -1
  81. package/dist/hooks/useSpacing.d.ts +1 -1
  82. package/dist/hooks/useWrapper.d.ts +1 -1
  83. package/dist/index.d.ts +55 -55
  84. package/dist/interfaces.d.ts +1 -1
  85. package/dist/react-lib-components.cjs.development.js +683 -581
  86. package/dist/react-lib-components.cjs.development.js.map +1 -1
  87. package/dist/react-lib-components.cjs.production.min.js +1 -1
  88. package/dist/react-lib-components.cjs.production.min.js.map +1 -1
  89. package/dist/react-lib-components.esm.js +683 -581
  90. package/dist/react-lib-components.esm.js.map +1 -1
  91. package/package.json +27 -16
  92. package/src/Breadcrumbs/Breadcrumbs.test.tsx +15 -15
  93. package/src/Breadcrumbs/Breadcrumbs.tsx +11 -11
  94. package/src/Button/BaseButton.module.scss +1 -1
  95. package/src/Button/BaseButton.test.tsx +27 -27
  96. package/src/Button/BaseButton.tsx +8 -8
  97. package/src/Button/Button.module.scss +5 -5
  98. package/src/Button/Button.test.tsx +39 -39
  99. package/src/Button/Button.tsx +10 -10
  100. package/src/Button/IconButton.module.scss +5 -5
  101. package/src/Button/IconButton.test.tsx +29 -29
  102. package/src/Button/IconButton.tsx +11 -11
  103. package/src/ContextMenu/ContextMenu.test.tsx +97 -76
  104. package/src/ContextMenu/ContextMenu.tsx +48 -42
  105. package/src/ContextMenu/ContextMenuItem.module.scss +1 -1
  106. package/src/ContextMenu/ContextMenuItem.tsx +8 -5
  107. package/src/DataGrid/DataGrid.test.tsx +193 -193
  108. package/src/DataGrid/DataGrid.tsx +26 -26
  109. package/src/DataGrid/DataGridActions/DataGridActions.test.tsx +63 -63
  110. package/src/DataGrid/DataGridActions/DataGridActions.tsx +15 -15
  111. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss +1 -1
  112. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.test.tsx +21 -21
  113. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.tsx +20 -20
  114. package/src/DataGrid/DataGridBody/DataGridBody.test.tsx +40 -40
  115. package/src/DataGrid/DataGridBody/DataGridBody.tsx +10 -10
  116. package/src/DataGrid/DataGridBody/DataGridCell.module.scss +1 -1
  117. package/src/DataGrid/DataGridBody/DataGridCell.test.tsx +25 -25
  118. package/src/DataGrid/DataGridBody/DataGridCell.tsx +6 -6
  119. package/src/DataGrid/DataGridBody/DataGridRow.test.tsx +38 -38
  120. package/src/DataGrid/DataGridBody/DataGridRow.tsx +9 -9
  121. package/src/DataGrid/DataGridHeader/DataGridHeader.module.scss +1 -2
  122. package/src/DataGrid/DataGridHeader/DataGridHeader.test.tsx +119 -119
  123. package/src/DataGrid/DataGridHeader/DataGridHeader.tsx +13 -13
  124. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss +2 -0
  125. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.test.tsx +51 -51
  126. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +14 -14
  127. package/src/DataGrid/datagrid.interfaces.ts +1 -1
  128. package/src/Form/Checkbox/Checkbox.test.tsx +74 -74
  129. package/src/Form/Checkbox/Checkbox.tsx +27 -27
  130. package/src/Form/Fieldset/Fieldset.module.scss +1 -1
  131. package/src/Form/Fieldset/Fieldset.test.tsx +35 -35
  132. package/src/Form/Fieldset/Fieldset.tsx +27 -27
  133. package/src/Form/Form.test.tsx +18 -18
  134. package/src/Form/Form.tsx +3 -3
  135. package/src/Form/FormControl/FormControl.test.tsx +22 -22
  136. package/src/Form/FormControl/FormControl.tsx +10 -10
  137. package/src/Form/FormGroup/FormGroup.test.tsx +37 -37
  138. package/src/Form/FormGroup/FormGroup.tsx +16 -16
  139. package/src/Form/FormHelperText/FormHelperText.test.tsx +18 -18
  140. package/src/Form/FormHelperText/FormHelperText.tsx +7 -7
  141. package/src/Form/FormSelectorWrapper/FormSelectorWrapper.test.tsx +15 -15
  142. package/src/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +14 -14
  143. package/src/Form/Input/Input.module.scss +20 -44
  144. package/src/Form/Input/Input.test.tsx +121 -73
  145. package/src/Form/Input/Input.tsx +96 -35
  146. package/src/Form/Label/Label.test.tsx +13 -13
  147. package/src/Form/Label/Label.tsx +6 -6
  148. package/src/Form/Radio/Radio.test.tsx +35 -35
  149. package/src/Form/Radio/Radio.tsx +17 -17
  150. package/src/Form/Select/Option.test.tsx +10 -10
  151. package/src/Form/Select/Option.tsx +8 -8
  152. package/src/Form/Select/Select.module.scss +7 -9
  153. package/src/Form/Select/Select.test.tsx +144 -141
  154. package/src/Form/Select/Select.tsx +79 -78
  155. package/src/Form/Textarea/Textarea.module.scss +8 -18
  156. package/src/Form/Textarea/Textarea.test.tsx +27 -27
  157. package/src/Form/Textarea/Textarea.tsx +33 -13
  158. package/src/Form/Toggle/Toggle.module.scss +1 -1
  159. package/src/Form/Toggle/Toggle.test.tsx +22 -22
  160. package/src/Form/Toggle/Toggle.tsx +10 -10
  161. package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.tsx +39 -39
  162. package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.tsx +12 -12
  163. package/src/Form/Wrapper/InputWrapper/InputWrapper.module.scss +2 -8
  164. package/src/Form/Wrapper/InputWrapper/InputWrapper.test.tsx +55 -55
  165. package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +30 -35
  166. package/src/Form/Wrapper/RadioWrapper/RadioWrapper.test.tsx +35 -35
  167. package/src/Form/Wrapper/RadioWrapper/RadioWrapper.tsx +12 -12
  168. package/src/Form/Wrapper/SelectWrapper/SelectWrapper.test.tsx +55 -55
  169. package/src/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +12 -12
  170. package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss +2 -11
  171. package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.test.tsx +50 -50
  172. package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +22 -22
  173. package/src/Form/Wrapper/Wrapper/Wrapper.module.scss +2 -2
  174. package/src/Form/Wrapper/Wrapper/Wrapper.test.tsx +11 -11
  175. package/src/Form/Wrapper/Wrapper/Wrapper.tsx +17 -17
  176. package/src/Form/form.interfaces.ts +2 -2
  177. package/src/Icon/Icon.module.scss +71 -71
  178. package/src/Icon/Icon.test.tsx +18 -18
  179. package/src/Icon/Icon.tsx +70 -70
  180. package/src/Link/Link.module.scss +5 -5
  181. package/src/Link/Link.test.tsx +76 -76
  182. package/src/Link/Link.tsx +27 -27
  183. package/src/Link/types.d.ts +2 -2
  184. package/src/Notifications/BaseModal/BaseModal.module.scss +1 -1
  185. package/src/Notifications/BaseModal/BaseModal.test.tsx +53 -53
  186. package/src/Notifications/BaseModal/BaseModal.tsx +16 -16
  187. package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.test.tsx +13 -13
  188. package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.tsx +5 -5
  189. package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.test.tsx +16 -16
  190. package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.tsx +5 -5
  191. package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.test.tsx +19 -19
  192. package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.tsx +10 -10
  193. package/src/Notifications/Dialog/Dialog.test.tsx +35 -35
  194. package/src/Notifications/Dialog/Dialog.tsx +19 -19
  195. package/src/Notifications/Dialog/DialogActions/DialogActions.test.tsx +14 -14
  196. package/src/Notifications/Dialog/DialogActions/DialogActions.tsx +6 -6
  197. package/src/Notifications/Dialog/DialogTitle/DialogTitle.test.tsx +12 -12
  198. package/src/Notifications/Dialog/DialogTitle/DialogTitle.tsx +6 -6
  199. package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.test.tsx +20 -20
  200. package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.tsx +7 -7
  201. package/src/Notifications/DiscardChangesModal/DiscardChangesModal.test.tsx +36 -36
  202. package/src/Notifications/DiscardChangesModal/DiscardChangesModal.tsx +8 -8
  203. package/src/Notifications/Modal/Modal.test.tsx +6 -6
  204. package/src/Notifications/Modal/Modal.tsx +1 -1
  205. package/src/Notifications/Modal/ModalActions/ModalActions.tsx +2 -2
  206. package/src/Notifications/Modal/ModalContent/ModalContent.tsx +2 -2
  207. package/src/Notifications/Modal/ModalHeader/ModalHeader.tsx +2 -2
  208. package/src/Notifications/SlideInModal/SlideInModal.test.tsx +16 -16
  209. package/src/Notifications/SlideInModal/SlideInModal.tsx +16 -11
  210. package/src/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.tsx +16 -16
  211. package/src/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.tsx +6 -6
  212. package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +2 -2
  213. package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.tsx +17 -17
  214. package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +23 -23
  215. package/src/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.tsx +32 -32
  216. package/src/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +18 -18
  217. package/src/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +3 -3
  218. package/src/Notifications/Snackbar/interfaces.ts +2 -2
  219. package/src/Notifications/Snackbar/useSnackbar.ts +2 -2
  220. package/src/Pagination/Pagination.module.scss +2 -0
  221. package/src/Pagination/Pagination.test.tsx +47 -47
  222. package/src/Pagination/Pagination.tsx +35 -35
  223. package/src/Popover/Popover.test.tsx +19 -19
  224. package/src/Popover/Popover.tsx +7 -7
  225. package/src/Skeleton/Skeleton.module.scss +2 -2
  226. package/src/Skeleton/Skeleton.test.tsx +29 -29
  227. package/src/Skeleton/Skeleton.tsx +10 -10
  228. package/src/StatusIndicator/StatusIndicator.test.tsx +38 -38
  229. package/src/StatusIndicator/StatusIndicator.tsx +9 -9
  230. package/src/Tabs/Tab.test.tsx +13 -13
  231. package/src/Tabs/Tab.tsx +1 -1
  232. package/src/Tabs/TabButton.test.tsx +28 -28
  233. package/src/Tabs/TabButton.tsx +7 -7
  234. package/src/Tabs/TabPanel.test.tsx +30 -30
  235. package/src/Tabs/TabPanel.tsx +4 -4
  236. package/src/Tabs/Tabs.test.tsx +93 -93
  237. package/src/Tabs/Tabs.tsx +25 -25
  238. package/src/TextEllipsis/TextEllipsis.test.tsx +22 -22
  239. package/src/TextEllipsis/TextEllipsis.tsx +6 -6
  240. package/src/Tiles/Tile.module.scss +1 -1
  241. package/src/Tiles/Tile.test.tsx +42 -42
  242. package/src/Tiles/Tile.tsx +22 -22
  243. package/src/Tiles/Tiles.test.tsx +30 -30
  244. package/src/Tiles/Tiles.tsx +9 -9
  245. package/src/Tooltip/Tooltip.test.tsx +35 -35
  246. package/src/Tooltip/Tooltip.tsx +21 -21
  247. package/src/Typography/Typography.module.scss +1 -1
  248. package/src/Typography/Typography.test.tsx +49 -49
  249. package/src/Typography/Typography.tsx +42 -42
  250. package/src/Wizard/BaseWizardSteps/BaseWizardSteps.module.scss +1 -1
  251. package/src/Wizard/BaseWizardSteps/BaseWizardSteps.test.tsx +26 -26
  252. package/src/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +24 -24
  253. package/src/Wizard/Wizard.test.tsx +56 -56
  254. package/src/Wizard/Wizard.tsx +6 -6
  255. package/src/Wizard/WizardActions/WizardActions.test.tsx +34 -34
  256. package/src/Wizard/WizardActions/WizardActions.tsx +14 -14
  257. package/src/Wizard/WizardStateProvider.tsx +3 -3
  258. package/src/Wizard/WizardSteps/WizardSteps.test.tsx +27 -27
  259. package/src/Wizard/WizardSteps/WizardSteps.tsx +7 -7
  260. package/src/Wizard/wizardStateReducer.ts +9 -9
  261. package/src/_BaseStyling_/BaseStyling.test.tsx +14 -14
  262. package/src/_BaseStyling_/BaseStyling.tsx +50 -50
  263. package/src/hooks/useAnimation.test.tsx +12 -12
  264. package/src/hooks/useAnimation.ts +4 -4
  265. package/src/hooks/useBodyClick.test.tsx +8 -8
  266. package/src/hooks/useBodyClick.ts +3 -3
  267. package/src/hooks/useFormSelector.test.ts +17 -17
  268. package/src/hooks/useFormSelector.ts +4 -4
  269. package/src/hooks/usePosition.test.tsx +215 -215
  270. package/src/hooks/usePosition.ts +73 -72
  271. package/src/hooks/useRepeater.test.tsx +26 -26
  272. package/src/hooks/useRepeater.ts +5 -5
  273. package/src/hooks/useScroll.test.tsx +5 -5
  274. package/src/hooks/useScroll.ts +3 -3
  275. package/src/hooks/useSpacing.test.ts +40 -40
  276. package/src/hooks/useSpacing.ts +3 -3
  277. package/src/hooks/useWrapper.test.ts +12 -12
  278. package/src/hooks/useWrapper.ts +10 -10
  279. package/src/index.ts +67 -67
  280. package/src/interfaces.ts +1 -1
  281. package/src/mixins.module.scss +76 -27
  282. package/src/types.d.ts +1 -1
  283. package/src/util/helper.test.tsx +25 -25
  284. package/src/util/helper.tsx +64 -64
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onewelcome/react-lib-components",
3
- "version": "0.2.1",
3
+ "version": "0.2.4",
4
4
  "license": "Apache-2.0",
5
5
  "author": "OneWelcome B.V.",
6
6
  "main": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "build": "dts build",
19
19
  "build-storybook": "build-storybook",
20
20
  "dev": "npm-run-all -p start test:watch storybook",
21
- "lint": "dts lint",
21
+ "lint": "eslint --fix '**/*.{ts,tsx}'",
22
22
  "prepare": "husky install && dts build",
23
23
  "size": "size-limit",
24
24
  "start": "dts watch",
@@ -47,20 +47,21 @@
47
47
  }
48
48
  ],
49
49
  "devDependencies": {
50
- "@babel/core": "^7.18.6",
50
+ "@babel/core": "^7.18.10",
51
+ "@onewelcome/eslint-config-shared-codestyle": "^9.0.3",
51
52
  "@size-limit/preset-small-lib": "^7.0.8",
52
- "@storybook/addon-a11y": "^6.5.9",
53
- "@storybook/addon-docs": "^6.5.9",
54
- "@storybook/addon-essentials": "^6.5.9",
55
- "@storybook/addon-links": "^6.5.9",
56
- "@storybook/addons": "^6.5.9",
57
- "@storybook/builder-webpack5": "^6.5.9",
58
- "@storybook/manager-webpack5": "^6.5.9",
53
+ "@storybook/addon-a11y": "^6.5.10",
54
+ "@storybook/addon-docs": "^6.5.10",
55
+ "@storybook/addon-essentials": "^6.5.10",
56
+ "@storybook/addon-links": "^6.5.10",
57
+ "@storybook/addons": "^6.5.10",
58
+ "@storybook/builder-webpack5": "^6.5.10",
59
+ "@storybook/manager-webpack5": "^6.5.10",
59
60
  "@storybook/preset-scss": "^1.0.3",
60
- "@storybook/react": "^6.5.9",
61
- "@storybook/theming": "^6.5.9",
62
- "@testing-library/dom": "^8.16.0",
63
- "@testing-library/jest-dom": "^5.16.4",
61
+ "@storybook/react": "^6.5.10",
62
+ "@storybook/theming": "^6.5.10",
63
+ "@testing-library/dom": "^8.16.1",
64
+ "@testing-library/jest-dom": "^5.16.5",
64
65
  "@testing-library/react": "^12.1.5",
65
66
  "@testing-library/react-hooks": "^7.0.2",
66
67
  "@testing-library/user-event": "^13.5.0",
@@ -68,23 +69,33 @@
68
69
  "@tsconfig/recommended": "^1.0.1",
69
70
  "@types/color-convert": "^2.0.0",
70
71
  "@types/mdx": "^2.0.2",
71
- "@types/react": "^17.0.47",
72
+ "@types/react": "^17.0.48",
72
73
  "@types/react-dom": "^17.0.17",
74
+ "@types/react-router": "^5.1.18",
75
+ "@types/react-router-dom": "^5.3.3",
76
+ "@typescript-eslint/eslint-plugin": "^5.33.1",
77
+ "@typescript-eslint/parser": "^5.33.1",
73
78
  "babel-loader": "^8.2.5",
74
79
  "dts-cli": "^1.5.2",
80
+ "eslint": "^8.22.0",
81
+ "eslint-config-prettier": "^8.5.0",
82
+ "eslint-plugin-cypress": "^2.12.1",
83
+ "eslint-plugin-jest": "^26.8.3",
84
+ "eslint-plugin-prettier": "^4.2.1",
75
85
  "html-webpack-plugin": "^5.5.0",
76
86
  "husky": "^7.0.4",
77
87
  "identity-obj-proxy": "^3.0.0",
78
88
  "jest-junit": "^13.2.0",
79
89
  "lint-staged": "^13.0.3",
80
90
  "npm-run-all": "^4.1.5",
91
+ "prettier": "^2.7.1",
81
92
  "react": "^17.0.2",
82
93
  "react-dom": "^17.0.2",
83
94
  "react-is": "^17.0.2",
84
95
  "react-router": "^6.3.0",
85
96
  "react-router-dom": "^6.3.0",
86
97
  "rollup-plugin-styles": "^4.0.0",
87
- "sass": "^1.53.0",
98
+ "sass": "^1.54.3",
88
99
  "size-limit": "^7.0.8",
89
100
  "tslib": "^2.4.0",
90
101
  "typescript": "^4.7.4"
@@ -1,18 +1,18 @@
1
- import React from 'react';
2
- import { Breadcrumbs, Props } from './Breadcrumbs';
3
- import { render } from '@testing-library/react';
4
- import { Link } from '../Link/Link';
1
+ import React from "react";
2
+ import { Breadcrumbs, Props } from "./Breadcrumbs";
3
+ import { render } from "@testing-library/react";
4
+ import { Link } from "../Link/Link";
5
5
 
6
6
  const defaultParams: Props = {
7
- 'aria-label': 'Breadcrumbs',
7
+ "aria-label": "Breadcrumbs",
8
8
  children: [
9
9
  <Link key="0" to="#1" data-testid="link">
10
10
  Test1
11
11
  </Link>,
12
12
  <Link key="1" to="#2" data-testid="link">
13
13
  Test2
14
- </Link>,
15
- ],
14
+ </Link>
15
+ ]
16
16
  };
17
17
 
18
18
  const createBreadcrumbs = (params?: (defaultParams: Props) => Props) => {
@@ -21,22 +21,22 @@ const createBreadcrumbs = (params?: (defaultParams: Props) => Props) => {
21
21
  parameters = params(defaultParams);
22
22
  }
23
23
  const queries = render(<Breadcrumbs {...parameters} data-testid="breadcrumbs"></Breadcrumbs>);
24
- const breadcrumbs = queries.getByTestId('breadcrumbs');
24
+ const breadcrumbs = queries.getByTestId("breadcrumbs");
25
25
 
26
26
  return {
27
27
  ...queries,
28
- breadcrumbs,
28
+ breadcrumbs
29
29
  };
30
30
  };
31
31
 
32
- describe('Breadcrumbs should render', () => {
33
- it('renders without crashing', () => {
32
+ describe("Breadcrumbs should render", () => {
33
+ it("renders without crashing", () => {
34
34
  const { breadcrumbs } = createBreadcrumbs();
35
35
 
36
36
  expect(breadcrumbs).toBeDefined();
37
- expect(breadcrumbs.firstChild).not.toHaveAttribute('aria-current');
38
- expect((breadcrumbs.firstChild as HTMLElement).tagName).toEqual('A');
39
- expect(breadcrumbs.lastChild).toHaveAttribute('aria-current', 'page');
40
- expect((breadcrumbs.lastChild as HTMLElement).tagName).toEqual('SPAN');
37
+ expect(breadcrumbs.firstChild).not.toHaveAttribute("aria-current");
38
+ expect((breadcrumbs.firstChild as HTMLElement).tagName).toEqual("A");
39
+ expect(breadcrumbs.lastChild).toHaveAttribute("aria-current", "page");
40
+ expect((breadcrumbs.lastChild as HTMLElement).tagName).toEqual("SPAN");
41
41
  });
42
42
  });
@@ -1,18 +1,18 @@
1
- import React, { ComponentPropsWithRef, Fragment, ReactElement } from 'react';
2
- import { Icon, Icons } from '../Icon/Icon';
3
- import { Link, Props as LinkProps } from '../Link/Link';
4
- import { Typography } from '../Typography/Typography';
5
- import classes from './Breadcrumbs.module.scss';
1
+ import React, { ComponentPropsWithRef, Fragment, ReactElement } from "react";
2
+ import { Icon, Icons } from "../Icon/Icon";
3
+ import { Link, Props as LinkProps } from "../Link/Link";
4
+ import { Typography } from "../Typography/Typography";
5
+ import classes from "./Breadcrumbs.module.scss";
6
6
 
7
7
  type ChildrenType = ReactElement<LinkProps, typeof Link>;
8
8
 
9
- export interface Props extends ComponentPropsWithRef<'div'> {
9
+ export interface Props extends ComponentPropsWithRef<"div"> {
10
10
  children: ChildrenType | ChildrenType[];
11
- 'aria-label': string;
11
+ "aria-label": string;
12
12
  }
13
13
 
14
14
  export const Breadcrumbs = React.forwardRef<HTMLDivElement, Props>(
15
- ({ children, 'aria-label': ariaLabel, className = '', ...rest }: Props, ref) => {
15
+ ({ children, "aria-label": ariaLabel, className = "", ...rest }: Props, ref) => {
16
16
  const items = React.Children.map(children, (child, index) => {
17
17
  const isLastElement = Array.isArray(children) ? index === children.length - 1 : true;
18
18
  if (isLastElement) {
@@ -21,7 +21,7 @@ export const Breadcrumbs = React.forwardRef<HTMLDivElement, Props>(
21
21
  key={child.key}
22
22
  variant="body"
23
23
  tag="span"
24
- className={classes['last']}
24
+ className={classes["last"]}
25
25
  aria-current="page"
26
26
  >
27
27
  {child.props.children}
@@ -31,7 +31,7 @@ export const Breadcrumbs = React.forwardRef<HTMLDivElement, Props>(
31
31
  return (
32
32
  <Fragment key={child.key}>
33
33
  {React.cloneElement(child)}
34
- <Icon icon={Icons.ChevronRight} className={classes['icon']} />
34
+ <Icon icon={Icons.ChevronRight} className={classes["icon"]} />
35
35
  </Fragment>
36
36
  );
37
37
  }
@@ -41,7 +41,7 @@ export const Breadcrumbs = React.forwardRef<HTMLDivElement, Props>(
41
41
  {...rest}
42
42
  ref={ref}
43
43
  aria-label={ariaLabel}
44
- className={`${classes['breadcrumbs']} ${className}`}
44
+ className={`${classes["breadcrumbs"]} ${className}`}
45
45
  >
46
46
  {items}
47
47
  </nav>
@@ -1,4 +1,4 @@
1
- @import '../mixins.module.scss';
1
+ @import "../mixins.module.scss";
2
2
 
3
3
  .button {
4
4
  @include buttonBase();
@@ -1,7 +1,7 @@
1
- import React, { useEffect, useRef } from 'react';
2
- import { BaseButton, Props } from './BaseButton';
3
- import { render } from '@testing-library/react';
4
- import userEvent from '@testing-library/user-event';
1
+ import React, { useEffect, useRef } from "react";
2
+ import { BaseButton, Props } from "./BaseButton";
3
+ import { render } from "@testing-library/react";
4
+ import userEvent from "@testing-library/user-event";
5
5
 
6
6
  const defaultParams: Props = {};
7
7
 
@@ -15,29 +15,29 @@ const createBaseButton = (params?: (defaultParams: Props) => Props) => {
15
15
  baseButton content
16
16
  </BaseButton>
17
17
  );
18
- const baseButton = queries.getByTestId('baseButton');
18
+ const baseButton = queries.getByTestId("baseButton");
19
19
 
20
20
  return {
21
21
  ...queries,
22
- baseButton,
22
+ baseButton
23
23
  };
24
24
  };
25
25
 
26
- describe('BaseButton should render', () => {
27
- it('renders without crashing', () => {
26
+ describe("BaseButton should render", () => {
27
+ it("renders without crashing", () => {
28
28
  const { baseButton } = createBaseButton();
29
29
 
30
30
  expect(baseButton).toBeDefined();
31
- expect(baseButton).toHaveTextContent('baseButton content');
31
+ expect(baseButton).toHaveTextContent("baseButton content");
32
32
  });
33
33
  });
34
34
 
35
- describe('On click handler', () => {
36
- it('executes the onclick handler', async () => {
35
+ describe("On click handler", () => {
36
+ it("executes the onclick handler", async () => {
37
37
  const onClickHandler = jest.fn();
38
- const { baseButton } = createBaseButton((defaultParams) => ({
38
+ const { baseButton } = createBaseButton(defaultParams => ({
39
39
  ...defaultParams,
40
- onClick: onClickHandler,
40
+ onClick: onClickHandler
41
41
  }));
42
42
 
43
43
  userEvent.click(baseButton);
@@ -46,13 +46,13 @@ describe('On click handler', () => {
46
46
  });
47
47
  });
48
48
 
49
- describe('Properties of the button', () => {
50
- it('should be disabled, function should not have been called', () => {
49
+ describe("Properties of the button", () => {
50
+ it("should be disabled, function should not have been called", () => {
51
51
  const onClickHandler = jest.fn();
52
- const { baseButton } = createBaseButton((defaultParams) => ({
52
+ const { baseButton } = createBaseButton(defaultParams => ({
53
53
  ...defaultParams,
54
54
  disabled: true,
55
- onClick: onClickHandler,
55
+ onClick: onClickHandler
56
56
  }));
57
57
 
58
58
  userEvent.click(baseButton);
@@ -60,28 +60,28 @@ describe('Properties of the button', () => {
60
60
  });
61
61
 
62
62
  it('should have the class "TESTING"', () => {
63
- const { baseButton } = createBaseButton((defaultParams) => ({
63
+ const { baseButton } = createBaseButton(defaultParams => ({
64
64
  ...defaultParams,
65
- className: 'TESTING',
65
+ className: "TESTING"
66
66
  }));
67
67
 
68
- expect(baseButton).toHaveClass('TESTING');
68
+ expect(baseButton).toHaveClass("TESTING");
69
69
  });
70
70
 
71
71
  it('should have a "name" property with the value "button"', () => {
72
- const { baseButton } = createBaseButton((defaultParams) => ({
72
+ const { baseButton } = createBaseButton(defaultParams => ({
73
73
  ...defaultParams,
74
- name: 'button',
74
+ name: "button"
75
75
  }));
76
76
 
77
- expect(baseButton).toHaveAttribute('name', 'button');
77
+ expect(baseButton).toHaveAttribute("name", "button");
78
78
  });
79
79
  });
80
80
 
81
- describe('ref should work', () => {
82
- it('should give back the proper data prop, this also checks if the component propagates ...rest properly', () => {
81
+ describe("ref should work", () => {
82
+ it("should give back the proper data prop, this also checks if the component propagates ...rest properly", () => {
83
83
  const ExampleComponent = ({
84
- propagateRef,
84
+ propagateRef
85
85
  }: {
86
86
  propagateRef?: (ref: React.RefObject<HTMLElement>) => void;
87
87
  }) => {
@@ -97,7 +97,7 @@ describe('ref should work', () => {
97
97
  };
98
98
 
99
99
  const refCheck = (ref: React.RefObject<HTMLElement>) => {
100
- expect(ref.current).toHaveAttribute('data-ref', 'testing');
100
+ expect(ref.current).toHaveAttribute("data-ref", "testing");
101
101
  };
102
102
 
103
103
  render(<ExampleComponent propagateRef={refCheck} />);
@@ -1,15 +1,15 @@
1
- import React, { ComponentPropsWithRef } from 'react';
2
- import classes from './BaseButton.module.scss';
1
+ import React, { ComponentPropsWithRef } from "react";
2
+ import classes from "./BaseButton.module.scss";
3
3
 
4
- export interface Props extends ComponentPropsWithRef<'button'> {
5
- type?: 'submit' | 'button' | 'reset';
4
+ export interface Props extends ComponentPropsWithRef<"button"> {
5
+ type?: "submit" | "button" | "reset";
6
6
  disabled?: boolean;
7
- color?: 'primary' | 'secondary' | 'tertiary' | 'default';
7
+ color?: "primary" | "secondary" | "tertiary" | "default";
8
8
  }
9
9
 
10
10
  export const BaseButton = React.forwardRef<HTMLButtonElement, Props>(
11
- ({ children, type = 'button', className, ...rest }, ref) => {
12
- const validTypes = ['submit', 'button', 'reset'];
11
+ ({ children, type = "button", className, ...rest }, ref) => {
12
+ const validTypes = ["submit", "button", "reset"];
13
13
 
14
14
  if (!validTypes.includes(type))
15
15
  throw new Error(
@@ -21,7 +21,7 @@ export const BaseButton = React.forwardRef<HTMLButtonElement, Props>(
21
21
  {...rest}
22
22
  ref={ref}
23
23
  type={type}
24
- className={`${classes.button} ${className ? className : ''}`}
24
+ className={`${classes.button} ${className ? className : ""}`}
25
25
  >
26
26
  {children}
27
27
  </button>
@@ -1,16 +1,16 @@
1
- @import '../readyclasses.module.scss';
2
- @import '../mixins.module.scss';
1
+ @import "../readyclasses.module.scss";
2
+ @import "../mixins.module.scss";
3
3
 
4
4
  .fill {
5
- @include button('fill');
5
+ @include button("fill");
6
6
  }
7
7
 
8
8
  .outline {
9
- @include button('outline');
9
+ @include button("outline");
10
10
  }
11
11
 
12
12
  .text {
13
- @include button('text');
13
+ @include button("text");
14
14
  }
15
15
 
16
16
  .has-icon {
@@ -1,7 +1,7 @@
1
- import React, { useRef, useEffect } from 'react';
2
- import { Button, Props } from './Button';
3
- import { render } from '@testing-library/react';
4
- import { Icon, Icons } from '../Icon/Icon';
1
+ import React, { useRef, useEffect } from "react";
2
+ import { Button, Props } from "./Button";
3
+ import { render } from "@testing-library/react";
4
+ import { Icon, Icons } from "../Icon/Icon";
5
5
 
6
6
  const defaultParams: Props = {};
7
7
 
@@ -15,26 +15,26 @@ const createButton = (params?: (defaultParams: Props) => Props) => {
15
15
  button content
16
16
  </Button>
17
17
  );
18
- const button = queries.getByTestId('button');
18
+ const button = queries.getByTestId("button");
19
19
 
20
20
  return {
21
21
  ...queries,
22
- button,
22
+ button
23
23
  };
24
24
  };
25
25
 
26
- describe('Button should render', () => {
27
- it('renders without crashing', () => {
26
+ describe("Button should render", () => {
27
+ it("renders without crashing", () => {
28
28
  const { button } = createButton();
29
29
 
30
30
  expect(button).toBeDefined();
31
31
  });
32
32
  });
33
33
 
34
- describe('ref should work', () => {
35
- it('should give back the proper data prop, this also checks if the component propagates ...rest properly', () => {
34
+ describe("ref should work", () => {
35
+ it("should give back the proper data prop, this also checks if the component propagates ...rest properly", () => {
36
36
  const ExampleComponent = ({
37
- propagateRef,
37
+ propagateRef
38
38
  }: {
39
39
  propagateRef?: (ref: React.RefObject<HTMLElement>) => void;
40
40
  }) => {
@@ -50,73 +50,73 @@ describe('ref should work', () => {
50
50
  };
51
51
 
52
52
  const refCheck = (ref: React.RefObject<HTMLElement>) => {
53
- expect(ref.current).toHaveAttribute('data-ref', 'testing');
53
+ expect(ref.current).toHaveAttribute("data-ref", "testing");
54
54
  };
55
55
 
56
56
  render(<ExampleComponent propagateRef={refCheck} />);
57
57
  });
58
58
  });
59
59
 
60
- describe('Button should render', () => {
61
- it('renders without crashing', () => {
60
+ describe("Button should render", () => {
61
+ it("renders without crashing", () => {
62
62
  const { button } = createButton();
63
63
 
64
64
  expect(button).toBeDefined();
65
65
  });
66
66
  });
67
67
 
68
- describe('Different variants of the button', () => {
68
+ describe("Different variants of the button", () => {
69
69
  it('should have a class of "primary"', () => {
70
70
  const { button } = createButton();
71
- expect(button.classList.contains('primary')).toBe(true);
71
+ expect(button.classList.contains("primary")).toBe(true);
72
72
  });
73
73
 
74
74
  it('should have a class of "secondary"', () => {
75
- const { button } = createButton((defaultParams) => ({ ...defaultParams, color: 'secondary' }));
76
- expect(button.classList.contains('secondary')).toBe(true);
75
+ const { button } = createButton(defaultParams => ({ ...defaultParams, color: "secondary" }));
76
+ expect(button.classList.contains("secondary")).toBe(true);
77
77
  });
78
78
 
79
79
  it('should have a class of "tertiary"', () => {
80
- const { button } = createButton((defaultParams) => ({ ...defaultParams, color: 'tertiary' }));
81
- expect(button.classList.contains('tertiary')).toBe(true);
80
+ const { button } = createButton(defaultParams => ({ ...defaultParams, color: "tertiary" }));
81
+ expect(button.classList.contains("tertiary")).toBe(true);
82
82
  });
83
83
 
84
84
  it('should have a class of "fill"', () => {
85
- const { button } = createButton((defaultParams) => ({ ...defaultParams, variant: 'fill' }));
86
- expect(button.classList.contains('fill')).toBe(true);
85
+ const { button } = createButton(defaultParams => ({ ...defaultParams, variant: "fill" }));
86
+ expect(button.classList.contains("fill")).toBe(true);
87
87
  });
88
88
 
89
89
  it('should have a class of "outline"', () => {
90
- const { button } = createButton((defaultParams) => ({ ...defaultParams, variant: 'outline' }));
91
- expect(button.classList.contains('outline')).toBe(true);
90
+ const { button } = createButton(defaultParams => ({ ...defaultParams, variant: "outline" }));
91
+ expect(button.classList.contains("outline")).toBe(true);
92
92
  });
93
93
 
94
94
  it('should have a class of "text"', () => {
95
- const { button } = createButton((defaultParams) => ({ ...defaultParams, variant: 'text' }));
96
- expect(button.classList.contains('text')).toBe(true);
95
+ const { button } = createButton(defaultParams => ({ ...defaultParams, variant: "text" }));
96
+ expect(button.classList.contains("text")).toBe(true);
97
97
  });
98
98
  });
99
99
 
100
- describe('Button contains an icon', () => {
101
- it('Contains an icon at the start', () => {
102
- const { button } = createButton((defaultParams) => ({
100
+ describe("Button contains an icon", () => {
101
+ it("Contains an icon at the start", () => {
102
+ const { button } = createButton(defaultParams => ({
103
103
  ...defaultParams,
104
- startIcon: <Icon icon={Icons.Calendar} />,
104
+ startIcon: <Icon icon={Icons.Calendar} />
105
105
  }));
106
106
 
107
- expect(button.classList.contains('has-icon')).toBe(true);
108
- expect(button.firstElementChild?.nodeName).toBe('I');
109
- expect(button.querySelector('i + span')!.innerHTML).toBe('button content');
107
+ expect(button.classList.contains("has-icon")).toBe(true);
108
+ expect(button.firstElementChild?.nodeName).toBe("I");
109
+ expect(button.querySelector("i + span")!.innerHTML).toBe("button content");
110
110
  });
111
111
 
112
- it('Contains an icon at the end', () => {
113
- const { button } = createButton((defaultParams) => ({
112
+ it("Contains an icon at the end", () => {
113
+ const { button } = createButton(defaultParams => ({
114
114
  ...defaultParams,
115
- endIcon: <Icon icon={Icons.Calendar} />,
115
+ endIcon: <Icon icon={Icons.Calendar} />
116
116
  }));
117
117
 
118
- expect(button.classList.contains('has-icon')).toBe(true);
119
- expect(button.lastElementChild?.nodeName).toBe('I');
120
- expect(button.querySelector('span')!.innerHTML).toBe('button content');
118
+ expect(button.classList.contains("has-icon")).toBe(true);
119
+ expect(button.lastElementChild?.nodeName).toBe("I");
120
+ expect(button.querySelector("span")!.innerHTML).toBe("button content");
121
121
  });
122
122
  });
@@ -1,20 +1,20 @@
1
- import React from 'react';
2
- import { BaseButton, Props as BaseButtonProps } from './BaseButton';
3
- import classes from './Button.module.scss';
1
+ import React from "react";
2
+ import { BaseButton, Props as BaseButtonProps } from "./BaseButton";
3
+ import classes from "./Button.module.scss";
4
4
 
5
5
  export interface Props extends BaseButtonProps {
6
6
  startIcon?: React.ReactNode | false;
7
7
  endIcon?: React.ReactNode | false;
8
8
  children?: React.ReactNode;
9
- variant?: 'text' | 'fill' | 'outline';
9
+ variant?: "text" | "fill" | "outline";
10
10
  }
11
11
 
12
12
  export const Button = React.forwardRef<HTMLButtonElement, Props>(
13
13
  (
14
14
  {
15
15
  children,
16
- variant = 'fill',
17
- color = 'primary',
16
+ variant = "fill",
17
+ color = "primary",
18
18
  startIcon = false,
19
19
  endIcon = false,
20
20
  className,
@@ -25,15 +25,15 @@ export const Button = React.forwardRef<HTMLButtonElement, Props>(
25
25
  const additionalClasses = [];
26
26
 
27
27
  if (startIcon || endIcon) {
28
- additionalClasses.push(classes['has-icon']);
28
+ additionalClasses.push(classes["has-icon"]);
29
29
  }
30
30
 
31
31
  if (startIcon) {
32
- additionalClasses.push(classes['start-icon']);
32
+ additionalClasses.push(classes["start-icon"]);
33
33
  }
34
34
 
35
35
  if (endIcon) {
36
- additionalClasses.push(classes['end-icon']);
36
+ additionalClasses.push(classes["end-icon"]);
37
37
  }
38
38
 
39
39
  if (className) {
@@ -44,7 +44,7 @@ export const Button = React.forwardRef<HTMLButtonElement, Props>(
44
44
  <BaseButton
45
45
  {...rest}
46
46
  ref={ref}
47
- className={`${classes[color]} ${classes[variant]} ${additionalClasses.join(' ')}`}
47
+ className={`${classes[color]} ${classes[variant]} ${additionalClasses.join(" ")}`}
48
48
  >
49
49
  {startIcon && <i>{startIcon}&nbsp;</i>}
50
50
  <span>{children}</span>
@@ -1,5 +1,5 @@
1
- @import '../readyclasses.module.scss';
2
- @import '../mixins.module.scss';
1
+ @import "../readyclasses.module.scss";
2
+ @import "../mixins.module.scss";
3
3
 
4
4
  .icon-button {
5
5
  border: var(--button-border-width) var(--button-border-style) transparent;
@@ -41,14 +41,14 @@
41
41
  }
42
42
 
43
43
  &.fill {
44
- @include button('fill', 'icon');
44
+ @include button("fill", "icon");
45
45
  }
46
46
 
47
47
  &.text {
48
- @include button('text', 'icon');
48
+ @include button("text", "icon");
49
49
  }
50
50
 
51
51
  &.outline {
52
- @include button('outline', 'icon');
52
+ @include button("outline", "icon");
53
53
  }
54
54
  }