@wistia/ui 0.18.0-beta.978703a9.78cdfd1 → 0.18.0-beta.ce6c1712.725e361
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 +27 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -12
- package/dist/index.d.ts +7 -12
- package/dist/index.mjs +27 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.18.0-beta.
|
|
3
|
+
* @license @wistia/ui v0.18.0-beta.ce6c1712.725e361
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2992,11 +2992,26 @@ var useForceUpdate = () => {
|
|
|
2992
2992
|
var import_react11 = require("react");
|
|
2993
2993
|
var useIsHovered = () => {
|
|
2994
2994
|
const [isHovered, setIsHovered] = (0, import_react11.useState)(false);
|
|
2995
|
-
const onFocus = () =>
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
const
|
|
2995
|
+
const onFocus = (event) => {
|
|
2996
|
+
if (event.target !== event.currentTarget) return;
|
|
2997
|
+
setIsHovered(true);
|
|
2998
|
+
};
|
|
2999
|
+
const onMouseEnter = (event) => {
|
|
3000
|
+
if (event.target !== event.currentTarget) return;
|
|
3001
|
+
setIsHovered(true);
|
|
3002
|
+
};
|
|
3003
|
+
const onMouseMove = (event) => {
|
|
3004
|
+
if (event.target !== event.currentTarget) return;
|
|
3005
|
+
setIsHovered(true);
|
|
3006
|
+
};
|
|
3007
|
+
const onBlur = (event) => {
|
|
3008
|
+
if (event.target !== event.currentTarget) return;
|
|
3009
|
+
setIsHovered(false);
|
|
3010
|
+
};
|
|
3011
|
+
const onMouseLeave = (event) => {
|
|
3012
|
+
if (event.target !== event.currentTarget) return;
|
|
3013
|
+
setIsHovered(false);
|
|
3014
|
+
};
|
|
3000
3015
|
const hoverProps = {
|
|
3001
3016
|
onFocus,
|
|
3002
3017
|
onMouseEnter,
|
|
@@ -3370,7 +3385,7 @@ var StyledToast = import_styled_components17.styled.div`
|
|
|
3370
3385
|
justify-content: space-between;
|
|
3371
3386
|
min-height: 56px;
|
|
3372
3387
|
width: 356px;
|
|
3373
|
-
border-radius: var(--wui-border-radius-
|
|
3388
|
+
border-radius: var(--wui-border-radius-01);
|
|
3374
3389
|
background-color: var(--wui-color-bg-surface);
|
|
3375
3390
|
border: 1px solid var(--wui-color-border);
|
|
3376
3391
|
color: var(--wui-color-text);
|
|
@@ -3386,28 +3401,13 @@ var StyledToast = import_styled_components17.styled.div`
|
|
|
3386
3401
|
flex: 0 0 16px;
|
|
3387
3402
|
}
|
|
3388
3403
|
`;
|
|
3389
|
-
var Action = ({
|
|
3390
|
-
actionButton,
|
|
3391
|
-
toastId
|
|
3392
|
-
}) => {
|
|
3404
|
+
var Action = ({ actionButton }) => {
|
|
3393
3405
|
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
|
-
};
|
|
3403
3406
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0, import_react19.cloneElement)(actionButton, {
|
|
3404
|
-
...restProps,
|
|
3405
3407
|
variant: "soft",
|
|
3406
3408
|
// force Button variant
|
|
3407
|
-
size: "sm"
|
|
3409
|
+
size: "sm"
|
|
3408
3410
|
// force Button size
|
|
3409
|
-
onClick: handleClick
|
|
3410
|
-
// decorate onClick function with new args
|
|
3411
3411
|
}) });
|
|
3412
3412
|
}
|
|
3413
3413
|
return null;
|
|
@@ -3417,7 +3417,6 @@ var Toast = ({
|
|
|
3417
3417
|
message,
|
|
3418
3418
|
colorScheme = "inherit",
|
|
3419
3419
|
icon,
|
|
3420
|
-
toastId,
|
|
3421
3420
|
...props
|
|
3422
3421
|
}) => {
|
|
3423
3422
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
@@ -3430,13 +3429,7 @@ var Toast = ({
|
|
|
3430
3429
|
(0, import_type_guards11.isNotNil)(icon) ? icon : null,
|
|
3431
3430
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Message, { lines: 3, children: message })
|
|
3432
3431
|
] }),
|
|
3433
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3434
|
-
Action,
|
|
3435
|
-
{
|
|
3436
|
-
actionButton: action,
|
|
3437
|
-
toastId
|
|
3438
|
-
}
|
|
3439
|
-
)
|
|
3432
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Action, { actionButton: action })
|
|
3440
3433
|
]
|
|
3441
3434
|
}
|
|
3442
3435
|
);
|
|
@@ -3449,15 +3442,14 @@ var useToast = () => {
|
|
|
3449
3442
|
return (0, import_react20.useCallback)(
|
|
3450
3443
|
({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
|
|
3451
3444
|
import_sonner2.toast.custom(
|
|
3452
|
-
(
|
|
3445
|
+
() => {
|
|
3453
3446
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3454
3447
|
Toast,
|
|
3455
3448
|
{
|
|
3456
3449
|
action,
|
|
3457
3450
|
colorScheme,
|
|
3458
3451
|
icon,
|
|
3459
|
-
message
|
|
3460
|
-
toastId: String(toastId)
|
|
3452
|
+
message
|
|
3461
3453
|
}
|
|
3462
3454
|
);
|
|
3463
3455
|
},
|