@registrucentras/rc-ses-react-components 2.0.0-rc.3 → 2.0.0-rc.5

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 (80) hide show
  1. package/dist/assets/icons/ArrowRightIcon.d.ts +1 -1
  2. package/dist/assets/icons/WarningCircleIcon.d.ts +1 -1
  3. package/dist/components/common/Alert/index.d.ts +8 -2
  4. package/dist/components/common/CardShell/index.d.ts +1 -1
  5. package/dist/components/common/CardShell/types.d.ts +3 -1
  6. package/dist/components/common/IconWithSquareBackground/index.d.ts +12 -0
  7. package/dist/components/common/ServiceLinks/ServiceLinkItem/index.d.ts +15 -0
  8. package/dist/components/common/ServiceLinks/index.d.ts +3 -0
  9. package/dist/components/common/ServiceLinks/types.d.ts +34 -0
  10. package/dist/components/common/SideNav/SideNav.types.d.ts +20 -0
  11. package/dist/components/common/SideNav/SideNavLayout.d.ts +4 -0
  12. package/dist/components/common/SideNav/components/SideNavPill.d.ts +9 -0
  13. package/dist/components/common/SideNav/components/SideNavPillList.d.ts +9 -0
  14. package/dist/components/common/SideNav/components/SideNavRow.d.ts +9 -0
  15. package/dist/components/common/SideNav/hooks/useSideNavScrollSpy.d.ts +12 -0
  16. package/dist/components/common/SideNav/index.d.ts +4 -0
  17. package/dist/components/common/TitleBlock/index.d.ts +3 -0
  18. package/dist/components/common/TitleBlock/types.d.ts +73 -0
  19. package/dist/components/utils/normalizeSx.d.ts +4 -0
  20. package/dist/library/index.d.ts +8 -2
  21. package/dist/library/types.d.ts +6 -2
  22. package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
  23. package/dist/registrucentras-rc-ses-react-components.js +3489 -2703
  24. package/dist/stories/components/display/CardShell.stories.d.ts +1 -1
  25. package/dist/stories/components/display/SelectableCardList.stories.d.ts +1 -0
  26. package/dist/stories/components/display/ServiceLinks.stories.d.ts +28 -0
  27. package/dist/stories/components/display/TitleBlock.stories.d.ts +20 -0
  28. package/dist/stories/components/feedback/Alert.stories.d.ts +4 -0
  29. package/dist/stories/components/form/FormControlWrapper.stories.d.ts +1 -0
  30. package/dist/stories/components/icons/IconWithSquareBackground.stories.d.ts +7 -0
  31. package/dist/stories/components/navigation/SideNav.stories.d.ts +7 -0
  32. package/package.json +1 -1
  33. package/src/assets/icons/ArrowRightIcon.tsx +2 -1
  34. package/src/assets/icons/WarningCircleIcon.tsx +8 -2
  35. package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +8 -6
  36. package/src/components/common/Alert/index.test.tsx +157 -2
  37. package/src/components/common/Alert/index.tsx +144 -10
  38. package/src/components/common/Card/index.tsx +1 -23
  39. package/src/components/common/CardShell/index.tsx +4 -1
  40. package/src/components/common/CardShell/types.ts +3 -1
  41. package/src/components/common/IconWithSquareBackground/index.test.tsx +55 -0
  42. package/src/components/common/IconWithSquareBackground/index.tsx +83 -0
  43. package/src/components/common/ServiceLinks/ServiceLinkItem/index.tsx +177 -0
  44. package/src/components/common/ServiceLinks/index.test.tsx +166 -0
  45. package/src/components/common/ServiceLinks/index.tsx +66 -0
  46. package/src/components/common/ServiceLinks/types.ts +37 -0
  47. package/src/components/common/SideNav/SideNav.types.ts +24 -0
  48. package/src/components/common/SideNav/SideNavLayout.test.tsx +113 -0
  49. package/src/components/common/SideNav/SideNavLayout.tsx +67 -0
  50. package/src/components/common/SideNav/components/SideNavPill.tsx +62 -0
  51. package/src/components/common/SideNav/components/SideNavPillList.tsx +190 -0
  52. package/src/components/common/SideNav/components/SideNavRow.tsx +72 -0
  53. package/src/components/common/SideNav/hooks/useSideNavScrollSpy.test.ts +457 -0
  54. package/src/components/common/SideNav/hooks/useSideNavScrollSpy.ts +154 -0
  55. package/src/components/common/SideNav/index.test.tsx +99 -0
  56. package/src/components/common/SideNav/index.tsx +83 -0
  57. package/src/components/common/TitleBlock/index.test.tsx +366 -0
  58. package/src/components/common/TitleBlock/index.tsx +144 -0
  59. package/src/components/common/TitleBlock/types.ts +82 -0
  60. package/src/components/utils/normalizeSx.ts +24 -0
  61. package/src/i18n/namespaces/common/en.json +4 -0
  62. package/src/i18n/namespaces/common/lt.json +4 -0
  63. package/src/library/index.ts +8 -2
  64. package/src/library/types.ts +20 -8
  65. package/src/stories/components/display/CardShell.stories.tsx +14 -12
  66. package/src/stories/components/display/SelectableCardList.stories.tsx +33 -1
  67. package/src/stories/components/display/ServiceLinks.stories.tsx +154 -0
  68. package/src/stories/components/display/TitleBlock.stories.tsx +506 -0
  69. package/src/stories/components/feedback/Alert.stories.tsx +135 -4
  70. package/src/stories/components/form/FormControlWrapper.stories.tsx +23 -0
  71. package/src/stories/components/icons/IconWithSquareBackground.stories.tsx +60 -0
  72. package/src/stories/components/navigation/SideNav.stories.tsx +110 -0
  73. package/src/theme/cards.ts +1 -1
  74. package/src/theme/light/MuiAlert.tsx +28 -20
  75. package/src/theme/light/MuiButton.tsx +6 -0
  76. package/dist/components/common/CardShell/CardHeader/index.d.ts +0 -3
  77. package/dist/components/common/CardShell/CardHeader/types.d.ts +0 -33
  78. package/src/components/common/CardShell/CardHeader/index.test.tsx +0 -207
  79. package/src/components/common/CardShell/CardHeader/index.tsx +0 -104
  80. package/src/components/common/CardShell/CardHeader/types.ts +0 -36
