@ohhwells/bridge 0.1.51 → 0.1.52

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.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
- import React__default, { Ref } from 'react';
2
+ import React__default, { Ref, ReactNode, DragEvent, PointerEvent } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
5
  import { VariantProps } from 'class-variance-authority';
6
- import { Toggle as Toggle$1, Tooltip as Tooltip$1 } from 'radix-ui';
6
+ import { Toggle as Toggle$1, DropdownMenu as DropdownMenu$1, Tooltip as Tooltip$1 } from 'radix-ui';
7
7
 
8
8
  declare function OhhwellsBridge(): React__default.ReactPortal | null;
9
9
 
@@ -167,34 +167,59 @@ declare const CustomToolbarButton: React.ForwardRefExoticComponent<React.ButtonH
167
167
  type ItemActionToolbarProps = {
168
168
  onEditLink?: () => void;
169
169
  onAddItem?: () => void;
170
- onMore?: () => void;
170
+ onSelectParent?: () => void;
171
+ onDuplicate?: () => void;
172
+ /** Wired by OHH-458 — row is always shown (destructive). */
173
+ onDelete?: () => void;
171
174
  editLinkDisabled?: boolean;
172
175
  addItemDisabled?: boolean;
173
176
  moreDisabled?: boolean;
177
+ selectParentDisabled?: boolean;
178
+ duplicateDisabled?: boolean;
179
+ deleteDisabled?: boolean;
180
+ /** Hide Edit link — e.g. footer column frame selection. */
181
+ showEditLink?: boolean;
174
182
  /** Hide Add item — CTA buttons only show Edit link (prototype). */
175
183
  showAddItem?: boolean;
176
184
  /** Hide More — CTA buttons only show Edit link (prototype). */
177
185
  showMore?: boolean;
178
186
  /** Tooltip placement relative to each icon — Figma uses bottom. */
179
187
  tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
188
+ /**
189
+ * Nav dropdown Open/Closed (OHH-468). When set, shows Closed|Open segment.
190
+ * `null` / `undefined` hides the control.
191
+ */
192
+ dropdownOpen?: boolean | null;
193
+ onDropdownOpenChange?: (open: boolean) => void;
194
+ /**
195
+ * Footer column Show/Hide heading (OHH-468). When set, shows Heading toggle.
196
+ * `null` / `undefined` hides the control.
197
+ */
198
+ headingVisible?: boolean | null;
199
+ onHeadingVisibleChange?: (visible: boolean) => void;
180
200
  };
181
- /** Item-action fill for Custom/Toolbar — Edit link / Add item / More (no separators). */
182
- declare function ItemActionToolbar({ onEditLink, onAddItem, onMore, editLinkDisabled, addItemDisabled, moreDisabled, showAddItem, showMore, tooltipSide, }: ItemActionToolbarProps): react_jsx_runtime.JSX.Element;
201
+ /** Item-action fill for Custom/Toolbar — Edit link / Add item / More (+ OHH-468 toggles). */
202
+ declare function ItemActionToolbar({ onEditLink, onAddItem, onSelectParent, onDuplicate, onDelete, editLinkDisabled, addItemDisabled, moreDisabled, selectParentDisabled, duplicateDisabled, deleteDisabled, showEditLink, showAddItem, showMore, tooltipSide, dropdownOpen, onDropdownOpenChange, headingVisible, onHeadingVisibleChange, }: ItemActionToolbarProps): react_jsx_runtime.JSX.Element;
183
203
 
184
204
  type ItemInteractionState = 'default' | 'hover' | 'sibling-hint' | 'active-top' | 'active-bottom' | 'dragging';
