@registrucentras/rc-ses-react-components 2.0.0-rc.5 → 2.0.0-rc.7
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/TitleBlock/types.d.ts +3 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +847 -794
- package/dist/stories/{components/display → atoms}/Badge.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → atoms}/Checkbox.stories.d.ts +1 -1
- package/dist/stories/{components/icons → atoms}/IconWithCircularBackground.stories.d.ts +1 -1
- package/dist/stories/{components/icons → atoms}/IconWithSquareBackground.stories.d.ts +1 -1
- package/dist/stories/{components/icons → atoms}/Icons.stories.d.ts +1 -1
- package/dist/stories/{components/loaders → atoms}/Loader.stories.d.ts +1 -1
- package/dist/stories/{components/loaders → atoms}/LoadingSpinner.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → atoms}/NumberStepper.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → atoms}/PhoneInput.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → atoms}/SearchInput.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → atoms}/Select.stories.d.ts +1 -1
- package/dist/stories/{components/form → atoms}/SimpleCheckbox.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → atoms}/Switch.stories.d.ts +1 -1
- package/dist/stories/{components/tabs → atoms}/Tab.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → atoms}/TextField.stories.d.ts +1 -1
- package/dist/stories/{components/display → atoms}/Tooltip.stories.d.ts +1 -1
- package/dist/stories/{components/feedback → molecules}/Alert.stories.d.ts +1 -1
- package/dist/stories/{components/navigation → molecules}/Breadcrumbs.stories.d.ts +1 -1
- package/dist/stories/{components/actions → molecules}/ButtonWithPopover.stories.d.ts +1 -1
- package/dist/stories/{components/display → molecules}/Card.stories.d.ts +1 -1
- package/dist/stories/{components/display → molecules}/CardShell.stories.d.ts +2 -1
- package/dist/stories/{components/form → molecules}/CheckboxFormControl.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → molecules}/DatePicker.stories.d.ts +1 -1
- package/dist/stories/{components/form → molecules}/FormControlWrapper.stories.d.ts +1 -1
- package/dist/stories/{components/display → molecules}/ImageCard.stories.d.ts +1 -1
- package/dist/stories/{components/display → molecules}/ListWithIcons.stories.d.ts +2 -2
- package/dist/stories/{components/inputs → molecules}/PhoneInputFormControl.stories.d.ts +1 -1
- package/dist/stories/{components/overlays → molecules}/Popover.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → molecules}/RadioButtonGroup.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → molecules}/SearchableField.stories.d.ts +1 -1
- package/dist/stories/{components/display → molecules}/SegmentedControl.stories.d.ts +1 -1
- package/dist/stories/{components/feedback → molecules}/Snackbar.stories.d.ts +1 -1
- package/dist/stories/{components/tabs → molecules}/TabPanel.stories.d.ts +1 -1
- package/dist/stories/{components/tabs → molecules}/Tabs.stories.d.ts +1 -1
- package/dist/stories/{components/tabs → molecules}/TabsWrapper.stories.d.ts +1 -1
- package/dist/stories/{components/display → molecules}/TitleBlock.stories.d.ts +3 -1
- package/dist/stories/{components/navigation → organisms}/Accordion.stories.d.ts +1 -1
- package/dist/stories/{components/display → organisms}/AdvancedList.stories.d.ts +1 -1
- package/dist/stories/{components/display → organisms}/AdvancedListItem.stories.d.ts +1 -1
- package/dist/stories/{components/form → organisms}/CardFormContainer.stories.d.ts +1 -1
- package/dist/stories/{components/navigation → organisms}/DataPagination.stories.d.ts +1 -1
- package/dist/stories/{components/overlays → organisms}/Dialog.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → organisms}/FileDropzone.stories.d.ts +1 -1
- package/dist/stories/{components/inputs → organisms}/FileUpload.stories.d.ts +1 -1
- package/dist/stories/{components/layout → organisms}/Footer.stories.d.ts +1 -1
- package/dist/stories/{components/loaders → organisms}/FullPageLoader.stories.d.ts +1 -1
- package/dist/stories/{components/overlays → organisms}/Modal.stories.d.ts +1 -1
- package/dist/stories/{components/display → organisms}/SelectableCardList.stories.d.ts +1 -1
- package/dist/stories/{components/form → organisms}/ServiceFormActions.stories.d.ts +1 -1
- package/dist/stories/{components/form → organisms}/ServiceFormContainer.stories.d.ts +1 -1
- package/dist/stories/{components/layout → organisms}/ServiceHeader.stories.d.ts +1 -1
- package/dist/stories/{components/display → organisms}/ServiceLinks.stories.d.ts +1 -1
- package/dist/stories/{components/navigation → organisms}/ServiceWizardStepper.stories.d.ts +1 -1
- package/dist/stories/{components/navigation → organisms}/SideNav.stories.d.ts +1 -1
- package/dist/stories/{components/layout → templates}/ServicePage.stories.d.ts +1 -1
- package/dist/theme/cards.d.ts +4 -0
- package/package.json +1 -1
- package/src/components/common/CardShell/CardFooter/index.tsx +10 -1
- package/src/components/common/CardShell/index.tsx +31 -7
- package/src/components/common/TitleBlock/index.test.tsx +33 -0
- package/src/components/common/TitleBlock/index.tsx +24 -4
- package/src/components/common/TitleBlock/types.ts +3 -1
- package/src/stories/Welcome.mdx +25 -2
- package/src/stories/{components/display → atoms}/Badge.stories.tsx +1 -1
- package/src/stories/{components/actions → atoms}/Button.stories.tsx +1 -1
- package/src/stories/{components/inputs → atoms}/Checkbox.stories.tsx +1 -1
- package/src/stories/{components/icons → atoms}/IconWithCircularBackground.stories.tsx +1 -1
- package/src/stories/{components/icons → atoms}/IconWithSquareBackground.stories.tsx +1 -1
- package/src/stories/{components/icons → atoms}/Icons.stories.tsx +1 -1
- package/src/stories/{components/loaders → atoms}/Loader.stories.tsx +1 -1
- package/src/stories/{components/loaders → atoms}/LoadingSpinner.stories.tsx +1 -1
- package/src/stories/{assets → atoms}/Logo.stories.tsx +1 -1
- package/src/stories/{components/inputs → atoms}/NumberStepper.stories.tsx +1 -1
- package/src/stories/{components/inputs → atoms}/PhoneInput.stories.tsx +1 -1
- package/src/stories/{components/inputs → atoms}/SearchInput.stories.tsx +1 -1
- package/src/stories/{components/inputs → atoms}/Select.stories.tsx +1 -1
- package/src/stories/{components/form → atoms}/SimpleCheckbox.stories.tsx +1 -1
- package/src/stories/{components/inputs → atoms}/Switch.stories.tsx +1 -1
- package/src/stories/{components/tabs → atoms}/Tab.stories.tsx +1 -1
- package/src/stories/{components/inputs → atoms}/TextField.stories.tsx +1 -1
- package/src/stories/{components/display → atoms}/Tooltip.stories.tsx +2 -2
- package/src/stories/{theme → foundations}/ThemedMuiComponents.stories.tsx +1 -1
- package/src/stories/{components/feedback → molecules}/Alert.stories.tsx +1 -1
- package/src/stories/{components/navigation → molecules}/Breadcrumbs.stories.tsx +1 -1
- package/src/stories/{components/actions → molecules}/ButtonWithPopover.stories.tsx +1 -1
- package/src/stories/{components/display → molecules}/Card.stories.tsx +1 -1
- package/src/stories/{components/display → molecules}/CardShell.stories.tsx +20 -1
- package/src/stories/{components/form → molecules}/CheckboxFormControl.stories.tsx +1 -1
- package/src/stories/{components/inputs → molecules}/DatePicker.stories.tsx +1 -1
- package/src/stories/{components/form → molecules}/FormControlWrapper.stories.tsx +1 -1
- package/src/stories/{components/display → molecules}/ImageCard.stories.tsx +1 -1
- package/src/stories/{components/display → molecules}/ListWithIcons.stories.tsx +1 -1
- package/src/stories/{components/inputs → molecules}/PhoneInputFormControl.stories.tsx +1 -1
- package/src/stories/{components/overlays → molecules}/Popover.stories.tsx +1 -1
- package/src/stories/{components/inputs → molecules}/RadioButtonGroup.stories.tsx +1 -1
- package/src/stories/{components/inputs → molecules}/SearchableField.stories.tsx +1 -1
- package/src/stories/{components/display → molecules}/SegmentedControl.stories.tsx +2 -2
- package/src/stories/{components/feedback → molecules}/Snackbar.stories.tsx +1 -1
- package/src/stories/{components/tabs → molecules}/TabPanel.stories.tsx +1 -1
- package/src/stories/{components/tabs → molecules}/Tabs.stories.tsx +1 -1
- package/src/stories/{components/tabs → molecules}/TabsWrapper.stories.tsx +1 -1
- package/src/stories/{components/display → molecules}/TitleBlock.stories.tsx +90 -1
- package/src/stories/{components/navigation → organisms}/Accordion.stories.tsx +1 -1
- package/src/stories/{components/display → organisms}/AdvancedList.stories.tsx +1 -1
- package/src/stories/{components/display → organisms}/AdvancedListItem.stories.tsx +1 -1
- package/src/stories/{components/form → organisms}/CardFormContainer.stories.tsx +1 -1
- package/src/stories/{components/navigation → organisms}/DataPagination.stories.tsx +1 -1
- package/src/stories/{components/overlays → organisms}/Dialog.stories.tsx +1 -1
- package/src/stories/{components/inputs → organisms}/FileDropzone.stories.tsx +1 -1
- package/src/stories/{components/inputs → organisms}/FileUpload.stories.tsx +1 -1
- package/src/stories/{components/layout → organisms}/Footer.stories.tsx +1 -1
- package/src/stories/{components/loaders → organisms}/FullPageLoader.stories.tsx +1 -1
- package/src/stories/{components/overlays → organisms}/Modal.stories.tsx +1 -1
- package/src/stories/{components/display → organisms}/SelectableCardList.stories.tsx +1 -1
- package/src/stories/{components/form → organisms}/ServiceFormActions.stories.tsx +1 -1
- package/src/stories/{components/form → organisms}/ServiceFormContainer.stories.tsx +1 -1
- package/src/stories/{components/layout → organisms}/ServiceHeader.stories.tsx +1 -1
- package/src/stories/{components/display → organisms}/ServiceLinks.stories.tsx +1 -1
- package/src/stories/{components/navigation → organisms}/ServiceWizardStepper.stories.tsx +3 -3
- package/src/stories/{components/navigation → organisms}/SideNav.stories.tsx +1 -1
- package/src/stories/{components/layout → templates}/ServicePage.stories.tsx +1 -1
- package/src/theme/cards.ts +2 -0
- package/src/stories/components/display/Card.test.tsx +0 -19
- /package/dist/stories/{components/actions → atoms}/Button.stories.d.ts +0 -0
- /package/dist/stories/{assets → atoms}/Logo.stories.d.ts +0 -0
- /package/dist/stories/{theme → foundations}/ThemedMuiComponents.stories.d.ts +0 -0
- /package/src/stories/{components/actions → atoms}/Button.test.ts +0 -0
- /package/src/stories/{Colors.mdx → foundations/Colors.mdx} +0 -0
|
@@ -12,7 +12,7 @@ import RcSesTitleBlock from '@/components/common/TitleBlock'
|
|
|
12
12
|
import palette from '@/theme/palette'
|
|
13
13
|
|
|
14
14
|
const meta: Meta<typeof RcSesTitleBlock> = {
|
|
15
|
-
title: '
|
|
15
|
+
title: 'Molecules/TitleBlock',
|
|
16
16
|
component: RcSesTitleBlock,
|
|
17
17
|
tags: ['autodocs'],
|
|
18
18
|
parameters: {
|
|
@@ -427,6 +427,73 @@ export const VerticalTitleBlock: Story = {
|
|
|
427
427
|
),
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
+
// Card title as running body copy: `titleVariant` moves the type scale only,
|
|
431
|
+
// `headingLevel` keeps the heading.
|
|
432
|
+
export const BodyScaleTitleInCard: Story = {
|
|
433
|
+
render: () => {
|
|
434
|
+
const services = [
|
|
435
|
+
{
|
|
436
|
+
id: 'body-scale-title-a',
|
|
437
|
+
title:
|
|
438
|
+
'Pažymos apie asmens duomenis Gyventojų registre užsakymas. Labai ilgas tekstas, skirtas testavimui.',
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
id: 'body-scale-title-b',
|
|
442
|
+
title: 'Nekilnojamojo turto registro išrašo užsakymas',
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
id: 'body-scale-title-c',
|
|
446
|
+
title: 'Pažymos santuokai sudaryti užsienyje užsakymas',
|
|
447
|
+
},
|
|
448
|
+
]
|
|
449
|
+
|
|
450
|
+
return (
|
|
451
|
+
<Box
|
|
452
|
+
sx={{
|
|
453
|
+
display: 'grid',
|
|
454
|
+
gap: 2,
|
|
455
|
+
gridTemplateColumns: { xs: '1fr', md: 'repeat(3, 1fr)' },
|
|
456
|
+
}}
|
|
457
|
+
>
|
|
458
|
+
{services.map((service) => (
|
|
459
|
+
<RcSesCardShell
|
|
460
|
+
key={service.id}
|
|
461
|
+
variant='card'
|
|
462
|
+
theme='brand'
|
|
463
|
+
fullHeight
|
|
464
|
+
header={
|
|
465
|
+
<RcSesTitleBlock
|
|
466
|
+
headingId={service.id}
|
|
467
|
+
headingLevel={3}
|
|
468
|
+
title={service.title}
|
|
469
|
+
titleVariant='body1'
|
|
470
|
+
titleTone='brand'
|
|
471
|
+
/>
|
|
472
|
+
}
|
|
473
|
+
footer={
|
|
474
|
+
<RcSesCardFooter align='start'>
|
|
475
|
+
<RcSesButton
|
|
476
|
+
id={`${service.id}-order`}
|
|
477
|
+
aria-labelledby={`${service.id}-order ${service.id}`}
|
|
478
|
+
>
|
|
479
|
+
Užsakyti
|
|
480
|
+
</RcSesButton>
|
|
481
|
+
<RcSesButton
|
|
482
|
+
variant='link'
|
|
483
|
+
id={`${service.id}-more`}
|
|
484
|
+
aria-labelledby={`${service.id}-more ${service.id}`}
|
|
485
|
+
>
|
|
486
|
+
Plačiau
|
|
487
|
+
</RcSesButton>
|
|
488
|
+
</RcSesCardFooter>
|
|
489
|
+
}
|
|
490
|
+
/>
|
|
491
|
+
))}
|
|
492
|
+
</Box>
|
|
493
|
+
)
|
|
494
|
+
},
|
|
495
|
+
}
|
|
496
|
+
|
|
430
497
|
// Responsive baselines for SAV-6509 / SAV-6480 DoD ("Responsive patikra 375 /
|
|
431
498
|
// 768 / 1440"). Exercises the mobile stacking of the actions slot
|
|
432
499
|
// (direction={{ xs: 'column', sm: 'row' }}) so both the two-action and
|
|
@@ -504,3 +571,25 @@ export const TabletViewport: Story = {
|
|
|
504
571
|
tags: ['viewport-768', '!autodocs'],
|
|
505
572
|
globals: { viewport: { value: 'tablet768' } },
|
|
506
573
|
}
|
|
574
|
+
|
|
575
|
+
// Pins the vertical-orientation mobile treatment (compressed
|
|
576
|
+
// title, left-aligned link footer inside CardShell) so any regression in the
|
|
577
|
+
// responsive gap/breakpoint stack shows up in the visual diff.
|
|
578
|
+
export const VerticalMobileViewport: Story = {
|
|
579
|
+
render: () => (
|
|
580
|
+
<RcSesCardShell
|
|
581
|
+
variant='card'
|
|
582
|
+
theme='default'
|
|
583
|
+
footer={<FooterLink label='Peržiūrėti DUK' href='#' />}
|
|
584
|
+
>
|
|
585
|
+
<RcSesTitleBlock
|
|
586
|
+
orientation='vertical'
|
|
587
|
+
title='DUK'
|
|
588
|
+
description='Atsakymai į dažniausiai užduodamus klausimus apie paslaugas ir savitarną.'
|
|
589
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
590
|
+
/>
|
|
591
|
+
</RcSesCardShell>
|
|
592
|
+
),
|
|
593
|
+
tags: ['viewport-375', '!autodocs'],
|
|
594
|
+
globals: { viewport: { value: 'mobile375' } },
|
|
595
|
+
}
|
|
@@ -6,7 +6,7 @@ import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/
|
|
|
6
6
|
import FieldView from '@/components/storybook/FieldView'
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof RcSesAccordion> = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Organisms/Accordion',
|
|
10
10
|
component: RcSesAccordion,
|
|
11
11
|
argTypes: {
|
|
12
12
|
disabled: {
|
|
@@ -17,7 +17,7 @@ import UserIcon from '@/assets/icons/UserIcon'
|
|
|
17
17
|
import AdvancedListItem from '@/components/common/AdvancedList/components/AdvancedListItem'
|
|
18
18
|
|
|
19
19
|
const meta = {
|
|
20
|
-
title: '
|
|
20
|
+
title: 'Organisms/AdvancedListItem',
|
|
21
21
|
component: AdvancedListItem,
|
|
22
22
|
tags: ['autodocs'],
|
|
23
23
|
args: {
|
|
@@ -5,7 +5,7 @@ import { useState } from 'react'
|
|
|
5
5
|
import DataPagination from '@/components/common/DataPagination'
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Organisms/DataPagination',
|
|
9
9
|
component: DataPagination,
|
|
10
10
|
tags: ['autodocs'],
|
|
11
11
|
args: {
|
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
|
3
3
|
import RcSesFooter from '@/components/layout/Footer'
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof RcSesFooter> = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Organisms/Footer',
|
|
7
7
|
component: RcSesFooter,
|
|
8
8
|
tags: ['autodocs'],
|
|
9
9
|
}
|
|
@@ -4,7 +4,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
|
4
4
|
import RcSesFullPageLoader from '@/components/loaders/FullPageLoader'
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Organisms/FullPageLoader',
|
|
8
8
|
component: RcSesFullPageLoader,
|
|
9
9
|
tags: ['autodocs'],
|
|
10
10
|
parameters: {
|
|
@@ -5,7 +5,7 @@ import FieldView from '@/components/storybook/FieldView'
|
|
|
5
5
|
import Fields from '@/components/storybook/Fields'
|
|
6
6
|
|
|
7
7
|
const meta: Meta<typeof RcSesServiceFormActions> = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Organisms/ServiceFormActions',
|
|
9
9
|
component: RcSesServiceFormActions,
|
|
10
10
|
tags: ['autodocs'],
|
|
11
11
|
}
|
|
@@ -9,7 +9,7 @@ import Fields from '@/components/storybook/Fields'
|
|
|
9
9
|
import BasicInformationForm from '@/examples/MultipleStepForm/components/BasicInformationForm'
|
|
10
10
|
|
|
11
11
|
const meta: Meta<typeof RcSesServiceFormContainer> = {
|
|
12
|
-
title: '
|
|
12
|
+
title: 'Organisms/ServiceFormContainer',
|
|
13
13
|
component: RcSesServiceFormContainer,
|
|
14
14
|
argTypes: {
|
|
15
15
|
accordionController: {
|
|
@@ -6,7 +6,7 @@ import RcSesServiceHeader from '@/components/layout/ServiceHeader'
|
|
|
6
6
|
import { common, grey } from '@/theme/palette'
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof RcSesServiceHeader> = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Organisms/ServiceHeader',
|
|
10
10
|
component: RcSesServiceHeader,
|
|
11
11
|
tags: ['autodocs'],
|
|
12
12
|
argTypes: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
2
|
import { useState } from 'react'
|
|
3
3
|
|
|
4
|
-
import ServiceWizardStepper from '
|
|
5
|
-
import { StepItem } from '
|
|
4
|
+
import ServiceWizardStepper from '@/components/layout/ServiceWizardStepper'
|
|
5
|
+
import { StepItem } from '@/components/layout/ServiceWizardStepper/StepperTypes'
|
|
6
6
|
|
|
7
7
|
const steps: StepItem[] = [
|
|
8
8
|
{ id: '1', title: 'Step 1' },
|
|
@@ -11,7 +11,7 @@ const steps: StepItem[] = [
|
|
|
11
11
|
]
|
|
12
12
|
|
|
13
13
|
const meta: Meta<typeof ServiceWizardStepper> = {
|
|
14
|
-
title: '
|
|
14
|
+
title: 'Organisms/ServiceWizardStepper',
|
|
15
15
|
component: ServiceWizardStepper,
|
|
16
16
|
tags: ['autodocs'],
|
|
17
17
|
argTypes: {
|
|
@@ -4,7 +4,7 @@ import { Meta, StoryObj } from '@storybook/react-vite'
|
|
|
4
4
|
import RcSesServicePage from '@/components/layout/ServicePage'
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof RcSesServicePage> = {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Templates/ServicePage',
|
|
8
8
|
component: RcSesServicePage,
|
|
9
9
|
tags: ['autodocs'],
|
|
10
10
|
}
|
package/src/theme/cards.ts
CHANGED
|
@@ -12,12 +12,14 @@ const borderWidth = '1px'
|
|
|
12
12
|
const card = {
|
|
13
13
|
borderRadius: '0.75rem',
|
|
14
14
|
gap: { xs: '1rem', md: '1.5rem' },
|
|
15
|
+
footerGap: '0.5rem',
|
|
15
16
|
padding: { xs: '1.25rem 1.5rem', md: '1.5rem 2rem' },
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
const subcard = {
|
|
19
20
|
borderRadius: '0.5rem',
|
|
20
21
|
gap: { xs: '0.75rem', md: '1rem' },
|
|
22
|
+
footerGap: '0.5rem',
|
|
21
23
|
padding: { xs: '1rem', md: '1.25rem 1.5rem' },
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider } from '@mui/material/styles'
|
|
2
|
-
import { composeStories } from '@storybook/react'
|
|
3
|
-
import '@testing-library/jest-dom'
|
|
4
|
-
import { render, screen } from '@testing-library/react'
|
|
5
|
-
|
|
6
|
-
import theme from '@/theme/light'
|
|
7
|
-
|
|
8
|
-
import * as stories from './Card.stories'
|
|
9
|
-
|
|
10
|
-
const { Main } = composeStories(stories)
|
|
11
|
-
|
|
12
|
-
test('reuses args from composed card story', () => {
|
|
13
|
-
render(<ThemeProvider theme={theme}>{Main()}</ThemeProvider>)
|
|
14
|
-
|
|
15
|
-
expect(screen.getByText(Main.args.title as string)).toBeInTheDocument()
|
|
16
|
-
expect(screen.getByText(Main.args.description as string)).toBeInTheDocument()
|
|
17
|
-
expect(screen.getByText('Vidinis paslaugu front-end sprendimas')).toBeInTheDocument()
|
|
18
|
-
expect(screen.getAllByRole('button', { name: 'Button' })).toHaveLength(3)
|
|
19
|
-
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|