@hanzo/ui 8.0.6 → 8.0.7

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.
Files changed (33) hide show
  1. package/package.json +5 -1
  2. package/src/product/ComboBox.tsx +49 -69
  3. package/src/product/SelectMenu.tsx +23 -37
  4. package/src/product/ThemeToggle.tsx +121 -11
  5. package/src/product/ThemeToggleNext.tsx +27 -0
  6. package/src/product/index.ts +6 -0
  7. package/src/product/menu/ContextMenu.tsx +114 -0
  8. package/src/product/menu/DropdownMenu.tsx +76 -0
  9. package/src/product/menu/index.ts +15 -0
  10. package/src/product/menu/items.tsx +230 -0
  11. package/src/product/menu/portal-theme.tsx +33 -0
  12. package/src/product/menu/roving.ts +34 -0
  13. package/types/product/ComboBox.d.ts.map +1 -1
  14. package/types/product/SelectMenu.d.ts +8 -5
  15. package/types/product/SelectMenu.d.ts.map +1 -1
  16. package/types/product/ThemeToggle.d.ts +21 -1
  17. package/types/product/ThemeToggle.d.ts.map +1 -1
  18. package/types/product/ThemeToggleNext.d.ts +5 -0
  19. package/types/product/ThemeToggleNext.d.ts.map +1 -0
  20. package/types/product/index.d.ts +2 -0
  21. package/types/product/index.d.ts.map +1 -1
  22. package/types/product/menu/ContextMenu.d.ts +24 -0
  23. package/types/product/menu/ContextMenu.d.ts.map +1 -0
  24. package/types/product/menu/DropdownMenu.d.ts +34 -0
  25. package/types/product/menu/DropdownMenu.d.ts.map +1 -0
  26. package/types/product/menu/index.d.ts +5 -0
  27. package/types/product/menu/index.d.ts.map +1 -0
  28. package/types/product/menu/items.d.ts +69 -0
  29. package/types/product/menu/items.d.ts.map +1 -0
  30. package/types/product/menu/portal-theme.d.ts +29 -0
  31. package/types/product/menu/portal-theme.d.ts.map +1 -0
  32. package/types/product/menu/roving.d.ts +9 -0
  33. package/types/product/menu/roving.d.ts.map +1 -0
