@blerp/design 1.3.16 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Blerp/BlerpImageRow.js +176 -57
- package/dist/cjs/Blerp/BlerpSavePopup.js +44 -40
- package/dist/cjs/Blerp/BlerpTitleRow.js +36 -19
- package/dist/cjs/Blerp/BlerpTopRow.js +110 -44
- package/dist/cjs/Blerp.js +9 -16
- package/dist/cjs/BlerpAudioContextProvider.js +2 -2
- package/dist/cjs/BlerpListView.js +318 -168
- package/dist/cjs/BlerpListViewPremium.js +155 -130
- package/dist/cjs/BlerpListViewSkeleton.js +60 -13
- package/dist/cjs/BlerpSkeleton.js +32 -9
- package/dist/cjs/CollectionCard.js +139 -60
- package/dist/cjs/CollectionListViewPremium.js +368 -297
- package/dist/cjs/CollectionSkeleton.js +74 -13
- package/dist/cjs/Dropdown.js +272 -172
- package/dist/cjs/EllipsisLoader.js +66 -21
- package/dist/cjs/GroupCard.js +64 -57
- package/dist/cjs/Icons/Icons.js +288 -426
- package/dist/cjs/ImageEditor.js +247 -0
- package/dist/cjs/ImageUpload.js +226 -0
- package/dist/cjs/NewBlerp.js +354 -160
- package/dist/cjs/NewBlerpTest.js +10 -792
- package/dist/cjs/NewCollectionModal.js +294 -310
- package/dist/cjs/PremiumCollectionCard.js +191 -454
- package/dist/cjs/PurchaseModals/CheckoutModal.js +1 -1
- package/dist/cjs/PurchaseModals/PremiumBlerpCheckoutModal.js +1 -1
- package/dist/cjs/PurchaseModals/PremiumCollectionCheckoutModal.js +1 -1
- package/dist/cjs/PurchaseModals/PremiumSubscriptionCheckoutModal.js +1 -1
- package/dist/cjs/ReactionButtons.js +26 -13
- package/dist/cjs/SnackbarContextProvider.js +200 -116
- package/dist/cjs/Theme.js +217 -90
- package/dist/cjs/Toggle.js +86 -32
- package/dist/cjs/UserCard.js +13 -32
- package/dist/cjs/UserPage/LibraryControls.js +180 -93
- package/dist/cjs/UserPage/UserLibraryHeader.js +23 -14
- package/dist/cjs/UserPage/UserProfileHeader.js +120 -105
- package/dist/cjs/UsernameWithPopout.js +12 -8
- package/dist/cjs/colors.js +15 -8
- package/dist/cjs/helpers.js +131 -0
- package/dist/cjs/index.js +98 -52
- package/dist/cjs/neo-components/Autocomplete.js +280 -0
- package/dist/cjs/neo-components/BottomNavigation.js +120 -0
- package/dist/cjs/neo-components/Box.js +48 -0
- package/dist/cjs/neo-components/Button.js +206 -0
- package/dist/cjs/neo-components/CircularProgress.js +92 -0
- package/dist/cjs/neo-components/Container.js +75 -0
- package/dist/cjs/neo-components/Dialog.js +441 -0
- package/dist/cjs/neo-components/Fab.js +237 -0
- package/dist/cjs/neo-components/FormControls.js +1057 -0
- package/dist/cjs/neo-components/Grid.js +256 -0
- package/dist/cjs/neo-components/IconButton.js +111 -0
- package/dist/cjs/neo-components/Input.js +493 -0
- package/dist/cjs/neo-components/Layout.js +1213 -0
- package/dist/cjs/neo-components/Misc.js +858 -0
- package/dist/cjs/neo-components/Navigation.js +1578 -0
- package/dist/cjs/neo-components/Paper.js +256 -0
- package/dist/cjs/neo-components/Stack.js +194 -0
- package/dist/cjs/neo-components/Stepper.js +291 -0
- package/dist/cjs/neo-components/Text.js +290 -0
- package/dist/cjs/neo-components/ThemeProvider.js +731 -0
- package/dist/cjs/neo-components/ToggleButton.js +223 -0
- package/dist/cjs/neo-components/createTheme.js +306 -0
- package/dist/cjs/neo-components/withSx.js +164 -0
- package/dist/cjs/neo-utils/sxToStyle.js +508 -0
- package/dist/esm/Blerp/BlerpImageRow.js +166 -46
- package/dist/esm/Blerp/BlerpSavePopup.js +35 -27
- package/dist/esm/Blerp/BlerpTitleRow.js +32 -13
- package/dist/esm/Blerp/BlerpTopRow.js +85 -16
- package/dist/esm/Blerp.js +4 -12
- package/dist/esm/BlerpAudioContextProvider.js +1 -2
- package/dist/esm/BlerpListView.js +313 -160
- package/dist/esm/BlerpListViewPremium.js +135 -109
- package/dist/esm/BlerpListViewSkeleton.js +60 -11
- package/dist/esm/BlerpSkeleton.js +32 -7
- package/dist/esm/CollectionCard.js +118 -38
- package/dist/esm/CollectionListViewPremium.js +367 -294
- package/dist/esm/CollectionSkeleton.js +73 -11
- package/dist/esm/Dropdown.js +260 -161
- package/dist/esm/EllipsisLoader.js +63 -18
- package/dist/esm/GroupCard.js +54 -46
- package/dist/esm/Icons/Icons.js +226 -367
- package/dist/esm/ImageEditor.js +240 -0
- package/dist/esm/ImageUpload.js +217 -0
- package/dist/esm/NewBlerp.js +282 -79
- package/dist/esm/NewBlerpTest.js +11 -781
- package/dist/esm/NewCollectionModal.js +289 -304
- package/dist/esm/PremiumCollectionCard.js +192 -451
- package/dist/esm/PurchaseModals/CheckoutModal.js +1 -1
- package/dist/esm/PurchaseModals/PremiumBlerpCheckoutModal.js +1 -1
- package/dist/esm/PurchaseModals/PremiumCollectionCheckoutModal.js +1 -1
- package/dist/esm/PurchaseModals/PremiumSubscriptionCheckoutModal.js +1 -1
- package/dist/esm/ReactionButtons.js +23 -8
- package/dist/esm/SnackbarContextProvider.js +196 -110
- package/dist/esm/Theme.js +187 -66
- package/dist/esm/Toggle.js +84 -29
- package/dist/esm/UserCard.js +1 -20
- package/dist/esm/UserPage/LibraryControls.js +159 -65
- package/dist/esm/UserPage/UserLibraryHeader.js +18 -10
- package/dist/esm/UserPage/UserProfileHeader.js +100 -79
- package/dist/esm/UsernameWithPopout.js +7 -4
- package/dist/esm/colors.js +11 -9
- package/dist/esm/helpers.js +122 -0
- package/dist/esm/icons.js +1 -1
- package/dist/esm/index.js +39 -3
- package/dist/esm/neo-components/Autocomplete.js +269 -0
- package/dist/esm/neo-components/BottomNavigation.js +109 -0
- package/dist/esm/neo-components/Box.js +36 -0
- package/dist/esm/neo-components/Button.js +194 -0
- package/dist/esm/neo-components/CircularProgress.js +81 -0
- package/dist/esm/neo-components/Container.js +63 -0
- package/dist/esm/neo-components/Dialog.js +423 -0
- package/dist/esm/neo-components/Fab.js +225 -0
- package/dist/esm/neo-components/FormControls.js +1041 -0
- package/dist/esm/neo-components/Grid.js +244 -0
- package/dist/esm/neo-components/IconButton.js +99 -0
- package/dist/esm/neo-components/Input.js +478 -0
- package/dist/esm/neo-components/Layout.js +1179 -0
- package/dist/esm/neo-components/Misc.js +840 -0
- package/dist/esm/neo-components/Navigation.js +1556 -0
- package/dist/esm/neo-components/Paper.js +243 -0
- package/dist/esm/neo-components/Stack.js +182 -0
- package/dist/esm/neo-components/Stepper.js +278 -0
- package/dist/esm/neo-components/Text.js +277 -0
- package/dist/esm/neo-components/ThemeProvider.js +718 -0
- package/dist/esm/neo-components/ToggleButton.js +214 -0
- package/dist/esm/neo-components/createTheme.js +297 -0
- package/dist/esm/neo-components/withSx.js +153 -0
- package/dist/esm/neo-utils/sxToStyle.js +502 -0
- package/package.json +19 -15
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _extends = 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 withSx = require('./withSx.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
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 = ["activeStep", "alternativeLabel", "children", "connector", "nonLinear", "orientation", "className", "style"],
|
|
19
|
+
_excluded2 = ["active", "completed", "disabled", "index", "alternativeLabel", "orientation", "children", "className", "style"],
|
|
20
|
+
_excluded3 = ["active", "completed", "disabled", "index", "icon", "optional", "StepIconComponent", "StepIconProps", "children", "className", "style"],
|
|
21
|
+
_excluded4 = ["active", "children", "TransitionComponent", "transitionDuration", "className", "style"],
|
|
22
|
+
_excluded5 = ["active", "completed", "disabled", "index", "icon", "optional", "children", "onClick", "className", "style"],
|
|
23
|
+
_excluded6 = ["orientation", "className", "style"];
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
/**
|
|
29
|
+
* Stepper - displays progress through a sequence of steps
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const StepperBase = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
33
|
+
let {
|
|
34
|
+
activeStep = 0,
|
|
35
|
+
alternativeLabel = false,
|
|
36
|
+
children,
|
|
37
|
+
connector,
|
|
38
|
+
nonLinear = false,
|
|
39
|
+
orientation = "horizontal",
|
|
40
|
+
className,
|
|
41
|
+
style
|
|
42
|
+
} = _ref,
|
|
43
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
44
|
+
|
|
45
|
+
const baseStyle = _objectSpread({
|
|
46
|
+
display: "flex",
|
|
47
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
48
|
+
alignItems: alternativeLabel ? "flex-start" : "center"
|
|
49
|
+
}, style);
|
|
50
|
+
|
|
51
|
+
const steps = React__default["default"].Children.toArray(children);
|
|
52
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
|
|
53
|
+
ref: ref,
|
|
54
|
+
className: className,
|
|
55
|
+
style: baseStyle
|
|
56
|
+
}, props), steps.map((step, index) => /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
57
|
+
key: index
|
|
58
|
+
}, /*#__PURE__*/React__default["default"].cloneElement(step, {
|
|
59
|
+
index,
|
|
60
|
+
active: activeStep === index,
|
|
61
|
+
completed: activeStep > index,
|
|
62
|
+
disabled: !nonLinear && activeStep < index,
|
|
63
|
+
alternativeLabel,
|
|
64
|
+
orientation
|
|
65
|
+
}), index < steps.length - 1 && (connector || /*#__PURE__*/React__default["default"].createElement(StepConnector, {
|
|
66
|
+
orientation: orientation
|
|
67
|
+
})))));
|
|
68
|
+
});
|
|
69
|
+
StepperBase.displayName = "Stepper";
|
|
70
|
+
const Stepper = withSx.withSx(StepperBase);
|
|
71
|
+
/**
|
|
72
|
+
* Step - individual step in a Stepper
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
const StepBase = /*#__PURE__*/React__default["default"].forwardRef((_ref2, ref) => {
|
|
76
|
+
let {
|
|
77
|
+
active = false,
|
|
78
|
+
completed = false,
|
|
79
|
+
disabled = false,
|
|
80
|
+
index,
|
|
81
|
+
alternativeLabel,
|
|
82
|
+
orientation,
|
|
83
|
+
children,
|
|
84
|
+
className,
|
|
85
|
+
style
|
|
86
|
+
} = _ref2,
|
|
87
|
+
props = _objectWithoutProperties__default["default"](_ref2, _excluded2);
|
|
88
|
+
|
|
89
|
+
const baseStyle = _objectSpread({
|
|
90
|
+
display: "flex",
|
|
91
|
+
flexDirection: alternativeLabel ? "column" : "row",
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
flex: orientation === "horizontal" ? 1 : undefined,
|
|
94
|
+
opacity: disabled ? 0.5 : 1
|
|
95
|
+
}, style);
|
|
96
|
+
|
|
97
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
|
|
98
|
+
ref: ref,
|
|
99
|
+
className: className,
|
|
100
|
+
style: baseStyle
|
|
101
|
+
}, props), React__default["default"].Children.map(children, child => /*#__PURE__*/React__default["default"].isValidElement(child) ? /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
102
|
+
active,
|
|
103
|
+
completed,
|
|
104
|
+
disabled,
|
|
105
|
+
index
|
|
106
|
+
}) : child));
|
|
107
|
+
});
|
|
108
|
+
StepBase.displayName = "Step";
|
|
109
|
+
withSx.withSx(StepBase);
|
|
110
|
+
/**
|
|
111
|
+
* StepLabel - label for a Step
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
const StepLabelBase = /*#__PURE__*/React__default["default"].forwardRef((_ref3, ref) => {
|
|
115
|
+
let {
|
|
116
|
+
active,
|
|
117
|
+
completed,
|
|
118
|
+
disabled,
|
|
119
|
+
index,
|
|
120
|
+
icon,
|
|
121
|
+
optional,
|
|
122
|
+
StepIconComponent,
|
|
123
|
+
StepIconProps,
|
|
124
|
+
children,
|
|
125
|
+
className,
|
|
126
|
+
style
|
|
127
|
+
} = _ref3,
|
|
128
|
+
props = _objectWithoutProperties__default["default"](_ref3, _excluded3);
|
|
129
|
+
|
|
130
|
+
const baseStyle = _objectSpread({
|
|
131
|
+
display: "flex",
|
|
132
|
+
alignItems: "center",
|
|
133
|
+
gap: 8
|
|
134
|
+
}, style);
|
|
135
|
+
|
|
136
|
+
const iconStyle = {
|
|
137
|
+
width: 24,
|
|
138
|
+
height: 24,
|
|
139
|
+
borderRadius: "50%",
|
|
140
|
+
display: "flex",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
justifyContent: "center",
|
|
143
|
+
fontSize: 12,
|
|
144
|
+
fontWeight: 600,
|
|
145
|
+
backgroundColor: completed ? "#7C4DFF" : active ? "#7C4DFF" : "#BDBDBD",
|
|
146
|
+
color: "#FFFFFF"
|
|
147
|
+
};
|
|
148
|
+
const labelStyle = {
|
|
149
|
+
color: disabled ? "#BDBDBD" : active ? "#000000" : "#757575",
|
|
150
|
+
fontWeight: active ? 600 : 400
|
|
151
|
+
};
|
|
152
|
+
const IconComponent = StepIconComponent;
|
|
153
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
|
|
154
|
+
ref: ref,
|
|
155
|
+
className: className,
|
|
156
|
+
style: baseStyle
|
|
157
|
+
}, props), IconComponent ? /*#__PURE__*/React__default["default"].createElement(IconComponent, _extends__default["default"]({
|
|
158
|
+
active: active,
|
|
159
|
+
completed: completed,
|
|
160
|
+
icon: index + 1
|
|
161
|
+
}, StepIconProps)) : icon ? icon : /*#__PURE__*/React__default["default"].createElement("span", {
|
|
162
|
+
style: iconStyle
|
|
163
|
+
}, completed ? "✓" : index + 1), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
164
|
+
style: labelStyle
|
|
165
|
+
}, children), optional && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
166
|
+
style: {
|
|
167
|
+
fontSize: 12,
|
|
168
|
+
color: "#757575"
|
|
169
|
+
}
|
|
170
|
+
}, optional)));
|
|
171
|
+
});
|
|
172
|
+
StepLabelBase.displayName = "StepLabel";
|
|
173
|
+
const StepLabel = withSx.withSx(StepLabelBase);
|
|
174
|
+
/**
|
|
175
|
+
* StepContent - content for vertical steppers
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
const StepContentBase = /*#__PURE__*/React__default["default"].forwardRef((_ref4, ref) => {
|
|
179
|
+
let {
|
|
180
|
+
active,
|
|
181
|
+
children,
|
|
182
|
+
TransitionComponent,
|
|
183
|
+
transitionDuration,
|
|
184
|
+
className,
|
|
185
|
+
style
|
|
186
|
+
} = _ref4,
|
|
187
|
+
props = _objectWithoutProperties__default["default"](_ref4, _excluded4);
|
|
188
|
+
|
|
189
|
+
const baseStyle = _objectSpread({
|
|
190
|
+
marginLeft: 12,
|
|
191
|
+
paddingLeft: 20,
|
|
192
|
+
borderLeft: "1px solid #BDBDBD",
|
|
193
|
+
display: active ? "block" : "none"
|
|
194
|
+
}, style);
|
|
195
|
+
|
|
196
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
|
|
197
|
+
ref: ref,
|
|
198
|
+
className: className,
|
|
199
|
+
style: baseStyle
|
|
200
|
+
}, props), children);
|
|
201
|
+
});
|
|
202
|
+
StepContentBase.displayName = "StepContent";
|
|
203
|
+
withSx.withSx(StepContentBase);
|
|
204
|
+
/**
|
|
205
|
+
* StepButton - clickable step for non-linear steppers
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
const StepButtonBase = /*#__PURE__*/React__default["default"].forwardRef((_ref5, ref) => {
|
|
209
|
+
let {
|
|
210
|
+
active,
|
|
211
|
+
completed,
|
|
212
|
+
disabled,
|
|
213
|
+
index,
|
|
214
|
+
icon,
|
|
215
|
+
optional,
|
|
216
|
+
children,
|
|
217
|
+
onClick,
|
|
218
|
+
className,
|
|
219
|
+
style
|
|
220
|
+
} = _ref5,
|
|
221
|
+
props = _objectWithoutProperties__default["default"](_ref5, _excluded5);
|
|
222
|
+
|
|
223
|
+
const baseStyle = _objectSpread({
|
|
224
|
+
display: "flex",
|
|
225
|
+
alignItems: "center",
|
|
226
|
+
gap: 8,
|
|
227
|
+
background: "none",
|
|
228
|
+
border: "none",
|
|
229
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
230
|
+
padding: 8,
|
|
231
|
+
borderRadius: 4,
|
|
232
|
+
transition: "background-color 0.2s"
|
|
233
|
+
}, style);
|
|
234
|
+
|
|
235
|
+
return /*#__PURE__*/React__default["default"].createElement("button", _extends__default["default"]({
|
|
236
|
+
ref: ref,
|
|
237
|
+
className: className,
|
|
238
|
+
style: baseStyle,
|
|
239
|
+
onClick: onClick,
|
|
240
|
+
disabled: disabled
|
|
241
|
+
}, props), /*#__PURE__*/React__default["default"].createElement(StepLabel, {
|
|
242
|
+
active: active,
|
|
243
|
+
completed: completed,
|
|
244
|
+
disabled: disabled,
|
|
245
|
+
index: index,
|
|
246
|
+
icon: icon,
|
|
247
|
+
optional: optional
|
|
248
|
+
}, children));
|
|
249
|
+
});
|
|
250
|
+
StepButtonBase.displayName = "StepButton";
|
|
251
|
+
withSx.withSx(StepButtonBase);
|
|
252
|
+
/**
|
|
253
|
+
* StepConnector - line between steps
|
|
254
|
+
*/
|
|
255
|
+
|
|
256
|
+
const StepConnectorBase = /*#__PURE__*/React__default["default"].forwardRef((_ref6, ref) => {
|
|
257
|
+
let {
|
|
258
|
+
orientation = "horizontal",
|
|
259
|
+
className,
|
|
260
|
+
style
|
|
261
|
+
} = _ref6,
|
|
262
|
+
props = _objectWithoutProperties__default["default"](_ref6, _excluded6);
|
|
263
|
+
|
|
264
|
+
const baseStyle = _objectSpread({
|
|
265
|
+
flex: orientation === "horizontal" ? 1 : undefined,
|
|
266
|
+
height: orientation === "vertical" ? 24 : undefined,
|
|
267
|
+
display: "flex",
|
|
268
|
+
alignItems: "center",
|
|
269
|
+
justifyContent: "center"
|
|
270
|
+
}, style);
|
|
271
|
+
|
|
272
|
+
const lineStyle = {
|
|
273
|
+
width: orientation === "horizontal" ? "100%" : 1,
|
|
274
|
+
height: orientation === "horizontal" ? 1 : "100%",
|
|
275
|
+
backgroundColor: "#BDBDBD",
|
|
276
|
+
margin: orientation === "horizontal" ? "0 8px" : "8px 0"
|
|
277
|
+
};
|
|
278
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
|
|
279
|
+
ref: ref,
|
|
280
|
+
className: className,
|
|
281
|
+
style: baseStyle
|
|
282
|
+
}, props), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
283
|
+
style: lineStyle
|
|
284
|
+
}));
|
|
285
|
+
});
|
|
286
|
+
StepConnectorBase.displayName = "StepConnector";
|
|
287
|
+
const StepConnector = withSx.withSx(StepConnectorBase);
|
|
288
|
+
|
|
289
|
+
exports.StepConnector = StepConnector;
|
|
290
|
+
exports.StepLabel = StepLabel;
|
|
291
|
+
exports.Stepper = Stepper;
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _extends = 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 withSx = require('./withSx.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 _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
15
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
+
|
|
19
|
+
const _excluded = ["variant", "component", "align", "color", "gutterBottom", "noWrap", "paragraph", "children", "style", "fontSize", "fontColor", "fontWeight"];
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
/**
|
|
25
|
+
* Typography variants matching MUI defaults
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
const VARIANT_STYLES = {
|
|
29
|
+
h1: {
|
|
30
|
+
fontSize: "6rem",
|
|
31
|
+
fontWeight: 300,
|
|
32
|
+
lineHeight: 1.167,
|
|
33
|
+
letterSpacing: "-0.01562em"
|
|
34
|
+
},
|
|
35
|
+
h2: {
|
|
36
|
+
fontSize: "3.75rem",
|
|
37
|
+
fontWeight: 300,
|
|
38
|
+
lineHeight: 1.2,
|
|
39
|
+
letterSpacing: "-0.00833em"
|
|
40
|
+
},
|
|
41
|
+
h3: {
|
|
42
|
+
fontSize: "3rem",
|
|
43
|
+
fontWeight: 400,
|
|
44
|
+
lineHeight: 1.167,
|
|
45
|
+
letterSpacing: "0em"
|
|
46
|
+
},
|
|
47
|
+
h4: {
|
|
48
|
+
fontSize: "2.125rem",
|
|
49
|
+
fontWeight: 400,
|
|
50
|
+
lineHeight: 1.235,
|
|
51
|
+
letterSpacing: "0.00735em"
|
|
52
|
+
},
|
|
53
|
+
h5: {
|
|
54
|
+
fontSize: "1.5rem",
|
|
55
|
+
fontWeight: 400,
|
|
56
|
+
lineHeight: 1.334,
|
|
57
|
+
letterSpacing: "0em"
|
|
58
|
+
},
|
|
59
|
+
h6: {
|
|
60
|
+
fontSize: "1.25rem",
|
|
61
|
+
fontWeight: 500,
|
|
62
|
+
lineHeight: 1.6,
|
|
63
|
+
letterSpacing: "0.0075em"
|
|
64
|
+
},
|
|
65
|
+
subtitle1: {
|
|
66
|
+
fontSize: "1rem",
|
|
67
|
+
fontWeight: 400,
|
|
68
|
+
lineHeight: 1.75,
|
|
69
|
+
letterSpacing: "0.00938em"
|
|
70
|
+
},
|
|
71
|
+
subtitle2: {
|
|
72
|
+
fontSize: "0.875rem",
|
|
73
|
+
fontWeight: 500,
|
|
74
|
+
lineHeight: 1.57,
|
|
75
|
+
letterSpacing: "0.00714em"
|
|
76
|
+
},
|
|
77
|
+
body1: {
|
|
78
|
+
fontSize: "1rem",
|
|
79
|
+
fontWeight: 400,
|
|
80
|
+
lineHeight: 1.5,
|
|
81
|
+
letterSpacing: "0.00938em"
|
|
82
|
+
},
|
|
83
|
+
body2: {
|
|
84
|
+
fontSize: "0.875rem",
|
|
85
|
+
fontWeight: 400,
|
|
86
|
+
lineHeight: 1.43,
|
|
87
|
+
letterSpacing: "0.01071em"
|
|
88
|
+
},
|
|
89
|
+
button: {
|
|
90
|
+
fontSize: "0.875rem",
|
|
91
|
+
fontWeight: 500,
|
|
92
|
+
lineHeight: 1.75,
|
|
93
|
+
letterSpacing: "0.02857em",
|
|
94
|
+
textTransform: "uppercase"
|
|
95
|
+
},
|
|
96
|
+
caption: {
|
|
97
|
+
fontSize: "0.75rem",
|
|
98
|
+
fontWeight: 400,
|
|
99
|
+
lineHeight: 1.66,
|
|
100
|
+
letterSpacing: "0.03333em"
|
|
101
|
+
},
|
|
102
|
+
overline: {
|
|
103
|
+
fontSize: "0.75rem",
|
|
104
|
+
fontWeight: 400,
|
|
105
|
+
lineHeight: 2.66,
|
|
106
|
+
letterSpacing: "0.08333em",
|
|
107
|
+
textTransform: "uppercase"
|
|
108
|
+
},
|
|
109
|
+
inherit: {}
|
|
110
|
+
}; // Map variant to semantic HTML element
|
|
111
|
+
|
|
112
|
+
const VARIANT_MAPPING = {
|
|
113
|
+
h1: "h1",
|
|
114
|
+
h2: "h2",
|
|
115
|
+
h3: "h3",
|
|
116
|
+
h4: "h4",
|
|
117
|
+
h5: "h5",
|
|
118
|
+
h6: "h6",
|
|
119
|
+
subtitle1: "h6",
|
|
120
|
+
subtitle2: "h6",
|
|
121
|
+
body1: "p",
|
|
122
|
+
body2: "p",
|
|
123
|
+
button: "span",
|
|
124
|
+
caption: "span",
|
|
125
|
+
overline: "span",
|
|
126
|
+
inherit: "span"
|
|
127
|
+
}; // Map fontWeight string values to CSS values
|
|
128
|
+
|
|
129
|
+
const FONT_WEIGHT_MAP = {
|
|
130
|
+
light: 300,
|
|
131
|
+
regular: 400,
|
|
132
|
+
medium: 500,
|
|
133
|
+
semibold: 600,
|
|
134
|
+
bold: 700
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Typography/Text component (replaces MUI Typography)
|
|
138
|
+
*
|
|
139
|
+
* Supports legacy @blerp/design props:
|
|
140
|
+
* - fontSize: string (e.g., "42px", "1.5rem")
|
|
141
|
+
* - fontColor: string (theme color name like "grey7" or direct color)
|
|
142
|
+
* - fontWeight: string | number (e.g., "light", "bold", 400)
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
const BaseText = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
|
|
146
|
+
let {
|
|
147
|
+
variant = "body1",
|
|
148
|
+
component,
|
|
149
|
+
align,
|
|
150
|
+
color,
|
|
151
|
+
gutterBottom = false,
|
|
152
|
+
noWrap = false,
|
|
153
|
+
paragraph = false,
|
|
154
|
+
children,
|
|
155
|
+
style,
|
|
156
|
+
// Legacy @blerp/design props
|
|
157
|
+
fontSize,
|
|
158
|
+
fontColor,
|
|
159
|
+
fontWeight
|
|
160
|
+
} = _ref,
|
|
161
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
162
|
+
|
|
163
|
+
const {
|
|
164
|
+
colors,
|
|
165
|
+
mode
|
|
166
|
+
} = ThemeProvider.useTheme(); // Determine the HTML element to use
|
|
167
|
+
|
|
168
|
+
const Component = component || (paragraph ? "p" : VARIANT_MAPPING[variant] || "span"); // Resolve color from theme - check both color and fontColor props
|
|
169
|
+
|
|
170
|
+
const resolvedColor = React.useMemo(() => {
|
|
171
|
+
var _props$sx, _props$sx2, _props$sx3, _props$sx4, _props$sx5, _props$sx6, _props$sx7, _props$sx8;
|
|
172
|
+
|
|
173
|
+
// fontColor takes precedence if provided (legacy support)
|
|
174
|
+
const colorValue = fontColor || color || (props === null || props === void 0 ? void 0 : (_props$sx = props.sx) === null || _props$sx === void 0 ? void 0 : _props$sx.color);
|
|
175
|
+
|
|
176
|
+
if (!colorValue) {
|
|
177
|
+
// Default text color based on theme mode
|
|
178
|
+
return mode === "dark" ? "#FFFFFF" : "#FFFFFF"; // "#21000C";
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if ((props === null || props === void 0 ? void 0 : (_props$sx2 = props.sx) === null || _props$sx2 === void 0 ? void 0 : _props$sx2.color) === "whiteOverride.main") return "#FFFFFF";
|
|
182
|
+
if ((props === null || props === void 0 ? void 0 : (_props$sx3 = props.sx) === null || _props$sx3 === void 0 ? void 0 : _props$sx3.color) === "white.real") return "#FFFFFF";
|
|
183
|
+
if ((props === null || props === void 0 ? void 0 : (_props$sx4 = props.sx) === null || _props$sx4 === void 0 ? void 0 : _props$sx4.color) === "grey2.real") return "#FFFFFF";
|
|
184
|
+
if ((props === null || props === void 0 ? void 0 : (_props$sx5 = props.sx) === null || _props$sx5 === void 0 ? void 0 : _props$sx5.color) === "grey6.main") return "#FFFFFF";
|
|
185
|
+
if ((props === null || props === void 0 ? void 0 : (_props$sx6 = props.sx) === null || _props$sx6 === void 0 ? void 0 : _props$sx6.color) === "grey7.main") return "#FFFFFF";
|
|
186
|
+
if ((props === null || props === void 0 ? void 0 : (_props$sx7 = props.sx) === null || _props$sx7 === void 0 ? void 0 : _props$sx7.color) === "notBlack.main") return "#FFFFFF";
|
|
187
|
+
if ((props === null || props === void 0 ? void 0 : (_props$sx8 = props.sx) === null || _props$sx8 === void 0 ? void 0 : _props$sx8.color) === "notBlack") return "#FFFFFF";
|
|
188
|
+
if (color === "grey3") return "#FFFFFF";
|
|
189
|
+
if (fontColor === "grey7") return "#FFFFFF";
|
|
190
|
+
if (color === "grey7.main" || colorValue === "grey7.main") return "#FFFFFF";
|
|
191
|
+
if ((colorValue === null || colorValue === void 0 ? void 0 : colorValue.toLowerCase()) === "grey6") return "#FFFFFF";
|
|
192
|
+
if ((colorValue === null || colorValue === void 0 ? void 0 : colorValue.toLowerCase()) === "grey6.main") return "#FFFFFF";
|
|
193
|
+
if ((colorValue === null || colorValue === void 0 ? void 0 : colorValue.toLowerCase()) === "black.main") return "#FFFFFF";
|
|
194
|
+
if ((colorValue === null || colorValue === void 0 ? void 0 : colorValue.toLowerCase()) === "notblack") return "#FFFFFF";
|
|
195
|
+
if ((colorValue === null || colorValue === void 0 ? void 0 : colorValue.toLowerCase()) === "notblack.main") return "#FFFFFF"; // Hardcode plain white / black detection
|
|
196
|
+
|
|
197
|
+
if (colorValue.toLowerCase() === "white") return "#FFFFFF";
|
|
198
|
+
if (colorValue.toLowerCase() === "black") return "#000000"; // Handle "white.override" or similar
|
|
199
|
+
|
|
200
|
+
if (colorValue === "white.override" || colorValue === "whiteOverride") {
|
|
201
|
+
var _colors$whiteOverride;
|
|
202
|
+
|
|
203
|
+
return ((_colors$whiteOverride = colors.whiteOverride) === null || _colors$whiteOverride === void 0 ? void 0 : _colors$whiteOverride.main) || colors.whiteText || "#FFFFFF";
|
|
204
|
+
} // Handle theme color references like "ibisRed.main"
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
if (typeof colorValue === "string" && colorValue.includes(".")) {
|
|
208
|
+
var _colors$colorName;
|
|
209
|
+
|
|
210
|
+
const [colorName, variant = "main"] = colorValue.split(".");
|
|
211
|
+
return ((_colors$colorName = colors[colorName]) === null || _colors$colorName === void 0 ? void 0 : _colors$colorName[variant]) || colors[colorName] || colorValue;
|
|
212
|
+
} // Handle direct color names like "primary", "error", "grey7"
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
if (colors[colorValue]) {
|
|
216
|
+
const themeColor = colors[colorValue];
|
|
217
|
+
|
|
218
|
+
if (typeof themeColor === "object") {
|
|
219
|
+
return themeColor.main || themeColor.real || themeColor.override;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return themeColor;
|
|
223
|
+
} // Return as-is (hex, rgb, etc.)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
return colorValue;
|
|
227
|
+
}, [color, fontColor, colors, mode]); // Resolve fontWeight - handle string values like "light", "bold"
|
|
228
|
+
|
|
229
|
+
const resolvedFontWeight = React.useMemo(() => {
|
|
230
|
+
if (fontWeight === undefined || fontWeight === null) {
|
|
231
|
+
return undefined; // Let variant default apply
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (typeof fontWeight === "number") {
|
|
235
|
+
return fontWeight;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (typeof fontWeight === "string") {
|
|
239
|
+
// Check if it's a named weight
|
|
240
|
+
const mappedWeight = FONT_WEIGHT_MAP[fontWeight.toLowerCase()];
|
|
241
|
+
|
|
242
|
+
if (mappedWeight) {
|
|
243
|
+
return mappedWeight;
|
|
244
|
+
} // Maybe it's a numeric string like "400"
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
const parsed = parseInt(fontWeight, 10);
|
|
248
|
+
|
|
249
|
+
if (!isNaN(parsed)) {
|
|
250
|
+
return parsed;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return fontWeight;
|
|
255
|
+
}, [fontWeight]);
|
|
256
|
+
const textStyle = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
257
|
+
margin: 0,
|
|
258
|
+
fontFamily: "Open Sans, Inter, Odudo, Arial, sans-serif"
|
|
259
|
+
}, VARIANT_STYLES[variant]), align && {
|
|
260
|
+
textAlign: align
|
|
261
|
+
}), gutterBottom && {
|
|
262
|
+
marginBottom: "0.35em"
|
|
263
|
+
}), noWrap && {
|
|
264
|
+
overflow: "hidden",
|
|
265
|
+
textOverflow: "ellipsis",
|
|
266
|
+
whiteSpace: "nowrap"
|
|
267
|
+
}), paragraph && {
|
|
268
|
+
marginBottom: "16px"
|
|
269
|
+
}), {}, {
|
|
270
|
+
// Apply resolved color
|
|
271
|
+
color: resolvedColor
|
|
272
|
+
}, fontSize && {
|
|
273
|
+
fontSize
|
|
274
|
+
}), resolvedFontWeight !== undefined && {
|
|
275
|
+
fontWeight: resolvedFontWeight
|
|
276
|
+
}), style), {}, {
|
|
277
|
+
color: resolvedColor
|
|
278
|
+
}), [variant, align, gutterBottom, noWrap, paragraph, style, resolvedColor, fontSize, resolvedFontWeight]);
|
|
279
|
+
return /*#__PURE__*/React__default["default"].createElement(Component, _extends__default["default"]({
|
|
280
|
+
ref: ref,
|
|
281
|
+
style: textStyle
|
|
282
|
+
}, props), children);
|
|
283
|
+
});
|
|
284
|
+
BaseText.displayName = "BaseText";
|
|
285
|
+
const Text = withSx.withSx(BaseText);
|
|
286
|
+
const Typography = Text; // Alias for MUI compatibility
|
|
287
|
+
|
|
288
|
+
exports.Text = Text;
|
|
289
|
+
exports.Typography = Typography;
|
|
290
|
+
exports["default"] = Text;
|