@superdispatch/ui 0.15.0 → 0.16.0-alpha.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/dist-node/index.js +4032 -490
- package/dist-node/index.js.map +1 -1
- package/dist-src/index.js +3 -1
- package/dist-src/v5/adaptive-toolbar/AdaptiveToolbar.js +146 -0
- package/dist-src/v5/app-bar/AppBarOverrides.js +9 -0
- package/dist-src/v5/autocomplete/AutocompleteOverrides.js +63 -0
- package/dist-src/v5/avatar/AvatarOverrides.js +21 -0
- package/dist-src/v5/avatar-button/AvatarButton.js +146 -0
- package/dist-src/v5/button/Button.js +32 -0
- package/dist-src/v5/button/ButtonOverrides.js +238 -0
- package/dist-src/v5/card/CardOverrides.js +16 -0
- package/dist-src/v5/card-button/CardButton.js +135 -0
- package/dist-src/v5/checkbox/CheckboxField.js +37 -0
- package/dist-src/v5/checkbox/CheckboxGroudField.js +32 -0
- package/dist-src/v5/checkbox/CheckboxOverrides.js +71 -0
- package/dist-src/v5/chip/ChipOverrides.js +106 -0
- package/dist-src/v5/columns/Column.js +75 -0
- package/dist-src/v5/columns/Columns.js +28 -0
- package/dist-src/v5/description-list/DescriptionList.js +114 -0
- package/dist-src/v5/dialog/DialogOverrides.js +43 -0
- package/dist-src/v5/drawer/DrawerActions.js +69 -0
- package/dist-src/v5/drawer/DrawerContent.js +15 -0
- package/dist-src/v5/drawer/DrawerList.js +31 -0
- package/dist-src/v5/drawer/DrawerOverrides.js +17 -0
- package/dist-src/v5/drawer/DrawerTitle.js +119 -0
- package/dist-src/v5/grid/GridStack.js +33 -0
- package/dist-src/v5/grid/InlineGrid.js +34 -0
- package/dist-src/v5/icon-button/IconButtonOverrides.js +60 -0
- package/dist-src/v5/index.js +38 -0
- package/dist-src/v5/info-card/InfoCard.js +59 -0
- package/dist-src/v5/inline/Inline.js +56 -0
- package/dist-src/v5/link/LinkOverrides.js +46 -0
- package/dist-src/v5/list/ListOverrides.js +16 -0
- package/dist-src/v5/menu/MenuOverrides.js +34 -0
- package/dist-src/v5/overflow-text/OverflowText.js +84 -0
- package/dist-src/v5/pagination/PaginationOverrides.js +35 -0
- package/dist-src/v5/paper/PaperOverrides.js +13 -0
- package/dist-src/v5/props/AlignProps.js +15 -0
- package/dist-src/v5/props/CollapseProp.js +3 -0
- package/dist-src/v5/props/ResponsiveProp.js +42 -0
- package/dist-src/v5/props/SpaceProp.js +28 -0
- package/dist-src/v5/radio/RadioField.js +36 -0
- package/dist-src/v5/radio/RadioGroupField.js +38 -0
- package/dist-src/v5/radio/RadioOverrides.js +49 -0
- package/dist-src/v5/responsive/CollapseBreakpoint.js +15 -0
- package/dist-src/v5/responsive/ResponsiveContext.js +31 -0
- package/dist-src/v5/snackbar/Snackbar.js +53 -0
- package/dist-src/v5/snackbar/SnackbarContent.js +105 -0
- package/dist-src/v5/snackbar/SnackbarOverrides.js +35 -0
- package/dist-src/v5/snackbar/SnackbarStack.js +113 -0
- package/dist-src/v5/stack/Stack.js +43 -0
- package/dist-src/v5/svg-icon/SvgIconOverrides.js +33 -0
- package/dist-src/v5/switch/SwitchOverrides.js +88 -0
- package/dist-src/v5/tabs/TabsOverrides.js +45 -0
- package/dist-src/v5/tag/Tag.js +118 -0
- package/dist-src/v5/text-field/TextFieldOverrides.js +205 -0
- package/dist-src/v5/theme/Color.js +77 -0
- package/dist-src/v5/theme/CssBaselineOverrides.js +8 -0
- package/dist-src/v5/theme/SuperDispatchTheme.js +2 -0
- package/dist-src/v5/theme/ThemeProvider.js +142 -0
- package/dist-src/v5/tiles/Tiles.js +94 -0
- package/dist-src/v5/toolbar/ToolbarOverrides.js +15 -0
- package/dist-src/v5/tooltip/TooltipOverrides.js +42 -0
- package/dist-src/v5/typography/TypographyOverrides.js +121 -0
- package/dist-src/v5/utils/VisibilityObserver.js +53 -0
- package/dist-src/v5/utils/isEmptyReactNode.js +3 -0
- package/dist-src/v5/utils/mergeRefs.js +20 -0
- package/dist-src/v5/utils/renderChildren.js +8 -0
- package/dist-src/v5/utils/useUID.js +6 -0
- package/dist-types/index.d.ts +642 -37
- package/dist-web/index.js +4195 -654
- package/dist-web/index.js.map +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export var Color;
|
|
2
|
+
|
|
3
|
+
(function (Color) {
|
|
4
|
+
Color["White"] = "#fff";
|
|
5
|
+
Color["White50"] = "rgba(255, 255, 255, 0.5)";
|
|
6
|
+
Color["White40"] = "rgba(255, 255, 255, 0.4)";
|
|
7
|
+
Color["White20"] = "rgba(255, 255, 255, 0.2)";
|
|
8
|
+
Color["White10"] = "rgba(255, 255, 255, 0.1)";
|
|
9
|
+
Color["White08"] = "rgba(255, 255, 255, 0.08)";
|
|
10
|
+
Color["Transparent"] = "rgba(0, 0, 0, 0)";
|
|
11
|
+
Color["Black"] = "#000";
|
|
12
|
+
Color["Black50"] = "rgba(0, 0, 0, 0.5)";
|
|
13
|
+
Color["Black20"] = "rgba(0, 0, 0, 0.2)";
|
|
14
|
+
Color["Grey100"] = "#8F949E";
|
|
15
|
+
Color["Grey200"] = "#6A707C";
|
|
16
|
+
Color["Grey300"] = "#5B6371";
|
|
17
|
+
Color["Grey400"] = "#323C4E";
|
|
18
|
+
Color["Grey450"] = "#222F44";
|
|
19
|
+
Color["Grey500"] = "#192334";
|
|
20
|
+
Color["Dark100"] = "#8F949E";
|
|
21
|
+
Color["Dark200"] = "#6A707C";
|
|
22
|
+
Color["Dark300"] = "#5B6371";
|
|
23
|
+
Color["Dark400"] = "#323C4E";
|
|
24
|
+
Color["Dark450"] = "#222F44";
|
|
25
|
+
Color["Dark500"] = "#192334";
|
|
26
|
+
Color["Silver100"] = "#F6F7F8";
|
|
27
|
+
Color["Silver200"] = "#F3F5F8";
|
|
28
|
+
Color["Silver300"] = "#E8ECF0";
|
|
29
|
+
Color["Silver400"] = "#E1E5EA";
|
|
30
|
+
Color["Silver500"] = "#C4CDD5";
|
|
31
|
+
Color["Blue50"] = "#EBF4FF";
|
|
32
|
+
Color["Blue75"] = "#CCE5FF";
|
|
33
|
+
Color["Blue100"] = "#A8D1FF";
|
|
34
|
+
Color["Blue200"] = "#66ADFF";
|
|
35
|
+
Color["Blue300"] = "#0075FF";
|
|
36
|
+
Color["Blue400"] = "#0063DB";
|
|
37
|
+
Color["Blue500"] = "#0050B2";
|
|
38
|
+
Color["Green50"] = "#ECF9EF";
|
|
39
|
+
Color["Green75"] = "#C8F4D1";
|
|
40
|
+
Color["Green100"] = "#90EAAE";
|
|
41
|
+
Color["Green200"] = "#5DDA87";
|
|
42
|
+
Color["Green300"] = "#1FA84D";
|
|
43
|
+
Color["Green400"] = "#1E8F46";
|
|
44
|
+
Color["Green500"] = "#19803D";
|
|
45
|
+
Color["Purple50"] = "#EFEEFC";
|
|
46
|
+
Color["Purple75"] = "#DCDBF5";
|
|
47
|
+
Color["Purple100"] = "#CBC8EE";
|
|
48
|
+
Color["Purple200"] = "#A7A1E8";
|
|
49
|
+
Color["Purple300"] = "#6559CF";
|
|
50
|
+
Color["Purple400"] = "#473ABB";
|
|
51
|
+
Color["Purple500"] = "#3A2F9D";
|
|
52
|
+
Color["Red50"] = "#FFEDEB";
|
|
53
|
+
Color["Red75"] = "#FDD9D3";
|
|
54
|
+
Color["Red100"] = "#FDC2BA";
|
|
55
|
+
Color["Red200"] = "#FE988B";
|
|
56
|
+
Color["Red300"] = "#EE3017";
|
|
57
|
+
Color["Red400"] = "#D9210D";
|
|
58
|
+
Color["Red500"] = "#C31909";
|
|
59
|
+
Color["Teal50"] = "#E3F6FC";
|
|
60
|
+
Color["Teal75"] = "#BEEDF9";
|
|
61
|
+
Color["Teal100"] = "#91E3F8";
|
|
62
|
+
Color["Teal200"] = "#61D3EF";
|
|
63
|
+
Color["Teal300"] = "#00A0CC";
|
|
64
|
+
Color["Teal400"] = "#008DB8";
|
|
65
|
+
Color["Teal500"] = "#007DA3";
|
|
66
|
+
Color["Yellow50"] = "#FFF9E5";
|
|
67
|
+
Color["Yellow75"] = "#FFF1C2";
|
|
68
|
+
Color["Yellow100"] = "#FFE494";
|
|
69
|
+
Color["Yellow200"] = "#FFDC6B";
|
|
70
|
+
Color["Yellow300"] = "#FFCB47";
|
|
71
|
+
Color["Yellow400"] = "#FFA91F";
|
|
72
|
+
Color["Yellow500"] = "#DB7500";
|
|
73
|
+
})(Color || (Color = {}));
|
|
74
|
+
|
|
75
|
+
export function isColorProp(name) {
|
|
76
|
+
return typeof name == 'string' && Object.prototype.hasOwnProperty.call(Color, name);
|
|
77
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { createTheme, CssBaseline, ThemeProvider as MaterialThemeProvider } from '@mui/material';
|
|
2
|
+
import { createGenerateClassName, StylesProvider } from '@mui/styles';
|
|
3
|
+
import { createBreakpoints } from '@mui/system';
|
|
4
|
+
import { useConstant } from '@superdispatch/hooks';
|
|
5
|
+
import { overrideAppBar } from "../app-bar/AppBarOverrides.js";
|
|
6
|
+
import { overrideAutocomplete } from "../autocomplete/AutocompleteOverrides.js";
|
|
7
|
+
import { overrideAvatar } from "../avatar/AvatarOverrides.js";
|
|
8
|
+
import { overrideButton } from "../button/ButtonOverrides.js";
|
|
9
|
+
import { overrideCard } from "../card/CardOverrides.js";
|
|
10
|
+
import { overrideCheckbox } from "../checkbox/CheckboxOverrides.js";
|
|
11
|
+
import { overrideChip } from "../chip/ChipOverrides.js";
|
|
12
|
+
import { overrideDialog } from "../dialog/DialogOverrides.js";
|
|
13
|
+
import { overrideDrawer } from "../drawer/DrawerOverrides.js";
|
|
14
|
+
import { overrideIconButton } from "../icon-button/IconButtonOverrides.js";
|
|
15
|
+
import { overrideLink } from "../link/LinkOverrides.js";
|
|
16
|
+
import { overrideList } from "../list/ListOverrides.js";
|
|
17
|
+
import { overrideMenu } from "../menu/MenuOverrides.js";
|
|
18
|
+
import { overridePagination } from "../pagination/PaginationOverrides.js";
|
|
19
|
+
import { overridePaper } from "../paper/PaperOverrides.js";
|
|
20
|
+
import { overrideRadio } from "../radio/RadioOverrides.js";
|
|
21
|
+
import { ResponsiveContextProvider } from "../responsive/ResponsiveContext.js";
|
|
22
|
+
import { overrideSnackbar } from "../snackbar/SnackbarOverrides.js";
|
|
23
|
+
import { SnackbarStackProvider } from "../snackbar/SnackbarStack.js";
|
|
24
|
+
import { overrideSvgIcon } from "../svg-icon/SvgIconOverrides.js";
|
|
25
|
+
import { overrideSwitch } from "../switch/SwitchOverrides.js";
|
|
26
|
+
import { overrideTabs } from "../tabs/TabsOverrides.js";
|
|
27
|
+
import { overrideTextField } from "../text-field/TextFieldOverrides.js";
|
|
28
|
+
import { overrideToolbar } from "../toolbar/ToolbarOverrides.js";
|
|
29
|
+
import { overrideTooltip } from "../tooltip/TooltipOverrides.js";
|
|
30
|
+
import { createTypographyOptions, overrideTypography } from "../typography/TypographyOverrides.js";
|
|
31
|
+
import { Color } from "./Color.js";
|
|
32
|
+
import { overrideCssBaseline } from "./CssBaselineOverrides.js";
|
|
33
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
|
+
|
|
36
|
+
function createSuperDispatchTheme() {
|
|
37
|
+
var breakpoints = createBreakpoints({});
|
|
38
|
+
var theme = createTheme({
|
|
39
|
+
breakpoints,
|
|
40
|
+
palette: {
|
|
41
|
+
primary: {
|
|
42
|
+
main: Color.Blue300
|
|
43
|
+
},
|
|
44
|
+
error: {
|
|
45
|
+
main: Color.Red300
|
|
46
|
+
},
|
|
47
|
+
action: {
|
|
48
|
+
hover: Color.Silver100,
|
|
49
|
+
selected: Color.Silver300,
|
|
50
|
+
disabled: Color.Silver400
|
|
51
|
+
},
|
|
52
|
+
text: {
|
|
53
|
+
primary: Color.Dark500,
|
|
54
|
+
secondary: Color.Dark200,
|
|
55
|
+
// hint: Color.Dark100, todo
|
|
56
|
+
disabled: Color.Dark100
|
|
57
|
+
},
|
|
58
|
+
divider: Color.Silver400
|
|
59
|
+
},
|
|
60
|
+
typography: createTypographyOptions(breakpoints),
|
|
61
|
+
components: {}
|
|
62
|
+
});
|
|
63
|
+
overrideCard(theme);
|
|
64
|
+
overrideButton(theme);
|
|
65
|
+
overrideAppBar(theme);
|
|
66
|
+
overridePaper(theme);
|
|
67
|
+
overrideTooltip(theme);
|
|
68
|
+
overrideSvgIcon(theme);
|
|
69
|
+
overrideToolbar(theme);
|
|
70
|
+
overrideIconButton(theme);
|
|
71
|
+
overrideTypography(theme);
|
|
72
|
+
overrideMenu(theme);
|
|
73
|
+
overrideAvatar(theme);
|
|
74
|
+
overrideTextField(theme);
|
|
75
|
+
overrideAutocomplete(theme);
|
|
76
|
+
overrideCssBaseline(theme);
|
|
77
|
+
overrideCheckbox(theme);
|
|
78
|
+
overrideRadio(theme);
|
|
79
|
+
overrideSwitch(theme);
|
|
80
|
+
overrideChip(theme);
|
|
81
|
+
overrideDialog(theme);
|
|
82
|
+
overrideDrawer(theme);
|
|
83
|
+
overridePagination(theme);
|
|
84
|
+
overrideList(theme);
|
|
85
|
+
overrideLink(theme);
|
|
86
|
+
overrideSnackbar(theme);
|
|
87
|
+
overrideTabs(theme);
|
|
88
|
+
return theme;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var generateMaterialClassName = /*#__PURE__*/createGenerateClassName();
|
|
92
|
+
|
|
93
|
+
function generateClassName(rule, sheet) {
|
|
94
|
+
var {
|
|
95
|
+
meta,
|
|
96
|
+
link
|
|
97
|
+
} = (sheet === null || sheet === void 0 ? void 0 : sheet.options) || {};
|
|
98
|
+
|
|
99
|
+
if (meta && rule.type === 'style') {
|
|
100
|
+
if (meta.startsWith('SD-')) {
|
|
101
|
+
return "".concat(meta, "-").concat(rule.key);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (meta.startsWith('Mui')) {
|
|
105
|
+
var isPseudoClass = ['checked', 'disabled', 'error', 'focused', 'focusVisible', 'required', 'expanded', 'selected'].includes(rule.key);
|
|
106
|
+
|
|
107
|
+
if (isPseudoClass) {
|
|
108
|
+
return "Mui-".concat(rule.key);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (!link) {
|
|
112
|
+
return "".concat(meta, "-").concat(rule.key);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return generateMaterialClassName(rule, sheet);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function ThemeProvider(_ref) {
|
|
121
|
+
var {
|
|
122
|
+
modifier,
|
|
123
|
+
children,
|
|
124
|
+
injectFirst = true
|
|
125
|
+
} = _ref;
|
|
126
|
+
var theme = useConstant(() => {
|
|
127
|
+
var nextTheme = createSuperDispatchTheme();
|
|
128
|
+
return !modifier ? nextTheme : modifier(nextTheme);
|
|
129
|
+
});
|
|
130
|
+
return /*#__PURE__*/_jsx(StylesProvider, {
|
|
131
|
+
injectFirst: injectFirst,
|
|
132
|
+
generateClassName: generateClassName,
|
|
133
|
+
children: /*#__PURE__*/_jsxs(MaterialThemeProvider, {
|
|
134
|
+
theme: theme,
|
|
135
|
+
children: [/*#__PURE__*/_jsx(CssBaseline, {}), /*#__PURE__*/_jsx(ResponsiveContextProvider, {
|
|
136
|
+
children: /*#__PURE__*/_jsx(SnackbarStackProvider, {
|
|
137
|
+
children: children
|
|
138
|
+
})
|
|
139
|
+
})]
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { makeStyles } from '@mui/styles';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import flattenChildren from 'react-keyed-flatten-children';
|
|
5
|
+
import { useResponsivePropRecord } from "../props/ResponsiveProp.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
var PREVENT_COLLAPSE = 1;
|
|
8
|
+
|
|
9
|
+
function spaceVariant(theme, space) {
|
|
10
|
+
var gap = theme.spacing(space);
|
|
11
|
+
var parsedGap = parseInt(gap);
|
|
12
|
+
return {
|
|
13
|
+
'&:before': {
|
|
14
|
+
marginTop: -parsedGap - PREVENT_COLLAPSE
|
|
15
|
+
},
|
|
16
|
+
'& > $container': {
|
|
17
|
+
marginLeft: -parsedGap,
|
|
18
|
+
'& > $child > $childContainer': {
|
|
19
|
+
marginTop: gap,
|
|
20
|
+
marginLeft: gap
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function columnVariant(columns) {
|
|
27
|
+
return {
|
|
28
|
+
flex: "0 0 ".concat(100 / columns, "%")
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var useStyles = /*#__PURE__*/makeStyles(theme => ({
|
|
33
|
+
root: {
|
|
34
|
+
paddingTop: PREVENT_COLLAPSE,
|
|
35
|
+
'&:before': {
|
|
36
|
+
content: '""',
|
|
37
|
+
display: 'block',
|
|
38
|
+
marginTop: -PREVENT_COLLAPSE
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
container: {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexWrap: 'wrap'
|
|
44
|
+
},
|
|
45
|
+
child: {
|
|
46
|
+
minWidth: 0
|
|
47
|
+
},
|
|
48
|
+
childContainer: {
|
|
49
|
+
height: '100%'
|
|
50
|
+
},
|
|
51
|
+
space1: spaceVariant(theme, 1),
|
|
52
|
+
space2: spaceVariant(theme, 2),
|
|
53
|
+
space3: spaceVariant(theme, 3),
|
|
54
|
+
space4: spaceVariant(theme, 4),
|
|
55
|
+
space5: spaceVariant(theme, 5),
|
|
56
|
+
space6: spaceVariant(theme, 6),
|
|
57
|
+
space7: spaceVariant(theme, 7),
|
|
58
|
+
space8: spaceVariant(theme, 8),
|
|
59
|
+
space9: spaceVariant(theme, 9),
|
|
60
|
+
space10: spaceVariant(theme, 10),
|
|
61
|
+
columns1: columnVariant(1),
|
|
62
|
+
columns2: columnVariant(2),
|
|
63
|
+
columns3: columnVariant(3),
|
|
64
|
+
columns4: columnVariant(4),
|
|
65
|
+
columns5: columnVariant(5),
|
|
66
|
+
columns6: columnVariant(6)
|
|
67
|
+
}), {
|
|
68
|
+
name: 'SD-Tiles'
|
|
69
|
+
});
|
|
70
|
+
export var Tiles = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
71
|
+
var {
|
|
72
|
+
children,
|
|
73
|
+
space: spaceProp = 1,
|
|
74
|
+
columns: columnsProp = 1
|
|
75
|
+
} = _ref;
|
|
76
|
+
var styles = useStyles({});
|
|
77
|
+
var space = useResponsivePropRecord(spaceProp);
|
|
78
|
+
var columns = useResponsivePropRecord(columnsProp);
|
|
79
|
+
return /*#__PURE__*/_jsx("div", {
|
|
80
|
+
ref: ref,
|
|
81
|
+
className: clsx(styles.root, space === 1 && styles.space1, space === 2 && styles.space2, space === 3 && styles.space3, space === 4 && styles.space4, space === 5 && styles.space5, space === 6 && styles.space6, space === 7 && styles.space7, space === 8 && styles.space8, space === 9 && styles.space9, space === 10 && styles.space10),
|
|
82
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
83
|
+
className: styles.container,
|
|
84
|
+
children: flattenChildren(children).map((child, idx) => /*#__PURE__*/_jsx("div", {
|
|
85
|
+
className: clsx(styles.child, columns === 1 && styles.columns1, columns === 2 && styles.columns2, columns === 3 && styles.columns3, columns === 4 && styles.columns4, columns === 5 && styles.columns5, columns === 6 && styles.columns6),
|
|
86
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
87
|
+
className: styles.childContainer,
|
|
88
|
+
children: child
|
|
89
|
+
})
|
|
90
|
+
}, idx))
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
if (process.env.NODE_ENV !== "production") Tiles.displayName = "Tiles";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function overrideToolbar(theme) {
|
|
2
|
+
theme.components.MuiToolbar = {
|
|
3
|
+
styleOverrides: {
|
|
4
|
+
regular: {
|
|
5
|
+
minHeight: theme.spacing(8)
|
|
6
|
+
},
|
|
7
|
+
gutters: {
|
|
8
|
+
[theme.breakpoints.up('sm')]: {
|
|
9
|
+
paddingLeft: theme.spacing(2),
|
|
10
|
+
paddingRight: theme.spacing(2)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import { tooltipClasses } from '@mui/material';
|
|
3
|
+
import { Color } from "../theme/Color.js";
|
|
4
|
+
export function overrideTooltip(theme) {
|
|
5
|
+
theme.components.MuiTooltip = {
|
|
6
|
+
defaultProps: {
|
|
7
|
+
arrow: true
|
|
8
|
+
},
|
|
9
|
+
styleOverrides: {
|
|
10
|
+
tooltip: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
|
|
11
|
+
padding: theme.spacing(1, 1.5),
|
|
12
|
+
backgroundColor: Color.Dark400
|
|
13
|
+
}),
|
|
14
|
+
popperArrow: {
|
|
15
|
+
["&[data-popper-placement*=\"top\"] .".concat(tooltipClasses.arrow)]: {
|
|
16
|
+
'&::before': {
|
|
17
|
+
borderBottomRightRadius: 2
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
["&[data-popper-placement*=\"left\"] .".concat(tooltipClasses.arrow)]: {
|
|
21
|
+
'&::before': {
|
|
22
|
+
borderTopRightRadius: 2
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
["&[data-popper-placement*=\"right\"] .".concat(tooltipClasses.arrow)]: {
|
|
26
|
+
'&::before': {
|
|
27
|
+
borderBottomLeftRadius: 2
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
["&[data-popper-placement*=\"bottom\"] .".concat(tooltipClasses.arrow)]: {
|
|
31
|
+
'&::before': {
|
|
32
|
+
borderTopLeftRadius: 2
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
arrow: {
|
|
37
|
+
color: Color.Dark400,
|
|
38
|
+
fontSize: theme.spacing(1)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import '@mui/material';
|
|
2
|
+
|
|
3
|
+
function createCSSVarName(component, property) {
|
|
4
|
+
return "--mui-".concat(component, "-").concat(property);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export var typographyVars = {
|
|
8
|
+
color: /*#__PURE__*/createCSSVarName('typography', 'color'),
|
|
9
|
+
backgroundImage: /*#__PURE__*/createCSSVarName('typography', 'backgroundImage')
|
|
10
|
+
};
|
|
11
|
+
export function createTypographyOptions(breakpoints) {
|
|
12
|
+
var xsOnly = breakpoints.only('xs');
|
|
13
|
+
return {
|
|
14
|
+
fontSize: 14,
|
|
15
|
+
fontWeightLight: 300,
|
|
16
|
+
fontWeightRegular: 400,
|
|
17
|
+
fontWeightMedium: 500,
|
|
18
|
+
fontWeightBold: 600,
|
|
19
|
+
fontFamily: '"Inter", sans-serif',
|
|
20
|
+
h1: {
|
|
21
|
+
fontSize: '32px',
|
|
22
|
+
lineHeight: '40px',
|
|
23
|
+
fontWeight: 700,
|
|
24
|
+
[xsOnly]: {
|
|
25
|
+
fontSize: '28px',
|
|
26
|
+
lineHeight: '36px'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
h2: {
|
|
30
|
+
fontSize: '24px',
|
|
31
|
+
lineHeight: '28px',
|
|
32
|
+
fontWeight: 500,
|
|
33
|
+
[xsOnly]: {
|
|
34
|
+
fontSize: '22px',
|
|
35
|
+
lineHeight: '26px'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
h3: {
|
|
39
|
+
fontSize: '20px',
|
|
40
|
+
lineHeight: '28px',
|
|
41
|
+
fontWeight: 500,
|
|
42
|
+
[xsOnly]: {
|
|
43
|
+
fontSize: '20px',
|
|
44
|
+
lineHeight: '26px'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
h4: {
|
|
48
|
+
fontSize: '16px',
|
|
49
|
+
lineHeight: '24px',
|
|
50
|
+
fontWeight: 500,
|
|
51
|
+
[xsOnly]: {
|
|
52
|
+
fontSize: '17px',
|
|
53
|
+
lineHeight: '26px'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
h5: {
|
|
57
|
+
fontSize: '14px',
|
|
58
|
+
lineHeight: '20px',
|
|
59
|
+
fontWeight: 600,
|
|
60
|
+
[xsOnly]: {
|
|
61
|
+
fontSize: '16px',
|
|
62
|
+
lineHeight: '24px'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
h6: {
|
|
66
|
+
fontSize: '12px',
|
|
67
|
+
lineHeight: '16px',
|
|
68
|
+
fontWeight: 700,
|
|
69
|
+
letterSpacing: '0.1em',
|
|
70
|
+
textTransform: 'uppercase',
|
|
71
|
+
[xsOnly]: {
|
|
72
|
+
fontSize: '14px',
|
|
73
|
+
lineHeight: '20px'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
body1: {
|
|
77
|
+
fontSize: '14px',
|
|
78
|
+
lineHeight: '20px',
|
|
79
|
+
fontWeight: 600,
|
|
80
|
+
[xsOnly]: {
|
|
81
|
+
fontSize: '16px',
|
|
82
|
+
lineHeight: '24px'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
body2: {
|
|
86
|
+
fontSize: '14px',
|
|
87
|
+
lineHeight: '20px',
|
|
88
|
+
fontWeight: 400,
|
|
89
|
+
[xsOnly]: {
|
|
90
|
+
fontSize: '16px',
|
|
91
|
+
lineHeight: '24px'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
caption: {
|
|
95
|
+
fontSize: '12px',
|
|
96
|
+
lineHeight: '16px',
|
|
97
|
+
fontWeight: 400,
|
|
98
|
+
[xsOnly]: {
|
|
99
|
+
fontSize: '14px',
|
|
100
|
+
lineHeight: '20px'
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
button: {
|
|
104
|
+
fontSize: '14px',
|
|
105
|
+
lineHeight: '20px',
|
|
106
|
+
fontWeight: 600,
|
|
107
|
+
textTransform: undefined,
|
|
108
|
+
[xsOnly]: {
|
|
109
|
+
fontSize: '16px',
|
|
110
|
+
lineHeight: '24px'
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export function overrideTypography(theme) {
|
|
116
|
+
theme.components.MuiTypography = {
|
|
117
|
+
defaultProps: {
|
|
118
|
+
variant: 'body2'
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["render", "onChange"];
|
|
3
|
+
import { useValueObserver } from '@superdispatch/hooks';
|
|
4
|
+
import { useLayoutEffect, useState } from 'react';
|
|
5
|
+
import { renderChildren } from "./renderChildren.js";
|
|
6
|
+
export function useVisibilityObserver(node) {
|
|
7
|
+
var {
|
|
8
|
+
threshold = 0,
|
|
9
|
+
marginTop = '0px',
|
|
10
|
+
marginLeft = '0px',
|
|
11
|
+
marginRight = '0px',
|
|
12
|
+
marginBottom = '0px'
|
|
13
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14
|
+
var [state, setState] = useState('undetermined');
|
|
15
|
+
var rootMargin = "".concat(marginTop, " ").concat(marginRight, " ").concat(marginBottom, " ").concat(marginLeft);
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
if (!node || !('IntersectionObserver' in window)) {
|
|
18
|
+
setState('undetermined');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var observer = new IntersectionObserver(_ref => {
|
|
23
|
+
var [entry] = _ref;
|
|
24
|
+
setState(entry !== null && entry !== void 0 && entry.isIntersecting ? 'visible' : 'invisible');
|
|
25
|
+
}, {
|
|
26
|
+
rootMargin,
|
|
27
|
+
threshold
|
|
28
|
+
});
|
|
29
|
+
observer.observe(node);
|
|
30
|
+
return () => {
|
|
31
|
+
observer.disconnect();
|
|
32
|
+
};
|
|
33
|
+
}, [node, threshold, rootMargin]);
|
|
34
|
+
return state;
|
|
35
|
+
}
|
|
36
|
+
export function VisibilityObserver(_ref2) {
|
|
37
|
+
var {
|
|
38
|
+
render,
|
|
39
|
+
onChange
|
|
40
|
+
} = _ref2,
|
|
41
|
+
options = _objectWithoutProperties(_ref2, _excluded);
|
|
42
|
+
|
|
43
|
+
var [node, setNode] = useState(null);
|
|
44
|
+
var visibility = useVisibilityObserver(node, options);
|
|
45
|
+
var children = render({
|
|
46
|
+
ref: setNode,
|
|
47
|
+
visibility
|
|
48
|
+
});
|
|
49
|
+
useValueObserver(visibility, () => {
|
|
50
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(visibility);
|
|
51
|
+
});
|
|
52
|
+
return renderChildren(children);
|
|
53
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function mergeRefs() {
|
|
2
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3
|
+
refs[_key] = arguments[_key];
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
return node => {
|
|
7
|
+
refs.forEach(ref => {
|
|
8
|
+
assignRef(ref, node);
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function assignRef(ref, value) {
|
|
13
|
+
if (ref) {
|
|
14
|
+
if (typeof ref === 'function') {
|
|
15
|
+
ref(value);
|
|
16
|
+
} else {
|
|
17
|
+
ref.current = value;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|