@wistia/ui 0.18.0-beta.978703a9.78cdfd1 → 0.18.0-beta.af6ce7a5.9372ce9

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.d.mts CHANGED
@@ -430,7 +430,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & Om
430
430
 
431
431
  type ToastProps = ComponentPropsWithoutRef<'div'> & {
432
432
  /**
433
- * Action can be passed a Button component for a custom button to be displayed in the toast
433
+ * Action can be undefined (default dismiss button), a Button component or false to hide the dismiss button
434
434
  */
435
435
  action?: React.ReactElement<typeof Button> | undefined;
436
436
  /**
@@ -445,15 +445,10 @@ type ToastProps = ComponentPropsWithoutRef<'div'> & {
445
445
  * The message displayed in the toast
446
446
  */
447
447
  message: ReactNode;
448
- /**
449
- * @ignore
450
- * The ID given for the Toast by sonner
451
- */
452
- toastId?: string;
453
448
  };
454
449
 
455
450
  type Position = 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right';
456
- type UseToastProps = Omit<ToastProps, 'toastId'> & {
451
+ type UseToastProps = ToastProps & {
457
452
  position?: Position;
458
453
  duration?: number;
459
454
  };
package/dist/index.d.ts CHANGED
@@ -430,7 +430,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & Om
430
430
 
431
431
  type ToastProps = ComponentPropsWithoutRef<'div'> & {
432
432
  /**
433
- * Action can be passed a Button component for a custom button to be displayed in the toast
433
+ * Action can be undefined (default dismiss button), a Button component or false to hide the dismiss button
434
434
  */
435
435
  action?: React.ReactElement<typeof Button> | undefined;
436
436
  /**
@@ -445,15 +445,10 @@ type ToastProps = ComponentPropsWithoutRef<'div'> & {
445
445
  * The message displayed in the toast
446
446
  */
447
447
  message: ReactNode;
448
- /**
449
- * @ignore
450
- * The ID given for the Toast by sonner
451
- */
452
- toastId?: string;
453
448
  };
454
449
 
455
450
  type Position = 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right';
456
- type UseToastProps = Omit<ToastProps, 'toastId'> & {
451
+ type UseToastProps = ToastProps & {
457
452
  position?: Position;
458
453
  duration?: number;
459
454
  };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.18.0-beta.978703a9.78cdfd1
3
+ * @license @wistia/ui v0.18.0-beta.af6ce7a5.9372ce9
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -3190,7 +3190,7 @@ var StyledToast = styled2.div`
3190
3190
  justify-content: space-between;
3191
3191
  min-height: 56px;
3192
3192
  width: 356px;
3193
- border-radius: var(--wui-border-radius-02);
3193
+ border-radius: var(--wui-border-radius-01);
3194
3194
  background-color: var(--wui-color-bg-surface);
3195
3195
  border: 1px solid var(--wui-color-border);
3196
3196
  color: var(--wui-color-text);
@@ -3206,28 +3206,13 @@ var StyledToast = styled2.div`
3206
3206
  flex: 0 0 16px;
3207
3207
  }
3208
3208
  `;
3209
- var Action = ({
3210
- actionButton,
3211
- toastId
3212
- }) => {
3209
+ var Action = ({ actionButton }) => {
3213
3210
  if (isNotNil4(actionButton) && isValidElement(actionButton)) {
3214
- const { onClick, ...restProps } = actionButton.props;
3215
- const handleClick = (event) => {
3216
- if (onClick) {
3217
- onClick(
3218
- event,
3219
- toastId ?? ""
3220
- );
3221
- }
3222
- };
3223
3211
  return /* @__PURE__ */ jsx5(ActionWrapper, { children: cloneElement(actionButton, {
3224
- ...restProps,
3225
3212
  variant: "soft",
3226
3213
  // force Button variant
3227
- size: "sm",
3214
+ size: "sm"
3228
3215
  // force Button size
3229
- onClick: handleClick
3230
- // decorate onClick function with new args
3231
3216
  }) });
3232
3217
  }
3233
3218
  return null;
@@ -3237,7 +3222,6 @@ var Toast = ({
3237
3222
  message,
3238
3223
  colorScheme = "inherit",
3239
3224
  icon,
3240
- toastId,
3241
3225
  ...props
3242
3226
  }) => {
3243
3227
  return /* @__PURE__ */ jsxs2(
@@ -3250,13 +3234,7 @@ var Toast = ({
3250
3234
  isNotNil4(icon) ? icon : null,
3251
3235
  /* @__PURE__ */ jsx5(Message, { lines: 3, children: message })
3252
3236
  ] }),
3253
- /* @__PURE__ */ jsx5(
3254
- Action,
3255
- {
3256
- actionButton: action,
3257
- toastId
3258
- }
3259
- )
3237
+ /* @__PURE__ */ jsx5(Action, { actionButton: action })
3260
3238
  ]
3261
3239
  }
3262
3240
  );
@@ -3269,15 +3247,14 @@ var useToast = () => {
3269
3247
  return useCallback7(
3270
3248
  ({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
3271
3249
  sonnerToast.custom(
3272
- (toastId) => {
3250
+ () => {
3273
3251
  return /* @__PURE__ */ jsx6(
3274
3252
  Toast,
3275
3253
  {
3276
3254
  action,
3277
3255
  colorScheme,
3278
3256
  icon,
3279
- message,
3280
- toastId: String(toastId)
3257
+ message
3281
3258
  }
3282
3259
  );
3283
3260
  },
@@ -7747,6 +7724,7 @@ var StyledButton = styled5.button`
7747
7724
  ${({ $variant }) => buttonVariantsStyles[$variant]}
7748
7725
  ${({ $unstyled }) => !$unstyled && buttonBaseStyles}
7749
7726
  ${({ $fullWidth }) => $fullWidth && "width: 100%;"}
7727
+ align-self: flex-start;
7750
7728
  text-align: center;
7751
7729
  `;
7752
7730
  var StyledButtonContent = styled5.div`
@@ -8443,7 +8421,7 @@ var DEFAULT_ELEMENT = "div";
8443
8421
  var BoxComponent = forwardRef5(
8444
8422
  ({
8445
8423
  alignContent = "stretch",
8446
- alignItems = "flex-start",
8424
+ alignItems = "stretch",
8447
8425
  alignSelf,
8448
8426
  basis,
8449
8427
  children,
@@ -8962,6 +8940,10 @@ var ButtonGroupComponent = styled14.div`
8962
8940
  justify-content: ${({ $align }) => getAlignment($align)};
8963
8941
  width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
8964
8942
 
8943
+ ${StyledButton} {
8944
+ align-self: unset;
8945
+ }
8946
+
8965
8947
  ${mq.smAndUp} {
8966
8948
  flex-direction: row;
8967
8949
  }