@wistia/ui 0.26.7 → 0.26.8-beta.650350ed.cb482b8
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.ts +9 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -102
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.26.
|
|
3
|
+
* @license @wistia/ui v0.26.8-beta.650350ed.cb482b8
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -431,9 +431,8 @@ const AriaLiveProvider = ({ children, debug = false }) => {
|
|
|
431
431
|
setTimeout(() => setMessage(null), 1e3);
|
|
432
432
|
}
|
|
433
433
|
}, []);
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
value,
|
|
434
|
+
return /* @__PURE__ */ jsx(AriaLiveContext, {
|
|
435
|
+
value: useMemo(() => ({ announce }), [announce]),
|
|
437
436
|
children
|
|
438
437
|
});
|
|
439
438
|
};
|
|
@@ -451,7 +450,7 @@ const ToastProvider = () => /* @__PURE__ */ jsx(Toaster, { ...toastConfig });
|
|
|
451
450
|
const UIProviderNestingContext = createContext(false);
|
|
452
451
|
const UIProvider = ({ children }) => {
|
|
453
452
|
if (useContext(UIProviderNestingContext)) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
454
|
-
return /* @__PURE__ */ jsx(UIProviderNestingContext
|
|
453
|
+
return /* @__PURE__ */ jsx(UIProviderNestingContext, {
|
|
455
454
|
value: true,
|
|
456
455
|
children: /* @__PURE__ */ jsx(AriaLiveProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1.Provider, { children: [
|
|
457
456
|
/* @__PURE__ */ jsx(GlobalStyle, {}),
|
|
@@ -497,16 +496,10 @@ const millisecondsInDay = 1440 * 60 * milisecondsInSecond;
|
|
|
497
496
|
//#endregion
|
|
498
497
|
//#region src/helpers/dateTime/buildTimeDuration.ts
|
|
499
498
|
/**
|
|
500
|
-
* @typedef {Object} Duration
|
|
501
|
-
* @property {number} seconds - number of seconds
|
|
502
|
-
* @property {number} minutes - number of minutes
|
|
503
|
-
* @property {number} hours - number of hours
|
|
504
|
-
*/
|
|
505
|
-
/**
|
|
506
499
|
* Returns an object representing the duration in seconds, minutes and hours.
|
|
507
500
|
*
|
|
508
501
|
* @param {number} numberOfMilliseconds - number of milliseconds
|
|
509
|
-
* @returns {
|
|
502
|
+
* @returns {TimeDuration} -
|
|
510
503
|
*/
|
|
511
504
|
const buildTimeDuration = (numberOfMilliseconds) => {
|
|
512
505
|
const numberOfSeconds = Math.floor(numberOfMilliseconds / milisecondsInSecond);
|
|
@@ -7144,23 +7137,22 @@ const Form = ({ children, action, values = {}, labelPosition = "block", validate
|
|
|
7144
7137
|
if (props.onReset) props.onReset(event);
|
|
7145
7138
|
if (action) action(null);
|
|
7146
7139
|
};
|
|
7147
|
-
|
|
7148
|
-
|
|
7140
|
+
return /* @__PURE__ */ jsx(FormContext, {
|
|
7141
|
+
value: useMemo(() => {
|
|
7142
|
+
return {
|
|
7143
|
+
values,
|
|
7144
|
+
errors,
|
|
7145
|
+
hasSubmitted,
|
|
7146
|
+
formId: id,
|
|
7147
|
+
labelPosition
|
|
7148
|
+
};
|
|
7149
|
+
}, [
|
|
7150
|
+
labelPosition,
|
|
7149
7151
|
values,
|
|
7150
7152
|
errors,
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
};
|
|
7155
|
-
}, [
|
|
7156
|
-
labelPosition,
|
|
7157
|
-
values,
|
|
7158
|
-
errors,
|
|
7159
|
-
id,
|
|
7160
|
-
hasSubmitted
|
|
7161
|
-
]);
|
|
7162
|
-
return /* @__PURE__ */ jsx(FormContext.Provider, {
|
|
7163
|
-
value: context,
|
|
7153
|
+
id,
|
|
7154
|
+
hasSubmitted
|
|
7155
|
+
]),
|
|
7164
7156
|
children: /* @__PURE__ */ jsx(Stack, {
|
|
7165
7157
|
...props,
|
|
7166
7158
|
ref,
|
|
@@ -7191,19 +7183,18 @@ const useCheckboxGroup = () => {
|
|
|
7191
7183
|
const CheckboxGroup = ({ children, name, onChange, value, ...props }) => {
|
|
7192
7184
|
const formState = useContext(FormContext);
|
|
7193
7185
|
const derivedValue = isArray(formState.values[name]) ? formState.values[name] : value;
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
value: context,
|
|
7186
|
+
return /* @__PURE__ */ jsx(CheckboxGroupContext, {
|
|
7187
|
+
value: useMemo(() => {
|
|
7188
|
+
return {
|
|
7189
|
+
name: `${name}[]`,
|
|
7190
|
+
onChange,
|
|
7191
|
+
value: derivedValue
|
|
7192
|
+
};
|
|
7193
|
+
}, [
|
|
7194
|
+
name,
|
|
7195
|
+
derivedValue,
|
|
7196
|
+
onChange
|
|
7197
|
+
]),
|
|
7207
7198
|
children: /* @__PURE__ */ jsx(FormGroup, {
|
|
7208
7199
|
...props,
|
|
7209
7200
|
children
|
|
@@ -7848,41 +7839,40 @@ const ColorPickerProvider = ({ children, colorForComparison, minimumContrastRati
|
|
|
7848
7839
|
valueAsHsvConvertedToHex,
|
|
7849
7840
|
whatValueAsHexShouldBe
|
|
7850
7841
|
]);
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
value: contextValue,
|
|
7842
|
+
return /* @__PURE__ */ jsx(ColorPickerContext, {
|
|
7843
|
+
value: useMemo(() => ({
|
|
7844
|
+
colorForComparison,
|
|
7845
|
+
currentContrastRatio,
|
|
7846
|
+
getAccessibleDerivativeColor,
|
|
7847
|
+
hasAccessibleDerivatives: hasAccessibleDerivativesValue,
|
|
7848
|
+
isDragging,
|
|
7849
|
+
isTransitioning,
|
|
7850
|
+
minimumContrastRatio,
|
|
7851
|
+
nonDerivedValueAsHex: formatHex(nonDerivedValueAsHsv),
|
|
7852
|
+
nonDerivedValueAsHsv,
|
|
7853
|
+
onChangeNonDerivedValueAsHsv,
|
|
7854
|
+
opacityForContrastCalculation,
|
|
7855
|
+
setIsDragging,
|
|
7856
|
+
setShouldEnforceMinContrast: setShouldEnforceMinContrastWrapped,
|
|
7857
|
+
shouldEnforceMinContrast,
|
|
7858
|
+
valueAsHex,
|
|
7859
|
+
valueAsHsv
|
|
7860
|
+
}), [
|
|
7861
|
+
colorForComparison,
|
|
7862
|
+
currentContrastRatio,
|
|
7863
|
+
getAccessibleDerivativeColor,
|
|
7864
|
+
hasAccessibleDerivativesValue,
|
|
7865
|
+
isDragging,
|
|
7866
|
+
isTransitioning,
|
|
7867
|
+
minimumContrastRatio,
|
|
7868
|
+
nonDerivedValueAsHsv,
|
|
7869
|
+
onChangeNonDerivedValueAsHsv,
|
|
7870
|
+
opacityForContrastCalculation,
|
|
7871
|
+
setShouldEnforceMinContrastWrapped,
|
|
7872
|
+
shouldEnforceMinContrast,
|
|
7873
|
+
valueAsHex,
|
|
7874
|
+
valueAsHsv
|
|
7875
|
+
]),
|
|
7886
7876
|
children
|
|
7887
7877
|
});
|
|
7888
7878
|
};
|
|
@@ -9949,7 +9939,7 @@ const Menu = ({ align = "start", children, disabled = false, compact = false, tr
|
|
|
9949
9939
|
open: false,
|
|
9950
9940
|
onOpenChange: () => null
|
|
9951
9941
|
};
|
|
9952
|
-
return /* @__PURE__ */ jsx(MenuContext
|
|
9942
|
+
return /* @__PURE__ */ jsx(MenuContext, {
|
|
9953
9943
|
value: contextValue,
|
|
9954
9944
|
children: /* @__PURE__ */ jsxs(Menu$1.Root, {
|
|
9955
9945
|
modal: false,
|
|
@@ -10028,7 +10018,7 @@ const ContextMenu = ({ position, triggerRef, children, side = "bottom", onReques
|
|
|
10028
10018
|
setIsRightClicked(next);
|
|
10029
10019
|
if (!next) onRequestClose();
|
|
10030
10020
|
};
|
|
10031
|
-
const menu = /* @__PURE__ */ jsx(MenuContext
|
|
10021
|
+
const menu = /* @__PURE__ */ jsx(MenuContext, {
|
|
10032
10022
|
value: contextValue,
|
|
10033
10023
|
children: /* @__PURE__ */ jsx(ContextMenu$1.Root, {
|
|
10034
10024
|
onOpenChange: handleOpenChange,
|
|
@@ -10662,7 +10652,7 @@ const EditableTextRoot = ({ children, defaultValue = "", value: controlledValue,
|
|
|
10662
10652
|
"data-wui-editable-text-root": true,
|
|
10663
10653
|
"data-wui-editable-text-state": getState(),
|
|
10664
10654
|
...props,
|
|
10665
|
-
children: /* @__PURE__ */ jsx(EditableTextContext
|
|
10655
|
+
children: /* @__PURE__ */ jsx(EditableTextContext, {
|
|
10666
10656
|
value: context,
|
|
10667
10657
|
children
|
|
10668
10658
|
})
|
|
@@ -11378,21 +11368,21 @@ const useRadioGroup = () => {
|
|
|
11378
11368
|
const RadioGroup = ({ children, name, onChange, value, ...props }) => {
|
|
11379
11369
|
const formState = useContext(FormContext);
|
|
11380
11370
|
const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
|
|
11381
|
-
|
|
11382
|
-
|
|
11371
|
+
return /* @__PURE__ */ jsx(RadioGroupContext, {
|
|
11372
|
+
value: useMemo(() => {
|
|
11373
|
+
return {
|
|
11374
|
+
name,
|
|
11375
|
+
onChange,
|
|
11376
|
+
value: derivedValue
|
|
11377
|
+
};
|
|
11378
|
+
}, [
|
|
11383
11379
|
name,
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
}, [
|
|
11388
|
-
name,
|
|
11389
|
-
derivedValue,
|
|
11390
|
-
onChange
|
|
11391
|
-
]);
|
|
11392
|
-
return /* @__PURE__ */ jsx(RadioGroupContext.Provider, {
|
|
11393
|
-
value: context,
|
|
11380
|
+
derivedValue,
|
|
11381
|
+
onChange
|
|
11382
|
+
]),
|
|
11394
11383
|
children: /* @__PURE__ */ jsx(FormGroup, {
|
|
11395
11384
|
...props,
|
|
11385
|
+
role: "radiogroup",
|
|
11396
11386
|
children
|
|
11397
11387
|
})
|
|
11398
11388
|
});
|
|
@@ -13743,7 +13733,7 @@ Popover.displayName = "Popover_UI";
|
|
|
13743
13733
|
//#endregion
|
|
13744
13734
|
//#region src/components/Popover/PopoverAnchorContext.tsx
|
|
13745
13735
|
const PopoverAnchorContext = createContext(null);
|
|
13746
|
-
const PopoverAnchorProvider = PopoverAnchorContext
|
|
13736
|
+
const PopoverAnchorProvider = PopoverAnchorContext;
|
|
13747
13737
|
const usePopoverAnchor = () => useContext(PopoverAnchorContext);
|
|
13748
13738
|
const useCreatePopoverAnchorRef = () => useRef(null);
|
|
13749
13739
|
//#endregion
|
|
@@ -14451,12 +14441,11 @@ const SelectedItemStyleProvider = ({ children }) => {
|
|
|
14451
14441
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
14452
14442
|
width: `${selectedItemMeasurements.offsetWidth}px`
|
|
14453
14443
|
} : void 0, [selectedItemMeasurements]);
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
value: contextValue,
|
|
14444
|
+
return /* @__PURE__ */ jsx(SelectedItemStyleContext, {
|
|
14445
|
+
value: useMemo(() => ({
|
|
14446
|
+
setSelectedItemMeasurements,
|
|
14447
|
+
selectedItemIndicatorStyle
|
|
14448
|
+
}), [selectedItemIndicatorStyle]),
|
|
14460
14449
|
children
|
|
14461
14450
|
});
|
|
14462
14451
|
};
|
|
@@ -14468,7 +14457,7 @@ const useSelectedItemStyle = () => {
|
|
|
14468
14457
|
//#endregion
|
|
14469
14458
|
//#region src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
14470
14459
|
const SegmentedControlValueContext = createContext(null);
|
|
14471
|
-
const SegmentedControlValueProvider = SegmentedControlValueContext
|
|
14460
|
+
const SegmentedControlValueProvider = SegmentedControlValueContext;
|
|
14472
14461
|
const useSegmentedControlValue = () => {
|
|
14473
14462
|
const context = useContext(SegmentedControlValueContext);
|
|
14474
14463
|
if (context === null) throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
@@ -15310,7 +15299,7 @@ const StyledTableBody = styled.tbody`
|
|
|
15310
15299
|
width: 100%;
|
|
15311
15300
|
`;
|
|
15312
15301
|
const TableBody = ({ children, ...props }) => {
|
|
15313
|
-
return /* @__PURE__ */ jsx(TableSectionContext
|
|
15302
|
+
return /* @__PURE__ */ jsx(TableSectionContext, {
|
|
15314
15303
|
value: "body",
|
|
15315
15304
|
children: /* @__PURE__ */ jsx(StyledTableBody, {
|
|
15316
15305
|
...props,
|
|
@@ -15353,7 +15342,7 @@ const StyledTableFoot = styled.tfoot`
|
|
|
15353
15342
|
width: 100%;
|
|
15354
15343
|
`;
|
|
15355
15344
|
const TableFoot = ({ children, ...props }) => {
|
|
15356
|
-
return /* @__PURE__ */ jsx(TableSectionContext
|
|
15345
|
+
return /* @__PURE__ */ jsx(TableSectionContext, {
|
|
15357
15346
|
value: "footer",
|
|
15358
15347
|
children: /* @__PURE__ */ jsx(StyledTableFoot, {
|
|
15359
15348
|
...props,
|
|
@@ -15367,7 +15356,7 @@ const StyledThead = styled.thead`
|
|
|
15367
15356
|
width: 100%;
|
|
15368
15357
|
`;
|
|
15369
15358
|
const TableHead = ({ children, ...props }) => {
|
|
15370
|
-
return /* @__PURE__ */ jsx(TableSectionContext
|
|
15359
|
+
return /* @__PURE__ */ jsx(TableSectionContext, {
|
|
15371
15360
|
value: "head",
|
|
15372
15361
|
children: /* @__PURE__ */ jsx(StyledThead, {
|
|
15373
15362
|
...props,
|
|
@@ -15389,7 +15378,7 @@ const TableRow = ({ children, ...props }) => {
|
|
|
15389
15378
|
//#endregion
|
|
15390
15379
|
//#region src/components/Tabs/useTabsValue.tsx
|
|
15391
15380
|
const TabsValueContext = createContext(null);
|
|
15392
|
-
const TabsValueProvider = TabsValueContext
|
|
15381
|
+
const TabsValueProvider = TabsValueContext;
|
|
15393
15382
|
const useTabsValue = () => {
|
|
15394
15383
|
const context = useContext(TabsValueContext);
|
|
15395
15384
|
if (context === null) throw new Error("useTabsValue must be used within a TabsValueProvider");
|