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