@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
|
@@ -2,26 +2,87 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var index = require('./index.js');
|
|
8
|
+
var Theme = require('./Theme.js');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
11
|
|
|
11
|
-
var
|
|
12
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
12
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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__default["default"](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; }
|
|
18
18
|
const CollectionSkeleton = () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
const theme = Theme.useBlerpTheme();
|
|
20
|
+
|
|
21
|
+
const getSquareStyles = depth => {
|
|
22
|
+
const baseStyles = {
|
|
23
|
+
position: "absolute",
|
|
24
|
+
height: "100%",
|
|
25
|
+
width: "100%",
|
|
26
|
+
borderRadius: "8px"
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
switch (depth) {
|
|
30
|
+
case "1":
|
|
31
|
+
return _objectSpread(_objectSpread({}, baseStyles), {}, {
|
|
32
|
+
zIndex: 5,
|
|
33
|
+
background: theme.colors.grey4
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
case "2":
|
|
37
|
+
return _objectSpread(_objectSpread({}, baseStyles), {}, {
|
|
38
|
+
zIndex: 4,
|
|
39
|
+
background: theme.colors.grey6,
|
|
40
|
+
transform: "skewX(-5deg)",
|
|
41
|
+
left: "8px",
|
|
42
|
+
height: "94%",
|
|
43
|
+
bottom: 0
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
case "3":
|
|
47
|
+
return _objectSpread(_objectSpread({}, baseStyles), {}, {
|
|
48
|
+
background: theme.colors.grey7,
|
|
49
|
+
transform: "skewX(-10deg)",
|
|
50
|
+
left: "15px",
|
|
51
|
+
height: "87%",
|
|
52
|
+
bottom: 0
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
default:
|
|
56
|
+
return _objectSpread(_objectSpread({}, baseStyles), {}, {
|
|
57
|
+
background: theme.colors.ibisRed
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return /*#__PURE__*/React__default["default"].createElement(index.Box, {
|
|
63
|
+
sx: {
|
|
64
|
+
position: "relative",
|
|
65
|
+
height: "200px",
|
|
66
|
+
width: "200px",
|
|
67
|
+
animation: "pulse 3s ease-in-out infinite",
|
|
68
|
+
"@keyframes pulse": {
|
|
69
|
+
"0%": {
|
|
70
|
+
opacity: 0.7
|
|
71
|
+
},
|
|
72
|
+
"50%": {
|
|
73
|
+
opacity: 1
|
|
74
|
+
},
|
|
75
|
+
"100%": {
|
|
76
|
+
opacity: 0.7
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, /*#__PURE__*/React__default["default"].createElement(index.Box, {
|
|
81
|
+
sx: getSquareStyles("1")
|
|
82
|
+
}), /*#__PURE__*/React__default["default"].createElement(index.Box, {
|
|
83
|
+
sx: getSquareStyles("2")
|
|
84
|
+
}), /*#__PURE__*/React__default["default"].createElement(index.Box, {
|
|
85
|
+
sx: getSquareStyles("3")
|
|
25
86
|
}));
|
|
26
87
|
};
|
|
27
88
|
|
package/dist/cjs/Dropdown.js
CHANGED
|
@@ -2,26 +2,100 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var index = require('./index.js');
|
|
7
|
-
var KeyboardArrowDownRoundedIcon = require('@mui/icons-material/KeyboardArrowDownRounded');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
|
11
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
11
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
-
var KeyboardArrowDownRoundedIcon__default = /*#__PURE__*/_interopDefaultLegacy(KeyboardArrowDownRoundedIcon);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
// div:focus {
|
|
16
|
-
// border: none !important;
|
|
17
|
-
// box-shadow: 0px 0px 20px #0000001a;
|
|
18
|
-
// }
|
|
19
|
-
// & .MuiPaper-root {
|
|
20
|
-
// background-color: ${(props) => props.theme.colors.grey3};
|
|
21
|
-
// }
|
|
22
|
-
// `;
|
|
14
|
+
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; }
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
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__default["default"](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; }
|
|
17
|
+
|
|
18
|
+
const ChevronIcon = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
isOpen,
|
|
21
|
+
color = "currentColor",
|
|
22
|
+
size = 20
|
|
23
|
+
} = _ref;
|
|
24
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
25
|
+
width: size,
|
|
26
|
+
height: size,
|
|
27
|
+
viewBox: "0 0 24 24",
|
|
28
|
+
fill: "none",
|
|
29
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
30
|
+
style: {
|
|
31
|
+
color,
|
|
32
|
+
transform: isOpen ? "rotate(180deg)" : "rotate(0deg)",
|
|
33
|
+
transition: "transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
34
|
+
flexShrink: 0
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
37
|
+
d: "M6 9l6 6 6-6",
|
|
38
|
+
stroke: "currentColor",
|
|
39
|
+
strokeWidth: "1.5",
|
|
40
|
+
strokeLinecap: "round",
|
|
41
|
+
strokeLinejoin: "round"
|
|
42
|
+
}));
|
|
43
|
+
}; // Shared menu styling - refined and consistent
|
|
44
|
+
// Shared menu styling - refined and consistent
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
const getMenuPaperStyles = function (anchorWidth) {
|
|
48
|
+
let customStyles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
49
|
+
return {
|
|
50
|
+
sx: _objectSpread({
|
|
51
|
+
"& ul": {
|
|
52
|
+
padding: "4px"
|
|
53
|
+
},
|
|
54
|
+
minWidth: Math.max(anchorWidth || 180, 180),
|
|
55
|
+
width: "auto",
|
|
56
|
+
maxWidth: "320px",
|
|
57
|
+
maxHeight: "400px",
|
|
58
|
+
backgroundColor: "#FAFAFA",
|
|
59
|
+
border: "1px solid rgba(0, 0, 0, 0.08)",
|
|
60
|
+
borderRadius: "8px",
|
|
61
|
+
boxShadow: "0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08)",
|
|
62
|
+
marginTop: "4px",
|
|
63
|
+
overflowY: "auto",
|
|
64
|
+
overflowX: "hidden"
|
|
65
|
+
}, customStyles)
|
|
66
|
+
};
|
|
67
|
+
}; // Shared menu item styling
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
const getMenuItemStyles = isSelected => ({
|
|
71
|
+
borderRadius: "4px",
|
|
72
|
+
padding: "10px 12px",
|
|
73
|
+
margin: "2px 0",
|
|
74
|
+
minHeight: "40px",
|
|
75
|
+
transition: "all 0.15s ease",
|
|
76
|
+
backgroundColor: isSelected ? "rgba(220, 53, 69, 0.08)" : "transparent",
|
|
77
|
+
"&.Mui-selected": {
|
|
78
|
+
backgroundColor: "rgba(220, 53, 69, 0.1)"
|
|
79
|
+
},
|
|
80
|
+
// ":hover": {
|
|
81
|
+
// backgroundColor: "rgba(220, 53, 69, 0.95)",
|
|
82
|
+
// },
|
|
83
|
+
":hover p, :hover .dropdown-item-text": {
|
|
84
|
+
color: "#FFFFFF"
|
|
85
|
+
},
|
|
86
|
+
"&.Mui-selected:hover": {
|
|
87
|
+
backgroundColor: "rgba(220, 53, 69, 0.95)"
|
|
88
|
+
},
|
|
89
|
+
// "&.Mui-selected p, &.Mui-selected .dropdown-item-text": {
|
|
90
|
+
// color: "#DC3545",
|
|
91
|
+
// fontWeight: 500,
|
|
92
|
+
// },
|
|
93
|
+
"& p": {
|
|
94
|
+
transition: "color 0.15s ease"
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const NewDropdown = _ref2 => {
|
|
25
99
|
let {
|
|
26
100
|
buttonTitle,
|
|
27
101
|
buttonLabel,
|
|
@@ -32,78 +106,101 @@ const NewDropdown = _ref => {
|
|
|
32
106
|
startIcon,
|
|
33
107
|
endIcon,
|
|
34
108
|
options
|
|
35
|
-
} =
|
|
109
|
+
} = _ref2;
|
|
36
110
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
37
|
-
const
|
|
111
|
+
const [buttonWidth, setButtonWidth] = React.useState(0);
|
|
112
|
+
const buttonRef = React.useRef(null);
|
|
113
|
+
const open = Boolean(anchorEl); // Measure button width on mount and resize
|
|
38
114
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
115
|
+
React.useEffect(() => {
|
|
116
|
+
const updateWidth = () => {
|
|
117
|
+
if (buttonRef.current) {
|
|
118
|
+
setButtonWidth(buttonRef.current.getBoundingClientRect().width);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
43
121
|
|
|
44
|
-
|
|
122
|
+
updateWidth();
|
|
123
|
+
window.addEventListener("resize", updateWidth);
|
|
124
|
+
return () => window.removeEventListener("resize", updateWidth);
|
|
125
|
+
}, []);
|
|
126
|
+
const handleClick = React.useCallback(event => {
|
|
127
|
+
setAnchorEl(event.currentTarget);
|
|
128
|
+
setButtonWidth(event.currentTarget.getBoundingClientRect().width);
|
|
129
|
+
}, []);
|
|
130
|
+
const handleClose = React.useCallback(() => {
|
|
45
131
|
setAnchorEl(null);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
132
|
+
}, []);
|
|
133
|
+
const handleOptionSelect = React.useCallback(option => {
|
|
134
|
+
handleOptionClicked(option);
|
|
135
|
+
handleClose();
|
|
136
|
+
}, [handleOptionClicked, handleClose]);
|
|
137
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(index.Button, {
|
|
138
|
+
ref: buttonRef,
|
|
139
|
+
onClick: handleClick,
|
|
140
|
+
variant: buttonVariant || "contained",
|
|
51
141
|
color: "waxwing",
|
|
52
|
-
icon: true,
|
|
53
142
|
disableElevation: true,
|
|
54
|
-
|
|
55
|
-
|
|
143
|
+
"aria-haspopup": "listbox",
|
|
144
|
+
"aria-expanded": open,
|
|
145
|
+
sx: _objectSpread({
|
|
146
|
+
borderRadius: "8px",
|
|
56
147
|
color: "notBlack.main",
|
|
57
|
-
padding: "
|
|
148
|
+
padding: "12px 16px",
|
|
58
149
|
position: "relative",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
150
|
+
minWidth: "140px",
|
|
151
|
+
border: open ? "1px solid rgba(220, 53, 69, 0.5)" : "1px solid rgba(0, 0, 0, 0.12)",
|
|
152
|
+
transition: "all 0.2s ease",
|
|
153
|
+
"&:hover": {
|
|
154
|
+
borderColor: "rgba(220, 53, 69, 0.3)",
|
|
155
|
+
backgroundColor: "rgba(250, 250, 250, 1)"
|
|
156
|
+
}
|
|
157
|
+
}, buttonStyle)
|
|
158
|
+
}, buttonLabel && /*#__PURE__*/React__default["default"].createElement(index.Text, {
|
|
62
159
|
noWrap: true,
|
|
63
|
-
fontSize: "
|
|
64
|
-
color: "
|
|
65
|
-
fontWeight: "
|
|
160
|
+
fontSize: "11px",
|
|
161
|
+
color: "whiteOverride.main",
|
|
162
|
+
fontWeight: "500",
|
|
66
163
|
sx: {
|
|
67
164
|
position: "absolute",
|
|
68
|
-
top: "-
|
|
69
|
-
left: "
|
|
70
|
-
padding: "0
|
|
71
|
-
backgroundColor: "inherit"
|
|
165
|
+
top: "-8px",
|
|
166
|
+
left: "12px",
|
|
167
|
+
padding: "0 6px",
|
|
168
|
+
backgroundColor: "inherit",
|
|
169
|
+
letterSpacing: "0.02em",
|
|
170
|
+
textTransform: "uppercase"
|
|
72
171
|
}
|
|
73
|
-
}, buttonLabel), /*#__PURE__*/React__default[
|
|
172
|
+
}, buttonLabel), /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
74
173
|
direction: "row",
|
|
75
174
|
justifyContent: "space-between",
|
|
76
175
|
alignItems: "center",
|
|
77
|
-
width: "100%"
|
|
78
|
-
|
|
176
|
+
width: "100%",
|
|
177
|
+
gap: 1
|
|
178
|
+
}, /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
79
179
|
direction: "row",
|
|
80
180
|
alignItems: "center",
|
|
181
|
+
gap: 1,
|
|
81
182
|
overflow: "hidden",
|
|
82
|
-
|
|
83
|
-
}, startIcon, /*#__PURE__*/React__default[
|
|
84
|
-
alignItems: "flex-start"
|
|
85
|
-
}, /*#__PURE__*/React__default['default'].createElement(index.Text, {
|
|
183
|
+
flex: 1
|
|
184
|
+
}, startIcon, /*#__PURE__*/React__default["default"].createElement(index.Text, {
|
|
86
185
|
noWrap: true,
|
|
87
|
-
fontSize: "
|
|
88
|
-
color: "
|
|
89
|
-
marginRight: "16px"
|
|
90
|
-
}, buttonTitle))), endIcon ? endIcon : /*#__PURE__*/React__default['default'].createElement(KeyboardArrowDownRoundedIcon__default['default'], {
|
|
186
|
+
fontSize: "14px",
|
|
187
|
+
color: "darkscale2.main",
|
|
91
188
|
sx: {
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
189
|
+
fontWeight: 500
|
|
190
|
+
}
|
|
191
|
+
}, buttonTitle)), endIcon || /*#__PURE__*/React__default["default"].createElement(ChevronIcon, {
|
|
192
|
+
isOpen: open,
|
|
193
|
+
color: "rgba(255, 255, 255, 0.54)"
|
|
194
|
+
}))), /*#__PURE__*/React__default["default"].createElement(index.Menu, {
|
|
195
|
+
id: "new-dropdown-menu",
|
|
97
196
|
MenuListProps: {
|
|
98
|
-
"aria-labelledby": "
|
|
197
|
+
"aria-labelledby": "dropdown-button",
|
|
198
|
+
role: "listbox"
|
|
99
199
|
},
|
|
100
200
|
anchorEl: anchorEl,
|
|
101
201
|
open: open,
|
|
102
202
|
onClose: handleClose,
|
|
103
203
|
elevation: 0,
|
|
104
|
-
sx: {
|
|
105
|
-
top: "10px"
|
|
106
|
-
},
|
|
107
204
|
anchorOrigin: {
|
|
108
205
|
vertical: "bottom",
|
|
109
206
|
horizontal: "left"
|
|
@@ -112,47 +209,35 @@ const NewDropdown = _ref => {
|
|
|
112
209
|
vertical: "top",
|
|
113
210
|
horizontal: "left"
|
|
114
211
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
backgroundColor: "waxwing.main",
|
|
122
|
-
boxShadow: "0px 0px 20px #0000001a;",
|
|
123
|
-
...paperStyle
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, options === null || options === void 0 ? void 0 : options.map(option => /*#__PURE__*/React__default['default'].createElement(index.MenuItem, {
|
|
127
|
-
key: "dropdown-".concat(option.name),
|
|
212
|
+
TransitionProps: {
|
|
213
|
+
timeout: 200
|
|
214
|
+
},
|
|
215
|
+
PaperProps: getMenuPaperStyles(buttonWidth, paperStyle)
|
|
216
|
+
}, options === null || options === void 0 ? void 0 : options.map((option, index$1) => /*#__PURE__*/React__default["default"].createElement(index.MenuItem, {
|
|
217
|
+
key: option.id || option.name || "dropdown-".concat(index$1),
|
|
128
218
|
selected: buttonTitle === option.name,
|
|
219
|
+
role: "option",
|
|
220
|
+
"aria-selected": buttonTitle === option.name,
|
|
221
|
+
sx: getMenuItemStyles(buttonTitle === option.name),
|
|
222
|
+
onClick: () => handleOptionSelect(option)
|
|
223
|
+
}, option.startImageIcon && /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
224
|
+
mr: 1,
|
|
225
|
+
alignItems: "center",
|
|
226
|
+
justifyContent: "center"
|
|
227
|
+
}, option.startImageIcon), /*#__PURE__*/React__default["default"].createElement(index.Text, {
|
|
228
|
+
noWrap: true,
|
|
229
|
+
className: "dropdown-item-text",
|
|
129
230
|
sx: {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
backgroundColor: "ibisRed.main"
|
|
133
|
-
},
|
|
134
|
-
":hover": {
|
|
135
|
-
backgroundColor: "ibisRed.main"
|
|
136
|
-
},
|
|
137
|
-
":hover p": {
|
|
138
|
-
color: "white.override"
|
|
139
|
-
},
|
|
140
|
-
"&.Mui-selected:hover": {
|
|
141
|
-
backgroundColor: "ibisRed.main"
|
|
142
|
-
},
|
|
143
|
-
"&.Mui-selected p": {
|
|
144
|
-
color: "white.override"
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
onClick: () => {
|
|
148
|
-
handleOptionClicked(option);
|
|
149
|
-
handleClose();
|
|
231
|
+
fontSize: "14px",
|
|
232
|
+
flex: 1
|
|
150
233
|
}
|
|
151
|
-
}, option.
|
|
152
|
-
|
|
153
|
-
|
|
234
|
+
}, option.name), option.endImageIcon && /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
235
|
+
ml: 1,
|
|
236
|
+
alignItems: "center",
|
|
237
|
+
justifyContent: "center"
|
|
238
|
+
}, option.endImageIcon)))));
|
|
154
239
|
};
|
|
155
|
-
const Dropdown =
|
|
240
|
+
const Dropdown = _ref3 => {
|
|
156
241
|
let {
|
|
157
242
|
buttonTitle,
|
|
158
243
|
buttonLabel,
|
|
@@ -163,72 +248,99 @@ const Dropdown = _ref2 => {
|
|
|
163
248
|
startIcon,
|
|
164
249
|
endIcon,
|
|
165
250
|
options
|
|
166
|
-
} =
|
|
251
|
+
} = _ref3;
|
|
167
252
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
168
|
-
const
|
|
253
|
+
const [buttonWidth, setButtonWidth] = React.useState(0);
|
|
254
|
+
const buttonRef = React.useRef(null);
|
|
255
|
+
const open = Boolean(anchorEl); // Measure button width properly
|
|
169
256
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
257
|
+
React.useEffect(() => {
|
|
258
|
+
const updateWidth = () => {
|
|
259
|
+
if (buttonRef.current) {
|
|
260
|
+
setButtonWidth(buttonRef.current.getBoundingClientRect().width);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
174
263
|
|
|
175
|
-
|
|
264
|
+
updateWidth();
|
|
265
|
+
window.addEventListener("resize", updateWidth);
|
|
266
|
+
return () => window.removeEventListener("resize", updateWidth);
|
|
267
|
+
}, []);
|
|
268
|
+
const handleClick = React.useCallback(event => {
|
|
269
|
+
setAnchorEl(event.currentTarget);
|
|
270
|
+
setButtonWidth(event.currentTarget.getBoundingClientRect().width);
|
|
271
|
+
}, []);
|
|
272
|
+
const handleClose = React.useCallback(() => {
|
|
176
273
|
setAnchorEl(null);
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
274
|
+
}, []);
|
|
275
|
+
const handleOptionSelect = React.useCallback(option => {
|
|
276
|
+
handleOptionClicked(option);
|
|
277
|
+
handleClose();
|
|
278
|
+
}, [handleOptionClicked, handleClose]);
|
|
279
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(index.Button, {
|
|
280
|
+
ref: buttonRef,
|
|
281
|
+
onClick: handleClick,
|
|
282
|
+
variant: buttonVariant || "contained",
|
|
182
283
|
color: "waxwing",
|
|
183
|
-
icon: true,
|
|
184
284
|
disableElevation: true,
|
|
185
|
-
|
|
186
|
-
|
|
285
|
+
"aria-haspopup": "listbox",
|
|
286
|
+
"aria-expanded": open,
|
|
287
|
+
sx: _objectSpread({
|
|
288
|
+
borderRadius: "8px",
|
|
187
289
|
color: "notBlack.main",
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
290
|
+
padding: "8px 12px",
|
|
291
|
+
minWidth: "120px",
|
|
292
|
+
border: open ? "1px solid rgba(220, 53, 69, 0.5)" : "1px solid rgba(0, 0, 0, 0.08)",
|
|
293
|
+
transition: "all 0.2s ease",
|
|
294
|
+
"&:hover": {
|
|
295
|
+
borderColor: "rgba(220, 53, 69, 0.25)",
|
|
296
|
+
backgroundColor: "rgba(250, 250, 250, 1)"
|
|
297
|
+
}
|
|
298
|
+
}, buttonStyle)
|
|
299
|
+
}, /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
193
300
|
direction: "row",
|
|
194
301
|
justifyContent: "space-between",
|
|
195
302
|
alignItems: "center",
|
|
196
|
-
width: "100%"
|
|
197
|
-
|
|
303
|
+
width: "100%",
|
|
304
|
+
gap: 1
|
|
305
|
+
}, /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
198
306
|
direction: "row",
|
|
199
307
|
alignItems: "center",
|
|
308
|
+
gap: 1.5,
|
|
200
309
|
overflow: "hidden",
|
|
201
|
-
|
|
202
|
-
}, startIcon, /*#__PURE__*/React__default[
|
|
310
|
+
flex: 1
|
|
311
|
+
}, startIcon, /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
203
312
|
alignItems: "flex-start",
|
|
204
|
-
|
|
205
|
-
}, buttonLabel && /*#__PURE__*/React__default[
|
|
313
|
+
overflow: "hidden"
|
|
314
|
+
}, buttonLabel && /*#__PURE__*/React__default["default"].createElement(index.Text, {
|
|
206
315
|
noWrap: true,
|
|
207
|
-
fontSize: "
|
|
316
|
+
fontSize: "10px",
|
|
208
317
|
color: "grey4.main",
|
|
209
|
-
fontWeight: "
|
|
210
|
-
|
|
318
|
+
fontWeight: "500",
|
|
319
|
+
sx: {
|
|
320
|
+
letterSpacing: "0.04em",
|
|
321
|
+
textTransform: "uppercase",
|
|
322
|
+
marginBottom: "-2px"
|
|
323
|
+
}
|
|
324
|
+
}, buttonLabel), /*#__PURE__*/React__default["default"].createElement(index.Text, {
|
|
211
325
|
noWrap: true,
|
|
212
326
|
fontSize: "14px",
|
|
213
327
|
color: "grey5.main",
|
|
214
|
-
marginRight: "16px"
|
|
215
|
-
}, buttonTitle))), endIcon ? endIcon : /*#__PURE__*/React__default['default'].createElement(KeyboardArrowDownRoundedIcon__default['default'], {
|
|
216
328
|
sx: {
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
329
|
+
fontWeight: 500
|
|
330
|
+
}
|
|
331
|
+
}, buttonTitle))), endIcon || /*#__PURE__*/React__default["default"].createElement(ChevronIcon, {
|
|
332
|
+
isOpen: open,
|
|
333
|
+
color: "rgba(0, 0, 0, 0.54)"
|
|
334
|
+
}))), /*#__PURE__*/React__default["default"].createElement(index.Menu, {
|
|
335
|
+
id: "dropdown-menu",
|
|
222
336
|
MenuListProps: {
|
|
223
|
-
"aria-labelledby": "
|
|
337
|
+
"aria-labelledby": "dropdown-button",
|
|
338
|
+
role: "listbox"
|
|
224
339
|
},
|
|
225
340
|
anchorEl: anchorEl,
|
|
226
341
|
open: open,
|
|
227
342
|
onClose: handleClose,
|
|
228
343
|
elevation: 0,
|
|
229
|
-
sx: {
|
|
230
|
-
top: "10px"
|
|
231
|
-
},
|
|
232
344
|
anchorOrigin: {
|
|
233
345
|
vertical: "bottom",
|
|
234
346
|
horizontal: "left"
|
|
@@ -237,47 +349,35 @@ const Dropdown = _ref2 => {
|
|
|
237
349
|
vertical: "top",
|
|
238
350
|
horizontal: "left"
|
|
239
351
|
},
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
backgroundColor: "waxwing.main",
|
|
247
|
-
boxShadow: "0px 0px 20px #0000001a;",
|
|
248
|
-
...paperStyle
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}, options === null || options === void 0 ? void 0 : options.map(option => /*#__PURE__*/React__default['default'].createElement(index.MenuItem, {
|
|
252
|
-
key: "dropdown-".concat(option.name),
|
|
352
|
+
TransitionProps: {
|
|
353
|
+
timeout: 200
|
|
354
|
+
},
|
|
355
|
+
PaperProps: getMenuPaperStyles(buttonWidth, paperStyle)
|
|
356
|
+
}, options === null || options === void 0 ? void 0 : options.map((option, index$1) => /*#__PURE__*/React__default["default"].createElement(index.MenuItem, {
|
|
357
|
+
key: option.id || option.name || "dropdown-".concat(index$1),
|
|
253
358
|
selected: buttonTitle === option.name,
|
|
359
|
+
role: "option",
|
|
360
|
+
"aria-selected": buttonTitle === option.name,
|
|
361
|
+
sx: getMenuItemStyles(buttonTitle === option.name),
|
|
362
|
+
onClick: () => handleOptionSelect(option)
|
|
363
|
+
}, option.startImageIcon && /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
364
|
+
mr: 1,
|
|
365
|
+
alignItems: "center",
|
|
366
|
+
justifyContent: "center"
|
|
367
|
+
}, option.startImageIcon), /*#__PURE__*/React__default["default"].createElement(index.Text, {
|
|
368
|
+
noWrap: true,
|
|
369
|
+
className: "dropdown-item-text",
|
|
254
370
|
sx: {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
backgroundColor: "ibisRed.main"
|
|
258
|
-
},
|
|
259
|
-
":hover": {
|
|
260
|
-
backgroundColor: "ibisRed.main"
|
|
261
|
-
},
|
|
262
|
-
":hover p": {
|
|
263
|
-
color: "white.override"
|
|
264
|
-
},
|
|
265
|
-
"&.Mui-selected:hover": {
|
|
266
|
-
backgroundColor: "ibisRed.main"
|
|
267
|
-
},
|
|
268
|
-
"&.Mui-selected p": {
|
|
269
|
-
color: "white.override"
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
onClick: () => {
|
|
273
|
-
handleOptionClicked(option);
|
|
274
|
-
handleClose();
|
|
371
|
+
fontSize: "14px",
|
|
372
|
+
flex: 1
|
|
275
373
|
}
|
|
276
|
-
}, option.
|
|
277
|
-
|
|
278
|
-
|
|
374
|
+
}, option.name), option.endImageIcon && /*#__PURE__*/React__default["default"].createElement(index.Stack, {
|
|
375
|
+
ml: 1,
|
|
376
|
+
alignItems: "center",
|
|
377
|
+
justifyContent: "center"
|
|
378
|
+
}, option.endImageIcon)))));
|
|
279
379
|
};
|
|
280
380
|
|
|
281
381
|
exports.Dropdown = Dropdown;
|
|
282
382
|
exports.NewDropdown = NewDropdown;
|
|
283
|
-
exports
|
|
383
|
+
exports["default"] = Dropdown;
|