prime-ui-kit 0.17.0 → 0.18.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/README.md +2 -1
- package/dist/chunks/{chunk-PRP4B6OG.js → chunk-IVS3J7AS.js} +1 -1
- package/dist/chunks/{chunk-A4WE3UNC.js → chunk-MB4CXSLL.js} +18473 -17911
- package/dist/chunks/{chunk-7WWZYGRC.js → chunk-OAXJWF3L.js} +4477 -3882
- package/dist/chunks/{chunk-2ODXLPW3.js → chunk-QFHE5GKW.js} +1 -0
- package/dist/chunks/{chunk-SVFWPLNW.js → chunk-X3JT5CLR.js} +14 -3
- package/dist/color-picker.js +3 -3
- package/dist/components/badge/Badge.d.ts +17 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +11 -2
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button-group/ButtonGroup.d.ts +1 -1
- package/dist/components/card/Card.d.ts +8 -4
- package/dist/components/chat/Chat.d.ts +3 -3
- package/dist/components/chat/MessageList.d.ts +5 -1
- package/dist/components/chat/groupMessages.d.ts +12 -4
- package/dist/components/chat-list/ChatList.d.ts +18 -9
- package/dist/components/chat-list/formatChatTime.d.ts +3 -3
- package/dist/components/checkbox/Checkbox.d.ts +6 -1
- package/dist/components/color-field/ColorField.d.ts +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +6 -1
- package/dist/components/color-picker/ColorPresets.d.ts +9 -1
- package/dist/components/crossfade/Crossfade.d.ts +1 -1
- package/dist/components/data-table/DataTable.d.ts +2 -0
- package/dist/components/data-table/Head.d.ts +3 -1
- package/dist/components/data-table/types.d.ts +5 -0
- package/dist/components/digit-input/DigitInput.d.ts +1 -1
- package/dist/components/drawer/Drawer.d.ts +3 -2
- package/dist/components/field-list/FieldList.d.ts +18 -6
- package/dist/components/hint/Hint.d.ts +8 -2
- package/dist/components/index.d.ts +6 -3
- package/dist/components/input/Input.d.ts +27 -5
- package/dist/components/input/inputSuggestions.d.ts +39 -0
- package/dist/components/kanban/Kanban.d.ts +4 -9
- package/dist/components/list/List.d.ts +19 -5
- package/dist/components/message/Message.d.ts +15 -3
- package/dist/components/message/MessageSticker.d.ts +27 -0
- package/dist/components/message/formatMessageTime.d.ts +5 -2
- package/dist/components/modal/Modal.d.ts +3 -2
- package/dist/components/native-select/NativeSelect.d.ts +1 -1
- package/dist/components/radio/Radio.d.ts +11 -2
- package/dist/components/rich-text/RichText.d.ts +23 -0
- package/dist/components/scroll-container/ScrollContainer.d.ts +1 -1
- package/dist/components/scroll-container/scrollGlide.d.ts +26 -0
- package/dist/components/scroll-container/useScrollMotion.d.ts +25 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +1 -1
- package/dist/components/select/selectContext.d.ts +7 -0
- package/dist/components/slider/Slider.d.ts +1 -1
- package/dist/components/switch/Switch.d.ts +6 -1
- package/dist/components/tag-select/TagSelect.d.ts +1 -1
- package/dist/components/textarea/Textarea.d.ts +6 -1
- package/dist/components/timeline/Timeline.d.ts +1 -1
- package/dist/icon-set.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +5 -3
- package/dist/internal/ChoiceField.d.ts +3 -1
- package/dist/internal/FieldFrame.d.ts +8 -2
- package/dist/internal/fieldCell.d.ts +1 -1
- package/dist/internal/formatClock.d.ts +23 -2
- package/dist/internal/leaveGuard.d.ts +21 -0
- package/dist/internal/messageList.d.ts +2 -0
- package/dist/internal/overlay/DialogParts.d.ts +27 -2
- package/dist/internal/swatch.d.ts +5 -0
- package/dist/internal/tokenDefaults.d.ts +1 -0
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/page/Page.d.ts +47 -8
- package/dist/skill/anti-slop.md +5 -0
- package/dist/skill/api-contract.md +14 -7
- package/dist/skill/cheatsheet.md +22 -7
- package/dist/skill/checklist.md +5 -0
- package/dist/skill/choosing.md +25 -12
- package/dist/skill/components.md +1 -0
- package/dist/skill/composition.md +19 -5
- package/dist/skill/layouts.md +5 -3
- package/dist/skill/reference/components/badge/COMPONENT.md +14 -1
- package/dist/skill/reference/components/badge/examples/examples.module.css +7 -0
- package/dist/skill/reference/components/badge/examples/tag-row.tsx +34 -0
- package/dist/skill/reference/components/breadcrumb/COMPONENT.md +9 -4
- package/dist/skill/reference/components/breadcrumb/examples/router.tsx +17 -0
- package/dist/skill/reference/components/button/COMPONENT.md +1 -1
- package/dist/skill/reference/components/button-group/COMPONENT.md +1 -0
- package/dist/skill/reference/components/card/COMPONENT.md +7 -1
- package/dist/skill/reference/components/card/examples/states.tsx +59 -0
- package/dist/skill/reference/components/chat/COMPONENT.md +4 -1
- package/dist/skill/reference/components/chat/examples/time-zone.tsx +83 -0
- package/dist/skill/reference/components/chat-list/COMPONENT.md +12 -6
- package/dist/skill/reference/components/chat-list/examples/links.tsx +1 -1
- package/dist/skill/reference/components/chat-list/examples/router.tsx +63 -0
- package/dist/skill/reference/components/checkbox/COMPONENT.md +1 -0
- package/dist/skill/reference/components/color-field/COMPONENT.md +2 -1
- package/dist/skill/reference/components/color-picker/COMPONENT.md +14 -5
- package/dist/skill/reference/components/color-picker/examples/presets-custom.tsx +31 -0
- package/dist/skill/reference/components/color-swatches/COMPONENT.md +1 -0
- package/dist/skill/reference/components/crossfade/COMPONENT.md +1 -1
- package/dist/skill/reference/components/data-table/COMPONENT.md +7 -2
- package/dist/skill/reference/components/data-table/examples/numeric.tsx +9 -2
- package/dist/skill/reference/components/datepicker/COMPONENT.md +3 -1
- package/dist/skill/reference/components/datepicker/examples/deadline.tsx +33 -0
- package/dist/skill/reference/components/digit-input/COMPONENT.md +1 -0
- package/dist/skill/reference/components/drawer/COMPONENT.md +15 -2
- package/dist/skill/reference/components/drawer/examples/client-card.tsx +32 -8
- package/dist/skill/reference/components/field-list/COMPONENT.md +15 -3
- package/dist/skill/reference/components/field-list/examples/saving.tsx +83 -0
- package/dist/skill/reference/components/field-list/examples/totals.tsx +82 -0
- package/dist/skill/reference/components/file-upload/COMPONENT.md +1 -0
- package/dist/skill/reference/components/hint/COMPONENT.md +16 -2
- package/dist/skill/reference/components/hint/examples/variants.tsx +48 -0
- package/dist/skill/reference/components/input/COMPONENT.md +39 -9
- package/dist/skill/reference/components/input/examples/affixes.tsx +4 -2
- package/dist/skill/reference/components/input/examples/dismiss.tsx +29 -0
- package/dist/skill/reference/components/input/examples/suggestions.tsx +26 -0
- package/dist/skill/reference/components/input/examples/time.tsx +24 -0
- package/dist/skill/reference/components/input/examples/with-select.tsx +44 -0
- package/dist/skill/reference/components/kanban/COMPONENT.md +6 -6
- package/dist/skill/reference/components/kanban/examples/columns.tsx +4 -2
- package/dist/skill/reference/components/list/COMPONENT.md +23 -7
- package/dist/skill/reference/components/list/examples/row-controls.tsx +80 -0
- package/dist/skill/reference/components/list/examples/with-icon.tsx +23 -2
- package/dist/skill/reference/components/login-form/COMPONENT.md +8 -7
- package/dist/skill/reference/components/login-form/examples/states.tsx +12 -14
- package/dist/skill/reference/components/message/COMPONENT.md +30 -9
- package/dist/skill/reference/components/message/examples/preview.tsx +28 -0
- package/dist/skill/reference/components/message/examples/sticker.tsx +35 -0
- package/dist/skill/reference/components/modal/COMPONENT.md +15 -3
- package/dist/skill/reference/components/modal/examples/long-content.tsx +37 -18
- package/dist/skill/reference/components/native-select/COMPONENT.md +1 -0
- package/dist/skill/reference/components/notification/COMPONENT.md +1 -1
- package/dist/skill/reference/components/radio/COMPONENT.md +2 -0
- package/dist/skill/reference/components/rich-text/COMPONENT.md +93 -0
- package/dist/skill/reference/components/rich-text/examples/overview.tsx +19 -0
- package/dist/skill/reference/components/scroll-container/COMPONENT.md +8 -5
- package/dist/skill/reference/components/segmented-control/COMPONENT.md +1 -0
- package/dist/skill/reference/components/segmented-control/examples/in-form.tsx +1 -1
- package/dist/skill/reference/components/select/COMPONENT.md +7 -3
- package/dist/skill/reference/components/slider/COMPONENT.md +1 -0
- package/dist/skill/reference/components/slider/examples/controlled.tsx +1 -1
- package/dist/skill/reference/components/switch/COMPONENT.md +1 -0
- package/dist/skill/reference/components/tag-select/COMPONENT.md +1 -0
- package/dist/skill/reference/components/textarea/COMPONENT.md +1 -0
- package/dist/skill/reference/components/timeline/COMPONENT.md +3 -3
- package/dist/skill/reference/components/timeline/examples/structure.tsx +2 -1
- package/dist/skill/reference/layout/app-shell/COMPONENT.md +2 -2
- package/dist/skill/reference/layout/bottom-nav/COMPONENT.md +1 -0
- package/dist/skill/reference/layout/page/COMPONENT.md +37 -8
- package/dist/skill/reference/layout/page/examples/examples.module.css +7 -0
- package/dist/skill/reference/layout/page/examples/guard.tsx +87 -0
- package/dist/skill/reference/layout/page/examples/loading.tsx +57 -0
- package/dist/skill/reference/layout/sidebar/COMPONENT.md +1 -0
- package/dist/skill/responsive.md +12 -7
- package/dist/skill/ux.md +5 -3
- package/dist/tokens/semantic.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/badge/COMPONENT.md +14 -1
- package/src/components/badge/examples/examples.module.css +7 -0
- package/src/components/badge/examples/tag-row.tsx +34 -0
- package/src/components/breadcrumb/COMPONENT.md +9 -4
- package/src/components/breadcrumb/examples/router.tsx +17 -0
- package/src/components/button/COMPONENT.md +1 -1
- package/src/components/button-group/COMPONENT.md +1 -0
- package/src/components/card/COMPONENT.md +7 -1
- package/src/components/card/examples/states.tsx +59 -0
- package/src/components/chat/COMPONENT.md +4 -1
- package/src/components/chat/examples/time-zone.tsx +83 -0
- package/src/components/chat-list/COMPONENT.md +12 -6
- package/src/components/chat-list/examples/links.tsx +1 -1
- package/src/components/chat-list/examples/router.tsx +63 -0
- package/src/components/checkbox/COMPONENT.md +1 -0
- package/src/components/color-field/COMPONENT.md +2 -1
- package/src/components/color-picker/COMPONENT.md +14 -5
- package/src/components/color-picker/examples/presets-custom.tsx +31 -0
- package/src/components/color-swatches/COMPONENT.md +1 -0
- package/src/components/crossfade/COMPONENT.md +1 -1
- package/src/components/data-table/COMPONENT.md +7 -2
- package/src/components/data-table/examples/numeric.tsx +9 -2
- package/src/components/datepicker/COMPONENT.md +3 -1
- package/src/components/datepicker/examples/deadline.tsx +33 -0
- package/src/components/digit-input/COMPONENT.md +1 -0
- package/src/components/drawer/COMPONENT.md +15 -2
- package/src/components/drawer/examples/client-card.tsx +32 -8
- package/src/components/field-list/COMPONENT.md +15 -3
- package/src/components/field-list/examples/saving.tsx +83 -0
- package/src/components/field-list/examples/totals.tsx +82 -0
- package/src/components/file-upload/COMPONENT.md +1 -0
- package/src/components/hint/COMPONENT.md +16 -2
- package/src/components/hint/examples/variants.tsx +48 -0
- package/src/components/input/COMPONENT.md +39 -9
- package/src/components/input/examples/affixes.tsx +4 -2
- package/src/components/input/examples/dismiss.tsx +29 -0
- package/src/components/input/examples/suggestions.tsx +26 -0
- package/src/components/input/examples/time.tsx +24 -0
- package/src/components/input/examples/with-select.tsx +44 -0
- package/src/components/kanban/COMPONENT.md +6 -6
- package/src/components/kanban/examples/columns.tsx +4 -2
- package/src/components/list/COMPONENT.md +23 -7
- package/src/components/list/examples/row-controls.tsx +80 -0
- package/src/components/list/examples/with-icon.tsx +23 -2
- package/src/components/login-form/COMPONENT.md +8 -7
- package/src/components/login-form/examples/states.tsx +12 -14
- package/src/components/message/COMPONENT.md +30 -9
- package/src/components/message/examples/preview.tsx +28 -0
- package/src/components/message/examples/sticker.tsx +35 -0
- package/src/components/modal/COMPONENT.md +15 -3
- package/src/components/modal/examples/long-content.tsx +37 -18
- package/src/components/native-select/COMPONENT.md +1 -0
- package/src/components/notification/COMPONENT.md +1 -1
- package/src/components/radio/COMPONENT.md +2 -0
- package/src/components/rich-text/COMPONENT.md +93 -0
- package/src/components/rich-text/examples/overview.tsx +19 -0
- package/src/components/scroll-container/COMPONENT.md +8 -5
- package/src/components/segmented-control/COMPONENT.md +1 -0
- package/src/components/segmented-control/examples/in-form.tsx +1 -1
- package/src/components/select/COMPONENT.md +7 -3
- package/src/components/slider/COMPONENT.md +1 -0
- package/src/components/slider/examples/controlled.tsx +1 -1
- package/src/components/switch/COMPONENT.md +1 -0
- package/src/components/tag-select/COMPONENT.md +1 -0
- package/src/components/textarea/COMPONENT.md +1 -0
- package/src/components/timeline/COMPONENT.md +3 -3
- package/src/components/timeline/examples/structure.tsx +2 -1
- package/src/layout/app-shell/COMPONENT.md +2 -2
- package/src/layout/bottom-nav/COMPONENT.md +1 -0
- package/src/layout/page/COMPONENT.md +37 -8
- package/src/layout/page/examples/examples.module.css +7 -0
- package/src/layout/page/examples/guard.tsx +87 -0
- package/src/layout/page/examples/loading.tsx +57 -0
- package/src/layout/sidebar/COMPONENT.md +1 -0
- package/src/styles/theme-light.css +1 -0
- package/dist/components/scroll-container/useWheelToInline.d.ts +0 -10
|
@@ -6,7 +6,7 @@ export type { AccordionContentProps, AccordionHeaderProps, AccordionHeadingLevel
|
|
|
6
6
|
export { Accordion } from "./accordion/Accordion";
|
|
7
7
|
export type { AvatarFallbackProps, AvatarGroupProps, AvatarImageProps, AvatarOverflowProps, AvatarPresence, AvatarRootProps, AvatarSize, AvatarStatusLabels, AvatarStatusProps, } from "./avatar/Avatar";
|
|
8
8
|
export { Avatar } from "./avatar/Avatar";
|
|
9
|
-
export type { BadgeActionProps, BadgeDotProps, BadgeIconProps, BadgeLabels, BadgeRootProps, } from "./badge/Badge";
|
|
9
|
+
export type { BadgeActionProps, BadgeDotProps, BadgeGroupProps, BadgeIconProps, BadgeLabels, BadgeRootProps, } from "./badge/Badge";
|
|
10
10
|
export { Badge } from "./badge/Badge";
|
|
11
11
|
export type { BannerActionsProps, BannerContentProps, BannerDescriptionProps, BannerIconProps, BannerLabels, BannerRootProps, BannerTitleProps, } from "./banner/Banner";
|
|
12
12
|
export { Banner } from "./banner/Banner";
|
|
@@ -82,7 +82,7 @@ export type { LabelDescriptionProps, LabelIconProps, LabelLabels, LabelRootProps
|
|
|
82
82
|
export { Label } from "./label/Label";
|
|
83
83
|
export type { LinkButtonProps } from "./link-button/LinkButton";
|
|
84
84
|
export { LinkButton } from "./link-button/LinkButton";
|
|
85
|
-
export type { ListItemCountProps, ListItemDescriptionProps, ListItemIconProps, ListItemMetaProps, ListItemProps, ListItemTextProps, ListLabels, ListRootProps, } from "./list/List";
|
|
85
|
+
export type { ListItemActionsProps, ListItemCountProps, ListItemDescriptionProps, ListItemIconProps, ListItemMetaProps, ListItemProps, ListItemTextProps, ListLabels, ListRootProps, } from "./list/List";
|
|
86
86
|
export { List } from "./list/List";
|
|
87
87
|
export type { LoginFormActionsProps, LoginFormBodyProps, LoginFormDescriptionProps, LoginFormFooterProps, LoginFormFormProps, LoginFormHeaderProps, LoginFormLogoProps, LoginFormRootProps, LoginFormTitleProps, } from "./login-form/LoginForm";
|
|
88
88
|
export { LoginForm } from "./login-form/LoginForm";
|
|
@@ -94,7 +94,8 @@ export { Message } from "./message/Message";
|
|
|
94
94
|
export type { MessageContactProps, MessageLinkPreviewProps, MessageLocationLabels, MessageLocationProps, } from "./message/MessageCards";
|
|
95
95
|
export type { MessageFileLabels, MessageFileProps } from "./message/MessageFile";
|
|
96
96
|
export type { MessageMediaProps } from "./message/MessageMedia";
|
|
97
|
-
export type {
|
|
97
|
+
export type { MessageStickerProps } from "./message/MessageSticker";
|
|
98
|
+
export type { ModalActionsProps, ModalBodyProps, ModalCloseProps, ModalConfirmProps, ModalContentProps, ModalDescriptionProps, ModalFooterProps, ModalGuardProps, ModalHeaderProps, ModalIconProps, ModalLabels, ModalMetaProps, ModalPlacement, ModalRootProps, ModalSectionProps, ModalTitleProps, ModalTriggerProps, } from "./modal/Modal";
|
|
98
99
|
export { Modal } from "./modal/Modal";
|
|
99
100
|
export type { NativeSelectLabels, NativeSelectProps } from "./native-select/NativeSelect";
|
|
100
101
|
export { NativeSelect } from "./native-select/NativeSelect";
|
|
@@ -112,6 +113,8 @@ export type { ProgressCircleLabels, ProgressCircleProps, } from "./progress-circ
|
|
|
112
113
|
export { ProgressCircle } from "./progress-circle/ProgressCircle";
|
|
113
114
|
export type { RadioGroupLabels, RadioGroupProps, RadioLabelProps, RadioRootProps, } from "./radio/Radio";
|
|
114
115
|
export { Radio } from "./radio/Radio";
|
|
116
|
+
export type { RichTextLabels, RichTextProps } from "./rich-text/RichText";
|
|
117
|
+
export { RichText } from "./rich-text/RichText";
|
|
115
118
|
export type { ScrollContainerAxis, ScrollContainerEdges, ScrollContainerProps, } from "./scroll-container/ScrollContainer";
|
|
116
119
|
export { ScrollContainer } from "./scroll-container/ScrollContainer";
|
|
117
120
|
export type { SegmentedControlCountProps, SegmentedControlDescriptionProps, SegmentedControlIconProps, SegmentedControlItemProps, SegmentedControlLabelProps, SegmentedControlLabels, SegmentedControlRootProps, } from "./segmented-control/SegmentedControl";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { HintTone } from "../hint/Hint";
|
|
2
3
|
import { type FieldActionButtonProps } from "../../internal/FieldAction";
|
|
3
4
|
import { type FieldCommitHandler } from "../../internal/FieldCommit";
|
|
4
5
|
import { type FieldFocusRingProps, type FieldRootDomProps } from "../../internal/FieldFrame";
|
|
@@ -32,6 +33,11 @@ export type InputLabels = {
|
|
|
32
33
|
strengthHard: string;
|
|
33
34
|
};
|
|
34
35
|
export declare const INPUT_LABELS: InputLabels;
|
|
36
|
+
/**
|
|
37
|
+
* Inside `Input.Wrapper`: a Select there drops its own frame and draws its trigger as the box's
|
|
38
|
+
* start segment, so the pick and the text read as one field.
|
|
39
|
+
*/
|
|
40
|
+
export declare const InputSegmentContext: React.Context<boolean>;
|
|
35
41
|
export type InputRootProps = FieldRootDomProps & FieldFocusRingProps & {
|
|
36
42
|
/**
|
|
37
43
|
* Tier for height, padding, radius, text, label and hint. Without it the field takes the tier of its host (LoginForm, Popover, a panel with a size), else `m`. Also provided to nested controls via the control-size context.
|
|
@@ -57,6 +63,10 @@ export type InputRootProps = FieldRootDomProps & FieldFocusRingProps & {
|
|
|
57
63
|
* Help text under the field. Hidden while `error` is shown.
|
|
58
64
|
*/
|
|
59
65
|
hint?: React.ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* Status color of `hint` («Осталось 12 дней» in `warning`). The words carry the status, the color repeats it; an `error` replaces the hint and its tone. A validation error is `error`, never a `danger` hint.
|
|
68
|
+
*/
|
|
69
|
+
hintTone?: HintTone;
|
|
60
70
|
/**
|
|
61
71
|
* Error message in the hint slot; implies `invalid`.
|
|
62
72
|
*/
|
|
@@ -85,6 +95,18 @@ export type InputRootProps = FieldRootDomProps & FieldFocusRingProps & {
|
|
|
85
95
|
* Inline save: fires with a changed value on blur and Enter; Escape reverts. Return a Promise: the field shows a spinner and stays editable; a rejection restores the value — show why through `error`.
|
|
86
96
|
*/
|
|
87
97
|
onCommit?: FieldCommitHandler;
|
|
98
|
+
/**
|
|
99
|
+
* Suggestions for free text (a combobox): a list under the box shows those containing the text; a pick goes into the field as typing would. Any text stays allowed; a value from a list only is `Select`.
|
|
100
|
+
*/
|
|
101
|
+
suggestions?: readonly string[];
|
|
102
|
+
/**
|
|
103
|
+
* Escape closes the `suggestions` list; the text and the focus stay in the field.
|
|
104
|
+
*/
|
|
105
|
+
closeOnEscape?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* A press outside the field and the `suggestions` list closes the list.
|
|
108
|
+
*/
|
|
109
|
+
closeOnOutsideClick?: boolean;
|
|
88
110
|
/**
|
|
89
111
|
* Built-in strings, see Labels.
|
|
90
112
|
*/
|
|
@@ -94,7 +116,7 @@ export type InputRootProps = FieldRootDomProps & FieldFocusRingProps & {
|
|
|
94
116
|
*/
|
|
95
117
|
children: React.ReactNode;
|
|
96
118
|
};
|
|
97
|
-
declare function InputRoot({ size: sizeProp, invalid, focusRing, label, required, optional, hint, error, counter, reserveSupportRow, id, strength, getStrength, onCommit, labels: labelsProp, children, className, ...rest }: InputRootProps): import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
declare function InputRoot({ size: sizeProp, invalid, focusRing, label, required, optional, hint, hintTone, error, counter, reserveSupportRow, id, strength, getStrength, onCommit, suggestions, closeOnEscape, closeOnOutsideClick, labels: labelsProp, children, className, ...rest }: InputRootProps): import("react/jsx-runtime").JSX.Element;
|
|
98
120
|
declare namespace InputRoot {
|
|
99
121
|
var displayName: string;
|
|
100
122
|
}
|
|
@@ -105,7 +127,7 @@ export type InputWrapperProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
105
127
|
children: React.ReactNode;
|
|
106
128
|
ref?: React.Ref<HTMLDivElement>;
|
|
107
129
|
};
|
|
108
|
-
declare function InputWrapper({ children, className, ...rest }: InputWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
130
|
+
declare function InputWrapper({ children, className, ref, ...rest }: InputWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
109
131
|
declare namespace InputWrapper {
|
|
110
132
|
var displayName: string;
|
|
111
133
|
}
|
|
@@ -117,7 +139,7 @@ export type InputFieldProps = Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
117
139
|
ref?: React.Ref<HTMLInputElement>;
|
|
118
140
|
};
|
|
119
141
|
/** The `<input>`; its id comes from `Input.Root` so the label, hint and error stay linked. */
|
|
120
|
-
declare function InputField({ className, "aria-describedby": ariaDescribedBy, required, disabled: disabledProp, type, onChange, onValueChange, onFocus, onBlur, onKeyDown, ref, ...rest }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
142
|
+
declare function InputField({ className, "aria-describedby": ariaDescribedBy, required, disabled: disabledProp, type, onChange, onValueChange, onFocus, onBlur, onKeyDown, onClick, ref, ...rest }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
121
143
|
declare namespace InputField {
|
|
122
144
|
var displayName: string;
|
|
123
145
|
}
|
|
@@ -147,7 +169,7 @@ export type InputAffixProps = Omit<React.HTMLAttributes<HTMLDivElement>, "childr
|
|
|
147
169
|
children: React.ReactNode;
|
|
148
170
|
ref?: React.Ref<HTMLDivElement>;
|
|
149
171
|
};
|
|
150
|
-
declare function InputAffix({ side, children, className, ...rest }: InputAffixProps): import("react/jsx-runtime").JSX.Element;
|
|
172
|
+
declare function InputAffix({ side, children, className, id, "aria-label": spokenText, ...rest }: InputAffixProps): import("react/jsx-runtime").JSX.Element;
|
|
151
173
|
declare namespace InputAffix {
|
|
152
174
|
var displayName: string;
|
|
153
175
|
}
|
|
@@ -162,7 +184,7 @@ export type InputInlineAffixProps = Omit<React.HTMLAttributes<HTMLSpanElement>,
|
|
|
162
184
|
children: React.ReactNode;
|
|
163
185
|
ref?: React.Ref<HTMLSpanElement>;
|
|
164
186
|
};
|
|
165
|
-
declare function InputInlineAffix({ side, children, className, ...rest }: InputInlineAffixProps): import("react/jsx-runtime").JSX.Element;
|
|
187
|
+
declare function InputInlineAffix({ side, children, className, id, "aria-label": spokenText, ...rest }: InputInlineAffixProps): import("react/jsx-runtime").JSX.Element;
|
|
166
188
|
declare namespace InputInlineAffix {
|
|
167
189
|
var displayName: string;
|
|
168
190
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Store } from "../../internal/listbox";
|
|
3
|
+
import type { ControlSize } from "../../internal/states";
|
|
4
|
+
/** The suggestion list of a free-text field (`Input.Root suggestions`): a combobox. */
|
|
5
|
+
export type InputSuggestions = {
|
|
6
|
+
listboxId: string;
|
|
7
|
+
/** The name of the list: the field's label. */
|
|
8
|
+
labelledBy: string | undefined;
|
|
9
|
+
closeOnEscape: boolean;
|
|
10
|
+
closeOnOutsideClick: boolean;
|
|
11
|
+
/** The field box: the panel's anchor, as wide as it. */
|
|
12
|
+
anchorRef: React.RefObject<HTMLDivElement | null>;
|
|
13
|
+
matches: string[];
|
|
14
|
+
query: string;
|
|
15
|
+
shown: boolean;
|
|
16
|
+
highlight: Store<string | undefined>;
|
|
17
|
+
setOpen: (open: boolean) => void;
|
|
18
|
+
pick: (item: string) => void;
|
|
19
|
+
/** The input's combobox attributes and handlers, run after the consumer's. */
|
|
20
|
+
onInput: (value: string) => void;
|
|
21
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
22
|
+
onClick: () => void;
|
|
23
|
+
onBlur: () => void;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Suggestions under a free-text field: the field keeps the focus and its text is the value; the
|
|
27
|
+
* list shows the suggestions that contain the text, the arrows move a virtual highlight
|
|
28
|
+
* (`aria-activedescendant`), Enter or a press puts the highlighted one into the field (as typing
|
|
29
|
+
* would), Escape closes the list. `null` without suggestions.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useInputSuggestions(items: readonly string[] | undefined, inputRef: React.RefObject<HTMLInputElement | null>, listboxId: string, labelledBy: string | undefined, { closeOnEscape, closeOnOutsideClick }: {
|
|
32
|
+
closeOnEscape: boolean;
|
|
33
|
+
closeOnOutsideClick: boolean;
|
|
34
|
+
}): InputSuggestions | null;
|
|
35
|
+
/** The floating list of an `Input.Root` with `suggestions`, anchored to the field box. */
|
|
36
|
+
export declare function InputSuggestionList({ suggest, size, }: {
|
|
37
|
+
suggest: InputSuggestions;
|
|
38
|
+
size: ControlSize;
|
|
39
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -126,9 +126,9 @@ export type KanbanRootProps<T> = Omit<React.HTMLAttributes<HTMLDivElement>, "chi
|
|
|
126
126
|
*/
|
|
127
127
|
renderColumnActions?: (column: KanbanColumn) => React.ReactNode;
|
|
128
128
|
/**
|
|
129
|
-
* The meta
|
|
129
|
+
* The meta under a column's title and description: the stage's figures («12 сделок · 4,8 млн ₽»); an array is a line per entry, in order. Describes the column's list.
|
|
130
130
|
*/
|
|
131
|
-
renderColumnMeta?: (column: KanbanColumn) => React.ReactNode;
|
|
131
|
+
renderColumnMeta?: (column: KanbanColumn) => React.ReactNode | readonly React.ReactNode[];
|
|
132
132
|
/**
|
|
133
133
|
* A workflow rule: refuses card `id` in column `columnId` — `false`, or a string that says why (spoken and shown under the carried card). The column turns `danger` before the release.
|
|
134
134
|
*/
|
|
@@ -151,11 +151,6 @@ export type KanbanRootProps<T> = Omit<React.HTMLAttributes<HTMLDivElement>, "chi
|
|
|
151
151
|
labels?: Partial<KanbanLabels>;
|
|
152
152
|
ref?: React.Ref<HTMLDivElement>;
|
|
153
153
|
};
|
|
154
|
-
/**
|
|
155
|
-
* A board of columns: cards move within and between columns by pointer, touch (a hold) and
|
|
156
|
-
* keyboard (Alt + arrows, Dnd's linked lists). Its `Dnd.Root` joins a drag session already above
|
|
157
|
-
* it.
|
|
158
|
-
*/
|
|
159
154
|
declare function KanbanRoot<T>(props: KanbanRootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
160
155
|
declare namespace KanbanRoot {
|
|
161
156
|
var displayName: string;
|
|
@@ -206,8 +201,8 @@ declare namespace KanbanItemDescription {
|
|
|
206
201
|
export type KanbanItemBadgesProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
207
202
|
ref?: React.Ref<HTMLDivElement>;
|
|
208
203
|
};
|
|
209
|
-
/** A wrapping row of `Badge`s: labels, priority. */
|
|
210
|
-
declare function KanbanItemBadges(
|
|
204
|
+
/** A wrapping row of `Badge`s: labels, priority (a `Badge.Group`). */
|
|
205
|
+
declare function KanbanItemBadges(props: KanbanItemBadgesProps): import("react/jsx-runtime").JSX.Element;
|
|
211
206
|
declare namespace KanbanItemBadges {
|
|
212
207
|
var displayName: string;
|
|
213
208
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type ControlSize, type PaletteColor } from "../../internal/states";
|
|
3
3
|
export type ListLabels = {
|
|
4
4
|
/** `aria-label` of a row's drag handle (`onReorder`); `{label}` is the row's text. */
|
|
5
5
|
reorderItem: string;
|
|
@@ -35,14 +35,15 @@ declare namespace ListRoot {
|
|
|
35
35
|
}
|
|
36
36
|
export type ListItemIconProps = Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
37
37
|
/**
|
|
38
|
-
* An `Avatar.Root` or
|
|
38
|
+
* An `Avatar.Root`, an `Icon`, or a `Badge.Dot` with `color` (a stage, a project): the large dot.
|
|
39
39
|
*/
|
|
40
40
|
children: React.ReactNode;
|
|
41
41
|
ref?: React.Ref<HTMLSpanElement>;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
|
-
* The leading picture of a row: an avatar of the row tier,
|
|
45
|
-
*
|
|
44
|
+
* The leading picture of a row: an avatar of the row tier, an icon, or a colour dot
|
|
45
|
+
* (`Badge.Dot color`) in a box as wide as an icon, so the rows' text lines up. After the text it is
|
|
46
|
+
* a quiet trailing glyph. Decorative: the text names the row.
|
|
46
47
|
*/
|
|
47
48
|
declare function ListItemIcon({ className, children, ...rest }: ListItemIconProps): import("react/jsx-runtime").JSX.Element;
|
|
48
49
|
declare namespace ListItemIcon {
|
|
@@ -88,6 +89,18 @@ declare function ListItemCount({ color, className, ...rest }: ListItemCountProps
|
|
|
88
89
|
declare namespace ListItemCount {
|
|
89
90
|
var displayName: string;
|
|
90
91
|
}
|
|
92
|
+
export type ListItemActionsProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
93
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The row's own controls (a Switch, a Dropdown with its icon Button, an icon Button): at the end of
|
|
97
|
+
* the row, beside its button or link and never inside it, one tier below the row. The row's fills
|
|
98
|
+
* cover them.
|
|
99
|
+
*/
|
|
100
|
+
declare function ListItemActions({ className, ...rest }: ListItemActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
declare namespace ListItemActions {
|
|
102
|
+
var displayName: string;
|
|
103
|
+
}
|
|
91
104
|
type ListItemOwnProps = {
|
|
92
105
|
/**
|
|
93
106
|
* Stable id of the row; required in a reorderable list (`onReorder` reports it).
|
|
@@ -106,7 +119,7 @@ type ListItemOwnProps = {
|
|
|
106
119
|
*/
|
|
107
120
|
asChild?: boolean;
|
|
108
121
|
/**
|
|
109
|
-
* `List.ItemIcon`, `List.ItemText`, `List.ItemDescription`, `List.ItemMeta`, `List.ItemCount`; loose text becomes the text line.
|
|
122
|
+
* `List.ItemIcon`, `List.ItemText`, `List.ItemDescription`, `List.ItemMeta`, `List.ItemCount`, `List.ItemActions`; loose text becomes the text line.
|
|
110
123
|
*/
|
|
111
124
|
children?: React.ReactNode;
|
|
112
125
|
};
|
|
@@ -138,5 +151,6 @@ export declare const List: {
|
|
|
138
151
|
ItemDescription: typeof ListItemDescription;
|
|
139
152
|
ItemMeta: typeof ListItemMeta;
|
|
140
153
|
ItemCount: typeof ListItemCount;
|
|
154
|
+
ItemActions: typeof ListItemActions;
|
|
141
155
|
};
|
|
142
156
|
export {};
|
|
@@ -4,6 +4,7 @@ import { MessageContact, MessageLinkPreview, MessageLocation } from "./MessageCa
|
|
|
4
4
|
import { MessageFile } from "./MessageFile";
|
|
5
5
|
import { MessageMedia } from "./MessageMedia";
|
|
6
6
|
import { MessageAuthor, MessageAuthorIcon, MessageAvatar, MessageForwarded, type MessageLabels, MessageMenu, MessageReactions, MessageReply, MessageText } from "./MessageParts";
|
|
7
|
+
import { MessageSticker } from "./MessageSticker";
|
|
7
8
|
import { MessageTyping } from "./MessageTyping";
|
|
8
9
|
import type { MessageDirection, MessagePosition } from "./types";
|
|
9
10
|
export type { MessageAuthorIconProps, MessageAuthorProps, MessageAvatarProps, MessageForwardedLabels, MessageForwardedProps, MessageLabels, MessageMenuProps, MessageReaction, MessageReactionsLabels, MessageReactionsProps, MessageReplyLabels, MessageReplyProps, MessageTextProps, } from "./MessageParts";
|
|
@@ -50,9 +51,13 @@ export type MessageRootProps = Omit<React.HTMLAttributes<HTMLElement>, "role"> &
|
|
|
50
51
|
*/
|
|
51
52
|
time?: Date | string;
|
|
52
53
|
/**
|
|
53
|
-
*
|
|
54
|
+
* The IANA zone the time is read in (`"Asia/Vladivostok"`): a profile's zone, not the browser's.
|
|
54
55
|
*/
|
|
55
|
-
|
|
56
|
+
timeZone?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Display of a `Date` time; gets the `timeZone` in force.
|
|
59
|
+
*/
|
|
60
|
+
formatTime?: (date: Date, timeZone?: string) => string;
|
|
56
61
|
/**
|
|
57
62
|
* The text was edited: `labels.edited` before the time.
|
|
58
63
|
*/
|
|
@@ -61,6 +66,10 @@ export type MessageRootProps = Omit<React.HTMLAttributes<HTMLElement>, "role"> &
|
|
|
61
66
|
* Delivery of an outgoing message: a clock, one check, two checks (accent), or a danger mark; the glyphs cross-fade from one state to the next. Named for assistive tech by `labels`.
|
|
62
67
|
*/
|
|
63
68
|
status?: MessageStatus;
|
|
69
|
+
/**
|
|
70
|
+
* A picture of the message outside a chat (a bot's settings): no menu, reactions, retry or row focus, `Message.Actions` inert; links and players still work.
|
|
71
|
+
*/
|
|
72
|
+
preview?: boolean;
|
|
64
73
|
/**
|
|
65
74
|
* Sends a failed message again: a ghost danger button beside the bubble. A returned promise shows `sending` until it settles; a rejection leaves it failed.
|
|
66
75
|
*/
|
|
@@ -82,8 +91,10 @@ export type MessageRootProps = Omit<React.HTMLAttributes<HTMLElement>, "role"> &
|
|
|
82
91
|
* reactions row, a transcript) is a disclosure that glides in layout. The row is a `role="article"`
|
|
83
92
|
* named «{author}, {time}» (an `option` in selection mode); right click, a long press, Enter or
|
|
84
93
|
* Shift+F10 open `Message.Menu` where the pointer is; a double tap puts the chat's quick reaction.
|
|
94
|
+
* A `preview` is the same message as a picture of itself: no menu, reactions, retry or row focus,
|
|
95
|
+
* its inline keyboard inert; its content (links, players, spoilers) still works.
|
|
85
96
|
*/
|
|
86
|
-
declare function MessageRoot({ value: valueProp, direction, position, time: timeProp, formatTime, edited, status, onRetry, onReactionToggle, labels: labelsProp, className, style, children, onContextMenu, onKeyDown, onPointerDown, onMouseDown, onClick, onDoubleClick, "aria-label": ariaLabel, ref, ...rest }: MessageRootProps): import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
declare function MessageRoot({ value: valueProp, direction, position, time: timeProp, timeZone: timeZoneProp, formatTime, edited, status, preview, onRetry, onReactionToggle, labels: labelsProp, className, style, children, onContextMenu, onKeyDown, onPointerDown, onMouseDown, onClick, onDoubleClick, "aria-label": ariaLabel, ref, ...rest }: MessageRootProps): import("react/jsx-runtime").JSX.Element;
|
|
87
98
|
declare namespace MessageRoot {
|
|
88
99
|
var displayName: string;
|
|
89
100
|
}
|
|
@@ -100,6 +111,7 @@ export declare const Message: {
|
|
|
100
111
|
Location: typeof MessageLocation;
|
|
101
112
|
Contact: typeof MessageContact;
|
|
102
113
|
LinkPreview: typeof MessageLinkPreview;
|
|
114
|
+
Sticker: typeof MessageSticker;
|
|
103
115
|
Reactions: typeof MessageReactions;
|
|
104
116
|
Actions: typeof MessageActions;
|
|
105
117
|
Menu: typeof MessageMenu;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type MessageStickerProps = Omit<React.HTMLAttributes<HTMLDivElement>, "role" | "aria-label"> & {
|
|
3
|
+
/**
|
|
4
|
+
* A still or animated picture (webp, gif, apng), decoded before it shows. Without it the children are the sticker.
|
|
5
|
+
*/
|
|
6
|
+
src?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Your player in the children is not ready yet: the `Skeleton` stays over the box.
|
|
9
|
+
*/
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The sticker's name («Стикер «Класс»», or its emoji); shown in its box when `src` fails.
|
|
13
|
+
*/
|
|
14
|
+
"aria-label": string;
|
|
15
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A sticker: a square picture with no bubble, the meta on a pill over its corner. The kit draws a
|
|
19
|
+
* still or animated image from `src` (webp, gif, apng); any other format — a Lottie (.tgs) or a
|
|
20
|
+
* video sticker — is the consumer's own player as children, which the sticker sizes to its box
|
|
21
|
+
* (the kit has no runtime dependencies). A `Skeleton` holds the box until the picture is decoded
|
|
22
|
+
* or `loading` ends, then fades out; a picture that fails shows its name instead.
|
|
23
|
+
*/
|
|
24
|
+
export declare function MessageSticker({ src, loading, className, children, "aria-label": ariaLabel, ref, ...rest }: MessageStickerProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare namespace MessageSticker {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* «09:05»: hours and minutes, 24-hour, in `timeZone` or the browser's zone — the default
|
|
3
|
+
* `Message.Root formatTime`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatMessageTime(date: Date, timeZone?: string): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DialogGuard } from "../../internal/overlay/DialogGuard";
|
|
2
|
-
import { DialogActions, DialogBody, DialogClose, DialogConfirm, DialogDescription, DialogFooter, DialogHeader, DialogIcon, DialogMeta, DialogTitle, DialogTrigger } from "../../internal/overlay/DialogParts";
|
|
2
|
+
import { DialogActions, DialogBody, DialogClose, DialogConfirm, DialogDescription, DialogFooter, DialogHeader, DialogIcon, DialogMeta, DialogSection, DialogTitle, DialogTrigger } from "../../internal/overlay/DialogParts";
|
|
3
3
|
import { ModalContent, ModalRoot } from "../../internal/overlay/ModalDialog";
|
|
4
4
|
export type { DialogGuardProps as ModalGuardProps } from "../../internal/overlay/DialogGuard";
|
|
5
|
-
export type { DialogActionsProps as ModalActionsProps, DialogBodyProps as ModalBodyProps, DialogCloseProps as ModalCloseProps, DialogConfirmProps as ModalConfirmProps, DialogDescriptionProps as ModalDescriptionProps, DialogFooterProps as ModalFooterProps, DialogHeaderProps as ModalHeaderProps, DialogIconProps as ModalIconProps, DialogMetaProps as ModalMetaProps, DialogTitleProps as ModalTitleProps, DialogTriggerProps as ModalTriggerProps, } from "../../internal/overlay/DialogParts";
|
|
5
|
+
export type { DialogActionsProps as ModalActionsProps, DialogBodyProps as ModalBodyProps, DialogCloseProps as ModalCloseProps, DialogConfirmProps as ModalConfirmProps, DialogDescriptionProps as ModalDescriptionProps, DialogFooterProps as ModalFooterProps, DialogHeaderProps as ModalHeaderProps, DialogIconProps as ModalIconProps, DialogMetaProps as ModalMetaProps, DialogSectionProps as ModalSectionProps, DialogTitleProps as ModalTitleProps, DialogTriggerProps as ModalTriggerProps, } from "../../internal/overlay/DialogParts";
|
|
6
6
|
export type { ModalContentProps, ModalLabels, ModalPlacement, ModalRootProps, } from "../../internal/overlay/ModalDialog";
|
|
7
7
|
export declare const Modal: {
|
|
8
8
|
Root: typeof ModalRoot;
|
|
@@ -14,6 +14,7 @@ export declare const Modal: {
|
|
|
14
14
|
Description: typeof DialogDescription;
|
|
15
15
|
Actions: typeof DialogActions;
|
|
16
16
|
Body: typeof DialogBody;
|
|
17
|
+
Section: typeof DialogSection;
|
|
17
18
|
Footer: typeof DialogFooter;
|
|
18
19
|
Meta: typeof DialogMeta;
|
|
19
20
|
Close: typeof DialogClose;
|
|
@@ -37,7 +37,7 @@ export type NativeSelectProps = FieldFrameProps & FieldFocusRingProps & Omit<Rea
|
|
|
37
37
|
* The system `<select>` in the field look: the OS picker opens on touch devices. Options are
|
|
38
38
|
* plain `<option>` / `<optgroup>` elements.
|
|
39
39
|
*/
|
|
40
|
-
export declare function NativeSelect({ size: sizeProp, label, required, optional, hint, error, invalid, focusRing, disabled: disabledProp, placeholder, id, value, defaultValue, onChange, onValueChange, labels: labelsProp, className, children, "aria-describedby": ariaDescribedBy, ...rest }: NativeSelectProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
40
|
+
export declare function NativeSelect({ size: sizeProp, label, required, optional, hint, hintTone, error, invalid, focusRing, disabled: disabledProp, placeholder, id, value, defaultValue, onChange, onValueChange, labels: labelsProp, className, children, "aria-describedby": ariaDescribedBy, ...rest }: NativeSelectProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
41
41
|
export declare namespace NativeSelect {
|
|
42
42
|
var displayName: string;
|
|
43
43
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { HintTone } from "../hint/Hint";
|
|
2
3
|
import { type ChoiceLabelProps } from "../../internal/ChoiceField";
|
|
3
4
|
import { type FieldRootDomProps } from "../../internal/FieldFrame";
|
|
4
5
|
import type { ControlSize } from "../../internal/states";
|
|
@@ -48,6 +49,10 @@ export type RadioGroupProps = Omit<FieldRootDomProps, "dir"> & {
|
|
|
48
49
|
* Help text under the options. Hidden while `error` is shown.
|
|
49
50
|
*/
|
|
50
51
|
hint?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Status color of `hint` («Осталось 12 дней» in `warning`). The words carry the status, the color repeats it; an `error` replaces the hint and its tone. A validation error is `error`, never a `danger` hint.
|
|
54
|
+
*/
|
|
55
|
+
hintTone?: HintTone;
|
|
51
56
|
/**
|
|
52
57
|
* Error message under the options; implies `invalid`.
|
|
53
58
|
*/
|
|
@@ -77,7 +82,7 @@ export type RadioGroupProps = Omit<FieldRootDomProps, "dir"> & {
|
|
|
77
82
|
* The field: label · radiogroup · hint or error. `className`, `ref` and the rest go to the frame,
|
|
78
83
|
* `id` and the `aria-label*` / `aria-describedby` names to the radiogroup.
|
|
79
84
|
*/
|
|
80
|
-
declare function RadioGroup({ id, value: valueProp, defaultValue, onValueChange, name: nameProp, size: sizeProp, disabled: disabledProp, label, required, optional, hint, error, invalid, orientation, labels: labelsProp, className, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, children, ...rest }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
declare function RadioGroup({ id, value: valueProp, defaultValue, onValueChange, name: nameProp, size: sizeProp, disabled: disabledProp, label, required, optional, hint, hintTone, error, invalid, orientation, labels: labelsProp, className, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, children, ...rest }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
81
86
|
declare namespace RadioGroup {
|
|
82
87
|
var displayName: string;
|
|
83
88
|
}
|
|
@@ -90,13 +95,17 @@ export type RadioRootProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
|
90
95
|
* Description under the option text, linked through `aria-describedby`.
|
|
91
96
|
*/
|
|
92
97
|
hint?: React.ReactNode;
|
|
98
|
+
/**
|
|
99
|
+
* Status color of `hint` («Осталось 12 дней» in `warning`). The words carry the status, the color repeats it; an `error` replaces the hint and its tone. A validation error is `error`, never a `danger` hint.
|
|
100
|
+
*/
|
|
101
|
+
hintTone?: HintTone;
|
|
93
102
|
/**
|
|
94
103
|
* `Radio.Label`. Without it only the circle renders — give the root an `aria-label`.
|
|
95
104
|
*/
|
|
96
105
|
children?: React.ReactNode;
|
|
97
106
|
ref?: React.Ref<HTMLInputElement>;
|
|
98
107
|
};
|
|
99
|
-
declare function RadioRoot({ id, value, hint, disabled: disabledProp, className, "aria-describedby": ariaDescribedBy, children, ref, ...inputRest }: RadioRootProps): import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
declare function RadioRoot({ id, value, hint, hintTone, disabled: disabledProp, className, "aria-describedby": ariaDescribedBy, children, ref, ...inputRest }: RadioRootProps): import("react/jsx-runtime").JSX.Element;
|
|
100
109
|
declare namespace RadioRoot {
|
|
101
110
|
var displayName: string;
|
|
102
111
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type RichTextLabels = {
|
|
3
|
+
/** The name of a masked `||spoiler||` until it is revealed. */
|
|
4
|
+
spoiler: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const RICH_TEXT_LABELS: RichTextLabels;
|
|
7
|
+
export type RichTextProps = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
8
|
+
/**
|
|
9
|
+
* The source: `**bold**`, `_italic_`, `~~strike~~`, `||spoiler||`, inline and fenced code, links (`[label]` then the address in parentheses), bare URLs, `> ` quotes; line breaks are kept.
|
|
10
|
+
*/
|
|
11
|
+
children: string;
|
|
12
|
+
/**
|
|
13
|
+
* Built-in strings, see Labels.
|
|
14
|
+
*/
|
|
15
|
+
labels?: Partial<RichTextLabels>;
|
|
16
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Text in the chat's Markdown subset outside a message (a bot's welcome text, a template, a
|
|
20
|
+
* comment): bold, italic, strike, spoiler, inline and fenced code, links, quotes, kept line breaks —
|
|
21
|
+
* the same rendering as `Message.Text`, as React elements, never HTML. Takes the type of its host.
|
|
22
|
+
*/
|
|
23
|
+
export declare function RichText({ children, labels: labelsProp, className, ...rest }: RichTextProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -33,7 +33,7 @@ export type ScrollContainerProps = React.HTMLAttributes<HTMLElement> & {
|
|
|
33
33
|
*/
|
|
34
34
|
lock?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Once a scroll ends, the region glides to the start of a child: `true` near one (strips of tiles), `"mandatory"` always (board columns, a carousel). Native scrolling meanwhile; any input stops the glide.
|
|
37
37
|
*/
|
|
38
38
|
snap?: boolean | "mandatory";
|
|
39
39
|
/**
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type ScrollAxis = "x" | "y";
|
|
2
|
+
/** Distance from the start along `axis`, whatever the direction (RTL `scrollLeft` is negative). */
|
|
3
|
+
export declare function scrollPosition(node: HTMLElement, axis: ScrollAxis): number;
|
|
4
|
+
export declare function scrollMax(node: HTMLElement, axis: ScrollAxis): number;
|
|
5
|
+
/**
|
|
6
|
+
* The positions the region comes to rest at along `axis` (distance from its start): every element
|
|
7
|
+
* within `SNAP_DEPTH` levels that has a `scroll-snap-align` on that axis, clamped to the range and
|
|
8
|
+
* clear of the region's `scroll-padding`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function restPoints(node: HTMLElement, axis: ScrollAxis): number[];
|
|
11
|
+
export type Glide = {
|
|
12
|
+
/** Glides `axis` to `to` on the kit's frames (instant under reduced motion). */
|
|
13
|
+
to: (axis: ScrollAxis, to: number) => void;
|
|
14
|
+
/** Stops where it is: the person takes over. */
|
|
15
|
+
stop: () => void;
|
|
16
|
+
/** Where a glide on `axis` is heading; `null` when none is. */
|
|
17
|
+
target: (axis: ScrollAxis) => number | null;
|
|
18
|
+
/** Whether a scroll event at this moment is the glide's own. */
|
|
19
|
+
owns: () => boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A scroll glide on animation frames, never a smooth `scrollTo`: an engine finishes that against
|
|
23
|
+
* the person's input, while this stops the moment they take over. A new target retargets from where
|
|
24
|
+
* the glide is.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createGlide(node: HTMLElement): Glide;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ScrollMotionOptions = {
|
|
3
|
+
axis: "vertical" | "horizontal" | "both";
|
|
4
|
+
/** Settle on a rest point once a scroll ends: near one, or always. */
|
|
5
|
+
snap: "proximity" | "mandatory" | null;
|
|
6
|
+
/** Nothing the person does moves the region: no wheel glide, no settling. */
|
|
7
|
+
lock: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* How a ScrollContainer moves beyond the browser's own scrolling, which it never replaces: the
|
|
11
|
+
* trackpad, touch, the scrollbar and the keys scroll natively, momentum included.
|
|
12
|
+
*
|
|
13
|
+
* - Snapping (`snap`): once a scroll ends (no movement for a moment, nothing held), the region
|
|
14
|
+
* glides to the nearest rest point — the start of a child with a `scroll-snap-align`. CSS scroll
|
|
15
|
+
* snapping is not used: an engine snaps during the gesture, damps the trackpad's momentum and
|
|
16
|
+
* pulls a scroll back to merged rest points at the end.
|
|
17
|
+
* - A mouse wheel over a strip that scrolls only sideways (`axis="horizontal"`) scrolls it — a
|
|
18
|
+
* snapping strip a rest point per notch, a free one by the wheel's distance. A trackpad, Shift
|
|
19
|
+
* + wheel, a gesture that began outside (it keeps scrolling the page) and a strip at its edge
|
|
20
|
+
* (the wheel chains to the page) stay native.
|
|
21
|
+
* - Every glide runs on the kit's frames and stops the moment the person takes over (a wheel,
|
|
22
|
+
* touch, press or key); each notch retargets from where the glide is heading, so a turn the
|
|
23
|
+
* other way goes back mid-glide.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useScrollMotion(ref: React.RefObject<HTMLElement | null>, { axis, snap, lock }: ScrollMotionOptions): void;
|
|
@@ -56,7 +56,7 @@ export type SegmentedControlRootProps = Omit<FieldRootDomProps, "dir"> & FieldFr
|
|
|
56
56
|
* The field: label · radiogroup track · hint or error. `className`, `ref` and the rest go to the
|
|
57
57
|
* frame; `id`, `onKeyDown` and the `aria-label*` / `aria-describedby` names to the radiogroup.
|
|
58
58
|
*/
|
|
59
|
-
declare function SegmentedControlRoot({ value, defaultValue, onValueChange, disabled: disabledProp, size: sizeProp, fullWidth, label, required, optional, hint, error, invalid, reserveSupportRow, id, labels: labelsProp, children, className, onKeyDown, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...rest }: SegmentedControlRootProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
declare function SegmentedControlRoot({ value, defaultValue, onValueChange, disabled: disabledProp, size: sizeProp, fullWidth, label, required, optional, hint, hintTone, error, invalid, reserveSupportRow, id, labels: labelsProp, children, className, onKeyDown, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...rest }: SegmentedControlRootProps): import("react/jsx-runtime").JSX.Element;
|
|
60
60
|
declare namespace SegmentedControlRoot {
|
|
61
61
|
var displayName: string;
|
|
62
62
|
}
|
|
@@ -58,5 +58,12 @@ export type SelectContextValue = {
|
|
|
58
58
|
describedBy: string | undefined;
|
|
59
59
|
triggerRef: React.RefObject<HTMLButtonElement | null>;
|
|
60
60
|
labels: SelectLabels;
|
|
61
|
+
/**
|
|
62
|
+
* The select is the start segment of a field box (`Input.Wrapper`): its trigger is a segment
|
|
63
|
+
* named by the root's `aria-label` and the picked value.
|
|
64
|
+
*/
|
|
65
|
+
segment: {
|
|
66
|
+
label: string | undefined;
|
|
67
|
+
} | null;
|
|
61
68
|
};
|
|
62
69
|
export declare const SelectProvider: React.Provider<SelectContextValue | null>, useSelectContext: (part?: string) => SelectContextValue;
|
|
@@ -88,4 +88,4 @@ export type SliderProps = FieldRootDomProps & FieldFrameProps & {
|
|
|
88
88
|
* with a glass thumb, then hint or error. `className`, `ref` and the rest go to the frame, `id`
|
|
89
89
|
* and `aria-label` to the range input.
|
|
90
90
|
*/
|
|
91
|
-
export declare function Slider({ value: valueProp, defaultValue, onValueChange, onCommit, name, min, max, step, disabled: disabledProp, invalid, label, required, optional, hint, error, showValue, formatValue, size: sizeProp, tone, orientation, id, className, style, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, labels: labelsProp, ...rest }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
export declare function Slider({ value: valueProp, defaultValue, onValueChange, onCommit, name, min, max, step, disabled: disabledProp, invalid, label, required, optional, hint, hintTone, error, showValue, formatValue, size: sizeProp, tone, orientation, id, className, style, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, labels: labelsProp, ...rest }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
+
import type { HintTone } from "../hint/Hint";
|
|
2
3
|
import { type ChoiceLabelProps } from "../../internal/ChoiceField";
|
|
3
4
|
import type { ControlSize } from "../../internal/states";
|
|
4
5
|
export type SwitchLabels = {
|
|
@@ -31,6 +32,10 @@ export type SwitchRootProps = Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
31
32
|
* Help text under the label text. Hidden while `error` is shown.
|
|
32
33
|
*/
|
|
33
34
|
hint?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Status color of `hint` («Осталось 12 дней» in `warning`). The words carry the status, the color repeats it; an `error` replaces the hint and its tone. A validation error is `error`, never a `danger` hint.
|
|
37
|
+
*/
|
|
38
|
+
hintTone?: HintTone;
|
|
34
39
|
/**
|
|
35
40
|
* Error message in the hint slot; implies `invalid`.
|
|
36
41
|
*/
|
|
@@ -53,7 +58,7 @@ export type SwitchRootProps = Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
53
58
|
children?: React.ReactNode;
|
|
54
59
|
ref?: React.Ref<HTMLInputElement>;
|
|
55
60
|
};
|
|
56
|
-
declare function SwitchRoot({ id, checked: checkedProp, defaultChecked, onCheckedChange, loading, invalid, hint, error, size: sizeProp, optional, labels: labelsProp, disabled: disabledProp, readOnly, className, "aria-describedby": ariaDescribedBy, children, ref, ...inputRest }: SwitchRootProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
declare function SwitchRoot({ id, checked: checkedProp, defaultChecked, onCheckedChange, loading, invalid, hint, hintTone, error, size: sizeProp, optional, labels: labelsProp, disabled: disabledProp, readOnly, className, "aria-describedby": ariaDescribedBy, children, ref, ...inputRest }: SwitchRootProps): import("react/jsx-runtime").JSX.Element;
|
|
57
62
|
declare namespace SwitchRoot {
|
|
58
63
|
var displayName: string;
|
|
59
64
|
}
|
|
@@ -142,7 +142,7 @@ export type TagSelectProps = FieldRootDomProps & FieldFrameProps & FieldFocusRin
|
|
|
142
142
|
* A multi-value field shown as tag chips: pick from a list, type to filter, create new values.
|
|
143
143
|
* At rest one row (extra chips fold into «+N»); focused or open it shows every chip.
|
|
144
144
|
*/
|
|
145
|
-
export declare function TagSelect({ options, value: valueProp, defaultValue, onValueChange, open: openProp, defaultOpen, onOpenChange, closeOnEscape, closeOnOutsideClick, creatable, onCreate, fallbackColor, onOptionUpdate, onOptionDelete, disabled: disabledProp, name, placeholder, invalid: invalidProp, focusRing, size: sizeProp, label, required, optional, hint, error, id: idProp, labels: labelsProp, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: TagSelectProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
145
|
+
export declare function TagSelect({ options, value: valueProp, defaultValue, onValueChange, open: openProp, defaultOpen, onOpenChange, closeOnEscape, closeOnOutsideClick, creatable, onCreate, fallbackColor, onOptionUpdate, onOptionDelete, disabled: disabledProp, name, placeholder, invalid: invalidProp, focusRing, size: sizeProp, label, required, optional, hint, hintTone, error, id: idProp, labels: labelsProp, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: TagSelectProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
146
146
|
export declare namespace TagSelect {
|
|
147
147
|
var displayName: string;
|
|
148
148
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { HintTone } from "../hint/Hint";
|
|
2
3
|
import { type FieldActionButtonProps } from "../../internal/FieldAction";
|
|
3
4
|
import { type FieldCommitHandler } from "../../internal/FieldCommit";
|
|
4
5
|
import { type FieldFocusRingProps } from "../../internal/FieldFrame";
|
|
@@ -52,6 +53,10 @@ export type TextareaRootProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
|
|
|
52
53
|
* Help text under the field. Hidden while `error` is shown.
|
|
53
54
|
*/
|
|
54
55
|
hint?: React.ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Status color of `hint` («Осталось 12 дней» in `warning`). The words carry the status, the color repeats it; an `error` replaces the hint and its tone. A validation error is `error`, never a `danger` hint.
|
|
58
|
+
*/
|
|
59
|
+
hintTone?: HintTone;
|
|
55
60
|
/**
|
|
56
61
|
* Error message in the hint slot; implies `invalid`.
|
|
57
62
|
*/
|
|
@@ -95,7 +100,7 @@ export type TextareaRootProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
|
|
|
95
100
|
* A multi-line field. `className` goes to the field frame, `id`, `ref` and the native attributes
|
|
96
101
|
* to the `<textarea>` (it has no `Field` part).
|
|
97
102
|
*/
|
|
98
|
-
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;
|
|
103
|
+
declare function TextareaRoot({ id, className, size: sizeProp, invalid, focusRing, label, required, optional, hint, hintTone, 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;
|
|
99
104
|
declare namespace TextareaRoot {
|
|
100
105
|
var displayName: string;
|
|
101
106
|
}
|