@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,271 @@
|
|
|
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, { ComponentPropsWithRef, ForwardRefRenderFunction, Fragment } from "react";
|
|
18
|
+
import classes from "./FileItem.module.scss";
|
|
19
|
+
import { Typography } from "../../../Typography/Typography";
|
|
20
|
+
import { Icon, Icons } from "../../../Icon/Icon";
|
|
21
|
+
import { ProgressBar } from "../../../ProgressBar/ProgressBar";
|
|
22
|
+
import { FileType } from "../FileUpload";
|
|
23
|
+
import { Button } from "../../../Button/Button";
|
|
24
|
+
import { Link } from "../../../Link/Link";
|
|
25
|
+
import { withReadOnly } from "../../../withReadOnly";
|
|
26
|
+
export type UploadProgress = "uploading" | "completed" | "error" | "readonly" | "retry";
|
|
27
|
+
|
|
28
|
+
export interface Props extends ComponentPropsWithRef<"div"> {
|
|
29
|
+
name: string;
|
|
30
|
+
status?: UploadProgress;
|
|
31
|
+
progress?: number;
|
|
32
|
+
error?: string;
|
|
33
|
+
downloadFileLink?: string;
|
|
34
|
+
onDownloadFile?: () => void;
|
|
35
|
+
totalPercentage?: number;
|
|
36
|
+
onRequestedFileAction?: (action: FILE_ACTION, name: FileType["name"]) => void;
|
|
37
|
+
}
|
|
38
|
+
interface FileItemIcons {
|
|
39
|
+
fileIcon: Icons;
|
|
40
|
+
actionIcons?: { type: Icons; action: FILE_ACTION }[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export enum FILE_ACTION {
|
|
44
|
+
DELETE = "delete",
|
|
45
|
+
DOWNLOAD = "download",
|
|
46
|
+
REMOVE = "remove",
|
|
47
|
+
ABORT = "abort",
|
|
48
|
+
RETRY = "retry"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export enum ACTION_STATUS {
|
|
52
|
+
COMPLETED = "completed",
|
|
53
|
+
UPLOADING = "uploading",
|
|
54
|
+
ERROR = "error",
|
|
55
|
+
RETRY = "retry",
|
|
56
|
+
READONLY = "readonly"
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const FileItemComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
60
|
+
{
|
|
61
|
+
name,
|
|
62
|
+
status,
|
|
63
|
+
error,
|
|
64
|
+
progress,
|
|
65
|
+
onDownloadFile,
|
|
66
|
+
downloadFileLink,
|
|
67
|
+
totalPercentage,
|
|
68
|
+
onRequestedFileAction,
|
|
69
|
+
...rest
|
|
70
|
+
}: Props,
|
|
71
|
+
ref
|
|
72
|
+
) => {
|
|
73
|
+
const determineIcons = (status?: UploadProgress): FileItemIcons => {
|
|
74
|
+
switch (status) {
|
|
75
|
+
case ACTION_STATUS.COMPLETED:
|
|
76
|
+
return {
|
|
77
|
+
fileIcon: Icons.FileAltIcon,
|
|
78
|
+
actionIcons: [
|
|
79
|
+
{
|
|
80
|
+
type: Icons.Trash,
|
|
81
|
+
action: FILE_ACTION.DELETE
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: Icons.DownloadFile,
|
|
85
|
+
action: FILE_ACTION.DOWNLOAD
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
case ACTION_STATUS.ERROR:
|
|
90
|
+
return {
|
|
91
|
+
fileIcon: Icons.Error,
|
|
92
|
+
actionIcons: [
|
|
93
|
+
{
|
|
94
|
+
type: Icons.Times,
|
|
95
|
+
action: FILE_ACTION.REMOVE
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
case ACTION_STATUS.UPLOADING:
|
|
100
|
+
return {
|
|
101
|
+
fileIcon: Icons.FileAltIcon,
|
|
102
|
+
actionIcons: [
|
|
103
|
+
{
|
|
104
|
+
type: Icons.AbortFile,
|
|
105
|
+
action: FILE_ACTION.ABORT
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
};
|
|
109
|
+
case ACTION_STATUS.RETRY:
|
|
110
|
+
return {
|
|
111
|
+
fileIcon: Icons.FileAltIcon,
|
|
112
|
+
actionIcons: [
|
|
113
|
+
{
|
|
114
|
+
type: Icons.Refresh,
|
|
115
|
+
action: FILE_ACTION.RETRY
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: Icons.Trash,
|
|
119
|
+
action: FILE_ACTION.REMOVE
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
};
|
|
123
|
+
case ACTION_STATUS.READONLY:
|
|
124
|
+
default:
|
|
125
|
+
return { fileIcon: Icons.FileAltIcon };
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const icons = determineIcons(status);
|
|
130
|
+
|
|
131
|
+
const getFriendlyNameAndExtension = (name: string) => {
|
|
132
|
+
const index = name.indexOf(".");
|
|
133
|
+
return { friendlyName: name.slice(0, index), extension: name.slice(index + 1) };
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const { friendlyName, extension } = getFriendlyNameAndExtension(name);
|
|
137
|
+
|
|
138
|
+
const getStartIcon = (icon: { type: Icons; action: FILE_ACTION }) => (
|
|
139
|
+
<Icon
|
|
140
|
+
key={icon.action}
|
|
141
|
+
title={icon.action}
|
|
142
|
+
icon={icon.type}
|
|
143
|
+
className={classes["action-icon"]}
|
|
144
|
+
></Icon>
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const renderActionIcons = (actionIcons: { type: Icons; action: FILE_ACTION }[]) => {
|
|
148
|
+
return actionIcons.map(icon => (
|
|
149
|
+
<Fragment key={icon.action}>
|
|
150
|
+
{icon.action !== FILE_ACTION.DOWNLOAD && (
|
|
151
|
+
<Button
|
|
152
|
+
color="primary"
|
|
153
|
+
startIcon={getStartIcon(icon)}
|
|
154
|
+
title={icon.action !== FILE_ACTION.ABORT ? icon.action : ""}
|
|
155
|
+
type="button"
|
|
156
|
+
variant="text"
|
|
157
|
+
onClick={() =>
|
|
158
|
+
icon && onRequestedFileAction && onRequestedFileAction(icon.action, name)
|
|
159
|
+
}
|
|
160
|
+
>
|
|
161
|
+
{icon.action !== FILE_ACTION.ABORT ? icon.action : ""}
|
|
162
|
+
</Button>
|
|
163
|
+
)}
|
|
164
|
+
|
|
165
|
+
{icon.action === FILE_ACTION.DOWNLOAD && downloadFileLink && !onDownloadFile && (
|
|
166
|
+
<Link
|
|
167
|
+
color="primary"
|
|
168
|
+
display="link"
|
|
169
|
+
to={downloadFileLink}
|
|
170
|
+
type="download"
|
|
171
|
+
target="_blank"
|
|
172
|
+
prefixIcon={
|
|
173
|
+
<Icon
|
|
174
|
+
key={icon.action}
|
|
175
|
+
className={classes["action-icon"]}
|
|
176
|
+
title={icon.action}
|
|
177
|
+
icon={icon.type}
|
|
178
|
+
></Icon>
|
|
179
|
+
}
|
|
180
|
+
>
|
|
181
|
+
{icon.action}
|
|
182
|
+
</Link>
|
|
183
|
+
)}
|
|
184
|
+
|
|
185
|
+
{icon.action === FILE_ACTION.DOWNLOAD && onDownloadFile && (
|
|
186
|
+
<Button
|
|
187
|
+
color="primary"
|
|
188
|
+
onClick={onDownloadFile}
|
|
189
|
+
type="button"
|
|
190
|
+
variant="text"
|
|
191
|
+
startIcon={getStartIcon(icon)}
|
|
192
|
+
>
|
|
193
|
+
{icon.action}
|
|
194
|
+
</Button>
|
|
195
|
+
)}
|
|
196
|
+
</Fragment>
|
|
197
|
+
));
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
const getUploadedFileInfo = () => {
|
|
201
|
+
return (
|
|
202
|
+
<Typography
|
|
203
|
+
variant={"body"}
|
|
204
|
+
title={name}
|
|
205
|
+
className={`${classes["file-name"]} ${status ? classes[status] : ""}`}
|
|
206
|
+
>
|
|
207
|
+
{status === "retry" && (
|
|
208
|
+
<Icon
|
|
209
|
+
icon={Icons.Error}
|
|
210
|
+
className={`${classes["file-icon"]} ${status ? classes[status] : ""}`}
|
|
211
|
+
/>
|
|
212
|
+
)}
|
|
213
|
+
<Icon icon={icons.fileIcon} className={classes["file-icon"]} />
|
|
214
|
+
<span className={classes["friendly-name"]}>
|
|
215
|
+
{friendlyName}.{extension}
|
|
216
|
+
</span>
|
|
217
|
+
</Typography>
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const getProgressBar = () => {
|
|
222
|
+
return (
|
|
223
|
+
<ProgressBar
|
|
224
|
+
className={classes["progress-bar"]}
|
|
225
|
+
completed={progress}
|
|
226
|
+
label={`${friendlyName}.${extension}`}
|
|
227
|
+
percentage={totalPercentage}
|
|
228
|
+
/>
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
const restPropsWithoutPointerEvents = () => {
|
|
233
|
+
const props = rest;
|
|
234
|
+
delete rest?.style?.pointerEvents;
|
|
235
|
+
return props;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<div
|
|
240
|
+
ref={ref}
|
|
241
|
+
className={classes["file-item-wrapper"]}
|
|
242
|
+
aria-label={`${name}-wrapper`}
|
|
243
|
+
tabIndex={0}
|
|
244
|
+
{...restPropsWithoutPointerEvents()}
|
|
245
|
+
>
|
|
246
|
+
<div className={classes["file-list-container"]}>
|
|
247
|
+
{status !== ACTION_STATUS.UPLOADING && getUploadedFileInfo()}
|
|
248
|
+
|
|
249
|
+
<div
|
|
250
|
+
className={`${status === ACTION_STATUS.UPLOADING ? classes["progress-with-action"] : ""}`}
|
|
251
|
+
>
|
|
252
|
+
{status === ACTION_STATUS.UPLOADING && getProgressBar()}
|
|
253
|
+
|
|
254
|
+
<div className={classes["action-button-wrapper"]}>
|
|
255
|
+
{icons.actionIcons && renderActionIcons(icons.actionIcons)}
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
{error && (
|
|
260
|
+
<Typography
|
|
261
|
+
variant={"sub-text"}
|
|
262
|
+
className={`${classes["file-subtitle"]} ${status ? classes[status] : ""}`}
|
|
263
|
+
>
|
|
264
|
+
{error}
|
|
265
|
+
</Typography>
|
|
266
|
+
)}
|
|
267
|
+
</div>
|
|
268
|
+
);
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export const FileItem = withReadOnly(React.forwardRef(FileItemComponent));
|
|
@@ -0,0 +1,241 @@
|
|
|
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" as *;
|
|
18
|
+
|
|
19
|
+
.file-upload-wrapper {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.file-dropzone {
|
|
25
|
+
border-radius: var(--input-border-radius);
|
|
26
|
+
background-color: var(--input-background-color);
|
|
27
|
+
position: relative;
|
|
28
|
+
|
|
29
|
+
.file-upload-title {
|
|
30
|
+
margin: 0 0 0.25rem 0;
|
|
31
|
+
font-family: var(--font-family);
|
|
32
|
+
font-size: var(--form-control-font-size);
|
|
33
|
+
line-height: var(--default-line-height);
|
|
34
|
+
color: var(--color-blue-grey900);
|
|
35
|
+
font-weight: 400;
|
|
36
|
+
display: block;
|
|
37
|
+
|
|
38
|
+
&.required {
|
|
39
|
+
&:after {
|
|
40
|
+
content: " *";
|
|
41
|
+
color: var(--error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.error {
|
|
47
|
+
span[data-icon-status],
|
|
48
|
+
.file-upload-title {
|
|
49
|
+
color: var(--error);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.file-select {
|
|
53
|
+
border-color: var(--error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.success {
|
|
58
|
+
span[data-icon-status] {
|
|
59
|
+
color: var(--success);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.upload-button-wrapper {
|
|
64
|
+
&.disabled {
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
|
|
67
|
+
p {
|
|
68
|
+
color: var(--color-blue-grey400);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
span[data-icon-status] {
|
|
74
|
+
font-size: var(--font-size-big);
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: auto;
|
|
77
|
+
right: 2rem;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
& {
|
|
81
|
+
@include transition(all, 0.2s, ease-in-out);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&[data-readonlyview="true"]:has(.file-list) {
|
|
85
|
+
.required {
|
|
86
|
+
&:after {
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
ul {
|
|
92
|
+
li {
|
|
93
|
+
p {
|
|
94
|
+
span[data-icon] {
|
|
95
|
+
&:before {
|
|
96
|
+
color: var(--color-blue-grey900);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
button {
|
|
102
|
+
visibility: hidden;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.upload-button-wrapper {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&[data-readonlyview="true"]:not(:has(.file-list)) {
|
|
113
|
+
.upload-button-wrapper {
|
|
114
|
+
min-height: 4.5rem;
|
|
115
|
+
|
|
116
|
+
& .file-select {
|
|
117
|
+
border: 0;
|
|
118
|
+
|
|
119
|
+
& p {
|
|
120
|
+
color: var(--read-only-text-color);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
& .file-upload-btn {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.required {
|
|
130
|
+
&:after {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.upload-button-wrapper {
|
|
138
|
+
background: var(--color-blue-grey25);
|
|
139
|
+
padding: 4px;
|
|
140
|
+
|
|
141
|
+
&.drag-active {
|
|
142
|
+
.outline {
|
|
143
|
+
position: absolute;
|
|
144
|
+
margin: 0;
|
|
145
|
+
padding: 0;
|
|
146
|
+
inset: 0;
|
|
147
|
+
border: var(--file-upload-border-width) var(--drag-drop-border-style)
|
|
148
|
+
var(--color-blue-grey500);
|
|
149
|
+
border-radius: var(--input-border-radius);
|
|
150
|
+
background-color: var(--color-primary50);
|
|
151
|
+
|
|
152
|
+
@include transition(all, 0.2s, ease-in-out);
|
|
153
|
+
|
|
154
|
+
&::before {
|
|
155
|
+
content: "Drop here";
|
|
156
|
+
text-align: center;
|
|
157
|
+
display: block;
|
|
158
|
+
color: var(--color-primary);
|
|
159
|
+
padding-top: 2rem;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&:hover .outline {
|
|
164
|
+
background-color: var(--color-primary50);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
& .file-select {
|
|
168
|
+
position: relative;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.error {
|
|
172
|
+
.outline {
|
|
173
|
+
border-color: var(--error);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.file-selector-sub-text {
|
|
180
|
+
color: var(--greyed-out);
|
|
181
|
+
|
|
182
|
+
&.error {
|
|
183
|
+
color: var(--error);
|
|
184
|
+
display: block;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.file-selector-helper-text {
|
|
189
|
+
color: var(--greyed-out);
|
|
190
|
+
display: block;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.file-select {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
flex-direction: row;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
border: var(--file-upload-border-width) var(--drag-drop-border-style) var(--color-blue-grey100);
|
|
199
|
+
padding: 1.25rem;
|
|
200
|
+
|
|
201
|
+
[class*="file"] {
|
|
202
|
+
font-size: var(--font-size-big);
|
|
203
|
+
margin-left: 0.5rem;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[class*="typography"] {
|
|
207
|
+
margin-bottom: 0;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.upload-input {
|
|
212
|
+
display: block;
|
|
213
|
+
width: 100%;
|
|
214
|
+
border: none;
|
|
215
|
+
text-transform: none;
|
|
216
|
+
position: absolute;
|
|
217
|
+
top: 0;
|
|
218
|
+
left: 0;
|
|
219
|
+
right: 0;
|
|
220
|
+
bottom: 0;
|
|
221
|
+
opacity: 0;
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
|
|
224
|
+
&:focus {
|
|
225
|
+
outline: none;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.file-upload-btn {
|
|
230
|
+
position: relative;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.file-list {
|
|
234
|
+
list-style: none;
|
|
235
|
+
padding: 0;
|
|
236
|
+
margin: 0.25rem 0;
|
|
237
|
+
|
|
238
|
+
li:not(:last-child) {
|
|
239
|
+
margin-bottom: 0.5rem;
|
|
240
|
+
}
|
|
241
|
+
}
|