@vinyasa/feedback 1.0.22 → 1.0.23

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 (61) hide show
  1. package/dist/cjs/alert.cjs +72 -32
  2. package/dist/cjs/banner.cjs +31 -14
  3. package/dist/cjs/circular-progress.cjs +74 -37
  4. package/dist/cjs/empty-state.cjs +47 -23
  5. package/dist/cjs/error-boundary.cjs +72 -32
  6. package/dist/cjs/index.cjs +593 -269
  7. package/dist/cjs/index.css +54 -32
  8. package/dist/cjs/inline-message.cjs +32 -15
  9. package/dist/cjs/loading-overlay.cjs +41 -17
  10. package/dist/cjs/progress-bar.cjs +143 -48
  11. package/dist/cjs/progress-bar.css +7 -2
  12. package/dist/cjs/toaster.cjs +202 -87
  13. package/dist/cjs/toaster.css +47 -30
  14. package/dist/esm/147.css +47 -30
  15. package/dist/esm/147.js +103 -89
  16. package/dist/esm/158.js +31 -19
  17. package/dist/esm/266.js +67 -37
  18. package/dist/esm/277.js +5 -1
  19. package/dist/esm/288.js +25 -20
  20. package/dist/esm/516.js +24 -17
  21. package/dist/esm/872.css +4 -2
  22. package/dist/esm/872.js +54 -19
  23. package/dist/esm/880.js +32 -13
  24. package/dist/esm/903.js +41 -31
  25. package/dist/esm/989.js +23 -16
  26. package/dist/esm/alert.js +1 -1
  27. package/dist/esm/banner.js +1 -1
  28. package/dist/esm/circular-progress.js +1 -1
  29. package/dist/esm/components/alert/Alert.d.ts +23 -7
  30. package/dist/esm/components/alert/index.d.ts +1 -1
  31. package/dist/esm/components/banner/Banner.d.ts +8 -5
  32. package/dist/esm/components/banner/index.d.ts +1 -1
  33. package/dist/esm/components/circular-progress/CircularProgress.d.ts +11 -3
  34. package/dist/esm/components/circular-progress/index.d.ts +1 -1
  35. package/dist/esm/components/empty-state/EmptyState.d.ts +24 -13
  36. package/dist/esm/components/empty-state/index.d.ts +1 -1
  37. package/dist/esm/components/error-boundary/ErrorBoundary.d.ts +16 -9
  38. package/dist/esm/components/error-boundary/index.d.ts +1 -1
  39. package/dist/esm/components/inline-message/InlineMessage.d.ts +5 -0
  40. package/dist/esm/components/inline-message/index.d.ts +1 -1
  41. package/dist/esm/components/loading-overlay/LoadingOverlay.d.ts +11 -1
  42. package/dist/esm/components/loading-overlay/index.d.ts +1 -1
  43. package/dist/esm/components/progress-bar/ProgressBar.d.ts +11 -4
  44. package/dist/esm/components/progress-bar/index.d.ts +1 -1
  45. package/dist/esm/components/spinner/Spinner.d.ts +1 -1
  46. package/dist/esm/components/toaster/Toaster.css.d.ts +2 -5
  47. package/dist/esm/components/toaster/Toaster.d.ts +3 -0
  48. package/dist/esm/components/toaster/ToasterItem.d.ts +18 -0
  49. package/dist/esm/components/toaster/index.d.ts +1 -1
  50. package/dist/esm/components/toaster/toastStore.d.ts +2 -2
  51. package/dist/esm/empty-state.js +1 -1
  52. package/dist/esm/error-boundary.js +1 -1
  53. package/dist/esm/index.d.ts +9 -9
  54. package/dist/esm/index.js +9 -9
  55. package/dist/esm/inline-message.js +1 -1
  56. package/dist/esm/loading-overlay.js +1 -1
  57. package/dist/esm/progress-bar.js +1 -1
  58. package/dist/esm/status.d.ts +3 -1
  59. package/dist/esm/toaster.js +1 -1
  60. package/package.json +15 -11
  61. package/dist/esm/components/toaster/ToastItemView.d.ts +0 -7
@@ -37,6 +37,10 @@ var __webpack_require__ = {};
37
37
  var __webpack_exports__ = {};
38
38
  __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
