@registrucentras/rc-ses-react-components 1.11.0 → 1.12.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 (29) hide show
  1. package/README.md +5 -1
  2. package/dist/components/common/SelectableCardList/index.d.ts +1 -1
  3. package/dist/components/common/Tooltip/index.d.ts +20 -0
  4. package/dist/library/index.d.ts +2 -0
  5. package/dist/library/types.d.ts +2 -1
  6. package/dist/registrucentras-rc-ses-react-components.cjs +10 -10
  7. package/dist/registrucentras-rc-ses-react-components.js +2875 -2739
  8. package/dist/stories/components/display/SelectableCardList.stories.d.ts +8 -1
  9. package/dist/stories/components/display/Tooltip.stories.d.ts +48 -0
  10. package/dist/theme/light/MuiTooltip.d.ts +3 -0
  11. package/package.json +1 -1
  12. package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +7 -5
  13. package/src/components/common/SelectableCardList/index.test.tsx +56 -2
  14. package/src/components/common/SelectableCardList/index.tsx +23 -10
  15. package/src/components/common/Tooltip/index.test.tsx +87 -0
  16. package/src/components/common/Tooltip/index.tsx +167 -0
  17. package/src/components/form/inputs/Select/index.test.tsx +102 -0
  18. package/src/components/form/inputs/Select/index.tsx +107 -53
  19. package/src/i18n/namespaces/common/en.json +3 -0
  20. package/src/i18n/namespaces/common/lt.json +3 -0
  21. package/src/library/index.ts +2 -0
  22. package/src/library/types.ts +2 -0
  23. package/src/stories/components/display/SelectableCardList.stories.tsx +16 -0
  24. package/src/stories/components/display/Tooltip.stories.tsx +67 -0
  25. package/src/stories/components/inputs/Select.stories.tsx +38 -2
  26. package/src/theme/light/MuiAutocomplete.ts +3 -1
  27. package/src/theme/light/MuiInputBase.ts +4 -0
  28. package/src/theme/light/MuiTooltip.ts +40 -0
  29. package/src/theme/light/index.tsx +2 -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(options, dropdownSearchValue)
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 (!dropdownSearch || hasCustomGroupBy) return opts
165
+ if (dropdownSearch && !hasCustomGroupBy) {
166
+ const [searchOption, ...realOptions] = opts
167
+ if (!dropdownSearchValue.trim()) return opts
145
168
 
146
- const [searchOption, ...realOptions] = opts
147
- if (!dropdownSearchValue.trim()) return opts
169
+ const filteredValues = new Set(filteredOptions.map((o) => o.value))
170
+ const filtered = realOptions.filter((opt) => filteredValues.has(opt.value))
148
171
 
149
- const filteredValues = new Set(filteredOptions.map((o) => o.value))
150
- const filtered = realOptions.filter((opt) => filteredValues.has(opt.value))
172
+ return [searchOption, ...filtered]
173
+ }
174
+
175
+ if (dropdownSearch && hasCustomGroupBy) return opts
151
176
 
152
- return [searchOption, ...filtered]
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}
@@ -203,12 +238,11 @@ function RcSesSelect(props: Props) {
203
238
  }}
204
239
  loading={loading}
205
240
  value={resolvedValue}
206
- inputValue={dropdownSearch ? undefined : inputValue}
241
+ inputValue={resolvedInputValue}
207
242
  onChange={handleChange}
208
243
  onInputChange={(event, val, reason) => {
209
244
  if (dropdownSearch) return
210
-
211
- setInputValue(val ?? '')
245
+ setInputValue(val)
212
246
  onInputChange?.(event, val, reason)
213
247
  }}
214
248
  onClose={(_event, reason) => {
@@ -216,7 +250,7 @@ function RcSesSelect(props: Props) {
216
250
  deferCloseCheck()
217
251
  return
218
252
  }
219
- closeDropdown()
253
+ closeDropdownWithClear()
220
254
  }}
221
255
  isOptionEqualToValue={(option, val) => option.value === val.value}
222
256
  getOptionLabel={(option) => option.label}
