@registrucentras/rc-ses-react-components 2.7.0 → 2.7.3

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/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.7.0",
4
+ "version": "2.7.3",
5
5
  "description": "RC SES React komponentų biblioteka",
6
6
  "type": "module",
7
7
  "private": false,
@@ -95,6 +95,7 @@
95
95
  "@testing-library/react": "^16.3.0",
96
96
  "@trivago/prettier-plugin-sort-imports": "^6.0.2",
97
97
  "@types/js-cookie": "^3.0.6",
98
+ "@types/node": "^24.19.2",
98
99
  "@types/react": "^18.3.3",
99
100
  "@types/react-dom": "^18.3.0",
100
101
  "@vitejs/plugin-react": "^4.3.4",
@@ -20,6 +20,9 @@ import {
20
20
  ClockIcon as Clock,
21
21
  CopyIcon as Copy,
22
22
  EnvelopeSimpleIcon as EnvelopeSimple,
23
+ EyeIcon as Eye,
24
+ FileIcon as File,
25
+ FilePdfIcon as FilePdf,
23
26
  FunnelIcon as Funnel,
24
27
  InfoIcon as Info,
25
28
  ListIcon as List,
@@ -36,8 +39,10 @@ import {
36
39
  ScalesIcon as Scales,
37
40
  ScrollIcon as Scroll,
38
41
  ShoppingCartIcon as ShoppingCart,
42
+ SignatureIcon as Signature,
39
43
  SpinnerGapIcon as SpinnerGap,
40
44
  SquareIcon as Square,
45
+ TagIcon as Tag,
41
46
  TrashIcon as Trash,
42
47
  UploadSimpleIcon as UploadSimple,
43
48
  UserIcon as User,
@@ -120,6 +125,9 @@ export const ExpandChevronsIcon = /* @__PURE__ */ createIcon(ArrowsOutLineVertic
120
125
  weight: 'bold',
121
126
  name: 'ExpandChevronsIcon',
122
127
  })
128
+ export const EyeIcon = /* @__PURE__ */ createIcon(Eye)
129
+ export const FileIcon = /* @__PURE__ */ createIcon(File)
130
+ export const FilePdfIcon = /* @__PURE__ */ createIcon(FilePdf)
123
131
  export const FunnelIcon = /* @__PURE__ */ createIcon(Funnel)
124
132
  export const InfoFillIcon = /* @__PURE__ */ createIcon(Info, { weight: 'fill' })
125
133
  export const InfoIcon = /* @__PURE__ */ createIcon(Info)
@@ -146,9 +154,11 @@ export const QuestionIcon = /* @__PURE__ */ createIcon(Question, { size: 16 })
146
154
  export const ScalesIcon = /* @__PURE__ */ createIcon(Scales)
147
155
  export const ScrollIcon = /* @__PURE__ */ createIcon(Scroll)
148
156
  export const ShoppingCartIcon = /* @__PURE__ */ createIcon(ShoppingCart)
157
+ export const SignatureIcon = /* @__PURE__ */ createIcon(Signature)
149
158
  export const SpinnerGapBoldIcon = /* @__PURE__ */ createIcon(SpinnerGap, {
150
159
  weight: 'bold',
151
160
  })
161
+ export const TagIcon = /* @__PURE__ */ createIcon(Tag)
152
162
  export const TrashIcon = /* @__PURE__ */ createIcon(Trash)
153
163
  export const UploadSimpleIcon = /* @__PURE__ */ createIcon(UploadSimple)
154
164
  export const UserIcon = /* @__PURE__ */ createIcon(User)
@@ -89,6 +89,17 @@ describe('RcSesPhoneInputFormControl', () => {
89
89
  expect(screen.queryByText('Lithuania')).not.toBeInTheDocument()
90
90
  })
91
91
 
92
+ test('shows the translated empty state when the search matches nothing', () => {
93
+ render(<TestComponent />)
94
+ openDropdown()
95
+
96
+ fireEvent.change(screen.getByPlaceholderText('search'), {
97
+ target: { value: 'XYZXYZ' },
98
+ })
99
+
100
+ expect(screen.getByText('noOptionsText')).toBeInTheDocument()
101
+ })
102
+
92
103
  test('selecting a country updates the dial code and mask', () => {
93
104
  render(<TestComponent />)
94
105
  openDropdown()
@@ -223,6 +223,7 @@ function RcSesPhoneInputFormControl(props: Props) {
223
223
  }
224
224
  getOptionLabel={(option) => option.name}
225
225
  isOptionEqualToValue={(o, v) => o.code === v.code}
226
+ noOptionsText={t('noOptionsText')}
226
227
  onChange={(e, selection) => {
227
228
  e.preventDefault()
228
229
  setAnchorEl(null)
@@ -195,6 +195,17 @@ describe('RcSesSelect', () => {
195
195
  expect(screen.getByRole('combobox')).toHaveAttribute('readonly')
196
196
  })
197
197
 
198
+ test('shows a Lithuanian empty state when the typed text matches no option', async () => {
199
+ render(<TestWrapper />)
200
+
201
+ const input = screen.getByRole('combobox')
202
+ fireEvent.mouseDown(input)
203
+ fireEvent.change(input, { target: { value: 'JSD' } })
204
+
205
+ expect(await screen.findByText('Rezultatų nerasta')).toBeInTheDocument()
206
+ expect(screen.queryByText('No options')).not.toBeInTheDocument()
207
+ })
208
+
198
209
  test('drops the value from the form by default when the field unmounts', () => {
199
210
  render(<UnregisterTestWrapper />)
200
211
 
@@ -404,6 +404,8 @@ function RcSesSelect<TFieldValues extends FieldValues = FieldValues>(
404
404
  clearOnBlur={false}
405
405
  handleHomeEndKeys={false}
406
406
  loading={loading}
407
+ loadingText={t('loadingText')}
408
+ noOptionsText={t('noOptionsText')}
407
409
  popupIcon={<CaretDownIcon size={20} fillColor={palette.grey['600']} />}
408
410
  value={resolvedValue}
409
411
  inputValue={resolvedInputValue}
@@ -221,7 +221,6 @@ function RcSesBottomSheet({
221
221
  <Box
222
222
  sx={{
223
223
  display: 'flex',
224
- justifyContent: 'flex-end',
225
224
  gap: 1.5,
226
225
  padding: SHEET.actionsPadding,
227
226
  flexShrink: 0,
@@ -233,6 +232,7 @@ function RcSesBottomSheet({
233
232
  color='grey'
234
233
  onClick={onSecondaryAction}
235
234
  disabled={secondaryActionDisabled}
235
+ sx={{ flex: 1 }}
236
236
  >
237
237
  {secondaryActionLabel}
238
238
  </RcSesButton>
@@ -242,6 +242,7 @@ function RcSesBottomSheet({
242
242
  variant='contained'
243
243
  onClick={onPrimaryAction}
244
244
  disabled={primaryActionDisabled}
245
+ sx={{ flex: 1 }}
245
246
  >
246
247
  {primaryActionLabel}
247
248
  </RcSesButton>
@@ -126,16 +126,7 @@ const RcSesDrawer = ({
126
126
  gap: '1rem',
127
127
  }}
128
128
  >
129
- <Typography
130
- id={headerId}
131
- component='h2'
132
- sx={{
133
- fontSize: '14px',
134
- fontStyle: 'normal',
135
- fontWeight: 600,
136
- lineHeight: '20px',
137
- }}
138
- >
129
+ <Typography id={headerId} variant='h6'>
139
130
  {title}
140
131
  </Typography>
141
132
  <RcSesButton
@@ -48,7 +48,8 @@
48
48
  "countrySelectorLabel": "Select country phone code"
49
49
  },
50
50
  "search": "Search",
51
- "invalid": "Invalid phone number format"
51
+ "invalid": "Invalid phone number format",
52
+ "noOptionsText": "No results found"
52
53
  },
53
54
 
54
55
  "RcSesSearchableField": {
@@ -58,7 +59,9 @@
58
59
 
59
60
  "RcSesSelect": {
60
61
  "searchPlaceholder": "Search",
61
- "selectAllLabel": "All"
62
+ "selectAllLabel": "All",
63
+ "noOptionsText": "No results found",
64
+ "loadingText": "Loading..."
62
65
  },
63
66
 
64
67
  "RcSesSearchInput": {
@@ -48,7 +48,8 @@
48
48
  "countrySelectorLabel": "Šalies telefono numerio kodo pasirinkimas"
49
49
  },
50
50
  "search": "Ieškoti",
51
- "invalid": "Klaidingas telefono numerio formatas"
51
+ "invalid": "Klaidingas telefono numerio formatas",
52
+ "noOptionsText": "Rezultatų nerasta"
52
53
  },
53
54
 
54
55
  "RcSesSearchableField": {
@@ -58,7 +59,9 @@
58
59
 
59
60
  "RcSesSelect": {
60
61
  "searchPlaceholder": "Ieškoti",
61
- "selectAllLabel": "Visi"
62
+ "selectAllLabel": "Visi",
63
+ "noOptionsText": "Rezultatų nerasta",
64
+ "loadingText": "Kraunama..."
62
65
  },
63
66
 
64
67
  "RcSesSearchInput": {