@wistia/ui 0.8.9 → 0.8.10
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 +225 -226
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +26 -25
- package/dist/index.d.ts +26 -25
- package/dist/index.mjs +63 -64
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -202,11 +202,12 @@ type LinkAsButtonProps = BaseProps$2 & ComponentPropsWithRef<'button'> & {
|
|
|
202
202
|
};
|
|
203
203
|
type LinkProps = LinkAsButtonProps | LinkAsLinkProps;
|
|
204
204
|
/**
|
|
205
|
-
* Links are used for navigation. If no `href` is supplied, a button that is visually styled to
|
|
206
|
-
* is
|
|
205
|
+
* Links are used for navigation. If no `href` is supplied, a button that is visually styled to appear as a link
|
|
206
|
+
* is rendered. If used in a `react-router` context, their [Link](https://reactrouter.com/en/main/components/link).
|
|
207
|
+
* component is used, otherwise a native `a` element.
|
|
208
|
+
*
|
|
207
209
|
* This means in addition to its own props, `Link` can use props from `react-router-dom`'s `Link` component. View their documentation [here](https://reactrouter.com/en/main/components/link).
|
|
208
210
|
* The one prop we ignore from react-router is `to`. We use `href` instead and map it under the hood.
|
|
209
|
-
*
|
|
210
211
|
*/
|
|
211
212
|
declare const Link: react.ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
212
213
|
|
|
@@ -758,7 +759,7 @@ declare const Breadcrumbs: {
|
|
|
758
759
|
type BreadcrumbProps = ButtonAsLinkProps & {
|
|
759
760
|
/**
|
|
760
761
|
* An [Icon](../?path=/docs/components-icon--docs) to show at the beginning of the breadcrumb
|
|
761
|
-
|
|
762
|
+
*/
|
|
762
763
|
icon?: ButtonAsLinkProps['leftIcon'];
|
|
763
764
|
/**
|
|
764
765
|
* The text of the breadcrumb link
|
|
@@ -838,51 +839,51 @@ type CardProps = BoxProps & ComponentPropsWithoutRef<'div'> & {
|
|
|
838
839
|
width?: string;
|
|
839
840
|
/**
|
|
840
841
|
* @ignore
|
|
841
|
-
|
|
842
|
+
*/
|
|
842
843
|
alignContent?: BoxProps['alignContent'];
|
|
843
844
|
/**
|
|
844
845
|
* @ignore
|
|
845
|
-
|
|
846
|
+
*/
|
|
846
847
|
alignItems?: BoxProps['alignItems'];
|
|
847
848
|
/**
|
|
848
849
|
* @ignore
|
|
849
|
-
|
|
850
|
+
*/
|
|
850
851
|
alignSelf?: BoxProps['alignSelf'];
|
|
851
852
|
/**
|
|
852
853
|
* @ignore
|
|
853
|
-
|
|
854
|
+
*/
|
|
854
855
|
basis?: BoxProps['basis'];
|
|
855
856
|
/**
|
|
856
857
|
* @ignore
|
|
857
|
-
|
|
858
|
+
*/
|
|
858
859
|
fill?: BoxProps['fill'];
|
|
859
860
|
/**
|
|
860
861
|
* @ignore
|
|
861
|
-
|
|
862
|
+
*/
|
|
862
863
|
fillViewport?: BoxProps['fillViewport'];
|
|
863
864
|
/**
|
|
864
865
|
* @ignore
|
|
865
|
-
|
|
866
|
+
*/
|
|
866
867
|
grow?: BoxProps['grow'];
|
|
867
868
|
/**
|
|
868
869
|
* @ignore
|
|
869
|
-
|
|
870
|
+
*/
|
|
870
871
|
inline?: BoxProps['inline'];
|
|
871
872
|
/**
|
|
872
873
|
* @ignore
|
|
873
|
-
|
|
874
|
+
*/
|
|
874
875
|
justifyContent?: BoxProps['justifyContent'];
|
|
875
876
|
/**
|
|
876
877
|
* @ignore
|
|
877
|
-
|
|
878
|
+
*/
|
|
878
879
|
order?: BoxProps['order'];
|
|
879
880
|
/**
|
|
880
881
|
* @ignore
|
|
881
|
-
|
|
882
|
+
*/
|
|
882
883
|
shrink?: BoxProps['shrink'];
|
|
883
884
|
/**
|
|
884
885
|
* @ignore
|
|
885
|
-
|
|
886
|
+
*/
|
|
886
887
|
wrapItems?: BoxProps['wrapItems'];
|
|
887
888
|
};
|
|
888
889
|
/**
|
|
@@ -1853,7 +1854,7 @@ type ControlledMenuProps = {
|
|
|
1853
1854
|
/**
|
|
1854
1855
|
* Is the menu open.
|
|
1855
1856
|
* Must be used with `onOpenChange`.
|
|
1856
|
-
|
|
1857
|
+
*/
|
|
1857
1858
|
isOpen: boolean;
|
|
1858
1859
|
/** When an attempt to toggle the menu is triggered.
|
|
1859
1860
|
* Must be used with `isOpen`.
|
|
@@ -1893,7 +1894,7 @@ type MenuProps = MenuControlProps & {
|
|
|
1893
1894
|
onInteractOutside?: DropdownMenuContentProps['onInteractOutside'];
|
|
1894
1895
|
/**
|
|
1895
1896
|
* Replace the default trigger with a custom button or other element
|
|
1896
|
-
|
|
1897
|
+
*/
|
|
1897
1898
|
trigger?: ReactNode;
|
|
1898
1899
|
/**
|
|
1899
1900
|
* Props to pass to the trigger component, the default trigger is Button
|
|
@@ -1978,23 +1979,23 @@ type MenuItemButtonProps = ButtonProps & {
|
|
|
1978
1979
|
rightIcon?: ButtonProps['rightIcon'];
|
|
1979
1980
|
/**
|
|
1980
1981
|
* @ignore
|
|
1981
|
-
|
|
1982
|
+
*/
|
|
1982
1983
|
fullWidth?: never;
|
|
1983
1984
|
/**
|
|
1984
1985
|
* @ignore
|
|
1985
|
-
|
|
1986
|
+
*/
|
|
1986
1987
|
asChild?: never;
|
|
1987
1988
|
/**
|
|
1988
1989
|
* @ignore
|
|
1989
|
-
|
|
1990
|
+
*/
|
|
1990
1991
|
variant?: never;
|
|
1991
1992
|
/**
|
|
1992
1993
|
* @ignore
|
|
1993
|
-
|
|
1994
|
+
*/
|
|
1994
1995
|
size?: never;
|
|
1995
1996
|
/**
|
|
1996
1997
|
* @ignore
|
|
1997
|
-
|
|
1998
|
+
*/
|
|
1998
1999
|
unstyled?: never;
|
|
1999
2000
|
};
|
|
2000
2001
|
|
|
@@ -2342,7 +2343,7 @@ type ControlledPopoverProps = {
|
|
|
2342
2343
|
/**
|
|
2343
2344
|
* Is the popover open.
|
|
2344
2345
|
* Must be used with `onOpenChange`.
|
|
2345
|
-
|
|
2346
|
+
*/
|
|
2346
2347
|
isOpen: boolean;
|
|
2347
2348
|
/** When an attempt to toggle the popover is triggered.
|
|
2348
2349
|
* Must be used with `isOpen`.
|
|
@@ -2374,7 +2375,7 @@ type PopoverProps = ContentProps & PopoverControlProps & {
|
|
|
2374
2375
|
hideCloseButton?: boolean;
|
|
2375
2376
|
/**
|
|
2376
2377
|
* An interactive element. Most commonly a [Button](?path=/docs/components-button--docs) or [IconButton]([Button](?path=/docs/components-iconbutton--docs)).
|
|
2377
|
-
|
|
2378
|
+
*/
|
|
2378
2379
|
trigger: JSX.Element;
|
|
2379
2380
|
/**
|
|
2380
2381
|
* If true, the popover will use the unstyled Content component instead of StyledContent
|
package/dist/index.d.ts
CHANGED
|
@@ -202,11 +202,12 @@ type LinkAsButtonProps = BaseProps$2 & ComponentPropsWithRef<'button'> & {
|
|
|
202
202
|
};
|
|
203
203
|
type LinkProps = LinkAsButtonProps | LinkAsLinkProps;
|
|
204
204
|
/**
|
|
205
|
-
* Links are used for navigation. If no `href` is supplied, a button that is visually styled to
|
|
206
|
-
* is
|
|
205
|
+
* Links are used for navigation. If no `href` is supplied, a button that is visually styled to appear as a link
|
|
206
|
+
* is rendered. If used in a `react-router` context, their [Link](https://reactrouter.com/en/main/components/link).
|
|
207
|
+
* component is used, otherwise a native `a` element.
|
|
208
|
+
*
|
|
207
209
|
* This means in addition to its own props, `Link` can use props from `react-router-dom`'s `Link` component. View their documentation [here](https://reactrouter.com/en/main/components/link).
|
|
208
210
|
* The one prop we ignore from react-router is `to`. We use `href` instead and map it under the hood.
|
|
209
|
-
*
|
|
210
211
|
*/
|
|
211
212
|
declare const Link: react.ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
212
213
|
|
|
@@ -758,7 +759,7 @@ declare const Breadcrumbs: {
|
|
|
758
759
|
type BreadcrumbProps = ButtonAsLinkProps & {
|
|
759
760
|
/**
|
|
760
761
|
* An [Icon](../?path=/docs/components-icon--docs) to show at the beginning of the breadcrumb
|
|
761
|
-
|
|
762
|
+
*/
|
|
762
763
|
icon?: ButtonAsLinkProps['leftIcon'];
|
|
763
764
|
/**
|
|
764
765
|
* The text of the breadcrumb link
|
|
@@ -838,51 +839,51 @@ type CardProps = BoxProps & ComponentPropsWithoutRef<'div'> & {
|
|
|
838
839
|
width?: string;
|
|
839
840
|
/**
|
|
840
841
|
* @ignore
|
|
841
|
-
|
|
842
|
+
*/
|
|
842
843
|
alignContent?: BoxProps['alignContent'];
|
|
843
844
|
/**
|
|
844
845
|
* @ignore
|
|
845
|
-
|
|
846
|
+
*/
|
|
846
847
|
alignItems?: BoxProps['alignItems'];
|
|
847
848
|
/**
|
|
848
849
|
* @ignore
|
|
849
|
-
|
|
850
|
+
*/
|
|
850
851
|
alignSelf?: BoxProps['alignSelf'];
|
|
851
852
|
/**
|
|
852
853
|
* @ignore
|
|
853
|
-
|
|
854
|
+
*/
|
|
854
855
|
basis?: BoxProps['basis'];
|
|
855
856
|
/**
|
|
856
857
|
* @ignore
|
|
857
|
-
|
|
858
|
+
*/
|
|
858
859
|
fill?: BoxProps['fill'];
|
|
859
860
|
/**
|
|
860
861
|
* @ignore
|
|
861
|
-
|
|
862
|
+
*/
|
|
862
863
|
fillViewport?: BoxProps['fillViewport'];
|
|
863
864
|
/**
|
|
864
865
|
* @ignore
|
|
865
|
-
|
|
866
|
+
*/
|
|
866
867
|
grow?: BoxProps['grow'];
|
|
867
868
|
/**
|
|
868
869
|
* @ignore
|
|
869
|
-
|
|
870
|
+
*/
|
|
870
871
|
inline?: BoxProps['inline'];
|
|
871
872
|
/**
|
|
872
873
|
* @ignore
|
|
873
|
-
|
|
874
|
+
*/
|
|
874
875
|
justifyContent?: BoxProps['justifyContent'];
|
|
875
876
|
/**
|
|
876
877
|
* @ignore
|
|
877
|
-
|
|
878
|
+
*/
|
|
878
879
|
order?: BoxProps['order'];
|
|
879
880
|
/**
|
|
880
881
|
* @ignore
|
|
881
|
-
|
|
882
|
+
*/
|
|
882
883
|
shrink?: BoxProps['shrink'];
|
|
883
884
|
/**
|
|
884
885
|
* @ignore
|
|
885
|
-
|
|
886
|
+
*/
|
|
886
887
|
wrapItems?: BoxProps['wrapItems'];
|
|
887
888
|
};
|
|
888
889
|
/**
|
|
@@ -1853,7 +1854,7 @@ type ControlledMenuProps = {
|
|
|
1853
1854
|
/**
|
|
1854
1855
|
* Is the menu open.
|
|
1855
1856
|
* Must be used with `onOpenChange`.
|
|
1856
|
-
|
|
1857
|
+
*/
|
|
1857
1858
|
isOpen: boolean;
|
|
1858
1859
|
/** When an attempt to toggle the menu is triggered.
|
|
1859
1860
|
* Must be used with `isOpen`.
|
|
@@ -1893,7 +1894,7 @@ type MenuProps = MenuControlProps & {
|
|
|
1893
1894
|
onInteractOutside?: DropdownMenuContentProps['onInteractOutside'];
|
|
1894
1895
|
/**
|
|
1895
1896
|
* Replace the default trigger with a custom button or other element
|
|
1896
|
-
|
|
1897
|
+
*/
|
|
1897
1898
|
trigger?: ReactNode;
|
|
1898
1899
|
/**
|
|
1899
1900
|
* Props to pass to the trigger component, the default trigger is Button
|
|
@@ -1978,23 +1979,23 @@ type MenuItemButtonProps = ButtonProps & {
|
|
|
1978
1979
|
rightIcon?: ButtonProps['rightIcon'];
|
|
1979
1980
|
/**
|
|
1980
1981
|
* @ignore
|
|
1981
|
-
|
|
1982
|
+
*/
|
|
1982
1983
|
fullWidth?: never;
|
|
1983
1984
|
/**
|
|
1984
1985
|
* @ignore
|
|
1985
|
-
|
|
1986
|
+
*/
|
|
1986
1987
|
asChild?: never;
|
|
1987
1988
|
/**
|
|
1988
1989
|
* @ignore
|
|
1989
|
-
|
|
1990
|
+
*/
|
|
1990
1991
|
variant?: never;
|
|
1991
1992
|
/**
|
|
1992
1993
|
* @ignore
|
|
1993
|
-
|
|
1994
|
+
*/
|
|
1994
1995
|
size?: never;
|
|
1995
1996
|
/**
|
|
1996
1997
|
* @ignore
|
|
1997
|
-
|
|
1998
|
+
*/
|
|
1998
1999
|
unstyled?: never;
|
|
1999
2000
|
};
|
|
2000
2001
|
|
|
@@ -2342,7 +2343,7 @@ type ControlledPopoverProps = {
|
|
|
2342
2343
|
/**
|
|
2343
2344
|
* Is the popover open.
|
|
2344
2345
|
* Must be used with `onOpenChange`.
|
|
2345
|
-
|
|
2346
|
+
*/
|
|
2346
2347
|
isOpen: boolean;
|
|
2347
2348
|
/** When an attempt to toggle the popover is triggered.
|
|
2348
2349
|
* Must be used with `isOpen`.
|
|
@@ -2374,7 +2375,7 @@ type PopoverProps = ContentProps & PopoverControlProps & {
|
|
|
2374
2375
|
hideCloseButton?: boolean;
|
|
2375
2376
|
/**
|
|
2376
2377
|
* An interactive element. Most commonly a [Button](?path=/docs/components-button--docs) or [IconButton]([Button](?path=/docs/components-iconbutton--docs)).
|
|
2377
|
-
|
|
2378
|
+
*/
|
|
2378
2379
|
trigger: JSX.Element;
|
|
2379
2380
|
/**
|
|
2380
2381
|
* If true, the popover will use the unstyled Content component instead of StyledContent
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.
|
|
3
|
+
* @license @wistia/ui v0.8.10
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
// src/providers/UIProvider/UIProvider.tsx
|
|
12
12
|
import { Provider as TooltipProvider } from "@radix-ui/react-tooltip";
|
|
13
|
+
import { createContext as createContext2, useContext } from "react";
|
|
13
14
|
|
|
14
15
|
// src/css/GlobalStyle.tsx
|
|
15
16
|
import { createGlobalStyle } from "styled-components";
|
|
@@ -1468,12 +1469,17 @@ var ToastProvider = () => /* @__PURE__ */ jsx2(Toaster, { ...toastConfig });
|
|
|
1468
1469
|
|
|
1469
1470
|
// src/providers/UIProvider/UIProvider.tsx
|
|
1470
1471
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1472
|
+
var UIProviderNestingContext = createContext2(false);
|
|
1471
1473
|
var UIProvider = ({ children }) => {
|
|
1472
|
-
|
|
1474
|
+
const isNested = useContext(UIProviderNestingContext);
|
|
1475
|
+
if (isNested) {
|
|
1476
|
+
console.warn("UIProvider is nested. Only one instance of UIProvider.");
|
|
1477
|
+
}
|
|
1478
|
+
return /* @__PURE__ */ jsx3(UIProviderNestingContext.Provider, { value: true, children: /* @__PURE__ */ jsx3(AriaLiveProvider, { children: /* @__PURE__ */ jsxs(TooltipProvider, { children: [
|
|
1473
1479
|
/* @__PURE__ */ jsx3(GlobalStyle, {}),
|
|
1474
1480
|
children,
|
|
1475
1481
|
process.env["NODE_ENV"] !== "test" && /* @__PURE__ */ jsx3(ToastProvider, {})
|
|
1476
|
-
] }) });
|
|
1482
|
+
] }) }) });
|
|
1477
1483
|
};
|
|
1478
1484
|
|
|
1479
1485
|
// src/helpers/copyToClipboard/copyToClipboard.ts
|
|
@@ -1941,10 +1947,10 @@ var mq = {
|
|
|
1941
1947
|
};
|
|
1942
1948
|
|
|
1943
1949
|
// src/hooks/useAriaLive/useAriaLive.tsx
|
|
1944
|
-
import { useContext } from "react";
|
|
1950
|
+
import { useContext as useContext2 } from "react";
|
|
1945
1951
|
import { isNil as isNil4 } from "@wistia/type-guards";
|
|
1946
1952
|
var useAriaLive = () => {
|
|
1947
|
-
const context =
|
|
1953
|
+
const context = useContext2(AriaLiveContext);
|
|
1948
1954
|
if (isNil4(context)) {
|
|
1949
1955
|
throw new Error("useAriaLive must be used within an AriaLiveProvider");
|
|
1950
1956
|
}
|
|
@@ -6859,31 +6865,29 @@ Icon.displayName = "Icon";
|
|
|
6859
6865
|
|
|
6860
6866
|
// src/components/Link/Link.tsx
|
|
6861
6867
|
import { forwardRef } from "react";
|
|
6862
|
-
import { isFunction as isFunction2, isNil as isNil6, isNotNil as isNotNil5, isNotUndefined as isNotUndefined3, isUndefined as isUndefined2 } from "@wistia/type-guards";
|
|
6863
6868
|
import styled4 from "styled-components";
|
|
6864
6869
|
import { Link as RouterLink, useInRouterContext } from "react-router-dom";
|
|
6870
|
+
import { isFunction as isFunction2, isNil as isNil6, isNotNil as isNotNil5, isNotUndefined as isNotUndefined3, isUndefined as isUndefined2 } from "@wistia/type-guards";
|
|
6865
6871
|
import { jsx as jsx192, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6866
6872
|
var generateHref = (href, type, disabled) => {
|
|
6867
6873
|
if (disabled || isNil6(href)) {
|
|
6868
6874
|
return void 0;
|
|
6869
6875
|
}
|
|
6870
|
-
let
|
|
6876
|
+
let modifiedHref = href;
|
|
6871
6877
|
if (type === "phone") {
|
|
6872
|
-
|
|
6878
|
+
modifiedHref = `tel:${href}`;
|
|
6873
6879
|
}
|
|
6874
6880
|
if (type === "email") {
|
|
6875
|
-
|
|
6881
|
+
modifiedHref = `mailto:${href}`;
|
|
6876
6882
|
}
|
|
6877
|
-
return
|
|
6883
|
+
return modifiedHref;
|
|
6878
6884
|
};
|
|
6879
6885
|
var isButton = (props) => isUndefined2(props.href);
|
|
6880
6886
|
var isLink = (props) => isNotUndefined3(props.href);
|
|
6881
6887
|
var StyledLink = styled4.a`
|
|
6882
|
-
--link-icon-size: 14px;
|
|
6883
|
-
|
|
6884
6888
|
${({ href }) => isNil6(href) && buttonResetCss};
|
|
6885
6889
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
6886
|
-
cursor: pointer;
|
|
6890
|
+
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
6887
6891
|
font-family: var(--wui-typography-family-default);
|
|
6888
6892
|
color: var(--wui-color-text-link);
|
|
6889
6893
|
text-decoration: ${({ $underline }) => $underline ? "underline" : "none"};
|
|
@@ -6893,8 +6897,8 @@ var StyledLink = styled4.a`
|
|
|
6893
6897
|
|
|
6894
6898
|
&& {
|
|
6895
6899
|
svg {
|
|
6896
|
-
width:
|
|
6897
|
-
height:
|
|
6900
|
+
width: 14px;
|
|
6901
|
+
height: 14px;
|
|
6898
6902
|
}
|
|
6899
6903
|
}
|
|
6900
6904
|
`;
|
|
@@ -6939,6 +6943,7 @@ var Link = forwardRef(
|
|
|
6939
6943
|
};
|
|
6940
6944
|
const commonProps = {
|
|
6941
6945
|
$colorScheme: colorScheme,
|
|
6946
|
+
$disabled: disabled,
|
|
6942
6947
|
$underline: underline,
|
|
6943
6948
|
onClick: handleClick
|
|
6944
6949
|
};
|
|
@@ -6957,33 +6962,27 @@ var Link = forwardRef(
|
|
|
6957
6962
|
}
|
|
6958
6963
|
if (isLink(props)) {
|
|
6959
6964
|
const externalLinkProps = type === "external" ? { target: "_blank", rel: "noopener noreferrer" } : null;
|
|
6965
|
+
const routerSpecificProps = shouldUseReactRouterLink ? {
|
|
6966
|
+
// TODO: Using 'any' here due to styled-components typing limitations with RouterLink
|
|
6967
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
6968
|
+
as: RouterLink,
|
|
6969
|
+
to: to ?? ""
|
|
6970
|
+
} : {
|
|
6971
|
+
as: "a",
|
|
6972
|
+
href: to
|
|
6973
|
+
};
|
|
6960
6974
|
const combinedProps = {
|
|
6961
6975
|
ref,
|
|
6962
6976
|
...props,
|
|
6963
6977
|
...commonProps,
|
|
6964
|
-
...externalLinkProps
|
|
6978
|
+
...externalLinkProps,
|
|
6979
|
+
...routerSpecificProps
|
|
6965
6980
|
};
|
|
6966
|
-
return
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
to: to ?? "",
|
|
6972
|
-
children
|
|
6973
|
-
}
|
|
6974
|
-
) : /* @__PURE__ */ jsxs7(
|
|
6975
|
-
StyledLink,
|
|
6976
|
-
{
|
|
6977
|
-
as: "a",
|
|
6978
|
-
...combinedProps,
|
|
6979
|
-
href: to,
|
|
6980
|
-
children: [
|
|
6981
|
-
leftIcon ?? null,
|
|
6982
|
-
children,
|
|
6983
|
-
rightIcon ?? null
|
|
6984
|
-
]
|
|
6985
|
-
}
|
|
6986
|
-
);
|
|
6981
|
+
return /* @__PURE__ */ jsxs7(StyledLink, { ...combinedProps, children: [
|
|
6982
|
+
leftIcon ?? null,
|
|
6983
|
+
children,
|
|
6984
|
+
rightIcon ?? null
|
|
6985
|
+
] });
|
|
6987
6986
|
}
|
|
6988
6987
|
return null;
|
|
6989
6988
|
}
|
|
@@ -9352,7 +9351,7 @@ var EditableHeading = ({
|
|
|
9352
9351
|
};
|
|
9353
9352
|
|
|
9354
9353
|
// src/components/Form/Form.tsx
|
|
9355
|
-
import { forwardRef as forwardRef12, useRef as useRef6, useMemo as useMemo4, createContext as
|
|
9354
|
+
import { forwardRef as forwardRef12, useRef as useRef6, useMemo as useMemo4, createContext as createContext3, useState as useState7, useId as useId2 } from "react";
|
|
9356
9355
|
import styled33 from "styled-components";
|
|
9357
9356
|
import { isNotUndefined as isNotUndefined7, isUndefined as isUndefined3 } from "@wistia/type-guards";
|
|
9358
9357
|
|
|
@@ -9396,7 +9395,7 @@ var StyledForm = styled33.form`
|
|
|
9396
9395
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9397
9396
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9398
9397
|
`;
|
|
9399
|
-
var FormContext =
|
|
9398
|
+
var FormContext = createContext3({
|
|
9400
9399
|
values: {},
|
|
9401
9400
|
errors: {},
|
|
9402
9401
|
hasSubmitted: false,
|
|
@@ -9526,7 +9525,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9526
9525
|
};
|
|
9527
9526
|
|
|
9528
9527
|
// src/components/Form/FormErrorSummary.tsx
|
|
9529
|
-
import { useContext as
|
|
9528
|
+
import { useContext as useContext3, useRef as useRef7 } from "react";
|
|
9530
9529
|
import { isArray, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
|
|
9531
9530
|
import { jsx as jsx223, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9532
9531
|
var ErrorItem = ({ name, error, formId }) => {
|
|
@@ -9534,7 +9533,7 @@ var ErrorItem = ({ name, error, formId }) => {
|
|
|
9534
9533
|
};
|
|
9535
9534
|
var FormErrorSummary = ({ description }) => {
|
|
9536
9535
|
const ref = useRef7(null);
|
|
9537
|
-
const { formId, errors, hasSubmitted } =
|
|
9536
|
+
const { formId, errors, hasSubmitted } = useContext3(FormContext);
|
|
9538
9537
|
const isValid = Object.keys(errors).length === 0;
|
|
9539
9538
|
if (isValid || !hasSubmitted) {
|
|
9540
9539
|
return null;
|
|
@@ -9564,7 +9563,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9564
9563
|
};
|
|
9565
9564
|
|
|
9566
9565
|
// src/components/FormField/FormField.tsx
|
|
9567
|
-
import { Children as Children5, cloneElement as cloneElement5, useContext as
|
|
9566
|
+
import { Children as Children5, cloneElement as cloneElement5, useContext as useContext4 } from "react";
|
|
9568
9567
|
import styled36 from "styled-components";
|
|
9569
9568
|
import { isArray as isArray2, isNotNil as isNotNil17, isNotUndefined as isNotUndefined9, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
9570
9569
|
|
|
@@ -9629,7 +9628,7 @@ var Label = ({
|
|
|
9629
9628
|
Label.displayName = "Label";
|
|
9630
9629
|
|
|
9631
9630
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9632
|
-
import { createContext as
|
|
9631
|
+
import { createContext as createContext4, useMemo as useMemo5 } from "react";
|
|
9633
9632
|
|
|
9634
9633
|
// src/components/FormGroup/FormGroup.tsx
|
|
9635
9634
|
import styled35 from "styled-components";
|
|
@@ -9667,7 +9666,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
9667
9666
|
|
|
9668
9667
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9669
9668
|
import { jsx as jsx226 } from "react/jsx-runtime";
|
|
9670
|
-
var CheckboxGroupContext =
|
|
9669
|
+
var CheckboxGroupContext = createContext4(null);
|
|
9671
9670
|
var CheckboxGroup = ({
|
|
9672
9671
|
children,
|
|
9673
9672
|
name,
|
|
@@ -9760,8 +9759,8 @@ var FormField = ({
|
|
|
9760
9759
|
value,
|
|
9761
9760
|
...props
|
|
9762
9761
|
}) => {
|
|
9763
|
-
const formState =
|
|
9764
|
-
const checkboxGroup =
|
|
9762
|
+
const formState = useContext4(FormContext);
|
|
9763
|
+
const checkboxGroup = useContext4(CheckboxGroupContext);
|
|
9765
9764
|
const defaultValue = formState.values[name];
|
|
9766
9765
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9767
9766
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -9826,9 +9825,9 @@ var FormField = ({
|
|
|
9826
9825
|
FormField.displayName = "FormField";
|
|
9827
9826
|
|
|
9828
9827
|
// src/components/FormGroup/RadioGroup.tsx
|
|
9829
|
-
import { createContext as
|
|
9828
|
+
import { createContext as createContext5, useMemo as useMemo6 } from "react";
|
|
9830
9829
|
import { jsx as jsx228 } from "react/jsx-runtime";
|
|
9831
|
-
var RadioGroupContext =
|
|
9830
|
+
var RadioGroupContext = createContext5(null);
|
|
9832
9831
|
var RadioGroup = ({
|
|
9833
9832
|
children,
|
|
9834
9833
|
name,
|
|
@@ -9960,9 +9959,9 @@ import { isNotNil as isNotNil18, isNotUndefined as isNotUndefined10 } from "@wis
|
|
|
9960
9959
|
import { useMemo as useMemo7 } from "react";
|
|
9961
9960
|
|
|
9962
9961
|
// src/components/Menu/MenuContext.tsx
|
|
9963
|
-
import { createContext as
|
|
9964
|
-
var MenuContext =
|
|
9965
|
-
var useMenuContext = () =>
|
|
9962
|
+
import { createContext as createContext6, useContext as useContext5 } from "react";
|
|
9963
|
+
var MenuContext = createContext6({ compact: false });
|
|
9964
|
+
var useMenuContext = () => useContext5(MenuContext);
|
|
9966
9965
|
|
|
9967
9966
|
// src/components/Menu/Menu.tsx
|
|
9968
9967
|
import { jsx as jsx231, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
@@ -11110,9 +11109,9 @@ import { Root as ToggleGroupRoot } from "@radix-ui/react-toggle-group";
|
|
|
11110
11109
|
import { isNil as isNil14 } from "@wistia/type-guards";
|
|
11111
11110
|
|
|
11112
11111
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11113
|
-
import { createContext as
|
|
11112
|
+
import { createContext as createContext7, useContext as useContext6, useMemo as useMemo8, useState as useState11 } from "react";
|
|
11114
11113
|
import { jsx as jsx248 } from "react/jsx-runtime";
|
|
11115
|
-
var SelectedItemStyleContext =
|
|
11114
|
+
var SelectedItemStyleContext = createContext7(null);
|
|
11116
11115
|
var SelectedItemStyleProvider = ({
|
|
11117
11116
|
children
|
|
11118
11117
|
}) => {
|
|
@@ -11137,7 +11136,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11137
11136
|
return /* @__PURE__ */ jsx248(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11138
11137
|
};
|
|
11139
11138
|
var useSelectedItemStyle = () => {
|
|
11140
|
-
const context =
|
|
11139
|
+
const context = useContext6(SelectedItemStyleContext);
|
|
11141
11140
|
if (context === null) {
|
|
11142
11141
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11143
11142
|
}
|
|
@@ -11148,11 +11147,11 @@ var useSelectedItemStyle = () => {
|
|
|
11148
11147
|
import styled52 from "styled-components";
|
|
11149
11148
|
|
|
11150
11149
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11151
|
-
import { createContext as
|
|
11152
|
-
var SegmentedControlValueContext =
|
|
11150
|
+
import { createContext as createContext8, useContext as useContext7 } from "react";
|
|
11151
|
+
var SegmentedControlValueContext = createContext8(null);
|
|
11153
11152
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11154
11153
|
var useSegmentedControlValue = () => {
|
|
11155
|
-
const context =
|
|
11154
|
+
const context = useContext7(SegmentedControlValueContext);
|
|
11156
11155
|
if (context === null) {
|
|
11157
11156
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11158
11157
|
}
|
|
@@ -11764,8 +11763,8 @@ var Table = ({
|
|
|
11764
11763
|
import styled60 from "styled-components";
|
|
11765
11764
|
|
|
11766
11765
|
// src/components/Table/TableSectionContext.ts
|
|
11767
|
-
import { createContext as
|
|
11768
|
-
var TableSectionContext =
|
|
11766
|
+
import { createContext as createContext9 } from "react";
|
|
11767
|
+
var TableSectionContext = createContext9(null);
|
|
11769
11768
|
|
|
11770
11769
|
// src/components/Table/TableBody.tsx
|
|
11771
11770
|
import { jsx as jsx256 } from "react/jsx-runtime";
|
|
@@ -11775,7 +11774,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
11775
11774
|
};
|
|
11776
11775
|
|
|
11777
11776
|
// src/components/Table/TableCell.tsx
|
|
11778
|
-
import { useContext as
|
|
11777
|
+
import { useContext as useContext8 } from "react";
|
|
11779
11778
|
import styled61, { css as css36 } from "styled-components";
|
|
11780
11779
|
import { jsx as jsx257 } from "react/jsx-runtime";
|
|
11781
11780
|
var sharedStyles = css36`
|
|
@@ -11796,7 +11795,7 @@ var StyledTd = styled61.td`
|
|
|
11796
11795
|
line-height: var(--wui-typography-body-2-line-height);
|
|
11797
11796
|
`;
|
|
11798
11797
|
var TableCell = ({ children, ...props }) => {
|
|
11799
|
-
const section =
|
|
11798
|
+
const section = useContext8(TableSectionContext);
|
|
11800
11799
|
if (section === "head") {
|
|
11801
11800
|
return /* @__PURE__ */ jsx257(StyledTh, { ...props, children });
|
|
11802
11801
|
}
|
|
@@ -11889,11 +11888,11 @@ import { Trigger as RadixTab } from "@radix-ui/react-tabs";
|
|
|
11889
11888
|
import { isNotNil as isNotNil28 } from "@wistia/type-guards";
|
|
11890
11889
|
|
|
11891
11890
|
// src/components/Tabs/useTabsValue.tsx
|
|
11892
|
-
import { createContext as
|
|
11893
|
-
var TabsValueContext =
|
|
11891
|
+
import { createContext as createContext10, useContext as useContext9 } from "react";
|
|
11892
|
+
var TabsValueContext = createContext10(null);
|
|
11894
11893
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
11895
11894
|
var useTabsValue = () => {
|
|
11896
|
-
const context =
|
|
11895
|
+
const context = useContext9(TabsValueContext);
|
|
11897
11896
|
if (context === null) {
|
|
11898
11897
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
11899
11898
|
}
|