@onewelcome/react-lib-components 0.3.0 → 1.0.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/LICENSE +202 -21
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/Button/BaseButton.d.ts +1 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/IconButton.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ContextMenu/ContextMenuItem.d.ts +1 -1
- package/dist/DataGrid/DataGridActions/DataGridActions.d.ts +1 -1
- package/dist/DataGrid/DataGridActions/DataGridColumnsToggle.d.ts +1 -1
- package/dist/DataGrid/DataGridBody/DataGridCell.d.ts +1 -1
- package/dist/DataGrid/DataGridBody/DataGridRow.d.ts +1 -1
- package/dist/DataGrid/DataGridHeader/DataGridHeader.d.ts +1 -1
- package/dist/DataGrid/DataGridHeader/DataGridHeaderCell.d.ts +1 -1
- package/dist/Form/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Form/Fieldset/Fieldset.d.ts +1 -1
- package/dist/Form/FormControl/FormControl.d.ts +1 -1
- package/dist/Form/FormGroup/FormGroup.d.ts +1 -1
- package/dist/Form/FormHelperText/FormHelperText.d.ts +1 -1
- package/dist/Form/FormSelectorWrapper/FormSelectorWrapper.d.ts +1 -1
- package/dist/Form/Input/Input.d.ts +2 -3
- package/dist/Form/Label/Label.d.ts +1 -1
- package/dist/Form/Radio/Radio.d.ts +1 -1
- package/dist/Form/Select/Option.d.ts +1 -1
- package/dist/Form/Select/Select.d.ts +1 -2
- package/dist/Form/Select/Select.interfaces.d.ts +22 -0
- package/dist/Form/Select/SelectService.d.ts +12 -0
- package/dist/Form/Textarea/Textarea.d.ts +1 -1
- package/dist/Form/Toggle/Toggle.d.ts +1 -1
- package/dist/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.d.ts +1 -1
- package/dist/Form/Wrapper/InputWrapper/InputWrapper.d.ts +1 -1
- package/dist/Form/Wrapper/RadioWrapper/RadioWrapper.d.ts +1 -1
- package/dist/Form/Wrapper/SelectWrapper/SelectWrapper.d.ts +1 -2
- package/dist/Form/Wrapper/TextareaWrapper/TextareaWrapper.d.ts +1 -1
- package/dist/Form/Wrapper/Wrapper/Wrapper.d.ts +1 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/Link/Link.d.ts +3 -4
- package/dist/Notifications/BaseModal/BaseModal.d.ts +1 -1
- package/dist/Notifications/BaseModal/BaseModalActions/BaseModalActions.d.ts +2 -2
- package/dist/Notifications/BaseModal/BaseModalContent/BaseModalContent.d.ts +1 -1
- package/dist/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.d.ts +2 -2
- package/dist/Notifications/Dialog/Dialog.d.ts +1 -1
- package/dist/Notifications/Dialog/DialogActions/DialogActions.d.ts +1 -1
- package/dist/Notifications/Dialog/DialogTitle/DialogTitle.d.ts +1 -1
- package/dist/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.d.ts +1 -1
- package/dist/Notifications/SlideInModal/SlideInModal.d.ts +1 -1
- package/dist/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +11 -0
- package/dist/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +3 -0
- package/dist/Notifications/Snackbar/useSnackbar.d.ts +5 -1
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Popover/Popover.d.ts +1 -1
- package/dist/Skeleton/Skeleton.d.ts +1 -1
- package/dist/StatusIndicator/StatusIndicator.d.ts +1 -1
- package/dist/Tabs/TabButton.d.ts +1 -1
- package/dist/Tabs/TabPanel.d.ts +1 -1
- package/dist/TextEllipsis/TextEllipsis.d.ts +1 -1
- package/dist/Tiles/Tile.d.ts +1 -1
- package/dist/Tiles/Tiles.d.ts +1 -1
- package/dist/Tooltip/Tooltip.d.ts +1 -1
- package/dist/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +1 -2
- package/dist/Wizard/Wizard.d.ts +0 -1
- package/dist/Wizard/WizardSteps/WizardSteps.d.ts +1 -1
- package/dist/Wizard/wizardStateReducer.d.ts +1 -3
- package/dist/_BaseStyling_/BaseStyling.d.ts +10 -4
- package/dist/react-lib-components.cjs.development.js +1158 -1559
- package/dist/react-lib-components.cjs.development.js.map +1 -1
- package/dist/react-lib-components.cjs.production.min.js +1 -1
- package/dist/react-lib-components.cjs.production.min.js.map +1 -1
- package/dist/react-lib-components.esm.js +1158 -1559
- package/dist/react-lib-components.esm.js.map +1 -1
- package/package.json +31 -24
- package/src/Breadcrumbs/Breadcrumbs.module.scss +16 -0
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +17 -1
- package/src/Breadcrumbs/Breadcrumbs.tsx +18 -2
- package/src/Button/BaseButton.module.scss +16 -0
- package/src/Button/BaseButton.test.tsx +16 -0
- package/src/Button/BaseButton.tsx +16 -0
- package/src/Button/Button.module.scss +16 -0
- package/src/Button/Button.test.tsx +16 -0
- package/src/Button/Button.tsx +16 -0
- package/src/Button/IconButton.module.scss +16 -0
- package/src/Button/IconButton.test.tsx +16 -0
- package/src/Button/IconButton.tsx +16 -0
- package/src/ContextMenu/ContextMenu.module.scss +16 -0
- package/src/ContextMenu/ContextMenu.test.tsx +16 -0
- package/src/ContextMenu/ContextMenu.tsx +16 -0
- package/src/ContextMenu/ContextMenuItem.module.scss +16 -0
- package/src/ContextMenu/ContextMenuItem.tsx +16 -0
- package/src/DataGrid/DataGrid.module.scss +16 -0
- package/src/DataGrid/DataGrid.test.tsx +16 -0
- package/src/DataGrid/DataGrid.tsx +16 -0
- package/src/DataGrid/DataGridActions/DataGridActions.module.scss +16 -0
- package/src/DataGrid/DataGridActions/DataGridActions.test.tsx +16 -0
- package/src/DataGrid/DataGridActions/DataGridActions.tsx +16 -0
- package/src/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss +16 -0
- package/src/DataGrid/DataGridActions/DataGridColumnsToggle.test.tsx +16 -0
- package/src/DataGrid/DataGridActions/DataGridColumnsToggle.tsx +16 -0
- package/src/DataGrid/DataGridBody/DataGridBody.module.scss +16 -0
- package/src/DataGrid/DataGridBody/DataGridBody.test.tsx +16 -0
- package/src/DataGrid/DataGridBody/DataGridBody.tsx +16 -0
- package/src/DataGrid/DataGridBody/DataGridCell.module.scss +16 -0
- package/src/DataGrid/DataGridBody/DataGridCell.test.tsx +16 -0
- package/src/DataGrid/DataGridBody/DataGridCell.tsx +16 -0
- package/src/DataGrid/DataGridBody/DataGridRow.module.scss +16 -0
- package/src/DataGrid/DataGridBody/DataGridRow.test.tsx +16 -0
- package/src/DataGrid/DataGridBody/DataGridRow.tsx +16 -0
- package/src/DataGrid/DataGridHeader/DataGridHeader.module.scss +17 -1
- package/src/DataGrid/DataGridHeader/DataGridHeader.test.tsx +16 -0
- package/src/DataGrid/DataGridHeader/DataGridHeader.tsx +16 -0
- package/src/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss +16 -0
- package/src/DataGrid/DataGridHeader/DataGridHeaderCell.test.tsx +16 -0
- package/src/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +16 -0
- package/src/DataGrid/datagrid.interfaces.ts +16 -0
- package/src/Form/Checkbox/Checkbox.module.scss +20 -6
- package/src/Form/Checkbox/Checkbox.test.tsx +16 -0
- package/src/Form/Checkbox/Checkbox.tsx +16 -0
- package/src/Form/Fieldset/Fieldset.module.scss +16 -0
- package/src/Form/Fieldset/Fieldset.test.tsx +16 -0
- package/src/Form/Fieldset/Fieldset.tsx +21 -3
- package/src/Form/Form.module.scss +16 -0
- package/src/Form/Form.test.tsx +16 -0
- package/src/Form/Form.tsx +16 -0
- package/src/Form/FormControl/FormControl.module.scss +16 -0
- package/src/Form/FormControl/FormControl.test.tsx +16 -0
- package/src/Form/FormControl/FormControl.tsx +16 -0
- package/src/Form/FormGroup/FormGroup.module.scss +16 -0
- package/src/Form/FormGroup/FormGroup.test.tsx +16 -0
- package/src/Form/FormGroup/FormGroup.tsx +17 -1
- package/src/Form/FormHelperText/FormHelperText.module.scss +16 -0
- package/src/Form/FormHelperText/FormHelperText.test.tsx +16 -0
- package/src/Form/FormHelperText/FormHelperText.tsx +16 -0
- package/src/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss +16 -0
- package/src/Form/FormSelectorWrapper/FormSelectorWrapper.test.tsx +16 -0
- package/src/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +16 -0
- package/src/Form/Input/Input.module.scss +64 -5
- package/src/Form/Input/Input.test.tsx +16 -0
- package/src/Form/Input/Input.tsx +19 -57
- package/src/Form/Label/Label.module.scss +16 -0
- package/src/Form/Label/Label.test.tsx +16 -0
- package/src/Form/Label/Label.tsx +16 -0
- package/src/Form/Radio/Radio.module.scss +20 -6
- package/src/Form/Radio/Radio.test.tsx +16 -0
- package/src/Form/Radio/Radio.tsx +16 -0
- package/src/Form/Select/Option.test.tsx +16 -0
- package/src/Form/Select/Option.tsx +16 -0
- package/src/Form/Select/Select.interfaces.ts +39 -0
- package/src/Form/Select/Select.module.scss +28 -13
- package/src/Form/Select/Select.test.tsx +16 -57
- package/src/Form/Select/Select.tsx +36 -190
- package/src/Form/Select/SelectService.ts +204 -0
- package/src/Form/Textarea/Textarea.module.scss +16 -0
- package/src/Form/Textarea/Textarea.test.tsx +16 -0
- package/src/Form/Textarea/Textarea.tsx +16 -0
- package/src/Form/Toggle/Toggle.module.scss +17 -1
- package/src/Form/Toggle/Toggle.test.tsx +16 -0
- package/src/Form/Toggle/Toggle.tsx +16 -0
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss +16 -0
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.tsx +16 -0
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.tsx +16 -0
- package/src/Form/Wrapper/InputWrapper/InputWrapper.module.scss +27 -3
- package/src/Form/Wrapper/InputWrapper/InputWrapper.test.tsx +16 -0
- package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +16 -0
- package/src/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss +16 -0
- package/src/Form/Wrapper/RadioWrapper/RadioWrapper.test.tsx +16 -0
- package/src/Form/Wrapper/RadioWrapper/RadioWrapper.tsx +16 -0
- package/src/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss +16 -0
- package/src/Form/Wrapper/SelectWrapper/SelectWrapper.test.tsx +17 -19
- package/src/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +17 -15
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss +41 -33
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.test.tsx +16 -0
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +23 -7
- package/src/Form/Wrapper/Wrapper/Wrapper.module.scss +37 -21
- package/src/Form/Wrapper/Wrapper/Wrapper.test.tsx +16 -0
- package/src/Form/Wrapper/Wrapper/Wrapper.tsx +16 -0
- package/src/Form/form.interfaces.ts +16 -0
- package/src/Icon/Icon.module.scss +16 -0
- package/src/Icon/Icon.test.tsx +16 -0
- package/src/Icon/Icon.tsx +16 -0
- package/src/Link/Link.module.scss +21 -5
- package/src/Link/Link.test.tsx +16 -0
- package/src/Link/Link.tsx +18 -8
- package/src/Notifications/BaseModal/BaseModal.module.scss +16 -0
- package/src/Notifications/BaseModal/BaseModal.test.tsx +16 -0
- package/src/Notifications/BaseModal/BaseModal.tsx +16 -0
- package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss +16 -0
- package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.test.tsx +16 -0
- package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.tsx +20 -4
- package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss +16 -0
- package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.test.tsx +16 -0
- package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.tsx +16 -0
- package/src/Notifications/BaseModal/BaseModalContext.ts +16 -0
- package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss +16 -0
- package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.test.tsx +16 -0
- package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.tsx +17 -1
- package/src/Notifications/Dialog/Dialog.module.scss +16 -0
- package/src/Notifications/Dialog/Dialog.test.tsx +18 -2
- package/src/Notifications/Dialog/Dialog.tsx +16 -0
- package/src/Notifications/Dialog/DialogActions/DialogActions.module.scss +16 -0
- package/src/Notifications/Dialog/DialogActions/DialogActions.test.tsx +16 -0
- package/src/Notifications/Dialog/DialogActions/DialogActions.tsx +17 -1
- package/src/Notifications/Dialog/DialogTitle/DialogTitle.module.scss +16 -0
- package/src/Notifications/Dialog/DialogTitle/DialogTitle.test.tsx +16 -0
- package/src/Notifications/Dialog/DialogTitle/DialogTitle.tsx +16 -0
- package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.test.tsx +16 -0
- package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.tsx +16 -0
- package/src/Notifications/DiscardChangesModal/DiscardChangesModal.test.tsx +16 -0
- package/src/Notifications/DiscardChangesModal/DiscardChangesModal.tsx +16 -0
- package/src/Notifications/Modal/Modal.tsx +16 -0
- package/src/Notifications/Modal/ModalActions/ModalActions.tsx +16 -0
- package/src/Notifications/Modal/ModalContent/ModalContent.tsx +16 -0
- package/src/Notifications/Modal/ModalHeader/ModalHeader.tsx +16 -0
- package/src/Notifications/SlideInModal/SlideInModal.module.scss +16 -0
- package/src/Notifications/SlideInModal/SlideInModal.test.tsx +16 -0
- package/src/Notifications/SlideInModal/SlideInModal.tsx +16 -0
- package/src/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.scss +19 -0
- package/src/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.tsx +16 -0
- package/src/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.tsx +57 -2
- package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +18 -0
- package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.tsx +16 -0
- package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +34 -1
- package/src/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.tsx +18 -2
- package/src/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +38 -2
- package/src/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +22 -1
- package/src/Notifications/Snackbar/interfaces.ts +16 -0
- package/src/Notifications/Snackbar/useSnackbar.ts +25 -1
- package/src/Pagination/Pagination.module.scss +17 -1
- package/src/Pagination/Pagination.test.tsx +17 -1
- package/src/Pagination/Pagination.tsx +16 -0
- package/src/Popover/Popover.module.scss +17 -1
- package/src/Popover/Popover.test.tsx +16 -0
- package/src/Popover/Popover.tsx +22 -0
- package/src/Skeleton/Skeleton.module.scss +16 -0
- package/src/Skeleton/Skeleton.test.tsx +17 -1
- package/src/Skeleton/Skeleton.tsx +16 -0
- package/src/StatusIndicator/StatusIndicator.module.scss +16 -0
- package/src/StatusIndicator/StatusIndicator.test.tsx +16 -0
- package/src/StatusIndicator/StatusIndicator.tsx +16 -0
- package/src/Tabs/Tab.test.tsx +16 -0
- package/src/Tabs/Tab.tsx +16 -0
- package/src/Tabs/TabButton.module.scss +20 -0
- package/src/Tabs/TabButton.test.tsx +16 -0
- package/src/Tabs/TabButton.tsx +16 -0
- package/src/Tabs/TabPanel.module.scss +20 -0
- package/src/Tabs/TabPanel.test.tsx +16 -0
- package/src/Tabs/TabPanel.tsx +16 -0
- package/src/Tabs/Tabs.module.scss +18 -2
- package/src/Tabs/Tabs.test.tsx +16 -0
- package/src/Tabs/Tabs.tsx +17 -1
- package/src/TextEllipsis/TextEllipsis.module.scss +16 -0
- package/src/TextEllipsis/TextEllipsis.test.tsx +16 -0
- package/src/TextEllipsis/TextEllipsis.tsx +16 -0
- package/src/Tiles/Tile.module.scss +18 -2
- package/src/Tiles/Tile.test.tsx +16 -0
- package/src/Tiles/Tile.tsx +16 -0
- package/src/Tiles/Tiles.module.scss +16 -0
- package/src/Tiles/Tiles.test.tsx +16 -0
- package/src/Tiles/Tiles.tsx +16 -0
- package/src/Tooltip/Tooltip.module.scss +17 -1
- package/src/Tooltip/Tooltip.test.tsx +26 -0
- package/src/Tooltip/Tooltip.tsx +18 -1
- package/src/Typography/Typography.module.scss +16 -0
- package/src/Typography/Typography.test.tsx +16 -0
- package/src/Typography/Typography.tsx +16 -0
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.module.scss +19 -7
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.test.tsx +16 -1
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +18 -19
- package/src/Wizard/Wizard.test.tsx +16 -1
- package/src/Wizard/Wizard.tsx +23 -8
- package/src/Wizard/WizardActions/WizardActions.test.tsx +16 -1
- package/src/Wizard/WizardActions/WizardActions.tsx +16 -0
- package/src/Wizard/WizardStateProvider.tsx +16 -0
- package/src/Wizard/WizardSteps/WizardSteps.test.tsx +16 -1
- package/src/Wizard/WizardSteps/WizardSteps.tsx +17 -2
- package/src/Wizard/wizardStateReducer.ts +18 -8
- package/src/_BaseStyling_/BaseStyling.test.tsx +16 -0
- package/src/_BaseStyling_/BaseStyling.tsx +41 -16
- package/src/hooks/useAnimation.test.tsx +16 -0
- package/src/hooks/useAnimation.ts +16 -0
- package/src/hooks/useBodyClick.test.tsx +16 -0
- package/src/hooks/useBodyClick.ts +16 -0
- package/src/hooks/useFormSelector.test.ts +16 -0
- package/src/hooks/useFormSelector.ts +16 -0
- package/src/hooks/usePosition.test.tsx +16 -0
- package/src/hooks/usePosition.ts +16 -0
- package/src/hooks/useRepeater.test.tsx +16 -0
- package/src/hooks/useRepeater.ts +16 -0
- package/src/hooks/useScroll.test.tsx +16 -0
- package/src/hooks/useScroll.ts +16 -0
- package/src/hooks/useSpacing.test.ts +16 -0
- package/src/hooks/useSpacing.ts +16 -0
- package/src/hooks/useWrapper.test.ts +16 -0
- package/src/hooks/useWrapper.ts +16 -0
- package/src/index.ts +16 -0
- package/src/interfaces.ts +16 -0
- package/src/mixins.module.scss +22 -7
- package/src/readyclasses.module.scss +16 -0
- package/src/types.d.ts +16 -0
- package/src/util/helper.test.tsx +16 -0
- package/src/util/helper.tsx +16 -0
- package/src/Link/types.d.ts +0 -9
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
.form-group {
|
|
2
18
|
position: relative;
|
|
3
19
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { useEffect, useRef } from "react";
|
|
2
18
|
import { FormGroup, Props } from "./FormGroup";
|
|
3
19
|
import { render } from "@testing-library/react";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
/** The empty className property on FormHelperText is on purpose! We want to basically "filter" out the className from helperProps because we're adding this to the surrounding div. This makes it so also the errormessage receives this styling. */
|
|
2
18
|
|
|
3
19
|
import React, { ComponentPropsWithRef, ReactChild } from "react";
|
|
@@ -52,7 +68,7 @@ export const FormGroup = React.forwardRef<HTMLDivElement, Props>(
|
|
|
52
68
|
helperProps?.className ? helperProps.className : ""
|
|
53
69
|
}`}
|
|
54
70
|
>
|
|
55
|
-
{helperText && !error && (
|
|
71
|
+
{((helperText && !error) || (helperText && error && !errorMessage)) && (
|
|
56
72
|
<FormHelperText {...helperProps} className={""} id={helperId}>
|
|
57
73
|
{(helperProps && helperProps.children) || helperText}
|
|
58
74
|
</FormHelperText>
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
.form-helper-text {
|
|
2
18
|
margin: 0;
|
|
3
19
|
color: var(--greyed-out);
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { useEffect, useRef } from "react";
|
|
2
18
|
import { FormHelperText, Props } from "./FormHelperText";
|
|
3
19
|
import { render } from "@testing-library/react";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
18
|
import classes from "./FormHelperText.module.scss";
|
|
3
19
|
import { Typography } from "../../Typography/Typography";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
.error {
|
|
2
18
|
color: var(--error);
|
|
3
19
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { useRef, useEffect } from "react";
|
|
2
18
|
import { FormSelectorWrapper, Props } from "./FormSelectorWrapper";
|
|
3
19
|
import { render } from "@testing-library/react";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { ComponentPropsWithRef, createRef, ReactNode } from "react";
|
|
2
18
|
import { Icon, Icons } from "../../Icon/Icon";
|
|
3
19
|
import { KeyValuePair } from "../../interfaces";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
@import "../../mixins.module.scss";
|
|
2
18
|
|
|
3
19
|
.input-wrapper {
|
|
@@ -11,6 +27,43 @@
|
|
|
11
27
|
padding: 0 1.25rem;
|
|
12
28
|
transition: all 0.2s ease-in-out;
|
|
13
29
|
|
|
30
|
+
// General autofill styles
|
|
31
|
+
input:-webkit-autofill,
|
|
32
|
+
input:-webkit-autofill:hover,
|
|
33
|
+
input:-webkit-autofill:focus,
|
|
34
|
+
input:-webkit-autofill:active {
|
|
35
|
+
transition: background-color 5000s ease-in-out 0s !important;
|
|
36
|
+
|
|
37
|
+
~ .outline {
|
|
38
|
+
&:after {
|
|
39
|
+
content: "";
|
|
40
|
+
position: absolute;
|
|
41
|
+
display: block;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
border-radius: var(--input-border-radius);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Chrome specific color
|
|
49
|
+
@media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
|
|
50
|
+
~ .outline {
|
|
51
|
+
&:after {
|
|
52
|
+
background-color: rgb(232, 240, 254);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Safari specific color
|
|
58
|
+
@media not all and (min-resolution: 0.001dpcm) {
|
|
59
|
+
~ .outline {
|
|
60
|
+
&:after {
|
|
61
|
+
background-color: rgb(250, 255, 189);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
14
67
|
@include outlineStates;
|
|
15
68
|
}
|
|
16
69
|
|
|
@@ -20,17 +73,26 @@
|
|
|
20
73
|
color: var(--greyed-out);
|
|
21
74
|
font-size: var(--font-size);
|
|
22
75
|
font-family: var(--font-family);
|
|
23
|
-
width: 100%;
|
|
24
76
|
box-sizing: border-box;
|
|
25
77
|
border: 0;
|
|
26
78
|
border-radius: var(--input-border-radius);
|
|
27
79
|
transition: all 0.2s ease-in-out;
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
z-index: 1;
|
|
82
|
+
|
|
83
|
+
&:not(.shrink-width-for-date-icon) {
|
|
84
|
+
width: 100%;
|
|
85
|
+
}
|
|
28
86
|
|
|
29
87
|
&:disabled {
|
|
30
88
|
background-color: var(--disabled);
|
|
31
89
|
cursor: not-allowed;
|
|
32
90
|
}
|
|
33
91
|
|
|
92
|
+
&.shrink-width-for-date-icon {
|
|
93
|
+
width: auto;
|
|
94
|
+
}
|
|
95
|
+
|
|
34
96
|
@include browserOutlineDisabled;
|
|
35
97
|
}
|
|
36
98
|
|
|
@@ -56,14 +118,11 @@
|
|
|
56
118
|
display: flex;
|
|
57
119
|
align-items: center;
|
|
58
120
|
justify-content: center;
|
|
121
|
+
z-index: 2;
|
|
59
122
|
|
|
60
123
|
&:before {
|
|
61
124
|
height: 1.3125rem;
|
|
62
125
|
}
|
|
63
|
-
|
|
64
|
-
&.extra-indent {
|
|
65
|
-
right: 3.75rem;
|
|
66
|
-
}
|
|
67
126
|
}
|
|
68
127
|
|
|
69
128
|
.input-wrapper [data-prefix],
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { useEffect, useRef, useState, Fragment } from "react";
|
|
2
18
|
import { Input, Props, Type } from "./Input";
|
|
3
19
|
import { fireEvent, render } from "@testing-library/react";
|
package/src/Form/Input/Input.tsx
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { ComponentPropsWithRef, Ref, useEffect, useRef, useState } from "react";
|
|
2
18
|
import classes from "./Input.module.scss";
|
|
3
19
|
import readyclasses from "../../readyclasses.module.scss";
|
|
4
20
|
import { Icon, Icons } from "../../Icon/Icon";
|
|
5
21
|
import { FormElement } from "../form.interfaces";
|
|
6
22
|
|
|
7
|
-
const dateTypes = ["date", "time", "datetime-local"] as const;
|
|
23
|
+
export const dateTypes = ["date", "time", "datetime-local"] as const;
|
|
8
24
|
|
|
9
25
|
export type Type =
|
|
10
26
|
| "text"
|
|
@@ -26,44 +42,6 @@ export interface Props extends ComponentPropsWithRef<"input">, FormElement {
|
|
|
26
42
|
prefix?: string;
|
|
27
43
|
}
|
|
28
44
|
|
|
29
|
-
const useErrorOffset = (
|
|
30
|
-
suffix: React.RefObject<HTMLDivElement>,
|
|
31
|
-
errorIcon: React.RefObject<HTMLDivElement>,
|
|
32
|
-
inputWrapper: React.RefObject<HTMLDivElement>,
|
|
33
|
-
error: boolean,
|
|
34
|
-
type: Type,
|
|
35
|
-
suffixContent: string = ""
|
|
36
|
-
) => {
|
|
37
|
-
const [errorOffset, setErrorOffset] = useState({});
|
|
38
|
-
const [defaultErrorOffset, setDefaultErrorOffset] = useState<number | null>(null);
|
|
39
|
-
|
|
40
|
-
const getErrorIconOffset = () => parseFloat(getComputedStyle(errorIcon.current!).right);
|
|
41
|
-
const getInputPaddingRight = (input: HTMLDivElement) =>
|
|
42
|
-
(dateTypes as ReadonlyArray<string>).includes(type)
|
|
43
|
-
? 0
|
|
44
|
-
: parseFloat(getComputedStyle(input).paddingRight);
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (errorIcon.current && inputWrapper.current) {
|
|
48
|
-
let defaultOffset = defaultErrorOffset;
|
|
49
|
-
if (!defaultOffset) {
|
|
50
|
-
defaultOffset = getErrorIconOffset();
|
|
51
|
-
setDefaultErrorOffset(defaultOffset);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (suffix.current && suffixContent) {
|
|
55
|
-
const inputPaddingRight = getInputPaddingRight(inputWrapper.current);
|
|
56
|
-
const prefixDifference = suffix.current.offsetWidth + inputPaddingRight + defaultOffset;
|
|
57
|
-
setErrorOffset({ right: `${prefixDifference}px` });
|
|
58
|
-
} else {
|
|
59
|
-
setErrorOffset({ right: `${defaultOffset}px` });
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, [suffix.current, errorIcon.current, inputWrapper.current, error, type, suffixContent]);
|
|
63
|
-
|
|
64
|
-
return { errorOffset };
|
|
65
|
-
};
|
|
66
|
-
|
|
67
45
|
export const Input = React.forwardRef(
|
|
68
46
|
(
|
|
69
47
|
{
|
|
@@ -87,14 +65,6 @@ export const Input = React.forwardRef(
|
|
|
87
65
|
const inputWrapperRef = useRef<HTMLDivElement>(null);
|
|
88
66
|
const errorIconRef = useRef<HTMLDivElement>(null);
|
|
89
67
|
const suffixRef = useRef<HTMLDivElement>(null);
|
|
90
|
-
const { errorOffset } = useErrorOffset(
|
|
91
|
-
suffixRef,
|
|
92
|
-
errorIconRef,
|
|
93
|
-
inputWrapperRef,
|
|
94
|
-
error,
|
|
95
|
-
type,
|
|
96
|
-
suffix
|
|
97
|
-
);
|
|
98
68
|
|
|
99
69
|
useEffect(() => {
|
|
100
70
|
if (name === undefined) {
|
|
@@ -105,13 +75,10 @@ export const Input = React.forwardRef(
|
|
|
105
75
|
const inputClassNames = [classes["input"]];
|
|
106
76
|
|
|
107
77
|
(dateTypes as ReadonlyArray<string>).includes(type) &&
|
|
108
|
-
inputClassNames.push(classes["
|
|
78
|
+
inputClassNames.push(classes["shrink-width-for-date-icon"]);
|
|
109
79
|
className && inputClassNames.push(className);
|
|
110
80
|
|
|
111
81
|
const iconClassNames = [classes["warning"]];
|
|
112
|
-
(dateTypes as ReadonlyArray<string>).includes(type) &&
|
|
113
|
-
iconClassNames.push(classes["extra-indent"]);
|
|
114
|
-
|
|
115
82
|
const wrapperClasses = [classes["input-wrapper"]];
|
|
116
83
|
const outlineClasses = [classes["outline"]];
|
|
117
84
|
|
|
@@ -160,12 +127,7 @@ export const Input = React.forwardRef(
|
|
|
160
127
|
</div>
|
|
161
128
|
)}
|
|
162
129
|
{error && (
|
|
163
|
-
<Icon
|
|
164
|
-
style={errorOffset}
|
|
165
|
-
ref={errorIconRef}
|
|
166
|
-
className={iconClassNames.join(" ")}
|
|
167
|
-
icon={Icons.Error}
|
|
168
|
-
/>
|
|
130
|
+
<Icon ref={errorIconRef} className={iconClassNames.join(" ")} icon={Icons.Error} />
|
|
169
131
|
)}
|
|
170
132
|
<span className={outlineClasses.join(" ")}></span>
|
|
171
133
|
</div>
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
.label {
|
|
2
18
|
cursor: text;
|
|
3
19
|
color: var(--greyed-out);
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { useEffect, useRef } from "react";
|
|
2
18
|
import { Label } from "./Label";
|
|
3
19
|
import { render } from "@testing-library/react";
|
package/src/Form/Label/Label.tsx
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
18
|
import classes from "./Label.module.scss";
|
|
3
19
|
import readyclasses from "../../readyclasses.module.scss";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
.radio-wrapper {
|
|
2
18
|
position: relative;
|
|
3
19
|
|
|
@@ -35,6 +51,7 @@
|
|
|
35
51
|
margin-left: 0.5rem;
|
|
36
52
|
user-select: none;
|
|
37
53
|
font-size: var(--font-size);
|
|
54
|
+
font-family: var(--font-family);
|
|
38
55
|
|
|
39
56
|
.disabled & {
|
|
40
57
|
cursor: not-allowed;
|
|
@@ -61,11 +78,8 @@
|
|
|
61
78
|
width: 1.75rem;
|
|
62
79
|
height: 1.75rem;
|
|
63
80
|
|
|
64
|
-
&:
|
|
65
|
-
|
|
66
|
-
+ * {
|
|
67
|
-
color: var(--color-primary);
|
|
68
|
-
}
|
|
81
|
+
&:checked + * {
|
|
82
|
+
color: var(--color-primary);
|
|
69
83
|
}
|
|
70
84
|
|
|
71
85
|
&:disabled {
|
|
@@ -75,7 +89,7 @@
|
|
|
75
89
|
&:focus-visible {
|
|
76
90
|
+ * {
|
|
77
91
|
border-radius: 2px;
|
|
78
|
-
outline: 1px solid var(--color-
|
|
92
|
+
outline: 1px solid var(--color-focus);
|
|
79
93
|
outline-offset: 1px;
|
|
80
94
|
}
|
|
81
95
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { useEffect, useRef } from "react";
|
|
2
18
|
import { Radio, Props } from "./Radio";
|
|
3
19
|
import { render } from "@testing-library/react";
|
package/src/Form/Radio/Radio.tsx
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { ComponentPropsWithRef } from "react";
|
|
2
18
|
import { Icon, Icons } from "../../Icon/Icon";
|
|
3
19
|
import { Props as HelperProps } from "../FormHelperText/FormHelperText";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { useEffect, useRef } from "react";
|
|
2
18
|
import { Option } from "./Option";
|
|
3
19
|
import { render } from "@testing-library/react";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
1
17
|
import React, { ComponentPropsWithRef, createRef, RefObject, useEffect } from "react";
|
|
2
18
|
import classes from "./Select.module.scss";
|
|
3
19
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export type Position = {
|
|
18
|
+
top: 0 | "initial";
|
|
19
|
+
bottom: 0 | "initial";
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export interface UseArrowNavigationParams {
|
|
23
|
+
expanded: boolean;
|
|
24
|
+
setExpanded: React.Dispatch<React.SetStateAction<boolean>>;
|
|
25
|
+
isSearching: boolean;
|
|
26
|
+
setIsSearching: React.Dispatch<React.SetStateAction<boolean>>;
|
|
27
|
+
setFocusedSelectItem: React.Dispatch<React.SetStateAction<number>>;
|
|
28
|
+
childrenCount: number;
|
|
29
|
+
customSelectButtonRef: React.RefObject<HTMLButtonElement>;
|
|
30
|
+
setShouldClick: React.Dispatch<React.SetStateAction<boolean>>;
|
|
31
|
+
searchInputRef: React.RefObject<HTMLInputElement>;
|
|
32
|
+
renderSearchCondition: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface UseSelectPositionListParams {
|
|
36
|
+
expanded: boolean;
|
|
37
|
+
optionListReference: React.RefObject<HTMLDivElement>;
|
|
38
|
+
containerReference: React.RefObject<HTMLDivElement>;
|
|
39
|
+
}
|