@registrucentras/rc-ses-react-components 1.9.0 → 1.11.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 (39) hide show
  1. package/dist/assets/icons/PencilSimpleLineIcon.d.ts +1 -1
  2. package/dist/components/common/Badge/index.d.ts +10 -0
  3. package/dist/components/common/SegmentedControl/components/SegmentButton/index.d.ts +19 -0
  4. package/dist/components/common/SegmentedControl/index.d.ts +14 -0
  5. package/dist/components/common/Switch/index.d.ts +10 -0
  6. package/dist/components/form/inputs/SearchInput/index.d.ts +10 -0
  7. package/dist/library/index.d.ts +5 -1
  8. package/dist/library/types.d.ts +3 -1
  9. package/dist/registrucentras-rc-ses-react-components.cjs +10 -10
  10. package/dist/registrucentras-rc-ses-react-components.js +2885 -2460
  11. package/dist/stories/components/display/Badge.stories.d.ts +9 -0
  12. package/dist/stories/components/display/SegmentedControl.stories.d.ts +202 -0
  13. package/dist/stories/components/inputs/Switch.stories.d.ts +17 -0
  14. package/dist/theme/light/MuiSwitch.d.ts +3 -0
  15. package/package.json +1 -1
  16. package/src/assets/icons/PencilSimpleLineIcon.tsx +8 -2
  17. package/src/components/common/Badge/index.test.tsx +129 -0
  18. package/src/components/common/Badge/index.tsx +162 -0
  19. package/src/components/common/SegmentedControl/components/SegmentButton/index.test.tsx +85 -0
  20. package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +110 -0
  21. package/src/components/common/SegmentedControl/index.test.tsx +164 -0
  22. package/src/components/common/SegmentedControl/index.tsx +188 -0
  23. package/src/components/common/SelectableCardList/components/SelectableCardListItem.test.tsx +74 -1
  24. package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +16 -1
  25. package/src/components/common/Switch/index.test.tsx +214 -0
  26. package/src/components/common/Switch/index.tsx +49 -0
  27. package/src/components/form/inputs/SearchInput/index.test.tsx +68 -2
  28. package/src/components/form/inputs/SearchInput/index.tsx +24 -13
  29. package/src/i18n/namespaces/common/en.json +4 -0
  30. package/src/i18n/namespaces/common/lt.json +4 -0
  31. package/src/i18n/namespaces/input/en.json +6 -0
  32. package/src/i18n/namespaces/input/lt.json +6 -0
  33. package/src/library/index.ts +6 -0
  34. package/src/library/types.ts +8 -0
  35. package/src/stories/components/display/Badge.stories.tsx +165 -0
  36. package/src/stories/components/display/SegmentedControl.stories.tsx +311 -0
  37. package/src/stories/components/inputs/Switch.stories.tsx +70 -0
  38. package/src/theme/light/MuiSwitch.tsx +77 -0
  39. package/src/theme/light/index.tsx +2 -0
@@ -1,3 +1,3 @@
1
1
  import { default as IconProps } from '../IconProps';
