@onewelcome/react-lib-components 0.0.0-experimental-8e3a0fd
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 -0
- package/README.md +94 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +9 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/dist/components/Button/BaseButton.d.ts +8 -0
- package/dist/components/Button/BaseButton.test.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +8 -0
- package/dist/components/Button/Button.test.d.ts +1 -0
- package/dist/components/Button/IconButton.d.ts +11 -0
- package/dist/components/Button/IconButton.test.d.ts +1 -0
- package/dist/components/Button/Spinner.d.ts +2 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +24 -0
- package/dist/components/ContextMenu/ContextMenu.test.d.ts +1 -0
- package/dist/components/ContextMenu/ContextMenuItem.d.ts +15 -0
- package/dist/components/ContextMenu/ContextMenuService.d.ts +21 -0
- package/dist/components/DataGrid/DataGrid.d.ts +46 -0
- package/dist/components/DataGrid/DataGrid.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridActions/DataGridActions.d.ts +15 -0
- package/dist/components/DataGrid/DataGridActions/DataGridActions.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.d.ts +13 -0
- package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridBody/DataGridBody.d.ts +21 -0
- package/dist/components/DataGrid/DataGridBody/DataGridBody.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.d.ts +12 -0
- package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.d.ts +5 -0
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.d.ts +6 -0
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.d.ts +33 -0
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridWithNestedRows.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.d.ts +855 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridDateFilter.d.ts +9 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +16 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +23 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.d.ts +16 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +15 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.d.ts +15 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.d.ts +78 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridSearchbar.d.ts +10 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +15 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbarWrapper.d.ts +10 -0
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.d.ts +31 -0
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.d.ts +15 -0
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerInputSection.d.ts +18 -0
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimeService.d.ts +10 -0
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/SideMenu.d.ts +10 -0
- package/dist/components/DataGrid/DataGridFilters/FilterKeyMapper.d.ts +14 -0
- package/dist/components/DataGrid/DataGridFilters/FilterKeyMapper.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.d.ts +9 -0
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.d.ts +13 -0
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.test.d.ts +1 -0
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.d.ts +10 -0
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.test.d.ts +1 -0
- package/dist/components/DataGrid/datagrid.interfaces.d.ts +13 -0
- package/dist/components/DataGrid/testUtils.d.ts +22 -0
- package/dist/components/DatePicker/DatePicker.d.ts +14 -0
- package/dist/components/DatePicker/DatePicker.test.d.ts +1 -0
- package/dist/components/Form/Checkbox/Checkbox.d.ts +14 -0
- package/dist/components/Form/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/components/Form/Fieldset/Fieldset.d.ts +14 -0
- package/dist/components/Form/Fieldset/Fieldset.test.d.ts +1 -0
- package/dist/components/Form/FileUpload/FileItem/FileItem.d.ts +28 -0
- package/dist/components/Form/FileUpload/FileItem/FileItem.test.d.ts +1 -0
- package/dist/components/Form/FileUpload/FileUpload.d.ts +32 -0
- package/dist/components/Form/FileUpload/FileUpload.test.d.ts +1 -0
- package/dist/components/Form/Form.d.ts +5 -0
- package/dist/components/Form/Form.test.d.ts +1 -0
- package/dist/components/Form/FormControl/FormControl.d.ts +8 -0
- package/dist/components/Form/FormControl/FormControl.test.d.ts +1 -0
- package/dist/components/Form/FormErrorText/FormErrorText.d.ts +12 -0
- package/dist/components/Form/FormErrorText/FormErrorText.test.d.ts +1 -0
- package/dist/components/Form/FormGroup/FormGroup.d.ts +17 -0
- package/dist/components/Form/FormGroup/FormGroup.test.d.ts +1 -0
- package/dist/components/Form/FormHelperText/FormHelperText.d.ts +7 -0
- package/dist/components/Form/FormHelperText/FormHelperText.test.d.ts +1 -0
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.d.ts +15 -0
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.test.d.ts +1 -0
- package/dist/components/Form/FormStatusIndicator/FormStatusIndicator.d.ts +8 -0
- package/dist/components/Form/Input/Input.d.ts +14 -0
- package/dist/components/Form/Input/Input.test.d.ts +1 -0
- package/dist/components/Form/Label/Label.d.ts +5 -0
- package/dist/components/Form/Label/Label.test.d.ts +1 -0
- package/dist/components/Form/Radio/Radio.d.ts +11 -0
- package/dist/components/Form/Radio/Radio.test.d.ts +1 -0
- package/dist/components/Form/Select/MultiSelect/MultiOption.d.ts +6 -0
- package/dist/components/Form/Select/MultiSelect/MultiSelect.d.ts +3 -0
- package/dist/components/Form/Select/MultiSelect/MultiSelect.test.d.ts +63 -0
- package/dist/components/Form/Select/MultiSelect/MultiSelectKeyboardNavigation.test.d.ts +1 -0
- package/dist/components/Form/Select/MultiSelect/SelectButton.d.ts +4 -0
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.d.ts +12 -0
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.d.ts +17 -0
- package/dist/components/Form/Select/MultiSelect/useMultiSelect.d.ts +16 -0
- package/dist/components/Form/Select/MultiSelect/useMultiSelect.test.d.ts +1 -0
- package/dist/components/Form/Select/MultiSelect/useSearch.d.ts +24 -0
- package/dist/components/Form/Select/Select.interfaces.d.ts +60 -0
- package/dist/components/Form/Select/SingleSelect/Option.d.ts +18 -0
- package/dist/components/Form/Select/SingleSelect/Option.test.d.ts +1 -0
- package/dist/components/Form/Select/SingleSelect/Select.d.ts +3 -0
- package/dist/components/Form/Select/SingleSelect/Select.test.d.ts +124 -0
- package/dist/components/Form/Select/SingleSelect/SelectKeyboardNavigation.test.d.ts +1 -0
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.d.ts +5 -0
- package/dist/components/Form/Select/SingleSelect/useSearch.d.ts +20 -0
- package/dist/components/Form/Select/useAddNewBtn.d.ts +19 -0
- package/dist/components/Form/Select/useSelectPositionList.d.ts +12 -0
- package/dist/components/Form/Textarea/Textarea.d.ts +7 -0
- package/dist/components/Form/Textarea/Textarea.test.d.ts +1 -0
- package/dist/components/Form/Toggle/Toggle.d.ts +11 -0
- package/dist/components/Form/Toggle/Toggle.test.d.ts +1 -0
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.d.ts +12 -0
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.d.ts +1 -0
- package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.d.ts +18 -0
- package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.test.d.ts +1 -0
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.d.ts +16 -0
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.test.d.ts +1 -0
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.d.ts +10 -0
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.test.d.ts +1 -0
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.d.ts +16 -0
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.test.d.ts +1 -0
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.d.ts +16 -0
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.test.d.ts +1 -0
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.d.ts +27 -0
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.test.d.ts +1 -0
- package/dist/components/Form/form.interfaces.d.ts +16 -0
- package/dist/components/Icon/Icon.d.ts +114 -0
- package/dist/components/Icon/Icon.test.d.ts +1 -0
- package/dist/components/InlineEditing/InlineCheckbox/InlineCheckbox.d.ts +6 -0
- package/dist/components/InlineEditing/InlineEditingContext.d.ts +10 -0
- package/dist/components/InlineEditing/InlineEditingSelect/InlineSelect.d.ts +6 -0
- package/dist/components/Layout/Card/Card.d.ts +16 -0
- package/dist/components/Layout/Card/Card.test.d.ts +0 -0
- package/dist/components/Layout/ContentHeader/ContentHeader.d.ts +24 -0
- package/dist/components/Layout/ContentHeader/ContentHeader.test.d.ts +1 -0
- package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.d.ts +7 -0
- package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.test.d.ts +1 -0
- package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.d.ts +10 -0
- package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.test.d.ts +1 -0
- package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.d.ts +6 -0
- package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.test.d.ts +1 -0
- package/dist/components/Link/Link.d.ts +14 -0
- package/dist/components/Link/Link.test.d.ts +1 -0
- package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.d.ts +12 -0
- package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.test.d.ts +1 -0
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.d.ts +4 -0
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.d.ts +22 -0
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.test.d.ts +1 -0
- package/dist/components/Notifications/Alert/AlertProvider/AlertContext.d.ts +13 -0
- package/dist/components/Notifications/Alert/AlertProvider/AlertProvider.d.ts +22 -0
- package/dist/components/Notifications/Alert/AlertProvider/AlertProvider.test.d.ts +1 -0
- package/dist/components/Notifications/Alert/useAlert.d.ts +7 -0
- package/dist/components/Notifications/Alert/useAlert.test.d.ts +1 -0
- package/dist/components/Notifications/Banner/Banner.d.ts +11 -0
- package/dist/components/Notifications/Banner/Banner.test.d.ts +1 -0
- package/dist/components/Notifications/BaseModal/BaseModal.d.ts +21 -0
- package/dist/components/Notifications/BaseModal/BaseModal.test.d.ts +1 -0
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.d.ts +13 -0
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.test.d.ts +1 -0
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.d.ts +8 -0
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.test.d.ts +1 -0
- package/dist/components/Notifications/BaseModal/BaseModalContext.d.ts +2 -0
- package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.d.ts +9 -0
- package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.test.d.ts +1 -0
- package/dist/components/Notifications/Dialog/Dialog.d.ts +22 -0
- package/dist/components/Notifications/Dialog/Dialog.test.d.ts +1 -0
- package/dist/components/Notifications/Dialog/DialogActions/DialogActions.d.ts +6 -0
- package/dist/components/Notifications/Dialog/DialogActions/DialogActions.test.d.ts +1 -0
- package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.d.ts +9 -0
- package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.test.d.ts +1 -0
- package/dist/components/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.d.ts +15 -0
- package/dist/components/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.test.d.ts +1 -0
- package/dist/components/Notifications/DiscardChangesModal/DiscardChangesModal.d.ts +13 -0
- package/dist/components/Notifications/DiscardChangesModal/DiscardChangesModal.test.d.ts +1 -0
- package/dist/components/Notifications/Modal/Modal.d.ts +2 -0
- package/dist/components/Notifications/Modal/Modal.test.d.ts +1 -0
- package/dist/components/Notifications/Modal/ModalActions/ModalActions.d.ts +2 -0
- package/dist/components/Notifications/Modal/ModalContent/ModalContent.d.ts +2 -0
- package/dist/components/Notifications/Modal/ModalHeader/ModalHeader.d.ts +2 -0
- package/dist/components/Notifications/NotificationProvider/NotificationContext.d.ts +35 -0
- package/dist/components/Notifications/NotificationProvider/NotificationContext.test.d.ts +1 -0
- package/dist/components/Notifications/NotificationProvider/NotificationService.d.ts +2 -0
- package/dist/components/Notifications/NotificationProvider/notification.interfaces.d.ts +46 -0
- package/dist/components/Notifications/SideSheet/SideSheet.d.ts +10 -0
- package/dist/components/Notifications/SideSheet/SideSheet.test.d.ts +1 -0
- package/dist/components/Notifications/SideSheet/SideSheetActions/SideSheetActions.d.ts +2 -0
- package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.d.ts +4 -0
- package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.d.ts +4 -0
- package/dist/components/Notifications/SlideInModal/SlideInModal.d.ts +4 -0
- package/dist/components/Notifications/SlideInModal/SlideInModal.test.d.ts +1 -0
- package/dist/components/Pagination/Pagination.d.ts +19 -0
- package/dist/components/Pagination/Pagination.test.d.ts +1 -0
- package/dist/components/Popover/Popover.d.ts +13 -0
- package/dist/components/Popover/Popover.test.d.ts +1 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +9 -0
- package/dist/components/ProgressBar/ProgressBar.test.d.ts +1 -0
- package/dist/components/RequiredSign/RequiredSign.d.ts +5 -0
- package/dist/components/Skeleton/Skeleton.d.ts +7 -0
- package/dist/components/Skeleton/Skeleton.test.d.ts +1 -0
- package/dist/components/Spinner/Spinner.d.ts +6 -0
- package/dist/components/Spinner/Spinner.test.d.ts +1 -0
- package/dist/components/Stepper/Step.d.ts +15 -0
- package/dist/components/Stepper/Stepper.d.ts +8 -0
- package/dist/components/Stepper/Stepper.test.d.ts +1 -0
- package/dist/components/Tabs/Tab.d.ts +8 -0
- package/dist/components/Tabs/Tab.test.d.ts +1 -0
- package/dist/components/Tabs/TabButton.d.ts +9 -0
- package/dist/components/Tabs/TabButton.test.d.ts +1 -0
- package/dist/components/Tabs/Tabs.d.ts +13 -0
- package/dist/components/Tabs/Tabs.test.d.ts +1 -0
- package/dist/components/Tag/RemoveButton.d.ts +7 -0
- package/dist/components/Tag/Tag.d.ts +13 -0
- package/dist/components/Tag/Tag.test.d.ts +1 -0
- package/dist/components/TextEllipsis/TextEllipsis.d.ts +6 -0
- package/dist/components/TextEllipsis/TextEllipsis.test.d.ts +1 -0
- package/dist/components/Tiles/Tile.d.ts +15 -0
- package/dist/components/Tiles/Tile.test.d.ts +1 -0
- package/dist/components/Tiles/Tiles.d.ts +6 -0
- package/dist/components/Tiles/Tiles.test.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +13 -0
- package/dist/components/Tooltip/Tooltip.test.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +14 -0
- package/dist/components/Typography/Typography.test.d.ts +1 -0
- package/dist/components/_BaseStyling_/BaseStyling.d.ts +208 -0
- package/dist/components/_BaseStyling_/BaseStyling.test.d.ts +1 -0
- package/dist/components/_BaseStyling_/buttonBaseStyling.d.ts +14 -0
- package/dist/components/admin/layout/LeftNav/LeftNav.d.ts +13 -0
- package/dist/components/admin/layout/LeftNav/LeftNav.interfaces.d.ts +13 -0
- package/dist/components/admin/layout/LeftNav/LeftNav.test.d.ts +0 -0
- package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.d.ts +14 -0
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.d.ts +3 -0
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.interface.d.ts +11 -0
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.test.d.ts +0 -0
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.d.ts +12 -0
- package/dist/components/admin/layout/LeftNav/LeftNavItem/useKeyboardNavigation.d.ts +13 -0
- package/dist/components/admin/layout/LeftNav/useRefItems.d.ts +22 -0
- package/dist/components/admin/layout/LeftNav/useRefItems.test.d.ts +1 -0
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.d.ts +8 -0
- package/dist/components/miscellaneous/IdentityProviderButton.d.ts +18 -0
- package/dist/components/miscellaneous/IdentityProviderButton.test.d.ts +1 -0
- package/dist/components/withReadOnly.d.ts +12 -0
- package/dist/components/withReadOnly.test.d.ts +1 -0
- package/dist/hooks/useAnimation.d.ts +5 -0
- package/dist/hooks/useAnimation.test.d.ts +1 -0
- package/dist/hooks/useClickOutside.d.ts +2 -0
- package/dist/hooks/useClickOutside.test.d.ts +1 -0
- package/dist/hooks/useDebouncedCallback.d.ts +1 -0
- package/dist/hooks/useDebouncedCallback.test.d.ts +1 -0
- package/dist/hooks/useDetermineStatusIcon.d.ts +3 -0
- package/dist/hooks/useDetermineStatusIcon.test.d.ts +1 -0
- package/dist/hooks/useFormSelector.d.ts +13 -0
- package/dist/hooks/useFormSelector.test.d.ts +1 -0
- package/dist/hooks/useFullHeightCollapse.d.ts +4 -0
- package/dist/hooks/useFullHeightCollapse.test.d.ts +1 -0
- package/dist/hooks/useGetDomRoot.d.ts +3 -0
- package/dist/hooks/usePosition.d.ts +50 -0
- package/dist/hooks/usePosition.test.d.ts +1 -0
- package/dist/hooks/useRepeatFocus.d.ts +7 -0
- package/dist/hooks/useRepeater.d.ts +10 -0
- package/dist/hooks/useRepeater.test.d.ts +6 -0
- package/dist/hooks/useScreenSize.d.ts +9 -0
- package/dist/hooks/useScreenSize.test.d.ts +1 -0
- package/dist/hooks/useScroll.d.ts +2 -0
- package/dist/hooks/useScroll.test.d.ts +1 -0
- package/dist/hooks/useSpacing.d.ts +18 -0
- package/dist/hooks/useSpacing.test.d.ts +1 -0
- package/dist/hooks/useUploadFile.d.ts +27 -0
- package/dist/hooks/useUploadFile.test.d.ts +1 -0
- package/dist/hooks/useWrapper.d.ts +7 -0
- package/dist/hooks/useWrapper.test.d.ts +1 -0
- package/dist/index.cjs.js +205 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +175 -0
- package/dist/index.es.js +65380 -0
- package/dist/index.es.js.map +1 -0
- package/dist/interfaces.d.ts +9 -0
- package/dist/util/helper.d.ts +14 -0
- package/dist/util/helper.test.d.ts +1 -0
- package/dist/util/unitTestUtils.d.ts +12 -0
- package/dist/utils/statusUtils.d.ts +10 -0
- package/dist/variables.d.ts +8 -0
- package/package.json +144 -0
- package/src/_functions.scss +19 -0
- package/src/components/Breadcrumbs/Breadcrumbs.module.scss +54 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +84 -0
- package/src/components/Button/BaseButton.module.scss +48 -0
- package/src/components/Button/BaseButton.tsx +65 -0
- package/src/components/Button/Button.module.scss +58 -0
- package/src/components/Button/Button.tsx +70 -0
- package/src/components/Button/IconButton.module.scss +73 -0
- package/src/components/Button/IconButton.tsx +63 -0
- package/src/components/Button/Spinner.tsx +33 -0
- package/src/components/ContextMenu/ContextMenu.module.scss +41 -0
- package/src/components/ContextMenu/ContextMenu.tsx +206 -0
- package/src/components/ContextMenu/ContextMenuItem.module.scss +73 -0
- package/src/components/ContextMenu/ContextMenuItem.tsx +100 -0
- package/src/components/ContextMenu/ContextMenuService.ts +171 -0
- package/src/components/DataGrid/DataGrid.module.scss +51 -0
- package/src/components/DataGrid/DataGrid.tsx +225 -0
- package/src/components/DataGrid/DataGridActions/DataGridActions.module.scss +51 -0
- package/src/components/DataGrid/DataGridActions/DataGridActions.tsx +140 -0
- package/src/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss +58 -0
- package/src/components/DataGrid/DataGridActions/DataGridColumnsToggle.tsx +107 -0
- package/src/components/DataGrid/DataGridBody/DataGridBody.module.scss +26 -0
- package/src/components/DataGrid/DataGridBody/DataGridBody.tsx +110 -0
- package/src/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss +61 -0
- package/src/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.tsx +131 -0
- package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss +60 -0
- package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.tsx +39 -0
- package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss +21 -0
- package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.tsx +47 -0
- package/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss +127 -0
- package/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.tsx +192 -0
- package/src/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.tsx +143 -0
- package/src/components/DataGrid/DataGridBody/__snapshots__/DataGridBody.test.tsx.snap +262 -0
- package/src/components/DataGrid/DataGridFilters/DataGridDateFilter.tsx +65 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilter.module.scss +116 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilter.tsx +161 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.tsx +172 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilterService.ts +124 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilterTag.tsx +146 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.tsx +136 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.ts +123 -0
- package/src/components/DataGrid/DataGridFilters/DataGridSearchbar.tsx +71 -0
- package/src/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss +73 -0
- package/src/components/DataGrid/DataGridFilters/DataGridToolbar.tsx +132 -0
- package/src/components/DataGrid/DataGridFilters/DataGridToolbarWrapper.tsx +38 -0
- package/src/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss +136 -0
- package/src/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.tsx +267 -0
- package/src/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.tsx +103 -0
- package/src/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerInputSection.tsx +121 -0
- package/src/components/DataGrid/DataGridFilters/DateTimePicker/DateTimeService.ts +30 -0
- package/src/components/DataGrid/DataGridFilters/DateTimePicker/SideMenu.tsx +50 -0
- package/src/components/DataGrid/DataGridFilters/FilterKeyMapper.ts +48 -0
- package/src/components/DataGrid/DataGridFilters/useFiltersReducer.tsx +73 -0
- package/src/components/DataGrid/DataGridHeader/DataGridHeader.module.scss +32 -0
- package/src/components/DataGrid/DataGridHeader/DataGridHeader.tsx +128 -0
- package/src/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss +93 -0
- package/src/components/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +83 -0
- package/src/components/DataGrid/dataGridMixins.module.scss +33 -0
- package/src/components/DataGrid/datagrid.interfaces.ts +30 -0
- package/src/components/DataGrid/testUtils.ts +117 -0
- package/src/components/DatePicker/DatePicker.module.scss +360 -0
- package/src/components/DatePicker/DatePicker.tsx +98 -0
- package/src/components/Form/Checkbox/Checkbox.module.scss +221 -0
- package/src/components/Form/Checkbox/Checkbox.tsx +205 -0
- package/src/components/Form/Fieldset/Fieldset.module.scss +49 -0
- package/src/components/Form/Fieldset/Fieldset.tsx +128 -0
- package/src/components/Form/FileUpload/FileItem/FileItem.module.scss +204 -0
- package/src/components/Form/FileUpload/FileItem/FileItem.tsx +271 -0
- package/src/components/Form/FileUpload/FileUpload.module.scss +241 -0
- package/src/components/Form/FileUpload/FileUpload.tsx +317 -0
- package/src/components/Form/Form.module.scss +19 -0
- package/src/components/Form/Form.tsx +35 -0
- package/src/components/Form/FormControl/FormControl.module.scss +65 -0
- package/src/components/Form/FormControl/FormControl.tsx +62 -0
- package/src/components/Form/FormErrorText/FormErrorText.module.scss +35 -0
- package/src/components/Form/FormErrorText/FormErrorText.tsx +65 -0
- package/src/components/Form/FormGroup/FormGroup.module.scss +24 -0
- package/src/components/Form/FormGroup/FormGroup.tsx +96 -0
- package/src/components/Form/FormHelperText/FormHelperText.module.scss +32 -0
- package/src/components/Form/FormHelperText/FormHelperText.tsx +43 -0
- package/src/components/Form/FormSection/FormSection.module.scss +12 -0
- package/src/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss +68 -0
- package/src/components/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +117 -0
- package/src/components/Form/FormStatusIndicator/FormStatusIndicator.tsx +75 -0
- package/src/components/Form/Input/Input.module.scss +186 -0
- package/src/components/Form/Input/Input.tsx +161 -0
- package/src/components/Form/Label/Label.module.scss +21 -0
- package/src/components/Form/Label/Label.tsx +40 -0
- package/src/components/Form/Radio/Radio.module.scss +196 -0
- package/src/components/Form/Radio/Radio.tsx +142 -0
- package/src/components/Form/Select/MultiSelect/MultiOption.tsx +66 -0
- package/src/components/Form/Select/MultiSelect/MultiSelect.module.scss +318 -0
- package/src/components/Form/Select/MultiSelect/MultiSelect.tsx +406 -0
- package/src/components/Form/Select/MultiSelect/SelectButton.module.scss +28 -0
- package/src/components/Form/Select/MultiSelect/SelectButton.tsx +37 -0
- package/src/components/Form/Select/MultiSelect/SelectedOptions.module.scss +39 -0
- package/src/components/Form/Select/MultiSelect/SelectedOptions.tsx +68 -0
- package/src/components/Form/Select/MultiSelect/useArrowNavigation.ts +133 -0
- package/src/components/Form/Select/MultiSelect/useMultiSelect.tsx +98 -0
- package/src/components/Form/Select/MultiSelect/useSearch.tsx +117 -0
- package/src/components/Form/Select/Select.interfaces.ts +84 -0
- package/src/components/Form/Select/SingleSelect/Option.tsx +116 -0
- package/src/components/Form/Select/SingleSelect/Select.module.scss +409 -0
- package/src/components/Form/Select/SingleSelect/Select.tsx +312 -0
- package/src/components/Form/Select/SingleSelect/useArrowNavigation.ts +177 -0
- package/src/components/Form/Select/SingleSelect/useSearch.tsx +113 -0
- package/src/components/Form/Select/useAddNewBtn.module.scss +66 -0
- package/src/components/Form/Select/useAddNewBtn.tsx +89 -0
- package/src/components/Form/Select/useSelectPositionList.ts +109 -0
- package/src/components/Form/Textarea/Textarea.module.scss +142 -0
- package/src/components/Form/Textarea/Textarea.tsx +97 -0
- package/src/components/Form/Toggle/Toggle.module.scss +214 -0
- package/src/components/Form/Toggle/Toggle.tsx +80 -0
- package/src/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss +32 -0
- package/src/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.tsx +99 -0
- package/src/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss +79 -0
- package/src/components/Form/Wrapper/InputWrapper/InputWrapper.tsx +125 -0
- package/src/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss +27 -0
- package/src/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.tsx +88 -0
- package/src/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss +30 -0
- package/src/components/Form/Wrapper/RadioWrapper/RadioWrapper.tsx +109 -0
- package/src/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss +27 -0
- package/src/components/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +89 -0
- package/src/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss +100 -0
- package/src/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +154 -0
- package/src/components/Form/Wrapper/Wrapper/Wrapper.module.scss +87 -0
- package/src/components/Form/Wrapper/Wrapper/Wrapper.tsx +116 -0
- package/src/components/Form/form.interfaces.ts +34 -0
- package/src/components/Icon/Icon.module.scss +455 -0
- package/src/components/Icon/Icon.tsx +152 -0
- package/src/components/InlineEditing/InlineCheckbox/InlineCheckbox.tsx +40 -0
- package/src/components/InlineEditing/InlineEditingContext.tsx +32 -0
- package/src/components/InlineEditing/InlineEditingSelect/InlineSelect.tsx +44 -0
- package/src/components/Layout/Card/Card.module.scss +68 -0
- package/src/components/Layout/Card/Card.tsx +108 -0
- package/src/components/Layout/ContentHeader/ContentHeader.module.scss +95 -0
- package/src/components/Layout/ContentHeader/ContentHeader.tsx +146 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss +12 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.tsx +53 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss +25 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.tsx +54 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss +36 -0
- package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.tsx +32 -0
- package/src/components/Link/Link.module.scss +106 -0
- package/src/components/Link/Link.tsx +111 -0
- package/src/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss +57 -0
- package/src/components/Notifications/Alert/AlertContainer/AlertContainer.tsx +52 -0
- package/src/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.ts +47 -0
- package/src/components/Notifications/Alert/AlertItem/AlertItem.module.scss +279 -0
- package/src/components/Notifications/Alert/AlertItem/AlertItem.tsx +214 -0
- package/src/components/Notifications/Alert/AlertProvider/AlertContext.ts +42 -0
- package/src/components/Notifications/Alert/AlertProvider/AlertProvider.tsx +173 -0
- package/src/components/Notifications/Alert/alertVariables.scss +17 -0
- package/src/components/Notifications/Alert/useAlert.ts +30 -0
- package/src/components/Notifications/Banner/Banner.module.scss +76 -0
- package/src/components/Notifications/Banner/Banner.tsx +78 -0
- package/src/components/Notifications/BaseModal/BaseModal.module.scss +76 -0
- package/src/components/Notifications/BaseModal/BaseModal.tsx +186 -0
- package/src/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss +65 -0
- package/src/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.tsx +66 -0
- package/src/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss +25 -0
- package/src/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.tsx +60 -0
- package/src/components/Notifications/BaseModal/BaseModalContext.ts +18 -0
- package/src/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss +43 -0
- package/src/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.tsx +69 -0
- package/src/components/Notifications/Dialog/Dialog.module.scss +31 -0
- package/src/components/Notifications/Dialog/Dialog.tsx +143 -0
- package/src/components/Notifications/Dialog/DialogActions/DialogActions.module.scss +35 -0
- package/src/components/Notifications/Dialog/DialogActions/DialogActions.tsx +48 -0
- package/src/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss +58 -0
- package/src/components/Notifications/Dialog/DialogTitle/DialogTitle.tsx +75 -0
- package/src/components/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.tsx +77 -0
- package/src/components/Notifications/DiscardChangesModal/DiscardChangesModal.tsx +77 -0
- package/src/components/Notifications/Modal/Modal.tsx +18 -0
- package/src/components/Notifications/Modal/ModalActions/ModalActions.tsx +18 -0
- package/src/components/Notifications/Modal/ModalContent/ModalContent.tsx +18 -0
- package/src/components/Notifications/Modal/ModalHeader/ModalHeader.tsx +18 -0
- package/src/components/Notifications/NotificationProvider/NotificationContext.tsx +217 -0
- package/src/components/Notifications/NotificationProvider/NotificationService.ts +33 -0
- package/src/components/Notifications/NotificationProvider/notification.interfaces.ts +68 -0
- package/src/components/Notifications/SideSheet/SideSheet.module.scss +97 -0
- package/src/components/Notifications/SideSheet/SideSheet.tsx +114 -0
- package/src/components/Notifications/SideSheet/SideSheetActions/SideSheetActions.tsx +18 -0
- package/src/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss +19 -0
- package/src/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.tsx +25 -0
- package/src/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss +19 -0
- package/src/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.tsx +25 -0
- package/src/components/Notifications/SlideInModal/SlideInModal.module.scss +54 -0
- package/src/components/Notifications/SlideInModal/SlideInModal.tsx +75 -0
- package/src/components/Pagination/Pagination.module.scss +162 -0
- package/src/components/Pagination/Pagination.tsx +235 -0
- package/src/components/Popover/Popover.module.scss +42 -0
- package/src/components/Popover/Popover.tsx +142 -0
- package/src/components/ProgressBar/ProgressBar.module.scss +95 -0
- package/src/components/ProgressBar/ProgressBar.tsx +75 -0
- package/src/components/RequiredSign/RequiredSign.tsx +28 -0
- package/src/components/Skeleton/Skeleton.module.scss +36 -0
- package/src/components/Skeleton/Skeleton.tsx +48 -0
- package/src/components/Spinner/Spinner.module.scss +33 -0
- package/src/components/Spinner/Spinner.tsx +61 -0
- package/src/components/Stepper/Step.module.scss +301 -0
- package/src/components/Stepper/Step.tsx +116 -0
- package/src/components/Stepper/Stepper.module.scss +17 -0
- package/src/components/Stepper/Stepper.tsx +53 -0
- package/src/components/Tabs/Tab.module.scss +27 -0
- package/src/components/Tabs/Tab.tsx +41 -0
- package/src/components/Tabs/TabButton.module.scss +87 -0
- package/src/components/Tabs/TabButton.tsx +66 -0
- package/src/components/Tabs/Tabs.module.scss +58 -0
- package/src/components/Tabs/Tabs.tsx +217 -0
- package/src/components/Tag/RemoveButton.module.scss +42 -0
- package/src/components/Tag/RemoveButton.tsx +53 -0
- package/src/components/Tag/Tag.module.scss +43 -0
- package/src/components/Tag/Tag.tsx +79 -0
- package/src/components/TextEllipsis/TextEllipsis.module.scss +35 -0
- package/src/components/TextEllipsis/TextEllipsis.tsx +80 -0
- package/src/components/Tiles/Tile.module.scss +91 -0
- package/src/components/Tiles/Tile.tsx +105 -0
- package/src/components/Tiles/Tiles.module.scss +27 -0
- package/src/components/Tiles/Tiles.tsx +70 -0
- package/src/components/Tooltip/Tooltip.module.scss +221 -0
- package/src/components/Tooltip/Tooltip.tsx +251 -0
- package/src/components/Typography/Typography.module.scss +80 -0
- package/src/components/Typography/Typography.tsx +111 -0
- package/src/components/_BaseStyling_/BaseStyling.tsx +481 -0
- package/src/components/_BaseStyling_/buttonBaseStyling.ts +123 -0
- package/src/components/admin/layout/LeftNav/LeftNav.interfaces.ts +30 -0
- package/src/components/admin/layout/LeftNav/LeftNav.module.scss +66 -0
- package/src/components/admin/layout/LeftNav/LeftNav.tsx +96 -0
- package/src/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.tsx +173 -0
- package/src/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.interface.ts +28 -0
- package/src/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss +222 -0
- package/src/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.tsx +34 -0
- package/src/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.tsx +106 -0
- package/src/components/admin/layout/LeftNav/LeftNavItem/useKeyboardNavigation.ts +75 -0
- package/src/components/admin/layout/LeftNav/useRefItems.ts +280 -0
- package/src/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss +25 -0
- package/src/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.tsx +47 -0
- package/src/components/miscellaneous/IdentityProviderButton.module.scss +31 -0
- package/src/components/miscellaneous/IdentityProviderButton.tsx +92 -0
- package/src/components/withReadOnly.tsx +121 -0
- package/src/font/README.md +47 -0
- package/src/font/icomoon.eot +0 -0
- package/src/font/icomoon.svg +111 -0
- package/src/font/icomoon.ttf +0 -0
- package/src/font/icomoon.woff +0 -0
- package/src/font/selection.json +1 -0
- package/src/hooks/useAnimation.ts +36 -0
- package/src/hooks/useClickOutside.ts +42 -0
- package/src/hooks/useDebouncedCallback.tsx +34 -0
- package/src/hooks/useDetermineStatusIcon.tsx +33 -0
- package/src/hooks/useFormSelector.ts +63 -0
- package/src/hooks/useFullHeightCollapse.ts +33 -0
- package/src/hooks/useGetDomRoot.ts +40 -0
- package/src/hooks/usePosition.ts +387 -0
- package/src/hooks/useRepeatFocus.tsx +89 -0
- package/src/hooks/useRepeater.ts +50 -0
- package/src/hooks/useScreenSize.ts +60 -0
- package/src/hooks/useScroll.ts +32 -0
- package/src/hooks/useSpacing.ts +58 -0
- package/src/hooks/useUploadFile.tsx +141 -0
- package/src/hooks/useWrapper.ts +33 -0
- package/src/index.ts +237 -0
- package/src/interfaces.ts +37 -0
- package/src/mixins.module.scss +371 -0
- package/src/readyclasses.module.scss +64 -0
- package/src/types.d.ts +20 -0
- package/src/util/helper.tsx +219 -0
- package/src/util/unitTestUtils.ts +32 -0
- package/src/utils/statusUtils.ts +51 -0
- package/src/variables.scss +38 -0
- package/src/variables.ts +32 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type DataAttributeKey = `data-${string}`;
|
|
3
|
+
export interface KeyValuePair {
|
|
4
|
+
[dataAttribute: DataAttributeKey]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export type MergeElementProps<T extends React.ElementType, P> = Omit<React.ComponentPropsWithRef<T>, keyof P> & P;
|
|
7
|
+
export type DeepPartial<T> = {
|
|
8
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial<U>[] : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : DeepPartial<T[P]>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const generateID: (length?: number, stringToWeaveIn?: string) => string;
|
|
2
|
+
export declare const filterProps: (props: any, regexPattern: RegExp, returnFiltered?: boolean) => {};
|
|
3
|
+
export declare const debounce: (fn: (...args: unknown[]) => unknown, delay: number) => (...args: unknown[]) => void;
|
|
4
|
+
export declare const throttle: (fn: (...args: unknown[]) => unknown, delay: number) => () => void;
|
|
5
|
+
export declare const areArraysDifferent: (arr1: Record<string, any>[], arr2: Record<string, any>[], key: string) => boolean;
|
|
6
|
+
/** Source: https://stackoverflow.com/a/42769683/5084110 */
|
|
7
|
+
export declare const remToPx: (rem: number) => number;
|
|
8
|
+
export declare const isJsonString: (str: any) => boolean;
|
|
9
|
+
type ObjectType = {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
export declare const deepMerge: <T extends object>(obj1: ObjectType, obj2: ObjectType | false) => T;
|
|
13
|
+
export declare const escapeRegExp: (str: string) => string;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class MockDOMRect implements DOMRect {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
top: number;
|
|
7
|
+
right: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
left: number;
|
|
10
|
+
constructor(x?: number, y?: number, width?: number, height?: number, top?: number, right?: number, bottom?: number, left?: number);
|
|
11
|
+
toJSON(): this;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Icons } from '../components/Icon/Icon';
|
|
2
|
+
interface StatusProps {
|
|
3
|
+
error?: boolean;
|
|
4
|
+
success?: boolean;
|
|
5
|
+
info?: boolean;
|
|
6
|
+
}
|
|
7
|
+
type StatusState = "error" | "success" | "info";
|
|
8
|
+
export declare function getStatusIcon({ error, success, info }: StatusProps): Icons;
|
|
9
|
+
export declare function getStatusState({ error, success, info }: StatusProps, defaultToInfo?: boolean): StatusState | undefined;
|
|
10
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"homepage": "http://onewelcome.github.io/react-lib-components",
|
|
3
|
+
"name": "@onewelcome/react-lib-components",
|
|
4
|
+
"version": "0.0.0-experimental-8e3a0fd",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "OneWelcome B.V.",
|
|
7
|
+
"main": "dist/index.cjs.js",
|
|
8
|
+
"module": "dist/index.es.js",
|
|
9
|
+
"typings": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"src",
|
|
13
|
+
"!*/**/*.test.tsx",
|
|
14
|
+
"!*/**/*.test.ts"
|
|
15
|
+
],
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"*.css",
|
|
18
|
+
"*.scss"
|
|
19
|
+
],
|
|
20
|
+
"browserslist": [
|
|
21
|
+
">0.2%",
|
|
22
|
+
"not dead",
|
|
23
|
+
"not ie <= 11"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/onewelcome/react-lib-components"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "rimraf dist && vite build",
|
|
34
|
+
"build-storybook": "storybook build",
|
|
35
|
+
"chromatic": "chromatic --exit-zero-on-changes",
|
|
36
|
+
"dev": "npm-run-all -p test:watch storybook",
|
|
37
|
+
"lint": "eslint \"**/*.{js,mjs,ts,tsx}\"",
|
|
38
|
+
"prepare": "husky && vite build",
|
|
39
|
+
"start": "npm run storybook",
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"test:watch": "npm test -- --watch",
|
|
42
|
+
"prettier": "prettier --write --ignore-path .gitignore \"**/*.+(ts|tsx|scss|mdx)\"",
|
|
43
|
+
"storybook": "storybook dev -p 6006"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"date-fns": "^4.1.0",
|
|
47
|
+
"react": ">=16",
|
|
48
|
+
"react-day-picker": "^9.4.1",
|
|
49
|
+
"react-dom": ">=16"
|
|
50
|
+
},
|
|
51
|
+
"overrides": {
|
|
52
|
+
"cross-spawn": ">=7.0.5"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=24"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@babel/core": "^7.26.9",
|
|
59
|
+
"@babel/preset-env": "^7.26.9",
|
|
60
|
+
"@babel/preset-react": "^7.26.3",
|
|
61
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
62
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
63
|
+
"@mdx-js/react": "^3.0.1",
|
|
64
|
+
"@onewelcome/eslint-config-shared-codestyle": "^9.3.0",
|
|
65
|
+
"@onewelcome/storybook-addon-basestyling": "^2.0.0",
|
|
66
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
67
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
68
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
69
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
70
|
+
"@rollup/plugin-virtual": "^3.0.2",
|
|
71
|
+
"@storybook/addon-a11y": "^8.6.12",
|
|
72
|
+
"@storybook/addon-actions": "^8.6.12",
|
|
73
|
+
"@storybook/addon-docs": "^8.6.12",
|
|
74
|
+
"@storybook/addon-essentials": "^8.6.12",
|
|
75
|
+
"@storybook/addon-interactions": "^8.6.12",
|
|
76
|
+
"@storybook/addon-links": "^8.6.12",
|
|
77
|
+
"@storybook/addon-styling-webpack": "^1.0.1",
|
|
78
|
+
"@storybook/addon-webpack5-compiler-babel": "^3.0.6",
|
|
79
|
+
"@storybook/blocks": "^8.6.12",
|
|
80
|
+
"@storybook/components": "^8.6.12",
|
|
81
|
+
"@storybook/manager-api": "^8.6.12",
|
|
82
|
+
"@storybook/preview-api": "^8.6.12",
|
|
83
|
+
"@storybook/react": "^8.6.12",
|
|
84
|
+
"@storybook/react-webpack5": "^8.6.12",
|
|
85
|
+
"@storybook/theming": "^8.6.12",
|
|
86
|
+
"@testing-library/dom": "^10.3.0",
|
|
87
|
+
"@testing-library/jest-dom": "^6.4.6",
|
|
88
|
+
"@testing-library/react": "^16.0.0",
|
|
89
|
+
"@testing-library/user-event": "^14.5.2",
|
|
90
|
+
"@types/jest": "^29.5.12",
|
|
91
|
+
"@types/mdx": "^2.0.13",
|
|
92
|
+
"@types/react": "^18.3.3",
|
|
93
|
+
"@types/react-dom": "^18.3.0",
|
|
94
|
+
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
95
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
96
|
+
"autoprefixer": "^10.4.21",
|
|
97
|
+
"babel-loader": "^9.1.3",
|
|
98
|
+
"chromatic": "^11.5.4",
|
|
99
|
+
"clean-css": "^5.3.3",
|
|
100
|
+
"css-loader": "^7.1.2",
|
|
101
|
+
"eslint": "^8.57.1",
|
|
102
|
+
"eslint-config-prettier": "^9.1.0",
|
|
103
|
+
"eslint-plugin-export-scope": "^2.4.0",
|
|
104
|
+
"eslint-plugin-jest": "^28.6.0",
|
|
105
|
+
"eslint-plugin-license-header": "^0.6.1",
|
|
106
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
107
|
+
"eslint-plugin-react": "^7.34.3",
|
|
108
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
109
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
110
|
+
"husky": "^9.1.7",
|
|
111
|
+
"identity-obj-proxy": "^3.0.0",
|
|
112
|
+
"jest": "^29.7.0",
|
|
113
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
114
|
+
"jest-junit": "^16.0.0",
|
|
115
|
+
"jest-sonar-reporter": "^2.0.0",
|
|
116
|
+
"lint-staged": "^15.2.7",
|
|
117
|
+
"mini-css-extract-plugin": "^2.9.2",
|
|
118
|
+
"npm-run-all": "^4.1.5",
|
|
119
|
+
"prettier": "^3.3.2",
|
|
120
|
+
"react": "^18.3.1",
|
|
121
|
+
"react-dom": "^18.3.1",
|
|
122
|
+
"react-is": "^18.3.1",
|
|
123
|
+
"react-router-dom": "^6.24.1",
|
|
124
|
+
"remark-gfm": "^4.0.1",
|
|
125
|
+
"rimraf": "^6.0.1",
|
|
126
|
+
"rollup": "^4.18.0",
|
|
127
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
128
|
+
"sass": "^1.85.1",
|
|
129
|
+
"sass-loader": "^16.0.5",
|
|
130
|
+
"size-limit": "^11.1.4",
|
|
131
|
+
"storybook": "^8.6.12",
|
|
132
|
+
"storybook-addon-mock": "^5.0.0",
|
|
133
|
+
"storybook-addon-pseudo-states": "^4.0.4",
|
|
134
|
+
"storybook-mock-date-decorator": "^2.0.6",
|
|
135
|
+
"style-inject": "^0.3.0",
|
|
136
|
+
"style-loader": "^4.0.0",
|
|
137
|
+
"ts-jest": "^29.1.5",
|
|
138
|
+
"tslib": "^2.6.3",
|
|
139
|
+
"typescript": "^5.5.3",
|
|
140
|
+
"vite": "^6.4.1",
|
|
141
|
+
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
142
|
+
"vite-plugin-dts": "^4.5.3"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +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
|
+
|
|
17
|
+
@function relativeToBaseFontSize($ratio) {
|
|
18
|
+
@return calc($ratio * var(--font-size));
|
|
19
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
.breadcrumbs {
|
|
18
|
+
.last {
|
|
19
|
+
color: var(--color-primary900);
|
|
20
|
+
font-weight: 700;
|
|
21
|
+
margin: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.icon {
|
|
25
|
+
color: var(--color-primary);
|
|
26
|
+
font-size: var(--font-size-small);
|
|
27
|
+
line-height: var(--default-line-height);
|
|
28
|
+
margin: 0 0.84rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.breadcrumb-link {
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
&:hover,
|
|
34
|
+
&.visited {
|
|
35
|
+
[data-underline] {
|
|
36
|
+
text-decoration: underline;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
&:focus,
|
|
40
|
+
&:focus-visible {
|
|
41
|
+
outline: 2px solid var(--color-focus);
|
|
42
|
+
outline-offset: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:visited {
|
|
46
|
+
color: var(--color-primary700);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:active {
|
|
50
|
+
color: var(--color-primary900);
|
|
51
|
+
font-weight: 700;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
import React, {
|
|
18
|
+
ComponentPropsWithRef,
|
|
19
|
+
ForwardRefRenderFunction,
|
|
20
|
+
Fragment,
|
|
21
|
+
ReactElement
|
|
22
|
+
} from "react";
|
|
23
|
+
import { Icon, Icons } from "../Icon/Icon";
|
|
24
|
+
import { Link, Props as LinkProps } from "../Link/Link";
|
|
25
|
+
import { Typography } from "../Typography/Typography";
|
|
26
|
+
import classes from "./Breadcrumbs.module.scss";
|
|
27
|
+
|
|
28
|
+
type ChildrenType = ReactElement<LinkProps, typeof Link>;
|
|
29
|
+
|
|
30
|
+
export interface Props extends ComponentPropsWithRef<"div"> {
|
|
31
|
+
children: ChildrenType | ChildrenType[];
|
|
32
|
+
ariaLabel: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const BreadcrumbsComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
36
|
+
{ children, ariaLabel, className = "", ...rest }: Props,
|
|
37
|
+
ref
|
|
38
|
+
) => {
|
|
39
|
+
const items = React.Children.map(children, (child, index) => {
|
|
40
|
+
const isLastElement = Array.isArray(children) ? index === children.length - 1 : true;
|
|
41
|
+
const isFirstElement = Array.isArray(children) && index === 0;
|
|
42
|
+
const item = React.cloneElement(child, {
|
|
43
|
+
className: classes["breadcrumb-link"],
|
|
44
|
+
...(isFirstElement
|
|
45
|
+
? {
|
|
46
|
+
prefixIcon: <Icon icon={Icons.HomeFilled} style={{ marginRight: "0.35rem" }} />
|
|
47
|
+
}
|
|
48
|
+
: {})
|
|
49
|
+
} as LinkProps);
|
|
50
|
+
|
|
51
|
+
if (isLastElement) {
|
|
52
|
+
return (
|
|
53
|
+
<Typography
|
|
54
|
+
key={child.key}
|
|
55
|
+
variant="body"
|
|
56
|
+
tag="span"
|
|
57
|
+
className={classes["last"]}
|
|
58
|
+
aria-current="page"
|
|
59
|
+
>
|
|
60
|
+
{child.props.children}
|
|
61
|
+
</Typography>
|
|
62
|
+
);
|
|
63
|
+
} else {
|
|
64
|
+
return (
|
|
65
|
+
<Fragment key={child.key}>
|
|
66
|
+
{item}
|
|
67
|
+
<Icon icon={Icons.ChevronRight} className={classes["icon"]} />
|
|
68
|
+
</Fragment>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return (
|
|
73
|
+
<nav
|
|
74
|
+
{...rest}
|
|
75
|
+
ref={ref}
|
|
76
|
+
aria-label={ariaLabel}
|
|
77
|
+
className={`${classes["breadcrumbs"]} ${className}`}
|
|
78
|
+
>
|
|
79
|
+
{items}
|
|
80
|
+
</nav>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Breadcrumbs = React.forwardRef(BreadcrumbsComponent);
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
@use "../../mixins.module.scss";
|
|
18
|
+
|
|
19
|
+
.button {
|
|
20
|
+
position: relative;
|
|
21
|
+
|
|
22
|
+
.content-hidden {
|
|
23
|
+
visibility: hidden;
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
& {
|
|
28
|
+
@include mixins.buttonBase();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.spinner {
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: calc(50% - 0.75rem);
|
|
35
|
+
left: calc(50% - 0.75rem);
|
|
36
|
+
transform: translate(-50%, -50%);
|
|
37
|
+
animation: spin 1s infinite linear;
|
|
38
|
+
|
|
39
|
+
@keyframes spin {
|
|
40
|
+
0% {
|
|
41
|
+
transform: rotate(0deg);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
100% {
|
|
45
|
+
transform: rotate(360deg);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
import React, { ForwardRefRenderFunction, ComponentPropsWithRef, Fragment } from "react";
|
|
18
|
+
import classes from "./BaseButton.module.scss";
|
|
19
|
+
import { ButtonSpinner } from "./Spinner";
|
|
20
|
+
|
|
21
|
+
export interface Props extends ComponentPropsWithRef<"button"> {
|
|
22
|
+
type?: "submit" | "button" | "reset";
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
color?: "primary" | "danger" | "default" | "success" | "warning";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const BaseButtonComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (
|
|
29
|
+
{ children, type = "button", className, loading, disabled, hidden, ...rest },
|
|
30
|
+
ref
|
|
31
|
+
) => {
|
|
32
|
+
const validTypes = ["submit", "button", "reset"];
|
|
33
|
+
const isDisabled = disabled ?? loading;
|
|
34
|
+
if (!validTypes.includes(type)) {
|
|
35
|
+
throw new Error(
|
|
36
|
+
`You have entered an invalid button type. Expected 'submit', 'button' or 'reset' got ${type}`
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const buttonClasses = [classes.button];
|
|
41
|
+
loading && buttonClasses.push(classes.loading);
|
|
42
|
+
className && buttonClasses.push(className);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<button
|
|
46
|
+
{...rest}
|
|
47
|
+
disabled={isDisabled}
|
|
48
|
+
ref={ref}
|
|
49
|
+
type={type}
|
|
50
|
+
hidden={hidden}
|
|
51
|
+
className={hidden ? "" : buttonClasses.join(" ")}
|
|
52
|
+
>
|
|
53
|
+
{loading ? (
|
|
54
|
+
<Fragment>
|
|
55
|
+
<div className={classes["content-hidden"]}>{children}</div>
|
|
56
|
+
<ButtonSpinner className={classes["spinner"]} />
|
|
57
|
+
</Fragment>
|
|
58
|
+
) : (
|
|
59
|
+
children
|
|
60
|
+
)}
|
|
61
|
+
</button>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const BaseButton = React.forwardRef(BaseButtonComponent);
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
@use "../../mixins.module.scss";
|
|
18
|
+
@use "../../functions" as *;
|
|
19
|
+
|
|
20
|
+
.fill {
|
|
21
|
+
@include mixins.button("fill");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.outline {
|
|
25
|
+
@include mixins.button("outline");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.text {
|
|
29
|
+
@include mixins.button("text");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.has-icon {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
|
|
36
|
+
&.start-icon {
|
|
37
|
+
padding-left: relativeToBaseFontSize(0.75);
|
|
38
|
+
padding-right: relativeToBaseFontSize(1.25);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.end-icon {
|
|
42
|
+
padding-left: relativeToBaseFontSize(1.25);
|
|
43
|
+
padding-right: relativeToBaseFontSize(0.75);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
i {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
|
|
51
|
+
width: relativeToBaseFontSize(1.5);
|
|
52
|
+
margin-right: relativeToBaseFontSize(0.25);
|
|
53
|
+
|
|
54
|
+
span {
|
|
55
|
+
font-size: var(--font-size);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
import React, { ForwardRefRenderFunction } from "react";
|
|
18
|
+
import { BaseButton, Props as BaseButtonProps } from "./BaseButton";
|
|
19
|
+
import classes from "./Button.module.scss";
|
|
20
|
+
|
|
21
|
+
export interface Props extends BaseButtonProps {
|
|
22
|
+
startIcon?: React.ReactNode | false;
|
|
23
|
+
endIcon?: React.ReactNode | false;
|
|
24
|
+
variant?: "text" | "fill" | "outline";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const ButtonComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (
|
|
28
|
+
{
|
|
29
|
+
children,
|
|
30
|
+
variant = "fill",
|
|
31
|
+
color = "primary",
|
|
32
|
+
startIcon = false,
|
|
33
|
+
endIcon = false,
|
|
34
|
+
className,
|
|
35
|
+
...rest
|
|
36
|
+
},
|
|
37
|
+
ref
|
|
38
|
+
) => {
|
|
39
|
+
const additionalClasses = [];
|
|
40
|
+
|
|
41
|
+
if (startIcon || endIcon) {
|
|
42
|
+
additionalClasses.push(classes["has-icon"]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (startIcon) {
|
|
46
|
+
additionalClasses.push(classes["start-icon"]);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (endIcon) {
|
|
50
|
+
additionalClasses.push(classes["end-icon"]);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (className) {
|
|
54
|
+
additionalClasses.push(className);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<BaseButton
|
|
59
|
+
{...rest}
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={`${classes[color]} ${classes[variant]} ${additionalClasses.join(" ")}`}
|
|
62
|
+
>
|
|
63
|
+
{startIcon && <i>{startIcon}</i>}
|
|
64
|
+
<span>{children}</span>
|
|
65
|
+
{endIcon && <i> {endIcon}</i>}
|
|
66
|
+
</BaseButton>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const Button = React.forwardRef(ButtonComponent);
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
@use "../../mixins.module.scss";
|
|
18
|
+
@use "../../functions" as *;
|
|
19
|
+
|
|
20
|
+
.icon-button {
|
|
21
|
+
border: var(--button-border-width) var(--button-border-style) transparent;
|
|
22
|
+
background-color: transparent;
|
|
23
|
+
padding: 0;
|
|
24
|
+
border-radius: var(--button-border-radius);
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
min-height: auto;
|
|
29
|
+
|
|
30
|
+
span {
|
|
31
|
+
vertical-align: top;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Sizes **/
|
|
35
|
+
&.button-s {
|
|
36
|
+
width: relativeToBaseFontSize(1.875);
|
|
37
|
+
height: relativeToBaseFontSize(1.875);
|
|
38
|
+
|
|
39
|
+
span {
|
|
40
|
+
font-size: relativeToBaseFontSize(0.75);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.button-m {
|
|
45
|
+
width: relativeToBaseFontSize(2.5);
|
|
46
|
+
height: relativeToBaseFontSize(2.5);
|
|
47
|
+
|
|
48
|
+
span {
|
|
49
|
+
font-size: var(--font-size);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.button-l {
|
|
54
|
+
width: relativeToBaseFontSize(3.125);
|
|
55
|
+
height: relativeToBaseFontSize(3.125);
|
|
56
|
+
|
|
57
|
+
span {
|
|
58
|
+
font-size: relativeToBaseFontSize(1.375);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.fill {
|
|
63
|
+
@include mixins.button("fill", "icon");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.text {
|
|
67
|
+
@include mixins.button("text", "icon");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.outline {
|
|
71
|
+
@include mixins.button("outline", "icon");
|
|
72
|
+
}
|
|
73
|
+
}
|