+ AlertBody: ()=>AlertBody,
41
+ AlertDescription: ()=>AlertDescription,
42
+ AlertIcon: ()=>AlertIcon,
43
+ AlertTitle: ()=>AlertTitle,
40
44
  default: ()=>alert_Alert
41
45
  });
42
46
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
@@ -50,6 +54,9 @@ const statusIcons = {
50
54
  warning: icons_namespaceObject.AlertTriangleIcon,
51
55
  error: icons_namespaceObject.XIcon
52
56
  };
57
+ const StatusContext = (0, external_react_namespaceObject.createContext)('info');
58
+ const StatusProvider = StatusContext.Provider;
59
+ const useStatusContext = ()=>(0, external_react_namespaceObject.useContext)(StatusContext);
53
60
  function toPrimitive(t, r) {
54
61
  if ("object" != typeof t || !t) return t;
55
62
  var e = t[Symbol.toPrimitive];
@@ -152,9 +159,9 @@ var Alert_css_alert = createRuntimeFn({
152
159
  compoundVariants: []
153
160
  });
154
161
  var body = '_1313gq6';
155
- var Alert_css_description = '_1313gq8';
162
+ var description = '_1313gq8';
156
163
  var icon = '_1313gq5';
157
- var Alert_css_title = '_1313gq7';
164
+ var title = '_1313gq7';
158
165
  function _define_property(obj, key, value) {
159
166
  if (key in obj) Object.defineProperty(obj, key, {
160
167
  value: value,
@@ -237,48 +244,81 @@ const Alert = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0,
237
244
  let _ref = [
238
245
  _0,
239
246
  _1
240
- ], [_ref1, ..._rest] = _ref, { status = 'info', title, description, className } = _ref1, rest = _object_without_properties(_ref1, [
247
+ ], [_ref1, ..._rest] = _ref, { status = 'info', className, children } = _ref1, rest = _object_without_properties(_ref1, [
241
248
  "status",
242
- "title",
243
- "description",
244
- "className"
249
+ "className",
250
+ "children"
245
251
  ]), [ref] = _rest;
246
- const Icon = statusIcons[status];
247
252
  const classes = className ? `${Alert_css_alert({
248
253
  status
249
254
  })} ${className}` : Alert_css_alert({
250
255
  status
251
256
  });
252
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(box_default(), _object_spread_props(_object_spread({
253
- ref: ref,
254
- role: "alert",
255
- className: classes
256
- }, rest), {
257
- children: [
258
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
259
- className: icon,
260
- "aria-hidden": "true"
261
- }),
262
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
263
- className: body,
264
- children: [
265
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
266
- className: Alert_css_title,
267
- children: title
268
- }),
269
- description ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
270
- className: Alert_css_description,
271
- children: description
272
- }) : null
273
- ]
274
- })
275
- ]
276
- }));
257
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StatusProvider, {
258
+ value: status,
259
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(box_default(), _object_spread_props(_object_spread({
260
+ ref: ref,
261
+ role: "alert",
262
+ className: classes
263
+ }, rest), {
264
+ children: children
265
+ }))
266
+ });
277
267
  });
278
268
  Alert.displayName = 'Alert';
279
269
  const alert_Alert = Alert;
270
+ const AlertIcon = (_0)=>{
271
+ let { className, children } = _0, rest = _object_without_properties(_0, [
272
+ "className",
273
+ "children"
274
+ ]);
275
+ const status = useStatusContext();
276
+ const StatusIcon = statusIcons[status];
277
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", _object_spread_props(_object_spread({
278
+ className: className ? `${icon} ${className}` : icon,
279
+ "aria-hidden": "true"
280
+ }, rest), {
281
+ children: null != children ? children : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StatusIcon, {})
282
+ }));
283
+ };
284
+ AlertIcon.displayName = 'AlertIcon';
285
+ const AlertBody = (_0)=>{
286
+ let { className } = _0, rest = _object_without_properties(_0, [
287
+ "className"
288
+ ]);
289
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", _object_spread({
290
+ className: className ? `${body} ${className}` : body
291
+ }, rest));
292
+ };
293
+ AlertBody.displayName = 'AlertBody';
294
+ const AlertTitle = (_0)=>{
295
+ let { className } = _0, rest = _object_without_properties(_0, [
296
+ "className"
297
+ ]);
298
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", _object_spread({
299
+ className: className ? `${title} ${className}` : title
300
+ }, rest));
301
+ };
302
+ AlertTitle.displayName = 'AlertTitle';
303
+ const AlertDescription = (_0)=>{
304
+ let { className } = _0, rest = _object_without_properties(_0, [
305
+ "className"
306
+ ]);
307
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", _object_spread({
308
+ className: className ? `${description} ${className}` : description
309
+ }, rest));
310
+ };
311
+ AlertDescription.displayName = "AlertDescription";
312
+ exports.AlertBody = __webpack_exports__.AlertBody;
313
+ exports.AlertDescription = __webpack_exports__.AlertDescription;
314
+ exports.AlertIcon = __webpack_exports__.AlertIcon;
315
+ exports.AlertTitle = __webpack_exports__.AlertTitle;
280
316
  exports["default"] = __webpack_exports__["default"];
