@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,1041 @@
1
+ import _extends from '@babel/runtime/helpers/extends';
2
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
4
+ import React, { useState, useRef, useEffect } from 'react';
5
+ import { withSx } from './withSx.js';
6
+ import { useTheme } from './ThemeProvider.js';
7
+ import { createPortal } from 'react-dom';
8
+
9
+ const _excluded = ["checked", "defaultChecked", "disabled", "onChange", "color", "size", "indeterminate", "icon", "checkedIcon", "name", "value", "inputProps", "style"],
10
+ _excluded2 = ["checked", "defaultChecked", "disabled", "onChange", "color", "size", "name", "value", "inputProps", "style"],
11
+ _excluded3 = ["checked", "defaultChecked", "disabled", "onChange", "color", "size", "name", "value", "inputProps", "style"],
12
+ _excluded4 = ["value", "defaultValue", "onChange", "children", "disabled", "multiple", "native", "variant", "label", "fullWidth", "size", "error", "displayEmpty", "renderValue", "MenuProps", "inputProps", "style", "IconComponent", "disableBorder", "color"],
13
+ _excluded5 = ["value", "defaultValue", "onChange", "onChangeCommitted", "min", "max", "step", "marks", "disabled", "orientation", "color", "size", "valueLabelDisplay", "valueLabelFormat", "getAriaValueText", "track", "style"],
14
+ _excluded6 = ["value", "defaultValue", "onChange", "max", "precision", "disabled", "readOnly", "size", "emptyIcon", "icon", "name", "style"];
15
+
16
+ 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; }
17
+
18
+ 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; }
19
+ /**
20
+ * Checkbox - Checkbox input (replaces MUI Checkbox)
21
+ */
22
+
23
+ const BaseCheckbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
24
+ let {
25
+ checked,
26
+ defaultChecked,
27
+ disabled = false,
28
+ onChange,
29
+ color = "whiteOverride",
30
+ size = "medium",
31
+ indeterminate = false,
32
+ icon,
33
+ checkedIcon,
34
+ name,
35
+ value,
36
+ inputProps,
37
+ style
38
+ } = _ref,
39
+ props = _objectWithoutProperties(_ref, _excluded);
40
+
41
+ const {
42
+ colors
43
+ } = useTheme();
44
+ const [internalChecked, setInternalChecked] = useState(defaultChecked || false);
45
+ const isChecked = checked !== undefined ? checked : internalChecked;
46
+ const colorValue = colors[color] || colors.whiteOverride;
47
+ const mainColor = typeof colorValue === "object" ? colorValue.main : colorValue;
48
+ const sizeMap = {
49
+ small: "18px",
50
+ medium: "24px",
51
+ large: "28px"
52
+ };
53
+ const checkSize = sizeMap[size] || sizeMap.medium;
54
+
55
+ const handleChange = e => {
56
+ if (checked === undefined) {
57
+ setInternalChecked(e.target.checked);
58
+ }
59
+
60
+ onChange === null || onChange === void 0 ? void 0 : onChange(e);
61
+ };
62
+
63
+ const containerStyle = _objectSpread({
64
+ display: "inline-flex",
65
+ alignItems: "center",
66
+ justifyContent: "center",
67
+ position: "relative",
68
+ padding: "9px",
69
+ cursor: disabled ? "default" : "pointer",
70
+ borderRadius: "4px"
71
+ }, style);
72
+
73
+ const inputStyle = {
74
+ position: "absolute",
75
+ opacity: 0,
76
+ width: "100%",
77
+ height: "100%",
78
+ margin: 0,
79
+ padding: 0,
80
+ cursor: "inherit"
81
+ };
82
+
83
+ const checkboxStyle = _objectSpread({
84
+ width: checkSize,
85
+ height: checkSize,
86
+ display: "flex",
87
+ alignItems: "center",
88
+ justifyContent: "center",
89
+ borderRadius: "4px",
90
+ border: "2px solid ".concat(isChecked ? mainColor : "var(--border-color, rgba(255, 255, 255, 0.54))"),
91
+ backgroundColor: isChecked ? mainColor : "transparent",
92
+ transition: "background-color 150ms, border-color 150ms"
93
+ }, disabled && {
94
+ opacity: 0.5
95
+ });
96
+
97
+ const checkmarkStyle = {
98
+ width: "70%",
99
+ height: "70%",
100
+ display: isChecked ? "block" : "none",
101
+ color: "black"
102
+ };
103
+ return /*#__PURE__*/React.createElement("span", _extends({
104
+ ref: ref,
105
+ style: containerStyle
106
+ }, props), /*#__PURE__*/React.createElement("input", _extends({
107
+ type: "checkbox",
108
+ checked: isChecked,
109
+ disabled: disabled,
110
+ onChange: handleChange,
111
+ name: name,
112
+ value: value,
113
+ style: inputStyle
114
+ }, inputProps)), /*#__PURE__*/React.createElement("span", {
115
+ style: checkboxStyle
116
+ }, isChecked && /*#__PURE__*/React.createElement("svg", {
117
+ style: checkmarkStyle,
118
+ viewBox: "0 0 24 24",
119
+ fill: "currentColor"
120
+ }, /*#__PURE__*/React.createElement("path", {
121
+ d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
122
+ })), indeterminate && !isChecked && /*#__PURE__*/React.createElement("svg", {
123
+ style: checkmarkStyle,
124
+ viewBox: "0 0 24 24",
125
+ fill: "currentColor"
126
+ }, /*#__PURE__*/React.createElement("path", {
127
+ d: "M19 13H5v-2h14v2z"
128
+ }))));
129
+ });
130
+ BaseCheckbox.displayName = "BaseCheckbox";
131
+ const Checkbox = withSx(BaseCheckbox);
132
+ /**
133
+ * Radio - Radio button (replaces MUI Radio)
134
+ */
135
+
136
+ const BaseRadio = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
137
+ let {
138
+ checked,
139
+ defaultChecked,
140
+ disabled = false,
141
+ onChange,
142
+ color = "whiteOverride",
143
+ size = "medium",
144
+ name,
145
+ value,
146
+ inputProps,
147
+ style
148
+ } = _ref2,
149
+ props = _objectWithoutProperties(_ref2, _excluded2);
150
+
151
+ const {
152
+ colors
153
+ } = useTheme();
154
+ const colorValue = colors[color] || colors.whiteOverride;
155
+ const mainColor = typeof colorValue === "object" ? colorValue.main : colorValue;
156
+ const sizeMap = {
157
+ small: "18px",
158
+ medium: "24px",
159
+ large: "28px"
160
+ };
161
+ const radioSize = sizeMap[size] || sizeMap.medium;
162
+
163
+ const containerStyle = _objectSpread({
164
+ display: "inline-flex",
165
+ alignItems: "center",
166
+ justifyContent: "center",
167
+ position: "relative",
168
+ padding: "9px",
169
+ cursor: disabled ? "default" : "pointer",
170
+ borderRadius: "50%"
171
+ }, style);
172
+
173
+ const inputStyle = {
174
+ position: "absolute",
175
+ opacity: 0,
176
+ width: "100%",
177
+ height: "100%",
178
+ margin: 0,
179
+ padding: 0,
180
+ cursor: "inherit"
181
+ };
182
+
183
+ const radioStyle = _objectSpread({
184
+ width: radioSize,
185
+ height: radioSize,
186
+ display: "flex",
187
+ alignItems: "center",
188
+ justifyContent: "center",
189
+ borderRadius: "50%",
190
+ border: "2px solid ".concat(checked ? mainColor : "var(--border-color, rgba(255, 255, 255, 0.54))"),
191
+ backgroundColor: "transparent",
192
+ transition: "border-color 150ms"
193
+ }, disabled && {
194
+ opacity: 0.5
195
+ });
196
+
197
+ const dotStyle = {
198
+ width: "50%",
199
+ height: "50%",
200
+ borderRadius: "50%",
201
+ backgroundColor: mainColor,
202
+ display: checked ? "block" : "none",
203
+ transition: "transform 150ms"
204
+ };
205
+ return /*#__PURE__*/React.createElement("span", _extends({
206
+ ref: ref,
207
+ style: containerStyle
208
+ }, props), /*#__PURE__*/React.createElement("input", _extends({
209
+ type: "radio",
210
+ checked: checked,
211
+ defaultChecked: defaultChecked,
212
+ disabled: disabled,
213
+ onChange: onChange,
214
+ name: name,
215
+ value: value,
216
+ style: inputStyle
217
+ }, inputProps)), /*#__PURE__*/React.createElement("span", {
218
+ style: radioStyle
219
+ }, /*#__PURE__*/React.createElement("span", {
220
+ style: dotStyle
221
+ })));
222
+ });
223
+ BaseRadio.displayName = "BaseRadio";
224
+ const Radio = withSx(BaseRadio);
225
+ /**
226
+ * Switch - Toggle switch (replaces MUI Switch)
227
+ */
228
+
229
+ const BaseSwitch = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
230
+ let {
231
+ checked,
232
+ defaultChecked,
233
+ disabled = false,
234
+ onChange,
235
+ color = "primary",
236
+ size = "medium",
237
+ name,
238
+ value,
239
+ inputProps,
240
+ style
241
+ } = _ref3,
242
+ props = _objectWithoutProperties(_ref3, _excluded3);
243
+
244
+ const {
245
+ colors
246
+ } = useTheme();
247
+ const [internalChecked, setInternalChecked] = useState(defaultChecked || false);
248
+ const isChecked = checked !== undefined ? checked : internalChecked;
249
+ const colorValue = colors[color] || colors.primary;
250
+ const mainColor = typeof colorValue === "object" ? colorValue.main : colorValue; // Size configurations
251
+
252
+ const isSmall = size === "small";
253
+ const trackWidth = isSmall ? 34 : 42;
254
+ const trackHeight = isSmall ? 14 : 20;
255
+ const thumbSize = isSmall ? 20 : 26; // Calculate thumb position
256
+
257
+ const thumbOffset = isChecked ? trackWidth - thumbSize + 4 : -4;
258
+
259
+ const toggle = () => {
260
+ if (disabled) return;
261
+ const newChecked = !isChecked; // Always update internal state for uncontrolled usage
262
+
263
+ if (checked === undefined) {
264
+ setInternalChecked(newChecked);
265
+ } // Call onChange with synthetic event
266
+
267
+
268
+ if (onChange) {
269
+ onChange({
270
+ target: {
271
+ checked: newChecked,
272
+ name,
273
+ value,
274
+ type: "checkbox"
275
+ }
276
+ });
277
+ }
278
+ };
279
+
280
+ return /*#__PURE__*/React.createElement("div", _extends({
281
+ ref: ref,
282
+ role: "switch",
283
+ "aria-checked": isChecked,
284
+ "aria-disabled": disabled,
285
+ tabIndex: disabled ? -1 : 0,
286
+ style: _objectSpread({
287
+ display: "inline-flex",
288
+ alignItems: "center",
289
+ position: "relative",
290
+ padding: "9px",
291
+ cursor: disabled ? "default" : "pointer",
292
+ opacity: disabled ? 0.5 : 1,
293
+ userSelect: "none",
294
+ WebkitTapHighlightColor: "transparent"
295
+ }, style),
296
+ onMouseDown: e => {
297
+ // Prevent text selection on double click
298
+ e.preventDefault();
299
+ },
300
+ onClick: e => {
301
+ e.stopPropagation();
302
+ toggle();
303
+ },
304
+ onKeyDown: e => {
305
+ if (e.key === "Enter" || e.key === " ") {
306
+ e.preventDefault();
307
+ toggle();
308
+ }
309
+ }
310
+ }, props), /*#__PURE__*/React.createElement("div", {
311
+ style: {
312
+ width: trackWidth,
313
+ height: trackHeight,
314
+ borderRadius: trackHeight,
315
+ backgroundColor: isChecked ? "".concat(mainColor, "80") : "rgba(0, 0, 0, 0.38)",
316
+ transition: "background-color 150ms",
317
+ position: "relative",
318
+ pointerEvents: "none"
319
+ }
320
+ }, /*#__PURE__*/React.createElement("div", {
321
+ style: {
322
+ width: thumbSize,
323
+ height: thumbSize,
324
+ borderRadius: "50%",
325
+ backgroundColor: isChecked ? mainColor : "#fafafa",
326
+ boxShadow: "0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)",
327
+ position: "absolute",
328
+ top: "50%",
329
+ left: thumbOffset,
330
+ transform: "translateY(-50%)",
331
+ transition: "left 150ms, background-color 150ms",
332
+ pointerEvents: "none"
333
+ }
334
+ })), /*#__PURE__*/React.createElement("input", _extends({
335
+ type: "checkbox",
336
+ checked: isChecked,
337
+ name: name,
338
+ value: value,
339
+ disabled: disabled,
340
+ readOnly: true,
341
+ tabIndex: -1,
342
+ style: {
343
+ position: "absolute",
344
+ width: 1,
345
+ height: 1,
346
+ margin: -1,
347
+ padding: 0,
348
+ overflow: "hidden",
349
+ clip: "rect(0, 0, 0, 0)",
350
+ border: 0
351
+ }
352
+ }, inputProps)));
353
+ });
354
+ BaseSwitch.displayName = "BaseSwitch";
355
+ const Switch = withSx(BaseSwitch);
356
+ /**
357
+ * Enhanced Select - Drop-in replacement that supports MUI-style MenuProps
358
+ */
359
+
360
+ const BaseSelect = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
361
+ var _MenuProps$sx, _propsSx$Svg, _PaperProps$style, _PaperProps$style2;
362
+
363
+ let {
364
+ value,
365
+ defaultValue,
366
+ onChange,
367
+ children,
368
+ disabled = false,
369
+ multiple = false,
370
+ native = false,
371
+ variant = "outlined",
372
+ label,
373
+ fullWidth = false,
374
+ size = "medium",
375
+ error = false,
376
+ displayEmpty = false,
377
+ renderValue,
378
+ MenuProps = {},
379
+ inputProps,
380
+ style,
381
+ IconComponent,
382
+ disableBorder = true,
383
+ // Default to no border on select box
384
+ color = "notBlack"
385
+ } = _ref4,
386
+ props = _objectWithoutProperties(_ref4, _excluded4);
387
+
388
+ const {
389
+ colors
390
+ } = useTheme();
391
+ const [open, setOpen] = useState(false);
392
+ const [internalValue, setInternalValue] = useState(defaultValue || (multiple ? [] : ""));
393
+ const [menuPosition, setMenuPosition] = useState({
394
+ top: 0,
395
+ left: 0,
396
+ width: 0,
397
+ bottom: 0
398
+ });
399
+ const selectRef = useRef(null);
400
+ const menuRef = useRef(null);
401
+ const currentValue = value !== undefined ? value : internalValue; // Extract color from theme
402
+
403
+ const colorValue = colors[color] || colors.notBlack || colors.primary;
404
+ const mainColor = typeof colorValue === "object" ? colorValue.main : colorValue;
405
+
406
+ const handleChange = newValue => {
407
+ if (value === undefined) {
408
+ setInternalValue(newValue);
409
+ }
410
+
411
+ onChange === null || onChange === void 0 ? void 0 : onChange({
412
+ target: {
413
+ value: newValue,
414
+ name: props.name
415
+ }
416
+ });
417
+
418
+ if (!multiple) {
419
+ setOpen(false);
420
+ }
421
+ }; // Extract MenuProps configuration
422
+
423
+
424
+ const {
425
+ keepMounted = false,
426
+ disablePortal = false,
427
+ anchorOrigin = {
428
+ vertical: "top",
429
+ horizontal: "left"
430
+ },
431
+ transformOrigin = {
432
+ vertical: "bottom",
433
+ horizontal: "left"
434
+ },
435
+ sx: menuSx = {},
436
+ PaperProps = {}
437
+ } = MenuProps; // Extract paper/menu styling from MUI-style sx prop
438
+
439
+ const paperSx = (MenuProps === null || MenuProps === void 0 ? void 0 : (_MenuProps$sx = MenuProps.sx) === null || _MenuProps$sx === void 0 ? void 0 : _MenuProps$sx["& .MuiPaper-root"]) || {}; // Resolve sx color values (e.g., "extensionColor9.main" -> actual color)
440
+
441
+ const resolveColor = colorPath => {
442
+ if (!colorPath || typeof colorPath !== "string") return colorPath;
443
+ const parts = colorPath.split(".");
444
+ let result = colors[parts[0]];
445
+
446
+ for (let i = 1; i < parts.length && result; i++) {
447
+ result = result[parts[i]];
448
+ }
449
+
450
+ return result || colorPath;
451
+ }; // Update menu position when opened
452
+
453
+
454
+ useEffect(() => {
455
+ if (open && selectRef.current) {
456
+ const rect = selectRef.current.getBoundingClientRect();
457
+ const viewportHeight = window.innerHeight; // Calculate position based on anchorOrigin/transformOrigin
458
+
459
+ let top, bottom;
460
+
461
+ if (anchorOrigin.vertical === "top" && transformOrigin.vertical === "bottom") {
462
+ // Menu opens above the select
463
+ bottom = viewportHeight - rect.top + 4;
464
+ top = "auto";
465
+ } else {
466
+ // Menu opens below the select (default)
467
+ top = rect.bottom + window.scrollY + 4;
468
+ bottom = "auto";
469
+ }
470
+
471
+ setMenuPosition({
472
+ top,
473
+ bottom,
474
+ left: rect.left + window.scrollX,
475
+ width: rect.width
476
+ });
477
+ }
478
+ }, [open, anchorOrigin.vertical, transformOrigin.vertical]); // Handle click outside
479
+
480
+ useEffect(() => {
481
+ const handleClickOutside = e => {
482
+ if (selectRef.current && !selectRef.current.contains(e.target) && menuRef.current && !menuRef.current.contains(e.target)) {
483
+ setOpen(false);
484
+ }
485
+ };
486
+
487
+ if (open) {
488
+ document.addEventListener("mousedown", handleClickOutside);
489
+ return () => document.removeEventListener("mousedown", handleClickOutside);
490
+ }
491
+ }, [open]);
492
+
493
+ const containerStyle = _objectSpread(_objectSpread({
494
+ position: "relative",
495
+ display: "inline-flex"
496
+ }, fullWidth && {
497
+ width: "100%"
498
+ }), style); // Build select box styles - NO BORDER by default
499
+
500
+
501
+ const propsSx = props.sx || {};
502
+ const selectHeight = propsSx.height || (size === "small" ? "40px" : "48px");
503
+ const selectFontSize = propsSx.fontSize || "16px";
504
+
505
+ const selectStyle = _objectSpread({
506
+ display: "flex",
507
+ alignItems: "center",
508
+ justifyContent: "space-between",
509
+ height: selectHeight,
510
+ padding: "4px 12px",
511
+ border: "none",
512
+ // No border on select box
513
+ borderRadius: "4px",
514
+ backgroundColor: "transparent",
515
+ color: resolveColor(propsSx.color) || mainColor || "#fff",
516
+ cursor: disabled ? "default" : "pointer",
517
+ minWidth: "120px",
518
+ width: propsSx.width || "100%",
519
+ fontSize: selectFontSize,
520
+ overflow: "hidden",
521
+ whiteSpace: "nowrap",
522
+ textOverflow: "ellipsis",
523
+ transition: "border-color 200ms"
524
+ }, disabled && {
525
+ opacity: 0.5
526
+ }); // Arrow icon styles
527
+
528
+
529
+ const arrowStyle = {
530
+ marginLeft: "8px",
531
+ transform: "rotate(".concat(open ? "180deg" : "0deg", ")"),
532
+ transition: "transform 200ms",
533
+ pointerEvents: "none",
534
+ color: resolveColor((_propsSx$Svg = propsSx["& svg"]) === null || _propsSx$Svg === void 0 ? void 0 : _propsSx$Svg.color) || "inherit",
535
+ fontSize: "10px",
536
+ flexShrink: 0
537
+ }; // Build menu styles from MenuProps
538
+
539
+ const menuBackgroundColor = resolveColor(paperSx.backgroundColor) || (PaperProps === null || PaperProps === void 0 ? void 0 : (_PaperProps$style = PaperProps.style) === null || _PaperProps$style === void 0 ? void 0 : _PaperProps$style.backgroundColor) || "#2C2E32";
540
+ const menuTextColor = resolveColor(paperSx.color) || (PaperProps === null || PaperProps === void 0 ? void 0 : (_PaperProps$style2 = PaperProps.style) === null || _PaperProps$style2 === void 0 ? void 0 : _PaperProps$style2.color) || "#fff";
541
+ const menuZIndex = paperSx.zIndex || 9999;
542
+
543
+ const menuStyle = _objectSpread(_objectSpread(_objectSpread({
544
+ position: "fixed"
545
+ }, menuPosition.top !== "auto" && {
546
+ top: "".concat(menuPosition.top, "px")
547
+ }), menuPosition.bottom !== "auto" && {
548
+ bottom: "".concat(menuPosition.bottom, "px")
549
+ }), {}, {
550
+ left: "".concat(menuPosition.left, "px"),
551
+ width: "".concat(menuPosition.width, "px"),
552
+ backgroundColor: menuBackgroundColor,
553
+ border: "none",
554
+ borderRadius: "12px",
555
+ boxShadow: "0px 5px 15px rgba(0,0,0,0.3), 0px 10px 30px rgba(0,0,0,0.25)",
556
+ zIndex: menuZIndex,
557
+ maxHeight: "350px",
558
+ overflowY: "auto",
559
+ padding: "8px 0",
560
+ opacity: open ? 1 : 0,
561
+ visibility: open ? "visible" : "hidden",
562
+ transform: open ? "scaleY(1)" : "scaleY(0.95)",
563
+ transformOrigin: transformOrigin.vertical === "bottom" ? "bottom" : "top",
564
+ transition: "opacity 150ms, transform 150ms, visibility 150ms"
565
+ }, PaperProps === null || PaperProps === void 0 ? void 0 : PaperProps.style);
566
+
567
+ const menuItemStyle = isSelected => ({
568
+ padding: "4px 12px",
569
+ cursor: "pointer",
570
+ backgroundColor: isSelected ? "rgba(255, 255, 255, 0.08)" : "transparent",
571
+ color: menuTextColor,
572
+ transition: "background-color 150ms",
573
+ userSelect: "none",
574
+ display: "flex",
575
+ flexDirection: "column",
576
+ justifyContent: "center",
577
+ gap: "2px"
578
+ }); // Get display text - ONLY show the name, not the balance
579
+
580
+
581
+ const getDisplayText = () => {
582
+ if (renderValue) {
583
+ return renderValue(currentValue);
584
+ }
585
+
586
+ if (multiple && Array.isArray(currentValue)) {
587
+ return currentValue.join(", ") || (displayEmpty ? "" : "\u00A0");
588
+ } // Find the selected child and extract just the name (first text content)
589
+
590
+
591
+ let displayText = currentValue;
592
+ React.Children.forEach(children, child => {
593
+ var _child$props;
594
+
595
+ if ((child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.value) === currentValue) {
596
+ // Try to get just the name from the child
597
+ const childContent = child.props.children; // If children is an array, get the first meaningful text
598
+
599
+ if (Array.isArray(childContent)) {
600
+ const firstChild = childContent[0];
601
+
602
+ if ( /*#__PURE__*/React.isValidElement(firstChild)) {
603
+ // Extract text from nested elements
604
+ displayText = extractTextFromElement(firstChild) || child.props.value;
605
+ } else if (typeof firstChild === 'string') {
606
+ displayText = firstChild;
607
+ }
608
+ } else if ( /*#__PURE__*/React.isValidElement(childContent)) {
609
+ displayText = extractTextFromElement(childContent) || child.props.value;
610
+ } else if (typeof childContent === 'string') {
611
+ displayText = childContent;
612
+ }
613
+ }
614
+ });
615
+ return displayText || (displayEmpty ? "" : "\u00A0");
616
+ }; // Helper to extract text from React elements
617
+
618
+
619
+ const extractTextFromElement = element => {
620
+ if (! /*#__PURE__*/React.isValidElement(element)) return null;
621
+ const children = element.props.children;
622
+
623
+ if (typeof children === 'string') {
624
+ return children;
625
+ }
626
+
627
+ if (Array.isArray(children)) {
628
+ for (const child of children) {
629
+ if (typeof child === 'string') return child;
630
+
631
+ if ( /*#__PURE__*/React.isValidElement(child)) {
632
+ const text = extractTextFromElement(child);
633
+ if (text) return text;
634
+ }
635
+ }
636
+ }
637
+
638
+ return null;
639
+ };
640
+
641
+ if (native) {
642
+ return /*#__PURE__*/React.createElement("div", _extends({
643
+ ref: ref,
644
+ style: containerStyle
645
+ }, props), /*#__PURE__*/React.createElement("select", _extends({
646
+ value: currentValue,
647
+ onChange: e => handleChange(e.target.value),
648
+ disabled: disabled,
649
+ multiple: multiple,
650
+ style: _objectSpread(_objectSpread({}, selectStyle), {}, {
651
+ appearance: "none"
652
+ })
653
+ }, inputProps), children), /*#__PURE__*/React.createElement("span", {
654
+ style: arrowStyle
655
+ }, "\u25BC"));
656
+ }
657
+
658
+ const menuContent = /*#__PURE__*/React.createElement("div", _extends({
659
+ ref: menuRef,
660
+ style: menuStyle,
661
+ role: "listbox"
662
+ }, MenuProps), React.Children.map(children, child => {
663
+ if (! /*#__PURE__*/React.isValidElement(child)) return child;
664
+ const isSelected = multiple ? currentValue.includes(child.props.value) : currentValue === child.props.value;
665
+ return /*#__PURE__*/React.createElement("div", {
666
+ key: child.props.value,
667
+ onClick: e => {
668
+ var _child$props$onClick, _child$props2;
669
+
670
+ e.stopPropagation(); // Call the child's onClick if it exists
671
+
672
+ (_child$props$onClick = (_child$props2 = child.props).onClick) === null || _child$props$onClick === void 0 ? void 0 : _child$props$onClick.call(_child$props2);
673
+
674
+ if (multiple) {
675
+ const newValue = isSelected ? currentValue.filter(v => v !== child.props.value) : [...currentValue, child.props.value];
676
+ handleChange(newValue);
677
+ } else {
678
+ handleChange(child.props.value);
679
+ }
680
+ },
681
+ onMouseEnter: e => {
682
+ e.currentTarget.style.backgroundColor = "rgba(255, 255, 255, 0.12)";
683
+ },
684
+ onMouseLeave: e => {
685
+ e.currentTarget.style.backgroundColor = isSelected ? "rgba(255, 255, 255, 0.08)" : "transparent";
686
+ },
687
+ style: menuItemStyle(isSelected),
688
+ role: "option",
689
+ "aria-selected": isSelected
690
+ }, child.props.children);
691
+ }));
692
+ const menu = (open || keepMounted) && (disablePortal ? menuContent : /*#__PURE__*/createPortal(menuContent, document.body));
693
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
694
+ ref: ref,
695
+ style: containerStyle
696
+ }, props), /*#__PURE__*/React.createElement("div", {
697
+ ref: selectRef,
698
+ style: selectStyle,
699
+ onClick: () => !disabled && setOpen(!open),
700
+ role: "button",
701
+ "aria-haspopup": "listbox",
702
+ "aria-expanded": open,
703
+ tabIndex: disabled ? -1 : 0,
704
+ onKeyDown: e => {
705
+ if (e.key === "Enter" || e.key === " ") {
706
+ e.preventDefault();
707
+ !disabled && setOpen(!open);
708
+ }
709
+
710
+ if (e.key === "Escape") {
711
+ setOpen(false);
712
+ }
713
+ }
714
+ }, /*#__PURE__*/React.createElement("span", {
715
+ style: {
716
+ flex: 1,
717
+ overflow: "hidden",
718
+ textOverflow: "ellipsis",
719
+ whiteSpace: "nowrap",
720
+ minWidth: 0,
721
+ fontSize: "inherit"
722
+ }
723
+ }, getDisplayText()), IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
724
+ style: {
725
+ marginLeft: "8px",
726
+ color: arrowStyle.color
727
+ }
728
+ }) : /*#__PURE__*/React.createElement("span", {
729
+ style: arrowStyle
730
+ }, "\u25B2"))), menu);
731
+ });
732
+ BaseSelect.displayName = "BaseSelect";
733
+ const Select = withSx(BaseSelect);
734
+ /**
735
+ * Slider - Range slider (replaces MUI Slider)
736
+ */
737
+
738
+ const BaseSlider = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
739
+ let {
740
+ value,
741
+ defaultValue = 0,
742
+ onChange,
743
+ onChangeCommitted,
744
+ min = 0,
745
+ max = 100,
746
+ step = 1,
747
+ marks = false,
748
+ disabled = false,
749
+ orientation = "horizontal",
750
+ color = "primary",
751
+ size = "medium",
752
+ valueLabelDisplay = "off",
753
+ valueLabelFormat,
754
+ getAriaValueText,
755
+ track = "normal",
756
+ style
757
+ } = _ref5,
758
+ props = _objectWithoutProperties(_ref5, _excluded5);
759
+
760
+ const {
761
+ colors
762
+ } = useTheme();
763
+ const [internalValue, setInternalValue] = useState(defaultValue);
764
+ const [isDragging, setIsDragging] = useState(false);
765
+ const sliderRef = useRef(null);
766
+ const currentValue = value !== undefined ? value : internalValue;
767
+ const colorValue = colors[color] || colors.primary;
768
+ const mainColor = typeof colorValue === "object" ? colorValue.main : colorValue;
769
+ const trackThickness = 4;
770
+ const thumbSize = 20;
771
+ const percentage = (currentValue - min) / (max - min) * 100;
772
+
773
+ const handleChange = newValue => {
774
+ const clampedValue = Math.min(max, Math.max(min, newValue));
775
+ const steppedValue = Math.round(clampedValue / step) * step;
776
+
777
+ if (value === undefined) {
778
+ setInternalValue(steppedValue);
779
+ }
780
+
781
+ onChange === null || onChange === void 0 ? void 0 : onChange({
782
+ target: {
783
+ value: steppedValue
784
+ }
785
+ }, steppedValue);
786
+ };
787
+
788
+ const updateValue = e => {
789
+ if (!sliderRef.current) return;
790
+ const rect = sliderRef.current.getBoundingClientRect();
791
+ const percent = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
792
+ const newValue = min + percent * (max - min);
793
+ handleChange(newValue);
794
+ };
795
+
796
+ const handleMouseDown = e => {
797
+ if (disabled) return;
798
+ e.preventDefault();
799
+ setIsDragging(true);
800
+ updateValue(e);
801
+ };
802
+
803
+ useEffect(() => {
804
+ if (!isDragging) return;
805
+
806
+ const handleMouseMove = e => {
807
+ updateValue(e);
808
+ };
809
+
810
+ const handleMouseUp = () => {
811
+ setIsDragging(false);
812
+ onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted({
813
+ target: {
814
+ value: currentValue
815
+ }
816
+ }, currentValue);
817
+ };
818
+
819
+ document.addEventListener("mousemove", handleMouseMove);
820
+ document.addEventListener("mouseup", handleMouseUp);
821
+ return () => {
822
+ document.removeEventListener("mousemove", handleMouseMove);
823
+ document.removeEventListener("mouseup", handleMouseUp);
824
+ };
825
+ }, [isDragging, currentValue, min, max, step]);
826
+
827
+ const containerStyle = _objectSpread(_objectSpread({
828
+ position: "relative",
829
+ display: "inline-block",
830
+ width: "100%",
831
+ height: "40px",
832
+ cursor: disabled ? "default" : "pointer",
833
+ touchAction: "none"
834
+ }, disabled && {
835
+ opacity: 0.38
836
+ }), style);
837
+
838
+ const railStyle = {
839
+ position: "absolute",
840
+ width: "100%",
841
+ height: "".concat(trackThickness, "px"),
842
+ top: "50%",
843
+ transform: "translateY(-50%)",
844
+ borderRadius: "".concat(trackThickness / 2, "px"),
845
+ backgroundColor: "rgba(255, 255, 255, 0.3)"
846
+ };
847
+ const trackStyle = {
848
+ position: "absolute",
849
+ width: "".concat(percentage, "%"),
850
+ height: "".concat(trackThickness, "px"),
851
+ top: "50%",
852
+ transform: "translateY(-50%)",
853
+ borderRadius: "".concat(trackThickness / 2, "px"),
854
+ backgroundColor: mainColor,
855
+ transition: isDragging ? "none" : "width 150ms"
856
+ };
857
+
858
+ const thumbStyle = _objectSpread({
859
+ position: "absolute",
860
+ width: "".concat(thumbSize, "px"),
861
+ height: "".concat(thumbSize, "px"),
862
+ borderRadius: "50%",
863
+ backgroundColor: mainColor,
864
+ boxShadow: "0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)",
865
+ left: "calc(".concat(percentage, "% - ").concat(thumbSize / 2, "px)"),
866
+ top: "50%",
867
+ transform: "translateY(-50%)",
868
+ transition: isDragging ? "none" : "left 150ms",
869
+ cursor: "grab"
870
+ }, isDragging && {
871
+ cursor: "grabbing"
872
+ }); // Render marks if provided
873
+
874
+
875
+ const renderMarks = () => {
876
+ if (!marks) return null;
877
+ const markArray = Array.isArray(marks) ? marks : Array.from({
878
+ length: Math.floor((max - min) / step) + 1
879
+ }, (_, i) => ({
880
+ value: min + i * step
881
+ }));
882
+ return markArray.map(mark => {
883
+ const markPercent = (mark.value - min) / (max - min) * 100;
884
+ return /*#__PURE__*/React.createElement(React.Fragment, {
885
+ key: mark.value
886
+ }, /*#__PURE__*/React.createElement("span", {
887
+ style: {
888
+ position: "absolute",
889
+ width: "2px",
890
+ height: "2px",
891
+ borderRadius: "50%",
892
+ backgroundColor: "rgba(255, 255, 255, 0.7)",
893
+ left: "".concat(markPercent, "%"),
894
+ top: "50%",
895
+ transform: "translate(-50%, -50%)"
896
+ }
897
+ }), mark.label && /*#__PURE__*/React.createElement("span", {
898
+ style: {
899
+ position: "absolute",
900
+ left: "".concat(markPercent, "%"),
901
+ top: "calc(50% + 16px)",
902
+ transform: "translateX(-50%)",
903
+ fontSize: "12px",
904
+ color: "rgba(255, 255, 255, 0.7)",
905
+ whiteSpace: "nowrap"
906
+ }
907
+ }, mark.label));
908
+ });
909
+ };
910
+
911
+ const displayValue = valueLabelFormat ? valueLabelFormat(currentValue) : getAriaValueText ? getAriaValueText(currentValue) : currentValue;
912
+ return /*#__PURE__*/React.createElement("div", _extends({
913
+ ref: node => {
914
+ sliderRef.current = node;
915
+
916
+ if (typeof ref === "function") {
917
+ ref(node);
918
+ } else if (ref) {
919
+ ref.current = node;
920
+ }
921
+ },
922
+ style: containerStyle,
923
+ onMouseDown: handleMouseDown,
924
+ role: "slider",
925
+ "aria-valuemin": min,
926
+ "aria-valuemax": max,
927
+ "aria-valuenow": currentValue,
928
+ "aria-valuetext": getAriaValueText === null || getAriaValueText === void 0 ? void 0 : getAriaValueText(currentValue),
929
+ tabIndex: disabled ? -1 : 0
930
+ }, props), /*#__PURE__*/React.createElement("span", {
931
+ style: railStyle
932
+ }), track !== false && /*#__PURE__*/React.createElement("span", {
933
+ style: trackStyle
934
+ }), /*#__PURE__*/React.createElement("span", {
935
+ style: thumbStyle
936
+ }, valueLabelDisplay === "on" && /*#__PURE__*/React.createElement("span", {
937
+ style: {
938
+ position: "absolute",
939
+ bottom: "calc(100% + 8px)",
940
+ left: "50%",
941
+ transform: "translateX(-50%)",
942
+ padding: "4px 8px",
943
+ borderRadius: "4px",
944
+ backgroundColor: "rgba(0, 0, 0, 0.87)",
945
+ color: "#fff",
946
+ fontSize: "12px",
947
+ whiteSpace: "nowrap"
948
+ }
949
+ }, displayValue)), renderMarks());
950
+ });
951
+ BaseSlider.displayName = "BaseSlider";
952
+ const Slider = withSx(BaseSlider);
953
+ /**
954
+ * Rating - Star rating (replaces MUI Rating)
955
+ */
956
+
957
+ const BaseRating = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
958
+ let {
959
+ value,
960
+ defaultValue = 0,
961
+ onChange,
962
+ max = 5,
963
+ precision = 1,
964
+ disabled = false,
965
+ readOnly = false,
966
+ size = "medium",
967
+ emptyIcon,
968
+ icon,
969
+ name,
970
+ style
971
+ } = _ref6,
972
+ props = _objectWithoutProperties(_ref6, _excluded6);
973
+
974
+ const [internalValue, setInternalValue] = useState(defaultValue);
975
+ const [hoverValue, setHoverValue] = useState(-1);
976
+ const currentValue = value !== undefined ? value : internalValue;
977
+ const displayValue = hoverValue !== -1 ? hoverValue : currentValue;
978
+ const sizeMap = {
979
+ small: "18px",
980
+ medium: "24px",
981
+ large: "32px"
982
+ };
983
+ const starSize = sizeMap[size] || sizeMap.medium;
984
+
985
+ const handleClick = newValue => {
986
+ if (disabled || readOnly) return;
987
+
988
+ if (value === undefined) {
989
+ setInternalValue(newValue);
990
+ }
991
+
992
+ onChange === null || onChange === void 0 ? void 0 : onChange({}, newValue);
993
+ };
994
+
995
+ const containerStyle = _objectSpread(_objectSpread({
996
+ display: "inline-flex",
997
+ cursor: disabled || readOnly ? "default" : "pointer"
998
+ }, disabled && {
999
+ opacity: 0.5
1000
+ }), style);
1001
+
1002
+ const starStyle = filled => ({
1003
+ width: starSize,
1004
+ height: starSize,
1005
+ color: filled ? "#faaf00" : "rgba(0, 0, 0, 0.26)",
1006
+ transition: "color 150ms"
1007
+ });
1008
+
1009
+ const Star = _ref7 => {
1010
+ let {
1011
+ filled
1012
+ } = _ref7;
1013
+ return /*#__PURE__*/React.createElement("svg", {
1014
+ style: starStyle(filled),
1015
+ viewBox: "0 0 24 24",
1016
+ fill: "currentColor"
1017
+ }, /*#__PURE__*/React.createElement("path", {
1018
+ d: "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
1019
+ }));
1020
+ };
1021
+
1022
+ return /*#__PURE__*/React.createElement("div", _extends({
1023
+ ref: ref,
1024
+ style: containerStyle,
1025
+ onMouseLeave: () => setHoverValue(-1)
1026
+ }, props), Array.from({
1027
+ length: max
1028
+ }, (_, i) => i + 1).map(star => /*#__PURE__*/React.createElement("span", {
1029
+ key: star,
1030
+ onClick: () => handleClick(star),
1031
+ onMouseEnter: () => !disabled && !readOnly && setHoverValue(star)
1032
+ }, icon ? /*#__PURE__*/React.cloneElement(icon, {
1033
+ filled: star <= displayValue
1034
+ }) : /*#__PURE__*/React.createElement(Star, {
1035
+ filled: star <= displayValue
1036
+ }))));
1037
+ });
1038
+ BaseRating.displayName = "BaseRating";
1039
+ const Rating = withSx(BaseRating);
1040
+
1041
+ export { Checkbox, Radio, Rating, Select, Slider, Switch };