@wistia/ui 0.18.0-beta.782f3b36.e196b15 → 0.18.0-beta.978703a9.78cdfd1

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/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.18.0-beta.782f3b36.e196b15
3
+ * @license @wistia/ui v0.18.0-beta.978703a9.78cdfd1
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -3370,7 +3370,7 @@ var StyledToast = import_styled_components17.styled.div`
3370
3370
  justify-content: space-between;
3371
3371
  min-height: 56px;
3372
3372
  width: 356px;
3373
- border-radius: var(--wui-border-radius-01);
3373
+ border-radius: var(--wui-border-radius-02);
3374
3374
  background-color: var(--wui-color-bg-surface);
3375
3375
  border: 1px solid var(--wui-color-border);
3376
3376
  color: var(--wui-color-text);
@@ -3386,13 +3386,28 @@ var StyledToast = import_styled_components17.styled.div`
3386
3386
  flex: 0 0 16px;
3387
3387
  }
3388
3388
  `;
3389
- var Action = ({ actionButton }) => {
3389
+ var Action = ({
3390
+ actionButton,
3391
+ toastId
3392
+ }) => {
3390
3393
  if ((0, import_type_guards11.isNotNil)(actionButton) && (0, import_react19.isValidElement)(actionButton)) {
3394
+ const { onClick, ...restProps } = actionButton.props;
3395
+ const handleClick = (event) => {
3396
+ if (onClick) {
3397
+ onClick(
3398
+ event,
3399
+ toastId ?? ""
3400
+ );
3401
+ }
3402
+ };
3391
3403
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0, import_react19.cloneElement)(actionButton, {
3404
+ ...restProps,
3392
3405
  variant: "soft",
3393
3406
  // force Button variant
3394
- size: "sm"
3407
+ size: "sm",
3395
3408
  // force Button size
3409
+ onClick: handleClick
3410
+ // decorate onClick function with new args
3396
3411
  }) });
3397
3412
  }
3398
3413
  return null;
@@ -3402,6 +3417,7 @@ var Toast = ({
3402
3417
  message,
3403
3418
  colorScheme = "inherit",
3404
3419
  icon,
3420
+ toastId,
3405
3421
  ...props
3406
3422
  }) => {
3407
3423
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
@@ -3414,7 +3430,13 @@ var Toast = ({
3414
3430
  (0, import_type_guards11.isNotNil)(icon) ? icon : null,
3415
3431
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Message, { lines: 3, children: message })
3416
3432
  ] }),
3417
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Action, { actionButton: action })
3433
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3434
+ Action,
3435
+ {
3436
+ actionButton: action,
3437
+ toastId
3438
+ }
3439
+ )
3418
3440
  ]
3419
3441
  }
3420
3442
  );
@@ -3427,14 +3449,15 @@ var useToast = () => {
3427
3449
  return (0, import_react20.useCallback)(
3428
3450
  ({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
3429
3451
  import_sonner2.toast.custom(
3430
- () => {
3452
+ (toastId) => {
3431
3453
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3432
3454
  Toast,
3433
3455
  {
3434
3456
  action,
3435
3457
  colorScheme,
3436
3458
  icon,
3437
- message
3459
+ message,
3460
+ toastId: String(toastId)
3438
3461
  }
3439
3462
  );
3440
3463
  },
@@ -8600,7 +8623,7 @@ var DEFAULT_ELEMENT = "div";
8600
8623
  var BoxComponent = (0, import_react27.forwardRef)(
8601
8624
  ({
8602
8625
  alignContent = "stretch",
8603
- alignItems = "stretch",
8626
+ alignItems = "flex-start",
8604
8627
  alignSelf,
8605
8628
  basis,
8606
8629
  children,
@@ -9481,7 +9504,6 @@ var prominenceMap = {
9481
9504
  };
9482
9505
  var Card = ({
9483
9506
  children,
9484
- alignItems = "flex-start",
9485
9507
  border = false,
9486
9508
  borderRadius = "border-radius-04",
9487
9509
  colorScheme = "inherit",
@@ -9495,7 +9517,6 @@ var Card = ({
9495
9517
  }) => /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
9496
9518
  StyledCard,
9497
9519
  {
9498
- $alignItems: alignItems,
9499
9520
  $backgroundColor: prominenceMap[prominence].backgroundColor,
9500
9521
  $borderColor: border ? prominenceMap[prominence].borderColor : "transparent",
9501
9522
  $borderRadius: borderRadius,