@registrucentras/rc-ses-react-components 2.0.0 → 2.1.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 (60) hide show
  1. package/README.md +4 -0
  2. package/dist/assets/icons/ShoppingCartIcon.d.ts +3 -0
  3. package/dist/components/common/CardShell/index.d.ts +1 -1
  4. package/dist/components/common/CardShell/types.d.ts +10 -0
  5. package/dist/components/common/ListWithIcons/ListWithIcons.types.d.ts +4 -1
  6. package/dist/components/common/StepCard/StepCardFooter/index.d.ts +34 -0
  7. package/dist/components/common/StepCard/index.d.ts +3 -0
  8. package/dist/components/common/StepCard/types.d.ts +39 -0
  9. package/dist/components/common/TitleBlock/types.d.ts +1 -1
  10. package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +3 -0
  11. package/dist/components/loaders/LoadingSpinner/index.d.ts +1 -4
  12. package/dist/library/icons.d.ts +2 -1
  13. package/dist/library/index.d.ts +2 -1
  14. package/dist/library/types.d.ts +4 -3
  15. package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
  16. package/dist/registrucentras-rc-ses-react-components.js +2091 -1888
  17. package/dist/theme/cards.d.ts +12 -12
  18. package/dist/theme/light/MuiTypography.d.ts +14 -0
  19. package/dist/theme/palette.d.ts +124 -124
  20. package/dist/theme/spacing.d.ts +4 -0
  21. package/package.json +2 -1
  22. package/src/assets/icons/ShoppingCartIcon.tsx +16 -0
  23. package/src/components/common/Button/index.test.tsx +20 -11
  24. package/src/components/common/Button/index.tsx +8 -44
  25. package/src/components/common/CardShell/index.tsx +6 -2
  26. package/src/components/common/CardShell/types.ts +10 -0
  27. package/src/components/common/ListWithIcons/ListWithIcons.types.ts +22 -1
  28. package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +13 -4
  29. package/src/components/common/ListWithIcons/index.test.tsx +42 -0
  30. package/src/components/common/StepCard/StepCardFooter/index.test.tsx +162 -0
  31. package/src/components/common/StepCard/StepCardFooter/index.tsx +120 -0
  32. package/src/components/common/StepCard/index.test.tsx +120 -0
  33. package/src/components/common/StepCard/index.tsx +74 -0
  34. package/src/components/common/StepCard/types.ts +45 -0
  35. package/src/components/common/TitleBlock/types.ts +1 -1
  36. package/src/components/form/inputs/SearchableField.test.tsx +1 -1
  37. package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +3 -0
  38. package/src/components/loaders/LoadingSpinner/index.tsx +3 -26
  39. package/src/examples/ListWithPagination/index.tsx +2 -1
  40. package/src/i18n/namespaces/common/en.json +7 -0
  41. package/src/i18n/namespaces/common/lt.json +7 -0
  42. package/src/library/icons.ts +2 -0
  43. package/src/library/index.ts +2 -0
  44. package/src/library/types.ts +17 -2
  45. package/src/stories/atoms/Button.stories.tsx +202 -497
  46. package/src/stories/foundations/ThemedMuiComponents.stories.tsx +2 -2
  47. package/src/stories/molecules/CardShell.stories.tsx +36 -2
  48. package/src/stories/molecules/DatePicker.stories.tsx +1 -2
  49. package/src/stories/molecules/ListWithIcons.stories.tsx +26 -0
  50. package/src/stories/molecules/Popover.stories.tsx +1 -1
  51. package/src/stories/molecules/StepCard.stories.tsx +181 -0
  52. package/src/stories/molecules/TitleBlock.stories.tsx +2 -2
  53. package/src/stories/organisms/AdvancedListItem.stories.tsx +80 -0
  54. package/src/stories/organisms/CardFormContainer.stories.tsx +1 -1
  55. package/src/stories/organisms/Dialog.stories.tsx +1 -2
  56. package/src/theme/light/MuiButton.tsx +54 -0
  57. package/src/theme/light/MuiCard.tsx +9 -7
  58. package/src/theme/light/MuiTypography.tsx +17 -0
  59. package/src/theme/palette.tsx +7 -7
  60. package/src/theme/spacing.ts +5 -0
package/README.md CHANGED
@@ -9,6 +9,10 @@ Prisidėjimo gairės pateiktos [`CONTRIBUTING.md`](./CONTRIBUTING.md) faile. Pri
9
9
  biblioteka jas reikia perskaityti: jose aprašyta prieigos ir dizaino derinimo tvarka, šakų bei pull
10
10
  request'ų taisyklės ir versijų leidyba.
11
11
 