281
317
  for(var __rspack_i in __webpack_exports__)if (-1 === [
318
+ "AlertBody",
319
+ "AlertDescription",
320
+ "AlertIcon",
321
+ "AlertTitle",
282
322
  "default"
283
323
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
284
324
  Object.defineProperty(exports, '__esModule', {
@@ -37,6 +37,7 @@ var __webpack_require__ = {};
37
37
  var __webpack_exports__ = {};
38
38
  __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
+ BannerIcon: ()=>BannerIcon,
40
41
  default: ()=>banner_Banner
41
42
  });
42
43
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
@@ -50,6 +51,9 @@ const statusIcons = {
50
51
  warning: icons_namespaceObject.AlertTriangleIcon,
51
52
  error: icons_namespaceObject.XIcon
52
53
  };
54
+ const StatusContext = (0, external_react_namespaceObject.createContext)('info');
55
+ const StatusProvider = StatusContext.Provider;
56
+ const useStatusContext = ()=>(0, external_react_namespaceObject.useContext)(StatusContext);
53
57
  function toPrimitive(t, r) {
54
58
  if ("object" != typeof t || !t) return t;
55
59
  var e = t[Symbol.toPrimitive];
@@ -239,30 +243,43 @@ const Banner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0,
239
243
  "className",
240
244
  "children"
241
245
  ]), [ref] = _rest;
242
- const Icon = statusIcons[status];
243
246
  const classes = className ? `${banner({
244
247
  status
245
248
  })} ${className}` : banner({
246
249
  status
247
250
  });
248
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(box_default(), _object_spread_props(_object_spread({
249
- ref: ref,
250
- role: "alert",
251
- className: classes
252
- }, rest), {
253
- children: [
254
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
255
- className: icon,
256
- "aria-hidden": "true"
257
- }),
258
- children
259
- ]
260
- }));
251
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StatusProvider, {
252
+ value: status,
253
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(box_default(), _object_spread_props(_object_spread({
254
+ ref: ref,
255
+ role: "alert",
256
+ className: classes
257
+ }, rest), {
258
+ children: children
259
+ }))
260
+ });
261
261
  });
262
262
  Banner.displayName = 'Banner';
263
263
  const banner_Banner = Banner;
264
+ const BannerIcon = (_0)=>{
265
+ let { className, children } = _0, rest = _object_without_properties(_0, [
266
+ "className",
267
+ "children"
268
+ ]);
269
+ const status = useStatusContext();
270
+ const StatusIcon = statusIcons[status];
271
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", _object_spread_props(_object_spread({
272
+ className: className ? `${icon} ${className}` : icon,
273
+ "aria-hidden": "true"
274
+ }, rest), {
275
+ children: null != children ? children : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StatusIcon, {})
276
+ }));
277
+ };
278
+ BannerIcon.displayName = 'BannerIcon';
279
+ exports.BannerIcon = __webpack_exports__.BannerIcon;
264
280
  exports["default"] = __webpack_exports__["default"];
