@registrucentras/rc-ses-react-components 2.0.0-rc.7 → 2.0.0-rc.8

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 (199) hide show
  1. package/dist/components/common/Accordion/hooks/useAccordionController.d.ts +2 -2
  2. package/dist/components/common/Accordion/types/AccordionControllerState.d.ts +2 -2
  3. package/dist/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.d.ts +2 -2
  4. package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.d.ts +2 -2
  5. package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.d.ts +2 -2
  6. package/dist/components/common/Badge/index.d.ts +2 -2
  7. package/dist/components/common/Breadcrumbs/index.d.ts +4 -4
  8. package/dist/components/common/Card/index.d.ts +2 -2
  9. package/dist/components/common/CardShell/CardFooter/index.d.ts +1 -1
  10. package/dist/components/common/CardShell/CardFooter/types.d.ts +4 -9
  11. package/dist/components/common/CardShell/types.d.ts +4 -4
  12. package/dist/components/common/IconWithCircularBackground.d.ts +2 -2
  13. package/dist/components/common/IconWithSquareBackground/index.d.ts +2 -2
  14. package/dist/components/common/ImageCard/index.d.ts +2 -2
  15. package/dist/components/common/SelectableCardList/components/SelectableCardListItem.d.ts +2 -2
  16. package/dist/components/common/SelectableCardList/index.d.ts +2 -2
  17. package/dist/components/common/ServiceLinks/types.d.ts +6 -6
  18. package/dist/components/common/SideNav/SideNav.types.d.ts +7 -5
  19. package/dist/components/common/SideNav/SideNavLayout.d.ts +1 -1
  20. package/dist/components/common/SideNav/components/SideNavPill.d.ts +2 -2
  21. package/dist/components/common/SideNav/components/SideNavPillList.d.ts +2 -2
  22. package/dist/components/common/SideNav/components/SideNavRow.d.ts +4 -3
  23. package/dist/components/common/SideNav/hooks/useKeepActiveItemInView.d.ts +19 -0
  24. package/dist/components/common/SideNav/hooks/useSideNavScrollSpy.d.ts +2 -2
  25. package/dist/components/common/SideNav/index.d.ts +2 -2
  26. package/dist/components/common/Tabs/TabPanel.d.ts +2 -2
  27. package/dist/components/common/Tabs/TabsWrapper.d.ts +2 -2
  28. package/dist/components/common/TitleBlock/types.d.ts +4 -4
  29. package/dist/components/form/components/FormControlWrapper/components/FieldSuffix.d.ts +2 -2
  30. package/dist/components/form/components/FormControlWrapper/index.d.ts +2 -2
  31. package/dist/components/form/inputs/RadioButtonGroup.d.ts +3 -3
  32. package/dist/components/form/inputs/SearchableField.d.ts +2 -2
  33. package/dist/components/form/inputs/Select/Select.types.d.ts +2 -2
  34. package/dist/components/layout/Footer/index.d.ts +2 -2
  35. package/dist/components/layout/ServiceFormActions.d.ts +2 -2
  36. package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.d.ts +2 -2
  37. package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/index.d.ts +2 -2
  38. package/dist/components/layout/ServiceHeader.d.ts +2 -2
  39. package/dist/components/layout/ServicePage.d.ts +2 -2
  40. package/dist/components/utils/normalizeSx.d.ts +1 -1
  41. package/dist/library/types.d.ts +2 -2
  42. package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
  43. package/dist/registrucentras-rc-ses-react-components.js +1631 -1589
  44. package/dist/types/assets/IconProps.d.ts +2 -2
  45. package/dist/types/cards/CardServiceProps.d.ts +2 -2
  46. package/dist/types/common/QuickLinkType.d.ts +2 -2
  47. package/dist/types/inputs/InputIconProps.d.ts +2 -2
  48. package/dist/types/lists/ListNewsItemType.d.ts +2 -2
  49. package/dist/types/lists/ListServicesItemType.d.ts +3 -3
  50. package/package.json +2 -1
  51. package/src/components/common/Accordion/hooks/useAccordionController.tsx +1 -1
  52. package/src/components/common/Accordion/index.tsx +1 -4
  53. package/src/components/common/Accordion/types/AccordionControllerState.ts +1 -1
  54. package/src/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.ts +1 -1
  55. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +1 -1
  56. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +1 -1
  57. package/src/components/common/AdvancedList/components/AdvancedListItem/index.test.tsx +2 -2
  58. package/src/components/common/Badge/index.tsx +3 -3
  59. package/src/components/common/Breadcrumbs/index.tsx +5 -2
  60. package/src/components/common/Card/index.tsx +1 -1
  61. package/src/components/common/CardShell/CardFooter/index.tsx +6 -13
  62. package/src/components/common/CardShell/CardFooter/types.ts +2 -7
  63. package/src/components/common/CardShell/types.ts +2 -2
  64. package/src/components/common/IconWithCircularBackground.tsx +7 -8
  65. package/src/components/common/IconWithSquareBackground/index.tsx +7 -8
  66. package/src/components/common/ImageCard/index.tsx +1 -1
  67. package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +18 -19
  68. package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +1 -1
  69. package/src/components/common/SelectableCardList/index.tsx +1 -1
  70. package/src/components/common/ServiceLinks/types.ts +3 -3
  71. package/src/components/common/SideNav/SideNav.types.ts +11 -3
  72. package/src/components/common/SideNav/SideNavLayout.tsx +3 -0
  73. package/src/components/common/SideNav/components/SideNavPill.tsx +1 -1
  74. package/src/components/common/SideNav/components/SideNavPillList.tsx +8 -23
  75. package/src/components/common/SideNav/components/SideNavRow.tsx +6 -2
  76. package/src/components/common/SideNav/hooks/useKeepActiveItemInView.test.ts +258 -0
  77. package/src/components/common/SideNav/hooks/useKeepActiveItemInView.ts +80 -0
  78. package/src/components/common/SideNav/hooks/useSideNavScrollSpy.test.ts +9 -2
  79. package/src/components/common/SideNav/hooks/useSideNavScrollSpy.ts +4 -3
  80. package/src/components/common/SideNav/index.test.tsx +51 -0
  81. package/src/components/common/SideNav/index.tsx +47 -12
  82. package/src/components/common/Snackbar/index.test.tsx +40 -0
  83. package/src/components/common/Snackbar/index.tsx +9 -3
  84. package/src/components/common/Tabs/TabPanel.tsx +1 -1
  85. package/src/components/common/Tabs/TabsWrapper.tsx +1 -1
  86. package/src/components/common/TitleBlock/index.test.tsx +9 -7
  87. package/src/components/common/TitleBlock/index.tsx +13 -9
  88. package/src/components/common/TitleBlock/types.ts +2 -2
  89. package/src/components/form/components/FormControlWrapper/components/FieldSuffix.tsx +1 -1
  90. package/src/components/form/components/FormControlWrapper/index.tsx +1 -1
  91. package/src/components/form/inputs/Datepicker/index.test.tsx +1 -1
  92. package/src/components/form/inputs/FileDropzone.tsx +1 -4
  93. package/src/components/form/inputs/NumberStepper.test.tsx +83 -0
  94. package/src/components/form/inputs/NumberStepper.tsx +7 -8
  95. package/src/components/form/inputs/RadioButtonGroup.test.tsx +1 -1
  96. package/src/components/form/inputs/RadioButtonGroup.tsx +2 -2
  97. package/src/components/form/inputs/SearchInput/index.tsx +1 -1
  98. package/src/components/form/inputs/SearchableField.test.tsx +2 -2
  99. package/src/components/form/inputs/SearchableField.tsx +1 -1
  100. package/src/components/form/inputs/Select/Select.types.ts +1 -1
  101. package/src/components/form/inputs/Select/index.test.tsx +3 -3
  102. package/src/components/layout/Footer/index.tsx +1 -1
  103. package/src/components/layout/ServiceFormActions.tsx +1 -1
  104. package/src/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.tsx +1 -1
  105. package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +1 -1
  106. package/src/components/layout/ServiceHeader.tsx +1 -1
  107. package/src/components/layout/ServicePage.tsx +1 -1
  108. package/src/components/utils/normalizeSx.ts +2 -4
  109. package/src/examples/ListWithPagination/index.tsx +0 -2
  110. package/src/examples/MultipleStepForm/components/AdditionalServicesForm.tsx +1 -1
  111. package/src/examples/MultipleStepForm/components/ServiceIssuanceForm.tsx +1 -1
  112. package/src/examples/MultipleStepForm/components/TermsAndConditionsForm.tsx +1 -1
  113. package/src/examples/MultipleStepForm/types/MultiStepFormModel.ts +1 -1
  114. package/src/examples/SingleStepForm/components/ObjectIdentifierSearchModal.tsx +2 -2
  115. package/src/examples/SingleStepForm/types/SingleStepFormModel.ts +1 -1
  116. package/src/library/types.ts +2 -1
  117. package/src/stories/atoms/Button.stories.tsx +9 -14
  118. package/src/stories/atoms/Checkbox.stories.tsx +1 -1
  119. package/src/stories/atoms/Icons.stories.tsx +1 -1
  120. package/src/stories/atoms/NumberStepper.stories.tsx +1 -1
  121. package/src/stories/atoms/PhoneInput.stories.tsx +1 -1
  122. package/src/stories/atoms/Select.stories.tsx +7 -9
  123. package/src/stories/atoms/Switch.stories.tsx +1 -1
  124. package/src/stories/molecules/Alert.stories.tsx +2 -2
  125. package/src/stories/molecules/CardShell.stories.tsx +4 -4
  126. package/src/stories/molecules/CheckboxFormControl.stories.tsx +13 -21
  127. package/src/stories/molecules/RadioButtonGroup.stories.tsx +1 -1
  128. package/src/stories/molecules/Snackbar.stories.tsx +2 -2
  129. package/src/stories/molecules/TitleBlock.stories.tsx +40 -1
  130. package/src/stories/organisms/AdvancedList.stories.tsx +4 -4
  131. package/src/stories/organisms/FileDropzone.stories.tsx +1 -1
  132. package/src/stories/organisms/FileUpload.stories.tsx +1 -1
  133. package/src/stories/organisms/SideNav.stories.tsx +36 -3
  134. package/src/stubs/Component.tsx +4 -4
  135. package/src/types/assets/IconProps.tsx +1 -1
  136. package/src/types/cards/CardServiceProps.tsx +1 -1
  137. package/src/types/common/QuickLinkType.tsx +1 -1
  138. package/src/types/inputs/InputIconProps.tsx +1 -1
  139. package/src/types/lists/ListNewsItemType.tsx +1 -1
  140. package/src/types/lists/ListServicesItemType.tsx +2 -2
  141. package/src/vite-env.d.ts +2 -2
  142. package/dist/stories/atoms/Badge.stories.d.ts +0 -9
  143. package/dist/stories/atoms/Button.stories.d.ts +0 -107
  144. package/dist/stories/atoms/Checkbox.stories.d.ts +0 -21
  145. package/dist/stories/atoms/IconWithCircularBackground.stories.d.ts +0 -6
  146. package/dist/stories/atoms/IconWithSquareBackground.stories.d.ts +0 -7
  147. package/dist/stories/atoms/Icons.stories.d.ts +0 -7
  148. package/dist/stories/atoms/Loader.stories.d.ts +0 -36
  149. package/dist/stories/atoms/LoadingSpinner.stories.d.ts +0 -62
  150. package/dist/stories/atoms/Logo.stories.d.ts +0 -12
  151. package/dist/stories/atoms/NumberStepper.stories.d.ts +0 -6
  152. package/dist/stories/atoms/PhoneInput.stories.d.ts +0 -10
  153. package/dist/stories/atoms/SearchInput.stories.d.ts +0 -11
  154. package/dist/stories/atoms/Select.stories.d.ts +0 -7
  155. package/dist/stories/atoms/SimpleCheckbox.stories.d.ts +0 -19
  156. package/dist/stories/atoms/Switch.stories.d.ts +0 -17
  157. package/dist/stories/atoms/Tab.stories.d.ts +0 -8
  158. package/dist/stories/atoms/TextField.stories.d.ts +0 -6
  159. package/dist/stories/atoms/Tooltip.stories.d.ts +0 -48
  160. package/dist/stories/foundations/ThemedMuiComponents.stories.d.ts +0 -25
  161. package/dist/stories/molecules/Alert.stories.d.ts +0 -14
  162. package/dist/stories/molecules/Breadcrumbs.stories.d.ts +0 -6
  163. package/dist/stories/molecules/ButtonWithPopover.stories.d.ts +0 -7
  164. package/dist/stories/molecules/Card.stories.d.ts +0 -8
  165. package/dist/stories/molecules/CardShell.stories.d.ts +0 -18
  166. package/dist/stories/molecules/CheckboxFormControl.stories.d.ts +0 -9
  167. package/dist/stories/molecules/DatePicker.stories.d.ts +0 -152
  168. package/dist/stories/molecules/FormControlWrapper.stories.d.ts +0 -7
  169. package/dist/stories/molecules/ImageCard.stories.d.ts +0 -8
  170. package/dist/stories/molecules/ListWithIcons.stories.d.ts +0 -34
  171. package/dist/stories/molecules/PhoneInputFormControl.stories.d.ts +0 -6
  172. package/dist/stories/molecules/Popover.stories.d.ts +0 -12
  173. package/dist/stories/molecules/RadioButtonGroup.stories.d.ts +0 -6
  174. package/dist/stories/molecules/SearchableField.stories.d.ts +0 -6
  175. package/dist/stories/molecules/SegmentedControl.stories.d.ts +0 -202
  176. package/dist/stories/molecules/Snackbar.stories.d.ts +0 -143
  177. package/dist/stories/molecules/TabPanel.stories.d.ts +0 -7
  178. package/dist/stories/molecules/Tabs.stories.d.ts +0 -7
  179. package/dist/stories/molecules/TabsWrapper.stories.d.ts +0 -6
  180. package/dist/stories/molecules/TitleBlock.stories.d.ts +0 -22
  181. package/dist/stories/organisms/Accordion.stories.d.ts +0 -18
  182. package/dist/stories/organisms/AdvancedList.stories.d.ts +0 -33
  183. package/dist/stories/organisms/AdvancedListItem.stories.d.ts +0 -33
  184. package/dist/stories/organisms/CardFormContainer.stories.d.ts +0 -7
  185. package/dist/stories/organisms/DataPagination.stories.d.ts +0 -47
  186. package/dist/stories/organisms/Dialog.stories.d.ts +0 -15
  187. package/dist/stories/organisms/FileDropzone.stories.d.ts +0 -6
  188. package/dist/stories/organisms/FileUpload.stories.d.ts +0 -18
  189. package/dist/stories/organisms/Footer.stories.d.ts +0 -6
  190. package/dist/stories/organisms/FullPageLoader.stories.d.ts +0 -37
  191. package/dist/stories/organisms/Modal.stories.d.ts +0 -10
  192. package/dist/stories/organisms/SelectableCardList.stories.d.ts +0 -37
  193. package/dist/stories/organisms/ServiceFormActions.stories.d.ts +0 -6
  194. package/dist/stories/organisms/ServiceFormContainer.stories.d.ts +0 -15
  195. package/dist/stories/organisms/ServiceHeader.stories.d.ts +0 -7
  196. package/dist/stories/organisms/ServiceLinks.stories.d.ts +0 -28
  197. package/dist/stories/organisms/ServiceWizardStepper.stories.d.ts +0 -7
  198. package/dist/stories/organisms/SideNav.stories.d.ts +0 -7
  199. package/dist/stories/templates/ServicePage.stories.d.ts +0 -6