@@ -0,0 +1,230 @@
1
+ 'use client'
2
+
3
+ /**
4
+ * The ONE menu-item spec — every menu across the fleet renders through these
5
+ * presentational primitives, so DropdownMenu, ContextMenu, SelectMenu and ComboBox
6
+ * are pixel-identical. Geometry is literal px on a strict 8-grid (never random);
7
+ * colour is theme-adaptive tokens ($color2/$color11/$color12/$borderColor) so light
8
+ * and dark both work, with the single purple accent supplied by the brand CSS vars.
9
+ *
10
+ * Style props use the @hanzo/gui config shorthands (bg/items/justify/px/py/p/mx/my/
11
+ * minW/maxH/rounded/select/shrink) — the config omits the longhand aliases.
12
+ *
13
+ * Panel — bg $color2 (#111 dark), hairline border, radius 12, inner pad 4, subtle
14
+ * border+ambient elevation.
15
+ * Item — height 30 (28–32 band), px 8, gap 8, radius 7; icon in a fixed 16px slot
16
+ * on the left; label 13px $color12; right affordance (shortcut / check /
17
+ * chevron) right-aligned. States: hover/active/focus → accent-soft, focus
18
+ * visible; selected → check + purple; disabled → muted, no hover.
19
+ * Separator — 1px hairline, 4px vertical margin.
20
+ * Label — 11px uppercase muted section header, px 8.
21
+ */
22
+ import type { ReactNode, KeyboardEvent } from 'react'
23
+ import { Text, XStack, YStack } from '@hanzo/gui'
24
+ import { Check, ChevronRight } from '@hanzogui/lucide-icons-2'
25
+
26
+ // ── Geometry — literal px, 8-grid ──────────────────────────────────────────────
27
+ const ITEM_MIN_HEIGHT = 30
28
+ const ITEM_RADIUS = 7
29
+ const ITEM_PX = 8
30
+ const ITEM_GAP = 8
31
+ const ICON_SLOT = 16
32
+ export const PANEL_RADIUS = 12
33
+ export const PANEL_PAD = 4
34
+ const PANEL_GAP = 2
35
+ const SEP_MARGIN = 4
36
+ const FONT_LABEL = 13
37
+ const FONT_MUTED = 11
38
+ const FONT_SHORTCUT = 12
39
+
40
+ // ── Colour — brand purple accent via CSS vars (fallbacks keep it correct even when
41
+ // @hanzo/brand is not loaded, e.g. a bare Vite/Tauri host); everything else uses
42
+ // theme-adaptive Tamagui tokens. ──────────────────────────────────────────────
43
+ const ACCENT = 'var(--hanzo-accent, #8b5cf6)'
44
+ const ACCENT_SOFT = 'var(--hanzo-accent-soft, rgba(139,92,246,0.16))'
45
+ const DANGER = 'var(--hanzo-danger, #ef4444)'
46
+
47
+ // ── Declarative item model ──────────────────────────────────────────────────────
48
+ export type MenuItemSpec =
49
+ | {
50
+ type?: 'item'
51
+ /** Stable key. */
52
+ key: string
53
+ label: string
54
+ /** Leading Lucide icon (16px, unfilled) in the fixed left slot. */
55
+ icon?: ReactNode
56
+ /** Second muted line under the label (e.g. an id or hint). */
57
+ description?: string
58
+ /** Right-aligned shortcut / hint text (e.g. "⌘K"). */
59
+ shortcut?: string
60
+ /** Renders a right check + purple tint. */
61
+ selected?: boolean
62
+ disabled?: boolean
63
+ /** Danger styling (red label/icon). */
64
+ destructive?: boolean
65
+ /** Renders a right chevron (submenu / drill-in affordance). */
66
+ hasSubmenu?: boolean
67
+ onSelect: () => void
68
+ /** Keep the menu open after selecting (default: close). */
69
+ closeOnSelect?: boolean
70
+ }
71
+ | { type: 'separator'; key?: string }
72
+ | { type: 'label'; key?: string; label: string }
73
+
74
+ // ── Surface ───────────────────────────────────────────────────────────────────
75
+ export function MenuPanel({
76
+ children,
77
+ minWidth = 200,
78
+ maxHeight = 360,
79
+ onKeyDown,
80
+ panelRef,
81
+ ...rest
82
+ }: {
83
+ children: ReactNode
84
+ minWidth?: number
85
+ maxHeight?: number
86
+ onKeyDown?: (e: KeyboardEvent) => void
87
+ /** Web DOM node of the panel (for measuring / edge-flip). */
88
+ panelRef?: (node: HTMLElement | null) => void
89
+ [key: string]: unknown
90
+ }) {
91
+ return (
92
+ <YStack
93
+ // Web DOM ref; Gui forwards it to the underlying node. Cast (not @ts-expect-error)
94
+ // so it is env-agnostic — the ref type is strict under the pkg build, loose here.
95
+ ref={panelRef as never}
96
+ role="menu"
97
+ bg="$color2"
98
+ borderColor="$borderColor"
99
+ borderWidth={1}
100
+ rounded={PANEL_RADIUS}
101
+ p={PANEL_PAD}
102
+ gap={PANEL_GAP}
103
+ minW={minWidth}
104
+ maxH={maxHeight}
105
+ overflow="scroll"
106
+ // Subtle border + ambient elevation, minimal shadow.
107
+ shadowColor="rgba(0,0,0,0.45)"
108
+ shadowRadius={20}
109
+ shadowOffset={{ width: 0, height: 10 }}
110
+ onKeyDown={onKeyDown as never}
111
+ {...rest}
112
+ >
113
+ {children}
114
+ </YStack>
115
+ )
116
+ }
117
+
118
+ // ── Item — the ONE row ──────────────────────────────────────────────────────────
119
+ export function MenuItemView({
120
+ icon,
121
+ label,
122
+ description,
123
+ shortcut,
124
+ selected = false,
125
+ disabled = false,
126
+ destructive = false,
127
+ hasSubmenu = false,
128
+ onSelect,
129
+ }: Omit<Extract<MenuItemSpec, { type?: 'item' }>, 'key' | 'type' | 'closeOnSelect'>) {
130
+ const press = () => {
131
+ if (!disabled) onSelect()
132
+ }
133
+ const onKeyDown = (e: KeyboardEvent) => {
134
+ if (disabled) return
135
+ if (e.key === 'Enter' || e.key === ' ') {
136
+ e.preventDefault()
137
+ onSelect()
138
+ }
139
+ }
140
+ const labelColor = destructive ? DANGER : '$color12'
141
+ return (
142
+ <XStack
143
+ role="menuitem"
144
+ tabIndex={disabled ? -1 : 0}
145
+ aria-disabled={disabled || undefined}
146
+ items="center"
147
+ gap={ITEM_GAP}
148
+ px={ITEM_PX}
149
+ minH={ITEM_MIN_HEIGHT}
150
+ rounded={ITEM_RADIUS}
151
+ cursor={disabled ? 'default' : 'pointer'}
152
+ opacity={disabled ? 0.4 : 1}
153
+ select="none"
154
+ style={{ outline: 'none' }}
155
+ hoverStyle={disabled ? {} : { bg: ACCENT_SOFT as never }}
156
+ pressStyle={disabled ? {} : { bg: ACCENT_SOFT as never }}
157
+ focusStyle={disabled ? {} : { bg: ACCENT_SOFT as never }}
158
+ onPress={press}
159
+ onKeyDown={onKeyDown as never}
160
+ >
161
+ <XStack width={ICON_SLOT} height={ICON_SLOT} items="center" justify="center" shrink={0}>
162
+ {icon ? (
163
+ <XStack items="center" justify="center" opacity={destructive ? 1 : 0.9} style={destructive ? { color: DANGER } : undefined}>
164
+ {icon}
165
+ </XStack>
166
+ ) : null}
167
+ </XStack>
168
+
169
+ <YStack flex={1} minW={0}>
170
+ <Text fontSize={FONT_LABEL} lineHeight={18} color={labelColor as never} numberOfLines={1}>
171
+ {label}
172
+ </Text>
173
+ {description ? (
174
+ <Text fontSize={FONT_MUTED} lineHeight={14} color="$color11" numberOfLines={1}>
175
+ {description}
176
+ </Text>
177
+ ) : null}
178
+ </YStack>
179
+
180
+ {shortcut ? (
181
+ <Text fontSize={FONT_SHORTCUT} color="$color11" shrink={0}>
182
+ {shortcut}
183
+ </Text>
184
+ ) : null}
185
+ {selected ? <Check size={14} color={ACCENT} /> : null}
186
+ {hasSubmenu ? <ChevronRight size={14} color="var(--hanzo-muted, currentColor)" opacity={0.6} /> : null}
187
+ </XStack>
188
+ )
189
+ }
190
+
191
+ // ── Separator ───────────────────────────────────────────────────────────────────
192
+ export function MenuSeparatorView() {
193
+ return <YStack height={1} bg="$borderColor" my={SEP_MARGIN} mx={SEP_MARGIN} role="separator" />
194
+ }
195
+
196
+ // ── Section label ────────────────────────────────────────────────────────────────
197
+ export function MenuLabelView({ children }: { children: ReactNode }) {
198
+ return (
199
+ <Text
200
+ fontSize={FONT_MUTED}
201
+ color="$color11"
202
+ px={ITEM_PX}
203
+ py={SEP_MARGIN}
204
+ textTransform="uppercase"
205
+ letterSpacing={0.4}
206
+ select="none"
207
+ >
208
+ {children}
209
+ </Text>
210
+ )
211
+ }
212
+
213
+ // ── The single render path shared by every menu ──────────────────────────────────
214
+ export function renderMenuItems(items: MenuItemSpec[], close?: () => void): ReactNode {
215
+ return items.map((it, i) => {
216
+ if (it.type === 'separator') return <MenuSeparatorView key={it.key ?? `sep-${i}`} />
217
+ if (it.type === 'label') return <MenuLabelView key={it.key ?? `lbl-${i}`}>{it.label}</MenuLabelView>
218
+ const { key, onSelect, closeOnSelect = true, ...rest } = it
219
+ return (
220
+ <MenuItemView
221
+ key={key}
222
+ {...rest}
223
+ onSelect={() => {
224
+ onSelect()
225
+ if (closeOnSelect) close?.()
226
+ }}
227
+ />
228
+ )
229
+ })
230
+ }
@@ -0,0 +1,33 @@
1
+ 'use client'
2
+
3
+ /**
4
+ * PortalTheme — the ONE fix for "themed content escapes its theme through a portal".
5
+ *
6
+ * @hanzo/gui's `Popover.Content` and `Portal` render their children in a SEPARATE
7
+ * React subtree (a Gorhom-style portal host mounted at the app root), NOT via
8
+ * `ReactDOM.createPortal`. React context therefore does NOT flow from the trigger's
9
+ * location to the host. Under a nested `<Theme name="dark">` the portaled content
10
+ * lands OUTSIDE that theme context and Tamagui throws "Missing theme" (or renders
11
+ * unthemed).
12
+ *
13
+ * The fix is two-part and must stay two-part:
14
+ * 1. At the TRIGGER site (theme context still available) capture the resolved
15
+ * theme name with `useThemeName()`.
16
+ * 2. INSIDE the portaled content re-apply it: `<PortalTheme name={captured}>`.
17
+ *
18
+ * Every portal-backed menu in this package (DropdownMenu, ContextMenu, SelectMenu,
19
+ * ComboBox) uses this so a menu renders identically whether it is opened under the
20
+ * root theme or under any nested `<Theme>`, light or dark.
21
+ */
22
+ import type { ReactNode } from 'react'
23
+ import { Theme, useThemeName } from '@hanzo/gui'
24
+
25
+ /** Capture the current resolved theme name at the trigger site. Re-exported so the
26
+ * capture + re-apply pair reads from one module. */
27
+ export { useThemeName }
28
+
29
+ export function PortalTheme({ name, children }: { name: string; children: ReactNode }) {
30
+ // `name` is the resolved theme name (e.g. "dark", or a compound "dark_purple").
31
+ // Tamagui's `Theme` accepts the resolved name and reconstructs the context.
32
+ return <Theme name={name as never}>{children}</Theme>
33
+ }
@@ -0,0 +1,34 @@
1
+ 'use client'
2
+
3
+ /**
4
+ * Roving keyboard focus for a menu panel — ArrowUp/Down move focus between enabled
5
+ * `[role="menuitem"]` children, Home/End jump to ends, Escape closes. Web/desktop
6
+ * only (guards on `document`); native menus have no pointer-keyboard nav. Shared by
7
+ * DropdownMenu and ContextMenu so navigation is identical.
8
+ */
9
+ import type { KeyboardEvent } from 'react'
10
+
11
+ export function menuKeyDown(e: KeyboardEvent, onClose?: () => void): void {
12
+ if (e.key === 'Escape') {
13
+ onClose?.()
14
+ return
15
+ }
16
+ if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp' && e.key !== 'Home' && e.key !== 'End') return
17
+ if (typeof document === 'undefined') return
18
+
19
+ const panel = e.currentTarget as HTMLElement
20
+ const items = Array.from(
21
+ panel.querySelectorAll<HTMLElement>('[role="menuitem"]:not([aria-disabled="true"])'),
22
+ )
23
+ if (items.length === 0) return
24
+ e.preventDefault()
25
+
26
+ const active = document.activeElement as HTMLElement | null
27
+ const current = active ? items.indexOf(active) : -1
28
+ let next: number
29
+ if (e.key === 'Home') next = 0
30
+ else if (e.key === 'End') next = items.length - 1
31
+ else if (e.key === 'ArrowDown') next = current < 0 ? 0 : (current + 1) % items.length
32
+ else next = current <= 0 ? items.length - 1 : current - 1
33
+ items[next]?.focus()
34
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../src/product/ComboBox.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEnE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAe,EACf,KAAY,EACZ,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAuD,EACvD,QAAc,GACf,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,6DAA6D;IAC7D,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,2CAmEA"}
1
+ {"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../src/product/ComboBox.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAKnE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAe,EACf,KAAY,EACZ,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAuD,EACvD,QAAc,GACf,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,6DAA6D;IAC7D,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,2CA4EA"}
@@ -1,9 +1,12 @@
1
1
  /**
2
- * SelectMenu — a compact, reusable dropdown select on @hanzo/gui Popover (the
3
- * console's proven dropdown idiom, same as OrgSwitcher/ScopeSwitcher). Renders a
4
- * labelled trigger ("All types", or the chosen option) and a popover list with a
5
- * check on the active option. Prop-driven + self-contained so it lifts into
6
- * `@hanzo/ui`. `value === null` is the "all"/unfiltered state.
2
+ * SelectMenu — a compact, reusable dropdown select on @hanzo/gui Popover. Renders a
3
+ * labelled trigger ("All types", or the chosen option) and a menu list with a check on
4
+ * the active option. Prop-driven + self-contained. `value === null` is the
5
+ * "all"/unfiltered state.
6
+ *
7
+ * Uses the ONE shared menu spec (MenuPanel + MenuItemView) so it is pixel-identical to
8
+ * DropdownMenu/ContextMenu, and the SAME portal-theme fix (PortalTheme) so it renders
9
+ * correctly through the portal under a nested `<Theme>`, light or dark.
7
10
  */
8
11
  import type { ReactElement } from 'react';
9
12
  export type SelectOption<T extends string> = {
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenu.d.ts","sourceRoot":"","sources":["../../src/product/SelectMenu.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAKzC,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI;IAAE,GAAG,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtE,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,EAC3C,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,IAAI,EACJ,QAAc,GACf,EAAE;IACD,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;IAC1B,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IACf,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,2CAsCA"}
1
+ {"version":3,"file":"SelectMenu.d.ts","sourceRoot":"","sources":["../../src/product/SelectMenu.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAQzC,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI;IAAE,GAAG,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtE,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,EAC3C,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,IAAI,EACJ,QAAc,GACf,EAAE;IACD,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;IAC1B,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IACf,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,2CAyCA"}
@@ -1,2 +1,22 @@
1
- export declare function ThemeToggle(): import("react/jsx-runtime").JSX.Element;
1
+ export type ThemeMode = 'light' | 'dark';
2
+ export type ThemeToggleProps = {
3
+ /** Controlled theme. Pair with `onToggle`/`onThemeChange` to fully control it. */
4
+ theme?: ThemeMode;
5
+ /** Seed for uncontrolled mode (default: read from the DOM `.dark` class, else 'dark'). */
6
+ defaultTheme?: ThemeMode;
7
+ /** Called with the next theme on toggle (alias of `onThemeChange`). */
8
+ onToggle?: (next: ThemeMode) => void;
9
+ /** Called with the next theme on toggle. */
10
+ onThemeChange?: (next: ThemeMode) => void;
11
+ /** @hanzo/gui Button size token (default "$2"). */
12
+ size?: string;
13
+ /** aria-label override. */
14
+ label?: string;
15
+ };
16
+ /**
17
+ * The framework-agnostic toggle button. Controlled when `theme` is provided; otherwise
18
+ * self-managed via the DOM `.dark` class. No framework dependency — safe on any host.
19
+ */
20
+ export declare function AgnosticThemeToggle({ theme, defaultTheme, onToggle, onThemeChange, size, label, }: ThemeToggleProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function ThemeToggle(props: ThemeToggleProps): import("react/jsx-runtime").JSX.Element;
2
22
  //# sourceMappingURL=ThemeToggle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../src/product/ThemeToggle.tsx"],"names":[],"mappings":"AAYA,wBAAgB,WAAW,4CAY1B"}
1
+ {"version":3,"file":"ThemeToggle.d.ts","sourceRoot":"","sources":["../../src/product/ThemeToggle.tsx"],"names":[],"mappings":"AAoBA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,kFAAkF;IAClF,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACpC,4CAA4C;IAC5C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACzC,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA+BD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,IAAW,EACX,KAAK,GACN,EAAE,gBAAgB,2CAyBlB;AAiBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAelD"}
@@ -0,0 +1,5 @@
1
+ import { type ThemeToggleProps } from './ThemeToggle';
2
+ declare function ThemeToggleNext({ size, label }: Pick<ThemeToggleProps, 'size' | 'label'>): import("react/jsx-runtime").JSX.Element;
3
+ export default ThemeToggleNext;
4
+ export { ThemeToggleNext };
5
+ //# sourceMappingURL=ThemeToggleNext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeToggleNext.d.ts","sourceRoot":"","sources":["../../src/product/ThemeToggleNext.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAE1E,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,2CAWjF;AAED,eAAe,eAAe,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -8,6 +8,7 @@ export * from './AppHeader';
8
8
  export * from './BrandMark';
9
9
  export * from './OrgSwitcher';
10
10
  export * from './scope';
11
+ export * from './menu';
11
12
  export * from './DataTable';
12
13
  export * from './EmptyState';
13
14
  export * from './FadeIn';
@@ -22,6 +23,7 @@ export * from './SelectMenu';
22
23
  export * from './SlideOver';
23
24
  export * from './StatusTag';
24
25
  export * from './ThemeToggle';
26
+ export { ThemeToggleNext } from './ThemeToggleNext';
25
27
  export * from './Toast';
26
28
  export * from './color';
27
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAA;AAKxB,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,IAAI,eAAe,EAC5B,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,KAAK,GACN,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAK/D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,cAAc,mBAAmB,CAAA;AAKjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AAGvB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAA;AAKxB,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,IAAI,eAAe,EAC5B,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,KAAK,GACN,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAK/D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,cAAc,mBAAmB,CAAA;AAKjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AAKvB,cAAc,QAAQ,CAAA;AAGtB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ContextMenu — a right-click menu that renders the SAME shared item spec as
3
+ * DropdownMenu, so every menu in the fleet is identical. Built on the @hanzo/gui
4
+ * Portal with the SAME portal-theme fix as the dropdown: the menu is portaled to the
5
+ * root, escaping any nested `<Theme>`, so it re-applies the captured theme via
6
+ * <PortalTheme>. Web/desktop right-click (`onContextMenu`); on native — which has no
7
+ * right-click — the wrapped child renders untouched.
8
+ *
9
+ * <ContextMenu items={[{ key:'copy', label:'Copy', icon:<Copy size={16}/>, onSelect:copy }]}>
10
+ * <YStack>right-click me</YStack>
11
+ * </ContextMenu>
12
+ */
13
+ import type { ReactElement } from 'react';
14
+ import { type MenuItemSpec } from './items';
15
+ export type ContextMenuProps = {
16
+ /** The right-clickable target. Its `onContextMenu` is composed, not replaced. */
17
+ children: ReactElement;
18
+ items: MenuItemSpec[];
19
+ disabled?: boolean;
20
+ minWidth?: number;
21
+ maxHeight?: number;
22
+ };
23
+ export declare function ContextMenu({ children, items, disabled, minWidth, maxHeight }: ContextMenuProps): import("react/jsx-runtime").JSX.Element;
24
+ //# sourceMappingURL=ContextMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/product/menu/ContextMenu.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,OAAO,CAAA;AAGrD,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAMvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,iFAAiF;IACjF,QAAQ,EAAE,YAAY,CAAA;IACtB,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAc,EAAE,SAAS,EAAE,EAAE,gBAAgB,2CAiFrG"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * DropdownMenu — a portal-theme-safe dropdown on the @hanzo/gui Popover (the proven
3
+ * console idiom, same shell as SelectMenu/ComboBox). Declarative `items`; renders the
4
+ * ONE shared menu-item spec so it is pixel-identical to every other menu. Opens under
5
+ * a nested `<Theme>` correctly because the portaled content re-applies the captured
6
+ * theme (see PortalTheme).
7
+ *
8
+ * <DropdownMenu
9
+ * trigger={<Button>Actions</Button>}
10
+ * items={[
11
+ * { key: 'rename', label: 'Rename', icon: <Pencil size={16} />, onSelect: rename },
12
+ * { type: 'separator' },
13
+ * { key: 'del', label: 'Delete', destructive: true, onSelect: del },
14
+ * ]}
15
+ * />
16
+ */
17
+ import type { ReactElement } from 'react';
18
+ import { Popover } from '@hanzo/gui';
19
+ import { type MenuItemSpec } from './items';
20
+ export type DropdownMenuProps = {
21
+ /** The clickable element. Cloned as the Popover trigger (`asChild`). */
22
+ trigger: ReactElement;
23
+ items: MenuItemSpec[];
24
+ /** Controlled open state. Omit for uncontrolled. */
25
+ open?: boolean;
26
+ defaultOpen?: boolean;
27
+ onOpenChange?: (open: boolean) => void;
28
+ /** Popover placement (default `bottom-start`). */
29
+ placement?: React.ComponentProps<typeof Popover>['placement'];
30
+ minWidth?: number;
31
+ maxHeight?: number;
32
+ };
33
+ export declare function DropdownMenu({ trigger, items, open, defaultOpen, onOpenChange, placement, minWidth, maxHeight, }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
34
+ //# sourceMappingURL=DropdownMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/product/menu/DropdownMenu.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,OAAO,EAAwB,MAAM,YAAY,CAAA;AAC1D,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAIvE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wEAAwE;IACxE,OAAO,EAAE,YAAY,CAAA;IACrB,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,kDAAkD;IAClD,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,WAAW,CAAC,CAAA;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,IAAI,EACJ,WAAmB,EACnB,YAAY,EACZ,SAA0B,EAC1B,QAAc,EACd,SAAS,GACV,EAAE,iBAAiB,2CA4BnB"}
@@ -0,0 +1,5 @@
1
+ export { DropdownMenu, type DropdownMenuProps } from './DropdownMenu';
2
+ export { ContextMenu, type ContextMenuProps } from './ContextMenu';
3
+ export { MenuPanel, MenuItemView, MenuSeparatorView, MenuLabelView, renderMenuItems, type MenuItemSpec, } from './items';
4
+ export { PortalTheme } from './portal-theme';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/product/menu/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EACL,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The ONE menu-item spec — every menu across the fleet renders through these
3
+ * presentational primitives, so DropdownMenu, ContextMenu, SelectMenu and ComboBox
4
+ * are pixel-identical. Geometry is literal px on a strict 8-grid (never random);
5
+ * colour is theme-adaptive tokens ($color2/$color11/$color12/$borderColor) so light
6
+ * and dark both work, with the single purple accent supplied by the brand CSS vars.
7
+ *
8
+ * Style props use the @hanzo/gui config shorthands (bg/items/justify/px/py/p/mx/my/
9
+ * minW/maxH/rounded/select/shrink) — the config omits the longhand aliases.
10
+ *
11
+ * Panel — bg $color2 (#111 dark), hairline border, radius 12, inner pad 4, subtle
12
+ * border+ambient elevation.
13
+ * Item — height 30 (28–32 band), px 8, gap 8, radius 7; icon in a fixed 16px slot
14
+ * on the left; label 13px $color12; right affordance (shortcut / check /
15
+ * chevron) right-aligned. States: hover/active/focus → accent-soft, focus
16
+ * visible; selected → check + purple; disabled → muted, no hover.
17
+ * Separator — 1px hairline, 4px vertical margin.
18
+ * Label — 11px uppercase muted section header, px 8.
19
+ */
20
+ import type { ReactNode, KeyboardEvent } from 'react';
21
+ export declare const PANEL_RADIUS = 12;
22
+ export declare const PANEL_PAD = 4;
23
+ export type MenuItemSpec = {
24
+ type?: 'item';
25
+ /** Stable key. */
26
+ key: string;
27
+ label: string;
28
+ /** Leading Lucide icon (16px, unfilled) in the fixed left slot. */
29
+ icon?: ReactNode;
30
+ /** Second muted line under the label (e.g. an id or hint). */
31
+ description?: string;
32
+ /** Right-aligned shortcut / hint text (e.g. "⌘K"). */
33
+ shortcut?: string;
34
+ /** Renders a right check + purple tint. */
35
+ selected?: boolean;
36
+ disabled?: boolean;
37
+ /** Danger styling (red label/icon). */
38
+ destructive?: boolean;
39
+ /** Renders a right chevron (submenu / drill-in affordance). */
40
+ hasSubmenu?: boolean;
41
+ onSelect: () => void;
42
+ /** Keep the menu open after selecting (default: close). */
43
+ closeOnSelect?: boolean;
44
+ } | {
45
+ type: 'separator';
46
+ key?: string;
47
+ } | {
48
+ type: 'label';
49
+ key?: string;
50
+ label: string;
51
+ };
52
+ export declare function MenuPanel({ children, minWidth, maxHeight, onKeyDown, panelRef, ...rest }: {
53
+ children: ReactNode;
54
+ minWidth?: number;
55
+ maxHeight?: number;
56
+ onKeyDown?: (e: KeyboardEvent) => void;
57
+ /** Web DOM node of the panel (for measuring / edge-flip). */
58
+ panelRef?: (node: HTMLElement | null) => void;
59
+ [key: string]: unknown;
60
+ }): import("react/jsx-runtime").JSX.Element;
61
+ export declare function MenuItemView({ icon, label, description, shortcut, selected, disabled, destructive, hasSubmenu, onSelect, }: Omit<Extract<MenuItemSpec, {
62
+ type?: 'item';
63
+ }>, 'key' | 'type' | 'closeOnSelect'>): import("react/jsx-runtime").JSX.Element;
64
+ export declare function MenuSeparatorView(): import("react/jsx-runtime").JSX.Element;
65
+ export declare function MenuLabelView({ children }: {
66
+ children: ReactNode;
67
+ }): import("react/jsx-runtime").JSX.Element;
68
+ export declare function renderMenuItems(items: MenuItemSpec[], close?: () => void): ReactNode;
69
+ //# sourceMappingURL=items.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../src/product/menu/items.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAUrD,eAAO,MAAM,YAAY,KAAK,CAAA;AAC9B,eAAO,MAAM,SAAS,IAAI,CAAA;AAe1B,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kBAAkB;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GACD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAGlD,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,QAAc,EACd,SAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACR,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;IACtC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAC7C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,2CA0BA;AAGD,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAgB,EAChB,QAAgB,EAChB,WAAmB,EACnB,UAAkB,EAClB,QAAQ,GACT,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,eAAe,CAAC,2CA4DlF;AAGD,wBAAgB,iBAAiB,4CAEhC;AAGD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAclE;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,IAAI,GAAG,SAAS,CAgBpF"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * PortalTheme — the ONE fix for "themed content escapes its theme through a portal".
3
+ *
4
+ * @hanzo/gui's `Popover.Content` and `Portal` render their children in a SEPARATE
5
+ * React subtree (a Gorhom-style portal host mounted at the app root), NOT via
6
+ * `ReactDOM.createPortal`. React context therefore does NOT flow from the trigger's
7
+ * location to the host. Under a nested `<Theme name="dark">` the portaled content
8
+ * lands OUTSIDE that theme context and Tamagui throws "Missing theme" (or renders
9
+ * unthemed).
10
+ *
11
+ * The fix is two-part and must stay two-part:
12
+ * 1. At the TRIGGER site (theme context still available) capture the resolved
13
+ * theme name with `useThemeName()`.
14
+ * 2. INSIDE the portaled content re-apply it: `<PortalTheme name={captured}>`.
15
+ *
16
+ * Every portal-backed menu in this package (DropdownMenu, ContextMenu, SelectMenu,
17
+ * ComboBox) uses this so a menu renders identically whether it is opened under the
18
+ * root theme or under any nested `<Theme>`, light or dark.
19
+ */
20
+ import type { ReactNode } from 'react';
21
+ import { useThemeName } from '@hanzo/gui';
22
+ /** Capture the current resolved theme name at the trigger site. Re-exported so the
23
+ * capture + re-apply pair reads from one module. */
24
+ export { useThemeName };
25
+ export declare function PortalTheme({ name, children }: {
26
+ name: string;
27
+ children: ReactNode;
28
+ }): import("react/jsx-runtime").JSX.Element;
29
+ //# sourceMappingURL=portal-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-theme.d.ts","sourceRoot":"","sources":["../../../src/product/menu/portal-theme.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAS,YAAY,EAAE,MAAM,YAAY,CAAA;AAEhD;qDACqD;AACrD,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAIpF"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Roving keyboard focus for a menu panel — ArrowUp/Down move focus between enabled
3
+ * `[role="menuitem"]` children, Home/End jump to ends, Escape closes. Web/desktop
4
+ * only (guards on `document`); native menus have no pointer-keyboard nav. Shared by
5
+ * DropdownMenu and ContextMenu so navigation is identical.
6
+ */
7
+ import type { KeyboardEvent } from 'react';
8
+ export declare function menuKeyDown(e: KeyboardEvent, onClose?: () => void): void;
9
+ //# sourceMappingURL=roving.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roving.d.ts","sourceRoot":"","sources":["../../../src/product/menu/roving.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C,wBAAgB,WAAW,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAuBxE"}