@registrucentras/rc-ses-react-components 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/assets/icons/createIcon.d.ts +18 -0
  2. package/dist/assets/icons/phosphorIcons.d.ts +221 -0
  3. package/dist/components/common/Badge/index.d.ts +1 -0
  4. package/dist/components/overlays/Drawer/Drawer.types.d.ts +30 -0
  5. package/dist/components/overlays/Drawer/index.d.ts +9 -0
  6. package/dist/library/icons.d.ts +2 -48
  7. package/dist/library/index.d.ts +2 -1
  8. package/dist/library/types.d.ts +2 -0
  9. package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
  10. package/dist/registrucentras-rc-ses-react-components.js +2579 -2762
  11. package/package.json +5 -5
  12. package/src/assets/icons/createIcon.test.tsx +49 -0
  13. package/src/assets/icons/createIcon.tsx +49 -0
  14. package/src/assets/icons/phosphorIcons.ts +162 -0
  15. package/src/components/common/Accordion/index.tsx +1 -1
  16. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +1 -3
  17. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +6 -4
  18. package/src/components/common/AdvancedList/components/AdvancedListItem/index.test.tsx +5 -3
  19. package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.test.tsx +23 -0
  20. package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.tsx +6 -0
  21. package/src/components/common/Alert/index.tsx +1 -1
  22. package/src/components/common/Badge/index.test.tsx +16 -0
  23. package/src/components/common/Badge/index.tsx +35 -12
  24. package/src/components/common/Button/ButtonWithPopover.tsx +1 -2
  25. package/src/components/common/DataPagination/index.tsx +1 -2
  26. package/src/components/common/IconWithSquareBackground/index.test.tsx +1 -1
  27. package/src/components/common/ServiceLinks/ServiceLinkItem/index.tsx +1 -1
  28. package/src/components/common/Snackbar/index.tsx +1 -1
  29. package/src/components/common/StepCard/StepCardFooter/index.tsx +5 -3
  30. package/src/components/common/Tooltip/index.tsx +1 -1
  31. package/src/components/form/inputs/CheckboxFormControl.tsx +1 -2
  32. package/src/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.tsx +6 -4
  33. package/src/components/form/inputs/Datepicker/index.tsx +1 -2
  34. package/src/components/form/inputs/FileDropzone.tsx +1 -2
  35. package/src/components/form/inputs/FileUpload.tsx +1 -1
  36. package/src/components/form/inputs/NumberStepper.tsx +1 -2
  37. package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +1 -1
  38. package/src/components/form/inputs/PhoneInputFormControl/index.tsx +1 -1
  39. package/src/components/form/inputs/SearchInput/index.tsx +1 -2
  40. package/src/components/form/inputs/SearchableField.tsx +1 -2
  41. package/src/components/form/inputs/Select/components/OptionCheckbox.tsx +1 -1
  42. package/src/components/form/inputs/Select/index.tsx +1 -2
  43. package/src/components/form/inputs/SimpleCheckbox.tsx +1 -2
  44. package/src/components/layout/ServiceFormActions.tsx +1 -2
  45. package/src/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.tsx +1 -2
  46. package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.tsx +1 -2
  47. package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.tsx +1 -2
  48. package/src/components/overlays/BottomSheet/index.tsx +1 -1
  49. package/src/components/overlays/Drawer/Drawer.types.ts +32 -0
  50. package/src/components/overlays/Drawer/index.test.tsx +174 -0
  51. package/src/components/overlays/Drawer/index.tsx +192 -0
  52. package/src/components/overlays/Modal/index.tsx +6 -4
  53. package/src/i18n/namespaces/common/en.json +3 -0
  54. package/src/i18n/namespaces/common/lt.json +3 -0
  55. package/src/library/icons.ts +3 -100
  56. package/src/library/index.ts +2 -0
  57. package/src/library/types.ts +2 -0
  58. package/src/stories/atoms/Badge.stories.tsx +40 -0
  59. package/src/stories/atoms/Button.stories.tsx +1 -1
  60. package/src/stories/atoms/IconWithCircularBackground.stories.tsx +1 -1
  61. package/src/stories/atoms/IconWithSquareBackground.stories.tsx +1 -1
  62. package/src/stories/atoms/Icons.stories.tsx +134 -225
  63. package/src/stories/molecules/Card.stories.tsx +5 -3
  64. package/src/stories/molecules/CardShell.stories.tsx +1 -1
  65. package/src/stories/molecules/ImageCard.stories.tsx +1 -1
  66. package/src/stories/molecules/ListWithIcons.stories.tsx +1 -2
  67. package/src/stories/molecules/TitleBlock.stories.tsx +6 -3
  68. package/src/stories/organisms/AdvancedList.stories.tsx +6 -4
  69. package/src/stories/organisms/AdvancedListItem.stories.tsx +1 -3
  70. package/src/stories/organisms/AdvancedListItemShell.stories.tsx +93 -4
  71. package/src/stories/organisms/Drawer.stories.tsx +90 -0
  72. package/src/stories/organisms/SelectableCardList.stories.tsx +1 -3
  73. package/src/stories/organisms/ServiceLinks.stories.tsx +1 -1
  74. package/src/theme/light/MuiAccordionSummary.tsx +1 -1
  75. package/src/theme/light/MuiAlert.tsx +7 -5
  76. package/dist/assets/icons/ArrowLeftIcon.d.ts +0 -3
  77. package/dist/assets/icons/ArrowRightIcon.d.ts +0 -3
  78. package/dist/assets/icons/ArrowsClockwiseIcon.d.ts +0 -3
  79. package/dist/assets/icons/BarcodeIcon.d.ts +0 -3
  80. package/dist/assets/icons/CalendarBlankIcon.d.ts +0 -3
  81. package/dist/assets/icons/CaretDoubleLeftBoldIcon.d.ts +0 -3
  82. package/dist/assets/icons/CaretDoubleRightBoldIcon.d.ts +0 -3
  83. package/dist/assets/icons/CaretDownBoldIcon.d.ts +0 -3
  84. package/dist/assets/icons/CaretDownFill.d.ts +0 -3
  85. package/dist/assets/icons/CaretDownIcon.d.ts +0 -3
  86. package/dist/assets/icons/CaretLeftBoldIcon.d.ts +0 -3
  87. package/dist/assets/icons/CaretLeftIcon.d.ts +0 -3
  88. package/dist/assets/icons/CaretRightBoldIcon.d.ts +0 -3
  89. package/dist/assets/icons/CaretUpBoldIcon.d.ts +0 -3
  90. package/dist/assets/icons/CaretUpIcon.d.ts +0 -3
  91. package/dist/assets/icons/CheckBoldIcon.d.ts +0 -3
  92. package/dist/assets/icons/CheckCircleFillIcon.d.ts +0 -3
  93. package/dist/assets/icons/CheckIcon.d.ts +0 -3
  94. package/dist/assets/icons/CheckUncheckedBoldIcon.d.ts +0 -3
  95. package/dist/assets/icons/CircleFilledIcon.d.ts +0 -3
  96. package/dist/assets/icons/CloseIcon.d.ts +0 -3
  97. package/dist/assets/icons/CollapseChevronsIcon.d.ts +0 -3
  98. package/dist/assets/icons/CopyIcon.d.ts +0 -3
  99. package/dist/assets/icons/ExpandChevronsIcon.d.ts +0 -3
  100. package/dist/assets/icons/InfoFillIcon.d.ts +0 -3
  101. package/dist/assets/icons/ListIcon.d.ts +0 -3
  102. package/dist/assets/icons/MagnifyingGlassIcon.d.ts +0 -3
  103. package/dist/assets/icons/MapPinAreaIcon.d.ts +0 -3
  104. package/dist/assets/icons/MinusBoldIcon.d.ts +0 -3
  105. package/dist/assets/icons/MinusIcon.d.ts +0 -3
  106. package/dist/assets/icons/NotePencilIcon.d.ts +0 -3
  107. package/dist/assets/icons/PencilSimpleLineIcon.d.ts +0 -3
  108. package/dist/assets/icons/PlusBoldIcon.d.ts +0 -3
  109. package/dist/assets/icons/PlusIcon.d.ts +0 -3
  110. package/dist/assets/icons/QuestionFillIcon.d.ts +0 -3
  111. package/dist/assets/icons/QuestionIcon.d.ts +0 -3
  112. package/dist/assets/icons/ScalesIcon.d.ts +0 -3
  113. package/dist/assets/icons/ScrollIcon.d.ts +0 -3
  114. package/dist/assets/icons/ShoppingCartIcon.d.ts +0 -3
  115. package/dist/assets/icons/SpinnerGapBoldIcon.d.ts +0 -3
  116. package/dist/assets/icons/TrashIcon.d.ts +0 -3
  117. package/dist/assets/icons/UploadSimpleIcon.d.ts +0 -3
  118. package/dist/assets/icons/UserIcon.d.ts +0 -3
  119. package/dist/assets/icons/WarningCircleIcon.d.ts +0 -3
  120. package/dist/assets/icons/WarningDiamondFillIcon.d.ts +0 -3
  121. package/dist/assets/icons/WarningFillIcon.d.ts +0 -3
  122. package/dist/assets/icons/XCircleFillIcon.d.ts +0 -3
  123. package/src/assets/icons/ArrowLeftIcon.tsx +0 -16
  124. package/src/assets/icons/ArrowRightIcon.tsx +0 -17
  125. package/src/assets/icons/ArrowsClockwiseIcon.tsx +0 -16
  126. package/src/assets/icons/BarcodeIcon.tsx +0 -9
  127. package/src/assets/icons/CalendarBlankIcon.tsx +0 -9
  128. package/src/assets/icons/CaretDoubleLeftBoldIcon.tsx +0 -22
  129. package/src/assets/icons/CaretDoubleRightBoldIcon.tsx +0 -22
  130. package/src/assets/icons/CaretDownBoldIcon.tsx +0 -17
  131. package/src/assets/icons/CaretDownFill.tsx +0 -17
  132. package/src/assets/icons/CaretDownIcon.tsx +0 -9
  133. package/src/assets/icons/CaretLeftBoldIcon.tsx +0 -17
  134. package/src/assets/icons/CaretLeftIcon.tsx +0 -9
  135. package/src/assets/icons/CaretRightBoldIcon.tsx +0 -17
  136. package/src/assets/icons/CaretUpBoldIcon.tsx +0 -17
  137. package/src/assets/icons/CaretUpIcon.tsx +0 -9
  138. package/src/assets/icons/CheckBoldIcon.tsx +0 -17
  139. package/src/assets/icons/CheckCircleFillIcon.tsx +0 -23
  140. package/src/assets/icons/CheckIcon.tsx +0 -23
  141. package/src/assets/icons/CheckUncheckedBoldIcon.tsx +0 -9
  142. package/src/assets/icons/CircleFilledIcon.tsx +0 -11
  143. package/src/assets/icons/CloseIcon.tsx +0 -9
  144. package/src/assets/icons/CollapseChevronsIcon.tsx +0 -17
  145. package/src/assets/icons/CopyIcon.tsx +0 -23
  146. package/src/assets/icons/ExpandChevronsIcon.tsx +0 -17
  147. package/src/assets/icons/InfoFillIcon.tsx +0 -17
  148. package/src/assets/icons/ListIcon.tsx +0 -17
  149. package/src/assets/icons/MagnifyingGlassIcon.tsx +0 -9
  150. package/src/assets/icons/MapPinAreaIcon.tsx +0 -9
  151. package/src/assets/icons/MinusBoldIcon.tsx +0 -11
  152. package/src/assets/icons/MinusIcon.tsx +0 -9
  153. package/src/assets/icons/NotePencilIcon.tsx +0 -9
  154. package/src/assets/icons/PencilSimpleLineIcon.tsx +0 -23
  155. package/src/assets/icons/PlusBoldIcon.tsx +0 -11
  156. package/src/assets/icons/PlusIcon.tsx +0 -9
  157. package/src/assets/icons/QuestionFillIcon.tsx +0 -23
  158. package/src/assets/icons/QuestionIcon.tsx +0 -9
  159. package/src/assets/icons/ScalesIcon.tsx +0 -9
  160. package/src/assets/icons/ScrollIcon.tsx +0 -9
  161. package/src/assets/icons/ShoppingCartIcon.tsx +0 -16
  162. package/src/assets/icons/SpinnerGapBoldIcon.tsx +0 -17
  163. package/src/assets/icons/TrashIcon.tsx +0 -23
  164. package/src/assets/icons/UploadSimpleIcon.tsx +0 -9
  165. package/src/assets/icons/UserIcon.tsx +0 -17
  166. package/src/assets/icons/WarningCircleIcon.tsx +0 -22
  167. package/src/assets/icons/WarningDiamondFillIcon.tsx +0 -17
  168. package/src/assets/icons/WarningFillIcon.tsx +0 -22
  169. package/src/assets/icons/XCircleFillIcon.tsx +0 -17
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@registrucentras/rc-ses-react-components",
3
3
  "author": "VĮ REGISTRŲ CENTRAS",
