@wistia/ui 0.18.14-beta.3d78b4cc.f1b5721 → 0.18.14-beta.6abe6061.9b94192
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 +9 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +8 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, AnchorHTMLAttributes,
|
|
3
|
+
import { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, AnchorHTMLAttributes, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, HTMLAttributes, ForwardRefExoticComponent, RefAttributes, TdHTMLAttributes, ThHTMLAttributes, ComponentProps } from 'react';
|
|
4
4
|
import { UseFilePickerConfig, FilePickerReturnTypes, ExtractContentTypeFromConfig, useImperativeFilePickerConfig, ImperativeFilePickerReturnTypes } from 'use-file-picker/types';
|
|
5
5
|
export * from 'use-file-picker/types';
|
|
6
6
|
import { CollapsibleContentProps as CollapsibleContentProps$1 } from '@radix-ui/react-collapsible';
|
|
@@ -268,7 +268,7 @@ type LinkProps = LinkAsButtonProps | LinkAsLinkProps;
|
|
|
268
268
|
* This means in addition to its own props, `Link` can use props from `react-router`'s `Link` component. View their documentation [here](https://reactrouter.com/en/main/components/link).
|
|
269
269
|
* The one prop we ignore from react-router is `to`. We use `href` instead and map it under the hood.
|
|
270
270
|
*/
|
|
271
|
-
declare const Link: ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
271
|
+
declare const Link: react.ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
272
272
|
|
|
273
273
|
type Breakpoints = 'isLgAndDown' | 'isLgAndUp' | 'isMdAndDown' | 'isMdAndUp' | 'isSmAndDown' | 'isSmAndUp' | 'isXlAndDown' | 'isXlAndUp' | 'isXsAndDown' | 'isXsAndUp';
|
|
274
274
|
type AtLeastOneBreakpoint<T, U = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, AnchorHTMLAttributes,
|
|
3
|
+
import { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, AnchorHTMLAttributes, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, HTMLAttributes, ForwardRefExoticComponent, RefAttributes, TdHTMLAttributes, ThHTMLAttributes, ComponentProps } from 'react';
|
|
4
4
|
import { UseFilePickerConfig, FilePickerReturnTypes, ExtractContentTypeFromConfig, useImperativeFilePickerConfig, ImperativeFilePickerReturnTypes } from 'use-file-picker/types';
|
|
5
5
|
export * from 'use-file-picker/types';
|
|
6
6
|
import { CollapsibleContentProps as CollapsibleContentProps$1 } from '@radix-ui/react-collapsible';
|
|
@@ -268,7 +268,7 @@ type LinkProps = LinkAsButtonProps | LinkAsLinkProps;
|
|
|
268
268
|
* This means in addition to its own props, `Link` can use props from `react-router`'s `Link` component. View their documentation [here](https://reactrouter.com/en/main/components/link).
|
|
269
269
|
* The one prop we ignore from react-router is `to`. We use `href` instead and map it under the hood.
|
|
270
270
|
*/
|
|
271
|
-
declare const Link: ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
271
|
+
declare const Link: react.ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
272
272
|
|
|
273
273
|
type Breakpoints = 'isLgAndDown' | 'isLgAndUp' | 'isMdAndDown' | 'isMdAndUp' | 'isSmAndDown' | 'isSmAndUp' | 'isXlAndDown' | 'isXlAndUp' | 'isXsAndDown' | 'isXsAndUp';
|
|
274
274
|
type AtLeastOneBreakpoint<T, U = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.18.14-beta.
|
|
3
|
+
* @license @wistia/ui v0.18.14-beta.6abe6061.9b94192
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7762,19 +7762,9 @@ Icon.displayName = "Icon_UI";
|
|
|
7762
7762
|
// src/components/Link/Link.tsx
|
|
7763
7763
|
import { forwardRef } from "react";
|
|
7764
7764
|
import { styled as styled5 } from "styled-components";
|
|
7765
|
+
import { Link as RouterLink, useInRouterContext } from "react-router";
|
|
7765
7766
|
import { isFunction as isFunction2, isNil as isNil6, isNotNil as isNotNil5, isNotUndefined as isNotUndefined3, isUndefined as isUndefined2 } from "@wistia/type-guards";
|
|
7766
7767
|
import { jsx as jsx207, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
7767
|
-
var RouterLink = null;
|
|
7768
|
-
var useInRouterContext = () => false;
|
|
7769
|
-
var isRouterEnabled = false;
|
|
7770
|
-
import("react-router").then((module) => {
|
|
7771
|
-
RouterLink = module.Link;
|
|
7772
|
-
useInRouterContext = module.useInRouterContext;
|
|
7773
|
-
isRouterEnabled = true;
|
|
7774
|
-
return module;
|
|
7775
|
-
}).catch(() => {
|
|
7776
|
-
isRouterEnabled = false;
|
|
7777
|
-
});
|
|
7778
7768
|
var generateHref = (href, type, disabled) => {
|
|
7779
7769
|
if (disabled || isNil6(href)) {
|
|
7780
7770
|
return void 0;
|
|
@@ -7833,9 +7823,9 @@ var Link = forwardRef(
|
|
|
7833
7823
|
role,
|
|
7834
7824
|
...props
|
|
7835
7825
|
}, ref) => {
|
|
7836
|
-
const
|
|
7826
|
+
const inRouterContext = useInRouterContext();
|
|
7837
7827
|
const to = generateHref(props.href, type, disabled);
|
|
7838
|
-
const shouldUseReactRouterLink =
|
|
7828
|
+
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
7839
7829
|
const handleClick = async (event) => {
|
|
7840
7830
|
if (disabled) {
|
|
7841
7831
|
event.preventDefault();
|
|
@@ -7884,6 +7874,7 @@ var Link = forwardRef(
|
|
|
7884
7874
|
const externalLinkProps = type === "external" ? { target: "_blank", rel: "noopener noreferrer" } : null;
|
|
7885
7875
|
const routerSpecificProps = shouldUseReactRouterLink ? {
|
|
7886
7876
|
// TODO: Using 'any' here due to styled-components typing limitations with RouterLink
|
|
7877
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
7887
7878
|
as: RouterLink,
|
|
7888
7879
|
to: to ?? ""
|
|
7889
7880
|
} : {
|
|
@@ -8070,7 +8061,7 @@ var StyledActionButton = styled7(Button)`
|
|
|
8070
8061
|
min-width: 96px;
|
|
8071
8062
|
padding: var(--wui-space-03);
|
|
8072
8063
|
background: var(--wui-color-bg-surface-secondary);
|
|
8073
|
-
|
|
8064
|
+
row-gap: var(--wui-space-02);
|
|
8074
8065
|
border-radius: var(--wui-border-radius-03);
|
|
8075
8066
|
flex: 0 0 auto;
|
|
8076
8067
|
transition: background-color var(--wui-motion-duration-02) var(--wui-motion-ease);
|
|
@@ -10193,9 +10184,9 @@ var isClickableElement = (element) => {
|
|
|
10193
10184
|
};
|
|
10194
10185
|
var ClickRegion = ({ children, targetRef }) => {
|
|
10195
10186
|
useEffect9(() => {
|
|
10196
|
-
if (targetRef.current
|
|
10187
|
+
if (targetRef.current?.tagName === "A") {
|
|
10197
10188
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
10198
|
-
} else if (targetRef.current
|
|
10189
|
+
} else if (targetRef.current?.tagName === "BUTTON") {
|
|
10199
10190
|
targetRef.current.setAttribute("data-click-region-target-button", "");
|
|
10200
10191
|
} else {
|
|
10201
10192
|
}
|