@wistia/ui 0.14.28 → 0.14.29
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 +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.mjs +10 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1609,9 +1609,11 @@ type ContextMenuProps = {
|
|
|
1609
1609
|
x: number;
|
|
1610
1610
|
y: number;
|
|
1611
1611
|
};
|
|
1612
|
+
side?: 'bottom' | 'top';
|
|
1612
1613
|
triggerRef?: never;
|
|
1613
1614
|
} | {
|
|
1614
1615
|
position?: never;
|
|
1616
|
+
side?: never;
|
|
1615
1617
|
triggerRef: RefObject<HTMLElement>;
|
|
1616
1618
|
});
|
|
1617
1619
|
/**
|
|
@@ -1620,7 +1622,7 @@ type ContextMenuProps = {
|
|
|
1620
1622
|
* 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
|
|
1621
1623
|
* 2. By providing a `position` prop, which will render the menu at the specified coordinates.
|
|
1622
1624
|
*/
|
|
1623
|
-
declare const ContextMenu: ({ position, triggerRef, children, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1625
|
+
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1624
1626
|
|
|
1625
1627
|
type DataCardProps = ComponentPropsWithoutRef<'div'> & Partial<Pick<ButtonAsLinkProps, 'beforeAction' | 'disabled' | 'href' | 'onClick' | 'type'>> & {
|
|
1626
1628
|
/**
|
|
@@ -2635,10 +2637,6 @@ type UncontrolledMenuProps = {
|
|
|
2635
2637
|
};
|
|
2636
2638
|
type MenuControlProps = ControlledMenuProps | UncontrolledMenuProps;
|
|
2637
2639
|
type MenuProps = MenuControlProps & {
|
|
2638
|
-
/**
|
|
2639
|
-
* @ignore
|
|
2640
|
-
*/
|
|
2641
|
-
avoidCollisions?: boolean;
|
|
2642
2640
|
/**
|
|
2643
2641
|
* The position of the Menu
|
|
2644
2642
|
*/
|
|
@@ -2664,6 +2662,10 @@ type MenuProps = MenuControlProps & {
|
|
|
2664
2662
|
* Callback for when the user clicks or focuses outside of the menu
|
|
2665
2663
|
*/
|
|
2666
2664
|
onInteractOutside?: DropdownMenuContentProps['onInteractOutside'];
|
|
2665
|
+
/**
|
|
2666
|
+
* The side the menu appears on, relative to the trigger
|
|
2667
|
+
*/
|
|
2668
|
+
side?: 'bottom' | 'top';
|
|
2667
2669
|
/**
|
|
2668
2670
|
* Replace the default trigger with a custom button or other element
|
|
2669
2671
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1609,9 +1609,11 @@ type ContextMenuProps = {
|
|
|
1609
1609
|
x: number;
|
|
1610
1610
|
y: number;
|
|
1611
1611
|
};
|
|
1612
|
+
side?: 'bottom' | 'top';
|
|
1612
1613
|
triggerRef?: never;
|
|
1613
1614
|
} | {
|
|
1614
1615
|
position?: never;
|
|
1616
|
+
side?: never;
|
|
1615
1617
|
triggerRef: RefObject<HTMLElement>;
|
|
1616
1618
|
});
|
|
1617
1619
|
/**
|
|
@@ -1620,7 +1622,7 @@ type ContextMenuProps = {
|
|
|
1620
1622
|
* 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
|
|
1621
1623
|
* 2. By providing a `position` prop, which will render the menu at the specified coordinates.
|
|
1622
1624
|
*/
|
|
1623
|
-
declare const ContextMenu: ({ position, triggerRef, children, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1625
|
+
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1624
1626
|
|
|
1625
1627
|
type DataCardProps = ComponentPropsWithoutRef<'div'> & Partial<Pick<ButtonAsLinkProps, 'beforeAction' | 'disabled' | 'href' | 'onClick' | 'type'>> & {
|
|
1626
1628
|
/**
|
|
@@ -2635,10 +2637,6 @@ type UncontrolledMenuProps = {
|
|
|
2635
2637
|
};
|
|
2636
2638
|
type MenuControlProps = ControlledMenuProps | UncontrolledMenuProps;
|
|
2637
2639
|
type MenuProps = MenuControlProps & {
|
|
2638
|
-
/**
|
|
2639
|
-
* @ignore
|
|
2640
|
-
*/
|
|
2641
|
-
avoidCollisions?: boolean;
|
|
2642
2640
|
/**
|
|
2643
2641
|
* The position of the Menu
|
|
2644
2642
|
*/
|
|
@@ -2664,6 +2662,10 @@ type MenuProps = MenuControlProps & {
|
|
|
2664
2662
|
* Callback for when the user clicks or focuses outside of the menu
|
|
2665
2663
|
*/
|
|
2666
2664
|
onInteractOutside?: DropdownMenuContentProps['onInteractOutside'];
|
|
2665
|
+
/**
|
|
2666
|
+
* The side the menu appears on, relative to the trigger
|
|
2667
|
+
*/
|
|
2668
|
+
side?: 'bottom' | 'top';
|
|
2667
2669
|
/**
|
|
2668
2670
|
* Replace the default trigger with a custom button or other element
|
|
2669
2671
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.14.
|
|
3
|
+
* @license @wistia/ui v0.14.29
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -12314,19 +12314,19 @@ var Combobox2 = ({
|
|
|
12314
12314
|
};
|
|
12315
12315
|
|
|
12316
12316
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
12317
|
-
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
12318
12317
|
import { isNil as isNil15, isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
12318
|
+
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
12319
12319
|
|
|
12320
12320
|
// src/components/Menu/Menu.tsx
|
|
12321
|
-
import { forwardRef as forwardRef17, useMemo as useMemo12 } from "react";
|
|
12322
|
-
import styled51, { css as css30, keyframes as keyframes2 } from "styled-components";
|
|
12323
12321
|
import {
|
|
12324
12322
|
DropdownMenu,
|
|
12325
|
-
|
|
12323
|
+
DropdownMenuContent,
|
|
12326
12324
|
DropdownMenuPortal,
|
|
12327
|
-
|
|
12325
|
+
DropdownMenuTrigger
|
|
12328
12326
|
} from "@radix-ui/react-dropdown-menu";
|
|
12329
12327
|
import { isNotNil as isNotNil20, isNotUndefined as isNotUndefined9 } from "@wistia/type-guards";
|
|
12328
|
+
import { forwardRef as forwardRef17, useMemo as useMemo12 } from "react";
|
|
12329
|
+
import styled51, { css as css30, keyframes as keyframes2 } from "styled-components";
|
|
12330
12330
|
|
|
12331
12331
|
// src/components/Menu/MenuContext.tsx
|
|
12332
12332
|
import { createContext as createContext6, useContext as useContext5 } from "react";
|
|
@@ -12432,6 +12432,7 @@ var Menu = forwardRef17(
|
|
|
12432
12432
|
trigger,
|
|
12433
12433
|
label,
|
|
12434
12434
|
isOpen,
|
|
12435
|
+
side = "bottom",
|
|
12435
12436
|
triggerProps = {},
|
|
12436
12437
|
onOpenChange,
|
|
12437
12438
|
...props
|
|
@@ -12474,7 +12475,7 @@ var Menu = forwardRef17(
|
|
|
12474
12475
|
onFocusOutside: (event) => {
|
|
12475
12476
|
event.preventDefault();
|
|
12476
12477
|
},
|
|
12477
|
-
side
|
|
12478
|
+
side,
|
|
12478
12479
|
sideOffset: 6,
|
|
12479
12480
|
children
|
|
12480
12481
|
}
|
|
@@ -13001,6 +13002,7 @@ var ContextMenu = ({
|
|
|
13001
13002
|
position,
|
|
13002
13003
|
triggerRef,
|
|
13003
13004
|
children,
|
|
13005
|
+
side = "bottom",
|
|
13004
13006
|
onRequestClose = () => null
|
|
13005
13007
|
}) => {
|
|
13006
13008
|
const [isRightClicked, setIsRightClicked] = useState17(false);
|
|
@@ -13024,7 +13026,6 @@ var ContextMenu = ({
|
|
|
13024
13026
|
return isOpen ? /* @__PURE__ */ jsx265(
|
|
13025
13027
|
Menu,
|
|
13026
13028
|
{
|
|
13027
|
-
avoidCollisions: false,
|
|
13028
13029
|
isOpen,
|
|
13029
13030
|
onOpenChange: (next) => {
|
|
13030
13031
|
setIsRightClicked(next);
|
|
@@ -13032,6 +13033,7 @@ var ContextMenu = ({
|
|
|
13032
13033
|
onRequestClose();
|
|
13033
13034
|
}
|
|
13034
13035
|
},
|
|
13036
|
+
side,
|
|
13035
13037
|
trigger: /* @__PURE__ */ jsx265(
|
|
13036
13038
|
"button",
|
|
13037
13039
|
{
|