@wistia/ui 0.14.18 → 0.14.19-beta.cea11903.1bed8cb
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 +31 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +22 -36
- package/dist/index.d.ts +22 -36
- package/dist/index.mjs +45 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.14.
|
|
3
|
+
* @license @wistia/ui v0.14.19-beta.cea11903.1bed8cb
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -1629,7 +1629,7 @@ var AriaLiveProvider = ({ children, debug = false }) => {
|
|
|
1629
1629
|
[]
|
|
1630
1630
|
);
|
|
1631
1631
|
const value = (0, import_react2.useMemo)(() => ({ announce }), [announce]);
|
|
1632
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AriaLiveContext
|
|
1632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AriaLiveContext, { value, children });
|
|
1633
1633
|
};
|
|
1634
1634
|
|
|
1635
1635
|
// src/providers/UIProvider/ToastProvider.tsx
|
|
@@ -1651,11 +1651,11 @@ var ToastProvider = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_so
|
|
|
1651
1651
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1652
1652
|
var UIProviderNestingContext = (0, import_react3.createContext)(false);
|
|
1653
1653
|
var UIProvider = ({ children }) => {
|
|
1654
|
-
const isNested = (0, import_react3.
|
|
1654
|
+
const isNested = (0, import_react3.use)(UIProviderNestingContext);
|
|
1655
1655
|
if (isNested) {
|
|
1656
1656
|
console.warn("UIProvider is nested. Only one instance of UIProvider.");
|
|
1657
1657
|
}
|
|
1658
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(UIProviderNestingContext
|
|
1658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(UIProviderNestingContext, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AriaLiveProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_tooltip.Provider, { children: [
|
|
1659
1659
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GlobalStyle, {}),
|
|
1660
1660
|
children,
|
|
1661
1661
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToastProvider, {})
|
|
@@ -2129,7 +2129,7 @@ var mq = {
|
|
|
2129
2129
|
var import_react4 = require("react");
|
|
2130
2130
|
var import_type_guards6 = require("@wistia/type-guards");
|
|
2131
2131
|
var useAriaLive = () => {
|
|
2132
|
-
const context = (0, import_react4.
|
|
2132
|
+
const context = (0, import_react4.use)(AriaLiveContext);
|
|
2133
2133
|
if ((0, import_type_guards6.isNil)(context)) {
|
|
2134
2134
|
throw new Error("useAriaLive must be used within an AriaLiveProvider");
|
|
2135
2135
|
}
|
|
@@ -2153,7 +2153,7 @@ var import_react7 = require("react");
|
|
|
2153
2153
|
var import_react6 = require("react");
|
|
2154
2154
|
var useTimedToggle = (initialValue) => {
|
|
2155
2155
|
const [value, setValue] = (0, import_react6.useState)(false);
|
|
2156
|
-
const timeoutRef = (0, import_react6.useRef)();
|
|
2156
|
+
const timeoutRef = (0, import_react6.useRef)(void 0);
|
|
2157
2157
|
const initialValueRef = (0, import_react6.useRef)(initialValue);
|
|
2158
2158
|
const toggleValue = (timeout) => {
|
|
2159
2159
|
clearTimeout(timeoutRef.current);
|
|
@@ -2519,8 +2519,8 @@ var isEventTargetSupported = (eventTarget) => (
|
|
|
2519
2519
|
Boolean(typeof eventTarget === "object" && eventTarget?.addEventListener)
|
|
2520
2520
|
);
|
|
2521
2521
|
var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}) => {
|
|
2522
|
-
const savedEventHandler = (0, import_react12.useRef)();
|
|
2523
|
-
const savedEventOptions = (0, import_react12.useRef)();
|
|
2522
|
+
const savedEventHandler = (0, import_react12.useRef)(void 0);
|
|
2523
|
+
const savedEventOptions = (0, import_react12.useRef)(void 0);
|
|
2524
2524
|
(0, import_react12.useEffect)(() => {
|
|
2525
2525
|
savedEventHandler.current = eventHandler;
|
|
2526
2526
|
}, [eventHandler]);
|
|
@@ -2713,7 +2713,7 @@ var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) =
|
|
|
2713
2713
|
// src/hooks/usePreviousValue/usePreviousValue.ts
|
|
2714
2714
|
var import_react18 = require("react");
|
|
2715
2715
|
var usePreviousValue = (value) => {
|
|
2716
|
-
const ref = (0, import_react18.useRef)();
|
|
2716
|
+
const ref = (0, import_react18.useRef)(void 0);
|
|
2717
2717
|
(0, import_react18.useEffect)(() => {
|
|
2718
2718
|
ref.current = value;
|
|
2719
2719
|
});
|
|
@@ -9322,7 +9322,7 @@ var Form = (0, import_react36.forwardRef)(
|
|
|
9322
9322
|
}, [labelPosition, values, errors, id, hasSubmitted]);
|
|
9323
9323
|
return (
|
|
9324
9324
|
// @ts-expect-error - generic context providers are a giant pain
|
|
9325
|
-
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(FormContext
|
|
9325
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(FormContext, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
9326
9326
|
Stack,
|
|
9327
9327
|
{
|
|
9328
9328
|
...props,
|
|
@@ -9346,7 +9346,7 @@ var Form = (0, import_react36.forwardRef)(
|
|
|
9346
9346
|
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
9347
9347
|
var CheckboxGroupContext = (0, import_react37.createContext)(null);
|
|
9348
9348
|
var useCheckboxGroup = () => {
|
|
9349
|
-
return (0, import_react37.
|
|
9349
|
+
return (0, import_react37.use)(CheckboxGroupContext);
|
|
9350
9350
|
};
|
|
9351
9351
|
var CheckboxGroup = ({
|
|
9352
9352
|
children,
|
|
@@ -9355,7 +9355,7 @@ var CheckboxGroup = ({
|
|
|
9355
9355
|
value,
|
|
9356
9356
|
...props
|
|
9357
9357
|
}) => {
|
|
9358
|
-
const formState = (0, import_react37.
|
|
9358
|
+
const formState = (0, import_react37.use)(FormContext);
|
|
9359
9359
|
const derivedValue = (0, import_type_guards30.isArray)(formState.values[name]) ? formState.values[name] : value;
|
|
9360
9360
|
const context = (0, import_react37.useMemo)(() => {
|
|
9361
9361
|
return {
|
|
@@ -9364,7 +9364,7 @@ var CheckboxGroup = ({
|
|
|
9364
9364
|
value: derivedValue
|
|
9365
9365
|
};
|
|
9366
9366
|
}, [name, derivedValue, onChange]);
|
|
9367
|
-
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(CheckboxGroupContext
|
|
9367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(CheckboxGroupContext, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(FormGroup, { ...props, children }) });
|
|
9368
9368
|
};
|
|
9369
9369
|
CheckboxGroup.displayName = "CheckboxGroup_UI";
|
|
9370
9370
|
|
|
@@ -10224,7 +10224,7 @@ var ColorPickerProvider = ({
|
|
|
10224
10224
|
valueAsHsv
|
|
10225
10225
|
]
|
|
10226
10226
|
);
|
|
10227
|
-
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(ColorPickerContext
|
|
10227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(ColorPickerContext, { value: contextValue, children });
|
|
10228
10228
|
};
|
|
10229
10229
|
var useColorPickerState = () => {
|
|
10230
10230
|
const context = (0, import_react41.useContext)(ColorPickerContext);
|
|
@@ -11300,7 +11300,7 @@ var Input = (0, import_react47.forwardRef)(
|
|
|
11300
11300
|
rightIcon,
|
|
11301
11301
|
...props
|
|
11302
11302
|
}, externalRef) => {
|
|
11303
|
-
const internalRef = (0, import_react47.useRef)();
|
|
11303
|
+
const internalRef = (0, import_react47.useRef)(null);
|
|
11304
11304
|
const ref = (0, import_type_guards35.isNotNil)(externalRef) && (0, import_type_guards35.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
11305
11305
|
let leftIconToDisplay = leftIcon;
|
|
11306
11306
|
if ((0, import_type_guards35.isNil)(leftIcon) && type === "search") {
|
|
@@ -11323,7 +11323,7 @@ var Input = (0, import_react47.forwardRef)(
|
|
|
11323
11323
|
if ((0, import_type_guards35.isNotNil)(props.onFocus)) {
|
|
11324
11324
|
props.onFocus(event);
|
|
11325
11325
|
}
|
|
11326
|
-
if (autoSelect &&
|
|
11326
|
+
if (autoSelect && type !== "multiline" && ref.current instanceof HTMLInputElement) {
|
|
11327
11327
|
requestAnimationFrame(() => {
|
|
11328
11328
|
ref.current?.select();
|
|
11329
11329
|
});
|
|
@@ -12951,7 +12951,7 @@ var ErrorItem = ({ name, error, formId }) => {
|
|
|
12951
12951
|
};
|
|
12952
12952
|
var FormErrorSummary = ({ description }) => {
|
|
12953
12953
|
const ref = (0, import_react58.useRef)(null);
|
|
12954
|
-
const { formId, errors, hasSubmitted } = (0, import_react58.
|
|
12954
|
+
const { formId, errors, hasSubmitted } = (0, import_react58.use)(FormContext);
|
|
12955
12955
|
const isValid = Object.keys(errors).length === 0;
|
|
12956
12956
|
if (isValid || !hasSubmitted) {
|
|
12957
12957
|
return null;
|
|
@@ -13076,8 +13076,8 @@ var FormField = ({
|
|
|
13076
13076
|
value,
|
|
13077
13077
|
...props
|
|
13078
13078
|
}) => {
|
|
13079
|
-
const formState = (0, import_react59.
|
|
13080
|
-
const checkboxGroup = (0, import_react59.
|
|
13079
|
+
const formState = (0, import_react59.use)(FormContext);
|
|
13080
|
+
const checkboxGroup = (0, import_react59.use)(CheckboxGroupContext);
|
|
13081
13081
|
const defaultValue = formState.values[name];
|
|
13082
13082
|
const isIntegratedLabel = children.type === Checkbox;
|
|
13083
13083
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -13146,7 +13146,7 @@ var import_react60 = require("react");
|
|
|
13146
13146
|
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
13147
13147
|
var RadioGroupContext = (0, import_react60.createContext)(null);
|
|
13148
13148
|
var useRadioGroup = () => {
|
|
13149
|
-
return (0, import_react60.
|
|
13149
|
+
return (0, import_react60.use)(RadioGroupContext);
|
|
13150
13150
|
};
|
|
13151
13151
|
var RadioGroup = ({
|
|
13152
13152
|
children,
|
|
@@ -13155,7 +13155,7 @@ var RadioGroup = ({
|
|
|
13155
13155
|
value,
|
|
13156
13156
|
...props
|
|
13157
13157
|
}) => {
|
|
13158
|
-
const formState = (0, import_react60.
|
|
13158
|
+
const formState = (0, import_react60.use)(FormContext);
|
|
13159
13159
|
const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
|
|
13160
13160
|
const context = (0, import_react60.useMemo)(() => {
|
|
13161
13161
|
return {
|
|
@@ -13164,7 +13164,7 @@ var RadioGroup = ({
|
|
|
13164
13164
|
value: derivedValue
|
|
13165
13165
|
};
|
|
13166
13166
|
}, [name, derivedValue, onChange]);
|
|
13167
|
-
return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(RadioGroupContext
|
|
13167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(RadioGroupContext, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(FormGroup, { ...props, children }) });
|
|
13168
13168
|
};
|
|
13169
13169
|
RadioGroup.displayName = "RadioGroup_UI";
|
|
13170
13170
|
|
|
@@ -13589,7 +13589,7 @@ var import_type_guards45 = require("@wistia/type-guards");
|
|
|
13589
13589
|
// src/components/Menu/MenuContext.tsx
|
|
13590
13590
|
var import_react63 = require("react");
|
|
13591
13591
|
var MenuContext = (0, import_react63.createContext)({ compact: false });
|
|
13592
|
-
var useMenuContext = () => (0, import_react63.
|
|
13592
|
+
var useMenuContext = () => (0, import_react63.use)(MenuContext);
|
|
13593
13593
|
|
|
13594
13594
|
// src/components/Menu/Menu.tsx
|
|
13595
13595
|
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
@@ -13704,7 +13704,7 @@ var Menu = (0, import_react64.forwardRef)(
|
|
|
13704
13704
|
onOpenChange: () => null
|
|
13705
13705
|
};
|
|
13706
13706
|
}
|
|
13707
|
-
return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)(MenuContext
|
|
13707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)(MenuContext, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(
|
|
13708
13708
|
import_react_dropdown_menu.DropdownMenu,
|
|
13709
13709
|
{
|
|
13710
13710
|
modal: false,
|
|
@@ -15328,7 +15328,7 @@ var SelectedItemStyleProvider = ({
|
|
|
15328
15328
|
}),
|
|
15329
15329
|
[selectedItemIndicatorStyle]
|
|
15330
15330
|
);
|
|
15331
|
-
return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(SelectedItemStyleContext
|
|
15331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(SelectedItemStyleContext, { value: contextValue, children });
|
|
15332
15332
|
};
|
|
15333
15333
|
var useSelectedItemStyle = () => {
|
|
15334
15334
|
const context = (0, import_react76.useContext)(SelectedItemStyleContext);
|
|
@@ -15347,7 +15347,7 @@ var import_react77 = require("react");
|
|
|
15347
15347
|
var SegmentedControlValueContext = (0, import_react77.createContext)(null);
|
|
15348
15348
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
15349
15349
|
var useSegmentedControlValue = () => {
|
|
15350
|
-
const context = (0, import_react77.
|
|
15350
|
+
const context = (0, import_react77.use)(SegmentedControlValueContext);
|
|
15351
15351
|
if (context === null) {
|
|
15352
15352
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
15353
15353
|
}
|
|
@@ -15946,7 +15946,7 @@ var TableSectionContext = (0, import_react82.createContext)(null);
|
|
|
15946
15946
|
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
15947
15947
|
var StyledTableBody = import_styled_components106.default.tbody``;
|
|
15948
15948
|
var TableBody = ({ children, ...props }) => {
|
|
15949
|
-
return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(TableSectionContext
|
|
15949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(TableSectionContext, { value: "body", children: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(StyledTableBody, { ...props, children }) });
|
|
15950
15950
|
};
|
|
15951
15951
|
|
|
15952
15952
|
// src/components/Table/TableCell.tsx
|
|
@@ -15971,7 +15971,7 @@ var StyledTd = import_styled_components107.default.td`
|
|
|
15971
15971
|
line-height: var(--wui-typography-body-2-line-height);
|
|
15972
15972
|
`;
|
|
15973
15973
|
var TableCell = ({ children, ...props }) => {
|
|
15974
|
-
const section = (0, import_react83.
|
|
15974
|
+
const section = (0, import_react83.use)(TableSectionContext);
|
|
15975
15975
|
if (section === "head") {
|
|
15976
15976
|
return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(StyledTh, { ...props, children });
|
|
15977
15977
|
}
|
|
@@ -15983,7 +15983,7 @@ var import_styled_components108 = __toESM(require("styled-components"));
|
|
|
15983
15983
|
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
15984
15984
|
var StyledTableFoot = import_styled_components108.default.tfoot``;
|
|
15985
15985
|
var TableFoot = ({ children, ...props }) => {
|
|
15986
|
-
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(TableSectionContext
|
|
15986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(TableSectionContext, { value: "footer", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(StyledTableFoot, { ...props, children }) });
|
|
15987
15987
|
};
|
|
15988
15988
|
|
|
15989
15989
|
// src/components/Table/TableHead.tsx
|
|
@@ -15991,7 +15991,7 @@ var import_styled_components109 = __toESM(require("styled-components"));
|
|
|
15991
15991
|
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
15992
15992
|
var StyledThead = import_styled_components109.default.thead``;
|
|
15993
15993
|
var TableHead = ({ children, ...props }) => {
|
|
15994
|
-
return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(TableSectionContext
|
|
15994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(TableSectionContext, { value: "head", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(StyledThead, { ...props, children }) });
|
|
15995
15995
|
};
|
|
15996
15996
|
|
|
15997
15997
|
// src/components/Table/TableRow.tsx
|
|
@@ -16012,7 +16012,7 @@ var import_react84 = require("react");
|
|
|
16012
16012
|
var TabsValueContext = (0, import_react84.createContext)(null);
|
|
16013
16013
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
16014
16014
|
var useTabsValue = () => {
|
|
16015
|
-
const context = (0, import_react84.
|
|
16015
|
+
const context = (0, import_react84.use)(TabsValueContext);
|
|
16016
16016
|
if (context === null) {
|
|
16017
16017
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
16018
16018
|
}
|