@baseline-ui/core 0.25.0 → 0.27.0
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/Acknowledgements.md +45071 -21080
- package/dist/index.css +1 -1
- package/dist/index.d.mts +172 -107
- package/dist/index.d.ts +172 -107
- package/dist/index.js +85 -87
- package/dist/index.mjs +8 -9
- package/package.json +5 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
import React, { Key, Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IconProps, SVGRProps } from '@baseline-ui/icons';
|
|
3
|
+
import * as react_stately from 'react-stately';
|
|
4
|
+
import { DraggableCollectionStateOptions, DroppableCollectionStateOptions, Orientation, ListState, OverlayTriggerProps, OverlayTriggerState, TooltipTriggerProps, SliderStateOptions, ToggleProps, MenuTriggerProps, NumberFieldStateOptions, ListProps, SelectStateOptions, Item as Item$2, Selection as Selection$1, ComboBoxStateOptions, Node as Node$2 } from 'react-stately';
|
|
3
5
|
import * as react_aria from 'react-aria';
|
|
4
|
-
import { DraggableCollectionOptions, DroppableCollectionOptions, AriaListBoxProps, AriaListBoxOptions, OptionAria, AriaButtonProps, AriaTooltipProps, AriaPositionProps, AriaSliderProps, AriaSwitchProps, AriaSearchFieldProps,
|
|
6
|
+
import { DraggableCollectionOptions, DroppableCollectionOptions, AriaListBoxProps, AriaListBoxOptions, OptionAria, AriaButtonProps, AriaPopoverProps, useOverlayTrigger, AriaTooltipProps, AriaPositionProps, AriaSliderProps, AriaSwitchProps, AriaSearchFieldProps, AriaMenuProps, AriaMenuTriggerProps, AriaLinkOptions, SeparatorProps as SeparatorProps$1, AriaProgressBarProps, AriaTextFieldProps, OverlayProps, AriaToggleButtonProps, AriaCheckboxProps, AriaNumberFieldProps, I18nProviderProps as I18nProviderProps$1, LocalizedStrings, useNumberFormatter, useDateFormatter, AriaTagGroupProps, AriaSelectOptions, Key as Key$1, AriaDialogProps, DropOptions, ClipboardProps, PressProps, AriaRadioGroupProps, AriaModalOverlayProps, AriaComboBoxOptions, AriaComboBoxProps, AriaGridListOptions, GridListItemAria, Locale } from 'react-aria';
|
|
5
7
|
export { I18nProviderProps, useCollator, useDateFormatter, useNumberFormatter } from 'react-aria';
|
|
6
8
|
import { Node as Node$1, DragItem, DOMAttributes, AriaLabelingProps, AriaValidationProps, DOMProps } from '@react-types/shared';
|
|
7
|
-
import { IconProps, SVGRProps } from '@baseline-ui/icons';
|
|
8
9
|
import { Theme, Sprinkles } from '@baseline-ui/tokens';
|
|
9
10
|
import { AriaTabListProps } from '@react-types/tabs';
|
|
10
11
|
import { ColorFieldProps, Color } from '@react-stately/color';
|
|
11
12
|
import { OnRender, OnRenderStart, OnDragStart, OnDrag, OnDragEnd, OnResizeStart, OnResize, OnResizeEnd, OnRotateStart, OnRotate, OnRotateEnd, OnSnap, RotationPosition } from 'react-moveable';
|
|
13
|
+
import { KeyboardProps } from '@react-aria/interactions';
|
|
12
14
|
import { AriaToolbarProps } from '@react-aria/toolbar';
|
|
13
15
|
import { UseTransitionProps } from '@react-spring/core';
|
|
14
16
|
import { AriaColorSwatchProps } from '@react-aria/color';
|
|
15
17
|
import { AriaActionGroupProps } from '@react-aria/actiongroup';
|
|
16
18
|
|
|
19
|
+
interface ListOption<T = Record<string, any>> {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
icon?: React.FC<IconProps>;
|
|
24
|
+
data?: T;
|
|
25
|
+
}
|
|
26
|
+
interface ListSection {
|
|
27
|
+
id: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
children: ListOption[];
|
|
30
|
+
}
|
|
31
|
+
declare type ListItem = ListOption | ListSection;
|
|
32
|
+
|
|
17
33
|
declare type DragAndDropProps = Omit<DraggableCollectionStateOptions & DraggableCollectionOptions & DroppableCollectionOptions & DroppableCollectionStateOptions, "keyboardDelegate" | "dropTargetDelegate" | "shouldAcceptItemDrop" | "onDropEnter" | "onDropActivate" | "onDropExit" | "getDropOperation" | "collection" | "selectionManager" | "onRootDrop" | "onInsert" | "getAllowedDropOperations" | "getItems" | "onItemDrop"> & Partial<Pick<DraggableCollectionStateOptions, "getItems">> & {
|
|
18
34
|
/**
|
|
19
35
|
* Indicates whether reordering is enabled.
|
|
@@ -84,21 +100,6 @@ declare function isInsideOverlayContent(selector: HTMLElement): Element | null;
|
|
|
84
100
|
*/
|
|
85
101
|
declare function isRect(rect: Rect): rect is Rect;
|
|
86
102
|
|
|
87
|
-
interface ListOption<T = Record<string, any>> {
|
|
88
|
-
id: string;
|
|
89
|
-
label: string;
|
|
90
|
-
description?: string;
|
|
91
|
-
icon?: React.FC<IconProps>;
|
|
92
|
-
data?: T;
|
|
93
|
-
type?: "option";
|
|
94
|
-
}
|
|
95
|
-
interface ListSection {
|
|
96
|
-
id: string;
|
|
97
|
-
title?: string;
|
|
98
|
-
type: "section";
|
|
99
|
-
children: ListOption[];
|
|
100
|
-
}
|
|
101
|
-
declare type ListItem = ListOption | ListSection;
|
|
102
103
|
interface ListBoxHandle {
|
|
103
104
|
scrollIntoView: (id: string, options: ScrollIntoViewOptions) => void;
|
|
104
105
|
}
|
|
@@ -230,6 +231,59 @@ interface DomNodeRendererProps extends StylingProps {
|
|
|
230
231
|
|
|
231
232
|
declare const DomNodeRenderer: React.ForwardRefExoticComponent<DomNodeRendererProps & React.RefAttributes<HTMLDivElement>>;
|
|
232
233
|
|
|
234
|
+
declare type OverlayTriggerProps_ = Parameters<typeof useOverlayTrigger>[0];
|
|
235
|
+
interface PopoverProps extends OverlayTriggerProps, OverlayTriggerProps_ {
|
|
236
|
+
/** The children of the popover. */
|
|
237
|
+
children: React.ReactNode;
|
|
238
|
+
}
|
|
239
|
+
interface PopoverContentProps extends Omit<AriaPopoverProps, "popoverRef" | "triggerRef" | "arrowSize" | "arrowBoundaryOffset">, StylingProps {
|
|
240
|
+
/**
|
|
241
|
+
* The reference element for the popover position. By default, the popover is
|
|
242
|
+
* positioned relative to the trigger element.
|
|
243
|
+
*/
|
|
244
|
+
triggerRef?: React.RefObject<HTMLElement>;
|
|
245
|
+
/** The class name for the underlay element. */
|
|
246
|
+
underlayClassName?: string;
|
|
247
|
+
/** The contents of the popover. */
|
|
248
|
+
children: React.ReactNode | ((state: OverlayTriggerState) => React.ReactNode);
|
|
249
|
+
/**
|
|
250
|
+
* The container element for the popover. By default, the modal is rendered as
|
|
251
|
+
* a child of the body element.
|
|
252
|
+
*
|
|
253
|
+
* @default document.body
|
|
254
|
+
*/
|
|
255
|
+
portalContainer?: HTMLElement;
|
|
256
|
+
/**
|
|
257
|
+
* Whether to include an arrow on the popover.
|
|
258
|
+
*
|
|
259
|
+
* @default false
|
|
260
|
+
*/
|
|
261
|
+
includeArrow?: boolean;
|
|
262
|
+
/** The class name for the content container element. */
|
|
263
|
+
contentContainerClassName?: string;
|
|
264
|
+
/** The style for the content container element. */
|
|
265
|
+
contentContainerStyle?: React.CSSProperties;
|
|
266
|
+
}
|
|
267
|
+
interface PopoverTriggerProps {
|
|
268
|
+
/** The contents of the popover trigger. */
|
|
269
|
+
children?: React.ReactNode | (({ isOpen, triggerProps, triggerRef, }: {
|
|
270
|
+
isOpen: boolean;
|
|
271
|
+
triggerProps: AriaButtonProps<"button">;
|
|
272
|
+
triggerRef: React.RefObject<HTMLElement>;
|
|
273
|
+
}) => React.ReactNode);
|
|
274
|
+
/**
|
|
275
|
+
* Client rect to be used as anchor for the popover content when no child
|
|
276
|
+
* element is provided.
|
|
277
|
+
*/
|
|
278
|
+
anchorRect?: Rect;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
282
|
+
|
|
283
|
+
declare const PopoverTrigger: React.FC<PopoverTriggerProps>;
|
|
284
|
+
|
|
285
|
+
declare const Popover: React.FC<PopoverProps>;
|
|
286
|
+
|
|
233
287
|
interface TooltipProps extends StylingProps, TooltipTriggerProps, AriaTooltipProps, Omit<AriaPositionProps, "overlayRef" | "targetRef" | "maxHeight" | "isOpen" | "arrowSize"> {
|
|
234
288
|
/** The content of the tooltip. */
|
|
235
289
|
text?: string;
|
|
@@ -305,13 +359,15 @@ interface SliderProps extends Omit<AriaSliderProps<number> & SliderStateOptions<
|
|
|
305
359
|
*/
|
|
306
360
|
includeNumberInput?: boolean;
|
|
307
361
|
}
|
|
308
|
-
interface IconSliderProps extends Pick<SliderProps, "value" | "minValue" | "maxValue" | "onChange" | "defaultValue">, StylingProps, IconComponentProps {
|
|
362
|
+
interface IconSliderProps extends Pick<SliderProps, "value" | "minValue" | "maxValue" | "onChange" | "defaultValue" | "includeNumberInput">, StylingProps, IconComponentProps {
|
|
309
363
|
/**
|
|
310
364
|
* A function to format the value of the slider.
|
|
311
365
|
*
|
|
312
366
|
* @default value => value
|
|
313
367
|
*/
|
|
314
368
|
formatValue?: (value: number) => string | number;
|
|
369
|
+
/** The props passed to the `PopoverContent` component. */
|
|
370
|
+
popoverContentProps?: Omit<PopoverContentProps, "children">;
|
|
315
371
|
}
|
|
316
372
|
|
|
317
373
|
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -405,59 +461,6 @@ interface PortalContainerProviderProps {
|
|
|
405
461
|
|
|
406
462
|
declare const PortalContainerProvider: React.FC<PortalContainerProviderProps>;
|
|
407
463
|
|
|
408
|
-
declare type OverlayTriggerProps_ = Parameters<typeof useOverlayTrigger>[0];
|
|
409
|
-
interface PopoverProps extends OverlayTriggerProps, OverlayTriggerProps_ {
|
|
410
|
-
/** The children of the popover. */
|
|
411
|
-
children: React.ReactNode | ((state: OverlayTriggerState) => React.ReactNode);
|
|
412
|
-
}
|
|
413
|
-
interface PopoverContentProps extends Omit<AriaPopoverProps, "popoverRef" | "triggerRef" | "arrowSize" | "arrowBoundaryOffset">, StylingProps {
|
|
414
|
-
/**
|
|
415
|
-
* The reference element for the popover position. By default, the popover is
|
|
416
|
-
* positioned relative to the trigger element.
|
|
417
|
-
*/
|
|
418
|
-
triggerRef?: React.RefObject<HTMLElement>;
|
|
419
|
-
/** The class name for the underlay element. */
|
|
420
|
-
underlayClassName?: string;
|
|
421
|
-
/** The contents of the popover. */
|
|
422
|
-
children: React.ReactNode;
|
|
423
|
-
/**
|
|
424
|
-
* The container element for the popover. By default, the modal is rendered as
|
|
425
|
-
* a child of the body element.
|
|
426
|
-
*
|
|
427
|
-
* @default document.body
|
|
428
|
-
*/
|
|
429
|
-
portalContainer?: HTMLElement;
|
|
430
|
-
/**
|
|
431
|
-
* Whether to include an arrow on the popover.
|
|
432
|
-
*
|
|
433
|
-
* @default false
|
|
434
|
-
*/
|
|
435
|
-
includeArrow?: boolean;
|
|
436
|
-
/** The class name for the content container element. */
|
|
437
|
-
contentContainerClassName?: string;
|
|
438
|
-
/** The style for the content container element. */
|
|
439
|
-
contentContainerStyle?: React.CSSProperties;
|
|
440
|
-
}
|
|
441
|
-
interface PopoverTriggerProps {
|
|
442
|
-
/** The contents of the popover trigger. */
|
|
443
|
-
children?: React.ReactNode | (({ isOpen, triggerProps, triggerRef, }: {
|
|
444
|
-
isOpen: boolean;
|
|
445
|
-
triggerProps: AriaButtonProps<"button">;
|
|
446
|
-
triggerRef: React.RefObject<HTMLElement>;
|
|
447
|
-
}) => React.ReactNode);
|
|
448
|
-
/**
|
|
449
|
-
* Client rect to be used as anchor for the popover content when no child
|
|
450
|
-
* element is provided.
|
|
451
|
-
*/
|
|
452
|
-
anchorRect?: Rect;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
456
|
-
|
|
457
|
-
declare const PopoverTrigger: React.FC<PopoverTriggerProps>;
|
|
458
|
-
|
|
459
|
-
declare const Popover: React.FC<PopoverProps>;
|
|
460
|
-
|
|
461
464
|
declare type MenuOption = Omit<ListOption, "description"> & {
|
|
462
465
|
keyboardShortcut?: string;
|
|
463
466
|
};
|
|
@@ -740,6 +743,8 @@ interface PaginationProps extends Omit<AriaNumberFieldProps, Excluded>, Omit<Num
|
|
|
740
743
|
* @default md
|
|
741
744
|
*/
|
|
742
745
|
size?: "xs" | "sm" | "md" | "lg";
|
|
746
|
+
/** Whether to hide the increment and decrement actions. */
|
|
747
|
+
hideActions?: boolean;
|
|
743
748
|
}
|
|
744
749
|
|
|
745
750
|
declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -747,6 +752,8 @@ declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & Reac
|
|
|
747
752
|
interface I18nProviderProps extends I18nProviderProps$1 {
|
|
748
753
|
/** The messages to use for internationalization. */
|
|
749
754
|
messages?: LocalizedStrings;
|
|
755
|
+
/** The children to render. */
|
|
756
|
+
children: React.ReactNode;
|
|
750
757
|
}
|
|
751
758
|
|
|
752
759
|
declare const I18nProvider: React.FC<I18nProviderProps>;
|
|
@@ -935,7 +942,7 @@ interface AvatarProps extends StylingProps {
|
|
|
935
942
|
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
936
943
|
|
|
937
944
|
declare type ItemProps = React.ComponentProps<typeof Item$2> & StylingProps & {
|
|
938
|
-
key?: Key;
|
|
945
|
+
key?: Key$1;
|
|
939
946
|
icon?: React.FC<SVGRProps>;
|
|
940
947
|
value?: string;
|
|
941
948
|
title?: string;
|
|
@@ -963,13 +970,13 @@ declare type TabsProps = Omit<StylingProps & AriaTabListProps<ItemProps>, "orien
|
|
|
963
970
|
*
|
|
964
971
|
* @param key
|
|
965
972
|
*/
|
|
966
|
-
onRemove?: (key: Key) => void;
|
|
973
|
+
onRemove?: (key: Key$1) => void;
|
|
967
974
|
/** The value of the tab that needs to be selected. */
|
|
968
975
|
selectedValue?: string;
|
|
969
976
|
/** The default value of the tab that needs to be selected. */
|
|
970
977
|
defaultSelectedValue?: string;
|
|
971
978
|
/** The values of the tabs that need to be disabled. */
|
|
972
|
-
disabledValues?: Set<Key>;
|
|
979
|
+
disabledValues?: Set<Key$1>;
|
|
973
980
|
/** A list of action buttons to render beside the tab items. */
|
|
974
981
|
actions?: Omit<ActionIconButtonProps, "variant" | "size">[];
|
|
975
982
|
/** The variant of the tabs */
|
|
@@ -990,14 +997,16 @@ declare type TabItemProps = StylingProps & {
|
|
|
990
997
|
titleClassName?: string;
|
|
991
998
|
/** The style to apply to the tab item. */
|
|
992
999
|
titleStyle?: React.CSSProperties;
|
|
1000
|
+
/** The contents of the tab item. */
|
|
1001
|
+
children: React.ReactNode;
|
|
993
1002
|
};
|
|
994
1003
|
|
|
995
|
-
declare const Tabs: React.ForwardRefExoticComponent<Omit<StylingProps & react_aria.AriaTabListProps<ItemProps>, "children" | "items" | "
|
|
1004
|
+
declare const Tabs: React.ForwardRefExoticComponent<Omit<StylingProps & react_aria.AriaTabListProps<ItemProps>, "children" | "items" | "orientation" | "disabledKeys" | "selectedKey" | "defaultSelectedKey"> & {
|
|
996
1005
|
children: React.ReactNode;
|
|
997
|
-
onRemove?: ((key:
|
|
1006
|
+
onRemove?: ((key: react_stately.Key) => void) | undefined;
|
|
998
1007
|
selectedValue?: string | undefined;
|
|
999
1008
|
defaultSelectedValue?: string | undefined;
|
|
1000
|
-
disabledValues?: Set<
|
|
1009
|
+
disabledValues?: Set<react_stately.Key> | undefined;
|
|
1001
1010
|
actions?: Omit<ActionIconButtonProps, "size" | "variant">[] | undefined;
|
|
1002
1011
|
variant?: "primary" | "ghost" | undefined;
|
|
1003
1012
|
tabHeaderClassName?: string | undefined;
|
|
@@ -1237,7 +1246,7 @@ interface IconColorInputProps extends StylingProps, Omit<ColorInputProps, "rende
|
|
|
1237
1246
|
*
|
|
1238
1247
|
* @default standard
|
|
1239
1248
|
*/
|
|
1240
|
-
variant
|
|
1249
|
+
variant?: "compact" | "standard";
|
|
1241
1250
|
}
|
|
1242
1251
|
|
|
1243
1252
|
declare const ColorInput: React.ForwardRefExoticComponent<ColorInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1391,7 +1400,7 @@ declare type TextProps<T extends keyof React.JSX.IntrinsicElements = "span"> = S
|
|
|
1391
1400
|
elementType?: React.ElementType;
|
|
1392
1401
|
};
|
|
1393
1402
|
|
|
1394
|
-
declare const Text: React.ForwardRefExoticComponent<
|
|
1403
|
+
declare const Text: React.ForwardRefExoticComponent<Omit<TextProps<"span">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1395
1404
|
|
|
1396
1405
|
interface TransformProps {
|
|
1397
1406
|
/** The `className` property assigned to the root element of the component. */
|
|
@@ -1662,15 +1671,15 @@ interface RadioGroupProps extends StylingProps, Omit<AriaRadioGroupProps, "descr
|
|
|
1662
1671
|
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
1663
1672
|
|
|
1664
1673
|
interface ModalProps extends OverlayTriggerProps {
|
|
1674
|
+
/** The contents of the modal. */
|
|
1675
|
+
children: React.ReactNode;
|
|
1665
1676
|
}
|
|
1666
1677
|
interface ModalContentProps extends Omit<AriaModalOverlayProps, "isDismissable" | "isKeyboardDismissDisabled">, StylingProps {
|
|
1667
1678
|
/**
|
|
1668
1679
|
* The contents of the modal. Can be a React node or a function that returns a
|
|
1669
1680
|
* React node.
|
|
1670
1681
|
*/
|
|
1671
|
-
children: React.ReactNode | ((props:
|
|
1672
|
-
close: () => void;
|
|
1673
|
-
}) => React.ReactNode);
|
|
1682
|
+
children: React.ReactNode | ((props: OverlayTriggerState) => React.ReactNode);
|
|
1674
1683
|
/**
|
|
1675
1684
|
* The container element for the modal. By default, the modal is rendered as a
|
|
1676
1685
|
* child of the body element.
|
|
@@ -1716,9 +1725,13 @@ declare const Modal: React.FC<ModalProps>;
|
|
|
1716
1725
|
|
|
1717
1726
|
declare const ModalContent: React.FC<ModalContentProps>;
|
|
1718
1727
|
|
|
1719
|
-
declare const ModalTrigger: React.FC
|
|
1728
|
+
declare const ModalTrigger: React.FC<{
|
|
1729
|
+
children: React.ReactNode;
|
|
1730
|
+
}>;
|
|
1720
1731
|
|
|
1721
|
-
declare const ModalClose: React.FC
|
|
1732
|
+
declare const ModalClose: React.FC<{
|
|
1733
|
+
children: React.ReactNode;
|
|
1734
|
+
}>;
|
|
1722
1735
|
|
|
1723
1736
|
interface MessageFormatProps {
|
|
1724
1737
|
/**
|
|
@@ -1767,17 +1780,6 @@ interface BoxProps extends Pick<StylingProps, "data-block-id">, Omit<React.Compo
|
|
|
1767
1780
|
|
|
1768
1781
|
declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<HTMLDivElement>>;
|
|
1769
1782
|
|
|
1770
|
-
interface ColorPresetInlineInputProps extends Omit<RadioGroupProps, "items" | "disabledValues"> {
|
|
1771
|
-
items: ColorPreset[];
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
/**
|
|
1775
|
-
* @deprecated Please use `ColorSwatchPicker` instead.
|
|
1776
|
-
*
|
|
1777
|
-
* TODO [>=0.26.0] Remove this component.
|
|
1778
|
-
*/
|
|
1779
|
-
declare const ColorPresetInlineInput: React.ForwardRefExoticComponent<ColorPresetInlineInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
1780
|
-
|
|
1781
1783
|
interface ToolbarProps extends StylingProps, AriaToolbarProps {
|
|
1782
1784
|
/** The children of the toolbar. */
|
|
1783
1785
|
children: React.ReactNode;
|
|
@@ -1804,7 +1806,9 @@ interface ToolbarProps extends StylingProps, AriaToolbarProps {
|
|
|
1804
1806
|
* the toolbar buttons and the menu trigger. This prop is only relevant when
|
|
1805
1807
|
* `isCollapsible` is true.
|
|
1806
1808
|
*/
|
|
1807
|
-
renderSpacer?:
|
|
1809
|
+
renderSpacer?: boolean;
|
|
1810
|
+
/** The callback to call when any key is pressed. */
|
|
1811
|
+
onKeyDown?: KeyboardProps["onKeyDown"];
|
|
1808
1812
|
}
|
|
1809
1813
|
|
|
1810
1814
|
declare const Toolbar: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1842,6 +1846,7 @@ interface MentionableUser {
|
|
|
1842
1846
|
}
|
|
1843
1847
|
interface EditorHandle {
|
|
1844
1848
|
setCaretPosition: (index: number) => void;
|
|
1849
|
+
focus: () => void;
|
|
1845
1850
|
}
|
|
1846
1851
|
interface EditorProps extends StylingProps, AriaLabelingProps {
|
|
1847
1852
|
/**
|
|
@@ -2119,9 +2124,9 @@ declare const AudioPlayer: React.ForwardRefExoticComponent<AudioPlayerProps & Re
|
|
|
2119
2124
|
|
|
2120
2125
|
interface Item {
|
|
2121
2126
|
id: string;
|
|
2127
|
+
label: string;
|
|
2122
2128
|
src?: string;
|
|
2123
2129
|
alt?: string;
|
|
2124
|
-
label: string;
|
|
2125
2130
|
}
|
|
2126
2131
|
interface ImageGalleryProps extends StylingProps, Omit<ListBoxProps, "items" | "layout" | "grid" | "renderOption" | "renderDropIndicator" | "renderDragPreview" | "showSelectedIcon" | "orientation" | "shouldSelectOnPressUp" | "shouldFocusOnHover" | "dropIndicatorClassName" | "dropIndicatorStyle" | "shouldUseVirtualFocus" | "getItems" | "acceptedDragTypes" | "sectionClassName" | "sectionStyle"> {
|
|
2127
2132
|
/**
|
|
@@ -2198,11 +2203,16 @@ interface ImageGalleryProps extends StylingProps, Omit<ListBoxProps, "items" | "
|
|
|
2198
2203
|
imageClassName?: string;
|
|
2199
2204
|
/** ClassName for each item image label */
|
|
2200
2205
|
labelClassName?: string;
|
|
2206
|
+
/** A callback that is called to render the image. */
|
|
2207
|
+
renderImage?: (item: ListOption<Pick<Item, "alt" | "src">>, options: {
|
|
2208
|
+
deleteElement?: React.ReactElement;
|
|
2209
|
+
onDelete?: (id: string) => void;
|
|
2210
|
+
}) => React.ReactElement;
|
|
2201
2211
|
}
|
|
2202
2212
|
|
|
2203
2213
|
declare const ImageGallery: React.ForwardRefExoticComponent<ImageGalleryProps & React.RefAttributes<HTMLDivElement>>;
|
|
2204
2214
|
|
|
2205
|
-
interface ButtonSelectProps extends StylingProps, Pick<SelectProps, "isDisabled" | "validationState" | "onSelectionChange" | "selectedKey" | "defaultSelectedKey" | "items" | "showSelectedIcon" | "isOpen" | "defaultOpen">, Pick<
|
|
2215
|
+
interface ButtonSelectProps extends StylingProps, Pick<SelectProps, "isDisabled" | "validationState" | "onSelectionChange" | "selectedKey" | "defaultSelectedKey" | "items" | "showSelectedIcon" | "isOpen" | "defaultOpen">, Pick<ToggleButtonProps, "onPress" | "isSelected" | "defaultSelected" | "excludeFromTabOrder">, AriaLabelingProps {
|
|
2206
2216
|
/**
|
|
2207
2217
|
* The size of the button.
|
|
2208
2218
|
*
|
|
@@ -2215,6 +2225,11 @@ interface ButtonSelectProps extends StylingProps, Pick<SelectProps, "isDisabled"
|
|
|
2215
2225
|
* @default false
|
|
2216
2226
|
*/
|
|
2217
2227
|
hideLabel?: boolean;
|
|
2228
|
+
/** A callback that is called when the button selection changes. */
|
|
2229
|
+
onButtonSelectionChange?: (options: {
|
|
2230
|
+
isSelected: boolean;
|
|
2231
|
+
selectedKey: string;
|
|
2232
|
+
}) => void;
|
|
2218
2233
|
}
|
|
2219
2234
|
|
|
2220
2235
|
declare const ButtonSelect: React.ForwardRefExoticComponent<ButtonSelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2292,6 +2307,22 @@ interface ComboBoxProps extends StylingProps, Omit<AriaComboBoxOptions<ListItem>
|
|
|
2292
2307
|
menuTrigger?: "manual" | "input" | "focus";
|
|
2293
2308
|
/** Custom filter function to use when filtering items. */
|
|
2294
2309
|
filter?: ComboBoxStateOptions<ListItem>["defaultFilter"];
|
|
2310
|
+
/**
|
|
2311
|
+
* The type of the input field
|
|
2312
|
+
*
|
|
2313
|
+
* @default text
|
|
2314
|
+
*/
|
|
2315
|
+
inputType?: "text" | "number";
|
|
2316
|
+
/**
|
|
2317
|
+
* The minimum value for the input field. This is only valid when `inputType`
|
|
2318
|
+
* is set to `number`.
|
|
2319
|
+
*/
|
|
2320
|
+
minValue?: number;
|
|
2321
|
+
/**
|
|
2322
|
+
* The maximum value for the input field. This is only valid when `inputType`
|
|
2323
|
+
* is set to `number`.
|
|
2324
|
+
*/
|
|
2325
|
+
maxValue?: number;
|
|
2295
2326
|
}
|
|
2296
2327
|
|
|
2297
2328
|
declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2384,18 +2415,51 @@ interface ActionGroupProps extends StylingProps, Omit<AriaActionGroupProps<ListI
|
|
|
2384
2415
|
selectionMode?: "single" | "multiple";
|
|
2385
2416
|
/** The props to be passed to the tooltip component. */
|
|
2386
2417
|
tooltipProps?: IconComponentProps["tooltipProps"] | ((item: ListItem) => IconComponentProps["tooltipProps"]);
|
|
2418
|
+
/**
|
|
2419
|
+
* A function that renders an action item. This function is called for each
|
|
2420
|
+
* item in the action group. By default, an `ActionIconButton` is rendered.
|
|
2421
|
+
*
|
|
2422
|
+
* @default
|
|
2423
|
+
*
|
|
2424
|
+
* ```jsx
|
|
2425
|
+
* <ActionIconButton
|
|
2426
|
+
* variant="tertiary"
|
|
2427
|
+
* icon={icon}
|
|
2428
|
+
* aria-label={item.textValue}
|
|
2429
|
+
* size="sm"
|
|
2430
|
+
* isDisabled={_isDisabled}
|
|
2431
|
+
* className={"BaselineUI-ActionGroup-Item"}
|
|
2432
|
+
* />;
|
|
2433
|
+
* ```
|
|
2434
|
+
*/
|
|
2435
|
+
renderActionItem?: (item: Node$2<ListItem>, options: {
|
|
2436
|
+
isSelected?: boolean;
|
|
2437
|
+
isDisabled?: boolean;
|
|
2438
|
+
}) => React.ReactNode;
|
|
2387
2439
|
}
|
|
2388
2440
|
|
|
2389
2441
|
declare const ActionGroup: React.ForwardRefExoticComponent<ActionGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
2390
|
-
declare const ActionGroupItem: React.FC<
|
|
2442
|
+
declare const ActionGroupItem: React.FC<ActionGroupItemProps>;
|
|
2443
|
+
interface ActionGroupItemProps extends Pick<ActionGroupProps, "tooltipProps" | "renderActionItem" | "onAction" | "isDisabled"> {
|
|
2391
2444
|
item: Node$2<ListItem>;
|
|
2392
2445
|
state: ListState<ListItem>;
|
|
2393
|
-
|
|
2394
|
-
isDisabled?: boolean;
|
|
2395
|
-
tooltipProps?: IconComponentProps["tooltipProps"];
|
|
2396
|
-
}>;
|
|
2446
|
+
}
|
|
2397
2447
|
|
|
2398
|
-
interface ColorSwatchPickerProps extends StylingProps, Pick<
|
|
2448
|
+
interface ColorSwatchPickerProps extends StylingProps, Pick<RadioGroupProps, "optionsContainerClassName" | "labelPosition">, Pick<ListBoxProps, "optionClassName" | "optionStyle">, AriaLabelingProps {
|
|
2449
|
+
/**
|
|
2450
|
+
* The items to display in the picker. Each item should have a `color` and a
|
|
2451
|
+
* `label`.
|
|
2452
|
+
*
|
|
2453
|
+
* ```js
|
|
2454
|
+
* const items = [
|
|
2455
|
+
* { color: "#FF0000", label: "Red" },
|
|
2456
|
+
* { color: "#00FF00", label: "Green" },
|
|
2457
|
+
* { color: "#0000FF", label: "Blue" },
|
|
2458
|
+
* { color: "#FFFF00", label: "Yellow" },
|
|
2459
|
+
* ];
|
|
2460
|
+
* ```
|
|
2461
|
+
*/
|
|
2462
|
+
items: ColorPreset[];
|
|
2399
2463
|
/** The icon visible at the start of the picker. */
|
|
2400
2464
|
icon?: React.FC<IconProps>;
|
|
2401
2465
|
/**
|
|
@@ -2730,7 +2794,8 @@ interface TextSelectionProps {
|
|
|
2730
2794
|
* @param element - The element to use to get the owner window. Defaults to
|
|
2731
2795
|
* `document.body`.
|
|
2732
2796
|
*/
|
|
2733
|
-
declare function useDevice(element?: Element | null | undefined): "
|
|
2797
|
+
declare function useDevice(element?: Element | null | undefined): "mobile" | "tablet" | "desktop";
|
|
2798
|
+
declare type Device = ReturnType<typeof useDevice>;
|
|
2734
2799
|
|
|
2735
2800
|
/**
|
|
2736
2801
|
* Custom hook for accessing PortalContainerProviderContext. This hook allows
|
|
@@ -2744,4 +2809,4 @@ declare function useDevice(element?: Element | null | undefined): "desktop" | "t
|
|
|
2744
2809
|
*/
|
|
2745
2810
|
declare function usePortalContainer(_portalContainer?: HTMLElement): HTMLElement | undefined;
|
|
2746
2811
|
|
|
2747
|
-
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionButton, type ActionButtonProps, ActionGroup, ActionGroupItem, type ActionGroupProps, ActionIconButton, type ActionIconButtonProps, AlertDialog, type AlertDialogProps, AudioPlayer, type AudioPlayerProps, Avatar, type AvatarProps, type BlockProps, Box, type BoxProps, ButtonSelect, type ButtonSelectProps, Checkbox, type CheckboxProps, ColorInput, type ColorInputProps, type ColorPreset,
|
|
2812
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionButton, type ActionButtonProps, ActionGroup, ActionGroupItem, type ActionGroupProps, ActionIconButton, type ActionIconButtonProps, AlertDialog, type AlertDialogProps, AudioPlayer, type AudioPlayerProps, Avatar, type AvatarProps, type BlockProps, Box, type BoxProps, ButtonSelect, type ButtonSelectProps, Checkbox, type CheckboxProps, ColorInput, type ColorInputProps, type ColorPreset, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ComboBox, type ComboBoxProps, DateFormat, type DateFormatProps, type Device, Dialog, type DialogProps, DialogTitle, type DialogTitleProps, DomNodeRenderer, type DomNodeRendererProps, Drawer, type DrawerProps, Editor, type EditorHandle, type EditorProps, FileUpload, type FileUploadProps, FreehandCanvas, type FreehandCanvasProps, GridList, type GridListProps, Group, type GroupProps, I18nProvider, type I18nResult, IconColorInput, IconColorInputButton, type IconColorInputProps, IconSelect, type IconSelectProps, IconSlider, type IconSliderProps, ImageDropZone, type ImageDropZoneProps, ImageGallery, type ImageGalleryProps, InlineAlert, type InlineAlertProps, Link, type LinkProps, ListBox, type ListBoxProps, type ListOption, Markdown, type MarkdownProps, Menu, type MenuItem, type MenuProps, type MessageDescriptor, MessageFormat, type MessageFormatProps, Modal, ModalClose, ModalContent, type ModalContentProps, type ModalProps, ModalTrigger, NumberFormat, type NumberFormatProps, NumberInput, type NumberInputProps, Pagination, type PaginationProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, Portal, PortalContainerProvider, type PortalProps, Preview, type PreviewProps, ProgressBar, type ProgressBarProps, ProgressSpinner, type ProgressSpinnerProps, RadioGroup, type RadioGroupProps, Reaction, type ReactionProps, type Rect, ScrollControlButton, type ScrollControlButtonProps, SearchInput, type SearchInputProps, Select, type SelectProps, Separator, type SeparatorProps, Slider, type SliderProps, type StylingProps, Switch, type SwitchProps, TabItem, type TabItemProps, Tabs, type TabsProps, TagGroup, type TagGroupProps, Text, TextInput, type TextInputProps, type TextProps, ThemeProvider, type ThemeProviderProps, ToggleButton, type ToggleButtonProps, ToggleIconButton, type ToggleIconButtonProps, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Transform, type TransformProps, Transition, type TransitionProps, defineMessages, isInsideOverlayContent, isRect, useDevice, useI18n, useImage, useIntersectionObserver, useIsFirstRender, useLocalStorage, useMutationObserver, usePortalContainer, useResizeObserver, useTextSelection, useUndoRedo, useUserPreferences };
|