@@ -237,7 +237,7 @@ export const Main: Story = {
237
237
  },
238
238
  }
239
239
 
240
- type VariantsFormModel = {
240
+ interface VariantsFormModel {
241
241
  singleSelect: string | null
242
242
  groupedSelect: string | null
243
243
  singleSearchSelect: string | null
@@ -266,14 +266,12 @@ const variantOptions = [
266
266
  },
267
267
  ]
268
268
 
269
- const groupedVariantOptions: Array<
270
- {
271
- group: string
272
- } & {
273
- value: string
274
- label: string
275
- }
276
- > = [
269
+ const groupedVariantOptions: ({
270
+ group: string
271
+ } & {
272
+ value: string
273
+ label: string
274
+ })[] = [
277
275
  { value: 'group-1-option-1', label: '1st option', group: 'GROUP 1' },
278
276
  { value: 'group-1-option-2', label: '2st option', group: 'GROUP 1' },
279
277
  { value: 'group-1-option-3', label: '3rd option', group: 'GROUP 1' },
@@ -15,7 +15,7 @@ const meta = {
15
15
  export default meta
16
16
  type Story = StoryObj<typeof meta>
17
17
 
18
- type ControlledDemoProps = {
18
+ interface ControlledDemoProps {
19
19
  initialChecked?: boolean
20
20
  disabled?: boolean
21
21
  label?: string
@@ -11,7 +11,7 @@ import PreviewTitle from '@/components/storybook/PreviewTitle'
11
11
  const lorem =
12
12
  "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard."
13
13
 
14
- const severities: Array<'grey' | 'info' | 'success' | 'warning' | 'error'> = [
14
+ const severities: ('grey' | 'info' | 'success' | 'warning' | 'error')[] = [
15
15
  'grey',
16
16
  'info',
17
17
  'success',
@@ -180,7 +180,7 @@ export const Toggles: Story = {
180
180
 
181
181
  function DismissibleTemplate() {
182
182
  const [visibleSeverities, setVisibleSeverities] = useState<
183
- Array<(typeof severities)[number]>
183
+ (typeof severities)[number][]
184
184
  >([...severities])
185
185
 
186
186
  return (
@@ -262,9 +262,9 @@ export const TabletViewport: Story = {
262
262
  globals: { viewport: { value: 'tablet768' } },
263
263
  }
264
264
 
265
- // Pins the CardFooter align='start' + single-action + stretchOnMobile={false}
266
- // path at 375, so the mobile left-align regression the FooterLink helper
267
- // depends on stays covered by the visual suite.
265
+ // Pins the CardFooter align='start' + single-action path at 375, so the
266
+ // mobile left-align regression the FooterLink helper depends on stays
267
+ // covered by the visual suite.
268
268
  export const LeftAlignedFooterMobileViewport: Story = {
269
269
  args: {
270
270
  variant: 'card',
@@ -272,7 +272,7 @@ export const LeftAlignedFooterMobileViewport: Story = {
272
272
  header: <SampleHeader />,
273
273
  children: <SampleContent />,
274
274
  footer: (
275
- <RcSesCardFooter align='start' stretchOnMobile={false}>
275
+ <RcSesCardFooter align='start'>
276
276
  <RcSesButton variant='link'>Peržiūrėti DUK</RcSesButton>
277
277
  </RcSesCardFooter>
278
278
  ),
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryContext, StoryObj } from '@storybook/react-vite'
2
- import { useForm } from 'react-hook-form'
2
+ import { useForm, useWatch } from 'react-hook-form'
3
3
 
4
4
  import RcSesCheckboxFormControl from '@/components/form/inputs/CheckboxFormControl'
5
5
  import RcSesFormControlLabel from '@/components/form/inputs/FormControlLabel'
@@ -46,7 +46,7 @@ const meta: Meta<typeof RcSesCheckboxFormControl> = {
46
46
  tags: ['autodocs'],
47
47
  }
48
48
 
49
- type FormModel = {
49
+ interface FormModel {
50
50
  agreement: string
51
51
  }
52
52
 
@@ -178,7 +178,7 @@ export const Loading: Story = {
178
178
  },
179
179
  }
180
180
 
181
- type IndeterminateFormModel = {
181
+ interface IndeterminateFormModel {
182
182
  parent: boolean
183
183
  child1: boolean
184
184
  child2: boolean
@@ -186,7 +186,7 @@ type IndeterminateFormModel = {
186
186
  }
187
187
 
188
188
  function CheckboxIndeterminateDemo() {
189
- const { control, watch, setValue } = useForm<IndeterminateFormModel>({
189
+ const { control, setValue } = useForm<IndeterminateFormModel>({
190
190
  mode: 'all',
191
191
  defaultValues: {
192
192
  parent: false,
@@ -196,11 +196,7 @@ function CheckboxIndeterminateDemo() {
196
196
  },
197
197
  })
198
198
 
199
- const child1Value = watch('child1')
200
- const child2Value = watch('child2')
201
- const child3Value = watch('child3')
202
-
203
- const childValues = [child1Value, child2Value, child3Value]
199
+ const childValues = useWatch({ control, name: ['child1', 'child2', 'child3'] })
204
200
 
205
201
  const handleParentChange = (newChildValues: boolean[]) => {
206
202
  setValue('child1', newChildValues[0])
@@ -232,7 +228,7 @@ function CheckboxIndeterminateDemo() {
232
228
  <RcSesFormControlLabel
233
229
  control={
234
230
  <RcSesSimpleCheckbox
235
- checked={child1Value}
231
+ checked={childValues[0]}
236
232
  onChange={(e) => setValue('child1', e.target.checked)}
237
233
  />
238
234
  }
@@ -241,7 +237,7 @@ function CheckboxIndeterminateDemo() {
241
237
  <RcSesFormControlLabel
242
238
  control={
243
239
  <RcSesSimpleCheckbox
244
- checked={child2Value}
240
+ checked={childValues[1]}
245
241
  onChange={(e) => setValue('child2', e.target.checked)}
246
242
  />
247
243
  }
@@ -250,7 +246,7 @@ function CheckboxIndeterminateDemo() {
250
246
  <RcSesFormControlLabel
251
247
  control={
252
248
  <RcSesSimpleCheckbox
253
- checked={child3Value}
249
+ checked={childValues[2]}
254
250
  onChange={(e) => setValue('child3', e.target.checked)}
255
251
  />
256
252
  }
@@ -302,7 +298,7 @@ export const Indeterminate: Story = {
302
298
  }
303
299
 
304
300
  function CheckboxIndeterminateLoadingDemo() {
305
- const { control, watch, setValue } = useForm<IndeterminateFormModel>({
301
+ const { control, setValue } = useForm<IndeterminateFormModel>({
306
302
  mode: 'all',
307
303
  defaultValues: {
308
304
  parent: false,
@@ -312,11 +308,7 @@ function CheckboxIndeterminateLoadingDemo() {
312
308
  },
313
309
  })
314
310
 
315
- const child1Value = watch('child1')
316
- const child2Value = watch('child2')
317
- const child3Value = watch('child3')
318
-
319
- const childValues = [child1Value, child2Value, child3Value]
311
+ const childValues = useWatch({ control, name: ['child1', 'child2', 'child3'] })
320
312
 
321
313
  const handleParentChange = (newChildValues: boolean[]) => {
322
314
  setValue('child1', newChildValues[0])
@@ -349,7 +341,7 @@ function CheckboxIndeterminateLoadingDemo() {
349
341
  <RcSesFormControlLabel
350
342
  control={
351
343
  <RcSesSimpleCheckbox
352
- checked={child1Value}
344
+ checked={childValues[0]}
353
345
  onChange={(e) => setValue('child1', e.target.checked)}
354
346
  loading
355
347
  />
@@ -360,7 +352,7 @@ function CheckboxIndeterminateLoadingDemo() {
360
352
  <RcSesFormControlLabel
361
353
  control={
362
354
  <RcSesSimpleCheckbox
363
- checked={child2Value}
355
+ checked={childValues[1]}
364
356
  onChange={(e) => setValue('child2', e.target.checked)}
365
357
  loading
366
358
  />
@@ -371,7 +363,7 @@ function CheckboxIndeterminateLoadingDemo() {
371
363
  <RcSesFormControlLabel
372
364
  control={
373
365
  <RcSesSimpleCheckbox
374
- checked={child3Value}
366
+ checked={childValues[2]}
375
367
  onChange={(e) => setValue('child3', e.target.checked)}
376
368
  loading
377
369
  />
@@ -7,7 +7,7 @@ import FieldView from '@/components/storybook/FieldView'
7
7
  import Fields from '@/components/storybook/Fields'
8
8
  import PreviewTitle from '@/components/storybook/PreviewTitle'
9
9
 
10
- type FormModel = {
10
+ interface FormModel {
11
11
  chooseOne: string
12
12
  }
13
13
 
@@ -160,7 +160,7 @@ function SnackbarDemoCompactWithText() {
160
160
  <Button
161
161
  key={snackbarState}
162
162
  variant='contained'
163
- color={getButtonColor(snackbarState) as any}
163
+ color={getButtonColor(snackbarState)}
164
164
  startIcon={<Icon />}
165
165
  onClick={() =>
166
166
  showSnackbar({ state: snackbarState, message, size: 'compact' })
@@ -233,7 +233,7 @@ function SnackbarDemoStandardWithButtons() {
233
233
  <Button
234
234
  key={snackbarState}
235
235
  variant='contained'
236
- color={getButtonColor(snackbarState) as any}
236
+ color={getButtonColor(snackbarState)}
237
237
  startIcon={<Icon />}
238
238
  onClick={() =>
239
239
  showSnackbar({
@@ -30,7 +30,7 @@ export default meta
30
30
  type Story = StoryObj<typeof RcSesTitleBlock>
31
31
 
32
32
  const FooterLink = ({ label, href }: { label: string; href: string }) => (
33
- <RcSesCardFooter align='start' stretchOnMobile={false}>
33
+ <RcSesCardFooter align='start'>
34
34
  <RcSesButton
35
35
  variant='link'
36
36
  href={href}
@@ -221,6 +221,45 @@ export const RowListWithIcons: Story = {
221
221
  },
222
222
  }
223
223
 
224
+ export const RowListWithIconsAndLongText: Story = {
225
+ render: () => {
226
+ const rowAId = 'row-list-long-text-a'
227
+ const rowBId = 'row-list-long-text-b'
228
+ return (
229
+ <Stack divider={<Divider flexItem />} spacing={3}>
230
+ <RcSesTitleBlock
231
+ headingId={rowAId}
232
+ title='Santuoką liudijančio įrašo, patvirtinančio santuokos sudarymo faktą užsienio valstybėje, užsakymas su visomis papildomomis pastabomis'
233
+ description='Oficialus santuokos faktą patvirtinantis įrašas, apimantis visus civilinės metrikacijos duomenis, reikalingus tolimesnėms teisinėms procedūroms tiek Lietuvoje, tiek užsienyje. Įrašas gali būti pateikiamas įvairioms institucijoms ir naudojamas kaip oficialus patvirtinimas.'
234
+ titleTone='brand'
235
+ icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
236
+ actions={
237
+ <RcSesButton
238
+ variant='link'
239
+ id={`${rowAId}-cta`}
240
+ aria-labelledby={`${rowAId}-cta ${rowAId}`}
241
+ >
242
+ Plačiau
243
+ </RcSesButton>
244
+ }
245
+ />
246
+ <RcSesTitleBlock
247
+ headingId={rowBId}
248
+ title='Pažymos, patvirtinančios, kad nėra kliūčių Lietuvos Respublikos piliečiui sudaryti santuoką užsienio valstybėje, užsakymas'
249
+ description='Ši pažyma reikalinga tais atvejais, kai Lietuvos Respublikos pilietis planuoja sudaryti santuoką užsienio valstybėje ir vietos civilinės metrikacijos institucija reikalauja oficialaus patvirtinimo, kad asmens šeiminė padėtis Lietuvoje neturi kliūčių santuokos sudarymui.'
250
+ titleTone='brand'
251
+ icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
252
+ actions={
253
+ <RcSesButton id={`${rowBId}-cta`} aria-labelledby={`${rowBId}-cta ${rowBId}`}>
254
+ Užsakyti
255
+ </RcSesButton>
256
+ }
257
+ />
258
+ </Stack>
259
+ )
260
+ },
261
+ }
262
+
224
263
  export const RowListWithIconsAndTwoActions: Story = {
225
264
  render: () => {
226
265
  const rowAId = 'row-list-two-actions-a'
@@ -13,7 +13,7 @@ import {
13
13
  } from '@mui/material'
14
14
  import type { Meta, StoryObj } from '@storybook/react-vite'
15
15
  import { useState } from 'react'
16
- import { useForm } from 'react-hook-form'
16
+ import { useForm, useWatch } from 'react-hook-form'
17
17
 
18
18
  import InfoFillIcon from '@/assets/icons/InfoFillIcon'
19
19
  import NotePencilIcon from '@/assets/icons/NotePencilIcon'
@@ -196,7 +196,7 @@ export const OwnerTypeExpand: Story = {
196
196
  render: () => <OwnerTypeExpandStory />,
197
197
  }
198
198
 
199
- type OwnerBranchFormModel = {
199
+ interface OwnerBranchFormModel {
200
200
  individual: { municipality: string | null }
201
201
  legalEntity: { legalForm: string | null }
202
202
  }
@@ -224,14 +224,14 @@ const RadioBranchFormStory = () => {
224
224
  const [ownerTypeId, setOwnerTypeId] = useState(OWNER_TYPE_OPTIONS[0].id)
225
225
  const [shouldUnregister, setShouldUnregister] = useState(true)
226
226
 
227
- const { control, watch } = useForm<OwnerBranchFormModel>({
227
+ const { control } = useForm<OwnerBranchFormModel>({
228
228
  defaultValues: {
229
229
  individual: { municipality: null },
230
230
  legalEntity: { legalForm: null },
231
231
  },
232
232
  })
233
233
 
234
- const formState = watch()
234
+ const formState = useWatch({ control })
235
235
 
236
236
  // The non-selected branch stays in form state when shouldUnregister is off, so the
237
237
  // submitted payload is built from the selected branch instead of the whole form.
@@ -7,7 +7,7 @@ import FieldView from '@/components/storybook/FieldView'
7
7
  import Fields from '@/components/storybook/Fields'
8
8
  import PreviewTitle from '@/components/storybook/PreviewTitle'
9
9
 
10
- type FormModel = {
10
+ interface FormModel {
11
11
  documents: File[]
12
12
  documentsDisabled: File[]
13
13
  documentsError: File[]
@@ -7,7 +7,7 @@ import FieldView from '@/components/storybook/FieldView'
7
7
  import Fields from '@/components/storybook/Fields'
8
8
  import PreviewTitle from '@/components/storybook/PreviewTitle'
9
9
 
10
- type FormModel = {
10
+ interface FormModel {
11
11
  uploadFile: string
12
12
  uploadFile2: string
13
13
  uploadFile3: string
@@ -15,12 +15,24 @@ const ITEMS: RcSesSideNavItem[] = [
15
15
  { id: 'marriage', label: 'Santuoka ir skyrybos', count: 7 },
16
16
  ]
17
17
 
18
+ // The upper end of the supported range (1-12), where the list no longer fits the
19
+ // viewport and the Overflow=Scroll variant earns its keep.
20
+ const MANY_ITEMS: RcSesSideNavItem[] = [
21
+ ...ITEMS,
22
+ { id: 'spatial', label: 'Erdviniai duomenys', count: 13 },
23
+ { id: 'forests', label: 'Miškai', count: 14 },
24
+ { id: 'mortgage', label: 'Hipoteka ir įkeitimai', count: 8 },
25
+ { id: 'value', label: 'Turto vertė ir sandorių duomenys', count: 12 },
26
+ { id: 'addresses', label: 'Adresai', count: 3 },
27
+ { id: 'contracts', label: 'Nekilnojamojo turto sutartys', count: 12 },
28
+ ]
29
+
18
30
  const SECTION_HEIGHT = 320
19
31
 
20
- function Sections() {
32
+ function Sections({ items = ITEMS }: { items?: RcSesSideNavItem[] }) {
21
33
  return (
22
34
  <>
23
- {ITEMS.map((item) => (
35
+ {items.map((item) => (
24
36
  <Box
25
37
  key={item.id}
26
38
  id={item.id}
@@ -50,7 +62,7 @@ const meta: Meta<typeof RcSesSideNavLayout> = {
50
62
  docs: {
51
63
  description: {
52
64
  component:
53
- 'RcSesSideNavLayout is the only supported way to use this component - it lays out the sticky nav column (a topic list on desktop, a horizontally scrollable pill bar on mobile) alongside its section children, which is what guarantees the desktop sticky behavior works. By default (no `activeItemId`) it tracks scroll position itself and scrolls the page on click - pass `activeItemId`/`onItemClick` to take full control instead. See `WithScrollSpy` for the default, self-contained behavior; `Main` demonstrates the fully-controlled mode, which is why it wires the state itself.',
65
+ 'RcSesSideNavLayout is the only supported way to use this component - it lays out the sticky nav column (a topic list on desktop, a horizontally scrollable pill bar on mobile) alongside its section children, which is what guarantees the desktop sticky behavior works. By default (no `activeItemId`) it tracks scroll position itself and scrolls the page on click - pass `activeItemId`/`onItemClick` to take full control instead. See `WithScrollSpy` for the default, self-contained behavior; `Main` demonstrates the fully-controlled mode, which is why it wires the state itself. `overflow` decides what happens when there are more topics than fit the screen - see `WithScrollOverflow`.',
54
66
  },
55
67
  },
56
68
  },
@@ -108,3 +120,24 @@ export const WithScrollSpy: Story = {
108
120
  },
109
121
  },
110
122
  }
123
+
124
+ export const WithScrollOverflow: Story = {
125
+ // Only visible at a real viewport height: the visual baseline is a fullPage
126
+ // capture, which stretches the viewport to the whole page and so leaves the
127
+ // 100vh cap with nothing to cut off.
128
+ render: () => (
129
+ <FieldView>
130
+ <RcSesSideNavLayout items={MANY_ITEMS} title='Temos' overflow='scroll'>
131
+ <Sections items={MANY_ITEMS} />
132
+ </RcSesSideNavLayout>
133
+ </FieldView>
134
+ ),
135
+ parameters: {
136
+ docs: {
137
+ description: {
138
+ story:
139
+ "`overflow='scroll'` caps the desktop list to the viewport (minus `offset`) and scrolls it inside itself, so a long topic list no longer runs off the bottom of the screen. As the scroll-spy moves the active topic past either edge of that list, the list scrolls just far enough to keep it visible - smoothly, unless the user prefers reduced motion. The default, `overflow='fit'`, lets the list grow as tall as it needs to.",
140
+ },
141
+ },
142
+ },
143
+ }
@@ -1,7 +1,7 @@
1
- type Props = {}
2
-
3
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
- function SuperName(props: Props) {
1
+ // Scaffolding template for a new component. Declare a `Props` type once the
2
+ // component actually takes props: an empty one is not a placeholder, it accepts
3
+ // any non-nullish value, including `0` and `''`.
4
+ function SuperName() {
5
5
  // eslint-disable-next-line react/jsx-no-useless-fragment
6
6
  return <></>
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { ColorType } from '@/types/common/ColorType'
2
2
 
3
- type IconProps = {
3
+ interface IconProps {
4
4
  className?: string
5
5
  width?: number
6
6
  height?: number
@@ -2,7 +2,7 @@ import React from 'react'
2
2
 
3
3
  import { ColorType } from '@/types/common/ColorType'
4
4
 
5
- export type CardServiceProps = {
5
+ export interface CardServiceProps {
6
6
  title: string
7
7
  Icon: React.FunctionComponent
8
8
  iconColor?: ColorType
@@ -1,4 +1,4 @@
1
- export type QuickLinkType = {
1
+ export interface QuickLinkType {
2
2
  name: string
3
3
  title: string
4
4
  Icon?: React.FC
@@ -1,4 +1,4 @@
1
- type InputIconProps = {
1
+ interface InputIconProps {
2
2
  disabled?: boolean
3
3
  }
4
4
 
@@ -1,4 +1,4 @@
1
- export type ListNewsItemType = {
1
+ export interface ListNewsItemType {
2
2
  title: string
3
3
  date: Date | string
4
4
  imgUrl: string
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
 
3
- export type ListServicesItemType = {
3
+ export interface ListServicesItemType {
4
4
  title: string
5
5
  Icon?: React.FC | undefined
6
6
  limit?: number | undefined
7
- items: Array<string>
7
+ items: string[]
8
8
  }
package/src/vite-env.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare global {
8
8
  }
9
9
  }
10
10
 
11
- export type EnvVariables = {
11
+ export interface EnvVariables {
12
12
  ENV_BUILD_VERSION: string;
13
13
 
14
14
  ENV_PUBLIC_PORTAL_URL: string;
@@ -37,7 +37,7 @@ export type EnvVariables = {
37
37
  ENV_KEYCLOAK_SERVER_URL: string;
38
38
  }
39
39
 
40
- export type MFEEnvVariables = {
40
+ export interface MFEEnvVariables {
41
41
  ENV_SERVICE_ROUTES: { path: string, application: string }[];
42
42
  ENV_OWNED_PROPERTIES_ROUTES: { path: string, application: string }[];
43
43
  }
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { default as RcSesBadge } from '../../components/common/Badge';
3
- declare const meta: Meta<typeof RcSesBadge>;
4
- export default meta;
5
- type Story = StoryObj<typeof RcSesBadge>;
6
- export declare const Main: Story;
7
- export declare const AllCombinations: Story;
8
- export declare const LongLabel: Story;
9
- export declare const BaselineAlignment: Story;
@@ -1,107 +0,0 @@
1
- import { StoryObj } from '@storybook/react-vite';
2
- import { ExtendButtonBase, ButtonTypeMap, ButtonPropsVariantOverrides } from '@mui/material';
3
- import { OverridableStringUnion } from '@mui/types';
4
- import { Mock } from 'storybook/test';
5
- declare const meta: {
6
- title: string;
7
- component: ExtendButtonBase<ButtonTypeMap<{
8
- iconOnly?: boolean;
9
- }>>;
10
- parameters: {
11
- layout: string;
12
- };
13
- argTypes: {
14
- variant: {
15
- options: ( OverridableStringUnion<"text" | "outlined" | "contained", ButtonPropsVariantOverrides> | undefined)[];
16
- mapping: ( OverridableStringUnion<"text" | "outlined" | "contained", ButtonPropsVariantOverrides> | undefined)[];
17
- control: {
18
- type: "select";
19
- labels: ( OverridableStringUnion<"text" | "outlined" | "contained", ButtonPropsVariantOverrides> | undefined)[];
20
- };
21
- table: {
22
- defaultValue: {};
23
- };
24
- };
25
- color: {
26
- options: string[];
27
- mapping: string[];
28
- control: {
29
- type: "select";
30
- labels: string[];
31
- };
32
- table: {
33
- defaultValue: {};
34
- };
35
- };
36
- disabled: {
37
- control: {
38
- type: "boolean";
39
- };
40
- table: {
41
- defaultValue: {};
42
- };
43
- };
44
- iconOnly: {
45
- control: {
46
- type: "boolean";
47
- };
48
- table: {
49
- defaultValue: {};
50
- };
51
- };
52
- loading: {
53
- control: {
54
- type: "boolean";
55
- };
56
- table: {
57
- defaultValue: {
58
- summary: string;
59
- };
60
- };
61
- };
62
- };
63
- tags: string[];
64
- args: {
65
- children: string;
66
- onClick: Mock<(...args: any[]) => any>;
67
- };
68
- };
69
- export default meta;
70
- type Story = StoryObj<typeof meta>;
71
- export declare const PrimaryContained: Story;
72
- export declare const PrimaryContainedWithPrefixIcon: Story;
73
- export declare const PrimaryContainedWithSuffixIcon: Story;
74
- export declare const PrimaryContainedIconOnly: Story;
75
- export declare const PrimaryOutlined: Story;
76
- export declare const PrimaryOutlinedWithPrefixIcon: Story;
77
- export declare const PrimaryOutlinedWithSuffixIcon: Story;
78
- export declare const PrimaryOutlinedIconOnly: Story;
79
- export declare const SecondaryContained: Story;
80
- export declare const SecondaryOutlined: Story;
81
- export declare const GreyContained: Story;
82
- export declare const GreyOutlined: Story;
83
- export declare const WarningContained: Story;
84
- export declare const WarningOutlined: Story;
85
- export declare const ErrorContained: Story;
86
- export declare const ErrorOutlined: Story;
87
- export declare const LightOutlined: Story;
88
- export declare const LightOutlinedWithIcon: Story;
89
- export declare const LightOutlinedDisabled: Story;
90
- export declare const GhostOutlinedIconOnly: Story;
91
- export declare const GhostOutlinedIconOnlyDisabled: Story;
92
- export declare const PrimaryContainedLoading: Story;
93
- export declare const PrimaryContainedLoadingWithIcon: Story;
94
- export declare const PrimaryContainedLoadingWithEndIcon: Story;
95
- export declare const PrimaryContainedIconOnlyLoading: Story;
96
- export declare const PrimaryOutlinedLoading: Story;
97
- export declare const SecondaryContainedLoading: Story;
98
- export declare const SecondaryOutlinedLoading: Story;
99
- export declare const GreyContainedLoading: Story;
100
- export declare const GreyOutlinedLoading: Story;
101
- export declare const WarningContainedLoading: Story;
102
- export declare const WarningOutlinedLoading: Story;
103
- export declare const ErrorContainedLoading: Story;
104
- export declare const ErrorOutlinedLoading: Story;
105
- export declare const LightOutlinedLoading: Story;
106
- export declare const LightOutlinedWithIconLoading: Story;
107
- export declare const GhostOutlinedIconOnlyLoading: Story;
@@ -1,21 +0,0 @@
1
- import { Meta, StoryContext } from '@storybook/react-vite';
2
- import { default as RcSesCheckbox } from '../../components/form/inputs/Checkbox';
3
- declare const meta: Meta<typeof RcSesCheckbox>;
4
- export default meta;
5
- export declare const Main: {
6
- render: (args: any) => import("react").JSX.Element;
7
- args: {
8
- label: string;
9
- variant: string;
10
- children: string;
11
- disabled: boolean;
12
- };
13
- parameters: {
14
- docs: {
15
- source: {
16
- type: string;
17
- transform: (code: string, storyContext: StoryContext) => string;
18
- };
19
- };
20
- };
21
- };
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { default as RcSesIconWithCircularBackground } from '../../components/common/IconWithCircularBackground';
3
- declare const meta: Meta<typeof RcSesIconWithCircularBackground>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
@@ -1,7 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { default as RcSesIconWithSquareBackground } from '../../components/common/IconWithSquareBackground';
3
- declare const meta: Meta<typeof RcSesIconWithSquareBackground>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
7
- export declare const AllVariantsAndSizes: Story;
@@ -1,7 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { default as IconProps } from '../../assets/IconProps';
3
- type StoryArgs = IconProps;
4
- declare const meta: Meta<StoryArgs>;
5
- export default meta;
6
- type Story = StoryObj<StoryArgs>;
7
- export declare const Gallery: Story;