@baseline-ui/core 0.44.1 → 0.44.2

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.ts CHANGED
@@ -2437,6 +2437,20 @@ interface TreeProps<T> extends CollectionStateBase<T>, Expandable, MultipleSelec
2437
2437
  /** Whether `disabledKeys` applies to all interactions, or only selection. */
2438
2438
  disabledBehavior?: DisabledBehavior;
2439
2439
  }
2440
+ interface TreeState<T> {
2441
+ /** A collection of items in the tree. */
2442
+ readonly collection: Collection<Node$1<T>>;
2443
+ /** A set of keys for items that are disabled. */
2444
+ readonly disabledKeys: Set<Key>;
2445
+ /** A set of keys for items that are expanded. */
2446
+ readonly expandedKeys: Set<Key>;
2447
+ /** Toggles the expanded state for an item by its key. */
2448
+ toggleKey(key: Key): void;
2449
+ /** Replaces the set of expanded keys. */
2450
+ setExpandedKeys(keys: Set<Key>): void;
2451
+ /** A selection manager to read and update multiple selection state. */
2452
+ readonly selectionManager: SelectionManager;
2453
+ }
2440
2454
 
2441
2455
  interface GridListProps$1<T> extends CollectionBase<T>, MultipleSelection {
2442
2456
  /** Whether to auto focus the gridlist or an option. */
@@ -3380,6 +3394,11 @@ interface AriaToolbarProps extends AriaLabelingProps {
3380
3394
  * @default 'horizontal'
3381
3395
  */
3382
3396
  orientation?: Orientation;
3397
+ /**
3398
+ * Allows tabbing through the toolbar's content when false.
3399
+ * @default true
3400
+ */
3401
+ isSingleTabStop?: boolean;
3383
3402
  }
3384
3403
 
3385
3404
  /*
@@ -19263,6 +19282,31 @@ declare function getOsSpecificKeyboardShortcutLabel(keyboardShortcut: string, us
19263
19282
  */
19264
19283
  declare const getPlainText: (text: string) => string;
19265
19284
 
19285
+ /**
19286
+ * Checks whether a given DOM node is inside an iframe.
19287
+ *
19288
+ * This function compares the node's owning document's `defaultView` to
19289
+ * `window.top`. If they're different, the node is inside an iframe. Handles
19290
+ * cross-origin iframes safely using try/catch.
19291
+ *
19292
+ * @param {Node} node - The DOM node to check.
19293
+ * @returns {boolean} `true` if the node is inside an iframe, `false` otherwise.
19294
+ * @see https://stackoverflow.com/a/326076
19295
+ */
19296
+ declare function isInIframe(el: Node): boolean;
19297
+
19298
+ /**
19299
+ * Checks whether a given node is inside a Shadow DOM.
19300
+ *
19301
+ * This function uses `getRootNode()` to determine if the node's root is a
19302
+ * `ShadowRoot`, which indicates that the node is part of a shadow tree.
19303
+ *
19304
+ * @param {Node} node - The DOM node to check.
19305
+ * @returns {boolean} `true` if the node is inside a Shadow DOM, `false`
19306
+ * otherwise.
19307
+ */
19308
+ declare function isInShadowDOM(element: Node | null | undefined): boolean;
19309
+
19266
19310
  interface ListHandle {
19267
19311
  /** Scrolls the listbox to the specified item. */
19268
19312
  scrollIntoView: (id: string, options?: ScrollIntoViewOptions) => void;
@@ -19412,18 +19456,6 @@ interface ActionButtonProps extends ActionButtonSharedProps {
19412
19456
 
19413
19457
  declare const ActionButton: React__default__default.ForwardRefExoticComponent<ActionButtonProps & React__default__default.RefAttributes<HTMLButtonElement>>;
19414
19458
 
19415
- interface DomNodeRendererProps extends StylingProps, Omit<PressHookProps, "ref"> {
19416
- /**
19417
- * The DOM node to render inside the component. If this is not provided, the
19418
- * component will render nothing. If this is provided, the component will
19419
- * render the DOM node inside a `div` component with `display` set to
19420
- * `contents`.
19421
- */
19422
- node: Node;
19423
- }
19424
-
19425
- declare const DomNodeRenderer: React__default__default.ForwardRefExoticComponent<DomNodeRendererProps & React__default__default.RefAttributes<HTMLDivElement>>;
19426
-
19427
19459
  interface ModalProps extends OverlayTriggerProps$1 {
19428
19460
  /** The contents of the modal. */
19429
19461
  children: React__default__default.ReactNode;
@@ -19572,6 +19604,91 @@ declare const PopoverTrigger: React__default__default.FC<PopoverTriggerProps>;
19572
19604
 
19573
19605
  declare const Popover: React__default__default.FC<PopoverProps>;
19574
19606
 
19607
+ type MenuOption = Omit<ListOption, "description"> & {
19608
+ keyboardShortcut?: string;
19609
+ };
19610
+ type MenuSection = Omit<ListSection, "children"> & {
19611
+ children: MenuOption[];
19612
+ };
19613
+ type MenuItem = MenuOption | MenuSection;
19614
+ type MenuPopoverProps = Pick<PopoverContentProps, "isNonModal" | "placement" | "shouldUpdatePosition" | "shouldFlip" | "boundaryElement" | "crossOffset" | "offset" | "portalContainer">;
19615
+ interface MenuProps extends MenuPopoverProps, MenuTriggerProps, Omit<AriaMenuProps<MenuItem>, "children">, Omit<AriaMenuTriggerProps, "type"> {
19616
+ /** The `className` property assigned to the root element of the component. */
19617
+ className?: string;
19618
+ /** The `className` property assigned to the content element of the component. */
19619
+ contentClassName?: string;
19620
+ /** The `className` property assigned to the item element of the component. */
19621
+ itemClassName?: string;
19622
+ /**
19623
+ * A list of items to render in the menu. Items have the following shape:
19624
+ *
19625
+ * ```ts
19626
+ * export type MenuOption = {
19627
+ * id: string;
19628
+ * label: string;
19629
+ * keyboardShortcut?: string;
19630
+ * icon?: React.FC<IconProps>;
19631
+ * };
19632
+ *
19633
+ * export type MenuSection = {
19634
+ * id: string;
19635
+ * title?: string;
19636
+ * type: "section";
19637
+ * children: MenuOption[];
19638
+ * };
19639
+ *
19640
+ * export type MenuItem = MenuOption | MenuSection;
19641
+ * ```
19642
+ */
19643
+ items: MenuItem[];
19644
+ /**
19645
+ * A function that renders the trigger element of the component. The default
19646
+ * implementation renders an `ActionButton` component.
19647
+ *
19648
+ * ```tsx
19649
+ * <Menu renderTrigger={({ buttonProps, ref }) => <ActionButton {...buttonProps} label="Label" ref={ref} />
19650
+ * ```
19651
+ */
19652
+ renderTrigger?: (options: {
19653
+ buttonProps: ActionButtonProps;
19654
+ ref: React__default__default.RefObject<HTMLButtonElement>;
19655
+ }) => React__default__default.ReactNode;
19656
+ /**
19657
+ * The label of the trigger element. This can be a string, a React node, or a
19658
+ * function that accepts a boolean indicating whether the menu is open.
19659
+ */
19660
+ triggerLabel?: React__default__default.ReactNode | ((isOpen: boolean) => React__default__default.ReactNode);
19661
+ }
19662
+
19663
+ declare const DefaultListOption: React__default__default.ForwardRefExoticComponent<DefaultListOptionProps & React__default__default.RefAttributes<HTMLLIElement>>;
19664
+ interface DefaultListOptionProps {
19665
+ item: Node$1<ListItem | MenuItem>;
19666
+ liProps: React__default__default.ComponentProps<"li">;
19667
+ labelProps: React__default__default.ComponentProps<"span">;
19668
+ isFocusVisible: boolean;
19669
+ isDisabled: boolean;
19670
+ isSelected: boolean;
19671
+ showSelectedIcon?: boolean;
19672
+ description?: string;
19673
+ descriptionProps?: React__default__default.ComponentProps<"span">;
19674
+ selectionMode?: "single" | "multiple";
19675
+ isFocused?: boolean;
19676
+ isPressed?: boolean;
19677
+ _state: ListState<ListItem> | TreeState<MenuItem>;
19678
+ }
19679
+
19680
+ interface DomNodeRendererProps extends StylingProps, Omit<PressHookProps, "ref"> {
19681
+ /**
19682
+ * The DOM node to render inside the component. If this is not provided, the
19683
+ * component will render nothing. If this is provided, the component will
19684
+ * render the DOM node inside a `div` component with `display` set to
19685
+ * `contents`.
19686
+ */
19687
+ node: Node;
19688
+ }
19689
+
19690
+ declare const DomNodeRenderer: React__default__default.ForwardRefExoticComponent<DomNodeRendererProps & React__default__default.RefAttributes<HTMLDivElement>>;
19691
+
19575
19692
  interface TooltipProps extends StylingProps, TooltipTriggerProps, AriaTooltipProps, Omit<AriaPositionProps, "overlayRef" | "targetRef" | "maxHeight" | "isOpen" | "arrowSize"> {
19576
19693
  /** The content of the tooltip. */
19577
19694
  text?: string;
@@ -19808,62 +19925,6 @@ interface PortalContainerProviderProps {
19808
19925
 
19809
19926
  declare const PortalContainerProvider: React__default__default.FC<PortalContainerProviderProps>;
19810
19927
 
19811
- type MenuOption = Omit<ListOption, "description"> & {
19812
- keyboardShortcut?: string;
19813
- };
19814
- type MenuSection = Omit<ListSection, "children"> & {
19815
- children: MenuOption[];
19816
- };
19817
- type MenuItem = MenuOption | MenuSection;
19818
- type MenuPopoverProps = Pick<PopoverContentProps, "isNonModal" | "placement" | "shouldUpdatePosition" | "shouldFlip" | "boundaryElement" | "crossOffset" | "offset" | "portalContainer">;
19819
- interface MenuProps extends MenuPopoverProps, MenuTriggerProps, Omit<AriaMenuProps<MenuItem>, "children">, Omit<AriaMenuTriggerProps, "type"> {
19820
- /** The `className` property assigned to the root element of the component. */
19821
- className?: string;
19822
- /** The `className` property assigned to the content element of the component. */
19823
- contentClassName?: string;
19824
- /** The `className` property assigned to the item element of the component. */
19825
- itemClassName?: string;
19826
- /**
19827
- * A list of items to render in the menu. Items have the following shape:
19828
- *
19829
- * ```ts
19830
- * export type MenuOption = {
19831
- * id: string;
19832
- * label: string;
19833
- * keyboardShortcut?: string;
19834
- * icon?: React.FC<IconProps>;
19835
- * };
19836
- *
19837
- * export type MenuSection = {
19838
- * id: string;
19839
- * title?: string;
19840
- * type: "section";
19841
- * children: MenuOption[];
19842
- * };
19843
- *
19844
- * export type MenuItem = MenuOption | MenuSection;
19845
- * ```
19846
- */
19847
- items: MenuItem[];
19848
- /**
19849
- * A function that renders the trigger element of the component. The default
19850
- * implementation renders an `ActionButton` component.
19851
- *
19852
- * ```tsx
19853
- * <Menu renderTrigger={({ buttonProps, ref }) => <ActionButton {...buttonProps} label="Label" ref={ref} />
19854
- * ```
19855
- */
19856
- renderTrigger?: (options: {
19857
- buttonProps: ActionButtonProps;
19858
- ref: React__default__default.RefObject<HTMLButtonElement>;
19859
- }) => React__default__default.ReactNode;
19860
- /**
19861
- * The label of the trigger element. This can be a string, a React node, or a
19862
- * function that accepts a boolean indicating whether the menu is open.
19863
- */
19864
- triggerLabel?: React__default__default.ReactNode | ((isOpen: boolean) => React__default__default.ReactNode);
19865
- }
19866
-
19867
19928
  declare const Menu: React__default__default.ForwardRefExoticComponent<MenuProps & React__default__default.RefAttributes<HTMLUListElement>>;
19868
19929
 
19869
19930
  interface LinkProps extends AriaLinkOptions, StylingProps {
@@ -21168,13 +21229,25 @@ interface ToolbarProps extends StylingProps, AriaToolbarProps {
21168
21229
  */
21169
21230
  collapsibleMenuProps?: Omit<MenuProps, "items" | "onAction" | "placement" | "disabledKeys">;
21170
21231
  /**
21171
- * A function that renders a spacer element in the collapsible toolbar between
21172
- * the toolbar buttons and the menu trigger. This prop is only relevant when
21173
- * `isCollapsible` is true.
21232
+ * A boolean indicating whether to render a spacer element in the collapsible
21233
+ * toolbar between the toolbar buttons and the menu trigger. This prop is only
21234
+ * relevant when `isCollapsible` is true.
21174
21235
  */
21175
21236
  renderSpacer?: boolean;
21176
21237
  /** The callback to call when any key is pressed. */
21177
21238
  onKeyDown?: KeyboardProps["onKeyDown"];
21239
+ /**
21240
+ * When set to true, the toolbar will act as a normal toolbar and will not
21241
+ * contain the navigation within it when the user presses tab again.
21242
+ *
21243
+ * When set to false, the toolbar will allow for navigating through all
21244
+ * elements within it if the user presses tab, and move to the next focusable
21245
+ * element outside of the toolbar only after user navigates through all
21246
+ * elements within the toolbar.
21247
+ *
21248
+ * @default true
21249
+ */
21250
+ isSingleTabStop?: boolean;
21178
21251
  }
21179
21252
 
21180
21253
  declare const Toolbar: React__default__default.ForwardRefExoticComponent<ToolbarProps & React__default__default.RefAttributes<HTMLDivElement>>;
@@ -22689,5 +22762,5 @@ declare namespace reactStately {
22689
22762
  export type { Color };
22690
22763
  }
22691
22764
 
22692
- export { Accordion, AccordionItem, ActionButton, ActionGroup, ActionGroupItem, ActionIconButton, AlertDialog, AudioPlayer, Avatar, Box, ButtonSelect, Checkbox, ColorInput, ColorSwatch, ColorSwatchPicker, ComboBox, DateField, DateFormat, DeviceProvider, DeviceProviderContext, Dialog, DialogTitle, DomNodeRenderer, Drawer, Editor, FileUpload, FocusScope, Focusable, FrameProvider, FreehandCanvas, GlobalToastRegion, GridList, Group, I18nProvider, Icon, IconColorInput, IconColorInputButton, IconSelect, IconSlider, ImageDropZone, ImageGallery, InlineAlert, Link, ListBox, Markdown, Menu, MessageFormat, Modal, ModalClose, ModalContent, ModalTrigger, MotionGlobalConfig, NumberFormat, NumberInput, Pagination, Panel, PanelGroup, PanelResizeHandle, PointPicker, PointPickerContent, PointPickerDisplay, PointsVisualiser, Popover, PopoverContent, PopoverTrigger, Portal, PortalContainerProvider, Pressable, Preview, ProgressBar, ProgressSpinner, RadioGroup, Reaction, ScrollControlButton, SearchInput, Select, Separator, Slider, Switch, TabItem, Tabs, TagGroup, TaggedPagination, Text, TextInput, ThemeProvider, TimeField, ToastQueue, ToggleButton, ToggleIconButton, Toolbar, Tooltip, Transform, TreeView, reactAria as UNSAFE_aria, reactStately as UNSAFE_stately, VisuallyHidden, announce, calculateFontSizeToFitWidth, classNames, cleanKeyFromGlobImport, clearAnnouncer, defineMessages, destroyAnnouncer, directionVar, disableAnimations, enableAnimations, filterDOMProps, filterTruthyValues, findFocusableElements, getAbsoluteBounds, getAbsolutePosition, getActiveElement, getHTMLElement, getOsSpecificKeyboardShortcutLabel, getOwnerDocument, getPlainText, getSvgPathFromStroke, getTextDimensions, invariant, isFocusableElement, isInputThatOpensKeyboard, isInsideOverlayContent, isRect, isUrl, lightenColor, mergeProps, mergeRefs, parseColor, useCollator, useDateFormatter, useDevice, useFocusRing, useFocusVisible, useI18n, useId, useImage, useInteractionModality, useIntersectionObserver, useIsFirstRender, useKeyboard, useLiveInteractionModality, useLocalStorage, useLocale, useMutationObserver, useNumberFormatter, useObjectRef, usePointProximity, usePortalContainer, useResizeObserver, useTextSelection, useUndoRedo, useUserPreferences };
22765
+ export { Accordion, AccordionItem, ActionButton, ActionGroup, ActionGroupItem, ActionIconButton, AlertDialog, AudioPlayer, Avatar, Box, ButtonSelect, Checkbox, ColorInput, ColorSwatch, ColorSwatchPicker, ComboBox, DateField, DateFormat, DefaultListOption, DeviceProvider, DeviceProviderContext, Dialog, DialogTitle, DomNodeRenderer, Drawer, Editor, FileUpload, FocusScope, Focusable, FrameProvider, FreehandCanvas, GlobalToastRegion, GridList, Group, I18nProvider, Icon, IconColorInput, IconColorInputButton, IconSelect, IconSlider, ImageDropZone, ImageGallery, InlineAlert, Link, ListBox, Markdown, Menu, MessageFormat, Modal, ModalClose, ModalContent, ModalTrigger, MotionGlobalConfig, NumberFormat, NumberInput, Pagination, Panel, PanelGroup, PanelResizeHandle, PointPicker, PointPickerContent, PointPickerDisplay, PointsVisualiser, Popover, PopoverContent, PopoverTrigger, Portal, PortalContainerProvider, Pressable, Preview, ProgressBar, ProgressSpinner, RadioGroup, Reaction, ScrollControlButton, SearchInput, Select, Separator, Slider, Switch, TabItem, Tabs, TagGroup, TaggedPagination, Text, TextInput, ThemeProvider, TimeField, ToastQueue, ToggleButton, ToggleIconButton, Toolbar, Tooltip, Transform, TreeView, reactAria as UNSAFE_aria, reactStately as UNSAFE_stately, VisuallyHidden, announce, calculateFontSizeToFitWidth, classNames, cleanKeyFromGlobImport, clearAnnouncer, defineMessages, destroyAnnouncer, directionVar, disableAnimations, enableAnimations, filterDOMProps, filterTruthyValues, findFocusableElements, getAbsoluteBounds, getAbsolutePosition, getActiveElement, getHTMLElement, getOsSpecificKeyboardShortcutLabel, getOwnerDocument, getPlainText, getSvgPathFromStroke, getTextDimensions, invariant, isFocusableElement, isInIframe, isInShadowDOM, isInputThatOpensKeyboard, isInsideOverlayContent, isRect, isUrl, lightenColor, mergeProps, mergeRefs, parseColor, useCollator, useDateFormatter, useDevice, useFocusRing, useFocusVisible, useI18n, useId, useImage, useInteractionModality, useIntersectionObserver, useIsFirstRender, useKeyboard, useLiveInteractionModality, useLocalStorage, useLocale, useMutationObserver, useNumberFormatter, useObjectRef, usePointProximity, usePortalContainer, useResizeObserver, useTextSelection, useUndoRedo, useUserPreferences };
22693
22766
  export type { AccordionItemProps, AccordionProps, ActionButtonProps, ActionGroupProps, ActionIconButtonProps, AlertDialogProps, Assertiveness, AudioPlayerProps, AvatarProps, BlockProps, BoxProps, ButtonSelectProps, CheckboxProps, ColorInputProps, ColorPreset, ColorSwatchPickerProps, ColorSwatchProps, ComboBoxProps, DateFieldProps, DateFormatProps, Device, DeviceProviderProps, DialogProps, DialogTitleProps, DomNodeRendererProps, DrawerProps, EditorHandle, EditorProps, FileUploadProps, FocusableProps, FrameProviderProps, FreehandCanvasProps, GridListProps, GroupProps, I18nProviderProps, I18nResult, IconColorInputProps, IconComponentProps$1 as IconComponentProps, IconProps, IconSelectProps, IconSliderProps, ImageDropZoneProps, ImageGalleryProps, ImperativePanelGroupHandle, ImperativePanelHandle, InlineAlertProps, Key, LinkProps, ListBoxProps, ListHandle, ListOption, MarkdownProps, MenuItem, MenuProps, Message, MessageDescriptor, MessageFormatProps, MessageFormatter, ModalContentProps, ModalProps, NumberFormatProps, NumberInputProps, PaginationProps, PanelGroupProps, PanelProps, PanelResizeHandleProps, PointPickerContentProps, PointPickerDisplayProps, PointPickerProps, PointsVisualiserProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, PortalProps, PressEvent, PreviewProps, ProgressBarProps, ProgressSpinnerProps, RadioGroupProps, ReactComplexTreeItem, ReactionProps, Rect, SVGRProps, ScrollControlButtonProps, SearchInputProps, SelectProps, SeparatorProps, SliderProps, StylingProps, SwitchProps, TabItemProps, TabsProps, TagGroupProps, TaggedPaginationProps, TextInputProps, TextProps, ThemeProviderProps, TimeFieldProps, ToastProps, ToggleButtonProps, ToggleIconButtonProps, ToolbarProps, TooltipProps, TransformProps, TreeViewProps };