@@ -1,104 +0,0 @@
1
- import { Box, Stack, Typography } from '@mui/material'
2
-
3
- import RcSesBadge from '@/components/common/Badge'
4
- import cards from '@/theme/cards'
5
- import palette from '@/theme/palette'
6
-
7
- import { RcSesCardHeaderProps } from './types'
8
-
9
- function RcSesCardHeader({
10
- title,
11
- headingLevel = 3,
12
- icon,
13
- count,
14
- description,
15
- actions,
16
- className,
17
- testIds,
18
- }: RcSesCardHeaderProps) {
19
- const HeadingTag = `h${headingLevel}` as 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
20
- const hasCount = count !== undefined && count !== null
21
-
22
- return (
23
- <Stack
24
- className={className}
25
- data-testid={testIds?.root}
26
- direction='row'
27
- spacing={cards.header.rowGap}
28
- sx={{ alignItems: 'flex-start', width: '100%' }}
29
- >
30
- {icon ? (
31
- <Box
32
- aria-hidden
33
- data-testid={testIds?.icon}
34
- sx={{ display: 'flex', flexShrink: 0 }}
35
- >
36
- {icon}
37
- </Box>
38
- ) : null}
39
-
40
- <Stack spacing={cards.header.gap} sx={{ flex: 1, minWidth: 0 }}>
41
- <HeadingTag data-testid={testIds?.heading} style={{ margin: 0 }}>
42
- <Typography
43
- component='span'
44
- variant='h6'
45
- sx={{
46
- color: palette.grey[900],
47
- // inline only when the badge has to sit on the heading's last line
48
- display: hasCount ? 'inline' : 'block',
49
- fontWeight: cards.header.titleFontWeight,
50
- overflowWrap: 'anywhere',
51
- }}
52
- >
53
- {title}
54
- </Typography>
55
-
56
- {hasCount ? (
57
- <Box
58
- component='span'
59
- data-testid={testIds?.badge}
60
- sx={{
61
- display: 'inline-flex',
62
- ml: cards.header.badgeGap,
63
- verticalAlign: 'middle',
64
- }}
65
- >
66
- <RcSesBadge
67
- label={String(count)}
68
- showIcon={false}
69
- size='small'
70
- variant='neutral'
71
- />
72
- </Box>
73
- ) : null}
74
- </HeadingTag>
75
-
76
- {description !== undefined && description !== null ? (
77
- <Typography
78
- data-testid={testIds?.description}
79
- variant='body2'
80
- sx={{
81
- color: palette.grey[700],
82
- lineHeight: cards.header.descriptionLineHeight,
83
- }}
84
- >
85
- {description}
86
- </Typography>
87
- ) : null}
88
- </Stack>
89
-
90
- {actions ? (
91
- <Stack
92
- data-testid={testIds?.actions}
93
- direction='row'
94
- spacing={cards.header.actionsGap}
95
- sx={{ alignItems: 'center', flexShrink: 0 }}
96
- >
97
- {actions}
98
- </Stack>
99
- ) : null}
100
- </Stack>
101
- )
102
- }
103
-
104
- export default RcSesCardHeader
@@ -1,36 +0,0 @@
1
- import { ReactNode } from 'react'
2
-
3
- export type CardHeadingLevel = 2 | 3 | 4 | 5 | 6
4
-
5
- export type RcSesCardHeaderTestIds = {
6
- root?: string
7
- icon?: string
8
- heading?: string
9
- badge?: string
10
- description?: string
11
- actions?: string
12
- }
13
-
14
- export type RcSesCardHeaderProps = {
15
- title: ReactNode
16
- headingLevel?: CardHeadingLevel
17
- /**
18
- * Decorative leading visual, `Icon-tile` once SAV-6476 lands. Rendered
19
- * `aria-hidden`, so it never contributes to the heading's accessible name.
20
- */
21
- icon?: ReactNode
22
- /**
23
- * Count rendered as a Neutral/Small `Badge` inside the heading, so it is
24
- * announced together with the title. Intended for short section headings.
25
- */
26
- count?: number
27
- description?: ReactNode
28
- /**
29
- * Up to two CTAs, rendered at the end of the header row. A trailing
30
- * affordance such as the Category-tile chevron is not a CTA and will need its
31
- * own slot.
32
- */
33
- actions?: ReactNode
34
- className?: string
35
- testIds?: RcSesCardHeaderTestIds
36
- }