@wistia/ui 0.8.19 → 0.8.20-beta.a0831c5f.4f35b1b
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 +71 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +75 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.
|
|
3
|
+
* @license @wistia/ui v0.8.20-beta.a0831c5f.4f35b1b
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2141,7 +2141,7 @@ var useClipboard = (textToCopy, timeout = 1500) => {
|
|
|
2141
2141
|
return [onCopy, hasCopied, failedToCopy];
|
|
2142
2142
|
};
|
|
2143
2143
|
|
|
2144
|
-
// src/hooks/useFilePicker/
|
|
2144
|
+
// src/hooks/useFilePicker/useFilePicker.tsx
|
|
2145
2145
|
var import_use_file_picker = require("use-file-picker");
|
|
2146
2146
|
var import_validators = require("use-file-picker/validators");
|
|
2147
2147
|
|
|
@@ -2424,8 +2424,7 @@ var noOpFn = () => {
|
|
|
2424
2424
|
// src/private/hooks/useEvent/useEvent.ts
|
|
2425
2425
|
var isEventTargetSupported = (eventTarget) => (
|
|
2426
2426
|
// @ts-expect-error the compiler thinks that addEventListener may not exist on eventTarget, but we still need to check it.
|
|
2427
|
-
|
|
2428
|
-
!!(typeof eventTarget === "object" && eventTarget?.addEventListener)
|
|
2427
|
+
Boolean(typeof eventTarget === "object" && eventTarget?.addEventListener)
|
|
2429
2428
|
);
|
|
2430
2429
|
var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}) => {
|
|
2431
2430
|
const savedEventHandler = (0, import_react11.useRef)();
|
|
@@ -2486,7 +2485,7 @@ var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
|
2486
2485
|
const [storedValue, setStoredValue] = (0, import_react13.useState)(() => {
|
|
2487
2486
|
try {
|
|
2488
2487
|
const item = storage.getItem(key);
|
|
2489
|
-
return item !== null &&
|
|
2488
|
+
return item !== null && Boolean(item) ? JSON.parse(item) : initialValue;
|
|
2490
2489
|
} catch (error) {
|
|
2491
2490
|
console.log(error);
|
|
2492
2491
|
return initialValue;
|
|
@@ -7095,7 +7094,7 @@ var StyledLink = import_styled_components20.default.a`
|
|
|
7095
7094
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
7096
7095
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
7097
7096
|
font-family: var(--wui-typography-family-default);
|
|
7098
|
-
color: var(--wui-color-text-link);
|
|
7097
|
+
color: ${({ $disabled }) => $disabled ? "var(--wui-color-text-disabled)" : "var(--wui-color-text-link)"};
|
|
7099
7098
|
text-decoration: ${({ $underline }) => $underline ? "underline" : "none"};
|
|
7100
7099
|
display: inline-flex;
|
|
7101
7100
|
align-items: baseline;
|
|
@@ -7220,7 +7219,7 @@ var StyledButtonContent = import_styled_components21.default.div`
|
|
|
7220
7219
|
${({ $hasRightIcon }) => $hasRightIcon && "padding-right: 0;"}
|
|
7221
7220
|
`;
|
|
7222
7221
|
var StyledButtonContentLabel = import_styled_components21.default.span`
|
|
7223
|
-
flex: 1;
|
|
7222
|
+
flex: ${({ $fullWidth }) => $fullWidth ? "initial" : "1"};
|
|
7224
7223
|
`;
|
|
7225
7224
|
var StyledButtonLoading = import_styled_components21.default.div`
|
|
7226
7225
|
position: absolute;
|
|
@@ -7230,7 +7229,8 @@ var ButtonContent = ({
|
|
|
7230
7229
|
isLoading = false,
|
|
7231
7230
|
leftIcon,
|
|
7232
7231
|
rightIcon,
|
|
7233
|
-
children
|
|
7232
|
+
children,
|
|
7233
|
+
fullWidth = false
|
|
7234
7234
|
}) => {
|
|
7235
7235
|
return /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(import_jsx_runtime193.Fragment, { children: [
|
|
7236
7236
|
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(StyledButtonLoading, { children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(Icon, { type: "spinner" }) }) : null,
|
|
@@ -7242,7 +7242,7 @@ var ButtonContent = ({
|
|
|
7242
7242
|
$isLoading: isLoading,
|
|
7243
7243
|
children: [
|
|
7244
7244
|
leftIcon ?? null,
|
|
7245
|
-
/* @__PURE__ */ (0, import_jsx_runtime193.jsx)(StyledButtonContentLabel, { children }),
|
|
7245
|
+
/* @__PURE__ */ (0, import_jsx_runtime193.jsx)(StyledButtonContentLabel, { $fullWidth: fullWidth, children }),
|
|
7246
7246
|
rightIcon ?? null
|
|
7247
7247
|
]
|
|
7248
7248
|
}
|
|
@@ -7292,6 +7292,7 @@ var Button = (0, import_react22.forwardRef)(
|
|
|
7292
7292
|
children: unstyled ? children : /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
7293
7293
|
ButtonContent,
|
|
7294
7294
|
{
|
|
7295
|
+
fullWidth: responsiveFullWidth,
|
|
7295
7296
|
isLoading,
|
|
7296
7297
|
leftIcon,
|
|
7297
7298
|
rightIcon,
|
|
@@ -7321,6 +7322,7 @@ var Button = (0, import_react22.forwardRef)(
|
|
|
7321
7322
|
children: unstyled ? children : /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
7322
7323
|
ButtonContent,
|
|
7323
7324
|
{
|
|
7325
|
+
fullWidth: responsiveFullWidth,
|
|
7324
7326
|
isLoading,
|
|
7325
7327
|
leftIcon,
|
|
7326
7328
|
rightIcon,
|
|
@@ -9130,6 +9132,54 @@ var import_react35 = require("react");
|
|
|
9130
9132
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
9131
9133
|
var import_styled_components45 = __toESM(require("styled-components"));
|
|
9132
9134
|
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
9135
|
+
var hide = import_styled_components45.keyframes`
|
|
9136
|
+
from {
|
|
9137
|
+
opacity: 1;
|
|
9138
|
+
}
|
|
9139
|
+
to {
|
|
9140
|
+
opacity: 0;
|
|
9141
|
+
}
|
|
9142
|
+
`;
|
|
9143
|
+
var slideDownAndFade = import_styled_components45.keyframes`
|
|
9144
|
+
from {
|
|
9145
|
+
opacity: 0;
|
|
9146
|
+
transform: translateY(-6px);
|
|
9147
|
+
}
|
|
9148
|
+
to {
|
|
9149
|
+
opacity: 1;
|
|
9150
|
+
transform: translateY(0);
|
|
9151
|
+
}
|
|
9152
|
+
`;
|
|
9153
|
+
var slideLeftAndFade = import_styled_components45.keyframes`
|
|
9154
|
+
from {
|
|
9155
|
+
opacity: 0;
|
|
9156
|
+
transform: translateX(6px);
|
|
9157
|
+
}
|
|
9158
|
+
to {
|
|
9159
|
+
opacity: 1;
|
|
9160
|
+
transform: translateX(0);
|
|
9161
|
+
}
|
|
9162
|
+
`;
|
|
9163
|
+
var slideUpAndFade = import_styled_components45.keyframes`
|
|
9164
|
+
from {
|
|
9165
|
+
opacity: 0;
|
|
9166
|
+
transform: translateY(6px);
|
|
9167
|
+
}
|
|
9168
|
+
to {
|
|
9169
|
+
opacity: 1;
|
|
9170
|
+
transform: translateY(0);
|
|
9171
|
+
}
|
|
9172
|
+
`;
|
|
9173
|
+
var slideRightAndFade = import_styled_components45.keyframes`
|
|
9174
|
+
from {
|
|
9175
|
+
opacity: 0;
|
|
9176
|
+
transform: translateX(-6px);
|
|
9177
|
+
}
|
|
9178
|
+
to {
|
|
9179
|
+
opacity: 1;
|
|
9180
|
+
transform: translateX(0);
|
|
9181
|
+
}
|
|
9182
|
+
`;
|
|
9133
9183
|
var StyledContent = (0, import_styled_components45.default)(import_react_tooltip2.Content)`
|
|
9134
9184
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
9135
9185
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
@@ -9140,6 +9190,8 @@ var StyledContent = (0, import_styled_components45.default)(import_react_tooltip
|
|
|
9140
9190
|
--tooltip-font-weight: var(--wui-typography-label-4-weight);
|
|
9141
9191
|
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
9142
9192
|
--tooltip-vertical-padding: var(--wui-space-03);
|
|
9193
|
+
--tooltip-animation-duration: var(--wui-motion-duration-04);
|
|
9194
|
+
--tooltip-animation-timing-function: var(--wui-motion-ease-out);
|
|
9143
9195
|
|
|
9144
9196
|
font-family: var(--tooltip-font-family);
|
|
9145
9197
|
font-size: var(--tooltip-font-size);
|
|
@@ -9148,26 +9200,30 @@ var StyledContent = (0, import_styled_components45.default)(import_react_tooltip
|
|
|
9148
9200
|
background-color: var(--tooltip-bg);
|
|
9149
9201
|
color: var(--tooltip-color);
|
|
9150
9202
|
user-select: none;
|
|
9151
|
-
animation-duration:
|
|
9152
|
-
animation-timing-function:
|
|
9203
|
+
animation-duration: var(--tooltip-animation-duration);
|
|
9204
|
+
animation-timing-function: var(--tooltip-animation-timing-function);
|
|
9153
9205
|
will-change: transform, opacity;
|
|
9154
9206
|
max-width: 30em;
|
|
9155
9207
|
z-index: var(--wui-zindex-tooltip);
|
|
9156
9208
|
|
|
9209
|
+
&[data-state='closed'] {
|
|
9210
|
+
animation-name: ${hide};
|
|
9211
|
+
}
|
|
9212
|
+
|
|
9157
9213
|
&[data-state='delayed-open'][data-side='top'] {
|
|
9158
|
-
animation-name:
|
|
9214
|
+
animation-name: ${slideUpAndFade};
|
|
9159
9215
|
}
|
|
9160
9216
|
|
|
9161
9217
|
&[data-state='delayed-open'][data-side='right'] {
|
|
9162
|
-
animation-name:
|
|
9218
|
+
animation-name: ${slideRightAndFade};
|
|
9163
9219
|
}
|
|
9164
9220
|
|
|
9165
9221
|
&[data-state='delayed-open'][data-side='bottom'] {
|
|
9166
|
-
animation-name:
|
|
9222
|
+
animation-name: ${slideDownAndFade};
|
|
9167
9223
|
}
|
|
9168
9224
|
|
|
9169
9225
|
&[data-state='delayed-open'][data-side='left'] {
|
|
9170
|
-
animation-name:
|
|
9226
|
+
animation-name: ${slideLeftAndFade};
|
|
9171
9227
|
}
|
|
9172
9228
|
`;
|
|
9173
9229
|
var VISUAL_OFFSET = 6;
|