@wistia/ui 0.18.13-beta.c18b7ca6.8e50fcb → 0.18.14-beta.3d78b4cc.f1b5721
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 +15 -6
- 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 +14 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, HTMLAttributes,
|
|
3
|
+
import { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, AnchorHTMLAttributes, ForwardRefExoticComponent, RefAttributes, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, HTMLAttributes, 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:
|
|
271
|
+
declare const Link: ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & 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, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, HTMLAttributes,
|
|
3
|
+
import { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, AnchorHTMLAttributes, ForwardRefExoticComponent, RefAttributes, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, HTMLAttributes, 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:
|
|
271
|
+
declare const Link: ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & 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.
|
|
3
|
+
* @license @wistia/ui v0.18.14-beta.3d78b4cc.f1b5721
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -7762,9 +7762,19 @@ 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";
|
|
7766
7765
|
import { isFunction as isFunction2, isNil as isNil6, isNotNil as isNotNil5, isNotUndefined as isNotUndefined3, isUndefined as isUndefined2 } from "@wistia/type-guards";
|
|
7767
7766
|
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
|
+
});
|
|
7768
7778
|
var generateHref = (href, type, disabled) => {
|
|
7769
7779
|
if (disabled || isNil6(href)) {
|
|
7770
7780
|
return void 0;
|
|
@@ -7823,9 +7833,9 @@ var Link = forwardRef(
|
|
|
7823
7833
|
role,
|
|
7824
7834
|
...props
|
|
7825
7835
|
}, ref) => {
|
|
7826
|
-
const
|
|
7836
|
+
const isInRouterContext = useInRouterContext();
|
|
7827
7837
|
const to = generateHref(props.href, type, disabled);
|
|
7828
|
-
const shouldUseReactRouterLink =
|
|
7838
|
+
const shouldUseReactRouterLink = isInRouterContext && isRouterEnabled && type !== "external" && !to?.startsWith("http");
|
|
7829
7839
|
const handleClick = async (event) => {
|
|
7830
7840
|
if (disabled) {
|
|
7831
7841
|
event.preventDefault();
|
|
@@ -7874,7 +7884,6 @@ var Link = forwardRef(
|
|
|
7874
7884
|
const externalLinkProps = type === "external" ? { target: "_blank", rel: "noopener noreferrer" } : null;
|
|
7875
7885
|
const routerSpecificProps = shouldUseReactRouterLink ? {
|
|
7876
7886
|
// 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
|
|
7878
7887
|
as: RouterLink,
|
|
7879
7888
|
to: to ?? ""
|
|
7880
7889
|
} : {
|