@voxel51/voodo 2.4.0-app-revamp.2 → 2.4.0-app-revamp.4

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.
@@ -8,6 +8,9 @@ type MenuAnchor = "bottom start" | "bottom end" | "top start" | "top end";
8
8
  * Pick the menu anchor based on whether the menu would overflow the
9
9
  * viewport when opened in the default `bottom start` direction.
10
10
  *
11
+ * @deprecated {@link ContextMenu} no longer uses this: Base UI flips the
12
+ * menu away from viewport edges itself. Kept only so the export does not
13
+ * break; it will be removed in the next major version.
11
14
  * @internal
12
15
  */
13
16
  export declare const pickAnchor: (cursor: {
@@ -36,9 +39,11 @@ export interface ContextMenuProps extends HTMLAttributes<HTMLDivElement> {
36
39
  * click outside, item selection, or Escape.
37
40
  *
38
41
  * Composes with the Menu primitives ({@link MenuTextItem},
39
- * {@link MenuIconTextItem}, {@link MenuCheckItem}, {@link MenuSectionTitle},
40
- * {@link MenuSeparator}). Built on HeadlessUI's `Menu`, so keyboard
41
- * navigation and ARIA `role="menu"` semantics work out of the box.
42
+ * {@link MenuIconTextItem}, {@link MenuCheckItem}, {@link MenuSubmenuItem},
43
+ * {@link MenuSectionTitle}, {@link MenuSeparator}). Built on Base UI's
44
+ * `ContextMenu`, so keyboard navigation, long-press on touch, and ARIA
45
+ * `role="menu"` semantics work out of the box. An `onContextMenu` handler
46
+ * that calls `preventDefault()` keeps the menu closed.
42
47
  *
43
48
  * @example
44
49
  * ```tsx
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,EAAE,EACP,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAOf;;;GAGG;AACH,KAAK,UAAU,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAU1E;;;;;GAKG;AACH,eAAO,M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tE,4EAA4E;IAC5E,QAAQ,EAAE,SAAS,CAAC;IACpB,wDAAwD;IACxD,IAAI,EAAE,SAAS,CAAC;IAChB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAkC5C,CAAC"}
@@ -2,9 +2,9 @@ import { FC, HTMLAttributes, ReactNode } from 'react';
2
2
  import { ZIndex } from '../../types';
3
3
  /**
4
4
  * Position of the dropdown menu panel relative to its trigger.
5
- * Values follow the `<edge> <alignment>` convention used by HeadlessUI's
6
- * floating UI — e.g. `BottomStart` opens the menu below the trigger,
7
- * left-aligned with it.
5
+ * Values follow the `<side> <alignment>` convention — e.g. `BottomStart`
6
+ * opens the menu below the trigger, left-aligned with it. The menu flips to
7
+ * the other side when it would leave the viewport.
8
8
  */
9
9
  export declare const DropdownAnchor: {
10
10
  /** Below the trigger, horizontally centered. */
@@ -35,7 +35,7 @@ export declare namespace DropdownAnchor {
35
35
  export interface DropdownProps extends HTMLAttributes<HTMLDivElement> {
36
36
  /**
37
37
  * The element that opens the dropdown when clicked.
38
- * Rendered inside a `MenuButton` wrapper — any focusable element works.
38
+ * Rendered inside the menu's trigger wrapper — any focusable element works.
39
39
  */
40
40
  trigger: ReactNode;
41
41
  /** Menu content. Use the Menu* primitive components as children. */
@@ -62,10 +62,11 @@ export interface DropdownProps extends HTMLAttributes<HTMLDivElement> {
62
62
  /**
63
63
  * A click-triggered menu component. Composes with the Menu primitives:
64
64
  * {@link MenuTextItem}, {@link MenuIconTextItem}, {@link MenuCheckItem},
65
- * {@link MenuSectionTitle}, and {@link MenuSeparator}.
65
+ * {@link MenuSubmenuItem}, {@link MenuSectionTitle}, and {@link MenuSeparator}.
66
66
  *
67
- * Built on HeadlessUI's `Menu`, providing full keyboard navigation
68
- * (arrow keys, Enter, Escape) and ARIA `role="menu"` semantics automatically.
67
+ * Built on Base UI's `Menu`, providing full keyboard navigation
68
+ * (arrow keys, Enter, Escape, type-ahead), nested menus through
69
+ * {@link MenuSubmenuItem}, and ARIA `role="menu"` semantics automatically.
69
70
  *
70
71
  * @example
71
72
  * ```tsx
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,EAAE,EACP,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,MAAM,EAAgB,MAAM,SAAS,CAAC;AAG/C;;;;;GAKG;AACH,eAAO,MAAM,cAAc;IACzB,gDAAgD;;IAEhD,gEAAgE;;IAEhE,+DAA+D;;IAE/D,gDAAgD;;IAEhD,gEAAgE;;IAEhE,+DAA+D;;CAEvD,CAAC;AACX,MAAM,MAAM,cAAc,GACxB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,EAAE,CAAC;AAE5D,yBAAiB,cAAc,CAAC;IAC9B,KAAY,MAAM,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC;IAClD,KAAY,WAAW,GAAG,OAAO,cAAc,CAAC,WAAW,CAAC;IAC5D,KAAY,SAAS,GAAG,OAAO,cAAc,CAAC,SAAS,CAAC;IACxD,KAAY,GAAG,GAAG,OAAO,cAAc,CAAC,GAAG,CAAC;IAC5C,KAAY,QAAQ,GAAG,OAAO,cAAc,CAAC,QAAQ,CAAC;IACtD,KAAY,MAAM,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IACnE;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB,oEAAoE;IACpE,QAAQ,EAAE,SAAS,CAAC;IACpB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;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;IACnB,oEAAoE;IACpE,QAAQ,EAAE,SAAS,CAAC;IACpB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0HAA0H;IAC1H,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAsEtC,CAAC"}
@@ -12,6 +12,7 @@ export interface MenuCheckItemProps extends HTMLAttributes<HTMLButtonElement> {
12
12
  * A selectable menu item with a leading checkmark indicator.
13
13
  * The checkmark is shown when `checked` is `true`; otherwise the slot is empty
14
14
  * but reserved so that text alignment stays consistent across items.
15
+ * Clicking it runs `onClick` and keeps the menu open.
15
16
  *
16
17
  * @example
17
18
  * ```tsx
@@ -1 +1 @@
1
- {"version":3,"file":"MenuCheckItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuCheckItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAiBhD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC3E,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA6ChD,CAAC"}
1
+ {"version":3,"file":"MenuCheckItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuCheckItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAShD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC3E,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA6ChD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuIconTextItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuIconTextItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK3D,OAAO,EAML,QAAQ,EAKT,MAAM,SAAS,CAAC;AAKjB;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC9E;;;;OAIG;IACH,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5C,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6IAA6I;IAC7I,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAsFtD,CAAC"}
1
+ {"version":3,"file":"MenuIconTextItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuIconTextItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3D,OAAO,EAEL,QAAQ,EAIT,MAAM,SAAS,CAAC;AAOjB;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC9E;;;;OAIG;IACH,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5C,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6IAA6I;IAC7I,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAoEtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuSectionTitle.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuSectionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAMhD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC3E,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAiBtD,CAAC"}
1
+ {"version":3,"file":"MenuSectionTitle.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuSectionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAMhD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC3E,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAwBtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuSeparator.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuSeparator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAKhD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAehD,CAAC"}
1
+ {"version":3,"file":"MenuSeparator.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuSeparator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAKhD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAgBhD,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import { IconName } from '../../types';
3
+ /**
4
+ * Props for {@link MenuSubmenuItem}.
5
+ */
6
+ export interface MenuSubmenuItemProps extends HTMLAttributes<HTMLDivElement> {
7
+ /**
8
+ * Icon to display to the left of the text content. A legacy
9
+ * {@link IconName} string renders through the deprecated map-based
10
+ * {@link Icon}.
11
+ */
12
+ icon: IconName | Exclude<ReactNode, string>;
13
+ /** Primary label text. */
14
+ text: string;
15
+ /** Optional secondary description shown below the primary text. */
16
+ subtext?: string;
17
+ /** If `true`, the submenu cannot be opened and the row is rendered in a muted style. */
18
+ disabled?: boolean;
19
+ /** Items of the nested menu. Use the Menu* primitive components. */
20
+ children: ReactNode;
21
+ }
22
+ /**
23
+ * A menu row that opens a flyout of items beside it instead of running an
24
+ * action. Use it inside a {@link Dropdown} or {@link ContextMenu}.
25
+ *
26
+ * Built on Base UI's nested menu: it opens on hover, click, Enter or
27
+ * ArrowRight, closes on ArrowLeft or Escape, flips to the other side when it
28
+ * would leave the viewport, and selecting an item in the flyout closes the
29
+ * whole menu.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * <Dropdown trigger={<DropdownTrigger>Layout</DropdownTrigger>}>
34
+ * <MenuIconTextItem icon={<ImageSearchIcon />} text="Image" />
35
+ * <MenuSubmenuItem icon={<PuzzleIcon />} text="Plugins">
36
+ * <MenuTextItem onClick={() => {}}>Histograms</MenuTextItem>
37
+ * <MenuTextItem onClick={() => {}}>Embeddings</MenuTextItem>
38
+ * </MenuSubmenuItem>
39
+ * </Dropdown>
40
+ * ```
41
+ *
42
+ * @param icon An icon element (e.g. `<PuzzleIcon />`) rendered in the leading slot; a legacy {@link IconName} is still accepted.
43
+ * @param text The primary label for the row.
44
+ * @param subtext An optional secondary line rendered below the primary text in muted color.
45
+ * @param disabled If `true`, the submenu cannot be opened.
46
+ * @param children The flyout's items — use the Menu* primitive components.
47
+ * @param className `class` overrides to apply to the row.
48
+ * @param props Additional HTML properties to apply to the row.
49
+ */
50
+ export declare const MenuSubmenuItem: FC<MenuSubmenuItemProps>;
51
+ //# sourceMappingURL=MenuSubmenuItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuSubmenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuSubmenuItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3D,OAAO,EAIL,QAAQ,EAMT,MAAM,SAAS,CAAC;AAejB;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC1E;;;;OAIG;IACH,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5C,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAyFpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuTextItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuTextItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAehD;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC1E,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kIAAkI;IAClI,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAqD9C,CAAC"}
1
+ {"version":3,"file":"MenuTextItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuTextItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAQhD;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC1E,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kIAAkI;IAClI,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA+B9C,CAAC"}
@@ -2,6 +2,7 @@ export * from './MenuCheckItem';
2
2
  export * from './MenuIconTextItem';
3
3
  export * from './MenuSectionTitle';
4
4
  export * from './MenuSeparator';
5
+ export * from './MenuSubmenuItem';
5
6
  export * from './MenuTextItem';
6
7
  export * from './styles';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
@@ -5,4 +5,32 @@
5
5
  * and focus outline reset that define the menu's visual identity.
6
6
  */
7
7
  export declare const menuPanelStyles: () => string;
8
+ /**
9
+ * Panel styles for action menus (Dropdown, ContextMenu, submenu flyouts):
10
+ * {@link menuPanelStyles} plus the width floor of the Figma ActionMenu, so a
11
+ * menu of short labels is not squeezed to a sliver. Lists sized to an input,
12
+ * such as Combobox, keep the plain panel styles.
13
+ *
14
+ * @internal
15
+ */
16
+ export declare const actionMenuPanelStyles: () => string;
17
+ /**
18
+ * State the menu row styles depend on. Base UI reports `highlighted` for
19
+ * both pointer hover and keyboard focus, so one flag drives the fill.
20
+ *
21
+ * @internal
22
+ */
23
+ export interface MenuRowState {
24
+ readonly highlighted: boolean;
25
+ readonly disabled: boolean;
26
+ }
27
+ /**
28
+ * Shared row styles for menu items (text, icon-text, check and submenu rows).
29
+ *
30
+ * Figma Action Menu Row: 6/10 padding, radius 8, bg/card-nested fill on
31
+ * hover and focus. Destructive rows fill danger-default with white content.
32
+ *
33
+ * @internal
34
+ */
35
+ export declare const menuRowStyles: ({ highlighted, disabled }: MenuRowState, destructive?: boolean) => string;
8
36
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/styles.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAO,MAoBhC,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/styles.ts"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAO,MAoBhC,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,QAAO,MAED,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GACxB,2BAA2B,YAAY,EACvC,qBAAmB,KAClB,MAgBA,CAAC"}
@@ -3,6 +3,8 @@ import { Anchor, Shadow } from '../../types';
3
3
  export type TooltipAnchor = `${Extract<Anchor, Anchor.Top | Anchor.Right | Anchor.Bottom | Anchor.Left>}`;
4
4
  export interface TooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, "content"> {
5
5
  anchor?: TooltipAnchor;
6
+ avoidCollisions?: boolean;
7
+ collisionPadding?: number;
6
8
  content: ReactNode;
7
9
  interactive?: boolean;
8
10
  portal?: boolean;
@@ -10,7 +12,10 @@ export interface TooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, "cont
10
12
  wrapperClassName?: string;
11
13
  }
12
14
  /**
13
- * A tooltip which appears when hovering over the wrapped content.
15
+ * A tooltip which appears when hovering over the wrapped content. It stays
16
+ * inside the viewport: it flips to the opposite side when its own side has no
17
+ * room, slides along that side near an edge with its arrow still on the
18
+ * content, and follows the content on scroll and resize.
14
19
  *
15
20
  * @example
16
21
  * ```tsx
@@ -19,15 +24,17 @@ export interface TooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, "cont
19
24
  * </Tooltip>
20
25
  * ```
21
26
  *
22
- * @param anchor Position of the tooltip relative to its content: `"top"`, `"right"`, `"bottom"` or `"left"`. Defaults to `"top"`. See {@link TooltipAnchor}.
27
+ * @param anchor Preferred position of the tooltip relative to its content: `"top"`, `"right"`, `"bottom"` or `"left"`. Defaults to `"top"`. See {@link TooltipAnchor}.
28
+ * @param avoidCollisions If `true` (the default), the tooltip flips and shifts to stay inside the viewport.
29
+ * @param collisionPadding Minimum distance, in pixels, kept between the tooltip and the viewport edge. Defaults to `8`.
23
30
  * @param content The content of the tooltip.
24
31
  * @param children The content which this component wraps; this acts as the element anchor and the hover trigger.
25
32
  * @param className `class` overrides to apply to the tooltip panel.
26
33
  * @param interactive If `true`, the tooltip stays open while the pointer moves from the content
27
34
  * into the panel, so the panel can hold links or buttons.
28
- * @param portal If `true`, renders the tooltip via a React portal into `document.body` with an
29
- * above-modal z-index, so it escapes ancestor stacking contexts (e.g. inside modals). The default
30
- * tooltip already uses fixed positioning, so it is never clipped by overflow-hidden/scroll ancestors.
35
+ * @param portal If `true` (the default), renders the tooltip via a React portal into `document.body`
36
+ * with an above-modal z-index, so no ancestor's overflow, transform or stacking context can clip
37
+ * or bury it. With `false` the panel renders in place with fixed positioning.
31
38
  * @param shadow The shadow to apply to the tooltip. See {@link Shadow}.
32
39
  * @param wrapperClassName Additional classes to apply to the outer wrapper element.
33
40
  * @param props Additional HTML properties to apply to the component.
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,EAAE,EACP,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAMf,OAAO,EACL,MAAM,EAI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