@registrucentras/rc-ses-react-components 2.1.0 → 2.3.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.
Files changed (35) hide show
  1. package/dist/components/common/AdvancedList/components/AdvancedListItem/index.d.ts +3 -0
  2. package/dist/components/common/AdvancedList/components/AdvancedListItemShell/AdvancedListItemShell.types.d.ts +31 -0
  3. package/dist/components/common/AdvancedList/components/AdvancedListItemShell/index.d.ts +11 -0
  4. package/dist/components/form/inputs/Select/Select.utils.d.ts +9 -0
  5. package/dist/components/form/inputs/Select/components/OptionCheckbox.d.ts +5 -0
  6. package/dist/components/form/inputs/Select/index.d.ts +18 -8
  7. package/dist/components/overlays/BottomSheet/index.d.ts +17 -0
  8. package/dist/components/overlays/BottomSheet/useSwipeToDismiss.d.ts +17 -0
  9. package/dist/library/index.d.ts +4 -2
  10. package/dist/library/types.d.ts +4 -0
  11. package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
  12. package/dist/registrucentras-rc-ses-react-components.js +3004 -2437
  13. package/package.json +1 -1
  14. package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +4 -0
  15. package/src/components/common/AdvancedList/components/AdvancedListItemShell/AdvancedListItemShell.types.ts +35 -0
  16. package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.test.tsx +350 -0
  17. package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.tsx +247 -0
  18. package/src/components/form/inputs/Select/Select.utils.ts +24 -0
  19. package/src/components/form/inputs/Select/components/OptionCheckbox.tsx +46 -0
  20. package/src/components/form/inputs/Select/index.test.tsx +127 -0
  21. package/src/components/form/inputs/Select/index.tsx +426 -181
  22. package/src/components/overlays/BottomSheet/index.test.tsx +256 -0
  23. package/src/components/overlays/BottomSheet/index.tsx +242 -0
  24. package/src/components/overlays/BottomSheet/useSwipeToDismiss.test.ts +295 -0
  25. package/src/components/overlays/BottomSheet/useSwipeToDismiss.ts +138 -0
  26. package/src/i18n/namespaces/input/en.json +11 -0
  27. package/src/i18n/namespaces/input/lt.json +11 -0
  28. package/src/library/index.ts +4 -1
  29. package/src/library/types.ts +12 -0
  30. package/src/stories/atoms/Select.stories.tsx +33 -5
  31. package/src/stories/organisms/AdvancedListItem.stories.tsx +1 -1
  32. package/src/stories/organisms/AdvancedListItemShell.stories.tsx +866 -0
  33. package/src/stories/organisms/BottomSheet.stories.tsx +291 -0
  34. package/src/theme/light/MuiAutocomplete.ts +43 -19
  35. package/src/theme/light/MuiTypography.tsx +24 -24
@@ -1,4 +1,7 @@
1
1
  import { AdvancedListItemProps } from './AdvancedListItem.types';
2
+ /**
3
+ * @deprecated Use `RcSesAdvancedListItemShell` instead. Will be removed in a future major release.
4
+ */
2
5
  declare const AdvancedListItem: ({ title, label, subtitle, metaItems, leadingMedia, expandedContent, expanded, onExpandedChange, leading, trailing, state, onClick, }: AdvancedListItemProps) => import("react").JSX.Element;
3
6
  export default AdvancedListItem;
4
7
  export type { AdvancedListItemProps };
