@blerp/design 1.3.16 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Blerp/BlerpImageRow.js +176 -57
- package/dist/cjs/Blerp/BlerpSavePopup.js +44 -40
- package/dist/cjs/Blerp/BlerpTitleRow.js +36 -19
- package/dist/cjs/Blerp/BlerpTopRow.js +110 -44
- package/dist/cjs/Blerp.js +9 -16
- package/dist/cjs/BlerpAudioContextProvider.js +2 -2
- package/dist/cjs/BlerpListView.js +318 -168
- package/dist/cjs/BlerpListViewPremium.js +155 -130
- package/dist/cjs/BlerpListViewSkeleton.js +60 -13
- package/dist/cjs/BlerpSkeleton.js +32 -9
- package/dist/cjs/CollectionCard.js +139 -60
- package/dist/cjs/CollectionListViewPremium.js +368 -297
- package/dist/cjs/CollectionSkeleton.js +74 -13
- package/dist/cjs/Dropdown.js +272 -172
- package/dist/cjs/EllipsisLoader.js +66 -21
- package/dist/cjs/GroupCard.js +64 -57
- package/dist/cjs/Icons/Icons.js +288 -426
- package/dist/cjs/ImageEditor.js +247 -0
- package/dist/cjs/ImageUpload.js +226 -0
- package/dist/cjs/NewBlerp.js +354 -160
- package/dist/cjs/NewBlerpTest.js +10 -792
- package/dist/cjs/NewCollectionModal.js +294 -310
- package/dist/cjs/PremiumCollectionCard.js +191 -454
- package/dist/cjs/PurchaseModals/CheckoutModal.js +1 -1
- package/dist/cjs/PurchaseModals/PremiumBlerpCheckoutModal.js +1 -1
- package/dist/cjs/PurchaseModals/PremiumCollectionCheckoutModal.js +1 -1
- package/dist/cjs/PurchaseModals/PremiumSubscriptionCheckoutModal.js +1 -1
- package/dist/cjs/ReactionButtons.js +26 -13
- package/dist/cjs/SnackbarContextProvider.js +200 -116
- package/dist/cjs/Theme.js +217 -90
- package/dist/cjs/Toggle.js +86 -32
- package/dist/cjs/UserCard.js +13 -32
- package/dist/cjs/UserPage/LibraryControls.js +180 -93
- package/dist/cjs/UserPage/UserLibraryHeader.js +23 -14
- package/dist/cjs/UserPage/UserProfileHeader.js +120 -105
- package/dist/cjs/UsernameWithPopout.js +12 -8
- package/dist/cjs/colors.js +15 -8
- package/dist/cjs/helpers.js +131 -0
- package/dist/cjs/index.js +98 -52
- package/dist/cjs/neo-components/Autocomplete.js +280 -0
- package/dist/cjs/neo-components/BottomNavigation.js +120 -0
- package/dist/cjs/neo-components/Box.js +48 -0
- package/dist/cjs/neo-components/Button.js +206 -0
- package/dist/cjs/neo-components/CircularProgress.js +92 -0
- package/dist/cjs/neo-components/Container.js +75 -0
- package/dist/cjs/neo-components/Dialog.js +441 -0
- package/dist/cjs/neo-components/Fab.js +237 -0
- package/dist/cjs/neo-components/FormControls.js +1057 -0
- package/dist/cjs/neo-components/Grid.js +256 -0
- package/dist/cjs/neo-components/IconButton.js +111 -0
- package/dist/cjs/neo-components/Input.js +493 -0
- package/dist/cjs/neo-components/Layout.js +1213 -0
- package/dist/cjs/neo-components/Misc.js +858 -0
- package/dist/cjs/neo-components/Navigation.js +1578 -0
- package/dist/cjs/neo-components/Paper.js +256 -0
- package/dist/cjs/neo-components/Stack.js +194 -0
- package/dist/cjs/neo-components/Stepper.js +291 -0
- package/dist/cjs/neo-components/Text.js +290 -0
- package/dist/cjs/neo-components/ThemeProvider.js +731 -0
- package/dist/cjs/neo-components/ToggleButton.js +223 -0
- package/dist/cjs/neo-components/createTheme.js +306 -0
- package/dist/cjs/neo-components/withSx.js +164 -0
- package/dist/cjs/neo-utils/sxToStyle.js +508 -0
- package/dist/esm/Blerp/BlerpImageRow.js +166 -46
- package/dist/esm/Blerp/BlerpSavePopup.js +35 -27
- package/dist/esm/Blerp/BlerpTitleRow.js +32 -13
- package/dist/esm/Blerp/BlerpTopRow.js +85 -16
- package/dist/esm/Blerp.js +4 -12
- package/dist/esm/BlerpAudioContextProvider.js +1 -2
- package/dist/esm/BlerpListView.js +313 -160
- package/dist/esm/BlerpListViewPremium.js +135 -109
- package/dist/esm/BlerpListViewSkeleton.js +60 -11
- package/dist/esm/BlerpSkeleton.js +32 -7
- package/dist/esm/CollectionCard.js +118 -38
- package/dist/esm/CollectionListViewPremium.js +367 -294
- package/dist/esm/CollectionSkeleton.js +73 -11
- package/dist/esm/Dropdown.js +260 -161
- package/dist/esm/EllipsisLoader.js +63 -18
- package/dist/esm/GroupCard.js +54 -46
- package/dist/esm/Icons/Icons.js +226 -367
- package/dist/esm/ImageEditor.js +240 -0
- package/dist/esm/ImageUpload.js +217 -0
- package/dist/esm/NewBlerp.js +282 -79
- package/dist/esm/NewBlerpTest.js +11 -781
- package/dist/esm/NewCollectionModal.js +289 -304
- package/dist/esm/PremiumCollectionCard.js +192 -451
- package/dist/esm/PurchaseModals/CheckoutModal.js +1 -1
- package/dist/esm/PurchaseModals/PremiumBlerpCheckoutModal.js +1 -1
- package/dist/esm/PurchaseModals/PremiumCollectionCheckoutModal.js +1 -1
- package/dist/esm/PurchaseModals/PremiumSubscriptionCheckoutModal.js +1 -1
- package/dist/esm/ReactionButtons.js +23 -8
- package/dist/esm/SnackbarContextProvider.js +196 -110
- package/dist/esm/Theme.js +187 -66
- package/dist/esm/Toggle.js +84 -29
- package/dist/esm/UserCard.js +1 -20
- package/dist/esm/UserPage/LibraryControls.js +159 -65
- package/dist/esm/UserPage/UserLibraryHeader.js +18 -10
- package/dist/esm/UserPage/UserProfileHeader.js +100 -79
- package/dist/esm/UsernameWithPopout.js +7 -4
- package/dist/esm/colors.js +11 -9
- package/dist/esm/helpers.js +122 -0
- package/dist/esm/icons.js +1 -1
- package/dist/esm/index.js +39 -3
- package/dist/esm/neo-components/Autocomplete.js +269 -0
- package/dist/esm/neo-components/BottomNavigation.js +109 -0
- package/dist/esm/neo-components/Box.js +36 -0
- package/dist/esm/neo-components/Button.js +194 -0
- package/dist/esm/neo-components/CircularProgress.js +81 -0
- package/dist/esm/neo-components/Container.js +63 -0
- package/dist/esm/neo-components/Dialog.js +423 -0
- package/dist/esm/neo-components/Fab.js +225 -0
- package/dist/esm/neo-components/FormControls.js +1041 -0
- package/dist/esm/neo-components/Grid.js +244 -0
- package/dist/esm/neo-components/IconButton.js +99 -0
- package/dist/esm/neo-components/Input.js +478 -0
- package/dist/esm/neo-components/Layout.js +1179 -0
- package/dist/esm/neo-components/Misc.js +840 -0
- package/dist/esm/neo-components/Navigation.js +1556 -0
- package/dist/esm/neo-components/Paper.js +243 -0
- package/dist/esm/neo-components/Stack.js +182 -0
- package/dist/esm/neo-components/Stepper.js +278 -0
- package/dist/esm/neo-components/Text.js +277 -0
- package/dist/esm/neo-components/ThemeProvider.js +718 -0
- package/dist/esm/neo-components/ToggleButton.js +214 -0
- package/dist/esm/neo-components/createTheme.js +297 -0
- package/dist/esm/neo-components/withSx.js +153 -0
- package/dist/esm/neo-utils/sxToStyle.js +502 -0
- package/package.json +19 -15
package/dist/esm/colors.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
1
7
|
let colors = {
|
|
2
8
|
white: "#ffffff",
|
|
3
9
|
waxing: "#F3F3F3",
|
|
@@ -68,10 +74,8 @@ let overrideColors = {
|
|
|
68
74
|
buntingBlueOverride: colors.buntingBlue,
|
|
69
75
|
popnYellowOverride: colors.popnYellow
|
|
70
76
|
};
|
|
71
|
-
const lightColors = {
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
const darkColors = {
|
|
77
|
+
const lightColors = _objectSpread(_objectSpread({}, colors), overrideColors);
|
|
78
|
+
const darkColors = _objectSpread({
|
|
75
79
|
white: colors.black,
|
|
76
80
|
waxwing: colors.grey8Dark,
|
|
77
81
|
grey1: colors.grey1Dark,
|
|
@@ -93,9 +97,8 @@ const darkColors = {
|
|
|
93
97
|
seafoam: colors.seafoam,
|
|
94
98
|
seafoamDark: colors.seafoamDark,
|
|
95
99
|
buntingBlue: colors.buntingBlue,
|
|
96
|
-
popnYellow: colors.popnYellow
|
|
97
|
-
|
|
98
|
-
};
|
|
100
|
+
popnYellow: colors.popnYellow
|
|
101
|
+
}, overrideColors);
|
|
99
102
|
const lightPalette = {
|
|
100
103
|
primary: {
|
|
101
104
|
light: colors.ibisRed,
|
|
@@ -356,5 +359,4 @@ const darkPalette = {
|
|
|
356
359
|
}
|
|
357
360
|
};
|
|
358
361
|
|
|
359
|
-
export default
|
|
360
|
-
export { darkColors, darkPalette, lightColors, lightPalette, overrideColors };
|
|
362
|
+
export { darkColors, darkPalette, colors as default, lightColors, lightPalette, overrideColors };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// Remove this import:
|
|
4
|
+
|
|
5
|
+
const extractDominantColor = (imageUrl, callback) => {
|
|
6
|
+
const img = new Image();
|
|
7
|
+
img.crossOrigin = "Anonymous";
|
|
8
|
+
img.src = imageUrl;
|
|
9
|
+
|
|
10
|
+
img.onload = () => {
|
|
11
|
+
const canvas = document.createElement("canvas");
|
|
12
|
+
const ctx = canvas.getContext("2d");
|
|
13
|
+
canvas.width = img.width;
|
|
14
|
+
canvas.height = img.height;
|
|
15
|
+
ctx.drawImage(img, 0, 0);
|
|
16
|
+
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
17
|
+
const data = imageData.data;
|
|
18
|
+
let r = 0,
|
|
19
|
+
g = 0,
|
|
20
|
+
b = 0;
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
23
|
+
r += data[i];
|
|
24
|
+
g += data[i + 1];
|
|
25
|
+
b += data[i + 2];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const pixelCount = data.length / 4;
|
|
29
|
+
r = Math.floor(r / pixelCount);
|
|
30
|
+
g = Math.floor(g / pixelCount);
|
|
31
|
+
b = Math.floor(b / pixelCount);
|
|
32
|
+
callback(["rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")")]);
|
|
33
|
+
};
|
|
34
|
+
}; // Custom palette extraction for components that need vibrant/darkVibrant colors
|
|
35
|
+
|
|
36
|
+
const useCustomPalette = imageUrl => {
|
|
37
|
+
const [palette, setPalette] = React.useState({
|
|
38
|
+
loading: true,
|
|
39
|
+
data: {
|
|
40
|
+
vibrant: null,
|
|
41
|
+
darkVibrant: null
|
|
42
|
+
},
|
|
43
|
+
error: null
|
|
44
|
+
});
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (!imageUrl) {
|
|
47
|
+
setPalette({
|
|
48
|
+
loading: false,
|
|
49
|
+
data: {
|
|
50
|
+
vibrant: null,
|
|
51
|
+
darkVibrant: null
|
|
52
|
+
},
|
|
53
|
+
error: null
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const img = new Image();
|
|
59
|
+
img.crossOrigin = "Anonymous";
|
|
60
|
+
img.src = imageUrl;
|
|
61
|
+
|
|
62
|
+
img.onload = () => {
|
|
63
|
+
try {
|
|
64
|
+
const canvas = document.createElement("canvas");
|
|
65
|
+
const ctx = canvas.getContext("2d");
|
|
66
|
+
canvas.width = img.width;
|
|
67
|
+
canvas.height = img.height;
|
|
68
|
+
ctx.drawImage(img, 0, 0);
|
|
69
|
+
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
70
|
+
const data = imageData.data;
|
|
71
|
+
let r = 0,
|
|
72
|
+
g = 0,
|
|
73
|
+
b = 0;
|
|
74
|
+
|
|
75
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
76
|
+
r += data[i];
|
|
77
|
+
g += data[i + 1];
|
|
78
|
+
b += data[i + 2];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const pixelCount = data.length / 4;
|
|
82
|
+
r = Math.floor(r / pixelCount);
|
|
83
|
+
g = Math.floor(g / pixelCount);
|
|
84
|
+
b = Math.floor(b / pixelCount);
|
|
85
|
+
const vibrant = "rgb(".concat(Math.min(r + 20, 255), ", ").concat(Math.min(g + 20, 255), ", ").concat(Math.min(b + 20, 255), ")");
|
|
86
|
+
const darkVibrant = "rgb(".concat(Math.floor(r * 0.6), ", ").concat(Math.floor(g * 0.6), ", ").concat(Math.floor(b * 0.6), ")");
|
|
87
|
+
setPalette({
|
|
88
|
+
loading: false,
|
|
89
|
+
data: {
|
|
90
|
+
vibrant,
|
|
91
|
+
darkVibrant
|
|
92
|
+
},
|
|
93
|
+
error: null
|
|
94
|
+
});
|
|
95
|
+
} catch (error) {
|
|
96
|
+
console.error("Palette extraction failed:", error);
|
|
97
|
+
setPalette({
|
|
98
|
+
loading: false,
|
|
99
|
+
data: {
|
|
100
|
+
vibrant: null,
|
|
101
|
+
darkVibrant: null
|
|
102
|
+
},
|
|
103
|
+
error: error.message
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
img.onerror = () => {
|
|
109
|
+
setPalette({
|
|
110
|
+
loading: false,
|
|
111
|
+
data: {
|
|
112
|
+
vibrant: null,
|
|
113
|
+
darkVibrant: null
|
|
114
|
+
},
|
|
115
|
+
error: "Image failed to load"
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
}, [imageUrl]);
|
|
119
|
+
return palette;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export { extractDominantColor, useCustomPalette };
|
package/dist/esm/icons.js
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThemeProvider as ThemeProvider$1 } from './neo-components/ThemeProvider.js';
|
|
2
|
+
import { createTheme as createTheme$1 } from './neo-components/createTheme.js';
|
|
3
|
+
import { CircularProgress as CircularProgress$1 } from './neo-components/CircularProgress.js';
|
|
4
|
+
import { Box as Box$1 } from './neo-components/Box.js';
|
|
5
|
+
import { Stack as Stack$1 } from './neo-components/Stack.js';
|
|
6
|
+
import { Grid as Grid$1 } from './neo-components/Grid.js';
|
|
7
|
+
import { Container as Container$1 } from './neo-components/Container.js';
|
|
8
|
+
import { Typography } from './neo-components/Text.js';
|
|
9
|
+
import { Button as Button$1 } from './neo-components/Button.js';
|
|
10
|
+
import { IconButton as IconButton$1 } from './neo-components/IconButton.js';
|
|
11
|
+
import { Fab, SpeedDial as SpeedDial$1 } from './neo-components/Fab.js';
|
|
12
|
+
import './neo-components/ToggleButton.js';
|
|
13
|
+
import { TextField, InputAdornment as InputAdornment$1 } from './neo-components/Input.js';
|
|
14
|
+
import { Checkbox as Checkbox$1, Radio, Rating as Rating$1, Select as Select$1, Slider as Slider$1, Switch as Switch$1 } from './neo-components/FormControls.js';
|
|
15
|
+
import { Autocomplete as Autocomplete$1 } from './neo-components/Autocomplete.js';
|
|
16
|
+
import { Card as Card$1, Paper as Paper$1 } from './neo-components/Paper.js';
|
|
17
|
+
import { Backdrop as Backdrop$1, Dialog as Dialog$1, Modal as Modal$1 } from './neo-components/Dialog.js';
|
|
18
|
+
import { Drawer as Drawer$1, Menu as Menu$1, Tabs as Tabs$1, Tab as Tab$1, Alert as Alert$1, Snackbar as Snackbar$1, Popover as Popover$1, MenuItem as MenuItem$1, AlertTitle as AlertTitle$1 } from './neo-components/Navigation.js';
|
|
19
|
+
import { BottomNavigation as BottomNavigation$1 } from './neo-components/BottomNavigation.js';
|
|
20
|
+
import { Stepper as Stepper$1 } from './neo-components/Stepper.js';
|
|
21
|
+
import { Link as Link$1, LinearProgress as LinearProgress$1, Skeleton as Skeleton$1, Avatar as Avatar$1, Badge as Badge$1, Chip as Chip$1, Divider as Divider$1, Tooltip as Tooltip$1 } from './neo-components/Misc.js';
|
|
22
|
+
import { AccordionSummary as AccordionSummary$1, AccordionDetails as AccordionDetails$1, AccordionActions as AccordionActions$1, ImageList as ImageList$1, ButtonGroup as ButtonGroup$1, Breadcrumbs as Breadcrumbs$1, Pagination as Pagination$1, Accordion as Accordion$1, AppBar as AppBar$1, List as List$1, Table as Table$1, Toolbar as Toolbar$1, SvgIcon as SvgIcon$1, FormControl as FormControl$1, InputLabel as InputLabel$1 } from './neo-components/Layout.js';
|
|
23
|
+
import '@babel/runtime/helpers/extends';
|
|
24
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
25
|
+
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
26
|
+
import 'react';
|
|
2
27
|
import { Blerp as Blerp$1 } from './Blerp.js';
|
|
3
28
|
import { NewBlerp as NewBlerp$1 } from './NewBlerp.js';
|
|
4
29
|
import { NewBlerpTest as NewBlerpTest$1 } from './NewBlerpTest.js';
|
|
@@ -27,7 +52,11 @@ export { default as PremiumBlerpCheckoutModal } from './PurchaseModals/PremiumBl
|
|
|
27
52
|
export { default as PremiumCollectionCheckoutModal } from './PurchaseModals/PremiumCollectionCheckoutModal.js';
|
|
28
53
|
export { default as PremiumSubscriptionCheckoutModal } from './PurchaseModals/PremiumSubscriptionCheckoutModal.js';
|
|
29
54
|
|
|
55
|
+
// import {
|
|
30
56
|
const Theme = BlerpTheme;
|
|
57
|
+
const AccordionSummary = AccordionSummary$1;
|
|
58
|
+
const AccordionDetails = AccordionDetails$1;
|
|
59
|
+
const AccordionActions = AccordionActions$1;
|
|
31
60
|
const Box = Box$1;
|
|
32
61
|
const Container = Container$1;
|
|
33
62
|
const Grid = Grid$1;
|
|
@@ -70,6 +99,7 @@ const Chip = Chip$1;
|
|
|
70
99
|
const Divider = Divider$1;
|
|
71
100
|
const List = List$1;
|
|
72
101
|
const Table = Table$1;
|
|
102
|
+
const CircularProgress = CircularProgress$1;
|
|
73
103
|
const Tooltip = Tooltip$1;
|
|
74
104
|
const Toolbar = Toolbar$1;
|
|
75
105
|
const Text = Typography;
|
|
@@ -95,7 +125,13 @@ const BlerpListViewPremium = BlerpListViewPremium$1;
|
|
|
95
125
|
const BlerpSkeleton = BlerpSkeleton$1;
|
|
96
126
|
const BlerpListViewSkeleton = BlerpListViewSkeleton$1;
|
|
97
127
|
const CollectionSkeleton = CollectionSkeleton$1;
|
|
98
|
-
const InputAdornment = InputAdornment$1;
|
|
128
|
+
const InputAdornment = InputAdornment$1;
|
|
129
|
+
const createTheme = createTheme$1;
|
|
130
|
+
const ThemeProvider = ThemeProvider$1;
|
|
131
|
+
const AlertTitle = AlertTitle$1;
|
|
132
|
+
const SvgIcon = SvgIcon$1;
|
|
133
|
+
const FormControl = FormControl$1;
|
|
134
|
+
const InputLabel = InputLabel$1; // export const BlerpContextMenu = MBlerpContextMenu;
|
|
99
135
|
// export const ListItem = MListItem;
|
|
100
136
|
// // export const ListItemText = MListItemText;
|
|
101
137
|
// export const ListItemButtonText = MListItemButtonText;
|
|
@@ -333,4 +369,4 @@ const Themes = {
|
|
|
333
369
|
// };
|
|
334
370
|
// export default returnLibrary();
|
|
335
371
|
|
|
336
|
-
export { Accordion, Alert, AppBar, Autocomplete, Avatar, Backdrop, Badge, Blerp, BlerpAudioContextProvider, BlerpListView, BlerpListViewPremium, BlerpListViewSkeleton, BlerpSkeleton, BottomNavigation, Box, Breadcrumbs, Button, ButtonGroup, Card, Checkbox, Chip, CollectionCard, CollectionListViewPremium, CollectionSkeleton, Container, Dialog, Divider, Drawer, Dropdown, FloatingActionButton, Grid, GroupCard, IconButton, ImageList, Input, InputAdornment, LinearProgress, Link, List, Menu, MenuItem, Modal, NewBlerp, NewBlerpTest, NewCollectionModal, NewDropdown, Pagination, Paper, Popover, RadioButton, Rating, Select, Skeleton, Slider, Snackbar, SpeedDial, Stack, Stepper, Switch, Tab, Table, Tabs, Text, Theme, Themes, Toggle, Toolbar, Tooltip, UserCard, UsernameWithPopout, darkThemeV1, lightThemeV1, mainTheme };
|
|
372
|
+
export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Alert, AlertTitle, AppBar, Autocomplete, Avatar, Backdrop, Badge, Blerp, BlerpAudioContextProvider, BlerpListView, BlerpListViewPremium, BlerpListViewSkeleton, BlerpSkeleton, BottomNavigation, Box, Breadcrumbs, Button, ButtonGroup, Card, Checkbox, Chip, CircularProgress, CollectionCard, CollectionListViewPremium, CollectionSkeleton, Container, Dialog, Divider, Drawer, Dropdown, FloatingActionButton, FormControl, Grid, GroupCard, IconButton, ImageList, Input, InputAdornment, InputLabel, LinearProgress, Link, List, Menu, MenuItem, Modal, NewBlerp, NewBlerpTest, NewCollectionModal, NewDropdown, Pagination, Paper, Popover, RadioButton, Rating, Select, Skeleton, Slider, Snackbar, SpeedDial, Stack, Stepper, SvgIcon, Switch, Tab, Table, Tabs, Text, Theme, ThemeProvider, Themes, Toggle, Toolbar, Tooltip, UserCard, UsernameWithPopout, createTheme, darkThemeV1, lightThemeV1, mainTheme };
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
5
|
+
import { withSx } from './withSx.js';
|
|
6
|
+
import { TextField } from './Input.js';
|
|
7
|
+
import { Paper } from './Paper.js';
|
|
8
|
+
|
|
9
|
+
const _excluded = ["options", "value", "defaultValue", "onChange", "onInputChange", "inputValue", "getOptionLabel", "isOptionEqualToValue", "filterOptions", "renderInput", "renderOption", "renderTags", "multiple", "freeSolo", "disabled", "disableClearable", "loading", "loadingText", "noOptionsText", "open", "onOpen", "onClose", "autoComplete", "autoHighlight", "clearOnBlur", "clearOnEscape", "disableCloseOnSelect", "disableListWrap", "disablePortal", "fullWidth", "groupBy", "includeInputInList", "limitTags", "ListboxComponent", "ListboxProps", "openOnFocus", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "selectOnFocus", "size", "clearIcon", "forcePopupIcon", "placeholder", "className", "style"];
|
|
10
|
+
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
|
+
/**
|
|
15
|
+
* Autocomplete - combo box with filtering
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const AutocompleteBase = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
19
|
+
let {
|
|
20
|
+
options = [],
|
|
21
|
+
value,
|
|
22
|
+
defaultValue,
|
|
23
|
+
onChange,
|
|
24
|
+
onInputChange,
|
|
25
|
+
inputValue: controlledInputValue,
|
|
26
|
+
getOptionLabel = option => {
|
|
27
|
+
var _ref2, _option$label, _option$toString;
|
|
28
|
+
|
|
29
|
+
return (_ref2 = (_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : option === null || option === void 0 ? void 0 : (_option$toString = option.toString) === null || _option$toString === void 0 ? void 0 : _option$toString.call(option)) !== null && _ref2 !== void 0 ? _ref2 : "";
|
|
30
|
+
},
|
|
31
|
+
isOptionEqualToValue = (option, value) => option === value,
|
|
32
|
+
filterOptions,
|
|
33
|
+
renderInput,
|
|
34
|
+
renderOption,
|
|
35
|
+
renderTags,
|
|
36
|
+
multiple = false,
|
|
37
|
+
freeSolo = false,
|
|
38
|
+
disabled = false,
|
|
39
|
+
disableClearable = false,
|
|
40
|
+
loading = false,
|
|
41
|
+
loadingText = "Loading…",
|
|
42
|
+
noOptionsText = "No options",
|
|
43
|
+
open: controlledOpen,
|
|
44
|
+
onOpen,
|
|
45
|
+
onClose,
|
|
46
|
+
autoComplete = false,
|
|
47
|
+
autoHighlight = false,
|
|
48
|
+
clearOnBlur = !freeSolo,
|
|
49
|
+
clearOnEscape = false,
|
|
50
|
+
disableCloseOnSelect = false,
|
|
51
|
+
disableListWrap = false,
|
|
52
|
+
disablePortal = false,
|
|
53
|
+
fullWidth = false,
|
|
54
|
+
groupBy,
|
|
55
|
+
includeInputInList = false,
|
|
56
|
+
limitTags = -1,
|
|
57
|
+
ListboxComponent = "ul",
|
|
58
|
+
ListboxProps,
|
|
59
|
+
openOnFocus = false,
|
|
60
|
+
PaperComponent = Paper,
|
|
61
|
+
PopperComponent,
|
|
62
|
+
popupIcon,
|
|
63
|
+
readOnly = false,
|
|
64
|
+
selectOnFocus = false,
|
|
65
|
+
size = "medium",
|
|
66
|
+
clearIcon,
|
|
67
|
+
forcePopupIcon = "auto",
|
|
68
|
+
placeholder,
|
|
69
|
+
className,
|
|
70
|
+
style
|
|
71
|
+
} = _ref,
|
|
72
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
73
|
+
|
|
74
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
75
|
+
const [internalInputValue, setInternalInputValue] = useState("");
|
|
76
|
+
const [internalValue, setInternalValue] = useState(multiple ? defaultValue || [] : defaultValue || null);
|
|
77
|
+
const inputRef = useRef(null);
|
|
78
|
+
const listboxRef = useRef(null);
|
|
79
|
+
const open = controlledOpen !== undefined ? controlledOpen : internalOpen;
|
|
80
|
+
const inputValue = controlledInputValue !== undefined ? controlledInputValue : internalInputValue;
|
|
81
|
+
const selectedValue = value !== undefined ? value : internalValue;
|
|
82
|
+
|
|
83
|
+
const handleOpen = () => {
|
|
84
|
+
if (disabled || readOnly) return;
|
|
85
|
+
setInternalOpen(true);
|
|
86
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const handleClose = () => {
|
|
90
|
+
setInternalOpen(false);
|
|
91
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const handleInputChange = event => {
|
|
95
|
+
const newValue = event.target.value;
|
|
96
|
+
setInternalInputValue(newValue);
|
|
97
|
+
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(event, newValue, "input");
|
|
98
|
+
if (!open) handleOpen();
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const handleSelect = option => {
|
|
102
|
+
if (multiple) {
|
|
103
|
+
const newValue = Array.isArray(selectedValue) ? selectedValue.some(v => isOptionEqualToValue(option, v)) ? selectedValue.filter(v => !isOptionEqualToValue(option, v)) : [...selectedValue, option] : [option];
|
|
104
|
+
setInternalValue(newValue);
|
|
105
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(null, newValue, "selectOption");
|
|
106
|
+
} else {
|
|
107
|
+
setInternalValue(option);
|
|
108
|
+
setInternalInputValue(getOptionLabel(option));
|
|
109
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(null, option, "selectOption");
|
|
110
|
+
if (!disableCloseOnSelect) handleClose();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const handleClear = event => {
|
|
115
|
+
event.stopPropagation();
|
|
116
|
+
setInternalValue(multiple ? [] : null);
|
|
117
|
+
setInternalInputValue("");
|
|
118
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event, multiple ? [] : null, "clear");
|
|
119
|
+
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(event, "", "clear");
|
|
120
|
+
}; // Filter options
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
const filteredOptions = filterOptions ? filterOptions(options, {
|
|
124
|
+
inputValue,
|
|
125
|
+
getOptionLabel
|
|
126
|
+
}) : options.filter(option => getOptionLabel(option).toLowerCase().includes(inputValue.toLowerCase())); // Group options if groupBy provided
|
|
127
|
+
|
|
128
|
+
const groupedOptions = groupBy ? filteredOptions.reduce((acc, option) => {
|
|
129
|
+
const group = groupBy(option);
|
|
130
|
+
if (!acc[group]) acc[group] = [];
|
|
131
|
+
acc[group].push(option);
|
|
132
|
+
return acc;
|
|
133
|
+
}, {}) : null;
|
|
134
|
+
|
|
135
|
+
const baseStyle = _objectSpread({
|
|
136
|
+
position: "relative",
|
|
137
|
+
display: "inline-flex",
|
|
138
|
+
flexDirection: "column",
|
|
139
|
+
width: fullWidth ? "100%" : undefined
|
|
140
|
+
}, style);
|
|
141
|
+
|
|
142
|
+
const listboxStyle = {
|
|
143
|
+
position: "absolute",
|
|
144
|
+
top: "100%",
|
|
145
|
+
left: 0,
|
|
146
|
+
right: 0,
|
|
147
|
+
zIndex: 1300,
|
|
148
|
+
maxHeight: 300,
|
|
149
|
+
overflow: "auto",
|
|
150
|
+
margin: 0,
|
|
151
|
+
padding: 0,
|
|
152
|
+
listStyle: "none",
|
|
153
|
+
backgroundColor: "#FFFFFF",
|
|
154
|
+
borderRadius: 4,
|
|
155
|
+
boxShadow: "0 2px 4px -1px rgba(0,0,0,0.2), 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12)"
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const optionStyle = (isSelected, isHighlighted) => ({
|
|
159
|
+
padding: "8px 16px",
|
|
160
|
+
cursor: "pointer",
|
|
161
|
+
backgroundColor: isSelected ? "#E3F2FD" : isHighlighted ? "#F5F5F5" : "transparent"
|
|
162
|
+
}); // Close on outside click
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
const handleClickOutside = event => {
|
|
167
|
+
if (inputRef.current && !inputRef.current.contains(event.target) && listboxRef.current && !listboxRef.current.contains(event.target)) {
|
|
168
|
+
handleClose();
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
173
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
174
|
+
}, []);
|
|
175
|
+
const inputProps = {
|
|
176
|
+
ref: inputRef,
|
|
177
|
+
value: inputValue,
|
|
178
|
+
onChange: handleInputChange,
|
|
179
|
+
onFocus: openOnFocus ? handleOpen : undefined,
|
|
180
|
+
disabled,
|
|
181
|
+
readOnly,
|
|
182
|
+
placeholder,
|
|
183
|
+
size
|
|
184
|
+
};
|
|
185
|
+
const showClearButton = !disableClearable && !disabled && !readOnly && (multiple ? (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) > 0 : selectedValue !== null);
|
|
186
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
187
|
+
ref: ref,
|
|
188
|
+
className: className,
|
|
189
|
+
style: baseStyle
|
|
190
|
+
}, props), renderInput ? renderInput(_objectSpread(_objectSpread({}, inputProps), {}, {
|
|
191
|
+
InputProps: {
|
|
192
|
+
endAdornment: /*#__PURE__*/React.createElement(React.Fragment, null, showClearButton && /*#__PURE__*/React.createElement("button", {
|
|
193
|
+
onClick: handleClear,
|
|
194
|
+
style: {
|
|
195
|
+
background: "none",
|
|
196
|
+
border: "none",
|
|
197
|
+
cursor: "pointer",
|
|
198
|
+
padding: 4
|
|
199
|
+
}
|
|
200
|
+
}, clearIcon || "×"), forcePopupIcon !== false && /*#__PURE__*/React.createElement("button", {
|
|
201
|
+
onClick: () => open ? handleClose() : handleOpen(),
|
|
202
|
+
style: {
|
|
203
|
+
background: "none",
|
|
204
|
+
border: "none",
|
|
205
|
+
cursor: "pointer",
|
|
206
|
+
padding: 4,
|
|
207
|
+
transform: open ? "rotate(180deg)" : "none"
|
|
208
|
+
}
|
|
209
|
+
}, popupIcon || "▼"))
|
|
210
|
+
}
|
|
211
|
+
})) : /*#__PURE__*/React.createElement(TextField, inputProps), open && /*#__PURE__*/React.createElement(PaperComponent, {
|
|
212
|
+
style: listboxStyle
|
|
213
|
+
}, /*#__PURE__*/React.createElement(ListboxComponent, _extends({
|
|
214
|
+
ref: listboxRef
|
|
215
|
+
}, ListboxProps), loading ? /*#__PURE__*/React.createElement("li", {
|
|
216
|
+
style: {
|
|
217
|
+
padding: "8px 16px",
|
|
218
|
+
color: "#757575"
|
|
219
|
+
}
|
|
220
|
+
}, loadingText) : filteredOptions.length === 0 ? /*#__PURE__*/React.createElement("li", {
|
|
221
|
+
style: {
|
|
222
|
+
padding: "8px 16px",
|
|
223
|
+
color: "#757575"
|
|
224
|
+
}
|
|
225
|
+
}, noOptionsText) : groupedOptions ? Object.entries(groupedOptions).map(_ref3 => {
|
|
226
|
+
let [group, groupOptions] = _ref3;
|
|
227
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
228
|
+
key: group
|
|
229
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
230
|
+
style: {
|
|
231
|
+
padding: "8px 16px",
|
|
232
|
+
fontWeight: 600,
|
|
233
|
+
backgroundColor: "#F5F5F5"
|
|
234
|
+
}
|
|
235
|
+
}, group), /*#__PURE__*/React.createElement("ul", {
|
|
236
|
+
style: {
|
|
237
|
+
listStyle: "none",
|
|
238
|
+
margin: 0,
|
|
239
|
+
padding: 0
|
|
240
|
+
}
|
|
241
|
+
}, groupOptions.map((option, index) => {
|
|
242
|
+
const isSelected = multiple ? selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.some(v => isOptionEqualToValue(option, v)) : isOptionEqualToValue(option, selectedValue);
|
|
243
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
244
|
+
key: index,
|
|
245
|
+
style: optionStyle(isSelected, false),
|
|
246
|
+
onClick: () => handleSelect(option)
|
|
247
|
+
}, renderOption ? renderOption({
|
|
248
|
+
option
|
|
249
|
+
}, option, {
|
|
250
|
+
selected: isSelected
|
|
251
|
+
}) : getOptionLabel(option));
|
|
252
|
+
})));
|
|
253
|
+
}) : filteredOptions.map((option, index) => {
|
|
254
|
+
const isSelected = multiple ? selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.some(v => isOptionEqualToValue(option, v)) : isOptionEqualToValue(option, selectedValue);
|
|
255
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
256
|
+
key: index,
|
|
257
|
+
style: optionStyle(isSelected, false),
|
|
258
|
+
onClick: () => handleSelect(option)
|
|
259
|
+
}, renderOption ? renderOption({
|
|
260
|
+
option
|
|
261
|
+
}, option, {
|
|
262
|
+
selected: isSelected
|
|
263
|
+
}) : getOptionLabel(option));
|
|
264
|
+
}))));
|
|
265
|
+
});
|
|
266
|
+
AutocompleteBase.displayName = "Autocomplete";
|
|
267
|
+
const Autocomplete = withSx(AutocompleteBase);
|
|
268
|
+
|
|
269
|
+
export { Autocomplete };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { withSx } from './withSx.js';
|
|
6
|
+
|
|
7
|
+
const _excluded = ["children", "value", "onChange", "showLabels", "className", "style"],
|
|
8
|
+
_excluded2 = ["icon", "label", "value", "selected", "showLabel", "onChange", "className", "style"];
|
|
9
|
+
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
|
+
/**
|
|
14
|
+
* BottomNavigation - navigation bar at bottom of screen
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const BottomNavigationBase = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18
|
+
let {
|
|
19
|
+
children,
|
|
20
|
+
value,
|
|
21
|
+
onChange,
|
|
22
|
+
showLabels = false,
|
|
23
|
+
className,
|
|
24
|
+
style
|
|
25
|
+
} = _ref,
|
|
26
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
|
|
28
|
+
const baseStyle = _objectSpread({
|
|
29
|
+
display: "flex",
|
|
30
|
+
justifyContent: "center",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
height: 56,
|
|
33
|
+
backgroundColor: "#FFFFFF",
|
|
34
|
+
boxShadow: "0 -1px 3px rgba(0,0,0,0.12)"
|
|
35
|
+
}, style);
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
38
|
+
ref: ref,
|
|
39
|
+
className: className,
|
|
40
|
+
style: baseStyle
|
|
41
|
+
}, props), React.Children.map(children, (child, index) => /*#__PURE__*/React.isValidElement(child) ? /*#__PURE__*/React.cloneElement(child, {
|
|
42
|
+
selected: value === index || value === child.props.value,
|
|
43
|
+
showLabel: showLabels || child.props.showLabel,
|
|
44
|
+
onChange: event => {
|
|
45
|
+
var _child$props$value;
|
|
46
|
+
|
|
47
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(event, (_child$props$value = child.props.value) !== null && _child$props$value !== void 0 ? _child$props$value : index);
|
|
48
|
+
}
|
|
49
|
+
}) : child));
|
|
50
|
+
});
|
|
51
|
+
BottomNavigationBase.displayName = "BottomNavigation";
|
|
52
|
+
const BottomNavigation = withSx(BottomNavigationBase);
|
|
53
|
+
/**
|
|
54
|
+
* BottomNavigationAction - individual action in BottomNavigation
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
const BottomNavigationActionBase = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
58
|
+
let {
|
|
59
|
+
icon,
|
|
60
|
+
label,
|
|
61
|
+
value,
|
|
62
|
+
selected = false,
|
|
63
|
+
showLabel = false,
|
|
64
|
+
onChange,
|
|
65
|
+
className,
|
|
66
|
+
style
|
|
67
|
+
} = _ref2,
|
|
68
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
69
|
+
|
|
70
|
+
const baseStyle = _objectSpread({
|
|
71
|
+
display: "flex",
|
|
72
|
+
flexDirection: "column",
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
justifyContent: "center",
|
|
75
|
+
flex: 1,
|
|
76
|
+
minWidth: 80,
|
|
77
|
+
maxWidth: 168,
|
|
78
|
+
padding: "6px 12px",
|
|
79
|
+
cursor: "pointer",
|
|
80
|
+
backgroundColor: "transparent",
|
|
81
|
+
border: "none",
|
|
82
|
+
color: selected ? "#7C4DFF" : "#757575",
|
|
83
|
+
transition: "color 0.2s"
|
|
84
|
+
}, style);
|
|
85
|
+
|
|
86
|
+
const iconStyle = {
|
|
87
|
+
fontSize: 24,
|
|
88
|
+
marginBottom: showLabel || selected ? 4 : 0
|
|
89
|
+
};
|
|
90
|
+
const labelStyle = {
|
|
91
|
+
fontSize: 12,
|
|
92
|
+
opacity: showLabel || selected ? 1 : 0,
|
|
93
|
+
transition: "opacity 0.2s"
|
|
94
|
+
};
|
|
95
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
96
|
+
ref: ref,
|
|
97
|
+
className: className,
|
|
98
|
+
style: baseStyle,
|
|
99
|
+
onClick: onChange
|
|
100
|
+
}, props), /*#__PURE__*/React.createElement("span", {
|
|
101
|
+
style: iconStyle
|
|
102
|
+
}, icon), (showLabel || selected) && /*#__PURE__*/React.createElement("span", {
|
|
103
|
+
style: labelStyle
|
|
104
|
+
}, label));
|
|
105
|
+
});
|
|
106
|
+
BottomNavigationActionBase.displayName = "BottomNavigationAction";
|
|
107
|
+
withSx(BottomNavigationActionBase);
|
|
108
|
+
|
|
109
|
+
export { BottomNavigation };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { withSx } from './withSx.js';
|
|
6
|
+
|
|
7
|
+
const _excluded = ["component", "children", "sx"];
|
|
8
|
+
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
12
|
+
/**
|
|
13
|
+
* Box - The fundamental layout component (replaces MUI Box)
|
|
14
|
+
* A div with sx prop support
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const BaseBox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18
|
+
let {
|
|
19
|
+
component: Component = 'div',
|
|
20
|
+
children,
|
|
21
|
+
sx
|
|
22
|
+
} = _ref,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
26
|
+
ref: ref
|
|
27
|
+
}, props, {
|
|
28
|
+
sx: _objectSpread({
|
|
29
|
+
padding: '16px'
|
|
30
|
+
}, sx)
|
|
31
|
+
}), children);
|
|
32
|
+
});
|
|
33
|
+
BaseBox.displayName = 'BaseBox';
|
|
34
|
+
const Box = withSx(BaseBox);
|
|
35
|
+
|
|
36
|
+
export { Box, Box as default };
|