@nextlyhq/ui 0.0.2-alpha.8 → 0.0.2-alpha.81
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 +130 -23
- package/dist/color.cjs +472 -0
- package/dist/color.cjs.map +1 -0
- package/dist/color.d.cts +254 -0
- package/dist/color.d.ts +254 -0
- package/dist/color.mjs +458 -0
- package/dist/color.mjs.map +1 -0
- package/dist/format.cjs +83 -0
- package/dist/format.cjs.map +1 -0
- package/dist/format.d.cts +84 -0
- package/dist/format.d.ts +84 -0
- package/dist/format.mjs +80 -0
- package/dist/format.mjs.map +1 -0
- package/dist/index.cjs +7613 -2200
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2425 -955
- package/dist/index.d.ts +2429 -959
- package/dist/index.mjs +7488 -2130
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +2 -0
- package/dist/styles.scoped.css +2 -0
- package/dist/tailwind-preset.cjs +191 -0
- package/dist/tailwind-preset.cjs.map +1 -0
- package/dist/tailwind-preset.d.cts +142 -0
- package/dist/tailwind-preset.d.ts +142 -0
- package/dist/tailwind-preset.mjs +186 -0
- package/dist/tailwind-preset.mjs.map +1 -0
- package/dist/theme.css +1425 -0
- package/dist/utils.cjs +24 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +17 -0
- package/dist/utils.d.ts +17 -0
- package/dist/utils.mjs +23 -0
- package/dist/utils.mjs.map +1 -0
- package/docs/plugin-ui-authoring.md +230 -0
- package/package.json +97 -27
package/dist/index.d.cts
CHANGED
|
@@ -1,35 +1,65 @@
|
|
|
1
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
-
import * as react from 'react';
|
|
3
|
-
import { ButtonHTMLAttributes, ComponentProps, TextareaHTMLAttributes, HTMLAttributes, ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
4
|
-
import * as class_variance_authority from 'class-variance-authority';
|
|
5
|
-
import { VariantProps } from 'class-variance-authority';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
-
import { Root } from '@radix-ui/react-label';
|
|
8
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
9
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
10
|
-
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
11
|
-
import { Root as Root$1 } from '@radix-ui/react-switch';
|
|
12
|
-
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
13
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
14
|
-
import { Content, Item, Root as Root$2, Trigger } from '@radix-ui/react-accordion';
|
|
15
|
-
import * as _radix_ui_react_tabs from '@radix-ui/react-tabs';
|
|
16
|
-
import { Content as Content$1, List, Root as Root$3, Trigger as Trigger$1 } from '@radix-ui/react-tabs';
|
|
17
|
-
import * as _radix_ui_react_tooltip from '@radix-ui/react-tooltip';
|
|
18
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
19
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
20
|
-
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
21
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
22
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
23
|
-
import { Command as Command$1 } from 'cmdk';
|
|
24
|
-
import { LucideProps } from 'lucide-react';
|
|
25
|
-
import { ToasterProps } from 'sonner';
|
|
26
|
-
export { ToasterProps, toast } from 'sonner';
|
|
27
|
-
import { ClassValue } from 'clsx';
|
|
28
1
|
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, ComponentProps, ComponentPropsWithoutRef, ElementRef, ForwardRefExoticComponent, HTMLAttributes, JSX, PropsWithoutRef, ReactNode, RefAttributes, TextareaHTMLAttributes } from "react";
|
|
4
|
+
import { VariantProps, cva } from "class-variance-authority";
|
|
5
|
+
import { Root } from "@radix-ui/react-label";
|
|
6
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
7
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
8
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
9
|
+
import { Root as Root$1 } from "@radix-ui/react-switch";
|
|
10
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
11
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
12
|
+
import { Content, Item, Root as Root$2, Trigger } from "@radix-ui/react-accordion";
|
|
13
|
+
import { Content as Content$1, List, Root as Root$3, Trigger as Trigger$1 } from "@radix-ui/react-tabs";
|
|
14
|
+
import { Content as Content$2, Provider, Root as Root$4, Trigger as Trigger$2 } from "@radix-ui/react-tooltip";
|
|
15
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
16
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
17
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
18
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
19
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
20
|
+
import { Command as Command$1, defaultFilter } from "cmdk";
|
|
21
|
+
import { LucideProps } from "lucide-react";
|
|
22
|
+
import { ToasterProps, ToasterProps as ToasterProps$1, toast } from "sonner";
|
|
23
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
24
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
25
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
26
|
+
/**
|
|
27
|
+
* The function `cva` returns for the variants map `T`: each variant's arms, and
|
|
28
|
+
* `class` or `className`.
|
|
29
|
+
*
|
|
30
|
+
* Every `*Variants` export is annotated with this over the very object its `cva`
|
|
31
|
+
* call is given (`VariantsFn<typeof BUTTON_VARIANT_MAP>`), so the published type
|
|
32
|
+
* is read from the configuration rather than restated beside it. An arm added to
|
|
33
|
+
* a map reaches the type with no second edit; a hand-written union would go on
|
|
34
|
+
* accepting the old set while the function accepted the new one.
|
|
35
|
+
* `variants.test-d.ts` checks each one against its map.
|
|
36
|
+
*/
|
|
37
|
+
type VariantsFn<T> = ReturnType<typeof cva<T>>;
|
|
38
|
+
/** @public */
|
|
29
39
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
30
|
-
|
|
40
|
+
asChild?: boolean;
|
|
31
41
|
}
|
|
32
|
-
|
|
42
|
+
/** The arms `buttonVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
43
|
+
declare const BUTTON_VARIANT_MAP: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: string;
|
|
46
|
+
primary: string;
|
|
47
|
+
destructive: string;
|
|
48
|
+
outline: string;
|
|
49
|
+
secondary: string;
|
|
50
|
+
ghost: string;
|
|
51
|
+
link: string;
|
|
52
|
+
};
|
|
53
|
+
size: {
|
|
54
|
+
default: string;
|
|
55
|
+
sm: string;
|
|
56
|
+
md: string;
|
|
57
|
+
lg: string;
|
|
58
|
+
icon: string;
|
|
59
|
+
"icon-sm": string;
|
|
60
|
+
"icon-lg": string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
33
63
|
/**
|
|
34
64
|
* Button Component - Design System Specification
|
|
35
65
|
*
|
|
@@ -42,16 +72,22 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantPr
|
|
|
42
72
|
* - destructive: Destructive action button (red background)
|
|
43
73
|
* - outline: Outlined button (transparent background, border)
|
|
44
74
|
* - ghost: Minimal button (transparent, no border)
|
|
45
|
-
* - link: Link-style button (underlined
|
|
75
|
+
* - link: Link-style button (text colour, underlined at rest)
|
|
46
76
|
*
|
|
47
77
|
* Note: 'primary' is a semantic alias for 'default' variant for better code readability
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
* @experimental
|
|
79
|
+
*/
|
|
80
|
+
declare const buttonVariants: VariantsFn<typeof BUTTON_VARIANT_MAP>;
|
|
81
|
+
/** @public */
|
|
82
|
+
declare const Button: ForwardRefExoticComponent<PropsWithoutRef<ButtonProps> & RefAttributes<HTMLButtonElement>>;
|
|
83
|
+
/** The arms `inputVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
84
|
+
declare const INPUT_VARIANT_MAP: {
|
|
85
|
+
size: {
|
|
86
|
+
sm: string;
|
|
87
|
+
default: string;
|
|
88
|
+
lg: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
55
91
|
/**
|
|
56
92
|
* Input Component - Design System Specification
|
|
57
93
|
*
|
|
@@ -66,15 +102,15 @@ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAtt
|
|
|
66
102
|
* - Placeholder text for guidance (not a replacement for labels)
|
|
67
103
|
*
|
|
68
104
|
* Design Specs:
|
|
69
|
-
* - Height: sm=
|
|
105
|
+
* - Height: sm=36px, default=40px, lg=44px
|
|
70
106
|
* - Padding: Horizontal varies by size (sm=10px, default=12px, lg=16px)
|
|
71
|
-
* - Border radius:
|
|
107
|
+
* - Border radius: `rounded-md`, the control step of the `--radius` scale
|
|
72
108
|
* - Border: 1px solid, changes on focus/error
|
|
73
109
|
* - Transition: 150ms (consistent with design system)
|
|
74
110
|
* - Font size: sm/default=14px (text-sm), lg=16px (text-base)
|
|
75
111
|
*
|
|
76
112
|
* Size Variants:
|
|
77
|
-
* - sm: Height
|
|
113
|
+
* - sm: Height 36px - Compact forms and filters, matching a small Button
|
|
78
114
|
* - default: Height 40px (h-10) - Standard forms
|
|
79
115
|
* - lg: Height 44px (h-11) - Prominent inputs, marketing forms
|
|
80
116
|
*
|
|
@@ -86,18 +122,39 @@ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAtt
|
|
|
86
122
|
* - tel: Phone number input
|
|
87
123
|
* - url: URL validation
|
|
88
124
|
* - search: Search input with clear button
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
interface InputProps extends Omit<ComponentProps<"input">, "size">, VariantProps<typeof inputVariants> {
|
|
125
|
+
* @experimental
|
|
126
|
+
*/
|
|
127
|
+
declare const inputVariants: VariantsFn<typeof INPUT_VARIANT_MAP>;
|
|
128
|
+
/** @public */
|
|
129
|
+
interface InputProps extends Omit<ComponentProps<"input">, "size">, VariantProps<typeof inputVariants> {}
|
|
130
|
+
/** @public */
|
|
131
|
+
declare const Input: ForwardRefExoticComponent<PropsWithoutRef<InputProps> & RefAttributes<HTMLInputElement>>;
|
|
132
|
+
type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
133
|
+
/** @public */
|
|
134
|
+
declare const Textarea: ForwardRefExoticComponent<PropsWithoutRef<TextareaProps> & RefAttributes<HTMLTextAreaElement>>;
|
|
135
|
+
/** @public */
|
|
136
|
+
declare function Label({ className, ...props }: ComponentProps<typeof Root>): JSX.Element;
|
|
137
|
+
/** @public */
|
|
138
|
+
interface FormLabelWithTooltipProps extends React$1.ComponentPropsWithoutRef<typeof Label> {
|
|
139
|
+
label: React$1.ReactNode;
|
|
140
|
+
description?: React$1.ReactNode;
|
|
141
|
+
required?: boolean;
|
|
142
|
+
labelClassName?: string;
|
|
143
|
+
tooltipClassName?: string;
|
|
94
144
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
declare const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
145
|
+
/** @public */
|
|
146
|
+
export declare const FormLabelWithTooltip: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<FormLabelWithTooltipProps> & React$1.RefAttributes<React$1.ElementRef<typeof Label>>>;
|
|
147
|
+
declare const BADGE_VARIANT_MAP: {
|
|
148
|
+
variant: {
|
|
149
|
+
default: string;
|
|
150
|
+
primary: string;
|
|
151
|
+
success: string;
|
|
152
|
+
warning: string;
|
|
153
|
+
destructive: string;
|
|
154
|
+
info: string;
|
|
155
|
+
outline: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
101
158
|
/**
|
|
102
159
|
* Badge Component - Design System Specification
|
|
103
160
|
*
|
|
@@ -116,23 +173,29 @@ declare function Label({ className, ...props }: ComponentProps<typeof Root>): re
|
|
|
116
173
|
* - Padding: 2px 10px (vertical × horizontal)
|
|
117
174
|
* - Border radius: Full (pill shape)
|
|
118
175
|
* - Font: 12px (text-xs), medium weight (500)
|
|
119
|
-
* -
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* -
|
|
124
|
-
* -
|
|
125
|
-
* - warning:
|
|
126
|
-
* -
|
|
127
|
-
*
|
|
128
|
-
*/
|
|
129
|
-
declare const badgeVariants:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
176
|
+
* - Status variants (success, warning, destructive, info): a neutral chip with
|
|
177
|
+
* a 6px dot in the status's solid colour before the label
|
|
178
|
+
*
|
|
179
|
+
* Variants:
|
|
180
|
+
* - default: muted background
|
|
181
|
+
* - primary: primary tint
|
|
182
|
+
* - success, warning, destructive, info: quiet chip with a status dot
|
|
183
|
+
* - outline: transparent background with a border
|
|
184
|
+
* @experimental
|
|
185
|
+
*/
|
|
186
|
+
declare const badgeVariants: VariantsFn<typeof BADGE_VARIANT_MAP>;
|
|
187
|
+
/** @public */
|
|
188
|
+
interface BadgeProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
189
|
+
/** @public */
|
|
190
|
+
declare function Badge({ className, variant, children, ...props }: BadgeProps): JSX.Element;
|
|
191
|
+
/** The arms `cardVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
192
|
+
declare const CARD_VARIANT_MAP: {
|
|
193
|
+
variant: {
|
|
194
|
+
default: string;
|
|
195
|
+
interactive: string;
|
|
196
|
+
elevated: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
136
199
|
/**
|
|
137
200
|
* Card Component - Design System Specification
|
|
138
201
|
*
|
|
@@ -140,14 +203,14 @@ declare function Badge({ className, variant, ...props }: BadgeProps): react_jsx_
|
|
|
140
203
|
* Cards provide a structured layout with header, content, and footer sections.
|
|
141
204
|
*
|
|
142
205
|
* Design Specs:
|
|
143
|
-
* - Border radius:
|
|
206
|
+
* - Border radius: `rounded-lg`, the container step of the `--radius` scale
|
|
144
207
|
* - Padding: 24px (p-6) for header/content, 16px 24px for footer
|
|
145
208
|
* - Shadow: sm (default), md (hover/elevated)
|
|
146
|
-
* - Border: 1px solid border border-
|
|
209
|
+
* - Border: 1px solid border border-border color
|
|
147
210
|
*
|
|
148
211
|
* Variants:
|
|
149
212
|
* - default: Standard card with subtle shadow
|
|
150
|
-
* - interactive: Hover effects for clickable cards (border border-
|
|
213
|
+
* - interactive: Hover effects for clickable cards (border border-border highlight, shadow increase)
|
|
151
214
|
* ⚠️ IMPORTANT: When using the interactive variant, you MUST add appropriate
|
|
152
215
|
* accessibility attributes:
|
|
153
216
|
* - Add role="button" or use an actual <button> wrapper
|
|
@@ -182,33 +245,106 @@ declare function Badge({ className, variant, ...props }: BadgeProps): react_jsx_
|
|
|
182
245
|
* - Interactive cards MUST have role, tabIndex, and keyboard handlers (see above)
|
|
183
246
|
* - Ensure sufficient color contrast for all text (WCAG 2.2 AA minimum)
|
|
184
247
|
* - Use aria-label or aria-labelledby for cards without visible text labels
|
|
248
|
+
* @experimental
|
|
185
249
|
*/
|
|
186
|
-
declare const cardVariants:
|
|
187
|
-
|
|
188
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
250
|
+
declare const cardVariants: VariantsFn<typeof CARD_VARIANT_MAP>;
|
|
251
|
+
/** @experimental */
|
|
189
252
|
type CardProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof cardVariants>;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
253
|
+
/** @experimental */
|
|
254
|
+
declare const Card: ForwardRefExoticComponent<PropsWithoutRef<CardProps> & RefAttributes<HTMLDivElement>>;
|
|
255
|
+
/** @experimental */
|
|
193
256
|
interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
257
|
+
/**
|
|
258
|
+
* Whether to hide the bottom border border-border separator between header and content.
|
|
259
|
+
* Default: false (border border-border is shown per design spec)
|
|
260
|
+
*/
|
|
261
|
+
noBorder?: boolean;
|
|
199
262
|
}
|
|
200
|
-
|
|
263
|
+
/** @experimental */
|
|
264
|
+
declare const CardHeader: ForwardRefExoticComponent<PropsWithoutRef<CardHeaderProps> & RefAttributes<HTMLDivElement>>;
|
|
265
|
+
/** @experimental */
|
|
201
266
|
type CardTitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
202
|
-
|
|
267
|
+
/** @experimental */
|
|
268
|
+
declare const CardTitle: ForwardRefExoticComponent<PropsWithoutRef<CardTitleProps> & RefAttributes<HTMLHeadingElement>>;
|
|
269
|
+
/** @experimental */
|
|
203
270
|
type CardDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
204
|
-
|
|
271
|
+
/** @experimental */
|
|
272
|
+
declare const CardDescription: ForwardRefExoticComponent<PropsWithoutRef<CardDescriptionProps> & RefAttributes<HTMLParagraphElement>>;
|
|
273
|
+
/** @experimental */
|
|
205
274
|
type CardActionProps = HTMLAttributes<HTMLDivElement>;
|
|
206
|
-
|
|
275
|
+
/** @experimental */
|
|
276
|
+
declare const CardAction: ForwardRefExoticComponent<PropsWithoutRef<CardActionProps> & RefAttributes<HTMLDivElement>>;
|
|
277
|
+
/** @experimental */
|
|
207
278
|
type CardContentProps = HTMLAttributes<HTMLDivElement>;
|
|
208
|
-
|
|
279
|
+
/** @experimental */
|
|
280
|
+
declare const CardContent: ForwardRefExoticComponent<PropsWithoutRef<CardContentProps> & RefAttributes<HTMLDivElement>>;
|
|
281
|
+
/** @experimental */
|
|
209
282
|
type CardFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
210
|
-
|
|
211
|
-
|
|
283
|
+
/** @experimental */
|
|
284
|
+
declare const CardFooter: ForwardRefExoticComponent<PropsWithoutRef<CardFooterProps> & RefAttributes<HTMLDivElement>>;
|
|
285
|
+
type Gap = 0 | 1 | 2 | 3 | 4 | 6 | 8;
|
|
286
|
+
type Cols = 1 | 2 | 3 | 4 | 6;
|
|
287
|
+
/** @experimental */
|
|
288
|
+
interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
289
|
+
/** Main-axis direction. Default `col`. */
|
|
290
|
+
direction?: "col" | "row";
|
|
291
|
+
/** Gap between children (Tailwind spacing step). Default `4`. */
|
|
292
|
+
gap?: Gap;
|
|
293
|
+
}
|
|
294
|
+
/** Flex stack: vertical by default, horizontal with `direction="row"`.
|
|
295
|
+
* @experimental
|
|
296
|
+
*/
|
|
297
|
+
export declare const Stack: ForwardRefExoticComponent<PropsWithoutRef<StackProps> & RefAttributes<HTMLDivElement>>;
|
|
298
|
+
/** @experimental */
|
|
299
|
+
interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
300
|
+
/** Column count. Default `2`. */
|
|
301
|
+
cols?: Cols;
|
|
302
|
+
/** Gap between cells. Default `4`. */
|
|
303
|
+
gap?: Gap;
|
|
304
|
+
/**
|
|
305
|
+
* Collapse to one column in a narrow container. Off by default so existing
|
|
306
|
+
* callers keep the fixed column count they were written against.
|
|
307
|
+
*/
|
|
308
|
+
responsive?: boolean;
|
|
309
|
+
}
|
|
310
|
+
/** Simple fixed-column grid, or a container-responsive one via `responsive`.
|
|
311
|
+
* @experimental
|
|
312
|
+
*/
|
|
313
|
+
export declare const Grid: ForwardRefExoticComponent<PropsWithoutRef<GridProps> & RefAttributes<HTMLDivElement>>;
|
|
314
|
+
/** A stat's tone: the status a dot before its value marks, as a badge's does. */
|
|
315
|
+
type StatTone = "success" | "warning" | "destructive" | "info";
|
|
316
|
+
/** @experimental */
|
|
317
|
+
interface StatProps extends HTMLAttributes<HTMLDivElement> {
|
|
318
|
+
/** Muted label above the value. */
|
|
319
|
+
label: string;
|
|
320
|
+
/** The emphasized value (string or node). */
|
|
321
|
+
value: ReactNode;
|
|
322
|
+
/**
|
|
323
|
+
* A dot before the value in a status's colour, such as `warning` beside
|
|
324
|
+
* "Should improve". It only marks the value: the value's own words say
|
|
325
|
+
* what it means, so colour is never the only sign. No dot when unset.
|
|
326
|
+
*/
|
|
327
|
+
tone?: StatTone;
|
|
328
|
+
/**
|
|
329
|
+
* `compact` draws the value smaller (20px rather than 24px), for a figure
|
|
330
|
+
* that leads a small card, with its label as the card's semibold title.
|
|
331
|
+
* Default `default`.
|
|
332
|
+
*/
|
|
333
|
+
size?: "default" | "compact";
|
|
334
|
+
}
|
|
335
|
+
/** Labelled metric block for dashboard-style plugin widgets.
|
|
336
|
+
* @experimental
|
|
337
|
+
*/
|
|
338
|
+
export declare const Stat: ForwardRefExoticComponent<PropsWithoutRef<StatProps> & RefAttributes<HTMLDivElement>>;
|
|
339
|
+
/** The arms `alertVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
340
|
+
declare const ALERT_VARIANT_MAP: {
|
|
341
|
+
variant: {
|
|
342
|
+
info: string;
|
|
343
|
+
success: string;
|
|
344
|
+
warning: string;
|
|
345
|
+
destructive: string;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
212
348
|
/**
|
|
213
349
|
* Alert Component - Design System Specification
|
|
214
350
|
*
|
|
@@ -217,13 +353,14 @@ declare const CardFooter: react.ForwardRefExoticComponent<CardFooterProps & reac
|
|
|
217
353
|
*
|
|
218
354
|
* Design Specs:
|
|
219
355
|
* - Padding: 16px (p-4)
|
|
220
|
-
* - Border radius:
|
|
356
|
+
* - Border radius: `rounded-md`, one step tighter than Card's `rounded-lg`
|
|
221
357
|
* for inline/flow content vs. larger container components
|
|
222
|
-
* - Border: 1px
|
|
358
|
+
* - Border: 1px; the card border for info and success, the status border for
|
|
359
|
+
* warning and destructive
|
|
223
360
|
* - Shadow: sm (subtle elevation)
|
|
224
361
|
* - Font: 14px (text-sm)
|
|
225
362
|
* - Layout: Flex with gap-3 for icon/content spacing
|
|
226
|
-
* - Colors:
|
|
363
|
+
* - Colors: the page's foreground text; the icon in the status's text colour
|
|
227
364
|
*
|
|
228
365
|
* Variants (4 total):
|
|
229
366
|
* - info (default): Blue - informational messages, neutral announcements
|
|
@@ -276,10 +413,10 @@ declare const CardFooter: react.ForwardRefExoticComponent<CardFooterProps & reac
|
|
|
276
413
|
* - Success: <CheckCircle2 className="h-4 w-4" />
|
|
277
414
|
* - Warning: <AlertTriangle className="h-4 w-4" />
|
|
278
415
|
* - Destructive: <XCircle className="h-4 w-4" />
|
|
416
|
+
* @experimental
|
|
279
417
|
*/
|
|
280
|
-
declare const alertVariants:
|
|
281
|
-
|
|
282
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
418
|
+
declare const alertVariants: VariantsFn<typeof ALERT_VARIANT_MAP>;
|
|
419
|
+
/** @experimental */
|
|
283
420
|
type AlertProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>;
|
|
284
421
|
/**
|
|
285
422
|
* Alert - Root container for alert messages
|
|
@@ -292,10 +429,10 @@ type AlertProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVari
|
|
|
292
429
|
* <CheckCircle2 className="h-4 w-4" />
|
|
293
430
|
* <AlertDescription>Operation completed successfully</AlertDescription>
|
|
294
431
|
* </Alert>
|
|
432
|
+
* @experimental
|
|
295
433
|
*/
|
|
296
|
-
declare const Alert:
|
|
297
|
-
|
|
298
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string> & react.RefAttributes<HTMLDivElement>>;
|
|
434
|
+
declare const Alert: ForwardRefExoticComponent<PropsWithoutRef<AlertProps> & RefAttributes<HTMLDivElement>>;
|
|
435
|
+
/** @experimental */
|
|
299
436
|
type AlertTitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
300
437
|
/**
|
|
301
438
|
* AlertTitle - Heading text for alert message
|
|
@@ -305,8 +442,10 @@ type AlertTitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
|
305
442
|
*
|
|
306
443
|
* @example
|
|
307
444
|
* <AlertTitle>Payment Successful</AlertTitle>
|
|
445
|
+
* @experimental
|
|
308
446
|
*/
|
|
309
|
-
declare const AlertTitle:
|
|
447
|
+
declare const AlertTitle: ForwardRefExoticComponent<PropsWithoutRef<AlertTitleProps> & RefAttributes<HTMLHeadingElement>>;
|
|
448
|
+
/** @experimental */
|
|
310
449
|
type AlertDescriptionProps = HTMLAttributes<HTMLDivElement>;
|
|
311
450
|
/**
|
|
312
451
|
* AlertDescription - Supporting detail text for alert message
|
|
@@ -318,11 +457,11 @@ type AlertDescriptionProps = HTMLAttributes<HTMLDivElement>;
|
|
|
318
457
|
* <AlertDescription>
|
|
319
458
|
* Your changes have been saved. <a href="/view">View details</a>
|
|
320
459
|
* </AlertDescription>
|
|
460
|
+
* @experimental
|
|
321
461
|
*/
|
|
322
|
-
declare const AlertDescription:
|
|
323
|
-
|
|
324
|
-
declare function Separator({ className, orientation, decorative, ...props }:
|
|
325
|
-
|
|
462
|
+
declare const AlertDescription: ForwardRefExoticComponent<PropsWithoutRef<AlertDescriptionProps> & RefAttributes<HTMLDivElement>>;
|
|
463
|
+
/** @experimental */
|
|
464
|
+
declare function Separator({ className, orientation, decorative, ...props }: React$1.ComponentProps<typeof SeparatorPrimitive.Root>): JSX.Element;
|
|
326
465
|
/**
|
|
327
466
|
* Skeleton Loading Component
|
|
328
467
|
*
|
|
@@ -332,7 +471,7 @@ declare function Separator({ className, orientation, decorative, ...props }: rea
|
|
|
332
471
|
* @design_specs
|
|
333
472
|
* - Background: bg-accent (slate-100 in light mode, slate-800 in dark mode)
|
|
334
473
|
* - Animation: animate-pulse with motion-reduce:animate-none (respects prefers-reduced-motion)
|
|
335
|
-
* - Border-radius:
|
|
474
|
+
* - Border-radius: `rounded-md` by default; override per placeholder shape
|
|
336
475
|
* - Contrast: 3:1 minimum for WCAG 1.4.11 (Non-text Contrast) compliance
|
|
337
476
|
*
|
|
338
477
|
* @accessibility
|
|
@@ -352,13 +491,13 @@ declare function Separator({ className, orientation, decorative, ...props }: rea
|
|
|
352
491
|
*
|
|
353
492
|
* **Avatar Skeleton:**
|
|
354
493
|
* ```tsx
|
|
355
|
-
* <Skeleton className="h-12 w-12 rounded-
|
|
494
|
+
* <Skeleton className="h-12 w-12 rounded-md" />
|
|
356
495
|
* ```
|
|
357
496
|
*
|
|
358
497
|
* **Card Skeleton:**
|
|
359
498
|
* ```tsx
|
|
360
499
|
* <div className="space-y-3">
|
|
361
|
-
* <Skeleton className="h-[125px] w-[250px] rounded-
|
|
500
|
+
* <Skeleton className="h-[125px] w-[250px] rounded-lg" />
|
|
362
501
|
* <div className="space-y-2">
|
|
363
502
|
* <Skeleton className="h-4 w-[250px]" />
|
|
364
503
|
* <Skeleton className="h-4 w-[200px]" />
|
|
@@ -372,7 +511,7 @@ declare function Separator({ className, orientation, decorative, ...props }: rea
|
|
|
372
511
|
* {isLoading ? (
|
|
373
512
|
* <>
|
|
374
513
|
* <span className="sr-only">Loading user profile...</span>
|
|
375
|
-
* <Skeleton className="h-12 w-12 rounded-
|
|
514
|
+
* <Skeleton className="h-12 w-12 rounded-md" />
|
|
376
515
|
* <Skeleton className="h-4 w-[200px]" />
|
|
377
516
|
* </>
|
|
378
517
|
* ) : (
|
|
@@ -395,66 +534,83 @@ declare function Separator({ className, orientation, decorative, ...props }: rea
|
|
|
395
534
|
*
|
|
396
535
|
* @see {@link https://ui.shadcn.com/docs/components/skeleton shadcn/ui Skeleton}
|
|
397
536
|
* @see {@link https://adrianroselli.com/2020/11/more-accessible-skeletons.html More Accessible Skeletons}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
537
|
+
* @experimental
|
|
538
|
+
*/
|
|
539
|
+
declare const Skeleton: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<SkeletonProps> & React$1.RefAttributes<HTMLDivElement>>;
|
|
540
|
+
/** @experimental */
|
|
541
|
+
type SkeletonProps = React$1.ComponentProps<"div"> & {
|
|
542
|
+
/**
|
|
543
|
+
* Draw a still outline: no pulse, on the `secondary` surface. For a page's
|
|
544
|
+
* outline shown while its data is on its way, where motion would read as
|
|
545
|
+
* the page itself moving.
|
|
546
|
+
*/
|
|
547
|
+
still?: boolean;
|
|
548
|
+
};
|
|
549
|
+
/** The arms `progressVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
550
|
+
declare const PROGRESS_VARIANT_MAP: {
|
|
551
|
+
variant: {
|
|
552
|
+
default: string;
|
|
553
|
+
success: string;
|
|
554
|
+
error: string;
|
|
555
|
+
};
|
|
556
|
+
};
|
|
402
557
|
/**
|
|
403
558
|
* Progress variants using CVA
|
|
404
559
|
*
|
|
405
560
|
* Defines color variants for different progress states.
|
|
561
|
+
*
|
|
562
|
+
* @experimental
|
|
406
563
|
*/
|
|
407
|
-
declare const progressVariants:
|
|
408
|
-
variant?: "default" | "success" | "error" | null | undefined;
|
|
409
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
564
|
+
export declare const progressVariants: VariantsFn<typeof PROGRESS_VARIANT_MAP>;
|
|
410
565
|
/**
|
|
411
566
|
* Progress component props
|
|
567
|
+
* @experimental
|
|
412
568
|
*/
|
|
413
569
|
type ProgressProps = {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
} &
|
|
570
|
+
/**
|
|
571
|
+
* Current progress value (0-100)
|
|
572
|
+
*
|
|
573
|
+
* @example
|
|
574
|
+
* ```tsx
|
|
575
|
+
* <Progress value={45} /> // 45% progress
|
|
576
|
+
* ```
|
|
577
|
+
*/
|
|
578
|
+
value: number;
|
|
579
|
+
/**
|
|
580
|
+
* Maximum value (default: 100)
|
|
581
|
+
*
|
|
582
|
+
* @example
|
|
583
|
+
* ```tsx
|
|
584
|
+
* <Progress value={30} max={50} /> // 60% progress (30/50)
|
|
585
|
+
* ```
|
|
586
|
+
*/
|
|
587
|
+
max?: number;
|
|
588
|
+
/**
|
|
589
|
+
* Visual variant for different states
|
|
590
|
+
*
|
|
591
|
+
* - `default`: Primary blue (bg-primary-500)
|
|
592
|
+
* - `success`: Green (bg-success-solid)
|
|
593
|
+
* - `error`: Red (bg-destructive)
|
|
594
|
+
*
|
|
595
|
+
* @default "default"
|
|
596
|
+
*/
|
|
597
|
+
variant?: VariantProps<typeof progressVariants>["variant"];
|
|
598
|
+
/**
|
|
599
|
+
* Optional CSS class name for custom styling
|
|
600
|
+
*/
|
|
601
|
+
className?: string;
|
|
602
|
+
/**
|
|
603
|
+
* Optional ARIA label for screen readers
|
|
604
|
+
*
|
|
605
|
+
* If not provided, defaults to "Progress: X%"
|
|
606
|
+
*
|
|
607
|
+
* @example
|
|
608
|
+
* ```tsx
|
|
609
|
+
* <Progress value={45} aria-label="Uploading image.jpg: 45%" />
|
|
610
|
+
* ```
|
|
611
|
+
*/
|
|
612
|
+
"aria-label"?: string;
|
|
613
|
+
} & React$1.HTMLAttributes<HTMLDivElement>;
|
|
458
614
|
/**
|
|
459
615
|
* Progress component
|
|
460
616
|
*
|
|
@@ -476,57 +632,15 @@ type ProgressProps = {
|
|
|
476
632
|
* );
|
|
477
633
|
* }
|
|
478
634
|
* ```
|
|
635
|
+
* @experimental
|
|
479
636
|
*/
|
|
480
|
-
declare const Progress:
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
* ```
|
|
488
|
-
*/
|
|
489
|
-
value: number;
|
|
490
|
-
/**
|
|
491
|
-
* Maximum value (default: 100)
|
|
492
|
-
*
|
|
493
|
-
* @example
|
|
494
|
-
* ```tsx
|
|
495
|
-
* <Progress value={30} max={50} /> // 60% progress (30/50)
|
|
496
|
-
* ```
|
|
497
|
-
*/
|
|
498
|
-
max?: number;
|
|
499
|
-
/**
|
|
500
|
-
* Visual variant for different states
|
|
501
|
-
*
|
|
502
|
-
* - `default`: Primary blue (bg-primary-500)
|
|
503
|
-
* - `success`: Green (bg-green-500)
|
|
504
|
-
* - `error`: Red (bg-destructive)
|
|
505
|
-
*
|
|
506
|
-
* @default "default"
|
|
507
|
-
*/
|
|
508
|
-
variant?: VariantProps<typeof progressVariants>["variant"];
|
|
509
|
-
/**
|
|
510
|
-
* Optional CSS class name for custom styling
|
|
511
|
-
*/
|
|
512
|
-
className?: string;
|
|
513
|
-
/**
|
|
514
|
-
* Optional ARIA label for screen readers
|
|
515
|
-
*
|
|
516
|
-
* If not provided, defaults to "Progress: X%"
|
|
517
|
-
*
|
|
518
|
-
* @example
|
|
519
|
-
* ```tsx
|
|
520
|
-
* <Progress value={45} aria-label="Uploading image.jpg: 45%" />
|
|
521
|
-
* ```
|
|
522
|
-
*/
|
|
523
|
-
"aria-label"?: string;
|
|
524
|
-
} & react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
525
|
-
|
|
526
|
-
declare const Checkbox: react.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
527
|
-
indeterminate?: boolean;
|
|
528
|
-
} & react.RefAttributes<HTMLButtonElement>>;
|
|
529
|
-
|
|
637
|
+
declare const Progress: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ProgressProps> & React$1.RefAttributes<HTMLDivElement>>;
|
|
638
|
+
type CheckboxProps = ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {
|
|
639
|
+
indeterminate?: boolean;
|
|
640
|
+
};
|
|
641
|
+
/** @public */
|
|
642
|
+
declare const Checkbox: ForwardRefExoticComponent<PropsWithoutRef<CheckboxProps> & RefAttributes<ElementRef<typeof CheckboxPrimitive.Root>>>;
|
|
643
|
+
type RadioGroupProps = ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;
|
|
530
644
|
/**
|
|
531
645
|
* RadioGroup Component - Design System Specification
|
|
532
646
|
*
|
|
@@ -542,43 +656,70 @@ declare const Checkbox: react.ForwardRefExoticComponent<Omit<CheckboxPrimitive.C
|
|
|
542
656
|
* Design Specs:
|
|
543
657
|
* - Size: 16px (h-4 w-4) - Fixed size matching Checkbox
|
|
544
658
|
* - Border: 1px solid, expands to 5px when checked (visual indicator)
|
|
545
|
-
* - Border radius:
|
|
659
|
+
* - Border radius: `rounded-full`. Round means "pick one" and square means
|
|
660
|
+
* "pick many"; a square radio would announce the wrong behaviour, so the
|
|
661
|
+
* shape is fixed and deliberately outside the `--radius` scale. Checkbox
|
|
662
|
+
* keeps the derived radius for the same reason.
|
|
546
663
|
* - Transition: 150ms (consistent with design system)
|
|
547
664
|
* - Focus ring: 2px ring with 2px offset
|
|
548
665
|
*
|
|
549
666
|
* Implementation Notes:
|
|
550
667
|
* - Uses Radix UI primitives for robust accessibility
|
|
551
|
-
* - Visual "checked" state achieved via border border-
|
|
552
|
-
* - No inner indicator needed - border border-
|
|
553
|
-
* - Hover state changes border border-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
declare const
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
668
|
+
* - Visual "checked" state achieved via border border-border expansion (border-[5px])
|
|
669
|
+
* - No inner indicator needed - border border-border expansion provides clear visual feedback
|
|
670
|
+
* - Hover state changes border border-border color for better interactivity
|
|
671
|
+
* @public
|
|
672
|
+
*/
|
|
673
|
+
declare const RadioGroup: ForwardRefExoticComponent<PropsWithoutRef<RadioGroupProps> & RefAttributes<ElementRef<typeof RadioGroupPrimitive.Root>>>;
|
|
674
|
+
type RadioGroupItemProps = ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;
|
|
675
|
+
/** @public */
|
|
676
|
+
declare const RadioGroupItem: ForwardRefExoticComponent<PropsWithoutRef<RadioGroupItemProps> & RefAttributes<ElementRef<typeof RadioGroupPrimitive.Item>>>;
|
|
677
|
+
/**
|
|
678
|
+
* A pill track carrying a circular thumb is how a toggle is recognised, so both
|
|
679
|
+
* parts use `rounded-full` and stay outside the `--radius` scale: at any theme
|
|
680
|
+
* radius the switch must still read as a switch and not as a small checkbox.
|
|
681
|
+
* @public
|
|
682
|
+
*/
|
|
683
|
+
declare function Switch({ className, ...props }: ComponentProps<typeof Root$1>): JSX.Element;
|
|
684
|
+
/** @experimental */
|
|
685
|
+
declare const Collapsible: typeof CollapsiblePrimitive.Root;
|
|
686
|
+
/** @experimental */
|
|
687
|
+
declare const CollapsibleTrigger: typeof CollapsiblePrimitive.CollapsibleTrigger;
|
|
688
|
+
/** @experimental */
|
|
689
|
+
declare const CollapsibleContent: typeof CollapsiblePrimitive.CollapsibleContent;
|
|
564
690
|
/**
|
|
565
691
|
* Props for the Accordion root component
|
|
566
692
|
* @see https://www.radix-ui.com/primitives/docs/components/accordion
|
|
693
|
+
* @experimental
|
|
567
694
|
*/
|
|
568
695
|
type AccordionProps = ComponentPropsWithoutRef<typeof Root$2>;
|
|
569
696
|
/**
|
|
570
697
|
* Props for the AccordionItem component (container for trigger and content)
|
|
698
|
+
* @experimental
|
|
571
699
|
*/
|
|
572
700
|
type AccordionItemProps = ComponentPropsWithoutRef<typeof Item>;
|
|
701
|
+
/**
|
|
702
|
+
* Ref type for AccordionItem component
|
|
703
|
+
*/
|
|
704
|
+
type AccordionItemRef = ElementRef<typeof Item>;
|
|
573
705
|
/**
|
|
574
706
|
* Props for the AccordionTrigger component (clickable header button)
|
|
707
|
+
* @experimental
|
|
575
708
|
*/
|
|
576
709
|
type AccordionTriggerProps = ComponentPropsWithoutRef<typeof Trigger>;
|
|
710
|
+
/**
|
|
711
|
+
* Ref type for AccordionTrigger component
|
|
712
|
+
*/
|
|
713
|
+
type AccordionTriggerRef = ElementRef<typeof Trigger>;
|
|
577
714
|
/**
|
|
578
715
|
* Props for the AccordionContent component (collapsible content panel)
|
|
716
|
+
* @experimental
|
|
579
717
|
*/
|
|
580
718
|
type AccordionContentProps = ComponentPropsWithoutRef<typeof Content>;
|
|
581
|
-
|
|
719
|
+
/**
|
|
720
|
+
* Ref type for AccordionContent component
|
|
721
|
+
*/
|
|
722
|
+
type AccordionContentRef = ElementRef<typeof Content>;
|
|
582
723
|
/**
|
|
583
724
|
* Accordion Component - Design System Specification
|
|
584
725
|
*
|
|
@@ -586,7 +727,7 @@ type AccordionContentProps = ComponentPropsWithoutRef<typeof Content>;
|
|
|
586
727
|
* Built on Radix UI primitives with WAI-ARIA compliance.
|
|
587
728
|
*
|
|
588
729
|
* Design Specs:
|
|
589
|
-
* - AccordionItem border: 1px bottom border border-
|
|
730
|
+
* - AccordionItem border: 1px bottom border border-border (border-b)
|
|
590
731
|
* - AccordionTrigger padding: 16px vertical (py-4)
|
|
591
732
|
* - AccordionTrigger font: font-medium (500 weight)
|
|
592
733
|
* - AccordionContent padding: 16px bottom, 0 top (pb-4 pt-0)
|
|
@@ -671,20 +812,22 @@ type AccordionContentProps = ComponentPropsWithoutRef<typeof Content>;
|
|
|
671
812
|
* ```
|
|
672
813
|
*
|
|
673
814
|
* @see https://www.radix-ui.com/primitives/docs/components/accordion
|
|
815
|
+
* @experimental
|
|
674
816
|
*/
|
|
675
|
-
declare const Accordion:
|
|
817
|
+
declare const Accordion: typeof AccordionPrimitive.Root;
|
|
676
818
|
/**
|
|
677
819
|
* AccordionItem - Container for trigger and content
|
|
678
820
|
*
|
|
679
821
|
* Design Specs:
|
|
680
|
-
* - Border: 1px bottom border border-
|
|
822
|
+
* - Border: 1px bottom border border-border (border-b) for visual separation
|
|
681
823
|
* - Each item represents a collapsible section
|
|
682
824
|
*
|
|
683
825
|
* Accessibility:
|
|
684
826
|
* - Each item requires a unique value prop for identification
|
|
685
827
|
* - Disabled state can be set via disabled prop
|
|
828
|
+
* @experimental
|
|
686
829
|
*/
|
|
687
|
-
declare const AccordionItem:
|
|
830
|
+
declare const AccordionItem: ForwardRefExoticComponent<PropsWithoutRef<AccordionItemProps> & RefAttributes<AccordionItemRef>>;
|
|
688
831
|
/**
|
|
689
832
|
* AccordionTrigger - Clickable header button that toggles content visibility
|
|
690
833
|
*
|
|
@@ -707,8 +850,9 @@ declare const AccordionItem: react.ForwardRefExoticComponent<Omit<AccordionPrimi
|
|
|
707
850
|
* - The ChevronDown icon is included by default
|
|
708
851
|
* - Icon rotates 180° when item is expanded ([data-state=open])
|
|
709
852
|
* - Trigger includes AccordionPrimitive.Header wrapper for proper semantics
|
|
853
|
+
* @experimental
|
|
710
854
|
*/
|
|
711
|
-
declare const AccordionTrigger:
|
|
855
|
+
declare const AccordionTrigger: ForwardRefExoticComponent<PropsWithoutRef<AccordionTriggerProps> & RefAttributes<AccordionTriggerRef>>;
|
|
712
856
|
/**
|
|
713
857
|
* AccordionContent - Collapsible content panel
|
|
714
858
|
*
|
|
@@ -728,9 +872,63 @@ declare const AccordionTrigger: react.ForwardRefExoticComponent<Omit<AccordionPr
|
|
|
728
872
|
* - data-state="open": animate-accordion-down (Tailwind built-in)
|
|
729
873
|
* - data-state="closed": animate-accordion-up (Tailwind built-in)
|
|
730
874
|
* - Height transitions smoothly from 0 to auto
|
|
875
|
+
* @experimental
|
|
731
876
|
*/
|
|
732
|
-
declare const AccordionContent:
|
|
733
|
-
|
|
877
|
+
declare const AccordionContent: ForwardRefExoticComponent<PropsWithoutRef<AccordionContentProps> & RefAttributes<AccordionContentRef>>;
|
|
878
|
+
/**
|
|
879
|
+
* Avatar component props
|
|
880
|
+
*
|
|
881
|
+
* Root container for displaying user avatars with image and fallback support.
|
|
882
|
+
* Extends Radix UI Avatar.Root props with size variants.
|
|
883
|
+
* @experimental
|
|
884
|
+
*/
|
|
885
|
+
type AvatarProps = ComponentPropsWithoutRef<"span"> & VariantProps<typeof avatarVariants> & {
|
|
886
|
+
/**
|
|
887
|
+
* Size variant
|
|
888
|
+
* - sm: 32px (h-8 w-8) - For compact layouts, lists
|
|
889
|
+
* - md: 40px (h-10 w-10) - Default size, general use
|
|
890
|
+
* - lg: 48px (h-12 w-12) - For prominent displays, profiles
|
|
891
|
+
* - xl: 64px (h-16 w-16) - For large profile displays, user panels
|
|
892
|
+
* - 2xl: 80px (h-20 w-20) - For profile headers, large avatars
|
|
893
|
+
* @default "md"
|
|
894
|
+
*/
|
|
895
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl";
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
* AvatarImage component props
|
|
899
|
+
*
|
|
900
|
+
* Displays the avatar image with proper fallback handling.
|
|
901
|
+
* Extends standard img element props.
|
|
902
|
+
*
|
|
903
|
+
* Note: Both src and alt are optional to support dynamic loading scenarios.
|
|
904
|
+
* When src is undefined/empty, the AvatarFallback will be displayed instead.
|
|
905
|
+
* @experimental
|
|
906
|
+
*/
|
|
907
|
+
type AvatarImageProps = ComponentPropsWithoutRef<"img">;
|
|
908
|
+
/**
|
|
909
|
+
* AvatarFallback component props
|
|
910
|
+
*
|
|
911
|
+
* Displays fallback content (typically user initials) when image fails to load.
|
|
912
|
+
* Extends Radix UI Avatar.Fallback props.
|
|
913
|
+
* @experimental
|
|
914
|
+
*/
|
|
915
|
+
type AvatarFallbackProps = ComponentPropsWithoutRef<"span"> & {
|
|
916
|
+
/**
|
|
917
|
+
* Delay in milliseconds before showing fallback
|
|
918
|
+
* @default 600
|
|
919
|
+
*/
|
|
920
|
+
delayMs?: number;
|
|
921
|
+
};
|
|
922
|
+
/** The arms `avatarVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
923
|
+
declare const AVATAR_VARIANT_MAP: {
|
|
924
|
+
size: {
|
|
925
|
+
sm: string;
|
|
926
|
+
md: string;
|
|
927
|
+
lg: string;
|
|
928
|
+
xl: string;
|
|
929
|
+
"2xl": string;
|
|
930
|
+
};
|
|
931
|
+
};
|
|
734
932
|
/**
|
|
735
933
|
* Avatar Component - Design System Specification
|
|
736
934
|
*
|
|
@@ -750,7 +948,9 @@ declare const AccordionContent: react.ForwardRefExoticComponent<Omit<AccordionPr
|
|
|
750
948
|
* - 2xl: 80px (h-20 w-20) - For profile headers, large avatars
|
|
751
949
|
*
|
|
752
950
|
* **Design Specs**:
|
|
753
|
-
* - Border radius: rounded-
|
|
951
|
+
* - Border radius: `rounded-full`. A person's avatar is read as a circle, so it
|
|
952
|
+
* sits outside the `--radius` scale and stays circular at any theme radius.
|
|
953
|
+
* Non-identity content (media thumbnails) overrides back to a scale step.
|
|
754
954
|
* - Background: bg-accent (slate-100 light, slate-800 dark)
|
|
755
955
|
* - Text color: text-accent-foreground (slate-900 light, slate-100 dark)
|
|
756
956
|
* - Fallback text scales with avatar size (text-xs to text-2xl)
|
|
@@ -790,22 +990,18 @@ declare const AccordionContent: react.ForwardRefExoticComponent<Omit<AccordionPr
|
|
|
790
990
|
*
|
|
791
991
|
* @see {@link https://www.radix-ui.com/primitives/docs/components/avatar Radix UI Avatar}
|
|
792
992
|
* @see {@link https://github.com/nextlyhq/nextly/blob/main/ui-revamp/04-design-system-specification.md Design System Specification}
|
|
993
|
+
* @experimental
|
|
793
994
|
*/
|
|
794
|
-
declare const avatarVariants:
|
|
795
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
796
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
995
|
+
export declare const avatarVariants: VariantsFn<typeof AVATAR_VARIANT_MAP>;
|
|
797
996
|
/**
|
|
798
997
|
* Avatar root component
|
|
799
998
|
*
|
|
800
999
|
* Container element for avatar image and fallback. Provides consistent sizing
|
|
801
1000
|
* and styling across the application. Uses React Context to pass size to
|
|
802
1001
|
* AvatarFallback for reliable text scaling.
|
|
1002
|
+
* @experimental
|
|
803
1003
|
*/
|
|
804
|
-
declare const Avatar:
|
|
805
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
806
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
807
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl";
|
|
808
|
-
} & react.RefAttributes<HTMLSpanElement>>;
|
|
1004
|
+
declare const Avatar: ForwardRefExoticComponent<PropsWithoutRef<AvatarProps> & RefAttributes<HTMLSpanElement>>;
|
|
809
1005
|
/**
|
|
810
1006
|
* AvatarImage component
|
|
811
1007
|
*
|
|
@@ -819,8 +1015,9 @@ declare const Avatar: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLPro
|
|
|
819
1015
|
*
|
|
820
1016
|
* @example
|
|
821
1017
|
* <AvatarImage src="/users/john-doe.jpg" alt="John Doe" />
|
|
1018
|
+
* @experimental
|
|
822
1019
|
*/
|
|
823
|
-
declare const AvatarImage:
|
|
1020
|
+
declare const AvatarImage: ForwardRefExoticComponent<PropsWithoutRef<AvatarImageProps> & RefAttributes<HTMLImageElement>>;
|
|
824
1021
|
/**
|
|
825
1022
|
* AvatarFallback component
|
|
826
1023
|
*
|
|
@@ -851,71 +1048,42 @@ declare const AvatarImage: react.ForwardRefExoticComponent<Omit<react.DetailedHT
|
|
|
851
1048
|
* @example
|
|
852
1049
|
* // Custom delay before showing fallback
|
|
853
1050
|
* <AvatarFallback delayMs={300}>AB</AvatarFallback>
|
|
1051
|
+
* @experimental
|
|
854
1052
|
*/
|
|
855
|
-
declare const AvatarFallback:
|
|
856
|
-
delayMs?: number;
|
|
857
|
-
} & react.RefAttributes<HTMLSpanElement>>;
|
|
858
|
-
|
|
859
|
-
/**
|
|
860
|
-
* Avatar component props
|
|
861
|
-
*
|
|
862
|
-
* Root container for displaying user avatars with image and fallback support.
|
|
863
|
-
* Extends Radix UI Avatar.Root props with size variants.
|
|
864
|
-
*/
|
|
865
|
-
type AvatarProps = ComponentPropsWithoutRef<"span"> & VariantProps<typeof avatarVariants> & {
|
|
866
|
-
/**
|
|
867
|
-
* Size variant
|
|
868
|
-
* - sm: 32px (h-8 w-8) - For compact layouts, lists
|
|
869
|
-
* - md: 40px (h-10 w-10) - Default size, general use
|
|
870
|
-
* - lg: 48px (h-12 w-12) - For prominent displays, profiles
|
|
871
|
-
* - xl: 64px (h-16 w-16) - For large profile displays, user panels
|
|
872
|
-
* - 2xl: 80px (h-20 w-20) - For profile headers, large avatars
|
|
873
|
-
* @default "md"
|
|
874
|
-
*/
|
|
875
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl";
|
|
876
|
-
};
|
|
877
|
-
/**
|
|
878
|
-
* AvatarImage component props
|
|
879
|
-
*
|
|
880
|
-
* Displays the avatar image with proper fallback handling.
|
|
881
|
-
* Extends standard img element props.
|
|
882
|
-
*
|
|
883
|
-
* Note: Both src and alt are optional to support dynamic loading scenarios.
|
|
884
|
-
* When src is undefined/empty, the AvatarFallback will be displayed instead.
|
|
885
|
-
*/
|
|
886
|
-
type AvatarImageProps = ComponentPropsWithoutRef<"img">;
|
|
887
|
-
/**
|
|
888
|
-
* AvatarFallback component props
|
|
889
|
-
*
|
|
890
|
-
* Displays fallback content (typically user initials) when image fails to load.
|
|
891
|
-
* Extends Radix UI Avatar.Fallback props.
|
|
892
|
-
*/
|
|
893
|
-
type AvatarFallbackProps = ComponentPropsWithoutRef<"span"> & {
|
|
894
|
-
/**
|
|
895
|
-
* Delay in milliseconds before showing fallback
|
|
896
|
-
* @default 600
|
|
897
|
-
*/
|
|
898
|
-
delayMs?: number;
|
|
899
|
-
};
|
|
900
|
-
|
|
1053
|
+
declare const AvatarFallback: ForwardRefExoticComponent<PropsWithoutRef<AvatarFallbackProps> & RefAttributes<HTMLSpanElement>>;
|
|
901
1054
|
/**
|
|
902
1055
|
* Props for the Tabs root component
|
|
903
1056
|
* @see https://www.radix-ui.com/primitives/docs/components/tabs
|
|
1057
|
+
* @public
|
|
904
1058
|
*/
|
|
905
1059
|
type TabsProps = ComponentPropsWithoutRef<typeof Root$3>;
|
|
906
1060
|
/**
|
|
907
1061
|
* Props for the TabsList component (container for tab triggers)
|
|
1062
|
+
* @public
|
|
1063
|
+
*/
|
|
1064
|
+
type TabsListProps$1 = ComponentPropsWithoutRef<typeof List>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Ref type for TabsList component
|
|
908
1067
|
*/
|
|
909
|
-
type
|
|
1068
|
+
type TabsListRef = ElementRef<typeof List>;
|
|
910
1069
|
/**
|
|
911
1070
|
* Props for the TabsTrigger component (clickable tab button)
|
|
1071
|
+
* @public
|
|
912
1072
|
*/
|
|
913
|
-
type TabsTriggerProps = ComponentPropsWithoutRef<typeof Trigger$1>;
|
|
1073
|
+
type TabsTriggerProps$1 = ComponentPropsWithoutRef<typeof Trigger$1>;
|
|
1074
|
+
/**
|
|
1075
|
+
* Ref type for TabsTrigger component
|
|
1076
|
+
*/
|
|
1077
|
+
type TabsTriggerRef = ElementRef<typeof Trigger$1>;
|
|
914
1078
|
/**
|
|
915
1079
|
* Props for the TabsContent component (content panel for each tab)
|
|
1080
|
+
* @public
|
|
916
1081
|
*/
|
|
917
1082
|
type TabsContentProps = ComponentPropsWithoutRef<typeof Content$1>;
|
|
918
|
-
|
|
1083
|
+
/**
|
|
1084
|
+
* Ref type for TabsContent component
|
|
1085
|
+
*/
|
|
1086
|
+
type TabsContentRef = ElementRef<typeof Content$1>;
|
|
919
1087
|
/**
|
|
920
1088
|
* Tabs Component - Design System Specification
|
|
921
1089
|
*
|
|
@@ -923,8 +1091,9 @@ type TabsContentProps = ComponentPropsWithoutRef<typeof Content$1>;
|
|
|
923
1091
|
* Built on Radix UI primitives with WAI-ARIA compliance.
|
|
924
1092
|
*
|
|
925
1093
|
* Design Specs:
|
|
926
|
-
* - TabsList border-radius:
|
|
927
|
-
* - TabsTrigger border-radius:
|
|
1094
|
+
* - TabsList border-radius: square, independent of `--radius`
|
|
1095
|
+
* - TabsTrigger border-radius: square, independent of `--radius`; the active
|
|
1096
|
+
* state is a 2px bottom border that has to stay flush with the tab edges
|
|
928
1097
|
* - TabsList height: 40px (h-10)
|
|
929
1098
|
* - TabsTrigger padding: 12px 24px (px-3 py-1.5)
|
|
930
1099
|
* - Transition duration: 150ms (design system standard)
|
|
@@ -992,8 +1161,66 @@ type TabsContentProps = ComponentPropsWithoutRef<typeof Content$1>;
|
|
|
992
1161
|
* ```
|
|
993
1162
|
*
|
|
994
1163
|
* @see https://www.radix-ui.com/primitives/docs/components/tabs
|
|
1164
|
+
* @public
|
|
1165
|
+
*/
|
|
1166
|
+
declare const Tabs: typeof Root$3;
|
|
1167
|
+
/**
|
|
1168
|
+
* The list's own appearance, as variants rather than as classes each caller
|
|
1169
|
+
* repeats.
|
|
1170
|
+
*
|
|
1171
|
+
* `ghost` is the compact, surface-less list used where tabs sit inside another
|
|
1172
|
+
* panel and must not draw a bar of their own. It was spelled `h-8 bg-transparent
|
|
1173
|
+
* p-0` at one call site and `h-7 bg-transparent p-0` at another; naming it here
|
|
1174
|
+
* settles the height rather than leaving two answers in the tree.
|
|
1175
|
+
*
|
|
1176
|
+
* Only APPEARANCE is promoted. Layout a caller chooses -- `w-full`,
|
|
1177
|
+
* `justify-start`, margins -- stays on `className`, because a variant names a
|
|
1178
|
+
* decision this component owns and layout is the caller's.
|
|
1179
|
+
*
|
|
1180
|
+
* Horizontal SCROLLING is the exception, and it moved to the `scrollable` prop
|
|
1181
|
+
* for a reason rather than as tidying: a caller putting `overflow-x-auto` on the
|
|
1182
|
+
* list makes the list itself the scroll container, which breaks the rail
|
|
1183
|
+
* contract this file's other half depends on. See that prop.
|
|
1184
|
+
*
|
|
1185
|
+
* The arms are a named declaration rather than an object literal inside `cva`,
|
|
1186
|
+
* because `cva` does not expose its configuration on the function it returns —
|
|
1187
|
+
* so anything checking which arms exist would otherwise have to restate them,
|
|
1188
|
+
* and the two drift the moment an arm is added.
|
|
995
1189
|
*/
|
|
996
|
-
declare const
|
|
1190
|
+
declare const TABS_LIST_VARIANTS: {
|
|
1191
|
+
readonly default: "h-10";
|
|
1192
|
+
readonly ghost: "h-8 bg-transparent";
|
|
1193
|
+
};
|
|
1194
|
+
/** The arms `tabsListVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
1195
|
+
declare const TABS_LIST_VARIANT_MAP: {
|
|
1196
|
+
variant: typeof TABS_LIST_VARIANTS;
|
|
1197
|
+
};
|
|
1198
|
+
declare const tabsListVariants: VariantsFn<typeof TABS_LIST_VARIANT_MAP>;
|
|
1199
|
+
/** What `TabsList` is declared to take. `TabsListProps`, below, is read back from the component. */
|
|
1200
|
+
type TabsListOwnProps = TabsListProps$1 & VariantProps<typeof tabsListVariants> & {
|
|
1201
|
+
/**
|
|
1202
|
+
* Let a strip too wide for its container scroll sideways.
|
|
1203
|
+
*
|
|
1204
|
+
* The scroll container is a WRAPPER, never the list, and that is why this
|
|
1205
|
+
* prop exists rather than callers reaching for `overflow-x-auto`
|
|
1206
|
+
* themselves. Two things go wrong when the list is the scroller, and the
|
|
1207
|
+
* second is why the obvious remedy is also wrong:
|
|
1208
|
+
*
|
|
1209
|
+
* - Per the CSS overflow rules, `visible` computes to `auto` when the
|
|
1210
|
+
* other axis is neither `visible` nor `clip`, so `overflow-x` alone
|
|
1211
|
+
* always makes the element a VERTICAL scroll container too.
|
|
1212
|
+
* - `TabsTrigger` carries `-mb-0.5` so its 2px underline lands ON this
|
|
1213
|
+
* list's rail rather than below it. That pull-up puts content past the
|
|
1214
|
+
* content-box edge, which the new scroll container reports as vertical
|
|
1215
|
+
* overflow — so `overflow-y-hidden` would clip the 2px the underline is
|
|
1216
|
+
* made of, silencing a scrollbar by deleting the indicator.
|
|
1217
|
+
*
|
|
1218
|
+
* With the wrapper scrolling instead, the list keeps its rail and
|
|
1219
|
+
* `w-max min-w-full` makes that rail span the full scroll width rather
|
|
1220
|
+
* than stopping where the triggers do.
|
|
1221
|
+
*/
|
|
1222
|
+
scrollable?: boolean;
|
|
1223
|
+
};
|
|
997
1224
|
/**
|
|
998
1225
|
* TabsList - Container for tab triggers
|
|
999
1226
|
*
|
|
@@ -1002,8 +1229,29 @@ declare const Tabs: react.ForwardRefExoticComponent<_radix_ui_react_tabs.TabsPro
|
|
|
1002
1229
|
* - Border-radius: none (for underline style)
|
|
1003
1230
|
* - Background: transparent
|
|
1004
1231
|
* - Layout: inline-flex (horizontal by default, use orientation="vertical" on Tabs root for vertical)
|
|
1232
|
+
* @public
|
|
1005
1233
|
*/
|
|
1006
|
-
declare const TabsList:
|
|
1234
|
+
declare const TabsList: ForwardRefExoticComponent<PropsWithoutRef<TabsListOwnProps> & RefAttributes<TabsListRef>>;
|
|
1235
|
+
/**
|
|
1236
|
+
* The trigger's own appearance. `size` carries the type scale only: everything
|
|
1237
|
+
* that draws the tab -- the square corners, the 2px underline, the active and
|
|
1238
|
+
* hover colours, the focus ring -- is in the base and is not a caller's to
|
|
1239
|
+
* choose, which is the property the `tab-indicator` lint rule
|
|
1240
|
+
* (`lint/tab-indicator`) holds every call site to.
|
|
1241
|
+
*
|
|
1242
|
+
* Arms declared separately for the same reason as the list's.
|
|
1243
|
+
*/
|
|
1244
|
+
declare const TABS_TRIGGER_SIZES: {
|
|
1245
|
+
readonly default: "text-sm";
|
|
1246
|
+
readonly sm: "text-xs";
|
|
1247
|
+
};
|
|
1248
|
+
/** The arms `tabsTriggerVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
1249
|
+
declare const TABS_TRIGGER_VARIANT_MAP: {
|
|
1250
|
+
size: typeof TABS_TRIGGER_SIZES;
|
|
1251
|
+
};
|
|
1252
|
+
declare const tabsTriggerVariants: VariantsFn<typeof TABS_TRIGGER_VARIANT_MAP>;
|
|
1253
|
+
/** What `TabsTrigger` is declared to take. `TabsTriggerProps`, below, is read back from the component. */
|
|
1254
|
+
type TabsTriggerOwnProps = TabsTriggerProps$1 & VariantProps<typeof tabsTriggerVariants>;
|
|
1007
1255
|
/**
|
|
1008
1256
|
* TabsTrigger - Clickable tab button
|
|
1009
1257
|
*
|
|
@@ -1012,8 +1260,8 @@ declare const TabsList: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tab
|
|
|
1012
1260
|
* - Padding: 6px 16px (px-4 py-2)
|
|
1013
1261
|
* - Font: text-sm (14px), font-medium (500)
|
|
1014
1262
|
* - Transition: 150ms (design system standard)
|
|
1015
|
-
* - Active state:
|
|
1016
|
-
* - Hover:
|
|
1263
|
+
* - Active state: the accent colour on the text and on the 2px trailing border
|
|
1264
|
+
* - Hover: the same accent, so the target reads before it is chosen
|
|
1017
1265
|
* - Gmail-inspired clean underline style
|
|
1018
1266
|
*
|
|
1019
1267
|
* Accessibility:
|
|
@@ -1021,8 +1269,9 @@ declare const TabsList: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tab
|
|
|
1021
1269
|
* - Focus ring: 2px with offset (WCAG 2.2 compliant)
|
|
1022
1270
|
* - Disabled state: pointer-events-none, opacity-50
|
|
1023
1271
|
* - Data attributes: [data-state="active|inactive"], [data-disabled]
|
|
1272
|
+
* @public
|
|
1024
1273
|
*/
|
|
1025
|
-
declare const TabsTrigger:
|
|
1274
|
+
declare const TabsTrigger: ForwardRefExoticComponent<PropsWithoutRef<TabsTriggerOwnProps> & RefAttributes<TabsTriggerRef>>;
|
|
1026
1275
|
/**
|
|
1027
1276
|
* TabsContent - Content panel for each tab
|
|
1028
1277
|
*
|
|
@@ -1034,19 +1283,46 @@ declare const TabsTrigger: react.ForwardRefExoticComponent<Omit<_radix_ui_react_
|
|
|
1034
1283
|
* - Focus indicator when navigating with Tab key
|
|
1035
1284
|
* - Data attributes: [data-state="active|inactive"], [data-orientation]
|
|
1036
1285
|
* - Only active content is visible, inactive content is hidden
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1286
|
+
* @public
|
|
1287
|
+
*/
|
|
1288
|
+
declare const TabsContent: ForwardRefExoticComponent<PropsWithoutRef<TabsContentProps> & RefAttributes<TabsContentRef>>;
|
|
1289
|
+
/**
|
|
1290
|
+
* The public prop types, DERIVED from the components rather than restated.
|
|
1291
|
+
*
|
|
1292
|
+
* `../types/tabs` describes the Radix props alone, so an alias taken from there
|
|
1293
|
+
* rejects `variant` and `size` — and a consumer typing a wrapper around
|
|
1294
|
+
* `TabsList` would be told the prop it can see in the signature does not exist.
|
|
1295
|
+
* Reading the component's own props keeps the two from drifting: a variant
|
|
1296
|
+
* added later reaches every consumer without a second edit.
|
|
1297
|
+
*/
|
|
1298
|
+
/**
|
|
1299
|
+
* The list's props, including its `variant`.
|
|
1300
|
+
* @public
|
|
1301
|
+
*/
|
|
1302
|
+
type TabsListProps = ComponentPropsWithoutRef<typeof TabsList>;
|
|
1303
|
+
/**
|
|
1304
|
+
* The trigger's props, including its `size`.
|
|
1305
|
+
* @public
|
|
1306
|
+
*/
|
|
1307
|
+
type TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsTrigger>;
|
|
1308
|
+
/** @experimental */
|
|
1309
|
+
declare const TooltipProvider: typeof Provider;
|
|
1310
|
+
/** @public */
|
|
1311
|
+
declare const Tooltip: typeof Root$4;
|
|
1312
|
+
/** @public */
|
|
1313
|
+
declare const TooltipTrigger: typeof Trigger$2;
|
|
1314
|
+
type TooltipContentProps = React.ComponentPropsWithoutRef<typeof Content$2>;
|
|
1315
|
+
/** @public */
|
|
1316
|
+
declare const TooltipContent: ForwardRefExoticComponent<PropsWithoutRef<TooltipContentProps> & RefAttributes<React.ElementRef<typeof Content$2>>>;
|
|
1317
|
+
/** @experimental */
|
|
1318
|
+
declare const Popover: typeof PopoverPrimitive.Root;
|
|
1319
|
+
/** @experimental */
|
|
1320
|
+
declare const PopoverTrigger: typeof PopoverPrimitive.Trigger;
|
|
1321
|
+
/** @experimental */
|
|
1322
|
+
declare const PopoverAnchor: typeof PopoverPrimitive.Anchor;
|
|
1323
|
+
type PopoverContentProps = React$1.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>;
|
|
1324
|
+
/** @experimental */
|
|
1325
|
+
declare const PopoverContent: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<PopoverContentProps> & React$1.RefAttributes<React$1.ElementRef<typeof PopoverPrimitive.Content>>>;
|
|
1050
1326
|
/**
|
|
1051
1327
|
* Dialog (Modal) Component
|
|
1052
1328
|
*
|
|
@@ -1078,9 +1354,9 @@ declare const PopoverContent: react.ForwardRefExoticComponent<Omit<PopoverPrimit
|
|
|
1078
1354
|
* ```
|
|
1079
1355
|
*
|
|
1080
1356
|
* @design-spec
|
|
1081
|
-
* - Border-radius:
|
|
1357
|
+
* - Border-radius: `rounded-lg`, the container step of the `--radius` scale
|
|
1082
1358
|
* - Max-width: 512px (default), responsive sizes available
|
|
1083
|
-
* - Backdrop:
|
|
1359
|
+
* - Backdrop: the `--nx-overlay` scrim with blur effect
|
|
1084
1360
|
* - Padding: 24px (p-6)
|
|
1085
1361
|
* - Shadow: xl for prominence (elevation level 4)
|
|
1086
1362
|
* - Transition: 150ms per design system
|
|
@@ -1093,17 +1369,34 @@ declare const PopoverContent: react.ForwardRefExoticComponent<Omit<PopoverPrimit
|
|
|
1093
1369
|
* - Includes ARIA labels and descriptions
|
|
1094
1370
|
* - Screen reader announcements via role="dialog"
|
|
1095
1371
|
* - Close button has sr-only text for screen readers
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
declare const
|
|
1099
|
-
|
|
1100
|
-
declare const
|
|
1372
|
+
* @public
|
|
1373
|
+
*/
|
|
1374
|
+
declare const Dialog: typeof DialogPrimitive.Root;
|
|
1375
|
+
/** @experimental */
|
|
1376
|
+
declare const DialogTrigger: typeof DialogPrimitive.Trigger;
|
|
1377
|
+
/** @experimental */
|
|
1378
|
+
declare const DialogPortal: typeof DialogPrimitive.Portal;
|
|
1379
|
+
/** @experimental */
|
|
1380
|
+
declare const DialogClose: typeof DialogPrimitive.Close;
|
|
1381
|
+
/** @experimental */
|
|
1101
1382
|
type DialogOverlayProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
1102
1383
|
/**
|
|
1103
1384
|
* DialogOverlay - The backdrop overlay behind the dialog content.
|
|
1104
|
-
* Renders
|
|
1105
|
-
|
|
1106
|
-
|
|
1385
|
+
* Renders the `--nx-overlay` scrim with a blur effect. The opacity is the
|
|
1386
|
+
* token's, not a literal: it differs by mode and a host can retheme it.
|
|
1387
|
+
* @experimental
|
|
1388
|
+
*/
|
|
1389
|
+
declare const DialogOverlay: ForwardRefExoticComponent<PropsWithoutRef<DialogOverlayProps> & RefAttributes<ElementRef<typeof DialogPrimitive.Overlay>>>;
|
|
1390
|
+
/** The arms `dialogContentVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
1391
|
+
declare const DIALOG_CONTENT_VARIANT_MAP: {
|
|
1392
|
+
size: {
|
|
1393
|
+
sm: string;
|
|
1394
|
+
md: string;
|
|
1395
|
+
lg: string;
|
|
1396
|
+
xl: string;
|
|
1397
|
+
full: string;
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1107
1400
|
/**
|
|
1108
1401
|
* Dialog content size variants using CVA.
|
|
1109
1402
|
*
|
|
@@ -1112,10 +1405,10 @@ declare const DialogOverlay: react.ForwardRefExoticComponent<Omit<DialogPrimitiv
|
|
|
1112
1405
|
* @variant lg - Large dialog (672px / max-w-2xl) - complex forms, data tables
|
|
1113
1406
|
* @variant xl - Extra large dialog (896px / max-w-4xl) - content editors, media galleries
|
|
1114
1407
|
* @variant full - Full width with margin (responsive) - fullscreen on mobile
|
|
1408
|
+
* @experimental
|
|
1115
1409
|
*/
|
|
1116
|
-
declare const dialogContentVariants:
|
|
1117
|
-
|
|
1118
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1410
|
+
declare const dialogContentVariants: VariantsFn<typeof DIALOG_CONTENT_VARIANT_MAP>;
|
|
1411
|
+
/** @public */
|
|
1119
1412
|
type DialogContentProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & VariantProps<typeof dialogContentVariants>;
|
|
1120
1413
|
/**
|
|
1121
1414
|
* DialogContent - The main dialog content container.
|
|
@@ -1128,16 +1421,18 @@ type DialogContentProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Conten
|
|
|
1128
1421
|
* Your content here
|
|
1129
1422
|
* </DialogContent>
|
|
1130
1423
|
* ```
|
|
1424
|
+
* @public
|
|
1131
1425
|
*/
|
|
1132
|
-
declare const DialogContent:
|
|
1133
|
-
|
|
1134
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string> & react.RefAttributes<HTMLDivElement>>;
|
|
1426
|
+
declare const DialogContent: ForwardRefExoticComponent<PropsWithoutRef<DialogContentProps> & RefAttributes<ElementRef<typeof DialogPrimitive.Content>>>;
|
|
1427
|
+
/** @public */
|
|
1135
1428
|
type DialogHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
1136
1429
|
/**
|
|
1137
1430
|
* DialogHeader - Container for dialog title and description.
|
|
1138
1431
|
* Provides consistent spacing and alignment (centered on mobile, left-aligned on desktop).
|
|
1432
|
+
* @public
|
|
1139
1433
|
*/
|
|
1140
|
-
declare const DialogHeader:
|
|
1434
|
+
declare const DialogHeader: ForwardRefExoticComponent<PropsWithoutRef<DialogHeaderProps> & RefAttributes<HTMLDivElement>>;
|
|
1435
|
+
/** @public */
|
|
1141
1436
|
type DialogFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
1142
1437
|
/**
|
|
1143
1438
|
* DialogFooter - Container for dialog action buttons.
|
|
@@ -1150,16 +1445,20 @@ type DialogFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
|
1150
1445
|
* <Button type="submit">Save Changes</Button>
|
|
1151
1446
|
* </DialogFooter>
|
|
1152
1447
|
* ```
|
|
1448
|
+
* @public
|
|
1153
1449
|
*/
|
|
1154
|
-
declare const DialogFooter:
|
|
1450
|
+
declare const DialogFooter: ForwardRefExoticComponent<PropsWithoutRef<DialogFooterProps> & RefAttributes<HTMLDivElement>>;
|
|
1451
|
+
/** @public */
|
|
1155
1452
|
type DialogTitleProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
1156
1453
|
/**
|
|
1157
1454
|
* DialogTitle - The title of the dialog.
|
|
1158
1455
|
* Uses text-lg (18px) with semibold weight per design system.
|
|
1159
1456
|
*
|
|
1160
1457
|
* @accessibility Required for screen readers. Always include a DialogTitle.
|
|
1458
|
+
* @public
|
|
1161
1459
|
*/
|
|
1162
|
-
declare const DialogTitle:
|
|
1460
|
+
declare const DialogTitle: ForwardRefExoticComponent<PropsWithoutRef<DialogTitleProps> & RefAttributes<ElementRef<typeof DialogPrimitive.Title>>>;
|
|
1461
|
+
/** @public */
|
|
1163
1462
|
type DialogDescriptionProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
1164
1463
|
/**
|
|
1165
1464
|
* DialogDescription - The description text of the dialog.
|
|
@@ -1167,225 +1466,197 @@ type DialogDescriptionProps = ComponentPropsWithoutRef<typeof DialogPrimitive.De
|
|
|
1167
1466
|
*
|
|
1168
1467
|
* @accessibility Provides additional context for screen readers.
|
|
1169
1468
|
* If not needed visually, you can use sr-only class.
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
declare const
|
|
1175
|
-
|
|
1469
|
+
* @public
|
|
1470
|
+
*/
|
|
1471
|
+
declare const DialogDescription: ForwardRefExoticComponent<PropsWithoutRef<DialogDescriptionProps> & RefAttributes<ElementRef<typeof DialogPrimitive.Description>>>;
|
|
1472
|
+
/** @experimental */
|
|
1473
|
+
declare const AlertDialog: typeof AlertDialogPrimitive.Root;
|
|
1474
|
+
/** @experimental */
|
|
1475
|
+
declare const AlertDialogTrigger: typeof AlertDialogPrimitive.Trigger;
|
|
1476
|
+
/** @experimental */
|
|
1477
|
+
declare const AlertDialogPortal: typeof AlertDialogPrimitive.Portal;
|
|
1478
|
+
/** @experimental */
|
|
1176
1479
|
type AlertDialogOverlayProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>;
|
|
1177
1480
|
/**
|
|
1178
1481
|
* AlertDialogOverlay - The backdrop overlay behind the dialog content.
|
|
1482
|
+
* @experimental
|
|
1179
1483
|
*/
|
|
1180
|
-
declare const AlertDialogOverlay:
|
|
1484
|
+
declare const AlertDialogOverlay: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogOverlayProps> & RefAttributes<ElementRef<typeof AlertDialogPrimitive.Overlay>>>;
|
|
1485
|
+
/** @experimental */
|
|
1181
1486
|
type AlertDialogContentProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>;
|
|
1182
1487
|
/**
|
|
1183
1488
|
* AlertDialogContent - The main dialog content container.
|
|
1489
|
+
* @experimental
|
|
1184
1490
|
*/
|
|
1185
|
-
declare const AlertDialogContent:
|
|
1491
|
+
declare const AlertDialogContent: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogContentProps> & RefAttributes<ElementRef<typeof AlertDialogPrimitive.Content>>>;
|
|
1492
|
+
/** @experimental */
|
|
1186
1493
|
type AlertDialogHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
1187
1494
|
/**
|
|
1188
1495
|
* AlertDialogHeader - Container for dialog title and description.
|
|
1496
|
+
* @experimental
|
|
1189
1497
|
*/
|
|
1190
|
-
declare const AlertDialogHeader:
|
|
1498
|
+
declare const AlertDialogHeader: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogHeaderProps> & RefAttributes<HTMLDivElement>>;
|
|
1499
|
+
/** @experimental */
|
|
1191
1500
|
type AlertDialogFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
1192
1501
|
/**
|
|
1193
1502
|
* AlertDialogFooter - Container for dialog action buttons.
|
|
1503
|
+
* @experimental
|
|
1194
1504
|
*/
|
|
1195
|
-
declare const AlertDialogFooter:
|
|
1505
|
+
declare const AlertDialogFooter: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogFooterProps> & RefAttributes<HTMLDivElement>>;
|
|
1506
|
+
/** @experimental */
|
|
1196
1507
|
type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>;
|
|
1197
1508
|
/**
|
|
1198
1509
|
* AlertDialogTitle - The title of the alert dialog.
|
|
1510
|
+
* @experimental
|
|
1199
1511
|
*/
|
|
1200
|
-
declare const AlertDialogTitle:
|
|
1512
|
+
declare const AlertDialogTitle: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogTitleProps> & RefAttributes<ElementRef<typeof AlertDialogPrimitive.Title>>>;
|
|
1513
|
+
/** @experimental */
|
|
1201
1514
|
type AlertDialogDescriptionProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>;
|
|
1202
1515
|
/**
|
|
1203
1516
|
* AlertDialogDescription - The description text of the alert dialog.
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1517
|
+
* @experimental
|
|
1518
|
+
*/
|
|
1519
|
+
declare const AlertDialogDescription: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogDescriptionProps> & RefAttributes<ElementRef<typeof AlertDialogPrimitive.Description>>>;
|
|
1520
|
+
/** @experimental */
|
|
1521
|
+
type AlertDialogActionProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> & {
|
|
1522
|
+
/**
|
|
1523
|
+
* `"destructive"` when confirming deletes data; anything else a dialog
|
|
1524
|
+
* confirms (a save, a publish, a restore) stays `"primary"`, the default.
|
|
1525
|
+
*/
|
|
1526
|
+
variant?: "primary" | "destructive";
|
|
1527
|
+
};
|
|
1207
1528
|
/**
|
|
1208
|
-
* AlertDialogAction - The
|
|
1209
|
-
*
|
|
1529
|
+
* AlertDialogAction - The confirming action button (e.g., "Save", "Delete").
|
|
1530
|
+
* Primary by default: red is kept for confirming a deletion, so it means one
|
|
1531
|
+
* thing wherever it appears.
|
|
1532
|
+
* @experimental
|
|
1210
1533
|
*/
|
|
1211
|
-
declare const AlertDialogAction:
|
|
1534
|
+
declare const AlertDialogAction: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogActionProps> & RefAttributes<ElementRef<typeof AlertDialogPrimitive.Action>>>;
|
|
1535
|
+
/** @experimental */
|
|
1212
1536
|
type AlertDialogCancelProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>;
|
|
1213
1537
|
/**
|
|
1214
1538
|
* AlertDialogCancel - The cancel button.
|
|
1215
1539
|
* Styled as outline variant.
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
/**
|
|
1220
|
-
*
|
|
1221
|
-
*
|
|
1222
|
-
* A
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1225
|
-
*
|
|
1226
|
-
*
|
|
1227
|
-
*
|
|
1228
|
-
*
|
|
1229
|
-
*
|
|
1230
|
-
*
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
* <DropdownMenuContent align="end">
|
|
1277
|
-
* <DropdownMenuLabel>Actions</DropdownMenuLabel>
|
|
1278
|
-
* <DropdownMenuItem>
|
|
1279
|
-
* <Edit className="h-4 w-4" />
|
|
1280
|
-
* Edit
|
|
1281
|
-
* <DropdownMenuShortcut>⌘E</DropdownMenuShortcut>
|
|
1282
|
-
* </DropdownMenuItem>
|
|
1283
|
-
* <DropdownMenuItem>
|
|
1284
|
-
* <Trash2 className="h-4 w-4" />
|
|
1285
|
-
* Delete
|
|
1286
|
-
* <DropdownMenuShortcut>⌘⌫</DropdownMenuShortcut>
|
|
1287
|
-
* </DropdownMenuItem>
|
|
1288
|
-
* </DropdownMenuContent>
|
|
1289
|
-
* </DropdownMenu>
|
|
1290
|
-
* ```
|
|
1291
|
-
*
|
|
1292
|
-
* @example
|
|
1293
|
-
* ```tsx
|
|
1294
|
-
* // With checkbox items
|
|
1295
|
-
* <DropdownMenu>
|
|
1296
|
-
* <DropdownMenuTrigger asChild>
|
|
1297
|
-
* <Button variant="outline">View Options</Button>
|
|
1298
|
-
* </DropdownMenuTrigger>
|
|
1299
|
-
* <DropdownMenuContent>
|
|
1300
|
-
* <DropdownMenuLabel>Display</DropdownMenuLabel>
|
|
1301
|
-
* <DropdownMenuSeparator />
|
|
1302
|
-
* <DropdownMenuCheckboxItem checked={showPanel} onCheckedChange={setShowPanel}>
|
|
1303
|
-
* Show Panel
|
|
1304
|
-
* </DropdownMenuCheckboxItem>
|
|
1305
|
-
* <DropdownMenuCheckboxItem checked={showToolbar} onCheckedChange={setShowToolbar}>
|
|
1306
|
-
* Show Toolbar
|
|
1307
|
-
* </DropdownMenuCheckboxItem>
|
|
1308
|
-
* </DropdownMenuContent>
|
|
1309
|
-
* </DropdownMenu>
|
|
1310
|
-
* ```
|
|
1311
|
-
*
|
|
1312
|
-
* @see https://www.radix-ui.com/docs/primitives/components/dropdown-menu - Radix UI DropdownMenu
|
|
1313
|
-
*/
|
|
1314
|
-
|
|
1315
|
-
declare const DropdownMenu: react.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
1316
|
-
declare const DropdownMenuTrigger: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1317
|
-
declare const DropdownMenuGroup: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
1318
|
-
declare const DropdownMenuPortal: react.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
1319
|
-
declare const DropdownMenuSub: react.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
1320
|
-
declare const DropdownMenuRadioGroup: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
1321
|
-
declare const DropdownMenuSubTrigger: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
1322
|
-
inset?: boolean;
|
|
1323
|
-
} & react.RefAttributes<HTMLDivElement>>;
|
|
1324
|
-
declare const DropdownMenuSubContent: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1325
|
-
declare const DropdownMenuContent: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1326
|
-
declare const DropdownMenuItem: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
1327
|
-
inset?: boolean;
|
|
1328
|
-
} & react.RefAttributes<HTMLDivElement>>;
|
|
1329
|
-
declare const DropdownMenuCheckboxItem: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1330
|
-
declare const DropdownMenuRadioItem: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1331
|
-
declare const DropdownMenuLabel: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
1332
|
-
inset?: boolean;
|
|
1333
|
-
} & react.RefAttributes<HTMLDivElement>>;
|
|
1334
|
-
declare const DropdownMenuSeparator: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1335
|
-
declare const DropdownMenuShortcut: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLSpanElement> & react.RefAttributes<HTMLSpanElement>>;
|
|
1336
|
-
|
|
1540
|
+
* @experimental
|
|
1541
|
+
*/
|
|
1542
|
+
declare const AlertDialogCancel: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogCancelProps> & RefAttributes<ElementRef<typeof AlertDialogPrimitive.Cancel>>>;
|
|
1543
|
+
/**
|
|
1544
|
+
* The menu's root: Radix's, not modal unless a caller asks.
|
|
1545
|
+
*
|
|
1546
|
+
* A menu is a list of choices, not a dialog. A modal one marks everything
|
|
1547
|
+
* around it `aria-hidden` while those controls stay focusable, which hides
|
|
1548
|
+
* the page from a screen reader without taking it out of reach (axe:
|
|
1549
|
+
* `aria-hidden-focus`). Not modal, the menu still closes on Escape, on Tab
|
|
1550
|
+
* and on a press outside, and gives focus back to its trigger; the press
|
|
1551
|
+
* outside also reaches what it was on, and the page can scroll while the
|
|
1552
|
+
* menu is open. A menu that must hold the page still passes `modal`.
|
|
1553
|
+
*
|
|
1554
|
+
* @public
|
|
1555
|
+
*/
|
|
1556
|
+
declare const DropdownMenu: typeof DropdownMenuPrimitive.Root;
|
|
1557
|
+
/** @public */
|
|
1558
|
+
declare const DropdownMenuTrigger: typeof DropdownMenuPrimitive.Trigger;
|
|
1559
|
+
/** @experimental */
|
|
1560
|
+
declare const DropdownMenuGroup: typeof DropdownMenuPrimitive.Group;
|
|
1561
|
+
/** @experimental */
|
|
1562
|
+
declare const DropdownMenuPortal: typeof DropdownMenuPrimitive.Portal;
|
|
1563
|
+
/** @experimental */
|
|
1564
|
+
declare const DropdownMenuSub: typeof DropdownMenuPrimitive.Sub;
|
|
1565
|
+
/** @experimental */
|
|
1566
|
+
declare const DropdownMenuRadioGroup: typeof DropdownMenuPrimitive.RadioGroup;
|
|
1567
|
+
type DropdownMenuSubTriggerProps$1 = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
1568
|
+
inset?: boolean;
|
|
1569
|
+
};
|
|
1570
|
+
/** @experimental */
|
|
1571
|
+
declare const DropdownMenuSubTrigger: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuSubTriggerProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>>>;
|
|
1572
|
+
type DropdownMenuSubContentProps$1 = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>;
|
|
1573
|
+
/** @experimental */
|
|
1574
|
+
declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuSubContentProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DropdownMenuPrimitive.SubContent>>>;
|
|
1575
|
+
type DropdownMenuContentProps$1 = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;
|
|
1576
|
+
/** @public */
|
|
1577
|
+
declare const DropdownMenuContent: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuContentProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DropdownMenuPrimitive.Content>>>;
|
|
1578
|
+
type DropdownMenuItemProps$1 = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
1579
|
+
inset?: boolean;
|
|
1580
|
+
};
|
|
1581
|
+
/** @public */
|
|
1582
|
+
declare const DropdownMenuItem: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuItemProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DropdownMenuPrimitive.Item>>>;
|
|
1583
|
+
type DropdownMenuCheckboxItemProps$1 = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
1584
|
+
/** @public */
|
|
1585
|
+
declare const DropdownMenuCheckboxItem: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuCheckboxItemProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>>>;
|
|
1586
|
+
type DropdownMenuRadioItemProps$1 = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>;
|
|
1587
|
+
/** @experimental */
|
|
1588
|
+
declare const DropdownMenuRadioItem: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuRadioItemProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DropdownMenuPrimitive.RadioItem>>>;
|
|
1589
|
+
type DropdownMenuLabelProps$1 = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
1590
|
+
inset?: boolean;
|
|
1591
|
+
};
|
|
1592
|
+
/** @experimental */
|
|
1593
|
+
declare const DropdownMenuLabel: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuLabelProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DropdownMenuPrimitive.Label>>>;
|
|
1594
|
+
type DropdownMenuSeparatorProps$1 = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>;
|
|
1595
|
+
/** @public */
|
|
1596
|
+
declare const DropdownMenuSeparator: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuSeparatorProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DropdownMenuPrimitive.Separator>>>;
|
|
1597
|
+
type DropdownMenuShortcutProps$1 = React$1.HTMLAttributes<HTMLSpanElement>;
|
|
1598
|
+
/** @experimental */
|
|
1599
|
+
declare const DropdownMenuShortcut: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<DropdownMenuShortcutProps$1> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
1337
1600
|
/**
|
|
1338
1601
|
* Props for the DropdownMenuSubTrigger component
|
|
1602
|
+
* @experimental
|
|
1339
1603
|
*/
|
|
1340
|
-
type DropdownMenuSubTriggerProps =
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1604
|
+
type DropdownMenuSubTriggerProps = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
1605
|
+
/**
|
|
1606
|
+
* Whether to add left padding (for alignment with items that have icons)
|
|
1607
|
+
*/
|
|
1608
|
+
inset?: boolean;
|
|
1345
1609
|
};
|
|
1346
1610
|
/**
|
|
1347
1611
|
* Props for the DropdownMenuSubContent component
|
|
1612
|
+
* @experimental
|
|
1348
1613
|
*/
|
|
1349
|
-
type DropdownMenuSubContentProps =
|
|
1614
|
+
type DropdownMenuSubContentProps = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>;
|
|
1350
1615
|
/**
|
|
1351
1616
|
* Props for the DropdownMenuContent component
|
|
1617
|
+
* @public
|
|
1352
1618
|
*/
|
|
1353
|
-
type DropdownMenuContentProps =
|
|
1619
|
+
type DropdownMenuContentProps = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;
|
|
1354
1620
|
/**
|
|
1355
1621
|
* Props for the DropdownMenuItem component
|
|
1622
|
+
* @public
|
|
1356
1623
|
*/
|
|
1357
|
-
type DropdownMenuItemProps =
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1624
|
+
type DropdownMenuItemProps = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
1625
|
+
/**
|
|
1626
|
+
* Whether to add left padding (for alignment with items that have icons)
|
|
1627
|
+
*/
|
|
1628
|
+
inset?: boolean;
|
|
1362
1629
|
};
|
|
1363
1630
|
/**
|
|
1364
1631
|
* Props for the DropdownMenuCheckboxItem component
|
|
1632
|
+
* @public
|
|
1365
1633
|
*/
|
|
1366
|
-
type DropdownMenuCheckboxItemProps =
|
|
1634
|
+
type DropdownMenuCheckboxItemProps = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
1367
1635
|
/**
|
|
1368
1636
|
* Props for the DropdownMenuRadioItem component
|
|
1637
|
+
* @experimental
|
|
1369
1638
|
*/
|
|
1370
|
-
type DropdownMenuRadioItemProps =
|
|
1639
|
+
type DropdownMenuRadioItemProps = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>;
|
|
1371
1640
|
/**
|
|
1372
1641
|
* Props for the DropdownMenuLabel component
|
|
1642
|
+
* @experimental
|
|
1373
1643
|
*/
|
|
1374
|
-
type DropdownMenuLabelProps =
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1644
|
+
type DropdownMenuLabelProps = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
1645
|
+
/**
|
|
1646
|
+
* Whether to add left padding (for alignment with items that have icons)
|
|
1647
|
+
*/
|
|
1648
|
+
inset?: boolean;
|
|
1379
1649
|
};
|
|
1380
1650
|
/**
|
|
1381
1651
|
* Props for the DropdownMenuSeparator component
|
|
1652
|
+
* @public
|
|
1382
1653
|
*/
|
|
1383
|
-
type DropdownMenuSeparatorProps =
|
|
1654
|
+
type DropdownMenuSeparatorProps = React$1.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>;
|
|
1384
1655
|
/**
|
|
1385
1656
|
* Props for the DropdownMenuShortcut component
|
|
1657
|
+
* @experimental
|
|
1386
1658
|
*/
|
|
1387
|
-
type DropdownMenuShortcutProps =
|
|
1388
|
-
|
|
1659
|
+
type DropdownMenuShortcutProps = React$1.HTMLAttributes<HTMLSpanElement>;
|
|
1389
1660
|
/**
|
|
1390
1661
|
* Select Component - Design System Specification
|
|
1391
1662
|
*
|
|
@@ -1400,15 +1671,15 @@ type DropdownMenuShortcutProps = react.HTMLAttributes<HTMLSpanElement>;
|
|
|
1400
1671
|
* - Disabled state support
|
|
1401
1672
|
*
|
|
1402
1673
|
* Design Specs:
|
|
1403
|
-
* - Height: sm=
|
|
1674
|
+
* - Height: sm=36px, default=40px, lg=44px (matches Input component)
|
|
1404
1675
|
* - Padding: Horizontal 12px, vertical varies by size
|
|
1405
|
-
* - Border radius:
|
|
1676
|
+
* - Border radius: `rounded-md` on the trigger, `rounded-lg` on the panel
|
|
1406
1677
|
* - Border: 1px solid, changes on focus/error
|
|
1407
1678
|
* - Transition: 150ms (consistent with design system)
|
|
1408
1679
|
* - Font size: sm/default=14px (text-sm), lg=16px (text-base)
|
|
1409
1680
|
*
|
|
1410
1681
|
* Size Variants:
|
|
1411
|
-
* - sm: Height
|
|
1682
|
+
* - sm: Height 36px - Compact forms and filters, matching a small Button
|
|
1412
1683
|
* - default: Height 40px (h-10) - Standard forms
|
|
1413
1684
|
* - lg: Height 44px (h-11) - Prominent selects
|
|
1414
1685
|
*
|
|
@@ -1419,23 +1690,114 @@ type DropdownMenuShortcutProps = react.HTMLAttributes<HTMLSpanElement>;
|
|
|
1419
1690
|
* - Grouping support with labels
|
|
1420
1691
|
* - Placeholder text support
|
|
1421
1692
|
* - Error state via aria-invalid
|
|
1693
|
+
* @public
|
|
1694
|
+
*/
|
|
1695
|
+
declare function Select({ ...props }: ComponentProps<typeof SelectPrimitive.Root>): JSX.Element;
|
|
1696
|
+
/** @experimental */
|
|
1697
|
+
declare function SelectGroup({ ...props }: ComponentProps<typeof SelectPrimitive.Group>): JSX.Element;
|
|
1698
|
+
/** @public */
|
|
1699
|
+
declare function SelectValue({ ...props }: ComponentProps<typeof SelectPrimitive.Value>): JSX.Element;
|
|
1700
|
+
/** The arms `selectTriggerVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
1701
|
+
declare const SELECT_TRIGGER_VARIANT_MAP: {
|
|
1702
|
+
size: {
|
|
1703
|
+
sm: string;
|
|
1704
|
+
default: string;
|
|
1705
|
+
lg: string;
|
|
1706
|
+
};
|
|
1707
|
+
};
|
|
1708
|
+
/** @experimental */
|
|
1709
|
+
declare const selectTriggerVariants: VariantsFn<typeof SELECT_TRIGGER_VARIANT_MAP>;
|
|
1710
|
+
/** @public */
|
|
1711
|
+
interface SelectTriggerProps extends ComponentProps<typeof SelectPrimitive.Trigger>, VariantProps<typeof selectTriggerVariants> {}
|
|
1712
|
+
/** @public */
|
|
1713
|
+
declare const SelectTrigger: ForwardRefExoticComponent<PropsWithoutRef<SelectTriggerProps> & RefAttributes<React.ElementRef<typeof SelectPrimitive.Trigger>>>;
|
|
1714
|
+
/** @public */
|
|
1715
|
+
declare function SelectContent({ className, children, position, ...props }: ComponentProps<typeof SelectPrimitive.Content>): JSX.Element;
|
|
1716
|
+
/** @experimental */
|
|
1717
|
+
declare function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>): JSX.Element;
|
|
1718
|
+
/** @public */
|
|
1719
|
+
declare function SelectItem({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Item>): JSX.Element;
|
|
1720
|
+
/** @experimental */
|
|
1721
|
+
declare function SelectSeparator({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>): JSX.Element;
|
|
1722
|
+
/** @experimental */
|
|
1723
|
+
declare function SelectScrollUpButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollUpButton>): JSX.Element;
|
|
1724
|
+
/** @experimental */
|
|
1725
|
+
declare function SelectScrollDownButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollDownButton>): JSX.Element;
|
|
1726
|
+
/**
|
|
1727
|
+
* Sheet root component props
|
|
1728
|
+
* Extends Radix UI Dialog.Root props
|
|
1729
|
+
* @public
|
|
1422
1730
|
*/
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1731
|
+
type SheetProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
|
|
1732
|
+
/**
|
|
1733
|
+
* Sheet trigger component props
|
|
1734
|
+
* Extends Radix UI Dialog.Trigger props
|
|
1735
|
+
* @experimental
|
|
1736
|
+
*/
|
|
1737
|
+
type SheetTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
|
|
1738
|
+
/**
|
|
1739
|
+
* Sheet close component props
|
|
1740
|
+
* Extends Radix UI Dialog.Close props
|
|
1741
|
+
* @experimental
|
|
1742
|
+
*/
|
|
1743
|
+
type SheetCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
|
|
1744
|
+
/**
|
|
1745
|
+
* Sheet overlay component props
|
|
1746
|
+
* Extends Radix UI Dialog.Overlay props
|
|
1747
|
+
* @experimental
|
|
1748
|
+
*/
|
|
1749
|
+
type SheetOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
1750
|
+
/**
|
|
1751
|
+
* Sheet content component props
|
|
1752
|
+
* Extends Radix UI Dialog.Content props with side variant
|
|
1753
|
+
*/
|
|
1754
|
+
type SheetContentProps$1 = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
1755
|
+
/**
|
|
1756
|
+
* Which edge to slide the sheet in from
|
|
1757
|
+
* @default "right"
|
|
1758
|
+
*/
|
|
1759
|
+
side?: "left" | "right" | "top" | "bottom";
|
|
1760
|
+
};
|
|
1761
|
+
/**
|
|
1762
|
+
* Sheet header component props
|
|
1763
|
+
* Standard div props
|
|
1764
|
+
* @public
|
|
1765
|
+
*/
|
|
1766
|
+
type SheetHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
1767
|
+
/**
|
|
1768
|
+
* Sheet footer component props
|
|
1769
|
+
* Standard div props
|
|
1770
|
+
* @experimental
|
|
1771
|
+
*/
|
|
1772
|
+
type SheetFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
1773
|
+
/**
|
|
1774
|
+
* Sheet title component props
|
|
1775
|
+
* Extends Radix UI Dialog.Title props
|
|
1776
|
+
* @public
|
|
1777
|
+
*/
|
|
1778
|
+
type SheetTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
1779
|
+
/**
|
|
1780
|
+
* Sheet description component props
|
|
1781
|
+
* Extends Radix UI Dialog.Description props
|
|
1782
|
+
* @public
|
|
1783
|
+
*/
|
|
1784
|
+
type SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
1785
|
+
/**
|
|
1786
|
+
* Sheet component refs
|
|
1787
|
+
* @experimental
|
|
1788
|
+
*/
|
|
1789
|
+
type SheetOverlayRef = React.ElementRef<typeof DialogPrimitive.Overlay>;
|
|
1790
|
+
/** @experimental */
|
|
1791
|
+
type SheetContentRef = React.ElementRef<typeof DialogPrimitive.Content>;
|
|
1792
|
+
/** @experimental */
|
|
1793
|
+
type SheetTitleRef = React.ElementRef<typeof DialogPrimitive.Title>;
|
|
1794
|
+
/** @experimental */
|
|
1795
|
+
type SheetDescriptionRef = React.ElementRef<typeof DialogPrimitive.Description>;
|
|
1796
|
+
/** What `Sheet` is: a component taking {@link SheetProps}, with a `displayName`. */
|
|
1797
|
+
type SheetComponent = {
|
|
1798
|
+
(props: SheetProps): React$1.JSX.Element;
|
|
1799
|
+
displayName: string;
|
|
1800
|
+
};
|
|
1439
1801
|
/**
|
|
1440
1802
|
* Sheet Component
|
|
1441
1803
|
*
|
|
@@ -1448,7 +1810,7 @@ declare function SelectScrollDownButton({ className, ...props }: ComponentProps<
|
|
|
1448
1810
|
*
|
|
1449
1811
|
* - **Width**: 320px (sm), 400px (default), 512px (lg), 672px (xl), 100% (full)
|
|
1450
1812
|
* - **Animation**: Slide-in from side (150ms duration)
|
|
1451
|
-
* - **Backdrop**:
|
|
1813
|
+
* - **Backdrop**: the `--nx-overlay` scrim, with backdrop blur
|
|
1452
1814
|
* - **z-index**: 50 (both overlay and content - content renders on top via DOM order)
|
|
1453
1815
|
* - **Border-radius**: 0 (full-screen edges)
|
|
1454
1816
|
*
|
|
@@ -1488,31 +1850,55 @@ declare function SelectScrollDownButton({ className, ...props }: ComponentProps<
|
|
|
1488
1850
|
* ```
|
|
1489
1851
|
*
|
|
1490
1852
|
* @see https://www.radix-ui.com/primitives/docs/components/dialog
|
|
1853
|
+
* @public
|
|
1491
1854
|
*/
|
|
1492
|
-
declare const Sheet:
|
|
1493
|
-
|
|
1494
|
-
declare const
|
|
1495
|
-
|
|
1855
|
+
declare const Sheet: SheetComponent;
|
|
1856
|
+
/** @experimental */
|
|
1857
|
+
declare const SheetTrigger: typeof DialogPrimitive.Trigger;
|
|
1858
|
+
/** @experimental */
|
|
1859
|
+
declare const SheetClose: typeof DialogPrimitive.Close;
|
|
1860
|
+
/** @experimental */
|
|
1861
|
+
declare const SheetPortal: typeof DialogPrimitive.Portal;
|
|
1862
|
+
type SheetOverlayProps$1 = React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
1496
1863
|
/**
|
|
1497
1864
|
* SheetOverlay
|
|
1498
1865
|
*
|
|
1499
1866
|
* Semi-transparent backdrop that appears behind the sheet.
|
|
1500
1867
|
*
|
|
1501
|
-
* - **Background**:
|
|
1868
|
+
* - **Background**: the `--nx-overlay` scrim + backdrop blur
|
|
1502
1869
|
* - **Animation**: Fade in/out (150ms)
|
|
1503
1870
|
* - **z-index**: 50
|
|
1504
|
-
|
|
1505
|
-
|
|
1871
|
+
* @experimental
|
|
1872
|
+
*/
|
|
1873
|
+
declare const SheetOverlay: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<SheetOverlayProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DialogPrimitive.Overlay>>>;
|
|
1874
|
+
/** The arms `sheetVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
1875
|
+
declare const SHEET_VARIANT_MAP: {
|
|
1876
|
+
side: {
|
|
1877
|
+
top: string;
|
|
1878
|
+
bottom: string;
|
|
1879
|
+
left: string;
|
|
1880
|
+
right: string;
|
|
1881
|
+
};
|
|
1882
|
+
};
|
|
1506
1883
|
/**
|
|
1507
1884
|
* Sheet Content Variants
|
|
1508
1885
|
*
|
|
1509
1886
|
* Defines slide-in animations for each side and size options.
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
interface SheetContentProps extends
|
|
1887
|
+
* @experimental
|
|
1888
|
+
*/
|
|
1889
|
+
declare const sheetVariants: VariantsFn<typeof SHEET_VARIANT_MAP>;
|
|
1890
|
+
/** @public */
|
|
1891
|
+
interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
1892
|
+
/**
|
|
1893
|
+
* For a bottom sheet: a grab strip at its top that drags the sheet down
|
|
1894
|
+
* and closes it past a quarter of its height or on a quick flick. Escape
|
|
1895
|
+
* and the sheet's own close control still close it, so the strip is a
|
|
1896
|
+
* pointer affordance only and is hidden from assistive technology.
|
|
1897
|
+
*/
|
|
1898
|
+
dragHandle?: boolean;
|
|
1515
1899
|
}
|
|
1900
|
+
/** Whether a drag released at `distance` after `elapsed` ms closes the sheet. */
|
|
1901
|
+
declare function dragCloses(distance: number, elapsed: number, height: number): boolean;
|
|
1516
1902
|
/**
|
|
1517
1903
|
* SheetContent
|
|
1518
1904
|
*
|
|
@@ -1525,8 +1911,14 @@ interface SheetContentProps extends react.ComponentPropsWithoutRef<typeof Dialog
|
|
|
1525
1911
|
* - **Close Button**: Positioned in top-right corner (16px from edges)
|
|
1526
1912
|
*
|
|
1527
1913
|
* @param side - Which edge to slide in from: "left", "right", "top", "bottom"
|
|
1914
|
+
* @public
|
|
1528
1915
|
*/
|
|
1529
|
-
declare const SheetContent:
|
|
1916
|
+
declare const SheetContent: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<SheetContentProps> & React$1.RefAttributes<React$1.ElementRef<typeof DialogPrimitive.Content>>>;
|
|
1917
|
+
/** What `SheetHeader` and `SheetFooter` are: a `div` component with a `displayName`. */
|
|
1918
|
+
type SheetSectionComponent = {
|
|
1919
|
+
(props: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
1920
|
+
displayName: string;
|
|
1921
|
+
};
|
|
1530
1922
|
/**
|
|
1531
1923
|
* SheetHeader
|
|
1532
1924
|
*
|
|
@@ -1534,11 +1926,9 @@ declare const SheetContent: react.ForwardRefExoticComponent<SheetContentProps &
|
|
|
1534
1926
|
*
|
|
1535
1927
|
* - **Layout**: Flex column with 6px gap
|
|
1536
1928
|
* - **Text Alignment**: Left (default) or center
|
|
1929
|
+
* @public
|
|
1537
1930
|
*/
|
|
1538
|
-
declare const SheetHeader:
|
|
1539
|
-
({ className, ...props }: react.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1540
|
-
displayName: string;
|
|
1541
|
-
};
|
|
1931
|
+
declare const SheetHeader: SheetSectionComponent;
|
|
1542
1932
|
/**
|
|
1543
1933
|
* SheetFooter
|
|
1544
1934
|
*
|
|
@@ -1546,11 +1936,10 @@ declare const SheetHeader: {
|
|
|
1546
1936
|
*
|
|
1547
1937
|
* - **Layout**: Flex row on desktop, column on mobile
|
|
1548
1938
|
* - **Alignment**: Right-aligned on desktop, stretched on mobile
|
|
1939
|
+
* @experimental
|
|
1549
1940
|
*/
|
|
1550
|
-
declare const SheetFooter:
|
|
1551
|
-
|
|
1552
|
-
displayName: string;
|
|
1553
|
-
};
|
|
1941
|
+
declare const SheetFooter: SheetSectionComponent;
|
|
1942
|
+
type SheetTitleProps$1 = React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
1554
1943
|
/**
|
|
1555
1944
|
* SheetTitle
|
|
1556
1945
|
*
|
|
@@ -1559,8 +1948,10 @@ declare const SheetFooter: {
|
|
|
1559
1948
|
* - **Font**: text-lg font-semibold
|
|
1560
1949
|
* - **Color**: text-foreground
|
|
1561
1950
|
* - **Required**: For accessibility (screen readers)
|
|
1951
|
+
* @public
|
|
1562
1952
|
*/
|
|
1563
|
-
declare const SheetTitle:
|
|
1953
|
+
declare const SheetTitle: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<SheetTitleProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DialogPrimitive.Title>>>;
|
|
1954
|
+
type SheetDescriptionProps$1 = React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
1564
1955
|
/**
|
|
1565
1956
|
* SheetDescription
|
|
1566
1957
|
*
|
|
@@ -1569,63 +1960,9 @@ declare const SheetTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.D
|
|
|
1569
1960
|
* - **Font**: text-sm
|
|
1570
1961
|
* - **Color**: text-muted-foreground
|
|
1571
1962
|
* - **Purpose**: Provide context for screen readers
|
|
1963
|
+
* @public
|
|
1572
1964
|
*/
|
|
1573
|
-
declare const SheetDescription:
|
|
1574
|
-
|
|
1575
|
-
/**
|
|
1576
|
-
* Sheet Component Types
|
|
1577
|
-
*
|
|
1578
|
-
* TypeScript type definitions for the Sheet component (Dialog variant).
|
|
1579
|
-
*/
|
|
1580
|
-
|
|
1581
|
-
/**
|
|
1582
|
-
* Sheet root component props
|
|
1583
|
-
* Extends Radix UI Dialog.Root props
|
|
1584
|
-
*/
|
|
1585
|
-
type SheetProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
|
|
1586
|
-
/**
|
|
1587
|
-
* Sheet trigger component props
|
|
1588
|
-
* Extends Radix UI Dialog.Trigger props
|
|
1589
|
-
*/
|
|
1590
|
-
type SheetTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
|
|
1591
|
-
/**
|
|
1592
|
-
* Sheet close component props
|
|
1593
|
-
* Extends Radix UI Dialog.Close props
|
|
1594
|
-
*/
|
|
1595
|
-
type SheetCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
|
|
1596
|
-
/**
|
|
1597
|
-
* Sheet overlay component props
|
|
1598
|
-
* Extends Radix UI Dialog.Overlay props
|
|
1599
|
-
*/
|
|
1600
|
-
type SheetOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
1601
|
-
/**
|
|
1602
|
-
* Sheet header component props
|
|
1603
|
-
* Standard div props
|
|
1604
|
-
*/
|
|
1605
|
-
type SheetHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
1606
|
-
/**
|
|
1607
|
-
* Sheet footer component props
|
|
1608
|
-
* Standard div props
|
|
1609
|
-
*/
|
|
1610
|
-
type SheetFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
1611
|
-
/**
|
|
1612
|
-
* Sheet title component props
|
|
1613
|
-
* Extends Radix UI Dialog.Title props
|
|
1614
|
-
*/
|
|
1615
|
-
type SheetTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
1616
|
-
/**
|
|
1617
|
-
* Sheet description component props
|
|
1618
|
-
* Extends Radix UI Dialog.Description props
|
|
1619
|
-
*/
|
|
1620
|
-
type SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
1621
|
-
/**
|
|
1622
|
-
* Sheet component refs
|
|
1623
|
-
*/
|
|
1624
|
-
type SheetOverlayRef = React.ElementRef<typeof DialogPrimitive.Overlay>;
|
|
1625
|
-
type SheetContentRef = React.ElementRef<typeof DialogPrimitive.Content>;
|
|
1626
|
-
type SheetTitleRef = React.ElementRef<typeof DialogPrimitive.Title>;
|
|
1627
|
-
type SheetDescriptionRef = React.ElementRef<typeof DialogPrimitive.Description>;
|
|
1628
|
-
|
|
1965
|
+
declare const SheetDescription: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<SheetDescriptionProps$1> & React$1.RefAttributes<React$1.ElementRef<typeof DialogPrimitive.Description>>>;
|
|
1629
1966
|
/**
|
|
1630
1967
|
* Command Component
|
|
1631
1968
|
*
|
|
@@ -1651,7 +1988,7 @@ type SheetDescriptionRef = React.ElementRef<typeof DialogPrimitive.Description>;
|
|
|
1651
1988
|
* @design-spec
|
|
1652
1989
|
* - Input height: 48px (h-12) - larger for prominence
|
|
1653
1990
|
* - Item height: 36px (h-9) desktop, 44px (h-11) mobile for touch
|
|
1654
|
-
* - Border radius:
|
|
1991
|
+
* - Border radius: `rounded-lg` for the panel, `rounded-sm` for items
|
|
1655
1992
|
* - Max list height: 400px (max-h-[400px])
|
|
1656
1993
|
* - Transition: 150ms per design system
|
|
1657
1994
|
*
|
|
@@ -1661,30 +1998,52 @@ type SheetDescriptionRef = React.ElementRef<typeof DialogPrimitive.Description>;
|
|
|
1661
1998
|
* - Screen reader announcements for results
|
|
1662
1999
|
* - Focus management and visual focus indicators
|
|
1663
2000
|
* - WCAG 2.2 AA compliant (verified contrast ratios)
|
|
2001
|
+
* @experimental
|
|
1664
2002
|
*/
|
|
1665
2003
|
type CommandProps = ComponentPropsWithoutRef<typeof Command$1>;
|
|
1666
2004
|
/**
|
|
1667
2005
|
* Command - Root container for the command palette.
|
|
1668
2006
|
* Handles filtering, keyboard navigation, and accessibility.
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
2007
|
+
* @experimental
|
|
2008
|
+
*/
|
|
2009
|
+
declare const Command: ForwardRefExoticComponent<PropsWithoutRef<CommandProps> & RefAttributes<ElementRef<typeof Command$1>>>;
|
|
2010
|
+
/** @experimental */
|
|
2011
|
+
interface CommandDialogProps extends DialogPrimitive.DialogProps {
|
|
2012
|
+
/**
|
|
2013
|
+
* The dialog's accessible name, drawn visually hidden: the search field is what the eye
|
|
2014
|
+
* reads, but a dialog without a name is announced as "dialog" and nothing more, and the
|
|
2015
|
+
* field's placeholder names the INPUT, not the dialog around it. Defaults to "Command
|
|
2016
|
+
* palette"; a caller whose palette searches something narrower says what.
|
|
2017
|
+
*/
|
|
2018
|
+
title?: string;
|
|
2019
|
+
/**
|
|
2020
|
+
* What the dialog is for, drawn visually hidden and read after its name. Optional: without
|
|
2021
|
+
* one the dialog points at no description, rather than at an element that is not there.
|
|
2022
|
+
*/
|
|
2023
|
+
description?: string;
|
|
2024
|
+
/**
|
|
2025
|
+
* Passed to the command root this dialog renders internally.
|
|
2026
|
+
*
|
|
2027
|
+
* A seam rather than a list of forwarded props, because the settings a caller needs from the
|
|
2028
|
+
* root are the ones this component happens not to have thought of: `label`, which supplies the
|
|
2029
|
+
* search input's accessible name (cmdk renders an EMPTY hidden label without it, and an empty
|
|
2030
|
+
* `aria-labelledby` reference is worse than none — it stops the placeholder naming the field);
|
|
2031
|
+
* `filter` and `shouldFilter`, which decide match order; and `vimBindings`, which claims Ctrl+K
|
|
2032
|
+
* and Ctrl+N inside the list.
|
|
2033
|
+
*
|
|
2034
|
+
* `children` is excluded because this component owns the dialog's contents.
|
|
2035
|
+
*/
|
|
2036
|
+
commandProps?: Omit<ComponentPropsWithoutRef<typeof Command>, "children">;
|
|
2037
|
+
/**
|
|
2038
|
+
* Passed to the dialog content this component renders internally.
|
|
2039
|
+
*
|
|
2040
|
+
* The seam that matters here is `onCloseAutoFocus`: this dialog has no trigger, so Radix has
|
|
2041
|
+
* nothing to hand focus back to, and it fires this at the point focus is actually being
|
|
2042
|
+
* returned — after the exit animation, which a timer set at close time cannot know the length
|
|
2043
|
+
* of. `className` is excluded because this component owns the dialog's own layout.
|
|
2044
|
+
*/
|
|
2045
|
+
contentProps?: Omit<ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, "children" | "className">;
|
|
2046
|
+
}
|
|
1688
2047
|
/**
|
|
1689
2048
|
* CommandDialog - Command palette in a modal dialog.
|
|
1690
2049
|
* Use this variant for Cmd+K keyboard shortcut pattern.
|
|
@@ -1711,101 +2070,142 @@ type CommandDialogProps = DialogPrimitive.DialogProps;
|
|
|
1711
2070
|
* </CommandDialog>
|
|
1712
2071
|
* )
|
|
1713
2072
|
* ```
|
|
2073
|
+
* @experimental
|
|
1714
2074
|
*/
|
|
1715
|
-
declare const CommandDialog: ({ children, ...props }: CommandDialogProps) =>
|
|
2075
|
+
declare const CommandDialog: ({ children, title, description, commandProps, contentProps, ...props }: CommandDialogProps) => JSX.Element;
|
|
2076
|
+
/** @experimental */
|
|
1716
2077
|
type CommandInputProps = ComponentPropsWithoutRef<typeof Command$1.Input>;
|
|
1717
2078
|
/**
|
|
1718
2079
|
* CommandInput - Search input field for filtering commands.
|
|
1719
2080
|
* Includes search icon and styled per design system.
|
|
2081
|
+
* @experimental
|
|
1720
2082
|
*/
|
|
1721
|
-
declare const CommandInput:
|
|
1722
|
-
|
|
1723
|
-
} & {
|
|
1724
|
-
asChild?: boolean;
|
|
1725
|
-
}, "asChild" | "key" | keyof react.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
|
|
1726
|
-
value?: string;
|
|
1727
|
-
onValueChange?: (search: string) => void;
|
|
1728
|
-
} & react.RefAttributes<HTMLInputElement>, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
2083
|
+
declare const CommandInput: ForwardRefExoticComponent<PropsWithoutRef<CommandInputProps> & RefAttributes<ElementRef<typeof Command$1.Input>>>;
|
|
2084
|
+
/** @experimental */
|
|
1729
2085
|
type CommandListProps = ComponentPropsWithoutRef<typeof Command$1.List>;
|
|
1730
2086
|
/**
|
|
1731
2087
|
* CommandList - Scrollable container for command results.
|
|
1732
2088
|
* Max height 400px per design spec to prevent tall dialogs.
|
|
2089
|
+
* @experimental
|
|
1733
2090
|
*/
|
|
1734
|
-
declare const CommandList:
|
|
1735
|
-
|
|
1736
|
-
} & Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1737
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
1738
|
-
} & {
|
|
1739
|
-
asChild?: boolean;
|
|
1740
|
-
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1741
|
-
label?: string;
|
|
1742
|
-
} & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
2091
|
+
declare const CommandList: ForwardRefExoticComponent<PropsWithoutRef<CommandListProps> & RefAttributes<ElementRef<typeof Command$1.List>>>;
|
|
2092
|
+
/** @experimental */
|
|
1743
2093
|
type CommandEmptyProps = ComponentPropsWithoutRef<typeof Command$1.Empty>;
|
|
1744
2094
|
/**
|
|
1745
2095
|
* CommandEmpty - Empty state message when no results found.
|
|
1746
2096
|
* Centered text with muted color per design spec.
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
2097
|
+
*
|
|
2098
|
+
* A message of plain text inside a `CommandList` is drawn in the list but hidden from screen
|
|
2099
|
+
* readers, and the list says it from its own status line outside the list. The list is a
|
|
2100
|
+
* `listbox`, which may own only options and their groups: the library gives the message
|
|
2101
|
+
* `role="presentation"`, set after the props it is given, so the list would own its words, and
|
|
2102
|
+
* axe-core's `aria-required-children` fails a list a search found nothing in. A message holding
|
|
2103
|
+
* anything else, a "Try again" button say, stays where it is, so what it holds can still be
|
|
2104
|
+
* reached; so does one outside a list.
|
|
2105
|
+
* @experimental
|
|
2106
|
+
*/
|
|
2107
|
+
declare const CommandEmpty: ForwardRefExoticComponent<PropsWithoutRef<CommandEmptyProps> & RefAttributes<ElementRef<typeof Command$1.Empty>>>;
|
|
2108
|
+
/** @experimental */
|
|
1755
2109
|
type CommandGroupProps = ComponentPropsWithoutRef<typeof Command$1.Group>;
|
|
1756
2110
|
/**
|
|
1757
2111
|
* CommandGroup - Grouped section of commands with optional heading.
|
|
1758
2112
|
* Heading styled as uppercase, small, semibold per design spec.
|
|
2113
|
+
* @experimental
|
|
1759
2114
|
*/
|
|
1760
|
-
declare const CommandGroup:
|
|
1761
|
-
|
|
1762
|
-
} & Omit<Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1763
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
1764
|
-
} & {
|
|
1765
|
-
asChild?: boolean;
|
|
1766
|
-
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
|
|
1767
|
-
heading?: React.ReactNode;
|
|
1768
|
-
value?: string;
|
|
1769
|
-
forceMount?: boolean;
|
|
1770
|
-
} & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
2115
|
+
declare const CommandGroup: ForwardRefExoticComponent<PropsWithoutRef<CommandGroupProps> & RefAttributes<ElementRef<typeof Command$1.Group>>>;
|
|
2116
|
+
/** @experimental */
|
|
1771
2117
|
type CommandSeparatorProps = ComponentPropsWithoutRef<typeof Command$1.Separator>;
|
|
1772
2118
|
/**
|
|
1773
2119
|
* CommandSeparator - Visual divider between command groups.
|
|
1774
|
-
* 1px line
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
2120
|
+
* 1px line in the border colour, 8px margin top/bottom.
|
|
2121
|
+
*
|
|
2122
|
+
* Hidden from screen readers by default. It usually sits inside the list, which is a `listbox`,
|
|
2123
|
+
* and a listbox may own only options and their groups: the library's separator sets
|
|
2124
|
+
* `role="separator"` after the props it is given, so the role cannot be swapped out, and a
|
|
2125
|
+
* screen reader meeting it there finds a child the list should not have (axe-core's
|
|
2126
|
+
* `aria-required-children`). Groups already carry their own headings, so the line adds nothing
|
|
2127
|
+
* to what is announced. Placed outside the list, pass `aria-hidden={false}` to announce it.
|
|
2128
|
+
* @experimental
|
|
2129
|
+
*/
|
|
2130
|
+
declare const CommandSeparator: ForwardRefExoticComponent<PropsWithoutRef<CommandSeparatorProps> & RefAttributes<ElementRef<typeof Command$1.Separator>>>;
|
|
2131
|
+
/** @experimental */
|
|
1783
2132
|
type CommandItemProps = ComponentPropsWithoutRef<typeof Command$1.Item>;
|
|
1784
2133
|
/**
|
|
1785
2134
|
* CommandItem - Individual selectable command item.
|
|
1786
2135
|
* Height: 36px desktop, 44px mobile per design spec.
|
|
1787
2136
|
* Includes hover, focus, and selected states.
|
|
2137
|
+
* @experimental
|
|
1788
2138
|
*/
|
|
1789
|
-
declare const CommandItem:
|
|
1790
|
-
|
|
1791
|
-
} & Omit<Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1792
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
1793
|
-
} & {
|
|
1794
|
-
asChild?: boolean;
|
|
1795
|
-
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
|
|
1796
|
-
disabled?: boolean;
|
|
1797
|
-
onSelect?: (value: string) => void;
|
|
1798
|
-
value?: string;
|
|
1799
|
-
keywords?: string[];
|
|
1800
|
-
forceMount?: boolean;
|
|
1801
|
-
} & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
2139
|
+
declare const CommandItem: ForwardRefExoticComponent<PropsWithoutRef<CommandItemProps> & RefAttributes<ElementRef<typeof Command$1.Item>>>;
|
|
2140
|
+
/** @experimental */
|
|
1802
2141
|
type CommandShortcutProps = HTMLAttributes<HTMLSpanElement>;
|
|
1803
2142
|
/**
|
|
1804
2143
|
* CommandShortcut - Keyboard shortcut display (e.g., "⌘K", "↵ Enter").
|
|
1805
2144
|
* Monospace font, subtle background, right-aligned per design spec.
|
|
2145
|
+
* @experimental
|
|
1806
2146
|
*/
|
|
1807
|
-
declare const CommandShortcut:
|
|
1808
|
-
|
|
2147
|
+
declare const CommandShortcut: ForwardRefExoticComponent<PropsWithoutRef<CommandShortcutProps> & RefAttributes<HTMLSpanElement>>;
|
|
2148
|
+
/**
|
|
2149
|
+
* The command palette's default match scorer, re-exported.
|
|
2150
|
+
*
|
|
2151
|
+
* A caller that overrides `filter` — to keep an opaque item value out of the scoring, say — still
|
|
2152
|
+
* wants the ranking that comes for free, and reaching for `cmdk` directly is not open to every
|
|
2153
|
+
* package here.
|
|
2154
|
+
*
|
|
2155
|
+
* Bound to a declaration rather than re-exported with `export { x as y }`: the bundler keeps a doc
|
|
2156
|
+
* comment attached to a declaration and drops one attached to an export statement, so the release
|
|
2157
|
+
* tag would not reach the published types.
|
|
2158
|
+
*
|
|
2159
|
+
* @experimental
|
|
2160
|
+
*/
|
|
2161
|
+
export declare const commandDefaultFilter: typeof defaultFilter;
|
|
2162
|
+
/**
|
|
2163
|
+
* The value of the item the palette has HIGHLIGHTED, from a component inside
|
|
2164
|
+
* it.
|
|
2165
|
+
*
|
|
2166
|
+
* The palette owns which item is highlighted, and it moves that highlight for
|
|
2167
|
+
* reasons a caller never sees: a pointer crossing an item, an arrow key, and a
|
|
2168
|
+
* filter that removes the item the highlight was on. Anything outside wanting
|
|
2169
|
+
* to follow it — a preview pane, a description strip, a status line — needs to
|
|
2170
|
+
* read that rather than keep a copy.
|
|
2171
|
+
*
|
|
2172
|
+
* Reading beats mirroring here for a specific reason rather than on principle.
|
|
2173
|
+
* The palette's controlled `value` sets which item is MARKED, and does not move
|
|
2174
|
+
* the internal cursor that `aria-activedescendant` and the scroll follow. So a
|
|
2175
|
+
* caller that writes the value to steer the highlight desynchronises the two:
|
|
2176
|
+
* the item drawn as current and the option announced as current stop agreeing,
|
|
2177
|
+
* and after a filter the announcement can name an element that has been
|
|
2178
|
+
* removed. A read leaves one owner and takes a derived view.
|
|
2179
|
+
*
|
|
2180
|
+
* NARROWED to the one field deliberately. The underlying library exposes its
|
|
2181
|
+
* whole store through a selector — the raw search text, its internal item and
|
|
2182
|
+
* group maps, the id it uses for `aria-activedescendant` — and publishing that
|
|
2183
|
+
* selector would make every one of those part of this kit's public API and its
|
|
2184
|
+
* generated declarations. A dependency upgrade could then reshape what callers
|
|
2185
|
+
* can reach without any export changing name, which is exactly what the
|
|
2186
|
+
* surface snapshot cannot see. This returns a string.
|
|
2187
|
+
*
|
|
2188
|
+
* Empty string means nothing is highlighted, which is the library's own
|
|
2189
|
+
* spelling and a different answer from "an item whose value is unknown".
|
|
2190
|
+
*
|
|
2191
|
+
* Must be called from inside the palette, since that is where the state lives.
|
|
2192
|
+
*
|
|
2193
|
+
* Bound to a declaration rather than re-exported with `export { x as y }`: the
|
|
2194
|
+
* bundler keeps a doc comment attached to a declaration and drops one attached
|
|
2195
|
+
* to an export statement, so the release tag would not reach the published
|
|
2196
|
+
* types.
|
|
2197
|
+
*
|
|
2198
|
+
* @experimental
|
|
2199
|
+
*/
|
|
2200
|
+
export declare const useCommandHighlight: () => string;
|
|
2201
|
+
/** The arms `spinnerVariants` is built from. Its type is read from them: {@link VariantsFn}. */
|
|
2202
|
+
declare const SPINNER_VARIANT_MAP: {
|
|
2203
|
+
size: {
|
|
2204
|
+
sm: string;
|
|
2205
|
+
md: string;
|
|
2206
|
+
lg: string;
|
|
2207
|
+
};
|
|
2208
|
+
};
|
|
1809
2209
|
/**
|
|
1810
2210
|
* Spinner Component - Design System Specification
|
|
1811
2211
|
*
|
|
@@ -1849,28 +2249,28 @@ declare const CommandShortcut: react.ForwardRefExoticComponent<CommandShortcutPr
|
|
|
1849
2249
|
* @example
|
|
1850
2250
|
* // Custom color
|
|
1851
2251
|
* <Spinner className="text-primary" />
|
|
2252
|
+
* @experimental
|
|
1852
2253
|
*/
|
|
1853
|
-
declare const spinnerVariants:
|
|
1854
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1855
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2254
|
+
declare const spinnerVariants: VariantsFn<typeof SPINNER_VARIANT_MAP>;
|
|
1856
2255
|
/**
|
|
1857
2256
|
* Spinner component props
|
|
1858
2257
|
*
|
|
1859
2258
|
* Extends LucideProps to support all standard SVG attributes (data-*, id, etc.)
|
|
1860
2259
|
* while providing size variants and accessibility features.
|
|
2260
|
+
* @experimental
|
|
1861
2261
|
*/
|
|
1862
2262
|
type SpinnerProps = Omit<LucideProps, "size"> & VariantProps<typeof spinnerVariants> & {
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
2263
|
+
/**
|
|
2264
|
+
* Accessible label for screen readers
|
|
2265
|
+
* @default "Loading"
|
|
2266
|
+
*/
|
|
2267
|
+
"aria-label"?: string;
|
|
1868
2268
|
};
|
|
1869
2269
|
/**
|
|
1870
2270
|
* Spinner component for loading states
|
|
2271
|
+
* @experimental
|
|
1871
2272
|
*/
|
|
1872
|
-
declare const Spinner:
|
|
1873
|
-
|
|
2273
|
+
declare const Spinner: ForwardRefExoticComponent<PropsWithoutRef<SpinnerProps> & RefAttributes<SVGSVGElement>>;
|
|
1874
2274
|
/**
|
|
1875
2275
|
* Toaster Component - Toast Notification System
|
|
1876
2276
|
*
|
|
@@ -1936,9 +2336,9 @@ declare const Spinner: react.ForwardRefExoticComponent<Omit<SpinnerProps, "ref">
|
|
|
1936
2336
|
*
|
|
1937
2337
|
* Customization:
|
|
1938
2338
|
* All styling uses CSS variables from the design system:
|
|
1939
|
-
* - --normal-bg: Background color (uses --popover with fallback)
|
|
1940
|
-
* - --normal-text: Text color (uses --popover-foreground with fallback)
|
|
1941
|
-
* - --normal-border: Border color (uses --border with fallback)
|
|
2339
|
+
* - --normal-bg: Background color (uses --nx-popover with fallback)
|
|
2340
|
+
* - --normal-text: Text color (uses --nx-popover-foreground with fallback)
|
|
2341
|
+
* - --normal-border: Border color (uses --nx-border with fallback)
|
|
1942
2342
|
* - --border-radius: Border radius (uses --radius with fallback)
|
|
1943
2343
|
*
|
|
1944
2344
|
* Security:
|
|
@@ -1960,34 +2360,50 @@ declare const Spinner: react.ForwardRefExoticComponent<Omit<SpinnerProps, "ref">
|
|
|
1960
2360
|
*
|
|
1961
2361
|
* @see https://sonner.emilkowal.ski/ - Sonner documentation
|
|
1962
2362
|
* @see https://ui.shadcn.com/docs/components/sonner - shadcn/ui integration guide
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
declare const
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
declare const
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
2363
|
+
* @experimental
|
|
2364
|
+
*/
|
|
2365
|
+
export declare function Toaster({ theme, ...props }: ToasterProps$1): JSX.Element;
|
|
2366
|
+
type TableProps = React$1.HTMLAttributes<HTMLTableElement>;
|
|
2367
|
+
/** @experimental */
|
|
2368
|
+
declare const Table: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TableProps> & React$1.RefAttributes<HTMLTableElement>>;
|
|
2369
|
+
type TableHeaderProps = React$1.HTMLAttributes<HTMLTableSectionElement>;
|
|
2370
|
+
/** @experimental */
|
|
2371
|
+
declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TableHeaderProps> & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
2372
|
+
type TableBodyProps = React$1.HTMLAttributes<HTMLTableSectionElement>;
|
|
2373
|
+
/** @experimental */
|
|
2374
|
+
declare const TableBody: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TableBodyProps> & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
2375
|
+
type TableFooterProps = React$1.HTMLAttributes<HTMLTableSectionElement>;
|
|
2376
|
+
/** @experimental */
|
|
2377
|
+
declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TableFooterProps> & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
2378
|
+
type TableRowProps = React$1.HTMLAttributes<HTMLTableRowElement>;
|
|
2379
|
+
/** @experimental */
|
|
2380
|
+
declare const TableRow: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TableRowProps> & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
2381
|
+
type TableHeadProps = React$1.ThHTMLAttributes<HTMLTableCellElement>;
|
|
2382
|
+
/** @experimental */
|
|
2383
|
+
declare const TableHead: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TableHeadProps> & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
2384
|
+
type TableCellProps = React$1.TdHTMLAttributes<HTMLTableCellElement>;
|
|
2385
|
+
/** @experimental */
|
|
2386
|
+
declare const TableCell: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TableCellProps> & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
2387
|
+
type TableCaptionProps = React$1.HTMLAttributes<HTMLTableCaptionElement>;
|
|
2388
|
+
/** @experimental */
|
|
2389
|
+
declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TableCaptionProps> & React$1.RefAttributes<HTMLTableCaptionElement>>;
|
|
1975
2390
|
/**
|
|
1976
2391
|
* Props for TableSearch component
|
|
2392
|
+
* @experimental
|
|
1977
2393
|
*/
|
|
1978
2394
|
interface TableSearchProps {
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
2395
|
+
/** Current search value */
|
|
2396
|
+
value: string;
|
|
2397
|
+
/** Callback when search value changes */
|
|
2398
|
+
onChange: (value: string) => void;
|
|
2399
|
+
/** Callback when clear button is clicked */
|
|
2400
|
+
onClear: () => void;
|
|
2401
|
+
/** Placeholder text for search input */
|
|
2402
|
+
placeholder?: string;
|
|
2403
|
+
/** Whether data is currently loading */
|
|
2404
|
+
isLoading?: boolean;
|
|
2405
|
+
/** Ref to the input element */
|
|
2406
|
+
inputRef?: React.RefObject<HTMLInputElement | null>;
|
|
1991
2407
|
}
|
|
1992
2408
|
/**
|
|
1993
2409
|
* Search input component for tables
|
|
@@ -2008,312 +2424,1366 @@ interface TableSearchProps {
|
|
|
2008
2424
|
* isLoading={loading}
|
|
2009
2425
|
* />
|
|
2010
2426
|
* ```
|
|
2427
|
+
* @experimental
|
|
2011
2428
|
*/
|
|
2012
|
-
declare function TableSearch({ value, onChange, onClear, placeholder, isLoading, inputRef
|
|
2013
|
-
|
|
2429
|
+
export declare function TableSearch({ value, onChange, onClear, placeholder, isLoading, inputRef }: TableSearchProps): JSX.Element;
|
|
2014
2430
|
/**
|
|
2015
2431
|
* Props for TableError component
|
|
2432
|
+
* @experimental
|
|
2016
2433
|
*/
|
|
2017
2434
|
interface TableErrorProps {
|
|
2018
|
-
|
|
2019
|
-
|
|
2435
|
+
/** Error message to display */
|
|
2436
|
+
message?: string;
|
|
2020
2437
|
}
|
|
2021
2438
|
/**
|
|
2022
2439
|
* Error state component for tables
|
|
2440
|
+
* @experimental
|
|
2023
2441
|
*/
|
|
2024
|
-
declare function TableError({ message
|
|
2442
|
+
export declare function TableError({ message }: TableErrorProps): JSX.Element;
|
|
2025
2443
|
/**
|
|
2026
2444
|
* Loading state component for tables
|
|
2445
|
+
* @experimental
|
|
2027
2446
|
*/
|
|
2028
|
-
declare function TableLoading():
|
|
2447
|
+
export declare function TableLoading(): JSX.Element;
|
|
2029
2448
|
/**
|
|
2030
2449
|
* Props for TableEmpty component
|
|
2450
|
+
* @experimental
|
|
2031
2451
|
*/
|
|
2032
2452
|
interface TableEmptyProps {
|
|
2033
|
-
|
|
2034
|
-
|
|
2453
|
+
/** Custom message to display when no data */
|
|
2454
|
+
message?: string;
|
|
2035
2455
|
}
|
|
2036
2456
|
/**
|
|
2037
2457
|
* Empty state component for tables
|
|
2458
|
+
* @experimental
|
|
2038
2459
|
*/
|
|
2039
|
-
declare function TableEmpty({ message }: TableEmptyProps):
|
|
2040
|
-
|
|
2460
|
+
export declare function TableEmpty({ message }: TableEmptyProps): JSX.Element;
|
|
2461
|
+
/** @experimental */
|
|
2462
|
+
interface TableSkeletonProps {
|
|
2463
|
+
columns?: number;
|
|
2464
|
+
rowCount?: number;
|
|
2465
|
+
hideWrapper?: boolean;
|
|
2466
|
+
hideFooter?: boolean;
|
|
2467
|
+
}
|
|
2468
|
+
/** @experimental */
|
|
2469
|
+
export declare const TableSkeleton: React$1.FC<TableSkeletonProps>;
|
|
2470
|
+
/**
|
|
2471
|
+
* One preset a host offers.
|
|
2472
|
+
*
|
|
2473
|
+
* `color` is what the swatch is PAINTED with. `value` is what `onSwatchSelect`
|
|
2474
|
+
* hands back, unread by this component — a host storing design tokens puts its
|
|
2475
|
+
* own token reference there and receives it unchanged, so choosing a swatch
|
|
2476
|
+
* never resolves a token into the colour it currently happens to be. Without
|
|
2477
|
+
* that, re-theming stops moving the values that pointed at it.
|
|
2478
|
+
*
|
|
2479
|
+
* @experimental
|
|
2480
|
+
*/
|
|
2481
|
+
interface ColorSwatch<TValue = string> {
|
|
2482
|
+
id: string;
|
|
2483
|
+
label: string;
|
|
2484
|
+
color: string;
|
|
2485
|
+
value?: TValue;
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* Props for ColorPicker.
|
|
2489
|
+
* @experimental
|
|
2490
|
+
*/
|
|
2491
|
+
interface ColorPickerProps<TValue = string> {
|
|
2492
|
+
/** The colour shown on the surface, as hex. */
|
|
2493
|
+
color: string;
|
|
2494
|
+
/**
|
|
2495
|
+
* A colour was chosen by editing — surface, hue, alpha or the field — as hex,
|
|
2496
|
+
* whichever notation it was typed in.
|
|
2497
|
+
*/
|
|
2498
|
+
onColorChange: (color: string) => void;
|
|
2499
|
+
/** Presets. Painted from `color`, returned by `value`. */
|
|
2500
|
+
swatches?: ColorSwatch<TValue>[];
|
|
2501
|
+
/**
|
|
2502
|
+
* A preset was chosen. Separate from `onColorChange` because only the host
|
|
2503
|
+
* can say what a swatch MEANS: the two are different events, and collapsing
|
|
2504
|
+
* them is what loses a token reference.
|
|
2505
|
+
*/
|
|
2506
|
+
onSwatchSelect?: (swatch: ColorSwatch<TValue>) => void;
|
|
2507
|
+
/**
|
|
2508
|
+
* Recently used colours. Owned by the host, never by this component — the
|
|
2509
|
+
* admin scopes them per user, and a component writing `localStorage` at
|
|
2510
|
+
* render is unusable on a server and untestable without a DOM. Given, the
|
|
2511
|
+
* "Recent colours" row shows, saying what will appear while it is empty;
|
|
2512
|
+
* absent, there is no row.
|
|
2513
|
+
*/
|
|
2514
|
+
recentColors?: string[];
|
|
2515
|
+
/**
|
|
2516
|
+
* A recent colour was chosen. Given, the colour comes back as the host
|
|
2517
|
+
* listed it, in its own notation, for the host to store as it is; absent,
|
|
2518
|
+
* the picker reads it and reports it as an edit, as it does a typed one.
|
|
2519
|
+
*/
|
|
2520
|
+
onRecentSelect?: (color: string) => void;
|
|
2521
|
+
/** Alpha channel. Off by default: most call sites want an opaque colour. */
|
|
2522
|
+
showAlpha?: boolean;
|
|
2523
|
+
className?: string;
|
|
2524
|
+
}
|
|
2525
|
+
/**
|
|
2526
|
+
* A colour control: a saturation square, a hue strip, optional alpha, a field
|
|
2527
|
+
* that reads hex, `rgb()` or `hsl()` and shows whichever of the three the
|
|
2528
|
+
* author picks, the screen's eyedropper where the browser has one, and any
|
|
2529
|
+
* presets and recent colours the host supplies. What it reports is hex.
|
|
2530
|
+
*
|
|
2531
|
+
* Deliberately knows nothing about design tokens. A swatch carries an opaque
|
|
2532
|
+
* `value` this component never reads and hands back untouched, so a host can
|
|
2533
|
+
* store a token reference and keep it. That is what lets one component serve
|
|
2534
|
+
* both a plain colour field and a token-aware surface without either learning
|
|
2535
|
+
* about the other.
|
|
2536
|
+
*
|
|
2537
|
+
* @experimental
|
|
2538
|
+
*
|
|
2539
|
+
* @example
|
|
2540
|
+
* ```tsx
|
|
2541
|
+
* <ColorPicker
|
|
2542
|
+
* color={color}
|
|
2543
|
+
* onColorChange={setColor}
|
|
2544
|
+
* swatches={tokens.map(t => ({ id: t.name, label: t.name, color: t.value, value: { $token: t.name } }))}
|
|
2545
|
+
* onSwatchSelect={s => store(s.value)}
|
|
2546
|
+
* />
|
|
2547
|
+
* ```
|
|
2548
|
+
*/
|
|
2549
|
+
export declare function ColorPicker<TValue = string>({ color, onColorChange, swatches, onSwatchSelect, recentColors, onRecentSelect, showAlpha, className }: ColorPickerProps<TValue>): React$1.JSX.Element;
|
|
2550
|
+
/**
|
|
2551
|
+
* One icon an icon source can draw.
|
|
2552
|
+
*
|
|
2553
|
+
* @experimental
|
|
2554
|
+
*/
|
|
2555
|
+
interface IconSourceIcon {
|
|
2556
|
+
/** The id a field stores, `<set>:<name>`: `lucide:star`. */
|
|
2557
|
+
readonly id: string;
|
|
2558
|
+
/** Its name within its set: `star`, `circle-arrow-up`. */
|
|
2559
|
+
readonly name: string;
|
|
2560
|
+
/**
|
|
2561
|
+
* The SVG's inner markup, as a flat run of self-closing shape elements:
|
|
2562
|
+
* `path`, `circle`, `ellipse`, `line`, `polygon`, `polyline` and `rect`,
|
|
2563
|
+
* carrying only their geometry attributes and a `fill` of `none` or
|
|
2564
|
+
* `currentColor`.
|
|
2565
|
+
*
|
|
2566
|
+
* Never inserted as HTML. {@link IconGlyph} reads the markup into React
|
|
2567
|
+
* elements and draws a body of any other shape as nothing at all, so a body
|
|
2568
|
+
* holding a script, an event attribute or a nested element draws an empty
|
|
2569
|
+
* box rather than reaching the page.
|
|
2570
|
+
*/
|
|
2571
|
+
readonly body: string;
|
|
2572
|
+
/** The box the body is drawn in: `0 0 24 24`. */
|
|
2573
|
+
readonly viewBox: string;
|
|
2574
|
+
/**
|
|
2575
|
+
* Drawn by its stroke in the text colour, as Lucide's icons are, rather than
|
|
2576
|
+
* by its fill. Stroked unless this is `false`.
|
|
2577
|
+
*/
|
|
2578
|
+
readonly stroked?: boolean;
|
|
2579
|
+
/** The words the icon is found by in a search, shown beside it. */
|
|
2580
|
+
readonly tags?: readonly string[];
|
|
2581
|
+
}
|
|
2582
|
+
/**
|
|
2583
|
+
* Where an icon picker gets its icons: one icon set, searched and resolved.
|
|
2584
|
+
*
|
|
2585
|
+
* An interface rather than data, so this package carries no icons of its own.
|
|
2586
|
+
* The host supplies the set, typically by loading it on demand, and decides
|
|
2587
|
+
* how a search ranks its matches.
|
|
2588
|
+
*
|
|
2589
|
+
* @experimental
|
|
2590
|
+
*/
|
|
2591
|
+
interface IconSource {
|
|
2592
|
+
/** The set prefix every id from this source carries: `lucide`. */
|
|
2593
|
+
readonly prefix: string;
|
|
2594
|
+
/** The set's name as a person reads it: `Lucide`. */
|
|
2595
|
+
readonly label: string;
|
|
2596
|
+
/**
|
|
2597
|
+
* The icons matching a query, best match first. An empty query lists the
|
|
2598
|
+
* whole set, in the order a person should browse it.
|
|
2599
|
+
*/
|
|
2600
|
+
search(query: string): Promise<readonly IconSourceIcon[]>;
|
|
2601
|
+
/**
|
|
2602
|
+
* One icon by id, or `null` when the set does not draw it. An id the set has
|
|
2603
|
+
* since renamed resolves to the icon it now is.
|
|
2604
|
+
*/
|
|
2605
|
+
resolve(id: string): Promise<IconSourceIcon | null>;
|
|
2606
|
+
}
|
|
2607
|
+
/**
|
|
2608
|
+
* Props for IconGlyph.
|
|
2609
|
+
*
|
|
2610
|
+
* @experimental
|
|
2611
|
+
*/
|
|
2612
|
+
interface IconGlyphProps extends Omit<React$1.SVGProps<SVGSVGElement>, "children" | "viewBox" | "dangerouslySetInnerHTML"> {
|
|
2613
|
+
/** The icon to draw. Only its body, box and stroke are read. */
|
|
2614
|
+
icon: Pick<IconSourceIcon, "body" | "viewBox" | "stroked">;
|
|
2615
|
+
}
|
|
2616
|
+
/**
|
|
2617
|
+
* An icon from an {@link IconSource}, drawn as an inline SVG in the text
|
|
2618
|
+
* colour.
|
|
2619
|
+
*
|
|
2620
|
+
* Decorative by default (`aria-hidden`): the control around it names the
|
|
2621
|
+
* icon. The body is read into React elements rather than inserted as markup,
|
|
2622
|
+
* and a body that is not a run of plain shapes draws an empty box.
|
|
2623
|
+
*
|
|
2624
|
+
* @experimental
|
|
2625
|
+
*/
|
|
2626
|
+
export declare function IconGlyph({ icon, className, ...props }: IconGlyphProps): React$1.JSX.Element;
|
|
2627
|
+
/**
|
|
2628
|
+
* An icon's name as a person reads it: `circle-arrow-up` is
|
|
2629
|
+
* `Circle arrow up`.
|
|
2630
|
+
*/
|
|
2631
|
+
declare function iconDisplayName(name: string): string;
|
|
2632
|
+
/**
|
|
2633
|
+
* Props for IconPicker.
|
|
2634
|
+
*
|
|
2635
|
+
* @experimental
|
|
2636
|
+
*/
|
|
2637
|
+
interface IconPickerProps {
|
|
2638
|
+
/**
|
|
2639
|
+
* Loads the icon source. Called once per function and shared by every
|
|
2640
|
+
* picker and field given the same one, so pass a stable function rather
|
|
2641
|
+
* than one created on each render.
|
|
2642
|
+
*/
|
|
2643
|
+
loadIcons: () => Promise<IconSource>;
|
|
2644
|
+
/**
|
|
2645
|
+
* The id currently chosen, marked in the grid and scrolled to on open. An
|
|
2646
|
+
* id the set has since renamed is marked as the icon it resolves to.
|
|
2647
|
+
*/
|
|
2648
|
+
value?: string | null;
|
|
2649
|
+
/** An icon was chosen, by click or by Enter. */
|
|
2650
|
+
onChoose: (icon: IconSourceIcon) => void;
|
|
2651
|
+
/**
|
|
2652
|
+
* The ids of the icons this person used last, newest first, offered as a
|
|
2653
|
+
* "Recent" row above the whole set while the search is empty. Kept by the
|
|
2654
|
+
* host, never by the picker, which writes no storage: the host knows who is
|
|
2655
|
+
* signed in, and remembers per person.
|
|
2656
|
+
*/
|
|
2657
|
+
recentIcons?: readonly string[];
|
|
2658
|
+
className?: string;
|
|
2659
|
+
}
|
|
2660
|
+
/**
|
|
2661
|
+
* A search-first icon picker: a search box over a grid of the matching icons,
|
|
2662
|
+
* and the highlighted icon's name and tags beneath.
|
|
2663
|
+
*
|
|
2664
|
+
* The search box keeps focus throughout, as a combobox. The arrow keys move a
|
|
2665
|
+
* highlight through the grid (left and right by one icon, up and down by a
|
|
2666
|
+
* row), Page Up and Page Down by several rows, and Enter chooses the
|
|
2667
|
+
* highlighted icon; the first match is highlighted as soon as results arrive,
|
|
2668
|
+
* so typing and pressing Enter chooses the best match. The grid is a listbox
|
|
2669
|
+
* that renders only the rows in view, which is what keeps a set of nearly two
|
|
2670
|
+
* thousand icons quick to open. How many icons match is announced politely.
|
|
2671
|
+
*
|
|
2672
|
+
* @experimental
|
|
2673
|
+
*/
|
|
2674
|
+
export declare function IconPicker({ loadIcons, value, onChoose, recentIcons, className }: IconPickerProps): React$1.JSX.Element;
|
|
2675
|
+
/**
|
|
2676
|
+
* Props for IconField.
|
|
2677
|
+
*
|
|
2678
|
+
* @experimental
|
|
2679
|
+
*/
|
|
2680
|
+
interface IconFieldProps {
|
|
2681
|
+
/** The stored icon id, `lucide:star`, or nothing. */
|
|
2682
|
+
value: string | null | undefined;
|
|
2683
|
+
/** An icon was chosen (its id), or the field was cleared (`null`). */
|
|
2684
|
+
onChange: (id: string | null) => void;
|
|
2685
|
+
/** Loads the icon source; see {@link IconPickerProps.loadIcons}. */
|
|
2686
|
+
loadIcons: () => Promise<IconSource>;
|
|
2687
|
+
/**
|
|
2688
|
+
* The icons this person used last, newest first, for the picker's Recent
|
|
2689
|
+
* row; see {@link IconPickerProps.recentIcons}. The host records a choice
|
|
2690
|
+
* from `onChange`.
|
|
2691
|
+
*/
|
|
2692
|
+
recentIcons?: readonly string[];
|
|
2693
|
+
/**
|
|
2694
|
+
* The field's label as a person reads it. It opens the button's accessible
|
|
2695
|
+
* name, which goes on to say the chosen icon: `Icon: Truck`.
|
|
2696
|
+
*/
|
|
2697
|
+
label?: string;
|
|
2698
|
+
/** The id of the button that opens the picker, for a `<label for>`. */
|
|
2699
|
+
id?: string;
|
|
2700
|
+
disabled?: boolean;
|
|
2701
|
+
/** Shows the value and its warning, but offers neither picker nor clear. */
|
|
2702
|
+
readOnly?: boolean;
|
|
2703
|
+
/** Marks the button invalid, for a form that rejected the value. */
|
|
2704
|
+
invalid?: boolean;
|
|
2705
|
+
/** Describes the button, for a hint or an error beside the field. */
|
|
2706
|
+
"aria-describedby"?: string;
|
|
2707
|
+
/**
|
|
2708
|
+
* The field was left: focus moved from its buttons to somewhere outside
|
|
2709
|
+
* them, the picker closed, or the value was cleared.
|
|
2710
|
+
*/
|
|
2711
|
+
onBlur?: () => void;
|
|
2712
|
+
/**
|
|
2713
|
+
* The button that opens the picker, for a form that focuses a field it
|
|
2714
|
+
* rejected or is asked to focus.
|
|
2715
|
+
*/
|
|
2716
|
+
ref?: React$1.Ref<HTMLButtonElement>;
|
|
2717
|
+
className?: string;
|
|
2718
|
+
}
|
|
2719
|
+
/**
|
|
2720
|
+
* A field holding one icon: a button showing the chosen icon, its name and
|
|
2721
|
+
* its set, which opens an {@link IconPicker}, and a button that clears it.
|
|
2722
|
+
*
|
|
2723
|
+
* An id the source no longer draws is shown by its name with a warning, and
|
|
2724
|
+
* kept until someone chooses another: the field never rewrites a stored value
|
|
2725
|
+
* on its own. Escape closes the picker and returns focus to the button.
|
|
2726
|
+
*
|
|
2727
|
+
* @experimental
|
|
2728
|
+
*/
|
|
2729
|
+
export declare function IconField({ value, onChange, loadIcons, label, id, disabled, readOnly, invalid, "aria-describedby": describedBy, onBlur, recentIcons, ref, className }: IconFieldProps): React$1.JSX.Element;
|
|
2730
|
+
/** @experimental */
|
|
2041
2731
|
interface PaginationMeta {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2732
|
+
total: number;
|
|
2733
|
+
page: number;
|
|
2734
|
+
limit: number;
|
|
2735
|
+
totalPages: number;
|
|
2736
|
+
hasNext: boolean;
|
|
2737
|
+
hasPrev: boolean;
|
|
2048
2738
|
}
|
|
2739
|
+
/** @experimental */
|
|
2049
2740
|
interface SortInfo {
|
|
2050
|
-
|
|
2051
|
-
|
|
2741
|
+
field: string;
|
|
2742
|
+
direction: "asc" | "desc";
|
|
2052
2743
|
}
|
|
2744
|
+
/** @experimental */
|
|
2053
2745
|
interface FilterInfo {
|
|
2054
|
-
|
|
2055
|
-
|
|
2746
|
+
search?: string;
|
|
2747
|
+
filters?: Record<string, unknown>;
|
|
2056
2748
|
}
|
|
2749
|
+
/** @experimental */
|
|
2057
2750
|
interface TableParams {
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2751
|
+
pagination: {
|
|
2752
|
+
page: number;
|
|
2753
|
+
pageSize: number;
|
|
2754
|
+
};
|
|
2755
|
+
sorting?: SortInfo[];
|
|
2756
|
+
filters?: FilterInfo;
|
|
2064
2757
|
}
|
|
2758
|
+
/** @experimental */
|
|
2065
2759
|
interface ListResponse<TData> {
|
|
2066
|
-
|
|
2067
|
-
|
|
2760
|
+
items: TData[];
|
|
2761
|
+
meta: PaginationMeta;
|
|
2068
2762
|
}
|
|
2763
|
+
/** @experimental */
|
|
2069
2764
|
interface PaginationConfig {
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2765
|
+
pageSize?: number;
|
|
2766
|
+
pageSizeOptions?: number[];
|
|
2767
|
+
showPageSizeSelector?: boolean;
|
|
2768
|
+
maxVisiblePages?: number;
|
|
2074
2769
|
}
|
|
2770
|
+
/** @experimental */
|
|
2075
2771
|
interface ActionCallbacks<TData = unknown> {
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2772
|
+
onEdit?: (item: TData) => void;
|
|
2773
|
+
onDelete?: (item: TData) => void;
|
|
2774
|
+
onView?: (item: TData) => void;
|
|
2079
2775
|
}
|
|
2776
|
+
/** @experimental */
|
|
2080
2777
|
type DataFetcher<TData> = (params: TableParams) => Promise<ListResponse<TData>>;
|
|
2081
|
-
|
|
2778
|
+
interface PortalProviderProps {
|
|
2779
|
+
/** The DOM element to portal overlay content into. Defaults to document.body (Radix default). */
|
|
2780
|
+
container: HTMLElement | null;
|
|
2781
|
+
children: ReactNode;
|
|
2782
|
+
}
|
|
2783
|
+
/** @public */
|
|
2784
|
+
declare function PortalProvider({ container, children }: PortalProviderProps): JSX.Element;
|
|
2785
|
+
/** @public */
|
|
2786
|
+
declare function usePortalContainer(): HTMLElement | undefined;
|
|
2787
|
+
/** @experimental */
|
|
2788
|
+
declare const ContextMenu: typeof ContextMenuPrimitive.Root;
|
|
2789
|
+
/** @experimental */
|
|
2790
|
+
declare const ContextMenuTrigger: typeof ContextMenuPrimitive.Trigger;
|
|
2791
|
+
/** @experimental */
|
|
2792
|
+
declare const ContextMenuGroup: typeof ContextMenuPrimitive.Group;
|
|
2793
|
+
/** @experimental */
|
|
2794
|
+
declare const ContextMenuSub: typeof ContextMenuPrimitive.Sub;
|
|
2795
|
+
/** @experimental */
|
|
2796
|
+
declare const ContextMenuRadioGroup: typeof ContextMenuPrimitive.RadioGroup;
|
|
2797
|
+
type ContextMenuSubTriggerProps = React$1.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
2798
|
+
inset?: boolean;
|
|
2799
|
+
};
|
|
2800
|
+
/** @experimental */
|
|
2801
|
+
declare const ContextMenuSubTrigger: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ContextMenuSubTriggerProps> & React$1.RefAttributes<React$1.ElementRef<typeof ContextMenuPrimitive.SubTrigger>>>;
|
|
2802
|
+
type ContextMenuSubContentProps = React$1.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>;
|
|
2803
|
+
/** @experimental */
|
|
2804
|
+
declare const ContextMenuSubContent: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ContextMenuSubContentProps> & React$1.RefAttributes<React$1.ElementRef<typeof ContextMenuPrimitive.SubContent>>>;
|
|
2805
|
+
type ContextMenuContentProps = React$1.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>;
|
|
2806
|
+
/** @experimental */
|
|
2807
|
+
declare const ContextMenuContent: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ContextMenuContentProps> & React$1.RefAttributes<React$1.ElementRef<typeof ContextMenuPrimitive.Content>>>;
|
|
2808
|
+
type ContextMenuItemProps = React$1.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
|
|
2809
|
+
inset?: boolean;
|
|
2810
|
+
};
|
|
2811
|
+
/** @experimental */
|
|
2812
|
+
declare const ContextMenuItem: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ContextMenuItemProps> & React$1.RefAttributes<React$1.ElementRef<typeof ContextMenuPrimitive.Item>>>;
|
|
2813
|
+
type ContextMenuCheckboxItemProps = React$1.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>;
|
|
2814
|
+
/** @experimental */
|
|
2815
|
+
declare const ContextMenuCheckboxItem: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ContextMenuCheckboxItemProps> & React$1.RefAttributes<React$1.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>>>;
|
|
2816
|
+
type ContextMenuRadioItemProps = React$1.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>;
|
|
2817
|
+
/** @experimental */
|
|
2818
|
+
declare const ContextMenuRadioItem: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ContextMenuRadioItemProps> & React$1.RefAttributes<React$1.ElementRef<typeof ContextMenuPrimitive.RadioItem>>>;
|
|
2819
|
+
type ContextMenuLabelProps = React$1.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
|
|
2820
|
+
inset?: boolean;
|
|
2821
|
+
};
|
|
2822
|
+
/** @experimental */
|
|
2823
|
+
declare const ContextMenuLabel: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ContextMenuLabelProps> & React$1.RefAttributes<React$1.ElementRef<typeof ContextMenuPrimitive.Label>>>;
|
|
2824
|
+
type ContextMenuSeparatorProps = React$1.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>;
|
|
2825
|
+
/** @experimental */
|
|
2826
|
+
declare const ContextMenuSeparator: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<ContextMenuSeparatorProps> & React$1.RefAttributes<React$1.ElementRef<typeof ContextMenuPrimitive.Separator>>>;
|
|
2827
|
+
/** What `ContextMenuShortcut` is: a `span` component with a `displayName`. */
|
|
2828
|
+
type ContextMenuShortcutComponent = {
|
|
2829
|
+
(props: React$1.HTMLAttributes<HTMLSpanElement>): React$1.JSX.Element;
|
|
2830
|
+
displayName: string;
|
|
2831
|
+
};
|
|
2832
|
+
/**
|
|
2833
|
+
* A keyboard shortcut hint, right-aligned in the item.
|
|
2834
|
+
*
|
|
2835
|
+
* @experimental
|
|
2836
|
+
*/
|
|
2837
|
+
declare const ContextMenuShortcut: ContextMenuShortcutComponent;
|
|
2838
|
+
/**
|
|
2839
|
+
* A splitter's accessible name, which the caller must supply one way or the
|
|
2840
|
+
* other.
|
|
2841
|
+
*
|
|
2842
|
+
* REQUIRED rather than documented, because the handle is focusable: a keyboard
|
|
2843
|
+
* user lands on it whether or not anyone remembered, and an unnamed separator
|
|
2844
|
+
* announces its position — "74" — with nothing saying what is at 74. The
|
|
2845
|
+
* caller is the only one who can name it, since only the caller knows what the
|
|
2846
|
+
* two panels hold, so the type is the only place the requirement can live.
|
|
2847
|
+
*
|
|
2848
|
+
* Either attribute satisfies it and neither may be paired with the other: two
|
|
2849
|
+
* names on one element is not a stronger label, it is an ambiguity resolved by
|
|
2850
|
+
* precedence rules nobody writing the call site is thinking about.
|
|
2851
|
+
*/
|
|
2852
|
+
type SplitterName = {
|
|
2853
|
+
"aria-label": string;
|
|
2854
|
+
"aria-labelledby"?: never;
|
|
2855
|
+
} | {
|
|
2856
|
+
"aria-labelledby": string;
|
|
2857
|
+
"aria-label"?: never;
|
|
2858
|
+
};
|
|
2859
|
+
/**
|
|
2860
|
+
* A group of resizable panels, laid out horizontally or vertically.
|
|
2861
|
+
*
|
|
2862
|
+
* @experimental
|
|
2863
|
+
*/
|
|
2864
|
+
declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.Group>) => JSX.Element;
|
|
2865
|
+
/**
|
|
2866
|
+
* One region of a panel group.
|
|
2867
|
+
*
|
|
2868
|
+
* @experimental
|
|
2869
|
+
*/
|
|
2870
|
+
declare const ResizablePanel: typeof ResizablePrimitive.Panel;
|
|
2871
|
+
/**
|
|
2872
|
+
* The draggable divider between two panels.
|
|
2873
|
+
*
|
|
2874
|
+
* The visible line is 1px; the element around it is wider and transparent, so the pointer target
|
|
2875
|
+
* is comfortably larger than the line it appears to grab. `withGrip` adds a visible handle, which
|
|
2876
|
+
* is worth it on a divider people are meant to discover rather than one they already expect.
|
|
2877
|
+
*
|
|
2878
|
+
* @experimental
|
|
2879
|
+
*/
|
|
2880
|
+
declare const ResizableHandle: ({ withGrip, className, children, ...props }: Omit<React$1.ComponentProps<typeof ResizablePrimitive.Separator>, "aria-label" | "aria-labelledby"> & SplitterName & {
|
|
2881
|
+
withGrip?: boolean;
|
|
2882
|
+
}) => JSX.Element;
|
|
2082
2883
|
/**
|
|
2083
|
-
*
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2884
|
+
* One node of the tree. Children are omitted or empty for a leaf.
|
|
2885
|
+
*
|
|
2886
|
+
* @experimental
|
|
2887
|
+
*/
|
|
2888
|
+
interface TreeNode {
|
|
2889
|
+
/** Stable identity. What selection and expansion are keyed by. */
|
|
2890
|
+
id: string;
|
|
2891
|
+
/** What the row shows. A string also feeds typeahead; anything else needs `textValue`. */
|
|
2892
|
+
label: React$1.ReactNode;
|
|
2893
|
+
/**
|
|
2894
|
+
* The text typeahead matches on, when `label` is not a string.
|
|
2895
|
+
*
|
|
2896
|
+
* Without it a row rendered as markup cannot be typed to, and a keyboard user loses the fastest
|
|
2897
|
+
* way through a long tree.
|
|
2898
|
+
*/
|
|
2899
|
+
textValue?: string;
|
|
2900
|
+
/** Children, if any. An empty array still marks the node as a parent. */
|
|
2901
|
+
children?: readonly TreeNode[];
|
|
2902
|
+
/** Shown before the label, after the twisty. */
|
|
2903
|
+
icon?: React$1.ReactNode;
|
|
2904
|
+
/** Skipped by every keyboard move and not selectable. */
|
|
2905
|
+
disabled?: boolean;
|
|
2096
2906
|
}
|
|
2097
2907
|
/**
|
|
2098
|
-
*
|
|
2908
|
+
* How far each level of the tree is indented, in pixels.
|
|
2909
|
+
*
|
|
2910
|
+
* Exported because a consumer that lets rows be dragged to a depth has to step
|
|
2911
|
+
* by the same distance the rows are drawn at: an editor reading a pointer's x
|
|
2912
|
+
* as a depth draws its drop line where a row at that depth would start, and
|
|
2913
|
+
* two separate numbers would put the line a level away from the hand.
|
|
2914
|
+
*
|
|
2915
|
+
* @experimental
|
|
2916
|
+
*/
|
|
2917
|
+
export declare const TREE_INDENT_PX = 20;
|
|
2918
|
+
/**
|
|
2919
|
+
* Which gesture a row's modifiers meant.
|
|
2920
|
+
*
|
|
2921
|
+
* Named by the same three words the rest of the system uses, so a caller maps
|
|
2922
|
+
* them onto its own selection rules without translating. Both Meta and Control
|
|
2923
|
+
* mean toggle: a Mac author presses Command and a Windows author presses
|
|
2924
|
+
* Control, and neither ever presses the other's.
|
|
2925
|
+
*
|
|
2926
|
+
* Shift outranks the toggle modifier — a shift+mod click is a slip rather than
|
|
2927
|
+
* a fourth gesture, and extending is the one whose result is visible and undone
|
|
2928
|
+
* by a plain click.
|
|
2929
|
+
*
|
|
2930
|
+
* @experimental
|
|
2931
|
+
*/
|
|
2932
|
+
type TreeSelectionMode = "replace" | "toggle" | "extend";
|
|
2933
|
+
/**
|
|
2934
|
+
* Read the gesture from the event that carried it.
|
|
2935
|
+
*
|
|
2936
|
+
* @experimental
|
|
2937
|
+
*/
|
|
2938
|
+
declare function treeSelectionMode(modifiers: {
|
|
2939
|
+
shiftKey: boolean;
|
|
2940
|
+
metaKey: boolean;
|
|
2941
|
+
ctrlKey: boolean;
|
|
2942
|
+
}): TreeSelectionMode;
|
|
2943
|
+
/**
|
|
2944
|
+
* Whether a row is in the selection at all.
|
|
2945
|
+
*
|
|
2946
|
+
* A helper rather than an expression inside the render, so the multi-select
|
|
2947
|
+
* branch is one call there instead of a condition — a small edit to a large
|
|
2948
|
+
* function is what pushes it across a complexity threshold.
|
|
2949
|
+
*
|
|
2950
|
+
* `selectedIds` when the caller owns a set, the single id otherwise, so a
|
|
2951
|
+
* caller that has not adopted the set keeps exactly the behaviour it had.
|
|
2952
|
+
*
|
|
2953
|
+
* @experimental
|
|
2954
|
+
*/
|
|
2955
|
+
declare function isRowSelected(id: string, primary: string | null | undefined, selectedIds: readonly string[] | undefined): boolean;
|
|
2956
|
+
/** @experimental */
|
|
2957
|
+
interface TreeViewProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
2958
|
+
/** The roots of the tree. */
|
|
2959
|
+
nodes: readonly TreeNode[];
|
|
2960
|
+
/** Expanded node ids, if the caller owns them. */
|
|
2961
|
+
expandedIds?: readonly string[];
|
|
2962
|
+
/** Which ids start expanded when the caller does not own expansion. */
|
|
2963
|
+
defaultExpandedIds?: readonly string[];
|
|
2964
|
+
/** Called with the full next set whenever a branch opens or closes. */
|
|
2965
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
2966
|
+
/**
|
|
2967
|
+
* The selected node id, if the caller owns it.
|
|
2968
|
+
*
|
|
2969
|
+
* With `selectedIds` also supplied this is the PRIMARY — the row a detail
|
|
2970
|
+
* panel answers for. Drawn at a heavier weight so a reader can tell which
|
|
2971
|
+
* member of a multi-row selection the rest of the screen describes.
|
|
2972
|
+
*/
|
|
2973
|
+
selectedId?: string | null;
|
|
2974
|
+
/**
|
|
2975
|
+
* Every selected id, when the caller holds more than one.
|
|
2976
|
+
*
|
|
2977
|
+
* Additive: omit it and the tree behaves exactly as it did. Supplying it also
|
|
2978
|
+
* makes the tree announce itself as `aria-multiselectable`, which is why it
|
|
2979
|
+
* is a separate prop rather than inferred — a single-select tree claiming to
|
|
2980
|
+
* be multi-selectable is wrong in a way a screen-reader user acts on.
|
|
2981
|
+
*/
|
|
2982
|
+
selectedIds?: readonly string[];
|
|
2983
|
+
/** Which id starts selected when the caller does not own selection. */
|
|
2984
|
+
defaultSelectedId?: string | null;
|
|
2985
|
+
/** Called when a row is chosen, by pointer or by Enter. */
|
|
2986
|
+
onSelectedChange?: (id: string, mode: TreeSelectionMode) => void;
|
|
2987
|
+
/**
|
|
2988
|
+
* Names the tree for a screen reader. One of this or `aria-labelledby` is required: a tree
|
|
2989
|
+
* announced only as "tree" tells a user nothing about which one they are in.
|
|
2990
|
+
*/
|
|
2991
|
+
"aria-label"?: string;
|
|
2992
|
+
}
|
|
2993
|
+
/**
|
|
2994
|
+
* A virtualized tree.
|
|
2995
|
+
*
|
|
2996
|
+
* @experimental
|
|
2099
2997
|
*/
|
|
2100
|
-
declare
|
|
2101
|
-
|
|
2998
|
+
declare const TreeView: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<TreeViewProps> & React$1.RefAttributes<HTMLDivElement>>;
|
|
2102
2999
|
/**
|
|
2103
|
-
*
|
|
3000
|
+
* The assistive-technology attributes a single thumb can carry.
|
|
2104
3001
|
*
|
|
2105
|
-
*
|
|
2106
|
-
* Renders header, body, and footer skeleton bars inside a card.
|
|
2107
|
-
* Unified with EntryTable skeleton pattern for consistency across all tables.
|
|
3002
|
+
* @experimental
|
|
2108
3003
|
*/
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
3004
|
+
interface SliderThumbProps {
|
|
3005
|
+
/** The thumb's accessible name. */
|
|
3006
|
+
"aria-label"?: string;
|
|
3007
|
+
/** An element naming the thumb, when the name is already on screen. */
|
|
3008
|
+
"aria-labelledby"?: string;
|
|
3009
|
+
/**
|
|
3010
|
+
* What the value MEANS, when the number alone does not say it — "40
|
|
3011
|
+
* percent", "Medium". Announced in place of the raw number.
|
|
3012
|
+
*/
|
|
3013
|
+
"aria-valuetext"?: string;
|
|
3014
|
+
/** An element carrying help text for this thumb. */
|
|
3015
|
+
"aria-describedby"?: string;
|
|
2115
3016
|
}
|
|
2116
|
-
declare const TableSkeleton: react.FC<TableSkeletonProps>;
|
|
2117
|
-
|
|
2118
3017
|
/**
|
|
2119
|
-
*
|
|
3018
|
+
* The slider's props, mirroring the Radix root.
|
|
3019
|
+
*
|
|
3020
|
+
* @experimental
|
|
3021
|
+
*/
|
|
3022
|
+
type SliderProps = Omit<React$1.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>, "asChild"> & {
|
|
3023
|
+
/**
|
|
3024
|
+
* Assistive-technology attributes per thumb, in value order.
|
|
3025
|
+
*
|
|
3026
|
+
* The reason this exists at all: the focusable element with the `slider`
|
|
3027
|
+
* role is the THUMB, and none of these attributes are inherited from the
|
|
3028
|
+
* root. Anything a caller puts on the root is therefore announced by
|
|
3029
|
+
* nothing, and the thumbs are generated internally so they cannot be
|
|
3030
|
+
* reached any other way.
|
|
3031
|
+
*
|
|
3032
|
+
* Deliberately a curated set rather than the thumb's full prop type. This
|
|
3033
|
+
* is the surface assistive technology reads; opening it to arbitrary props
|
|
3034
|
+
* would let a caller replace the class names or the role the control
|
|
3035
|
+
* depends on, and every escape hatch in a design system eventually gets
|
|
3036
|
+
* used that way.
|
|
3037
|
+
*
|
|
3038
|
+
* Required for a RANGE: two thumbs sharing one name are announced
|
|
3039
|
+
* identically, so nothing says which end is held. A single thumb falls back
|
|
3040
|
+
* to the root's `aria-label`/`aria-labelledby`, so the one-thumb API stays
|
|
3041
|
+
* as documented.
|
|
3042
|
+
*/
|
|
3043
|
+
thumbs?: readonly SliderThumbProps[];
|
|
3044
|
+
};
|
|
3045
|
+
/**
|
|
3046
|
+
* A bounded numeric value chosen by dragging.
|
|
3047
|
+
*
|
|
3048
|
+
* @experimental
|
|
3049
|
+
*/
|
|
3050
|
+
declare const Slider: React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<SliderProps> & React$1.RefAttributes<React$1.ElementRef<typeof SliderPrimitive.Root>>>;
|
|
3051
|
+
/**
|
|
3052
|
+
* One shortcut and what it does.
|
|
3053
|
+
*
|
|
3054
|
+
* @experimental
|
|
3055
|
+
*/
|
|
3056
|
+
interface ShortcutBinding {
|
|
3057
|
+
/** The keys, as understood by `parseKeys` — `"mod+s"`, `"Escape"`, `"g d"`. */
|
|
3058
|
+
keys: string;
|
|
3059
|
+
/**
|
|
3060
|
+
* What this does, in words, for a shortcuts help panel. Required because an undiscoverable
|
|
3061
|
+
* shortcut helps only the person who wrote it.
|
|
3062
|
+
*/
|
|
3063
|
+
description: string;
|
|
3064
|
+
/** Runs when the shortcut fires. */
|
|
3065
|
+
run: (event: KeyboardEvent) => void;
|
|
3066
|
+
/** Checked at press time; a binding whose condition is false is skipped and passes the key on. */
|
|
3067
|
+
when?: () => boolean;
|
|
3068
|
+
/**
|
|
3069
|
+
* Whether this fires while the user is typing in a field.
|
|
3070
|
+
*
|
|
3071
|
+
* Defaults to true for bindings whose FIRST chord carries a non-shift modifier or is Escape,
|
|
3072
|
+
* and false otherwise — the rule nearly every application converges on. `mod+s` must save
|
|
3073
|
+
* mid-sentence and Escape must dismiss, while a bare `n` must be able to be the letter n.
|
|
3074
|
+
*
|
|
3075
|
+
* The first chord decides because it is the keystroke that has to be taken from the field.
|
|
3076
|
+
* `mod+k c` is a command from its opening chord, so its bare `c` completes it in an input. A
|
|
3077
|
+
* sequence that OPENS on a plain character cannot fire while typing whatever it ends with:
|
|
3078
|
+
* allowing `g Escape` would mean swallowing the `g` of every word containing one.
|
|
3079
|
+
*/
|
|
3080
|
+
whenTyping?: boolean;
|
|
3081
|
+
/** Whether to call `preventDefault()` when it fires. Defaults to true. */
|
|
3082
|
+
preventDefault?: boolean;
|
|
3083
|
+
}
|
|
3084
|
+
/**
|
|
3085
|
+
* How a layer behaves for keys it does not bind.
|
|
3086
|
+
*
|
|
3087
|
+
* @experimental
|
|
3088
|
+
*/
|
|
3089
|
+
interface ShortcutLayerOptions {
|
|
3090
|
+
/** Identifies the layer in diagnostics and in a help panel. */
|
|
3091
|
+
name: string;
|
|
3092
|
+
/** Precedence: deeper layers are offered keystrokes first. */
|
|
3093
|
+
depth: number;
|
|
3094
|
+
/**
|
|
3095
|
+
* Whether unmatched keys stop here instead of reaching layers beneath.
|
|
3096
|
+
*
|
|
3097
|
+
* The reason a drag can be interrupted safely: everything below is inert for as long as this
|
|
3098
|
+
* is set, so no other context can act on a keystroke aimed at this one.
|
|
3099
|
+
*/
|
|
3100
|
+
blocking?: boolean;
|
|
3101
|
+
/**
|
|
3102
|
+
* Sorted ABOVE depth, so a layer can outrank one nested deeper than itself.
|
|
3103
|
+
*
|
|
3104
|
+
* Depth alone cannot express a modal. A modal wants to sit above every ordinary layer, but the
|
|
3105
|
+
* host chooses how deeply its own shortcuts are scoped, so any depth a modal picks can be tied
|
|
3106
|
+
* or beaten by a scope the host nests one level further. Priority is the axis the host does not
|
|
3107
|
+
* control: ordinary layers leave it at 0 and a modal raises it.
|
|
3108
|
+
*
|
|
3109
|
+
* KNOWN LIMIT, stated so it is not discovered: layers at EQUAL priority still compare depth
|
|
3110
|
+
* before registration order. Two modals therefore stack by how deeply each is scoped rather
|
|
3111
|
+
* than by which opened last, so a modal opened later at a shallower depth can sit under one
|
|
3112
|
+
* opened earlier and nested deeper — while whatever renders them puts the newer on top.
|
|
3113
|
+
*
|
|
3114
|
+
* Fixing it needs the manager to record when a layer is ACTIVATED, which registration order
|
|
3115
|
+
* does not capture: `useShortcuts` registers once at mount and updates its options in place, so
|
|
3116
|
+
* a layer enabled later still carries its mount-time sequence. Not attempted here because
|
|
3117
|
+
* nothing reaches it yet: the layers that raise priority are modal HOLDS, and a hold blocks the
|
|
3118
|
+
* keystroke that would open the next one — the command palette cannot be summoned over a dialog
|
|
3119
|
+
* that is already holding, so two of them are not both active for a keystroke to be resolved
|
|
3120
|
+
* between.
|
|
3121
|
+
*/
|
|
3122
|
+
priority?: number;
|
|
3123
|
+
/** Whether the layer participates at all. A disabled layer neither matches nor blocks. */
|
|
3124
|
+
enabled?: boolean;
|
|
3125
|
+
}
|
|
3126
|
+
/**
|
|
3127
|
+
* A layer's registration, held by whoever created it.
|
|
2120
3128
|
*
|
|
2121
|
-
*
|
|
3129
|
+
* @experimental
|
|
3130
|
+
*/
|
|
3131
|
+
interface ShortcutRegistration {
|
|
3132
|
+
/** Replace this layer's bindings and options without changing its precedence. */
|
|
3133
|
+
update: (bindings: readonly ShortcutBinding[], options: ShortcutLayerOptions) => void;
|
|
3134
|
+
/** Remove the layer. */
|
|
3135
|
+
dispose: () => void;
|
|
3136
|
+
}
|
|
3137
|
+
/**
|
|
3138
|
+
* Options for creating a manager.
|
|
2122
3139
|
*
|
|
2123
|
-
* @
|
|
2124
|
-
|
|
3140
|
+
* @experimental
|
|
3141
|
+
*/
|
|
3142
|
+
interface ShortcutManagerOptions {
|
|
3143
|
+
/** Whether `mod` means Command. Detected from the platform when omitted. */
|
|
3144
|
+
isApple?: boolean;
|
|
3145
|
+
/** How long a partially typed sequence waits for its next key, in milliseconds. */
|
|
3146
|
+
sequenceTimeoutMs?: number;
|
|
3147
|
+
/** Clock source, for tests that need to control sequence expiry. */
|
|
3148
|
+
now?: () => number;
|
|
3149
|
+
}
|
|
3150
|
+
/**
|
|
3151
|
+
* A shortcut manager: the registry, the matcher, and the one listener.
|
|
3152
|
+
*
|
|
3153
|
+
* @experimental
|
|
3154
|
+
*/
|
|
3155
|
+
interface ShortcutManager {
|
|
3156
|
+
/** Add a layer. */
|
|
3157
|
+
register: (bindings: readonly ShortcutBinding[], options: ShortcutLayerOptions) => ShortcutRegistration;
|
|
3158
|
+
/**
|
|
3159
|
+
* Offer a keystroke to the stack. Returns whether it was consumed.
|
|
3160
|
+
*
|
|
3161
|
+
* Public so the behaviour can be tested without a DOM, and so a host that already owns its
|
|
3162
|
+
* event plumbing can drive the manager itself.
|
|
3163
|
+
*/
|
|
3164
|
+
handle: (event: KeyboardEvent) => boolean;
|
|
3165
|
+
/** Install the single listener on a target, returning a function that removes it. */
|
|
3166
|
+
attach: (target: Pick<EventTarget, "addEventListener" | "removeEventListener">) => () => void;
|
|
3167
|
+
/**
|
|
3168
|
+
* Every active binding, most-precedent layer first, for a shortcuts help panel.
|
|
3169
|
+
*
|
|
3170
|
+
* The same array is returned until the layer stack changes, so it is safe to use as an external
|
|
3171
|
+
* store snapshot without re-rendering on every read.
|
|
3172
|
+
*/
|
|
3173
|
+
activeBindings: () => readonly ActiveShortcut[];
|
|
3174
|
+
/**
|
|
3175
|
+
* Watch for changes to the layer stack.
|
|
3176
|
+
*
|
|
3177
|
+
* A help panel mounting alongside the components that register shortcuts would otherwise read
|
|
3178
|
+
* BEFORE their effects run and show nothing, with no later render to correct it.
|
|
3179
|
+
*/
|
|
3180
|
+
subscribe: (onChange: () => void) => () => void;
|
|
3181
|
+
}
|
|
3182
|
+
/**
|
|
3183
|
+
* A binding as presented to a help panel, with the layer it came from.
|
|
2125
3184
|
*
|
|
2126
|
-
* @
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
3185
|
+
* @experimental
|
|
3186
|
+
*/
|
|
3187
|
+
interface ActiveShortcut {
|
|
3188
|
+
keys: string;
|
|
3189
|
+
description: string;
|
|
3190
|
+
layer: string;
|
|
3191
|
+
}
|
|
3192
|
+
/**
|
|
3193
|
+
* Create a shortcut manager.
|
|
2133
3194
|
*
|
|
2134
|
-
*
|
|
2135
|
-
* const columns: Column<User>[] = [
|
|
2136
|
-
* {
|
|
2137
|
-
* key: "name",
|
|
2138
|
-
* label: "Name",
|
|
2139
|
-
* // value is inferred as string, not string | number
|
|
2140
|
-
* render: (value, user) => <strong>{value}</strong>
|
|
2141
|
-
* },
|
|
2142
|
-
* {
|
|
2143
|
-
* key: "age",
|
|
2144
|
-
* label: "Age",
|
|
2145
|
-
* // value is inferred as number, not string | number
|
|
2146
|
-
* render: (value) => `${value} years old`
|
|
2147
|
-
* }
|
|
2148
|
-
* ];
|
|
2149
|
-
* ```
|
|
3195
|
+
* @experimental
|
|
2150
3196
|
*/
|
|
2151
|
-
|
|
2152
|
-
/** Unique key for the column (must match a property in T) */
|
|
2153
|
-
key: K;
|
|
2154
|
-
/** Display label for the column header */
|
|
2155
|
-
label: react.ReactNode;
|
|
2156
|
-
/** Optional custom renderer for cell content with type-safe value */
|
|
2157
|
-
render?: (value: T[K], item: T) => react.ReactNode;
|
|
2158
|
-
/** Hide column on mobile card view (optional, default: false) */
|
|
2159
|
-
hideOnMobile?: boolean;
|
|
2160
|
-
/** Hide the label on mobile card view (optional, default: false) */
|
|
2161
|
-
hideLabelOnMobile?: boolean;
|
|
2162
|
-
/** Optional custom className for the table header cell */
|
|
2163
|
-
headerClassName?: string;
|
|
2164
|
-
/** Optional custom className for the table body cell */
|
|
2165
|
-
cellClassName?: string;
|
|
2166
|
-
};
|
|
3197
|
+
export declare function createShortcutManager(options?: ShortcutManagerOptions): ShortcutManager;
|
|
2167
3198
|
/**
|
|
2168
|
-
* Props for
|
|
2169
|
-
*
|
|
2170
|
-
* @
|
|
2171
|
-
*/
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
/** Optional custom className for the container */
|
|
2184
|
-
className?: string;
|
|
2185
|
-
/** Optional empty state message */
|
|
2186
|
-
emptyMessage?: string;
|
|
2187
|
-
/** Optional ARIA label for the table (improves screen reader experience) */
|
|
2188
|
-
ariaLabel?: string;
|
|
2189
|
-
/** Optional custom className for the internal desktop table wrapper */
|
|
2190
|
-
tableWrapperClassName?: string;
|
|
2191
|
-
/** Optional footer content rendered inside the table card (e.g. Pagination) */
|
|
2192
|
-
footer?: react.ReactNode;
|
|
2193
|
-
};
|
|
3199
|
+
* Props for {@link ShortcutProvider}.
|
|
3200
|
+
*
|
|
3201
|
+
* @experimental
|
|
3202
|
+
*/
|
|
3203
|
+
interface ShortcutProviderProps extends ShortcutManagerOptions {
|
|
3204
|
+
children?: React$1.ReactNode;
|
|
3205
|
+
/**
|
|
3206
|
+
* Where the listener is installed. Defaults to `document`.
|
|
3207
|
+
*
|
|
3208
|
+
* The bubble phase is deliberate: a component that handles its own keys and calls
|
|
3209
|
+
* `stopPropagation` wins without knowing this exists, because React attaches its handlers
|
|
3210
|
+
* below `document`.
|
|
3211
|
+
*/
|
|
3212
|
+
target?: Pick<EventTarget, "addEventListener" | "removeEventListener"> | null;
|
|
3213
|
+
}
|
|
2194
3214
|
/**
|
|
2195
|
-
*
|
|
3215
|
+
* Installs the application's one keydown listener and roots the layer stack.
|
|
3216
|
+
*
|
|
3217
|
+
* @experimental
|
|
2196
3218
|
*/
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
3219
|
+
export declare function ShortcutProvider({ children, target, ...managerOptions }: ShortcutProviderProps): React$1.JSX.Element;
|
|
3220
|
+
/**
|
|
3221
|
+
* Raises the precedence of everything inside it by one level.
|
|
3222
|
+
*
|
|
3223
|
+
* @experimental
|
|
3224
|
+
*/
|
|
3225
|
+
export declare function ShortcutScope({ children }: {
|
|
3226
|
+
children?: React$1.ReactNode;
|
|
3227
|
+
}): React$1.JSX.Element;
|
|
3228
|
+
/**
|
|
3229
|
+
* Options for {@link useShortcuts}, minus the depth, which comes from the tree.
|
|
3230
|
+
*
|
|
3231
|
+
* @experimental
|
|
3232
|
+
*/
|
|
3233
|
+
interface UseShortcutsOptions {
|
|
3234
|
+
/** Identifies this layer in a help panel. */
|
|
3235
|
+
name: string;
|
|
3236
|
+
/** Whether the layer participates. A disabled layer neither matches nor blocks. */
|
|
3237
|
+
enabled?: boolean;
|
|
3238
|
+
/**
|
|
3239
|
+
* Whether unmatched keys stop here rather than reaching layers beneath.
|
|
3240
|
+
*
|
|
3241
|
+
* Set this while a drag or a modal interaction owns the keyboard.
|
|
3242
|
+
*/
|
|
3243
|
+
blocking?: boolean;
|
|
3244
|
+
/**
|
|
3245
|
+
* Sorted ABOVE depth, so a layer can outrank one nested deeper than itself.
|
|
3246
|
+
*
|
|
3247
|
+
* For a modal, whose hold must not be tied or beaten by a host scoping its own shortcuts one
|
|
3248
|
+
* level further. Ordinary layers leave this alone.
|
|
3249
|
+
*/
|
|
3250
|
+
priority?: number;
|
|
2209
3251
|
}
|
|
2210
|
-
declare function PortalProvider({ container, children }: PortalProviderProps): react_jsx_runtime.JSX.Element;
|
|
2211
|
-
declare function usePortalContainer(): HTMLElement | undefined;
|
|
2212
|
-
|
|
2213
3252
|
/**
|
|
2214
|
-
*
|
|
3253
|
+
* Register shortcuts for as long as the calling component is mounted.
|
|
2215
3254
|
*
|
|
2216
|
-
*
|
|
2217
|
-
*
|
|
3255
|
+
* The bindings array may be rebuilt on every render; it is re-read in place rather than
|
|
3256
|
+
* re-registered, so inline closures are fine and the layer keeps its position in the stack.
|
|
2218
3257
|
*
|
|
2219
|
-
* @
|
|
2220
|
-
* ```typescript
|
|
2221
|
-
* cn('px-2 py-1', 'px-4') // => 'py-1 px-4'
|
|
2222
|
-
* cn('text-red-500', condition && 'text-blue-500')
|
|
2223
|
-
* ```
|
|
3258
|
+
* @experimental
|
|
2224
3259
|
*/
|
|
2225
|
-
declare function
|
|
2226
|
-
|
|
3260
|
+
export declare function useShortcuts(bindings: readonly ShortcutBinding[], options: UseShortcutsOptions): void;
|
|
2227
3261
|
/**
|
|
2228
|
-
*
|
|
2229
|
-
*
|
|
2230
|
-
*
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
*
|
|
2235
|
-
*
|
|
2236
|
-
*
|
|
2237
|
-
*
|
|
2238
|
-
*
|
|
2239
|
-
*
|
|
2240
|
-
*
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
3262
|
+
* The manager itself, for a help panel that lists what is currently bound.
|
|
3263
|
+
*
|
|
3264
|
+
* @experimental
|
|
3265
|
+
*/
|
|
3266
|
+
export declare function useShortcutManager(): ShortcutManager;
|
|
3267
|
+
/**
|
|
3268
|
+
* The shortcuts currently in effect, most precedent first.
|
|
3269
|
+
*
|
|
3270
|
+
* SUBSCRIBED rather than read once. A help panel mounting alongside the components that register
|
|
3271
|
+
* shortcuts reads before their effects have run, so a one-time read returns an empty list and no
|
|
3272
|
+
* later render corrects it — the panel simply shows nothing. The same applies whenever a layer is
|
|
3273
|
+
* enabled, disabled or replaced while the panel is open.
|
|
3274
|
+
*
|
|
3275
|
+
* The manager returns the same array until its stack changes, so this re-renders when the
|
|
3276
|
+
* shortcuts change and not on every read.
|
|
3277
|
+
*
|
|
3278
|
+
* @experimental
|
|
3279
|
+
*/
|
|
3280
|
+
export declare function useActiveShortcuts(): readonly ActiveShortcut[];
|
|
3281
|
+
/**
|
|
3282
|
+
* A layout effect in the browser, a plain effect where there is no DOM.
|
|
3283
|
+
*
|
|
3284
|
+
* These components are client code, but a consumer may still PRERENDER them,
|
|
3285
|
+
* and React warns that `useLayoutEffect` does nothing on the server. Layout
|
|
3286
|
+
* timing is what the browser needs wherever an effect has to be settled before
|
|
3287
|
+
* anything else can observe it — a registration that must exist before the
|
|
3288
|
+
* first frame, or a native listener that must be the current one before the
|
|
3289
|
+
* next event reaches it. Neither effect runs during a server render, so
|
|
3290
|
+
* choosing between them by environment loses nothing and silences a warning
|
|
3291
|
+
* that reports no real problem.
|
|
3292
|
+
*
|
|
3293
|
+
* Published rather than kept beside its first caller, because a second one
|
|
3294
|
+
* arrived: two spellings of this choice would drift the first time either
|
|
3295
|
+
* learned something about a new environment. A third now lives in another
|
|
3296
|
+
* package, which is why it leaves this one through the barrel.
|
|
3297
|
+
*
|
|
3298
|
+
* @experimental
|
|
3299
|
+
*/
|
|
3300
|
+
export declare const useIsomorphicLayoutEffect: typeof React$1.useLayoutEffect;
|
|
3301
|
+
/**
|
|
3302
|
+
* Parsing and matching for keyboard shortcut specifications.
|
|
3303
|
+
*
|
|
3304
|
+
* A spec is written the way it is spoken: `"mod+s"`, `"Escape"`, `"shift+alt+f"`, and — for a
|
|
3305
|
+
* sequence — `"g d"`, meaning `g` then `d`. Steps are separated by spaces; within a step,
|
|
3306
|
+
* modifiers are joined to the key with `+`.
|
|
3307
|
+
*
|
|
3308
|
+
* The space bar is written `"Space"`, because the character the browser reports for it is `" "`
|
|
3309
|
+
* and a spec split on whitespace has no way to carry that.
|
|
3310
|
+
*
|
|
3311
|
+
* **`mod` is the point of this module.** It resolves to Command on Apple platforms and Control
|
|
3312
|
+
* everywhere else, so a binding is written once. Writing `ctrl` or `meta` explicitly is still
|
|
3313
|
+
* possible and then means exactly that, which is what lets a platform-specific binding coexist
|
|
3314
|
+
* with a portable one — a distinction lost by any implementation that treats the two as
|
|
3315
|
+
* interchangeable.
|
|
3316
|
+
*
|
|
3317
|
+
* @module lib/shortcuts/key-spec
|
|
3318
|
+
*/
|
|
3319
|
+
/**
|
|
3320
|
+
* One keystroke: a key plus the modifier state required with it.
|
|
3321
|
+
*
|
|
3322
|
+
* @experimental
|
|
3323
|
+
*/
|
|
3324
|
+
interface KeyChord {
|
|
3325
|
+
/** The `KeyboardEvent.key` value, normalized to lower case for single characters. */
|
|
3326
|
+
readonly key: string;
|
|
3327
|
+
/** Command on Apple platforms, Control elsewhere. */
|
|
3328
|
+
readonly mod: boolean;
|
|
3329
|
+
readonly ctrl: boolean;
|
|
3330
|
+
readonly meta: boolean;
|
|
3331
|
+
readonly alt: boolean;
|
|
3332
|
+
readonly shift: boolean;
|
|
3333
|
+
}
|
|
3334
|
+
/**
|
|
3335
|
+
* A shortcut: one chord, or several pressed in order.
|
|
3336
|
+
*
|
|
3337
|
+
* @experimental
|
|
3338
|
+
*/
|
|
3339
|
+
type KeySequence = readonly KeyChord[];
|
|
3340
|
+
/**
|
|
3341
|
+
* Whether shift is part of what a caller can meaningfully require for this key.
|
|
3342
|
+
*
|
|
3343
|
+
* On a US layout `?` is already Shift+/, so the browser reports `key: "?"` with `shiftKey: true`.
|
|
3344
|
+
* A spec of `"?"` must therefore match an event that carries shift, or the most natural way to
|
|
3345
|
+
* write the binding would never fire. For letters and named keys the opposite holds: `"s"` must
|
|
3346
|
+
* NOT match Shift+S, or a binding would swallow a keystroke its author never claimed.
|
|
3347
|
+
*
|
|
3348
|
+
* The dividing line is whether the character itself already encodes the shift.
|
|
3349
|
+
*/
|
|
3350
|
+
declare function shiftIsMeaningful(key: string): boolean;
|
|
3351
|
+
/**
|
|
3352
|
+
* Parse a spec into the sequence of chords it describes.
|
|
3353
|
+
*
|
|
3354
|
+
* @param spec - For example `"mod+s"`, `"Escape"`, or `"g d"`.
|
|
3355
|
+
* @throws If the spec is empty, or a step names modifiers but no key.
|
|
3356
|
+
*
|
|
3357
|
+
* @experimental
|
|
3358
|
+
*/
|
|
3359
|
+
export declare function parseKeys(spec: string): KeySequence;
|
|
3360
|
+
/**
|
|
3361
|
+
* The modifier state an event carries, with `mod` already resolved for the platform.
|
|
3362
|
+
*
|
|
3363
|
+
* @experimental
|
|
3364
|
+
*/
|
|
3365
|
+
interface ModifierState {
|
|
3366
|
+
readonly ctrlKey: boolean;
|
|
3367
|
+
readonly metaKey: boolean;
|
|
3368
|
+
readonly altKey: boolean;
|
|
3369
|
+
readonly shiftKey: boolean;
|
|
3370
|
+
/** Optional, so a caller driving the matcher by hand need not synthesise one. */
|
|
3371
|
+
readonly getModifierState?: (key: string) => boolean;
|
|
3372
|
+
}
|
|
3373
|
+
/**
|
|
3374
|
+
* Whether a chord describes the given keystroke.
|
|
3375
|
+
*
|
|
3376
|
+
* Modifiers are matched EXACTLY rather than as a minimum: a binding for `s` must not fire on
|
|
3377
|
+
* `mod+s`, which is a different shortcut and very often a destructive one.
|
|
3378
|
+
*
|
|
3379
|
+
* @param chord - The chord to test.
|
|
3380
|
+
* @param key - The event's `key`.
|
|
3381
|
+
* @param state - The event's modifier flags.
|
|
3382
|
+
* @param isApple - Whether `mod` should resolve to Command rather than Control.
|
|
3383
|
+
*
|
|
3384
|
+
* @experimental
|
|
3385
|
+
*/
|
|
3386
|
+
export declare function chordMatches(chord: KeyChord, key: string, state: ModifierState, isApple: boolean): boolean;
|
|
3387
|
+
/**
|
|
3388
|
+
* Whether this platform uses Command as its primary modifier.
|
|
3389
|
+
*
|
|
3390
|
+
* Reads the modern `userAgentData` hint before the deprecated `navigator.platform`, and answers
|
|
3391
|
+
* `false` when neither exists — the non-Apple default is also the correct answer for a server
|
|
3392
|
+
* render, where no keystroke can arrive.
|
|
3393
|
+
*
|
|
3394
|
+
* @experimental
|
|
3395
|
+
*/
|
|
3396
|
+
export declare function detectApplePlatform(): boolean;
|
|
3397
|
+
/**
|
|
3398
|
+
* How wide a field's CONTROL may grow.
|
|
3399
|
+
*
|
|
3400
|
+
* Named rather than measured so a page cannot invent a one-off width, which is
|
|
3401
|
+
* how the eight admin forms diverged. The caps read from custom properties with
|
|
3402
|
+
* literal fallbacks, so a theme can retune them centrally without this file
|
|
3403
|
+
* changing and without a page overriding them locally.
|
|
3404
|
+
* @experimental
|
|
3405
|
+
*/
|
|
3406
|
+
type FieldWidth = "half" | "full" | "fill";
|
|
3407
|
+
/**
|
|
3408
|
+
* Where a field's label and help stand relative to its control.
|
|
3409
|
+
* @experimental
|
|
3410
|
+
*/
|
|
3411
|
+
type FieldLayout = "stacked" | "row";
|
|
3412
|
+
/**
|
|
3413
|
+
* The wiring `FieldShell` computes for its control: the id to attach, the
|
|
3414
|
+
* composed `aria-describedby` (`undefined` when nothing is rendered to point
|
|
3415
|
+
* at), and whether a rendered `error` forces the control invalid (`undefined`
|
|
3416
|
+
* when there is no error to force one way or the other).
|
|
3417
|
+
*
|
|
3418
|
+
* A render-function `children` (see `FieldShellProps`) receives exactly this
|
|
3419
|
+
* object — the SAME computation the element-clone path derives its
|
|
3420
|
+
* `cloneElement` overrides from — so a caller wiring a compound control (a
|
|
3421
|
+
* Radix `Select`'s trigger, for example) gets precisely the values the
|
|
3422
|
+
* simple, single-element case would have applied.
|
|
3423
|
+
* @experimental
|
|
3424
|
+
*/
|
|
3425
|
+
interface FieldShellRenderProps {
|
|
3426
|
+
id: string;
|
|
3427
|
+
describedBy: string | undefined;
|
|
3428
|
+
invalid: boolean | undefined;
|
|
3429
|
+
}
|
|
3430
|
+
/** @experimental */
|
|
3431
|
+
interface FieldShellProps {
|
|
3432
|
+
label?: React.ReactNode;
|
|
3433
|
+
/** Helper text under the control. Rendered only when present. */
|
|
3434
|
+
description?: React.ReactNode;
|
|
3435
|
+
/** Validation message under the control. Rendered only when present. */
|
|
3436
|
+
error?: React.ReactNode;
|
|
3437
|
+
/**
|
|
3438
|
+
* Defaults to "half" in the stacked layout, where most admin inputs are
|
|
3439
|
+
* short values, and to "fill" in the row layout, whose right column is
|
|
3440
|
+
* already the control's measure.
|
|
3441
|
+
*/
|
|
3442
|
+
width?: FieldWidth;
|
|
3443
|
+
/**
|
|
3444
|
+
* `stacked` (the default): the label above the control, the help under it.
|
|
3445
|
+
* `row`: the settings row, with the label and its help in a left column and
|
|
3446
|
+
* the control in a right one, stacking on a narrow screen. Both lay out the
|
|
3447
|
+
* same wiring; only where each part stands differs.
|
|
3448
|
+
*/
|
|
3449
|
+
layout?: FieldLayout;
|
|
3450
|
+
htmlFor?: string;
|
|
3451
|
+
className?: string;
|
|
3452
|
+
/**
|
|
3453
|
+
* Either a single element to clone, or a function that receives the
|
|
3454
|
+
* computed wiring and applies it itself.
|
|
3455
|
+
*
|
|
3456
|
+
* The element form is `FieldShell` cloning it with `cloneElement` to
|
|
3457
|
+
* attach the id, `aria-describedby` and `aria-invalid` it computes —
|
|
3458
|
+
* unchanged from before, and still the right choice for an atomic control
|
|
3459
|
+
* (`Input`, `Textarea`, `Switch`) that spreads its own props onto a real
|
|
3460
|
+
* DOM node. Typing this branch as `ReactNode` would let a composite field
|
|
3461
|
+
* (two inputs with a unit between them, for example) compile and then
|
|
3462
|
+
* crash on mount, so it stays a single `ReactElement` — wrap several
|
|
3463
|
+
* elements in one real element, a `<div>`, not a `<Fragment>`: a Fragment
|
|
3464
|
+
* forwards none of those props to what is inside it.
|
|
3465
|
+
*
|
|
3466
|
+
* The function form exists for a compound control built on a Radix `Root`
|
|
3467
|
+
* (`Select`, and by the same shape `RadioGroup`): `Root` destructures a
|
|
3468
|
+
* fixed, named prop list and never spreads the remainder, so `id` handed
|
|
3469
|
+
* to it via `cloneElement` is silently dropped rather than reaching the
|
|
3470
|
+
* actual focusable element two levels down (`Select` > `SelectTrigger` >
|
|
3471
|
+
* `SelectValue`). A render function is called with `FieldShellRenderProps`
|
|
3472
|
+
* and applies `id`/`describedBy`/`invalid` to whichever nested element is
|
|
3473
|
+
* the real control, instead of relying on a single top-level clone that
|
|
3474
|
+
* can never reach it.
|
|
3475
|
+
*/
|
|
3476
|
+
children: React.ReactElement | ((field: FieldShellRenderProps) => React.ReactNode);
|
|
3477
|
+
}
|
|
3478
|
+
/** @experimental */
|
|
3479
|
+
interface FormActionsProps {
|
|
3480
|
+
/**
|
|
3481
|
+
* Whether the form has unsaved changes. Supplied by the page from the form
|
|
3482
|
+
* state that already tracks it; never computed here.
|
|
3483
|
+
*/
|
|
3484
|
+
dirty?: boolean;
|
|
3485
|
+
/**
|
|
3486
|
+
* What the bar says while `dirty` is true, in place of "You have unsaved
|
|
3487
|
+
* changes": a bar committing several records at once says what changed,
|
|
3488
|
+
* such as "1 page changed". Like `dirty`, the page states it from the state
|
|
3489
|
+
* that already knows; the bar never counts anything.
|
|
3490
|
+
*/
|
|
3491
|
+
message?: React.ReactNode;
|
|
3492
|
+
className?: string;
|
|
3493
|
+
children: React.ReactNode;
|
|
3494
|
+
}
|
|
3495
|
+
/** @experimental */
|
|
3496
|
+
export declare function FieldShell({ label, description, error, width, layout, htmlFor, className, children }: FieldShellProps): JSX.Element;
|
|
3497
|
+
/** @experimental */
|
|
3498
|
+
interface FieldRowProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
3499
|
+
/**
|
|
3500
|
+
* The left column: the row's label and any help under it, already rendered.
|
|
3501
|
+
* A node rather than a string because who names the control differs by
|
|
3502
|
+
* caller — a `<label for>` for one control, a `<span>` a group points
|
|
3503
|
+
* `aria-labelledby` at for several — and that choice is the caller's.
|
|
3504
|
+
*/
|
|
3505
|
+
aside: ReactNode;
|
|
3506
|
+
/** The right column: the control, or the group of controls. */
|
|
3507
|
+
children: ReactNode;
|
|
3508
|
+
}
|
|
3509
|
+
/**
|
|
3510
|
+
* The two-column settings row: label and help on the left, the control on the
|
|
3511
|
+
* right, stacking into one column on a narrow screen.
|
|
3512
|
+
*
|
|
3513
|
+
* Geometry only. It owns the grid and nothing about naming, so the rows that
|
|
3514
|
+
* differ in how they label their control — `FieldShell`'s row layout, and the
|
|
3515
|
+
* admin's form-bound and grouped settings rows — all draw this one grid rather
|
|
3516
|
+
* than three copies of it that could drift apart.
|
|
3517
|
+
*
|
|
3518
|
+
* It applies no vertical padding: `FormSection` sets the rhythm between its
|
|
3519
|
+
* rows, and a row that padded itself as well would double it.
|
|
3520
|
+
* @experimental
|
|
3521
|
+
*/
|
|
3522
|
+
export declare function FieldRow({ aside, children, className, ...props }: FieldRowProps): JSX.Element;
|
|
3523
|
+
/** @experimental */
|
|
3524
|
+
interface FormSectionProps {
|
|
3525
|
+
/** Short label above the card, rendered uppercase. */
|
|
3526
|
+
label: string;
|
|
3527
|
+
/** Optional sentence under the label. */
|
|
3528
|
+
description?: React$1.ReactNode;
|
|
3529
|
+
className?: string;
|
|
3530
|
+
children: React$1.ReactNode;
|
|
3531
|
+
}
|
|
3532
|
+
/**
|
|
3533
|
+
* A labelled card holding a group of fields.
|
|
3534
|
+
*
|
|
3535
|
+
* Composes `Card` rather than hand-rolling its own border and background, so
|
|
3536
|
+
* a section carries the CONTAINER radius tier `Card` already defines instead
|
|
3537
|
+
* of a second, drifting copy of the same chrome. There is deliberately no
|
|
3538
|
+
* footer slot. A form commits as one document, so its action belongs to the
|
|
3539
|
+
* page rather than to a section.
|
|
3540
|
+
* @experimental
|
|
3541
|
+
*/
|
|
3542
|
+
export declare function FormSection({ label, description, className, children }: FormSectionProps): JSX.Element;
|
|
3543
|
+
/**
|
|
3544
|
+
* One action bar per form, at the end of the page's measure.
|
|
3545
|
+
*
|
|
3546
|
+
* A form commits as a single document, so there is one place to commit it. The
|
|
3547
|
+
* dirty flag arrives from the page because the form state already answers that
|
|
3548
|
+
* question, and a second implementation of it here would disagree with the
|
|
3549
|
+
* first as soon as either changed.
|
|
3550
|
+
* @experimental
|
|
3551
|
+
*/
|
|
3552
|
+
export declare function FormActions({ dirty, message, className, children }: FormActionsProps): JSX.Element;
|
|
3553
|
+
/** @experimental */
|
|
3554
|
+
interface PageShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
3555
|
+
/**
|
|
3556
|
+
* Which measure the content column is bounded to. `full` removes the cap so
|
|
3557
|
+
* the column takes whatever the panel gives it, while KEEPING the gutter — a
|
|
3558
|
+
* full-width page is still inset from the panel's edge.
|
|
3559
|
+
*/
|
|
3560
|
+
width?: "form" | "wide" | "full";
|
|
3561
|
+
/**
|
|
3562
|
+
* Where a bounded column sits on a wide screen. `start` (the default) keeps
|
|
3563
|
+
* it under the page's left edge, where the header, the panel and every list
|
|
3564
|
+
* begin, so moving between a list and its form shifts nothing sideways.
|
|
3565
|
+
* `center` balances it between equal gutters. A `full` column fills the row
|
|
3566
|
+
* either way.
|
|
3567
|
+
*/
|
|
3568
|
+
align?: "start" | "center";
|
|
3569
|
+
}
|
|
3570
|
+
/**
|
|
3571
|
+
* What each named width resolves to, owned here because this is what applies it.
|
|
3572
|
+
*
|
|
3573
|
+
* Declared as a lookup rather than branched at the call site so the three arms
|
|
3574
|
+
* are one list. A `switch` here would let a fourth width be added to the type
|
|
3575
|
+
* and forgotten in the mapping, which the checker cannot see through a
|
|
3576
|
+
* `default` arm.
|
|
3577
|
+
*
|
|
3578
|
+
* Exported because a caller whose CONTENT carries the measure needs the same
|
|
3579
|
+
* value as a length, and the alternative is a second table naming the same
|
|
3580
|
+
* tokens — which drifts silently, since both look correct beside their own
|
|
3581
|
+
* neighbours. Reading it here means there is one answer rather than two that
|
|
3582
|
+
* agree today.
|
|
3583
|
+
*
|
|
3584
|
+
* @experimental
|
|
3585
|
+
*/
|
|
3586
|
+
export declare const SHELL_MEASURE: Record<NonNullable<PageShellProps["width"]>, string>;
|
|
3587
|
+
/**
|
|
3588
|
+
* The page's inset and measure, owned in one place and spent as GRID COLUMNS.
|
|
3589
|
+
*
|
|
3590
|
+
* This replaces a pairing in which an outer container padded the panel and an
|
|
3591
|
+
* inner one padded again while capping the width. That shape had three
|
|
3592
|
+
* defects, and all three are structural rather than cosmetic:
|
|
3593
|
+
*
|
|
3594
|
+
* - The two insets ADDED, because padding is not something a descendant can
|
|
3595
|
+
* cancel. Measured on the settings page, the header sat at x=360 and the
|
|
3596
|
+
* form card at x=384 — a 24px disagreement between two elements that are
|
|
3597
|
+
* supposed to share a left edge. Here the inset is a column, so there is one
|
|
3598
|
+
* declaration and no second site to disagree with it.
|
|
3599
|
+
* - A measure applied INSIDE a form component lets anything the page renders
|
|
3600
|
+
* beside that form escape it. With the page owning the shell, a sibling is
|
|
3601
|
+
* inside the measure by default and leaves it only by saying `Bleed`.
|
|
3602
|
+
* - Centring by `mx-auto` on a max-width box does nothing at panel widths
|
|
3603
|
+
* where the cap does not bind. Here the two outer tracks are equal and
|
|
3604
|
+
* flexible, so the content column is centred at every width and no
|
|
3605
|
+
* `justify-content` is declared — with flexible tracks the grid fills its
|
|
3606
|
+
* container and there is no free space for one to distribute.
|
|
3607
|
+
*
|
|
3608
|
+
* Vertical padding stays ordinary `padding-block`: it is not in tension with
|
|
3609
|
+
* the columns, and keeping it here means one component answers the whole of
|
|
3610
|
+
* "how far is content from the panel's edge".
|
|
3611
|
+
* @experimental
|
|
3612
|
+
*/
|
|
3613
|
+
export declare const PageShell: ForwardRefExoticComponent<PropsWithoutRef<PageShellProps> & RefAttributes<HTMLDivElement>>;
|
|
3614
|
+
/** @experimental */
|
|
3615
|
+
type BleedProps = HTMLAttributes<HTMLDivElement>;
|
|
3616
|
+
/**
|
|
3617
|
+
* Opts one child out of the measure, edge to edge across the shell's gutter.
|
|
3618
|
+
*
|
|
3619
|
+
* The sanctioned form of something that previously only happened by accident.
|
|
3620
|
+
* A wide data table, a delivery log or a toolbar declares that it wants the
|
|
3621
|
+
* full panel, so a reviewer can see the intent — and, just as usefully, a block
|
|
3622
|
+
* that is merely in the wrong place no longer LOOKS like a deliberate
|
|
3623
|
+
* full-bleed.
|
|
3624
|
+
*
|
|
3625
|
+
* Valid only as a DIRECT child of `PageShell`. The `full-start`/`full-end`
|
|
3626
|
+
* lines are named on the shell's own grid, so they are in scope for its
|
|
3627
|
+
* children and nowhere else; nested inside a `FormSection` this renders a plain
|
|
3628
|
+
* block and the `grid-column` is inert. That is a real constraint rather than a
|
|
3629
|
+
* stylistic preference, and `page-shell.test.tsx` pins both halves: that a
|
|
3630
|
+
* `Bleed` rendered directly under the shell is its child, and that one nested a
|
|
3631
|
+
* level deeper does NOT receive the full column.
|
|
3632
|
+
*
|
|
3633
|
+
* It forwards its ref and any div attributes for the same reason: a consumer
|
|
3634
|
+
* cannot reach for the usual remedy of wrapping it, because a wrapper is
|
|
3635
|
+
* precisely what makes it stop working.
|
|
3636
|
+
* @experimental
|
|
3637
|
+
*/
|
|
3638
|
+
export declare const Bleed: ForwardRefExoticComponent<PropsWithoutRef<BleedProps> & RefAttributes<HTMLDivElement>>;
|
|
3639
|
+
/** @experimental */
|
|
3640
|
+
interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
3641
|
+
/** The page's name, rendered as its `h1`. */
|
|
3642
|
+
title: string;
|
|
3643
|
+
/**
|
|
3644
|
+
* A sentence under the title. A `ReactNode` rather than a string because a
|
|
3645
|
+
* description carrying a link or an inline code span is ordinary here, and
|
|
3646
|
+
* typing it narrowly would push those pages back to hand-rolling the header.
|
|
3647
|
+
*/
|
|
3648
|
+
description?: ReactNode;
|
|
3649
|
+
/** The trail above the title. The page supplies it; this only places it. */
|
|
3650
|
+
breadcrumbs?: ReactNode;
|
|
3651
|
+
/** Page-level actions, trailing the title on one line where there is room. */
|
|
3652
|
+
actions?: ReactNode;
|
|
3653
|
+
/**
|
|
3654
|
+
* A row of tabs under the title, for a page whose sections each have their
|
|
3655
|
+
* own address (`PageTabs` with a `PageTab` per section). Rendered across the
|
|
3656
|
+
* header's full width, below the title and actions.
|
|
3657
|
+
*/
|
|
3658
|
+
tabs?: ReactNode;
|
|
3659
|
+
/**
|
|
3660
|
+
* The `id` of the title's `h1`, for a region that names itself by the page's
|
|
3661
|
+
* title (`aria-labelledby` on the page's form).
|
|
3662
|
+
*/
|
|
3663
|
+
titleId?: string;
|
|
3664
|
+
/** A leading visual, such as a plugin's icon tile, before the title. */
|
|
3665
|
+
media?: ReactNode;
|
|
3666
|
+
/** Small chips beside the title: a version, a status, a category. */
|
|
3667
|
+
meta?: ReactNode;
|
|
3668
|
+
}
|
|
3669
|
+
/**
|
|
3670
|
+
* A page's own identity — its trail, its name, its one-line summary and its
|
|
3671
|
+
* actions — rendered once instead of at every page that needs one.
|
|
3672
|
+
*
|
|
3673
|
+
* Every value arrives as a PROP, and that is the point rather than an
|
|
3674
|
+
* implementation detail. The markup this replaces was written out by hand on 22
|
|
3675
|
+
* pages, and the settings pages took their title from a ~130-line chain that
|
|
3676
|
+
* matched `window.location.pathname` in a file none of them import. Both are
|
|
3677
|
+
* the same defect from opposite ends: a page knows what it is, and nothing let
|
|
3678
|
+
* it say so — so the title lived either in 22 copies or in one foreign file
|
|
3679
|
+
* that had to be edited whenever a route was added.
|
|
3680
|
+
*
|
|
3681
|
+
* The route registry already made this decision for the sidebar. A private
|
|
3682
|
+
* route must DECLARE the rail section it belongs to, because the sidebar reads
|
|
3683
|
+
* that declaration rather than matching the URL, which makes a route added
|
|
3684
|
+
* without one a compile error instead of a page that silently highlights the
|
|
3685
|
+
* wrong entry. A title derived from a pathname is the same defect in the half
|
|
3686
|
+
* nobody had covered.
|
|
3687
|
+
*
|
|
3688
|
+
* It also makes a plugin's page indistinguishable from a first-party one: a
|
|
3689
|
+
* plugin cannot add a branch to an if-chain it does not ship, but it can pass a
|
|
3690
|
+
* prop.
|
|
3691
|
+
* @experimental
|
|
3692
|
+
*/
|
|
3693
|
+
export declare const PageHeader: ForwardRefExoticComponent<PropsWithoutRef<PageHeaderProps> & RefAttributes<HTMLElement>>;
|
|
3694
|
+
/** @experimental */
|
|
3695
|
+
interface PageTabsProps extends HTMLAttributes<HTMLElement> {
|
|
3696
|
+
/** What the sections are, for assistive technology (`"Form sections"`). */
|
|
3697
|
+
label: string;
|
|
3698
|
+
}
|
|
3699
|
+
/**
|
|
3700
|
+
* The tab row of a page whose sections each have their own address. A labelled
|
|
3701
|
+
* `nav` of links rather than an ARIA tablist: every tab changes the URL, and a
|
|
3702
|
+
* link inside `role="tab"` breaks the tabs pattern's keyboard and announcement
|
|
3703
|
+
* contract. The current section is marked with `aria-current="page"` by
|
|
3704
|
+
* `PageTab`.
|
|
3705
|
+
* @experimental
|
|
3706
|
+
*/
|
|
3707
|
+
export declare const PageTabs: ForwardRefExoticComponent<PropsWithoutRef<PageTabsProps> & RefAttributes<HTMLElement>>;
|
|
3708
|
+
/**
|
|
3709
|
+
* The anchor attributes a tab passes through. `aria-current` is not among
|
|
3710
|
+
* them: it is derived from `current`, so the tab is announced as current
|
|
3711
|
+
* exactly when it is drawn as current.
|
|
3712
|
+
*/
|
|
3713
|
+
type PageTabAnchorProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "aria-current" | "href">;
|
|
3714
|
+
/**
|
|
3715
|
+
* A tab changes the address, so it always has a destination: its own `href`,
|
|
3716
|
+
* or, with `asChild`, the router link it wraps.
|
|
3717
|
+
* @experimental
|
|
3718
|
+
*/
|
|
3719
|
+
type PageTabProps = PageTabAnchorProps & {
|
|
3720
|
+
/** Whether this tab is the section being shown. */
|
|
3721
|
+
current?: boolean;
|
|
3722
|
+
} & ({
|
|
3723
|
+
/** Where the tab leads. */
|
|
3724
|
+
href: string;
|
|
3725
|
+
asChild?: false;
|
|
3726
|
+
} | {
|
|
3727
|
+
/**
|
|
3728
|
+
* Render the caller's own link element (a router link) in place of
|
|
3729
|
+
* an `<a>`; that element carries the destination. The tab keeps its
|
|
3730
|
+
* look and its `aria-current`.
|
|
3731
|
+
*/
|
|
3732
|
+
asChild: true;
|
|
3733
|
+
href?: undefined;
|
|
3734
|
+
});
|
|
3735
|
+
/**
|
|
3736
|
+
* One section of a `PageTabs` row: a link, underlined when current.
|
|
3737
|
+
* @experimental
|
|
3738
|
+
*/
|
|
3739
|
+
export declare const PageTab: ForwardRefExoticComponent<PropsWithoutRef<PageTabProps> & RefAttributes<HTMLAnchorElement>>;
|
|
3740
|
+
/**
|
|
3741
|
+
* The four kinds of page the admin draws, each with one width.
|
|
3742
|
+
*
|
|
3743
|
+
* - `list`: full width within the gutter (entries, users, keys, webhooks),
|
|
3744
|
+
* drawn as a padded block rather than a grid, so a page that hands its own
|
|
3745
|
+
* height down through `height: 100%` (a split pane, a media grid) keeps it.
|
|
3746
|
+
* - `form`: a 56rem column under the page's left edge (settings, create and
|
|
3747
|
+
* edit pages).
|
|
3748
|
+
* - `editor`: full width with no gutter and no padding: the editor draws its
|
|
3749
|
+
* own field column (inset by the gutter, and measured) and a side panel that
|
|
3750
|
+
* meets the window's edge.
|
|
3751
|
+
* - `workspace`: no gutter and no padding, for a page that lays out its own
|
|
3752
|
+
* surface (the dashboard, a builder canvas).
|
|
3753
|
+
* @experimental
|
|
3754
|
+
*/
|
|
3755
|
+
type PageType = "list" | "form" | "editor" | "workspace";
|
|
3756
|
+
/** @experimental */
|
|
3757
|
+
interface PageFrameListenerProps {
|
|
3758
|
+
/**
|
|
3759
|
+
* Called with the type of the outermost `PageFrame` drawn inside, as it
|
|
3760
|
+
* mounts or changes, and with `null` once none is left.
|
|
3761
|
+
*/
|
|
3762
|
+
onFrame: (type: PageType | null) => void;
|
|
3763
|
+
children?: ReactNode;
|
|
3764
|
+
}
|
|
3765
|
+
/**
|
|
3766
|
+
* Hears whether the content inside it draws a `PageFrame`, for a host that
|
|
3767
|
+
* gives unframed content a frame of its own and must not frame content twice.
|
|
3768
|
+
* Read from the frames themselves rather than from what the content is called,
|
|
3769
|
+
* so a page that draws a frame through any component is heard the same way.
|
|
3770
|
+
*
|
|
3771
|
+
* The frame claims in a layout effect, so a host that changes its own markup
|
|
3772
|
+
* in answer does so before the first paint.
|
|
3773
|
+
* @experimental
|
|
3774
|
+
*/
|
|
3775
|
+
export declare function PageFrameListener({ onFrame, children }: PageFrameListenerProps): JSX.Element;
|
|
3776
|
+
/** @experimental */
|
|
3777
|
+
interface PageFrameProps extends HTMLAttributes<HTMLDivElement> {
|
|
3778
|
+
/** Which kind of page this is; it decides the width. */
|
|
3779
|
+
type: PageType;
|
|
3780
|
+
}
|
|
3781
|
+
/**
|
|
3782
|
+
* A page's frame: the width and gutter its type gives it. A page says what it
|
|
3783
|
+
* is, and the frame decides how wide that is, so two pages of one type can
|
|
3784
|
+
* never drift apart.
|
|
3785
|
+
* @experimental
|
|
3786
|
+
*/
|
|
3787
|
+
export declare const PageFrame: ForwardRefExoticComponent<PropsWithoutRef<PageFrameProps> & RefAttributes<HTMLDivElement>>;
|
|
3788
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, type ActionCallbacks, type ActiveShortcut, Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BleedProps, Button, type ButtonProps, Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorPickerProps, type ColorSwatch, Command, CommandDialog, type CommandDialogProps, CommandEmpty, type CommandEmptyProps, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, type CommandItemProps, CommandList, type CommandListProps, type CommandProps, CommandSeparator, type CommandSeparatorProps, CommandShortcut, type CommandShortcutProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, type DataFetcher, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogOverlay, type DialogOverlayProps, DialogPortal, DialogTitle, type DialogTitleProps, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type FieldLayout, type FieldRowProps, type FieldShellProps, type FieldShellRenderProps, type FieldWidth, type FilterInfo, type FormActionsProps, type FormLabelWithTooltipProps, type FormSectionProps, type GridProps, type IconFieldProps, type IconGlyphProps, type IconPickerProps, type IconSource, type IconSourceIcon, Input, type InputProps, type KeyChord, type KeySequence, Label, type ListResponse, type ModifierState, type PageFrameListenerProps, type PageFrameProps, type PageHeaderProps, type PageShellProps, type PageTabProps, type PageTabsProps, type PageType, type PaginationConfig, type PaginationMeta, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalProvider, Progress, type ProgressProps, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, type SheetContentRef, SheetDescription, type SheetDescriptionProps, type SheetDescriptionRef, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, SheetOverlay, type SheetOverlayProps, type SheetOverlayRef, SheetPortal, type SheetProps, SheetTitle, type SheetTitleProps, type SheetTitleRef, SheetTrigger, type SheetTriggerProps, type ShortcutBinding, type ShortcutLayerOptions, type ShortcutManager, type ShortcutManagerOptions, type ShortcutProviderProps, type ShortcutRegistration, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderThumbProps, type SortInfo, Spinner, type SpinnerProps, type StackProps, type StatProps, Switch, Table, TableBody, TableCaption, TableCell, type TableEmptyProps, type TableErrorProps, TableFooter, TableHead, TableHeader, type TableParams, TableRow, type TableSearchProps, type TableSkeletonProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type ToasterProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TreeNode, TreeView, type TreeViewProps, type UseShortcutsOptions, alertVariants, badgeVariants, buttonVariants, cardVariants, dialogContentVariants, inputVariants, selectTriggerVariants, sheetVariants, spinnerVariants, toast, usePortalContainer };
|
|
3789
|
+
//# sourceMappingURL=index.d.cts.map
|