@wistia/ui 0.6.4-beta.a8418872.2e6b4be → 0.6.6-beta.8a5013fa.ed1975e
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 +116 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +27 -20
- package/dist/index.d.ts +27 -20
- package/dist/index.mjs +113 -77
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.6.
|
|
3
|
+
* @license @wistia/ui v0.6.6-beta.8a5013fa.ed1975e
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -61,6 +61,9 @@ __export(index_exports, {
|
|
|
61
61
|
Divider: () => Divider,
|
|
62
62
|
EditableHeading: () => EditableHeading,
|
|
63
63
|
Ellipsis: () => Ellipsis,
|
|
64
|
+
FileAmountLimitValidator: () => import_validators.FileAmountLimitValidator,
|
|
65
|
+
FileSizeValidator: () => import_validators.FileSizeValidator,
|
|
66
|
+
FileTypeValidator: () => import_validators.FileTypeValidator,
|
|
64
67
|
Form: () => Form,
|
|
65
68
|
FormErrorSummary: () => FormErrorSummary,
|
|
66
69
|
FormField: () => FormField,
|
|
@@ -69,6 +72,7 @@ __export(index_exports, {
|
|
|
69
72
|
Icon: () => Icon,
|
|
70
73
|
IconButton: () => IconButton,
|
|
71
74
|
Image: () => Image,
|
|
75
|
+
ImageDimensionsValidator: () => import_validators.ImageDimensionsValidator,
|
|
72
76
|
Input: () => Input,
|
|
73
77
|
Label: () => Label,
|
|
74
78
|
Link: () => Link,
|
|
@@ -79,6 +83,7 @@ __export(index_exports, {
|
|
|
79
83
|
MenuLabel: () => MenuLabel,
|
|
80
84
|
MenuRadioGroup: () => MenuRadioGroup,
|
|
81
85
|
Modal: () => Modal,
|
|
86
|
+
PersistentFileAmountLimitValidator: () => import_validators.PersistentFileAmountLimitValidator,
|
|
82
87
|
Popover: () => Popover,
|
|
83
88
|
Radio: () => Radio,
|
|
84
89
|
RadioGroup: () => RadioGroup,
|
|
@@ -108,7 +113,9 @@ __export(index_exports, {
|
|
|
108
113
|
useActiveMq: () => useActiveMq,
|
|
109
114
|
useAriaLive: () => useAriaLive,
|
|
110
115
|
useBoolean: () => useBoolean,
|
|
116
|
+
useFilePicker: () => import_use_file_picker.useFilePicker,
|
|
111
117
|
useFormState: () => useFormState,
|
|
118
|
+
useImperativeFilePicker: () => import_use_file_picker.useImperativeFilePicker,
|
|
112
119
|
useKey: () => useKey,
|
|
113
120
|
useMq: () => useMq,
|
|
114
121
|
useToast: () => useToast,
|
|
@@ -2005,82 +2012,30 @@ var mq = {
|
|
|
2005
2012
|
xlAndDown
|
|
2006
2013
|
};
|
|
2007
2014
|
|
|
2008
|
-
// src/hooks/
|
|
2015
|
+
// src/hooks/useAriaLive/useAriaLive.tsx
|
|
2009
2016
|
var import_react3 = require("react");
|
|
2010
|
-
var useBoolean = (initialValue = false) => {
|
|
2011
|
-
const [value, setValue] = (0, import_react3.useState)(initialValue);
|
|
2012
|
-
const toggle = (0, import_react3.useCallback)(() => setValue((val) => !val), []);
|
|
2013
|
-
const setTrue = (0, import_react3.useCallback)(() => setValue(true), []);
|
|
2014
|
-
const setFalse = (0, import_react3.useCallback)(() => setValue(false), []);
|
|
2015
|
-
return [value, toggle, setTrue, setFalse, setValue];
|
|
2016
|
-
};
|
|
2017
|
-
|
|
2018
|
-
// src/hooks/useMq/useMq.ts
|
|
2019
2017
|
var import_type_guards5 = require("@wistia/type-guards");
|
|
2018
|
+
var useAriaLive = () => {
|
|
2019
|
+
const context = (0, import_react3.useContext)(AriaLiveContext);
|
|
2020
|
+
if ((0, import_type_guards5.isNil)(context)) {
|
|
2021
|
+
throw new Error("useAriaLive must be used within an AriaLiveProvider");
|
|
2022
|
+
}
|
|
2023
|
+
return context;
|
|
2024
|
+
};
|
|
2020
2025
|
|
|
2021
|
-
// src/hooks/
|
|
2026
|
+
// src/hooks/useBoolean/useBoolean.ts
|
|
2022
2027
|
var import_react4 = require("react");
|
|
2023
|
-
var
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
var useWindowSize = (interval = 0) => {
|
|
2030
|
-
const [dimensions, setDimensions] = (0, import_react4.useState)({
|
|
2031
|
-
width: isClient() ? window.innerWidth : 0,
|
|
2032
|
-
height: isClient() ? window.innerHeight : 0
|
|
2033
|
-
});
|
|
2034
|
-
(0, import_react4.useLayoutEffect)(() => {
|
|
2035
|
-
const handleResize = (0, import_throttle_debounce.debounce)(
|
|
2036
|
-
interval,
|
|
2037
|
-
() => setDimensions({
|
|
2038
|
-
width: window.innerWidth,
|
|
2039
|
-
height: window.innerHeight
|
|
2040
|
-
})
|
|
2041
|
-
);
|
|
2042
|
-
window.addEventListener("resize", handleResize);
|
|
2043
|
-
return () => window.removeEventListener("resize", handleResize);
|
|
2044
|
-
}, [interval]);
|
|
2045
|
-
return dimensions;
|
|
2028
|
+
var useBoolean = (initialValue = false) => {
|
|
2029
|
+
const [value, setValue] = (0, import_react4.useState)(initialValue);
|
|
2030
|
+
const toggle = (0, import_react4.useCallback)(() => setValue((val) => !val), []);
|
|
2031
|
+
const setTrue = (0, import_react4.useCallback)(() => setValue(true), []);
|
|
2032
|
+
const setFalse = (0, import_react4.useCallback)(() => setValue(false), []);
|
|
2033
|
+
return [value, toggle, setTrue, setFalse, setValue];
|
|
2046
2034
|
};
|
|
2047
2035
|
|
|
2048
|
-
// src/hooks/
|
|
2049
|
-
var
|
|
2050
|
-
var
|
|
2051
|
-
const { width } = useWindowSize();
|
|
2052
|
-
const viewportWidth = width / REM_SIZE;
|
|
2053
|
-
const isXsAndUp = true;
|
|
2054
|
-
const isSmAndUp = viewportWidth >= Number.parseFloat(breakpoints.sm);
|
|
2055
|
-
const isMdAndUp = viewportWidth >= Number.parseFloat(breakpoints.md);
|
|
2056
|
-
const isLgAndUp = viewportWidth >= Number.parseFloat(breakpoints.lg);
|
|
2057
|
-
const isXlAndUp = viewportWidth >= Number.parseFloat(breakpoints.xl);
|
|
2058
|
-
const isXsAndDown = viewportWidth < Number.parseFloat(breakpoints.sm);
|
|
2059
|
-
const isSmAndDown = viewportWidth < Number.parseFloat(breakpoints.md);
|
|
2060
|
-
const isMdAndDown = viewportWidth < Number.parseFloat(breakpoints.lg);
|
|
2061
|
-
const isLgAndDown = viewportWidth < Number.parseFloat(breakpoints.xl);
|
|
2062
|
-
const isXlAndDown = true;
|
|
2063
|
-
return {
|
|
2064
|
-
isXlAndUp,
|
|
2065
|
-
isLgAndUp,
|
|
2066
|
-
isMdAndUp,
|
|
2067
|
-
isSmAndUp,
|
|
2068
|
-
isXsAndUp,
|
|
2069
|
-
isXsAndDown,
|
|
2070
|
-
isSmAndDown,
|
|
2071
|
-
isMdAndDown,
|
|
2072
|
-
isLgAndDown,
|
|
2073
|
-
isXlAndDown
|
|
2074
|
-
};
|
|
2075
|
-
};
|
|
2076
|
-
var useActiveMq = () => {
|
|
2077
|
-
const mq2 = useMq();
|
|
2078
|
-
const keys = Object.keys(mq2);
|
|
2079
|
-
return keys.filter((key) => {
|
|
2080
|
-
const value = mq2[key];
|
|
2081
|
-
return (0, import_type_guards5.isBoolean)(value) && value;
|
|
2082
|
-
});
|
|
2083
|
-
};
|
|
2036
|
+
// src/hooks/useFilePicker/index.ts
|
|
2037
|
+
var import_use_file_picker = require("use-file-picker");
|
|
2038
|
+
var import_validators = require("use-file-picker/validators");
|
|
2084
2039
|
|
|
2085
2040
|
// src/hooks/useKey/useKey.ts
|
|
2086
2041
|
var import_react6 = require("react");
|
|
@@ -2154,15 +2109,71 @@ var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOpti
|
|
|
2154
2109
|
useEvent(eventName, memoizedEventHandler, eventTarget, eventOptions);
|
|
2155
2110
|
};
|
|
2156
2111
|
|
|
2157
|
-
// src/hooks/
|
|
2158
|
-
var import_react7 = require("react");
|
|
2112
|
+
// src/hooks/useMq/useMq.ts
|
|
2159
2113
|
var import_type_guards7 = require("@wistia/type-guards");
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2114
|
+
|
|
2115
|
+
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2116
|
+
var import_react7 = require("react");
|
|
2117
|
+
var import_throttle_debounce = require("throttle-debounce");
|
|
2118
|
+
|
|
2119
|
+
// src/private/helpers/isClient/isClient.ts
|
|
2120
|
+
var isClient = () => typeof window !== "undefined" && typeof document !== "undefined";
|
|
2121
|
+
|
|
2122
|
+
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2123
|
+
var useWindowSize = (interval = 0) => {
|
|
2124
|
+
const [dimensions, setDimensions] = (0, import_react7.useState)({
|
|
2125
|
+
width: isClient() ? window.innerWidth : 0,
|
|
2126
|
+
height: isClient() ? window.innerHeight : 0
|
|
2127
|
+
});
|
|
2128
|
+
(0, import_react7.useLayoutEffect)(() => {
|
|
2129
|
+
const handleResize = (0, import_throttle_debounce.debounce)(
|
|
2130
|
+
interval,
|
|
2131
|
+
() => setDimensions({
|
|
2132
|
+
width: window.innerWidth,
|
|
2133
|
+
height: window.innerHeight
|
|
2134
|
+
})
|
|
2135
|
+
);
|
|
2136
|
+
window.addEventListener("resize", handleResize);
|
|
2137
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
2138
|
+
}, [interval]);
|
|
2139
|
+
return dimensions;
|
|
2140
|
+
};
|
|
2141
|
+
|
|
2142
|
+
// src/hooks/useMq/useMq.ts
|
|
2143
|
+
var REM_SIZE = 16;
|
|
2144
|
+
var useMq = () => {
|
|
2145
|
+
const { width } = useWindowSize();
|
|
2146
|
+
const viewportWidth = width / REM_SIZE;
|
|
2147
|
+
const isXsAndUp = true;
|
|
2148
|
+
const isSmAndUp = viewportWidth >= Number.parseFloat(breakpoints.sm);
|
|
2149
|
+
const isMdAndUp = viewportWidth >= Number.parseFloat(breakpoints.md);
|
|
2150
|
+
const isLgAndUp = viewportWidth >= Number.parseFloat(breakpoints.lg);
|
|
2151
|
+
const isXlAndUp = viewportWidth >= Number.parseFloat(breakpoints.xl);
|
|
2152
|
+
const isXsAndDown = viewportWidth < Number.parseFloat(breakpoints.sm);
|
|
2153
|
+
const isSmAndDown = viewportWidth < Number.parseFloat(breakpoints.md);
|
|
2154
|
+
const isMdAndDown = viewportWidth < Number.parseFloat(breakpoints.lg);
|
|
2155
|
+
const isLgAndDown = viewportWidth < Number.parseFloat(breakpoints.xl);
|
|
2156
|
+
const isXlAndDown = true;
|
|
2157
|
+
return {
|
|
2158
|
+
isXlAndUp,
|
|
2159
|
+
isLgAndUp,
|
|
2160
|
+
isMdAndUp,
|
|
2161
|
+
isSmAndUp,
|
|
2162
|
+
isXsAndUp,
|
|
2163
|
+
isXsAndDown,
|
|
2164
|
+
isSmAndDown,
|
|
2165
|
+
isMdAndDown,
|
|
2166
|
+
isLgAndDown,
|
|
2167
|
+
isXlAndDown
|
|
2168
|
+
};
|
|
2169
|
+
};
|
|
2170
|
+
var useActiveMq = () => {
|
|
2171
|
+
const mq2 = useMq();
|
|
2172
|
+
const keys = Object.keys(mq2);
|
|
2173
|
+
return keys.filter((key) => {
|
|
2174
|
+
const value = mq2[key];
|
|
2175
|
+
return (0, import_type_guards7.isBoolean)(value) && value;
|
|
2176
|
+
});
|
|
2166
2177
|
};
|
|
2167
2178
|
|
|
2168
2179
|
// src/hooks/useToast/useToast.tsx
|
|
@@ -10344,6 +10355,21 @@ var WistiaLogoComponent = import_styled_components70.default.svg`
|
|
|
10344
10355
|
${({ $hoverColor }) => $hoverColor !== void 0 ? `fill: ${$hoverColor}` : null};
|
|
10345
10356
|
}
|
|
10346
10357
|
}
|
|
10358
|
+
|
|
10359
|
+
${({ $opticallyCentered, $iconOnly }) => {
|
|
10360
|
+
if ($opticallyCentered) {
|
|
10361
|
+
if ($iconOnly) {
|
|
10362
|
+
return import_styled_components70.css`
|
|
10363
|
+
aspect-ratio: 1;
|
|
10364
|
+
padding: 11.85% 3.12% 13.91%;
|
|
10365
|
+
`;
|
|
10366
|
+
}
|
|
10367
|
+
return import_styled_components70.css`
|
|
10368
|
+
aspect-ratio: 127 / 32;
|
|
10369
|
+
`;
|
|
10370
|
+
}
|
|
10371
|
+
return null;
|
|
10372
|
+
}}
|
|
10347
10373
|
`;
|
|
10348
10374
|
var WistiaLogo = ({
|
|
10349
10375
|
description = void 0,
|
|
@@ -10351,6 +10377,7 @@ var WistiaLogo = ({
|
|
|
10351
10377
|
hoverColor = void 0,
|
|
10352
10378
|
href = void 0,
|
|
10353
10379
|
iconOnly = false,
|
|
10380
|
+
opticallyCentered = false,
|
|
10354
10381
|
title = "Wistia Logo",
|
|
10355
10382
|
variant = "standard",
|
|
10356
10383
|
...otherProps
|
|
@@ -10378,7 +10405,10 @@ var WistiaLogo = ({
|
|
|
10378
10405
|
WistiaLogoComponent,
|
|
10379
10406
|
{
|
|
10380
10407
|
$hoverColor: hoverColor,
|
|
10408
|
+
$iconOnly: iconOnly,
|
|
10409
|
+
$opticallyCentered: opticallyCentered,
|
|
10381
10410
|
height,
|
|
10411
|
+
preserveAspectRatio: opticallyCentered ? "xMidYMin" : void 0,
|
|
10382
10412
|
role: "img",
|
|
10383
10413
|
viewBox: computedViewBox(iconOnly),
|
|
10384
10414
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10652,6 +10682,9 @@ Image.displayName = "Image";
|
|
|
10652
10682
|
Divider,
|
|
10653
10683
|
EditableHeading,
|
|
10654
10684
|
Ellipsis,
|
|
10685
|
+
FileAmountLimitValidator,
|
|
10686
|
+
FileSizeValidator,
|
|
10687
|
+
FileTypeValidator,
|
|
10655
10688
|
Form,
|
|
10656
10689
|
FormErrorSummary,
|
|
10657
10690
|
FormField,
|
|
@@ -10660,6 +10693,7 @@ Image.displayName = "Image";
|
|
|
10660
10693
|
Icon,
|
|
10661
10694
|
IconButton,
|
|
10662
10695
|
Image,
|
|
10696
|
+
ImageDimensionsValidator,
|
|
10663
10697
|
Input,
|
|
10664
10698
|
Label,
|
|
10665
10699
|
Link,
|
|
@@ -10670,6 +10704,7 @@ Image.displayName = "Image";
|
|
|
10670
10704
|
MenuLabel,
|
|
10671
10705
|
MenuRadioGroup,
|
|
10672
10706
|
Modal,
|
|
10707
|
+
PersistentFileAmountLimitValidator,
|
|
10673
10708
|
Popover,
|
|
10674
10709
|
Radio,
|
|
10675
10710
|
RadioGroup,
|
|
@@ -10699,7 +10734,9 @@ Image.displayName = "Image";
|
|
|
10699
10734
|
useActiveMq,
|
|
10700
10735
|
useAriaLive,
|
|
10701
10736
|
useBoolean,
|
|
10737
|
+
useFilePicker,
|
|
10702
10738
|
useFormState,
|
|
10739
|
+
useImperativeFilePicker,
|
|
10703
10740
|
useKey,
|
|
10704
10741
|
useMq,
|
|
10705
10742
|
useToast,
|