2
- declare function PencilSimpleLineIcon({ className, fillColor, size, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function PencilSimpleLineIcon({ className, fillColor, size, weight, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default PencilSimpleLineIcon;
@@ -0,0 +1,10 @@
1
+ export type RcSesBadgeProps = {
2
+ label: string;
3
+ variant: 'neutral' | 'success' | 'warning' | 'error' | 'info' | 'brand';
4
+ size: 'small' | 'regular';
5
+ showIcon?: boolean;
6
+ showClose?: boolean;
7
+ onClose?: () => void;
8
+ };
9
+ declare function RcSesBadge(props: RcSesBadgeProps): import("react/jsx-runtime").JSX.Element;
10
+ export default RcSesBadge;
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ export interface RcSesSegmentOption {
3
+ id: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ panelId?: string;
7
+ }
8
+ export interface RcSesSegmentButtonProps {
9
+ option: RcSesSegmentOption;
10
+ isSelected: boolean;
11
+ isFocused: boolean;
12
+ size: 'small' | 'regular';
13
+ ariaRole: 'tab' | 'radio';
14
+ onClick: (optionId: string) => void;
15
+ onKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;
16
+ onFocus: () => void;
17
+ }
18
+ declare const RcSesSegmentButton: React.ForwardRefExoticComponent<RcSesSegmentButtonProps & React.RefAttributes<HTMLButtonElement>>;
19
+ export default RcSesSegmentButton;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { RcSesSegmentOption } from './components/SegmentButton';
3
+ export type { RcSesSegmentOption };
4
+ export interface RcSesSegmentedControlProps {
5
+ options: RcSesSegmentOption[];
6
+ value: string;
7
+ onChange: (value: string) => void;
8
+ size?: 'small' | 'regular';
9
+ role?: 'radiogroup' | 'tablist';
10
+ disableBg?: boolean;
11
+ ariaLabel?: string;
12
+ }
13
+ declare const RcSesSegmentedControl: React.ForwardRefExoticComponent<RcSesSegmentedControlProps & React.RefAttributes<HTMLDivElement>>;
14
+ export default RcSesSegmentedControl;
@@ -0,0 +1,10 @@
1
+ import { SwitchProps } from '@mui/material';
2
+ export type RcSesSwitchProps = SwitchProps & ({
3
+ label: string;
4
+ ariaLabel?: string;
5
+ } | {
6
+ label?: undefined;
7
+ ariaLabel: string;
8
+ });
9
+ declare function RcSesSwitch(props: RcSesSwitchProps): import("react/jsx-runtime").JSX.Element;
10
+ export default RcSesSwitch;
@@ -9,6 +9,16 @@ type TFieldProps = Omit<OutlinedTextFieldProps, 'variant' | 'value' | 'defaultVa
9
9
  type TWrapperProps = RcSesFormControlWrapperProps;
10
10
  type ImmediateWrapperProps = 'id' | 'label' | 'errors' | 'labelSubtitle';
11
11
  type TSearchButtonProps = Partial<ButtonProps>;
12
+ /**
13
+ * Search input component with react-hook-form integration.
14
+ *
15
+ * ⚠️ Warning: This component renders an inner `<form>` element and uses `stopPropagation()`
16
+ * to prevent submit events from bubbling to parent forms. If nested inside another form,
17
+ * React will log a `validateDOMNesting` warning in development mode — this is expected
18
+ * for client-side rendering and does not affect functionality. Note this is not SSR-safe:
19
+ * an HTML parser drops the nested `<form>` tag, so under SSR/hydration the Enter key
20
+ * would submit the parent form instead.
21
+ */
12
22
  declare const RcSesSearchInput: React.ForwardRefExoticComponent<Pick<TControllerProps, ImmediateControllerProps> & Pick<RcSesFormControlWrapperProps, ImmediateWrapperProps> & {
13
23
  onSearch: (value: string) => void;
14
24
  required?: boolean;
@@ -2,6 +2,7 @@ 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
4
  import { default as RcSesAlert } from '../components/common/Alert';
5
+ import { default as RcSesBadge } from '../components/common/Badge';
5
6
  import { default as RcSesBreadcrumbs } from '../components/common/Breadcrumbs';
6
7
  import { default as RcSesButton } from '../components/common/Button';
7
8
  import { default as RcSesButtonWithPopover } from '../components/common/Button/ButtonWithPopover';
@@ -10,8 +11,10 @@ import { default as DataPagination } from '../components/common/DataPagination';
10
11
  import { default as RcSesIconWithCircularBackground } from '../components/common/IconWithCircularBackground';
11
12
  import { default as RcSesImageCard } from '../components/common/ImageCard';
12
13
  import { default as ListWithIcons } from '../components/common/ListWithIcons';
14
+ import { default as RcSesSegmentedControl } from '../components/common/SegmentedControl';
13
15
  import { default as RcSesSnackbar } from '../components/common/Snackbar';
14
16
  import { RcSesSnackbarProvider, useSnackbar } from '../components/common/Snackbar/SnackbarProvider';
17
+ import { default as RcSesSwitch } from '../components/common/Switch';
15
18
  import { default as RcSesTab } from '../components/common/Tabs/Tab';
16
19
  import { default as RcSesTabPanel } from '../components/common/Tabs/TabPanel';
17
20
  import { default as RcSesTabs } from '../components/common/Tabs/Tabs';
@@ -54,7 +57,8 @@ declare module '@mui/x-date-pickers/models' {
54
57
  }
55
58
  export { RcSesPalette, RcSesTheme };
56
59
  export { RcSesAccordion, useAccordionController };
57
- export { RcSesAlert, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesModal, };
60
+ export { RcSesAlert, RcSesBadge, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesModal, RcSesSwitch, };
61
+ export { RcSesSegmentedControl };
58
62
  export { RcSesCheckbox, RcSesCheckboxFormControl, RcSesSimpleCheckbox };
59
63
  export { useSnackbar };
60
64
  export { RcSesDatepicker };
@@ -1,6 +1,8 @@
1
1
  import { RcSesCardProps } from '../components/common/Card';
2
2
  import { ListWithIconsProps } from '../components/common/ListWithIcons';
3
3
  import { ListWithIconsItemData } from '../components/common/ListWithIcons/ListWithIcons.types';
4
+ import { RcSesSegmentOption, RcSesSegmentedControlProps } from '../components/common/SegmentedControl';
5
+ import { RcSesSegmentButtonProps } from '../components/common/SegmentedControl/components/SegmentButton';
4
6
  import { RcSesFormControlLabelProps } from '../components/form/inputs/FormControlLabel';
5
7
  import { SimpleCheckboxProps } from '../components/form/inputs/SimpleCheckbox';
6
8
  import { RcSesCardFormContainerProps } from '../components/layout/ServiceFormContainer/CardFormContainer';
@@ -13,6 +15,6 @@ import { ModalVariant, RcSesModalProps } from '../components/overlays/Modal';
13
15
  import { ButtonProps } from '../types/buttons/ButtonProps';
14
16
  export type { ListWithIconsProps, ListWithIconsItemData };
15
17
  export type { ButtonProps };
16
- export type { RcSesFullPageLoaderProps, RcSesLoaderBackdrop, RcSesLoaderProps, RcSesLoaderSize, RcSesCardFormContainerProps, RcSesCardProps, ServiceWizardStepperProps, SimpleCheckboxProps, RcSesFormControlLabelProps, RcSesLoadingSpinnerProps, RcSesSpinnerColor, };
18
+ export type { RcSesFullPageLoaderProps, RcSesLoaderBackdrop, RcSesLoaderProps, RcSesLoaderSize, RcSesCardFormContainerProps, RcSesCardProps, RcSesSegmentedControlProps, RcSesSegmentButtonProps, RcSesSegmentOption, ServiceWizardStepperProps, SimpleCheckboxProps, RcSesFormControlLabelProps, RcSesLoadingSpinnerProps, RcSesSpinnerColor, };
17
19
  export type { RcSesDialogProps, DialogSize };
18
20
  export type { RcSesModalProps, ModalVariant };