@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,480 @@
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, { useId, useState } from 'react';
5
+ import { withSx } from './withSx.js';
6
+ import { useTheme } from './ThemeProvider.js';
7
+
8
+ const _excluded = ["variant", "label", "placeholder", "helperText", "error", "disabled", "required", "fullWidth", "multiline", "rows", "maxRows", "minRows", "type", "value", "defaultValue", "onChange", "onFocus", "onBlur", "onClick", "onKeyDown", "InputProps", "inputProps", "InputLabelProps", "FormHelperTextProps", "size", "color", "darkMode", "autoFocus", "autoComplete", "name", "id", "inputRef", "startAdornment", "endAdornment", "style", "sx"],
9
+ _excluded2 = ["position", "children", "disablePointerEvents", "style"],
10
+ _excluded3 = ["children", "error", "disabled", "style"];
11
+
12
+ 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; }
13
+
14
+ 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; }
15
+
16
+ const resolveStyleValue = (value, colors) => {
17
+ if (typeof value === "string" && value.includes(".main")) {
18
+ const colorKey = value.replace(".main", "");
19
+ const color = colors === null || colors === void 0 ? void 0 : colors[colorKey];
20
+ if (color) return typeof color === "object" ? color.main : color;
21
+ }
22
+
23
+ return value;
24
+ };
25
+
26
+ const resolveStyles = (styleObj, colors) => {
27
+ if (!styleObj) return {};
28
+ const resolved = {};
29
+
30
+ for (const [key, value] of Object.entries(styleObj)) {
31
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
32
+ // Skip pseudo-selectors and nested objects for inline styles
33
+ if (key.startsWith("&") || key.startsWith(":")) continue;
34
+ resolved[key] = resolveStyles(value, colors);
35
+ } else {
36
+ resolved[key] = resolveStyleValue(value, colors);
37
+ }
38
+ }
39
+
40
+ return resolved;
41
+ };
42
+
43
+ const canUseDOM = () => typeof window !== "undefined" && typeof document !== "undefined";
44
+ /**
45
+ * Input/TextField - Form input component (replaces MUI TextField)
46
+ * Supports variants: outlined, filled, standard
47
+ *
48
+ * DEFAULTS TO DARK MODE (white text/borders) since most Blerp UI is on dark backgrounds.
49
+ * Pass darkMode={false} to use light mode styling.
50
+ */
51
+
52
+
53
+ const BaseInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
54
+ let {
55
+ variant = "outlined",
56
+ label,
57
+ placeholder,
58
+ helperText,
59
+ error = false,
60
+ disabled = false,
61
+ required = false,
62
+ fullWidth = false,
63
+ multiline = false,
64
+ rows,
65
+ maxRows,
66
+ minRows,
67
+ type = "text",
68
+ value,
69
+ defaultValue,
70
+ onChange,
71
+ onFocus,
72
+ onBlur,
73
+ onClick,
74
+ onKeyDown,
75
+ InputProps = {},
76
+ inputProps = {},
77
+ InputLabelProps = {},
78
+ FormHelperTextProps = {},
79
+ size = "medium",
80
+ color = "primary",
81
+ darkMode: forceDarkMode,
82
+ autoFocus,
83
+ autoComplete,
84
+ name,
85
+ id: providedId,
86
+ inputRef,
87
+ startAdornment,
88
+ endAdornment,
89
+ style,
90
+ sx
91
+ } = _ref,
92
+ props = _objectWithoutProperties(_ref, _excluded);
93
+
94
+ const {
95
+ colors,
96
+ mode
97
+ } = useTheme();
98
+ const generatedId = useId();
99
+ const id = providedId || generatedId;
100
+ const [focused, setFocused] = useState(false);
101
+ const [internalValue, setInternalValue] = useState(defaultValue || ""); // Track actual value for label shrink detection
102
+
103
+ const currentValue = value !== undefined ? value : internalValue; // Helper to resolve theme colors
104
+
105
+ const getColor = (colorKey, fallback) => {
106
+ const c = colors === null || colors === void 0 ? void 0 : colors[colorKey];
107
+ if (!c) return fallback;
108
+ return typeof c === "object" ? c.main : c;
109
+ };
110
+
111
+ const colorValue = (colors === null || colors === void 0 ? void 0 : colors[color]) || (colors === null || colors === void 0 ? void 0 : colors.primary);
112
+ const mainColor = typeof colorValue === "object" ? colorValue.main : colorValue || "#21A5A2";
113
+ const errorColor = getColor("error", "#d32f2f"); // FORCE dark mode styling by default - most Blerp UI is on dark backgrounds
114
+ // Can be overridden with darkMode={false} prop if needed on light backgrounds
115
+
116
+ const isDark = forceDarkMode !== undefined ? forceDarkMode : true; // Colors - defaulting to white/light for dark backgrounds
117
+
118
+ const textColor = isDark ? "#FFFFFF" : "#21000C";
119
+ const labelColor = isDark ? "rgba(255, 255, 255, 0.7)" : "rgba(0, 0, 0, 0.6)";
120
+ const focusedLabelColor = isDark ? "#FFFFFF" : mainColor;
121
+ const borderColor = isDark ? "rgba(255, 255, 255, 0.5)" : "rgba(0, 0, 0, 0.23)";
122
+ const focusedBorderColor = isDark ? "#FFFFFF" : mainColor;
123
+ const bgColor = isDark ? "rgba(255, 255, 255, 0.08)" : "rgba(0, 0, 0, 0.04)";
124
+ const hoverBgColor = isDark ? "rgba(255, 255, 255, 0.12)" : "rgba(0, 0, 0, 0.06)";
125
+ const placeholderColor = isDark ? "rgba(255, 255, 255, 0.35)" : "rgba(0, 0, 0, 0.35)";
126
+ const labelBgColor = isDark ? "#212121" : "#FFFFFF";
127
+ const hasValue = currentValue !== undefined && currentValue !== null && currentValue !== "";
128
+ const hasPlaceholder = Boolean(placeholder); // Label should shrink if: focused, has value, OR has a placeholder (so they don't overlap)
129
+
130
+ const isLabelShrunk = focused || hasValue || hasPlaceholder; // Resolve InputProps.sx styles to actual style values
131
+
132
+ const inputPropsSx = resolveStyles(InputProps.sx || {}, colors); // Container styles
133
+
134
+ const containerStyle = _objectSpread(_objectSpread({
135
+ display: "inline-flex",
136
+ flexDirection: "column",
137
+ position: "relative",
138
+ minWidth: 0,
139
+ padding: 0,
140
+ margin: 0,
141
+ border: 0,
142
+ verticalAlign: "top"
143
+ }, fullWidth && {
144
+ width: "100%"
145
+ }), style); // Determine current border color based on state
146
+
147
+
148
+ const getCurrentBorderColor = () => {
149
+ if (error) return errorColor;
150
+ if (focused) return focusedBorderColor;
151
+ return borderColor;
152
+ }; // Input wrapper styles (the bordered box)
153
+
154
+
155
+ const getWrapperStyles = () => {
156
+ const activeBorderColor = getCurrentBorderColor(); // Check if InputProps.sx overrides border-related styles
157
+
158
+ const hasBorderOverride = inputPropsSx.border !== undefined || inputPropsSx.borderColor !== undefined;
159
+ const hasRadiusOverride = inputPropsSx.borderRadius !== undefined;
160
+ const hasBgOverride = inputPropsSx.backgroundColor !== undefined || inputPropsSx.background !== undefined;
161
+ const hasHeightOverride = inputPropsSx.height !== undefined;
162
+ const hasPaddingOverride = inputPropsSx.padding !== undefined;
163
+ const base = {
164
+ display: "flex",
165
+ alignItems: "center",
166
+ position: "relative",
167
+ borderRadius: hasRadiusOverride ? inputPropsSx.borderRadius : "6px",
168
+ transition: "border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease",
169
+ cursor: disabled ? "default" : "text",
170
+ backgroundColor: hasBgOverride ? inputPropsSx.backgroundColor || inputPropsSx.background : "transparent",
171
+ minHeight: hasHeightOverride ? undefined : size === "small" ? "32px" : "40px",
172
+ height: hasHeightOverride ? inputPropsSx.height : undefined,
173
+ boxSizing: inputPropsSx.boxSizing || "border-box"
174
+ }; // If there's a complete style override from InputProps.sx, use minimal base styling
175
+
176
+ if (hasBorderOverride || inputPropsSx.border === "none") {
177
+ return _objectSpread(_objectSpread({}, base), {}, {
178
+ border: inputPropsSx.border !== undefined ? inputPropsSx.border : "none",
179
+ borderColor: inputPropsSx.borderColor,
180
+ padding: hasPaddingOverride ? inputPropsSx.padding : undefined
181
+ }, inputPropsSx);
182
+ }
183
+
184
+ switch (variant) {
185
+ case "filled":
186
+ return _objectSpread(_objectSpread({}, base), {}, {
187
+ backgroundColor: hasBgOverride ? inputPropsSx.backgroundColor || inputPropsSx.background : focused ? hoverBgColor : bgColor,
188
+ borderBottom: "2px solid ".concat(activeBorderColor),
189
+ borderRadius: hasRadiusOverride ? inputPropsSx.borderRadius : "8px 8px 0 0",
190
+ paddingTop: label ? "20px" : "0"
191
+ }, inputPropsSx);
192
+
193
+ case "standard":
194
+ return _objectSpread(_objectSpread({}, base), {}, {
195
+ borderBottom: "".concat(focused ? "2px" : "1px", " solid ").concat(activeBorderColor),
196
+ borderRadius: 0,
197
+ paddingTop: label ? "16px" : "0",
198
+ paddingBottom: focused ? "0px" : "1px"
199
+ }, inputPropsSx);
200
+
201
+ case "outlined":
202
+ default:
203
+ return _objectSpread(_objectSpread({}, base), {}, {
204
+ border: "".concat(focused ? "2px" : "1px", " solid ").concat(activeBorderColor),
205
+ padding: focused ? "0px" : "1px",
206
+ boxShadow: focused ? "0 0 0 3px ".concat(isDark ? "rgba(255,255,255,0.1)" : "".concat(mainColor, "20")) : "none"
207
+ }, inputPropsSx);
208
+ }
209
+ }; // Input element styles
210
+
211
+
212
+ const getInputStyles = () => {
213
+ // Check for font/text overrides
214
+ const fontSize = inputPropsSx.fontSize || (size === "small" ? "14px" : "16px");
215
+ const caretColor = inputPropsSx.caretColor;
216
+ return _objectSpread(_objectSpread({
217
+ fontFamily: "inherit",
218
+ fontSize: fontSize,
219
+ fontWeight: 400,
220
+ letterSpacing: "0.01em",
221
+ lineHeight: 1.5,
222
+ color: textColor,
223
+ // Always use theme text color (white for dark mode)
224
+ border: 0,
225
+ boxSizing: "border-box",
226
+ background: "none",
227
+ margin: 0,
228
+ display: "block",
229
+ minWidth: 0,
230
+ width: "100%",
231
+ outline: "none",
232
+ padding: "4px 8px",
233
+ resize: multiline ? "vertical" : "none",
234
+ WebkitTextFillColor: textColor
235
+ }, caretColor && {
236
+ caretColor
237
+ }), disabled && {
238
+ opacity: 0.5,
239
+ cursor: "not-allowed"
240
+ });
241
+ }; // Label styles
242
+
243
+
244
+ const getLabelStyles = () => {
245
+ const leftPos = variant === "outlined" ? "11px" : variant === "filled" ? "11px" : "0";
246
+
247
+ const getTransform = () => {
248
+ if (isLabelShrunk) {
249
+ switch (variant) {
250
+ case "outlined":
251
+ return "translate(0, -50%) scale(0.75)";
252
+
253
+ case "filled":
254
+ return "translate(0, -100%) scale(0.75)";
255
+
256
+ case "standard":
257
+ return "translate(0, -100%) scale(0.75)";
258
+
259
+ default:
260
+ return "translate(0, -50%) scale(0.75)";
261
+ }
262
+ }
263
+
264
+ return "translate(0, -50%) scale(1)";
265
+ };
266
+
267
+ const getTop = () => {
268
+ if (variant === "outlined") {
269
+ return isLabelShrunk ? "0" : "50%";
270
+ }
271
+
272
+ if (variant === "filled") {
273
+ return isLabelShrunk ? "8px" : "50%";
274
+ }
275
+
276
+ return isLabelShrunk ? "0" : "50%";
277
+ };
278
+
279
+ return _objectSpread({
280
+ position: "absolute",
281
+ left: leftPos,
282
+ top: getTop(),
283
+ transform: getTransform(),
284
+ transformOrigin: "top left",
285
+ transition: "transform 200ms cubic-bezier(0.4, 0, 0.2, 1), color 200ms cubic-bezier(0.4, 0, 0.2, 1), top 200ms cubic-bezier(0.4, 0, 0.2, 1)",
286
+ color: error ? errorColor : focused ? focusedLabelColor : labelColor,
287
+ pointerEvents: "none",
288
+ backgroundColor: variant === "outlined" && isLabelShrunk ? labelBgColor : "transparent",
289
+ padding: variant === "outlined" && isLabelShrunk ? "0 6px" : "4px",
290
+ marginLeft: variant === "outlined" && isLabelShrunk ? "-4px" : 0,
291
+ fontSize: "11px",
292
+ fontWeight: 400,
293
+ lineHeight: 1.4,
294
+ whiteSpace: "nowrap",
295
+ overflow: "hidden",
296
+ textOverflow: "ellipsis",
297
+ maxWidth: isLabelShrunk ? "133%" : "calc(100% - 32px)",
298
+ zIndex: 1
299
+ }, InputLabelProps.style);
300
+ }; // Helper text styles
301
+
302
+
303
+ const helperTextStyle = _objectSpread({
304
+ fontSize: "12px",
305
+ fontWeight: 400,
306
+ lineHeight: 1.4,
307
+ marginTop: "6px",
308
+ marginLeft: variant === "standard" ? "0" : "14px",
309
+ marginRight: "14px",
310
+ color: error ? errorColor : labelColor
311
+ }, FormHelperTextProps.style);
312
+
313
+ const handleFocus = e => {
314
+ setFocused(true);
315
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
316
+ };
317
+
318
+ const handleBlur = e => {
319
+ setFocused(false);
320
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
321
+ };
322
+
323
+ const handleChange = e => {
324
+ if (value === undefined) {
325
+ setInternalValue(e.target.value);
326
+ }
327
+
328
+ onChange === null || onChange === void 0 ? void 0 : onChange(e);
329
+ };
330
+
331
+ const handleClick = e => {
332
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
333
+
334
+ if (!disabled && canUseDOM()) {
335
+ const input = document.getElementById(id);
336
+ input === null || input === void 0 ? void 0 : input.focus();
337
+ }
338
+ };
339
+
340
+ const InputComponent = multiline ? "textarea" : "input"; // Create a safe CSS ID for the style block
341
+
342
+ const safeId = id.replace(/:/g, "\\:"); // Text color is always based on dark/light mode, not InputProps.sx.color
343
+ // (InputProps.sx.color in MUI is typically for border/accent, not text)
344
+
345
+ const resolvedTextColor = textColor; // Combine refs
346
+
347
+ const setRefs = el => {
348
+ if (typeof ref === "function") ref(el);else if (ref) ref.current = el;
349
+ if (typeof inputRef === "function") inputRef(el);else if (inputRef) inputRef.current = el;
350
+ };
351
+
352
+ return /*#__PURE__*/React.createElement("div", _extends({
353
+ style: containerStyle
354
+ }, props), /*#__PURE__*/React.createElement("style", null, "\n #".concat(safeId, "::placeholder {\n color: ").concat(placeholderColor, " !important;\n opacity: 1 !important;\n font-style: italic !important;\n font-weight: 300 !important;\n }\n #").concat(safeId, "::-webkit-input-placeholder {\n color: ").concat(placeholderColor, " !important;\n font-style: italic !important;\n font-weight: 300 !important;\n }\n #").concat(safeId, "::-moz-placeholder {\n color: ").concat(placeholderColor, " !important;\n font-style: italic !important;\n font-weight: 300 !important;\n }\n #").concat(safeId, " {\n color: ").concat(resolvedTextColor, " !important;\n -webkit-text-fill-color: ").concat(resolvedTextColor, " !important;\n }\n ")), /*#__PURE__*/React.createElement("div", {
355
+ style: getWrapperStyles(),
356
+ onClick: handleClick
357
+ }, label && /*#__PURE__*/React.createElement("label", _extends({
358
+ htmlFor: id,
359
+ style: getLabelStyles()
360
+ }, InputLabelProps), label, required && /*#__PURE__*/React.createElement("span", {
361
+ style: {
362
+ color: errorColor,
363
+ marginLeft: "2px"
364
+ }
365
+ }, "*")), (startAdornment || InputProps.startAdornment) && /*#__PURE__*/React.createElement("div", {
366
+ style: {
367
+ display: "flex",
368
+ alignItems: "center",
369
+ paddingLeft: "4px",
370
+ color: labelColor,
371
+ flexShrink: 0
372
+ }
373
+ }, startAdornment || InputProps.startAdornment), /*#__PURE__*/React.createElement(InputComponent, _extends({
374
+ ref: setRefs,
375
+ id: id,
376
+ type: type,
377
+ style: getInputStyles(),
378
+ placeholder: placeholder,
379
+ disabled: disabled,
380
+ required: required,
381
+ value: value,
382
+ defaultValue: defaultValue,
383
+ onChange: handleChange,
384
+ onFocus: handleFocus,
385
+ onBlur: handleBlur,
386
+ onKeyDown: onKeyDown,
387
+ autoFocus: autoFocus,
388
+ autoComplete: autoComplete,
389
+ name: name,
390
+ rows: multiline ? rows || minRows || 3 : undefined,
391
+ "aria-invalid": error,
392
+ "aria-describedby": helperText ? "".concat(id, "-helper-text") : undefined
393
+ }, inputProps, InputProps.inputProps)), (endAdornment || InputProps.endAdornment) && /*#__PURE__*/React.createElement("div", {
394
+ style: {
395
+ display: "flex",
396
+ alignItems: "center",
397
+ paddingRight: "4px",
398
+ color: labelColor,
399
+ flexShrink: 0
400
+ }
401
+ }, endAdornment || InputProps.endAdornment)), helperText && /*#__PURE__*/React.createElement("p", _extends({
402
+ id: "".concat(id, "-helper-text"),
403
+ style: helperTextStyle
404
+ }, FormHelperTextProps), helperText));
405
+ });
406
+ BaseInput.displayName = "BaseInput";
407
+ const Input = withSx(BaseInput);
408
+ const TextField = Input; // Alias for MUI compatibility
409
+
410
+ /**
411
+ * InputAdornment - For adding icons/text to inputs
412
+ */
413
+
414
+ const InputAdornment = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
415
+ let {
416
+ position = "start",
417
+ children,
418
+ disablePointerEvents = false,
419
+ style
420
+ } = _ref2,
421
+ props = _objectWithoutProperties(_ref2, _excluded2);
422
+
423
+ const adornmentStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
424
+ display: "flex",
425
+ alignItems: "center",
426
+ justifyContent: "center",
427
+ height: "100%",
428
+ color: "rgba(255, 255, 255, 0.7)",
429
+ whiteSpace: "nowrap"
430
+ }, position === "start" && {
431
+ marginRight: "4px"
432
+ }), position === "end" && {
433
+ marginLeft: "4px"
434
+ }), disablePointerEvents && {
435
+ pointerEvents: "none"
436
+ }), style);
437
+
438
+ return /*#__PURE__*/React.createElement("div", _extends({
439
+ ref: ref,
440
+ style: adornmentStyle
441
+ }, props), children);
442
+ });
443
+ InputAdornment.displayName = "InputAdornment";
444
+ /**
445
+ * FormHelperText - Standalone helper text component
446
+ */
447
+
448
+ const FormHelperText = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
449
+ var _colors$error;
450
+
451
+ let {
452
+ children,
453
+ error = false,
454
+ disabled = false,
455
+ style
456
+ } = _ref3,
457
+ props = _objectWithoutProperties(_ref3, _excluded3);
458
+
459
+ const {
460
+ colors
461
+ } = useTheme();
462
+ const errorColor = (colors === null || colors === void 0 ? void 0 : (_colors$error = colors.error) === null || _colors$error === void 0 ? void 0 : _colors$error.main) || "#d32f2f";
463
+
464
+ const helperStyle = _objectSpread({
465
+ fontSize: "12px",
466
+ fontWeight: 400,
467
+ lineHeight: 1.4,
468
+ margin: "6px 14px 0",
469
+ color: error ? errorColor : "rgba(255, 255, 255, 0.7)",
470
+ opacity: disabled ? 0.6 : 1
471
+ }, style);
472
+
473
+ return /*#__PURE__*/React.createElement("p", _extends({
474
+ ref: ref,
475
+ style: helperStyle
476
+ }, props), children);
477
+ });
478
+ FormHelperText.displayName = "FormHelperText";
479
+
480
+ export { FormHelperText, Input, InputAdornment, TextField, Input as default };