@@ -0,0 +1,31 @@
1
+ import { ReactNode } from 'react';
2
+ export type AdvancedListItemShellState = 'rest' | 'selected' | 'disabled' | 'error';
3
+ /**
4
+ * `card` - bordered, rounded container (the default).
5
+ * `row` - flush row within a list: no border/radius, just a bottom divider.
6
+ */
7
+ export type AdvancedListItemShellContainer = 'card' | 'row';
8
+ export interface AdvancedListItemShellTestIds {
9
+ root?: string;
10
+ leading?: string;
11
+ content?: string;
12
+ trailing?: string;
13
+ expanded?: string;
14
+ }
15
+ export interface AdvancedListItemShellProps {
16
+ /** Optional leading slot (e.g. checkbox, radio, avatar, icon). Empty => not rendered. */
17
+ leading?: ReactNode;
18
+ /** Required main content slot (title, subtitle, meta, etc.). */
19
+ content: ReactNode;
20
+ /** Optional trailing slot (e.g. actions, status, price). Empty => not rendered. */
21
+ trailing?: ReactNode;
22
+ /** Optional expandable slot content, shown/hidden via `isExpanded`. */
23
+ expanded?: ReactNode;
24
+ isExpanded?: boolean;
25
+ state?: AdvancedListItemShellState;
26
+ /** Visual container style. Defaults to `card`. */
27
+ container?: AdvancedListItemShellContainer;
28
+ onClick?: () => void;
29
+ className?: string;
30
+ testIds?: AdvancedListItemShellTestIds;
31
+ }
@@ -0,0 +1,11 @@
1
+ import { AdvancedListItemShellContainer, AdvancedListItemShellProps, AdvancedListItemShellState, AdvancedListItemShellTestIds } from './AdvancedListItemShell.types';
2
+ /**
3
+ * Slot-based shell (Leading, Content, Trailing, Expanded).
4
+ * Content is required; Leading/Trailing/Expanded are omitted from the DOM
5
+ * entirely when not provided. Slot content is opaque to the shell and stays
6
+ * stable across `state`/`isExpanded` changes — new content variations are
7
+ * composed as slot content, not new boolean/variant props.
8
+ */
9
+ declare const AdvancedListItemShell: ({ leading, content, trailing, expanded, isExpanded, state, container, onClick, className, testIds, }: AdvancedListItemShellProps) => import("react").JSX.Element;
10
+ export default AdvancedListItemShell;
11
+ export type { AdvancedListItemShellContainer, AdvancedListItemShellProps, AdvancedListItemShellState, AdvancedListItemShellTestIds, };
@@ -0,0 +1,9 @@
1
+ import { Option } from './Select.types';
2
+ export declare const dropdownSearchFieldValue = "__dropdown-search-field__";
3
+ export declare const dropdownSelectAllValue = "__dropdown-select-all__";
4
+ export declare const dropdownGroupOptionPrefix = "__dropdown-group__:";
5
+ export declare const isGroupOptionValue: (value: string) => boolean;
6
+ export declare const groupNameFromOptionValue: (value: string) => string;
7
+ export declare const dropdownGroupOptionValue: (groupName: string) => string;
8
+ export declare const isInternalOptionValue: (value: string) => boolean;
9
+ export declare const dropdownSearchFieldOption: Option;
@@ -0,0 +1,5 @@
1
+ interface Props {
2
+ checked: boolean;
3
+ }
4
+ declare function OptionCheckbox({ checked }: Props): import("react").JSX.Element;
5
+ export default OptionCheckbox;
@@ -1,29 +1,39 @@
1
1
  import { AutocompleteProps } from '@mui/material/Autocomplete';
2
2
  import { default as React } from 'react';
3
- import { UseControllerProps } from 'react-hook-form';
3
+ import { FieldValues, UseControllerProps } from 'react-hook-form';
4
4
  import { RcSesFormControlWrapperProps } from '../../components/FormControlWrapper';
5
5
  import { Option } from './Select.types';
6
- type TControllerProps = UseControllerProps<any, any>;
6
+ type TControllerProps<TFieldValues extends FieldValues = FieldValues> = UseControllerProps<TFieldValues>;
7
7
  type ImmediateControllerProps = 'control' | 'rules' | 'name' | 'disabled';
8
8
  type TWrapperProps = RcSesFormControlWrapperProps;
9
9
  type ImmediateWrapperProps = 'id' | 'label' | 'errors';
