@wistia/ui 0.18.0-beta.978703a9.78cdfd1 → 0.18.0-beta.9dd31b7e.fa98d59

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.9dd31b7e.fa98d59
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
  },
@@ -14863,6 +14840,7 @@ var FormField = ({
14863
14840
  id: computedId,
14864
14841
  label: isIntegratedLabel ? label : void 0,
14865
14842
  "aria-describedby": ariaDescribedby,
14843
+ "aria-invalid": isNotNil28(computedError),
14866
14844
  ...props
14867
14845
  };
14868
14846
  if (isUndefined4(value) && isNotUndefined12(defaultValue)) {
@@ -14884,8 +14862,7 @@ var FormField = ({
14884
14862
  childProps = {
14885
14863
  ...childProps,
14886
14864
  name: computedName,
14887
- onChange: handleChange,
14888
- "aria-invalid": isNotNil28(error)
14865
+ onChange: handleChange
14889
14866
  };
14890
14867
  }
14891
14868
  Children10.only(children);