@blerp/design 1.3.17 → 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.
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 +280 -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 +493 -0
  52. package/dist/cjs/neo-components/Layout.js +1213 -0
  53. package/dist/cjs/neo-components/Misc.js +858 -0
  54. package/dist/cjs/neo-components/Navigation.js +1578 -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 +164 -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 +269 -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 +478 -0
  116. package/dist/esm/neo-components/Layout.js +1179 -0
  117. package/dist/esm/neo-components/Misc.js +840 -0
  118. package/dist/esm/neo-components/Navigation.js +1556 -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 +153 -0
  127. package/dist/esm/neo-utils/sxToStyle.js +502 -0
  128. package/package.json +19 -15
@@ -0,0 +1,423 @@
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, { useRef, useCallback, useEffect } from 'react';
5
+ import { createPortal } from 'react-dom';
6
+ import { withSx } from './withSx.js';
7
+
8
+ const _excluded = ["open", "invisible", "children", "onClick", "style"],
9
+ _excluded2 = ["open", "onClose", "children", "disableEscapeKeyDown", "disableBackdropClick", "disableEnforceFocus", "disableAutoFocus", "disableRestoreFocus", "disablePortal", "hideBackdrop", "keepMounted", "BackdropProps", "container", "style"],
10
+ _excluded3 = ["open", "onClose", "maxWidth", "fullWidth", "fullScreen", "scroll", "children", "PaperProps", "TransitionProps", "disablePortal", "style"],
11
+ _excluded4 = ["children", "component", "style"],
12
+ _excluded5 = ["dividers", "children", "style"],
13
+ _excluded6 = ["children", "style"],
14
+ _excluded7 = ["disableSpacing", "children", "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
+ * Backdrop - Overlay behind modals (replaces MUI Backdrop)
21
+ */
22
+
23
+ const BaseBackdrop = /*#__PURE__*/React.forwardRef((_ref, ref) => {
24
+ let {
25
+ open,
26
+ invisible = false,
27
+ children,
28
+ onClick,
29
+ style
30
+ } = _ref,
31
+ props = _objectWithoutProperties(_ref, _excluded);
32
+
33
+ if (!open) return null;
34
+
35
+ const backdropStyle = _objectSpread({
36
+ position: "fixed",
37
+ display: "flex",
38
+ alignItems: "center",
39
+ justifyContent: "center",
40
+ inset: 0,
41
+ backgroundColor: invisible ? "transparent" : "rgba(0, 0, 0, 0.5)",
42
+ zIndex: -1,
43
+ WebkitTapHighlightColor: "transparent"
44
+ }, style);
45
+
46
+ return /*#__PURE__*/React.createElement("div", _extends({
47
+ ref: ref,
48
+ style: backdropStyle,
49
+ onClick: onClick
50
+ }, props), children);
51
+ });
52
+ BaseBackdrop.displayName = "BaseBackdrop";
53
+ const Backdrop = withSx(BaseBackdrop);
54
+ /**
55
+ * Get all focusable elements within a container
56
+ */
57
+
58
+ const getFocusableElements = container => {
59
+ const focusableSelectors = ['a[href]', 'button:not([disabled])', 'textarea:not([disabled])', 'input:not([disabled])', 'select:not([disabled])', '[tabindex]:not([tabindex="-1"])'].join(', ');
60
+ return Array.from(container.querySelectorAll(focusableSelectors)).filter(el => el.offsetParent !== null);
61
+ };
62
+ /**
63
+ * Modal - Base modal component (replaces MUI Modal)
64
+ */
65
+
66
+
67
+ const BaseModal = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
68
+ let {
69
+ open,
70
+ onClose,
71
+ children,
72
+ disableEscapeKeyDown = false,
73
+ disableBackdropClick = false,
74
+ disableEnforceFocus = false,
75
+ disableAutoFocus = false,
76
+ disableRestoreFocus = false,
77
+ disablePortal = false,
78
+ hideBackdrop = false,
79
+ keepMounted = false,
80
+ BackdropProps = {},
81
+ container,
82
+ style
83
+ } = _ref2,
84
+ props = _objectWithoutProperties(_ref2, _excluded2);
85
+
86
+ const modalRef = useRef(null);
87
+ const previousActiveElement = useRef(null);
88
+ const handleRef = useCallback(node => {
89
+ modalRef.current = node;
90
+
91
+ if (typeof ref === 'function') {
92
+ ref(node);
93
+ } else if (ref) {
94
+ ref.current = node;
95
+ }
96
+ }, [ref]);
97
+ useEffect(() => {
98
+ if (open && !disableAutoFocus) {
99
+ previousActiveElement.current = document.activeElement;
100
+ requestAnimationFrame(() => {
101
+ if (modalRef.current) {
102
+ const focusable = getFocusableElements(modalRef.current);
103
+
104
+ if (focusable.length > 0) {
105
+ focusable[0].focus();
106
+ } else {
107
+ modalRef.current.focus();
108
+ }
109
+ }
110
+ });
111
+ }
112
+
113
+ return () => {
114
+ if (open && !disableRestoreFocus && previousActiveElement.current) {
115
+ var _previousActiveElemen, _previousActiveElemen2;
116
+
117
+ (_previousActiveElemen = (_previousActiveElemen2 = previousActiveElement.current).focus) === null || _previousActiveElemen === void 0 ? void 0 : _previousActiveElemen.call(_previousActiveElemen2);
118
+ }
119
+ };
120
+ }, [open, disableAutoFocus, disableRestoreFocus]);
121
+ useEffect(() => {
122
+ if (!open || disableEscapeKeyDown) return;
123
+
124
+ const handleKeyDown = event => {
125
+ if (event.key === "Escape") {
126
+ event.stopPropagation();
127
+ onClose === null || onClose === void 0 ? void 0 : onClose(event, "escapeKeyDown");
128
+ }
129
+ };
130
+
131
+ document.addEventListener("keydown", handleKeyDown);
132
+ return () => document.removeEventListener("keydown", handleKeyDown);
133
+ }, [open, disableEscapeKeyDown, onClose]);
134
+ useEffect(() => {
135
+ if (!open || disableEnforceFocus) return;
136
+
137
+ const handleFocusTrap = event => {
138
+ if (!modalRef.current) return;
139
+
140
+ if (!modalRef.current.contains(event.target)) {
141
+ event.stopPropagation();
142
+ const focusable = getFocusableElements(modalRef.current);
143
+
144
+ if (focusable.length > 0) {
145
+ focusable[0].focus();
146
+ } else {
147
+ modalRef.current.focus();
148
+ }
149
+ }
150
+ };
151
+
152
+ const handleKeyDown = event => {
153
+ if (event.key !== 'Tab' || !modalRef.current) return;
154
+ const focusable = getFocusableElements(modalRef.current);
155
+ if (focusable.length === 0) return;
156
+ const firstElement = focusable[0];
157
+ const lastElement = focusable[focusable.length - 1];
158
+
159
+ if (event.shiftKey && document.activeElement === firstElement) {
160
+ event.preventDefault();
161
+ lastElement.focus();
162
+ } else if (!event.shiftKey && document.activeElement === lastElement) {
163
+ event.preventDefault();
164
+ firstElement.focus();
165
+ }
166
+ };
167
+
168
+ document.addEventListener("focus", handleFocusTrap, true);
169
+ document.addEventListener("keydown", handleKeyDown);
170
+ return () => {
171
+ document.removeEventListener("focus", handleFocusTrap, true);
172
+ document.removeEventListener("keydown", handleKeyDown);
173
+ };
174
+ }, [open, disableEnforceFocus]);
175
+ useEffect(() => {
176
+ if (open) {
177
+ const originalOverflow = document.body.style.overflow;
178
+ document.body.style.overflow = "hidden";
179
+ return () => {
180
+ document.body.style.overflow = originalOverflow;
181
+ };
182
+ }
183
+ }, [open]); // Handle backdrop click - properly stop propagation for modal content clicks
184
+
185
+ const handleModalClick = useCallback(event => {
186
+ // Stop propagation so document-level handlers don't close parent menus
187
+ event.stopPropagation();
188
+ }, []);
189
+ const handleBackdropClick = useCallback(event => {
190
+ // Only trigger close if clicking directly on the backdrop, not its children
191
+ if (event.target === event.currentTarget && !disableBackdropClick) {
192
+ onClose === null || onClose === void 0 ? void 0 : onClose(event, "backdropClick");
193
+ }
194
+ }, [disableBackdropClick, onClose]);
195
+ if (!open && !keepMounted) return null;
196
+
197
+ const modalStyle = _objectSpread({
198
+ position: "fixed",
199
+ zIndex: 1300,
200
+ top: 0,
201
+ left: 0,
202
+ right: 0,
203
+ bottom: 0,
204
+ display: open ? "flex" : "none",
205
+ alignItems: "center",
206
+ justifyContent: "center"
207
+ }, style);
208
+
209
+ const backdropStyle = _objectSpread({
210
+ position: "fixed",
211
+ top: 0,
212
+ left: 0,
213
+ right: 0,
214
+ bottom: 0,
215
+ backgroundColor: hideBackdrop ? "transparent" : "rgba(0, 0, 0, 0.5)",
216
+ zIndex: -1
217
+ }, BackdropProps.style);
218
+
219
+ const modalContent = /*#__PURE__*/React.createElement("div", _extends({
220
+ ref: handleRef,
221
+ role: "presentation",
222
+ tabIndex: -1,
223
+ style: modalStyle,
224
+ "data-modal-root": "true",
225
+ "data-modal-disable-portal": disablePortal ? "true" : undefined,
226
+ onClick: handleModalClick,
227
+ onMouseDown: handleModalClick
228
+ }, props), /*#__PURE__*/React.createElement("div", _extends({
229
+ style: backdropStyle,
230
+ "aria-hidden": "true",
231
+ onClick: handleBackdropClick
232
+ }, BackdropProps)), children);
233
+
234
+ if (disablePortal) {
235
+ return modalContent;
236
+ }
237
+
238
+ return /*#__PURE__*/createPortal(modalContent, container || document.body);
239
+ });
240
+ BaseModal.displayName = "BaseModal";
241
+ const Modal = withSx(BaseModal);
242
+ /**
243
+ * Dialog - Modal dialog component (replaces MUI Dialog)
244
+ */
245
+
246
+ const BaseDialog = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
247
+ let {
248
+ open,
249
+ onClose,
250
+ maxWidth = "sm",
251
+ fullWidth = false,
252
+ fullScreen = false,
253
+ scroll = "paper",
254
+ children,
255
+ PaperProps = {},
256
+ TransitionProps = {},
257
+ disablePortal = false,
258
+ style
259
+ } = _ref3,
260
+ props = _objectWithoutProperties(_ref3, _excluded3);
261
+
262
+ const maxWidthValues = {
263
+ xs: "444px",
264
+ sm: "600px",
265
+ md: "900px",
266
+ lg: "1200px",
267
+ xl: "1536px",
268
+ false: "none"
269
+ };
270
+ const handlePaperClick = useCallback(event => {
271
+ // Prevent clicks inside the dialog from closing it
272
+ event.stopPropagation();
273
+ }, []);
274
+
275
+ const dialogPaperStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
276
+ position: "relative",
277
+ display: "flex",
278
+ flexDirection: "column",
279
+ maxHeight: fullScreen ? "100%" : "calc(100% - 64px)",
280
+ overflowY: scroll === "paper" ? "auto" : "visible",
281
+ backgroundColor: "var(--flyout-background, #fff)",
282
+ color: "var(--body-text, rgba(0, 0, 0, 0.87))",
283
+ borderRadius: fullScreen ? 0 : "8px",
284
+ boxShadow: "0px 11px 15px -7px rgba(0,0,0,0.2), 0px 24px 38px 3px rgba(0,0,0,0.14), 0px 9px 46px 8px rgba(0,0,0,0.12)",
285
+ boxSizing: "border-box",
286
+ isolation: "isolate"
287
+ }, fullScreen && {
288
+ width: "100%",
289
+ height: "100%",
290
+ maxWidth: "none",
291
+ maxHeight: "none"
292
+ }), !fullScreen && fullWidth && {
293
+ width: "calc(100% - 64px)",
294
+ maxWidth: maxWidthValues[maxWidth] || maxWidth
295
+ }), !fullScreen && !fullWidth && {
296
+ width: "fit-content",
297
+ minWidth: "280px",
298
+ maxWidth: maxWidthValues[maxWidth] || maxWidth
299
+ }), PaperProps.style);
300
+
301
+ return /*#__PURE__*/React.createElement(Modal, _extends({
302
+ ref: ref,
303
+ open: open,
304
+ onClose: onClose,
305
+ disablePortal: disablePortal,
306
+ style: style
307
+ }, props), /*#__PURE__*/React.createElement("div", _extends({
308
+ role: "dialog",
309
+ "aria-modal": "true",
310
+ style: dialogPaperStyle,
311
+ onClick: handlePaperClick,
312
+ onMouseDown: handlePaperClick
313
+ }, PaperProps), children));
314
+ });
315
+ BaseDialog.displayName = "BaseDialog";
316
+ const Dialog = withSx(BaseDialog);
317
+ /**
318
+ * DialogTitle - Title for dialogs
319
+ */
320
+
321
+ const DialogTitle = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
322
+ let {
323
+ children,
324
+ component: Component = "h2",
325
+ style
326
+ } = _ref4,
327
+ props = _objectWithoutProperties(_ref4, _excluded4);
328
+
329
+ const titleStyle = _objectSpread({
330
+ margin: 0,
331
+ padding: "16px 24px",
332
+ fontSize: "1.25rem",
333
+ fontWeight: 500,
334
+ lineHeight: 1.6
335
+ }, style);
336
+
337
+ return /*#__PURE__*/React.createElement(Component, _extends({
338
+ ref: ref,
339
+ style: titleStyle
340
+ }, props), children);
341
+ });
342
+ DialogTitle.displayName = "DialogTitle";
343
+ /**
344
+ * DialogContent - Content area for dialogs
345
+ */
346
+
347
+ const DialogContent = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
348
+ let {
349
+ dividers = false,
350
+ children,
351
+ style
352
+ } = _ref5,
353
+ props = _objectWithoutProperties(_ref5, _excluded5);
354
+
355
+ const contentStyle = _objectSpread(_objectSpread({
356
+ flex: "1 1 auto",
357
+ overflowY: "auto",
358
+ padding: "20px 24px"
359
+ }, dividers && {
360
+ borderTop: "1px solid var(--border-color, rgba(0, 0, 0, 0.12))",
361
+ borderBottom: "1px solid var(--border-color, rgba(0, 0, 0, 0.12))",
362
+ padding: "16px 24px"
363
+ }), style);
364
+
365
+ return /*#__PURE__*/React.createElement("div", _extends({
366
+ ref: ref,
367
+ style: contentStyle
368
+ }, props), children);
369
+ });
370
+ DialogContent.displayName = "DialogContent";
371
+ /**
372
+ * DialogContentText - Text inside dialog content
373
+ */
374
+
375
+ const DialogContentText = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
376
+ let {
377
+ children,
378
+ style
379
+ } = _ref6,
380
+ props = _objectWithoutProperties(_ref6, _excluded6);
381
+
382
+ const textStyle = _objectSpread({
383
+ margin: 0,
384
+ color: "var(--secondary-text, rgba(0, 0, 0, 0.6))",
385
+ fontSize: "1rem",
386
+ lineHeight: 1.5
387
+ }, style);
388
+
389
+ return /*#__PURE__*/React.createElement("p", _extends({
390
+ ref: ref,
391
+ style: textStyle
392
+ }, props), children);
393
+ });
394
+ DialogContentText.displayName = "DialogContentText";
395
+ /**
396
+ * DialogActions - Action buttons for dialogs
397
+ */
398
+
399
+ const DialogActions = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
400
+ let {
401
+ disableSpacing = false,
402
+ children,
403
+ style
404
+ } = _ref7,
405
+ props = _objectWithoutProperties(_ref7, _excluded7);
406
+
407
+ const actionsStyle = _objectSpread(_objectSpread({
408
+ display: "flex",
409
+ alignItems: "center",
410
+ justifyContent: "flex-end",
411
+ padding: "8px"
412
+ }, !disableSpacing && {
413
+ gap: "8px"
414
+ }), style);
415
+
416
+ return /*#__PURE__*/React.createElement("div", _extends({
417
+ ref: ref,
418
+ style: actionsStyle
419
+ }, props), children);
420
+ });
421
+ DialogActions.displayName = "DialogActions";
422
+
423
+ export { Backdrop, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Modal, Dialog as default };
@@ -0,0 +1,225 @@
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 from 'react';
5
+ import { withSx } from './withSx.js';
6
+
7
+ const _excluded = ["children", "color", "size", "variant", "disabled", "href", "onClick", "className", "style"],
8
+ _excluded2 = ["ariaLabel", "children", "direction", "hidden", "icon", "onClose", "onOpen", "open", "FabProps", "className", "style"],
9
+ _excluded3 = ["icon", "tooltipTitle", "tooltipOpen", "tooltipPlacement", "onClick", "FabProps", "className", "style"];
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(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
+ * Floating Action Button (FAB)
16
+ */
17
+
18
+ const FabBase = /*#__PURE__*/React.forwardRef((_ref, ref) => {
19
+ let {
20
+ children,
21
+ color = "primary",
22
+ size = "large",
23
+ variant = "circular",
24
+ disabled = false,
25
+ href,
26
+ onClick,
27
+ className,
28
+ style
29
+ } = _ref,
30
+ props = _objectWithoutProperties(_ref, _excluded);
31
+
32
+ const sizeStyles = {
33
+ small: {
34
+ width: 40,
35
+ height: 40,
36
+ fontSize: 18
37
+ },
38
+ medium: {
39
+ width: 48,
40
+ height: 48,
41
+ fontSize: 20
42
+ },
43
+ large: {
44
+ width: 56,
45
+ height: 56,
46
+ fontSize: 24
47
+ }
48
+ };
49
+ const colorStyles = {
50
+ primary: {
51
+ backgroundColor: "#7C4DFF",
52
+ color: "#FFFFFF"
53
+ },
54
+ secondary: {
55
+ backgroundColor: "#FF4081",
56
+ color: "#FFFFFF"
57
+ },
58
+ default: {
59
+ backgroundColor: "#E0E0E0",
60
+ color: "#000000"
61
+ },
62
+ inherit: {
63
+ backgroundColor: "inherit",
64
+ color: "inherit"
65
+ }
66
+ };
67
+
68
+ const baseStyle = _objectSpread(_objectSpread(_objectSpread({
69
+ display: "inline-flex",
70
+ alignItems: "center",
71
+ justifyContent: "center",
72
+ border: "none",
73
+ borderRadius: variant === "extended" ? 24 : "50%",
74
+ cursor: disabled ? "not-allowed" : "pointer",
75
+ opacity: disabled ? 0.5 : 1,
76
+ boxShadow: "0 3px 5px -1px rgba(0,0,0,0.2), 0 6px 10px 0 rgba(0,0,0,0.14), 0 1px 18px 0 rgba(0,0,0,0.12)",
77
+ transition: "background-color 0.2s, box-shadow 0.2s",
78
+ textDecoration: "none",
79
+ padding: variant === "extended" ? "0 16px" : 0,
80
+ minWidth: variant === "extended" ? 48 : undefined
81
+ }, sizeStyles[size]), colorStyles[color]), style);
82
+
83
+ const Component = href ? "a" : "button";
84
+ return /*#__PURE__*/React.createElement(Component, _extends({
85
+ ref: ref,
86
+ className: className,
87
+ style: baseStyle,
88
+ disabled: disabled,
89
+ href: href,
90
+ onClick: onClick
91
+ }, props), children);
92
+ });
93
+ FabBase.displayName = "Fab";
94
+ const Fab = withSx(FabBase);
95
+ /**
96
+ * SpeedDial - FAB that reveals related actions
97
+ */
98
+
99
+ const SpeedDialBase = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
100
+ let {
101
+ ariaLabel,
102
+ children,
103
+ direction = "up",
104
+ hidden = false,
105
+ icon,
106
+ onClose,
107
+ onOpen,
108
+ open: controlledOpen,
109
+ FabProps = {},
110
+ className,
111
+ style
112
+ } = _ref2,
113
+ props = _objectWithoutProperties(_ref2, _excluded2);
114
+
115
+ const [internalOpen, setInternalOpen] = React.useState(false);
116
+ const open = controlledOpen !== undefined ? controlledOpen : internalOpen;
117
+
118
+ const handleToggle = () => {
119
+ if (controlledOpen === undefined) {
120
+ setInternalOpen(!internalOpen);
121
+ }
122
+
123
+ if (open) {
124
+ onClose === null || onClose === void 0 ? void 0 : onClose();
125
+ } else {
126
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
127
+ }
128
+ };
129
+
130
+ const directionStyles = {
131
+ up: {
132
+ flexDirection: "column-reverse",
133
+ bottom: 16,
134
+ right: 16
135
+ },
136
+ down: {
137
+ flexDirection: "column",
138
+ top: 16,
139
+ right: 16
140
+ },
141
+ left: {
142
+ flexDirection: "row-reverse",
143
+ bottom: 16,
144
+ right: 16
145
+ },
146
+ right: {
147
+ flexDirection: "row",
148
+ bottom: 16,
149
+ left: 16
150
+ }
151
+ };
152
+
153
+ const baseStyle = _objectSpread(_objectSpread({
154
+ position: "fixed",
155
+ display: "flex",
156
+ alignItems: "center",
157
+ gap: 8,
158
+ zIndex: 1050,
159
+ visibility: hidden ? "hidden" : "visible"
160
+ }, directionStyles[direction]), style);
161
+
162
+ return /*#__PURE__*/React.createElement("div", _extends({
163
+ ref: ref,
164
+ className: className,
165
+ style: baseStyle
166
+ }, props), /*#__PURE__*/React.createElement(Fab, _extends({
167
+ "aria-label": ariaLabel,
168
+ onClick: handleToggle
169
+ }, FabProps), icon), open && /*#__PURE__*/React.createElement("div", {
170
+ style: {
171
+ display: "flex",
172
+ flexDirection: directionStyles[direction].flexDirection,
173
+ gap: 8
174
+ }
175
+ }, children));
176
+ });
177
+ SpeedDialBase.displayName = "SpeedDial";
178
+ const SpeedDial = withSx(SpeedDialBase);
179
+ /**
180
+ * SpeedDialAction - Individual action in SpeedDial
181
+ */
182
+
183
+ const SpeedDialActionBase = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
184
+ let {
185
+ icon,
186
+ tooltipTitle,
187
+ tooltipOpen = false,
188
+ tooltipPlacement = "left",
189
+ onClick,
190
+ FabProps = {},
191
+ className,
192
+ style
193
+ } = _ref3,
194
+ props = _objectWithoutProperties(_ref3, _excluded3);
195
+
196
+ return /*#__PURE__*/React.createElement("div", _extends({
197
+ ref: ref,
198
+ className: className,
199
+ style: _objectSpread({
200
+ position: "relative",
201
+ display: "inline-flex",
202
+ alignItems: "center"
203
+ }, style)
204
+ }, props), tooltipOpen && tooltipTitle && /*#__PURE__*/React.createElement("span", {
205
+ style: {
206
+ position: "absolute",
207
+ [tooltipPlacement]: "100%",
208
+ marginLeft: tooltipPlacement === "left" ? -8 : 8,
209
+ marginRight: tooltipPlacement === "right" ? -8 : 8,
210
+ backgroundColor: "#616161",
211
+ color: "#fff",
212
+ padding: "4px 8px",
213
+ borderRadius: 4,
214
+ fontSize: 12,
215
+ whiteSpace: "nowrap"
216
+ }
217
+ }, tooltipTitle), /*#__PURE__*/React.createElement(Fab, _extends({
218
+ size: "small",
219
+ onClick: onClick
220
+ }, FabProps), icon));
221
+ });
222
+ SpeedDialActionBase.displayName = "SpeedDialAction";
223
+ withSx(SpeedDialActionBase);
224
+
225
+ export { Fab, SpeedDial };