10
- type Props = Pick<TControllerProps, ImmediateControllerProps> & Pick<TWrapperProps, ImmediateWrapperProps> & {
11
- multiple?: boolean;
10
+ type CommonSelectProps<TFieldValues extends FieldValues = FieldValues> = Pick<TControllerProps<TFieldValues>, ImmediateControllerProps> & Pick<TWrapperProps, ImmediateWrapperProps> & {
12
11
  clearable?: boolean;
13
- limitTags?: number;
14
12
  loading?: boolean;
15
13
  options: Option[];
16
14
  placeholder?: string;
17
15
  dropdownLabel?: string;
18
16
  dropdownSearch?: boolean;
19
17
  dropdownSearchPlaceholder?: string;
20
- selectAll?: boolean;
21
18
  onInputChange?: AutocompleteProps<Option, boolean, boolean, false>['onInputChange'];
22
19
  slotProps?: {
23
- controller?: Partial<Omit<TControllerProps, ImmediateControllerProps>>;
20
+ controller?: Partial<Omit<TControllerProps<TFieldValues>, ImmediateControllerProps>>;
24
21
  field?: Partial<Omit<AutocompleteProps<Option, boolean, boolean, false>, 'renderInput' | 'options' | 'value'>>;
25
22
  wrapper?: Partial<Omit<TWrapperProps, ImmediateWrapperProps>>;
26
23
  };
27
24
  };
28
- declare function RcSesSelect(props: Props): React.JSX.Element;
25
+ type SingleSelectProps<TFieldValues extends FieldValues = FieldValues> = CommonSelectProps<TFieldValues> & {
26
+ multiple?: false;
27
+ limitTags?: never;
28
+ selectAll?: never;
29
+ selectAllLabel?: never;
30
+ };
31
+ type MultiSelectProps<TFieldValues extends FieldValues = FieldValues> = CommonSelectProps<TFieldValues> & {
32
+ multiple: true;
33
+ limitTags?: number;
34
+ selectAll?: boolean;
35
+ selectAllLabel?: string;
36
+ };
37
+ type Props<TFieldValues extends FieldValues = FieldValues> = SingleSelectProps<TFieldValues> | MultiSelectProps<TFieldValues>;
38
+ declare function RcSesSelect<TFieldValues extends FieldValues = FieldValues>(props: Props<TFieldValues>): React.JSX.Element;
29
39
  export default RcSesSelect;
@@ -0,0 +1,17 @@
1
+ import { DialogProps as MuiDialogProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ export interface RcSesBottomSheetProps extends Omit<MuiDialogProps, 'children' | 'title' | 'PaperProps' | 'maxWidth' | 'onClose' | 'slots' | 'slotProps'> {
4
+ title?: string;
5
+ children?: ReactNode;
6
+ showBack?: boolean;
7
+ onBack?: () => void;
8
+ primaryActionLabel?: string;
9
+ onPrimaryAction?: () => void;
10
+ secondaryActionLabel?: string;
11
+ onSecondaryAction?: () => void;
12
+ disableBackdropClose?: boolean;
13
+ size?: 'sm' | 'md';
14
+ onClose?: (event: unknown, reason: 'backdropClick' | 'escapeKeyDown' | 'swipeDown') => void;
15
+ }
16
+ declare function RcSesBottomSheet({ title, children, showBack, onBack, primaryActionLabel, onPrimaryAction, secondaryActionLabel, onSecondaryAction, onClose, disableBackdropClose, size, open, 'aria-labelledby': ariaLabelledByProp, 'aria-describedby': ariaDescribedByProp, scroll, transitionDuration, ...props }: RcSesBottomSheetProps): import("react").JSX.Element;
17
+ export default RcSesBottomSheet;
@@ -0,0 +1,17 @@
1
+ import { PointerEvent as ReactPointerEvent, MutableRefObject } from 'react';
2
+ export interface UseSwipeToDismissOptions {
3
+ open: boolean;
4
+ disableTransform: boolean;
5
+ onDismiss: (event: ReactPointerEvent<HTMLElement>) => void;
6
+ }
7
+ declare function useSwipeToDismiss({ open, disableTransform, onDismiss, }: UseSwipeToDismissOptions): {
8
+ paperRef: MutableRefObject<HTMLDivElement | null>;
9
+ isDragging: boolean;
10
+ handleProps: {
11
+ onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;
12
+ onPointerMove: (event: ReactPointerEvent<HTMLElement>) => void;
13
+ onPointerUp: (event: ReactPointerEvent<HTMLElement>) => void;
14
+ onPointerCancel: (event: ReactPointerEvent<HTMLElement>) => void;
15
+ };
16
+ };
17
+ export default useSwipeToDismiss;
@@ -3,6 +3,7 @@ import { default as RcSesAccordion } from '../components/common/Accordion';
3
3
  import { default as useAccordionController } from '../components/common/Accordion/hooks/useAccordionController';
4
4
  import { default as RcSesAdvancedList } from '../components/common/AdvancedList';
5
5
  import { default as RcSesAdvancedListItem } from '../components/common/AdvancedList/components/AdvancedListItem';
6
+ import { default as RcSesAdvancedListItemShell } from '../components/common/AdvancedList/components/AdvancedListItemShell';
6
7
  import { default as RcSesAlert } from '../components/common/Alert';
7
8
  import { default as RcSesBadge } from '../components/common/Badge';
8
9
  import { default as RcSesBreadcrumbs } from '../components/common/Breadcrumbs';
@@ -55,6 +56,7 @@ import { default as ServiceWizardStepper } from '../components/layout/ServiceWiz
55
56
  import { default as RcSesFullPageLoader } from '../components/loaders/FullPageLoader';
56
57
  import { default as RcSesLoader } from '../components/loaders/Loader';
57
58
  import { default as RcSesLoadingSpinner } from '../components/loaders/LoadingSpinner';
59
+ import { default as RcSesBottomSheet } from '../components/overlays/BottomSheet';
58
60
  import { default as RcSesDialog } from '../components/overlays/Dialog';
59
61
  import { default as RcSesModal } from '../components/overlays/Modal';
60
62
  import { default as RcSesTheme } from '../theme/light';
@@ -67,8 +69,8 @@ declare module '@mui/x-date-pickers/models' {
67
69
  }
68
70
  export { RcSesPalette, RcSesTheme };
69
71
  export { RcSesAccordion, useAccordionController };
70
- export { RcSesAdvancedList, RcSesAdvancedListItem };
71
- export { RcSesAlert, RcSesBadge, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesCardShell, RcSesTitleBlock, RcSesCardFooter, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesModal, RcSesStepCard, RcSesSwitch, };
72
+ export { RcSesAdvancedList, RcSesAdvancedListItem, RcSesAdvancedListItemShell };
73
+ export { RcSesAlert, RcSesBadge, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesCardShell, RcSesTitleBlock, RcSesCardFooter, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesModal, RcSesStepCard, RcSesSwitch, RcSesBottomSheet, };
72
74
  export { RcSesSegmentedControl };
73
75
  export { RcSesSideNavLayout };
74
76
  export { RcSesCheckbox, RcSesCheckboxFormControl, RcSesSimpleCheckbox };
@@ -1,3 +1,4 @@
1
+ import { AdvancedListItemShellProps, AdvancedListItemShellState, AdvancedListItemShellTestIds } from '../components/common/AdvancedList/components/AdvancedListItemShell/AdvancedListItemShell.types';
1
2
  import { RcSesCardProps } from '../components/common/Card';
2
3
  import { CardFooterAlign, RcSesCardFooterProps, RcSesCardFooterTestIds } from '../components/common/CardShell/CardFooter/types';
3
4
  import { CardShellTheme, CardShellVariant, RcSesCardShellProps, RcSesCardShellTestIds } from '../components/common/CardShell/types';
@@ -18,12 +19,15 @@ import { ServiceWizardStepperProps } from '../components/layout/ServiceWizardSte
18
19
  import { RcSesFullPageLoaderProps, RcSesLoaderBackdrop } from '../components/loaders/FullPageLoader';
19
20
  import { RcSesLoaderProps, RcSesLoaderSize } from '../components/loaders/Loader';
20
21
  import { RcSesLoadingSpinnerProps, RcSesSpinnerColor } from '../components/loaders/LoadingSpinner';
22
+ import { RcSesBottomSheetProps } from '../components/overlays/BottomSheet';
21
23
  import { DialogSize, RcSesDialogProps } from '../components/overlays/Dialog';
22
24
  import { ModalVariant, RcSesModalProps } from '../components/overlays/Modal';
23
25
  import { ButtonProps } from '../types/buttons/ButtonProps';
24
26
  export type { ListWithIconsProps, ListWithIconsItemData, ListWithIconsItemTone, PaletteColor, };
25
27
  export type { RcSesServiceLinksProps, RcSesServiceLinkItem, RcSesServiceLinksTestIds };
26
28
  export type { ButtonProps };
29
+ export type { AdvancedListItemShellProps, AdvancedListItemShellState, AdvancedListItemShellTestIds, };
27
30
  export type { RcSesFullPageLoaderProps, RcSesLoaderBackdrop, RcSesLoaderProps, RcSesLoaderSize, RcSesCardFormContainerProps, RcSesCardProps, RcSesCardShellProps, RcSesCardShellTestIds, RcSesTitleBlockProps, RcSesTitleBlockTestIds, RcSesCardFooterProps, RcSesCardFooterTestIds, CardFooterAlign, CardShellVariant, CardShellTheme, TitleBlockHeadingLevel, TitleBlockTitleVariant, RcSesSegmentedControlProps, RcSesSegmentButtonProps, RcSesSegmentOption, ServiceWizardStepperProps, SimpleCheckboxProps, RcSesFormControlLabelProps, RcSesLoadingSpinnerProps, RcSesSpinnerColor, RcSesTooltipProps, RcSesSideNavItem, RcSesSideNavLayoutProps, RcSesSideNavOverflow, RcSesStepCardProps, RcSesStepCardTestIds, };
28
31
  export type { RcSesDialogProps, DialogSize };
29
32
  export type { RcSesModalProps, ModalVariant };
33
+ export type { RcSesBottomSheetProps };