@registrucentras/rc-ses-react-components 2.5.0 → 2.5.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.
@@ -6739,8 +6739,12 @@ const uc = (t) => ({
6739
6739
  padding: ".75rem 1rem",
6740
6740
  textTransform: "none"
6741
6741
  },
6742
+ // Options stack as a column here, so alignItems is the horizontal
6743
+ // axis: 'center' would centre the text of every consumer's
6744
+ // Autocomplete. Components that lay options out as a row (Select,
6745
+ // PhoneInput) set their own vertical centring.
6742
6746
  ".MuiAutocomplete-option": {
6743
- alignItems: "center",
6747
+ alignItems: "flex-start",
6744
6748
  backgroundColor: "transparent",
6745
6749
  borderRadius: 0,
6746
6750
  color: u.grey[900],
@@ -10024,6 +10028,7 @@ function x0(t) {
10024
10028
  q.stopPropagation(), Gr();
10025
10029
  },
10026
10030
  sx: {
10031
+ alignItems: "center !important",
10027
10032
  display: "flex",
10028
10033
  flexDirection: "row !important",
10029
10034
  gap: ".75rem"
@@ -10051,7 +10056,7 @@ function x0(t) {
10051
10056
  Qe.stopPropagation(), Ur(q);
10052
10057
  },
10053
10058
  sx: {
10054
- alignItems: "center",
10059
+ alignItems: "center !important",
10055
10060
  backgroundColor: je ? u.primary[50] : "transparent",
10056
10061
  display: "flex",
10057
10062
  flexDirection: "row !important",
@@ -10097,6 +10102,7 @@ function x0(t) {
10097
10102
  ...ot,
10098
10103
  className: [se, it].filter(Boolean).join(" "),
10099
10104
  sx: {
10105
+ alignItems: "center !important",
10100
10106
  display: "flex",
10101
10107
  gap: p ? ".75rem" : ".5rem",
10102
10108
  flexDirection: "row !important",
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.5.0",
4
+ "version": "2.5.1",
5
5
  "description": "RC SES React komponentų biblioteka",
6
6
  "type": "module",
7
7
  "private": false,
@@ -596,6 +596,7 @@ function RcSesSelect<TFieldValues extends FieldValues = FieldValues>(
596
596
  handleSelectAll()
597
597
  }}
598
598
  sx={{
599
+ alignItems: 'center !important',
599
600
  display: 'flex',
600
601
  flexDirection: 'row !important',
601
602
  gap: '.75rem',
@@ -628,7 +629,7 @@ function RcSesSelect<TFieldValues extends FieldValues = FieldValues>(
628
629
  toggleGroupValue(groupValue)
629
630
  }}
630
631
  sx={{
631
- alignItems: 'center',
632
+ alignItems: 'center !important',
632
633
  backgroundColor: isGroupSelected
633
634
  ? palette.primary['50']
634
635
  : 'transparent',
@@ -678,6 +679,7 @@ function RcSesSelect<TFieldValues extends FieldValues = FieldValues>(
678
679
  {...rest}
679
680
  className={[className, indentClassName].filter(Boolean).join(' ')}
680
681
  sx={{
682
+ alignItems: 'center !important',
681
683
  display: 'flex',
682
684
  gap: multiple ? '.75rem' : '.5rem',
683
685
  flexDirection: 'row !important',
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Autocomplete,
2
3
  Box,
3
4
  Card,
4
5
  CardContent,
@@ -11,6 +12,7 @@ import {
11
12
  TableContainer,
12
13
  TableHead,
13
14
  TableRow,
15
+ TextField,
14
16
  Tooltip,
15
17
  Typography,
16
18
  } from '@mui/material'
@@ -29,6 +31,9 @@ import type { Meta, StoryObj } from '@storybook/react-vite'
29
31
  * 2. **The wrapper never shows it open.** `MuiTooltip` is styled through
30
32
  * `RcSesTooltip`, but that component owns its open state internally and no
31
33
  * story can force it, so the popper never reaches a baseline.
34
+ * 3. **The wrappers restyle it.** `RcSesSelect` and `PhoneInput` lay their
35
+ * `MuiAutocomplete` options out as rows, so the theme's own option layout -
36
+ * what a consumer's plain Autocomplete gets - is covered by nothing else.
32
37
  *
33
38
  * Either way these render the plain MUI component under the theme, so a broken
34
39
  * or silently dead override surfaces as a pixel diff.
@@ -175,3 +180,29 @@ export const TooltipSlots: Story = {
175
180
  </Stack>
176
181
  ),
177
182
  }
183
+
184
+ const autocompleteOptions = [
185
+ { group: 'Paslaugos', label: 'Išrašo užsakymas' },
186
+ {
187
+ group: 'Paslaugos',
188
+ label:
189
+ 'Nekilnojamojo turto registro duomenų teikimo leidžiamosios kreipties būdu naudojantis saityno paslauga',
190
+ },
191
+ { group: 'Puslapiai', label: 'Kontaktai' },
192
+ ]
193
+
194
+ export const AutocompleteSlots: Story = {
195
+ name: 'Autocomplete',
196
+ // Short options next to one that wraps, so a change to the theme's option
197
+ // alignment shows: the short ones move while the wrapping one cannot.
198
+ render: () => (
199
+ <Box sx={{ pb: '16rem', width: 480 }}>
200
+ <Autocomplete
201
+ groupBy={(option) => option.group}
202
+ open
203
+ options={autocompleteOptions}
204
+ renderInput={(params) => <TextField {...params} label='Paieška' />}
205
+ />
206
+ </Box>
207
+ ),
208
+ }
@@ -48,8 +48,12 @@ const MuiAutocomplete: Components['MuiAutocomplete'] = {
48
48
  textTransform: 'none',
49
49
  },
50
50
 
51
+ // Options stack as a column here, so alignItems is the horizontal
52
+ // axis: 'center' would centre the text of every consumer's
53
+ // Autocomplete. Components that lay options out as a row (Select,
54
+ // PhoneInput) set their own vertical centring.
51
55
  '.MuiAutocomplete-option': {
52
- alignItems: 'center',
56
+ alignItems: 'flex-start',
53
57
  backgroundColor: 'transparent',
54
58
  borderRadius: 0,
55
59
  color: palette.grey['900'],