@neo-design/mui 1.0.0-rc.4
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/LICENSE +21 -0
- package/README.md +25 -0
- package/package.json +38 -0
- package/theme/alert-icons.mjs +16 -0
- package/theme/baseline.mjs +17 -0
- package/theme/checkbox-icons.mjs +12 -0
- package/theme/chip-icon.mjs +8 -0
- package/theme/components.mjs +982 -0
- package/theme/custom-css.mjs +44 -0
- package/theme/index.d.ts +9 -0
- package/theme/index.mjs +7 -0
- package/theme/locale.mjs +11 -0
- package/theme/neo.d.ts +105 -0
- package/theme/select-icon.mjs +8 -0
- package/theme/slices.mjs +37 -0
- package/ui/Alert.mjs +39 -0
- package/ui/AspectRatio.mjs +26 -0
- package/ui/Badge.mjs +39 -0
- package/ui/Banner.mjs +57 -0
- package/ui/Button.mjs +31 -0
- package/ui/ButtonIcon.mjs +22 -0
- package/ui/Checkbox.mjs +30 -0
- package/ui/Chips.mjs +16 -0
- package/ui/ChipsGroup.mjs +53 -0
- package/ui/Combobox.mjs +41 -0
- package/ui/EmptyState.mjs +31 -0
- package/ui/Link.mjs +11 -0
- package/ui/Menu.mjs +73 -0
- package/ui/ModalDialog.mjs +14 -0
- package/ui/ModalFullscreen.mjs +20 -0
- package/ui/RadioButton.mjs +23 -0
- package/ui/RadioGroup.mjs +16 -0
- package/ui/Select.mjs +35 -0
- package/ui/Snackbar.mjs +29 -0
- package/ui/Spinner.mjs +12 -0
- package/ui/Tabs.mjs +46 -0
- package/ui/Tag.mjs +16 -0
- package/ui/TextArea.mjs +45 -0
- package/ui/TextField.mjs +47 -0
- package/ui/Toggle.mjs +27 -0
- package/ui/Tooltip.mjs +20 -0
- package/ui/_alias-props.mjs +26 -0
- package/ui/_css-layers.mjs +15 -0
- package/ui/_help.mjs +25 -0
- package/ui/_icon.mjs +43 -0
- package/ui/_inner-input.mjs +7 -0
- package/ui/_keyboard-focus.mjs +24 -0
- package/ui/_modal-base.mjs +95 -0
- package/ui/_overflow.mjs +21 -0
- package/ui/_reveal.mjs +17 -0
- package/ui/_select-value.mjs +18 -0
- package/ui/_warn.mjs +13 -0
- package/ui/index.d.ts +693 -0
- package/ui/index.mjs +35 -0
|
@@ -0,0 +1,982 @@
|
|
|
1
|
+
// packages/mui/theme/components.mjs — emitted without comments. The reasoning behind each decision lives in Neo's source repository.
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Fade, easing } from '@mui/material';
|
|
4
|
+
import { alertIconMapping } from './alert-icons.mjs';
|
|
5
|
+
import { CheckboxCheckedIcon, CheckboxIndeterminateIcon } from './checkbox-icons.mjs';
|
|
6
|
+
import { SelectChevronIcon } from './select-icon.mjs';
|
|
7
|
+
import { ChipCloseIcon } from './chip-icon.mjs';
|
|
8
|
+
import { iconSize } from '@neo-design/foundations/tokens/iconSize.mjs';
|
|
9
|
+
|
|
10
|
+
const SNACKBAR_DESPLAZA = 'translateY(16px)';
|
|
11
|
+
const conTransform = (t) => (t ? `${t}, ${t.replace(/opacity/g, 'transform')}` : t);
|
|
12
|
+
const movimientoReducido = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function'
|
|
13
|
+
&& window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
14
|
+
const _h = React.createElement;
|
|
15
|
+
|
|
16
|
+
const FILL = {
|
|
17
|
+
primary: { d: '--fill--primary--default', h: '--fill--primary--hover', a: '--fill--primary--active', on: '--text--base--contrast' },
|
|
18
|
+
secondary: { d: '--fill--secondary--default', h: '--fill--secondary--hover', a: '--fill--secondary--active', on: '--text--base--default' },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const withIcon = (textRole) => {
|
|
22
|
+
const iconRole = `var(${textRole.replace('--text--', '--icon--')})`;
|
|
23
|
+
return {
|
|
24
|
+
color: `var(${textRole})`,
|
|
25
|
+
'& .icon, & .MuiCircularProgress-root': { color: iconRole },
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const statusAlert = (i, theme) => ({
|
|
30
|
+
backgroundColor: `var(--fill--semantic--${i}--soft)`, color: 'var(--text--base--default)',
|
|
31
|
+
border: `var(--neo-stroke-xs) solid var(--border--semantic--${i === 'error' ? 'error-soft' : i})`, borderRadius: 'var(--neo-radius-sm)',
|
|
32
|
+
paddingInline: 'var(--neo-space-lg-rem)', paddingBlock: 'var(--neo-space-md-rem)', gap: 0,
|
|
33
|
+
'& .MuiAlert-icon': { color: `var(--icon--semantic--${i})`, width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)', flexShrink: 0, padding: 0, paddingTop: 'var(--neo-space-xs-rem)', marginRight: 'var(--neo-space-sm-rem)' },
|
|
34
|
+
'& .MuiAlertTitle-root': { ...theme.typography.titleXsBold, color: `var(--text--semantic--${i})`, marginTop: 0, marginBottom: 0 },
|
|
35
|
+
'& .MuiAlert-message': { ...theme.typography.bodyMdRegular, padding: 0, display: 'flex', flexDirection: 'column', gap: 'var(--neo-space-xs-rem)', flex: '1 1 auto', minWidth: 0 },
|
|
36
|
+
'& .MuiAlert-message .NeoAlert-text': { display: 'flex', flexDirection: 'column', gap: 'var(--neo-space-xs-rem)', paddingBlock: 'var(--neo-space-xs-rem)' },
|
|
37
|
+
'& .MuiAlert-action': { color: 'var(--icon--base--default)', paddingTop: 0, paddingLeft: 'var(--neo-space-xs-rem)', marginRight: 0, '& .MuiIconButton-root': { backgroundColor: 'var(--fill--tertiary--default)' } },
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const focusRing = {
|
|
41
|
+
outline: 'var(--neo-stroke-focus-ring-width) solid var(--focus--ring--default)',
|
|
42
|
+
outlineOffset: '2px',
|
|
43
|
+
boxShadow: '0 0 0 var(--neo-stroke-focus-ring-width) var(--focus--gap--default)',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const focusRingField = {
|
|
47
|
+
boxShadow: '0 0 0 var(--neo-stroke-focus-ring-width) var(--focus--gap--default),'
|
|
48
|
+
+ ' 0 0 0 calc(var(--neo-stroke-focus-ring-width) * 2) var(--focus--ring--default)',
|
|
49
|
+
};
|
|
50
|
+
const focusRingInset = {
|
|
51
|
+
boxShadow: 'inset 0 0 0 var(--neo-stroke-focus-ring-width) var(--focus--ring--default),'
|
|
52
|
+
+ ' inset 0 0 0 calc(var(--neo-stroke-focus-ring-width) * 2) var(--focus--gap--default)',
|
|
53
|
+
borderRadius: 'calc(var(--neo-radius-sm) - var(--neo-stroke-xs))',
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const focusRingInverse = {
|
|
57
|
+
'&[data-surface="inverse"]': {
|
|
58
|
+
outline: 'var(--neo-stroke-focus-ring-width) solid var(--focus--ring--inverse)',
|
|
59
|
+
boxShadow: '0 0 0 var(--neo-stroke-focus-ring-width) var(--focus--gap--inverse)',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const components = {
|
|
64
|
+
MuiContainer: {
|
|
65
|
+
defaultProps: { maxWidth: false },
|
|
66
|
+
styleOverrides: {
|
|
67
|
+
root: ({ theme }) => ({
|
|
68
|
+
paddingInline: 'var(--neo-space-md-rem)',
|
|
69
|
+
[theme.breakpoints.up('md')]: { paddingInline: 'var(--neo-space-lg-rem)' },
|
|
70
|
+
[theme.breakpoints.up('xl')]: {
|
|
71
|
+
maxWidth: 'var(--neo-container-content)',
|
|
72
|
+
paddingInline: 0,
|
|
73
|
+
},
|
|
74
|
+
[theme.breakpoints.up('xxl')]: { maxWidth: 'var(--neo-container-wide)' },
|
|
75
|
+
'&.neo-wide': {
|
|
76
|
+
[theme.breakpoints.up('xl')]: { maxWidth: 'var(--neo-container-wide)' },
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
MuiTypography: {
|
|
83
|
+
defaultProps: {
|
|
84
|
+
variantMapping: {
|
|
85
|
+
h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6',
|
|
86
|
+
subtitle1: 'h6', subtitle2: 'h6', body1: 'p', body2: 'p', inherit: 'p',
|
|
87
|
+
button: 'span', caption: 'span', overline: 'span',
|
|
88
|
+
displayXlBold: 'h1',
|
|
89
|
+
headlineLgBold: 'h2', headlineMdBold: 'h3', headlineSmBold: 'h4',
|
|
90
|
+
titleLgBold: 'h5', titleLgMedium: 'h5',
|
|
91
|
+
titleMdBold: 'h6', titleMdMedium: 'h6',
|
|
92
|
+
titleSmBold: 'h6', titleSmMedium: 'h6',
|
|
93
|
+
titleXsBold: 'p',
|
|
94
|
+
bodyXlBold: 'p', bodyXlMedium: 'p', bodyXlRegular: 'p',
|
|
95
|
+
bodyLgBold: 'p', bodyLgMedium: 'p', bodyLgRegular: 'p',
|
|
96
|
+
bodyMdBold: 'p', bodyMdMedium: 'p', bodyMdRegular: 'p',
|
|
97
|
+
captionSmMedium: 'span', captionSmRegular: 'span',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
MuiButtonBase: {
|
|
103
|
+
defaultProps: { disableRipple: true },
|
|
104
|
+
},
|
|
105
|
+
MuiButton: {
|
|
106
|
+
defaultProps: { disableElevation: true, variant: 'contained', disableFocusRipple: true },
|
|
107
|
+
styleOverrides: {
|
|
108
|
+
root: ({ theme }) => {
|
|
109
|
+
const size = (S, h, padX, padY, typo, iconNode) => ({
|
|
110
|
+
[`&.MuiButton-size${S}`]: { minHeight: `var(--neo-button-height-${h}-rem)`, paddingInline: `var(--neo-space-${padX}-rem)`, paddingBlock: `var(--neo-space-${padY}-rem)`, ...theme.typography[typo],
|
|
111
|
+
'& .MuiButton-startIcon > *, & .MuiButton-endIcon > *': { width: `var(--neo-icon-size-${iconNode}-rem)`, height: `var(--neo-icon-size-${iconNode}-rem)` } },
|
|
112
|
+
});
|
|
113
|
+
const loading = (colors) => ({ '&&[aria-busy="true"]': colors });
|
|
114
|
+
const ghostInverse = { ...withIcon('--text--base--contrast'), ...loading(withIcon('--text--base--contrast')), '&:hover': { backgroundColor: 'var(--fill--tertiary--inverse--hover)' }, '&:active': { backgroundColor: 'var(--fill--tertiary--inverse--active)' } };
|
|
115
|
+
const ghost = { ...withIcon('--text--base--default'), ...loading(withIcon('--text--base--default')), '&:hover': { backgroundColor: 'var(--fill--tertiary--hover)' }, '&:active': { backgroundColor: 'var(--fill--tertiary--active)' } };
|
|
116
|
+
const contained = (f) => ({ backgroundColor: `var(${f.d})`, ...withIcon(f.on), ...loading({ backgroundColor: `var(${f.d})`, ...withIcon(f.on) }), '&:hover': { backgroundColor: `var(${f.h})` }, '&:active': { backgroundColor: `var(${f.a})` } });
|
|
117
|
+
return {
|
|
118
|
+
gap: 'var(--neo-space-sm-rem)', borderRadius: 'var(--neo-radius-pill)', textTransform: 'none',
|
|
119
|
+
whiteSpace: 'nowrap',
|
|
120
|
+
'& .MuiButton-startIcon, & .MuiButton-endIcon': { marginLeft: 0, marginRight: 0 },
|
|
121
|
+
...theme.typography.bodyLgMedium,
|
|
122
|
+
...size('Small', 'sm', 'md', 'xs', 'bodyMdMedium', 'xs'), ...size('Medium', 'md', 'lg', 'sm', 'bodyLgMedium', 'sm'), ...size('Large', 'lg', 'xl', 'sm', 'titleSmMedium', 'md'),
|
|
123
|
+
'&.Mui-focusVisible': { ...focusRing, ...focusRingInverse },
|
|
124
|
+
'&&.Mui-disabled:not([aria-busy="true"])': { backgroundColor: 'var(--fill--base--disabled)', ...withIcon('--text--base--disabled') },
|
|
125
|
+
'&&[aria-busy="true"]': { pointerEvents: 'none' },
|
|
126
|
+
variants: [
|
|
127
|
+
{ props: { variant: 'text' }, style: { '&[data-surface="inverse"]': ghostInverse } },
|
|
128
|
+
{ props: { variant: 'outlined' }, style: { '&[data-surface="inverse"]': ghostInverse } },
|
|
129
|
+
{ props: { variant: 'contained' }, style: { '&[data-surface="inverse"]': { backgroundColor: 'var(--fill--primary--inverse--default)', ...withIcon('--text--base--default'), '&:hover': { backgroundColor: 'var(--fill--primary--inverse--hover)' }, '&:active': { backgroundColor: 'var(--fill--primary--inverse--active)' } } } },
|
|
130
|
+
{ props: { variant: 'contained', color: 'secondary' }, style: { '&[data-surface="inverse"]': { backgroundColor: 'var(--fill--secondary--inverse--default)', ...withIcon('--text--base--contrast'), boxShadow: 'inset 0 0 0 var(--neo-stroke-xs) var(--border--base--contrast)', '&:hover': { backgroundColor: 'var(--fill--secondary--inverse--hover)' }, '&:active': { backgroundColor: 'var(--fill--secondary--inverse--active)' } } } },
|
|
131
|
+
{ props: { variant: 'contained', color: 'primary' }, style: contained(FILL.primary) },
|
|
132
|
+
{ props: { variant: 'contained', color: 'secondary' }, style: contained(FILL.secondary) },
|
|
133
|
+
{ props: { variant: 'text', color: 'primary' }, style: ghost },
|
|
134
|
+
{ props: { variant: 'text', color: 'secondary' }, style: ghost },
|
|
135
|
+
{ props: { variant: 'outlined', color: 'primary' }, style: ghost },
|
|
136
|
+
{ props: { variant: 'outlined', color: 'secondary' }, style: ghost },
|
|
137
|
+
...['primary', 'secondary', 'tertiary'].map((v) => ({
|
|
138
|
+
props: { color: 'brand' },
|
|
139
|
+
style: {
|
|
140
|
+
[`&[data-variant="${v}"]`]: {
|
|
141
|
+
'&.MuiButton-sizeLarge': theme.typography.titleMdBold,
|
|
142
|
+
backgroundColor: `var(--fill--brand--${v}--default)`,
|
|
143
|
+
...withIcon(v === 'primary' ? '--text--base--contrast' : '--text--base--brand-strong'),
|
|
144
|
+
'&:hover': { backgroundColor: `var(--fill--brand--${v}--hover)` },
|
|
145
|
+
'&:active': { backgroundColor: `var(--fill--brand--${v}--active)` },
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
})),
|
|
149
|
+
],
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
MuiIconButton: {
|
|
156
|
+
defaultProps: { disableFocusRipple: true },
|
|
157
|
+
styleOverrides: {
|
|
158
|
+
root: {
|
|
159
|
+
color: 'var(--icon--base--default)',
|
|
160
|
+
borderRadius: 'var(--neo-radius-pill)',
|
|
161
|
+
'&.Mui-focusVisible': { ...focusRing, ...focusRingInverse },
|
|
162
|
+
'&.Mui-disabled': { color: 'var(--icon--base--disabled)' },
|
|
163
|
+
|
|
164
|
+
'&[data-variant]': {
|
|
165
|
+
padding: 0,
|
|
166
|
+
'&.MuiIconButton-sizeSmall': { width: 'var(--neo-button-height-sm-rem)', height: 'var(--neo-button-height-sm-rem)',
|
|
167
|
+
'& .icon, & svg': { width: 'var(--neo-icon-size-xs-rem)', height: 'var(--neo-icon-size-xs-rem)' } },
|
|
168
|
+
'&.MuiIconButton-sizeMedium': { width: 'var(--neo-button-height-md-rem)', height: 'var(--neo-button-height-md-rem)',
|
|
169
|
+
'& .icon, & svg': { width: 'var(--neo-icon-size-sm-rem)', height: 'var(--neo-icon-size-sm-rem)' } },
|
|
170
|
+
'&.MuiIconButton-sizeLarge': { width: 'var(--neo-button-height-lg-rem)', height: 'var(--neo-button-height-lg-rem)',
|
|
171
|
+
'& .icon, & svg': { width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)' } },
|
|
172
|
+
...Object.fromEntries(Object.keys(iconSize).map((t) => [`&[class*="MuiIconButton-size"] svg.icon--${t}`,
|
|
173
|
+
{ width: `var(--neo-icon-size-${t}-rem)`, height: `var(--neo-icon-size-${t}-rem)` }])),
|
|
174
|
+
'& .icon, & svg': { fill: 'currentColor', color: 'inherit', flex: 'none' },
|
|
175
|
+
},
|
|
176
|
+
...Object.fromEntries([['primary', '--icon--base--contrast'], ['secondary', '--icon--base--default'], ['tertiary', '--icon--base--default']]
|
|
177
|
+
.map(([v, glyph]) => [`&[data-variant="${v}"]`, {
|
|
178
|
+
backgroundColor: `var(--fill--${v}--default)`, color: `var(${glyph})`,
|
|
179
|
+
'&:hover': { backgroundColor: `var(--fill--${v}--hover)` },
|
|
180
|
+
'&:active': { backgroundColor: `var(--fill--${v}--active)` },
|
|
181
|
+
}])),
|
|
182
|
+
...Object.fromEntries([['primary', '--icon--base--default'], ['secondary', '--icon--base--contrast'], ['tertiary', '--icon--base--contrast']]
|
|
183
|
+
.map(([v, glyph]) => [`&[data-variant="${v}"][data-surface="inverse"]`, {
|
|
184
|
+
backgroundColor: `var(--fill--${v}--inverse--default)`, color: `var(${glyph})`,
|
|
185
|
+
'&:hover': { backgroundColor: `var(--fill--${v}--inverse--hover)` },
|
|
186
|
+
'&:active': { backgroundColor: `var(--fill--${v}--inverse--active)` },
|
|
187
|
+
...(v === 'secondary' ? { border: 'var(--neo-stroke-xs) solid var(--border--base--contrast)' } : {}),
|
|
188
|
+
}])),
|
|
189
|
+
'&[data-variant].Mui-disabled': {
|
|
190
|
+
backgroundColor: 'var(--fill--base--disabled)', color: 'var(--icon--base--disabled)', border: 'none',
|
|
191
|
+
},
|
|
192
|
+
variants: [
|
|
193
|
+
...[['primary', '--icon--base--contrast'], ['secondary', '--icon--base--brand-strong'], ['tertiary', '--icon--base--brand-strong']]
|
|
194
|
+
.map(([v, glyph]) => ({
|
|
195
|
+
props: { color: 'brand' },
|
|
196
|
+
style: {
|
|
197
|
+
[`&[data-variant="${v}"]`]: {
|
|
198
|
+
backgroundColor: `var(--fill--brand--${v}--default)`, color: `var(${glyph})`,
|
|
199
|
+
'&:hover': { backgroundColor: `var(--fill--brand--${v}--hover)` },
|
|
200
|
+
'&:active': { backgroundColor: `var(--fill--brand--${v}--active)` },
|
|
201
|
+
'&.Mui-disabled': { backgroundColor: 'var(--fill--base--disabled)', color: 'var(--icon--base--disabled)' },
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
})),
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
MuiAlert: {
|
|
211
|
+
defaultProps: { iconMapping: alertIconMapping },
|
|
212
|
+
styleOverrides: {
|
|
213
|
+
standardError: ({ theme }) => statusAlert('error', theme), standardWarning: ({ theme }) => statusAlert('warning', theme),
|
|
214
|
+
standardInfo: ({ theme }) => statusAlert('info', theme), standardSuccess: ({ theme }) => statusAlert('success', theme),
|
|
215
|
+
message: {
|
|
216
|
+
'& .NeoAlert-description': {
|
|
217
|
+
display: '-webkit-box', WebkitBoxOrient: 'vertical', WebkitLineClamp: 3, overflow: 'hidden',
|
|
218
|
+
},
|
|
219
|
+
'& .alert__link': {
|
|
220
|
+
color: 'var(--text--base--default)',
|
|
221
|
+
fontSize: 'var(--neo-type-body-md-medium-size-rem)',
|
|
222
|
+
fontWeight: 'var(--neo-type-body-md-medium-weight)',
|
|
223
|
+
lineHeight: 'var(--neo-type-body-md-medium-line-height-rem)',
|
|
224
|
+
textDecoration: 'underline',
|
|
225
|
+
textDecorationColor: 'currentColor',
|
|
226
|
+
textUnderlineOffset: '2px',
|
|
227
|
+
textDecorationThickness: '1px',
|
|
228
|
+
textDecorationSkipInk: 'auto',
|
|
229
|
+
cursor: 'pointer',
|
|
230
|
+
display: 'inline-flex',
|
|
231
|
+
alignItems: 'center',
|
|
232
|
+
alignSelf: 'flex-start',
|
|
233
|
+
minHeight: '24px',
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
MuiBackdrop: {
|
|
240
|
+
styleOverrides: {
|
|
241
|
+
root: { backgroundColor: 'var(--surface--base--overlay)' },
|
|
242
|
+
invisible: { backgroundColor: 'transparent' },
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
MuiDialog: {
|
|
247
|
+
styleOverrides: {
|
|
248
|
+
paper: ({ theme }) => ({
|
|
249
|
+
alignItems: 'flex-start',
|
|
250
|
+
'& > .MuiDialogTitle-root, & > .MuiDialogContent-root, & > .MuiDialogActions-root': { alignSelf: 'stretch' },
|
|
251
|
+
backgroundColor: 'var(--surface--base--default)', borderRadius: 'var(--neo-radius-xl)',
|
|
252
|
+
boxShadow: 'none', backgroundImage: 'none',
|
|
253
|
+
'--neo-dialog-gutter': 'var(--neo-space-xl-rem)',
|
|
254
|
+
'--neo-dialog-actions-dir': 'row',
|
|
255
|
+
'--neo-dialog-actions-justify': 'center',
|
|
256
|
+
'--neo-dialog-actions-align': 'flex-start',
|
|
257
|
+
'--neo-dialog-actions-flex': '1 1 0',
|
|
258
|
+
'--neo-dialog-actions-min': '116px',
|
|
259
|
+
'--neo-dialog-close-gutter': 'var(--neo-space-sm-rem)',
|
|
260
|
+
'--neo-dialog-content-top': 'var(--neo-space-sm-rem)',
|
|
261
|
+
'--neo-dialog-content-bottom': 'var(--neo-space-xl-rem)',
|
|
262
|
+
'&[data-type="default"]': { '--neo-dialog-content-top': 'var(--neo-space-none-rem)' },
|
|
263
|
+
'&.MuiDialog-paperWidthXs': { maxWidth: '343px', maxHeight: '600px', '--neo-dialog-gutter': 'var(--neo-space-lg-rem)', '--neo-dialog-content-bottom': 'var(--neo-space-lg-rem)',
|
|
264
|
+
'--neo-dialog-actions-dir': 'column', '--neo-dialog-actions-justify': 'flex-start',
|
|
265
|
+
'--neo-dialog-actions-align': 'center',
|
|
266
|
+
'--neo-dialog-actions-flex': '0 0 auto',
|
|
267
|
+
'--neo-dialog-actions-width': '100%' },
|
|
268
|
+
'&.MuiDialog-paperWidthSm': { maxWidth: '600px', maxHeight: '700px' },
|
|
269
|
+
'&.MuiDialog-paperWidthMd': { maxWidth: '900px', maxHeight: '740px', '--neo-dialog-close-gutter': 'var(--neo-space-lg-rem)', '--neo-dialog-actions-justify': 'flex-end', '--neo-dialog-actions-flex': '0 0 auto', '--neo-dialog-actions-min': '160px' },
|
|
270
|
+
'&.MuiDialog-paperWidthLg': { maxWidth: '1200px', maxHeight: '840px', '--neo-dialog-gutter': 'var(--neo-space-2xl-rem)', '--neo-dialog-close-gutter': 'var(--neo-space-lg-rem)', '--neo-dialog-actions-justify': 'flex-end', '--neo-dialog-actions-flex': '0 0 auto', '--neo-dialog-actions-min': '160px' },
|
|
271
|
+
position: 'relative',
|
|
272
|
+
'& > .MuiIconButton-root': { position: 'absolute', top: '9px', right: 'var(--neo-space-sm-rem)' },
|
|
273
|
+
'&.MuiDialog-paperFullScreen': { borderRadius: 0 },
|
|
274
|
+
'&.MuiDialog-paperFullScreen .MuiDialogTitle-root': {
|
|
275
|
+
height: '104px', paddingBlock: 'var(--neo-space-xl-rem)', paddingInline: 'var(--neo-space-3xl-rem)',
|
|
276
|
+
justifyContent: 'center', alignItems: 'center',
|
|
277
|
+
borderBottom: 'var(--neo-stroke-xs) solid var(--border--base--secondary)',
|
|
278
|
+
position: 'relative',
|
|
279
|
+
'& > .NeoModalFullscreen-back': { position: 'absolute', left: 'var(--neo-space-3xl-rem)' },
|
|
280
|
+
'& > .NeoModalFullscreen-close': { position: 'absolute', right: 'var(--neo-space-3xl-rem)' },
|
|
281
|
+
},
|
|
282
|
+
'&.MuiDialog-paperFullScreen .MuiDialogContent-root': { paddingInline: 'var(--neo-space-3xl-rem)', paddingTop: 0,
|
|
283
|
+
display: 'grid', gridAutoRows: 'minmax(min-content, 1fr)' },
|
|
284
|
+
'&.MuiDialog-paperFullScreen .MuiDialogActions-root': {
|
|
285
|
+
height: '88px', paddingBlock: 'var(--neo-space-xl-rem)', paddingInline: 'var(--neo-space-3xl-rem)',
|
|
286
|
+
'& .MuiButton-root': { flex: '0 0 auto', width: '240px', minWidth: 0 },
|
|
287
|
+
borderTop: '1px solid transparent',
|
|
288
|
+
'&[data-scroll="top"], &[data-scroll="mid"]': { borderTopColor: 'var(--border--base--secondary)' },
|
|
289
|
+
},
|
|
290
|
+
'&.MuiDialog-paperFullScreen .NeoModalFullscreen-title': { flex: 1, textAlign: 'center' },
|
|
291
|
+
'@media (max-width: 719px)': {
|
|
292
|
+
'&.MuiDialog-paperFullScreen .MuiDialogTitle-root': {
|
|
293
|
+
height: '60px', paddingBlock: 'var(--neo-space-sm-rem)', paddingInline: 'var(--neo-space-sm-rem)',
|
|
294
|
+
borderBottom: 'none',
|
|
295
|
+
justifyContent: 'flex-start', gap: 'var(--neo-space-sm-rem)',
|
|
296
|
+
'& > .NeoModalFullscreen-back, & > .NeoModalFullscreen-close': { position: 'static' },
|
|
297
|
+
},
|
|
298
|
+
'&.MuiDialog-paperFullScreen .MuiDialogContent-root[data-scroll="mid"], &.MuiDialog-paperFullScreen .MuiDialogContent-root[data-scroll="bottom"]':
|
|
299
|
+
{ borderTop: 'var(--neo-stroke-xs) solid var(--border--base--secondary)' },
|
|
300
|
+
'&.MuiDialog-paperFullScreen .MuiDialogContent-root[data-scroll="top"], &.MuiDialog-paperFullScreen .MuiDialogContent-root[data-scroll="mid"]':
|
|
301
|
+
{ borderBottom: 'var(--neo-stroke-xs) solid var(--border--base--secondary)' },
|
|
302
|
+
'&.MuiDialog-paperFullScreen .MuiDialogContent-root': {
|
|
303
|
+
paddingInline: 'var(--neo-space-lg-rem)', paddingBottom: 'var(--neo-space-lg-rem)',
|
|
304
|
+
},
|
|
305
|
+
'&.MuiDialog-paperFullScreen .NeoModalFullscreen-title': {
|
|
306
|
+
flex: 1, textAlign: 'center', marginInlineEnd: 0,
|
|
307
|
+
},
|
|
308
|
+
'&.MuiDialog-paperFullScreen .NeoModalFullscreen-title:first-child': { textAlign: 'start' },
|
|
309
|
+
'&.MuiDialog-paperFullScreen .MuiDialogActions-root': {
|
|
310
|
+
borderTop: 'none',
|
|
311
|
+
height: '128px', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'stretch',
|
|
312
|
+
'& .MuiButton-root': { flex: '0 0 auto', minWidth: 0, width: '100%' },
|
|
313
|
+
paddingTop: 'var(--neo-space-md-rem)', paddingBottom: 'var(--neo-space-xl-rem)', paddingInline: 'var(--neo-space-lg-rem)',
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
'&.MuiDialog-paperFullScreen .MuiDialogTitle-root .MuiIconButton-root': {
|
|
317
|
+
'@media (max-width: 719px)': {
|
|
318
|
+
width: 'var(--neo-button-height-md-rem)', height: 'var(--neo-button-height-md-rem)',
|
|
319
|
+
'& .icon, & svg': { width: 'var(--neo-icon-size-sm-rem)', height: 'var(--neo-icon-size-sm-rem)' },
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
...Object.fromEntries(['info', 'success', 'warning', 'error'].map((i) => [
|
|
323
|
+
`&[data-type="${i}"]`, {
|
|
324
|
+
'& .MuiDialogTitle-root': {
|
|
325
|
+
color: `var(--text--semantic--${i})`, backgroundColor: `var(--fill--semantic--${i}--soft)`,
|
|
326
|
+
'& .NeoModalDialog-title': { flex: 'none' },
|
|
327
|
+
flexDirection: 'column', alignItems: 'center', justifyContent: 'center', textAlign: 'center', gap: 'var(--neo-space-md-rem)',
|
|
328
|
+
paddingTop: 'var(--neo-space-2xl-rem)', paddingBottom: 'var(--neo-space-xl-rem)',
|
|
329
|
+
paddingInline: 'var(--neo-dialog-gutter, var(--neo-space-xl-rem))',
|
|
330
|
+
borderBottomLeftRadius: '50% 14px', borderBottomRightRadius: '50% 14px',
|
|
331
|
+
},
|
|
332
|
+
'& .MuiDialogContent-root': { textAlign: 'center' },
|
|
333
|
+
'& .MuiDialogTitle-root .MuiSvgIcon-root, & .MuiDialogTitle-root .icon': { width: 'var(--neo-icon-size-3xl-rem)', height: 'var(--neo-icon-size-3xl-rem)', flex: 'none' },
|
|
334
|
+
},
|
|
335
|
+
])),
|
|
336
|
+
'&[data-type="brand"]': {
|
|
337
|
+
'& .MuiDialogTitle-root': {
|
|
338
|
+
color: 'var(--text--base--brand)',
|
|
339
|
+
'& .NeoModalDialog-title': { flex: 'none' },
|
|
340
|
+
flexDirection: 'column', alignItems: 'center', justifyContent: 'center', textAlign: 'center', gap: 'var(--neo-space-md-rem)',
|
|
341
|
+
paddingTop: 'var(--neo-space-2xl-rem)', paddingBottom: 'var(--neo-space-md-rem)',
|
|
342
|
+
paddingInline: 'var(--neo-dialog-gutter, var(--neo-space-xl-rem))',
|
|
343
|
+
},
|
|
344
|
+
'& .MuiDialogContent-root': { textAlign: 'center' },
|
|
345
|
+
'& .MuiDialogTitle-root .MuiSvgIcon-root, & .MuiDialogTitle-root .icon': { width: 'var(--neo-icon-size-4xl-rem)', height: 'var(--neo-icon-size-4xl-rem)', flex: 'none' },
|
|
346
|
+
},
|
|
347
|
+
}),
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
MuiDialogTitle: {
|
|
351
|
+
styleOverrides: {
|
|
352
|
+
root: ({ theme }) => ({
|
|
353
|
+
...theme.typography.titleSmBold, color: 'var(--text--base--default)',
|
|
354
|
+
display: 'flex', alignItems: 'flex-start', justifyContent: 'flex-start', gap: 'var(--neo-space-md-rem)',
|
|
355
|
+
'& .NeoModalDialog-title': {
|
|
356
|
+
flex: 1,
|
|
357
|
+
minWidth: 0, display: '-webkit-box', WebkitBoxOrient: 'vertical', WebkitLineClamp: 2, overflow: 'hidden',
|
|
358
|
+
},
|
|
359
|
+
paddingBlock: 'var(--neo-space-lg-rem)', paddingLeft: 'var(--neo-dialog-gutter, var(--neo-space-xl-rem))',
|
|
360
|
+
paddingRight: 'var(--neo-dialog-close-gutter, var(--neo-space-sm-rem))',
|
|
361
|
+
}),
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
MuiDialogContentText: {
|
|
365
|
+
styleOverrides: {
|
|
366
|
+
root: { color: 'var(--text--base--default)' },
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
MuiDialogContent: {
|
|
370
|
+
styleOverrides: {
|
|
371
|
+
root: ({ theme }) => ({
|
|
372
|
+
...theme.typography.bodyLgRegular, color: 'var(--text--base--default)',
|
|
373
|
+
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--neo-space-lg-rem)',
|
|
374
|
+
'& > *': { alignSelf: 'stretch' },
|
|
375
|
+
paddingTop: 'var(--neo-dialog-content-top, var(--neo-space-sm-rem))', paddingInline: 'var(--neo-dialog-gutter, var(--neo-space-xl-rem))',
|
|
376
|
+
paddingBottom: 'var(--neo-dialog-content-bottom, var(--neo-space-xl-rem))',
|
|
377
|
+
'&:focus-visible': { outline: 'none', boxShadow: focusRingInset.boxShadow },
|
|
378
|
+
}),
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
MuiDialogActions: {
|
|
382
|
+
styleOverrides: {
|
|
383
|
+
root: {
|
|
384
|
+
gap: 'var(--neo-space-md-rem)', paddingTop: 'var(--neo-space-lg-rem)',
|
|
385
|
+
paddingInline: 'var(--neo-dialog-gutter, var(--neo-space-xl-rem))', paddingBottom: 'var(--neo-space-xl-rem)',
|
|
386
|
+
flexDirection: 'var(--neo-dialog-actions-dir, row)',
|
|
387
|
+
justifyContent: 'var(--neo-dialog-actions-justify, center)',
|
|
388
|
+
alignItems: 'var(--neo-dialog-actions-align, flex-start)',
|
|
389
|
+
'& > div': { display: 'contents' },
|
|
390
|
+
'& .MuiButton-root': {
|
|
391
|
+
flex: 'var(--neo-dialog-actions-flex, 1 1 0)',
|
|
392
|
+
minWidth: 'var(--neo-dialog-actions-min, 116px)',
|
|
393
|
+
width: 'var(--neo-dialog-actions-width, auto)',
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
|
|
399
|
+
MuiCheckbox: {
|
|
400
|
+
defaultProps: { disableRipple: true, checkedIcon: _h(CheckboxCheckedIcon), indeterminateIcon: _h(CheckboxIndeterminateIcon) },
|
|
401
|
+
styleOverrides: {
|
|
402
|
+
root: {
|
|
403
|
+
padding: 'var(--neo-space-sm-rem)',
|
|
404
|
+
minHeight: '44px',
|
|
405
|
+
'& .MuiSvgIcon-root': {
|
|
406
|
+
width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)', borderRadius: 'var(--neo-radius-xs)',
|
|
407
|
+
border: 'var(--neo-stroke-xs) solid var(--border--base--default)', backgroundColor: 'var(--fill--base--default)', color: 'transparent', boxSizing: 'border-box',
|
|
408
|
+
},
|
|
409
|
+
'&:hover .MuiSvgIcon-root': { borderColor: 'var(--border--base--focus)' },
|
|
410
|
+
'&.Mui-checked .MuiSvgIcon-root, &.MuiCheckbox-indeterminate .MuiSvgIcon-root': { backgroundColor: 'var(--icon--base--default)', borderColor: 'var(--icon--base--default)', color: 'var(--text--base--contrast)' },
|
|
411
|
+
'&.Mui-focusVisible .MuiSvgIcon-root': focusRing,
|
|
412
|
+
'&.Mui-disabled .MuiSvgIcon-root': { backgroundColor: 'var(--fill--base--disabled)', borderColor: 'var(--border--base--disabled)' },
|
|
413
|
+
'&.Mui-disabled.Mui-checked .MuiSvgIcon-root, &.Mui-disabled.MuiCheckbox-indeterminate .MuiSvgIcon-root': { backgroundColor: 'var(--icon--base--disabled)', borderColor: 'var(--icon--base--disabled)', color: 'var(--text--base--contrast)' },
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
|
|
418
|
+
MuiRadio: {
|
|
419
|
+
defaultProps: { disableRipple: true },
|
|
420
|
+
styleOverrides: {
|
|
421
|
+
root: {
|
|
422
|
+
position: 'relative', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', padding: 'var(--neo-space-sm-rem)',
|
|
423
|
+
minHeight: '44px',
|
|
424
|
+
'& svg': { display: 'none' },
|
|
425
|
+
'&::before': { content: '""', boxSizing: 'border-box', width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)', borderRadius: 'var(--neo-radius-pill)', border: 'var(--neo-stroke-xs) solid var(--border--base--default)', backgroundColor: 'var(--fill--base--default)' },
|
|
426
|
+
'&::after': { content: '""', position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%,-50%)', width: 'var(--neo-radio-dot)', height: 'var(--neo-radio-dot)', borderRadius: 'var(--neo-radius-pill)', backgroundColor: 'var(--fill--base--default)', opacity: 0 },
|
|
427
|
+
'&:hover::before': { borderColor: 'var(--border--base--focus)' },
|
|
428
|
+
'&.Mui-checked::before': { backgroundColor: 'var(--icon--base--default)', borderColor: 'var(--icon--base--default)' },
|
|
429
|
+
'&.Mui-checked::after': { opacity: 1 },
|
|
430
|
+
'&.Mui-focusVisible::before': focusRing,
|
|
431
|
+
'&.Mui-disabled::before': { backgroundColor: 'var(--fill--base--disabled)', borderColor: 'var(--border--base--disabled)' },
|
|
432
|
+
'&.Mui-disabled.Mui-checked::before': { backgroundColor: 'var(--icon--base--disabled)', borderColor: 'var(--icon--base--disabled)' },
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
|
|
437
|
+
MuiSwitch: {
|
|
438
|
+
defaultProps: { disableRipple: true },
|
|
439
|
+
styleOverrides: {
|
|
440
|
+
root: {
|
|
441
|
+
width: 'var(--neo-switch-width-rem)', height: 'var(--neo-switch-height-rem)', padding: 0,
|
|
442
|
+
display: 'inline-flex', alignItems: 'center',
|
|
443
|
+
overflow: 'visible',
|
|
444
|
+
'.neo-toggle-field &': { marginLeft: 'var(--neo-space-lg-rem)' },
|
|
445
|
+
},
|
|
446
|
+
switchBase: {
|
|
447
|
+
padding: 'var(--neo-space-xs-rem)', top: '50%', transform: 'translateY(-50%)',
|
|
448
|
+
'&.Mui-checked': { transform: 'translateX(var(--neo-switch-thumb-travel-rem)) translateY(-50%)' },
|
|
449
|
+
'&.Mui-checked + .MuiSwitch-track': { backgroundColor: 'var(--fill--semantic--success--solid)', opacity: 1 },
|
|
450
|
+
'&.Mui-disabled + .MuiSwitch-track': { backgroundColor: 'var(--fill--base--disabled)', opacity: 1, border: 'var(--neo-stroke-xs) solid var(--border--base--disabled)' },
|
|
451
|
+
'&.Mui-disabled .MuiSwitch-thumb': { backgroundColor: 'var(--fill--base--medium)' },
|
|
452
|
+
'&.Mui-focusVisible + .MuiSwitch-track': focusRing,
|
|
453
|
+
'@media (prefers-reduced-motion: reduce)': { transition: 'none' },
|
|
454
|
+
},
|
|
455
|
+
thumb: { width: 'var(--neo-icon-size-xs-rem)', height: 'var(--neo-icon-size-xs-rem)', borderRadius: 'var(--neo-radius-pill)', backgroundColor: 'var(--fill--base--default)', boxShadow: 'none' },
|
|
456
|
+
track: { width: 'var(--neo-switch-width-rem)', height: 'var(--neo-switch-track-height-rem)', borderRadius: 'var(--neo-radius-pill)', backgroundColor: 'var(--fill--base--strong)', opacity: 1, '@media (prefers-reduced-motion: reduce)': { transition: 'none' } },
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
|
|
460
|
+
MuiFormControlLabel: {
|
|
461
|
+
styleOverrides: {
|
|
462
|
+
root: {
|
|
463
|
+
marginLeft: 0, marginRight: 0, gap: 0,
|
|
464
|
+
'&.neo-label-hidden .MuiFormControlLabel-label': { border: 0, clip: 'rect(0 0 0 0)', height: '1px', margin: '-1px', overflow: 'hidden', padding: 0, position: 'absolute', whiteSpace: 'nowrap', width: '1px' },
|
|
465
|
+
},
|
|
466
|
+
label: { margin: 0 },
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
|
|
470
|
+
MuiFormGroup: {
|
|
471
|
+
styleOverrides: {
|
|
472
|
+
root: { gap: 'var(--neo-space-xs-rem)' },
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
MuiChip: {
|
|
478
|
+
defaultProps: { deleteIcon: _h(ChipCloseIcon) },
|
|
479
|
+
styleOverrides: {
|
|
480
|
+
root: ({ theme }) => {
|
|
481
|
+
const label = { '& .MuiChip-label': { padding: 0 } };
|
|
482
|
+
const icons = (c) => ({
|
|
483
|
+
'& .MuiChip-icon, & .MuiChip-deleteIcon': {
|
|
484
|
+
color: `var(--icon--base--${c})`, fill: `var(--icon--base--${c})`,
|
|
485
|
+
margin: 0, width: 'var(--neo-icon-size-xs-rem)', height: 'var(--neo-icon-size-xs-rem)',
|
|
486
|
+
},
|
|
487
|
+
});
|
|
488
|
+
const interactive = {
|
|
489
|
+
...label,
|
|
490
|
+
...theme.typography.bodyMdMedium, height: '32px', boxSizing: 'border-box', borderRadius: 'var(--neo-radius-pill)', gap: 'var(--neo-space-xs-rem)',
|
|
491
|
+
paddingInline: 'var(--neo-space-md-rem)', paddingBlock: 'var(--neo-space-sm-rem)',
|
|
492
|
+
backgroundColor: 'var(--fill--base--default)', border: 'var(--neo-stroke-xs) solid var(--border--base--default)', color: 'var(--text--base--default)',
|
|
493
|
+
...icons('default'),
|
|
494
|
+
'&.Mui-focusVisible': { backgroundColor: 'var(--fill--base--default)' },
|
|
495
|
+
'&:has(input[type="radio"])': {
|
|
496
|
+
cursor: 'pointer', position: 'relative',
|
|
497
|
+
'& input[type="radio"]': { border: 0, clip: 'rect(0 0 0 0)', height: '1px', margin: '-1px', overflow: 'hidden', padding: 0, position: 'absolute', whiteSpace: 'nowrap', width: '1px' },
|
|
498
|
+
},
|
|
499
|
+
};
|
|
500
|
+
const interactiveStates = {
|
|
501
|
+
'&.Mui-focusVisible': focusRing,
|
|
502
|
+
'&:has(input:focus-visible)': focusRing,
|
|
503
|
+
'&.Mui-disabled': { opacity: 1, backgroundColor: 'var(--fill--base--disabled)', borderColor: 'var(--border--base--disabled)', color: 'var(--text--base--disabled)', ...icons('disabled') },
|
|
504
|
+
};
|
|
505
|
+
const lavado = {
|
|
506
|
+
backgroundColor: 'var(--fill--primary--hover)', borderColor: 'var(--fill--primary--hover)',
|
|
507
|
+
color: 'var(--text--base--contrast)', ...icons('contrast'),
|
|
508
|
+
};
|
|
509
|
+
const hoverWash = { '&.MuiChip-clickable:hover': lavado };
|
|
510
|
+
const radioHover = { '&:has(input[type="radio"]):not(.Mui-disabled):not([data-selected="true"])': { '&:hover': lavado } };
|
|
511
|
+
const selected = { backgroundColor: 'var(--fill--primary--active)', borderColor: 'var(--fill--primary--active)', color: 'var(--text--base--contrast)', ...icons('contrast'), '&:hover': { backgroundColor: 'var(--fill--primary--active)', borderColor: 'var(--fill--primary--active)' } };
|
|
512
|
+
const statusColor = (c) => ({ border: `var(--neo-stroke-xs) solid var(--border--semantic--${c === 'error' ? 'error-soft' : c})`, backgroundColor: `var(--fill--semantic--${c}--soft)`, color: `var(--text--semantic--${c})` });
|
|
513
|
+
return {
|
|
514
|
+
variants: [
|
|
515
|
+
{ props: { variant: 'filled' }, style: interactive },
|
|
516
|
+
{ props: { variant: 'outlined' }, style: interactive },
|
|
517
|
+
{ props: { variant: 'filled', clickable: true }, style: hoverWash },
|
|
518
|
+
{ props: { variant: 'outlined', clickable: true }, style: hoverWash },
|
|
519
|
+
{ props: { variant: 'filled' }, style: radioHover },
|
|
520
|
+
{ props: { variant: 'outlined' }, style: radioHover },
|
|
521
|
+
{ props: { variant: 'filled' }, style: { '&[data-selected="true"]': selected } },
|
|
522
|
+
{ props: { variant: 'outlined' }, style: { '&[data-selected="true"]': selected } },
|
|
523
|
+
{ props: { variant: 'filled' }, style: interactiveStates },
|
|
524
|
+
{ props: { variant: 'outlined' }, style: interactiveStates },
|
|
525
|
+
{ props: { variant: 'tag' }, style: {
|
|
526
|
+
...theme.typography.bodyMdMedium, height: 'auto', borderRadius: 'var(--neo-radius-xs)',
|
|
527
|
+
paddingInline: 'var(--neo-space-sm-rem)', paddingBlock: 'var(--neo-space-xs-rem)', gap: 'var(--neo-space-xs-rem)',
|
|
528
|
+
...label,
|
|
529
|
+
'& .MuiChip-label': { padding: 0, display: 'flex', alignItems: 'center', gap: 'var(--neo-space-xs-rem)' },
|
|
530
|
+
backgroundColor: 'var(--fill--base--light)', border: 'var(--neo-stroke-xs) solid var(--border--base--default)', color: 'var(--text--base--secondary)',
|
|
531
|
+
'& .MuiChip-icon, & .MuiChip-label .icon': { margin: 0, width: 'var(--neo-icon-size-sm-rem)', height: 'var(--neo-icon-size-sm-rem)', flexShrink: 0 },
|
|
532
|
+
...withIcon('--text--base--secondary'),
|
|
533
|
+
'&[data-tone="solid"]': {
|
|
534
|
+
backgroundColor: 'var(--fill--base--inverse)', borderColor: 'var(--fill--base--inverse)',
|
|
535
|
+
...withIcon('--text--base--contrast'),
|
|
536
|
+
},
|
|
537
|
+
} },
|
|
538
|
+
{ props: { variant: 'status' }, style: {
|
|
539
|
+
...theme.typography.bodyMdMedium, height: 'auto', borderRadius: 'var(--neo-radius-pill)',
|
|
540
|
+
paddingInline: 'var(--neo-space-md-rem)', paddingBlock: 'var(--neo-space-xs-rem)', border: 'var(--neo-stroke-xs) solid var(--border--base--secondary)',
|
|
541
|
+
backgroundColor: 'var(--fill--base--light)', color: 'var(--text--base--default)', ...label,
|
|
542
|
+
} },
|
|
543
|
+
{ props: { variant: 'status', color: 'success' }, style: statusColor('success') },
|
|
544
|
+
{ props: { variant: 'status', color: 'error' }, style: statusColor('error') },
|
|
545
|
+
{ props: { variant: 'status', color: 'info' }, style: statusColor('info') },
|
|
546
|
+
{ props: { variant: 'status', color: 'warning' }, style: statusColor('warning') },
|
|
547
|
+
],
|
|
548
|
+
};
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
|
|
553
|
+
MuiBadge: {
|
|
554
|
+
styleOverrides: {
|
|
555
|
+
root: { justifyContent: 'center', alignItems: 'center' },
|
|
556
|
+
badge: ({ theme }) => ({
|
|
557
|
+
...theme.typography.captionSmMedium, backgroundColor: 'var(--fill--semantic--error--solid)', color: 'var(--text--base--contrast)',
|
|
558
|
+
minWidth: 'var(--neo-icon-size-sm-rem)', height: 'var(--neo-icon-size-sm-rem)', borderRadius: 'var(--neo-radius-pill)', paddingInline: 'var(--neo-space-xs-rem)',
|
|
559
|
+
top: 'var(--neo-space-xs-rem)', right: 'var(--neo-space-xs-rem)', transform: 'none',
|
|
560
|
+
'&.MuiBadge-invisible': { transform: 'scale(0)' },
|
|
561
|
+
}),
|
|
562
|
+
dot: { minWidth: 'var(--neo-space-sm-rem)', width: 'var(--neo-space-sm-rem)', height: 'var(--neo-space-sm-rem)', padding: 0, borderRadius: 'var(--neo-radius-pill)', backgroundColor: 'var(--fill--semantic--error--solid)' },
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
|
|
566
|
+
MuiLink: {
|
|
567
|
+
defaultProps: { underline: 'always', color: 'inherit' },
|
|
568
|
+
styleOverrides: {
|
|
569
|
+
root: {
|
|
570
|
+
display: 'inline-flex', alignItems: 'center', gap: 'var(--neo-space-xs-rem)', cursor: 'pointer', position: 'relative',
|
|
571
|
+
borderRadius: 'var(--neo-radius-xs)', textDecoration: 'none', color: 'inherit',
|
|
572
|
+
'&::after': { content: '""', position: 'absolute', bottom: 0, left: 0, right: 0, height: 'var(--neo-stroke-xs)', background: 'currentColor' },
|
|
573
|
+
'&:focus-visible, &.Mui-focusVisible': { ...focusRing, ...focusRingInverse },
|
|
574
|
+
'&:not([href])': { color: 'var(--text--base--disabled)', pointerEvents: 'none', cursor: 'not-allowed' },
|
|
575
|
+
variants: [
|
|
576
|
+
{ props: { underline: 'none' }, style: { '&::after': { display: 'none' } } },
|
|
577
|
+
],
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
|
|
582
|
+
MuiDivider: {
|
|
583
|
+
styleOverrides: {
|
|
584
|
+
root: { height: 'var(--neo-stroke-xs)', margin: 0, border: 'none', backgroundColor: 'var(--border--base--secondary)' },
|
|
585
|
+
},
|
|
586
|
+
},
|
|
587
|
+
|
|
588
|
+
MuiTooltip: {
|
|
589
|
+
defaultProps: {
|
|
590
|
+
arrow: true,
|
|
591
|
+
slotProps: { popper: { modifiers: [{ name: 'offset', options: { offset: [0, 4] } }] } },
|
|
592
|
+
},
|
|
593
|
+
styleOverrides: {
|
|
594
|
+
tooltip: ({ theme }) => ({
|
|
595
|
+
...theme.typography.bodyMdRegular, backgroundColor: 'var(--fill--semantic--info--solid)', color: 'var(--text--base--contrast)',
|
|
596
|
+
paddingInline: 'var(--neo-space-sm-rem)', paddingBlock: 'var(--neo-space-xs-rem)', borderRadius: 'var(--neo-radius-xs)', maxWidth: '40ch',
|
|
597
|
+
'@media (prefers-reduced-motion: reduce)': { transition: 'none !important' },
|
|
598
|
+
}),
|
|
599
|
+
arrow: {
|
|
600
|
+
color: 'var(--fill--semantic--info--solid)',
|
|
601
|
+
'[data-popper-placement*="top"] &, [data-popper-placement*="bottom"] &': { width: '12px', height: '6px' },
|
|
602
|
+
'&::before': { transform: 'none', width: '100%', height: '100%', margin: 0 },
|
|
603
|
+
'[data-popper-placement*="top"] &::before': { clipPath: 'polygon(50% 100%, 0 0, 100% 0)' },
|
|
604
|
+
'[data-popper-placement*="bottom"] &::before': { clipPath: 'polygon(50% 0, 0 100%, 100% 100%)' },
|
|
605
|
+
'[data-popper-placement*="left"] &::before': { clipPath: 'polygon(100% 50%, 0 0, 0 100%)' },
|
|
606
|
+
'[data-popper-placement*="right"] &::before': { clipPath: 'polygon(0 50%, 100% 0, 100% 100%)' },
|
|
607
|
+
},
|
|
608
|
+
popper: {
|
|
609
|
+
'&[data-popper-placement*="left"] .MuiTooltip-arrow, &[data-popper-placement*="right"] .MuiTooltip-arrow': {
|
|
610
|
+
width: '6px', height: '12px',
|
|
611
|
+
},
|
|
612
|
+
'&[data-popper-placement*="top"] .MuiTooltip-arrow': { marginBottom: '-6px' },
|
|
613
|
+
'&[data-popper-placement*="bottom"] .MuiTooltip-arrow': { marginTop: '-6px' },
|
|
614
|
+
'&[data-popper-placement*="left"] .MuiTooltip-arrow': { marginRight: '-6px' },
|
|
615
|
+
'&[data-popper-placement*="right"] .MuiTooltip-arrow': { marginLeft: '-6px' },
|
|
616
|
+
},
|
|
617
|
+
},
|
|
618
|
+
},
|
|
619
|
+
|
|
620
|
+
MuiSnackbar: {
|
|
621
|
+
defaultProps: {
|
|
622
|
+
autoHideDuration: 5000,
|
|
623
|
+
TransitionComponent: Fade,
|
|
624
|
+
transitionDuration: { enter: 250, exit: 200 },
|
|
625
|
+
TransitionProps: {
|
|
626
|
+
easing: { enter: easing.easeOut, exit: easing.easeIn },
|
|
627
|
+
onEnter: (node) => {
|
|
628
|
+
if (movimientoReducido()) return;
|
|
629
|
+
const t = node.style.transition;
|
|
630
|
+
node.style.transition = 'none';
|
|
631
|
+
node.style.transform = SNACKBAR_DESPLAZA;
|
|
632
|
+
node.getBoundingClientRect();
|
|
633
|
+
node.style.transition = conTransform(t);
|
|
634
|
+
},
|
|
635
|
+
onEntering: (node) => { if (!movimientoReducido()) node.style.transform = 'none'; },
|
|
636
|
+
onExit: (node) => {
|
|
637
|
+
if (movimientoReducido()) return;
|
|
638
|
+
node.style.transition = conTransform(node.style.transition);
|
|
639
|
+
node.style.transform = SNACKBAR_DESPLAZA;
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
|
|
643
|
+
},
|
|
644
|
+
styleOverrides: {
|
|
645
|
+
root: ({ theme }) => ({
|
|
646
|
+
[theme.breakpoints.up('sm')]: { right: 'var(--neo-space-2xl-rem)', bottom: 'var(--neo-space-2xl-rem)' },
|
|
647
|
+
[theme.breakpoints.down('sm')]: { left: 'var(--neo-space-lg-rem)', right: 'var(--neo-space-lg-rem)', bottom: 'var(--neo-space-2xl-rem)' },
|
|
648
|
+
}),
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
MuiSnackbarContent: {
|
|
652
|
+
styleOverrides: {
|
|
653
|
+
root: ({ theme }) => ({
|
|
654
|
+
backgroundColor: 'var(--fill--base--inverse)',
|
|
655
|
+
color: 'var(--text--base--contrast)',
|
|
656
|
+
borderRadius: 'var(--neo-radius-lg)',
|
|
657
|
+
paddingBlock: 'var(--neo-space-md-rem)',
|
|
658
|
+
paddingInline: 'var(--neo-space-lg-rem)',
|
|
659
|
+
gap: 'var(--neo-space-sm-rem)',
|
|
660
|
+
flexWrap: 'nowrap',
|
|
661
|
+
boxShadow: 'none',
|
|
662
|
+
[theme.breakpoints.up('sm')]: { minWidth: 0 },
|
|
663
|
+
[theme.breakpoints.down('sm')]: {
|
|
664
|
+
display: 'grid',
|
|
665
|
+
gridTemplateColumns: '1fr auto',
|
|
666
|
+
gridTemplateRows: 'minmax(var(--neo-icon-size-lg-rem), auto)',
|
|
667
|
+
},
|
|
668
|
+
}),
|
|
669
|
+
message: ({ theme }) => ({
|
|
670
|
+
padding: 0,
|
|
671
|
+
flex: 'none',
|
|
672
|
+
minWidth: 0,
|
|
673
|
+
minHeight: 'var(--neo-icon-size-lg-rem)',
|
|
674
|
+
display: 'flex',
|
|
675
|
+
alignItems: 'center',
|
|
676
|
+
fontSize: 'var(--neo-type-body-lg-bold-size-rem)',
|
|
677
|
+
fontWeight: 'var(--neo-type-body-lg-bold-weight)',
|
|
678
|
+
lineHeight: 'var(--neo-type-body-lg-bold-line-height-rem)',
|
|
679
|
+
'& .NeoSnackbar-message': { display: 'flex', alignItems: 'center', gap: 'var(--neo-space-sm-rem)' },
|
|
680
|
+
'& .NeoSnackbar-icon': { display: 'inline-flex', flexShrink: 0, width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)' },
|
|
681
|
+
[theme.breakpoints.down('sm')]: {
|
|
682
|
+
gridColumn: 1,
|
|
683
|
+
gridRow: 1,
|
|
684
|
+
alignSelf: 'start',
|
|
685
|
+
alignItems: 'flex-start',
|
|
686
|
+
minHeight: 0,
|
|
687
|
+
paddingTop: 'var(--neo-space-xs-rem)',
|
|
688
|
+
'& .NeoSnackbar-message': { alignItems: 'flex-start' },
|
|
689
|
+
'& .NeoSnackbar-text': { flex: 1, display: '-webkit-box', WebkitBoxOrient: 'vertical', WebkitLineClamp: 2, overflow: 'hidden' },
|
|
690
|
+
},
|
|
691
|
+
'& .NeoSnackbar-text': { minWidth: 0 },
|
|
692
|
+
}),
|
|
693
|
+
action: ({ theme }) => ({
|
|
694
|
+
paddingLeft: 0,
|
|
695
|
+
marginLeft: 0,
|
|
696
|
+
marginRight: 0,
|
|
697
|
+
gap: 'var(--neo-space-sm-rem)',
|
|
698
|
+
color: 'var(--text--base--contrast)',
|
|
699
|
+
'& > .NeoSnackbar-action': { display: 'inline-flex', alignItems: 'center', paddingLeft: 'var(--neo-space-sm-rem)' },
|
|
700
|
+
[theme.breakpoints.down('sm')]: {
|
|
701
|
+
display: 'contents',
|
|
702
|
+
'& > .NeoSnackbar-action': { gridColumn: '1 / -1', gridRow: 2, justifySelf: 'end' },
|
|
703
|
+
'& > .NeoSnackbar-close': { gridColumn: 2, gridRow: 1, alignSelf: 'start' },
|
|
704
|
+
},
|
|
705
|
+
}),
|
|
706
|
+
},
|
|
707
|
+
},
|
|
708
|
+
|
|
709
|
+
MuiCircularProgress: {
|
|
710
|
+
defaultProps: { 'aria-hidden': true },
|
|
711
|
+
styleOverrides: {
|
|
712
|
+
root: {
|
|
713
|
+
color: 'var(--icon--base--default)', width: 'var(--neo-icon-size-md-rem) !important', height: 'var(--neo-icon-size-md-rem) !important', flexShrink: 0,
|
|
714
|
+
'& .MuiCircularProgress-circle': { strokeWidth: 3.6667 },
|
|
715
|
+
'@media (prefers-reduced-motion: reduce)': { animation: 'none', '& .MuiCircularProgress-circle': { animation: 'none' } },
|
|
716
|
+
variants: [
|
|
717
|
+
{ props: { size: 'sm' }, style: { width: 'var(--neo-icon-size-sm-rem) !important', height: 'var(--neo-icon-size-sm-rem) !important', '& .MuiCircularProgress-circle': { strokeWidth: 4.4 } } },
|
|
718
|
+
{ props: { size: 'lg' }, style: { width: 'var(--neo-icon-size-lg-rem) !important', height: 'var(--neo-icon-size-lg-rem) !important', '& .MuiCircularProgress-circle': { strokeWidth: 4.125 } } },
|
|
719
|
+
],
|
|
720
|
+
},
|
|
721
|
+
},
|
|
722
|
+
},
|
|
723
|
+
|
|
724
|
+
MuiTabs: {
|
|
725
|
+
defaultProps: { variant: 'scrollable', scrollButtons: false },
|
|
726
|
+
styleOverrides: {
|
|
727
|
+
root: {
|
|
728
|
+
minHeight: 'auto', position: 'relative', backgroundColor: 'var(--surface--base--default)',
|
|
729
|
+
'&[data-overflow~="end"]': { borderRightColor: 'transparent', borderTopRightRadius: 0 },
|
|
730
|
+
'&[data-overflow~="start"]': { borderLeftColor: 'transparent', borderTopLeftRadius: 0 },
|
|
731
|
+
'&[data-overflow="end"]': { clipPath: 'inset(-100vmax 0 -100vmax -100vmax)' },
|
|
732
|
+
'&[data-overflow="start"]': { clipPath: 'inset(-100vmax -100vmax -100vmax 0)' },
|
|
733
|
+
'&[data-overflow="start end"]': { clipPath: 'inset(-100vmax 0)' },
|
|
734
|
+
alignItems: 'center',
|
|
735
|
+
borderStyle: 'solid', borderWidth: 'var(--neo-stroke-xs)', borderColor: 'var(--border--base--secondary)',
|
|
736
|
+
borderRadius: 'var(--neo-radius-sm) var(--neo-radius-sm) 0 0', boxShadow: 'var(--neo-elevation-md)',
|
|
737
|
+
width: 'fit-content', maxWidth: '100%',
|
|
738
|
+
},
|
|
739
|
+
indicator: { display: 'none' },
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
MuiTab: {
|
|
743
|
+
defaultProps: { disableRipple: true },
|
|
744
|
+
styleOverrides: {
|
|
745
|
+
iconWrapper: { marginBottom: 0 },
|
|
746
|
+
root: ({ theme }) => ({
|
|
747
|
+
minHeight: 'auto', textTransform: 'none', gap: 'var(--neo-space-sm-rem)', paddingInline: 'var(--neo-space-lg-rem)', paddingBlock: 'var(--neo-space-md-rem)',
|
|
748
|
+
flexDirection: 'row', alignItems: 'center',
|
|
749
|
+
...theme.typography.bodyLgMedium, color: 'var(--text--base--secondary)',
|
|
750
|
+
backgroundColor: 'var(--fill--tertiary--default)', position: 'relative',
|
|
751
|
+
'&:first-of-type': { borderTopLeftRadius: 'var(--neo-radius-sm)' },
|
|
752
|
+
'&:last-of-type': { borderTopRightRadius: 'var(--neo-radius-sm)' },
|
|
753
|
+
'&::before': { content: '""', position: 'absolute', top: 0, bottom: 0, right: 0, width: 'var(--neo-stroke-xs)', backgroundColor: 'var(--border--base--secondary)', zIndex: 1 },
|
|
754
|
+
'&:last-of-type::before': { display: 'none' },
|
|
755
|
+
'&::after': { content: '""', position: 'absolute', bottom: 0, left: 0, right: 0, height: 'var(--neo-stroke-sm)', backgroundColor: 'var(--border--base--default)' },
|
|
756
|
+
'&:hover': { backgroundColor: 'var(--fill--tertiary--hover)', color: 'var(--text--base--default)' },
|
|
757
|
+
'&.Mui-selected': { backgroundColor: 'var(--fill--tertiary--active)', color: 'var(--text--base--default)', '&::after': { backgroundColor: 'var(--border--base--focus)' } },
|
|
758
|
+
'&.Mui-focusVisible': { outline: 'var(--neo-stroke-focus-ring-width) solid var(--focus--ring--default)', outlineOffset: 'calc(-1 * var(--neo-stroke-focus-ring-width))', boxShadow: 'inset 0 0 0 calc(var(--neo-stroke-focus-ring-width) * 2) var(--focus--gap--default)',
|
|
759
|
+
isolation: 'isolate', '&::before, &::after': { zIndex: -1 } },
|
|
760
|
+
'&.Mui-disabled': { color: 'var(--text--base--disabled)', '&::after': { backgroundColor: 'var(--border--base--secondary)' } },
|
|
761
|
+
'& svg': { color: 'var(--icon--base--secondary)', width: 'var(--neo-icon-size-sm-rem)', height: 'var(--neo-icon-size-sm-rem)', margin: 0, flexShrink: 0 },
|
|
762
|
+
'&.Mui-selected svg': { color: 'var(--icon--base--default)' },
|
|
763
|
+
'&.Mui-disabled svg': { color: 'var(--icon--base--disabled)' },
|
|
764
|
+
}),
|
|
765
|
+
},
|
|
766
|
+
},
|
|
767
|
+
|
|
768
|
+
MuiFormControl: {
|
|
769
|
+
styleOverrides: {
|
|
770
|
+
root: ({ theme }) => ({
|
|
771
|
+
display: 'flex', flexDirection: 'column', gap: 'var(--neo-space-xs-rem)',
|
|
772
|
+
'& .field__label-row, & .select__label-row, & .combobox__label-row': { display: 'flex', alignItems: 'center', gap: 'var(--neo-space-xs-rem)' },
|
|
773
|
+
'& .field__footer': { display: 'flex', alignItems: 'center', justifyContent: 'flex-start', gap: 'var(--neo-space-sm-rem)' },
|
|
774
|
+
'& .field__footer .MuiFormHelperText-root': { margin: 0, flex: 1 },
|
|
775
|
+
'& .field__footer .field__counter': { marginLeft: 'auto' },
|
|
776
|
+
'& .field__counter': {
|
|
777
|
+
flexShrink: 0, ...theme.typography.bodyMdRegular, color: 'var(--text--base--secondary)',
|
|
778
|
+
},
|
|
779
|
+
'& .field__icon--tooltip, & .select__icon--tooltip, & .combobox__icon--tooltip': {
|
|
780
|
+
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
|
781
|
+
width: 'var(--neo-icon-size-xs-rem)', height: 'var(--neo-icon-size-xs-rem)',
|
|
782
|
+
padding: 0, border: 'none', background: 'none', cursor: 'pointer',
|
|
783
|
+
color: 'var(--icon--base--secondary)',
|
|
784
|
+
position: 'relative',
|
|
785
|
+
'&::after': {
|
|
786
|
+
content: '""', position: 'absolute',
|
|
787
|
+
inset: 'calc((var(--neo-icon-size-md-rem) - var(--neo-icon-size-xs-rem)) / -2)',
|
|
788
|
+
},
|
|
789
|
+
},
|
|
790
|
+
'& .field__icon--tooltip .icon, & .select__icon--tooltip .icon, & .combobox__icon--tooltip .icon': { width: 'var(--neo-icon-size-xs-rem)', height: 'var(--neo-icon-size-xs-rem)' },
|
|
791
|
+
'&:has(.Mui-disabled) .field__counter': { color: 'var(--text--base--disabled)' },
|
|
792
|
+
'& .NeoSelect-placeholder': { color: 'var(--text--base--secondary)' },
|
|
793
|
+
'&:has(.Mui-disabled) .NeoSelect-placeholder': { color: 'var(--text--base--disabled)' },
|
|
794
|
+
'&:has(.MuiInputBase-readOnly) .NeoSelect-placeholder': { color: 'var(--text--base--default)' },
|
|
795
|
+
}),
|
|
796
|
+
},
|
|
797
|
+
},
|
|
798
|
+
MuiFormLabel: {
|
|
799
|
+
styleOverrides: {
|
|
800
|
+
root: ({ theme }) => ({
|
|
801
|
+
...theme.typography.bodyLgMedium, color: 'var(--text--base--default)',
|
|
802
|
+
whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', minWidth: 0,
|
|
803
|
+
'&.Mui-focused': { color: 'var(--text--base--default)' },
|
|
804
|
+
'&&.Mui-error': { color: 'var(--text--semantic--error)' },
|
|
805
|
+
'&.Mui-disabled': { color: 'var(--text--base--disabled)' },
|
|
806
|
+
'& .MuiFormLabel-asterisk': { color: 'var(--text--semantic--error)' },
|
|
807
|
+
}),
|
|
808
|
+
},
|
|
809
|
+
},
|
|
810
|
+
MuiOutlinedInput: {
|
|
811
|
+
styleOverrides: {
|
|
812
|
+
root: {
|
|
813
|
+
minHeight: 'var(--neo-input-height)',
|
|
814
|
+
borderRadius: 'var(--neo-radius-sm)', backgroundColor: 'var(--fill--base--default)',
|
|
815
|
+
gap: 'var(--neo-space-sm-rem)',
|
|
816
|
+
isolation: 'isolate',
|
|
817
|
+
'& .MuiInputBase-input:not([aria-hidden="true"]), & .MuiInputAdornment-root': { position: 'relative', zIndex: 1 },
|
|
818
|
+
'& .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--border--base--default)', borderWidth: 'var(--neo-stroke-xs)' },
|
|
819
|
+
'&:hover .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--border--base--focus)' },
|
|
820
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--border--base--focus)', borderWidth: 'var(--neo-stroke-sm)' },
|
|
821
|
+
'&.Mui-focused:has(.MuiSelect-select[aria-expanded="false"]) .MuiOutlinedInput-notchedOutline': {
|
|
822
|
+
borderColor: 'var(--border--base--default)', borderWidth: 'var(--neo-stroke-xs)',
|
|
823
|
+
},
|
|
824
|
+
'&.field--focus': focusRingField,
|
|
825
|
+
'&:has(.MuiSelect-select:focus-visible)': focusRingField,
|
|
826
|
+
'&.Mui-error .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--border--semantic--error-solid)', borderWidth: 'var(--neo-stroke-sm)' },
|
|
827
|
+
'&.Mui-disabled': {
|
|
828
|
+
backgroundColor: 'var(--fill--base--disabled)',
|
|
829
|
+
'& .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--border--base--disabled)' },
|
|
830
|
+
'& .icon': { color: 'var(--icon--base--disabled)' },
|
|
831
|
+
'& .field__prefix, & .field__suffix': { color: 'var(--text--base--disabled)' },
|
|
832
|
+
},
|
|
833
|
+
'&.MuiInputBase-readOnly': {
|
|
834
|
+
backgroundColor: 'var(--fill--base--medium)',
|
|
835
|
+
borderColor: 'var(--border--base--default)',
|
|
836
|
+
cursor: 'default',
|
|
837
|
+
'& .MuiOutlinedInput-input': { color: 'var(--text--base--default)', cursor: 'default' },
|
|
838
|
+
'& .MuiOutlinedInput-input::placeholder': { color: 'var(--text--base--default)', opacity: 1 },
|
|
839
|
+
'& .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--border--base--default)' },
|
|
840
|
+
'&:hover .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--border--base--default)' },
|
|
841
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--border--base--default)', borderWidth: 'var(--neo-stroke-xs)' },
|
|
842
|
+
'& .MuiSelect-icon': { color: 'var(--icon--base--secondary)' },
|
|
843
|
+
'& .MuiSelect-select': { cursor: 'default' },
|
|
844
|
+
},
|
|
845
|
+
'&.MuiInputBase-adornedStart': { paddingLeft: 'var(--neo-space-md-rem)', '& .MuiOutlinedInput-input': { paddingLeft: 0 } },
|
|
846
|
+
'&.MuiInputBase-adornedEnd': { paddingRight: 'var(--neo-space-md-rem)', '& .MuiOutlinedInput-input': { paddingRight: 0 } },
|
|
847
|
+
'& .MuiInputAdornment-positionStart': { marginRight: 0 },
|
|
848
|
+
'& .MuiInputAdornment-positionEnd': { marginLeft: 0 },
|
|
849
|
+
'&.MuiInputBase-multiline': {
|
|
850
|
+
minHeight: 112, padding: 'var(--neo-space-md-rem)',
|
|
851
|
+
alignItems: 'flex-start',
|
|
852
|
+
'& .MuiInputBase-inputMultiline': { padding: 0 },
|
|
853
|
+
},
|
|
854
|
+
},
|
|
855
|
+
input: ({ theme }) => ({
|
|
856
|
+
...theme.typography.bodyLgRegular, color: 'var(--text--base--default)', paddingInline: 'var(--neo-space-md-rem)', paddingBlock: 'var(--neo-space-sm-rem)',
|
|
857
|
+
flex: 1,
|
|
858
|
+
'&::placeholder': { color: 'var(--text--base--secondary)', opacity: 1 },
|
|
859
|
+
'&.Mui-disabled': { WebkitTextFillColor: 'var(--text--base--disabled)' },
|
|
860
|
+
}),
|
|
861
|
+
},
|
|
862
|
+
},
|
|
863
|
+
MuiFormHelperText: {
|
|
864
|
+
styleOverrides: {
|
|
865
|
+
root: ({ theme }) => ({
|
|
866
|
+
...theme.typography.bodyMdRegular, color: 'var(--text--base--secondary)', marginInline: 0,
|
|
867
|
+
whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', minWidth: 0,
|
|
868
|
+
|
|
869
|
+
'&&.Mui-error': {
|
|
870
|
+
color: 'var(--text--semantic--error)', display: 'flex', alignItems: 'center', gap: 'var(--neo-space-xs-rem)',
|
|
871
|
+
'&::before': {
|
|
872
|
+
content: '""', flex: '0 0 auto', width: 'var(--neo-icon-size-xs-rem)', height: 'var(--neo-icon-size-xs-rem)', backgroundColor: 'var(--icon--semantic--error)',
|
|
873
|
+
maskImage: `url("data:image/svg+xml,${encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM11 12V8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8V12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12ZM12 15C12.5523 15 13 15.4477 13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16C11 15.4477 11.4477 15 12 15Z'/></svg>")}")`,
|
|
874
|
+
WebkitMaskImage: `url("data:image/svg+xml,${encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM11 12V8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8V12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12ZM12 15C12.5523 15 13 15.4477 13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16C11 15.4477 11.4477 15 12 15Z'/></svg>")}")`,
|
|
875
|
+
maskSize: 'contain', WebkitMaskSize: 'contain', maskRepeat: 'no-repeat', WebkitMaskRepeat: 'no-repeat',
|
|
876
|
+
},
|
|
877
|
+
},
|
|
878
|
+
'&.Mui-disabled': { color: 'var(--text--base--disabled)' },
|
|
879
|
+
}),
|
|
880
|
+
},
|
|
881
|
+
},
|
|
882
|
+
|
|
883
|
+
MuiMenu: {
|
|
884
|
+
defaultProps: { anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, transformOrigin: { vertical: 'top', horizontal: 'left' } },
|
|
885
|
+
styleOverrides: {
|
|
886
|
+
paper: {
|
|
887
|
+
marginTop: 'var(--neo-space-sm-rem)', minWidth: 'var(--neo-menu-min-width)', backgroundColor: 'var(--surface--base--default)',
|
|
888
|
+
border: 'var(--neo-stroke-xs) solid var(--border--base--secondary)', borderRadius: 'var(--neo-radius-sm)',
|
|
889
|
+
boxShadow: 'var(--neo-elevation-md)', overflowX: 'hidden', overflowY: 'auto',
|
|
890
|
+
'& .MuiMenu-list': { paddingBlock: 0 },
|
|
891
|
+
maxHeight: '260px',
|
|
892
|
+
'@media (prefers-reduced-motion: reduce)': { transition: 'none !important' },
|
|
893
|
+
},
|
|
894
|
+
},
|
|
895
|
+
},
|
|
896
|
+
MuiMenuItem: {
|
|
897
|
+
styleOverrides: {
|
|
898
|
+
root: ({ theme }) => ({
|
|
899
|
+
gap: 'var(--neo-space-md-rem)', minHeight: 'var(--neo-menu-item-min-height)', paddingBlock: 'var(--neo-space-sm-rem)', paddingInline: 'var(--neo-space-lg-rem)',
|
|
900
|
+
...theme.typography.bodyLgRegular, color: 'var(--text--base--default)', backgroundColor: 'var(--fill--tertiary--default)',
|
|
901
|
+
'& .NeoMenu-label': { minWidth: 0, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' },
|
|
902
|
+
'&:hover': { backgroundColor: 'var(--fill--tertiary--hover)' },
|
|
903
|
+
'&.Mui-selected, &.Mui-selected:hover': { backgroundColor: 'var(--fill--tertiary--active)' },
|
|
904
|
+
'&.Mui-focusVisible': { ...focusRingInset, backgroundColor: 'var(--fill--tertiary--default)' },
|
|
905
|
+
'&.Mui-focusVisible:hover': { backgroundColor: 'var(--fill--tertiary--hover)' },
|
|
906
|
+
'&.Mui-selected.Mui-focusVisible, &.Mui-selected.Mui-focusVisible:hover': { backgroundColor: 'var(--fill--tertiary--active)' },
|
|
907
|
+
'&.Mui-disabled': { opacity: 1, backgroundColor: 'var(--fill--base--disabled)', color: 'var(--text--base--disabled)',
|
|
908
|
+
'& .menu-item__icon': { color: 'var(--icon--base--disabled)', fill: 'var(--icon--base--disabled)' } },
|
|
909
|
+
}),
|
|
910
|
+
},
|
|
911
|
+
},
|
|
912
|
+
|
|
913
|
+
MuiSelect: {
|
|
914
|
+
defaultProps: { IconComponent: SelectChevronIcon },
|
|
915
|
+
styleOverrides: {
|
|
916
|
+
select: ({ theme }) => ({ ...theme.typography.bodyLgRegular, color: 'var(--text--base--default)', textAlign: 'left', paddingBlock: 'var(--neo-space-sm-rem)' }),
|
|
917
|
+
icon: {
|
|
918
|
+
width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)',
|
|
919
|
+
top: 'calc(50% - (var(--neo-icon-size-md-rem) / 2))', color: 'var(--icon--base--secondary)',
|
|
920
|
+
right: 'var(--neo-space-md-rem)',
|
|
921
|
+
transition: 'transform 150ms ease',
|
|
922
|
+
'@media (prefers-reduced-motion: reduce)': { transition: 'none' },
|
|
923
|
+
'&.Mui-disabled': { color: 'var(--icon--base--disabled)' },
|
|
924
|
+
},
|
|
925
|
+
iconOpen: { transform: 'rotate(180deg)' },
|
|
926
|
+
},
|
|
927
|
+
},
|
|
928
|
+
|
|
929
|
+
MuiAutocomplete: {
|
|
930
|
+
defaultProps: { popupIcon: _h(SelectChevronIcon), includeInputInList: true },
|
|
931
|
+
styleOverrides: {
|
|
932
|
+
inputRoot: {
|
|
933
|
+
padding: 0,
|
|
934
|
+
'& .MuiAutocomplete-input': { paddingBlock: 'var(--neo-space-sm-rem)', paddingLeft: 'var(--neo-space-md-rem)', paddingRight: 0 },
|
|
935
|
+
'&.MuiInputBase-adornedStart .MuiAutocomplete-input': { paddingLeft: 0 },
|
|
936
|
+
'.MuiAutocomplete-hasPopupIcon&, .MuiAutocomplete-hasClearIcon&': {
|
|
937
|
+
paddingRight: 'calc(var(--neo-space-md-rem) + var(--neo-icon-size-md-rem) + var(--neo-space-sm-rem))',
|
|
938
|
+
},
|
|
939
|
+
'.MuiAutocomplete-hasPopupIcon.MuiAutocomplete-hasClearIcon&': {
|
|
940
|
+
paddingRight: 'calc(var(--neo-space-md-rem) + var(--neo-icon-size-md-rem) + var(--neo-space-sm-rem) + var(--neo-icon-size-lg-rem) + var(--neo-space-sm-rem))',
|
|
941
|
+
},
|
|
942
|
+
'& .MuiAutocomplete-endAdornment': { right: 'var(--neo-space-md-rem)', top: 0, bottom: 0, transform: 'none', display: 'flex', alignItems: 'center', gap: 'var(--neo-space-sm-rem)' },
|
|
943
|
+
},
|
|
944
|
+
paper: {
|
|
945
|
+
backgroundColor: 'var(--surface--base--default)', border: 'var(--neo-stroke-xs) solid var(--border--base--secondary)',
|
|
946
|
+
borderRadius: 'var(--neo-radius-sm)', boxShadow: 'var(--neo-elevation-md)', marginTop: 'var(--neo-space-sm-rem)',
|
|
947
|
+
overflow: 'hidden', maxHeight: '260px',
|
|
948
|
+
},
|
|
949
|
+
listbox: { paddingBlock: 0, maxHeight: '260px',
|
|
950
|
+
'& .MuiAutocomplete-option': {
|
|
951
|
+
backgroundColor: 'var(--fill--tertiary--default)',
|
|
952
|
+
'&:hover': { backgroundColor: 'var(--fill--tertiary--hover)' },
|
|
953
|
+
'&.Mui-focused': { backgroundColor: 'var(--fill--tertiary--hover)' },
|
|
954
|
+
'&.Mui-focusVisible': { backgroundColor: 'var(--fill--tertiary--default)' },
|
|
955
|
+
'&.Mui-focusVisible:hover': { backgroundColor: 'var(--fill--tertiary--hover)' },
|
|
956
|
+
'&[aria-selected="true"]': { backgroundColor: 'var(--fill--tertiary--active)' },
|
|
957
|
+
'&[aria-selected="true"].Mui-focused': { backgroundColor: 'var(--fill--tertiary--active)' },
|
|
958
|
+
'&[aria-selected="true"].Mui-focusVisible': { backgroundColor: 'var(--fill--tertiary--active)' },
|
|
959
|
+
},
|
|
960
|
+
},
|
|
961
|
+
option: ({ theme }) => ({
|
|
962
|
+
gap: 'var(--neo-space-md-rem)', minHeight: 'var(--neo-menu-item-min-height)', paddingBlock: 'var(--neo-space-sm-rem)', paddingInline: 'var(--neo-space-lg-rem)',
|
|
963
|
+
...theme.typography.bodyLgRegular, color: 'var(--text--base--default)',
|
|
964
|
+
'& .NeoMenu-label': { minWidth: 0, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' },
|
|
965
|
+
'&.Mui-focusVisible': focusRingInset,
|
|
966
|
+
'&.Mui-disabled': { backgroundColor: 'var(--fill--base--disabled)', color: 'var(--text--base--disabled)', opacity: 1 },
|
|
967
|
+
'& .MuiSvgIcon-root': { width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)' },
|
|
968
|
+
}),
|
|
969
|
+
clearIndicator: {
|
|
970
|
+
color: 'var(--icon--base--secondary)', padding: 'var(--neo-space-xs-rem)', margin: 0,
|
|
971
|
+
'& svg': { width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)' },
|
|
972
|
+
'.Mui-disabled &': { color: 'var(--icon--base--disabled)' },
|
|
973
|
+
},
|
|
974
|
+
popupIndicator: {
|
|
975
|
+
color: 'var(--icon--base--secondary)', padding: 0, margin: 0,
|
|
976
|
+
'& svg': { width: 'var(--neo-icon-size-md-rem)', height: 'var(--neo-icon-size-md-rem)' },
|
|
977
|
+
'.Mui-disabled &': { color: 'var(--icon--base--disabled)' },
|
|
978
|
+
'@media (prefers-reduced-motion: reduce)': { transition: 'none' },
|
|
979
|
+
},
|
|
980
|
+
},
|
|
981
|
+
},
|
|
982
|
+
};
|