@@ -247,9 +281,9 @@ function RcSesSelect(props: Props) {
247
281
  {...params}
248
282
  disabled={disabled}
249
283
  error={hasError}
250
- placeholder={placeholder}
284
+ placeholder={!multiple && selectedSingleLabel ? undefined : placeholder}
251
285
  sx={{
252
- ...(dropdownSearch
286
+ ...(dropdownSearch || (!multiple && selectedSingleLabel)
253
287
  ? {
254
288
  '& .MuiInputBase-input': {
255
289
  caretColor: 'transparent',
@@ -260,34 +294,39 @@ function RcSesSelect(props: Props) {
260
294
  ? {
261
295
  '& .MuiAutocomplete-inputRoot': {
262
296
  alignItems: 'center',
263
- pb: '0 !important',
264
- pt: '0 !important',
265
- },
266
- '& .MuiOutlinedInput-root': {
267
- alignItems: 'center',
268
- flexWrap: 'nowrap',
269
- height: '2.75rem',
270
- minHeight: '2.75rem',
271
- overflow: 'hidden',
272
- pl: '.375rem',
273
- py: 0,
297
+ pr: `calc(${reservedMultipleEndAdornmentWidth}rem) !important`,
274
298
  },
275
- '& .MuiAutocomplete-tag': {
276
- alignSelf: 'center',
277
- m: '0 .25rem 0 .35rem',
278
- maxWidth: 'calc(100% - 3.5rem)',
299
+ }
300
+ : {
301
+ '& .rc-ses-select-single-value': {
302
+ boxSizing: 'border-box',
303
+ display: 'block',
304
+ overflowWrap: 'anywhere',
305
+ paddingLeft: '.75rem',
306
+ pointerEvents: 'none',
307
+ width: '100%',
279
308
  },
280
309
  '& .MuiAutocomplete-input': {
281
- minWidth: 0,
310
+ marginRight: `calc(${reservedSingleEndAdornmentWidth}rem) !important`,
282
311
  },
283
- }
284
- : {}),
312
+ }),
285
313
  }}
286
314
  InputProps={{
287
315
  ...params.InputProps,
316
+ startAdornment:
317
+ !multiple && selectedSingleLabel ? (
318
+ <Box id={selectedValueId} className='rc-ses-select-single-value'>
319
+ {selectedSingleLabel}
320
+ </Box>
321
+ ) : (
322
+ params.InputProps.startAdornment
323
+ ),
288
324
  inputProps: {
289
325
  ...params.inputProps,
290
- readOnly: dropdownSearch,
326
+ 'aria-describedby':
327
+ !multiple && selectedSingleLabel ? selectedValueId : undefined,
328
+ value: !multiple && selectedSingleLabel ? '' : params.inputProps?.value,
329
+ readOnly: dropdownSearch || (!multiple && !!selectedSingleLabel),
291
330
  },
292
331
  }}
293
332
  />
@@ -458,28 +497,43 @@ function RcSesSelect(props: Props) {
458
497
  </Box>
459
498
  )
460
499
  }}
461
- renderTags={(tagValues, getTagProps) => {
462
- const visible = tagValues.slice(0, limitTags)
463
- const hiddenCount = tagValues.length - visible.length
500
+ renderTags={(tagValues, getTagProps, ownerState) => {
501
+ const visibleTagLimit = ownerState.limitTags ?? -1
502
+ const shouldLimitTags =
503
+ visibleTagLimit > -1 && tagValues.length > visibleTagLimit
504
+ const visibleTags = shouldLimitTags
505
+ ? tagValues.slice(0, visibleTagLimit)
506
+ : tagValues
507
+ const hiddenTagCount = tagValues.length - visibleTags.length
508
+
464
509
  return (
465
510
  <>
466
- {visible.map((option, index) => {
511
+ {visibleTags.map((option, index) => {
467
512
  const { key, ...tagProps } = getTagProps({ index })
468
- return <Chip key={key} label={option.label} size='small' {...tagProps} />
513
+ return (
514
+ <Chip
515
+ key={key}
516
+ label={option.label}
517
+ size='small'
518
+ sx={{
519
+ height: 'auto',
520
+ maxWidth: `calc(100% - ${reservedMultipleEndAdornmentWidth}rem)`,
521
+ '& .MuiChip-label': {
522
+ display: 'block',
523
+ overflowWrap: 'anywhere',
524
+ py: '.25rem',
525
+ textOverflow: 'clip',
526
+ whiteSpace: 'normal',
527
+ },
528
+ }}
529
+ {...tagProps}
530
+ />
531
+ )
469
532
  })}
470
- {hiddenCount > 0 && (
471
- <Box
472
- component='span'
473
- sx={{
474
- alignSelf: 'center',
475
- color: 'text.secondary',
476
- flexShrink: 0,
477
- fontSize: '.8125rem',
478
- ml: '.25rem',
479
- whiteSpace: 'nowrap',
480
- }}
481
- >
482
- +{hiddenCount}
533
+
534
+ {hiddenTagCount > 0 && (
535
+ <Box component='span' className='MuiAutocomplete-tag'>
536
+ {ownerState.getLimitTagsText?.(hiddenTagCount) ?? `+${hiddenTagCount}`}
483
537
  </Box>
484
538
  )}
485
539
  </>
@@ -14,6 +14,9 @@
14
14
  "SegmentedControl": {
15
15
  "options": "Options",
16
16
  "tabs": "Tabs"
17
+ },
18
+ "Tooltip": {
19
+ "trigger": "Explanation"
17
20
  }
18
21
  }
19
22
  }
@@ -14,6 +14,9 @@
14
14
  "SegmentedControl": {
15
15
  "options": "Parinktys",
16
16
  "tabs": "Skirtukai"
17
+ },
18
+ "Tooltip": {
19
+ "trigger": "Paaiškinimas"
17
20
  }
18
21
  }
19
22
  }
@@ -26,6 +26,7 @@ import RcSesTab from '@/components/common/Tabs/Tab'
26
26
  import RcSesTabPanel from '@/components/common/Tabs/TabPanel'
27
27
  import RcSesTabs from '@/components/common/Tabs/Tabs'
28
28
  import RcSesTabsWrapper from '@/components/common/Tabs/TabsWrapper'
29
+ import RcSesTooltip from '@/components/common/Tooltip'
29
30
  import RcSesFormControlWrapper from '@/components/form/components/FormControlWrapper'
30
31
  import RcSesCheckbox from '@/components/form/inputs/Checkbox'
31
32
  import RcSesCheckboxFormControl from '@/components/form/inputs/CheckboxFormControl'
@@ -98,6 +99,7 @@ export { RcSesSearchInput }
98
99
  export { RcSesSearchableField }
99
100
  export { RcSesSelect }
100
101
  export { RcSesTab, RcSesTabPanel, RcSesTabs, RcSesTabsWrapper }
102
+ export { RcSesTooltip }
101
103
  export { RcSesTextField }
102
104
  export { DataPagination }
103
105
  export { ListWithIcons }
@@ -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 }
@@ -55,6 +55,14 @@ const meta = {
55
55
  title: 'components/display/SelectableCardList',
56
56
  component: SelectableCardList,
57
57
  tags: ['autodocs'],
58
+ parameters: {
59
+ docs: {
60
+ description: {
61
+ component:
62
+ 'Paginates items client-side, showing 5 per page on desktop and 3 per page on mobile (below the `md` breakpoint). The page resets to 1 whenever the page size changes, e.g. when resizing across the breakpoint.',
63
+ },
64
+ },
65
+ },
58
66
  args: {
59
67
  items: buildItems(),
60
68
  selectedId: null,
@@ -101,6 +109,14 @@ export const Main: Story = {
101
109
  render: (args) => (
102
110
  <SelectableCardListStory {...args} onSelect={args.onSelect ?? (() => {})} />
103
111
  ),
112
+ parameters: {
113
+ docs: {
114
+ description: {
115
+ story:
116
+ 'Responsive page size: desktop shows 5 cards per page, mobile (below md) shows 3 cards per page. When page size changes across breakpoints, current page is reset to 1.',
117
+ },
118
+ },
119
+ },
104
120
  }
105
121
 
106
122
  export const Loading: Story = {
@@ -0,0 +1,67 @@
1
+ import { Button, Typography } from '@mui/material'
2
+ import type { Meta } from '@storybook/react'
3
+
4
+ import RcSesTooltip from '../../../components/common/Tooltip'
5
+
6
+ const meta = {
7
+ title: 'components/display/Tooltip',
8
+ component: RcSesTooltip,
9
+ parameters: {
10
+ layout: 'centered',
11
+ },
12
+ tags: ['autodocs'],
13
+ argTypes: {
14
+ title: {
15
+ control: 'text',
16
+ description: 'Tooltip content',
17
+ },
18
+ placement: {
19
+ control: 'select',
20
+ options: ['top-start', 'top', 'top-end', 'bottom-start', 'bottom', 'bottom-end'],
21
+ description: 'Popper placement relative to the trigger',
22
+ },
23
+ slotProps: {
24
+ control: false,
25
+ description: 'Overrides for default trigger button',
26
+ },
27
+ children: {
28
+ control: false,
29
+ description: 'Custom trigger element, must forward ref!',
30
+ },
31
+ },
32
+ } satisfies Meta<typeof RcSesTooltip>
33
+
34
+ export default meta
35
+
36
+ export const Default = {
37
+ args: {
38
+ title:
39
+ 'Deklaruojant išvykimą iš Lietuvos nurodoma užsienio valstybė, į kurią išvykstama.',
40
+ },
41
+ render: (args: any) => (
42
+ <Typography>
43
+ Išvykimo valstybė
44
+ <RcSesTooltip {...args} />
45
+ </Typography>
46
+ ),
47
+ } as const
48
+
49
+ export const CustomTrigger = {
50
+ args: {
51
+ title: 'Papildoma informacija apie paslaugą.',
52
+ },
53
+ render: (args: any) => (
54
+ <RcSesTooltip {...args}>
55
+ <Button variant='text'>Mygtukas</Button>
56
+ </RcSesTooltip>
57
+ ),
58
+ parameters: {
59
+ docs: {
60
+ source: {
61
+ code: `<RcSesTooltip title="Papildoma informacija apie paslaugą.">
62
+ <Button variant="text">Mygtukas</Button>
63
+ </RcSesTooltip>`,
64
+ },
65
+ },
66
+ },
67
+ } as const
@@ -77,7 +77,7 @@ function SelectDemo(args: any) {
77
77
  formState: { errors },
78
78
  } = useForm<SingleStepFormModel>({ mode: 'all', defaultValues: { selection: '' } })
79
79
 
80
- const { label, disabled, slotProps } = args
80
+ const { label, disabled, placeholder, slotProps } = args
81
81
 
82
82
  return (
83
83
  <Fields>
@@ -88,6 +88,7 @@ function SelectDemo(args: any) {
88
88
  control={control}
89
89
  label={label}
90
90
  disabled={disabled}
91
+ placeholder={placeholder}
91
92
  slotProps={slotProps}
92
93
  options={[
93
94
  { value: 'pasirinkimas-1', label: 'Pasirinkimas #1' },
@@ -104,6 +105,7 @@ function SelectDemo(args: any) {
104
105
  control={control}
105
106
  rules={{ required: true }}
106
107
  label='Active'
108
+ placeholder={placeholder}
107
109
  errors={errors?.selection}
108
110
  options={[
109
111
  { value: 'pasirinkimas-1', label: 'Pasirinkimas #1' },
@@ -117,6 +119,7 @@ function SelectDemo(args: any) {
117
119
  rules={{ required: true }}
118
120
  label='Disabled'
119
121
  disabled
122
+ placeholder={placeholder}
120
123
  errors={errors?.selection}
121
124
  options={[
122
125
  { value: 'pasirinkimas-1', label: 'Pasirinkimas #1' },
@@ -129,6 +132,7 @@ function SelectDemo(args: any) {
129
132
  control={control}
130
133
  rules={{ required: true }}
131
134
  label='Error'
135
+ placeholder={placeholder}
132
136
  errors={{ message: 'Error Message', type: 'required' }}
133
137
  options={[
134
138
  { value: 'pasirinkimas-1', label: 'Pasirinkimas #1' },
@@ -146,6 +150,7 @@ function SelectDemo(args: any) {
146
150
  rules={{ required: true }}
147
151
  label='Active'
148
152
  slotProps={{ wrapper: { labelOnTop: true } }}
153
+ placeholder={placeholder}
149
154
  errors={errors?.selection}
150
155
  options={[
151
156
  { value: 'pasirinkimas-1', label: 'Pasirinkimas #1' },
@@ -160,6 +165,7 @@ function SelectDemo(args: any) {
160
165
  label='Disabled'
161
166
  disabled
162
167
  slotProps={{ wrapper: { labelOnTop: true } }}
168
+ placeholder={placeholder}
163
169
  errors={errors?.selection}
164
170
  options={[
165
171
  { value: 'pasirinkimas-1', label: 'Pasirinkimas #1' },
@@ -173,6 +179,7 @@ function SelectDemo(args: any) {
173
179
  rules={{ required: true }}
174
180
  label='Error'
175
181
  slotProps={{ wrapper: { labelOnTop: true } }}
182
+ placeholder={placeholder}
176
183
  errors={{ message: 'Error', type: 'required' }}
177
184
  options={[
178
185
  { value: 'pasirinkimas-1', label: 'Pasirinkimas #1' },
@@ -185,7 +192,7 @@ function SelectDemo(args: any) {
185
192
  }
186
193
 
187
194
  const codeBlock = (args: any) => {
188
- const { label, disabled, slotProps } = args
195
+ const { label, disabled, placeholder, slotProps } = args
189
196
  return `
190
197
  import RcSesSelect from '@/components/form/inputs/Select'
191
198
 
@@ -201,6 +208,7 @@ const codeBlock = (args: any) => {
201
208
  rules={{ required: true }}
202
209
  label="${label}"
203
210
  disabled={${disabled}}
211
+ placeholder="${placeholder ?? ''}"
204
212
  errors={errors?.selection}
205
213
  slotProps=${slotProps.wrapper.labelOnTop ? '{{ wrapper: { labelOnTop: true } }}' : '{{ wrapper: { labelOnTop: false} }}'}
206
214
  options={[
@@ -236,6 +244,7 @@ type VariantsFormModel = {
236
244
  singleSearchSelect: string | null
237
245
  descriptionSelect: string | null
238
246
  multiSelect: string[]
247
+ limitedMultiSelect: string[]
239
248
  multiSearchSelect: string[]
240
249
  phoneInput: string
241
250
  }
@@ -246,6 +255,16 @@ const variantOptions = [
246
255
  { value: 'option-3', label: '3rd option' },
247
256
  { value: 'option-4', label: '4th option' },
248
257
  { value: 'option-5', label: '5th option' },
258
+ {
259
+ value: 'long-option-1',
260
+ label:
261
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
262
+ },
263
+ {
264
+ value: 'long-option-2',
265
+ label:
266
+ 'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
267
+ },
249
268
  ]
250
269
 
251
270
  const groupedVariantOptions: Array<
@@ -320,6 +339,7 @@ export const AllVariants: Story = {
320
339
  singleSearchSelect: null,
321
340
  descriptionSelect: 'option-3',
322
341
  multiSelect: ['option-1', 'option-3'],
342
+ limitedMultiSelect: ['option-1', 'option-2', 'option-3'],
323
343
  multiSearchSelect: ['option-1', 'option-3', 'option-4', 'option-5'],
324
344
  phoneInput: '',
325
345
  },
@@ -416,6 +436,22 @@ export const AllVariants: Story = {
416
436
  />
417
437
  </VariantCard>
418
438
 
439
+ <VariantCard
440
+ title='Multi select + limit tags'
441
+ description='Daugybinis pasirinkimas su limitTags={1}, kai pertekliniai pasirinkimai sutraukiami i +N.'
442
+ >
443
+ <RcSesSelect
444
+ id='limited-multi-select'
445
+ name='limitedMultiSelect'
446
+ control={control}
447
+ label='Pasirinkti'
448
+ slotProps={{ wrapper: { labelOnTop: true } }}
449
+ multiple
450
+ limitTags={1}
451
+ options={variantOptions}
452
+ />
453
+ </VariantCard>
454
+
419
455
  <VariantCard
420
456
  title='Multi select + search'
421
457
  description='Daugybinis pasirinkimas su paieska ir select all.'
@@ -82,15 +82,17 @@ const MuiAutocomplete: Components['MuiAutocomplete'] = {
82
82
 
83
83
  '.rc-ses-select-option-label': {
84
84
  display: 'block',
85
+ overflowWrap: 'anywhere',
85
86
  },
86
87
  '.rc-ses-select-option-description': {
87
88
  color: palette.grey['600'],
88
89
  display: 'block',
89
90
  fontSize: '.75rem',
90
91
  fontStyle: 'italic',
92
+ fontWeight: 500,
91
93
  lineHeight: '1rem',
92
94
  marginTop: '.25rem',
93
- fontWeight: 500,
95
+ overflowWrap: 'anywhere',
94
96
  },
95
97
  },
96
98
  },
@@ -76,6 +76,10 @@ const MuiInputBase: Components['MuiInputBase'] = {
76
76
  },
77
77
  multiline: {
78
78
  padding: '0 !important',
79
+
80
+ '.MuiInputBase-inputMultiline': {
81
+ overflowWrap: 'anywhere',
82
+ },
79
83
  },
80
84
  adornedStart: {
81
85
  paddingLeft: '0 !important',
@@ -0,0 +1,40 @@
1
+ import { Components } from '@mui/material'
2
+
3
+ import palette, { common } from '../palette'
4
+
5
+ const MuiTooltip: Components['MuiTooltip'] = {
6
+ styleOverrides: {
7
+ tooltip: {
8
+ backgroundColor: common.white,
9
+ color: palette.grey['900'],
10
+ maxWidth: 480,
11
+ padding: '12px 16px',
12
+ fontSize: '.875rem',
13
+ fontWeight: 400,
14
+ lineHeight: 1.5,
15
+ borderRadius: '8px',
16
+ boxShadow: 'none',
17
+ filter: 'drop-shadow(0 6px 24px rgba(0, 0, 0, 0.16))',
18
+
19
+ '@keyframes rcses-tooltip': {
20
+ from: { transform: 'translate3d(0, var(--rcses-tooltip-shift, 6px), 0)' },
21
+ to: { transform: 'none' },
22
+ },
23
+
24
+ '@media (prefers-reduced-motion: no-preference)': {
25
+ animation: 'rcses-tooltip 160ms ease-out',
26
+ },
27
+
28
+ '[data-popper-placement*="bottom"] &': {
29
+ '--rcses-tooltip-shift': '-6px',
30
+ },
31
+ },
32
+
33
+ arrow: {
34
+ color: common.white,
35
+ fontSize: '1rem',
36
+ },
37
+ },
38
+ }
39
+
40
+ export default MuiTooltip
@@ -39,6 +39,7 @@ import MuiTable from '@/theme/light/MuiTable'
39
39
  import MuiTableCell from '@/theme/light/MuiTableCell'
40
40
  import MuiTabs from '@/theme/light/MuiTabs'
41
41
  import MuiTextField from '@/theme/light/MuiTextField'
42
+ import MuiTooltip from '@/theme/light/MuiTooltip'
42
43
  import MuiTypography from '@/theme/light/MuiTypography'
43
44
  import themePalette from '@/theme/light/themePalette'
44
45
 
@@ -131,6 +132,7 @@ const theme = createTheme(themePalette, ltLT, enUS, {
131
132
  MuiTable,
132
133
  MuiTableCell,
133
134
  MuiTextField,
135
+ MuiTooltip,
134
136
  MuiTypography,
135
137
  },
136
138
  })