@blerp/design 1.3.17 → 1.4.2
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 +92 -58
- package/dist/cjs/neo-components/Autocomplete.js +285 -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 +495 -0
- package/dist/cjs/neo-components/Layout.js +1214 -0
- package/dist/cjs/neo-components/Misc.js +868 -0
- package/dist/cjs/neo-components/Navigation.js +1616 -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 +171 -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 +32 -2
- package/dist/esm/neo-components/Autocomplete.js +274 -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 +480 -0
- package/dist/esm/neo-components/Layout.js +1180 -0
- package/dist/esm/neo-components/Misc.js +850 -0
- package/dist/esm/neo-components/Navigation.js +1594 -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 +160 -0
- package/dist/esm/neo-utils/sxToStyle.js +502 -0
- package/package.json +19 -15
|
@@ -0,0 +1,868 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var ReactDOM = require('react-dom');
|
|
10
|
+
var withSx = require('./withSx.js');
|
|
11
|
+
var ThemeProvider = require('./ThemeProvider.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
16
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
17
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
|
|
20
|
+
const _excluded = ["orientation", "variant", "flexItem", "light", "textAlign", "children", "component", "style"],
|
|
21
|
+
_excluded2 = ["label", "variant", "color", "size", "disabled", "clickable", "deletable", "onDelete", "onClick", "avatar", "icon", "deleteIcon", "selected", "selectedColor", "selectedTextColor", "style"],
|
|
22
|
+
_excluded3 = ["alt", "src", "srcSet", "sizes", "variant", "children", "imgProps", "style"],
|
|
23
|
+
_excluded4 = ["badgeContent", "color", "variant", "overlap", "anchorOrigin", "invisible", "max", "showZero", "children", "style"],
|
|
24
|
+
_excluded5 = ["title", "placement", "arrow", "enterDelay", "leaveDelay", "children", "open", "onOpen", "onClose", "disablePortal", "PopperProps", "componentsProps"],
|
|
25
|
+
_excluded6 = ["variant", "value", "valueBuffer", "color", "style"],
|
|
26
|
+
_excluded7 = ["variant", "animation", "width", "height", "children", "style"],
|
|
27
|
+
_excluded8 = ["color", "underline", "component", "href", "children", "style"];
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
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; }
|
|
32
|
+
|
|
33
|
+
const canUseDOM = () => typeof window !== 'undefined' && typeof document !== 'undefined'; // Use useLayoutEffect only on client, useEffect on server
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const useIsomorphicLayoutEffect = canUseDOM() ? React.useLayoutEffect : React.useEffect;
|
|
37
|
+
/**
|
|
38
|
+
* Divider - Visual separator (replaces MUI Divider)
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
const BaseDivider = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
42
|
+
let {
|
|
43
|
+
orientation = "horizontal",
|
|
44
|
+
variant = "fullWidth",
|
|
45
|
+
flexItem = false,
|
|
46
|
+
light = false,
|
|
47
|
+
textAlign = "center",
|
|
48
|
+
children,
|
|
49
|
+
component,
|
|
50
|
+
style
|
|
51
|
+
} = _ref,
|
|
52
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
53
|
+
|
|
54
|
+
const hasChildren = Boolean(children);
|
|
55
|
+
const Component = component || (hasChildren ? "div" : "hr");
|
|
56
|
+
|
|
57
|
+
const dividerStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
58
|
+
margin: 0,
|
|
59
|
+
flexShrink: 0,
|
|
60
|
+
borderWidth: 0,
|
|
61
|
+
borderStyle: "solid",
|
|
62
|
+
borderColor: light ? "rgba(255, 255, 255, 0.12)" : "var(--border-color, rgba(0, 0, 0, 0.12))"
|
|
63
|
+
}, orientation === "horizontal" && !hasChildren && _objectSpread(_objectSpread({
|
|
64
|
+
borderBottomWidth: "thin"
|
|
65
|
+
}, variant === "inset" && {
|
|
66
|
+
marginLeft: "72px"
|
|
67
|
+
}), variant === "middle" && {
|
|
68
|
+
marginLeft: "16px",
|
|
69
|
+
marginRight: "16px"
|
|
70
|
+
})), orientation === "vertical" && _objectSpread({
|
|
71
|
+
height: "auto",
|
|
72
|
+
alignSelf: "stretch",
|
|
73
|
+
borderRightWidth: "thin"
|
|
74
|
+
}, variant === "middle" && {
|
|
75
|
+
marginTop: "8px",
|
|
76
|
+
marginBottom: "8px"
|
|
77
|
+
})), flexItem && {
|
|
78
|
+
alignSelf: "stretch",
|
|
79
|
+
height: "auto"
|
|
80
|
+
}), hasChildren && {
|
|
81
|
+
display: "flex",
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
border: 0
|
|
84
|
+
}), style);
|
|
85
|
+
|
|
86
|
+
if (hasChildren) {
|
|
87
|
+
return /*#__PURE__*/React__default["default"].createElement(Component, _extends__default["default"]({
|
|
88
|
+
ref: ref,
|
|
89
|
+
role: "separator",
|
|
90
|
+
style: dividerStyle
|
|
91
|
+
}, props), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
92
|
+
style: _objectSpread({
|
|
93
|
+
flex: 1,
|
|
94
|
+
borderTop: "thin solid var(--border-color, rgba(0, 0, 0, 0.12))"
|
|
95
|
+
}, textAlign === "left" && {
|
|
96
|
+
flex: 0,
|
|
97
|
+
width: "10%"
|
|
98
|
+
})
|
|
99
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
100
|
+
style: _objectSpread(_objectSpread({
|
|
101
|
+
padding: "0 16px"
|
|
102
|
+
}, textAlign === "left" && {
|
|
103
|
+
paddingLeft: "8px"
|
|
104
|
+
}), textAlign === "right" && {
|
|
105
|
+
paddingRight: "8px"
|
|
106
|
+
})
|
|
107
|
+
}, children), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
108
|
+
style: _objectSpread({
|
|
109
|
+
flex: 1,
|
|
110
|
+
borderTop: "thin solid var(--border-color, rgba(0, 0, 0, 0.12))"
|
|
111
|
+
}, textAlign === "right" && {
|
|
112
|
+
flex: 0,
|
|
113
|
+
width: "10%"
|
|
114
|
+
})
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return /*#__PURE__*/React__default["default"].createElement(Component, _extends__default["default"]({
|
|
119
|
+
ref: ref,
|
|
120
|
+
role: "separator",
|
|
121
|
+
style: dividerStyle
|
|
122
|
+
}, props));
|
|
123
|
+
});
|
|
124
|
+
BaseDivider.displayName = "BaseDivider";
|
|
125
|
+
const Divider = withSx.withSx(BaseDivider);
|
|
126
|
+
/**
|
|
127
|
+
* Chip - Compact element for inputs, attributes, or actions (replaces MUI Chip)
|
|
128
|
+
*
|
|
129
|
+
* New props for selection support:
|
|
130
|
+
* - selected: boolean - whether the chip is in selected state
|
|
131
|
+
* - selectedColor: string - theme color to use when selected (default: "primary")
|
|
132
|
+
* - selectedTextColor: string - text color when selected (optional override)
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
const BaseChip = /*#__PURE__*/React__default["default"].forwardRef((_ref2, ref) => {
|
|
136
|
+
var _colors$selectedTextC, _avatar$props, _icon$props;
|
|
137
|
+
|
|
138
|
+
let {
|
|
139
|
+
label,
|
|
140
|
+
variant = "filled",
|
|
141
|
+
color = "default",
|
|
142
|
+
size = "medium",
|
|
143
|
+
disabled = false,
|
|
144
|
+
clickable,
|
|
145
|
+
deletable,
|
|
146
|
+
onDelete,
|
|
147
|
+
onClick,
|
|
148
|
+
avatar,
|
|
149
|
+
icon,
|
|
150
|
+
deleteIcon,
|
|
151
|
+
selected,
|
|
152
|
+
selectedColor = "primary",
|
|
153
|
+
selectedTextColor,
|
|
154
|
+
style
|
|
155
|
+
} = _ref2,
|
|
156
|
+
props = _objectWithoutProperties__default["default"](_ref2, _excluded2);
|
|
157
|
+
|
|
158
|
+
const {
|
|
159
|
+
colors
|
|
160
|
+
} = ThemeProvider.useTheme();
|
|
161
|
+
|
|
162
|
+
const getColor = colorName => {
|
|
163
|
+
if (colorName === "default") return {
|
|
164
|
+
bg: "rgba(0, 0, 0, 0.08)",
|
|
165
|
+
text: "var(--body-text)"
|
|
166
|
+
};
|
|
167
|
+
const colorValue = colors[colorName];
|
|
168
|
+
|
|
169
|
+
if (typeof colorValue === "object") {
|
|
170
|
+
return {
|
|
171
|
+
bg: colorValue.main,
|
|
172
|
+
text: colorValue.contrastText || "#fff"
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
bg: colorValue || "rgba(0, 0, 0, 0.08)",
|
|
178
|
+
text: "#fff"
|
|
179
|
+
};
|
|
180
|
+
}; // Use selectedColor when selected, otherwise use color
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
const activeColor = selected ? selectedColor : color;
|
|
184
|
+
const {
|
|
185
|
+
bg,
|
|
186
|
+
text
|
|
187
|
+
} = getColor(activeColor); // Allow override of text color when selected
|
|
188
|
+
|
|
189
|
+
const finalTextColor = selected && selectedTextColor ? ((_colors$selectedTextC = colors[selectedTextColor]) === null || _colors$selectedTextC === void 0 ? void 0 : _colors$selectedTextC.main) || colors[selectedTextColor] || selectedTextColor : text;
|
|
190
|
+
|
|
191
|
+
const chipStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
192
|
+
display: "inline-flex",
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
justifyContent: "center",
|
|
195
|
+
height: size === "small" ? "24px" : "32px",
|
|
196
|
+
fontSize: size === "small" ? "0.8125rem" : "0.875rem",
|
|
197
|
+
borderRadius: "16px",
|
|
198
|
+
whiteSpace: "nowrap",
|
|
199
|
+
cursor: clickable || onClick ? "pointer" : "default",
|
|
200
|
+
outline: 0,
|
|
201
|
+
textDecoration: "none",
|
|
202
|
+
border: 0,
|
|
203
|
+
padding: 0,
|
|
204
|
+
verticalAlign: "middle",
|
|
205
|
+
boxSizing: "border-box",
|
|
206
|
+
transition: "background-color 300ms, border-color 300ms, color 300ms"
|
|
207
|
+
}, variant === "filled" && {
|
|
208
|
+
backgroundColor: bg,
|
|
209
|
+
color: activeColor === "default" ? "var(--body-text)" : finalTextColor
|
|
210
|
+
}), variant === "outlined" && {
|
|
211
|
+
backgroundColor: selected ? bg : "transparent",
|
|
212
|
+
border: "1px solid ".concat(activeColor === "default" ? "var(--border-color)" : bg),
|
|
213
|
+
color: activeColor === "default" ? "var(--body-text)" : selected ? finalTextColor : bg
|
|
214
|
+
}), disabled && {
|
|
215
|
+
opacity: 0.5,
|
|
216
|
+
pointerEvents: "none"
|
|
217
|
+
}), style);
|
|
218
|
+
|
|
219
|
+
const labelStyle = _objectSpread(_objectSpread({
|
|
220
|
+
overflow: "hidden",
|
|
221
|
+
textOverflow: "ellipsis",
|
|
222
|
+
paddingLeft: "12px",
|
|
223
|
+
paddingRight: "12px",
|
|
224
|
+
whiteSpace: "nowrap"
|
|
225
|
+
}, (avatar || icon) && {
|
|
226
|
+
paddingLeft: "8px"
|
|
227
|
+
}), (deletable || onDelete) && {
|
|
228
|
+
paddingRight: "8px"
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
const iconStyle = {
|
|
232
|
+
marginLeft: "5px",
|
|
233
|
+
marginRight: "-6px",
|
|
234
|
+
width: size === "small" ? "18px" : "24px",
|
|
235
|
+
height: size === "small" ? "18px" : "24px"
|
|
236
|
+
};
|
|
237
|
+
const deleteIconStyle = {
|
|
238
|
+
cursor: "pointer",
|
|
239
|
+
marginLeft: "-6px",
|
|
240
|
+
marginRight: "5px",
|
|
241
|
+
width: size === "small" ? "18px" : "22px",
|
|
242
|
+
height: size === "small" ? "18px" : "22px",
|
|
243
|
+
opacity: 0.7
|
|
244
|
+
};
|
|
245
|
+
const Component = onClick ? "button" : "div";
|
|
246
|
+
return /*#__PURE__*/React__default["default"].createElement(Component, _extends__default["default"]({
|
|
247
|
+
ref: ref,
|
|
248
|
+
style: chipStyle,
|
|
249
|
+
onClick: onClick,
|
|
250
|
+
disabled: disabled
|
|
251
|
+
}, props), avatar && /*#__PURE__*/React__default["default"].cloneElement(avatar, {
|
|
252
|
+
style: _objectSpread(_objectSpread({}, iconStyle), (_avatar$props = avatar.props) === null || _avatar$props === void 0 ? void 0 : _avatar$props.style)
|
|
253
|
+
}), !avatar && icon && /*#__PURE__*/React__default["default"].cloneElement(icon, {
|
|
254
|
+
style: _objectSpread(_objectSpread({}, iconStyle), (_icon$props = icon.props) === null || _icon$props === void 0 ? void 0 : _icon$props.style)
|
|
255
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
256
|
+
style: labelStyle
|
|
257
|
+
}, label), (deletable || onDelete) && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
258
|
+
style: deleteIconStyle,
|
|
259
|
+
onClick: e => {
|
|
260
|
+
e.stopPropagation();
|
|
261
|
+
onDelete === null || onDelete === void 0 ? void 0 : onDelete(e);
|
|
262
|
+
},
|
|
263
|
+
role: "button",
|
|
264
|
+
tabIndex: 0
|
|
265
|
+
}, deleteIcon || "✕"));
|
|
266
|
+
});
|
|
267
|
+
BaseChip.displayName = "BaseChip";
|
|
268
|
+
const Chip = withSx.withSx(BaseChip);
|
|
269
|
+
/**
|
|
270
|
+
* Avatar - Circular image/icon/letter display (replaces MUI Avatar)
|
|
271
|
+
*/
|
|
272
|
+
|
|
273
|
+
const BaseAvatar = /*#__PURE__*/React__default["default"].forwardRef((_ref3, ref) => {
|
|
274
|
+
let {
|
|
275
|
+
alt,
|
|
276
|
+
src,
|
|
277
|
+
srcSet,
|
|
278
|
+
sizes,
|
|
279
|
+
variant = "circular",
|
|
280
|
+
children,
|
|
281
|
+
imgProps,
|
|
282
|
+
style
|
|
283
|
+
} = _ref3,
|
|
284
|
+
props = _objectWithoutProperties__default["default"](_ref3, _excluded3);
|
|
285
|
+
|
|
286
|
+
const [hasError, setHasError] = React__default["default"].useState(false);
|
|
287
|
+
|
|
288
|
+
const avatarStyle = _objectSpread({
|
|
289
|
+
position: "relative",
|
|
290
|
+
display: "flex",
|
|
291
|
+
alignItems: "center",
|
|
292
|
+
justifyContent: "center",
|
|
293
|
+
flexShrink: 0,
|
|
294
|
+
width: "40px",
|
|
295
|
+
height: "40px",
|
|
296
|
+
fontSize: "1.25rem",
|
|
297
|
+
lineHeight: 1,
|
|
298
|
+
borderRadius: variant === "circular" ? "50%" : variant === "rounded" ? "4px" : 0,
|
|
299
|
+
overflow: "hidden",
|
|
300
|
+
userSelect: "none",
|
|
301
|
+
color: "#fff",
|
|
302
|
+
backgroundColor: "#bdbdbd"
|
|
303
|
+
}, style);
|
|
304
|
+
|
|
305
|
+
const imgStyle = {
|
|
306
|
+
width: "100%",
|
|
307
|
+
height: "100%",
|
|
308
|
+
textAlign: "center",
|
|
309
|
+
objectFit: "cover",
|
|
310
|
+
color: "transparent",
|
|
311
|
+
textIndent: "10000px"
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
const getInitials = () => {
|
|
315
|
+
var _alt$;
|
|
316
|
+
|
|
317
|
+
if (!alt) return null;
|
|
318
|
+
const names = alt.split(" ");
|
|
319
|
+
|
|
320
|
+
if (names.length >= 2) {
|
|
321
|
+
return "".concat(names[0][0]).concat(names[1][0]).toUpperCase();
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return (_alt$ = alt[0]) === null || _alt$ === void 0 ? void 0 : _alt$.toUpperCase();
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
|
|
328
|
+
ref: ref,
|
|
329
|
+
style: avatarStyle
|
|
330
|
+
}, props), src && !hasError ? /*#__PURE__*/React__default["default"].createElement("img", _extends__default["default"]({
|
|
331
|
+
alt: alt,
|
|
332
|
+
src: src,
|
|
333
|
+
srcSet: srcSet,
|
|
334
|
+
sizes: sizes,
|
|
335
|
+
style: imgStyle,
|
|
336
|
+
onError: () => setHasError(true)
|
|
337
|
+
}, imgProps)) : children || getInitials());
|
|
338
|
+
});
|
|
339
|
+
BaseAvatar.displayName = "BaseAvatar";
|
|
340
|
+
const Avatar = withSx.withSx(BaseAvatar);
|
|
341
|
+
/**
|
|
342
|
+
* Badge - Small count/indicator overlay (replaces MUI Badge)
|
|
343
|
+
*/
|
|
344
|
+
|
|
345
|
+
const BaseBadge = /*#__PURE__*/React__default["default"].forwardRef((_ref4, ref) => {
|
|
346
|
+
let {
|
|
347
|
+
badgeContent,
|
|
348
|
+
color = "default",
|
|
349
|
+
variant = "standard",
|
|
350
|
+
overlap = "rectangular",
|
|
351
|
+
anchorOrigin = {
|
|
352
|
+
vertical: "top",
|
|
353
|
+
horizontal: "right"
|
|
354
|
+
},
|
|
355
|
+
invisible = false,
|
|
356
|
+
max = 99,
|
|
357
|
+
showZero = false,
|
|
358
|
+
children,
|
|
359
|
+
style
|
|
360
|
+
} = _ref4,
|
|
361
|
+
props = _objectWithoutProperties__default["default"](_ref4, _excluded4);
|
|
362
|
+
|
|
363
|
+
const {
|
|
364
|
+
colors
|
|
365
|
+
} = ThemeProvider.useTheme();
|
|
366
|
+
|
|
367
|
+
const getColor = () => {
|
|
368
|
+
if (color === "default") return {
|
|
369
|
+
bg: "#bdbdbd",
|
|
370
|
+
text: "#fff"
|
|
371
|
+
};
|
|
372
|
+
const colorValue = colors[color];
|
|
373
|
+
|
|
374
|
+
if (typeof colorValue === "object") {
|
|
375
|
+
return {
|
|
376
|
+
bg: colorValue.main,
|
|
377
|
+
text: colorValue.contrastText || "#fff"
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return {
|
|
382
|
+
bg: colorValue || "#bdbdbd",
|
|
383
|
+
text: "#fff"
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
const {
|
|
388
|
+
bg,
|
|
389
|
+
text
|
|
390
|
+
} = getColor();
|
|
391
|
+
const shouldHide = invisible || badgeContent === 0 && !showZero;
|
|
392
|
+
const displayValue = typeof badgeContent === "number" && badgeContent > max ? "".concat(max, "+") : badgeContent;
|
|
393
|
+
|
|
394
|
+
const containerStyle = _objectSpread({
|
|
395
|
+
position: "relative",
|
|
396
|
+
display: "inline-flex",
|
|
397
|
+
verticalAlign: "middle",
|
|
398
|
+
flexShrink: 0
|
|
399
|
+
}, style);
|
|
400
|
+
|
|
401
|
+
const badgeStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
402
|
+
display: shouldHide ? "none" : "flex",
|
|
403
|
+
flexDirection: "row",
|
|
404
|
+
flexWrap: "wrap",
|
|
405
|
+
justifyContent: "center",
|
|
406
|
+
alignContent: "center",
|
|
407
|
+
alignItems: "center",
|
|
408
|
+
position: "absolute",
|
|
409
|
+
boxSizing: "border-box",
|
|
410
|
+
fontFamily: "inherit",
|
|
411
|
+
fontWeight: 500,
|
|
412
|
+
fontSize: "0.75rem",
|
|
413
|
+
lineHeight: 1,
|
|
414
|
+
zIndex: 1,
|
|
415
|
+
transition: "transform 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
416
|
+
backgroundColor: bg,
|
|
417
|
+
color: text
|
|
418
|
+
}, variant === "standard" && {
|
|
419
|
+
minWidth: "20px",
|
|
420
|
+
height: "20px",
|
|
421
|
+
padding: "0 6px",
|
|
422
|
+
borderRadius: "10px"
|
|
423
|
+
}), variant === "dot" && {
|
|
424
|
+
width: "8px",
|
|
425
|
+
height: "8px",
|
|
426
|
+
borderRadius: "4px",
|
|
427
|
+
padding: 0
|
|
428
|
+
}), anchorOrigin.vertical === "top" && {
|
|
429
|
+
top: 0
|
|
430
|
+
}), anchorOrigin.vertical === "bottom" && {
|
|
431
|
+
bottom: 0
|
|
432
|
+
}), anchorOrigin.horizontal === "right" && {
|
|
433
|
+
right: 0
|
|
434
|
+
}), anchorOrigin.horizontal === "left" && {
|
|
435
|
+
left: 0
|
|
436
|
+
}), {}, {
|
|
437
|
+
transform: "scale(1) translate(".concat(anchorOrigin.horizontal === "right" ? "50%" : "-50%", ", ").concat(anchorOrigin.vertical === "top" ? "-50%" : "50%", ")"),
|
|
438
|
+
transformOrigin: "".concat(anchorOrigin.horizontal === "right" ? "100%" : "0%", " ").concat(anchorOrigin.vertical === "top" ? "0%" : "100%")
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
return /*#__PURE__*/React__default["default"].createElement("span", _extends__default["default"]({
|
|
442
|
+
ref: ref,
|
|
443
|
+
style: containerStyle
|
|
444
|
+
}, props), children, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
445
|
+
style: badgeStyle
|
|
446
|
+
}, variant !== "dot" && displayValue));
|
|
447
|
+
});
|
|
448
|
+
BaseBadge.displayName = "BaseBadge";
|
|
449
|
+
const Badge = withSx.withSx(BaseBadge);
|
|
450
|
+
/**
|
|
451
|
+
* Tooltip - Informative text on hover (replaces MUI Tooltip)
|
|
452
|
+
* Uses portal for proper positioning regardless of parent overflow/transform
|
|
453
|
+
*/
|
|
454
|
+
|
|
455
|
+
const BaseTooltip = /*#__PURE__*/React__default["default"].forwardRef((_ref5, ref) => {
|
|
456
|
+
var _componentsProps$tool, _componentsProps$tool2, _PopperProps$sx, _componentsProps$tool3;
|
|
457
|
+
|
|
458
|
+
let {
|
|
459
|
+
title,
|
|
460
|
+
placement = "bottom",
|
|
461
|
+
arrow = false,
|
|
462
|
+
enterDelay = 100,
|
|
463
|
+
leaveDelay = 0,
|
|
464
|
+
children,
|
|
465
|
+
open: controlledOpen,
|
|
466
|
+
onOpen,
|
|
467
|
+
onClose,
|
|
468
|
+
disablePortal = false,
|
|
469
|
+
PopperProps = {},
|
|
470
|
+
componentsProps = {}
|
|
471
|
+
} = _ref5;
|
|
472
|
+
_objectWithoutProperties__default["default"](_ref5, _excluded5);
|
|
473
|
+
|
|
474
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
475
|
+
const [position, setPosition] = React.useState({
|
|
476
|
+
top: 0,
|
|
477
|
+
left: 0
|
|
478
|
+
});
|
|
479
|
+
const [mounted, setMounted] = React.useState(false);
|
|
480
|
+
const timeoutRef = React.useRef(null);
|
|
481
|
+
const childRef = React.useRef(null);
|
|
482
|
+
const tooltipRef = React.useRef(null);
|
|
483
|
+
const open = controlledOpen !== undefined ? controlledOpen : isOpen; // SSR safety - only mount portal after hydration
|
|
484
|
+
|
|
485
|
+
React.useEffect(() => {
|
|
486
|
+
setMounted(true);
|
|
487
|
+
}, []); // Calculate position based on child element and placement
|
|
488
|
+
|
|
489
|
+
const updatePosition = React.useCallback(() => {
|
|
490
|
+
if (!canUseDOM() || !childRef.current) return;
|
|
491
|
+
const childRect = childRef.current.getBoundingClientRect();
|
|
492
|
+
const tooltipEl = tooltipRef.current;
|
|
493
|
+
const tooltipRect = tooltipEl ? tooltipEl.getBoundingClientRect() : {
|
|
494
|
+
width: 0,
|
|
495
|
+
height: 0
|
|
496
|
+
};
|
|
497
|
+
const gap = 8; // Space between element and tooltip
|
|
498
|
+
|
|
499
|
+
let top = 0;
|
|
500
|
+
let left = 0;
|
|
501
|
+
|
|
502
|
+
switch (placement) {
|
|
503
|
+
case 'top':
|
|
504
|
+
top = childRect.top - tooltipRect.height - gap;
|
|
505
|
+
left = childRect.left + (childRect.width - tooltipRect.width) / 2;
|
|
506
|
+
break;
|
|
507
|
+
|
|
508
|
+
case 'top-start':
|
|
509
|
+
top = childRect.top - tooltipRect.height - gap;
|
|
510
|
+
left = childRect.left;
|
|
511
|
+
break;
|
|
512
|
+
|
|
513
|
+
case 'top-end':
|
|
514
|
+
top = childRect.top - tooltipRect.height - gap;
|
|
515
|
+
left = childRect.right - tooltipRect.width;
|
|
516
|
+
break;
|
|
517
|
+
|
|
518
|
+
case 'bottom':
|
|
519
|
+
top = childRect.bottom + gap;
|
|
520
|
+
left = childRect.left + (childRect.width - tooltipRect.width) / 2;
|
|
521
|
+
break;
|
|
522
|
+
|
|
523
|
+
case 'bottom-start':
|
|
524
|
+
top = childRect.bottom + gap;
|
|
525
|
+
left = childRect.left;
|
|
526
|
+
break;
|
|
527
|
+
|
|
528
|
+
case 'bottom-end':
|
|
529
|
+
top = childRect.bottom + gap;
|
|
530
|
+
left = childRect.right - tooltipRect.width;
|
|
531
|
+
break;
|
|
532
|
+
|
|
533
|
+
case 'left':
|
|
534
|
+
top = childRect.top + (childRect.height - tooltipRect.height) / 2;
|
|
535
|
+
left = childRect.left - tooltipRect.width - gap;
|
|
536
|
+
break;
|
|
537
|
+
|
|
538
|
+
case 'left-start':
|
|
539
|
+
top = childRect.top;
|
|
540
|
+
left = childRect.left - tooltipRect.width - gap;
|
|
541
|
+
break;
|
|
542
|
+
|
|
543
|
+
case 'left-end':
|
|
544
|
+
top = childRect.bottom - tooltipRect.height;
|
|
545
|
+
left = childRect.left - tooltipRect.width - gap;
|
|
546
|
+
break;
|
|
547
|
+
|
|
548
|
+
case 'right':
|
|
549
|
+
top = childRect.top + (childRect.height - tooltipRect.height) / 2;
|
|
550
|
+
left = childRect.right + gap;
|
|
551
|
+
break;
|
|
552
|
+
|
|
553
|
+
case 'right-start':
|
|
554
|
+
top = childRect.top;
|
|
555
|
+
left = childRect.right + gap;
|
|
556
|
+
break;
|
|
557
|
+
|
|
558
|
+
case 'right-end':
|
|
559
|
+
top = childRect.bottom - tooltipRect.height;
|
|
560
|
+
left = childRect.right + gap;
|
|
561
|
+
break;
|
|
562
|
+
|
|
563
|
+
default:
|
|
564
|
+
top = childRect.bottom + gap;
|
|
565
|
+
left = childRect.left + (childRect.width - tooltipRect.width) / 2;
|
|
566
|
+
} // Keep within viewport
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
const padding = 8;
|
|
570
|
+
const viewportWidth = window.innerWidth;
|
|
571
|
+
const viewportHeight = window.innerHeight;
|
|
572
|
+
if (left < padding) left = padding;
|
|
573
|
+
|
|
574
|
+
if (left + tooltipRect.width > viewportWidth - padding) {
|
|
575
|
+
left = viewportWidth - tooltipRect.width - padding;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
if (top < padding) top = padding;
|
|
579
|
+
|
|
580
|
+
if (top + tooltipRect.height > viewportHeight - padding) {
|
|
581
|
+
top = viewportHeight - tooltipRect.height - padding;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
setPosition({
|
|
585
|
+
top,
|
|
586
|
+
left
|
|
587
|
+
});
|
|
588
|
+
}, [placement]); // Update position when open changes or on scroll/resize
|
|
589
|
+
|
|
590
|
+
useIsomorphicLayoutEffect(() => {
|
|
591
|
+
if (!canUseDOM() || !open) return;
|
|
592
|
+
updatePosition(); // Update position on scroll and resize
|
|
593
|
+
|
|
594
|
+
window.addEventListener('scroll', updatePosition, true);
|
|
595
|
+
window.addEventListener('resize', updatePosition);
|
|
596
|
+
return () => {
|
|
597
|
+
window.removeEventListener('scroll', updatePosition, true);
|
|
598
|
+
window.removeEventListener('resize', updatePosition);
|
|
599
|
+
};
|
|
600
|
+
}, [open, updatePosition]); // Re-calculate after tooltip renders (to get accurate dimensions)
|
|
601
|
+
|
|
602
|
+
React.useEffect(() => {
|
|
603
|
+
if (open && tooltipRef.current) {
|
|
604
|
+
updatePosition();
|
|
605
|
+
}
|
|
606
|
+
}, [open, updatePosition]);
|
|
607
|
+
|
|
608
|
+
const handleOpen = () => {
|
|
609
|
+
clearTimeout(timeoutRef.current);
|
|
610
|
+
timeoutRef.current = setTimeout(() => {
|
|
611
|
+
setIsOpen(true);
|
|
612
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
613
|
+
}, enterDelay);
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
const handleClose = () => {
|
|
617
|
+
clearTimeout(timeoutRef.current);
|
|
618
|
+
timeoutRef.current = setTimeout(() => {
|
|
619
|
+
setIsOpen(false);
|
|
620
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
621
|
+
}, leaveDelay);
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
React.useEffect(() => {
|
|
625
|
+
return () => clearTimeout(timeoutRef.current);
|
|
626
|
+
}, []); // Get the child element and clone it to add event handlers and ref
|
|
627
|
+
|
|
628
|
+
const child = React__default["default"].Children.only(children);
|
|
629
|
+
const childWithHandlers = /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
630
|
+
ref: node => {
|
|
631
|
+
childRef.current = node; // Handle child's ref if it exists
|
|
632
|
+
|
|
633
|
+
const {
|
|
634
|
+
ref: childRefProp
|
|
635
|
+
} = child;
|
|
636
|
+
|
|
637
|
+
if (typeof childRefProp === 'function') {
|
|
638
|
+
childRefProp(node);
|
|
639
|
+
} else if (childRefProp) {
|
|
640
|
+
childRefProp.current = node;
|
|
641
|
+
} // Handle forwarded ref
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
if (typeof ref === 'function') {
|
|
645
|
+
ref(node);
|
|
646
|
+
} else if (ref) {
|
|
647
|
+
ref.current = node;
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
onMouseEnter: e => {
|
|
651
|
+
var _child$props$onMouseE, _child$props;
|
|
652
|
+
|
|
653
|
+
handleOpen();
|
|
654
|
+
(_child$props$onMouseE = (_child$props = child.props).onMouseEnter) === null || _child$props$onMouseE === void 0 ? void 0 : _child$props$onMouseE.call(_child$props, e);
|
|
655
|
+
},
|
|
656
|
+
onMouseLeave: e => {
|
|
657
|
+
var _child$props$onMouseL, _child$props2;
|
|
658
|
+
|
|
659
|
+
handleClose();
|
|
660
|
+
(_child$props$onMouseL = (_child$props2 = child.props).onMouseLeave) === null || _child$props$onMouseL === void 0 ? void 0 : _child$props$onMouseL.call(_child$props2, e);
|
|
661
|
+
},
|
|
662
|
+
onFocus: e => {
|
|
663
|
+
var _child$props$onFocus, _child$props3;
|
|
664
|
+
|
|
665
|
+
handleOpen();
|
|
666
|
+
(_child$props$onFocus = (_child$props3 = child.props).onFocus) === null || _child$props$onFocus === void 0 ? void 0 : _child$props$onFocus.call(_child$props3, e);
|
|
667
|
+
},
|
|
668
|
+
onBlur: e => {
|
|
669
|
+
var _child$props$onBlur, _child$props4;
|
|
670
|
+
|
|
671
|
+
handleClose();
|
|
672
|
+
(_child$props$onBlur = (_child$props4 = child.props).onBlur) === null || _child$props$onBlur === void 0 ? void 0 : _child$props$onBlur.call(_child$props4, e);
|
|
673
|
+
}
|
|
674
|
+
}); // Hardcoded fallback background color
|
|
675
|
+
|
|
676
|
+
const defaultBgColor = "rgba(97, 97, 97, 0.92)"; // Get background from props, with fallback chain
|
|
677
|
+
|
|
678
|
+
const customBg = ((_componentsProps$tool = componentsProps.tooltip) === null || _componentsProps$tool === void 0 ? void 0 : (_componentsProps$tool2 = _componentsProps$tool.sx) === null || _componentsProps$tool2 === void 0 ? void 0 : _componentsProps$tool2.backgroundColor) || ((_PopperProps$sx = PopperProps.sx) === null || _PopperProps$sx === void 0 ? void 0 : _PopperProps$sx.backgroundColor); // Ensure we always have a valid background
|
|
679
|
+
|
|
680
|
+
const backgroundColor = customBg && customBg !== "transparent" && customBg !== "inherit" ? customBg : defaultBgColor;
|
|
681
|
+
|
|
682
|
+
const tooltipStyle = _objectSpread(_objectSpread(_objectSpread({
|
|
683
|
+
position: 'fixed',
|
|
684
|
+
top: position.top,
|
|
685
|
+
left: position.left,
|
|
686
|
+
zIndex: 1500,
|
|
687
|
+
borderRadius: "4px",
|
|
688
|
+
color: "#fff",
|
|
689
|
+
padding: "4px 8px",
|
|
690
|
+
fontSize: "0.6875rem",
|
|
691
|
+
maxWidth: "300px",
|
|
692
|
+
wordWrap: "break-word",
|
|
693
|
+
fontWeight: 500,
|
|
694
|
+
pointerEvents: 'none',
|
|
695
|
+
opacity: open ? 1 : 0,
|
|
696
|
+
transition: 'opacity 200ms'
|
|
697
|
+
}, (_componentsProps$tool3 = componentsProps.tooltip) === null || _componentsProps$tool3 === void 0 ? void 0 : _componentsProps$tool3.sx), PopperProps.sx), {}, {
|
|
698
|
+
// Force background at the end to ensure it's never transparent
|
|
699
|
+
backgroundColor
|
|
700
|
+
}); // Don't render portal during SSR or before mount
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
const tooltipContent = open && title && mounted && canUseDOM() ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
704
|
+
ref: tooltipRef,
|
|
705
|
+
role: "tooltip",
|
|
706
|
+
style: tooltipStyle
|
|
707
|
+
}, title) : null;
|
|
708
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, childWithHandlers, tooltipContent && (disablePortal ? tooltipContent : /*#__PURE__*/ReactDOM.createPortal(tooltipContent, document.body)));
|
|
709
|
+
});
|
|
710
|
+
BaseTooltip.displayName = "BaseTooltip";
|
|
711
|
+
const Tooltip = withSx.withSx(BaseTooltip);
|
|
712
|
+
/**
|
|
713
|
+
* LinearProgress - Progress bar (replaces MUI LinearProgress)
|
|
714
|
+
*/
|
|
715
|
+
|
|
716
|
+
const BaseLinearProgress = /*#__PURE__*/React__default["default"].forwardRef((_ref6, ref) => {
|
|
717
|
+
let {
|
|
718
|
+
variant = "indeterminate",
|
|
719
|
+
value = 0,
|
|
720
|
+
valueBuffer,
|
|
721
|
+
color = "primary",
|
|
722
|
+
style
|
|
723
|
+
} = _ref6,
|
|
724
|
+
props = _objectWithoutProperties__default["default"](_ref6, _excluded6);
|
|
725
|
+
|
|
726
|
+
const {
|
|
727
|
+
colors
|
|
728
|
+
} = ThemeProvider.useTheme();
|
|
729
|
+
const colorValue = colors[color] || colors.primary;
|
|
730
|
+
const mainColor = typeof colorValue === "object" ? colorValue.main : colorValue;
|
|
731
|
+
|
|
732
|
+
const containerStyle = _objectSpread({
|
|
733
|
+
position: "relative",
|
|
734
|
+
overflow: "hidden",
|
|
735
|
+
display: "block",
|
|
736
|
+
height: "4px",
|
|
737
|
+
zIndex: 0,
|
|
738
|
+
backgroundColor: "".concat(mainColor, "33"),
|
|
739
|
+
borderRadius: "2px"
|
|
740
|
+
}, style);
|
|
741
|
+
|
|
742
|
+
const barStyle = _objectSpread(_objectSpread({
|
|
743
|
+
width: "100%",
|
|
744
|
+
position: "absolute",
|
|
745
|
+
left: 0,
|
|
746
|
+
bottom: 0,
|
|
747
|
+
top: 0,
|
|
748
|
+
transition: "transform 0.4s linear",
|
|
749
|
+
transformOrigin: "left",
|
|
750
|
+
backgroundColor: mainColor
|
|
751
|
+
}, variant === "determinate" && {
|
|
752
|
+
transform: "translateX(".concat(value - 100, "%)")
|
|
753
|
+
}), variant === "indeterminate" && {
|
|
754
|
+
animation: "indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
return /*#__PURE__*/React__default["default"].createElement("span", _extends__default["default"]({
|
|
758
|
+
ref: ref,
|
|
759
|
+
role: "progressbar",
|
|
760
|
+
"aria-valuenow": variant === "determinate" ? value : undefined,
|
|
761
|
+
style: containerStyle
|
|
762
|
+
}, props), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
763
|
+
style: barStyle
|
|
764
|
+
}), /*#__PURE__*/React__default["default"].createElement("style", null, "\n @keyframes indeterminate1 {\n 0% { left: -35%; right: 100%; }\n 60% { left: 100%; right: -90%; }\n 100% { left: 100%; right: -90%; }\n }\n "));
|
|
765
|
+
});
|
|
766
|
+
BaseLinearProgress.displayName = "BaseLinearProgress";
|
|
767
|
+
const LinearProgress = withSx.withSx(BaseLinearProgress);
|
|
768
|
+
/**
|
|
769
|
+
* Skeleton - Placeholder loading component (replaces MUI Skeleton)
|
|
770
|
+
*/
|
|
771
|
+
|
|
772
|
+
const BaseSkeleton = /*#__PURE__*/React__default["default"].forwardRef((_ref7, ref) => {
|
|
773
|
+
let {
|
|
774
|
+
variant = "text",
|
|
775
|
+
animation = "pulse",
|
|
776
|
+
width,
|
|
777
|
+
height,
|
|
778
|
+
children,
|
|
779
|
+
style
|
|
780
|
+
} = _ref7,
|
|
781
|
+
props = _objectWithoutProperties__default["default"](_ref7, _excluded7);
|
|
782
|
+
|
|
783
|
+
const {
|
|
784
|
+
mode
|
|
785
|
+
} = ThemeProvider.useTheme(); // Theme-aware background color like MUI
|
|
786
|
+
|
|
787
|
+
const bgColor = mode === "dark" ? "#3b3d43ff" : "#3b3d43ff";
|
|
788
|
+
|
|
789
|
+
const skeletonStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
790
|
+
display: "block"
|
|
791
|
+
}, variant === "text" && {
|
|
792
|
+
marginTop: "4px",
|
|
793
|
+
marginBottom: "4px",
|
|
794
|
+
height: height || "1.2em",
|
|
795
|
+
borderRadius: "4px"
|
|
796
|
+
}), variant === "circular" && {
|
|
797
|
+
borderRadius: "50%"
|
|
798
|
+
}), variant === "rectangular" && {
|
|
799
|
+
borderRadius: 0
|
|
800
|
+
}), variant === "rounded" && {
|
|
801
|
+
borderRadius: "4px"
|
|
802
|
+
}), width && {
|
|
803
|
+
width
|
|
804
|
+
}), height && {
|
|
805
|
+
height
|
|
806
|
+
}), animation === "pulse" && {
|
|
807
|
+
animation: "skeleton-pulse 1.5s ease-in-out 0.5s infinite"
|
|
808
|
+
}), animation === "wave" && {
|
|
809
|
+
position: "relative",
|
|
810
|
+
overflow: "hidden"
|
|
811
|
+
}), animation === false && {
|
|
812
|
+
animation: "none"
|
|
813
|
+
}), style), {}, {
|
|
814
|
+
backgroundColor: bgColor
|
|
815
|
+
});
|
|
816
|
+
|
|
817
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", _extends__default["default"]({
|
|
818
|
+
ref: ref,
|
|
819
|
+
style: skeletonStyle
|
|
820
|
+
}, props), children), /*#__PURE__*/React__default["default"].createElement("style", null, "\n @keyframes skeleton-pulse {\n 0% { opacity: 1; }\n 50% { opacity: 0.4; }\n 100% { opacity: 1; }\n }\n "));
|
|
821
|
+
});
|
|
822
|
+
BaseSkeleton.displayName = "BaseSkeleton";
|
|
823
|
+
const Skeleton = withSx.withSx(BaseSkeleton);
|
|
824
|
+
/**
|
|
825
|
+
* Link - Styled anchor element (replaces MUI Link)
|
|
826
|
+
*/
|
|
827
|
+
|
|
828
|
+
const BaseLink = /*#__PURE__*/React__default["default"].forwardRef((_ref8, ref) => {
|
|
829
|
+
let {
|
|
830
|
+
color = "primary",
|
|
831
|
+
underline = "always",
|
|
832
|
+
component,
|
|
833
|
+
href,
|
|
834
|
+
children,
|
|
835
|
+
style
|
|
836
|
+
} = _ref8,
|
|
837
|
+
props = _objectWithoutProperties__default["default"](_ref8, _excluded8);
|
|
838
|
+
|
|
839
|
+
const {
|
|
840
|
+
colors
|
|
841
|
+
} = ThemeProvider.useTheme();
|
|
842
|
+
const colorValue = colors[color] || colors.primary;
|
|
843
|
+
const mainColor = typeof colorValue === "object" ? colorValue.main : colorValue;
|
|
844
|
+
|
|
845
|
+
const linkStyle = _objectSpread({
|
|
846
|
+
color: color === "inherit" ? "inherit" : mainColor,
|
|
847
|
+
textDecoration: underline === "none" ? "none" : underline === "hover" ? "none" : "underline",
|
|
848
|
+
cursor: "pointer"
|
|
849
|
+
}, style);
|
|
850
|
+
|
|
851
|
+
const Component = component || "a";
|
|
852
|
+
return /*#__PURE__*/React__default["default"].createElement(Component, _extends__default["default"]({
|
|
853
|
+
ref: ref,
|
|
854
|
+
href: href,
|
|
855
|
+
style: linkStyle
|
|
856
|
+
}, props), children);
|
|
857
|
+
});
|
|
858
|
+
BaseLink.displayName = "BaseLink";
|
|
859
|
+
const Link = withSx.withSx(BaseLink);
|
|
860
|
+
|
|
861
|
+
exports.Avatar = Avatar;
|
|
862
|
+
exports.Badge = Badge;
|
|
863
|
+
exports.Chip = Chip;
|
|
864
|
+
exports.Divider = Divider;
|
|
865
|
+
exports.LinearProgress = LinearProgress;
|
|
866
|
+
exports.Link = Link;
|
|
867
|
+
exports.Skeleton = Skeleton;
|
|
868
|
+
exports.Tooltip = Tooltip;
|