@vertigis/react-ui 16.5.0 → 16.6.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.
- package/Switch/Switch.d.ts +1 -1
- package/SymbolInput/SymbolJson.js +0 -1
- package/TimePicker/TimePicker.js +1 -1
- package/colors/Color.js +0 -1
- package/package.json +1 -1
- package/styles/createTheme.js +30 -18
package/Switch/Switch.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export type SwitchClassKey = keyof SwitchClasses;
|
|
|
8
8
|
export type SwitchProps = Omit<MUISwitchProps, "classes"> & {
|
|
9
9
|
classes?: Partial<SwitchClasses>;
|
|
10
10
|
};
|
|
11
|
-
declare const Switch: import("@emotion/styled").StyledComponent<MUISwitchProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material
|
|
11
|
+
declare const Switch: import("@emotion/styled").StyledComponent<MUISwitchProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
12
12
|
export default Switch;
|
package/TimePicker/TimePicker.js
CHANGED
|
@@ -12,7 +12,7 @@ const TimePicker = ({ slots, viewRenderers, ...props }, ref) => (_jsx(MuiTimePic
|
|
|
12
12
|
"& .MuiIconButton-sizeMedium": {
|
|
13
13
|
// Match the adornment alignment of other date pickers.
|
|
14
14
|
marginRight: -0.375,
|
|
15
|
-
padding:
|
|
15
|
+
padding: -0.375,
|
|
16
16
|
},
|
|
17
17
|
}, ...props }));
|
|
18
18
|
export default forwardRef(TimePicker);
|
package/colors/Color.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/package.json
CHANGED
package/styles/createTheme.js
CHANGED
|
@@ -86,11 +86,14 @@ const getDefaultOptions = (theme) => {
|
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
const defaultDenseOptions = {
|
|
89
|
-
spacing:
|
|
89
|
+
spacing: 5,
|
|
90
90
|
components: {
|
|
91
91
|
MuiButton: {
|
|
92
92
|
defaultProps: { size: "small" },
|
|
93
93
|
},
|
|
94
|
+
MuiCheckbox: {
|
|
95
|
+
defaultProps: { size: "small" },
|
|
96
|
+
},
|
|
94
97
|
MuiFilledInput: {
|
|
95
98
|
defaultProps: { margin: "dense" },
|
|
96
99
|
},
|
|
@@ -124,6 +127,12 @@ const defaultDenseOptions = {
|
|
|
124
127
|
MuiFab: {
|
|
125
128
|
defaultProps: { size: "small" },
|
|
126
129
|
},
|
|
130
|
+
MuiSwitch: {
|
|
131
|
+
defaultProps: { size: "small" },
|
|
132
|
+
},
|
|
133
|
+
MuiSvgIcon: {
|
|
134
|
+
defaultProps: { fontSize: "small" },
|
|
135
|
+
},
|
|
127
136
|
MuiTable: {
|
|
128
137
|
defaultProps: { size: "small" },
|
|
129
138
|
},
|
|
@@ -184,14 +193,14 @@ const getMenuItemStyles = ({ palette, transitions }) => ({
|
|
|
184
193
|
backgroundColor: "transparent",
|
|
185
194
|
},
|
|
186
195
|
"&:hover, &.Mui-selected": {
|
|
187
|
-
background: `linear-gradient(to right, ${palette.
|
|
196
|
+
background: `linear-gradient(to right, ${palette.custom.greyBackground} 0%, transparent 100%)`,
|
|
188
197
|
},
|
|
189
198
|
});
|
|
190
199
|
/**
|
|
191
200
|
* The overrides may be based on the theme's palette. We must create these
|
|
192
201
|
* separately after the fact.
|
|
193
202
|
*/
|
|
194
|
-
function getComponentOverrides(theme) {
|
|
203
|
+
function getComponentOverrides(theme, isDense) {
|
|
195
204
|
const { palette, shape, spacing, transitions, typography: { pxToRem, fontWeightMedium, fontWeightBold, body1, subtitle2 }, } = theme;
|
|
196
205
|
return {
|
|
197
206
|
components: {
|
|
@@ -202,7 +211,7 @@ function getComponentOverrides(theme) {
|
|
|
202
211
|
".MuiInput-input": {
|
|
203
212
|
// Let the height expand to fit content
|
|
204
213
|
height: "auto",
|
|
205
|
-
padding:
|
|
214
|
+
padding: `${spacing(0.625)} ${spacing(1)}`,
|
|
206
215
|
},
|
|
207
216
|
},
|
|
208
217
|
},
|
|
@@ -273,7 +282,7 @@ function getComponentOverrides(theme) {
|
|
|
273
282
|
},
|
|
274
283
|
},
|
|
275
284
|
sizeMedium: {
|
|
276
|
-
padding:
|
|
285
|
+
padding: `${spacing(0.75)} ${spacing(2)}`,
|
|
277
286
|
},
|
|
278
287
|
text: {
|
|
279
288
|
borderColor: "transparent",
|
|
@@ -531,7 +540,7 @@ function getComponentOverrides(theme) {
|
|
|
531
540
|
},
|
|
532
541
|
},
|
|
533
542
|
sizeSmall: {
|
|
534
|
-
padding:
|
|
543
|
+
padding: spacing(0.375),
|
|
535
544
|
},
|
|
536
545
|
},
|
|
537
546
|
},
|
|
@@ -571,7 +580,7 @@ function getComponentOverrides(theme) {
|
|
|
571
580
|
},
|
|
572
581
|
},
|
|
573
582
|
inputMultiline: {
|
|
574
|
-
padding:
|
|
583
|
+
padding: `${spacing(0.625)} ${spacing(1)}`,
|
|
575
584
|
},
|
|
576
585
|
},
|
|
577
586
|
},
|
|
@@ -590,7 +599,7 @@ function getComponentOverrides(theme) {
|
|
|
590
599
|
input: {
|
|
591
600
|
// Let the height expand to fit content
|
|
592
601
|
height: "auto",
|
|
593
|
-
padding:
|
|
602
|
+
padding: `${spacing(0.625)} ${spacing(1)}`,
|
|
594
603
|
},
|
|
595
604
|
},
|
|
596
605
|
},
|
|
@@ -678,16 +687,16 @@ function getComponentOverrides(theme) {
|
|
|
678
687
|
// Reset to make height consistent with ListItems
|
|
679
688
|
minHeight: 48,
|
|
680
689
|
},
|
|
681
|
-
paddingTop:
|
|
682
|
-
paddingBottom:
|
|
690
|
+
paddingTop: spacing(1),
|
|
691
|
+
paddingBottom: spacing(1),
|
|
683
692
|
...getMenuItemStyles(theme),
|
|
684
693
|
},
|
|
685
694
|
dense: {
|
|
686
695
|
[theme.breakpoints.up("sm")]: {
|
|
687
696
|
minHeight: 36,
|
|
688
697
|
},
|
|
689
|
-
paddingTop:
|
|
690
|
-
paddingBottom:
|
|
698
|
+
paddingTop: spacing(0.5),
|
|
699
|
+
paddingBottom: spacing(0.5),
|
|
691
700
|
"& .MuiListItemIcon-root svg": {
|
|
692
701
|
// MUI sets this to 1.25rem, which ignores the
|
|
693
702
|
// theme's `htmlFontSize` setting. Override with
|
|
@@ -776,6 +785,7 @@ function getComponentOverrides(theme) {
|
|
|
776
785
|
width: 36,
|
|
777
786
|
height: 30,
|
|
778
787
|
padding: 6,
|
|
788
|
+
marginLeft: 4,
|
|
779
789
|
// 'on' state indicator
|
|
780
790
|
"&::before": {
|
|
781
791
|
left: 8,
|
|
@@ -826,9 +836,9 @@ function getComponentOverrides(theme) {
|
|
|
826
836
|
borderWidth: 1,
|
|
827
837
|
borderColor: palette.grey[400],
|
|
828
838
|
borderLeftWidth: 0,
|
|
829
|
-
height:
|
|
830
|
-
minHeight:
|
|
831
|
-
padding:
|
|
839
|
+
height: "unset",
|
|
840
|
+
minHeight: isDense ? 30 : 40,
|
|
841
|
+
padding: `${spacing(0.75)} ${spacing(1.5)}`,
|
|
832
842
|
textTransform: "none",
|
|
833
843
|
[theme.breakpoints.up("sm")]: {
|
|
834
844
|
minWidth: 72,
|
|
@@ -848,7 +858,7 @@ function getComponentOverrides(theme) {
|
|
|
848
858
|
styleOverrides: {
|
|
849
859
|
root: {
|
|
850
860
|
border: `1px solid ${palette.grey[400]}`,
|
|
851
|
-
padding:
|
|
861
|
+
padding: spacing(1.5),
|
|
852
862
|
overflowWrap: "anywhere",
|
|
853
863
|
"&:last-child": {
|
|
854
864
|
paddingRight: undefined,
|
|
@@ -881,6 +891,8 @@ function getComponentOverrides(theme) {
|
|
|
881
891
|
borderStyle: "solid",
|
|
882
892
|
borderWidth: 0,
|
|
883
893
|
borderBottomWidth: 1,
|
|
894
|
+
height: "unset",
|
|
895
|
+
minHeight: isDense ? 30 : 40,
|
|
884
896
|
"& >div >button": {
|
|
885
897
|
marginBottom: -1,
|
|
886
898
|
borderLeftWidth: 1,
|
|
@@ -942,7 +954,7 @@ function getComponentOverrides(theme) {
|
|
|
942
954
|
styleOverrides: {
|
|
943
955
|
root: {
|
|
944
956
|
// Same as MuiButton
|
|
945
|
-
padding:
|
|
957
|
+
padding: `${spacing(0.75)} ${spacing(2)}`,
|
|
946
958
|
height: undefined,
|
|
947
959
|
color: alpha(palette.text.primary, 0.7),
|
|
948
960
|
// Border color from Button contained
|
|
@@ -1047,7 +1059,7 @@ function createTheme(options = {}) {
|
|
|
1047
1059
|
const createdTheme = createMuiTheme(mergedOptions);
|
|
1048
1060
|
// The component overrides use the final palette and so must be applied
|
|
1049
1061
|
// last.
|
|
1050
|
-
return overrideTheme(createdTheme, getComponentOverrides(createdTheme));
|
|
1062
|
+
return overrideTheme(createdTheme, getComponentOverrides(createdTheme, dense));
|
|
1051
1063
|
}
|
|
1052
1064
|
export default createTheme;
|
|
1053
1065
|
/**
|