265
281
  for(var __rspack_i in __webpack_exports__)if (-1 === [
282
+ "BannerIcon",
266
283
  "default"
267
284
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
268
285
  Object.defineProperty(exports, '__esModule', {
@@ -28,9 +28,11 @@ var __webpack_require__ = {};
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
30
  __webpack_require__.d(__webpack_exports__, {
31
+ CircularProgressIndicator: ()=>CircularProgressIndicator,
31
32
  default: ()=>circular_progress_CircularProgress
32
33
  });
33
34
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
35
+ const react_progress_namespaceObject = require("@radix-ui/react-progress");
34
36
  const external_react_namespaceObject = require("react");
35
37
  const tokens_namespaceObject = require("@vinyasa/tokens");
36
38
  const space = {
@@ -189,11 +191,17 @@ function _object_without_properties_loose(source, excluded) {
189
191
  }
190
192
  return target;
191
193
  }
194
+ const CircularProgressContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)({
195
+ value: null,
196
+ max: 100,
197
+ size: 32,
198
+ strokeWidth: 4
199
+ });
192
200
  const CircularProgress = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((_0, _1)=>{
193
201
  let _ref = [
194
202
  _0,
195
203
  _1
196
- ], [_ref1, ..._rest] = _ref, { value, max = 100, size = 32, strokeWidth = 4, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, className, style } = _ref1, rest = _object_without_properties(_ref1, [
204
+ ], [_ref1, ..._rest] = _ref, { value, max = 100, size = 32, strokeWidth = 4, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, className, style, children } = _ref1, rest = _object_without_properties(_ref1, [
197
205
  "value",
198
206
  "max",
199
207
  "size",
@@ -213,13 +221,10 @@ const CircularProgress = /*#__PURE__*/ (0, external_react_namespaceObject.forwar
213
221
  "px",
214
222
  "py",
215
223
  "className",
216
- "style"
224
+ "style",
225
+ "children"
217
226
  ]), [ref] = _rest;
218
- const radius = (size - strokeWidth) / 2;
219
- const circumference = 2 * Math.PI * radius;
220
227
  const isIndeterminate = void 0 === value;
221
- const percent = isIndeterminate ? 25 : Math.min(100, Math.max(0, value / max * 100));
222
- const dashOffset = circumference - percent / 100 * circumference;
223
228
  const computedStyle = _object_spread({}, resolveSpacingStyle({
224
229
  m,
225
230
  mt,
@@ -242,43 +247,75 @@ const CircularProgress = /*#__PURE__*/ (0, external_react_namespaceObject.forwar
242
247
  className
243
248
  ].filter(Boolean).join(' ');
244
249
  const center = size / 2;
245
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", _object_spread_props(_object_spread({
246
- ref: ref,
247
- role: "progressbar",
248
- "aria-valuenow": isIndeterminate ? void 0 : value,
249
- "aria-valuemin": 0,
250
- "aria-valuemax": max,
251
- width: size,
252
- height: size,
253
- viewBox: `0 0 ${String(size)} ${String(size)}`,
254
- className: classes,
255
- style: computedStyle
256
- }, rest), {
257
- children: [
258
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("circle", {
259
- className: track,
260
- cx: center,
261
- cy: center,
262
- r: radius,
263
- strokeWidth: strokeWidth
264
- }),
265
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("circle", {
266
- className: fill,
267
- cx: center,
268
- cy: center,
269
- r: radius,
270
- strokeWidth: strokeWidth,
271
- strokeDasharray: circumference,
272
- strokeDashoffset: dashOffset,
273
- transform: `rotate(-90 ${String(center)} ${String(center)})`
250
+ const radius = (size - strokeWidth) / 2;
251
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CircularProgressContext.Provider, {
252
+ value: {
253
+ value: isIndeterminate ? null : value,
254
+ max,
255
+ size,
256
+ strokeWidth
257
+ },
258
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_progress_namespaceObject.Root, _object_spread_props(_object_spread({
259
+ value: isIndeterminate ? null : value,
260
+ max: max
261
+ }, rest), {
262
+ asChild: true,
263
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", {
264
+ ref: ref,
265
+ width: size,
266
+ height: size,
267
+ viewBox: `0 0 ${String(size)} ${String(size)}`,
268
+ className: classes,
269
+ style: computedStyle,
270
+ children: [
271
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("circle", {
272
+ className: track,
273
+ cx: center,
274
+ cy: center,
275
+ r: radius,
276
+ strokeWidth: strokeWidth
277
+ }),
278
+ children
279
+ ]
274
280
  })
275
- ]
276
- }));
281
+ }))
282
+ });
277
283
  });
278
284
  CircularProgress.displayName = 'CircularProgress';
279
285
  const circular_progress_CircularProgress = CircularProgress;
286
+ const CircularProgressIndicator = (_0)=>{
287
+ let { className, style } = _0, rest = _object_without_properties(_0, [
288
+ "className",
289
+ "style"
290
+ ]);
291
+ const { value, max, size, strokeWidth } = (0, external_react_namespaceObject.useContext)(CircularProgressContext);
292
+ const isIndeterminate = null === value;
293
+ const radius = (size - strokeWidth) / 2;
294
+ const circumference = 2 * Math.PI * radius;
295
+ const percent = isIndeterminate ? 25 : Math.min(100, Math.max(0, value / max * 100));
296
+ const dashOffset = circumference - percent / 100 * circumference;
297
+ const center = size / 2;
298
+ const classes = className ? `${fill} ${className}` : fill;
299
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_progress_namespaceObject.Indicator, {
300
+ asChild: true,
301
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("circle", _object_spread({
302
+ className: classes,
303
+ cx: center,
304
+ cy: center,
305
+ r: radius,
306
+ strokeWidth: strokeWidth,
307
+ strokeDasharray: circumference,
308
+ strokeDashoffset: dashOffset,
309
+ transform: `rotate(-90 ${String(center)} ${String(center)})`,
310
+ style: style
311
+ }, rest))
312
+ });
313
+ };
314
+ CircularProgressIndicator.displayName = 'CircularProgressIndicator';
315
+ exports.CircularProgressIndicator = __webpack_exports__.CircularProgressIndicator;
280
316
  exports["default"] = __webpack_exports__["default"];
281
317
  for(var __rspack_i in __webpack_exports__)if (-1 === [
318
+ "CircularProgressIndicator",
282
319
  "default"
283
320
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
284
321
  Object.defineProperty(exports, '__esModule', {
@@ -28,6 +28,10 @@ var __webpack_require__ = {};
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
30
  __webpack_require__.d(__webpack_exports__, {
31
+ EmptyStateAction: ()=>EmptyStateAction,
32
+ EmptyStateDescription: ()=>EmptyStateDescription,
33
+ EmptyStateIcon: ()=>EmptyStateIcon,
34
+ EmptyStateTitle: ()=>EmptyStateTitle,
31
35
  default: ()=>empty_state_EmptyState
32
36
  });
33
37
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
@@ -117,47 +121,67 @@ const EmptyState = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(
117
121
  let _ref = [
118
122
  _0,
119
123
  _1
120
- ], [_ref1, ..._rest] = _ref, { icon, title, description, action, p = 6 } = _ref1, rest = _object_without_properties(_ref1, [
121
- "icon",
122
- "title",
123
- "description",
124
- "action",
125
- "p"
124
+ ], [_ref1, ..._rest] = _ref, { p = 6, children } = _ref1, rest = _object_without_properties(_ref1, [
125
+ "p",
126
+ "children"
126
127
  ]), [ref] = _rest;
127
128
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(layout_namespaceObject.Center, _object_spread_props(_object_spread({
128
129
  ref: ref,
129
130
  p: p
130
131
  }, rest), {
131
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(layout_namespaceObject.Stack, {
132
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(layout_namespaceObject.Stack, {
132
133
  gap: 2,
133
134
  align: "center",
134
135
  style: {
135
136
  textAlign: 'center',
136
137
  maxWidth: '24rem'
137
138
  },
138
- children: [
139
- icon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
140
- className: iconWrapper,
141
- children: icon
142
- }) : null,
143
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typography_namespaceObject.Heading, {
144
- as: "h3",
145
- size: "lg",
146
- children: title
147
- }),
148
- description ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typography_namespaceObject.Paragraph, {
149
- color: "muted",
150
- children: description
151
- }) : null,
152
- action
153
- ]
139
+ children: children
154
140
  })
155
141
  }));
156
142
  });
157
143
  EmptyState.displayName = 'EmptyState';
158
144
  const empty_state_EmptyState = EmptyState;
145
+ const EmptyStateIcon = (_0)=>{
146
+ let { className } = _0, rest = _object_without_properties(_0, [
147
+ "className"
148
+ ]);
149
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", _object_spread({
150
+ className: className ? `${iconWrapper} ${className}` : iconWrapper
151
+ }, rest));
152
+ };
153
+ EmptyStateIcon.displayName = 'EmptyStateIcon';
154
+ const EmptyStateTitle = (_0)=>{
155
+ let { size = 'lg' } = _0, rest = _object_without_properties(_0, [
156
+ "size"
157
+ ]);
158
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typography_namespaceObject.Heading, _object_spread({
159
+ as: "h3",
160
+ size: size
161
+ }, rest));
162
+ };
163
+ EmptyStateTitle.displayName = 'EmptyStateTitle';
164
+ const EmptyStateDescription = (_0)=>{
165
+ let { color = 'muted' } = _0, rest = _object_without_properties(_0, [
166
+ "color"
167
+ ]);
168
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typography_namespaceObject.Paragraph, _object_spread({
169
+ color: color
170
+ }, rest));
171
+ };
172
+ EmptyStateDescription.displayName = "EmptyStateDescription";
173
+ const EmptyStateAction = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", _object_spread({}, props));
174
+ EmptyStateAction.displayName = 'EmptyStateAction';
175
+ exports.EmptyStateAction = __webpack_exports__.EmptyStateAction;
176
+ exports.EmptyStateDescription = __webpack_exports__.EmptyStateDescription;
177
+ exports.EmptyStateIcon = __webpack_exports__.EmptyStateIcon;
178
+ exports.EmptyStateTitle = __webpack_exports__.EmptyStateTitle;
159
179
  exports["default"] = __webpack_exports__["default"];
