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