12
+ > [!IMPORTANT]
13
+ > Naujinantis iš `1.x` į **`2.0.0`** (MUI 5 → 9), migracijos gairės pateiktos
14
+ > [`docs/MIGRATION-v2.md`](./docs/MIGRATION-v2.md) faile.
15
+
12
16
  ## Prerekvizitai
13
17
 
14
18
  1. Įsitikinkite, kad turite įdiegtą **Node.js 22.x** versiją. Tokia pati Node.js versija šiuo metu naudojama ir CI aplinkoje;
@@ -0,0 +1,3 @@
1
+ import { default as IconProps } from '../IconProps';
2
+ declare function ShoppingCartIcon({ className, size, fillColor, ...rest }: IconProps): import("react").JSX.Element;
3
+ export default ShoppingCartIcon;
@@ -1,5 +1,5 @@
1
1
  import { BoxProps } from '@mui/material';
2
2
  import { RcSesCardShellProps } from './types';
3
3
  type ShellProps = RcSesCardShellProps & Omit<BoxProps, keyof RcSesCardShellProps | 'children'>;
4
- declare function RcSesCardShell({ variant, theme, fullHeight, borderless, header, children, footer, className, testIds, sx, ...boxProps }: ShellProps): import("react").JSX.Element;
4
+ declare function RcSesCardShell({ variant, theme, fullHeight, borderless, contentGap, footerGap, header, children, footer, className, testIds, sx, ...boxProps }: ShellProps): import("react").JSX.Element;
5
5
  export default RcSesCardShell;