185
205
  type ItemInteractionLayerProps = {
186
206
  rect: DOMRect;
187
207
  state: ItemInteractionState;
188
- elRef?: React.Ref<HTMLDivElement>;
208
+ elRef?: Ref<HTMLDivElement>;
189
209
  /** Slotted Custom/Toolbar instance (item-action or other fill). */
190
- toolbar?: React.ReactNode;
210
+ toolbar?: ReactNode;
211
+ /**
212
+ * When set with active-bottom, park the toolbar under this rect instead of
213
+ * under `rect` (open nav dropdown panel — chrome stays on the trigger only).
214
+ */
215
+ toolbarBelowRect?: DOMRect | null;
191
216
  showHandle?: boolean;
192
217
  dragDisabled?: boolean;
193
218
  dragHandleLabel?: string;
194
- onDragHandleDragStart?: (e: React.DragEvent<HTMLButtonElement>) => void;
195
- onDragHandleDragEnd?: (e: React.DragEvent<HTMLButtonElement>) => void;
219
+ onDragHandleDragStart?: (e: DragEvent<HTMLButtonElement>) => void;
220
+ onDragHandleDragEnd?: (e: DragEvent<HTMLButtonElement>) => void;
196
221
  /** Press on the item chrome (not handle/toolbar) — starts press-to-drag. */
197
- onItemPointerDown?: (e: React.PointerEvent<HTMLDivElement>) => void;
222
+ onItemPointerDown?: (e: PointerEvent<HTMLDivElement>) => void;
198
223
  /** Click on chrome without a drag — typically enter text edit. */
199
224
  onItemClick?: (clientX: number, clientY: number) => void;
200
225
  /**
@@ -206,7 +231,25 @@ type ItemInteractionLayerProps = {
206
231
  chromeGap?: number;
207
232
  className?: string;
208
233
  };
209
- declare function ItemInteractionLayer({ rect, state, elRef, toolbar, showHandle, dragDisabled, dragHandleLabel, onDragHandleDragStart, onDragHandleDragEnd, onItemPointerDown, onItemClick, itemDragSurface, chromeGap, className, }: ItemInteractionLayerProps): react_jsx_runtime.JSX.Element | null;
234
+ declare function ItemInteractionLayer({ rect, state, elRef, toolbar, toolbarBelowRect, showHandle, dragDisabled, dragHandleLabel, onDragHandleDragStart, onDragHandleDragEnd, onItemPointerDown, onItemClick, itemDragSurface, chromeGap, className, }: ItemInteractionLayerProps): react_jsx_runtime.JSX.Element | null;
235
+
236
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Root>): react_jsx_runtime.JSX.Element;
237
+ declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Trigger>): react_jsx_runtime.JSX.Element;
238
+ declare function DropdownMenuGroup({ className, ...props }: React.ComponentProps<typeof DropdownMenu$1.Group>): react_jsx_runtime.JSX.Element;
239
+ /**
240
+ * Figma Dropdown Menu (4:6588 / 8202:1581):
241
+ * border, radius 6, shadow-md, min 128px / typical 224px width.
242
+ */
243
+ declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenu$1.Content>): react_jsx_runtime.JSX.Element;
244
+ /**
245
+ * Figma Command Base / CMDK Item — leading icon at left 8px, label at pl-8.
246
+ */
247
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenu$1.Item> & {
248
+ inset?: boolean;
249
+ variant?: 'default' | 'destructive';
250
+ }): react_jsx_runtime.JSX.Element;
251
+ /** Full-bleed section divider — Figma section border-t (not inset hairline). */
252
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenu$1.Separator>): react_jsx_runtime.JSX.Element;
210
253
 
211
254
  declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof Tooltip$1.Provider>): react_jsx_runtime.JSX.Element;
212
255
  declare function Tooltip({ ...props }: React.ComponentProps<typeof Tooltip$1.Root>): react_jsx_runtime.JSX.Element;
@@ -242,4 +285,4 @@ declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
242
285
  bind: Record<string, string>;
243
286
  };
244
287
 
