@registrucentras/rc-ses-react-components 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/CaretUpBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CaretUpIcon.d.ts +3 -0
- package/dist/assets/icons/ListIcon.d.ts +3 -0
- package/dist/assets/icons/MinusIcon.d.ts +3 -0
- package/dist/assets/icons/NotePencilIcon.d.ts +3 -0
- package/dist/assets/icons/PlusIcon.d.ts +3 -0
- package/dist/assets/icons/TrashIcon.d.ts +3 -0
- package/dist/assets/icons/UserIcon.d.ts +3 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.d.ts +106 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.d.ts +12 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.d.ts +7 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/index.d.ts +4 -0
- package/dist/components/common/AdvancedList/index.d.ts +11 -0
- package/dist/components/common/SelectableCardList/components/SelectableCardListItem.d.ts +4 -1
- package/dist/components/common/SelectableCardList/index.d.ts +3 -0
- package/dist/components/form/inputs/Select/index.d.ts +1 -0
- package/dist/library/icons.d.ts +9 -1
- package/dist/library/index.d.ts +3 -0
- package/dist/registrucentras-rc-ses-react-components.cjs +10 -10
- package/dist/registrucentras-rc-ses-react-components.js +3807 -3102
- package/dist/stories/components/display/AdvancedList.stories.d.ts +33 -0
- package/dist/stories/components/display/AdvancedListItem.stories.d.ts +33 -0
- package/dist/stories/components/loaders/LoadingSpinner.stories.d.ts +3 -3
- package/dist/theme/motion.d.ts +16 -0
- package/package.json +1 -1
- package/src/assets/icons/CaretUpBoldIcon.tsx +17 -0
- package/src/assets/icons/CaretUpIcon.tsx +9 -0
- package/src/assets/icons/ListIcon.tsx +17 -0
- package/src/assets/icons/MinusIcon.tsx +9 -0
- package/src/assets/icons/NotePencilIcon.tsx +9 -0
- package/src/assets/icons/PlusIcon.tsx +9 -0
- package/src/assets/icons/TrashIcon.tsx +23 -0
- package/src/assets/icons/UserIcon.tsx +17 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.ts +100 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +214 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +241 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.test.ts +80 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.ts +28 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/index.test.tsx +631 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +329 -0
- package/src/components/common/AdvancedList/index.test.tsx +97 -0
- package/src/components/common/AdvancedList/index.tsx +52 -0
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.test.tsx +50 -0
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +34 -0
- package/src/components/common/SelectableCardList/index.tsx +6 -0
- package/src/components/common/Tooltip/index.test.tsx +1 -3
- package/src/components/form/inputs/FileDropzone.tsx +1 -0
- package/src/components/form/inputs/FileUpload.tsx +1 -0
- package/src/components/form/inputs/NumberStepper.tsx +1 -0
- package/src/components/form/inputs/RadioButtonGroup.test.tsx +71 -0
- package/src/components/form/inputs/RadioButtonGroup.tsx +1 -0
- package/src/components/form/inputs/Select/index.test.tsx +57 -0
- package/src/components/form/inputs/Select/index.tsx +2 -0
- package/src/i18n/namespaces/common/en.json +11 -0
- package/src/i18n/namespaces/common/lt.json +11 -0
- package/src/library/icons.ts +16 -0
- package/src/library/index.ts +3 -0
- package/src/setupTests.ts +7 -1
- package/src/stories/components/display/AdvancedList.stories.tsx +660 -0
- package/src/stories/components/display/AdvancedListItem.stories.tsx +593 -0
- package/src/stories/components/display/SelectableCardList.stories.tsx +3 -0
- package/src/theme/motion.tsx +10 -0
package/dist/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.d.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { ListWithIconsItemData } from '../../../ListWithIcons/ListWithIcons.types';
|
|
3
|
+
export type AdvancedListItemState = 'rest' | 'selected' | 'disabled' | 'error';
|
|
4
|
+
export type AdvancedListItemStatusColor = 'grey' | 'warning' | 'success' | 'error';
|
|
5
|
+
export type AdvancedListItemAction = {
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: ComponentType<{
|
|
8
|
+
fillColor?: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
}>;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type AdvancedListItemLeading = {
|
|
15
|
+
type: 'none';
|
|
16
|
+
} | {
|
|
17
|
+
type: 'reorder';
|
|
18
|
+
onMoveUp?: () => void;
|
|
19
|
+
onMoveDown?: () => void;
|
|
20
|
+
moveUpDisabled?: boolean;
|
|
21
|
+
moveDownDisabled?: boolean;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'checkbox';
|
|
24
|
+
checked: boolean;
|
|
25
|
+
onChange: (checked: boolean) => void;
|
|
26
|
+
'aria-label'?: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'radio';
|
|
29
|
+
checked: boolean;
|
|
30
|
+
onChange: (checked: boolean) => void;
|
|
31
|
+
name?: string;
|
|
32
|
+
'aria-label'?: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'drag';
|
|
35
|
+
'aria-label'?: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'icon';
|
|
38
|
+
icon: ComponentType<{
|
|
39
|
+
fillColor?: string;
|
|
40
|
+
size?: number;
|
|
41
|
+
}>;
|
|
42
|
+
'aria-label'?: string;
|
|
43
|
+
} | {
|
|
44
|
+
type: 'avatar';
|
|
45
|
+
initials?: string;
|
|
46
|
+
src?: string;
|
|
47
|
+
alt?: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'index';
|
|
50
|
+
index: number;
|
|
51
|
+
};
|
|
52
|
+
export type AdvancedListItemTrailing = {
|
|
53
|
+
type: 'none';
|
|
54
|
+
} | {
|
|
55
|
+
type: 'actions';
|
|
56
|
+
actions: AdvancedListItemAction[];
|
|
57
|
+
} | {
|
|
58
|
+
type: 'toggle';
|
|
59
|
+
checked: boolean;
|
|
60
|
+
onChange: (checked: boolean) => void;
|
|
61
|
+
'aria-label'?: string;
|
|
62
|
+
} | {
|
|
63
|
+
type: 'status';
|
|
64
|
+
label: string;
|
|
65
|
+
color?: AdvancedListItemStatusColor;
|
|
66
|
+
} | {
|
|
67
|
+
type: 'price';
|
|
68
|
+
amount: string;
|
|
69
|
+
caption?: string;
|
|
70
|
+
onDelete?: () => void;
|
|
71
|
+
deleteAriaLabel?: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: 'checkbox';
|
|
74
|
+
checked: boolean;
|
|
75
|
+
onChange: (checked: boolean) => void;
|
|
76
|
+
'aria-label'?: string;
|
|
77
|
+
} | {
|
|
78
|
+
type: 'radio';
|
|
79
|
+
checked: boolean;
|
|
80
|
+
onChange: (checked: boolean) => void;
|
|
81
|
+
name?: string;
|
|
82
|
+
'aria-label'?: string;
|
|
83
|
+
} | {
|
|
84
|
+
type: 'chevron';
|
|
85
|
+
} | {
|
|
86
|
+
type: 'stepper';
|
|
87
|
+
value: number;
|
|
88
|
+
onChange: (value: number) => void;
|
|
89
|
+
min?: number;
|
|
90
|
+
max?: number;
|
|
91
|
+
'aria-label'?: string;
|
|
92
|
+
};
|
|
93
|
+
export interface AdvancedListItemProps {
|
|
94
|
+
title: string;
|
|
95
|
+
label?: string;
|
|
96
|
+
subtitle?: string;
|
|
97
|
+
metaItems?: ListWithIconsItemData[];
|
|
98
|
+
leadingMedia?: ReactNode;
|
|
99
|
+
expandedContent?: ReactNode;
|
|
100
|
+
expanded?: boolean;
|
|
101
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
102
|
+
leading?: AdvancedListItemLeading;
|
|
103
|
+
trailing?: AdvancedListItemTrailing;
|
|
104
|
+
state?: AdvancedListItemState;
|
|
105
|
+
onClick?: () => void;
|
|
106
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { AdvancedListItemLeading as AdvancedListItemLeadingData } from '../AdvancedListItem.types';
|
|
3
|
+
type Props = {
|
|
4
|
+
leading: AdvancedListItemLeadingData;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
7
|
+
expandableId?: string;
|
|
8
|
+
expanded?: boolean;
|
|
9
|
+
titleId?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const AdvancedListItemLeading: ({ leading, disabled, inputRef, expandableId, expanded, titleId, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export default AdvancedListItemLeading;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AdvancedListItemTrailing as AdvancedListItemTrailingData } from '../AdvancedListItem.types';
|
|
2
|
+
type Props = {
|
|
3
|
+
trailing: AdvancedListItemTrailingData;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const AdvancedListItemTrailing: ({ trailing, disabled }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default AdvancedListItemTrailing;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AdvancedListItemProps } from './AdvancedListItem.types';
|
|
2
|
+
declare const AdvancedListItem: ({ title, label, subtitle, metaItems, leadingMedia, expandedContent, expanded, onExpandedChange, leading, trailing, state, onClick, }: AdvancedListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default AdvancedListItem;
|
|
4
|
+
export type { AdvancedListItemProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AdvancedListItemProps } from './components/AdvancedListItem';
|
|
3
|
+
export type AdvancedListItemData = AdvancedListItemProps & {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
export interface AdvancedListProps {
|
|
7
|
+
items: AdvancedListItemData[];
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const AdvancedList: ({ items, error }: AdvancedListProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default AdvancedList;
|
|
@@ -6,6 +6,9 @@ type Props = {
|
|
|
6
6
|
selected: boolean;
|
|
7
7
|
onSelect: () => void;
|
|
8
8
|
isLoading?: boolean;
|
|
9
|
+
hasActionButton?: boolean;
|
|
10
|
+
actionButtonLabel?: string;
|
|
11
|
+
onActionButtonClick?: () => void;
|
|
9
12
|
};
|
|
10
|
-
declare const SelectableCardListItem: ({ title, subtitle, listItems, selected, onSelect, isLoading, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const SelectableCardListItem: ({ title, subtitle, listItems, selected, onSelect, isLoading, hasActionButton, actionButtonLabel, onActionButtonClick, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
export default SelectableCardListItem;
|
|
@@ -5,6 +5,9 @@ export type SelectableCardListItemData = {
|
|
|
5
5
|
title: string;
|
|
6
6
|
subtitle?: string;
|
|
7
7
|
listItems?: ListWithIconsItemData[];
|
|
8
|
+
hasActionButton?: boolean;
|
|
9
|
+
actionButtonLabel?: string;
|
|
10
|
+
onActionButtonClick?: () => void;
|
|
8
11
|
};
|
|
9
12
|
export interface SelectableCardListProps {
|
|
10
13
|
items?: SelectableCardListItemData[];
|
|
@@ -19,6 +19,7 @@ type Props = Pick<TControllerProps, ImmediateControllerProps> & Pick<TWrapperPro
|
|
|
19
19
|
selectAll?: boolean;
|
|
20
20
|
onInputChange?: AutocompleteProps<Option, boolean, boolean, false>['onInputChange'];
|
|
21
21
|
slotProps?: {
|
|
22
|
+
controller?: Partial<Omit<TControllerProps, ImmediateControllerProps>>;
|
|
22
23
|
field?: Partial<Omit<AutocompleteProps<Option, boolean, boolean, false>, 'renderInput' | 'options' | 'value'>>;
|
|
23
24
|
wrapper?: Partial<Omit<TWrapperProps, ImmediateWrapperProps>>;
|
|
24
25
|
};
|
package/dist/library/icons.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { default as CaretDownIcon } from '../assets/icons/CaretDownIcon';
|
|
|
12
12
|
import { default as CaretLeftBoldIcon } from '../assets/icons/CaretLeftBoldIcon';
|
|
13
13
|
import { default as CaretLeftIcon } from '../assets/icons/CaretLeftIcon';
|
|
14
14
|
import { default as CaretRightBoldIcon } from '../assets/icons/CaretRightBoldIcon';
|
|
15
|
+
import { default as CaretUpBoldIcon } from '../assets/icons/CaretUpBoldIcon';
|
|
16
|
+
import { default as CaretUpIcon } from '../assets/icons/CaretUpIcon';
|
|
15
17
|
import { default as CheckBoldIcon } from '../assets/icons/CheckBoldIcon';
|
|
16
18
|
import { default as CheckCircleFillIcon } from '../assets/icons/CheckCircleFillIcon';
|
|
17
19
|
import { default as CheckIcon } from '../assets/icons/CheckIcon';
|
|
@@ -23,11 +25,15 @@ import { default as CopyIcon } from '../assets/icons/CopyIcon';
|
|
|
23
25
|
import { default as DotCircleFilledIcon } from '../assets/icons/DotCircleFilledIcon';
|
|
24
26
|
import { default as ExpandChevronsIcon } from '../assets/icons/ExpandChevronsIcon';
|
|
25
27
|
import { default as InfoFillIcon } from '../assets/icons/InfoFillIcon';
|
|
28
|
+
import { default as ListIcon } from '../assets/icons/ListIcon';
|
|
26
29
|
import { default as MagnifyingGlassIcon } from '../assets/icons/MagnifyingGlassIcon';
|
|
27
30
|
import { default as MapPinAreaIcon } from '../assets/icons/MapPinAreaIcon';
|
|
28
31
|
import { default as MinusBoldIcon } from '../assets/icons/MinusBoldIcon';
|
|
32
|
+
import { default as MinusIcon } from '../assets/icons/MinusIcon';
|
|
33
|
+
import { default as NotePencilIcon } from '../assets/icons/NotePencilIcon';
|
|
29
34
|
import { default as PencilSimpleLineIcon } from '../assets/icons/PencilSimpleLineIcon';
|
|
30
35
|
import { default as PlusBoldIcon } from '../assets/icons/PlusBoldIcon';
|
|
36
|
+
import { default as PlusIcon } from '../assets/icons/PlusIcon';
|
|
31
37
|
import { default as QuestionFillIcon } from '../assets/icons/QuestionFillIcon';
|
|
32
38
|
import { default as QuestionIcon } from '../assets/icons/QuestionIcon';
|
|
33
39
|
import { default as ScalesIcon } from '../assets/icons/ScalesIcon';
|
|
@@ -35,9 +41,11 @@ import { default as ScrollIcon } from '../assets/icons/ScrollIcon';
|
|
|
35
41
|
import { default as SearchHelpIcon } from '../assets/icons/SearchHelpIcon';
|
|
36
42
|
import { default as SearchXIcon } from '../assets/icons/SearchXIcon';
|
|
37
43
|
import { default as SpinnerGapBoldIcon } from '../assets/icons/SpinnerGapBoldIcon';
|
|
44
|
+
import { default as TrashIcon } from '../assets/icons/TrashIcon';
|
|
38
45
|
import { default as UploadSimpleIcon } from '../assets/icons/UploadSimpleIcon';
|
|
46
|
+
import { default as UserIcon } from '../assets/icons/UserIcon';
|
|
39
47
|
import { default as WarningCircleIcon } from '../assets/icons/WarningCircleIcon';
|
|
40
48
|
import { default as WarningDiamondFillIcon } from '../assets/icons/WarningDiamondFillIcon';
|
|
41
49
|
import { default as WarningFillIcon } from '../assets/icons/WarningFillIcon';
|
|
42
50
|
import { default as XCircleFillIcon } from '../assets/icons/XCircleFillIcon';
|
|
43
|
-
export { RcSesLogo, ArrowLeftIcon, ArrowRightIcon, ArrowsClockwiseIcon, BarcodeIcon, CalendarBlankIcon, CaretDoubleLeftBoldIcon, CaretDoubleRightBoldIcon, CaretDownBoldIcon, CaretDownFill, CaretDownIcon, CaretLeftBoldIcon, CaretLeftIcon, CaretRightBoldIcon, CheckBoldIcon, CheckCircleFillIcon, CheckIcon, CheckUncheckedBoldIcon, CircleFilledIcon, CloseIcon, CollapseChevronsIcon, CopyIcon, DotCircleFilledIcon, ExpandChevronsIcon, InfoFillIcon, MagnifyingGlassIcon, MapPinAreaIcon, MinusBoldIcon, PencilSimpleLineIcon, PlusBoldIcon, QuestionFillIcon, QuestionIcon, ScalesIcon, ScrollIcon, SearchHelpIcon, SearchXIcon, SpinnerGapBoldIcon, UploadSimpleIcon, WarningDiamondFillIcon, WarningFillIcon, WarningCircleIcon, XCircleFillIcon, };
|
|
51
|
+
export { RcSesLogo, ArrowLeftIcon, ArrowRightIcon, ArrowsClockwiseIcon, BarcodeIcon, CalendarBlankIcon, CaretDoubleLeftBoldIcon, CaretDoubleRightBoldIcon, CaretDownBoldIcon, CaretDownFill, CaretDownIcon, CaretLeftBoldIcon, CaretLeftIcon, CaretRightBoldIcon, CaretUpIcon, CaretUpBoldIcon, CheckBoldIcon, CheckCircleFillIcon, CheckIcon, CheckUncheckedBoldIcon, CircleFilledIcon, CloseIcon, CollapseChevronsIcon, CopyIcon, DotCircleFilledIcon, ExpandChevronsIcon, InfoFillIcon, ListIcon, MagnifyingGlassIcon, MapPinAreaIcon, MinusBoldIcon, MinusIcon, NotePencilIcon, PencilSimpleLineIcon, PlusBoldIcon, PlusIcon, QuestionFillIcon, QuestionIcon, ScalesIcon, ScrollIcon, SearchHelpIcon, SearchXIcon, SpinnerGapBoldIcon, TrashIcon, UploadSimpleIcon, UserIcon, WarningDiamondFillIcon, WarningFillIcon, WarningCircleIcon, XCircleFillIcon, };
|
package/dist/library/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { default as RcSesIconProps } from '../assets/IconProps';
|
|
2
2
|
import { default as RcSesAccordion } from '../components/common/Accordion';
|
|
3
3
|
import { default as useAccordionController } from '../components/common/Accordion/hooks/useAccordionController';
|
|
4
|
+
import { default as RcSesAdvancedList } from '../components/common/AdvancedList';
|
|
5
|
+
import { default as RcSesAdvancedListItem } from '../components/common/AdvancedList/components/AdvancedListItem';
|
|
4
6
|
import { default as RcSesAlert } from '../components/common/Alert';
|
|
5
7
|
import { default as RcSesBadge } from '../components/common/Badge';
|
|
6
8
|
import { default as RcSesBreadcrumbs } from '../components/common/Breadcrumbs';
|
|
@@ -58,6 +60,7 @@ declare module '@mui/x-date-pickers/models' {
|
|
|
58
60
|
}
|
|
59
61
|
export { RcSesPalette, RcSesTheme };
|
|
60
62
|
export { RcSesAccordion, useAccordionController };
|
|
63
|
+
export { RcSesAdvancedList, RcSesAdvancedListItem };
|
|
61
64
|
export { RcSesAlert, RcSesBadge, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesModal, RcSesSwitch, };
|
|
62
65
|
export { RcSesSegmentedControl };
|
|
63
66
|
export { RcSesCheckbox, RcSesCheckboxFormControl, RcSesSimpleCheckbox };
|