4
- "version": "2.3.0",
4
+ "version": "2.5.0",
5
5
  "description": "RC SES React komponentų biblioteka",
6
6
  "type": "module",
7
7
  "private": false,
@@ -50,8 +50,8 @@
50
50
  "peerDependencies": {
51
51
  "@emotion/react": "^11.13.3",
52
52
  "@emotion/styled": "^11.13.0",
53
- "@mui/material": "^9.2.0",
54
- "@mui/system": "^9.2.0",
53
+ "@mui/material": "^9.3.1",
54
+ "@mui/system": "^9.3.0",
55
55
  "@mui/x-date-pickers": "^9.10.1",
56
56
  "date-fns": "^3.6.0 || ^4.0.0",
57
57
  "date-fns-tz": "^3.2.0",
@@ -77,8 +77,8 @@
77
77
  "@eslint/js": "^9.39.5",
78
78
  "@fontsource/public-sans": "^5.3.0",
79
79
  "@microsoft/api-extractor": "^7.58.12",
80
- "@mui/material": "9.2.0",
81
- "@mui/system": "9.2.0",
80
+ "@mui/material": "9.3.1",
81
+ "@mui/system": "9.3.0",
82
82
  "@mui/x-date-pickers": "9.10.1",
83
83
  "@playwright/test": "^1.62.0",
84
84
  "@rollup/plugin-commonjs": "^26.0.3",
@@ -0,0 +1,49 @@
1
+ import { BriefcaseIcon as Briefcase } from '@phosphor-icons/react'
2
+ import { render } from '@testing-library/react'
3
+ import { describe, expect, it } from 'vitest'
4
+
5
+ import createIcon from './createIcon'
6
+
7
+ const renderSvg = (element: React.ReactElement) =>
8
+ render(element).container.querySelector('svg') as SVGSVGElement
9
+
10
+ describe('createIcon', () => {
11
+ it('renders at 24px in the icon color by default', () => {
12
+ const Icon = createIcon(Briefcase)
13
+ const svg = renderSvg(<Icon fillColor='#06a0d4' />)
14
+
15
+ expect(svg).toHaveAttribute('width', '24')
16
+ expect(svg).toHaveAttribute('height', '24')
17
+ expect(svg).toHaveAttribute('fill', '#06a0d4')
18
+ })
19
+
20
+ it('uses the given defaults and still lets callers override them', () => {
21
+ const Icon = createIcon(Briefcase, { size: 16, weight: 'bold' })
22
+ const withDefaults = renderSvg(<Icon />)
23
+ const boldPaths = withDefaults.innerHTML
24
+ const overridden = renderSvg(<Icon size={32} weight='regular' />)
25
+
26
+ expect(withDefaults).toHaveAttribute('width', '16')
27
+ expect(overridden).toHaveAttribute('width', '32')
28
+ expect(overridden.innerHTML).not.toBe(boldPaths)
29
+ })
30
+
31
+ it('passes other SVG props through', () => {
32
+ const Icon = createIcon(Briefcase)
33
+ const svg = renderSvg(<Icon className='custom' aria-hidden='true' />)
34
+
35
+ expect(svg).toHaveClass('custom')
36
+ expect(svg).toHaveAttribute('aria-hidden', 'true')
37
+ })
38
+
39
+ it('names the component after the Phosphor icon and its default weight', () => {
40
+ expect(createIcon(Briefcase).displayName).toBe('BriefcaseIcon')
41
+ expect(createIcon(Briefcase, { weight: 'bold' }).displayName).toBe(
42
+ 'BriefcaseBoldIcon',
43
+ )
44
+ })
45
+
46
+ it('uses an explicit name when given', () => {
47
+ expect(createIcon(Briefcase, { name: 'WorkIcon' }).displayName).toBe('WorkIcon')
48
+ })
49
+ })
@@ -0,0 +1,49 @@
1
+ import type { IconWeight, Icon as PhosphorIcon } from '@phosphor-icons/react'
2
+
3
+ import IconProps from '../IconProps'
4
+
5
+ interface CreateIconOptions {
6
+ size?: number
7
+ weight?: IconWeight
8
+ /** Component name, only needed when it doesn't follow `<Phosphor name><Weight>Icon` */
9
+ name?: string
10
+ }
11
+
12
+ // Phosphor names its components with the `Icon` suffix (`CaretDownIcon`), so a bold
13
+ // variant becomes `CaretDownBoldIcon`, matching how the library names its icons
14
+ const nameFor = (Phosphor: PhosphorIcon, weight: IconWeight) => {
15
+ const base = Phosphor.displayName ?? 'Icon'
16
+ if (weight === 'regular') {
17
+ return base
18
+ }
19
+ return base.replace(/Icon$/, `${weight[0].toUpperCase()}${weight.slice(1)}Icon`)
20
+ }
21
+
22
+ /**
23
+ * Wraps a Phosphor icon in the library's icon API: `fillColor` maps to Phosphor's
24
+ * `color`, and `size`/`weight` fall back to the given defaults. Callers can still
25
+ * override both per use.
26
+ */
27
+ const createIcon = (
28
+ Phosphor: PhosphorIcon,
29
+ {
30
+ size: defaultSize = 24,
31
+ weight: defaultWeight = 'regular',
32
+ name,
33
+ }: CreateIconOptions = {},
34
+ ) => {
35
+ function Icon({
36
+ fillColor,
37
+ size = defaultSize,
38
+ weight = defaultWeight,
39
+ ...rest
40
+ }: IconProps) {
41
+ return <Phosphor {...rest} size={size} weight={weight} color={fillColor} />
42
+ }
43
+
44
+ Icon.displayName = name ?? nameFor(Phosphor, defaultWeight)
45
+
46
+ return Icon
47
+ }
48
+
49
+ export default createIcon
@@ -0,0 +1,162 @@
1
+ import {
2
+ ArrowLeftIcon as ArrowLeft,
3
+ ArrowRightIcon as ArrowRight,
4
+ ArrowsClockwiseIcon as ArrowsClockwise,
5
+ ArrowsInLineVerticalIcon as ArrowsInLineVertical,
6
+ ArrowsOutLineVerticalIcon as ArrowsOutLineVertical,
7
+ BarcodeIcon as Barcode,
8
+ BriefcaseIcon as Briefcase,
9
+ CalendarBlankIcon as CalendarBlank,
10
+ CaretDoubleLeftIcon as CaretDoubleLeft,
11
+ CaretDoubleRightIcon as CaretDoubleRight,
12
+ CaretDownIcon as CaretDown,
13
+ CaretLeftIcon as CaretLeft,
14
+ CaretRightIcon as CaretRight,
15
+ CaretUpIcon as CaretUp,
16
+ CheckIcon as Check,
17
+ CheckCircleIcon as CheckCircle,
18
+ CheckSquareIcon as CheckSquare,
19
+ CircleIcon as Circle,
20
+ ClockIcon as Clock,
21
+ CopyIcon as Copy,
22
+ EnvelopeSimpleIcon as EnvelopeSimple,
23
+ InfoIcon as Info,
24
+ ListIcon as List,
25
+ MagnifyingGlassIcon as MagnifyingGlass,
26
+ MapPinIcon as MapPin,
27
+ MapPinAreaIcon as MapPinArea,
28
+ MinusIcon as Minus,
29
+ NotePencilIcon as NotePencil,
30
+ PencilSimpleLineIcon as PencilSimpleLine,
31
+ PhoneIcon as Phone,
32
+ PhoneCallIcon as PhoneCall,
33
+ PlusIcon as Plus,
34
+ QuestionIcon as Question,
35
+ ScalesIcon as Scales,
36
+ ScrollIcon as Scroll,
37
+ ShoppingCartIcon as ShoppingCart,
38
+ SpinnerGapIcon as SpinnerGap,
39
+ SquareIcon as Square,
40
+ TrashIcon as Trash,
41
+ UploadSimpleIcon as UploadSimple,
42
+ UserIcon as User,
43
+ UserListIcon as UserList,
44
+ WarningIcon as Warning,
45
+ WarningCircleIcon as WarningCircle,
46
+ WarningDiamondIcon as WarningDiamond,
47
+ XIcon as X,
48
+ XCircleIcon as XCircle,
49
+ } from '@phosphor-icons/react'
50
+
51
+ import createIcon from './createIcon'
52
+
53
+ // One line per icon. Pass `{ size, weight }` only when the default (24, regular) differs,
54
+ // and `name` only when the export name doesn't follow `<Phosphor name><Weight>Icon`.
55
+ // The pure annotation lets consumers' bundlers drop the icons they don't import.
56
+ export const ArrowLeftIcon = /* @__PURE__ */ createIcon(ArrowLeft)
57
+ export const ArrowRightIcon = /* @__PURE__ */ createIcon(ArrowRight)
58
+ export const ArrowsClockwiseIcon = /* @__PURE__ */ createIcon(ArrowsClockwise)
59
+ export const BarcodeIcon = /* @__PURE__ */ createIcon(Barcode)
60
+ export const BriefcaseIcon = /* @__PURE__ */ createIcon(Briefcase)
61
+ export const CalendarBlankIcon = /* @__PURE__ */ createIcon(CalendarBlank)
62
+ export const CaretDoubleLeftBoldIcon = /* @__PURE__ */ createIcon(CaretDoubleLeft, {
63
+ size: 16,
64
+ weight: 'bold',
65
+ })
66
+ export const CaretDoubleRightBoldIcon = /* @__PURE__ */ createIcon(CaretDoubleRight, {
67
+ size: 16,
68
+ weight: 'bold',
69
+ })
70
+ export const CaretDownBoldIcon = /* @__PURE__ */ createIcon(CaretDown, {
71
+ size: 16,
72
+ weight: 'bold',
73
+ })
74
+ export const CaretDownFill = /* @__PURE__ */ createIcon(CaretDown, {
75
+ weight: 'fill',
76
+ name: 'CaretDownFill',
77
+ })
78
+ export const CaretDownIcon = /* @__PURE__ */ createIcon(CaretDown)
79
+ export const CaretLeftBoldIcon = /* @__PURE__ */ createIcon(CaretLeft, {
80
+ size: 16,
81
+ weight: 'bold',
82
+ })
83
+ export const CaretLeftIcon = /* @__PURE__ */ createIcon(CaretLeft, { size: 16 })
84
+ export const CaretRightBoldIcon = /* @__PURE__ */ createIcon(CaretRight, {
85
+ size: 16,
86
+ weight: 'bold',
87
+ })
88
+ export const CaretUpBoldIcon = /* @__PURE__ */ createIcon(CaretUp, {
89
+ size: 16,
90
+ weight: 'bold',
91
+ })
92
+ export const CaretUpIcon = /* @__PURE__ */ createIcon(CaretUp, { size: 16 })
93
+ export const CheckBoldIcon = /* @__PURE__ */ createIcon(CheckSquare, {
94
+ weight: 'fill',
95
+ name: 'CheckBoldIcon',
96
+ })
97
+ export const CheckCircleFillIcon = /* @__PURE__ */ createIcon(CheckCircle, {
98
+ weight: 'fill',
99
+ })
100
+ export const CheckIcon = /* @__PURE__ */ createIcon(Check)
101
+ export const CheckUncheckedBoldIcon = /* @__PURE__ */ createIcon(Square, {
102
+ name: 'CheckUncheckedBoldIcon',
103
+ })
104
+ export const CircleFilledIcon = /* @__PURE__ */ createIcon(Circle, {
105
+ weight: 'fill',
106
+ name: 'CircleFilledIcon',
107
+ })
108
+ export const ClockIcon = /* @__PURE__ */ createIcon(Clock)
109
+ export const CloseIcon = /* @__PURE__ */ createIcon(X, { name: 'CloseIcon' })
110
+ export const CollapseChevronsIcon = /* @__PURE__ */ createIcon(ArrowsInLineVertical, {
111
+ size: 16,
112
+ weight: 'bold',
113
+ name: 'CollapseChevronsIcon',
114
+ })
115
+ export const CopyIcon = /* @__PURE__ */ createIcon(Copy)
116
+ export const EnvelopeSimpleIcon = /* @__PURE__ */ createIcon(EnvelopeSimple)
117
+ export const ExpandChevronsIcon = /* @__PURE__ */ createIcon(ArrowsOutLineVertical, {
118
+ size: 16,
119
+ weight: 'bold',
120
+ name: 'ExpandChevronsIcon',
121
+ })
122
+ export const InfoFillIcon = /* @__PURE__ */ createIcon(Info, { weight: 'fill' })
123
+ export const InfoIcon = /* @__PURE__ */ createIcon(Info)
124
+ export const ListIcon = /* @__PURE__ */ createIcon(List)
125
+ export const MagnifyingGlassIcon = /* @__PURE__ */ createIcon(MagnifyingGlass)
126
+ export const MapPinAreaIcon = /* @__PURE__ */ createIcon(MapPinArea)
127
+ export const MapPinIcon = /* @__PURE__ */ createIcon(MapPin)
128
+ export const MinusBoldIcon = /* @__PURE__ */ createIcon(Minus, {
129
+ size: 16,
130
+ weight: 'bold',
131
+ })
132
+ export const MinusIcon = /* @__PURE__ */ createIcon(Minus, { size: 16 })
133
+ export const NotePencilIcon = /* @__PURE__ */ createIcon(NotePencil, { size: 16 })
134
+ export const PencilSimpleLineIcon = /* @__PURE__ */ createIcon(PencilSimpleLine)
135
+ export const PhoneCallIcon = /* @__PURE__ */ createIcon(PhoneCall)
136
+ export const PhoneIcon = /* @__PURE__ */ createIcon(Phone)
137
+ export const PlusBoldIcon = /* @__PURE__ */ createIcon(Plus, { size: 16, weight: 'bold' })
138
+ export const PlusIcon = /* @__PURE__ */ createIcon(Plus, { size: 16 })
139
+ export const QuestionFillIcon = /* @__PURE__ */ createIcon(Question, {
140
+ size: 16,
141
+ weight: 'fill',
142
+ })
143
+ export const QuestionIcon = /* @__PURE__ */ createIcon(Question, { size: 16 })
144
+ export const ScalesIcon = /* @__PURE__ */ createIcon(Scales)
145
+ export const ScrollIcon = /* @__PURE__ */ createIcon(Scroll)
146
+ export const ShoppingCartIcon = /* @__PURE__ */ createIcon(ShoppingCart)
147
+ export const SpinnerGapBoldIcon = /* @__PURE__ */ createIcon(SpinnerGap, {
148
+ weight: 'bold',
149
+ })
150
+ export const TrashIcon = /* @__PURE__ */ createIcon(Trash)
151
+ export const UploadSimpleIcon = /* @__PURE__ */ createIcon(UploadSimple)
152
+ export const UserIcon = /* @__PURE__ */ createIcon(User)
153
+ export const UserListIcon = /* @__PURE__ */ createIcon(UserList)
154
+ export const WarningCircleIcon = /* @__PURE__ */ createIcon(WarningCircle, {
155
+ weight: 'fill',
156
+ name: 'WarningCircleIcon',
157
+ })
158
+ export const WarningDiamondFillIcon = /* @__PURE__ */ createIcon(WarningDiamond, {
159
+ weight: 'fill',
160
+ })
161
+ export const WarningFillIcon = /* @__PURE__ */ createIcon(Warning, { weight: 'fill' })
162
+ export const XCircleFillIcon = /* @__PURE__ */ createIcon(XCircle, { weight: 'fill' })
@@ -1,7 +1,7 @@
1
1
  import { Accordion, AccordionDetails, AccordionSummary } from '@mui/material'
2
2
  import React from 'react'
3
3
 
4
- import CaretDownIcon from '@/assets/icons/CaretDownIcon'
4
+ import { CaretDownIcon } from '@/assets/icons/phosphorIcons'
5
5
 
6
6
  import useAccordionController from './hooks/useAccordionController'
7
7
 
@@ -2,9 +2,7 @@ import { Avatar, Box, IconButton, Radio, Stack, Typography } from '@mui/material
2
2
  import { RefObject } from 'react'
3
3
  import { useTranslation } from 'react-i18next'
4
4
 
5
- import CaretDownIcon from '@/assets/icons/CaretDownIcon'
6
- import CaretUpIcon from '@/assets/icons/CaretUpIcon'
7
- import ListIcon from '@/assets/icons/ListIcon'
5
+ import { CaretDownIcon, CaretUpIcon, ListIcon } from '@/assets/icons/phosphorIcons'
8
6
  import RcSesSimpleCheckbox from '@/components/form/inputs/SimpleCheckbox'
9
7
  import palette from '@/theme/palette'
10
8
 
@@ -1,10 +1,12 @@
1
1
  import { Box, IconButton, Radio, Stack, Typography } from '@mui/material'
2
2
  import { useTranslation } from 'react-i18next'
3
3
 
4
- import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
5
- import MinusRegularIcon from '@/assets/icons/MinusIcon'
6
- import PlusRegularIcon from '@/assets/icons/PlusIcon'
7
- import TrashIcon from '@/assets/icons/TrashIcon'
4
+ import {
5
+ CaretRightBoldIcon,
6
+ MinusIcon as MinusRegularIcon,
7
+ PlusIcon as PlusRegularIcon,
8
+ TrashIcon,
9
+ } from '@/assets/icons/phosphorIcons'
8
10
  import RcSesBadge, { type RcSesBadgeProps } from '@/components/common/Badge'
9
11
  import RcSesButton from '@/components/common/Button'
10
12
  import RcSesSwitch from '@/components/common/Switch'
@@ -3,9 +3,11 @@ import { fireEvent, render, screen, within } from '@testing-library/react'
3
3
  import { type ReactElement, useState } from 'react'
4
4
  import { describe, expect, test, vi } from 'vitest'
5
5
 
6
- import NotePencilIcon from '@/assets/icons/NotePencilIcon'
7
- import PencilSimpleLineIcon from '@/assets/icons/PencilSimpleLineIcon'
8
- import TrashIcon from '@/assets/icons/TrashIcon'
6
+ import {
7
+ NotePencilIcon,
8
+ PencilSimpleLineIcon,
9
+ TrashIcon,
10
+ } from '@/assets/icons/phosphorIcons'
9
11
  import theme from '@/theme/light'
10
12
 
11
13
  import AdvancedListItem from '.'
@@ -1,4 +1,5 @@
1
1
  import { fireEvent, render, screen } from '@testing-library/react'
2
+ import { createPortal } from 'react-dom'
2
3
  import { describe, expect, it, vi } from 'vitest'
3
4
 
4
5
  import AdvancedListItemShell from '.'
@@ -202,6 +203,28 @@ describe('AdvancedListItemShell', () => {
202
203
  expect(onClick).not.toHaveBeenCalled()
203
204
  })
204
205
 
206
+ it('does not call onClick when clicked on portalled content from slot (dropdown option)', () => {
207
+ const onClick = vi.fn()
208
+ render(
209
+ <AdvancedListItemShell
210
+ content={<span>Content</span>}
211
+ isExpanded
212
+ onClick={onClick}
213
+ expanded={createPortal(
214
+ <ul role='listbox'>
215
+ <li role='option' aria-selected={false}>
216
+ Pasas
217
+ </li>
218
+ </ul>,
219
+ document.body,
220
+ )}
221
+ />,
222
+ )
223
+
224
+ fireEvent.click(screen.getByRole('option', { name: 'Pasas' }))
225
+ expect(onClick).not.toHaveBeenCalled()
226
+ })
227
+
205
228
  it('does not expose role="button" on the root, even when clickable', () => {
206
229
  render(
207
230
  <AdvancedListItemShell
@@ -99,6 +99,12 @@ const AdvancedListItemShell = ({
99
99
 
100
100
  const target = event.target as HTMLElement
101
101
 
102
+ // Skip clicks on portalled content (dropdown poppers, dialogs) rendered from a slot,
103
+ // React bubbles them up
104
+ if (!rootRef.current?.contains(target)) {
105
+ return
106
+ }
107
+
102
108
  // Skip clicks on interactive elements that have their own handlers. The root itself
103
109
  // is role="button" in expandable rows, so it is excluded.
104
110
  const control = target.closest('button, a, input, select, textarea, [role="button"]')
@@ -8,7 +8,7 @@ import {
8
8
  } from '@mui/material'
9
9
  import { useTranslation } from 'react-i18next'
10
10
 
11
- import CloseIcon from '@/assets/icons/CloseIcon'
11
+ import { CloseIcon } from '@/assets/icons/phosphorIcons'
12
12
 
13
13
  type Props = Omit<MuiAlertProps, 'onClose'> & {
14
14
  container?: boolean | ContainerProps
@@ -3,6 +3,7 @@ import { fireEvent, render, screen } from '@testing-library/react'
3
3
  import { ReactElement } from 'react'
4
4
  import { beforeEach, describe, expect, it, vi } from 'vitest'
5
5
 
6
+ import { CheckIcon } from '@/assets/icons/phosphorIcons'
6
7
  import i18n from '@/i18n/i18n'
7
8
  import theme from '@/theme/light'
8
9
 
@@ -63,6 +64,21 @@ describe('RcSesBadge', () => {
63
64
  expect(container.querySelector('svg')).not.toBeInTheDocument()
64
65
  })
65
66
 
67
+ it('renders custom icon over default icon', () => {
68
+ const { container } = renderBadge(
69
+ <RcSesBadge
70
+ label='Label'
71
+ variant='neutral'
72
+ size='regular'
73
+ showIcon
74
+ icon={<CheckIcon data-testid='custom-icon' />}
75
+ />,
76
+ )
77
+
78
+ expect(screen.getByTestId('custom-icon')).toBeInTheDocument()
79
+ expect(container.querySelectorAll('svg').length).toBe(1)
80
+ })
81
+
66
82
  it('does not render a close button by default', () => {
67
83
  renderBadge(<RcSesBadge label='Label' variant='neutral' size='regular' />)
68
84
 
@@ -1,8 +1,7 @@
1
1
  import { Box } from '@mui/material'
2
2
  import { useTranslation } from 'react-i18next'
3
3
 
4
- import CircleFilledIcon from '@/assets/icons/CircleFilledIcon'
5
- import CloseIcon from '@/assets/icons/CloseIcon'
4
+ import { CircleFilledIcon, CloseIcon } from '@/assets/icons/phosphorIcons'
6
5
  import { common, error, grey, primary, secondary, warning } from '@/theme/palette'
7
6
 
8
7
  export interface RcSesBadgeProps {
@@ -10,6 +9,7 @@ export interface RcSesBadgeProps {
10
9
  variant: 'neutral' | 'success' | 'warning' | 'error' | 'info' | 'brand'
11
10
  size: 'small' | 'regular'
12
11
  showIcon?: boolean
12
+ icon?: React.ReactNode
13
13
  showClose?: boolean
14
14
  onClose?: () => void
15
15
  }
@@ -83,7 +83,15 @@ const sizeStyles: Record<RcSesBadgeProps['size'], SizeStyle> = {
83
83
  }
84
84
 
85
85
  function RcSesBadge(props: RcSesBadgeProps) {
86
- const { label, variant, size, showIcon = true, showClose = false, onClose } = props
86
+ const {
87
+ label,
88
+ variant,
89
+ size,
90
+ showIcon = true,
91
+ icon,
92
+ showClose = false,
93
+ onClose,
94
+ } = props
87
95
  const { t } = useTranslation('input', { keyPrefix: 'components.RcSesBadge' })
88
96
 
89
97
  const variantStyle = variantStyles[variant]
@@ -105,15 +113,30 @@ function RcSesBadge(props: RcSesBadgeProps) {
105
113
 
106
114
  return (
107
115
  <Box sx={baseStyle}>
108
- {showIcon && (
109
- <CircleFilledIcon
110
- size={14}
111
- fillColor={variantStyle.iconColor}
112
- aria-hidden
113
- focusable={false}
114
- style={{ flexShrink: 0 }}
115
- />
116
- )}
116
+ {showIcon &&
117
+ (icon ? (
118
+ <Box
119
+ aria-hidden
120
+ sx={{
121
+ display: 'flex',
122
+ alignItems: 'center',
123
+ justifyContent: 'center',
124
+ width: 14,
125
+ height: 14,
126
+ flexShrink: 0,
127
+ }}
128
+ >
129
+ {icon}
130
+ </Box>
131
+ ) : (
132
+ <CircleFilledIcon
133
+ size={14}
134
+ fillColor={variantStyle.iconColor}
135
+ aria-hidden
136
+ focusable={false}
137
+ style={{ flexShrink: 0 }}
138
+ />
139
+ ))}
117
140
  <Box
118
141
  component='span'
119
142
  title={label}
@@ -3,8 +3,7 @@ import { PopoverProps } from '@mui/material/Popover'
3
3
  import React from 'react'
4
4
  import { useTranslation } from 'react-i18next'
5
5
 
6
- import QuestionFillIcon from '@/assets/icons/QuestionFillIcon'
7
- import QuestionIcon from '@/assets/icons/QuestionIcon'
6
+ import { QuestionFillIcon, QuestionIcon } from '@/assets/icons/phosphorIcons'
8
7
  import palette from '@/theme/palette'
9
8
 
10
9
  import RcSesButton from '.'
@@ -1,8 +1,7 @@
1
1
  import { Box, Pagination, useMediaQuery, useTheme } from '@mui/material'
2
2
  import { useState } from 'react'
3
3
 
4
- import ArrowLeftIcon from '@/assets/icons/ArrowLeftIcon'
5
- import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
4
+ import { ArrowLeftIcon, ArrowRightIcon } from '@/assets/icons/phosphorIcons'
6
5
 
7
6
  import DataPaginationSkeleton from './components/DataPaginationSkeleton'
8
7
  import PaginationButton from './components/PaginationButton'
@@ -4,7 +4,7 @@ import { render } from '@testing-library/react'
4
4
  import { type ReactElement } from 'react'
5
5
  import { describe, expect, test } from 'vitest'
6
6
 
7
- import InfoFillIcon from '@/assets/icons/InfoFillIcon'
7
+ import { InfoFillIcon } from '@/assets/icons/phosphorIcons'
8
8
  import theme from '@/theme/light'
9
9
 
10
10
  import RcSesIconWithSquareBackground from '.'
@@ -1,7 +1,7 @@
1
1
  import { Box, Skeleton, Stack, Typography } from '@mui/material'
2
2
  import { ElementType } from 'react'
3
3
 
4
- import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
4
+ import { ArrowRightIcon } from '@/assets/icons/phosphorIcons'
5
5
  import { subcard } from '@/theme/cards'
6
6
  import palette from '@/theme/palette'
7
7
 
@@ -9,7 +9,7 @@ import {
9
9
  import { useLayoutEffect, useRef, useState } from 'react'
10
10
  import { useTranslation } from 'react-i18next'
11
11
 
12
- import CloseIcon from '@/assets/icons/CloseIcon'
12
+ import { CloseIcon } from '@/assets/icons/phosphorIcons'
13
13
  import { grey } from '@/theme/palette'
14
14
 
15
15
  import RcSesButton from '../Button'
@@ -1,9 +1,11 @@
1
1
  import { Box, Button, Typography } from '@mui/material'
2
2
  import { useTranslation } from 'react-i18next'
3
3
 
4
- import ArrowLeftIcon from '@/assets/icons/ArrowLeftIcon'
5
- import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
6
- import ShoppingCartIcon from '@/assets/icons/ShoppingCartIcon'
4
+ import {
5
+ ArrowLeftIcon,
6
+ ArrowRightIcon,
7
+ ShoppingCartIcon,
8
+ } from '@/assets/icons/phosphorIcons'
7
9
  import RcSesCardFooter from '@/components/common/CardShell/CardFooter'
8
10
  import { typography } from '@/theme/light/MuiTypography'
9
11
 
@@ -4,7 +4,7 @@ import { useForkRef } from '@mui/material/utils'
4
4
  import React from 'react'
5
5
  import { useTranslation } from 'react-i18next'
6
6
 
7
- import QuestionIcon from '@/assets/icons/QuestionIcon'
7
+ import { QuestionIcon } from '@/assets/icons/phosphorIcons'
8
8
 
9
9
  export type RcSesTooltipProps = {
10
10
  title: string
@@ -7,8 +7,7 @@ import {
7
7
  import React, { useEffect, useMemo } from 'react'
8
8
  import { UseControllerProps, useController } from 'react-hook-form'
9
9
 
10
- import CheckBoldIcon from '@/assets/icons/CheckBoldIcon'
11
- import CheckUncheckedBoldIcon from '@/assets/icons/CheckUncheckedBoldIcon'
10
+ import { CheckBoldIcon, CheckUncheckedBoldIcon } from '@/assets/icons/phosphorIcons'
12
11
  import RcSesFormControlLabel from '@/components/form/inputs/FormControlLabel'
13
12
  import getLoadingIcon from '@/components/utils/loading'
14
13
  import palette from '@/theme/palette'
@@ -7,10 +7,12 @@ import { usePickerAdapter, usePickerTranslations } from '@mui/x-date-pickers/hoo
7
7
  import React from 'react'
8
8
  import { useTranslation } from 'react-i18next'
9
9
 
10
- import CaretDoubleLeftBoldIcon from '@/assets/icons/CaretDoubleLeftBoldIcon'
11
- import CaretDoubleRightBoldIcon from '@/assets/icons/CaretDoubleRightBoldIcon'
12
- import CaretLeftBoldIcon from '@/assets/icons/CaretLeftBoldIcon'
13
- import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
10
+ import {
11
+ CaretDoubleLeftBoldIcon,
12
+ CaretDoubleRightBoldIcon,
13
+ CaretLeftBoldIcon,
14
+ CaretRightBoldIcon,
15
+ } from '@/assets/icons/phosphorIcons'
14
16
  import palette from '@/theme/palette'
15
17
 
16
18
  const CustomCalendarHeaderRoot = styled('div')({
@@ -9,8 +9,7 @@ import { UseControllerProps, useController } from 'react-hook-form'
9
9
  import { useTranslation } from 'react-i18next'
10
10
  import { v4 as uuidv4 } from 'uuid'
11
11
 
12
- import CalendarBlankIcon from '@/assets/icons/CalendarBlankIcon'
13
- import XCircleFillIcon from '@/assets/icons/XCircleFillIcon'
12
+ import { CalendarBlankIcon, XCircleFillIcon } from '@/assets/icons/phosphorIcons'
14
13
  import theme from '@/theme/light'
15
14
 
16
15
  import RcSesFormControlWrapper, {
@@ -6,8 +6,7 @@ import { UseControllerProps, useController } from 'react-hook-form'
6
6
  import { Trans, useTranslation } from 'react-i18next'
7
7
  import { v4 as uuidv4 } from 'uuid'
8
8
 
9
- import UploadSimpleIcon from '@/assets/icons/UploadSimpleIcon'
10
- import XCircleFillIcon from '@/assets/icons/XCircleFillIcon'
9
+ import { UploadSimpleIcon, XCircleFillIcon } from '@/assets/icons/phosphorIcons'
11
10
  import IconWithCircularBackground from '@/components/common/IconWithCircularBackground'
12
11
  import palette from '@/theme/palette'
13
12
 
@@ -4,7 +4,7 @@ import { UseControllerProps, useController } from 'react-hook-form'
4
4
  import { useTranslation } from 'react-i18next'
5
5
  import { v4 as uuidv4 } from 'uuid'
6
6
 
7
- import UploadSimpleIcon from '@/assets/icons/UploadSimpleIcon'
7
+ import { UploadSimpleIcon } from '@/assets/icons/phosphorIcons'
8
8
  import palette from '@/theme/palette'
9
9
 
10
10
  import RcSesFormControlWrapper, {