@registrucentras/rc-ses-react-components 1.8.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.
- package/dist/assets/icons/PencilSimpleLineIcon.d.ts +1 -1
- package/dist/components/common/SegmentedControl/components/SegmentButton/index.d.ts +19 -0
- package/dist/components/common/SegmentedControl/index.d.ts +14 -0
- package/dist/components/form/inputs/SearchInput/index.d.ts +10 -0
- package/dist/components/loaders/FullPageLoader/index.d.ts +9 -0
- package/dist/components/loaders/Loader/index.d.ts +26 -0
- package/dist/library/index.d.ts +6 -2
- package/dist/library/types.d.ts +6 -2
- package/dist/registrucentras-rc-ses-react-components.cjs +10 -10
- package/dist/registrucentras-rc-ses-react-components.js +2569 -2277
- package/dist/stories/components/display/SegmentedControl.stories.d.ts +202 -0
- package/dist/stories/components/loaders/FullPageLoader.stories.d.ts +37 -0
- package/dist/stories/components/loaders/Loader.stories.d.ts +36 -0
- package/dist/stories/components/{spinner → loaders}/LoadingSpinner.stories.d.ts +4 -4
- package/package.json +1 -1
- package/src/assets/icons/PencilSimpleLineIcon.tsx +8 -2
- package/src/components/common/Button/index.tsx +1 -3
- package/src/components/common/SegmentedControl/components/SegmentButton/index.test.tsx +85 -0
- package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +110 -0
- package/src/components/common/SegmentedControl/index.test.tsx +164 -0
- package/src/components/common/SegmentedControl/index.tsx +188 -0
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.test.tsx +74 -1
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +16 -1
- package/src/components/common/Snackbar/index.test.tsx +10 -4
- package/src/components/form/inputs/CheckboxFormControl.test.tsx +11 -7
- package/src/components/form/inputs/SearchInput/index.test.tsx +68 -2
- package/src/components/form/inputs/SearchInput/index.tsx +24 -13
- package/src/components/loaders/FullPageLoader/index.test.tsx +80 -0
- package/src/components/loaders/FullPageLoader/index.tsx +68 -0
- package/src/components/loaders/Loader/index.test.tsx +58 -0
- package/src/components/loaders/Loader/index.tsx +65 -0
- package/src/components/{LoadingSpinner/LoadingSpinner.test.tsx → loaders/LoadingSpinner/index.test.tsx} +1 -1
- package/src/components/{LoadingSpinner/LoadingSpinner.tsx → loaders/LoadingSpinner/index.tsx} +1 -1
- package/src/components/overlays/Dialog/index.test.tsx +1 -1
- package/src/i18n/namespaces/common/en.json +7 -0
- package/src/i18n/namespaces/common/lt.json +7 -0
- package/src/library/index.ts +7 -1
- package/src/library/types.ts +21 -4
- package/src/setupTests.ts +13 -0
- package/src/stories/components/display/SegmentedControl.stories.tsx +311 -0
- package/src/stories/components/loaders/FullPageLoader.stories.tsx +126 -0
- package/src/stories/components/loaders/Loader.stories.tsx +76 -0
- package/src/stories/components/{spinner → loaders}/LoadingSpinner.stories.tsx +2 -2
- /package/dist/components/{LoadingSpinner/LoadingSpinner.d.ts → loaders/LoadingSpinner/index.d.ts} +0 -0
|
@@ -42,6 +42,16 @@ type Props = Pick<TControllerProps, ImmediateControllerProps> &
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Search input component with react-hook-form integration.
|
|
47
|
+
*
|
|
48
|
+
* ⚠️ Warning: This component renders an inner `<form>` element and uses `stopPropagation()`
|
|
49
|
+
* to prevent submit events from bubbling to parent forms. If nested inside another form,
|
|
50
|
+
* React will log a `validateDOMNesting` warning in development mode — this is expected
|
|
51
|
+
* for client-side rendering and does not affect functionality. Note this is not SSR-safe:
|
|
52
|
+
* an HTML parser drops the nested `<form>` tag, so under SSR/hydration the Enter key
|
|
53
|
+
* would submit the parent form instead.
|
|
54
|
+
*/
|
|
45
55
|
const RcSesSearchInput = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
|
|
46
56
|
const [hasSearchAttempted, setHasSearchAttempted] = React.useState(false)
|
|
47
57
|
const internalInputRef = useRef<HTMLInputElement>(null)
|
|
@@ -115,32 +125,31 @@ const RcSesSearchInput = React.forwardRef<HTMLInputElement, Props>((props, ref)
|
|
|
115
125
|
labelOnTop: slotProps?.wrapper?.labelOnTop ?? !sideLabel,
|
|
116
126
|
}
|
|
117
127
|
|
|
118
|
-
const shouldSearchOnEnter =
|
|
119
|
-
!shouldRenderSearchButton || !!mergedSearchButtonProps.disabled
|
|
120
|
-
|
|
121
128
|
const hasSearchValue = `${value ?? ''}`.trim().length > 0
|
|
122
129
|
const visibleErrors = hasSearchAttempted ? errors : undefined
|
|
123
130
|
|
|
124
|
-
const
|
|
131
|
+
const handleFormSubmit: React.FormEventHandler<HTMLFormElement> = (event) => {
|
|
132
|
+
event.preventDefault()
|
|
133
|
+
event.stopPropagation()
|
|
125
134
|
setHasSearchAttempted(true)
|
|
126
|
-
mergedSearchButtonProps.onClick?.(event)
|
|
127
135
|
|
|
128
|
-
if (
|
|
136
|
+
if (hasSearchValue) {
|
|
129
137
|
onSearch(value ?? '')
|
|
138
|
+
} else {
|
|
139
|
+
onBlur()
|
|
130
140
|
}
|
|
131
141
|
}
|
|
132
142
|
|
|
133
143
|
const handleFieldKeyDown: NonNullable<TFieldProps['onKeyDown']> = (event) => {
|
|
134
144
|
slotProps?.field?.onKeyDown?.(event)
|
|
135
145
|
|
|
136
|
-
if (!event.defaultPrevented &&
|
|
137
|
-
setHasSearchAttempted(true)
|
|
146
|
+
if (!event.defaultPrevented && event.key === 'Enter') {
|
|
138
147
|
event.preventDefault()
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
|
|
148
|
+
const form = internalInputRef.current?.form
|
|
149
|
+
if (form?.requestSubmit) {
|
|
150
|
+
form.requestSubmit()
|
|
142
151
|
} else {
|
|
143
|
-
|
|
152
|
+
form?.dispatchEvent(new Event('submit', { cancelable: true, bubbles: true }))
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
155
|
}
|
|
@@ -213,6 +222,8 @@ const RcSesSearchInput = React.forwardRef<HTMLInputElement, Props>((props, ref)
|
|
|
213
222
|
{...mergedWrapperProps}
|
|
214
223
|
>
|
|
215
224
|
<Box
|
|
225
|
+
component='form'
|
|
226
|
+
onSubmit={handleFormSubmit}
|
|
216
227
|
sx={{
|
|
217
228
|
alignItems: 'stretch',
|
|
218
229
|
display: 'flex',
|
|
@@ -254,8 +265,8 @@ const RcSesSearchInput = React.forwardRef<HTMLInputElement, Props>((props, ref)
|
|
|
254
265
|
|
|
255
266
|
{shouldRenderSearchButton && (
|
|
256
267
|
<RcSesButton
|
|
268
|
+
type='submit'
|
|
257
269
|
disabled={disabled || mergedSearchButtonProps.disabled || !hasSearchValue}
|
|
258
|
-
onClick={handleSearchClick}
|
|
259
270
|
sx={[
|
|
260
271
|
{
|
|
261
272
|
flexShrink: 0,
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ThemeProvider, alpha } from '@mui/material/styles'
|
|
2
|
+
import { render, screen } from '@testing-library/react'
|
|
3
|
+
import { type ReactElement } from 'react'
|
|
4
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
5
|
+
|
|
6
|
+
import i18n from '@/i18n/i18n'
|
|
7
|
+
import theme from '@/theme/light'
|
|
8
|
+
|
|
9
|
+
import RcSesFullPageLoader from './index'
|
|
10
|
+
|
|
11
|
+
const getDefaultLoaderLabel = () => i18n.t('components.Loader.loading', { ns: 'common' })
|
|
12
|
+
|
|
13
|
+
const renderWithTheme = (ui: ReactElement) =>
|
|
14
|
+
render(<ThemeProvider theme={theme}>{ui}</ThemeProvider>)
|
|
15
|
+
|
|
16
|
+
describe('RcSesFullPageLoader', () => {
|
|
17
|
+
beforeEach(async () => {
|
|
18
|
+
await i18n.changeLanguage('lt')
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('should render paper container in full page mode', () => {
|
|
22
|
+
renderWithTheme(<RcSesFullPageLoader />)
|
|
23
|
+
|
|
24
|
+
expect(screen.getByRole('status').closest('.MuiPaper-root')).toBeInTheDocument()
|
|
25
|
+
expect(screen.getByRole('progressbar')).toHaveStyle({ height: '64px', width: '64px' })
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('should render light backdrop variant', () => {
|
|
29
|
+
renderWithTheme(<RcSesFullPageLoader backdrop='light' />)
|
|
30
|
+
|
|
31
|
+
const backdrop = document.querySelector('.MuiBackdrop-root') as HTMLElement
|
|
32
|
+
|
|
33
|
+
expect(backdrop).toHaveStyle({
|
|
34
|
+
backgroundColor: alpha(theme.palette.common.white, 0.72),
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('should render dark backdrop variant', () => {
|
|
39
|
+
renderWithTheme(<RcSesFullPageLoader backdrop='dark' />)
|
|
40
|
+
|
|
41
|
+
const backdrop = document.querySelector('.MuiBackdrop-root') as HTMLElement
|
|
42
|
+
|
|
43
|
+
expect(backdrop).toHaveStyle({
|
|
44
|
+
backgroundColor: alpha(theme.palette.grey[900], 0.45),
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('should prevent and restore background focus', () => {
|
|
49
|
+
const backgroundButton = document.createElement('button')
|
|
50
|
+
backgroundButton.textContent = 'Background action'
|
|
51
|
+
document.body.appendChild(backgroundButton)
|
|
52
|
+
backgroundButton.focus()
|
|
53
|
+
|
|
54
|
+
const { unmount } = renderWithTheme(<RcSesFullPageLoader />)
|
|
55
|
+
|
|
56
|
+
expect(backgroundButton).not.toHaveFocus()
|
|
57
|
+
|
|
58
|
+
unmount()
|
|
59
|
+
|
|
60
|
+
expect(backgroundButton).toHaveFocus()
|
|
61
|
+
document.body.removeChild(backgroundButton)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('should pass loader props to base loader', () => {
|
|
65
|
+
renderWithTheme(<RcSesFullPageLoader label='Duomenys kraunami' showLabel={false} />)
|
|
66
|
+
|
|
67
|
+
expect(screen.queryByText('Duomenys kraunami')).not.toBeInTheDocument()
|
|
68
|
+
expect(screen.getByRole('status')).toHaveAttribute('aria-label', 'Duomenys kraunami')
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('should use translated aria-label when label is hidden', () => {
|
|
72
|
+
renderWithTheme(<RcSesFullPageLoader showLabel={false} />)
|
|
73
|
+
|
|
74
|
+
expect(screen.queryByText(getDefaultLoaderLabel())).not.toBeInTheDocument()
|
|
75
|
+
expect(screen.getByRole('status')).toHaveAttribute(
|
|
76
|
+
'aria-label',
|
|
77
|
+
getDefaultLoaderLabel(),
|
|
78
|
+
)
|
|
79
|
+
})
|
|
80
|
+
})
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Box, BoxProps, Modal, Paper } from '@mui/material'
|
|
2
|
+
import { alpha } from '@mui/material/styles'
|
|
3
|
+
|
|
4
|
+
import RcSesLoader, { RcSesLoaderProps } from '@/components/loaders/Loader'
|
|
5
|
+
|
|
6
|
+
export type RcSesLoaderBackdrop = 'dark' | 'light'
|
|
7
|
+
|
|
8
|
+
// dimensions are based on the Figma design specifications
|
|
9
|
+
const FULL_PAGE_LOADER_CONTAINER_WIDTH = 187
|
|
10
|
+
const FULL_PAGE_LOADER_CONTAINER_HEIGHT = 198
|
|
11
|
+
|
|
12
|
+
type FullPageLoaderContentProps = Pick<RcSesLoaderProps, 'label' | 'showLabel'>
|
|
13
|
+
|
|
14
|
+
export interface RcSesFullPageLoaderProps
|
|
15
|
+
extends Omit<BoxProps, 'children' | 'sx'>,
|
|
16
|
+
FullPageLoaderContentProps {
|
|
17
|
+
backdrop?: RcSesLoaderBackdrop
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function RcSesFullPageLoader({
|
|
21
|
+
backdrop = 'light',
|
|
22
|
+
label,
|
|
23
|
+
showLabel,
|
|
24
|
+
...props
|
|
25
|
+
}: RcSesFullPageLoaderProps) {
|
|
26
|
+
return (
|
|
27
|
+
<Modal
|
|
28
|
+
disableEscapeKeyDown
|
|
29
|
+
open
|
|
30
|
+
slotProps={{
|
|
31
|
+
backdrop: {
|
|
32
|
+
sx: {
|
|
33
|
+
backgroundColor: (theme) =>
|
|
34
|
+
backdrop === 'dark'
|
|
35
|
+
? alpha(theme.palette.grey[900], 0.45)
|
|
36
|
+
: alpha(theme.palette.common.white, 0.72),
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<Box
|
|
42
|
+
sx={{
|
|
43
|
+
display: 'grid',
|
|
44
|
+
inset: 0,
|
|
45
|
+
placeItems: 'center',
|
|
46
|
+
position: 'fixed',
|
|
47
|
+
}}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
<Paper
|
|
51
|
+
elevation={4}
|
|
52
|
+
sx={{
|
|
53
|
+
borderRadius: 2,
|
|
54
|
+
boxSizing: 'border-box',
|
|
55
|
+
display: 'grid',
|
|
56
|
+
height: FULL_PAGE_LOADER_CONTAINER_HEIGHT,
|
|
57
|
+
placeItems: 'center',
|
|
58
|
+
width: FULL_PAGE_LOADER_CONTAINER_WIDTH,
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<RcSesLoader label={label} showLabel={showLabel} size='large' />
|
|
62
|
+
</Paper>
|
|
63
|
+
</Box>
|
|
64
|
+
</Modal>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default RcSesFullPageLoader
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
|
|
4
|
+
import i18n from '@/i18n/i18n'
|
|
5
|
+
|
|
6
|
+
import RcSesLoader from './index'
|
|
7
|
+
|
|
8
|
+
const getDefaultLoaderLabel = () => i18n.t('components.Loader.loading', { ns: 'common' })
|
|
9
|
+
|
|
10
|
+
describe('RcSesLoader', () => {
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
await i18n.changeLanguage('lt')
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
it('should render loader with default label', () => {
|
|
16
|
+
render(<RcSesLoader />)
|
|
17
|
+
|
|
18
|
+
expect(screen.getByRole('status')).toBeInTheDocument()
|
|
19
|
+
expect(screen.getByText(getDefaultLoaderLabel())).toBeInTheDocument()
|
|
20
|
+
expect(screen.getByRole('progressbar')).toBeInTheDocument()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it.each([
|
|
24
|
+
['small', '24px'],
|
|
25
|
+
['medium', '40px'],
|
|
26
|
+
['large', '64px'],
|
|
27
|
+
] as const)('should render the proper loader size', (size, expectedSize) => {
|
|
28
|
+
render(<RcSesLoader size={size} />)
|
|
29
|
+
|
|
30
|
+
expect(screen.getByRole('progressbar')).toHaveStyle({
|
|
31
|
+
height: expectedSize,
|
|
32
|
+
width: expectedSize,
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('should render custom label', () => {
|
|
37
|
+
render(<RcSesLoader label='Duomenys kraunami' />)
|
|
38
|
+
|
|
39
|
+
expect(screen.getByText('Duomenys kraunami')).toBeInTheDocument()
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('should hide label and set aria-label when showLabel is false', () => {
|
|
43
|
+
render(<RcSesLoader showLabel={false} />)
|
|
44
|
+
|
|
45
|
+
expect(screen.queryByText(getDefaultLoaderLabel())).not.toBeInTheDocument()
|
|
46
|
+
expect(screen.getByRole('status')).toHaveAttribute(
|
|
47
|
+
'aria-label',
|
|
48
|
+
getDefaultLoaderLabel(),
|
|
49
|
+
)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('should use custom label for aria-label when label is string and showLabel is false', () => {
|
|
53
|
+
render(<RcSesLoader label='Duomenys kraunami' showLabel={false} />)
|
|
54
|
+
|
|
55
|
+
expect(screen.queryByText('Duomenys kraunami')).not.toBeInTheDocument()
|
|
56
|
+
expect(screen.getByRole('status')).toHaveAttribute('aria-label', 'Duomenys kraunami')
|
|
57
|
+
})
|
|
58
|
+
})
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Stack, StackProps, Typography } from '@mui/material'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
|
|
4
|
+
import RcSesLoadingSpinner from '@/components/loaders/LoadingSpinner'
|
|
5
|
+
import RcSesPalette from '@/theme/palette'
|
|
6
|
+
|
|
7
|
+
const LOADER_SIZE_MAP = {
|
|
8
|
+
small: {
|
|
9
|
+
gap: 1,
|
|
10
|
+
spinnerSize: '24px',
|
|
11
|
+
textVariant: 'body2',
|
|
12
|
+
},
|
|
13
|
+
medium: {
|
|
14
|
+
gap: 1.5,
|
|
15
|
+
spinnerSize: '40px',
|
|
16
|
+
textVariant: 'body1',
|
|
17
|
+
},
|
|
18
|
+
large: {
|
|
19
|
+
gap: 2,
|
|
20
|
+
spinnerSize: '64px',
|
|
21
|
+
textVariant: 'body1',
|
|
22
|
+
},
|
|
23
|
+
} as const
|
|
24
|
+
|
|
25
|
+
export type RcSesLoaderSize = keyof typeof LOADER_SIZE_MAP
|
|
26
|
+
|
|
27
|
+
export interface RcSesLoaderProps extends Omit<StackProps, 'children'> {
|
|
28
|
+
label?: string
|
|
29
|
+
size?: RcSesLoaderSize
|
|
30
|
+
showLabel?: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function RcSesLoader({
|
|
34
|
+
'aria-label': ariaLabel,
|
|
35
|
+
label,
|
|
36
|
+
size = 'medium',
|
|
37
|
+
showLabel = true,
|
|
38
|
+
sx,
|
|
39
|
+
...props
|
|
40
|
+
}: RcSesLoaderProps) {
|
|
41
|
+
const { t } = useTranslation('common', { keyPrefix: 'components.Loader' })
|
|
42
|
+
const { gap, spinnerSize, textVariant } = LOADER_SIZE_MAP[size]
|
|
43
|
+
const resolvedLabel = label ?? t('loading')
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Stack
|
|
47
|
+
role='status'
|
|
48
|
+
aria-live='polite'
|
|
49
|
+
aria-label={!showLabel ? (ariaLabel ?? resolvedLabel) : ariaLabel}
|
|
50
|
+
alignItems='center'
|
|
51
|
+
gap={gap}
|
|
52
|
+
sx={[{ color: RcSesPalette.primary[700] }, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
53
|
+
{...props}
|
|
54
|
+
>
|
|
55
|
+
<RcSesLoadingSpinner color='inherit' size={spinnerSize} />
|
|
56
|
+
{showLabel && (
|
|
57
|
+
<Typography color='text.secondary' variant={textVariant}>
|
|
58
|
+
{resolvedLabel}
|
|
59
|
+
</Typography>
|
|
60
|
+
)}
|
|
61
|
+
</Stack>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default RcSesLoader
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react'
|
|
2
2
|
import { describe, expect, it } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import RcSesLoadingSpinner from './
|
|
4
|
+
import RcSesLoadingSpinner from './index'
|
|
5
5
|
|
|
6
6
|
describe('RcSesLoadingSpinner', () => {
|
|
7
7
|
it('should render a progress bar', () => {
|
|
@@ -5,8 +5,15 @@
|
|
|
5
5
|
"discard": "Discard and delete form data",
|
|
6
6
|
"submit": "Save and add to cart"
|
|
7
7
|
},
|
|
8
|
+
"Loader": {
|
|
9
|
+
"loading": "Loading..."
|
|
10
|
+
},
|
|
8
11
|
"Button": {
|
|
9
12
|
"loading": "Loading"
|
|
13
|
+
},
|
|
14
|
+
"SegmentedControl": {
|
|
15
|
+
"options": "Options",
|
|
16
|
+
"tabs": "Tabs"
|
|
10
17
|
}
|
|
11
18
|
}
|
|
12
19
|
}
|
|
@@ -5,8 +5,15 @@
|
|
|
5
5
|
"discard": "Atšaukti pildymą ir ištrinti formos duomenis",
|
|
6
6
|
"submit": "Baigti pildyti ir pridėti į krepšelį"
|
|
7
7
|
},
|
|
8
|
+
"Loader": {
|
|
9
|
+
"loading": "Kraunama..."
|
|
10
|
+
},
|
|
8
11
|
"Button": {
|
|
9
12
|
"loading": "Kraunasi"
|
|
13
|
+
},
|
|
14
|
+
"SegmentedControl": {
|
|
15
|
+
"options": "Parinktys",
|
|
16
|
+
"tabs": "Skirtukai"
|
|
10
17
|
}
|
|
11
18
|
}
|
|
12
19
|
}
|
package/src/library/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type {} from '@mui/system'
|
|
|
3
3
|
import type {} from '@mui/x-date-pickers/themeAugmentation'
|
|
4
4
|
|
|
5
5
|
import RcSesIconProps from '@/assets/IconProps'
|
|
6
|
-
import RcSesLoadingSpinner from '@/components/LoadingSpinner/LoadingSpinner'
|
|
7
6
|
import RcSesAccordion from '@/components/common/Accordion'
|
|
8
7
|
import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
|
|
9
8
|
import RcSesAlert from '@/components/common/Alert'
|
|
@@ -15,6 +14,7 @@ import DataPagination from '@/components/common/DataPagination'
|
|
|
15
14
|
import RcSesIconWithCircularBackground from '@/components/common/IconWithCircularBackground'
|
|
16
15
|
import RcSesImageCard from '@/components/common/ImageCard'
|
|
17
16
|
import ListWithIcons from '@/components/common/ListWithIcons'
|
|
17
|
+
import RcSesSegmentedControl from '@/components/common/SegmentedControl'
|
|
18
18
|
import RcSesSnackbar from '@/components/common/Snackbar'
|
|
19
19
|
import {
|
|
20
20
|
RcSesSnackbarProvider,
|
|
@@ -47,6 +47,9 @@ import RcSesCardFormContainer from '@/components/layout/ServiceFormContainer/Car
|
|
|
47
47
|
import RcSesServiceHeader from '@/components/layout/ServiceHeader'
|
|
48
48
|
import RcSesServicePage from '@/components/layout/ServicePage'
|
|
49
49
|
import ServiceWizardStepper from '@/components/layout/ServiceWizardStepper'
|
|
50
|
+
import RcSesFullPageLoader from '@/components/loaders/FullPageLoader'
|
|
51
|
+
import RcSesLoader from '@/components/loaders/Loader'
|
|
52
|
+
import RcSesLoadingSpinner from '@/components/loaders/LoadingSpinner'
|
|
50
53
|
import RcSesDialog from '@/components/overlays/Dialog'
|
|
51
54
|
import RcSesModal from '@/components/overlays/Modal'
|
|
52
55
|
import RcSesTheme from '@/theme/light'
|
|
@@ -67,6 +70,8 @@ export {
|
|
|
67
70
|
RcSesBreadcrumbs,
|
|
68
71
|
RcSesButton,
|
|
69
72
|
RcSesButtonWithPopover,
|
|
73
|
+
RcSesFullPageLoader,
|
|
74
|
+
RcSesLoader,
|
|
70
75
|
RcSesLoadingSpinner,
|
|
71
76
|
RcSesCard,
|
|
72
77
|
RcSesDialog,
|
|
@@ -76,6 +81,7 @@ export {
|
|
|
76
81
|
RcSesSnackbarProvider,
|
|
77
82
|
RcSesModal,
|
|
78
83
|
}
|
|
84
|
+
export { RcSesSegmentedControl }
|
|
79
85
|
export { RcSesCheckbox, RcSesCheckboxFormControl, RcSesSimpleCheckbox }
|
|
80
86
|
export { useSnackbar }
|
|
81
87
|
export { RcSesDatepicker }
|
package/src/library/types.ts
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RcSesLoadingSpinnerProps,
|
|
3
|
-
RcSesSpinnerColor,
|
|
4
|
-
} from '@/components/LoadingSpinner/LoadingSpinner'
|
|
5
1
|
import { RcSesCardProps } from '@/components/common/Card'
|
|
6
2
|
import { ListWithIconsProps } from '@/components/common/ListWithIcons'
|
|
7
3
|
import { ListWithIconsItemData } from '@/components/common/ListWithIcons/ListWithIcons.types'
|
|
4
|
+
import {
|
|
5
|
+
RcSesSegmentOption,
|
|
6
|
+
RcSesSegmentedControlProps,
|
|
7
|
+
} from '@/components/common/SegmentedControl'
|
|
8
|
+
import { RcSesSegmentButtonProps } from '@/components/common/SegmentedControl/components/SegmentButton'
|
|
8
9
|
import { RcSesFormControlLabelProps } from '@/components/form/inputs/FormControlLabel'
|
|
9
10
|
import { SimpleCheckboxProps } from '@/components/form/inputs/SimpleCheckbox'
|
|
10
11
|
import { RcSesCardFormContainerProps } from '@/components/layout/ServiceFormContainer/CardFormContainer'
|
|
11
12
|
import { ServiceWizardStepperProps } from '@/components/layout/ServiceWizardStepper'
|
|
13
|
+
import {
|
|
14
|
+
RcSesFullPageLoaderProps,
|
|
15
|
+
RcSesLoaderBackdrop,
|
|
16
|
+
} from '@/components/loaders/FullPageLoader'
|
|
17
|
+
import { RcSesLoaderProps, RcSesLoaderSize } from '@/components/loaders/Loader'
|
|
18
|
+
import {
|
|
19
|
+
RcSesLoadingSpinnerProps,
|
|
20
|
+
RcSesSpinnerColor,
|
|
21
|
+
} from '@/components/loaders/LoadingSpinner'
|
|
12
22
|
import { DialogSize, RcSesDialogProps } from '@/components/overlays/Dialog'
|
|
13
23
|
import { ModalVariant, RcSesModalProps } from '@/components/overlays/Modal'
|
|
14
24
|
import { ButtonProps } from '@/types/buttons/ButtonProps'
|
|
@@ -17,8 +27,15 @@ export type { ListWithIconsProps, ListWithIconsItemData }
|
|
|
17
27
|
export type { ButtonProps }
|
|
18
28
|
|
|
19
29
|
export type {
|
|
30
|
+
RcSesFullPageLoaderProps,
|
|
31
|
+
RcSesLoaderBackdrop,
|
|
32
|
+
RcSesLoaderProps,
|
|
33
|
+
RcSesLoaderSize,
|
|
20
34
|
RcSesCardFormContainerProps,
|
|
21
35
|
RcSesCardProps,
|
|
36
|
+
RcSesSegmentedControlProps,
|
|
37
|
+
RcSesSegmentButtonProps,
|
|
38
|
+
RcSesSegmentOption,
|
|
22
39
|
ServiceWizardStepperProps,
|
|
23
40
|
SimpleCheckboxProps,
|
|
24
41
|
RcSesFormControlLabelProps,
|
package/src/setupTests.ts
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
1
|
import '@testing-library/jest-dom/vitest'
|
|
2
|
+
import i18n from 'i18next'
|
|
3
|
+
import { initReactI18next } from 'react-i18next'
|
|
4
|
+
|
|
5
|
+
if (!i18n.isInitialized) {
|
|
6
|
+
i18n.use(initReactI18next).init({
|
|
7
|
+
fallbackLng: 'lt',
|
|
8
|
+
interpolation: { escapeValue: false },
|
|
9
|
+
lng: 'lt',
|
|
10
|
+
resources: {
|
|
11
|
+
lt: { translation: {} },
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
}
|