245
- export { type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };
288
+ export { type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
- import React__default, { Ref } from 'react';
2
+ import React__default, { Ref, ReactNode, DragEvent, PointerEvent } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
5
  import { VariantProps } from 'class-variance-authority';
6
- import { Toggle as Toggle$1, Tooltip as Tooltip$1 } from 'radix-ui';
6
+ import { Toggle as Toggle$1, DropdownMenu as DropdownMenu$1, Tooltip as Tooltip$1 } from 'radix-ui';
7
7
 
8
8
  declare function OhhwellsBridge(): React__default.ReactPortal | null;
9
9
 
@@ -167,34 +167,59 @@ declare const CustomToolbarButton: React.ForwardRefExoticComponent<React.ButtonH
167
167
  type ItemActionToolbarProps = {
168
168
  onEditLink?: () => void;
169
169
  onAddItem?: () => void;
170
- onMore?: () => void;
170
+ onSelectParent?: () => void;
171
+ onDuplicate?: () => void;
172
+ /** Wired by OHH-458 — row is always shown (destructive). */
173
+ onDelete?: () => void;
171
174
  editLinkDisabled?: boolean;
172
175
  addItemDisabled?: boolean;
173
176
  moreDisabled?: boolean;
177
+ selectParentDisabled?: boolean;
178
+ duplicateDisabled?: boolean;
179
+ deleteDisabled?: boolean;
180
+ /** Hide Edit link — e.g. footer column frame selection. */
181
+ showEditLink?: boolean;
174
182
  /** Hide Add item — CTA buttons only show Edit link (prototype). */
175
183
  showAddItem?: boolean;
176
184
  /** Hide More — CTA buttons only show Edit link (prototype). */
177
185
  showMore?: boolean;
178
186
  /** Tooltip placement relative to each icon — Figma uses bottom. */
179
187
  tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
188
+ /**
189
+ * Nav dropdown Open/Closed (OHH-468). When set, shows Closed|Open segment.
190
+ * `null` / `undefined` hides the control.
191
+ */
192
+ dropdownOpen?: boolean | null;
193
+ onDropdownOpenChange?: (open: boolean) => void;
194
+ /**
195
+ * Footer column Show/Hide heading (OHH-468). When set, shows Heading toggle.
196
+ * `null` / `undefined` hides the control.
197
+ */
198
+ headingVisible?: boolean | null;
199
+ onHeadingVisibleChange?: (visible: boolean) => void;
180
200
  };
181
- /** Item-action fill for Custom/Toolbar — Edit link / Add item / More (no separators). */
182
- declare function ItemActionToolbar({ onEditLink, onAddItem, onMore, editLinkDisabled, addItemDisabled, moreDisabled, showAddItem, showMore, tooltipSide, }: ItemActionToolbarProps): react_jsx_runtime.JSX.Element;
201
+ /** Item-action fill for Custom/Toolbar — Edit link / Add item / More (+ OHH-468 toggles). */
202
+ declare function ItemActionToolbar({ onEditLink, onAddItem, onSelectParent, onDuplicate, onDelete, editLinkDisabled, addItemDisabled, moreDisabled, selectParentDisabled, duplicateDisabled, deleteDisabled, showEditLink, showAddItem, showMore, tooltipSide, dropdownOpen, onDropdownOpenChange, headingVisible, onHeadingVisibleChange, }: ItemActionToolbarProps): react_jsx_runtime.JSX.Element;
183
203
 
184
204
  type ItemInteractionState = 'default' | 'hover' | 'sibling-hint' | 'active-top' | 'active-bottom' | 'dragging';
185
205
  type ItemInteractionLayerProps = {
186
206
  rect: DOMRect;
187
207
  state: ItemInteractionState;
188
- elRef?: React.Ref<HTMLDivElement>;
208
+ elRef?: Ref<HTMLDivElement>;
189
209
  /** Slotted Custom/Toolbar instance (item-action or other fill). */
190
- toolbar?: React.ReactNode;
210
+ toolbar?: ReactNode;
211
+ /**
212
+ * When set with active-bottom, park the toolbar under this rect instead of
213
+ * under `rect` (open nav dropdown panel — chrome stays on the trigger only).
214
+ */
215
+ toolbarBelowRect?: DOMRect | null;
191
216
  showHandle?: boolean;
192
217
  dragDisabled?: boolean;
193
218
  dragHandleLabel?: string;
194
- onDragHandleDragStart?: (e: React.DragEvent<HTMLButtonElement>) => void;
195
- onDragHandleDragEnd?: (e: React.DragEvent<HTMLButtonElement>) => void;
219
+ onDragHandleDragStart?: (e: DragEvent<HTMLButtonElement>) => void;
220
+ onDragHandleDragEnd?: (e: DragEvent<HTMLButtonElement>) => void;
196
221
  /** Press on the item chrome (not handle/toolbar) — starts press-to-drag. */
197
- onItemPointerDown?: (e: React.PointerEvent<HTMLDivElement>) => void;
222
+ onItemPointerDown?: (e: PointerEvent<HTMLDivElement>) => void;
198
223
  /** Click on chrome without a drag — typically enter text edit. */
199
224
  onItemClick?: (clientX: number, clientY: number) => void;
200
225
  /**
@@ -206,7 +231,25 @@ type ItemInteractionLayerProps = {
206
231
  chromeGap?: number;
207
232
  className?: string;
208
233
  };
209
- declare function ItemInteractionLayer({ rect, state, elRef, toolbar, showHandle, dragDisabled, dragHandleLabel, onDragHandleDragStart, onDragHandleDragEnd, onItemPointerDown, onItemClick, itemDragSurface, chromeGap, className, }: ItemInteractionLayerProps): react_jsx_runtime.JSX.Element | null;
234
+ declare function ItemInteractionLayer({ rect, state, elRef, toolbar, toolbarBelowRect, showHandle, dragDisabled, dragHandleLabel, onDragHandleDragStart, onDragHandleDragEnd, onItemPointerDown, onItemClick, itemDragSurface, chromeGap, className, }: ItemInteractionLayerProps): react_jsx_runtime.JSX.Element | null;
235
+
236
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Root>): react_jsx_runtime.JSX.Element;
237
+ declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Trigger>): react_jsx_runtime.JSX.Element;
238
+ declare function DropdownMenuGroup({ className, ...props }: React.ComponentProps<typeof DropdownMenu$1.Group>): react_jsx_runtime.JSX.Element;
239
+ /**
240
+ * Figma Dropdown Menu (4:6588 / 8202:1581):
241
+ * border, radius 6, shadow-md, min 128px / typical 224px width.
242
+ */
243
+ declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenu$1.Content>): react_jsx_runtime.JSX.Element;
244
+ /**
245
+ * Figma Command Base / CMDK Item — leading icon at left 8px, label at pl-8.
246
+ */
247
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenu$1.Item> & {
248
+ inset?: boolean;
249
+ variant?: 'default' | 'destructive';
250
+ }): react_jsx_runtime.JSX.Element;
251
+ /** Full-bleed section divider — Figma section border-t (not inset hairline). */
252
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenu$1.Separator>): react_jsx_runtime.JSX.Element;
210
253
 
211
254
  declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof Tooltip$1.Provider>): react_jsx_runtime.JSX.Element;
212
255
  declare function Tooltip({ ...props }: React.ComponentProps<typeof Tooltip$1.Root>): react_jsx_runtime.JSX.Element;
@@ -242,4 +285,4 @@ declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
242
285
  bind: Record<string, string>;
243
286
  };
244
287
 
245
- export { type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };
288
+ export { type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };