@baseline-ui/core 0.8.4 → 0.9.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/dist/index.css +1 -1
- package/dist/index.d.mts +232 -33
- package/dist/index.d.ts +232 -33
- package/dist/index.js +84 -74
- package/dist/index.mjs +20 -12
- package/package.json +25 -15
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Key, Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ListState, Orientation, SliderStateOptions, ToggleProps, OverlayTriggerProps, OverlayTriggerState, MenuTriggerProps, TooltipTriggerProps, NumberFieldStateOptions, ListProps, SelectStateOptions, Item as Item$1 } from 'react-stately';
|
|
2
|
+
import { DraggableCollectionStateOptions, DroppableCollectionStateOptions, Orientation, ListState, SliderStateOptions, ToggleProps, OverlayTriggerProps, OverlayTriggerState, MenuTriggerProps, TooltipTriggerProps, NumberFieldStateOptions, ListProps, SelectStateOptions, Item as Item$1 } from 'react-stately';
|
|
4
3
|
import * as react_aria from 'react-aria';
|
|
5
|
-
import { AriaListBoxProps, AriaListBoxOptions, OptionAria, AriaButtonProps, AriaSliderProps, AriaSwitchProps, AriaSearchFieldProps, AriaPopoverProps, useOverlayTrigger, AriaMenuProps, AriaMenuTriggerProps, AriaLinkOptions, SeparatorProps as SeparatorProps$1, AriaProgressBarProps, AriaTextFieldProps, AriaTooltipProps, AriaPositionProps, OverlayProps, AriaToggleButtonProps, AriaCheckboxProps, AriaNumberFieldProps, I18nProviderProps as I18nProviderProps$1, LocalizedStrings, useNumberFormatter, useDateFormatter, AriaTagGroupProps, AriaSelectOptions, AriaDialogProps, DropOptions, ClipboardProps, PressProps, AriaRadioGroupProps, AriaModalOverlayProps, Locale } from 'react-aria';
|
|
4
|
+
import { DraggableCollectionOptions, DroppableCollectionOptions, AriaListBoxProps, AriaListBoxOptions, OptionAria, AriaButtonProps, AriaSliderProps, AriaSwitchProps, AriaSearchFieldProps, AriaPopoverProps, useOverlayTrigger, AriaMenuProps, AriaMenuTriggerProps, AriaLinkOptions, SeparatorProps as SeparatorProps$1, AriaProgressBarProps, AriaTextFieldProps, AriaTooltipProps, AriaPositionProps, OverlayProps, AriaToggleButtonProps, AriaCheckboxProps, AriaNumberFieldProps, I18nProviderProps as I18nProviderProps$1, LocalizedStrings, useNumberFormatter, useDateFormatter, AriaTagGroupProps, AriaSelectOptions, AriaDialogProps, DropOptions, ClipboardProps, PressProps, AriaRadioGroupProps, AriaModalOverlayProps, Locale } from 'react-aria';
|
|
6
5
|
export { I18nProviderProps, useCollator, useDateFormatter, useNumberFormatter } from 'react-aria';
|
|
6
|
+
import { Node as Node$1, DragItem, AriaLabelingProps } from '@react-types/shared';
|
|
7
7
|
import { IconProps, SVGRProps } from '@baseline-ui/icons';
|
|
8
8
|
import { Theme, Sprinkles } from '@baseline-ui/tokens';
|
|
9
9
|
import { AriaTabListProps } from '@react-types/tabs';
|
|
@@ -11,6 +11,28 @@ import { ColorFieldProps, Color } from '@react-stately/color';
|
|
|
11
11
|
import { OnRender, OnRenderStart, OnDragStart, OnDrag, OnDragEnd, OnResizeStart, OnResize, OnResizeEnd, OnRotateStart, OnRotate, OnRotateEnd, OnSnap, RotationPosition } from 'react-moveable';
|
|
12
12
|
import { AriaToolbarProps } from '@react-aria/toolbar';
|
|
13
13
|
|
|
14
|
+
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">> & {
|
|
15
|
+
/**
|
|
16
|
+
* Indicates whether reordering is enabled.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
enableReorder: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the items are arranged in a stack or grid.
|
|
23
|
+
*
|
|
24
|
+
* @default stack
|
|
25
|
+
*/
|
|
26
|
+
layout: "grid" | "stack";
|
|
27
|
+
/**
|
|
28
|
+
* The primary orientation of the items. Usually this is the direction that
|
|
29
|
+
* the collection scrolls.
|
|
30
|
+
*
|
|
31
|
+
* @default vertical
|
|
32
|
+
*/
|
|
33
|
+
orientation: Orientation;
|
|
34
|
+
};
|
|
35
|
+
|
|
14
36
|
interface BlockProps {
|
|
15
37
|
/**
|
|
16
38
|
* The unique identifier for the block. This is used to identify the block in
|
|
@@ -33,6 +55,7 @@ type ListOption = {
|
|
|
33
55
|
label: string;
|
|
34
56
|
description?: string;
|
|
35
57
|
icon?: React.FC<IconProps>;
|
|
58
|
+
data?: Record<string, any>;
|
|
36
59
|
/**
|
|
37
60
|
* The type of item.
|
|
38
61
|
*
|
|
@@ -47,7 +70,7 @@ type ListSection = {
|
|
|
47
70
|
children: ListOption[];
|
|
48
71
|
};
|
|
49
72
|
type ListItem = ListOption | ListSection;
|
|
50
|
-
interface ListBoxProps extends StylingProps, Omit<AriaListBoxProps<ListItem> & AriaListBoxOptions<ListItem>, "children" | "linkBehavior" | "isVirtualized"
|
|
73
|
+
interface ListBoxProps extends StylingProps, Omit<AriaListBoxProps<ListItem> & AriaListBoxOptions<ListItem>, "children" | "linkBehavior" | "isVirtualized" | "keyboardDelegate">, Omit<DragAndDropProps, "preview" | "enableReorder" | "orientation" | "layout">, Partial<Pick<DragAndDropProps, "enableReorder" | "orientation" | "layout">> {
|
|
51
74
|
/**
|
|
52
75
|
* The items to render in the listbox. Items have the following shape:
|
|
53
76
|
*
|
|
@@ -81,23 +104,26 @@ interface ListBoxProps extends StylingProps, Omit<AriaListBoxProps<ListItem> & A
|
|
|
81
104
|
showSelectedIcon?: boolean;
|
|
82
105
|
_state: ListState<ListItem>;
|
|
83
106
|
}, ref: React.Ref<HTMLLIElement>) => React.ReactNode;
|
|
107
|
+
/** Renders the drop indicator component. */
|
|
108
|
+
renderDropIndicator?: (options: {
|
|
109
|
+
dropIndicatorProps: React.HTMLAttributes<HTMLLIElement>;
|
|
110
|
+
isDropTarget: boolean;
|
|
111
|
+
isHidden: boolean;
|
|
112
|
+
orientation: Orientation;
|
|
113
|
+
}, ref: React.RefObject<HTMLLIElement>) => React.ReactNode;
|
|
114
|
+
/**
|
|
115
|
+
* The custom render function for the drag preview. This can be used to render
|
|
116
|
+
* a custom drag preview when dragging items.
|
|
117
|
+
*/
|
|
118
|
+
renderDragPreview?: (items: DragItem[]) => React.ReactNode;
|
|
84
119
|
/** Whether to show the selected checkmark icon. */
|
|
85
120
|
showSelectedIcon?: boolean;
|
|
86
121
|
/** The label for the listbox. */
|
|
87
122
|
label?: React.ReactNode;
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*/
|
|
93
|
-
layout?: "grid" | "stack";
|
|
94
|
-
/**
|
|
95
|
-
* The primary orientation of the items. Usually this is the direction that
|
|
96
|
-
* the collection scrolls.
|
|
97
|
-
*
|
|
98
|
-
* @default vertical
|
|
99
|
-
*/
|
|
100
|
-
orientation?: Orientation;
|
|
123
|
+
/** The CSS class name for the drop indicator. */
|
|
124
|
+
dropIndicatorClassName?: string;
|
|
125
|
+
/** The style of the drop indicator used in a component. */
|
|
126
|
+
dropIndicatorStyle?: React.CSSProperties;
|
|
101
127
|
}
|
|
102
128
|
|
|
103
129
|
declare const ListBox: React.ForwardRefExoticComponent<ListBoxProps & React.RefAttributes<HTMLUListElement>>;
|
|
@@ -255,7 +281,11 @@ interface PopoverContentProps extends Omit<AriaPopoverProps, "popoverRef" | "tri
|
|
|
255
281
|
}
|
|
256
282
|
interface PopoverTriggerProps {
|
|
257
283
|
/** The contents of the popover trigger. */
|
|
258
|
-
children: React.ReactNode
|
|
284
|
+
children: React.ReactNode | (({ isOpen, triggerProps, triggerRef, }: {
|
|
285
|
+
isOpen: boolean;
|
|
286
|
+
triggerProps: AriaButtonProps<"button">;
|
|
287
|
+
triggerRef: React.RefObject<HTMLElement>;
|
|
288
|
+
}) => React.ReactNode);
|
|
259
289
|
}
|
|
260
290
|
|
|
261
291
|
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -807,7 +837,7 @@ type TabItemProps = StylingProps & {
|
|
|
807
837
|
titleStyle?: React.CSSProperties;
|
|
808
838
|
};
|
|
809
839
|
|
|
810
|
-
declare const Tabs: React.ForwardRefExoticComponent<Omit<StylingProps & react_aria.AriaTabListProps<ItemProps>, "
|
|
840
|
+
declare const Tabs: React.ForwardRefExoticComponent<Omit<StylingProps & react_aria.AriaTabListProps<ItemProps>, "children" | "items" | "disabledKeys" | "orientation" | "selectedKey" | "defaultSelectedKey"> & {
|
|
811
841
|
children: React.ReactNode;
|
|
812
842
|
onRemove?: ((key: React.Key) => void) | undefined;
|
|
813
843
|
selectedValue?: string | undefined;
|
|
@@ -917,7 +947,7 @@ interface ColorPreset {
|
|
|
917
947
|
label: string;
|
|
918
948
|
color: string;
|
|
919
949
|
}
|
|
920
|
-
interface ColorInputProps extends OverlayTriggerProps, StylingProps, Pick<ColorFieldProps, "onChange" | "defaultValue" | "value" | "label" | "isDisabled">, Pick<AriaLabelingProps, "aria-label"> {
|
|
950
|
+
interface ColorInputProps extends OverlayTriggerProps, StylingProps, Pick<ColorFieldProps, "onChange" | "defaultValue" | "value" | "label" | "isDisabled">, Pick<AriaLabelingProps, "aria-label">, Pick<PopoverContentProps, "isNonModal" | "placement" | "shouldUpdatePosition" | "shouldFlip" | "boundaryElement" | "crossOffset" | "offset"> {
|
|
921
951
|
/**
|
|
922
952
|
* The list of color presets to show in the color picker. The signature of the
|
|
923
953
|
* color presets is:
|
|
@@ -1149,7 +1179,7 @@ type TextProps<T extends keyof React.JSX.IntrinsicElements = "span"> = StylingPr
|
|
|
1149
1179
|
*
|
|
1150
1180
|
* @default "title"
|
|
1151
1181
|
*/
|
|
1152
|
-
type?: "subtitle" | "title" | "
|
|
1182
|
+
type?: "subtitle" | "title" | "label" | "value" | "helper" | "body";
|
|
1153
1183
|
/**
|
|
1154
1184
|
* The size of the text.
|
|
1155
1185
|
*
|
|
@@ -1166,7 +1196,7 @@ type TextProps<T extends keyof React.JSX.IntrinsicElements = "span"> = StylingPr
|
|
|
1166
1196
|
elementType?: React.ElementType;
|
|
1167
1197
|
};
|
|
1168
1198
|
|
|
1169
|
-
declare const Text: React.ForwardRefExoticComponent<Pick<TextProps, "
|
|
1199
|
+
declare const Text: React.ForwardRefExoticComponent<Pick<TextProps, "children" | "autoFocus" | "onFocus" | "onBlur" | "id" | "aria-label" | "aria-labelledby" | "aria-describedby" | "aria-details" | "onDrop" | "onDragStart" | "onDragEnd" | "className" | "style" | "data-blockid" | "type" | "color" | "size" | "content" | "translate" | "hidden" | "elementType" | "role" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
1170
1200
|
|
|
1171
1201
|
type TransformProps = {
|
|
1172
1202
|
/** The `className` property assigned to the root element of the component. */
|
|
@@ -1272,7 +1302,7 @@ type TransformProps = {
|
|
|
1272
1302
|
|
|
1273
1303
|
declare const Transform: React.ForwardRefExoticComponent<TransformProps & React.RefAttributes<HTMLDivElement>>;
|
|
1274
1304
|
|
|
1275
|
-
interface ImageDropZoneProps extends Omit<SharedFileUploadProps, "label" | "variant">, Omit<DropOptions, "ref" | "getDropOperation" | "hasDropButton" | "getDropOperationForPoint">, Omit<ClipboardProps, "getItems" | "onCut" | "onCopy">, AriaLabelingProps {
|
|
1305
|
+
interface ImageDropZoneProps extends Omit<SharedFileUploadProps, "label" | "variant">, Omit<DropOptions, "ref" | "getDropOperation" | "hasDropButton" | "getDropOperationForPoint">, Omit<ClipboardProps, "getItems" | "onCut" | "onCopy">, Pick<FreehandCanvasProps, "footerClassName" | "footerStyle" | "placeholder" | "clearLabel">, AriaLabelingProps {
|
|
1276
1306
|
/**
|
|
1277
1307
|
* The initial image to display. This will be used as the `src` attribute of
|
|
1278
1308
|
* the `<img>` element. You will be able to choose a new image.
|
|
@@ -1292,8 +1322,6 @@ interface ImageDropZoneProps extends Omit<SharedFileUploadProps, "label" | "vari
|
|
|
1292
1322
|
imageAlt?: string;
|
|
1293
1323
|
/** The label to display for the picker button. */
|
|
1294
1324
|
pickerButtonLabel?: string;
|
|
1295
|
-
/** The label to display for the remove button. */
|
|
1296
|
-
removeButtonLabel?: string;
|
|
1297
1325
|
/**
|
|
1298
1326
|
* Whether to show the checkered background behind the image. This is useful
|
|
1299
1327
|
* when the image has transparency.
|
|
@@ -1307,9 +1335,13 @@ interface ImageDropZoneProps extends Omit<SharedFileUploadProps, "label" | "vari
|
|
|
1307
1335
|
pickerButtonClassName?: string;
|
|
1308
1336
|
/** The style to apply to the picker button. */
|
|
1309
1337
|
pickerButtonStyle?: React.CSSProperties;
|
|
1338
|
+
/** The class name to apply to the label. */
|
|
1339
|
+
labelClassName?: string;
|
|
1340
|
+
/** The style to apply to the label. */
|
|
1341
|
+
labelStyle?: React.CSSProperties;
|
|
1310
1342
|
}
|
|
1311
1343
|
|
|
1312
|
-
declare const ImageDropZone: React.ForwardRefExoticComponent<ImageDropZoneProps & React.RefAttributes<
|
|
1344
|
+
declare const ImageDropZone: React.ForwardRefExoticComponent<ImageDropZoneProps & React.RefAttributes<HTMLDivElement>>;
|
|
1313
1345
|
|
|
1314
1346
|
interface PreviewProps extends StylingProps, AriaLabelingProps {
|
|
1315
1347
|
/**
|
|
@@ -1424,7 +1456,7 @@ declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & Reac
|
|
|
1424
1456
|
|
|
1425
1457
|
interface ModalProps extends OverlayTriggerProps {
|
|
1426
1458
|
}
|
|
1427
|
-
interface ModalContentProps extends AriaModalOverlayProps, StylingProps {
|
|
1459
|
+
interface ModalContentProps extends Omit<AriaModalOverlayProps, "isDismissable" | "isKeyboardDismissDisabled">, StylingProps {
|
|
1428
1460
|
/**
|
|
1429
1461
|
* The contents of the modal. Can be a React node or a function that returns a
|
|
1430
1462
|
* React node.
|
|
@@ -1446,6 +1478,31 @@ interface ModalContentProps extends AriaModalOverlayProps, StylingProps {
|
|
|
1446
1478
|
* @default false
|
|
1447
1479
|
*/
|
|
1448
1480
|
disableAnimation?: boolean;
|
|
1481
|
+
/**
|
|
1482
|
+
* Whether the modal should be rendered as a drawer. This will render the
|
|
1483
|
+
* modal with a transparent background and no border at the bottom. The `auto`
|
|
1484
|
+
* value will render the modal as a drawer on mobile and as a dialog on
|
|
1485
|
+
* desktop and tablet.
|
|
1486
|
+
*
|
|
1487
|
+
* @default false
|
|
1488
|
+
*/
|
|
1489
|
+
enableDrawer?: boolean | "auto";
|
|
1490
|
+
/**
|
|
1491
|
+
* Specifies if the component is dismissable or not. If the value is a
|
|
1492
|
+
* function, it will be called with a boolean indicating if the modal is
|
|
1493
|
+
* rendered as a drawer or not.
|
|
1494
|
+
*
|
|
1495
|
+
* @default true
|
|
1496
|
+
*/
|
|
1497
|
+
isDismissable?: boolean | ((isDrawer: boolean) => boolean);
|
|
1498
|
+
/**
|
|
1499
|
+
* Determines if keyboard dismissal is disabled. If the value is a function,
|
|
1500
|
+
* it will be called with a boolean indicating if the modal is rendered as a
|
|
1501
|
+
* drawer or not.
|
|
1502
|
+
*
|
|
1503
|
+
* @default false
|
|
1504
|
+
*/
|
|
1505
|
+
isKeyboardDismissDisabled?: boolean | ((isDrawer: boolean) => boolean);
|
|
1449
1506
|
}
|
|
1450
1507
|
|
|
1451
1508
|
declare const Modal: React.FC<ModalProps>;
|
|
@@ -1511,6 +1568,11 @@ declare const ColorPresetInlineInput: React.ForwardRefExoticComponent<ColorPrese
|
|
|
1511
1568
|
|
|
1512
1569
|
interface ToolbarProps extends StylingProps, AriaToolbarProps {
|
|
1513
1570
|
children: React.ReactNode;
|
|
1571
|
+
/**
|
|
1572
|
+
* Identifies the element (or elements) whose contents or presence are
|
|
1573
|
+
* controlled by the current element.
|
|
1574
|
+
*/
|
|
1575
|
+
"aria-controls"?: string;
|
|
1514
1576
|
}
|
|
1515
1577
|
|
|
1516
1578
|
declare const Toolbar: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1530,6 +1592,140 @@ interface ToggleIconButtonProps extends StylingProps, Omit<ToggleProps, "childre
|
|
|
1530
1592
|
|
|
1531
1593
|
declare const ToggleIconButton: React.ForwardRefExoticComponent<ToggleIconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
1532
1594
|
|
|
1595
|
+
type MentionableUser = {
|
|
1596
|
+
id: string;
|
|
1597
|
+
name: string;
|
|
1598
|
+
displayName: string;
|
|
1599
|
+
avatar?: AvatarProps;
|
|
1600
|
+
description?: string;
|
|
1601
|
+
};
|
|
1602
|
+
type EditorHandle = {
|
|
1603
|
+
setCaretPosition: (index: number) => void;
|
|
1604
|
+
};
|
|
1605
|
+
interface EditorProps extends StylingProps, AriaLabelingProps {
|
|
1606
|
+
/**
|
|
1607
|
+
* The function to be called when `Enter` key is pressed or Save button is
|
|
1608
|
+
* clicked.
|
|
1609
|
+
*/
|
|
1610
|
+
onSave?: (value: string) => void;
|
|
1611
|
+
/**
|
|
1612
|
+
* The function to be called when Cancel button is clicked. If not provided,
|
|
1613
|
+
* the Cancel button will not be rendered.
|
|
1614
|
+
*/
|
|
1615
|
+
onCancel?: () => void;
|
|
1616
|
+
/** The default value of the editor. */
|
|
1617
|
+
defaultValue?: string;
|
|
1618
|
+
/** The value of the editor. */
|
|
1619
|
+
value?: string;
|
|
1620
|
+
/**
|
|
1621
|
+
* The function to be called when the value of the editor changes.
|
|
1622
|
+
*
|
|
1623
|
+
* @param value
|
|
1624
|
+
*/
|
|
1625
|
+
onChange?: (value: string) => void;
|
|
1626
|
+
/** Whether the editor is disabled. */
|
|
1627
|
+
isDisabled?: boolean;
|
|
1628
|
+
/**
|
|
1629
|
+
* Indicates whether rich text is enabled or not.
|
|
1630
|
+
*
|
|
1631
|
+
* @default true
|
|
1632
|
+
*/
|
|
1633
|
+
enableRichText?: boolean;
|
|
1634
|
+
/** The placeholder text to be displayed when the editor is empty. */
|
|
1635
|
+
placeholder?: string;
|
|
1636
|
+
/**
|
|
1637
|
+
* The variant of the editor.
|
|
1638
|
+
*
|
|
1639
|
+
* @default default
|
|
1640
|
+
*/
|
|
1641
|
+
variant?: "default" | "minimal";
|
|
1642
|
+
/** Whether the editor is inline or not. */
|
|
1643
|
+
isInline?: boolean;
|
|
1644
|
+
/** Specifies whether spell checking is enabled or disabled. */
|
|
1645
|
+
spellCheck?: boolean;
|
|
1646
|
+
/**
|
|
1647
|
+
* Optional property that represents the ARIA label for the submit button.
|
|
1648
|
+
* This property is used to provide an accessible label for the button, which
|
|
1649
|
+
* is read by screen readers to assist visually impaired users.
|
|
1650
|
+
*
|
|
1651
|
+
* @default Save
|
|
1652
|
+
*/
|
|
1653
|
+
submitButtonAriaLabel?: string;
|
|
1654
|
+
/**
|
|
1655
|
+
* The React node representing the icon to be displayed on the submit button.
|
|
1656
|
+
*
|
|
1657
|
+
* @default ArrowUpCircleFilledIcon
|
|
1658
|
+
*/
|
|
1659
|
+
submitButtonIcon?: React.FC<IconProps>;
|
|
1660
|
+
/**
|
|
1661
|
+
* The name of the avatar. The avatar is visible when `variant` is set to
|
|
1662
|
+
* `minimal` and `enableRichText` is set to `false`.
|
|
1663
|
+
*/
|
|
1664
|
+
avatarName?: string;
|
|
1665
|
+
/**
|
|
1666
|
+
* The ARIA label for the editable content. In case of rich text, this label
|
|
1667
|
+
* is used to provide an accessible label for the contenteditable element,
|
|
1668
|
+
* which is read by screen readers to assist visually impaired users. In case
|
|
1669
|
+
* of plain text, this label is used to provide an accessible label for the
|
|
1670
|
+
* textarea element.
|
|
1671
|
+
*
|
|
1672
|
+
* @default Editing Area
|
|
1673
|
+
*/
|
|
1674
|
+
editableContentAriaLabel?: string;
|
|
1675
|
+
/**
|
|
1676
|
+
* An optional array of mentionable users. Mention feature is only available
|
|
1677
|
+
* when `enableRichText` is set to `true` and this prop is provided.
|
|
1678
|
+
*
|
|
1679
|
+
* ```tsx
|
|
1680
|
+
* type MentionableUser = {
|
|
1681
|
+
* id: string;
|
|
1682
|
+
* name: string;
|
|
1683
|
+
* displayName: string;
|
|
1684
|
+
* avatar?: AvatarProps;
|
|
1685
|
+
* description?: string;
|
|
1686
|
+
* };
|
|
1687
|
+
* ```
|
|
1688
|
+
*/
|
|
1689
|
+
mentionableUsers?: MentionableUser[];
|
|
1690
|
+
/** Footer button represents an array of ActionIconButtonProps. */
|
|
1691
|
+
footerButtons?: ActionIconButtonProps[];
|
|
1692
|
+
/** The imperative handle for manipulating editor. */
|
|
1693
|
+
editorHandle?: React.RefObject<EditorHandle>;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<HTMLDivElement>>;
|
|
1697
|
+
|
|
1698
|
+
interface ScrollControlButtonProps extends StylingProps, Pick<ActionButtonProps, "label"> {
|
|
1699
|
+
/**
|
|
1700
|
+
* The ref to the scrollable element.
|
|
1701
|
+
*
|
|
1702
|
+
* @default document.body
|
|
1703
|
+
*/
|
|
1704
|
+
scrollRef?: React.RefObject<HTMLElement>;
|
|
1705
|
+
/**
|
|
1706
|
+
* Indicates whether the button should be hidden when the keyboard is being
|
|
1707
|
+
* used.
|
|
1708
|
+
*
|
|
1709
|
+
* @default false
|
|
1710
|
+
*/
|
|
1711
|
+
hideForKeyboard?: boolean;
|
|
1712
|
+
/**
|
|
1713
|
+
* The delay in milliseconds before the button is hidden when the scrolling
|
|
1714
|
+
* stops.
|
|
1715
|
+
*
|
|
1716
|
+
* @default 1500
|
|
1717
|
+
*/
|
|
1718
|
+
delay?: number;
|
|
1719
|
+
/**
|
|
1720
|
+
* Indicates whether the scroll should be smooth.
|
|
1721
|
+
*
|
|
1722
|
+
* @default true
|
|
1723
|
+
*/
|
|
1724
|
+
smoothScroll?: boolean;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
declare const ScrollControlButton: React.ForwardRefExoticComponent<ScrollControlButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
1728
|
+
|
|
1533
1729
|
/**
|
|
1534
1730
|
* A hook that creates an IntersectionObserver and observes a target element.
|
|
1535
1731
|
*
|
|
@@ -1763,6 +1959,9 @@ interface MessageDescriptor<T extends LocalizedStrings[keyof LocalizedStrings]>
|
|
|
1763
1959
|
id: keyof T;
|
|
1764
1960
|
defaultMessage?: string;
|
|
1765
1961
|
}
|
|
1962
|
+
type Message<T extends object> = {
|
|
1963
|
+
[U in keyof T]: U;
|
|
1964
|
+
};
|
|
1766
1965
|
/**
|
|
1767
1966
|
* Defines a set of messages for use with the `useI18n` hook.
|
|
1768
1967
|
*
|
|
@@ -1770,11 +1969,11 @@ interface MessageDescriptor<T extends LocalizedStrings[keyof LocalizedStrings]>
|
|
|
1770
1969
|
* @returns An object containing the message descriptors with their keys as
|
|
1771
1970
|
* property names.
|
|
1772
1971
|
*/
|
|
1773
|
-
declare function defineMessages<T extends
|
|
1774
|
-
[
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
}
|
|
1972
|
+
declare function defineMessages<T extends {
|
|
1973
|
+
[p: string]: {
|
|
1974
|
+
id: string;
|
|
1975
|
+
};
|
|
1976
|
+
}>(messages: T): Message<T>;
|
|
1778
1977
|
|
|
1779
1978
|
/**
|
|
1780
1979
|
* A hook that uses a MutationObserver to watch for changes to the DOM.
|
|
@@ -1866,4 +2065,4 @@ interface TextSelectionProps {
|
|
|
1866
2065
|
*/
|
|
1867
2066
|
declare function useDevice(element?: HTMLElement | null): "mobile" | "tablet" | "desktop";
|
|
1868
2067
|
|
|
1869
|
-
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionButton, type ActionButtonProps, ActionIconButton, type ActionIconButtonProps, Avatar, type AvatarProps, type BlockProps, Box, type BoxProps, Checkbox, type CheckboxProps, ColorInput, type ColorInputProps, type ColorPreset, ColorPresetInlineInput, type ColorPresetInlineInputProps, ColorSwatch, type ColorSwatchProps, DateFormat, type DateFormatProps, Dialog, type DialogProps, DialogTitle, type DialogTitleProps, DomNodeRenderer, type DomNodeRendererProps, FileUpload, type FileUploadProps, FreehandCanvas, type FreehandCanvasProps, Group, type GroupProps, I18nProvider, type I18nResult, IconColorInputButton, ImageDropZone, type ImageDropZoneProps, InlineAlert, type InlineAlertProps, Link, type LinkProps, ListBox, type ListBoxProps, type ListOption, Menu, 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, type PortalProps, Preview, type PreviewProps, ProgressBar, type ProgressBarProps, ProgressSpinner, type ProgressSpinnerProps, RadioGroup, type RadioGroupProps, Reaction, type ReactionProps, 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, defineMessages, useDevice, useI18n, useImage, useIntersectionObserver, useIsFirstRender, useLocalStorage, useMutationObserver, useResizeObserver, useTextSelection, useUndoRedo, useUserPreferences };
|
|
2068
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionButton, type ActionButtonProps, ActionIconButton, type ActionIconButtonProps, Avatar, type AvatarProps, type BlockProps, Box, type BoxProps, Checkbox, type CheckboxProps, ColorInput, type ColorInputProps, type ColorPreset, ColorPresetInlineInput, type ColorPresetInlineInputProps, ColorSwatch, type ColorSwatchProps, DateFormat, type DateFormatProps, Dialog, type DialogProps, DialogTitle, type DialogTitleProps, DomNodeRenderer, type DomNodeRendererProps, Editor, type EditorProps, FileUpload, type FileUploadProps, FreehandCanvas, type FreehandCanvasProps, Group, type GroupProps, I18nProvider, type I18nResult, IconColorInputButton, ImageDropZone, type ImageDropZoneProps, InlineAlert, type InlineAlertProps, Link, type LinkProps, ListBox, type ListBoxProps, type ListOption, Menu, 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, type PortalProps, Preview, type PreviewProps, ProgressBar, type ProgressBarProps, ProgressSpinner, type ProgressSpinnerProps, RadioGroup, type RadioGroupProps, Reaction, type ReactionProps, 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, defineMessages, useDevice, useI18n, useImage, useIntersectionObserver, useIsFirstRender, useLocalStorage, useMutationObserver, useResizeObserver, useTextSelection, useUndoRedo, useUserPreferences };
|