@registrucentras/rc-ses-react-components 2.0.0-rc.0 → 2.0.0-rc.1
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/README.md +5 -1
- package/dist/assets/icons/CaretUpBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CaretUpIcon.d.ts +3 -0
- package/dist/assets/icons/ListIcon.d.ts +3 -0
- package/dist/assets/icons/MinusIcon.d.ts +3 -0
- package/dist/assets/icons/NotePencilIcon.d.ts +3 -0
- package/dist/assets/icons/PlusIcon.d.ts +3 -0
- package/dist/assets/icons/TrashIcon.d.ts +3 -0
- package/dist/assets/icons/UserIcon.d.ts +3 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.d.ts +106 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.d.ts +12 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.d.ts +7 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/dist/components/common/AdvancedList/components/AdvancedListItem/index.d.ts +4 -0
- package/dist/components/common/AdvancedList/index.d.ts +11 -0
- package/dist/components/common/Button/index.d.ts +13 -3
- package/dist/components/common/SelectableCardList/components/SelectableCardListItem.d.ts +4 -1
- package/dist/components/common/SelectableCardList/index.d.ts +4 -1
- package/dist/components/common/Tooltip/index.d.ts +20 -0
- package/dist/library/icons.d.ts +9 -1
- package/dist/library/index.d.ts +5 -0
- package/dist/library/types.d.ts +2 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +4107 -3246
- package/dist/stories/components/actions/Button.stories.d.ts +4 -3
- package/dist/stories/components/display/AdvancedList.stories.d.ts +32 -0
- package/dist/stories/components/display/AdvancedListItem.stories.d.ts +33 -0
- package/dist/stories/components/display/SelectableCardList.stories.d.ts +8 -1
- package/dist/stories/components/display/Tooltip.stories.d.ts +48 -0
- package/dist/stories/components/inputs/DatePicker.stories.d.ts +23 -0
- package/dist/stories/components/loaders/LoadingSpinner.stories.d.ts +3 -3
- package/dist/stories/components/overlays/Dialog.stories.d.ts +6 -0
- package/dist/stories/components/overlays/Popover.stories.d.ts +12 -0
- package/dist/stories/theme/ThemedMuiComponents.stories.d.ts +25 -0
- package/dist/theme/light/MuiTooltip.d.ts +3 -0
- package/dist/theme/motion.d.ts +16 -0
- package/package.json +2 -1
- package/src/assets/icons/CaretUpBoldIcon.tsx +17 -0
- package/src/assets/icons/CaretUpIcon.tsx +9 -0
- package/src/assets/icons/ListIcon.tsx +17 -0
- package/src/assets/icons/MinusIcon.tsx +9 -0
- package/src/assets/icons/NotePencilIcon.tsx +9 -0
- package/src/assets/icons/PlusIcon.tsx +9 -0
- package/src/assets/icons/TrashIcon.tsx +23 -0
- package/src/assets/icons/UserIcon.tsx +17 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.ts +100 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +224 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +263 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.test.ts +80 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.ts +28 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/index.test.tsx +631 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +332 -0
- package/src/components/common/AdvancedList/index.test.tsx +97 -0
- package/src/components/common/AdvancedList/index.tsx +52 -0
- package/src/components/common/Button/index.tsx +15 -1
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +7 -5
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.test.tsx +50 -0
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +34 -0
- package/src/components/common/SelectableCardList/index.test.tsx +56 -2
- package/src/components/common/SelectableCardList/index.tsx +29 -10
- package/src/components/common/Tooltip/index.test.tsx +85 -0
- package/src/components/common/Tooltip/index.tsx +168 -0
- package/src/components/form/inputs/Select/index.test.tsx +102 -0
- package/src/components/form/inputs/Select/index.tsx +105 -52
- package/src/i18n/namespaces/common/en.json +14 -0
- package/src/i18n/namespaces/common/lt.json +14 -0
- package/src/library/icons.ts +16 -0
- package/src/library/index.ts +5 -0
- package/src/library/types.ts +2 -0
- package/src/setupTests.ts +7 -1
- package/src/stories/components/display/AdvancedList.stories.tsx +529 -0
- package/src/stories/components/display/AdvancedListItem.stories.tsx +653 -0
- package/src/stories/components/display/SelectableCardList.stories.tsx +19 -0
- package/src/stories/components/display/Tooltip.stories.tsx +67 -0
- package/src/stories/components/inputs/DatePicker.stories.tsx +36 -1
- package/src/stories/components/inputs/Select.stories.tsx +38 -2
- package/src/stories/components/overlays/Dialog.stories.tsx +34 -0
- package/src/stories/components/overlays/Popover.stories.tsx +65 -0
- package/src/stories/theme/ThemedMuiComponents.stories.tsx +177 -0
- package/src/theme/light/MuiAutocomplete.ts +3 -1
- package/src/theme/light/MuiInputBase.ts +4 -0
- package/src/theme/light/MuiTooltip.ts +40 -0
- package/src/theme/light/index.tsx +2 -0
- package/src/theme/motion.tsx +10 -0
|
@@ -53,19 +53,22 @@ type Props = Pick<TControllerProps, ImmediateControllerProps> &
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function RcSesSelect(props: Props) {
|
|
56
|
-
const [inputValue, setInputValue] = React.useState('')
|
|
57
56
|
const [dropdownSearchValue, setDropdownSearchValue] = React.useState('')
|
|
58
57
|
const [open, setOpen] = React.useState(false)
|
|
59
58
|
const dropdownSearchOptionValue = '__dropdown-search-option__'
|
|
59
|
+
// rem widths reserved at the end of the input for the clear and dropdown adornments
|
|
60
|
+
const reservedSingleEndAdornmentWidth = 2
|
|
61
|
+
const reservedMultipleTagsEndAdornmentWidth = 2.2
|
|
62
|
+
const reservedMultipleWithCounterEndAdornmentWidth = 3
|
|
60
63
|
const wrapperRef = React.useRef<HTMLDivElement>(null)
|
|
61
64
|
|
|
62
65
|
const {
|
|
63
66
|
multiple = false,
|
|
64
67
|
clearable,
|
|
65
|
-
limitTags = 1,
|
|
66
68
|
control,
|
|
67
69
|
errors,
|
|
68
70
|
label,
|
|
71
|
+
limitTags,
|
|
69
72
|
loading,
|
|
70
73
|
onInputChange,
|
|
71
74
|
options,
|
|
@@ -82,6 +85,7 @@ function RcSesSelect(props: Props) {
|
|
|
82
85
|
const { disabled, name } = fieldProps
|
|
83
86
|
|
|
84
87
|
const id = useMemo(() => fieldProps.id ?? uuidv4(), [fieldProps.id])
|
|
88
|
+
const selectedValueId = useMemo(() => `rc-ses-select-single-value-${id}`, [id])
|
|
85
89
|
|
|
86
90
|
const {
|
|
87
91
|
field: { onChange, value },
|
|
@@ -104,6 +108,20 @@ function RcSesSelect(props: Props) {
|
|
|
104
108
|
return options.find((o) => o.value === value) ?? null
|
|
105
109
|
}, [value, options, multiple])
|
|
106
110
|
|
|
111
|
+
const selectedSingleLabel =
|
|
112
|
+
!multiple && resolvedValue && !Array.isArray(resolvedValue) ? resolvedValue.label : ''
|
|
113
|
+
|
|
114
|
+
const selectedTagCount =
|
|
115
|
+
multiple && Array.isArray(resolvedValue) ? resolvedValue.length : 0
|
|
116
|
+
const hasLimitTagCounter =
|
|
117
|
+
multiple && (limitTags ?? -1) > -1 && selectedTagCount > (limitTags ?? -1)
|
|
118
|
+
const reservedMultipleEndAdornmentWidth = hasLimitTagCounter
|
|
119
|
+
? reservedMultipleWithCounterEndAdornmentWidth
|
|
120
|
+
: reservedMultipleTagsEndAdornmentWidth
|
|
121
|
+
|
|
122
|
+
const [inputValue, setInputValue] = React.useState('')
|
|
123
|
+
const resolvedInputValue = dropdownSearch ? '' : inputValue
|
|
124
|
+
|
|
107
125
|
const searchRowOption = useMemo<Option>(
|
|
108
126
|
() => ({ label: '', value: dropdownSearchOptionValue }),
|
|
109
127
|
[dropdownSearchOptionValue],
|
|
@@ -131,7 +149,10 @@ function RcSesSelect(props: Props) {
|
|
|
131
149
|
}
|
|
132
150
|
}
|
|
133
151
|
|
|
134
|
-
const filteredOptions = useFilteredOptions(
|
|
152
|
+
const filteredOptions = useFilteredOptions(
|
|
153
|
+
options,
|
|
154
|
+
dropdownSearch ? dropdownSearchValue : inputValue,
|
|
155
|
+
)
|
|
135
156
|
|
|
136
157
|
const selectedValues = Array.isArray(value) ? value : []
|
|
137
158
|
const { allSelected: allFilteredSelected, toggle: handleSelectAll } = useSelectAll(
|
|
@@ -141,15 +162,22 @@ function RcSesSelect(props: Props) {
|
|
|
141
162
|
)
|
|
142
163
|
|
|
143
164
|
const filterOptions = (opts: Option[]) => {
|
|
144
|
-
if (
|
|
165
|
+
if (dropdownSearch && !hasCustomGroupBy) {
|
|
166
|
+
const [searchOption, ...realOptions] = opts
|
|
167
|
+
if (!dropdownSearchValue.trim()) return opts
|
|
145
168
|
|
|
146
|
-
|
|
147
|
-
|
|
169
|
+
const filteredValues = new Set(filteredOptions.map((o) => o.value))
|
|
170
|
+
const filtered = realOptions.filter((opt) => filteredValues.has(opt.value))
|
|
148
171
|
|
|
149
|
-
|
|
150
|
-
|
|
172
|
+
return [searchOption, ...filtered]
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (dropdownSearch && hasCustomGroupBy) return opts
|
|
151
176
|
|
|
152
|
-
return
|
|
177
|
+
if (!inputValue.trim() || inputValue === selectedSingleLabel) return opts
|
|
178
|
+
|
|
179
|
+
const filteredValues = new Set(filteredOptions.map((o) => o.value))
|
|
180
|
+
return opts.filter((opt) => filteredValues.has(opt.value))
|
|
153
181
|
}
|
|
154
182
|
|
|
155
183
|
const closeDropdown = () => {
|
|
@@ -157,6 +185,13 @@ function RcSesSelect(props: Props) {
|
|
|
157
185
|
setDropdownSearchValue('')
|
|
158
186
|
}
|
|
159
187
|
|
|
188
|
+
// clear input when dropdown closes
|
|
189
|
+
const closeDropdownWithClear = () => {
|
|
190
|
+
setOpen(false)
|
|
191
|
+
setDropdownSearchValue('')
|
|
192
|
+
setInputValue('')
|
|
193
|
+
}
|
|
194
|
+
|
|
160
195
|
const shouldKeepDropdownOpen = () => {
|
|
161
196
|
const activeEl = document.activeElement
|
|
162
197
|
if (!(activeEl instanceof Element)) return false
|
|
@@ -186,7 +221,7 @@ function RcSesSelect(props: Props) {
|
|
|
186
221
|
open={open}
|
|
187
222
|
onOpen={() => setOpen(true)}
|
|
188
223
|
multiple={multiple}
|
|
189
|
-
limitTags={multiple ? limitTags : undefined}
|
|
224
|
+
limitTags={multiple ? (limitTags ?? -1) : undefined}
|
|
190
225
|
disableCloseOnSelect={multiple}
|
|
191
226
|
disabled={disabled}
|
|
192
227
|
disableClearable={clearable === false}
|
|
@@ -198,12 +233,11 @@ function RcSesSelect(props: Props) {
|
|
|
198
233
|
handleHomeEndKeys={false}
|
|
199
234
|
loading={loading}
|
|
200
235
|
value={resolvedValue}
|
|
201
|
-
inputValue={
|
|
236
|
+
inputValue={resolvedInputValue}
|
|
202
237
|
onChange={handleChange}
|
|
203
238
|
onInputChange={(event, val, reason) => {
|
|
204
239
|
if (dropdownSearch) return
|
|
205
|
-
|
|
206
|
-
setInputValue(val ?? '')
|
|
240
|
+
setInputValue(val)
|
|
207
241
|
onInputChange?.(event, val, reason)
|
|
208
242
|
}}
|
|
209
243
|
onClose={(_event, reason) => {
|
|
@@ -211,7 +245,7 @@ function RcSesSelect(props: Props) {
|
|
|
211
245
|
deferCloseCheck()
|
|
212
246
|
return
|
|
213
247
|
}
|
|
214
|
-
|
|
248
|
+
closeDropdownWithClear()
|
|
215
249
|
}}
|
|
216
250
|
isOptionEqualToValue={(option, val) => option.value === val.value}
|
|
217
251
|
getOptionLabel={(option) => option.label}
|
|
@@ -243,9 +277,9 @@ function RcSesSelect(props: Props) {
|
|
|
243
277
|
{...params}
|
|
244
278
|
disabled={disabled}
|
|
245
279
|
error={hasError}
|
|
246
|
-
placeholder={placeholder}
|
|
280
|
+
placeholder={!multiple && selectedSingleLabel ? undefined : placeholder}
|
|
247
281
|
sx={{
|
|
248
|
-
...(dropdownSearch
|
|
282
|
+
...(dropdownSearch || (!multiple && selectedSingleLabel)
|
|
249
283
|
? {
|
|
250
284
|
'& .MuiInputBase-input': {
|
|
251
285
|
caretColor: 'transparent',
|
|
@@ -256,36 +290,47 @@ function RcSesSelect(props: Props) {
|
|
|
256
290
|
? {
|
|
257
291
|
'& .MuiAutocomplete-inputRoot': {
|
|
258
292
|
alignItems: 'center',
|
|
259
|
-
|
|
260
|
-
pt: '0 !important',
|
|
261
|
-
},
|
|
262
|
-
'& .MuiOutlinedInput-root': {
|
|
263
|
-
alignItems: 'center',
|
|
264
|
-
flexWrap: 'nowrap',
|
|
265
|
-
height: '2.75rem',
|
|
266
|
-
minHeight: '2.75rem',
|
|
267
|
-
overflow: 'hidden',
|
|
268
|
-
pl: '.375rem',
|
|
269
|
-
py: 0,
|
|
293
|
+
pr: `calc(${reservedMultipleEndAdornmentWidth}rem) !important`,
|
|
270
294
|
},
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
295
|
+
}
|
|
296
|
+
: {
|
|
297
|
+
'& .rc-ses-select-single-value': {
|
|
298
|
+
boxSizing: 'border-box',
|
|
299
|
+
display: 'block',
|
|
300
|
+
overflowWrap: 'anywhere',
|
|
301
|
+
paddingLeft: '.75rem',
|
|
302
|
+
pointerEvents: 'none',
|
|
303
|
+
width: '100%',
|
|
275
304
|
},
|
|
276
305
|
'& .MuiAutocomplete-input': {
|
|
277
|
-
|
|
306
|
+
marginRight: `calc(${reservedSingleEndAdornmentWidth}rem) !important`,
|
|
278
307
|
},
|
|
279
|
-
}
|
|
280
|
-
: {}),
|
|
308
|
+
}),
|
|
281
309
|
}}
|
|
282
310
|
slotProps={{
|
|
283
311
|
// Spreading params.slotProps keeps `input`, which carries the ref
|
|
284
312
|
// and classes Autocomplete relies on.
|
|
285
313
|
...params.slotProps,
|
|
314
|
+
input: {
|
|
315
|
+
...params.slotProps.input,
|
|
316
|
+
startAdornment:
|
|
317
|
+
!multiple && selectedSingleLabel ? (
|
|
318
|
+
<Box id={selectedValueId} className='rc-ses-select-single-value'>
|
|
319
|
+
{selectedSingleLabel}
|
|
320
|
+
</Box>
|
|
321
|
+
) : (
|
|
322
|
+
params.slotProps.input.startAdornment
|
|
323
|
+
),
|
|
324
|
+
},
|
|
286
325
|
htmlInput: {
|
|
287
326
|
...params.slotProps.htmlInput,
|
|
288
|
-
|
|
327
|
+
'aria-describedby':
|
|
328
|
+
!multiple && selectedSingleLabel ? selectedValueId : undefined,
|
|
329
|
+
value:
|
|
330
|
+
!multiple && selectedSingleLabel
|
|
331
|
+
? ''
|
|
332
|
+
: params.slotProps.htmlInput?.value,
|
|
333
|
+
readOnly: dropdownSearch || (!multiple && !!selectedSingleLabel),
|
|
289
334
|
},
|
|
290
335
|
}}
|
|
291
336
|
/>
|
|
@@ -468,7 +513,7 @@ function RcSesSelect(props: Props) {
|
|
|
468
513
|
</Box>
|
|
469
514
|
)
|
|
470
515
|
}}
|
|
471
|
-
renderValue={(tagValues, getItemProps) => {
|
|
516
|
+
renderValue={(tagValues, getItemProps, ownerState) => {
|
|
472
517
|
// MUI 9 merged renderTags into renderValue, so this now runs for
|
|
473
518
|
// single-select too where v7's renderTags did not. Single-select must
|
|
474
519
|
// keep showing the plain label - rendering a deletable Chip there both
|
|
@@ -478,32 +523,40 @@ function RcSesSelect(props: Props) {
|
|
|
478
523
|
return selected[0]?.label ?? ''
|
|
479
524
|
}
|
|
480
525
|
|
|
481
|
-
const
|
|
482
|
-
const
|
|
526
|
+
const visibleTagLimit = ownerState.limitTags ?? -1
|
|
527
|
+
const shouldLimitTags =
|
|
528
|
+
visibleTagLimit > -1 && selected.length > visibleTagLimit
|
|
529
|
+
const visibleTags = shouldLimitTags
|
|
530
|
+
? selected.slice(0, visibleTagLimit)
|
|
531
|
+
: selected
|
|
532
|
+
const hiddenTagCount = selected.length - visibleTags.length
|
|
533
|
+
|
|
483
534
|
return (
|
|
484
535
|
<>
|
|
485
|
-
{
|
|
536
|
+
{visibleTags.map((option, index) => (
|
|
486
537
|
// getItemProps no longer returns a key, so it comes from the option.
|
|
487
538
|
<Chip
|
|
488
539
|
key={option.value ?? index}
|
|
489
540
|
label={option.label}
|
|
490
541
|
size='small'
|
|
542
|
+
sx={{
|
|
543
|
+
height: 'auto',
|
|
544
|
+
maxWidth: `calc(100% - ${reservedMultipleEndAdornmentWidth}rem)`,
|
|
545
|
+
'& .MuiChip-label': {
|
|
546
|
+
display: 'block',
|
|
547
|
+
overflowWrap: 'anywhere',
|
|
548
|
+
py: '.25rem',
|
|
549
|
+
textOverflow: 'clip',
|
|
550
|
+
whiteSpace: 'normal',
|
|
551
|
+
},
|
|
552
|
+
}}
|
|
491
553
|
{...getItemProps({ index })}
|
|
492
554
|
/>
|
|
493
555
|
))}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
alignSelf: 'center',
|
|
499
|
-
color: 'text.secondary',
|
|
500
|
-
flexShrink: 0,
|
|
501
|
-
fontSize: '.8125rem',
|
|
502
|
-
ml: '.25rem',
|
|
503
|
-
whiteSpace: 'nowrap',
|
|
504
|
-
}}
|
|
505
|
-
>
|
|
506
|
-
+{hiddenCount}
|
|
556
|
+
|
|
557
|
+
{hiddenTagCount > 0 && (
|
|
558
|
+
<Box component='span' className='MuiAutocomplete-tag'>
|
|
559
|
+
{ownerState.getLimitTagsText?.(hiddenTagCount) ?? `+${hiddenTagCount}`}
|
|
507
560
|
</Box>
|
|
508
561
|
)}
|
|
509
562
|
</>
|
|
@@ -14,6 +14,20 @@
|
|
|
14
14
|
"SegmentedControl": {
|
|
15
15
|
"options": "Options",
|
|
16
16
|
"tabs": "Tabs"
|
|
17
|
+
},
|
|
18
|
+
"AdvancedListItemTrailing": {
|
|
19
|
+
"decrease": "Decrease",
|
|
20
|
+
"increase": "Increase",
|
|
21
|
+
"delete": "Delete",
|
|
22
|
+
"toggle": "Toggle",
|
|
23
|
+
"vat": "incl. VAT"
|
|
24
|
+
},
|
|
25
|
+
"Tooltip": {
|
|
26
|
+
"trigger": "Explanation"
|
|
27
|
+
},
|
|
28
|
+
"AdvancedListItemLeading": {
|
|
29
|
+
"moveUp": "Move up",
|
|
30
|
+
"moveDown": "Move down"
|
|
17
31
|
}
|
|
18
32
|
}
|
|
19
33
|
}
|
|
@@ -14,6 +14,20 @@
|
|
|
14
14
|
"SegmentedControl": {
|
|
15
15
|
"options": "Parinktys",
|
|
16
16
|
"tabs": "Skirtukai"
|
|
17
|
+
},
|
|
18
|
+
"AdvancedListItemTrailing": {
|
|
19
|
+
"decrease": "Sumažinti",
|
|
20
|
+
"increase": "Padidinti",
|
|
21
|
+
"delete": "Pašalinti",
|
|
22
|
+
"toggle": "Perjungti",
|
|
23
|
+
"vat": "su PVM"
|
|
24
|
+
},
|
|
25
|
+
"Tooltip": {
|
|
26
|
+
"trigger": "Paaiškinimas"
|
|
27
|
+
},
|
|
28
|
+
"AdvancedListItemLeading": {
|
|
29
|
+
"moveUp": "Perkelti aukštyn",
|
|
30
|
+
"moveDown": "Perkelti žemyn"
|
|
17
31
|
}
|
|
18
32
|
}
|
|
19
33
|
}
|
package/src/library/icons.ts
CHANGED
|
@@ -12,6 +12,8 @@ import CaretDownIcon from '@/assets/icons/CaretDownIcon'
|
|
|
12
12
|
import CaretLeftBoldIcon from '@/assets/icons/CaretLeftBoldIcon'
|
|
13
13
|
import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
|
|
14
14
|
import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
|
|
15
|
+
import CaretUpBoldIcon from '@/assets/icons/CaretUpBoldIcon'
|
|
16
|
+
import CaretUpIcon from '@/assets/icons/CaretUpIcon'
|
|
15
17
|
import CheckBoldIcon from '@/assets/icons/CheckBoldIcon'
|
|
16
18
|
import CheckCircleFillIcon from '@/assets/icons/CheckCircleFillIcon'
|
|
17
19
|
import CheckIcon from '@/assets/icons/CheckIcon'
|
|
@@ -23,11 +25,15 @@ import CopyIcon from '@/assets/icons/CopyIcon'
|
|
|
23
25
|
import DotCircleFilledIcon from '@/assets/icons/DotCircleFilledIcon'
|
|
24
26
|
import ExpandChevronsIcon from '@/assets/icons/ExpandChevronsIcon'
|
|
25
27
|
import InfoFillIcon from '@/assets/icons/InfoFillIcon'
|
|
28
|
+
import ListIcon from '@/assets/icons/ListIcon'
|
|
26
29
|
import MagnifyingGlassIcon from '@/assets/icons/MagnifyingGlassIcon'
|
|
27
30
|
import MapPinAreaIcon from '@/assets/icons/MapPinAreaIcon'
|
|
28
31
|
import MinusBoldIcon from '@/assets/icons/MinusBoldIcon'
|
|
32
|
+
import MinusIcon from '@/assets/icons/MinusIcon'
|
|
33
|
+
import NotePencilIcon from '@/assets/icons/NotePencilIcon'
|
|
29
34
|
import PencilSimpleLineIcon from '@/assets/icons/PencilSimpleLineIcon'
|
|
30
35
|
import PlusBoldIcon from '@/assets/icons/PlusBoldIcon'
|
|
36
|
+
import PlusIcon from '@/assets/icons/PlusIcon'
|
|
31
37
|
import QuestionFillIcon from '@/assets/icons/QuestionFillIcon'
|
|
32
38
|
import QuestionIcon from '@/assets/icons/QuestionIcon'
|
|
33
39
|
import ScalesIcon from '@/assets/icons/ScalesIcon'
|
|
@@ -35,7 +41,9 @@ import ScrollIcon from '@/assets/icons/ScrollIcon'
|
|
|
35
41
|
import SearchHelpIcon from '@/assets/icons/SearchHelpIcon'
|
|
36
42
|
import SearchXIcon from '@/assets/icons/SearchXIcon'
|
|
37
43
|
import SpinnerGapBoldIcon from '@/assets/icons/SpinnerGapBoldIcon'
|
|
44
|
+
import TrashIcon from '@/assets/icons/TrashIcon'
|
|
38
45
|
import UploadSimpleIcon from '@/assets/icons/UploadSimpleIcon'
|
|
46
|
+
import UserIcon from '@/assets/icons/UserIcon'
|
|
39
47
|
import WarningCircleIcon from '@/assets/icons/WarningCircleIcon'
|
|
40
48
|
import WarningDiamondFillIcon from '@/assets/icons/WarningDiamondFillIcon'
|
|
41
49
|
import WarningFillIcon from '@/assets/icons/WarningFillIcon'
|
|
@@ -56,6 +64,8 @@ export {
|
|
|
56
64
|
CaretLeftBoldIcon,
|
|
57
65
|
CaretLeftIcon,
|
|
58
66
|
CaretRightBoldIcon,
|
|
67
|
+
CaretUpIcon,
|
|
68
|
+
CaretUpBoldIcon,
|
|
59
69
|
CheckBoldIcon,
|
|
60
70
|
CheckCircleFillIcon,
|
|
61
71
|
CheckIcon,
|
|
@@ -67,11 +77,15 @@ export {
|
|
|
67
77
|
DotCircleFilledIcon,
|
|
68
78
|
ExpandChevronsIcon,
|
|
69
79
|
InfoFillIcon,
|
|
80
|
+
ListIcon,
|
|
70
81
|
MagnifyingGlassIcon,
|
|
71
82
|
MapPinAreaIcon,
|
|
72
83
|
MinusBoldIcon,
|
|
84
|
+
MinusIcon,
|
|
85
|
+
NotePencilIcon,
|
|
73
86
|
PencilSimpleLineIcon,
|
|
74
87
|
PlusBoldIcon,
|
|
88
|
+
PlusIcon,
|
|
75
89
|
QuestionFillIcon,
|
|
76
90
|
QuestionIcon,
|
|
77
91
|
ScalesIcon,
|
|
@@ -79,7 +93,9 @@ export {
|
|
|
79
93
|
SearchHelpIcon,
|
|
80
94
|
SearchXIcon,
|
|
81
95
|
SpinnerGapBoldIcon,
|
|
96
|
+
TrashIcon,
|
|
82
97
|
UploadSimpleIcon,
|
|
98
|
+
UserIcon,
|
|
83
99
|
WarningDiamondFillIcon,
|
|
84
100
|
WarningFillIcon,
|
|
85
101
|
WarningCircleIcon,
|
package/src/library/index.ts
CHANGED
|
@@ -5,6 +5,8 @@ import type {} from '@mui/x-date-pickers/themeAugmentation'
|
|
|
5
5
|
import RcSesIconProps from '@/assets/IconProps'
|
|
6
6
|
import RcSesAccordion from '@/components/common/Accordion'
|
|
7
7
|
import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
|
|
8
|
+
import RcSesAdvancedList from '@/components/common/AdvancedList'
|
|
9
|
+
import RcSesAdvancedListItem from '@/components/common/AdvancedList/components/AdvancedListItem'
|
|
8
10
|
import RcSesAlert from '@/components/common/Alert'
|
|
9
11
|
import RcSesBadge from '@/components/common/Badge'
|
|
10
12
|
import RcSesBreadcrumbs from '@/components/common/Breadcrumbs'
|
|
@@ -26,6 +28,7 @@ import RcSesTab from '@/components/common/Tabs/Tab'
|
|
|
26
28
|
import RcSesTabPanel from '@/components/common/Tabs/TabPanel'
|
|
27
29
|
import RcSesTabs from '@/components/common/Tabs/Tabs'
|
|
28
30
|
import RcSesTabsWrapper from '@/components/common/Tabs/TabsWrapper'
|
|
31
|
+
import RcSesTooltip from '@/components/common/Tooltip'
|
|
29
32
|
import RcSesFormControlWrapper from '@/components/form/components/FormControlWrapper'
|
|
30
33
|
import RcSesCheckbox from '@/components/form/inputs/Checkbox'
|
|
31
34
|
import RcSesCheckboxFormControl from '@/components/form/inputs/CheckboxFormControl'
|
|
@@ -67,6 +70,7 @@ declare module '@mui/x-date-pickers/models' {
|
|
|
67
70
|
|
|
68
71
|
export { RcSesPalette, RcSesTheme }
|
|
69
72
|
export { RcSesAccordion, useAccordionController }
|
|
73
|
+
export { RcSesAdvancedList, RcSesAdvancedListItem }
|
|
70
74
|
export {
|
|
71
75
|
RcSesAlert,
|
|
72
76
|
RcSesBadge,
|
|
@@ -98,6 +102,7 @@ export { RcSesSearchInput }
|
|
|
98
102
|
export { RcSesSearchableField }
|
|
99
103
|
export { RcSesSelect }
|
|
100
104
|
export { RcSesTab, RcSesTabPanel, RcSesTabs, RcSesTabsWrapper }
|
|
105
|
+
export { RcSesTooltip }
|
|
101
106
|
export { RcSesTextField }
|
|
102
107
|
export { DataPagination }
|
|
103
108
|
export { ListWithIcons }
|
package/src/library/types.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
RcSesSegmentedControlProps,
|
|
7
7
|
} from '@/components/common/SegmentedControl'
|
|
8
8
|
import { RcSesSegmentButtonProps } from '@/components/common/SegmentedControl/components/SegmentButton'
|
|
9
|
+
import { RcSesTooltipProps } from '@/components/common/Tooltip'
|
|
9
10
|
import { RcSesFormControlLabelProps } from '@/components/form/inputs/FormControlLabel'
|
|
10
11
|
import { SimpleCheckboxProps } from '@/components/form/inputs/SimpleCheckbox'
|
|
11
12
|
import { RcSesCardFormContainerProps } from '@/components/layout/ServiceFormContainer/CardFormContainer'
|
|
@@ -41,6 +42,7 @@ export type {
|
|
|
41
42
|
RcSesFormControlLabelProps,
|
|
42
43
|
RcSesLoadingSpinnerProps,
|
|
43
44
|
RcSesSpinnerColor,
|
|
45
|
+
RcSesTooltipProps,
|
|
44
46
|
}
|
|
45
47
|
export type { RcSesDialogProps, DialogSize }
|
|
46
48
|
export type { RcSesModalProps, ModalVariant }
|
package/src/setupTests.ts
CHANGED
|
@@ -2,13 +2,19 @@ import '@testing-library/jest-dom/vitest'
|
|
|
2
2
|
import i18n from 'i18next'
|
|
3
3
|
import { initReactI18next } from 'react-i18next'
|
|
4
4
|
|
|
5
|
+
import commonEn from '@/i18n/namespaces/common/en.json'
|
|
6
|
+
import commonLt from '@/i18n/namespaces/common/lt.json'
|
|
7
|
+
import inputEn from '@/i18n/namespaces/input/en.json'
|
|
8
|
+
import inputLt from '@/i18n/namespaces/input/lt.json'
|
|
9
|
+
|
|
5
10
|
if (!i18n.isInitialized) {
|
|
6
11
|
i18n.use(initReactI18next).init({
|
|
7
12
|
fallbackLng: 'lt',
|
|
8
13
|
interpolation: { escapeValue: false },
|
|
9
14
|
lng: 'lt',
|
|
10
15
|
resources: {
|
|
11
|
-
lt: {
|
|
16
|
+
lt: { common: commonLt, input: inputLt },
|
|
17
|
+
en: { common: commonEn, input: inputEn },
|
|
12
18
|
},
|
|
13
19
|
})
|
|
14
20
|
}
|