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
|
@@ -113,6 +113,7 @@ import * as React2 from "react";
|
|
|
113
113
|
// src/internal/tokenDefaults.ts
|
|
114
114
|
var TOKEN_DEFAULTS = {
|
|
115
115
|
"--prime-gallery-max-size": 360,
|
|
116
|
+
"--prime-message-sticker": 160,
|
|
116
117
|
"--prime-message-video-note-box": 268,
|
|
117
118
|
"--prime-motion-duration-base": 380,
|
|
118
119
|
"--prime-motion-duration-fast": 230,
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
useInheritedDisabled,
|
|
24
24
|
useLabels,
|
|
25
25
|
useOpenState
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OAXJWF3L.js";
|
|
27
27
|
import {
|
|
28
28
|
cx,
|
|
29
29
|
useHostTier
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-QFHE5GKW.js";
|
|
31
31
|
|
|
32
32
|
// src/components/color-field/ColorField.tsx
|
|
33
33
|
import * as React3 from "react";
|
|
@@ -359,7 +359,15 @@ function SliderMeta({ label, className, ...rest }) {
|
|
|
359
359
|
/* @__PURE__ */ jsx("output", { className: ColorPicker_default.sliderValue, "aria-live": "off", children: slider && channel ? sliderValueLabel(slider.value, channel, locale) : null })
|
|
360
360
|
] });
|
|
361
361
|
}
|
|
362
|
-
function HexInput({
|
|
362
|
+
function HexInput({
|
|
363
|
+
label,
|
|
364
|
+
hint,
|
|
365
|
+
hintTone,
|
|
366
|
+
error,
|
|
367
|
+
focusRing,
|
|
368
|
+
children,
|
|
369
|
+
...rest
|
|
370
|
+
}) {
|
|
363
371
|
const { labels } = useColorPickerContext();
|
|
364
372
|
const { inputRef, text, setText, commit } = useColorDraft(toHexText, parseHex);
|
|
365
373
|
return /* @__PURE__ */ jsx(
|
|
@@ -368,6 +376,7 @@ function HexInput({ label, hint, error, focusRing, children, ...rest }) {
|
|
|
368
376
|
...rest,
|
|
369
377
|
label: label ?? labels.hex,
|
|
370
378
|
hint,
|
|
379
|
+
hintTone,
|
|
371
380
|
error,
|
|
372
381
|
focusRing,
|
|
373
382
|
children: /* @__PURE__ */ jsxs(Input.Wrapper, { children: [
|
|
@@ -507,6 +516,7 @@ function ColorField({
|
|
|
507
516
|
required = false,
|
|
508
517
|
optional,
|
|
509
518
|
hint,
|
|
519
|
+
hintTone,
|
|
510
520
|
error,
|
|
511
521
|
className,
|
|
512
522
|
"aria-label": ariaLabel,
|
|
@@ -557,6 +567,7 @@ function ColorField({
|
|
|
557
567
|
required,
|
|
558
568
|
optional,
|
|
559
569
|
hint,
|
|
570
|
+
hintTone,
|
|
560
571
|
error,
|
|
561
572
|
disabled,
|
|
562
573
|
optionalLabel: labels.optional,
|
package/dist/color-picker.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
ColorField,
|
|
5
5
|
ColorPicker,
|
|
6
6
|
parseColor
|
|
7
|
-
} from "./chunks/chunk-
|
|
8
|
-
import "./chunks/chunk-
|
|
9
|
-
import "./chunks/chunk-
|
|
7
|
+
} from "./chunks/chunk-X3JT5CLR.js";
|
|
8
|
+
import "./chunks/chunk-OAXJWF3L.js";
|
|
9
|
+
import "./chunks/chunk-QFHE5GKW.js";
|
|
10
10
|
export {
|
|
11
11
|
ColorField,
|
|
12
12
|
ColorPicker,
|
|
@@ -127,6 +127,13 @@ export type BadgeActionProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
127
127
|
children?: React.ReactNode;
|
|
128
128
|
ref?: React.Ref<HTMLButtonElement>;
|
|
129
129
|
};
|
|
130
|
+
export type BadgeGroupProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
131
|
+
/**
|
|
132
|
+
* Tier of every badge in the group; a badge's own `size` wins. Small tiers stand closer.
|
|
133
|
+
*/
|
|
134
|
+
size?: ControlSize;
|
|
135
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
136
|
+
};
|
|
130
137
|
declare function BadgeRoot({ color, tone, variant, size: sizeProp, shape, onRemove, pressed: pressedProp, defaultPressed, onPressedChange, loading, labels, disabled: disabledProp, children, className, ref, ...rest }: BadgeRootProps): import("react/jsx-runtime").JSX.Element;
|
|
131
138
|
declare namespace BadgeRoot {
|
|
132
139
|
var displayName: string;
|
|
@@ -153,8 +160,18 @@ declare function BadgeAction({ label, onClick, persistent: _persistent, disabled
|
|
|
153
160
|
declare namespace BadgeAction {
|
|
154
161
|
var displayName: string;
|
|
155
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* A row of badges as one value (the tags of a record, the stages a deal went through): the badges
|
|
165
|
+
* wrap onto more lines, a chip gap apart. `size` sets the tier of every badge in it; without it the
|
|
166
|
+
* badges follow the host, as a lone badge does.
|
|
167
|
+
*/
|
|
168
|
+
declare function BadgeGroup({ size, className, ...rest }: BadgeGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
169
|
+
declare namespace BadgeGroup {
|
|
170
|
+
var displayName: string;
|
|
171
|
+
}
|
|
156
172
|
export declare const Badge: {
|
|
157
173
|
Root: typeof BadgeRoot;
|
|
174
|
+
Group: typeof BadgeGroup;
|
|
158
175
|
Icon: typeof BadgeIcon;
|
|
159
176
|
Dot: typeof BadgeDot;
|
|
160
177
|
Action: typeof BadgeAction;
|
|
@@ -24,9 +24,13 @@ declare namespace BreadcrumbRoot {
|
|
|
24
24
|
}
|
|
25
25
|
export type BreadcrumbItemProps = Omit<React.LiHTMLAttributes<HTMLLIElement>, "aria-label"> & {
|
|
26
26
|
/**
|
|
27
|
-
* Renders a link; without it the item is text.
|
|
27
|
+
* Renders a link; without it (and without `asChild`) the item is text.
|
|
28
28
|
*/
|
|
29
29
|
href?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The single child (a router `Link`) is the level's link with the same look; its own text is the level. In the «…» menu of a folded path it is the menu item.
|
|
32
|
+
*/
|
|
33
|
+
asChild?: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* Current page: `aria-current="page"` (on the link when `href` is set), primary text, medium weight. Usually the last item, without `href`.
|
|
32
36
|
*/
|
|
@@ -37,7 +41,12 @@ export type BreadcrumbItemProps = Omit<React.LiHTMLAttributes<HTMLLIElement>, "a
|
|
|
37
41
|
"aria-label"?: string;
|
|
38
42
|
ref?: React.Ref<HTMLLIElement>;
|
|
39
43
|
};
|
|
40
|
-
|
|
44
|
+
/**
|
|
45
|
+
* One level of the path in its `<li>`: a link (`href`, or the consumer's router link with
|
|
46
|
+
* `asChild`) for a previous level, plain text for the current one. A press on the link goes
|
|
47
|
+
* through `Page.Guard` (`leaveGuardCapture`).
|
|
48
|
+
*/
|
|
49
|
+
declare function BreadcrumbItem({ href, asChild, current, children, className, "aria-label": ariaLabel, onClickCapture, ...rest }: BreadcrumbItemProps): import("react/jsx-runtime").JSX.Element;
|
|
41
50
|
declare namespace BreadcrumbItem {
|
|
42
51
|
var displayName: string;
|
|
43
52
|
}
|
|
@@ -37,7 +37,7 @@ type ButtonShapeProps = {
|
|
|
37
37
|
"aria-label": string;
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
|
-
* A `<button>` runs the long-action modes; with `asChild` the child (a link) owns its
|
|
40
|
+
* A `<button>` runs the long-action modes; with `asChild` the child (a link) owns its element, so
|
|
41
41
|
* it takes none of them.
|
|
42
42
|
*/
|
|
43
43
|
type ButtonElementProps = {
|
|
@@ -45,7 +45,7 @@ export type ButtonGroupRootProps = Omit<FieldRootDomProps, "dir"> & FieldFramePr
|
|
|
45
45
|
* The field: label · the segments · hint or error. `className`, `ref` and the rest go to the frame;
|
|
46
46
|
* `id`, `role` and the `aria-label*` / `aria-describedby` names to the `role="group"` element.
|
|
47
47
|
*/
|
|
48
|
-
declare function ButtonGroupRoot({ orientation, size: sizeProp, fullWidth, label, required, optional, hint, error, invalid, reserveSupportRow, id, labels: labelsProp, children, className, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...rest }: ButtonGroupRootProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
declare function ButtonGroupRoot({ orientation, size: sizeProp, fullWidth, label, required, optional, hint, hintTone, error, invalid, reserveSupportRow, id, labels: labelsProp, children, className, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...rest }: ButtonGroupRootProps): import("react/jsx-runtime").JSX.Element;
|
|
49
49
|
declare namespace ButtonGroupRoot {
|
|
50
50
|
var displayName: string;
|
|
51
51
|
}
|
|
@@ -16,12 +16,16 @@ export type CardRootProps = DivProps & {
|
|
|
16
16
|
* No raised shadow: a flat tile for dense grids.
|
|
17
17
|
*/
|
|
18
18
|
flat?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The KPI is loading: `Card.Value`, `Card.Delta` and `Card.Meta` show a Skeleton in their own geometry and the root sets `aria-busy`; the data fades in when it arrives. Labels and titles stay.
|
|
21
|
+
*/
|
|
22
|
+
loading?: boolean;
|
|
19
23
|
/**
|
|
20
24
|
* The whole card is one link or button: pass that element as the only child with the parts inside it; it gets hover, press and the focus ring. Nothing interactive may sit inside it.
|
|
21
25
|
*/
|
|
22
26
|
asChild?: boolean;
|
|
23
27
|
};
|
|
24
|
-
declare function CardRoot({ variant, flat, asChild, className, children, ...rest }: CardRootProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare function CardRoot({ variant, flat, loading, asChild, className, children, ...rest }: CardRootProps): import("react/jsx-runtime").JSX.Element;
|
|
25
29
|
declare namespace CardRoot {
|
|
26
30
|
var displayName: string;
|
|
27
31
|
}
|
|
@@ -79,7 +83,7 @@ declare namespace CardLabel {
|
|
|
79
83
|
var displayName: string;
|
|
80
84
|
}
|
|
81
85
|
export type CardValueProps = SpanProps;
|
|
82
|
-
declare function CardValue({ className, ...rest }: CardValueProps): import("react/jsx-runtime").JSX.Element;
|
|
86
|
+
declare function CardValue({ className, children, ...rest }: CardValueProps): import("react/jsx-runtime").JSX.Element;
|
|
83
87
|
declare namespace CardValue {
|
|
84
88
|
var displayName: string;
|
|
85
89
|
}
|
|
@@ -89,7 +93,7 @@ export type CardDeltaProps = SpanProps & {
|
|
|
89
93
|
*/
|
|
90
94
|
tone?: Extract<Tone, "neutral" | "success" | "warning" | "danger">;
|
|
91
95
|
};
|
|
92
|
-
declare function CardDelta({ className, tone, ...rest }: CardDeltaProps): import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
declare function CardDelta({ className, tone, children, ...rest }: CardDeltaProps): import("react/jsx-runtime").JSX.Element;
|
|
93
97
|
declare namespace CardDelta {
|
|
94
98
|
var displayName: string;
|
|
95
99
|
}
|
|
@@ -98,7 +102,7 @@ export type CardMetaProps = SpanProps;
|
|
|
98
102
|
* The reference line of a KPI («Лидов 120 · сделок 18»): caption, muted, tabular; it sits at the
|
|
99
103
|
* bottom of the tile, so tiles in a row line their meta up.
|
|
100
104
|
*/
|
|
101
|
-
declare function CardMeta({ className, ...rest }: CardMetaProps): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
declare function CardMeta({ className, children, ...rest }: CardMetaProps): import("react/jsx-runtime").JSX.Element;
|
|
102
106
|
declare namespace CardMeta {
|
|
103
107
|
var displayName: string;
|
|
104
108
|
}
|
|
@@ -186,9 +186,9 @@ export type ChatMessagesProps<T = unknown> = Omit<MessageListProps, "selected" |
|
|
|
186
186
|
*/
|
|
187
187
|
now?: Date;
|
|
188
188
|
/**
|
|
189
|
-
* The label of a date
|
|
189
|
+
* The label of a date; gets the `timeZone`.
|
|
190
190
|
*/
|
|
191
|
-
formatDate?: (date: Date, now: Date) => string;
|
|
191
|
+
formatDate?: (date: Date, now: Date, timeZone?: string) => string;
|
|
192
192
|
};
|
|
193
193
|
/**
|
|
194
194
|
* The conversation: the one message list of the kit, in its own scroller. A `role="log"` of rows
|
|
@@ -198,7 +198,7 @@ export type ChatMessagesProps<T = unknown> = Omit<MessageListProps, "selected" |
|
|
|
198
198
|
* and `Message.Typing` close the list). Only the rows around the view render; the list opens at
|
|
199
199
|
* the end and keeps the reader's place.
|
|
200
200
|
*/
|
|
201
|
-
declare function ChatMessages<T>({ group, loading, hasOlder, onLoadOlder, items, getKey, getAuthor, getDate, isService, renderMessage, unread, groupWindow, now, formatDate, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: ChatMessagesProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
201
|
+
declare function ChatMessages<T>({ group, loading, hasOlder, onLoadOlder, items, getKey, getAuthor, getDate, isService, renderMessage, unread, groupWindow, now, timeZone, formatDate, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: ChatMessagesProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
202
202
|
declare namespace ChatMessages {
|
|
203
203
|
var displayName: string;
|
|
204
204
|
}
|
|
@@ -38,6 +38,10 @@ export type MessageListProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
38
38
|
* The reader (`{ id, name: «Вы», src?, color? }`): a reaction they put shows them among the chip's avatars at once, before the data comes back; matched by `id`.
|
|
39
39
|
*/
|
|
40
40
|
reader?: MessageUser;
|
|
41
|
+
/**
|
|
42
|
+
* The IANA zone of the date separators, the runs and every message time (`"Asia/Vladivostok"`): a profile's zone, not the browser's.
|
|
43
|
+
*/
|
|
44
|
+
timeZone?: string;
|
|
41
45
|
/**
|
|
42
46
|
* A message was added at the end after mount, sent or received: for a sound, a counter, a title badge. Not called for the first render, history or a message put back in the middle.
|
|
43
47
|
*/
|
|
@@ -76,7 +80,7 @@ export type MessageListProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
76
80
|
* `anchor="end"`); jumps, search, selection ranges, the keyboard and playing media reach or keep
|
|
77
81
|
* rows that are not rendered.
|
|
78
82
|
*/
|
|
79
|
-
export declare function MessageList({ group, selected: selectedProp, defaultSelected, onSelectedChange, quickReaction, reactionOptions, reader, onNewMessage, onRead, jumpTo, highlight, onMatchesChange, revealRef, labels: labelsProp, className, children, onKeyDown, onFocus, ref, ...rest }: MessageListProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export declare function MessageList({ group, selected: selectedProp, defaultSelected, onSelectedChange, quickReaction, reactionOptions, reader, timeZone, onNewMessage, onRead, jumpTo, highlight, onMatchesChange, revealRef, labels: labelsProp, className, children, onKeyDown, onFocus, ref, ...rest }: MessageListProps): import("react/jsx-runtime").JSX.Element;
|
|
80
84
|
export type ChatSelectionBarProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
81
85
|
ref?: React.Ref<HTMLDivElement>;
|
|
82
86
|
};
|
|
@@ -7,7 +7,7 @@ import type { MessagePosition } from "../message/types";
|
|
|
7
7
|
export type MessageListEntry<T> = {
|
|
8
8
|
type: "date";
|
|
9
9
|
key: string;
|
|
10
|
-
/** The start of the day (local time). */
|
|
10
|
+
/** The start of the day (in `timeZone`, else local time). */
|
|
11
11
|
date: Date;
|
|
12
12
|
/** «Сегодня», «Вчера», «12 марта», «12 марта 2025». */
|
|
13
13
|
label: string;
|
|
@@ -37,11 +37,19 @@ export type GroupMessagesOptions<T> = {
|
|
|
37
37
|
groupWindow?: number;
|
|
38
38
|
/** «Today» for the date labels. Default: now. */
|
|
39
39
|
now?: Date;
|
|
40
|
+
/**
|
|
41
|
+
* The zone the days are read in (an IANA name, `"Asia/Vladivostok"`): where a day starts and what
|
|
42
|
+
* «today» is. Default: the browser's zone.
|
|
43
|
+
*/
|
|
44
|
+
timeZone?: string;
|
|
40
45
|
/** The label of a date separator. Default `formatMessageDate`. */
|
|
41
|
-
formatDate?: (date: Date, now: Date) => string;
|
|
46
|
+
formatDate?: (date: Date, now: Date, timeZone?: string) => string;
|
|
42
47
|
};
|
|
43
|
-
/**
|
|
44
|
-
|
|
48
|
+
/**
|
|
49
|
+
* «Сегодня», «Вчера», «12 марта» this year, «12 марта 2025» another year; days are read in
|
|
50
|
+
* `timeZone`, or the browser's zone.
|
|
51
|
+
*/
|
|
52
|
+
export declare function formatMessageDate(date: Date, now?: Date, timeZone?: string): string;
|
|
45
53
|
/**
|
|
46
54
|
* The rows of a chat from messages in time order: a date separator before the first message of
|
|
47
55
|
* every day, and for every message its `position` in the run of one author (a new run starts with
|
|
@@ -140,17 +140,22 @@ type ChatListItemOwnProps = {
|
|
|
140
140
|
*/
|
|
141
141
|
draft?: string;
|
|
142
142
|
/**
|
|
143
|
-
*
|
|
143
|
+
* The one child element (a router `Link`) is the row; the parts go inside it.
|
|
144
|
+
*/
|
|
145
|
+
asChild?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* `ChatList.ItemIcon`, `ChatList.ItemText`, `ChatList.ItemDescription`, `ChatList.ItemMenu` — inside the child element with `asChild`.
|
|
144
148
|
*/
|
|
145
149
|
children?: React.ReactNode;
|
|
146
150
|
};
|
|
147
|
-
export type ChatListItemProps = ChatListItemOwnProps & Omit<ListItemProps, keyof ChatListItemOwnProps | "value" | "current" | "
|
|
151
|
+
export type ChatListItemProps = ChatListItemOwnProps & Omit<ListItemProps, keyof ChatListItemOwnProps | "value" | "current" | "disabled">;
|
|
148
152
|
/**
|
|
149
|
-
* A dialog: a `List.Item` row (a button,
|
|
150
|
-
*
|
|
151
|
-
*
|
|
153
|
+
* A dialog: a `List.Item` row (a button, a link with `href`, or the consumer's element with
|
|
154
|
+
* `asChild` — a router link, its children the parts) with the avatar, the name and the time on
|
|
155
|
+
* the first line, the preview and the counts on the second. Its key and `current` come from
|
|
156
|
+
* `ChatList.Root`.
|
|
152
157
|
*/
|
|
153
|
-
declare function ChatListItem({ time, status, unread, mention, muted, pinned, typing, draft, className, children, onClick, onKeyDown, onFocus, onContextMenu, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, ref, ...rest }: ChatListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
158
|
+
declare function ChatListItem({ asChild, time, status, unread, mention, muted, pinned, typing, draft, className, children, onClick, onKeyDown, onFocus, onContextMenu, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, ref, ...rest }: ChatListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
154
159
|
declare namespace ChatListItem {
|
|
155
160
|
var displayName: string;
|
|
156
161
|
}
|
|
@@ -216,9 +221,13 @@ export type ChatListRootProps<T = unknown> = Omit<React.HTMLAttributes<HTMLDivEl
|
|
|
216
221
|
*/
|
|
217
222
|
now?: Date;
|
|
218
223
|
/**
|
|
219
|
-
*
|
|
224
|
+
* The IANA zone the times of the rows are read in (`"Asia/Vladivostok"`): a profile's zone, not the browser's.
|
|
225
|
+
*/
|
|
226
|
+
timeZone?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Display of a row's `Date` time: «14:32» today, «пн» this week, «12 мар», «12.03.2025»; gets the `timeZone`.
|
|
220
229
|
*/
|
|
221
|
-
formatTime?: (date: Date, now: Date) => string;
|
|
230
|
+
formatTime?: (date: Date, now: Date, timeZone?: string) => string;
|
|
222
231
|
/**
|
|
223
232
|
* Built-in strings, see Labels.
|
|
224
233
|
*/
|
|
@@ -231,7 +240,7 @@ export type ChatListRootProps<T = unknown> = Omit<React.HTMLAttributes<HTMLDivEl
|
|
|
231
240
|
* new places when the order changes, a long list rendered only around the view, placeholder rows
|
|
232
241
|
* while loading and more dialogs loaded near the end. Draws no surface: put it in a pane.
|
|
233
242
|
*/
|
|
234
|
-
declare function ChatListRoot<T>({ items, getKey, renderItem, value: valueProp, defaultValue, onValueChange, search: searchProp, defaultSearch, onSearchChange, loading, hasMore, onLoadMore, empty, size: sizeProp, now: nowProp, formatTime, labels: labelsProp, className, ref, ...rest }: ChatListRootProps<T>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
243
|
+
declare function ChatListRoot<T>({ items, getKey, renderItem, value: valueProp, defaultValue, onValueChange, search: searchProp, defaultSearch, onSearchChange, loading, hasMore, onLoadMore, empty, size: sizeProp, now: nowProp, timeZone, formatTime, labels: labelsProp, className, ref, ...rest }: ChatListRootProps<T>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
235
244
|
declare namespace ChatListRoot {
|
|
236
245
|
var displayName: string;
|
|
237
246
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The time of a dialog's last message, as a messenger shows it: today «14:32», within the last
|
|
3
|
-
* six days the weekday «пн», earlier this year «12 мар», another year «12.03.2025».
|
|
4
|
-
* `ChatList.Root formatTime`.
|
|
3
|
+
* six days the weekday «пн», earlier this year «12 мар», another year «12.03.2025». Days and the
|
|
4
|
+
* clock are read in `timeZone`, or the browser's zone. The default `ChatList.Root formatTime`.
|
|
5
5
|
*/
|
|
6
|
-
export declare function formatChatTime(date: Date, now: Date): string;
|
|
6
|
+
export declare function formatChatTime(date: Date, now: Date, timeZone?: string): string;
|
|
@@ -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 { ControlSize } from "../../internal/states";
|
|
4
5
|
export type CheckboxShape = "square" | "circle";
|
|
@@ -32,6 +33,10 @@ export type CheckboxRootProps = Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
32
33
|
* Help text under the label text. Hidden while `error` is shown.
|
|
33
34
|
*/
|
|
34
35
|
hint?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* 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.
|
|
38
|
+
*/
|
|
39
|
+
hintTone?: HintTone;
|
|
35
40
|
/**
|
|
36
41
|
* Error message in the hint slot; implies `invalid`.
|
|
37
42
|
*/
|
|
@@ -59,7 +64,7 @@ export type CheckboxRootProps = Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
59
64
|
/** The native checkbox input. */
|
|
60
65
|
ref?: React.Ref<HTMLInputElement>;
|
|
61
66
|
};
|
|
62
|
-
declare function CheckboxRoot({ id, checked: checkedProp, defaultChecked, onCheckedChange, indeterminate, invalid, hint, error, size: sizeProp, shape, optional, labels: labelsProp, disabled: disabledProp, readOnly, className, "aria-describedby": ariaDescribedBy, children, ref, ...inputRest }: CheckboxRootProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
declare function CheckboxRoot({ id, checked: checkedProp, defaultChecked, onCheckedChange, indeterminate, invalid, hint, hintTone, error, size: sizeProp, shape, optional, labels: labelsProp, disabled: disabledProp, readOnly, className, "aria-describedby": ariaDescribedBy, children, ref, ...inputRest }: CheckboxRootProps): import("react/jsx-runtime").JSX.Element;
|
|
63
68
|
declare namespace CheckboxRoot {
|
|
64
69
|
var displayName: string;
|
|
65
70
|
}
|
|
@@ -77,7 +77,7 @@ export type ColorFieldProps = FieldRootDomProps & FieldFrameProps & FieldFocusRi
|
|
|
77
77
|
* the ColorPicker panel (area, hue, optional opacity, channels with the eyedropper, presets) in a
|
|
78
78
|
* Popover.
|
|
79
79
|
*/
|
|
80
|
-
export declare function ColorField({ value: valueProp, defaultValue, onValueChange, presets, alpha, size: sizeProp, disabled: disabledProp, invalid: invalidProp, focusRing, name, id, label, required, optional, hint, error, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, labels: labelsProp, ...rest }: ColorFieldProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
80
|
+
export declare function ColorField({ value: valueProp, defaultValue, onValueChange, presets, alpha, size: sizeProp, disabled: disabledProp, invalid: invalidProp, focusRing, name, id, label, required, optional, hint, hintTone, error, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, labels: labelsProp, ...rest }: ColorFieldProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
81
81
|
export declare namespace ColorField {
|
|
82
82
|
var displayName: string;
|
|
83
83
|
}
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { type ColorAreaProps as AriaColorAreaProps, type ColorSliderProps as AriaColorSliderProps, type ColorThumbProps as AriaColorThumbProps, type SliderTrackProps as AriaSliderTrackProps, type Color, parseColor } from "react-aria-components";
|
|
3
3
|
import { Button } from "../button/Button";
|
|
4
4
|
import { type ColorSwatchesColorProps } from "../color-swatches/ColorSwatches";
|
|
5
|
+
import type { HintTone } from "../hint/Hint";
|
|
5
6
|
import { type FieldActionButtonProps } from "../../internal/FieldAction";
|
|
6
7
|
import type { FieldFocusRingProps, FieldRootDomProps } from "../../internal/FieldFrame";
|
|
7
8
|
import type { ControlSize } from "../../internal/states";
|
|
@@ -82,6 +83,10 @@ export type ColorPickerHexInputProps = FieldRootDomProps & FieldFocusRingProps &
|
|
|
82
83
|
* Help text under the field. Hidden while `error` is shown.
|
|
83
84
|
*/
|
|
84
85
|
hint?: React.ReactNode;
|
|
86
|
+
/**
|
|
87
|
+
* 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.
|
|
88
|
+
*/
|
|
89
|
+
hintTone?: HintTone;
|
|
85
90
|
/**
|
|
86
91
|
* Error message in the hint slot; marks the field invalid.
|
|
87
92
|
*/
|
|
@@ -165,7 +170,7 @@ export type ColorPickerSliderMetaProps = DivProps & {
|
|
|
165
170
|
* React Aria's `SliderOutput` inside a color slider points `for` at an id no input carries.
|
|
166
171
|
*/
|
|
167
172
|
declare function SliderMeta({ label, className, ...rest }: ColorPickerSliderMetaProps): import("react/jsx-runtime").JSX.Element;
|
|
168
|
-
declare function HexInput({ label, hint, error, focusRing, children, ...rest }: ColorPickerHexInputProps): import("react/jsx-runtime").JSX.Element;
|
|
173
|
+
declare function HexInput({ label, hint, hintTone, error, focusRing, children, ...rest }: ColorPickerHexInputProps): import("react/jsx-runtime").JSX.Element;
|
|
169
174
|
declare namespace HexInput {
|
|
170
175
|
var displayName: string;
|
|
171
176
|
}
|
|
@@ -10,6 +10,10 @@ export type ColorPresetsLabels = {
|
|
|
10
10
|
list: string;
|
|
11
11
|
/** The "no color" swatch (`allowEmpty`) and the trigger name for an empty value. */
|
|
12
12
|
empty: string;
|
|
13
|
+
/** Label of the hex field under the swatches (`allowCustom`). */
|
|
14
|
+
custom: string;
|
|
15
|
+
/** Error of the hex field when Enter finds no hex color in it. */
|
|
16
|
+
customInvalid: string;
|
|
13
17
|
};
|
|
14
18
|
export declare const COLOR_PRESETS_LABELS: ColorPresetsLabels;
|
|
15
19
|
export type ColorPresetsRootProps = {
|
|
@@ -65,6 +69,10 @@ export type ColorPresetsRootProps = {
|
|
|
65
69
|
* Adds the «no color» swatch after the presets (value `null`).
|
|
66
70
|
*/
|
|
67
71
|
allowEmpty?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Any color beyond the palette: a hex field under the swatches (`labels.custom`) shows the typed color, Enter picks it as `#rrggbb`; invalid text gets `labels.customInvalid`.
|
|
74
|
+
*/
|
|
75
|
+
allowCustom?: boolean;
|
|
68
76
|
/**
|
|
69
77
|
* Close the panel after a pick (focus returns to the trigger).
|
|
70
78
|
*/
|
|
@@ -78,7 +86,7 @@ export type ColorPresetsRootProps = {
|
|
|
78
86
|
*/
|
|
79
87
|
children: React.ReactNode;
|
|
80
88
|
};
|
|
81
|
-
declare function ColorPresetsRoot({ value: valueProp, defaultValue, onValueChange, open: openProp, defaultOpen, onOpenChange, closeOnEscape, closeOnOutsideClick, presets, columns: columnsProp, size: sizeProp, disabled: disabledProp, allowEmpty, closeOnSelect, labels: labelsProp, children, }: ColorPresetsRootProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
89
|
+
declare function ColorPresetsRoot({ value: valueProp, defaultValue, onValueChange, open: openProp, defaultOpen, onOpenChange, closeOnEscape, closeOnOutsideClick, presets, columns: columnsProp, size: sizeProp, disabled: disabledProp, allowEmpty, allowCustom, closeOnSelect, labels: labelsProp, children, }: ColorPresetsRootProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
82
90
|
declare namespace ColorPresetsRoot {
|
|
83
91
|
var displayName: string;
|
|
84
92
|
}
|
|
@@ -5,7 +5,7 @@ export type CrossfadeProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
5
5
|
*/
|
|
6
6
|
state: string | number;
|
|
7
7
|
/**
|
|
8
|
-
* The region takes its parent's height (a flex or grid item, or a sized block) and every state stretches to it; the height never glides.
|
|
8
|
+
* The region takes its parent's height (a flex or grid item, or a sized block) and every state stretches to it; the height never glides. A `Crossfade` that is the child of a `Page.Cell` fills it unless `fill` is set.
|
|
9
9
|
*/
|
|
10
10
|
fill?: boolean;
|
|
11
11
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -38,6 +38,8 @@ export type DataTableLabels = {
|
|
|
38
38
|
expandGroup: string;
|
|
39
39
|
/** `aria-label` of the toggle of an expanded group; `{group}` is the group key. */
|
|
40
40
|
collapseGroup: string;
|
|
41
|
+
/** Name of the info glyph of a column with a `description` (the tooltip holds the text). */
|
|
42
|
+
columnInfo: string;
|
|
41
43
|
};
|
|
42
44
|
export declare const DATA_TABLE_LABELS: DataTableLabels;
|
|
43
45
|
export type DataTableProps<Row> = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
@@ -11,6 +11,8 @@ type HeadProps<Row> = {
|
|
|
11
11
|
/** Sticky head and first column: the leading head cells stick to both edges. */
|
|
12
12
|
stickyCorner: boolean;
|
|
13
13
|
expandEnabled: boolean;
|
|
14
|
+
/** Name of the info glyph of a column with a `description`. */
|
|
15
|
+
infoLabel: string;
|
|
14
16
|
/** A leading column of row handles (`onReorder`). */
|
|
15
17
|
reorderable?: boolean;
|
|
16
18
|
selectAll?: {
|
|
@@ -21,5 +23,5 @@ type HeadProps<Row> = {
|
|
|
21
23
|
onToggle: () => void;
|
|
22
24
|
};
|
|
23
25
|
};
|
|
24
|
-
export declare function Head<Row>({ columns, size, sort, onSort, stickyFirstColumn, stickyHeader, stickyCorner, expandEnabled, reorderable, selectAll, }: HeadProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function Head<Row>({ columns, size, sort, onSort, stickyFirstColumn, stickyHeader, stickyCorner, expandEnabled, infoLabel, reorderable, selectAll, }: HeadProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
export {};
|
|
@@ -32,6 +32,11 @@ export type DataTableColumn<Row> = {
|
|
|
32
32
|
* empty, the `<th>` keeps `header` as its name.
|
|
33
33
|
*/
|
|
34
34
|
hideHeader?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* What the column means, for a header that cannot say it all: an info glyph after the header
|
|
37
|
+
* opens it as a tooltip, and the header cell is described by it (`aria-describedby`).
|
|
38
|
+
*/
|
|
39
|
+
description?: string;
|
|
35
40
|
width?: string;
|
|
36
41
|
minWidth?: string;
|
|
37
42
|
maxWidth?: string;
|
|
@@ -83,4 +83,4 @@ export type DigitInputProps = FieldRootDomProps & FieldFrameProps & FieldFocusRi
|
|
|
83
83
|
labels?: Partial<DigitInputLabels>;
|
|
84
84
|
};
|
|
85
85
|
/** A one-time code or PIN split into cells, with the field label, hint and error. */
|
|
86
|
-
export declare function DigitInput({ length, size: sizeProp, fullWidth, name, groupSize, mask, autoFocus, value: valueProp, defaultValue, onValueChange, onComplete, disabled: disabledProp, invalid, success, focusRing, label, required, optional, hint, error, id, "aria-describedby": ariaDescribedBy, labels: labelsProp, className, ...rest }: DigitInputProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
86
|
+
export declare function DigitInput({ length, size: sizeProp, fullWidth, name, groupSize, mask, autoFocus, value: valueProp, defaultValue, onValueChange, onComplete, disabled: disabledProp, invalid, success, focusRing, label, required, optional, hint, hintTone, error, id, "aria-describedby": ariaDescribedBy, labels: labelsProp, className, ...rest }: DigitInputProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
2
|
import { DialogGuard } from "../../internal/overlay/DialogGuard";
|
|
3
|
-
import { DialogActions, DialogBody, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogIcon, type DialogLabels, DialogMeta, DialogTitle, DialogTrigger } from "../../internal/overlay/DialogParts";
|
|
3
|
+
import { DialogActions, DialogBody, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogIcon, type DialogLabels, DialogMeta, DialogSection, DialogTitle, DialogTrigger } from "../../internal/overlay/DialogParts";
|
|
4
4
|
import { type ControlSize } from "../../internal/states";
|
|
5
5
|
export type { DialogGuardProps as DrawerGuardProps } from "../../internal/overlay/DialogGuard";
|
|
6
|
-
export type { DialogActionsProps as DrawerActionsProps, DialogBodyProps as DrawerBodyProps, DialogCloseProps as DrawerCloseProps, DialogDescriptionProps as DrawerDescriptionProps, DialogFooterProps as DrawerFooterProps, DialogHeaderProps as DrawerHeaderProps, DialogIconProps as DrawerIconProps, DialogMetaProps as DrawerMetaProps, DialogTitleProps as DrawerTitleProps, DialogTriggerProps as DrawerTriggerProps, } from "../../internal/overlay/DialogParts";
|
|
6
|
+
export type { DialogActionsProps as DrawerActionsProps, DialogBodyProps as DrawerBodyProps, DialogCloseProps as DrawerCloseProps, DialogDescriptionProps as DrawerDescriptionProps, DialogFooterProps as DrawerFooterProps, DialogHeaderProps as DrawerHeaderProps, DialogIconProps as DrawerIconProps, DialogMetaProps as DrawerMetaProps, DialogSectionProps as DrawerSectionProps, DialogTitleProps as DrawerTitleProps, DialogTriggerProps as DrawerTriggerProps, } from "../../internal/overlay/DialogParts";
|
|
7
7
|
export type DrawerSide = "left" | "right";
|
|
8
8
|
export type DrawerLabels = DialogLabels;
|
|
9
9
|
export type DrawerRootProps = {
|
|
@@ -69,6 +69,7 @@ export declare const Drawer: {
|
|
|
69
69
|
Description: typeof DialogDescription;
|
|
70
70
|
Actions: typeof DialogActions;
|
|
71
71
|
Body: typeof DialogBody;
|
|
72
|
+
Section: typeof DialogSection;
|
|
72
73
|
Footer: typeof DialogFooter;
|
|
73
74
|
Meta: typeof DialogMeta;
|
|
74
75
|
Close: typeof DialogClose;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { HintTone } from "../hint/Hint";
|
|
2
3
|
import { type FieldRootDomProps } from "../../internal/FieldFrame";
|
|
3
4
|
import type { ControlSize } from "../../internal/states";
|
|
4
5
|
export type FieldListLabels = {
|
|
@@ -14,16 +15,19 @@ export type FieldListLabels = {
|
|
|
14
15
|
locked: string;
|
|
15
16
|
/** Text beside the disabled add button once the list holds `max` rows; `{max}` is the limit. */
|
|
16
17
|
maxReached: string;
|
|
18
|
+
/** Name of the totals row (`renderTotals`), shown in its first cell when that has no total. */
|
|
19
|
+
totals: string;
|
|
17
20
|
};
|
|
18
21
|
export declare const FIELD_LIST_LABELS: FieldListLabels;
|
|
19
22
|
/** Width of a column: the same track in the heading row and in every row. */
|
|
20
|
-
export type FieldListColumnWidth = "fill" | "compact" | "s" | "m";
|
|
23
|
+
export type FieldListColumnWidth = "fill" | "compact" | "xs" | "s" | "m";
|
|
21
24
|
export type FieldListColumn = {
|
|
22
25
|
/** Column heading, shown once above the rows; it names the field of this column in every row. */
|
|
23
26
|
label: string;
|
|
24
27
|
/**
|
|
25
28
|
* `fill` (default) shares the free width; `compact` fits an icon-only control (an icon Select,
|
|
26
|
-
* a swatch button, a checkbox); `
|
|
29
|
+
* a swatch button, a checkbox); `xs` a number of a few digits (a share, a percent); `s` a short
|
|
30
|
+
* value (a quantity, a code); `m` an amount or a date.
|
|
27
31
|
*/
|
|
28
32
|
width?: FieldListColumnWidth;
|
|
29
33
|
/** A red `*` after the heading (decorative): every field of the column is required. */
|
|
@@ -48,21 +52,25 @@ export type FieldListProps<T extends object> = Omit<FieldRootDomProps, "onChange
|
|
|
48
52
|
*/
|
|
49
53
|
defaultValue?: readonly T[];
|
|
50
54
|
/**
|
|
51
|
-
* The new list after an edit (`row.update`), an
|
|
55
|
+
* The new list after an edit (`row.update`), an add, a remove or a move. Return the save's promise: the new list shows while it is pending, the owner's again on a reject (say why with `error`).
|
|
52
56
|
*/
|
|
53
|
-
onValueChange?: (value: T[]) => void
|
|
57
|
+
onValueChange?: (value: T[]) => void | Promise<void>;
|
|
54
58
|
/**
|
|
55
59
|
* Stable unique id of an item: the row key and the drag id.
|
|
56
60
|
*/
|
|
57
61
|
getId: (item: T) => string;
|
|
58
62
|
/**
|
|
59
|
-
* The columns in cell order: `label` (the heading; it names the field of the column in every row), `width` (`fill` | `compact` | `s` | `m`), `required` (a `*` after the heading).
|
|
63
|
+
* The columns in cell order: `label` (the heading; it names the field of the column in every row), `width` (`fill` | `compact` | `xs` | `s` | `m`), `required` (a `*` after the heading).
|
|
60
64
|
*/
|
|
61
65
|
columns: readonly FieldListColumn[];
|
|
62
66
|
/**
|
|
63
67
|
* The cells of a row, one element per column (a fragment): kit fields without `label`. `row` has `index`, `update(patch)` and `remove()`.
|
|
64
68
|
*/
|
|
65
69
|
renderItem: (item: T, row: FieldListRow<T>) => React.ReactNode;
|
|
70
|
+
/**
|
|
71
|
+
* The totals row under the rows: one node per column (a fragment), `null` where a column has none. The first cell without a total reads `labels.totals`, the row's group name.
|
|
72
|
+
*/
|
|
73
|
+
renderTotals?: (items: readonly T[]) => React.ReactNode;
|
|
66
74
|
/**
|
|
67
75
|
* A new empty item; with it the add button shows under the rows and focus goes to the new row's first field.
|
|
68
76
|
*/
|
|
@@ -99,6 +107,10 @@ export type FieldListProps<T extends object> = Omit<FieldRootDomProps, "onChange
|
|
|
99
107
|
* Help text under the list; hidden while `error` shows.
|
|
100
108
|
*/
|
|
101
109
|
hint?: React.ReactNode;
|
|
110
|
+
/**
|
|
111
|
+
* 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.
|
|
112
|
+
*/
|
|
113
|
+
hintTone?: HintTone;
|
|
102
114
|
/**
|
|
103
115
|
* A problem of the list as a whole («Добавьте хотя бы одну позицию»); a field's own error goes on that field.
|
|
104
116
|
*/
|
|
@@ -122,7 +134,7 @@ export type FieldListProps<T extends object> = Omit<FieldRootDomProps, "onChange
|
|
|
122
134
|
* reorder and pinned rows. In a narrow container the rows stack into blocks and each field shows
|
|
123
135
|
* its own label.
|
|
124
136
|
*/
|
|
125
|
-
export declare function FieldList<T extends object>({ value: valueProp, defaultValue, onValueChange, getId, columns, renderItem, createItem, addLabel, getLabel, getLocked, reorderable, min, max, label, hint, error, disabled: disabledProp, size: sizeProp, labels: labelsProp, className, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: FieldListProps<T>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
137
|
+
export declare function FieldList<T extends object>({ value: valueProp, defaultValue, onValueChange, getId, columns, renderItem, renderTotals, createItem, addLabel, getLabel, getLocked, reorderable, min, max, label, hint, hintTone, error, disabled: disabledProp, size: sizeProp, labels: labelsProp, className, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: FieldListProps<T>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
126
138
|
export declare namespace FieldList {
|
|
127
139
|
var displayName: string;
|
|
128
140
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
import type { ControlSize } from "../../internal/states";
|
|
2
|
+
import type { ControlSize, Tone } from "../../internal/states";
|
|
3
|
+
/** The status a hint's words carry (a deadline that nears, a check that passed). */
|
|
4
|
+
export type HintTone = Extract<Tone, "neutral" | "success" | "warning" | "danger">;
|
|
3
5
|
export type HintRootProps = React.HTMLAttributes<HTMLParagraphElement> & {
|
|
4
6
|
/**
|
|
5
7
|
* Tier of the paired field: 12/16 for xs–m, 13/20 for l and xl. Without it the tier of its host, else `m`.
|
|
6
8
|
*/
|
|
7
9
|
size?: ControlSize;
|
|
10
|
+
/**
|
|
11
|
+
* Status color of the text (a deadline that nears, a check that passed). The words carry the status, the color repeats it; `invalid` and `disabled` take over the color.
|
|
12
|
+
*/
|
|
13
|
+
tone?: HintTone;
|
|
8
14
|
/**
|
|
9
15
|
* Error styling: danger text that drops in (fade + 4 px from above).
|
|
10
16
|
*/
|
|
@@ -15,7 +21,7 @@ export type HintRootProps = React.HTMLAttributes<HTMLParagraphElement> & {
|
|
|
15
21
|
disabled?: boolean;
|
|
16
22
|
ref?: React.Ref<HTMLParagraphElement>;
|
|
17
23
|
};
|
|
18
|
-
declare function HintRoot({ className, size: sizeProp, invalid, disabled: disabledProp, children, ...rest }: HintRootProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
24
|
+
declare function HintRoot({ className, size: sizeProp, tone, invalid, disabled: disabledProp, children, ...rest }: HintRootProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
19
25
|
declare namespace HintRoot {
|
|
20
26
|
var displayName: string;
|
|
21
27
|
}
|