@luscii-healthtech/web-ui 0.0.0-alpha.2fcd0e9
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/README.md +179 -0
- package/dist/components/Accordion/Accordion.d.ts +10 -0
- package/dist/components/Accordion/AccordionItem.d.ts +9 -0
- package/dist/components/AccordionList/AccordionList.d.ts +42 -0
- package/dist/components/AccordionList/subcomponents/AccordionListActions.d.ts +18 -0
- package/dist/components/Badge/Badge.d.ts +7 -0
- package/dist/components/BaseList/BaseList.d.ts +7 -0
- package/dist/components/BaseList/BaseList.types.d.ts +55 -0
- package/dist/components/BaseList/BaseListEmptyState.d.ts +7 -0
- package/dist/components/BaseList/BaseListHeader.d.ts +4 -0
- package/dist/components/BaseList/BaseListIcon.d.ts +5 -0
- package/dist/components/BaseList/BaseListItem.d.ts +4 -0
- package/dist/components/BaseList/DraggableBaseList/DraggableBaseList.d.ts +4 -0
- package/dist/components/BaseList/DraggableBaseList/DraggableBaseListItem.d.ts +3 -0
- package/dist/components/BaseList/DraggableBaseList/index.d.ts +2 -0
- package/dist/components/BaseList/ListSkeleton/ListItemSkeleton.d.ts +2 -0
- package/dist/components/BaseList/ListSkeleton/ListSkeleton.d.ts +8 -0
- package/dist/components/BaseList/SortableBaseList/SortableBaseList.d.ts +4 -0
- package/dist/components/BaseList/SortableBaseList/SortableBaseListItem.d.ts +3 -0
- package/dist/components/BaseList/SortableBaseList/index.d.ts +2 -0
- package/dist/components/BaseList/index.d.ts +6 -0
- package/dist/components/BaseList/utils.d.ts +10 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts +4 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +14 -0
- package/dist/components/Breadcrumbs/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +9 -0
- package/dist/components/Button/Button.types.d.ts +32 -0
- package/dist/components/Button/ButtonIcon.d.ts +7 -0
- package/dist/components/ButtonV2/ButtonProps.type.d.ts +49 -0
- package/dist/components/ButtonV2/ButtonV2.d.ts +3 -0
- package/dist/components/ButtonV2/PrimaryButton.d.ts +3 -0
- package/dist/components/ButtonV2/SecondaryButton.d.ts +3 -0
- package/dist/components/ButtonV2/TertiaryButton.d.ts +3 -0
- package/dist/components/Card/Card.d.ts +12 -0
- package/dist/components/Carousel/Carousel.d.ts +8 -0
- package/dist/components/Carousel/GliderContainer.d.ts +7 -0
- package/dist/components/CenteredHero/CenteredHero.d.ts +14 -0
- package/dist/components/CheckBoxListModal/CheckboxListModal.d.ts +30 -0
- package/dist/components/Checkbox/Checkbox.d.ts +64 -0
- package/dist/components/CheckboxList/CheckboxGroup.d.ts +3 -0
- package/dist/components/CheckboxList/CheckboxList.d.ts +4 -0
- package/dist/components/CheckboxList/CheckboxList.types.d.ts +74 -0
- package/dist/components/CheckboxList/CheckboxListItem.d.ts +3 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +3 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialogChoices.d.ts +7 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialogMessage.d.ts +4 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialogTitle.d.ts +3 -0
- package/dist/components/ConfirmationDialog/types/ConfirmationDialog.types.d.ts +41 -0
- package/dist/components/Container/FlexColumn.d.ts +7 -0
- package/dist/components/Container/FlexContainer.d.ts +9 -0
- package/dist/components/Container/FlexRow.d.ts +7 -0
- package/dist/components/Container/types/FlexContainerProps.type.d.ts +26 -0
- package/dist/components/Divider/Divider.d.ts +6 -0
- package/dist/components/DragHandle/DragHandle.d.ts +7 -0
- package/dist/components/DragHandle/DragHandle.types.d.ts +6 -0
- package/dist/components/DragHandle/index.d.ts +2 -0
- package/dist/components/Dropzone/Dropzone.d.ts +6 -0
- package/dist/components/Dropzone/Dropzone.types.d.ts +33 -0
- package/dist/components/Dropzone/index.d.ts +2 -0
- package/dist/components/EmptyListMessage/EmptyListMessage.d.ts +14 -0
- package/dist/components/FilterBar/ActiveFilters.d.ts +9 -0
- package/dist/components/FilterBar/FilterBar.d.ts +96 -0
- package/dist/components/FilterBar/FilterBar.utils.d.ts +32 -0
- package/dist/components/FilterBar/FilterBarProps.type.d.ts +86 -0
- package/dist/components/FilterBar/FiltersMenus.d.ts +8 -0
- package/dist/components/FilterBar/SortMenu.d.ts +9 -0
- package/dist/components/FilterBar/index.d.ts +2 -0
- package/dist/components/Form/Form.d.ts +30 -0
- package/dist/components/Form/FormFieldCheckbox.d.ts +9 -0
- package/dist/components/Form/FormFieldCheckboxList.d.ts +9 -0
- package/dist/components/Form/FormFieldErrorMessages.d.ts +8 -0
- package/dist/components/Form/FormFieldLabeler.d.ts +8 -0
- package/dist/components/Form/FormImagePicker.d.ts +9 -0
- package/dist/components/Form/FormInput.d.ts +14 -0
- package/dist/components/Form/FormRadioGroup.d.ts +13 -0
- package/dist/components/Form/FormSelect.d.ts +10 -0
- package/dist/components/Form/FormTextarea.d.ts +14 -0
- package/dist/components/Form/form.transformer.d.ts +3 -0
- package/dist/components/Form/form.types.d.ts +92 -0
- package/dist/components/Icon/Icon.d.ts +17 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icons/AddIcon.d.ts +4 -0
- package/dist/components/Icons/AlertsIcon.d.ts +4 -0
- package/dist/components/Icons/BellIcon.d.ts +4 -0
- package/dist/components/Icons/BluetoothIcon.d.ts +4 -0
- package/dist/components/Icons/ChartIcon.d.ts +4 -0
- package/dist/components/Icons/ChartLineColoredIcon.d.ts +4 -0
- package/dist/components/Icons/ChatBoxIcon.d.ts +4 -0
- package/dist/components/Icons/CheckIcon.d.ts +4 -0
- package/dist/components/Icons/ChevronDoubleIcon.d.ts +4 -0
- package/dist/components/Icons/ChevronDownIcon.d.ts +4 -0
- package/dist/components/Icons/ChevronRightIcon.d.ts +4 -0
- package/dist/components/Icons/CrossIcon.d.ts +4 -0
- package/dist/components/Icons/DeleteIcon.d.ts +4 -0
- package/dist/components/Icons/DownArrowIcon.d.ts +4 -0
- package/dist/components/Icons/DragIcon.d.ts +4 -0
- package/dist/components/Icons/EditIcon.d.ts +4 -0
- package/dist/components/Icons/EmptyIcon.d.ts +4 -0
- package/dist/components/Icons/EmptyStateDashboardIcon.d.ts +4 -0
- package/dist/components/Icons/ExclamationMarkIcon.d.ts +4 -0
- package/dist/components/Icons/EyeIcon.d.ts +4 -0
- package/dist/components/Icons/EyeIconSlashed.d.ts +4 -0
- package/dist/components/Icons/GearColoredIcon.d.ts +4 -0
- package/dist/components/Icons/GearIcon.d.ts +4 -0
- package/dist/components/Icons/GroupColoredIcon.d.ts +4 -0
- package/dist/components/Icons/GroupIcon.d.ts +4 -0
- package/dist/components/Icons/HamburgerIcon.d.ts +4 -0
- package/dist/components/Icons/HeartIcon.d.ts +4 -0
- package/dist/components/Icons/ImageIcon.d.ts +4 -0
- package/dist/components/Icons/InfoIcon.d.ts +4 -0
- package/dist/components/Icons/LeftArrowIcon.d.ts +4 -0
- package/dist/components/Icons/LightBulbIcon.d.ts +4 -0
- package/dist/components/Icons/LinkIcon.d.ts +4 -0
- package/dist/components/Icons/LockIcon.d.ts +4 -0
- package/dist/components/Icons/MessagesIcon.d.ts +4 -0
- package/dist/components/Icons/MouseIcon.d.ts +4 -0
- package/dist/components/Icons/NotesIcon.d.ts +4 -0
- package/dist/components/Icons/PageViewIcon.d.ts +4 -0
- package/dist/components/Icons/PinIcon.d.ts +4 -0
- package/dist/components/Icons/PrintIcon.d.ts +4 -0
- package/dist/components/Icons/RightArrowIcon.d.ts +4 -0
- package/dist/components/Icons/SearchCancelIcon.d.ts +4 -0
- package/dist/components/Icons/SearchIcon.d.ts +4 -0
- package/dist/components/Icons/SmallCircleIcon.d.ts +4 -0
- package/dist/components/Icons/SmallDiamondIcon.d.ts +4 -0
- package/dist/components/Icons/SmallSquareIcon.d.ts +4 -0
- package/dist/components/Icons/SpaceRocketIcon.d.ts +4 -0
- package/dist/components/Icons/StarIcon.d.ts +4 -0
- package/dist/components/Icons/StatusColoredIcon.d.ts +4 -0
- package/dist/components/Icons/WarningIcon.d.ts +4 -0
- package/dist/components/Icons/iconWrapper/iconWrapper.d.ts +4 -0
- package/dist/components/Icons/iconWrapper/index.d.ts +1 -0
- package/dist/components/Icons/index.d.ts +49 -0
- package/dist/components/Icons/templates/component.d.ts +3 -0
- package/dist/components/Icons/templates/index.d.ts +2 -0
- package/dist/components/Icons/types/IconProps.type.d.ts +8 -0
- package/dist/components/Image/Image.d.ts +10 -0
- package/dist/components/InfoField/InfoField.d.ts +28 -0
- package/dist/components/Input/Input.d.ts +57 -0
- package/dist/components/Input/SearchInput.d.ts +24 -0
- package/dist/components/Link/Link.d.ts +19 -0
- package/dist/components/List/List.d.ts +6 -0
- package/dist/components/List/List.types.d.ts +19 -0
- package/dist/components/List/ListItem.d.ts +4 -0
- package/dist/components/List/index.d.ts +5 -0
- package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +12 -0
- package/dist/components/MediaPicker/ImageCategory.d.ts +14 -0
- package/dist/components/MediaPicker/MediaPicker.d.ts +95 -0
- package/dist/components/Modal/FullPageModal.d.ts +39 -0
- package/dist/components/Modal/FullPageModalHeader.d.ts +13 -0
- package/dist/components/Modal/Modal.d.ts +6 -0
- package/dist/components/Modal/ModalBase.d.ts +16 -0
- package/dist/components/Modal/ModalFooter.d.ts +12 -0
- package/dist/components/Modal/ModalHeader.d.ts +6 -0
- package/dist/components/Modal/subcomponents/FullPageModalActions.d.ts +18 -0
- package/dist/components/NavMenu/NavLayout.d.ts +20 -0
- package/dist/components/NavMenu/NavMenu.d.ts +16 -0
- package/dist/components/NavMenu/NavMenuContent.d.ts +3 -0
- package/dist/components/NavMenu/NavMenuFooter.d.ts +3 -0
- package/dist/components/NavMenu/NavMenuHeader.d.ts +3 -0
- package/dist/components/NavMenu/NavMenuItem.d.ts +3 -0
- package/dist/components/NavMenu/types/NavMenuFooterProps.type.d.ts +5 -0
- package/dist/components/NavMenu/types/NavMenuHeaderProps.type.d.ts +5 -0
- package/dist/components/NavMenu/types/NavMenuItemProps.type.d.ts +11 -0
- package/dist/components/NotificationBanner/NotificationBanner.d.ts +41 -0
- package/dist/components/Page/CRUDPage.d.ts +4 -0
- package/dist/components/Page/CRUDPage.types.d.ts +32 -0
- package/dist/components/Page/index.d.ts +3 -0
- package/dist/components/PageHeader/PageHeader.d.ts +4 -0
- package/dist/components/PageHeader/PageHeader.types.d.ts +28 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/PaginationMenu/PaginationMenu.d.ts +3 -0
- package/dist/components/PaginationMenu/PaginationMenu.types.d.ts +37 -0
- package/dist/components/PaginationMenu/PaginationMenu.utils.d.ts +15 -0
- package/dist/components/PaginationMenu/PaginationMenuLarge.d.ts +3 -0
- package/dist/components/PaginationMenu/PaginationMenuSmall.d.ts +3 -0
- package/dist/components/PreviewPhone/PreviewPhone.d.ts +7 -0
- package/dist/components/Radio/RadioV2.d.ts +17 -0
- package/dist/components/RadioGroup/RadioGroupV2.d.ts +10 -0
- package/dist/components/Section/Section.d.ts +25 -0
- package/dist/components/Section/SectionItem.d.ts +9 -0
- package/dist/components/Section/SectionItemWithContent.d.ts +9 -0
- package/dist/components/Section/subcomponents/SectionActions.d.ts +21 -0
- package/dist/components/Select/Select.d.ts +46 -0
- package/dist/components/Select/SelectDropdownIndicator.d.ts +3 -0
- package/dist/components/Select/SelectLoadingIndicator.d.ts +3 -0
- package/dist/components/SettingsMenuButton/SettingsMenuButton.d.ts +19 -0
- package/dist/components/Spinner/Spinner.d.ts +6 -0
- package/dist/components/Steps/Step.d.ts +10 -0
- package/dist/components/Steps/Steps.d.ts +10 -0
- package/dist/components/TabLinks/TabLinks.d.ts +14 -0
- package/dist/components/Tabbar/Tabbar.d.ts +18 -0
- package/dist/components/Tabbar/TabbarItem.d.ts +16 -0
- package/dist/components/Table/Table.d.ts +16 -0
- package/dist/components/Table/Table.types.d.ts +43 -0
- package/dist/components/Table/Table.utils.d.ts +3 -0
- package/dist/components/Table/TableBody.d.ts +13 -0
- package/dist/components/Table/TableBodyRow.d.ts +10 -0
- package/dist/components/Table/TableBodyRowDataCell.d.ts +8 -0
- package/dist/components/Table/TableFooter.d.ts +8 -0
- package/dist/components/Table/TableHeader.d.ts +7 -0
- package/dist/components/Tag/Tag.d.ts +17 -0
- package/dist/components/Tag/Tag.utils.d.ts +4 -0
- package/dist/components/Tag/TagGroup.d.ts +10 -0
- package/dist/components/Text/Text.d.ts +115 -0
- package/dist/components/TextEditor/TextEditor.d.ts +17 -0
- package/dist/components/TextLink/TextLink.d.ts +14 -0
- package/dist/components/Textarea/Textarea.d.ts +29 -0
- package/dist/components/Timeline/Timeline.d.ts +14 -0
- package/dist/components/Timeline/TimelineHeader.d.ts +10 -0
- package/dist/components/Timeline/TimelineStep.d.ts +10 -0
- package/dist/components/Title/Title.d.ts +17 -0
- package/dist/components/Toaster/Toaster.d.ts +17 -0
- package/dist/components/Toaster/toast-elements-getter.d.ts +22 -0
- package/dist/components/Toaster/toast-progress-animator.d.ts +12 -0
- package/dist/components/Toaster/toast.d.ts +12 -0
- package/dist/components/ViewItem/ViewItem.d.ts +16 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.development.js +5682 -0
- package/dist/index.development.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/types/general.types.d.ts +8 -0
- package/dist/utils/string.utils.d.ts +7 -0
- package/dist/web-ui-tailwind.css +2890 -0
- package/dist/web-ui.esm.js +2 -0
- package/dist/web-ui.esm.js.map +1 -0
- package/package.json +159 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CheckboxGroupItemProps } from "../CheckboxList/CheckboxList.types";
|
|
3
|
+
export type Item = {
|
|
4
|
+
group?: string;
|
|
5
|
+
isPinned?: boolean;
|
|
6
|
+
} & Pick<CheckboxGroupItemProps, "id" | "label" | "isChecked" | "isDisabled">;
|
|
7
|
+
export interface Group {
|
|
8
|
+
title?: string;
|
|
9
|
+
items: Item[];
|
|
10
|
+
}
|
|
11
|
+
interface CheckboxListModalTexts {
|
|
12
|
+
title: string;
|
|
13
|
+
confirmLabel: string;
|
|
14
|
+
cancelLabel: string;
|
|
15
|
+
searchPlaceHolder?: string;
|
|
16
|
+
emptyState: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CheckboxListModalProps {
|
|
19
|
+
texts: CheckboxListModalTexts;
|
|
20
|
+
initialItems: Array<Item>;
|
|
21
|
+
isLoadingInitialItems?: boolean;
|
|
22
|
+
isOpen: boolean;
|
|
23
|
+
onSave: (newItems: Item[]) => void;
|
|
24
|
+
onCloseClick: () => void;
|
|
25
|
+
filterItem: (item: Item, searchQuery: string) => boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
hasSearch: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare const CheckboxListModal: ({ texts, initialItems, isLoadingInitialItems, isOpen, onSave, onCloseClick, filterItem, hasSearch, }: CheckboxListModalProps) => JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Checkbox.scss";
|
|
3
|
+
export interface CheckboxProps {
|
|
4
|
+
/**
|
|
5
|
+
* ID used for semantic targeting, as can be used in attributes like `<label htmlFor="some-id">`.
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The visible text labeling the checkbox element.
|
|
10
|
+
*/
|
|
11
|
+
text?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Helper text that adds some more information on what the option means, or inform
|
|
14
|
+
* the user about the consequences of the checkbox.
|
|
15
|
+
*
|
|
16
|
+
* Only works if the `renderLabel` prop isn't set.
|
|
17
|
+
*/
|
|
18
|
+
explanation?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Shows a different checkbox variant. `type="switch"` shows a switch-like component
|
|
21
|
+
* without a visual label.
|
|
22
|
+
*/
|
|
23
|
+
type?: "regular" | "switch";
|
|
24
|
+
/**
|
|
25
|
+
* Set the value.
|
|
26
|
+
* Same as `checked` on `<input type="checkbox" />`.
|
|
27
|
+
*/
|
|
28
|
+
isChecked?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Value for when it is not clear if the state of this checkbox
|
|
31
|
+
* is "checked" or not (for hierarchical checkboxes).
|
|
32
|
+
*/
|
|
33
|
+
isIndeterminate?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Disallow the user to change the checkbox value.
|
|
36
|
+
* Same as `disabled` on `<input type="checkbox" />`.
|
|
37
|
+
*/
|
|
38
|
+
isDisabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The name that the value of the checkbox will be associated with.
|
|
41
|
+
* Same as `name` on `<input type="checkbox" />`.
|
|
42
|
+
*/
|
|
43
|
+
name?: string;
|
|
44
|
+
/**
|
|
45
|
+
* This can be used to retrieve the value it is referring to through onChange.
|
|
46
|
+
*/
|
|
47
|
+
value?: string;
|
|
48
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
49
|
+
className?: string;
|
|
50
|
+
classNameCheckboxLabel?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Visually show that the currently selected value has an issue the user needs to attend to.
|
|
53
|
+
*/
|
|
54
|
+
error?: boolean;
|
|
55
|
+
innerRef?: React.Ref<HTMLInputElement>;
|
|
56
|
+
/**
|
|
57
|
+
* Renders a completely custom label. Can change its contents or
|
|
58
|
+
* appearance based on the props of the checkbox item.
|
|
59
|
+
*
|
|
60
|
+
* Overrides the `text` prop.
|
|
61
|
+
*/
|
|
62
|
+
renderLabel?: (props: CheckboxProps) => JSX.Element | null;
|
|
63
|
+
}
|
|
64
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare enum CheckboxState {
|
|
2
|
+
CHECKED = "checked",
|
|
3
|
+
INDETERMINATE = "indeterminate",
|
|
4
|
+
UNCHECKED = "unchecked"
|
|
5
|
+
}
|
|
6
|
+
export interface CheckboxListProps {
|
|
7
|
+
/**
|
|
8
|
+
* An array of items to render as checkboxes. Each item can be a single item or a group. When the
|
|
9
|
+
* title isn't specified, the group will render as a non-collapsible list. This is the way to
|
|
10
|
+
* render a regular list of checkboxes.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* Single list of checkboxes without visual grouping.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const groups = [{
|
|
17
|
+
* items: [
|
|
18
|
+
* {
|
|
19
|
+
* id: "1",
|
|
20
|
+
* label: "Item 1",
|
|
21
|
+
* },
|
|
22
|
+
* {
|
|
23
|
+
* id: "2",
|
|
24
|
+
* label: "Item 2",
|
|
25
|
+
* },
|
|
26
|
+
* ],
|
|
27
|
+
* }]
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
groups: CheckboxGroup[];
|
|
31
|
+
onChange: (event: CheckboxChangeEvent) => void;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
type WithCollapsible = {
|
|
35
|
+
/**
|
|
36
|
+
* When `false` will prevent the checkbox list from being collapsed (also disabling clicking to expand/collapse)
|
|
37
|
+
* in the component and it will be displayed expanded by default.
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
collapsible?: boolean;
|
|
41
|
+
};
|
|
42
|
+
export type CheckboxGroupProps = CheckboxGroup & {
|
|
43
|
+
onChange: (event: CheckboxChangeEvent) => void;
|
|
44
|
+
className?: string;
|
|
45
|
+
} & WithCollapsible;
|
|
46
|
+
export interface CheckboxGroupItemProps extends CheckboxListItem {
|
|
47
|
+
onChange: (event: CheckboxChangeEvent) => void;
|
|
48
|
+
}
|
|
49
|
+
export interface CheckboxListItem {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
isChecked?: boolean;
|
|
53
|
+
isDisabled?: boolean;
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
export type CheckboxGroup = {
|
|
57
|
+
/**
|
|
58
|
+
* When the title isn't specified, the group will render as a non-collapsible list.
|
|
59
|
+
*/
|
|
60
|
+
title?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The checkbox items to be shown inside of this group.
|
|
63
|
+
*/
|
|
64
|
+
items: CheckboxListItem[];
|
|
65
|
+
/**
|
|
66
|
+
* Whether the group is initially collapsed or not.
|
|
67
|
+
*/
|
|
68
|
+
isCollapsed?: boolean;
|
|
69
|
+
} & WithCollapsible;
|
|
70
|
+
export interface CheckboxChangeEvent {
|
|
71
|
+
id: string;
|
|
72
|
+
newCheckedValue: boolean;
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ConfirmationDialogChoice, ConfirmationDialogProps } from "./types/ConfirmationDialog.types";
|
|
3
|
+
export declare const ConfirmationDialogChoices: React.FC<{
|
|
4
|
+
choices: ConfirmationDialogProps["choices"];
|
|
5
|
+
onChoiceChangeCallback?: (choice: ConfirmationDialogChoice) => void;
|
|
6
|
+
selectedChoice?: ConfirmationDialogChoice;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IconKey, IconProps } from "../../Icons/types/IconProps.type";
|
|
3
|
+
import type { NotificationBannerColor } from "../../NotificationBanner/NotificationBanner";
|
|
4
|
+
interface ConfirmationDialogTexts {
|
|
5
|
+
message: string | string[];
|
|
6
|
+
confirmLabel: string;
|
|
7
|
+
cancelLabel: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ConfirmationDialogChoice<T extends string = string> {
|
|
10
|
+
text: string;
|
|
11
|
+
value: T;
|
|
12
|
+
description?: string;
|
|
13
|
+
displaysInfo?: {
|
|
14
|
+
level: NotificationBannerColor;
|
|
15
|
+
text: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface ConfirmationDialogProps {
|
|
19
|
+
texts: ConfirmationDialogTexts;
|
|
20
|
+
isOpen: boolean;
|
|
21
|
+
onCancel: () => void;
|
|
22
|
+
onConfirm: (choice?: ConfirmationDialogChoice) => void;
|
|
23
|
+
isProcessing?: boolean;
|
|
24
|
+
withTitle?: {
|
|
25
|
+
title: string;
|
|
26
|
+
icon?: React.FC<IconProps> | IconKey;
|
|
27
|
+
};
|
|
28
|
+
choices?: {
|
|
29
|
+
defaultChoice?: ConfirmationDialogChoice["value"];
|
|
30
|
+
onChoiceChange: (choice: ConfirmationDialogChoice) => void;
|
|
31
|
+
options: {
|
|
32
|
+
0: ConfirmationDialogChoice;
|
|
33
|
+
1: ConfirmationDialogChoice;
|
|
34
|
+
} & ConfirmationDialogChoice[];
|
|
35
|
+
};
|
|
36
|
+
dataTestId?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ConfirmationDialogTitleProps {
|
|
39
|
+
title: ConfirmationDialogProps["withTitle"];
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlexContainerProps } from "./types/FlexContainerProps.type";
|
|
3
|
+
/**
|
|
4
|
+
* Container to be used for layouting instead of divs around the project.
|
|
5
|
+
* The spacing here has been coded according to our guidelines.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FlexColumn: React.FC<FlexContainerProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlexContainerBaseProps } from "./types/FlexContainerProps.type";
|
|
3
|
+
/**
|
|
4
|
+
* Container to be used for layouting instead of divs around the project.
|
|
5
|
+
* The spacing here has been coded according to our guidelines.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FlexContainer: React.FC<FlexContainerBaseProps & {
|
|
8
|
+
type: "column" | "row";
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlexContainerProps } from "./types/FlexContainerProps.type";
|
|
3
|
+
/**
|
|
4
|
+
* Container to be used for layouting instead of divs around the project.
|
|
5
|
+
* The spacing here has been coded according to our guidelines.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FlexRow: React.FC<FlexContainerProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Spacing = "tiny" | "none" | "small" | "medium" | "large";
|
|
3
|
+
type FlexContainerBase = {
|
|
4
|
+
alignItems?: "center" | "start" | "end";
|
|
5
|
+
justifyContent?: "center" | "start" | "end" | "between";
|
|
6
|
+
position?: "static" | "fixed" | "absolute" | "relative" | "sticky";
|
|
7
|
+
verticalSpacing?: Spacing;
|
|
8
|
+
horizontalSpacing?: Spacing;
|
|
9
|
+
/**
|
|
10
|
+
* Applies the default padding (`"ui-p-4"`) inside the container.
|
|
11
|
+
*/
|
|
12
|
+
hasPadding?: boolean;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, will make the flexbox full width and not size itui-relative to its content.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
stretch?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type FlexContainerBaseProps = FlexContainerBase & {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
export type FlexContainerProps = Omit<FlexContainerBaseProps, "verticalSpacing" | "horizontalSpacing"> & {
|
|
24
|
+
spacing?: Spacing;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const DragHandle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
grabbing: boolean;
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
dataTestId?: string | undefined;
|
|
6
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export default DragHandle;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Dropzone.scss";
|
|
3
|
+
import type { DropzoneProps, DropzonePresentationProps } from "./Dropzone.types";
|
|
4
|
+
export declare const DropzonePresentation: React.FC<DropzonePresentationProps>;
|
|
5
|
+
export declare const Dropzone: React.FC<DropzoneProps>;
|
|
6
|
+
export default Dropzone;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode, Ref } from "react";
|
|
2
|
+
import type { IconKey } from "../Icons/types/IconProps.type";
|
|
3
|
+
export type DropzonePresentationProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Message shown to the user hinting how to use the component
|
|
6
|
+
* Usually something like "Click or Drag"
|
|
7
|
+
*/
|
|
8
|
+
message?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
* Dropzones no longer support icons
|
|
12
|
+
*/
|
|
13
|
+
icon?: IconKey;
|
|
14
|
+
isHighlighted?: boolean;
|
|
15
|
+
isClickable?: boolean;
|
|
16
|
+
ref?: Ref<HTMLDivElement>;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
dataTestId?: string;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated
|
|
22
|
+
* use alignMessage instead
|
|
23
|
+
*/
|
|
24
|
+
horizontal?: boolean;
|
|
25
|
+
alignMessage?: "left" | "center";
|
|
26
|
+
};
|
|
27
|
+
export type DropzoneProps = Omit<DropzonePresentationProps, "isHighlighted" | "isClickable"> & {
|
|
28
|
+
draggableIdentifier: string | number;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
data?: Record<string, unknown>;
|
|
31
|
+
dataTestId?: string;
|
|
32
|
+
onClick?: React.HTMLAttributes<HTMLButtonElement>["onClick"];
|
|
33
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const imageSrc: {
|
|
3
|
+
"no-open-alerts": string;
|
|
4
|
+
"search-not-found": string;
|
|
5
|
+
"no-notes-found": string;
|
|
6
|
+
};
|
|
7
|
+
interface EmptyListMessageProps {
|
|
8
|
+
text: string;
|
|
9
|
+
imageName?: keyof typeof imageSrc;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const EmptyListMessage: ({ text, imageName, dataTestId, className, }: EmptyListMessageProps) => JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CategorizedFilters, FilterBarLocalization, OnFilterBarFilterChange } from "./FilterBarProps.type";
|
|
3
|
+
type ActiveFiltersProps = {
|
|
4
|
+
filters: CategorizedFilters;
|
|
5
|
+
onRemoveActiveFilter: OnFilterBarFilterChange;
|
|
6
|
+
localization: Pick<FilterBarLocalization, "filtersLabel">;
|
|
7
|
+
};
|
|
8
|
+
export declare const ActiveFilters: React.FC<ActiveFiltersProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { CategorizedFilters, FilterBarLocalization, TransformedSortingOptions } from "./FilterBarProps.type";
|
|
3
|
+
type FilterBarProps<SortableEntity extends object> = {
|
|
4
|
+
/**
|
|
5
|
+
* A list of grouped filters to be displayed in the FilterBar.
|
|
6
|
+
*
|
|
7
|
+
* This is an array with items shaped as:
|
|
8
|
+
* ```ts
|
|
9
|
+
* type CategorizedFilter = {
|
|
10
|
+
* key: string;
|
|
11
|
+
* label: string;
|
|
12
|
+
* options: TransformedFilterOptions;
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* You can choose to manually create this option or use the `getFilterGroups` helper function that will do the same
|
|
17
|
+
* for you based on your data.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* If you decided to use the `getFilterGroups` function:
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* const items = []; // any list of object you are working with
|
|
26
|
+
*
|
|
27
|
+
* // the list of filter generators, the `filterValuePredicate` will be the displayed
|
|
28
|
+
* // value in the filter dropdown, so you can map and transform it to any custom string if necessary, or use
|
|
29
|
+
* // the value from the object entry
|
|
30
|
+
*
|
|
31
|
+
* const filterGenerators: FilterGenerator<TShirtFromApi>[] = [
|
|
32
|
+
* {
|
|
33
|
+
* id: "brand",
|
|
34
|
+
* label: "Brand",
|
|
35
|
+
* filterValuePredicate: (tshirt) => tshirt.brand,
|
|
36
|
+
* },
|
|
37
|
+
* {
|
|
38
|
+
* id: "size",
|
|
39
|
+
* label: "Size",
|
|
40
|
+
* filterValuePredicate: (tshirt) => tshirt.size,
|
|
41
|
+
* },
|
|
42
|
+
* {
|
|
43
|
+
* id: "color",
|
|
44
|
+
* label: "Color",
|
|
45
|
+
* filterValuePredicate: (tshirt) => tshirt.color,
|
|
46
|
+
* },
|
|
47
|
+
* ];
|
|
48
|
+
*
|
|
49
|
+
* const categorizedFilters = getFilterGroups(items, filterGenerators);
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
*
|
|
53
|
+
* A compliant entry in the `categorizedFilters` has a shape like the object below:
|
|
54
|
+
*
|
|
55
|
+
*
|
|
56
|
+
* ```json
|
|
57
|
+
* {
|
|
58
|
+
* "key": "color",
|
|
59
|
+
* "label": "Color",
|
|
60
|
+
* "options": [
|
|
61
|
+
* {
|
|
62
|
+
* "isChecked": false,
|
|
63
|
+
* "id": "yellow",
|
|
64
|
+
* "label": "yellow",
|
|
65
|
+
* "value": "yellow"
|
|
66
|
+
* },
|
|
67
|
+
* {
|
|
68
|
+
* "isChecked": false,
|
|
69
|
+
* "id": "red",
|
|
70
|
+
* "label": "red",
|
|
71
|
+
* "value": "red"
|
|
72
|
+
* },
|
|
73
|
+
* {
|
|
74
|
+
* "isChecked": false,
|
|
75
|
+
* "id": "green",
|
|
76
|
+
* "label": "green",
|
|
77
|
+
* "value": "green"
|
|
78
|
+
* }
|
|
79
|
+
* ]
|
|
80
|
+
* }
|
|
81
|
+
*```
|
|
82
|
+
*/
|
|
83
|
+
categorizedFilters: CategorizedFilters;
|
|
84
|
+
/**
|
|
85
|
+
* For more details, see {@link TransformedSortingOptions}.
|
|
86
|
+
*/
|
|
87
|
+
sortingOptions: TransformedSortingOptions<SortableEntity>;
|
|
88
|
+
onFilterChange: (updatedFilters: CategorizedFilters) => void;
|
|
89
|
+
onSortingChange: (updatedSortingOptions: TransformedSortingOptions<SortableEntity>) => void;
|
|
90
|
+
/**
|
|
91
|
+
* See {@link FilterBarLocalization}.
|
|
92
|
+
*/
|
|
93
|
+
localization: FilterBarLocalization;
|
|
94
|
+
};
|
|
95
|
+
export declare const FilterBar: <SortableEntity extends object>({ localization, categorizedFilters, sortingOptions, ...props }: FilterBarProps<SortableEntity>) => ReactElement | null;
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CategorizedFilters, FilterGenerator, TransformedSortingOptions } from "./FilterBarProps.type";
|
|
2
|
+
/**
|
|
3
|
+
* Generates the list of filters based on the data (see this as what you'd like to be filtered in your component).
|
|
4
|
+
*
|
|
5
|
+
* @param dataToGenerateFiltersFrom - The data (list of entities) that will be used to create the filters.
|
|
6
|
+
* @param groupers a list of functions used to create the filters dropdown
|
|
7
|
+
* @returns {CategorisedFilters} a list of filters properly grouped.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getFilterGroups<T extends unknown[]>(dataToGenerateFiltersFrom: T, groupers: FilterGenerator<T[number]>[]): CategorizedFilters;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param filterKey the key of the categorized filter (eg. color, size, brand) - which one of them are you gonna check.
|
|
13
|
+
* @param categorizedFilters the array of categorized filters the FilterBar component needs
|
|
14
|
+
* @param attributeGetter the getter to retrieve the attribute to be filtered on, this allow maximum flexibility on how to process
|
|
15
|
+
* filters on any level of nesting if necessary.
|
|
16
|
+
* @returns a predicate to be used in the filter function
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* const sizeFilterPredicate = createFilterPredicate<TShirtFromApi>("size", filtersOptions, (item) => item.meta.size);
|
|
20
|
+
* const filteredBySize = items.filter(sizeFilterPredicate);
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export declare const createFilterPredicate: <T extends object>(filterKey: string, categorizedFilters: CategorizedFilters, attributeGetter: (item: T) => string) => (item: T) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a sorting function to be used on a specific object attribute.
|
|
26
|
+
*
|
|
27
|
+
* @param getter the getter function to retrieve the attribute used in the sorting
|
|
28
|
+
* @param order if ascending or descending
|
|
29
|
+
* @returns the sorting comparer function to be used in Array.sort
|
|
30
|
+
*/
|
|
31
|
+
export declare const createSortingComparer: <T extends object>(getter: (item: T) => string | number, order?: "asc" | "desc") => (itemA: T, itemB: T) => number;
|
|
32
|
+
export declare const applySorting: <T extends object[]>(sortable: T, sortingOptions: TransformedSortingOptions<T[number]>) => T;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The object used to create a filter dropdown in the component.
|
|
3
|
+
* This is used based on the dataset passed to FilterBar, so we always calculate the filters
|
|
4
|
+
* looking at the data.
|
|
5
|
+
*/
|
|
6
|
+
export type FilterGenerator<SortableEntity> = {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param data the value from the dataset entry that will be used for the filter
|
|
12
|
+
* @returns the string value for the desired filter
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* {
|
|
18
|
+
id: "brand",
|
|
19
|
+
label: "Brand",
|
|
20
|
+
filterValuePredicate: (tshirt: TShirtFromApi) => tshirt.brand,
|
|
21
|
+
}
|
|
22
|
+
* ```
|
|
23
|
+
* in the above, all unique values from `brand` will be used to populate the `Brand` filter.
|
|
24
|
+
*/
|
|
25
|
+
filterValuePredicate: (data: SortableEntity) => string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Allows customization of labels related to filter.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export type FilterBarLocalization = {
|
|
32
|
+
/**
|
|
33
|
+
* The string prefix displayed when a sorting value is selected in the menu.
|
|
34
|
+
*
|
|
35
|
+
* @default "Sorted by:"
|
|
36
|
+
* @example
|
|
37
|
+
*
|
|
38
|
+
* `sortedByLabel`: "Sorted by: "
|
|
39
|
+
*
|
|
40
|
+
* Example of sorting options
|
|
41
|
+
* - Name
|
|
42
|
+
* - Email (selected)
|
|
43
|
+
* - Date of birth
|
|
44
|
+
*
|
|
45
|
+
* UI shows: `Sorted by: Email`.
|
|
46
|
+
*/
|
|
47
|
+
sortedByLabel: string;
|
|
48
|
+
/**
|
|
49
|
+
* The string for unselected state of the sorting options.
|
|
50
|
+
*
|
|
51
|
+
* @default "Sort"
|
|
52
|
+
*/
|
|
53
|
+
sortLabel: string;
|
|
54
|
+
/**
|
|
55
|
+
* The string for the active filters and the mobile filter menu label.
|
|
56
|
+
*
|
|
57
|
+
* @default "Filters"
|
|
58
|
+
*/
|
|
59
|
+
filtersLabel: string;
|
|
60
|
+
};
|
|
61
|
+
export type TransformedFilterOption = {
|
|
62
|
+
id: string;
|
|
63
|
+
label: string;
|
|
64
|
+
value: string;
|
|
65
|
+
isChecked: boolean;
|
|
66
|
+
};
|
|
67
|
+
export type TransformedFilterOptions = TransformedFilterOption[];
|
|
68
|
+
type CategorizedFilter = {
|
|
69
|
+
key: string;
|
|
70
|
+
label: string;
|
|
71
|
+
options: TransformedFilterOptions;
|
|
72
|
+
};
|
|
73
|
+
export type CategorizedFilters = CategorizedFilter[];
|
|
74
|
+
export type TransformedSortingOption<SortableEntity extends object> = {
|
|
75
|
+
id: string;
|
|
76
|
+
label: string;
|
|
77
|
+
value: string;
|
|
78
|
+
isChecked: boolean;
|
|
79
|
+
sortingCompare: (itemA: SortableEntity, itemB: SortableEntity) => number;
|
|
80
|
+
};
|
|
81
|
+
export type TransformedSortingOptions<SortableEntity extends object> = TransformedSortingOption<SortableEntity>[];
|
|
82
|
+
export type OnFilterBarFilterChange = (params: {
|
|
83
|
+
changedFilterOption: TransformedFilterOption;
|
|
84
|
+
}) => void;
|
|
85
|
+
export type OnFilterBarSortingChange<SortableEntity extends object> = (changedSortingOption: TransformedSortingOption<SortableEntity>) => void;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CategorizedFilters, OnFilterBarFilterChange } from "./FilterBarProps.type";
|
|
3
|
+
type FiltersMenusProps = {
|
|
4
|
+
filters: CategorizedFilters;
|
|
5
|
+
onFilterOptionChange: OnFilterBarFilterChange;
|
|
6
|
+
};
|
|
7
|
+
export declare const FiltersMenus: React.FC<FiltersMenusProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { FilterBarLocalization, OnFilterBarSortingChange, TransformedSortingOption } from "./FilterBarProps.type";
|
|
3
|
+
type SortMenuProps<SortableEntity extends object> = {
|
|
4
|
+
localization: FilterBarLocalization;
|
|
5
|
+
sortingOptions: TransformedSortingOption<SortableEntity>[];
|
|
6
|
+
onSortOptionChange: OnFilterBarSortingChange<SortableEntity>;
|
|
7
|
+
};
|
|
8
|
+
export declare const SortMenu: <SortableEntity extends object>(props: SortMenuProps<SortableEntity>) => ReactElement | null;
|
|
9
|
+
export {};
|