160
180
  for(var __rspack_i in __webpack_exports__)if (-1 === [
181
+ "EmptyStateAction",
182
+ "EmptyStateDescription",
183
+ "EmptyStateIcon",
184
+ "EmptyStateTitle",
161
185
  "default"
162
186
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
163
187
  Object.defineProperty(exports, '__esModule', {
@@ -37,6 +37,8 @@ var __webpack_require__ = {};
37
37
  var __webpack_exports__ = {};
38
38
  __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
+ ErrorBoundaryContent: ()=>ErrorBoundaryContent,
41
+ ErrorBoundaryFallback: ()=>ErrorBoundaryFallback,
40
42
  default: ()=>error_boundary_ErrorBoundary
41
43
  });
42
44
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
@@ -128,45 +130,57 @@ const EmptyState = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(
128
130
  let _ref = [
129
131
  _0,
130
132
  _1
131
- ], [_ref1, ..._rest] = _ref, { icon, title, description, action, p = 6 } = _ref1, rest = _object_without_properties(_ref1, [
132
- "icon",
133
- "title",
134
- "description",
135
- "action",
136
- "p"
133
+ ], [_ref1, ..._rest] = _ref, { p = 6, children } = _ref1, rest = _object_without_properties(_ref1, [
134
+ "p",
135
+ "children"
137
136
  ]), [ref] = _rest;
138
137
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(layout_namespaceObject.Center, _object_spread_props(_object_spread({
139
138
  ref: ref,
140
139
  p: p
141
140
  }, rest), {
142
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(layout_namespaceObject.Stack, {
141
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(layout_namespaceObject.Stack, {
143
142
  gap: 2,
144
143
  align: "center",
145
144
  style: {
146
145
  textAlign: 'center',
147
146
  maxWidth: '24rem'
148
147
  },
149
- children: [
150
- icon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
151
- className: iconWrapper,
152
- children: icon
153
- }) : null,
154
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typography_namespaceObject.Heading, {
155
- as: "h3",
156
- size: "lg",
157
- children: title
158
- }),
159
- description ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typography_namespaceObject.Paragraph, {
160
- color: "muted",
161
- children: description
162
- }) : null,
163
- action
164
- ]
148
+ children: children
165
149
  })
166
150
  }));
167
151
  });
