@onewelcome/react-lib-components 6.0.0 → 6.1.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.
- package/dist/cjs/Button/Button.module.cjs.js +1 -1
- package/dist/cjs/Button/IconButton.module.cjs.js +1 -1
- package/dist/cjs/ContextMenu/ContextMenu.cjs.js +1 -1
- package/dist/cjs/ContextMenu/ContextMenu.cjs.js.map +1 -1
- package/dist/cjs/ContextMenu/ContextMenuItem.module.cjs.js +1 -1
- package/dist/cjs/ContextMenu/ContextMenuService.cjs.js +1 -1
- package/dist/cjs/ContextMenu/ContextMenuService.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridActions/DataGridColumnsToggle.module.cjs.js +1 -1
- package/dist/cjs/Form/Input/Input.module.cjs.js +1 -1
- package/dist/cjs/Form/Select/Option.cjs.js +1 -1
- package/dist/cjs/Form/Select/Option.cjs.js.map +1 -1
- package/dist/cjs/Form/Select/Select.cjs.js +1 -1
- package/dist/cjs/Form/Select/Select.cjs.js.map +1 -1
- package/dist/cjs/Form/Select/Select.module.cjs.js +1 -1
- package/dist/cjs/Form/Select/SelectService.cjs.js +1 -1
- package/dist/cjs/Form/Select/SelectService.cjs.js.map +1 -1
- package/dist/cjs/Form/Textarea/Textarea.module.cjs.js +1 -1
- package/dist/cjs/Link/Link.module.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModal.module.cjs.js +1 -1
- package/dist/cjs/Notifications/SlideInModal/SlideInModal.module.cjs.js +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.cjs.js +1 -1
- package/dist/cjs/Popover/Popover.cjs.js +1 -1
- package/dist/cjs/Popover/Popover.cjs.js.map +1 -1
- package/dist/cjs/Popover/Popover.module.cjs.js +1 -1
- package/dist/cjs/Stepper/Step.cjs.js +1 -1
- package/dist/cjs/Stepper/Step.cjs.js.map +1 -1
- package/dist/cjs/Stepper/Step.module.cjs.js +1 -1
- package/dist/cjs/Stepper/Stepper.cjs.js +1 -1
- package/dist/cjs/Stepper/Stepper.cjs.js.map +1 -1
- package/dist/cjs/Tabs/TabButton.module.cjs.js +1 -1
- package/dist/cjs/TextEllipsis/TextEllipsis.module.cjs.js +1 -1
- package/dist/cjs/Tiles/Tile.module.cjs.js +1 -1
- package/dist/cjs/Tooltip/Tooltip.module.cjs.js +1 -1
- package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.module.cjs.js +1 -1
- package/dist/cjs/src/.scope.d.ts +2 -0
- package/dist/cjs/src/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/cjs/src/components/ContextMenu/ContextMenuService.d.ts +4 -1
- package/dist/cjs/src/components/Form/Select/Option.d.ts +1 -0
- package/dist/cjs/src/components/Form/Select/Select.d.ts +20 -0
- package/dist/cjs/src/components/Form/Select/Select.interfaces.d.ts +3 -1
- package/dist/cjs/src/components/Form/Select/Select.test.d.ts +63 -1
- package/dist/cjs/src/components/Form/Select/SelectKeyboardNavigation.test.d.ts +1 -0
- package/dist/cjs/src/components/Form/Select/SelectService.d.ts +3 -2
- package/dist/cjs/src/components/Stepper/Stepper.d.ts +0 -1
- package/dist/cjs/src/hooks/usePosition.cjs.js.map +1 -1
- package/dist/cjs/src/hooks/usePosition.d.ts +1 -1
- package/dist/esm/Button/Button.module.esm.js +1 -1
- package/dist/esm/Button/IconButton.module.esm.js +1 -1
- package/dist/esm/ContextMenu/ContextMenu.esm.js +1 -1
- package/dist/esm/ContextMenu/ContextMenu.esm.js.map +1 -1
- package/dist/esm/ContextMenu/ContextMenuItem.module.esm.js +1 -1
- package/dist/esm/ContextMenu/ContextMenuService.esm.js +1 -1
- package/dist/esm/ContextMenu/ContextMenuService.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridActions/DataGridColumnsToggle.module.esm.js +1 -1
- package/dist/esm/Form/Input/Input.module.esm.js +1 -1
- package/dist/esm/Form/Select/Option.esm.js +1 -1
- package/dist/esm/Form/Select/Option.esm.js.map +1 -1
- package/dist/esm/Form/Select/Select.esm.js +1 -1
- package/dist/esm/Form/Select/Select.esm.js.map +1 -1
- package/dist/esm/Form/Select/Select.module.esm.js +1 -1
- package/dist/esm/Form/Select/SelectService.esm.js +1 -1
- package/dist/esm/Form/Select/SelectService.esm.js.map +1 -1
- package/dist/esm/Form/Textarea/Textarea.module.esm.js +1 -1
- package/dist/esm/Link/Link.module.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModal.module.esm.js +1 -1
- package/dist/esm/Notifications/SlideInModal/SlideInModal.module.esm.js +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.esm.js +1 -1
- package/dist/esm/Popover/Popover.esm.js +1 -1
- package/dist/esm/Popover/Popover.esm.js.map +1 -1
- package/dist/esm/Popover/Popover.module.esm.js +1 -1
- package/dist/esm/Stepper/Step.esm.js +1 -1
- package/dist/esm/Stepper/Step.esm.js.map +1 -1
- package/dist/esm/Stepper/Step.module.esm.js +1 -1
- package/dist/esm/Stepper/Stepper.esm.js +1 -1
- package/dist/esm/Stepper/Stepper.esm.js.map +1 -1
- package/dist/esm/Tabs/TabButton.module.esm.js +1 -1
- package/dist/esm/TextEllipsis/TextEllipsis.module.esm.js +1 -1
- package/dist/esm/Tiles/Tile.module.esm.js +1 -1
- package/dist/esm/Tooltip/Tooltip.module.esm.js +1 -1
- package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.module.esm.js +1 -1
- package/dist/esm/src/.scope.d.ts +2 -0
- package/dist/esm/src/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/esm/src/components/ContextMenu/ContextMenuService.d.ts +4 -1
- package/dist/esm/src/components/Form/Select/Option.d.ts +1 -0
- package/dist/esm/src/components/Form/Select/Select.d.ts +20 -0
- package/dist/esm/src/components/Form/Select/Select.interfaces.d.ts +3 -1
- package/dist/esm/src/components/Form/Select/Select.test.d.ts +63 -1
- package/dist/esm/src/components/Form/Select/SelectKeyboardNavigation.test.d.ts +1 -0
- package/dist/esm/src/components/Form/Select/SelectService.d.ts +3 -2
- package/dist/esm/src/components/Stepper/Stepper.d.ts +0 -1
- package/dist/esm/src/hooks/usePosition.d.ts +1 -1
- package/dist/esm/src/hooks/usePosition.esm.js.map +1 -1
- package/package.json +48 -45
- package/src/{hooks/useWrapper.test.ts → .scope.ts} +1 -12
- package/src/components/ContextMenu/ContextMenu.tsx +13 -23
- package/src/components/ContextMenu/ContextMenuService.ts +47 -1
- package/src/components/Form/Select/Option.tsx +3 -1
- package/src/components/Form/Select/Select.interfaces.ts +3 -1
- package/src/components/Form/Select/Select.module.scss +55 -34
- package/src/components/Form/Select/Select.tsx +74 -23
- package/src/components/Form/Select/SelectService.ts +26 -10
- package/src/components/Link/Link.module.scss +16 -0
- package/src/components/Popover/Popover.tsx +19 -2
- package/src/components/Stepper/Step.tsx +2 -1
- package/src/components/Stepper/Stepper.tsx +0 -2
- package/src/components/Tooltip/Tooltip.module.scss +1 -0
- package/src/hooks/usePosition.ts +1 -1
- package/src/interfaces.ts +2 -2
- package/src/mixins.module.scss +2 -4
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +0 -64
- package/src/components/Button/BaseButton.test.tsx +0 -133
- package/src/components/Button/Button.test.tsx +0 -150
- package/src/components/Button/IconButton.test.tsx +0 -106
- package/src/components/ContextMenu/ContextMenu.test.tsx +0 -358
- package/src/components/DataGrid/DataGrid.test.tsx +0 -437
- package/src/components/DataGrid/DataGridActions/DataGridActions.test.tsx +0 -204
- package/src/components/DataGrid/DataGridActions/DataGridColumnsToggle.test.tsx +0 -99
- package/src/components/DataGrid/DataGridBody/DataGridBody.test.tsx +0 -140
- package/src/components/DataGrid/DataGridBody/DataGridCell.test.tsx +0 -90
- package/src/components/DataGrid/DataGridBody/DataGridRow.test.tsx +0 -117
- package/src/components/DataGrid/DataGridHeader/DataGridHeader.test.tsx +0 -276
- package/src/components/DataGrid/DataGridHeader/DataGridHeaderCell.test.tsx +0 -144
- package/src/components/Form/Checkbox/Checkbox.test.tsx +0 -308
- package/src/components/Form/Fieldset/Fieldset.test.tsx +0 -127
- package/src/components/Form/FileUpload/FileItem/FileItem.test.tsx +0 -103
- package/src/components/Form/FileUpload/FileUpload.test.tsx +0 -374
- package/src/components/Form/Form.test.tsx +0 -63
- package/src/components/Form/FormControl/FormControl.test.tsx +0 -98
- package/src/components/Form/FormGroup/FormGroup.test.tsx +0 -127
- package/src/components/Form/FormHelperText/FormHelperText.test.tsx +0 -84
- package/src/components/Form/FormSelectorWrapper/FormSelectorWrapper.test.tsx +0 -94
- package/src/components/Form/Input/Input.test.tsx +0 -267
- package/src/components/Form/Label/Label.test.tsx +0 -68
- package/src/components/Form/Radio/Radio.test.tsx +0 -130
- package/src/components/Form/Select/Option.test.tsx +0 -57
- package/src/components/Form/Select/Select.test.tsx +0 -564
- package/src/components/Form/Textarea/Textarea.test.tsx +0 -124
- package/src/components/Form/Toggle/Toggle.test.tsx +0 -200
- package/src/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.tsx +0 -141
- package/src/components/Form/Wrapper/InputWrapper/InputWrapper.test.tsx +0 -211
- package/src/components/Form/Wrapper/RadioWrapper/RadioWrapper.test.tsx +0 -117
- package/src/components/Form/Wrapper/SelectWrapper/SelectWrapper.test.tsx +0 -186
- package/src/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.test.tsx +0 -173
- package/src/components/Form/Wrapper/Wrapper/Wrapper.test.tsx +0 -59
- package/src/components/Icon/Icon.test.tsx +0 -83
- package/src/components/Link/Link.test.tsx +0 -203
- package/src/components/Notifications/Banner/Banner.test.tsx +0 -84
- package/src/components/Notifications/BaseModal/BaseModal.test.tsx +0 -194
- package/src/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.test.tsx +0 -74
- package/src/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.test.tsx +0 -71
- package/src/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.test.tsx +0 -74
- package/src/components/Notifications/Dialog/Dialog.test.tsx +0 -118
- package/src/components/Notifications/Dialog/DialogActions/DialogActions.test.tsx +0 -61
- package/src/components/Notifications/Dialog/DialogTitle/DialogTitle.test.tsx +0 -87
- package/src/components/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.test.tsx +0 -111
- package/src/components/Notifications/DiscardChangesModal/DiscardChangesModal.test.tsx +0 -175
- package/src/components/Notifications/Modal/Modal.test.tsx +0 -18
- package/src/components/Notifications/NotificationProvider/NotificationContext.test.tsx +0 -449
- package/src/components/Notifications/SlideInModal/SlideInModal.test.tsx +0 -90
- package/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.tsx +0 -53
- package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.tsx +0 -77
- package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.tsx +0 -219
- package/src/components/Notifications/Snackbar/useSnackbar.test.tsx +0 -136
- package/src/components/Pagination/Pagination.test.tsx +0 -183
- package/src/components/Popover/Popover.test.tsx +0 -103
- package/src/components/ProgressBar/ProgressBar.test.tsx +0 -91
- package/src/components/Skeleton/Skeleton.test.tsx +0 -112
- package/src/components/StatusIndicator/StatusIndicator.test.tsx +0 -143
- package/src/components/Stepper/Stepper.test.tsx +0 -83
- package/src/components/Tabs/Tab.test.tsx +0 -49
- package/src/components/Tabs/TabButton.test.tsx +0 -65
- package/src/components/Tabs/Tabs.test.tsx +0 -291
- package/src/components/Tag/Tag.test.tsx +0 -89
- package/src/components/TextEllipsis/TextEllipsis.test.tsx +0 -96
- package/src/components/Tiles/Tile.test.tsx +0 -183
- package/src/components/Tiles/Tiles.test.tsx +0 -162
- package/src/components/Tooltip/Tooltip.test.tsx +0 -390
- package/src/components/Typography/Typography.test.tsx +0 -177
- package/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.test.tsx +0 -90
- package/src/components/Wizard/Wizard.test.tsx +0 -218
- package/src/components/Wizard/WizardActions/WizardActions.test.tsx +0 -187
- package/src/components/Wizard/WizardSteps/WizardSteps.test.tsx +0 -125
- package/src/components/_BaseStyling_/BaseStyling.test.tsx +0 -55
- package/src/hooks/useAnimation.test.tsx +0 -65
- package/src/hooks/useBodyClick.test.tsx +0 -55
- package/src/hooks/useDebouncedCallback.test.ts +0 -150
- package/src/hooks/useDetermineStatusIcon.test.ts +0 -28
- package/src/hooks/useFormSelector.test.ts +0 -56
- package/src/hooks/usePosition.test.tsx +0 -510
- package/src/hooks/useRepeater.test.tsx +0 -156
- package/src/hooks/useScroll.test.tsx +0 -36
- package/src/hooks/useSpacing.test.ts +0 -86
- package/src/hooks/useUploadFile.test.ts +0 -211
- package/src/util/helper.test.tsx +0 -403
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"homepage": "http://onewelcome.github.io/react-lib-components",
|
|
3
3
|
"name": "@onewelcome/react-lib-components",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.1.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "OneWelcome B.V.",
|
|
7
7
|
"main": "dist/cjs/src/index.cjs.js",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"typings": "dist/cjs/src/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"src"
|
|
12
|
+
"src",
|
|
13
|
+
"!*/**/*.test.tsx",
|
|
14
|
+
"!*/**/*.test.ts"
|
|
13
15
|
],
|
|
14
16
|
"sideEffects": [
|
|
15
17
|
"*.css",
|
|
@@ -50,8 +52,8 @@
|
|
|
50
52
|
"node": ">=16"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"@babel/core": "^7.23.
|
|
54
|
-
"@babel/preset-env": "^7.23.
|
|
55
|
+
"@babel/core": "^7.23.9",
|
|
56
|
+
"@babel/preset-env": "^7.23.9",
|
|
55
57
|
"@babel/preset-react": "^7.23.3",
|
|
56
58
|
"@babel/preset-typescript": "^7.23.3",
|
|
57
59
|
"@mdx-js/react": "^3.0.0",
|
|
@@ -59,74 +61,75 @@
|
|
|
59
61
|
"@onewelcome/storybook-addon-basestyling": "^1.0.0",
|
|
60
62
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
61
63
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
62
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
63
|
-
"@storybook/addon-a11y": "^7.
|
|
64
|
-
"@storybook/addon-actions": "^7.
|
|
65
|
-
"@storybook/addon-docs": "^7.
|
|
66
|
-
"@storybook/addon-essentials": "^7.
|
|
67
|
-
"@storybook/addon-interactions": "^7.
|
|
68
|
-
"@storybook/addon-links": "^7.
|
|
69
|
-
"@storybook/blocks": "^7.
|
|
70
|
-
"@storybook/components": "^7.
|
|
64
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
65
|
+
"@storybook/addon-a11y": "^7.6.10",
|
|
66
|
+
"@storybook/addon-actions": "^7.6.10",
|
|
67
|
+
"@storybook/addon-docs": "^7.6.10",
|
|
68
|
+
"@storybook/addon-essentials": "^7.6.10",
|
|
69
|
+
"@storybook/addon-interactions": "^7.6.10",
|
|
70
|
+
"@storybook/addon-links": "^7.6.10",
|
|
71
|
+
"@storybook/blocks": "^7.6.10",
|
|
72
|
+
"@storybook/components": "^7.6.10",
|
|
71
73
|
"@storybook/jest": "^0.2.3",
|
|
72
|
-
"@storybook/manager-api": "^7.
|
|
73
|
-
"@storybook/react": "^7.
|
|
74
|
-
"@storybook/react-webpack5": "^7.
|
|
74
|
+
"@storybook/manager-api": "^7.6.10",
|
|
75
|
+
"@storybook/react": "^7.6.10",
|
|
76
|
+
"@storybook/react-webpack5": "^7.6.10",
|
|
75
77
|
"@storybook/testing-library": "^0.2.2",
|
|
76
|
-
"@storybook/theming": "^7.
|
|
77
|
-
"@testing-library/dom": "^9.3.
|
|
78
|
-
"@testing-library/jest-dom": "^6.
|
|
79
|
-
"@testing-library/react": "^14.
|
|
80
|
-
"@testing-library/user-event": "^14.5.
|
|
81
|
-
"@types/jest": "^29.5.
|
|
78
|
+
"@storybook/theming": "^7.6.10",
|
|
79
|
+
"@testing-library/dom": "^9.3.4",
|
|
80
|
+
"@testing-library/jest-dom": "^6.3.0",
|
|
81
|
+
"@testing-library/react": "^14.1.2",
|
|
82
|
+
"@testing-library/user-event": "^14.5.2",
|
|
83
|
+
"@types/jest": "^29.5.11",
|
|
82
84
|
"@types/mdx": "^2.0.10",
|
|
83
|
-
"@types/react": "^18.2.
|
|
84
|
-
"@types/react-dom": "^18.2.
|
|
85
|
+
"@types/react": "^18.2.48",
|
|
86
|
+
"@types/react-dom": "^18.2.18",
|
|
85
87
|
"@types/react-router": "^5.1.20",
|
|
86
88
|
"@types/react-router-dom": "^5.3.3",
|
|
87
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
88
|
-
"@typescript-eslint/parser": "^6.
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
|
90
|
+
"@typescript-eslint/parser": "^6.19.1",
|
|
89
91
|
"babel-loader": "^9.1.3",
|
|
90
|
-
"chromatic": "^
|
|
91
|
-
"css-loader": "^6.
|
|
92
|
-
"eslint": "^8.
|
|
93
|
-
"eslint-config-prettier": "^9.
|
|
92
|
+
"chromatic": "^10.6.0",
|
|
93
|
+
"css-loader": "^6.9.1",
|
|
94
|
+
"eslint": "^8.56.0",
|
|
95
|
+
"eslint-config-prettier": "^9.1.0",
|
|
94
96
|
"eslint-plugin-cypress": "^2.15.1",
|
|
95
|
-
"eslint-plugin-
|
|
97
|
+
"eslint-plugin-export-scope": "^2.0.3",
|
|
98
|
+
"eslint-plugin-jest": "^27.6.3",
|
|
96
99
|
"eslint-plugin-license-header": "^0.6.0",
|
|
97
|
-
"eslint-plugin-prettier": "^5.
|
|
100
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
98
101
|
"eslint-plugin-react": "^7.33.2",
|
|
99
102
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
100
103
|
"eslint-plugin-storybook": "^0.6.15",
|
|
101
|
-
"husky": "^
|
|
104
|
+
"husky": "^9.0.6",
|
|
102
105
|
"identity-obj-proxy": "^3.0.0",
|
|
103
106
|
"jest": "^29.7.0",
|
|
104
107
|
"jest-environment-jsdom": "^29.7.0",
|
|
105
108
|
"jest-junit": "^16.0.0",
|
|
106
109
|
"jest-sonar-reporter": "^2.0.0",
|
|
107
|
-
"lint-staged": "^15.0
|
|
108
|
-
"mini-css-extract-plugin": "^2.7.
|
|
110
|
+
"lint-staged": "^15.2.0",
|
|
111
|
+
"mini-css-extract-plugin": "^2.7.7",
|
|
109
112
|
"npm-run-all": "^4.1.5",
|
|
110
|
-
"postcss": "^8.4.
|
|
113
|
+
"postcss": "^8.4.33",
|
|
111
114
|
"postcss-modules": "^6.0.0",
|
|
112
115
|
"postcss-url": "^10.1.3",
|
|
113
|
-
"prettier": "^3.
|
|
116
|
+
"prettier": "^3.2.4",
|
|
114
117
|
"react": "^18.2.0",
|
|
115
118
|
"react-dom": "^18.2.0",
|
|
116
119
|
"react-is": "^18.2.0",
|
|
117
|
-
"react-router-dom": "^6.
|
|
120
|
+
"react-router-dom": "^6.21.3",
|
|
118
121
|
"remark-gfm": "^4.0.0",
|
|
119
122
|
"rollup": "^2.79.1",
|
|
120
123
|
"rollup-plugin-postcss": "^4.0.2",
|
|
121
124
|
"rollup-plugin-terser": "^7.0.2",
|
|
122
|
-
"sass": "^1.
|
|
123
|
-
"sass-loader": "^
|
|
124
|
-
"size-limit": "^
|
|
125
|
-
"storybook": "^7.
|
|
125
|
+
"sass": "^1.70.0",
|
|
126
|
+
"sass-loader": "^14.0.0",
|
|
127
|
+
"size-limit": "^11.0.2",
|
|
128
|
+
"storybook": "^7.6.10",
|
|
126
129
|
"storybook-addon-pseudo-states": "^2.1.2",
|
|
127
|
-
"style-loader": "^3.3.
|
|
128
|
-
"ts-jest": "^29.1.
|
|
130
|
+
"style-loader": "^3.3.4",
|
|
131
|
+
"ts-jest": "^29.1.2",
|
|
129
132
|
"tslib": "^2.6.2",
|
|
130
|
-
"typescript": "^5.3.
|
|
133
|
+
"typescript": "^5.3.3"
|
|
131
134
|
}
|
|
132
135
|
}
|
|
@@ -14,15 +14,4 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
import { useWrapper } from "./useWrapper";
|
|
19
|
-
|
|
20
|
-
describe("it should give the correct results based on no value, no placeholder and default text input", () => {
|
|
21
|
-
it("should execute correctly", () => {
|
|
22
|
-
const { result } = renderHook(() => useWrapper());
|
|
23
|
-
|
|
24
|
-
expect(result.current.helperId).toHaveLength(20);
|
|
25
|
-
expect(result.current.errorId).toHaveLength(20);
|
|
26
|
-
expect(result.current.labelId).toHaveLength(20);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
17
|
+
export default "*";
|
|
@@ -35,7 +35,8 @@ import { useBodyClick } from "../../hooks/useBodyClick";
|
|
|
35
35
|
import { Props as ContextMenuItemProps } from "./ContextMenuItem";
|
|
36
36
|
import { createPortal } from "react-dom";
|
|
37
37
|
import { useGetDomRoot } from "../../hooks/useGetDomRoot";
|
|
38
|
-
import { useArrowNavigation, useDefaultOffset } from "./ContextMenuService";
|
|
38
|
+
import { useArrowNavigation, useDefaultOffset, useFocusAnchorElement } from "./ContextMenuService";
|
|
39
|
+
import { generateID } from "../../util/helper";
|
|
39
40
|
|
|
40
41
|
export interface Props extends Omit<ComponentPropsWithRef<"div">, "onChange"> {
|
|
41
42
|
trigger: ReactElement<ButtonProps> | ReactElement<IconButtonProps>;
|
|
@@ -45,7 +46,7 @@ export interface Props extends Omit<ComponentPropsWithRef<"div">, "onChange"> {
|
|
|
45
46
|
transformOrigin?: Placement;
|
|
46
47
|
offset?: Offset;
|
|
47
48
|
debounceAmount?: number;
|
|
48
|
-
id
|
|
49
|
+
id?: string;
|
|
49
50
|
show?: boolean;
|
|
50
51
|
domRoot?: HTMLElement;
|
|
51
52
|
onShow?: () => void;
|
|
@@ -60,7 +61,7 @@ const ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
|
60
61
|
trigger,
|
|
61
62
|
children,
|
|
62
63
|
decorativeElement,
|
|
63
|
-
id
|
|
64
|
+
id = `ID-${generateID()}`,
|
|
64
65
|
show = false,
|
|
65
66
|
onShow,
|
|
66
67
|
onClose,
|
|
@@ -79,7 +80,6 @@ const ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
|
79
80
|
const anchorEl = useRef<HTMLButtonElement>(null);
|
|
80
81
|
const wrappingDivRef = (ref as RefObject<HTMLDivElement>) || createRef<HTMLDivElement>();
|
|
81
82
|
const [showContextMenu, setShowContextMenu] = useState(show);
|
|
82
|
-
const [hasBeenClosed, setHasBeenClosed] = useState(false);
|
|
83
83
|
const [selectedContextMenuItem, setSelectedContextMenuItem] = useState(-1);
|
|
84
84
|
const [focusedContextMenuItem, setFocusedContextMenuItem] = useState(-1);
|
|
85
85
|
const [shouldClick, setShouldClick] =
|
|
@@ -90,10 +90,6 @@ const ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
|
90
90
|
|
|
91
91
|
const { root } = useGetDomRoot(domRoot, wrappingDivRef);
|
|
92
92
|
|
|
93
|
-
if (!id) {
|
|
94
|
-
throw new Error("You need to provide an ID to the context menu");
|
|
95
|
-
}
|
|
96
|
-
|
|
97
93
|
const syncSelectedContextMenuItem = setSelectedContextMenuItem;
|
|
98
94
|
|
|
99
95
|
useEffect(() => {
|
|
@@ -128,21 +124,15 @@ const ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
|
128
124
|
showContextMenu
|
|
129
125
|
);
|
|
130
126
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// otherwise pressing enter wouldn't fire the primary action of the modal.
|
|
141
|
-
if (document.activeElement?.closest(`.${wrappingDivRef.current?.className}`)) {
|
|
142
|
-
hasBeenClosed && anchorEl.current && anchorEl.current.focus();
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}, [showContextMenu]);
|
|
127
|
+
useFocusAnchorElement(
|
|
128
|
+
anchorEl,
|
|
129
|
+
id,
|
|
130
|
+
showContextMenu,
|
|
131
|
+
setShowContextMenu,
|
|
132
|
+
setFocusedContextMenuItem,
|
|
133
|
+
onShow,
|
|
134
|
+
onClose
|
|
135
|
+
);
|
|
146
136
|
|
|
147
137
|
const renderTrigger = () =>
|
|
148
138
|
React.cloneElement(trigger, {
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { SetStateAction, useEffect } from "react";
|
|
18
|
+
import { horizontal, Offset, Placement, vertical } from "../../hooks/usePosition";
|
|
18
19
|
import { remToPx } from "../../util/helper";
|
|
19
20
|
|
|
20
21
|
interface UseArrowNavigation {
|
|
@@ -28,6 +29,7 @@ interface UseArrowNavigation {
|
|
|
28
29
|
setShouldClick: React.Dispatch<React.SetStateAction<boolean>>;
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
/** @scope . */
|
|
31
33
|
export const useArrowNavigation = ({
|
|
32
34
|
selectedContextMenuItem,
|
|
33
35
|
setSelectedContextMenuItem,
|
|
@@ -123,3 +125,47 @@ export const useDefaultOffset = () => {
|
|
|
123
125
|
|
|
124
126
|
return { calculateDefaultOffset };
|
|
125
127
|
};
|
|
128
|
+
|
|
129
|
+
export const useFocusAnchorElement = (
|
|
130
|
+
anchorEl: React.RefObject<HTMLElement>,
|
|
131
|
+
id: string,
|
|
132
|
+
showContextMenu: boolean,
|
|
133
|
+
setShowContextMenu: React.Dispatch<SetStateAction<boolean>>,
|
|
134
|
+
setFocusedContextMenuItem: React.Dispatch<SetStateAction<number>>,
|
|
135
|
+
onShow?: () => void,
|
|
136
|
+
onClose?: () => void
|
|
137
|
+
) => {
|
|
138
|
+
const handleEscapeKeyPress = (e: KeyboardEvent) => {
|
|
139
|
+
if (e.key === "Escape") {
|
|
140
|
+
setShowContextMenu(false);
|
|
141
|
+
anchorEl.current?.focus();
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const escapeKeyEventHandlerManager = () => {
|
|
146
|
+
if (showContextMenu) {
|
|
147
|
+
document.addEventListener("keydown", handleEscapeKeyPress);
|
|
148
|
+
} else {
|
|
149
|
+
document.removeEventListener("keydown", handleEscapeKeyPress);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const emitContextMenuEvent = () => {
|
|
154
|
+
if (showContextMenu) {
|
|
155
|
+
onShow?.();
|
|
156
|
+
} else {
|
|
157
|
+
onClose?.();
|
|
158
|
+
|
|
159
|
+
if (document.activeElement?.closest(`#${id}-menu`)) {
|
|
160
|
+
anchorEl.current?.focus();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
setFocusedContextMenuItem(-1);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
escapeKeyEventHandlerManager();
|
|
169
|
+
emitContextMenuEvent();
|
|
170
|
+
}, [showContextMenu]);
|
|
171
|
+
};
|
|
@@ -37,6 +37,7 @@ export interface Props extends ComponentPropsWithRef<"li"> {
|
|
|
37
37
|
childIndex?: number;
|
|
38
38
|
onOptionSelect?: (ref: React.RefObject<HTMLLIElement>) => void;
|
|
39
39
|
onFocusChange?: (childIndex: number) => void;
|
|
40
|
+
isAddBtnFocused?: boolean;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
const OptionComponent: ForwardRefRenderFunction<HTMLLIElement, Props> = (
|
|
@@ -53,6 +54,7 @@ const OptionComponent: ForwardRefRenderFunction<HTMLLIElement, Props> = (
|
|
|
53
54
|
onFocusChange,
|
|
54
55
|
disabled,
|
|
55
56
|
value,
|
|
57
|
+
isAddBtnFocused,
|
|
56
58
|
...rest
|
|
57
59
|
}: Props,
|
|
58
60
|
ref
|
|
@@ -66,7 +68,7 @@ const OptionComponent: ForwardRefRenderFunction<HTMLLIElement, Props> = (
|
|
|
66
68
|
}, [isSelected, shouldClick]);
|
|
67
69
|
|
|
68
70
|
useEffect(() => {
|
|
69
|
-
if (innerOptionRef.current && hasFocus && selectOpened && !isSearching) {
|
|
71
|
+
if (innerOptionRef.current && hasFocus && selectOpened && !isSearching && !isAddBtnFocused) {
|
|
70
72
|
onFocusChange && childIndex && onFocusChange(childIndex);
|
|
71
73
|
innerOptionRef.current.focus();
|
|
72
74
|
}
|
|
@@ -29,11 +29,13 @@ export interface UseArrowNavigationParams {
|
|
|
29
29
|
setShouldClick: React.Dispatch<React.SetStateAction<boolean>>;
|
|
30
30
|
onOptionChangeHandler: (optionElement: HTMLElement | null) => void;
|
|
31
31
|
searchInputRef: React.RefObject<HTMLInputElement>;
|
|
32
|
-
|
|
32
|
+
addBtnRef?: React.RefObject<HTMLButtonElement>;
|
|
33
|
+
renderThreshold: number;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export interface UseSelectPositionListParams {
|
|
36
37
|
expanded: boolean;
|
|
37
38
|
optionListReference: React.RefObject<HTMLDivElement>;
|
|
38
39
|
containerReference: React.RefObject<HTMLDivElement>;
|
|
40
|
+
addBtnRef: React.RefObject<HTMLButtonElement>;
|
|
39
41
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@use "src/mixins.module";
|
|
18
18
|
@use "src/variables";
|
|
19
19
|
|
|
20
|
-
$listItemHeight: 2.
|
|
20
|
+
$listItemHeight: 2.5rem;
|
|
21
21
|
|
|
22
22
|
.select {
|
|
23
23
|
position: relative;
|
|
@@ -92,9 +92,7 @@ $listItemHeight: 2.125rem;
|
|
|
92
92
|
border-style: var(--input-border-style);
|
|
93
93
|
border-width: var(--input-border-width);
|
|
94
94
|
border-radius: var(--input-border-radius);
|
|
95
|
-
box-shadow:
|
|
96
|
-
box-shadow: 0px 3px 14px 0px #0105321f;
|
|
97
|
-
box-shadow: 0px 8px 10px 0px #01053224;
|
|
95
|
+
box-shadow: 0 8px 10px 0 #01053224;
|
|
98
96
|
position: absolute;
|
|
99
97
|
z-index: variables.$select-z-index;
|
|
100
98
|
top: 44px;
|
|
@@ -113,39 +111,28 @@ $listItemHeight: 2.125rem;
|
|
|
113
111
|
border-radius: var(--input-border-radius);
|
|
114
112
|
color: var(--default);
|
|
115
113
|
text-align: left;
|
|
116
|
-
max-height: calc($listItemHeight * 10);
|
|
117
114
|
|
|
118
115
|
li {
|
|
119
|
-
padding: 0.
|
|
116
|
+
padding: 0.62rem 0.75rem;
|
|
120
117
|
font-size: var(--form-control-font-size);
|
|
121
118
|
margin: 0;
|
|
122
119
|
position: relative;
|
|
123
|
-
line-height:
|
|
120
|
+
line-height: 1.25rem;
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
min-height: $listItemHeight;
|
|
124
123
|
cursor: pointer;
|
|
125
124
|
|
|
126
|
-
&:after {
|
|
127
|
-
content: "";
|
|
128
|
-
position: absolute;
|
|
129
|
-
top: 0;
|
|
130
|
-
left: 0;
|
|
131
|
-
background-color: transparent;
|
|
132
|
-
width: 100%;
|
|
133
|
-
height: 100%;
|
|
134
|
-
opacity: 0.05;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
125
|
&:focus {
|
|
138
126
|
outline: var(--input-border-width-focus) solid var(--color-primary300);
|
|
139
|
-
outline-offset:
|
|
127
|
+
outline-offset: var(--input-border-width-focus);
|
|
140
128
|
}
|
|
141
129
|
|
|
142
|
-
&:hover
|
|
143
|
-
|
|
144
|
-
background-color: var(--color-primary);
|
|
130
|
+
&:hover {
|
|
131
|
+
background-color: var(--color-blue-grey50);
|
|
145
132
|
}
|
|
146
133
|
|
|
147
|
-
&:active
|
|
148
|
-
|
|
134
|
+
&:active {
|
|
135
|
+
background-color: var(--color-blue-grey100);
|
|
149
136
|
}
|
|
150
137
|
|
|
151
138
|
&.disabled {
|
|
@@ -157,17 +144,19 @@ $listItemHeight: 2.125rem;
|
|
|
157
144
|
}
|
|
158
145
|
}
|
|
159
146
|
|
|
147
|
+
ul.has-sibling {
|
|
148
|
+
padding-bottom: 2px;
|
|
149
|
+
}
|
|
150
|
+
|
|
160
151
|
.selected-option {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
border-left: 0.25rem solid var(--color-primary);
|
|
170
|
-
}
|
|
152
|
+
content: "";
|
|
153
|
+
position: absolute;
|
|
154
|
+
top: 0;
|
|
155
|
+
left: 0;
|
|
156
|
+
height: 100%;
|
|
157
|
+
border-top-right-radius: 0.125rem;
|
|
158
|
+
border-bottom-right-radius: 0.125rem;
|
|
159
|
+
border-left: 0.25rem solid var(--color-primary);
|
|
171
160
|
color: var(--color-primary);
|
|
172
161
|
}
|
|
173
162
|
|
|
@@ -178,6 +167,38 @@ $listItemHeight: 2.125rem;
|
|
|
178
167
|
pointer-events: none;
|
|
179
168
|
}
|
|
180
169
|
|
|
170
|
+
.action-button {
|
|
171
|
+
border: none;
|
|
172
|
+
border-top: 1px solid var(--color-blue-grey50);
|
|
173
|
+
width: 100%;
|
|
174
|
+
height: 2.5rem;
|
|
175
|
+
padding: 0.625rem 0.75rem;
|
|
176
|
+
margin: 0 0 0.25rem;
|
|
177
|
+
background-color: var(--light);
|
|
178
|
+
border-radius: var(--input-border-radius);
|
|
179
|
+
color: var(--default);
|
|
180
|
+
text-align: left;
|
|
181
|
+
box-sizing: border-box;
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
|
|
184
|
+
font-family: var(--font-family);
|
|
185
|
+
font-size: var(--form-control-font-size);
|
|
186
|
+
|
|
187
|
+
&:focus {
|
|
188
|
+
outline: 1px solid;
|
|
189
|
+
outline-offset: 0;
|
|
190
|
+
border-radius: 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&:hover {
|
|
194
|
+
background-color: var(--color-blue-grey50);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&:active {
|
|
198
|
+
background-color: var(--color-blue-grey100);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
181
202
|
.status {
|
|
182
203
|
position: absolute;
|
|
183
204
|
top: 50%;
|