prime-ui-kit 0.12.0 → 0.13.1
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/README.md +3 -1
- package/dist/chunks/{chunk-YJO3NJIJ.js → chunk-JV2KB5JZ.js} +6662 -5282
- package/dist/chunks/{chunk-VOZ7J72X.js → chunk-PK2GC77E.js} +169 -51
- package/dist/chunks/{chunk-OTOIOHVE.js → chunk-XNOJEX55.js} +14 -5
- package/dist/color-picker.js +2 -2
- package/dist/components/chat/Chat.d.ts +11 -12
- package/dist/components/chat/chatContext.d.ts +2 -0
- package/dist/components/chat-list/ChatList.d.ts +191 -0
- package/dist/components/chat-list/formatChatTime.d.ts +6 -0
- package/dist/components/command-menu/CommandMenu.d.ts +10 -5
- package/dist/components/composer/Composer.d.ts +3 -10
- package/dist/components/data-table/DataTable.d.ts +16 -2
- package/dist/components/data-table/Row.d.ts +23 -7
- package/dist/components/data-table/StateRows.d.ts +5 -1
- package/dist/components/data-table/reorder.d.ts +3 -1
- package/dist/components/data-table/rows.d.ts +20 -4
- package/dist/components/file-upload/FileUpload.d.ts +7 -0
- package/dist/components/gantt/Gantt.d.ts +19 -1
- package/dist/components/gantt/GanttBar.d.ts +4 -1
- package/dist/components/gantt/GanttRow.d.ts +8 -1
- package/dist/components/index.d.ts +10 -8
- package/dist/components/kanban/Kanban.d.ts +17 -2
- package/dist/components/list/List.d.ts +18 -3
- package/dist/components/message/Message.d.ts +13 -0
- package/dist/components/message/MessageParts.d.ts +2 -0
- package/dist/components/modal/DialogParts.d.ts +5 -1
- package/dist/components/select/Select.d.ts +11 -5
- package/dist/components/select/SelectItem.d.ts +19 -0
- package/dist/components/select/selectContext.d.ts +4 -0
- package/dist/components/sparkline/Sparkline.d.ts +14 -3
- package/dist/components/textarea/Textarea.d.ts +11 -3
- package/dist/hooks/useUploadQueue.d.ts +5 -1
- package/dist/icons/registry.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.js +6 -2
- package/dist/internal/attachmentTile.d.ts +5 -1
- package/dist/internal/richText.d.ts +7 -2
- package/dist/internal/textFormatting.d.ts +52 -0
- package/dist/internal/textFormattingToolbar.d.ts +26 -0
- package/dist/skill/cheatsheet.md +12 -0
- package/dist/skill/choosing.md +5 -2
- package/dist/skill/components.md +5 -4
- package/dist/skill/composition.md +1 -1
- package/dist/skill/layouts.md +2 -0
- package/dist/skill/patterns/chat.module.css +0 -9
- package/dist/skill/patterns/chat.tsx +71 -25
- package/dist/skill/patterns/kanban-board.tsx +2 -8
- package/dist/skill/patterns/schedule.tsx +15 -3
- package/dist/skill/reference/components/chat/COMPONENT.md +13 -4
- package/dist/skill/reference/components/chat/examples/states.tsx +100 -0
- package/dist/skill/reference/components/chat-list/COMPONENT.md +256 -0
- package/dist/skill/reference/components/chat-list/examples/controlled.tsx +103 -0
- package/dist/skill/reference/components/chat-list/examples/examples.module.css +66 -0
- package/dist/skill/reference/components/chat-list/examples/live.tsx +133 -0
- package/dist/skill/reference/components/chat-list/examples/long-list.tsx +87 -0
- package/dist/skill/reference/components/chat-list/examples/narrow.tsx +88 -0
- package/dist/skill/reference/components/chat-list/examples/overview.tsx +194 -0
- package/dist/skill/reference/components/chat-list/examples/search.tsx +71 -0
- package/dist/skill/reference/components/chat-list/examples/sizes.tsx +61 -0
- package/dist/skill/reference/components/chat-list/examples/states.tsx +107 -0
- package/dist/skill/reference/components/chat-list/examples/structure.tsx +135 -0
- package/dist/skill/reference/components/command-menu/COMPONENT.md +15 -11
- package/dist/skill/reference/components/command-menu/examples/server-search.tsx +11 -9
- package/dist/skill/reference/components/composer/COMPONENT.md +8 -7
- package/dist/skill/reference/components/composer/examples/formatting.tsx +1 -1
- package/dist/skill/reference/components/confirm-dialog/COMPONENT.md +1 -0
- package/dist/skill/reference/components/data-table/COMPONENT.md +21 -6
- package/dist/skill/reference/components/data-table/examples/groups.tsx +2 -1
- package/dist/skill/reference/components/data-table/examples/trend.tsx +85 -0
- package/dist/skill/reference/components/drawer/COMPONENT.md +7 -6
- package/dist/skill/reference/components/drawer/examples/client-card.tsx +50 -0
- package/dist/skill/reference/components/fieldset/COMPONENT.md +1 -0
- package/dist/skill/reference/components/file-upload/COMPONENT.md +9 -7
- package/dist/skill/reference/components/file-upload/examples/overview.tsx +14 -3
- package/dist/skill/reference/components/gantt/COMPONENT.md +15 -5
- package/dist/skill/reference/components/gantt/examples/row-link.tsx +96 -0
- package/dist/skill/reference/components/kanban/COMPONENT.md +12 -4
- package/dist/skill/reference/components/kanban/examples/item-link.tsx +92 -0
- package/dist/skill/reference/components/list/COMPONENT.md +19 -4
- package/dist/skill/reference/components/list/examples/reorder.tsx +48 -0
- package/dist/skill/reference/components/message/COMPONENT.md +18 -2
- package/dist/skill/reference/components/message/examples/bot-actions.tsx +51 -0
- package/dist/skill/reference/components/modal/COMPONENT.md +6 -4
- package/dist/skill/reference/components/select/COMPONENT.md +38 -7
- package/dist/skill/reference/components/select/examples/create-action.tsx +107 -0
- package/dist/skill/reference/components/select/examples/saving.tsx +47 -0
- package/dist/skill/reference/components/sheet/COMPONENT.md +4 -4
- package/dist/skill/reference/components/sparkline/COMPONENT.md +16 -2
- package/dist/skill/reference/components/sparkline/examples/compact.tsx +41 -0
- package/dist/skill/reference/components/sparkline/examples/examples.module.css +12 -0
- package/dist/skill/reference/components/textarea/COMPONENT.md +22 -2
- package/dist/skill/reference/components/textarea/examples/formatting.tsx +20 -0
- package/package.json +2 -2
- package/src/components/chat/COMPONENT.md +13 -4
- package/src/components/chat/examples/states.tsx +100 -0
- package/src/components/chat-list/COMPONENT.md +256 -0
- package/src/components/chat-list/examples/controlled.tsx +103 -0
- package/src/components/chat-list/examples/examples.module.css +66 -0
- package/src/components/chat-list/examples/live.tsx +133 -0
- package/src/components/chat-list/examples/long-list.tsx +87 -0
- package/src/components/chat-list/examples/narrow.tsx +88 -0
- package/src/components/chat-list/examples/overview.tsx +194 -0
- package/src/components/chat-list/examples/search.tsx +71 -0
- package/src/components/chat-list/examples/sizes.tsx +61 -0
- package/src/components/chat-list/examples/states.tsx +107 -0
- package/src/components/chat-list/examples/structure.tsx +135 -0
- package/src/components/command-menu/COMPONENT.md +15 -11
- package/src/components/command-menu/examples/server-search.tsx +11 -9
- package/src/components/composer/COMPONENT.md +8 -7
- package/src/components/composer/examples/formatting.tsx +1 -1
- package/src/components/confirm-dialog/COMPONENT.md +1 -0
- package/src/components/data-table/COMPONENT.md +21 -6
- package/src/components/data-table/examples/groups.tsx +2 -1
- package/src/components/data-table/examples/trend.tsx +85 -0
- package/src/components/drawer/COMPONENT.md +7 -6
- package/src/components/drawer/examples/client-card.tsx +50 -0
- package/src/components/fieldset/COMPONENT.md +1 -0
- package/src/components/file-upload/COMPONENT.md +9 -7
- package/src/components/file-upload/examples/overview.tsx +14 -3
- package/src/components/gantt/COMPONENT.md +15 -5
- package/src/components/gantt/examples/row-link.tsx +96 -0
- package/src/components/kanban/COMPONENT.md +12 -4
- package/src/components/kanban/examples/item-link.tsx +92 -0
- package/src/components/list/COMPONENT.md +19 -4
- package/src/components/list/examples/reorder.tsx +48 -0
- package/src/components/message/COMPONENT.md +18 -2
- package/src/components/message/examples/bot-actions.tsx +51 -0
- package/src/components/modal/COMPONENT.md +6 -4
- package/src/components/select/COMPONENT.md +38 -7
- package/src/components/select/examples/create-action.tsx +107 -0
- package/src/components/select/examples/saving.tsx +47 -0
- package/src/components/sheet/COMPONENT.md +4 -4
- package/src/components/sparkline/COMPONENT.md +16 -2
- package/src/components/sparkline/examples/compact.tsx +41 -0
- package/src/components/sparkline/examples/examples.module.css +12 -0
- package/src/components/textarea/COMPONENT.md +22 -2
- package/src/components/textarea/examples/formatting.tsx +20 -0
- package/dist/components/composer/format.d.ts +0 -39
|
@@ -23,6 +23,8 @@ export type { ChartFrameActionsProps, ChartFrameDeltaProps, ChartFrameDescriptio
|
|
|
23
23
|
export { ChartFrame } from "./chart-frame/ChartFrame";
|
|
24
24
|
export type { ChatActionsProps, ChatDescriptionProps, ChatFooterProps, ChatHeaderProps, ChatLabels, ChatMessageEntry, ChatMessagesProps, ChatPinnedItem, ChatPinnedLabels, ChatPinnedProps, ChatRootProps, ChatSearchButtonProps, ChatSearchProps, ChatSelectionBarProps, ChatSeparatorProps, ChatServiceProps, ChatTitleProps, ChatUnreadLabels, ChatUnreadProps, GroupMessagesOptions, MessageListEntry, } from "./chat/Chat";
|
|
25
25
|
export { Chat, formatMessageDate, groupMessages } from "./chat/Chat";
|
|
26
|
+
export type { ChatListItemDescriptionProps, ChatListItemIconProps, ChatListItemMenuProps, ChatListItemProps, ChatListItemTextProps, ChatListLabels, ChatListMediaKind, ChatListRootProps, } from "./chat-list/ChatList";
|
|
27
|
+
export { ChatList, formatChatTime } from "./chat-list/ChatList";
|
|
26
28
|
export type { CheckboxIndicatorProps, CheckboxLabelProps, CheckboxRootProps, CheckboxShape, } from "./checkbox/Checkbox";
|
|
27
29
|
export { Checkbox } from "./checkbox/Checkbox";
|
|
28
30
|
export type { CodeBlockColorScheme, CodeBlockProps, CodeBlockVariant, } from "./code-block/CodeBlock";
|
|
@@ -33,7 +35,7 @@ export type { ColorSwatchesLabels, ColorSwatchesProps } from "./color-swatches/C
|
|
|
33
35
|
export { ColorSwatches } from "./color-swatches/ColorSwatches";
|
|
34
36
|
export type { CommandMenuDescriptionProps, CommandMenuEmptyProps, CommandMenuFooterHintProps, CommandMenuFooterProps, CommandMenuGroupProps, CommandMenuInputProps, CommandMenuItemIconProps, CommandMenuItemProps, CommandMenuItemShortcutProps, CommandMenuItemTextProps, CommandMenuLabels, CommandMenuListProps, CommandMenuRootProps, CommandMenuTitleProps, } from "./command-menu/CommandMenu";
|
|
35
37
|
export { CommandMenu } from "./command-menu/CommandMenu";
|
|
36
|
-
export type { ComposerActivity, ComposerAttachProps, ComposerContextMode, ComposerContextProps, ComposerDescriptionProps,
|
|
38
|
+
export type { ComposerActivity, ComposerAttachProps, ComposerContextMode, ComposerContextProps, ComposerDescriptionProps, ComposerItemIconProps, ComposerItemProps, ComposerLabels, ComposerMediaItem, ComposerMessage, ComposerQueue, ComposerRecording, ComposerRecordMode, ComposerRootProps, ComposerTitleProps, } from "./composer/Composer";
|
|
37
39
|
export { Composer } from "./composer/Composer";
|
|
38
40
|
export type { ConfirmDialogLabels, ConfirmDialogRootProps, ConfirmDialogTriggerProps, } from "./confirm-dialog/ConfirmDialog";
|
|
39
41
|
export { ConfirmDialog } from "./confirm-dialog/ConfirmDialog";
|
|
@@ -65,14 +67,14 @@ export type { FileUploadBodyProps, FileUploadDescriptionProps, FileUploadFile, F
|
|
|
65
67
|
export { FileUpload } from "./file-upload/FileUpload";
|
|
66
68
|
export type { GalleryItem, GalleryLabels, GalleryProps } from "./gallery/Gallery";
|
|
67
69
|
export { Gallery } from "./gallery/Gallery";
|
|
68
|
-
export type { GanttBar, GanttDates, GanttLabels, GanttProps, GanttScale, } from "./gantt/Gantt";
|
|
70
|
+
export type { GanttBar, GanttDates, GanttLabels, GanttProps, GanttRowClickEvent, GanttScale, } from "./gantt/Gantt";
|
|
69
71
|
export { Gantt } from "./gantt/Gantt";
|
|
70
72
|
export type { HintIconProps, HintRootProps } from "./hint/Hint";
|
|
71
73
|
export { Hint } from "./hint/Hint";
|
|
72
74
|
export type { InputActionProps, InputAffixProps, InputClearButtonProps, InputCopyButtonProps, InputCounterProps, InputFieldProps, InputIconProps, InputInlineAffixProps, InputLabels, InputRevealButtonProps, InputRootProps, InputWrapperProps, } from "./input/Input";
|
|
73
75
|
export { Input } from "./input/Input";
|
|
74
76
|
export { getPasswordStrength, type PasswordStrength } from "./input/passwordStrength";
|
|
75
|
-
export type { KanbanColumn, KanbanColumnMove, KanbanItemBadgesProps, KanbanItemCountProps, KanbanItemDescriptionProps, KanbanItemFooterProps, KanbanItemHeaderProps, KanbanItemProps, KanbanItemTitleProps, KanbanLabels, KanbanMove, KanbanRootProps, KanbanValue, KanbanVariant, } from "./kanban/Kanban";
|
|
77
|
+
export type { KanbanColumn, KanbanColumnMove, KanbanItemBadgesProps, KanbanItemClickEvent, KanbanItemCountProps, KanbanItemDescriptionProps, KanbanItemFooterProps, KanbanItemHeaderProps, KanbanItemProps, KanbanItemTitleProps, KanbanLabels, KanbanMove, KanbanRootProps, KanbanValue, KanbanVariant, } from "./kanban/Kanban";
|
|
76
78
|
export { Kanban } from "./kanban/Kanban";
|
|
77
79
|
export type { KbdProps } from "./kbd/Kbd";
|
|
78
80
|
export { Kbd } from "./kbd/Kbd";
|
|
@@ -80,14 +82,14 @@ export type { LabelDescriptionProps, LabelIconProps, LabelLabels, LabelRootProps
|
|
|
80
82
|
export { Label } from "./label/Label";
|
|
81
83
|
export type { LinkButtonProps } from "./link-button/LinkButton";
|
|
82
84
|
export { LinkButton } from "./link-button/LinkButton";
|
|
83
|
-
export type { ListItemCountProps, ListItemDescriptionProps, ListItemIconProps, ListItemMetaProps, ListItemProps, ListItemTextProps, ListRootProps, } from "./list/List";
|
|
85
|
+
export type { ListItemCountProps, ListItemDescriptionProps, ListItemIconProps, ListItemMetaProps, ListItemProps, ListItemTextProps, ListLabels, ListRootProps, } from "./list/List";
|
|
84
86
|
export { List } from "./list/List";
|
|
85
87
|
export type { LoginFormActionsProps, LoginFormBodyProps, LoginFormDescriptionProps, LoginFormFooterProps, LoginFormFormProps, LoginFormHeaderProps, LoginFormLogoProps, LoginFormRootProps, LoginFormTitleProps, } from "./login-form/LoginForm";
|
|
86
88
|
export { LoginForm } from "./login-form/LoginForm";
|
|
87
89
|
export type { MediaViewerItem, MediaViewerLabels, MediaViewerProps, } from "./media-viewer/MediaViewer";
|
|
88
90
|
export { MediaViewer } from "./media-viewer/MediaViewer";
|
|
89
91
|
export { formatMessageTime } from "./message/formatMessageTime";
|
|
90
|
-
export type { MessageAuthorIconProps, MessageAuthorProps, MessageAvatarProps, MessageDirection, MessageForwardedLabels, MessageForwardedProps, MessageLabels, MessageMenuProps, MessagePosition, MessageReaction, MessageReactionOption, MessageReactionsLabels, MessageReactionsProps, MessageReplyLabels, MessageReplyProps, MessageRootProps, MessageStatus, MessageTextProps, MessageTypingLabels, MessageTypingProps, MessageUser, } from "./message/Message";
|
|
92
|
+
export type { MessageActionsProps, MessageAuthorIconProps, MessageAuthorProps, MessageAvatarProps, MessageDirection, MessageForwardedLabels, MessageForwardedProps, MessageLabels, MessageMenuProps, MessagePosition, MessageReaction, MessageReactionOption, MessageReactionsLabels, MessageReactionsProps, MessageReplyLabels, MessageReplyProps, MessageRootProps, MessageStatus, MessageTextProps, MessageTypingLabels, MessageTypingProps, MessageUser, } from "./message/Message";
|
|
91
93
|
export { Message } from "./message/Message";
|
|
92
94
|
export type { MessageContactProps, MessageLinkPreviewProps, MessageLocationLabels, MessageLocationProps, } from "./message/MessageCards";
|
|
93
95
|
export type { MessageFileLabels, MessageFileProps } from "./message/MessageFile";
|
|
@@ -118,7 +120,7 @@ export type { ScrollContainerAxis, ScrollContainerEdges, ScrollContainerProps, }
|
|
|
118
120
|
export { ScrollContainer } from "./scroll-container/ScrollContainer";
|
|
119
121
|
export type { SegmentedControlCountProps, SegmentedControlDescriptionProps, SegmentedControlIconProps, SegmentedControlItemProps, SegmentedControlLabelProps, SegmentedControlLabels, SegmentedControlRootProps, } from "./segmented-control/SegmentedControl";
|
|
120
122
|
export { SegmentedControl } from "./segmented-control/SegmentedControl";
|
|
121
|
-
export type { SelectContentProps, SelectGroupProps, SelectItemDescriptionProps, SelectItemIconProps, SelectItemMetaProps, SelectItemProps, SelectItemTextProps, SelectLabels, SelectRootProps, SelectSeparatorProps, SelectTriggerIconProps, SelectTriggerProps, SelectValueItem, SelectValueProps, } from "./select/Select";
|
|
123
|
+
export type { SelectActionProps, SelectContentProps, SelectGroupProps, SelectItemDescriptionProps, SelectItemIconProps, SelectItemMetaProps, SelectItemProps, SelectItemTextProps, SelectLabels, SelectRootProps, SelectSeparatorProps, SelectTriggerIconProps, SelectTriggerProps, SelectValueItem, SelectValueProps, } from "./select/Select";
|
|
122
124
|
export { Select } from "./select/Select";
|
|
123
125
|
export * from "./sheet/Sheet";
|
|
124
126
|
export type { SkeletonProps, SkeletonShape } from "./skeleton/Skeleton";
|
|
@@ -127,7 +129,7 @@ export type { SliderLabels, SliderProps } from "./slider/Slider";
|
|
|
127
129
|
export { Slider } from "./slider/Slider";
|
|
128
130
|
export type { SmartFilterChipsProps, SmartFilterDateRangeField, SmartFilterField, SmartFilterFieldValue, SmartFilterLabels, SmartFilterMode, SmartFilterOption, SmartFilterOptionsField, SmartFilterRange, SmartFilterRangeField, SmartFilterRootProps, SmartFilterSelection, SmartFilterToolbarProps, SmartFilterValue, } from "./smart-filter/SmartFilter";
|
|
129
131
|
export { isSmartFilterRange, matchesSmartFilter, resolveSmartFilterValues, SmartFilter, } from "./smart-filter/SmartFilter";
|
|
130
|
-
export type { SparklineLabels, SparklinePoint, SparklineProps, SparklineVariant, } from "./sparkline/Sparkline";
|
|
132
|
+
export type { SparklineLabels, SparklineLayout, SparklinePoint, SparklineProps, SparklineVariant, } from "./sparkline/Sparkline";
|
|
131
133
|
export { Sparkline } from "./sparkline/Sparkline";
|
|
132
134
|
export type { SpinnerLabels, SpinnerProps } from "./spinner/Spinner";
|
|
133
135
|
export { Spinner } from "./spinner/Spinner";
|
|
@@ -138,7 +140,7 @@ export { Switch } from "./switch/Switch";
|
|
|
138
140
|
export * from "./tabs/Tabs";
|
|
139
141
|
export type { TagSelectLabels, TagSelectOption, TagSelectOptionUpdate, TagSelectProps, } from "./tag-select/TagSelect";
|
|
140
142
|
export { TagSelect } from "./tag-select/TagSelect";
|
|
141
|
-
export type { TextareaActionProps, TextareaCopyButtonProps, TextareaCounterProps, TextareaLabels, TextareaRootProps, } from "./textarea/Textarea";
|
|
143
|
+
export type { TextareaActionProps, TextareaCopyButtonProps, TextareaCounterProps, TextareaLabels, TextareaRootProps, TextFormat, } from "./textarea/Textarea";
|
|
142
144
|
export { Textarea } from "./textarea/Textarea";
|
|
143
145
|
export type { ThumbnailFallbackProps, ThumbnailImageProps, ThumbnailRatio, ThumbnailRootProps, ThumbnailVideoProps, } from "./thumbnail/Thumbnail";
|
|
144
146
|
export { Thumbnail } from "./thumbnail/Thumbnail";
|
|
@@ -32,6 +32,8 @@ export type KanbanColumnMove = {
|
|
|
32
32
|
id: string;
|
|
33
33
|
index: number;
|
|
34
34
|
};
|
|
35
|
+
/** What opened a card: a click on it, or Enter / Space on the focused card. */
|
|
36
|
+
export type KanbanItemClickEvent = React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
|
|
35
37
|
/** How columns stand on the board: filled wells, or bare columns of cards. */
|
|
36
38
|
export type KanbanVariant = "well" | "plain";
|
|
37
39
|
/** System strings of the board. `{token}` values are substituted. */
|
|
@@ -87,6 +89,18 @@ export type KanbanRootProps<T> = Omit<React.HTMLAttributes<HTMLDivElement>, "chi
|
|
|
87
89
|
reorderableColumns?: boolean;
|
|
88
90
|
/** Renders one card; return a `Kanban.Item`. */
|
|
89
91
|
renderItem: (item: T) => React.ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* The card is a link: a real `<a>` named by `getLabel` covers the card and is its tab stop, so a
|
|
94
|
+
* click, ⌘/Ctrl-click, a middle click and «open in new tab» work anywhere on it. A drag never
|
|
95
|
+
* follows it; Alt + arrows still move the card from it.
|
|
96
|
+
*/
|
|
97
|
+
getItemHref?: (item: T) => string;
|
|
98
|
+
/**
|
|
99
|
+
* Opens a card in place: a click on it (never on a control inside it, never after a drag) or
|
|
100
|
+
* Enter / Space on the focused card. With `getItemHref` it gets the plain clicks only — call
|
|
101
|
+
* `event.preventDefault()` there to route in the app instead of loading the page.
|
|
102
|
+
*/
|
|
103
|
+
onItemClick?: (item: T, event: KanbanItemClickEvent) => void;
|
|
90
104
|
/** Renders the trailing actions of a column header (add a card, a menu). */
|
|
91
105
|
renderColumnActions?: (column: KanbanColumn) => React.ReactNode;
|
|
92
106
|
/**
|
|
@@ -124,9 +138,10 @@ export type KanbanItemProps = Omit<React.HTMLAttributes<HTMLElement>, "id"> & {
|
|
|
124
138
|
};
|
|
125
139
|
/**
|
|
126
140
|
* One card: an `<li>` on a filled surface; drags by the whole card, moves with Alt + arrows. While
|
|
127
|
-
* the owner saves its move it is busy: dimmed under a spinner, still.
|
|
141
|
+
* the owner saves its move it is busy: dimmed under a spinner, still. With `getItemHref` a link
|
|
142
|
+
* covers it; with `onItemClick` a click, Enter or Space opens it.
|
|
128
143
|
*/
|
|
129
|
-
declare function KanbanItem({ disabled, className, children, ...rest }: KanbanItemProps): import("react/jsx-runtime").JSX.Element;
|
|
144
|
+
declare function KanbanItem({ disabled, className, children, onClick, onKeyDown, ...rest }: KanbanItemProps): import("react/jsx-runtime").JSX.Element;
|
|
130
145
|
declare namespace KanbanItem {
|
|
131
146
|
var displayName: string;
|
|
132
147
|
}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ControlSize, PaletteColor } from "../../internal/states";
|
|
3
|
-
export type
|
|
3
|
+
export type ListLabels = {
|
|
4
|
+
/** `aria-label` of a row's drag handle (`onReorder`); `{label}` is the row's text. */
|
|
5
|
+
reorderItem: string;
|
|
6
|
+
};
|
|
7
|
+
export type ListRootProps = Omit<React.HTMLAttributes<HTMLUListElement>, "children"> & {
|
|
4
8
|
/** Row tier: height, text, icon and avatar size; counts take one tier down. Default `m`. */
|
|
5
9
|
size?: ControlSize;
|
|
10
|
+
/**
|
|
11
|
+
* Rows reorder by a leading handle (drag, a touch hold, Alt + ↑ / ↓): the row `id` now stands
|
|
12
|
+
* in front of `beforeId` (`List.Item` `value`s; `null` — last). Apply it with `moveBefore`.
|
|
13
|
+
* Return a promise to save on a server: the row stays in its new place with a busy handle, a
|
|
14
|
+
* rejection moves it back. Every `List.Item` then needs a `value`.
|
|
15
|
+
*/
|
|
16
|
+
onReorder?: (id: string, beforeId: string | null) => void | Promise<void>;
|
|
17
|
+
/** Built-in strings. */
|
|
18
|
+
labels?: Partial<ListLabels>;
|
|
6
19
|
/** `List.Item`s. */
|
|
7
20
|
children?: React.ReactNode;
|
|
8
21
|
ref?: React.Ref<HTMLUListElement>;
|
|
@@ -11,7 +24,7 @@ export type ListRootProps = React.HTMLAttributes<HTMLUListElement> & {
|
|
|
11
24
|
* A selectable navigation list: the master half of a list + detail screen (conversations, tickets,
|
|
12
25
|
* mail, records). Rows are buttons or links; the open record is `current`.
|
|
13
26
|
*/
|
|
14
|
-
declare function ListRoot({ size, className, ...rest }: ListRootProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare function ListRoot({ size, onReorder, labels, className, children, ...rest }: ListRootProps): import("react/jsx-runtime").JSX.Element;
|
|
15
28
|
declare namespace ListRoot {
|
|
16
29
|
var displayName: string;
|
|
17
30
|
}
|
|
@@ -66,6 +79,8 @@ declare namespace ListItemCount {
|
|
|
66
79
|
var displayName: string;
|
|
67
80
|
}
|
|
68
81
|
type ListItemOwnProps = {
|
|
82
|
+
/** Stable id of the row; required in a reorderable list (`List.Root` `onReorder`). */
|
|
83
|
+
value?: string;
|
|
69
84
|
/**
|
|
70
85
|
* The open record: the selected fill and `aria-current` — `"true"` on a button, `"page"` on a
|
|
71
86
|
* link (`href`, `asChild`). Links rendered by a router may set it themselves.
|
|
@@ -89,7 +104,7 @@ export type ListItemProps = ListItemOwnProps & Omit<React.ComponentPropsWithoutR
|
|
|
89
104
|
ref?: React.Ref<HTMLElement>;
|
|
90
105
|
};
|
|
91
106
|
/** A row of the list: an `<li>` holding a full-width button or link. */
|
|
92
|
-
declare function ListItem({ current, disabled, asChild, href, className, children, onClick, type, ref, ...rest }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
declare function ListItem({ value, current, disabled, asChild, href, className, children, onClick, type, ref, ...rest }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
93
108
|
declare namespace ListItem {
|
|
94
109
|
var displayName: string;
|
|
95
110
|
}
|
|
@@ -20,6 +20,18 @@ export type MessageStatus = "sending" | "sent" | "read" | "failed";
|
|
|
20
20
|
*/
|
|
21
21
|
export type MessageShell = "bubble" | "media" | "round";
|
|
22
22
|
type AsyncEvent<T> = (value: T) => void | Promise<unknown>;
|
|
23
|
+
export type MessageActionsProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
24
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* A row of a bot's inline keyboard under the message: `Button.Root` children sharing the row
|
|
28
|
+
* equally, at the message's width (the bubble widens to the keyboard when it is wider). Several
|
|
29
|
+
* make several rows, in the order written. A row too narrow for its buttons wraps them.
|
|
30
|
+
*/
|
|
31
|
+
declare function MessageActions({ className, ...rest }: MessageActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare namespace MessageActions {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
23
35
|
export type MessageRootProps = Omit<React.HTMLAttributes<HTMLElement>, "role"> & {
|
|
24
36
|
/** The id of the message: selection, `onNewMessage`, `onRead`, `current`, `Message.Reply target`. */
|
|
25
37
|
value?: string;
|
|
@@ -78,6 +90,7 @@ export declare const Message: {
|
|
|
78
90
|
Contact: typeof MessageContact;
|
|
79
91
|
LinkPreview: typeof MessageLinkPreview;
|
|
80
92
|
Reactions: typeof MessageReactions;
|
|
93
|
+
Actions: typeof MessageActions;
|
|
81
94
|
Menu: typeof MessageMenu;
|
|
82
95
|
Typing: typeof MessageTyping;
|
|
83
96
|
};
|
|
@@ -124,8 +124,12 @@ export declare function DialogShellProvider({ value, children, }: {
|
|
|
124
124
|
children: React.ReactNode;
|
|
125
125
|
}): import("react/jsx-runtime").JSX.Element;
|
|
126
126
|
export type DialogIconProps = Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
127
|
-
/** Soft fill + text color of the role. Default `neutral`. */
|
|
127
|
+
/** Soft fill + text color of the role. Default `neutral`. Not used around a picture. */
|
|
128
128
|
tone?: Tone;
|
|
129
|
+
/**
|
|
130
|
+
* An `Icon` in a filled box of the role, or the record's picture — an `Avatar.Root` (sized to
|
|
131
|
+
* the box) or a `Thumbnail.Root` — with no box of its own.
|
|
132
|
+
*/
|
|
129
133
|
children: React.ReactNode;
|
|
130
134
|
ref?: React.Ref<HTMLSpanElement>;
|
|
131
135
|
};
|
|
@@ -2,9 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
import { type FieldFrameProps, type FieldRootDomProps } from "../../internal/FieldFrame";
|
|
3
3
|
import { type MenuGroupProps } from "../../internal/MenuGroup";
|
|
4
4
|
import type { ControlSize } from "../../internal/states";
|
|
5
|
-
import { SelectItem, SelectItemDescription, SelectItemIcon, SelectItemMeta, SelectItemText } from "./SelectItem";
|
|
5
|
+
import { SelectAction, SelectItem, SelectItemDescription, SelectItemIcon, SelectItemMeta, SelectItemText } from "./SelectItem";
|
|
6
6
|
import { type SelectLabels } from "./selectContext";
|
|
7
|
-
export type { SelectItemDescriptionProps, SelectItemIconProps, SelectItemMetaProps, SelectItemProps, SelectItemTextProps, } from "./SelectItem";
|
|
7
|
+
export type { SelectActionProps, SelectItemDescriptionProps, SelectItemIconProps, SelectItemMetaProps, SelectItemProps, SelectItemTextProps, } from "./SelectItem";
|
|
8
8
|
export type { SelectLabels } from "./selectContext";
|
|
9
9
|
type SelectRootBase = FieldRootDomProps & FieldFrameProps & {
|
|
10
10
|
size?: ControlSize;
|
|
@@ -55,15 +55,20 @@ type SelectSingleProps = {
|
|
|
55
55
|
multiple?: false;
|
|
56
56
|
value?: string;
|
|
57
57
|
defaultValue?: string;
|
|
58
|
-
/**
|
|
59
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Picked value; `""` after clearing. Return the save's promise: the value shows at once with a
|
|
60
|
+
* Spinner on the trigger and picks wait; resolve keeps it, reject rolls it back and announces
|
|
61
|
+
* `labels.changeFailed`.
|
|
62
|
+
*/
|
|
63
|
+
onValueChange?: (value: string) => void | Promise<void>;
|
|
60
64
|
};
|
|
61
65
|
type SelectMultipleProps = {
|
|
62
66
|
/** `string[]` value, checkboxes in the list, the list stays open on a pick. */
|
|
63
67
|
multiple: true;
|
|
64
68
|
value?: string[];
|
|
65
69
|
defaultValue?: string[];
|
|
66
|
-
|
|
70
|
+
/** The new list; a promise as in single mode. */
|
|
71
|
+
onValueChange?: (value: string[]) => void | Promise<void>;
|
|
67
72
|
};
|
|
68
73
|
export type SelectRootProps = SelectRootBase & (SelectSingleProps | SelectMultipleProps);
|
|
69
74
|
declare function SelectRoot(props: SelectRootProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -146,4 +151,5 @@ export declare const Select: {
|
|
|
146
151
|
ItemMeta: typeof SelectItemMeta;
|
|
147
152
|
Group: typeof SelectGroup;
|
|
148
153
|
Separator: typeof SelectSeparator;
|
|
154
|
+
Action: typeof SelectAction;
|
|
149
155
|
};
|
|
@@ -68,4 +68,23 @@ export declare function SelectItem({ value, label, keywords, disabled, className
|
|
|
68
68
|
export declare namespace SelectItem {
|
|
69
69
|
var displayName: string;
|
|
70
70
|
}
|
|
71
|
+
export declare const isActionValue: (value: string) => boolean;
|
|
72
|
+
export type SelectActionProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect" | "role" | "id" | "children"> & {
|
|
73
|
+
/** Runs the action: a click, or Enter / Space while it is highlighted; the list then closes. */
|
|
74
|
+
onSelect: () => void;
|
|
75
|
+
/** Muted, skipped by the keyboard, not runnable. */
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
/** The action text; an optional `Select.ItemIcon` in front. */
|
|
78
|
+
children: React.ReactNode;
|
|
79
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* A list-level action («Новый клиент»): pinned under the scroller, never filtered by the search,
|
|
83
|
+
* the last stop of the arrow keys. The listbox owns it (`aria-owns`), so it is an option of the
|
|
84
|
+
* list for assistive tech.
|
|
85
|
+
*/
|
|
86
|
+
export declare function SelectAction({ onSelect, disabled, className, children, onClick, onMouseMove, ref, ...rest }: SelectActionProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export declare namespace SelectAction {
|
|
88
|
+
var displayName: string;
|
|
89
|
+
}
|
|
71
90
|
export {};
|
|
@@ -16,6 +16,8 @@ export type SelectLabels = {
|
|
|
16
16
|
clear: string;
|
|
17
17
|
/** Muted marker after the label when `optional`. */
|
|
18
18
|
optional: string;
|
|
19
|
+
/** Announced when the `onValueChange` promise rejects and the value rolls back. */
|
|
20
|
+
changeFailed: string;
|
|
19
21
|
};
|
|
20
22
|
export declare const normalize: (text: string) => string;
|
|
21
23
|
/**
|
|
@@ -48,6 +50,8 @@ export type SelectContextValue = {
|
|
|
48
50
|
clear: () => void;
|
|
49
51
|
clearable: boolean;
|
|
50
52
|
loading: boolean;
|
|
53
|
+
/** A promise from `onValueChange` is pending: the trigger is busy, picks wait. */
|
|
54
|
+
saving: boolean;
|
|
51
55
|
loadingMore: boolean;
|
|
52
56
|
hasMore: boolean;
|
|
53
57
|
onLoadMore: (() => void | Promise<void>) | undefined;
|
|
@@ -10,13 +10,23 @@ export type SparklineLabels = {
|
|
|
10
10
|
};
|
|
11
11
|
/** `line`: a line with a soft area. `bars`: a bar per point from zero — up when positive, down when negative. */
|
|
12
12
|
export type SparklineVariant = "line" | "bars";
|
|
13
|
+
/**
|
|
14
|
+
* `default`: the headline (title · date, value · change) over the plot. `compact`: the plot alone at
|
|
15
|
+
* the height of an `xs` control, for a table cell or a list row.
|
|
16
|
+
*/
|
|
17
|
+
export type SparklineLayout = "default" | "compact";
|
|
13
18
|
export type SparklineProps = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
14
19
|
/** Points in order, oldest first; at least two draw a line. */
|
|
15
20
|
data: SparklinePoint[];
|
|
16
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Visible title above the value and the accessible name of the chart; with `layout="compact"`
|
|
23
|
+
* only the accessible name.
|
|
24
|
+
*/
|
|
17
25
|
label: string;
|
|
18
26
|
/** Default `line`. */
|
|
19
27
|
variant?: SparklineVariant;
|
|
28
|
+
/** Default `default`. */
|
|
29
|
+
layout?: SparklineLayout;
|
|
20
30
|
/**
|
|
21
31
|
* Index of the point at rest (the current month): the headline shows it when nobody scrubs, and
|
|
22
32
|
* `bars` draw the other bars quieter. Default: the latest point.
|
|
@@ -36,6 +46,7 @@ export type SparklineProps = Omit<React.HTMLAttributes<HTMLDivElement>, "childre
|
|
|
36
46
|
* A small chart with its headline: the value at rest (the latest point or `highlight`), its change
|
|
37
47
|
* against the point before and its date. Scrubbing (pointer, touch, or the arrow keys on the chart)
|
|
38
48
|
* shows any point; the header follows instantly, the trend arrow turns, and leaving glides back to
|
|
39
|
-
* the point at rest. `bars` draw signed values from a zero line.
|
|
49
|
+
* the point at rest. `bars` draw signed values from a zero line. `layout="compact"` is the plot
|
|
50
|
+
* alone (a table cell): the shown point is spoken through the slider's `aria-valuetext`.
|
|
40
51
|
*/
|
|
41
|
-
export declare function Sparkline({ data, label, variant, highlight, loading, formatValue, labels: labelsProp, className, ref, ...rest }: SparklineProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function Sparkline({ data, label, variant, layout, highlight, loading, formatValue, labels: labelsProp, className, ref, ...rest }: SparklineProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import { type FieldActionButtonProps } from "../../internal/FieldAction";
|
|
3
3
|
import { type FieldCommitHandler } from "../../internal/FieldCommit";
|
|
4
4
|
import type { ControlSize } from "../../internal/states";
|
|
5
|
-
|
|
5
|
+
import { type TextFormattingLabels } from "../../internal/textFormatting";
|
|
6
|
+
export type { TextFormat } from "../../internal/textFormatting";
|
|
7
|
+
/** Every built-in string; the formatting toolbar's names are shared with Composer. */
|
|
8
|
+
export type TextareaLabels = TextFormattingLabels & {
|
|
6
9
|
/** Muted marker after the label when `optional`. */
|
|
7
10
|
optional: string;
|
|
8
11
|
/** Screen-reader text of `Textarea.Counter`; `{current}` and `{max}` are replaced. */
|
|
@@ -59,6 +62,12 @@ export type TextareaRootProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
|
|
|
59
62
|
maxRows?: number;
|
|
60
63
|
/** Called with the new string value; native `onChange` still fires. */
|
|
61
64
|
onValueChange?: (value: string) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Markdown formatting, as in Composer: selecting text shows a floating toolbar (bold, italic,
|
|
67
|
+
* strikethrough, code, spoiler, link, quote) and enables the hotkeys; each writes Markdown around
|
|
68
|
+
* the selection.
|
|
69
|
+
*/
|
|
70
|
+
formatting?: boolean;
|
|
62
71
|
labels?: Partial<TextareaLabels>;
|
|
63
72
|
/** The native `<textarea>`. */
|
|
64
73
|
ref?: React.Ref<HTMLTextAreaElement>;
|
|
@@ -67,7 +76,7 @@ export type TextareaRootProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
|
|
|
67
76
|
* A multi-line field. `className` goes to the field frame, `id`, `ref` and the native attributes
|
|
68
77
|
* to the `<textarea>` (it has no `Field` part).
|
|
69
78
|
*/
|
|
70
|
-
declare function TextareaRoot({ id, className, size: sizeProp, invalid, focusRing, label, required, optional, hint, error, counter, reserveSupportRow, autoResize, rows, maxRows, disabled: disabledProp, readOnly, value, onInput, onChange, onValueChange, onFocus, onBlur, onKeyDown, onCommit, labels: labelsProp, "aria-describedby": ariaDescribedBy, children, ref, ...rest }: TextareaRootProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
declare function TextareaRoot({ id, className, size: sizeProp, invalid, focusRing, label, required, optional, hint, error, counter, reserveSupportRow, autoResize, rows, maxRows, disabled: disabledProp, readOnly, value, onInput, onChange, onValueChange, onFocus, onBlur, onKeyDown, onSelect, onCommit, formatting, labels: labelsProp, "aria-describedby": ariaDescribedBy, children, ref, ...rest }: TextareaRootProps): import("react/jsx-runtime").JSX.Element;
|
|
71
80
|
declare namespace TextareaRoot {
|
|
72
81
|
var displayName: string;
|
|
73
82
|
}
|
|
@@ -103,4 +112,3 @@ export declare const Textarea: {
|
|
|
103
112
|
CopyButton: typeof TextareaCopyButton;
|
|
104
113
|
Action: typeof TextareaAction;
|
|
105
114
|
};
|
|
106
|
-
export {};
|
|
@@ -23,6 +23,8 @@ export type UploadItem<TResult = unknown> = {
|
|
|
23
23
|
preview?: string;
|
|
24
24
|
};
|
|
25
25
|
export type UploadContext = {
|
|
26
|
+
/** The item's id: the same id `add` returned and the files of the set carry. */
|
|
27
|
+
id: string;
|
|
26
28
|
/** Aborted when the item is removed (or the queue unmounts): stop the request. */
|
|
27
29
|
signal: AbortSignal;
|
|
28
30
|
/** Reports the share sent, 0…1. */
|
|
@@ -31,7 +33,9 @@ export type UploadContext = {
|
|
|
31
33
|
export type UploadQueueOptions<TResult> = {
|
|
32
34
|
/**
|
|
33
35
|
* Sends one file. Resolve with what the server answered (kept as `result`); reject to mark the
|
|
34
|
-
* item failed — the rejection's message is shown as the reason.
|
|
36
|
+
* item failed — the rejection's message is shown as the reason. Work that must follow the upload
|
|
37
|
+
* (attach the file to a record, save the set) runs here after the request resolves:
|
|
38
|
+
* `context.id` is the item, and the item is `failed` if that work rejects.
|
|
35
39
|
*/
|
|
36
40
|
upload: (file: File, context: UploadContext) => Promise<TResult>;
|
|
37
41
|
/** How many files upload at once; the rest wait as `queued`. Default 3. */
|
package/dist/icons/registry.d.ts
CHANGED
|
@@ -74,6 +74,8 @@ export declare const iconRegistry: {
|
|
|
74
74
|
readonly "format.link": import("./glyph").Glyph;
|
|
75
75
|
readonly "format.list": import("./glyph").Glyph;
|
|
76
76
|
readonly "format.quote": import("./glyph").Glyph;
|
|
77
|
+
/** Hidden text (a spoiler) in text formatting; `field.password.hide` masks a password. */
|
|
78
|
+
readonly "format.spoiler": import("./glyph").Glyph;
|
|
77
79
|
readonly "format.strikethrough": import("./glyph").Glyph;
|
|
78
80
|
readonly "format.underline": import("./glyph").Glyph;
|
|
79
81
|
readonly "object.activity": import("./glyph").Glyph;
|