168
152
  EmptyState.displayName = 'EmptyState';
169
153
  const empty_state_EmptyState = EmptyState;
154
+ const EmptyStateIcon = (_0)=>{
155
+ let { className } = _0, rest = _object_without_properties(_0, [
156
+ "className"
157
+ ]);
158
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", _object_spread({
159
+ className: className ? `${iconWrapper} ${className}` : iconWrapper
160
+ }, rest));
161
+ };
162
+ EmptyStateIcon.displayName = 'EmptyStateIcon';
163
+ const EmptyStateTitle = (_0)=>{
164
+ let { size = 'lg' } = _0, rest = _object_without_properties(_0, [
165
+ "size"
166
+ ]);
167
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typography_namespaceObject.Heading, _object_spread({
168
+ as: "h3",
169
+ size: size
170
+ }, rest));
171
+ };
172
+ EmptyStateTitle.displayName = 'EmptyStateTitle';
173
+ const EmptyStateDescription = (_0)=>{
174
+ let { color = 'muted' } = _0, rest = _object_without_properties(_0, [
175
+ "color"
176
+ ]);
177
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(typography_namespaceObject.Paragraph, _object_spread({
178
+ color: color
179
+ }, rest));
180
+ };
181
+ EmptyStateDescription.displayName = "EmptyStateDescription";
182
+ const EmptyStateAction = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", _object_spread({}, props));
183
+ EmptyStateAction.displayName = 'EmptyStateAction';
170
184
  function ErrorBoundary_define_property(obj, key, value) {
171
185
  if (key in obj) Object.defineProperty(obj, key, {
172
186
  value: value,
@@ -177,6 +191,27 @@ function ErrorBoundary_define_property(obj, key, value) {
177
191
  else obj[key] = value;
178
192
  return obj;
179
193
  }
194
+ const ErrorBoundaryContent = ({ children })=>children;
195
+ ErrorBoundaryContent.displayName = 'ErrorBoundaryContent';
196
+ const ErrorBoundaryFallback = (props)=>null;
197
+ ErrorBoundaryFallback.displayName = 'ErrorBoundaryFallback';
198
+ const findSlot = (children, type)=>external_react_namespaceObject.Children.toArray(children).find((child)=>/*#__PURE__*/ (0, external_react_namespaceObject.isValidElement)(child) && child.type === type);
199
+ const defaultFallback = ({ error, resetErrorBoundary })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(empty_state_EmptyState, {
200
+ children: [
201
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EmptyStateTitle, {
202
+ children: "Something went wrong"
203
+ }),
204
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EmptyStateDescription, {
205
+ children: error.message
206
+ }),
207
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EmptyStateAction, {
208
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_default(), {
209
+ onClick: resetErrorBoundary,
210
+ children: "Try again"
211
+ })
212
+ })
213
+ ]
214
+ });
180
215
  class ErrorBoundary extends external_react_namespaceObject.Component {
181
216
  static getDerivedStateFromError(error) {
182
217
  return {
@@ -197,19 +232,20 @@ class ErrorBoundary extends external_react_namespaceObject.Component {
197
232
  }
198
233
  render() {
199
234
  const { error } = this.state;
200
- if (!error) return this.props.children;
201
- const { fallback } = this.props;
235
+ const { children } = this.props;
236
+ if (!error) {
237
+ var _findSlot;
238
+ return null != (_findSlot = findSlot(children, ErrorBoundaryContent)) ? _findSlot : null;
239
+ }
240
+ const fallbackSlot = findSlot(children, ErrorBoundaryFallback);
241
+ const fallback = null == fallbackSlot ? void 0 : fallbackSlot.props.children;
202
242
  if ('function' == typeof fallback) return fallback({
203
243
  error,
204
244
  resetErrorBoundary: this.reset
205
245
  });
206
- return null != fallback ? fallback : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(empty_state_EmptyState, {
207
- title: "Something went wrong",
208
- description: error.message,
209
- action: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_default(), {
210
- onClick: this.reset,
211
- children: "Try again"
212
- })
246
+ return null != fallback ? fallback : defaultFallback({
247
+ error,
248
+ resetErrorBoundary: this.reset
213
249
  });
214
250
  }
215
251
  constructor(...args){
@@ -225,8 +261,12 @@ class ErrorBoundary extends external_react_namespaceObject.Component {
225
261
  }
226
262
  }
227
263
  const error_boundary_ErrorBoundary = ErrorBoundary;
264
+ exports.ErrorBoundaryContent = __webpack_exports__.ErrorBoundaryContent;
265
+ exports.ErrorBoundaryFallback = __webpack_exports__.ErrorBoundaryFallback;
228
266
  exports["default"] = __webpack_exports__["default"];
229
267
  for(var __rspack_i in __webpack_exports__)if (-1 === [
268
+ "ErrorBoundaryContent",
269
+ "ErrorBoundaryFallback",
230
270
  "default"
231
271
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
232
272
  Object.defineProperty(exports, '__esModule', {