@wistia/ui 0.26.7 → 0.26.8-beta.9f130069.61e1daf
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 +96 -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.9f130069.61e1daf
|
|
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);
|
|
@@ -5663,6 +5656,7 @@ const StyledButton$2 = styled.button`
|
|
|
5663
5656
|
${({ $variant }) => buttonVariantsStyles[$variant]}
|
|
5664
5657
|
${({ $unstyled }) => !$unstyled && buttonBaseStyles}
|
|
5665
5658
|
${({ $fullWidth }) => $fullWidth && "width: 100%;"}
|
|
5659
|
+
align-self: flex-start;
|
|
5666
5660
|
text-align: center;
|
|
5667
5661
|
`;
|
|
5668
5662
|
const StyledButtonContent = styled.div`
|
|
@@ -5725,6 +5719,7 @@ const Button = ({ children, forceState, className, leftIcon, rightIcon, colorSch
|
|
|
5725
5719
|
disabled: isAriaDisabled(),
|
|
5726
5720
|
...props,
|
|
5727
5721
|
...commonProps,
|
|
5722
|
+
"data-wui-button": true,
|
|
5728
5723
|
children: unstyled ? children : /* @__PURE__ */ jsx(ButtonContent, {
|
|
5729
5724
|
fullWidth: responsiveFullWidth,
|
|
5730
5725
|
isLoading,
|
|
@@ -6623,6 +6618,10 @@ const ButtonGroupComponent = styled.div`
|
|
|
6623
6618
|
justify-content: ${({ $align }) => getAlignment($align)};
|
|
6624
6619
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
6625
6620
|
|
|
6621
|
+
[data-wui-button] {
|
|
6622
|
+
align-self: unset;
|
|
6623
|
+
}
|
|
6624
|
+
|
|
6626
6625
|
${mq.smAndUp} {
|
|
6627
6626
|
flex-direction: row;
|
|
6628
6627
|
}
|
|
@@ -7144,23 +7143,22 @@ const Form = ({ children, action, values = {}, labelPosition = "block", validate
|
|
|
7144
7143
|
if (props.onReset) props.onReset(event);
|
|
7145
7144
|
if (action) action(null);
|
|
7146
7145
|
};
|
|
7147
|
-
|
|
7148
|
-
|
|
7146
|
+
return /* @__PURE__ */ jsx(FormContext, {
|
|
7147
|
+
value: useMemo(() => {
|
|
7148
|
+
return {
|
|
7149
|
+
values,
|
|
7150
|
+
errors,
|
|
7151
|
+
hasSubmitted,
|
|
7152
|
+
formId: id,
|
|
7153
|
+
labelPosition
|
|
7154
|
+
};
|
|
7155
|
+
}, [
|
|
7156
|
+
labelPosition,
|
|
7149
7157
|
values,
|
|
7150
7158
|
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,
|
|
7159
|
+
id,
|
|
7160
|
+
hasSubmitted
|
|
7161
|
+
]),
|
|
7164
7162
|
children: /* @__PURE__ */ jsx(Stack, {
|
|
7165
7163
|
...props,
|
|
7166
7164
|
ref,
|
|
@@ -7191,19 +7189,18 @@ const useCheckboxGroup = () => {
|
|
|
7191
7189
|
const CheckboxGroup = ({ children, name, onChange, value, ...props }) => {
|
|
7192
7190
|
const formState = useContext(FormContext);
|
|
7193
7191
|
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,
|
|
7192
|
+
return /* @__PURE__ */ jsx(CheckboxGroupContext, {
|
|
7193
|
+
value: useMemo(() => {
|
|
7194
|
+
return {
|
|
7195
|
+
name: `${name}[]`,
|
|
7196
|
+
onChange,
|
|
7197
|
+
value: derivedValue
|
|
7198
|
+
};
|
|
7199
|
+
}, [
|
|
7200
|
+
name,
|
|
7201
|
+
derivedValue,
|
|
7202
|
+
onChange
|
|
7203
|
+
]),
|
|
7207
7204
|
children: /* @__PURE__ */ jsx(FormGroup, {
|
|
7208
7205
|
...props,
|
|
7209
7206
|
children
|
|
@@ -7848,41 +7845,40 @@ const ColorPickerProvider = ({ children, colorForComparison, minimumContrastRati
|
|
|
7848
7845
|
valueAsHsvConvertedToHex,
|
|
7849
7846
|
whatValueAsHexShouldBe
|
|
7850
7847
|
]);
|
|
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,
|
|
7848
|
+
return /* @__PURE__ */ jsx(ColorPickerContext, {
|
|
7849
|
+
value: useMemo(() => ({
|
|
7850
|
+
colorForComparison,
|
|
7851
|
+
currentContrastRatio,
|
|
7852
|
+
getAccessibleDerivativeColor,
|
|
7853
|
+
hasAccessibleDerivatives: hasAccessibleDerivativesValue,
|
|
7854
|
+
isDragging,
|
|
7855
|
+
isTransitioning,
|
|
7856
|
+
minimumContrastRatio,
|
|
7857
|
+
nonDerivedValueAsHex: formatHex(nonDerivedValueAsHsv),
|
|
7858
|
+
nonDerivedValueAsHsv,
|
|
7859
|
+
onChangeNonDerivedValueAsHsv,
|
|
7860
|
+
opacityForContrastCalculation,
|
|
7861
|
+
setIsDragging,
|
|
7862
|
+
setShouldEnforceMinContrast: setShouldEnforceMinContrastWrapped,
|
|
7863
|
+
shouldEnforceMinContrast,
|
|
7864
|
+
valueAsHex,
|
|
7865
|
+
valueAsHsv
|
|
7866
|
+
}), [
|
|
7867
|
+
colorForComparison,
|
|
7868
|
+
currentContrastRatio,
|
|
7869
|
+
getAccessibleDerivativeColor,
|
|
7870
|
+
hasAccessibleDerivativesValue,
|
|
7871
|
+
isDragging,
|
|
7872
|
+
isTransitioning,
|
|
7873
|
+
minimumContrastRatio,
|
|
7874
|
+
nonDerivedValueAsHsv,
|
|
7875
|
+
onChangeNonDerivedValueAsHsv,
|
|
7876
|
+
opacityForContrastCalculation,
|
|
7877
|
+
setShouldEnforceMinContrastWrapped,
|
|
7878
|
+
shouldEnforceMinContrast,
|
|
7879
|
+
valueAsHex,
|
|
7880
|
+
valueAsHsv
|
|
7881
|
+
]),
|
|
7886
7882
|
children
|
|
7887
7883
|
});
|
|
7888
7884
|
};
|
|
@@ -9949,7 +9945,7 @@ const Menu = ({ align = "start", children, disabled = false, compact = false, tr
|
|
|
9949
9945
|
open: false,
|
|
9950
9946
|
onOpenChange: () => null
|
|
9951
9947
|
};
|
|
9952
|
-
return /* @__PURE__ */ jsx(MenuContext
|
|
9948
|
+
return /* @__PURE__ */ jsx(MenuContext, {
|
|
9953
9949
|
value: contextValue,
|
|
9954
9950
|
children: /* @__PURE__ */ jsxs(Menu$1.Root, {
|
|
9955
9951
|
modal: false,
|
|
@@ -10028,7 +10024,7 @@ const ContextMenu = ({ position, triggerRef, children, side = "bottom", onReques
|
|
|
10028
10024
|
setIsRightClicked(next);
|
|
10029
10025
|
if (!next) onRequestClose();
|
|
10030
10026
|
};
|
|
10031
|
-
const menu = /* @__PURE__ */ jsx(MenuContext
|
|
10027
|
+
const menu = /* @__PURE__ */ jsx(MenuContext, {
|
|
10032
10028
|
value: contextValue,
|
|
10033
10029
|
children: /* @__PURE__ */ jsx(ContextMenu$1.Root, {
|
|
10034
10030
|
onOpenChange: handleOpenChange,
|
|
@@ -10662,7 +10658,7 @@ const EditableTextRoot = ({ children, defaultValue = "", value: controlledValue,
|
|
|
10662
10658
|
"data-wui-editable-text-root": true,
|
|
10663
10659
|
"data-wui-editable-text-state": getState(),
|
|
10664
10660
|
...props,
|
|
10665
|
-
children: /* @__PURE__ */ jsx(EditableTextContext
|
|
10661
|
+
children: /* @__PURE__ */ jsx(EditableTextContext, {
|
|
10666
10662
|
value: context,
|
|
10667
10663
|
children
|
|
10668
10664
|
})
|
|
@@ -11378,19 +11374,18 @@ const useRadioGroup = () => {
|
|
|
11378
11374
|
const RadioGroup = ({ children, name, onChange, value, ...props }) => {
|
|
11379
11375
|
const formState = useContext(FormContext);
|
|
11380
11376
|
const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
|
|
11381
|
-
|
|
11382
|
-
|
|
11377
|
+
return /* @__PURE__ */ jsx(RadioGroupContext, {
|
|
11378
|
+
value: useMemo(() => {
|
|
11379
|
+
return {
|
|
11380
|
+
name,
|
|
11381
|
+
onChange,
|
|
11382
|
+
value: derivedValue
|
|
11383
|
+
};
|
|
11384
|
+
}, [
|
|
11383
11385
|
name,
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
}, [
|
|
11388
|
-
name,
|
|
11389
|
-
derivedValue,
|
|
11390
|
-
onChange
|
|
11391
|
-
]);
|
|
11392
|
-
return /* @__PURE__ */ jsx(RadioGroupContext.Provider, {
|
|
11393
|
-
value: context,
|
|
11386
|
+
derivedValue,
|
|
11387
|
+
onChange
|
|
11388
|
+
]),
|
|
11394
11389
|
children: /* @__PURE__ */ jsx(FormGroup, {
|
|
11395
11390
|
...props,
|
|
11396
11391
|
children
|
|
@@ -13743,7 +13738,7 @@ Popover.displayName = "Popover_UI";
|
|
|
13743
13738
|
//#endregion
|
|
13744
13739
|
//#region src/components/Popover/PopoverAnchorContext.tsx
|
|
13745
13740
|
const PopoverAnchorContext = createContext(null);
|
|
13746
|
-
const PopoverAnchorProvider = PopoverAnchorContext
|
|
13741
|
+
const PopoverAnchorProvider = PopoverAnchorContext;
|
|
13747
13742
|
const usePopoverAnchor = () => useContext(PopoverAnchorContext);
|
|
13748
13743
|
const useCreatePopoverAnchorRef = () => useRef(null);
|
|
13749
13744
|
//#endregion
|
|
@@ -14451,12 +14446,11 @@ const SelectedItemStyleProvider = ({ children }) => {
|
|
|
14451
14446
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
14452
14447
|
width: `${selectedItemMeasurements.offsetWidth}px`
|
|
14453
14448
|
} : void 0, [selectedItemMeasurements]);
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
value: contextValue,
|
|
14449
|
+
return /* @__PURE__ */ jsx(SelectedItemStyleContext, {
|
|
14450
|
+
value: useMemo(() => ({
|
|
14451
|
+
setSelectedItemMeasurements,
|
|
14452
|
+
selectedItemIndicatorStyle
|
|
14453
|
+
}), [selectedItemIndicatorStyle]),
|
|
14460
14454
|
children
|
|
14461
14455
|
});
|
|
14462
14456
|
};
|
|
@@ -14468,7 +14462,7 @@ const useSelectedItemStyle = () => {
|
|
|
14468
14462
|
//#endregion
|
|
14469
14463
|
//#region src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
14470
14464
|
const SegmentedControlValueContext = createContext(null);
|
|
14471
|
-
const SegmentedControlValueProvider = SegmentedControlValueContext
|
|
14465
|
+
const SegmentedControlValueProvider = SegmentedControlValueContext;
|
|
14472
14466
|
const useSegmentedControlValue = () => {
|
|
14473
14467
|
const context = useContext(SegmentedControlValueContext);
|
|
14474
14468
|
if (context === null) throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
@@ -15310,7 +15304,7 @@ const StyledTableBody = styled.tbody`
|
|
|
15310
15304
|
width: 100%;
|
|
15311
15305
|
`;
|
|
15312
15306
|
const TableBody = ({ children, ...props }) => {
|
|
15313
|
-
return /* @__PURE__ */ jsx(TableSectionContext
|
|
15307
|
+
return /* @__PURE__ */ jsx(TableSectionContext, {
|
|
15314
15308
|
value: "body",
|
|
15315
15309
|
children: /* @__PURE__ */ jsx(StyledTableBody, {
|
|
15316
15310
|
...props,
|
|
@@ -15353,7 +15347,7 @@ const StyledTableFoot = styled.tfoot`
|
|
|
15353
15347
|
width: 100%;
|
|
15354
15348
|
`;
|
|
15355
15349
|
const TableFoot = ({ children, ...props }) => {
|
|
15356
|
-
return /* @__PURE__ */ jsx(TableSectionContext
|
|
15350
|
+
return /* @__PURE__ */ jsx(TableSectionContext, {
|
|
15357
15351
|
value: "footer",
|
|
15358
15352
|
children: /* @__PURE__ */ jsx(StyledTableFoot, {
|
|
15359
15353
|
...props,
|
|
@@ -15367,7 +15361,7 @@ const StyledThead = styled.thead`
|
|
|
15367
15361
|
width: 100%;
|
|
15368
15362
|
`;
|
|
15369
15363
|
const TableHead = ({ children, ...props }) => {
|
|
15370
|
-
return /* @__PURE__ */ jsx(TableSectionContext
|
|
15364
|
+
return /* @__PURE__ */ jsx(TableSectionContext, {
|
|
15371
15365
|
value: "head",
|
|
15372
15366
|
children: /* @__PURE__ */ jsx(StyledThead, {
|
|
15373
15367
|
...props,
|
|
@@ -15389,7 +15383,7 @@ const TableRow = ({ children, ...props }) => {
|
|
|
15389
15383
|
//#endregion
|
|
15390
15384
|
//#region src/components/Tabs/useTabsValue.tsx
|
|
15391
15385
|
const TabsValueContext = createContext(null);
|
|
15392
|
-
const TabsValueProvider = TabsValueContext
|
|
15386
|
+
const TabsValueProvider = TabsValueContext;
|
|
15393
15387
|
const useTabsValue = () => {
|
|
15394
15388
|
const context = useContext(TabsValueContext);
|
|
15395
15389
|
if (context === null) throw new Error("useTabsValue must be used within a TabsValueProvider");
|