@registrucentras/rc-ses-react-components 2.5.1 → 2.6.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/components/common/FilterChip/index.d.ts +8 -0
- package/dist/components/common/StepCard/StepCardFooter/index.d.ts +4 -1
- package/dist/components/common/StepCard/index.d.ts +1 -1
- package/dist/components/common/StepCard/types.d.ts +31 -0
- package/dist/library/index.d.ts +2 -1
- package/dist/library/types.d.ts +3 -2
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +1279 -1201
- package/package.json +1 -1
- package/src/components/common/FilterChip/index.test.tsx +71 -0
- package/src/components/common/FilterChip/index.tsx +89 -0
- package/src/components/common/StepCard/StepCardFooter/index.test.tsx +187 -0
- package/src/components/common/StepCard/StepCardFooter/index.tsx +59 -24
- package/src/components/common/StepCard/index.test.tsx +31 -0
- package/src/components/common/StepCard/index.tsx +4 -0
- package/src/components/common/StepCard/types.ts +33 -0
- package/src/i18n/namespaces/input/en.json +6 -0
- package/src/i18n/namespaces/input/lt.json +6 -0
- package/src/library/index.ts +3 -1
- package/src/library/types.ts +6 -0
- package/src/stories/atoms/FilterChip.stories.tsx +104 -0
- package/src/stories/molecules/StepCard.stories.tsx +86 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
export interface RcSesFilterChipProps {
|
|
3
|
+
label: string;
|
|
4
|
+
onRemove: () => void;
|
|
5
|
+
testId?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const RcSesFilterChip: ForwardRefExoticComponent<RcSesFilterChipProps & RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default RcSesFilterChip;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RcSesStepCardActions } from '../types';
|
|
1
2
|
export interface RcSesStepCardFooterProps {
|
|
2
3
|
activeStep: number;
|
|
3
4
|
stepCount: number;
|
|
@@ -5,6 +6,8 @@ export interface RcSesStepCardFooterProps {
|
|
|
5
6
|
onBack?: () => void;
|
|
6
7
|
onCancel?: () => void;
|
|
7
8
|
totalPrice?: string;
|
|
9
|
+
totalPriceLabel?: string;
|
|
10
|
+
actions?: RcSesStepCardActions;
|
|
8
11
|
}
|
|
9
12
|
export declare const stepCardFooterLeadingSx: {
|
|
10
13
|
readonly width: {
|
|
@@ -30,5 +33,5 @@ export declare const stepCardFooterTrailingSx: {
|
|
|
30
33
|
readonly sm: 1;
|
|
31
34
|
};
|
|
32
35
|
};
|
|
33
|
-
declare function RcSesStepCardFooter({ activeStep, stepCount, onNext, onBack, onCancel, totalPrice, }: RcSesStepCardFooterProps): import("react").JSX.Element;
|
|
36
|
+
declare function RcSesStepCardFooter({ activeStep, stepCount, onNext, onBack, onCancel, totalPrice, totalPriceLabel, actions, }: RcSesStepCardFooterProps): import("react").JSX.Element;
|
|
34
37
|
export default RcSesStepCardFooter;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RcSesStepCardProps } from './types';
|
|
2
|
-
declare function RcSesStepCard({ activeStep, stepCount, onNext, onBack, onCancel, totalPrice, title, description, footer, children, testIds, }: RcSesStepCardProps): import("react").JSX.Element;
|
|
2
|
+
declare function RcSesStepCard({ activeStep, stepCount, onNext, onBack, onCancel, totalPrice, totalPriceLabel, actions, title, description, footer, children, testIds, }: RcSesStepCardProps): import("react").JSX.Element;
|
|
3
3
|
export default RcSesStepCard;
|
|
@@ -6,6 +6,30 @@ export interface RcSesStepCardTestIds {
|
|
|
6
6
|
content?: string;
|
|
7
7
|
footer?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface RcSesStepCardAction {
|
|
10
|
+
label?: string;
|
|
11
|
+
/**
|
|
12
|
+
* `undefined` keeps the default icon (arrows, or the cart on the last step),
|
|
13
|
+
* `null` renders none, a node replaces the icon.
|
|
14
|
+
*/
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Id of a `<form>` rendered elsewhere. The button becomes that form's submit
|
|
18
|
+
* button (`type="submit" form={id}`). The click handler still fires.
|
|
19
|
+
*/
|
|
20
|
+
form?: string;
|
|
21
|
+
/** Shows a spinner in the icon's place and disables the button. */
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface RcSesStepCardActions {
|
|
26
|
+
/** The trailing CTA on every step, including the last. */
|
|
27
|
+
next?: RcSesStepCardAction;
|
|
28
|
+
/** The leading "Atgal" button (middle + last step). */
|
|
29
|
+
back?: RcSesStepCardAction;
|
|
30
|
+
/** The leading "Atšaukti" button (first step). `false` removes it. */
|
|
31
|
+
cancel?: RcSesStepCardAction | false;
|
|
32
|
+
}
|
|
9
33
|
export interface RcSesStepCardProps extends Pick<RcSesTitleBlockBaseProps, 'title' | 'description'> {
|
|
10
34
|
/**
|
|
11
35
|
* Zero-based index of the currently active step. Drives the step-position
|
|
@@ -29,6 +53,13 @@ export interface RcSesStepCardProps extends Pick<RcSesTitleBlockBaseProps, 'titl
|
|
|
29
53
|
* locale + currency stay a consumer concern.
|
|
30
54
|
*/
|
|
31
55
|
totalPrice?: string;
|
|
56
|
+
/** Replaces the default caption of `totalPrice`. */
|
|
57
|
+
totalPriceLabel?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Overrides for the default footer: label, icon, form submit,
|
|
60
|
+
* loading and disabled. Ignored when `footer` is set.
|
|
61
|
+
*/
|
|
62
|
+
actions?: RcSesStepCardActions;
|
|
32
63
|
/**
|
|
33
64
|
* Replaces the whole default footer, including the step-position variants.
|
|
34
65
|
* Use when a step needs an entirely custom action row.
|
package/dist/library/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { default as RcSesCard } from '../components/common/Card';
|
|
|
13
13
|
import { default as RcSesCardShell } from '../components/common/CardShell';
|
|
14
14
|
import { default as RcSesCardFooter } from '../components/common/CardShell/CardFooter';
|
|
15
15
|
import { default as DataPagination } from '../components/common/DataPagination';
|
|
16
|
+
import { default as RcSesFilterChip } from '../components/common/FilterChip';
|
|
16
17
|
import { default as RcSesIconWithCircularBackground } from '../components/common/IconWithCircularBackground';
|
|
17
18
|
import { default as RcSesIconWithSquareBackground } from '../components/common/IconWithSquareBackground';
|
|
18
19
|
import { default as RcSesImageCard } from '../components/common/ImageCard';
|
|
@@ -71,7 +72,7 @@ declare module '@mui/x-date-pickers/models' {
|
|
|
71
72
|
export { RcSesPalette, RcSesTheme };
|
|
72
73
|
export { RcSesAccordion, useAccordionController };
|
|
73
74
|
export { RcSesAdvancedList, RcSesAdvancedListItem, RcSesAdvancedListItemShell };
|
|
74
|
-
export { RcSesAlert, RcSesBadge, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesCardShell, RcSesTitleBlock, RcSesCardFooter, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider,
|
|
75
|
+
export { RcSesAlert, RcSesBadge, RcSesFilterChip, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesCardShell, RcSesTitleBlock, RcSesCardFooter, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesStepCard, RcSesSwitch, RcSesModal, RcSesBottomSheet, RcSesDrawer, };
|
|
75
76
|
export { RcSesSegmentedControl };
|
|
76
77
|
export { RcSesSideNavLayout };
|
|
77
78
|
export { RcSesCheckbox, RcSesCheckboxFormControl, RcSesSimpleCheckbox };
|
package/dist/library/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AdvancedListItemShellProps, AdvancedListItemShellState, AdvancedListIte
|
|
|
2
2
|
import { RcSesCardProps } from '../components/common/Card';
|
|
3
3
|
import { CardFooterAlign, RcSesCardFooterProps, RcSesCardFooterTestIds } from '../components/common/CardShell/CardFooter/types';
|
|
4
4
|
import { CardShellTheme, CardShellVariant, RcSesCardShellProps, RcSesCardShellTestIds } from '../components/common/CardShell/types';
|
|
5
|
+
import { RcSesFilterChipProps } from '../components/common/FilterChip';
|
|
5
6
|
import { ListWithIconsProps } from '../components/common/ListWithIcons';
|
|
6
7
|
import { ListWithIconsItemData, ListWithIconsItemTone, PaletteColor } from '../components/common/ListWithIcons/ListWithIcons.types';
|
|
7
8
|
import { RcSesSegmentOption, RcSesSegmentedControlProps } from '../components/common/SegmentedControl';
|
|
@@ -9,7 +10,7 @@ import { RcSesSegmentButtonProps } from '../components/common/SegmentedControl/c
|
|
|
9
10
|
import { RcSesServiceLinkItem, RcSesServiceLinksProps, RcSesServiceLinksTestIds } from '../components/common/ServiceLinks/types';
|
|
10
11
|
import { RcSesSideNavItem, RcSesSideNavOverflow } from '../components/common/SideNav';
|
|
11
12
|
import { RcSesSideNavLayoutProps } from '../components/common/SideNav/SideNavLayout';
|
|
12
|
-
import { RcSesStepCardProps, RcSesStepCardTestIds } from '../components/common/StepCard/types';
|
|
13
|
+
import { RcSesStepCardAction, RcSesStepCardActions, RcSesStepCardProps, RcSesStepCardTestIds } from '../components/common/StepCard/types';
|
|
13
14
|
import { RcSesTitleBlockProps, RcSesTitleBlockTestIds, TitleBlockHeadingLevel, TitleBlockTitleVariant } from '../components/common/TitleBlock/types';
|
|
14
15
|
import { RcSesTooltipProps } from '../components/common/Tooltip';
|
|
15
16
|
import { RcSesFormControlLabelProps } from '../components/form/inputs/FormControlLabel';
|
|
@@ -28,7 +29,7 @@ export type { ListWithIconsProps, ListWithIconsItemData, ListWithIconsItemTone,
|
|
|
28
29
|
export type { RcSesServiceLinksProps, RcSesServiceLinkItem, RcSesServiceLinksTestIds };
|
|
29
30
|
export type { ButtonProps };
|
|
30
31
|
export type { AdvancedListItemShellProps, AdvancedListItemShellState, AdvancedListItemShellTestIds, };
|
|
31
|
-
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, };
|
|
32
|
+
export type { RcSesFullPageLoaderProps, RcSesLoaderBackdrop, RcSesLoaderProps, RcSesLoaderSize, RcSesCardFormContainerProps, RcSesCardProps, RcSesFilterChipProps, RcSesCardShellProps, RcSesCardShellTestIds, RcSesTitleBlockProps, RcSesTitleBlockTestIds, RcSesCardFooterProps, RcSesCardFooterTestIds, CardFooterAlign, CardShellVariant, CardShellTheme, TitleBlockHeadingLevel, TitleBlockTitleVariant, RcSesSegmentedControlProps, RcSesSegmentButtonProps, RcSesSegmentOption, ServiceWizardStepperProps, SimpleCheckboxProps, RcSesFormControlLabelProps, RcSesLoadingSpinnerProps, RcSesSpinnerColor, RcSesTooltipProps, RcSesSideNavItem, RcSesSideNavLayoutProps, RcSesSideNavOverflow, RcSesStepCardAction, RcSesStepCardActions, RcSesStepCardProps, RcSesStepCardTestIds, };
|
|
32
33
|
export type { RcSesDialogProps, DialogSize };
|
|
33
34
|
export type { RcSesModalProps, ModalVariant };
|
|
34
35
|
export type { RcSesBottomSheetProps };
|