@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,223 @@
1
+ 'use strict';
2
+
3
+ var _extends = require('@babel/runtime/helpers/extends');
4
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
6
+ var React = require('react');
7
+ var withSx = require('./withSx.js');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
12
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
13
+ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
14
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
+
16
+ const _excluded = ["children", "value", "selected", "disabled", "onChange", "onClick", "color", "size", "fullWidth", "className", "style"],
17
+ _excluded2 = ["children", "value", "onChange", "exclusive", "disabled", "color", "size", "orientation", "fullWidth", "className", "style"];
18
+
19
+ 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; }
20
+
21
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
22
+ /**
23
+ * ToggleButton - button that can be toggled on/off
24
+ */
25
+
26
+ const ToggleButtonBase = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
27
+ let {
28
+ children,
29
+ value,
30
+ selected = false,
31
+ disabled = false,
32
+ onChange,
33
+ onClick,
34
+ color = "standard",
35
+ size = "medium",
36
+ fullWidth = false,
37
+ className,
38
+ style
39
+ } = _ref,
40
+ props = _objectWithoutProperties__default["default"](_ref, _excluded);
41
+
42
+ const sizeStyles = {
43
+ small: {
44
+ padding: "4px 8px",
45
+ fontSize: 13
46
+ },
47
+ medium: {
48
+ padding: "8px 12px",
49
+ fontSize: 14
50
+ },
51
+ large: {
52
+ padding: "12px 16px",
53
+ fontSize: 15
54
+ }
55
+ };
56
+ const colorStyles = {
57
+ standard: {
58
+ default: {
59
+ backgroundColor: "transparent",
60
+ color: "#000000",
61
+ borderColor: "rgba(0, 0, 0, 0.12)"
62
+ },
63
+ selected: {
64
+ backgroundColor: "rgba(0, 0, 0, 0.08)",
65
+ color: "#000000",
66
+ borderColor: "rgba(0, 0, 0, 0.12)"
67
+ }
68
+ },
69
+ primary: {
70
+ default: {
71
+ backgroundColor: "transparent",
72
+ color: "#000000",
73
+ borderColor: "rgba(0, 0, 0, 0.12)"
74
+ },
75
+ selected: {
76
+ backgroundColor: "rgba(124, 77, 255, 0.12)",
77
+ color: "#7C4DFF",
78
+ borderColor: "#7C4DFF"
79
+ }
80
+ },
81
+ secondary: {
82
+ default: {
83
+ backgroundColor: "transparent",
84
+ color: "#000000",
85
+ borderColor: "rgba(0, 0, 0, 0.12)"
86
+ },
87
+ selected: {
88
+ backgroundColor: "rgba(255, 64, 129, 0.12)",
89
+ color: "#FF4081",
90
+ borderColor: "#FF4081"
91
+ }
92
+ }
93
+ };
94
+ const currentColorStyle = colorStyles[color] || colorStyles.standard; // Explicitly compute these based on selected boolean to force re-render
95
+
96
+ const backgroundColor = selected ? currentColorStyle.selected.backgroundColor : currentColorStyle.default.backgroundColor;
97
+ const textColor = selected ? currentColorStyle.selected.color : currentColorStyle.default.color;
98
+ const borderColorValue = selected ? currentColorStyle.selected.borderColor : currentColorStyle.default.borderColor;
99
+
100
+ const baseStyle = _objectSpread(_objectSpread(_objectSpread({
101
+ display: "inline-flex",
102
+ alignItems: "center",
103
+ justifyContent: "center",
104
+ border: "1px solid",
105
+ cursor: disabled ? "not-allowed" : "pointer",
106
+ opacity: disabled ? 0.5 : 1,
107
+ transition: "background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out",
108
+ textTransform: "uppercase",
109
+ fontWeight: 500,
110
+ fontFamily: "inherit",
111
+ width: fullWidth ? "100%" : undefined,
112
+ outline: "none"
113
+ }, sizeStyles[size]), style), {}, {
114
+ // These MUST be last to override any style prop
115
+ backgroundColor,
116
+ color: textColor,
117
+ borderColor: borderColorValue
118
+ });
119
+
120
+ const handleClick = event => {
121
+ if (disabled) return; // Blur to clear any focus state that might be holding onto styles
122
+
123
+ event.currentTarget.blur();
124
+ onClick === null || onClick === void 0 ? void 0 : onClick(event, value);
125
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, value);
126
+ };
127
+
128
+ return /*#__PURE__*/React__default["default"].createElement("button", _extends__default["default"]({
129
+ ref: ref,
130
+ className: className,
131
+ style: baseStyle,
132
+ disabled: disabled,
133
+ onClick: handleClick,
134
+ "aria-pressed": selected,
135
+ type: "button"
136
+ }, props), children);
137
+ });
138
+ ToggleButtonBase.displayName = "ToggleButton";
139
+ withSx.withSx(ToggleButtonBase);
140
+ /**
141
+ * ToggleButtonGroup - group of toggle buttons
142
+ */
143
+
144
+ const ToggleButtonGroupBase = /*#__PURE__*/React__default["default"].forwardRef((_ref2, ref) => {
145
+ let {
146
+ children,
147
+ value,
148
+ onChange,
149
+ exclusive = false,
150
+ disabled = false,
151
+ color = "standard",
152
+ size = "medium",
153
+ orientation = "horizontal",
154
+ fullWidth = false,
155
+ className,
156
+ style
157
+ } = _ref2,
158
+ props = _objectWithoutProperties__default["default"](_ref2, _excluded2);
159
+
160
+ const baseStyle = _objectSpread({
161
+ display: "inline-flex",
162
+ flexDirection: orientation === "vertical" ? "column" : "row",
163
+ borderRadius: 4
164
+ }, style);
165
+
166
+ const handleChange = (event, buttonValue) => {
167
+ if (exclusive) {
168
+ // Single selection - toggle off if same value clicked
169
+ const newValue = value === buttonValue ? null : buttonValue;
170
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, newValue);
171
+ } else {
172
+ // Multiple selection
173
+ const currentValue = Array.isArray(value) ? value : [];
174
+ const newValue = currentValue.includes(buttonValue) ? currentValue.filter(v => v !== buttonValue) : [...currentValue, buttonValue];
175
+ onChange === null || onChange === void 0 ? void 0 : onChange(event, newValue);
176
+ }
177
+ };
178
+
179
+ const isSelected = buttonValue => {
180
+ if (exclusive) {
181
+ return value === buttonValue;
182
+ }
183
+
184
+ return Array.isArray(value) && value.includes(buttonValue);
185
+ };
186
+
187
+ return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
188
+ ref: ref,
189
+ className: className,
190
+ style: baseStyle,
191
+ role: "group"
192
+ }, props), React__default["default"].Children.map(children, (child, index) => {
193
+ if (! /*#__PURE__*/React__default["default"].isValidElement(child)) return child;
194
+ const isFirst = index === 0;
195
+ const isLast = index === React__default["default"].Children.count(children) - 1;
196
+ const borderRadiusStyle = orientation === "horizontal" ? {
197
+ borderRadius: 0,
198
+ borderTopLeftRadius: isFirst ? 4 : 0,
199
+ borderBottomLeftRadius: isFirst ? 4 : 0,
200
+ borderTopRightRadius: isLast ? 4 : 0,
201
+ borderBottomRightRadius: isLast ? 4 : 0,
202
+ marginLeft: isFirst ? 0 : -1
203
+ } : {
204
+ borderRadius: 0,
205
+ borderTopLeftRadius: isFirst ? 4 : 0,
206
+ borderTopRightRadius: isFirst ? 4 : 0,
207
+ borderBottomLeftRadius: isLast ? 4 : 0,
208
+ borderBottomRightRadius: isLast ? 4 : 0,
209
+ marginTop: isFirst ? 0 : -1
210
+ };
211
+ return /*#__PURE__*/React__default["default"].cloneElement(child, {
212
+ selected: isSelected(child.props.value),
213
+ onChange: handleChange,
214
+ disabled: disabled || child.props.disabled,
215
+ color: child.props.color || color,
216
+ size: child.props.size || size,
217
+ fullWidth,
218
+ style: _objectSpread(_objectSpread({}, borderRadiusStyle), child.props.style)
219
+ });
220
+ }));
221
+ });
222
+ ToggleButtonGroupBase.displayName = "ToggleButtonGroup";
223
+ withSx.withSx(ToggleButtonGroupBase);
@@ -0,0 +1,306 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
10
+
11
+ 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; }
12
+
13
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
14
+
15
+ /**
16
+ * createTheme - creates a theme object compatible with MUI's createTheme
17
+ * This is a simplified version that merges theme options
18
+ */
19
+ const defaultTheme = {
20
+ palette: {
21
+ mode: "light",
22
+ primary: {
23
+ main: "#7C4DFF",
24
+ light: "#B47CFF",
25
+ dark: "#3F1DCB",
26
+ contrastText: "#FFFFFF"
27
+ },
28
+ secondary: {
29
+ main: "#FF4081",
30
+ light: "#FF79B0",
31
+ dark: "#C60055",
32
+ contrastText: "#FFFFFF"
33
+ },
34
+ error: {
35
+ main: "#F44336",
36
+ light: "#E57373",
37
+ dark: "#D32F2F",
38
+ contrastText: "#FFFFFF"
39
+ },
40
+ warning: {
41
+ main: "#FF9800",
42
+ light: "#FFB74D",
43
+ dark: "#F57C00",
44
+ contrastText: "rgba(0, 0, 0, 0.87)"
45
+ },
46
+ info: {
47
+ main: "#2196F3",
48
+ light: "#64B5F6",
49
+ dark: "#1976D2",
50
+ contrastText: "#FFFFFF"
51
+ },
52
+ success: {
53
+ main: "#4CAF50",
54
+ light: "#81C784",
55
+ dark: "#388E3C",
56
+ contrastText: "rgba(0, 0, 0, 0.87)"
57
+ },
58
+ grey: {
59
+ 50: "#FAFAFA",
60
+ 100: "#F5F5F5",
61
+ 200: "#EEEEEE",
62
+ 300: "#E0E0E0",
63
+ 400: "#BDBDBD",
64
+ 500: "#9E9E9E",
65
+ 600: "#757575",
66
+ 700: "#616161",
67
+ 800: "#424242",
68
+ 900: "#212121",
69
+ A100: "#D5D5D5",
70
+ A200: "#AAAAAA",
71
+ A400: "#616161",
72
+ A700: "#303030"
73
+ },
74
+ text: {
75
+ primary: "rgba(0, 0, 0, 0.87)",
76
+ secondary: "rgba(0, 0, 0, 0.6)",
77
+ disabled: "rgba(0, 0, 0, 0.38)"
78
+ },
79
+ background: {
80
+ paper: "#FFFFFF",
81
+ default: "#FAFAFA"
82
+ },
83
+ divider: "rgba(0, 0, 0, 0.12)",
84
+ action: {
85
+ active: "rgba(0, 0, 0, 0.54)",
86
+ hover: "rgba(0, 0, 0, 0.04)",
87
+ selected: "rgba(0, 0, 0, 0.08)",
88
+ disabled: "rgba(0, 0, 0, 0.26)",
89
+ disabledBackground: "rgba(0, 0, 0, 0.12)"
90
+ }
91
+ },
92
+ typography: {
93
+ fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
94
+ fontSize: 14,
95
+ fontWeightLight: 300,
96
+ fontWeightRegular: 400,
97
+ fontWeightMedium: 500,
98
+ fontWeightBold: 700,
99
+ h1: {
100
+ fontWeight: 300,
101
+ fontSize: "6rem",
102
+ lineHeight: 1.167,
103
+ letterSpacing: "-0.01562em"
104
+ },
105
+ h2: {
106
+ fontWeight: 300,
107
+ fontSize: "3.75rem",
108
+ lineHeight: 1.2,
109
+ letterSpacing: "-0.00833em"
110
+ },
111
+ h3: {
112
+ fontWeight: 400,
113
+ fontSize: "3rem",
114
+ lineHeight: 1.167,
115
+ letterSpacing: "0em"
116
+ },
117
+ h4: {
118
+ fontWeight: 400,
119
+ fontSize: "2.125rem",
120
+ lineHeight: 1.235,
121
+ letterSpacing: "0.00735em"
122
+ },
123
+ h5: {
124
+ fontWeight: 400,
125
+ fontSize: "1.5rem",
126
+ lineHeight: 1.334,
127
+ letterSpacing: "0em"
128
+ },
129
+ h6: {
130
+ fontWeight: 500,
131
+ fontSize: "1.25rem",
132
+ lineHeight: 1.6,
133
+ letterSpacing: "0.0075em"
134
+ },
135
+ subtitle1: {
136
+ fontWeight: 400,
137
+ fontSize: "1rem",
138
+ lineHeight: 1.75,
139
+ letterSpacing: "0.00938em"
140
+ },
141
+ subtitle2: {
142
+ fontWeight: 500,
143
+ fontSize: "0.875rem",
144
+ lineHeight: 1.57,
145
+ letterSpacing: "0.00714em"
146
+ },
147
+ body1: {
148
+ fontWeight: 400,
149
+ fontSize: "1rem",
150
+ lineHeight: 1.5,
151
+ letterSpacing: "0.00938em"
152
+ },
153
+ body2: {
154
+ fontWeight: 400,
155
+ fontSize: "0.875rem",
156
+ lineHeight: 1.43,
157
+ letterSpacing: "0.01071em"
158
+ },
159
+ button: {
160
+ fontWeight: 500,
161
+ fontSize: "0.875rem",
162
+ lineHeight: 1.75,
163
+ letterSpacing: "0.02857em",
164
+ textTransform: "uppercase"
165
+ },
166
+ caption: {
167
+ fontWeight: 400,
168
+ fontSize: "0.75rem",
169
+ lineHeight: 1.66,
170
+ letterSpacing: "0.03333em"
171
+ },
172
+ overline: {
173
+ fontWeight: 400,
174
+ fontSize: "0.75rem",
175
+ lineHeight: 2.66,
176
+ letterSpacing: "0.08333em",
177
+ textTransform: "uppercase"
178
+ }
179
+ },
180
+ spacing: factor => "".concat(8 * factor, "px"),
181
+ shape: {
182
+ borderRadius: 4
183
+ },
184
+ shadows: ["none", "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)", "0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)", "0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)", "0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)" // ... more shadow levels
185
+ ],
186
+ transitions: {
187
+ easing: {
188
+ easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
189
+ easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
190
+ easeIn: "cubic-bezier(0.4, 0, 1, 1)",
191
+ sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
192
+ },
193
+ duration: {
194
+ shortest: 150,
195
+ shorter: 200,
196
+ short: 250,
197
+ standard: 300,
198
+ complex: 375,
199
+ enteringScreen: 225,
200
+ leavingScreen: 195
201
+ }
202
+ },
203
+ zIndex: {
204
+ mobileStepper: 1000,
205
+ fab: 1050,
206
+ speedDial: 1050,
207
+ appBar: 1100,
208
+ drawer: 1200,
209
+ modal: 1300,
210
+ snackbar: 1400,
211
+ tooltip: 1500
212
+ },
213
+ breakpoints: {
214
+ keys: ["xs", "sm", "md", "lg", "xl"],
215
+ values: {
216
+ xs: 0,
217
+ sm: 600,
218
+ md: 900,
219
+ lg: 1200,
220
+ xl: 1536
221
+ },
222
+ up: key => "@media (min-width:".concat(defaultTheme.breakpoints.values[key], "px)"),
223
+ down: key => "@media (max-width:".concat(defaultTheme.breakpoints.values[key] - 0.05, "px)"),
224
+ between: (start, end) => "@media (min-width:".concat(defaultTheme.breakpoints.values[start], "px) and (max-width:").concat(defaultTheme.breakpoints.values[end] - 0.05, "px)"),
225
+ only: key => {
226
+ const keys = defaultTheme.breakpoints.keys;
227
+ const idx = keys.indexOf(key);
228
+
229
+ if (idx === keys.length - 1) {
230
+ return defaultTheme.breakpoints.up(key);
231
+ }
232
+
233
+ return defaultTheme.breakpoints.between(key, keys[idx + 1]);
234
+ }
235
+ },
236
+ components: {}
237
+ };
238
+ /**
239
+ * Deep merge utility
240
+ */
241
+
242
+ function deepMerge(target, source) {
243
+ const output = _objectSpread({}, target);
244
+
245
+ if (isObject(target) && isObject(source)) {
246
+ Object.keys(source).forEach(key => {
247
+ if (isObject(source[key])) {
248
+ if (!(key in target)) {
249
+ output[key] = source[key];
250
+ } else {
251
+ output[key] = deepMerge(target[key], source[key]);
252
+ }
253
+ } else {
254
+ output[key] = source[key];
255
+ }
256
+ });
257
+ }
258
+
259
+ return output;
260
+ }
261
+
262
+ function isObject(item) {
263
+ return item && typeof item === "object" && !Array.isArray(item);
264
+ }
265
+ /**
266
+ * createTheme - creates a custom theme by merging with defaults
267
+ * @param {Object} options - Theme options to merge with defaults
268
+ * @returns {Object} Complete theme object
269
+ */
270
+
271
+
272
+ function createTheme() {
273
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
274
+ const theme = deepMerge(defaultTheme, options); // Rebuild breakpoint functions with merged values
275
+
276
+ theme.breakpoints.up = key => "@media (min-width:".concat(theme.breakpoints.values[key], "px)");
277
+
278
+ theme.breakpoints.down = key => "@media (max-width:".concat(theme.breakpoints.values[key] - 0.05, "px)");
279
+
280
+ theme.breakpoints.between = (start, end) => "@media (min-width:".concat(theme.breakpoints.values[start], "px) and (max-width:").concat(theme.breakpoints.values[end] - 0.05, "px)");
281
+
282
+ theme.breakpoints.only = key => {
283
+ const keys = theme.breakpoints.keys;
284
+ const idx = keys.indexOf(key);
285
+
286
+ if (idx === keys.length - 1) {
287
+ return theme.breakpoints.up(key);
288
+ }
289
+
290
+ return theme.breakpoints.between(key, keys[idx + 1]);
291
+ }; // Ensure spacing function uses merged value
292
+
293
+
294
+ const spacingInput = options.spacing;
295
+
296
+ if (typeof spacingInput === "number") {
297
+ theme.spacing = factor => "".concat(spacingInput * factor, "px");
298
+ } else if (typeof spacingInput === "function") {
299
+ theme.spacing = spacingInput;
300
+ }
301
+
302
+ return theme;
303
+ }
304
+
305
+ exports.createTheme = createTheme;
306
+ exports["default"] = createTheme;
@@ -0,0 +1,171 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('@babel/runtime/helpers/extends');
6
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
8
+ var React = require('react');
9
+ var sxToStyle = require('../neo-utils/sxToStyle.js');
10
+ var ThemeProvider = require('./ThemeProvider.js');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
15
+ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
16
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
+
18
+ const _excluded = ["sx", "style", "className"];
19
+
20
+ 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; }
21
+
22
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23
+
24
+ const canUseDOM = () => typeof window !== 'undefined' && typeof document !== 'undefined'; // Global style cache to avoid re-injecting same styles
25
+
26
+
27
+ const styleCache = new Map();
28
+ let styleSheet = null;
29
+
30
+ function getStyleSheet() {
31
+ if (!canUseDOM()) return null;
32
+ if (styleSheet) return styleSheet; // Check for existing stylesheet
33
+
34
+ const existing = document.querySelector("style[data-blerp-sx]");
35
+
36
+ if (existing) {
37
+ styleSheet = existing.sheet;
38
+ return styleSheet;
39
+ } // Create new stylesheet
40
+
41
+
42
+ const style = document.createElement("style");
43
+ style.setAttribute("data-blerp-sx", "true");
44
+ document.head.appendChild(style);
45
+ styleSheet = style.sheet;
46
+ return styleSheet;
47
+ }
48
+
49
+ function injectStyles(className, pseudoStyles, nestedStyles, mediaQueries, themeColors) {
50
+ if (!canUseDOM()) return;
51
+
52
+ if (!className) {
53
+ return;
54
+ }
55
+
56
+ const hasStyles = pseudoStyles && Object.keys(pseudoStyles).length > 0 || nestedStyles && Object.keys(nestedStyles).length > 0 || mediaQueries && Object.keys(mediaQueries).length > 0;
57
+
58
+ if (!hasStyles) {
59
+ return;
60
+ } // Check cache
61
+
62
+
63
+ const cacheKey = className;
64
+
65
+ if (styleCache.has(cacheKey)) {
66
+ return;
67
+ } // Generate CSS
68
+
69
+
70
+ const css = sxToStyle.generatePseudoCSS(className, pseudoStyles, themeColors, nestedStyles, mediaQueries);
71
+
72
+ if (css) {
73
+ try {
74
+ const sheet = getStyleSheet();
75
+ if (!sheet) return; // Split by newlines and insert each rule
76
+
77
+ css.split("\n").filter(Boolean).forEach(rule => {
78
+ try {
79
+ sheet.insertRule(rule.trim(), sheet.cssRules.length);
80
+ } catch (e) {
81
+ // Rule might be invalid, log for debugging but don't crash
82
+ if (process.env.NODE_ENV === "development") {
83
+ console.warn("Failed to insert CSS rule:", rule, e.message);
84
+ }
85
+ }
86
+ });
87
+ styleCache.set(cacheKey, true);
88
+ } catch (e) {
89
+ console.warn("Failed to inject styles:", e);
90
+ }
91
+ }
92
+ }
93
+ /**
94
+ * Higher-Order Component that adds MUI-compatible `sx` prop support
95
+ *
96
+ * Supports:
97
+ * - Regular style properties (margin, padding, color, etc.)
98
+ * - MUI shorthand props (m, p, mt, px, etc.)
99
+ * - Theme color references (color: "primary.main")
100
+ * - Pseudo-selectors (&:hover, &:disabled, etc.)
101
+ * - Nested selectors (.className, & > div, etc.)
102
+ * - Media queries (@media (max-width: 600px))
103
+ */
104
+
105
+ function withSx(Component) {
106
+ const WrappedComponent = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
107
+ let {
108
+ sx,
109
+ style,
110
+ className
111
+ } = _ref,
112
+ props = _objectWithoutProperties__default["default"](_ref, _excluded);
113
+
114
+ const {
115
+ colors
116
+ } = ThemeProvider.useTheme();
117
+ React.useId().replace(/:/g, ""); // Memoize the style conversion
118
+
119
+ const {
120
+ computedStyle,
121
+ pseudoClassName,
122
+ pseudoStyles,
123
+ nestedStyles,
124
+ mediaQueries
125
+ } = React.useMemo(() => {
126
+ if (!sx) {
127
+ return {
128
+ computedStyle: style || {},
129
+ pseudoClassName: "",
130
+ pseudoStyles: {},
131
+ nestedStyles: {},
132
+ mediaQueries: {}
133
+ };
134
+ }
135
+
136
+ const result = sxToStyle.sxToStyle(sx, colors);
137
+ return {
138
+ computedStyle: _objectSpread(_objectSpread({}, result.style), style),
139
+ pseudoClassName: result.pseudoClassName,
140
+ pseudoStyles: result.pseudoStyles,
141
+ nestedStyles: result.nestedStyles,
142
+ mediaQueries: result.mediaQueries
143
+ };
144
+ }, [sx, style, colors]); // Inject special styles (pseudo, nested, media queries)
145
+
146
+ React.useEffect(() => {
147
+ if (canUseDOM() && pseudoClassName) {
148
+ injectStyles(pseudoClassName, pseudoStyles, nestedStyles, mediaQueries, colors);
149
+ }
150
+ }, [pseudoClassName, pseudoStyles, nestedStyles, mediaQueries, colors]); // Also inject synchronously for SSR/initial render
151
+
152
+ if (canUseDOM() && pseudoClassName) {
153
+ injectStyles(pseudoClassName, pseudoStyles, nestedStyles, mediaQueries, colors);
154
+ } // Combine classNames
155
+
156
+
157
+ const combinedClassName = [className, pseudoClassName].filter(Boolean).join(" ") || undefined;
158
+ return /*#__PURE__*/React__default["default"].createElement(Component, _objectSpread({
159
+ ref,
160
+ style: computedStyle,
161
+ className: combinedClassName,
162
+ sx
163
+ }, props));
164
+ });
165
+ const componentName = typeof Component === "string" ? Component : Component.displayName || Component.name || "Component";
166
+ WrappedComponent.displayName = "withSx(".concat(componentName, ")");
167
+ return WrappedComponent;
168
+ }
169
+
170
+ exports["default"] = withSx;
171
+ exports.withSx = withSx;