@wistia/ui 0.15.12-beta.3ecc0076.d529776 → 0.15.12-beta.4ccc4307.9870827
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 +6 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +6 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1634,6 +1634,10 @@ declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchVa
|
|
|
1634
1634
|
type ContextMenuProps = {
|
|
1635
1635
|
children: ReactNode;
|
|
1636
1636
|
onRequestClose?: () => void;
|
|
1637
|
+
/**
|
|
1638
|
+
* If the menu is compact
|
|
1639
|
+
*/
|
|
1640
|
+
compact?: boolean;
|
|
1637
1641
|
} & ({
|
|
1638
1642
|
position: {
|
|
1639
1643
|
x: number;
|
|
@@ -1652,7 +1656,7 @@ type ContextMenuProps = {
|
|
|
1652
1656
|
* 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
|
|
1653
1657
|
* 2. By providing a `position` prop, which will render the menu at the specified coordinates.
|
|
1654
1658
|
*/
|
|
1655
|
-
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1659
|
+
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, compact, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1656
1660
|
|
|
1657
1661
|
type DataCardProps = ComponentPropsWithoutRef<'div'> & Partial<Pick<ButtonAsLinkProps, 'beforeAction' | 'disabled' | 'href' | 'onClick' | 'type'>> & {
|
|
1658
1662
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1634,6 +1634,10 @@ declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchVa
|
|
|
1634
1634
|
type ContextMenuProps = {
|
|
1635
1635
|
children: ReactNode;
|
|
1636
1636
|
onRequestClose?: () => void;
|
|
1637
|
+
/**
|
|
1638
|
+
* If the menu is compact
|
|
1639
|
+
*/
|
|
1640
|
+
compact?: boolean;
|
|
1637
1641
|
} & ({
|
|
1638
1642
|
position: {
|
|
1639
1643
|
x: number;
|
|
@@ -1652,7 +1656,7 @@ type ContextMenuProps = {
|
|
|
1652
1656
|
* 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
|
|
1653
1657
|
* 2. By providing a `position` prop, which will render the menu at the specified coordinates.
|
|
1654
1658
|
*/
|
|
1655
|
-
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1659
|
+
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, compact, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1656
1660
|
|
|
1657
1661
|
type DataCardProps = ComponentPropsWithoutRef<'div'> & Partial<Pick<ButtonAsLinkProps, 'beforeAction' | 'disabled' | 'href' | 'onClick' | 'type'>> & {
|
|
1658
1662
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.15.12-beta.
|
|
3
|
+
* @license @wistia/ui v0.15.12-beta.4ccc4307.9870827
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -12835,7 +12835,6 @@ var Combobox2 = ({
|
|
|
12835
12835
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
12836
12836
|
import { isNil as isNil15, isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
12837
12837
|
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
12838
|
-
import { createPortal } from "react-dom";
|
|
12839
12838
|
|
|
12840
12839
|
// src/components/Menu/Menu.tsx
|
|
12841
12840
|
import {
|
|
@@ -13517,7 +13516,8 @@ var ContextMenu = ({
|
|
|
13517
13516
|
triggerRef,
|
|
13518
13517
|
children,
|
|
13519
13518
|
side = "bottom",
|
|
13520
|
-
onRequestClose = () => null
|
|
13519
|
+
onRequestClose = () => null,
|
|
13520
|
+
compact = false
|
|
13521
13521
|
}) => {
|
|
13522
13522
|
const [isRightClicked, setIsRightClicked] = useState17(false);
|
|
13523
13523
|
const [menuPosition, setMenuPosition] = useState17(position ?? { x: 0, y: 0 });
|
|
@@ -13537,12 +13537,10 @@ var ContextMenu = ({
|
|
|
13537
13537
|
return () => null;
|
|
13538
13538
|
}, [position, triggerRef]);
|
|
13539
13539
|
const isOpen = isNotNil24(position) || isRightClicked;
|
|
13540
|
-
|
|
13541
|
-
return null;
|
|
13542
|
-
}
|
|
13543
|
-
const menu = /* @__PURE__ */ jsx267(
|
|
13540
|
+
return isOpen ? /* @__PURE__ */ jsx267(
|
|
13544
13541
|
Menu,
|
|
13545
13542
|
{
|
|
13543
|
+
compact,
|
|
13546
13544
|
isOpen,
|
|
13547
13545
|
onOpenChange: (next) => {
|
|
13548
13546
|
setIsRightClicked(next);
|
|
@@ -13568,11 +13566,7 @@ var ContextMenu = ({
|
|
|
13568
13566
|
),
|
|
13569
13567
|
children
|
|
13570
13568
|
}
|
|
13571
|
-
);
|
|
13572
|
-
if (isNotNil24(triggerRef)) {
|
|
13573
|
-
return createPortal(menu, document.body);
|
|
13574
|
-
}
|
|
13575
|
-
return menu;
|
|
13569
|
+
) : null;
|
|
13576
13570
|
};
|
|
13577
13571
|
|
|
13578
13572
|
// src/components/DataCards/DataCard.tsx
|