@registrucentras/rc-ses-react-components 1.9.0 → 1.10.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 (24) hide show
  1. package/dist/assets/icons/PencilSimpleLineIcon.d.ts +1 -1
  2. package/dist/components/common/SegmentedControl/components/SegmentButton/index.d.ts +19 -0
  3. package/dist/components/common/SegmentedControl/index.d.ts +14 -0
  4. package/dist/components/form/inputs/SearchInput/index.d.ts +10 -0
  5. package/dist/library/index.d.ts +2 -0
  6. package/dist/library/types.d.ts +3 -1
  7. package/dist/registrucentras-rc-ses-react-components.cjs +10 -10
  8. package/dist/registrucentras-rc-ses-react-components.js +2240 -2042
  9. package/dist/stories/components/display/SegmentedControl.stories.d.ts +202 -0
  10. package/package.json +1 -1
  11. package/src/assets/icons/PencilSimpleLineIcon.tsx +8 -2
  12. package/src/components/common/SegmentedControl/components/SegmentButton/index.test.tsx +85 -0
  13. package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +110 -0
  14. package/src/components/common/SegmentedControl/index.test.tsx +164 -0
  15. package/src/components/common/SegmentedControl/index.tsx +188 -0
  16. package/src/components/common/SelectableCardList/components/SelectableCardListItem.test.tsx +74 -1
  17. package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +16 -1
  18. package/src/components/form/inputs/SearchInput/index.test.tsx +68 -2
  19. package/src/components/form/inputs/SearchInput/index.tsx +24 -13
  20. package/src/i18n/namespaces/common/en.json +4 -0
  21. package/src/i18n/namespaces/common/lt.json +4 -0
  22. package/src/library/index.ts +2 -0
  23. package/src/library/types.ts +8 -0
  24. package/src/stories/components/display/SegmentedControl.stories.tsx +311 -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,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;
@@ -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;
@@ -10,6 +10,7 @@ import { default as DataPagination } from '../components/common/DataPagination';
10
10
  import { default as RcSesIconWithCircularBackground } from '../components/common/IconWithCircularBackground';
11
11
  import { default as RcSesImageCard } from '../components/common/ImageCard';
12
12
  import { default as ListWithIcons } from '../components/common/ListWithIcons';
13
+ import { default as RcSesSegmentedControl } from '../components/common/SegmentedControl';
13
14
  import { default as RcSesSnackbar } from '../components/common/Snackbar';
14
15
  import { RcSesSnackbarProvider, useSnackbar } from '../components/common/Snackbar/SnackbarProvider';
15
16
  import { default as RcSesTab } from '../components/common/Tabs/Tab';
@@ -55,6 +56,7 @@ declare module '@mui/x-date-pickers/models' {
55
56
  export { RcSesPalette, RcSesTheme };
56
57
  export { RcSesAccordion, useAccordionController };
57
58
  export { RcSesAlert, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesFullPageLoader, RcSesLoader, RcSesLoadingSpinner, RcSesCard, RcSesDialog, RcSesFooter, RcSesImageCard, RcSesSnackbar, RcSesSnackbarProvider, RcSesModal, };
59
+ export { RcSesSegmentedControl };
58
60
  export { RcSesCheckbox, RcSesCheckboxFormControl, RcSesSimpleCheckbox };
59
61
  export { useSnackbar };
60
62
  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 };