@@ -13,6 +13,16 @@ export interface RcSesCardShellProps {
13
13
  fullHeight?: boolean;
14
14
  /** Renders the shell without any border. */
15
15
  borderless?: boolean;
16
+ /**
17
+ * Overrides the `variant` preset's header-to-content gap (`cards[variant].gap`).
18
+ * Use when a composition needs a fixed spacing regardless of breakpoint.
19
+ */
20
+ contentGap?: string;
21
+ /**
22
+ * Overrides the `variant` preset's content-to-footer gap
23
+ * (`cards[variant].footerGap`).
24
+ */
25
+ footerGap?: string;
16
26
  /** Header row, normally `RcSesTitleBlock`. The shell only provides the slot. */
17
27
  header?: ReactNode;
18
28
  children?: ReactNode;
@@ -1,4 +1,7 @@
1
1
  import { ComponentType } from 'react';
2
+ import { common, error, grey, overlays, primary, secondary, warning } from '../../../theme/palette';
3
+ export type ListWithIconsItemTone = 'default' | 'secondary' | 'muted' | 'link';
4
+ export type PaletteColor = (typeof primary)[keyof typeof primary] | (typeof secondary)[keyof typeof secondary] | (typeof grey)[keyof typeof grey] | (typeof warning)[keyof typeof warning] | (typeof error)[keyof typeof error] | (typeof overlays)[keyof typeof overlays] | (typeof common)[keyof typeof common];
2
5
  export interface ListWithIconsItemData {
3
6
  icon?: ComponentType<{
4
7
  fillColor?: string;
@@ -7,5 +10,5 @@ export interface ListWithIconsItemData {
7
10
  text?: string;
8
11
  disabled?: boolean;
9
12
  tooltip?: string;
10
- textColor?: string;
13
+ textColor?: ListWithIconsItemTone | PaletteColor;
11
14
  }
@@ -0,0 +1,34 @@
1
+ export interface RcSesStepCardFooterProps {
2
+ activeStep: number;
3
+ stepCount: number;
4
+ onNext?: () => void;
5
+ onBack?: () => void;
6
+ onCancel?: () => void;
7
+ totalPrice?: string;
8
+ }
9
+ export declare const stepCardFooterLeadingSx: {
10
+ readonly width: {
11
+ readonly xs: "100%";
12
+ readonly sm: "auto";
13
+ };
14
+ readonly mt: {
15
+ readonly xs: 0.5;
16
+ readonly sm: 0;
17
+ };
18
+ readonly order: {
19
+ readonly xs: 1;
20
+ readonly sm: 0;
21
+ };
22
+ };
23
+ export declare const stepCardFooterTrailingSx: {
24
+ readonly width: {
25
+ readonly xs: "100%";
26
+ readonly sm: "auto";
27
+ };
28
+ readonly order: {
29
+ readonly xs: 0;
30
+ readonly sm: 1;
31
+ };
32
+ };
33
+ declare function RcSesStepCardFooter({ activeStep, stepCount, onNext, onBack, onCancel, totalPrice, }: RcSesStepCardFooterProps): import("react").JSX.Element;
34
+ export default RcSesStepCardFooter;
@@ -0,0 +1,3 @@
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;
3
+ export default RcSesStepCard;
@@ -0,0 +1,39 @@
1
+ import { ReactNode } from 'react';
2
+ import { RcSesTitleBlockBaseProps } from '../TitleBlock/types';
3
+ export interface RcSesStepCardTestIds {
4
+ root?: string;
5
+ header?: string;
6
+ content?: string;
7
+ footer?: string;
8
+ }
9
+ export interface RcSesStepCardProps extends Pick<RcSesTitleBlockBaseProps, 'title' | 'description'> {
10
+ /**
11
+ * Zero-based index of the currently active step. Drives the step-position
12
+ * variant of the default footer (first / middle / last).
13
+ */
14
+ activeStep: number;
15
+ /** Total number of steps in the wizard. Drives last-step detection. */
16
+ stepCount: number;
17
+ /**
18
+ * Fired when the trailing CTA is clicked ("Tęsti" on first / middle,
19
+ * "Į krepšelį" on the last step). The parent decides what "next" means.
20
+ */
21
+ onNext?: () => void;
22
+ /** Fired when the leading "Atgal" button is clicked (middle + last step). */
23
+ onBack?: () => void;
24
+ /** Fired when the leading "Atšaukti" button is clicked (first step). */
25
+ onCancel?: () => void;
26
+ /**
27
+ * Total price shown next to the trailing CTA on the last step, rendered as
28
+ * `Suma be PVM: {totalPrice}`. Pass a preformatted string ("4,01 €") so
29
+ * locale + currency stay a consumer concern.
30
+ */
31
+ totalPrice?: string;
32
+ /**
33
+ * Replaces the whole default footer, including the step-position variants.
34
+ * Use when a step needs an entirely custom action row.
35
+ */
36
+ footer?: ReactNode;
37
+ children?: ReactNode;
38
+ testIds?: RcSesStepCardTestIds;
39
+ }
@@ -31,7 +31,7 @@ export interface RcSesTitleBlockBaseProps {
31
31
  */
32
32
  titleTone?: 'default' | 'brand';
33
33
  /**
34
- * Decorative leading visual, `Icon-tile` once SAV-6476 lands. Rendered
34
+ * Decorative leading visual, `Icon-tile` once that component lands. Rendered
35
35
  * `aria-hidden`, so it never contributes to the heading's accessible name.
36
36
  */
37
37
  icon?: ReactNode;
@@ -8,5 +8,8 @@ export interface RcSesCardFormContainerProps extends RcSesCardProps {
8
8
  layout?: LayoutMode;
9
9
  isLoading?: boolean;
10
10
  }
11
+ /**
12
+ * @deprecated Use `RcSesStepCard` instead. Will be removed in a future major release.
13
+ */
11
14
  declare const RcSesCardFormContainer: ({ steps, onStepClick, activeStep, layout, children, isLoading, ...cardProps }: RcSesCardFormContainerProps) => import("react").JSX.Element;
12
15
  export default RcSesCardFormContainer;
@@ -1,7 +1,4 @@
1
- import { ButtonOwnProps } from '@mui/material';
2
- declare const VALID_SPINNER_COLORS: readonly ["primary", "secondary", "error", "warning", "info", "success", "inherit"];
3
- export type RcSesSpinnerColor = (typeof VALID_SPINNER_COLORS)[number];
4
- export declare function getSpinnerColor(color: ButtonOwnProps['color']): RcSesSpinnerColor;
1
+ export type RcSesSpinnerColor = 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success' | 'inherit';
5
2
  export interface RcSesLoadingSpinnerProps {
6
3
  color?: RcSesSpinnerColor;
7
4
  size?: 'small' | 'medium' | 'large' | string;
@@ -40,6 +40,7 @@ import { default as ScalesIcon } from '../assets/icons/ScalesIcon';
40
40
  import { default as ScrollIcon } from '../assets/icons/ScrollIcon';
41
41
  import { default as SearchHelpIcon } from '../assets/icons/SearchHelpIcon';
42
42
  import { default as SearchXIcon } from '../assets/icons/SearchXIcon';
43
+ import { default as ShoppingCartIcon } from '../assets/icons/ShoppingCartIcon';
43
44
  import { default as SpinnerGapBoldIcon } from '../assets/icons/SpinnerGapBoldIcon';
44
45
  import { default as TrashIcon } from '../assets/icons/TrashIcon';
45
46
  import { default as UploadSimpleIcon } from '../assets/icons/UploadSimpleIcon';
@@ -48,4 +49,4 @@ import { default as WarningCircleIcon } from '../assets/icons/WarningCircleIcon'
48
49
  import { default as WarningDiamondFillIcon } from '../assets/icons/WarningDiamondFillIcon';
49
50
  import { default as WarningFillIcon } from '../assets/icons/WarningFillIcon';
50
51
  import { default as XCircleFillIcon } from '../assets/icons/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, };
52
+ 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, ShoppingCartIcon, SpinnerGapBoldIcon, TrashIcon, UploadSimpleIcon, UserIcon, WarningDiamondFillIcon, WarningFillIcon, WarningCircleIcon, XCircleFillIcon, };
@@ -21,6 +21,7 @@ import { default as RcSesServiceLinks } from '../components/common/ServiceLinks'
21
21
  import { default as RcSesSideNavLayout } from '../components/common/SideNav/SideNavLayout';
22
22
  import { default as RcSesSnackbar } from '../components/common/Snackbar';
23
23
  import { RcSesSnackbarProvider, useSnackbar } from '../components/common/Snackbar/SnackbarProvider';
24
+ import { default as RcSesStepCard } from '../components/common/StepCard';
24
25
  import { default as RcSesSwitch } from '../components/common/Switch';
25
26
  import { default as RcSesTab } from '../components/common/Tabs/Tab';
26
27
  import { default as RcSesTabPanel } from '../components/common/Tabs/TabPanel';
@@ -67,7 +68,7 @@ declare module '@mui/x-date-pickers/models' {
67
68
  export { RcSesPalette, RcSesTheme };
68
69
  export { RcSesAccordion, useAccordionController };
69
70
  export { RcSesAdvancedList, RcSesAdvancedListItem };
70
- export { RcSesAlert, RcSesBadge, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesCardShell, RcSesTitleBlock, RcSesCardFooter, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesModal, RcSesSwitch, };
71
+ export { RcSesAlert, RcSesBadge, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesCardShell, RcSesTitleBlock, RcSesCardFooter, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesModal, RcSesStepCard, RcSesSwitch, };
71
72
  export { RcSesSegmentedControl };
72
73
  export { RcSesSideNavLayout };
73
74
  export { RcSesCheckbox, RcSesCheckboxFormControl, RcSesSimpleCheckbox };
@@ -2,12 +2,13 @@ import { RcSesCardProps } from '../components/common/Card';
2
2
  import { CardFooterAlign, RcSesCardFooterProps, RcSesCardFooterTestIds } from '../components/common/CardShell/CardFooter/types';
3
3
  import { CardShellTheme, CardShellVariant, RcSesCardShellProps, RcSesCardShellTestIds } from '../components/common/CardShell/types';
4
4
  import { ListWithIconsProps } from '../components/common/ListWithIcons';
5
- import { ListWithIconsItemData } from '../components/common/ListWithIcons/ListWithIcons.types';
5
+ import { ListWithIconsItemData, ListWithIconsItemTone, PaletteColor } from '../components/common/ListWithIcons/ListWithIcons.types';
6
6
  import { RcSesSegmentOption, RcSesSegmentedControlProps } from '../components/common/SegmentedControl';
7
7
  import { RcSesSegmentButtonProps } from '../components/common/SegmentedControl/components/SegmentButton';
8
8
  import { RcSesServiceLinkItem, RcSesServiceLinksProps, RcSesServiceLinksTestIds } from '../components/common/ServiceLinks/types';
9
9
  import { RcSesSideNavItem, RcSesSideNavOverflow } from '../components/common/SideNav';
10
10
  import { RcSesSideNavLayoutProps } from '../components/common/SideNav/SideNavLayout';
11
+ import { RcSesStepCardProps, RcSesStepCardTestIds } from '../components/common/StepCard/types';
11
12
  import { RcSesTitleBlockProps, RcSesTitleBlockTestIds, TitleBlockHeadingLevel, TitleBlockTitleVariant } from '../components/common/TitleBlock/types';
12
13
  import { RcSesTooltipProps } from '../components/common/Tooltip';
13
14
  import { RcSesFormControlLabelProps } from '../components/form/inputs/FormControlLabel';
@@ -20,9 +21,9 @@ import { RcSesLoadingSpinnerProps, RcSesSpinnerColor } from '../components/loade
20
21
  import { DialogSize, RcSesDialogProps } from '../components/overlays/Dialog';
21
22
  import { ModalVariant, RcSesModalProps } from '../components/overlays/Modal';
22
23
  import { ButtonProps } from '../types/buttons/ButtonProps';
23
- export type { ListWithIconsProps, ListWithIconsItemData };
24
+ export type { ListWithIconsProps, ListWithIconsItemData, ListWithIconsItemTone, PaletteColor, };
24
25
  export type { RcSesServiceLinksProps, RcSesServiceLinkItem, RcSesServiceLinksTestIds };
25
26
  export type { ButtonProps };
26
- 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, };
27
+ 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, };
27
28
  export type { RcSesDialogProps, DialogSize };
28
29
  export type { RcSesModalProps, ModalVariant };