prime-ui-kit 0.9.2 → 0.9.3
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 +9 -5
- package/dist/chunks/{chunk-ZEFCDEEQ.js → chunk-6JTZOA5I.js} +878 -331
- package/dist/chunks/{chunk-LXGRKN34.js → chunk-OAE4IQX2.js} +769 -479
- package/dist/chunks/{chunk-IQELQNMR.js → chunk-U5SR2LZR.js} +17 -4
- package/dist/color-picker.js +2 -2
- package/dist/components/button/Button.d.ts +19 -2
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/code-block/CodeBlock.d.ts +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +1 -1
- package/dist/components/data-table/Row.d.ts +3 -1
- package/dist/components/data-table/rows.d.ts +4 -0
- package/dist/components/digit-input/DigitInput.d.ts +6 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/input/Input.d.ts +16 -1
- package/dist/components/input/passwordStrength.d.ts +9 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +16 -1
- package/dist/components/sparkline/Sparkline.d.ts +26 -0
- package/dist/hooks/useEdgeOverflow.d.ts +4 -0
- package/dist/icons/registry.d.ts +2 -0
- package/dist/index.css +830 -267
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -3
- package/dist/internal/CheckMark.d.ts +12 -0
- package/dist/internal/MorphText.d.ts +12 -0
- package/dist/internal/RollingNumber.d.ts +14 -0
- package/dist/internal/surfaceDepth.d.ts +25 -0
- package/dist/internal/swatch.d.ts +4 -1
- package/dist/layout/app-shell/AppShell.d.ts +2 -2
- package/dist/motion/celebrate.d.ts +18 -0
- package/dist/tokens/layers.d.ts +37 -0
- package/dist/tokens/naming.d.ts +1 -1
- package/dist/tokens/semantic.d.ts +66 -56
- package/dist/tokens/themes/dark.d.ts +6 -14
- package/package.json +1 -1
- package/src/components/accordion/COMPONENT.md +4 -4
- package/src/components/avatar/COMPONENT.md +1 -1
- package/src/components/button/COMPONENT.md +26 -5
- package/src/components/button/examples/download.tsx +45 -0
- package/src/components/button/examples/hold-to-confirm.tsx +23 -0
- package/src/components/button/examples/label-morph.tsx +33 -0
- package/src/components/card/COMPONENT.md +4 -2
- package/src/components/card/examples/narrow.tsx +2 -2
- package/src/components/card/examples/panel-chart.tsx +1 -1
- package/src/components/card/examples/variants.tsx +1 -1
- package/src/components/checkbox/examples/examples.module.css +1 -1
- package/src/components/code-block/COMPONENT.md +6 -6
- package/src/components/code-block/examples/overview.tsx +1 -1
- package/src/components/code-block/examples/variants.tsx +1 -1
- package/src/components/color-picker/COMPONENT.md +1 -1
- package/src/components/color-swatches/COMPONENT.md +5 -5
- package/src/components/command-menu/COMPONENT.md +1 -1
- package/src/components/crossfade/examples/overview.tsx +3 -3
- package/src/components/data-table/COMPONENT.md +5 -4
- package/src/components/digit-input/COMPONENT.md +5 -3
- package/src/components/digit-input/examples/on-complete.tsx +7 -6
- package/src/components/dnd/COMPONENT.md +1 -1
- package/src/components/dnd/examples/examples.module.css +4 -4
- package/src/components/dropdown/COMPONENT.md +1 -1
- package/src/components/dropdown/examples/examples.module.css +1 -1
- package/src/components/empty-page/examples/examples.module.css +1 -1
- package/src/components/example-frame/COMPONENT.md +1 -1
- package/src/components/input/COMPONENT.md +10 -1
- package/src/components/input/examples/password-strength.tsx +12 -0
- package/src/components/kanban/COMPONENT.md +4 -4
- package/src/components/login-form/COMPONENT.md +4 -4
- package/src/components/login-form/examples/register.tsx +2 -2
- package/src/components/login-form/examples/reset-password.tsx +2 -2
- package/src/components/modal/COMPONENT.md +2 -2
- package/src/components/modal/examples/examples.module.css +2 -2
- package/src/components/page-content/examples/examples.module.css +1 -1
- package/src/components/popover/COMPONENT.md +1 -1
- package/src/components/progress-bar/COMPONENT.md +5 -1
- package/src/components/progress-bar/examples/examples.module.css +7 -0
- package/src/components/progress-bar/examples/milestone.tsx +43 -0
- package/src/components/progress-bar/examples/steps.tsx +35 -0
- package/src/components/skeleton/examples/with-crossfade.tsx +3 -3
- package/src/components/sparkline/COMPONENT.md +98 -0
- package/src/components/sparkline/examples/examples.module.css +13 -0
- package/src/components/sparkline/examples/overview.tsx +27 -0
- package/src/components/sparkline/examples/period.tsx +46 -0
- package/src/components/tabs/COMPONENT.md +15 -16
- package/src/components/tabs/examples/examples.module.css +14 -0
- package/src/components/tabs/examples/orientation.tsx +87 -33
- package/src/components/tooltip/COMPONENT.md +8 -6
- package/src/components/tooltip/examples/examples.module.css +2 -2
- package/src/layout/app-header/COMPONENT.md +1 -1
- package/src/layout/app-header/examples/examples.module.css +4 -4
- package/src/layout/app-shell/COMPONENT.md +8 -8
- package/src/layout/app-shell/examples/examples.module.css +3 -3
- package/src/layout/bottom-nav/COMPONENT.md +1 -1
- package/src/layout/bottom-nav/examples/examples.module.css +1 -1
- package/src/layout/sidebar/COMPONENT.md +4 -4
- package/src/layout/sidebar/examples/examples.module.css +5 -5
- package/src/styles/globals.css +125 -2
- package/src/styles/theme-dark.css +36 -13
- package/src/styles/theme-light.css +60 -16
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
Icon,
|
|
5
5
|
Input,
|
|
6
6
|
Select,
|
|
7
|
+
SurfaceDepthProvider,
|
|
7
8
|
SwatchChip,
|
|
8
9
|
createComponentContext,
|
|
9
10
|
cx,
|
|
10
11
|
fieldSurfaceClass
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6JTZOA5I.js";
|
|
12
13
|
|
|
13
14
|
// src/components/color-picker/ColorPicker.tsx
|
|
14
15
|
import * as React from "react";
|
|
@@ -60,7 +61,7 @@ var COLOR_PICKER_LABELS = {
|
|
|
60
61
|
green: "\u0417\u0435\u043B\u0451\u043D\u044B\u0439, 0\u2013255",
|
|
61
62
|
blue: "\u0421\u0438\u043D\u0438\u0439, 0\u2013255"
|
|
62
63
|
};
|
|
63
|
-
var CHECKER_BG = "repeating-conic-gradient(var(--prime-color-
|
|
64
|
+
var CHECKER_BG = "repeating-conic-gradient(var(--prime-color-layer-current) 0deg 90deg, var(--prime-color-fill-strong) 90deg 180deg) 0% 0% / var(--prime-space-2) var(--prime-space-2)";
|
|
64
65
|
var [ColorPickerProvider, useColorPickerContext] = createComponentContext("ColorPicker");
|
|
65
66
|
function useColorState() {
|
|
66
67
|
const state = React.useContext(ColorPickerStateContext);
|
|
@@ -194,8 +195,20 @@ function ChannelStrip({ className, focusRing = true, ...rest }) {
|
|
|
194
195
|
}
|
|
195
196
|
);
|
|
196
197
|
}
|
|
197
|
-
function Panel({ surface = "none", className, ...rest }) {
|
|
198
|
-
|
|
198
|
+
function Panel({ surface = "none", className, children, ...rest }) {
|
|
199
|
+
if (surface === "none") {
|
|
200
|
+
return /* @__PURE__ */ jsx("div", { className: cx(ColorPicker_default.panel, className), "data-surface": surface, ...rest, children });
|
|
201
|
+
}
|
|
202
|
+
return /* @__PURE__ */ jsx(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
className: cx(ColorPicker_default.panel, className),
|
|
206
|
+
"data-surface": surface,
|
|
207
|
+
"data-depth": "floating",
|
|
208
|
+
...rest,
|
|
209
|
+
children: /* @__PURE__ */ jsx(SurfaceDepthProvider, { value: "floating", children })
|
|
210
|
+
}
|
|
211
|
+
);
|
|
199
212
|
}
|
|
200
213
|
Panel.displayName = "ColorPicker.Panel";
|
|
201
214
|
function ColorPickerRoot({
|
package/dist/color-picker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import type { ControlSize, Tone, Variant } from "@/internal/states";
|
|
3
3
|
/**
|
|
4
4
|
* `tone="inherit"` takes the host's text color (a close button on a solid Banner): fills are a
|
|
@@ -14,11 +14,28 @@ type ButtonColorProps = {
|
|
|
14
14
|
/** Takes the host's text color; for actions placed on a colored host. */
|
|
15
15
|
tone: "inherit";
|
|
16
16
|
};
|
|
17
|
+
export type ButtonLabels = {
|
|
18
|
+
/** Description of a hold-to-confirm button for assistive tech. */
|
|
19
|
+
holdHint: string;
|
|
20
|
+
};
|
|
17
21
|
export type ButtonRootProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & ButtonColorProps & {
|
|
18
22
|
/** Tier. Default: the tier of the surrounding control (a form, a panel, a field), else `m`. */
|
|
19
23
|
size?: ControlSize;
|
|
20
24
|
fullWidth?: boolean;
|
|
21
25
|
loading?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Progress of a long action started by this button, `0…1`: a fill grows inside the button and
|
|
28
|
+
* `aria-busy` is set. The label carries the number («Скачивание 42%»). Remove it when done.
|
|
29
|
+
*/
|
|
30
|
+
progress?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The action needs a held press: the fill runs for 1.2 s and `onConfirm` fires at its end.
|
|
33
|
+
* Releasing earlier rolls the fill back and does nothing. Space and Enter hold too.
|
|
34
|
+
*/
|
|
35
|
+
holdToConfirm?: boolean;
|
|
36
|
+
/** Fires when a `holdToConfirm` press completes; the action goes here, not in `onClick`. */
|
|
37
|
+
onConfirm?: () => void;
|
|
38
|
+
labels?: Partial<ButtonLabels>;
|
|
22
39
|
/**
|
|
23
40
|
* Merges Button props onto its single child element instead of rendering `<button>`.
|
|
24
41
|
* `disabled` / `loading` become `aria-disabled` (a link has no native `disabled`), `type` is
|
|
@@ -27,7 +44,7 @@ export type ButtonRootProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
27
44
|
asChild?: boolean;
|
|
28
45
|
ref?: React.Ref<HTMLButtonElement>;
|
|
29
46
|
};
|
|
30
|
-
declare function ButtonRoot({ children, className, variant, tone, size: sizeProp, fullWidth, type, loading, disabled, asChild, onClick, ref, ...rest }: ButtonRootProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare function ButtonRoot({ children, className, variant, tone, size: sizeProp, fullWidth, type, loading, progress, holdToConfirm, onConfirm, labels, disabled, asChild, onClick, ref, ...rest }: ButtonRootProps): import("react/jsx-runtime").JSX.Element;
|
|
31
48
|
declare namespace ButtonRoot {
|
|
32
49
|
var displayName: string;
|
|
33
50
|
}
|
|
@@ -13,7 +13,7 @@ export type CardRootProps = DivProps & {
|
|
|
13
13
|
/** No raised shadow: a flat tile on the page (dense grids where shadows add noise). */
|
|
14
14
|
flat?: boolean;
|
|
15
15
|
};
|
|
16
|
-
declare function CardRoot({ variant, flat, className, ...rest }: CardRootProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function CardRoot({ variant, flat, className, children, ...rest }: CardRootProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare namespace CardRoot {
|
|
18
18
|
var displayName: string;
|
|
19
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { Variant } from "@/internal/states";
|
|
3
3
|
export type CodeBlockColorScheme = "light" | "dark";
|
|
4
|
-
/** `soft` —
|
|
4
|
+
/** `soft` — filled panel with padding and the `code` text role; `ghost` — bare `pre` that inherits type and background from its host. */
|
|
5
5
|
export type CodeBlockVariant = Extract<Variant, "soft" | "ghost">;
|
|
6
6
|
export type CodeBlockProps = Omit<React.HTMLAttributes<HTMLPreElement>, "children" | "dangerouslySetInnerHTML"> & {
|
|
7
7
|
/** TS/TSX source; highlighted with `highlightTsxHtml`. */
|
|
@@ -80,7 +80,7 @@ export type ColorPickerPanelProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
80
80
|
ref?: React.Ref<HTMLDivElement>;
|
|
81
81
|
};
|
|
82
82
|
/** Vertical stack for picker parts with the standard gap; optional raised surface. */
|
|
83
|
-
declare function Panel({ surface, className, ...rest }: ColorPickerPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
declare function Panel({ surface, className, children, ...rest }: ColorPickerPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
84
84
|
declare namespace Panel {
|
|
85
85
|
var displayName: string;
|
|
86
86
|
}
|
|
@@ -33,13 +33,15 @@ type DataTableRowProps<Row> = {
|
|
|
33
33
|
expandable: boolean;
|
|
34
34
|
expanded: boolean;
|
|
35
35
|
animate: boolean;
|
|
36
|
+
/** A sub-row of a row that is collapsing: it folds away before it unmounts. */
|
|
37
|
+
folding?: boolean;
|
|
36
38
|
/** The detail panel opened by the latest expand: it drops in. */
|
|
37
39
|
detailAnimate: boolean;
|
|
38
40
|
selected: boolean;
|
|
39
41
|
/** Ids of the sub-rows the toggle controls (while expanded). */
|
|
40
42
|
childControls: string;
|
|
41
43
|
};
|
|
42
|
-
declare function DataTableRowImpl<Row>({ shared, row, rowKey, index, depth, expandable, expanded, animate, detailAnimate, selected, childControls, }: DataTableRowProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function DataTableRowImpl<Row>({ shared, row, rowKey, index, depth, expandable, expanded, animate, folding, detailAnimate, selected, childControls, }: DataTableRowProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
43
45
|
/** A body row (plus its detail panel); re-renders only when its own props change. */
|
|
44
46
|
export declare const DataTableRow: typeof DataTableRowImpl;
|
|
45
47
|
type MeasureBodyProps<Row> = {
|
|
@@ -16,6 +16,8 @@ export type FlatRow<Row> = {
|
|
|
16
16
|
expanded: boolean;
|
|
17
17
|
/** Mounted by the latest expand, or newly added to `rows`: plays the enter animation. */
|
|
18
18
|
animate: boolean;
|
|
19
|
+
/** A sub-row of a row that is collapsing: still drawn while it folds away. */
|
|
20
|
+
folding: boolean;
|
|
19
21
|
};
|
|
20
22
|
export type MeasureRow<Row> = {
|
|
21
23
|
row: Row;
|
|
@@ -35,6 +37,8 @@ export type FlattenOptions<Row> = {
|
|
|
35
37
|
withDetail: boolean;
|
|
36
38
|
isRowExpandable?: (row: Row) => boolean;
|
|
37
39
|
expanded: ReadonlySet<React.Key>;
|
|
40
|
+
/** Rows collapsed a moment ago: their sub-rows stay drawn (folding) until the fold ends. */
|
|
41
|
+
closing?: ReadonlySet<React.Key>;
|
|
38
42
|
/** Top-level rows newly added to the data. */
|
|
39
43
|
arrived: ReadonlySet<React.Key>;
|
|
40
44
|
/** Row whose latest expand mounted new rows: only those animate in. */
|
|
@@ -34,10 +34,15 @@ export type DigitInputProps = FieldRootDomProps & FieldFrameProps & {
|
|
|
34
34
|
disabled?: boolean;
|
|
35
35
|
/** Invalid state: danger ring on every cell. A non-empty `error` implies it. */
|
|
36
36
|
invalid?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The code was accepted (after the server checked it): the cells turn success one after
|
|
39
|
+
* another. Say it in words too (`hint`), never by color alone.
|
|
40
|
+
*/
|
|
41
|
+
success?: boolean;
|
|
37
42
|
/** Id of the first cell (the label points at it); generated when omitted. */
|
|
38
43
|
id?: string;
|
|
39
44
|
"aria-describedby"?: string;
|
|
40
45
|
labels?: Partial<DigitInputLabels>;
|
|
41
46
|
};
|
|
42
47
|
/** A one-time code or PIN split into cells, with the field label, hint and error. */
|
|
43
|
-
export declare function DigitInput({ length, size: sizeProp, fullWidth, name, groupSize, mask, autoFocus, value: valueProp, defaultValue, onValueChange, onComplete, disabled, invalid, focusRing, label, required, optional, hint, error, id, "aria-describedby": ariaDescribedBy, labels: labelsProp, className, ...rest }: DigitInputProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function DigitInput({ length, size: sizeProp, fullWidth, name, groupSize, mask, autoFocus, value: valueProp, defaultValue, onValueChange, onComplete, disabled, invalid, success, focusRing, label, required, optional, hint, error, id, "aria-describedby": ariaDescribedBy, labels: labelsProp, className, ...rest }: DigitInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,7 +11,7 @@ export type { BannerActionsProps, BannerContentProps, BannerDescriptionProps, Ba
|
|
|
11
11
|
export { Banner } from "./banner/Banner";
|
|
12
12
|
export type { BreadcrumbEllipsisProps, BreadcrumbItemProps, BreadcrumbLabels, BreadcrumbRootProps, } from "./breadcrumb/Breadcrumb";
|
|
13
13
|
export { Breadcrumb } from "./breadcrumb/Breadcrumb";
|
|
14
|
-
export type { ButtonIconProps, ButtonRootProps } from "./button/Button";
|
|
14
|
+
export type { ButtonIconProps, ButtonLabels, ButtonRootProps } from "./button/Button";
|
|
15
15
|
export { Button } from "./button/Button";
|
|
16
16
|
export type { ButtonGroupIconProps, ButtonGroupItemProps, ButtonGroupOrientation, ButtonGroupRootProps, } from "./button-group/ButtonGroup";
|
|
17
17
|
export { ButtonGroup } from "./button-group/ButtonGroup";
|
|
@@ -53,6 +53,7 @@ export type { HintIconProps, HintRootProps } from "./hint/Hint";
|
|
|
53
53
|
export { Hint } from "./hint/Hint";
|
|
54
54
|
export type { InputAffixProps, InputClearButtonProps, InputCounterProps, InputFieldProps, InputIconProps, InputInlineAffixProps, InputLabels, InputRootProps, InputWrapperProps, } from "./input/Input";
|
|
55
55
|
export { Input } from "./input/Input";
|
|
56
|
+
export { getPasswordStrength, type PasswordStrength } from "./input/passwordStrength";
|
|
56
57
|
export type { KanbanColumn, KanbanItemBadgesProps, KanbanItemCountProps, KanbanItemDescriptionProps, KanbanItemFooterProps, KanbanItemProps, KanbanItemTitleProps, KanbanLabels, KanbanMove, KanbanRootProps, KanbanValue, } from "./kanban/Kanban";
|
|
57
58
|
export { Kanban } from "./kanban/Kanban";
|
|
58
59
|
export type { KbdProps } from "./kbd/Kbd";
|
|
@@ -97,6 +98,8 @@ export type { SliderLabels, SliderProps } from "./slider/Slider";
|
|
|
97
98
|
export { Slider } from "./slider/Slider";
|
|
98
99
|
export type { SmartFilterChipsProps, SmartFilterField, SmartFilterLabels, SmartFilterMode, SmartFilterOption, SmartFilterRootProps, SmartFilterSelection, SmartFilterToolbarProps, SmartFilterValue, } from "./smart-filter/SmartFilter";
|
|
99
100
|
export { matchesSmartFilter, resolveSmartFilterValues, SmartFilter, } from "./smart-filter/SmartFilter";
|
|
101
|
+
export type { SparklineLabels, SparklinePoint, SparklineProps, } from "./sparkline/Sparkline";
|
|
102
|
+
export { Sparkline } from "./sparkline/Sparkline";
|
|
100
103
|
export type { SpinnerLabels, SpinnerProps } from "./spinner/Spinner";
|
|
101
104
|
export { Spinner } from "./spinner/Spinner";
|
|
102
105
|
export type { StepperArrowProps, StepperContentProps, StepperDescriptionProps, StepperIndicatorProps, StepperItemProps, StepperItemStatus, StepperRootProps, StepperTitleProps, } from "./stepper/Stepper";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type FieldRootDomProps } from "@/internal/FieldFrame";
|
|
3
3
|
import type { ControlSize } from "@/internal/states";
|
|
4
|
+
import { type PasswordStrength } from "./passwordStrength";
|
|
4
5
|
export type InputLabels = {
|
|
5
6
|
/** Muted marker after the label when `optional`. */
|
|
6
7
|
optional: string;
|
|
@@ -8,6 +9,13 @@ export type InputLabels = {
|
|
|
8
9
|
clear: string;
|
|
9
10
|
/** Screen-reader text of `Input.Counter`; `{current}` and `{max}` are replaced. */
|
|
10
11
|
counter: string;
|
|
12
|
+
/** Accessible name of the `strength` meter. */
|
|
13
|
+
strength: string;
|
|
14
|
+
/** Visible words of the four `strength` levels. */
|
|
15
|
+
strengthWeak: string;
|
|
16
|
+
strengthEasy: string;
|
|
17
|
+
strengthMedium: string;
|
|
18
|
+
strengthHard: string;
|
|
11
19
|
};
|
|
12
20
|
export type InputRootProps = FieldRootDomProps & {
|
|
13
21
|
/** Tier. Default: the tier of the surrounding control (a form, a panel), else `m`. */
|
|
@@ -34,10 +42,17 @@ export type InputRootProps = FieldRootDomProps & {
|
|
|
34
42
|
reserveSupportRow?: boolean;
|
|
35
43
|
/** Explicit id for the underlying <input>; auto-generated if omitted. */
|
|
36
44
|
id?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A password strength meter under the field: four steps that fill as the value grows stronger,
|
|
47
|
+
* with the level word on the right of the support row. Use on new-password fields.
|
|
48
|
+
*/
|
|
49
|
+
strength?: boolean;
|
|
50
|
+
/** Replaces the kit's estimate (`getPasswordStrength`): return 0 (empty) … 4 (hard). */
|
|
51
|
+
getStrength?: (value: string) => PasswordStrength;
|
|
37
52
|
labels?: Partial<InputLabels>;
|
|
38
53
|
children: React.ReactNode;
|
|
39
54
|
};
|
|
40
|
-
declare function InputRoot({ size: sizeProp, invalid, focusRing, label, required, optional, hint, error, counter, reserveSupportRow, id, labels: labelsProp, children, className, ...rest }: InputRootProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
declare function InputRoot({ size: sizeProp, invalid, focusRing, label, required, optional, hint, error, counter, reserveSupportRow, id, strength, getStrength, labels: labelsProp, children, className, ...rest }: InputRootProps): import("react/jsx-runtime").JSX.Element;
|
|
41
56
|
declare namespace InputRoot {
|
|
42
57
|
var displayName: string;
|
|
43
58
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A password level: 0 — empty, 1 — weak, 2 — easy, 3 — medium, 4 — hard. */
|
|
2
|
+
export type PasswordStrength = 0 | 1 | 2 | 3 | 4;
|
|
3
|
+
/**
|
|
4
|
+
* The kit's default estimate. Every trait adds one point on its own, in any order: lowercase
|
|
5
|
+
* letters, uppercase letters, digits, symbols, 10+ characters, 14+ characters. Points 0–2 are weak,
|
|
6
|
+
* 3 easy, 4 medium, 5+ hard; a password shorter than 8 characters is at most easy. A quick hint
|
|
7
|
+
* for the person typing, not a security check — the server decides what it accepts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPasswordStrength(value: string): PasswordStrength;
|
|
@@ -13,9 +13,24 @@ export type ProgressBarProps = Omit<React.HTMLAttributes<HTMLDivElement>, "child
|
|
|
13
13
|
/** Shows the rounded filled percentage at the end of the label row. */
|
|
14
14
|
showValue?: boolean;
|
|
15
15
|
ref?: React.Ref<HTMLDivElement>;
|
|
16
|
-
} &
|
|
16
|
+
} & ProgressBarModeProps;
|
|
17
|
+
/** Value mode may draw its scale as steps; segments already are parts. */
|
|
18
|
+
type ProgressBarModeProps = (Extract<ProgressModeProps, {
|
|
19
|
+
value: number;
|
|
20
|
+
}> & {
|
|
21
|
+
/**
|
|
22
|
+
* Draws the scale as `max` equal cells (2–12), each filled whole: a level out of a few
|
|
23
|
+
* (password strength, a step of onboarding). `value` rounds to a whole cell.
|
|
24
|
+
*/
|
|
25
|
+
steps?: boolean;
|
|
26
|
+
}) | (Extract<ProgressModeProps, {
|
|
27
|
+
segments: unknown;
|
|
28
|
+
}> & {
|
|
29
|
+
steps?: never;
|
|
30
|
+
});
|
|
17
31
|
/**
|
|
18
32
|
* A linear progress line: a single `value` (native `<progress>` for assistive tech) or
|
|
19
33
|
* `segments` — parts of a whole in one bar (`role="group"` named by the distribution).
|
|
20
34
|
*/
|
|
21
35
|
export declare function ProgressBar(props: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SparklinePoint = {
|
|
3
|
+
/** Name of the point on the axis: a date, a week, a month («8 окт»). */
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
};
|
|
7
|
+
export type SparklineLabels = {
|
|
8
|
+
/** Spoken value of the chosen point; `{label}` and `{value}` are replaced. */
|
|
9
|
+
point: string;
|
|
10
|
+
};
|
|
11
|
+
export type SparklineProps = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
12
|
+
/** Points in order, oldest first; at least two draw a line. */
|
|
13
|
+
data: SparklinePoint[];
|
|
14
|
+
/** Visible title above the value and the accessible name of the chart. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Display of a value («312 400 ₽»). Default: the number with Russian digit groups. */
|
|
17
|
+
formatValue?: (value: number) => string;
|
|
18
|
+
labels?: Partial<SparklineLabels>;
|
|
19
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A small line chart with its headline: the latest value, its change against the point before and
|
|
23
|
+
* its date. Scrubbing (pointer, touch, or the arrow keys on the chart) shows any point; the header
|
|
24
|
+
* follows instantly, the trend arrow turns, and leaving glides the cursor back to the latest point.
|
|
25
|
+
*/
|
|
26
|
+
export declare function Sparkline({ data, label, formatValue, labels: labelsProp, className, ref, ...rest }: SparklineProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,5 +8,9 @@ export type EdgeOverflow = {
|
|
|
8
8
|
* (`ScrollContainer` `fade`, the DataTable edge cue). Measured at most once per frame on scroll,
|
|
9
9
|
* on resize of the region or any child, and when children are added. RTL-aware: the start is the
|
|
10
10
|
* inline start of the region.
|
|
11
|
+
*
|
|
12
|
+
* It also writes how far the hidden content reaches on each side to the region itself
|
|
13
|
+
* (`--edge-start` / `--edge-end`, px), so a fade can be as deep as that distance at most: it grows
|
|
14
|
+
* as the region scrolls away from an edge and melts as it comes back, instead of switching.
|
|
11
15
|
*/
|
|
12
16
|
export declare function useEdgeOverflow(ref: React.RefObject<HTMLElement | null>, enabled: boolean, horizontal: boolean): EdgeOverflow;
|
package/dist/icons/registry.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ export declare const iconRegistry: {
|
|
|
73
73
|
readonly "status.locked": import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
74
74
|
readonly "status.offline": import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
75
75
|
readonly "status.success": import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
76
|
+
/** A rising trend; a falling one is the same arrow turned half a turn (it rotates between them). */
|
|
77
|
+
readonly "status.trendUp": import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
76
78
|
readonly "status.warning": import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
77
79
|
readonly "theme.dark": import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
78
80
|
readonly "theme.light": import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|