@sanity/ui 5.0.0-alpha.2 → 5.0.0-alpha.21
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 +1 -1
- package/dist/LazyRefractor-CQ22IeXB.js +19 -0
- package/dist/LazyRefractor-CQ22IeXB.js.map +1 -0
- package/dist/cli/install.js +2 -1
- package/dist/index.d.ts +826 -855
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2439 -1796
- package/dist/index.js.map +1 -1
- package/dist/polyfills.d.ts +1 -0
- package/dist/polyfills.js +5 -0
- package/dist/polyfills.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +16 -9
- package/src/cli/install.ts +2 -1
- package/src/components/avatar/Avatar.tsx +50 -0
- package/src/components/avatar/avatar.css +51 -0
- package/src/components/avatar/avatar.props.ts +57 -0
- package/src/components/avatar-counter/AvatarCounter.tsx +38 -0
- package/src/components/avatar-counter/avatar-counter.css +8 -0
- package/src/components/avatar-counter/avatarCounter.props.ts +44 -0
- package/src/components/avatar-stack/AvatarStack.tsx +60 -0
- package/src/components/avatar-stack/avatar-stack.css +16 -0
- package/src/components/avatar-stack/avatarStack.props.ts +20 -0
- package/src/components/badge/Badge.tsx +53 -0
- package/src/components/badge/badge.css +6 -0
- package/src/components/badge/badge.props.ts +31 -0
- package/src/components/box/box.css +5 -0
- package/src/components/box/box.props.ts +7 -2
- package/src/components/button/Button.tsx +7 -1
- package/src/components/button/button.css +51 -23
- package/src/components/button/button.props.ts +27 -9
- package/src/components/card/Card.tsx +1 -1
- package/src/components/card/card.props.ts +10 -5
- package/src/components/checkbox/Checkbox.tsx +15 -29
- package/src/components/checkbox/checkbox.css +19 -20
- package/src/components/checkbox/checkbox.props.ts +11 -12
- package/src/components/code/Code.tsx +18 -19
- package/src/components/code/code.props.ts +23 -14
- package/src/components/container/Container.tsx +5 -1
- package/src/components/container/container.css +4 -0
- package/src/components/container/container.props.ts +6 -2
- package/src/components/dialog/Dialog.tsx +139 -0
- package/src/components/dialog/dialog.css +49 -0
- package/src/components/dialog/dialog.props.ts +45 -0
- package/src/components/eyebrow/eyebrow.props.ts +6 -2
- package/src/components/flex/flex.css +5 -0
- package/src/components/flex/flex.props.ts +6 -2
- package/src/components/grid/grid.css +5 -0
- package/src/components/grid/grid.props.ts +14 -3
- package/src/components/h-stack/HStack.tsx +8 -14
- package/src/components/h-stack/hStack.props.ts +5 -13
- package/src/components/heading/Heading.tsx +8 -3
- package/src/components/heading/heading.css +0 -5
- package/src/components/heading/heading.props.ts +16 -5
- package/src/components/hotkeys/Hotkeys.tsx +29 -0
- package/src/components/hotkeys/hotkeys.css +3 -0
- package/src/components/hotkeys/hotkeys.props.ts +15 -0
- package/src/components/icon/Icon.tsx +22 -11
- package/src/components/icon/icon.props.ts +7 -3
- package/src/components/icon-button/iconButton.props.ts +7 -2
- package/src/components/index.css +12 -1
- package/src/components/indicator/indicator.css +1 -1
- package/src/components/indicator/indicator.props.ts +6 -2
- package/src/components/indicator-stack/indicatorStack.props.ts +3 -1
- package/src/components/inline/inline.props.ts +6 -2
- package/src/components/kbd/KBD.tsx +33 -0
- package/src/components/kbd/kbd.css +6 -0
- package/src/components/kbd/kbd.props.ts +20 -0
- package/src/components/link/link.props.ts +4 -4
- package/src/components/list/list.props.ts +27 -9
- package/src/components/popover/Popover.tsx +85 -0
- package/src/components/popover/popover.css +21 -0
- package/src/components/popover/popover.props.ts +38 -0
- package/src/components/press-area/pressArea.props.ts +3 -1
- package/src/components/radio/Radio.tsx +10 -28
- package/src/components/radio/radio.css +17 -32
- package/src/components/radio/radio.props.ts +1 -19
- package/src/components/select/Select.tsx +41 -0
- package/src/components/select/select.css +67 -0
- package/src/components/select/select.props.ts +18 -0
- package/src/components/skip-to-content/skipToContent.props.ts +9 -3
- package/src/components/spinner/Spinner.tsx +2 -1
- package/src/components/spinner/spinner.props.ts +3 -0
- package/src/components/switch/Switch.tsx +9 -21
- package/src/components/switch/switch.css +22 -23
- package/src/components/switch/switch.props.ts +7 -11
- package/src/components/tabs/Tabs.tsx +186 -0
- package/src/components/tabs/tabs.css +34 -0
- package/src/components/tabs/tabs.props.ts +66 -0
- package/src/components/text/text.props.ts +6 -2
- package/src/components/text-area/TextArea.tsx +32 -0
- package/src/components/text-area/text-area.css +56 -0
- package/src/components/text-area/textArea.props.ts +35 -0
- package/src/components/text-input/TextInput.tsx +32 -0
- package/src/components/text-input/text-input.css +55 -0
- package/src/components/text-input/textInput.props.ts +42 -0
- package/src/components/tooltip/Tooltip.tsx +59 -55
- package/src/components/tooltip/tooltip.css +21 -40
- package/src/components/tooltip/tooltip.props.ts +24 -8
- package/src/components/tooltip-group/TooltipGroup.tsx +2 -5
- package/src/components/tooltip-group/tooltipGroup.props.ts +3 -1
- package/src/components/v-stack/VStack.tsx +8 -14
- package/src/components/v-stack/vStack.props.ts +5 -13
- package/src/components/visually-hidden/visuallyHidden.props.ts +6 -2
- package/src/css/classes/dynamic/height.css +2 -0
- package/src/css/classes/generic/display.css +8 -8
- package/src/css/classes/generic/placement.css +105 -86
- package/src/css/classes/local/animation.css +4 -0
- package/src/css/classes/local/field-sizing.css +3 -0
- package/src/css/classes/local/index.css +3 -1
- package/src/css/classes/local/text-trim.css +11 -4
- package/src/css/classes/local/top-anchor.css +4 -0
- package/src/css/classes/system/shadow.css +6 -6
- package/src/css/classes/system/typography.css +0 -4
- package/src/css/global/reset.css +16 -1
- package/src/css/tokens/semantic.css +7 -6
- package/src/css/tokens/surface.css +80 -12
- package/src/hooks/useIsClient.ts +10 -0
- package/src/index.ts +17 -2
- package/src/polyfills.ts +17 -0
- package/src/props/formElement.ts +34 -0
- package/src/props/layout.ts +3 -3
- package/src/props/tone.ts +13 -2
- package/src/types/Avatar.ts +14 -0
- package/src/types/Code.ts +0 -3
- package/src/types/Eyebrow.ts +1 -1
- package/src/types/FormElement.ts +2 -0
- package/src/types/Heading.ts +1 -1
- package/src/types/TextAlign.ts +1 -1
- package/src/types/Tone.ts +2 -0
- package/src/utils/getProps.ts +1 -1
- package/src/utils/mergeTriggerProps.ts +66 -0
- package/src/utils/renderPortal.tsx +14 -0
- package/src/version.ts +2 -2
- package/dist/_chunks-es/LazyRefractor.js +0 -20
- package/dist/_chunks-es/LazyRefractor.js.map +0 -1
- package/src/components/label/Label.tsx +0 -34
- package/src/components/label/label.css +0 -3
- package/src/components/label/label.props.ts +0 -19
- package/src/css/classes/local/tone.css +0 -75
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,85 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import React$1, { ComponentProps, ComponentPropsWithRef, ElementType, SVGProps } from "react";
|
|
2
|
+
declare const AVATAR_SIZE: readonly [0, 1, 2];
|
|
3
|
+
type AvatarSize = (typeof AVATAR_SIZE)[number];
|
|
4
|
+
declare const AVATAR_COLOR: readonly ["gray", "purple", "magenta", "red", "orange", "yellow", "green", "cyan"];
|
|
5
|
+
type AvatarColor = (typeof AVATAR_COLOR)[number];
|
|
6
|
+
/** @public */
|
|
7
|
+
type Responsive<T> = T | [] | ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
8
|
+
length: 1;
|
|
9
|
+
}) | ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
10
|
+
length: 2;
|
|
11
|
+
}) | ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
12
|
+
length: 3;
|
|
13
|
+
}) | ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
14
|
+
length: 4;
|
|
15
|
+
}) | ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
16
|
+
length: 5;
|
|
17
|
+
}) | ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
18
|
+
length: 6;
|
|
19
|
+
});
|
|
20
|
+
/** @public */
|
|
21
|
+
interface AvatarProps extends React.ComponentProps<'figure'> {
|
|
22
|
+
/** Avatar color */
|
|
23
|
+
color?: AvatarColor;
|
|
24
|
+
/** Avatar name, only first letter will be displayed */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Composite prop for setting height and font size */
|
|
27
|
+
size?: Responsive<AvatarSize>;
|
|
28
|
+
/** Avatar image src */
|
|
29
|
+
src?: string;
|
|
30
|
+
}
|
|
31
|
+
/** @public */
|
|
32
|
+
export declare function Avatar({ color, size, ...props }: AvatarProps): import("react").JSX.Element;
|
|
33
|
+
/** @public */
|
|
34
|
+
interface AvatarCounterProps extends React.ComponentProps<'figure'> {
|
|
35
|
+
/** Count */
|
|
36
|
+
count: number;
|
|
37
|
+
/** Composite prop for setting height and font size */
|
|
38
|
+
size?: AvatarSize;
|
|
39
|
+
}
|
|
40
|
+
/** @public */
|
|
41
|
+
export declare function AvatarCounter({ size, ...props }: AvatarCounterProps): import("react").JSX.Element;
|
|
42
|
+
/** @public */
|
|
43
|
+
interface AvatarStackProps extends React.ComponentProps<'ul'> {
|
|
44
|
+
/** Max number of avatars to display */
|
|
45
|
+
maxLength?: number;
|
|
46
|
+
/** Avatar and AvatarCounter size */
|
|
47
|
+
size?: AvatarSize;
|
|
48
|
+
}
|
|
49
|
+
/** @public */
|
|
50
|
+
export declare function AvatarStack({ size, ...props }: AvatarStackProps): import("react").JSX.Element;
|
|
51
|
+
declare const TONE: readonly ["neutral", "positive", "suggest", "caution", "critical"];
|
|
52
|
+
declare const TONE_WITH_DEFAULT: string[];
|
|
53
|
+
/** @public */
|
|
54
|
+
type Tone = (typeof TONE)[number];
|
|
55
|
+
type ToneWithDefault = (typeof TONE_WITH_DEFAULT)[number];
|
|
56
|
+
type ToneProps = {
|
|
57
|
+
tone?: Tone;
|
|
58
|
+
};
|
|
59
|
+
type ToneWithDefaultProps = {
|
|
60
|
+
tone?: ToneWithDefault;
|
|
61
|
+
};
|
|
62
|
+
/** @public */
|
|
63
|
+
interface BadgeProps<T extends React.ElementType = 'span'> extends ToneProps {
|
|
64
|
+
/**
|
|
65
|
+
* HTML element to render.
|
|
66
|
+
*/
|
|
67
|
+
as?: T;
|
|
68
|
+
/**
|
|
69
|
+
* Shows an icon in the start position (left side in left-to-right languages).
|
|
70
|
+
*/
|
|
71
|
+
iconStart?: React.ElementType | React.ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Sets Badge's text label. Use instead of children unless you have a special use case.
|
|
74
|
+
*/
|
|
75
|
+
text?: string;
|
|
76
|
+
}
|
|
77
|
+
/** @public */
|
|
78
|
+
export declare function Badge<T extends ElementType = 'span'>({ tone, ...props }: BadgeProps<T> & Omit<ComponentPropsWithRef<T>, keyof BadgeProps<T>>): import("react").JSX.Element;
|
|
79
|
+
declare const RADIUS: readonly [0, 1, 2, 3, 4, 5, 6, "full"];
|
|
80
|
+
/** @public */
|
|
81
|
+
type Radius = (typeof RADIUS)[number];
|
|
82
|
+
type BorderProps = {
|
|
20
83
|
/** CSS **border** property */
|
|
21
84
|
border?: Responsive<boolean>;
|
|
22
85
|
/** CSS **border-top** property */
|
|
@@ -30,216 +93,7 @@ declare type BorderProps = {
|
|
|
30
93
|
/** CSS **border-radius** property */
|
|
31
94
|
radius?: Responsive<Radius>;
|
|
32
95
|
};
|
|
33
|
-
|
|
34
|
-
/** @public */
|
|
35
|
-
export declare function Box<T extends ElementType = "div">({
|
|
36
|
-
display,
|
|
37
|
-
...props
|
|
38
|
-
}: BoxProps<T> &
|
|
39
|
-
Omit<ComponentPropsWithRef<T>, keyof BoxProps<T>>): JSX.Element;
|
|
40
|
-
|
|
41
|
-
/** @public */
|
|
42
|
-
export declare interface BoxProps<
|
|
43
|
-
T extends React.ElementType = "div",
|
|
44
|
-
> extends LayoutProps {
|
|
45
|
-
/** Element to render */
|
|
46
|
-
as?: T;
|
|
47
|
-
/** CSS **display** property */
|
|
48
|
-
display?: Responsive<DisplayBlock>;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** @public */
|
|
52
|
-
export declare function Button<T extends ElementType = "button">({
|
|
53
|
-
density,
|
|
54
|
-
level,
|
|
55
|
-
tone,
|
|
56
|
-
...props
|
|
57
|
-
}: ButtonProps<T> &
|
|
58
|
-
Omit<ComponentPropsWithRef<T>, keyof ButtonProps<T>>): JSX.Element;
|
|
59
|
-
|
|
60
|
-
declare const BUTTON_DENSITY: readonly ["regular", "loose"];
|
|
61
|
-
|
|
62
|
-
declare const BUTTON_LEVEL: readonly ["primary", "secondary", "tertiary"];
|
|
63
|
-
|
|
64
|
-
declare const BUTTON_TONE: readonly ["neutral", "critical"];
|
|
65
|
-
|
|
66
|
-
declare type ButtonDensity = (typeof BUTTON_DENSITY)[number];
|
|
67
|
-
|
|
68
|
-
declare type ButtonLevel = (typeof BUTTON_LEVEL)[number];
|
|
69
|
-
|
|
70
|
-
/** @public */
|
|
71
|
-
export declare interface ButtonProps<T extends React.ElementType = "button"> {
|
|
72
|
-
/** Element to render */
|
|
73
|
-
as?: InteractiveAs<T>;
|
|
74
|
-
/** Composite prop for setting padding and gap */
|
|
75
|
-
density?: ButtonDensity;
|
|
76
|
-
/** Set CSS **width** property to 100% */
|
|
77
|
-
fullWidth?: Responsive<boolean>;
|
|
78
|
-
/** Starting icon */
|
|
79
|
-
iconStart?: React.ElementType | React.ReactNode;
|
|
80
|
-
/** Ending icon */
|
|
81
|
-
iconEnd?: React.ElementType | React.ReactNode;
|
|
82
|
-
/** Button level */
|
|
83
|
-
level?: ButtonLevel;
|
|
84
|
-
/** Loading state */
|
|
85
|
-
loading?: boolean;
|
|
86
|
-
/** Button text */
|
|
87
|
-
text?: string;
|
|
88
|
-
/** Button tone */
|
|
89
|
-
tone?: ButtonTone;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
declare type ButtonTone = (typeof BUTTON_TONE)[number];
|
|
93
|
-
|
|
94
|
-
/** @public */
|
|
95
|
-
export declare function Card<T extends ElementType = "div">({
|
|
96
|
-
density,
|
|
97
|
-
tone,
|
|
98
|
-
...props
|
|
99
|
-
}: CardProps<T> &
|
|
100
|
-
Omit<ComponentPropsWithRef<T>, keyof CardProps<T>>): JSX.Element;
|
|
101
|
-
|
|
102
|
-
/** @public */
|
|
103
|
-
export declare interface CardProps<T extends React.ElementType = "div">
|
|
104
|
-
extends MarginProps, ToneProps {
|
|
105
|
-
/** Element to render */
|
|
106
|
-
as?: T;
|
|
107
|
-
/** Composite prop for setting padding and border radius */
|
|
108
|
-
density?: Responsive<Density>;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/** @beta */
|
|
112
|
-
export declare function Checkbox(props: CheckboxProps): JSX.Element;
|
|
113
|
-
|
|
114
|
-
/** @beta */
|
|
115
|
-
export declare interface CheckboxProps
|
|
116
|
-
extends React.ComponentProps<"input">, MarginProps {
|
|
117
|
-
/** Error state */
|
|
118
|
-
error?: boolean;
|
|
119
|
-
/** Indeterminate state */
|
|
120
|
-
indeterminate?: boolean;
|
|
121
|
-
/** Input label */
|
|
122
|
-
label: React.ReactNode;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/** @public */
|
|
126
|
-
export declare function Code<T extends CodeTag = "pre">({
|
|
127
|
-
size,
|
|
128
|
-
...props
|
|
129
|
-
}: CodeProps<T> &
|
|
130
|
-
Omit<ComponentPropsWithRef<T>, keyof CodeProps<T>>): JSX.Element;
|
|
131
|
-
|
|
132
|
-
declare const CODE_SIZE: readonly [0, 1, 2, 3, 4];
|
|
133
|
-
|
|
134
|
-
declare const CODE_TAG: readonly ["pre", "span"];
|
|
135
|
-
|
|
136
|
-
/** @public */
|
|
137
|
-
export declare interface CodeProps<T extends CodeTag = "pre"> extends Omit<
|
|
138
|
-
TypographyProps,
|
|
139
|
-
"align" | "truncate" | "tone"
|
|
140
|
-
> {
|
|
141
|
-
/** Element to render */
|
|
142
|
-
as?: T;
|
|
143
|
-
/** Refractor language for syntax highlighting */
|
|
144
|
-
language?: string;
|
|
145
|
-
/** CSS **font-size** property */
|
|
146
|
-
size?: Responsive<CodeSize>;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/** @public */
|
|
150
|
-
export declare type CodeSize = (typeof CODE_SIZE)[number];
|
|
151
|
-
|
|
152
|
-
declare type CodeTag = (typeof CODE_TAG)[number];
|
|
153
|
-
|
|
154
|
-
/** @public */
|
|
155
|
-
export declare function Container<T extends ElementType = "div">({
|
|
156
|
-
marginX,
|
|
157
|
-
...props
|
|
158
|
-
}: ContainerProps<T> &
|
|
159
|
-
Omit<ComponentPropsWithRef<T>, keyof ContainerProps<T>>): JSX.Element;
|
|
160
|
-
|
|
161
|
-
declare const CONTAINER_SIZE: readonly [0, 1, 2, 3, 4, 5];
|
|
162
|
-
|
|
163
|
-
/** @public */
|
|
164
|
-
export declare interface ContainerProps<
|
|
165
|
-
T extends React.ElementType = "div",
|
|
166
|
-
> extends LayoutProps {
|
|
167
|
-
/** Element to render */
|
|
168
|
-
as?: T;
|
|
169
|
-
/** CSS **max-width** property */
|
|
170
|
-
size?: Responsive<ContainerSize>;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/** @public */
|
|
174
|
-
export declare type ContainerSize = (typeof CONTAINER_SIZE)[number];
|
|
175
|
-
|
|
176
|
-
declare const DENSITY: readonly ["compact", "regular", "loose"];
|
|
177
|
-
|
|
178
|
-
/** @public */
|
|
179
|
-
export declare type Density = (typeof DENSITY)[number];
|
|
180
|
-
|
|
181
|
-
declare const DISPLAY_BLOCK: readonly ["block", "inline-block", "none"];
|
|
182
|
-
|
|
183
|
-
declare const DISPLAY_FLEX: readonly ["flex", "inline-flex", "none"];
|
|
184
|
-
|
|
185
|
-
declare const DISPLAY_GRID: readonly ["grid", "inline-grid", "none"];
|
|
186
|
-
|
|
187
|
-
/** @public */
|
|
188
|
-
export declare type DisplayBlock = (typeof DISPLAY_BLOCK)[number];
|
|
189
|
-
|
|
190
|
-
/** @public */
|
|
191
|
-
export declare type DisplayFlex = (typeof DISPLAY_FLEX)[number];
|
|
192
|
-
|
|
193
|
-
/** @public */
|
|
194
|
-
export declare type DisplayGrid = (typeof DISPLAY_GRID)[number];
|
|
195
|
-
|
|
196
|
-
/** @public */
|
|
197
|
-
export declare function Divider(props: DividerProps): JSX.Element;
|
|
198
|
-
|
|
199
|
-
/** @public */
|
|
200
|
-
export declare interface DividerProps
|
|
201
|
-
extends React.ComponentProps<"hr">, MarginProps {}
|
|
202
|
-
|
|
203
|
-
/** @public */
|
|
204
|
-
export declare function Eyebrow<T extends ElementType = "span">({
|
|
205
|
-
size,
|
|
206
|
-
weight,
|
|
207
|
-
...props
|
|
208
|
-
}: EyebrowProps<T> &
|
|
209
|
-
Omit<ComponentPropsWithRef<T>, keyof EyebrowProps<T>>): JSX.Element;
|
|
210
|
-
|
|
211
|
-
declare const EYEBROW_SIZE: readonly [0, 1, 2, 3, 4];
|
|
212
|
-
|
|
213
|
-
/** @public */
|
|
214
|
-
export declare interface EyebrowProps<
|
|
215
|
-
T extends React.ElementType = "span",
|
|
216
|
-
> extends TypographyProps {
|
|
217
|
-
/** Element to render */
|
|
218
|
-
as?: T;
|
|
219
|
-
/** CSS **font-size** property */
|
|
220
|
-
size?: Responsive<EyebrowSize>;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/** @public */
|
|
224
|
-
export declare type EyebrowSize = (typeof EYEBROW_SIZE)[number];
|
|
225
|
-
|
|
226
|
-
/** @public */
|
|
227
|
-
export declare function Flex<T extends ElementType = "div">({
|
|
228
|
-
display,
|
|
229
|
-
...props
|
|
230
|
-
}: FlexProps<T> &
|
|
231
|
-
Omit<ComponentPropsWithRef<T>, keyof FlexProps<T>>): JSX.Element;
|
|
232
|
-
|
|
233
|
-
declare const FLEX_DIRECTION: readonly [
|
|
234
|
-
"row",
|
|
235
|
-
"row-reverse",
|
|
236
|
-
"column",
|
|
237
|
-
"column-reverse",
|
|
238
|
-
];
|
|
239
|
-
|
|
240
|
-
declare const FLEX_WRAP: readonly ["wrap", "wrap-reverse", "nowrap"];
|
|
241
|
-
|
|
242
|
-
declare type FlexChildProps = {
|
|
96
|
+
type FlexChildProps = {
|
|
243
97
|
/** CSS **flex-basis** property */
|
|
244
98
|
flexBasis?: Responsive<string>;
|
|
245
99
|
/** CSS **flex-grow** property */
|
|
@@ -247,68 +101,7 @@ declare type FlexChildProps = {
|
|
|
247
101
|
/** CSS **flex-shrink** property */
|
|
248
102
|
flexShrink?: Responsive<number>;
|
|
249
103
|
};
|
|
250
|
-
|
|
251
|
-
/** @public */
|
|
252
|
-
export declare type FlexDirection = (typeof FLEX_DIRECTION)[number];
|
|
253
|
-
|
|
254
|
-
/** @public */
|
|
255
|
-
export declare type FlexParentProps = {
|
|
256
|
-
/** CSS **align-items** property */
|
|
257
|
-
alignItems?: Responsive<AlignItems>;
|
|
258
|
-
/** CSS **justify-content** property */
|
|
259
|
-
justifyContent?: Responsive<JustifyContent>;
|
|
260
|
-
/** CSS **flex-direction** property */
|
|
261
|
-
flexDirection?: Responsive<FlexDirection>;
|
|
262
|
-
/** CSS **flex-wrap** property */
|
|
263
|
-
flexWrap?: Responsive<FlexWrap>;
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
/** @public */
|
|
267
|
-
export declare interface FlexProps<T extends React.ElementType = "div">
|
|
268
|
-
extends FlexParentProps, GapProps, LayoutProps {
|
|
269
|
-
/** Element to render */
|
|
270
|
-
as?: T;
|
|
271
|
-
/** CSS **display** property */
|
|
272
|
-
display?: Responsive<DisplayFlex>;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/** @public */
|
|
276
|
-
export declare type FlexWrap = (typeof FLEX_WRAP)[number];
|
|
277
|
-
|
|
278
|
-
declare const FONT_WEIGHT: readonly ["regular", "medium", "semibold", "bold"];
|
|
279
|
-
|
|
280
|
-
/** @public */
|
|
281
|
-
export declare type FontWeight = (typeof FONT_WEIGHT)[number];
|
|
282
|
-
|
|
283
|
-
/** @public */
|
|
284
|
-
export declare type GapProps = {
|
|
285
|
-
/** CSS **gap** property */
|
|
286
|
-
gap?: Responsive<SpaceInherit>;
|
|
287
|
-
/** CSS **row-gap** property */
|
|
288
|
-
rowGap?: Responsive<SpaceInherit>;
|
|
289
|
-
/** CSS **column-gap** property */
|
|
290
|
-
columnGap?: Responsive<SpaceInherit>;
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
/** @public */
|
|
294
|
-
export declare function Grid<T extends ElementType = "div">({
|
|
295
|
-
display,
|
|
296
|
-
...props
|
|
297
|
-
}: GridProps<T> &
|
|
298
|
-
Omit<ComponentPropsWithRef<T>, keyof GridProps<T>>): JSX.Element;
|
|
299
|
-
|
|
300
|
-
declare const GRID_AUTO_FLOW: readonly [
|
|
301
|
-
"row",
|
|
302
|
-
"column",
|
|
303
|
-
"row dense",
|
|
304
|
-
"column dense",
|
|
305
|
-
"dense",
|
|
306
|
-
];
|
|
307
|
-
|
|
308
|
-
/** @public */
|
|
309
|
-
export declare type GridAutoFlow = (typeof GRID_AUTO_FLOW)[number];
|
|
310
|
-
|
|
311
|
-
declare type GridChildProps = {
|
|
104
|
+
type GridChildProps = {
|
|
312
105
|
/** CSS **grid-column** property */
|
|
313
106
|
gridColumn?: Responsive<string>;
|
|
314
107
|
/** CSS **grid-column-start** property */
|
|
@@ -322,56 +115,7 @@ declare type GridChildProps = {
|
|
|
322
115
|
/** CSS **grid-row-end** property */
|
|
323
116
|
gridRowEnd?: Responsive<string>;
|
|
324
117
|
};
|
|
325
|
-
|
|
326
|
-
/** @public */
|
|
327
|
-
export declare type GridParentProps = {
|
|
328
|
-
/** CSS **grid-auto-flow** property */
|
|
329
|
-
gridAutoFlow?: Responsive<GridAutoFlow>;
|
|
330
|
-
/** CSS **grid-auto-columns** property */
|
|
331
|
-
gridAutoColumns?: Responsive<string>;
|
|
332
|
-
/** CSS **grid-auto-row** property */
|
|
333
|
-
gridAutoRows?: Responsive<string>;
|
|
334
|
-
/** CSS **grid-template-columns** property */
|
|
335
|
-
gridTemplateColumns?: Responsive<string>;
|
|
336
|
-
/** CSS **grid-template-rows** property */
|
|
337
|
-
gridTemplateRows?: Responsive<string>;
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
/** @public */
|
|
341
|
-
export declare interface GridProps<T extends React.ElementType = "div">
|
|
342
|
-
extends GridParentProps, GapProps, LayoutProps {
|
|
343
|
-
/** Element to render */
|
|
344
|
-
as?: T;
|
|
345
|
-
/** CSS **display** property */
|
|
346
|
-
display?: Responsive<DisplayGrid>;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/** @public */
|
|
350
|
-
export declare function Heading<T extends ElementType = "h2">({
|
|
351
|
-
size,
|
|
352
|
-
weight,
|
|
353
|
-
...props
|
|
354
|
-
}: HeadingProps &
|
|
355
|
-
Omit<ComponentPropsWithRef<T>, keyof HeadingProps>): JSX.Element;
|
|
356
|
-
|
|
357
|
-
declare const HEADING_SIZE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
358
|
-
|
|
359
|
-
declare const HEADING_TAG: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
360
|
-
|
|
361
|
-
/** @public */
|
|
362
|
-
export declare interface HeadingProps extends TypographyProps {
|
|
363
|
-
/** Element to render */
|
|
364
|
-
as?: HeadingTag;
|
|
365
|
-
/** CSS **font-size** property */
|
|
366
|
-
size?: Responsive<HeadingSize>;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/** @public */
|
|
370
|
-
export declare type HeadingSize = (typeof HEADING_SIZE)[number];
|
|
371
|
-
|
|
372
|
-
declare type HeadingTag = (typeof HEADING_TAG)[number];
|
|
373
|
-
|
|
374
|
-
declare type HeightProps = {
|
|
118
|
+
type HeightProps = {
|
|
375
119
|
/** CSS **height** property */
|
|
376
120
|
height?: Responsive<string>;
|
|
377
121
|
/** CSS **min-height** property */
|
|
@@ -379,246 +123,20 @@ declare type HeightProps = {
|
|
|
379
123
|
/** CSS **max-height** property */
|
|
380
124
|
maxHeight?: Responsive<string>;
|
|
381
125
|
};
|
|
382
|
-
|
|
383
|
-
/** @public */
|
|
384
|
-
export declare function HStack<T extends ElementType = "div">(
|
|
385
|
-
props: HStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof HStackProps<T>>,
|
|
386
|
-
): JSX.Element;
|
|
387
|
-
|
|
388
|
-
/** @public */
|
|
389
|
-
export declare interface HStackProps<
|
|
390
|
-
T extends React.ElementType = "div",
|
|
391
|
-
> extends Pick<GapProps, "gap"> {
|
|
392
|
-
/** Element to render */
|
|
393
|
-
as?: T;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/** @public */
|
|
397
|
-
export declare function Icon({ size, ...props }: IconProps): JSX.Element;
|
|
398
|
-
|
|
399
|
-
declare const ICON_SIZE: readonly [0, 1, 2, 3, 4];
|
|
400
|
-
|
|
401
|
-
/** @public */
|
|
402
|
-
export declare function IconButton<T extends ElementType = "button">(
|
|
403
|
-
props: IconButtonProps<T> &
|
|
404
|
-
Omit<ComponentPropsWithRef<T>, keyof IconButtonProps<T>>,
|
|
405
|
-
): JSX.Element;
|
|
406
|
-
|
|
407
|
-
/** @public */
|
|
408
|
-
export declare interface IconButtonProps<
|
|
409
|
-
T extends React_2.ElementType = "button",
|
|
410
|
-
> extends Pick<
|
|
411
|
-
ButtonProps<T>,
|
|
412
|
-
"as" | "density" | "level" | "loading" | "tone"
|
|
413
|
-
> {
|
|
414
|
-
/** Button label */
|
|
415
|
-
"aria-label": string;
|
|
416
|
-
/** Icon */
|
|
417
|
-
icon: React_2.ComponentType<SVGProps<SVGSVGElement>>;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
/** @public */
|
|
421
|
-
export declare interface IconProps
|
|
422
|
-
extends
|
|
423
|
-
ComponentProps<"svg">,
|
|
424
|
-
Pick<TypographyProps, "muted">,
|
|
425
|
-
MarginProps,
|
|
426
|
-
ToneProps {
|
|
427
|
-
/** Icon to render */
|
|
428
|
-
icon: React.ComponentType<SVGProps<SVGSVGElement>>;
|
|
429
|
-
/** CSS **font-size** property */
|
|
430
|
-
size?: Responsive<IconSize>;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
/** @public */
|
|
434
|
-
export declare type IconSize = (typeof ICON_SIZE)[number];
|
|
435
|
-
|
|
436
|
-
/** @beta */
|
|
437
|
-
export declare function Indicator<T extends ElementType = "span">({
|
|
438
|
-
tone,
|
|
439
|
-
...props
|
|
440
|
-
}: IndicatorProps<T> &
|
|
441
|
-
Omit<ComponentPropsWithRef<T>, keyof IndicatorProps<T>>): JSX.Element;
|
|
442
|
-
|
|
443
|
-
/** @beta */
|
|
444
|
-
export declare interface IndicatorProps<
|
|
445
|
-
T extends React.ElementType = "span",
|
|
446
|
-
> extends ToneProps {
|
|
447
|
-
/** Element to render */
|
|
448
|
-
as?: T;
|
|
449
|
-
/** Label for aria-label attribute */
|
|
450
|
-
label?: string;
|
|
451
|
-
}
|
|
452
|
-
|
|
126
|
+
declare const SPACE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
453
127
|
/** @public */
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
Omit<ComponentPropsWithRef<T>, keyof IndicatorStackProps<T>>,
|
|
457
|
-
): JSX.Element;
|
|
458
|
-
|
|
128
|
+
type Space = (typeof SPACE)[number];
|
|
129
|
+
declare const SPACE_AUTO: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "auto"];
|
|
459
130
|
/** @public */
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
> {
|
|
463
|
-
/** Element to render */
|
|
464
|
-
as?: T;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
/** @deprecated Use HStack component instead */
|
|
131
|
+
type SpaceAuto = (typeof SPACE_AUTO)[number];
|
|
132
|
+
declare const SPACE_INHERIT: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "inherit"];
|
|
468
133
|
/** @public */
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
): JSX.Element;
|
|
472
|
-
|
|
473
|
-
/** @deprecated Use HStack component instead */
|
|
134
|
+
type SpaceInherit = (typeof SPACE_INHERIT)[number];
|
|
135
|
+
declare const SPACE_AUTO_NEGATIVE: readonly [-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "auto"];
|
|
474
136
|
/** @public */
|
|
475
|
-
|
|
476
|
-
T extends React.ElementType = "div",
|
|
477
|
-
> extends PaddingProps {
|
|
478
|
-
/** Element to render */
|
|
479
|
-
as?: T;
|
|
480
|
-
/** CSS **gap** property */
|
|
481
|
-
gap?: Responsive<SpaceInherit>;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
declare const INTERACTIVE_TAG: readonly ["button", "a"];
|
|
485
|
-
|
|
486
|
-
declare type InteractiveAs<T extends React.ElementType> =
|
|
487
|
-
T extends InteractiveTag ? T : T extends string ? never : T;
|
|
488
|
-
|
|
489
|
-
declare type InteractiveTag = (typeof INTERACTIVE_TAG)[number];
|
|
490
|
-
|
|
491
|
-
declare const JUSTIFY_CONTENT: readonly [
|
|
492
|
-
"flex-start",
|
|
493
|
-
"flex-end",
|
|
494
|
-
"center",
|
|
495
|
-
"space-between",
|
|
496
|
-
"space-around",
|
|
497
|
-
"space-evenly",
|
|
498
|
-
];
|
|
499
|
-
|
|
500
|
-
/** @public */
|
|
501
|
-
export declare type JustifyContent = (typeof JUSTIFY_CONTENT)[number];
|
|
502
|
-
|
|
503
|
-
/** @beta */
|
|
504
|
-
export declare function Label(props: LabelProps): JSX.Element;
|
|
505
|
-
|
|
506
|
-
/** @beta */
|
|
507
|
-
export declare interface LabelProps
|
|
508
|
-
extends React.ComponentProps<"label">, MarginProps {
|
|
509
|
-
/** Element to render */
|
|
510
|
-
disabled?: boolean;
|
|
511
|
-
error?: boolean;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/** @public */
|
|
515
|
-
export declare interface LayoutProps
|
|
516
|
-
extends
|
|
517
|
-
ToneProps,
|
|
518
|
-
WidthProps,
|
|
519
|
-
HeightProps,
|
|
520
|
-
MarginProps,
|
|
521
|
-
BorderProps,
|
|
522
|
-
PaddingProps,
|
|
523
|
-
PositionProps,
|
|
524
|
-
OverflowProps,
|
|
525
|
-
FlexChildProps,
|
|
526
|
-
GridChildProps,
|
|
527
|
-
ZIndexProps,
|
|
528
|
-
ShadowProps {}
|
|
529
|
-
|
|
530
|
-
/** @beta */
|
|
531
|
-
export declare function Link({ underlined, ...props }: LinkProps): JSX.Element;
|
|
532
|
-
|
|
533
|
-
/** @beta */
|
|
534
|
-
export declare interface LinkProps extends React.ComponentProps<"a"> {
|
|
535
|
-
/** If true, sets `target="_blank"` and `rel="noopener noreferrer"` */
|
|
536
|
-
openInNewTab?: boolean;
|
|
537
|
-
/**
|
|
538
|
-
* If true, sets `text-decoration: underline`
|
|
539
|
-
*
|
|
540
|
-
* @defaultValue true
|
|
541
|
-
*/
|
|
542
|
-
underlined?: boolean;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
/** @beta */
|
|
546
|
-
export declare const List: typeof ListRoot;
|
|
547
|
-
|
|
548
|
-
declare const LIST_TAG: readonly ["ol", "ul"];
|
|
549
|
-
|
|
550
|
-
declare function ListButtonItem<T extends ElementType = "button">({
|
|
551
|
-
density,
|
|
552
|
-
...props
|
|
553
|
-
}: ListButtonItemProps<T> &
|
|
554
|
-
Omit<ComponentPropsWithRef<T>, keyof ListButtonItemProps<T>>): JSX.Element;
|
|
555
|
-
|
|
556
|
-
/** @beta */
|
|
557
|
-
export declare interface ListButtonItemProps<
|
|
558
|
-
T extends React_2.ElementType = "button",
|
|
559
|
-
> extends ListItemProps {
|
|
560
|
-
/** Element to render */
|
|
561
|
-
as?: InteractiveAs<T>;
|
|
562
|
-
/** Selected state */
|
|
563
|
-
selected?: boolean;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
declare function ListItem({ density, ...props }: ListItemProps): JSX.Element;
|
|
567
|
-
|
|
568
|
-
declare function ListItemImage(props: ComponentProps<"img">): JSX.Element;
|
|
569
|
-
|
|
570
|
-
/** @beta */
|
|
571
|
-
export declare interface ListItemProps extends React_2.ComponentProps<"li"> {
|
|
572
|
-
/** Composite prop for setting padding and gap */
|
|
573
|
-
density?: Responsive<Density>;
|
|
574
|
-
/** Starting slot */
|
|
575
|
-
start?: React_2.ReactNode;
|
|
576
|
-
/** Ending slot */
|
|
577
|
-
end?: React_2.ReactNode;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
declare function ListItemText<T extends ElementType = "div">(
|
|
581
|
-
props: ListItemTextProps<T> &
|
|
582
|
-
Omit<ComponentPropsWithRef<T>, keyof ListItemTextProps<T>>,
|
|
583
|
-
): JSX.Element;
|
|
584
|
-
|
|
585
|
-
/** @beta */
|
|
586
|
-
export declare interface ListItemTextProps<
|
|
587
|
-
T extends React_2.ElementType = "div",
|
|
588
|
-
> {
|
|
589
|
-
/** Element to render */
|
|
590
|
-
as?: T;
|
|
591
|
-
/** Title text */
|
|
592
|
-
title?: React_2.ReactNode;
|
|
593
|
-
/** Subtitle text */
|
|
594
|
-
subtitle?: React_2.ReactNode;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
/** @beta */
|
|
598
|
-
export declare interface ListProps<T extends ListTag = "ul"> extends Pick<
|
|
599
|
-
GapProps,
|
|
600
|
-
"gap"
|
|
601
|
-
> {
|
|
602
|
-
/** Element to render */
|
|
603
|
-
as?: T;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
declare function ListRoot<T extends ListTag = "ul">(
|
|
607
|
-
props: ListProps<T> & Omit<ComponentPropsWithRef<T>, keyof ListProps<T>>,
|
|
608
|
-
): JSX.Element;
|
|
609
|
-
|
|
610
|
-
declare namespace ListRoot {
|
|
611
|
-
var displayName: string;
|
|
612
|
-
var Item: typeof ListItem;
|
|
613
|
-
var ButtonItem: typeof ListButtonItem;
|
|
614
|
-
var ItemText: typeof ListItemText;
|
|
615
|
-
var ItemImage: typeof ListItemImage;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
declare type ListTag = (typeof LIST_TAG)[number];
|
|
619
|
-
|
|
137
|
+
type SpaceAutoNegative = (typeof SPACE_AUTO_NEGATIVE)[number];
|
|
620
138
|
/** @public */
|
|
621
|
-
|
|
139
|
+
type MarginProps = {
|
|
622
140
|
/** CSS **margin** property */
|
|
623
141
|
margin?: Responsive<SpaceAutoNegative>;
|
|
624
142
|
/** CSS **margin-left** and **margin-right** properties */
|
|
@@ -634,19 +152,10 @@ export declare type MarginProps = {
|
|
|
634
152
|
/** CSS **margin-left** property */
|
|
635
153
|
marginLeft?: Responsive<SpaceAutoNegative>;
|
|
636
154
|
};
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
"auto",
|
|
642
|
-
"scroll",
|
|
643
|
-
"clip",
|
|
644
|
-
];
|
|
645
|
-
|
|
646
|
-
/** @public */
|
|
647
|
-
export declare type Overflow = (typeof OVERFLOW)[number];
|
|
648
|
-
|
|
649
|
-
declare type OverflowProps = {
|
|
155
|
+
declare const OVERFLOW: readonly ["visible", "hidden", "auto", "scroll", "clip"];
|
|
156
|
+
/** @public */
|
|
157
|
+
type Overflow = (typeof OVERFLOW)[number];
|
|
158
|
+
type OverflowProps = {
|
|
650
159
|
/** CSS **overflow** property */
|
|
651
160
|
overflow?: Responsive<Overflow>;
|
|
652
161
|
/** CSS **overflow-x** property */
|
|
@@ -654,9 +163,8 @@ declare type OverflowProps = {
|
|
|
654
163
|
/** CSS **overflow-y** property */
|
|
655
164
|
overflowY?: Responsive<Overflow>;
|
|
656
165
|
};
|
|
657
|
-
|
|
658
166
|
/** @public */
|
|
659
|
-
|
|
167
|
+
interface PaddingProps {
|
|
660
168
|
/** CSS **padding** property */
|
|
661
169
|
padding?: Responsive<Space>;
|
|
662
170
|
/** CSS **padding-left** and **padding-right** properties */
|
|
@@ -672,43 +180,10 @@ export declare interface PaddingProps {
|
|
|
672
180
|
/** CSS **padding-left** property */
|
|
673
181
|
paddingLeft?: Responsive<Space>;
|
|
674
182
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
"top-end",
|
|
680
|
-
"right",
|
|
681
|
-
"right-start",
|
|
682
|
-
"right-end",
|
|
683
|
-
"bottom",
|
|
684
|
-
"bottom-start",
|
|
685
|
-
"bottom-end",
|
|
686
|
-
"left",
|
|
687
|
-
"left-start",
|
|
688
|
-
"left-end",
|
|
689
|
-
];
|
|
690
|
-
|
|
691
|
-
/** @public */
|
|
692
|
-
export declare type Placement = (typeof PLACEMENT)[number];
|
|
693
|
-
|
|
694
|
-
/** @public */
|
|
695
|
-
export declare type PlacementProps = {
|
|
696
|
-
/** Placement relative to anchor */
|
|
697
|
-
placement?: Placement;
|
|
698
|
-
};
|
|
699
|
-
|
|
700
|
-
declare const POSITION: readonly [
|
|
701
|
-
"absolute",
|
|
702
|
-
"fixed",
|
|
703
|
-
"relative",
|
|
704
|
-
"static",
|
|
705
|
-
"sticky",
|
|
706
|
-
];
|
|
707
|
-
|
|
708
|
-
/** @public */
|
|
709
|
-
export declare type Position = (typeof POSITION)[number];
|
|
710
|
-
|
|
711
|
-
declare type PositionProps = {
|
|
183
|
+
declare const POSITION: readonly ["absolute", "fixed", "relative", "static", "sticky"];
|
|
184
|
+
/** @public */
|
|
185
|
+
type Position = (typeof POSITION)[number];
|
|
186
|
+
type PositionProps = {
|
|
712
187
|
/** CSS **position** property */
|
|
713
188
|
position?: Responsive<Position>;
|
|
714
189
|
/** CSS **inset** property */
|
|
@@ -722,219 +197,139 @@ declare type PositionProps = {
|
|
|
722
197
|
/** CSS **left** property */
|
|
723
198
|
left?: Responsive<SpaceAuto>;
|
|
724
199
|
};
|
|
725
|
-
|
|
726
|
-
/** @public */
|
|
727
|
-
export declare function PressArea<T extends ElementType = "button">(
|
|
728
|
-
props: PressAreaProps<T> &
|
|
729
|
-
Omit<ComponentPropsWithRef<T>, keyof PressAreaProps<T>>,
|
|
730
|
-
): JSX.Element;
|
|
731
|
-
|
|
732
|
-
/** @public */
|
|
733
|
-
export declare interface PressAreaProps<
|
|
734
|
-
T extends React.ElementType = "button",
|
|
735
|
-
> {
|
|
736
|
-
/** Element to render */
|
|
737
|
-
as?: InteractiveAs<T>;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
/** @beta */
|
|
741
|
-
export declare function Radio(props: RadioProps): JSX.Element;
|
|
742
|
-
|
|
743
|
-
/** @beta */
|
|
744
|
-
export declare interface RadioProps
|
|
745
|
-
extends React.ComponentProps<"input">, MarginProps {
|
|
746
|
-
/** Error state */
|
|
747
|
-
error?: boolean;
|
|
748
|
-
/** Input label */
|
|
749
|
-
label: React.ReactNode;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
declare const RADIUS: readonly [0, 1, 2, 3, 4, 5, 6, "full"];
|
|
753
|
-
|
|
754
|
-
/** @public */
|
|
755
|
-
export declare type Radius = (typeof RADIUS)[number];
|
|
756
|
-
|
|
757
|
-
/** @public */
|
|
758
|
-
export declare type Responsive<T> =
|
|
759
|
-
| T
|
|
760
|
-
| []
|
|
761
|
-
| ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
762
|
-
length: 1;
|
|
763
|
-
})
|
|
764
|
-
| ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
765
|
-
length: 2;
|
|
766
|
-
})
|
|
767
|
-
| ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
768
|
-
length: 3;
|
|
769
|
-
})
|
|
770
|
-
| ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
771
|
-
length: 4;
|
|
772
|
-
})
|
|
773
|
-
| ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
774
|
-
length: 5;
|
|
775
|
-
})
|
|
776
|
-
| ([T | undefined | null, ...(T | undefined | null)[]] & {
|
|
777
|
-
length: 6;
|
|
778
|
-
});
|
|
779
|
-
|
|
780
200
|
declare const SHADOW: readonly [0, 1, 2, 3, 4, 5];
|
|
781
|
-
|
|
782
201
|
/** @public */
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
declare type ShadowProps = {
|
|
202
|
+
type Shadow = (typeof SHADOW)[number];
|
|
203
|
+
type ShadowProps = {
|
|
786
204
|
/** CSS **box-shadow** property */
|
|
787
205
|
shadow?: Shadow;
|
|
788
206
|
};
|
|
789
|
-
|
|
790
|
-
/**
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
/** Use label instead */
|
|
802
|
-
children?: never;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
declare const SPACE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
806
|
-
|
|
807
|
-
/** @public */
|
|
808
|
-
export declare type Space = (typeof SPACE)[number];
|
|
809
|
-
|
|
810
|
-
declare const SPACE_AUTO: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "auto"];
|
|
811
|
-
|
|
812
|
-
declare const SPACE_AUTO_NEGATIVE: readonly [
|
|
813
|
-
-9,
|
|
814
|
-
-8,
|
|
815
|
-
-7,
|
|
816
|
-
-6,
|
|
817
|
-
-5,
|
|
818
|
-
-4,
|
|
819
|
-
-3,
|
|
820
|
-
-2,
|
|
821
|
-
-1,
|
|
822
|
-
0,
|
|
823
|
-
1,
|
|
824
|
-
2,
|
|
825
|
-
3,
|
|
826
|
-
4,
|
|
827
|
-
5,
|
|
828
|
-
6,
|
|
829
|
-
7,
|
|
830
|
-
8,
|
|
831
|
-
9,
|
|
832
|
-
"auto",
|
|
833
|
-
];
|
|
834
|
-
|
|
835
|
-
declare const SPACE_INHERIT: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "inherit"];
|
|
836
|
-
|
|
207
|
+
type WidthProps = {
|
|
208
|
+
/** CSS **width** property */
|
|
209
|
+
width?: Responsive<string>;
|
|
210
|
+
/** CSS **min-width** property */
|
|
211
|
+
minWidth?: Responsive<string>;
|
|
212
|
+
/** CSS **max-width** property */
|
|
213
|
+
maxWidth?: Responsive<string>;
|
|
214
|
+
};
|
|
215
|
+
type ZIndexProps = {
|
|
216
|
+
/** CSS z-index property */
|
|
217
|
+
zIndex?: Responsive<number>;
|
|
218
|
+
};
|
|
837
219
|
/** @public */
|
|
838
|
-
|
|
839
|
-
|
|
220
|
+
interface LayoutProps extends ToneWithDefaultProps, WidthProps, HeightProps, MarginProps, BorderProps, PaddingProps, PositionProps, OverflowProps, FlexChildProps, GridChildProps, ZIndexProps, ShadowProps {}
|
|
221
|
+
declare const DISPLAY_BLOCK: readonly ["block", "inline-block", "none"];
|
|
840
222
|
/** @public */
|
|
841
|
-
|
|
842
|
-
|
|
223
|
+
type DisplayBlock = (typeof DISPLAY_BLOCK)[number];
|
|
224
|
+
declare const DISPLAY_FLEX: readonly ["flex", "inline-flex", "none"];
|
|
843
225
|
/** @public */
|
|
844
|
-
|
|
845
|
-
|
|
226
|
+
type DisplayFlex = (typeof DISPLAY_FLEX)[number];
|
|
227
|
+
declare const DISPLAY_GRID: readonly ["grid", "inline-grid", "none"];
|
|
846
228
|
/** @public */
|
|
847
|
-
|
|
848
|
-
|
|
229
|
+
type DisplayGrid = (typeof DISPLAY_GRID)[number];
|
|
849
230
|
/** @public */
|
|
850
|
-
|
|
851
|
-
|
|
231
|
+
interface BoxProps<T extends React.ElementType = 'div'> extends LayoutProps {
|
|
232
|
+
/**
|
|
233
|
+
* HTML element or component to render.
|
|
234
|
+
*/
|
|
235
|
+
as?: T;
|
|
236
|
+
/**
|
|
237
|
+
* CSS `display` property.
|
|
238
|
+
* @remarks Does not include `'flex'` or `'grid'`. Use the Flex or Grid components for those.
|
|
239
|
+
*/
|
|
240
|
+
display?: Responsive<DisplayBlock>;
|
|
852
241
|
}
|
|
853
|
-
|
|
854
|
-
/** @beta */
|
|
855
|
-
export declare function Switch(props: SwitchProps): JSX.Element;
|
|
856
|
-
|
|
857
|
-
/** @beta */
|
|
858
|
-
export declare interface SwitchProps
|
|
859
|
-
extends React.ComponentProps<"input">, MarginProps {
|
|
860
|
-
/** Error state */
|
|
861
|
-
error?: boolean;
|
|
862
|
-
/** Input label */
|
|
863
|
-
label: React.ReactNode;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
/** @public */
|
|
867
|
-
declare function Text_2<T extends ElementType = "span">({
|
|
868
|
-
size,
|
|
869
|
-
...props
|
|
870
|
-
}: TextProps<T> &
|
|
871
|
-
Omit<ComponentPropsWithRef<T>, keyof TextProps<T>>): JSX.Element;
|
|
872
|
-
export { Text_2 as Text };
|
|
873
|
-
|
|
874
|
-
declare const TEXT_ALIGN: readonly ["left", "center", "right", "justify"];
|
|
875
|
-
|
|
876
|
-
declare const TEXT_SIZE: readonly [0, 1, 2, 3, 4];
|
|
877
|
-
|
|
878
242
|
/** @public */
|
|
879
|
-
export declare
|
|
880
|
-
|
|
243
|
+
export declare function Box<T extends ElementType = 'div'>({ display, ...props }: BoxProps<T> & Omit<ComponentPropsWithRef<T>, keyof BoxProps<T>>): import("react").JSX.Element;
|
|
244
|
+
declare const BUTTON_DENSITY: readonly ["regular", "loose"];
|
|
245
|
+
type ButtonDensity = (typeof BUTTON_DENSITY)[number];
|
|
246
|
+
declare const BUTTON_LEVEL: readonly ["primary", "secondary", "tertiary"];
|
|
247
|
+
type ButtonLevel = (typeof BUTTON_LEVEL)[number];
|
|
248
|
+
declare const BUTTON_TONE: readonly ["neutral", "critical"];
|
|
249
|
+
type ButtonTone = (typeof BUTTON_TONE)[number];
|
|
250
|
+
declare const INTERACTIVE_TAG: readonly ["button", "a"];
|
|
251
|
+
type InteractiveTag = (typeof INTERACTIVE_TAG)[number];
|
|
252
|
+
type InteractiveAs<T extends React.ElementType> = T extends InteractiveTag ? T : T extends string ? never : T;
|
|
881
253
|
/** @public */
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
as?: T
|
|
887
|
-
/**
|
|
888
|
-
|
|
254
|
+
interface ButtonProps<T extends React.ElementType = 'button'> {
|
|
255
|
+
/**
|
|
256
|
+
* HTML element to render.
|
|
257
|
+
*/
|
|
258
|
+
as?: InteractiveAs<T>;
|
|
259
|
+
/**
|
|
260
|
+
* Sets padding and gap together to specify size.
|
|
261
|
+
*/
|
|
262
|
+
density?: ButtonDensity;
|
|
263
|
+
/**
|
|
264
|
+
* Sets Button to fill the width of its container.
|
|
265
|
+
*/
|
|
266
|
+
fullWidth?: Responsive<boolean>;
|
|
267
|
+
/**
|
|
268
|
+
* Shows an icon in the start position (left side in left-to-right languages).
|
|
269
|
+
*/
|
|
270
|
+
iconStart?: React.ElementType | React.ReactNode;
|
|
271
|
+
/**
|
|
272
|
+
* Shows an icon in the end position (right side in left-to-right languages).
|
|
273
|
+
*/
|
|
274
|
+
iconEnd?: React.ElementType | React.ReactNode;
|
|
275
|
+
/**
|
|
276
|
+
* Sets the importance of Button's action.
|
|
277
|
+
*/
|
|
278
|
+
level?: ButtonLevel;
|
|
279
|
+
/**
|
|
280
|
+
* Places Button into a loading state.
|
|
281
|
+
*/
|
|
282
|
+
loading?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Sets Button's text label.
|
|
285
|
+
*/
|
|
286
|
+
text?: string;
|
|
287
|
+
/**
|
|
288
|
+
* Sets Button's semantic meaning and related color.
|
|
289
|
+
*/
|
|
290
|
+
tone?: ButtonTone;
|
|
889
291
|
}
|
|
890
|
-
|
|
891
|
-
/** @public */
|
|
892
|
-
export declare type TextSize = (typeof TEXT_SIZE)[number];
|
|
893
|
-
|
|
894
|
-
declare const TONE: readonly [
|
|
895
|
-
"neutral",
|
|
896
|
-
"positive",
|
|
897
|
-
"suggest",
|
|
898
|
-
"caution",
|
|
899
|
-
"critical",
|
|
900
|
-
];
|
|
901
|
-
|
|
902
|
-
/** @public */
|
|
903
|
-
export declare type Tone = (typeof TONE)[number];
|
|
904
|
-
|
|
905
|
-
declare type ToneProps = {
|
|
906
|
-
/** CSS **background-color** property */
|
|
907
|
-
tone?: Tone;
|
|
908
|
-
};
|
|
909
|
-
|
|
910
292
|
/** @public */
|
|
911
|
-
export declare function
|
|
912
|
-
|
|
293
|
+
export declare function Button<T extends ElementType = 'button'>({ density, level, tone, ...props }: ButtonProps<T> & Omit<ComponentPropsWithRef<T>, keyof ButtonProps<T>>): import("react").JSX.Element;
|
|
294
|
+
declare const DENSITY: readonly ["compact", "regular", "loose"];
|
|
913
295
|
/** @public */
|
|
914
|
-
|
|
915
|
-
props: TooltipGroupProps<T> &
|
|
916
|
-
Omit<ComponentPropsWithRef<T>, keyof TooltipGroupProps<T>>,
|
|
917
|
-
): JSX.Element;
|
|
918
|
-
|
|
296
|
+
type Density = (typeof DENSITY)[number];
|
|
919
297
|
/** @public */
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
298
|
+
interface CardProps<T extends React.ElementType = 'div'> extends MarginProps, ToneWithDefaultProps {
|
|
299
|
+
/**
|
|
300
|
+
* HTML element or component to render.
|
|
301
|
+
*/
|
|
924
302
|
as?: T;
|
|
303
|
+
/**
|
|
304
|
+
* Sets padding, gap, and border-radius together to specify size. This prop is used in place of separate `padding`, `gap`, and `border-radius` props.
|
|
305
|
+
*/
|
|
306
|
+
density?: Responsive<Density>;
|
|
925
307
|
}
|
|
926
|
-
|
|
927
308
|
/** @public */
|
|
928
|
-
export declare
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
309
|
+
export declare function Card<T extends ElementType = 'div'>({ density, tone, ...props }: CardProps<T> & Omit<ComponentPropsWithRef<T>, keyof CardProps<T>>): import("react").JSX.Element;
|
|
310
|
+
/** @beta */
|
|
311
|
+
interface CheckboxProps extends React.ComponentProps<'input'> {
|
|
312
|
+
/**
|
|
313
|
+
* Applies error styling to the checkbox mark for invalid states.
|
|
314
|
+
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
315
|
+
*/
|
|
316
|
+
hasError?: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Renders the "mixed state" mark (a horizontal line).
|
|
319
|
+
* @remarks Use when the checkbox controls a group with some-but-not-all children checked.
|
|
320
|
+
*/
|
|
321
|
+
indeterminate?: boolean;
|
|
322
|
+
}
|
|
323
|
+
/** @beta */
|
|
324
|
+
export declare function Checkbox(props: CheckboxProps): import("react").JSX.Element;
|
|
325
|
+
declare const FONT_WEIGHT: readonly ["regular", "medium", "semibold", "bold"];
|
|
326
|
+
/** @public */
|
|
327
|
+
type FontWeight = (typeof FONT_WEIGHT)[number];
|
|
328
|
+
declare const TEXT_ALIGN: readonly ["left", "center", "right"];
|
|
329
|
+
/** @public */
|
|
330
|
+
type TextAlign = (typeof TEXT_ALIGN)[number];
|
|
936
331
|
/** @public */
|
|
937
|
-
|
|
332
|
+
interface TypographyProps extends MarginProps, ToneProps {
|
|
938
333
|
/** CSS **text-align** property */
|
|
939
334
|
align?: Responsive<TextAlign>;
|
|
940
335
|
/** CSS **color** property */
|
|
@@ -946,48 +341,624 @@ export declare interface TypographyProps extends MarginProps, ToneProps {
|
|
|
946
341
|
/** CSS **font-weight** property */
|
|
947
342
|
weight?: FontWeight;
|
|
948
343
|
}
|
|
949
|
-
|
|
344
|
+
declare const CODE_SIZE: readonly [0, 1, 2, 3, 4];
|
|
345
|
+
/** @public */
|
|
346
|
+
type CodeSize = (typeof CODE_SIZE)[number];
|
|
347
|
+
interface CodeBaseProps extends Omit<TypographyProps, 'align' | 'truncate' | 'tone' | 'weight'> {
|
|
348
|
+
/**
|
|
349
|
+
* Refractor language for syntax highlighting.
|
|
350
|
+
*/
|
|
351
|
+
language?: string;
|
|
352
|
+
/**
|
|
353
|
+
* Sets font size.
|
|
354
|
+
*/
|
|
355
|
+
size?: Responsive<CodeSize>;
|
|
356
|
+
}
|
|
357
|
+
/** @public */
|
|
358
|
+
type CodeProps = (CodeBaseProps & {
|
|
359
|
+
/**
|
|
360
|
+
* Render code inline or as a block.
|
|
361
|
+
* @remarks Block code is wrapped in a `<pre>` tag.
|
|
362
|
+
*/
|
|
363
|
+
inline?: false;
|
|
364
|
+
} & Omit<React.ComponentPropsWithRef<'pre'>, keyof CodeBaseProps>) | (CodeBaseProps & {
|
|
365
|
+
inline: true;
|
|
366
|
+
} & Omit<React.ComponentPropsWithRef<'span'>, keyof CodeBaseProps>);
|
|
367
|
+
/** @public */
|
|
368
|
+
export declare function Code({ size, ...props }: CodeProps): import("react").JSX.Element;
|
|
369
|
+
declare const CONTAINER_SIZE: readonly [0, 1, 2, 3, 4, 5];
|
|
950
370
|
/** @public */
|
|
951
|
-
|
|
952
|
-
props: VisuallyHiddenProps<T> &
|
|
953
|
-
Omit<ComponentPropsWithRef<T>, keyof VisuallyHiddenProps<T>>,
|
|
954
|
-
): JSX.Element;
|
|
955
|
-
|
|
371
|
+
type ContainerSize = (typeof CONTAINER_SIZE)[number];
|
|
956
372
|
/** @public */
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
373
|
+
interface ContainerProps<T extends React.ElementType = 'div'> extends LayoutProps {
|
|
374
|
+
/**
|
|
375
|
+
* HTML element or component to render.
|
|
376
|
+
*/
|
|
961
377
|
as?: T;
|
|
962
|
-
/**
|
|
963
|
-
|
|
378
|
+
/**
|
|
379
|
+
* Maximum width of the container.
|
|
380
|
+
*/
|
|
381
|
+
size?: Responsive<ContainerSize>;
|
|
964
382
|
}
|
|
965
|
-
|
|
966
383
|
/** @public */
|
|
967
|
-
export declare function
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
384
|
+
export declare function Container<T extends ElementType = 'div'>({ marginX, size, ...props }: ContainerProps<T> & Omit<ComponentPropsWithRef<T>, keyof ContainerProps<T>>): import("react").JSX.Element;
|
|
385
|
+
/** @beta */
|
|
386
|
+
interface DialogProps extends Omit<React.ComponentProps<'dialog'>, 'open'> {
|
|
387
|
+
/**
|
|
388
|
+
* Text for the dialog heading.
|
|
389
|
+
* @remarks Recommended for accessibility. The component sets `aria-labelledby` to the heading when you give this prop.
|
|
390
|
+
*/
|
|
391
|
+
header?: string;
|
|
392
|
+
/**
|
|
393
|
+
* A function to call alongside the native `close` event.
|
|
394
|
+
* @remarks Use it to set `open` back to `false`. It runs for every close cause: the Escape key, a backdrop click, the close button, or a programmatic close.
|
|
395
|
+
*/
|
|
396
|
+
onClose: React.ReactEventHandler<HTMLDialogElement>;
|
|
397
|
+
/**
|
|
398
|
+
* Toggles the dialog's open state.
|
|
399
|
+
* @remarks `true` calls `showModal()` on the element. `false` calls `close()`.
|
|
400
|
+
*/
|
|
401
|
+
open?: boolean;
|
|
402
|
+
/** Sets the max width of the dialog */
|
|
403
|
+
size?: Responsive<ContainerSize>;
|
|
404
|
+
/** CSS length value used to set the Dialog’s distance from the top of the viewport; Dialog is centered if not provided */
|
|
405
|
+
topAnchor?: string;
|
|
406
|
+
}
|
|
407
|
+
declare function DialogRoot({ open, size, ...props }: DialogProps): import("react").JSX.Element;
|
|
408
|
+
declare namespace DialogRoot {
|
|
409
|
+
var displayName: string;
|
|
410
|
+
var Content: typeof DialogContent;
|
|
411
|
+
var Footer: typeof DialogFooter;
|
|
412
|
+
}
|
|
413
|
+
declare function DialogContent(props: ComponentProps<'div'>): import("react").JSX.Element;
|
|
414
|
+
declare function DialogFooter(props: ComponentProps<'div'>): import("react").JSX.Element;
|
|
415
|
+
/**
|
|
416
|
+
* @beta
|
|
417
|
+
*
|
|
418
|
+
* Renders a modal dialog element — should not be used for nonmodal dialogs.
|
|
419
|
+
* Modal dialogs make their containing documents inert, and render on the topmost
|
|
420
|
+
* layer within that containing document; they must be dimissed before the containing
|
|
421
|
+
* document and its contents become unblocked. They also trap focus within the bounds
|
|
422
|
+
* of the dialog element and its descendants.
|
|
423
|
+
*
|
|
424
|
+
* For more on dialogs and modality, refer to the HTML specification for the dialog element:
|
|
425
|
+
* https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-element
|
|
426
|
+
*/
|
|
427
|
+
export declare const Dialog: typeof DialogRoot;
|
|
428
|
+
/** @public */
|
|
429
|
+
interface DividerProps extends React.ComponentProps<'hr'>, MarginProps {}
|
|
430
|
+
/** @public */
|
|
431
|
+
export declare function Divider(props: DividerProps): import("react").JSX.Element;
|
|
432
|
+
declare const EYEBROW_SIZE: readonly [0, 1, 2, 3, 4, 5];
|
|
433
|
+
/** @public */
|
|
434
|
+
type EyebrowSize = (typeof EYEBROW_SIZE)[number];
|
|
435
|
+
/** @public */
|
|
436
|
+
interface EyebrowProps<T extends React.ElementType = 'span'> extends TypographyProps {
|
|
437
|
+
/**
|
|
438
|
+
* HTML element to render.
|
|
439
|
+
*/
|
|
440
|
+
as?: T;
|
|
441
|
+
/**
|
|
442
|
+
* Sets font size. Uses the same scale as Label.
|
|
443
|
+
*/
|
|
444
|
+
size?: Responsive<EyebrowSize>;
|
|
445
|
+
}
|
|
446
|
+
/** @public */
|
|
447
|
+
export declare function Eyebrow<T extends ElementType = 'span'>({ size, weight, ...props }: EyebrowProps<T> & Omit<ComponentPropsWithRef<T>, keyof EyebrowProps<T>>): import("react").JSX.Element;
|
|
448
|
+
declare const ALIGN_ITEMS: readonly ["baseline", "center", "flex-end", "flex-start", "stretch"];
|
|
449
|
+
/** @public */
|
|
450
|
+
type AlignItems = (typeof ALIGN_ITEMS)[number];
|
|
451
|
+
declare const JUSTIFY_CONTENT: readonly ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly"];
|
|
452
|
+
/** @public */
|
|
453
|
+
type JustifyContent = (typeof JUSTIFY_CONTENT)[number];
|
|
454
|
+
declare const FLEX_DIRECTION: readonly ["row", "row-reverse", "column", "column-reverse"];
|
|
455
|
+
/** @public */
|
|
456
|
+
type FlexDirection = (typeof FLEX_DIRECTION)[number];
|
|
457
|
+
declare const FLEX_WRAP: readonly ["wrap", "wrap-reverse", "nowrap"];
|
|
458
|
+
/** @public */
|
|
459
|
+
type FlexWrap = (typeof FLEX_WRAP)[number];
|
|
460
|
+
/** @public */
|
|
461
|
+
type FlexParentProps = {
|
|
462
|
+
/** CSS **align-items** property */
|
|
463
|
+
alignItems?: Responsive<AlignItems>;
|
|
464
|
+
/** CSS **justify-content** property */
|
|
465
|
+
justifyContent?: Responsive<JustifyContent>;
|
|
466
|
+
/** CSS **flex-direction** property */
|
|
467
|
+
flexDirection?: Responsive<FlexDirection>;
|
|
468
|
+
/** CSS **flex-wrap** property */
|
|
469
|
+
flexWrap?: Responsive<FlexWrap>;
|
|
470
|
+
};
|
|
971
471
|
/** @public */
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
/**
|
|
472
|
+
type GapProps = {
|
|
473
|
+
/** CSS **gap** property */
|
|
474
|
+
gap?: Responsive<SpaceInherit>;
|
|
475
|
+
/** CSS **row-gap** property */
|
|
476
|
+
rowGap?: Responsive<SpaceInherit>;
|
|
477
|
+
/** CSS **column-gap** property */
|
|
478
|
+
columnGap?: Responsive<SpaceInherit>;
|
|
479
|
+
};
|
|
480
|
+
/** @public */
|
|
481
|
+
interface FlexProps<T extends React.ElementType = 'div'> extends FlexParentProps, GapProps, LayoutProps {
|
|
482
|
+
/**
|
|
483
|
+
* HTML element or component to render.
|
|
484
|
+
*/
|
|
976
485
|
as?: T;
|
|
486
|
+
/**
|
|
487
|
+
* CSS `display` property.
|
|
488
|
+
*/
|
|
489
|
+
display?: Responsive<DisplayFlex>;
|
|
977
490
|
}
|
|
978
|
-
|
|
979
|
-
declare
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
491
|
+
/** @public */
|
|
492
|
+
export declare function Flex<T extends ElementType = 'div'>({ display, ...props }: FlexProps<T> & Omit<ComponentPropsWithRef<T>, keyof FlexProps<T>>): import("react").JSX.Element;
|
|
493
|
+
declare const GRID_AUTO_FLOW: readonly ["row", "column", "row dense", "column dense", "dense"];
|
|
494
|
+
/** @public */
|
|
495
|
+
type GridAutoFlow = (typeof GRID_AUTO_FLOW)[number];
|
|
496
|
+
/** @public */
|
|
497
|
+
type GridParentProps = {
|
|
498
|
+
/** CSS **grid-auto-flow** property */
|
|
499
|
+
gridAutoFlow?: Responsive<GridAutoFlow>;
|
|
500
|
+
/** CSS **grid-auto-columns** property */
|
|
501
|
+
gridAutoColumns?: Responsive<string>;
|
|
502
|
+
/** CSS **grid-auto-row** property */
|
|
503
|
+
gridAutoRows?: Responsive<string>;
|
|
504
|
+
/** CSS **grid-template-columns** property */
|
|
505
|
+
gridTemplateColumns?: Responsive<string>;
|
|
506
|
+
/** CSS **grid-template-rows** property */
|
|
507
|
+
gridTemplateRows?: Responsive<string>;
|
|
986
508
|
};
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
/**
|
|
990
|
-
|
|
509
|
+
/** @public */
|
|
510
|
+
interface GridProps<T extends React.ElementType = 'div'> extends Pick<FlexParentProps, 'alignItems' | 'justifyContent'>, GridParentProps, GapProps, LayoutProps {
|
|
511
|
+
/**
|
|
512
|
+
* HTML element or component to render.
|
|
513
|
+
*/
|
|
514
|
+
as?: T;
|
|
515
|
+
/**
|
|
516
|
+
* CSS `display` property.
|
|
517
|
+
*/
|
|
518
|
+
display?: Responsive<DisplayGrid>;
|
|
519
|
+
}
|
|
520
|
+
/** @public */
|
|
521
|
+
export declare function Grid<T extends ElementType = 'div'>({ display, ...props }: GridProps<T> & Omit<ComponentPropsWithRef<T>, keyof GridProps<T>>): import("react").JSX.Element;
|
|
522
|
+
/** @public */
|
|
523
|
+
interface HStackProps<T extends React.ElementType = 'div'> extends Pick<FlexProps<T>, 'as' | 'gap'> {}
|
|
524
|
+
/** @public */
|
|
525
|
+
export declare function HStack<T extends ElementType = 'div'>({ className, ...props }: HStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof HStackProps<T>>): import("react").JSX.Element;
|
|
526
|
+
declare const HEADING_TAG: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
527
|
+
type HeadingTag = (typeof HEADING_TAG)[number];
|
|
528
|
+
declare const HEADING_SIZE: readonly [0, 1, 2, 3, 4, 5];
|
|
529
|
+
/** @public */
|
|
530
|
+
type HeadingSize = (typeof HEADING_SIZE)[number];
|
|
531
|
+
/** @public */
|
|
532
|
+
interface HeadingProps extends Omit<TypographyProps, 'muted' | 'weight'> {
|
|
533
|
+
/**
|
|
534
|
+
* Semantic heading element to render.
|
|
535
|
+
*/
|
|
536
|
+
as: HeadingTag;
|
|
537
|
+
/**
|
|
538
|
+
* Sets font size.
|
|
539
|
+
* @remarks Independent of `as`.
|
|
540
|
+
*/
|
|
541
|
+
size?: Responsive<HeadingSize>;
|
|
542
|
+
}
|
|
543
|
+
/** @public */
|
|
544
|
+
export declare function Heading<T extends ElementType = 'h2'>({ size, ...props }: HeadingProps & Omit<ComponentPropsWithRef<T>, keyof HeadingProps>): import("react").JSX.Element;
|
|
545
|
+
/** @public */
|
|
546
|
+
interface HotkeysProps extends React.ComponentProps<'kbd'> {
|
|
547
|
+
/**
|
|
548
|
+
* The keys in the shortcut, in order. Each one renders as a KBD.
|
|
549
|
+
*/
|
|
550
|
+
keys?: string[];
|
|
551
|
+
}
|
|
552
|
+
/** @alpha */
|
|
553
|
+
export declare function Hotkeys({ keys, ...props }: HotkeysProps): import("react").JSX.Element | null;
|
|
554
|
+
declare const ICON_SIZE: readonly [0, 1, 2, 3, 4];
|
|
555
|
+
/** @public */
|
|
556
|
+
type IconSize = (typeof ICON_SIZE)[number];
|
|
557
|
+
/** @public */
|
|
558
|
+
interface IconProps extends ComponentProps<'svg'>, Pick<TypographyProps, 'muted'>, MarginProps, ToneProps {
|
|
559
|
+
/**
|
|
560
|
+
* The icon component to render.
|
|
561
|
+
*/
|
|
562
|
+
icon: React.ComponentType<SVGProps<SVGSVGElement>> | React.ReactElement<SVGProps<SVGSVGElement>>;
|
|
563
|
+
/**
|
|
564
|
+
* Sets icon size.
|
|
565
|
+
*/
|
|
566
|
+
size?: Responsive<IconSize>;
|
|
567
|
+
}
|
|
568
|
+
/** @public */
|
|
569
|
+
export declare function Icon({ icon, size, ...props }: IconProps): import("react").ReactElement<SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
|
|
570
|
+
/** @public */
|
|
571
|
+
interface IconButtonProps<T extends React$1.ElementType = 'button'> extends Pick<ButtonProps<T>, 'as' | 'density' | 'level' | 'loading' | 'tone'> {
|
|
572
|
+
/**
|
|
573
|
+
* Accessible name for the button.
|
|
574
|
+
* @remarks Because IconButtons have no visible text, this is required.
|
|
575
|
+
*/
|
|
576
|
+
'aria-label': string;
|
|
577
|
+
/**
|
|
578
|
+
* Icon to render.
|
|
579
|
+
*/
|
|
580
|
+
'icon': React$1.ComponentType<SVGProps<SVGSVGElement>>;
|
|
581
|
+
}
|
|
582
|
+
/** @public */
|
|
583
|
+
export declare function IconButton<T extends ElementType = 'button'>(props: IconButtonProps<T> & Omit<ComponentPropsWithRef<T>, keyof IconButtonProps<T>>): import("react").JSX.Element;
|
|
584
|
+
/** @beta */
|
|
585
|
+
interface IndicatorProps<T extends React.ElementType = 'span'> extends ToneProps {
|
|
586
|
+
/**
|
|
587
|
+
* HTML element to render.
|
|
588
|
+
*/
|
|
589
|
+
as?: T;
|
|
590
|
+
/**
|
|
591
|
+
* Accessible label.
|
|
592
|
+
*/
|
|
593
|
+
label?: string;
|
|
594
|
+
}
|
|
595
|
+
/** @beta */
|
|
596
|
+
export declare function Indicator<T extends ElementType = 'span'>({ tone, ...props }: IndicatorProps<T> & Omit<ComponentPropsWithRef<T>, keyof IndicatorProps<T>>): import("react").JSX.Element;
|
|
597
|
+
/** @public */
|
|
598
|
+
interface IndicatorStackProps<T extends React.ElementType = 'div'> {
|
|
599
|
+
/**
|
|
600
|
+
* HTML element to render.
|
|
601
|
+
*/
|
|
602
|
+
as?: T;
|
|
603
|
+
}
|
|
604
|
+
/** @public */
|
|
605
|
+
export declare function IndicatorStack<T extends ElementType = 'div'>(props: IndicatorStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof IndicatorStackProps<T>>): import("react").JSX.Element;
|
|
606
|
+
/** @deprecated Use HStack component instead */
|
|
607
|
+
/** @public */
|
|
608
|
+
interface InlineProps<T extends React.ElementType = 'div'> extends PaddingProps {
|
|
609
|
+
/**
|
|
610
|
+
* HTML element or component to render.
|
|
611
|
+
*/
|
|
612
|
+
as?: T;
|
|
613
|
+
/**
|
|
614
|
+
* Space between children.
|
|
615
|
+
*/
|
|
616
|
+
gap?: Responsive<SpaceInherit>;
|
|
617
|
+
}
|
|
618
|
+
/** @deprecated Use HStack component instead */
|
|
619
|
+
/** @public */
|
|
620
|
+
export declare function Inline<T extends ElementType = 'div'>(props: InlineProps<T> & Omit<ComponentPropsWithRef<T>, keyof InlineProps<T>>): import("react").JSX.Element;
|
|
621
|
+
/** @public */
|
|
622
|
+
interface KBDProps extends React.ComponentProps<'kbd'> {
|
|
623
|
+
/**
|
|
624
|
+
* Sets KBD's key label.
|
|
625
|
+
*/
|
|
626
|
+
text?: string;
|
|
627
|
+
/**
|
|
628
|
+
* Not accepted.
|
|
629
|
+
* @remarks Pass the key label via `text`.
|
|
630
|
+
*/
|
|
631
|
+
children?: never;
|
|
632
|
+
}
|
|
633
|
+
/** @alpha */
|
|
634
|
+
export declare function KBD(props: KBDProps): import("react").JSX.Element;
|
|
635
|
+
/** @beta */
|
|
636
|
+
interface LinkProps extends React.ComponentProps<'a'> {
|
|
637
|
+
/**
|
|
638
|
+
* Sets the link to `target="_blank"` and `rel="noopener noreferrer"`.
|
|
639
|
+
*/
|
|
640
|
+
openInNewTab?: boolean;
|
|
641
|
+
/**
|
|
642
|
+
* Underlines the link.
|
|
643
|
+
*/
|
|
644
|
+
underlined?: boolean;
|
|
645
|
+
}
|
|
646
|
+
/** @beta */
|
|
647
|
+
export declare function Link({ underlined, ...props }: LinkProps): import("react").JSX.Element;
|
|
648
|
+
declare const LIST_TAG: readonly ["ol", "ul"];
|
|
649
|
+
type ListTag = (typeof LIST_TAG)[number];
|
|
650
|
+
/** @beta */
|
|
651
|
+
interface ListProps<T extends ListTag = 'ul'> extends Pick<GapProps, 'gap'> {
|
|
652
|
+
/**
|
|
653
|
+
* HTML element to render.
|
|
654
|
+
*/
|
|
655
|
+
as?: T;
|
|
656
|
+
}
|
|
657
|
+
/** @beta */
|
|
658
|
+
interface ListItemProps extends React$1.ComponentProps<'li'> {
|
|
659
|
+
/**
|
|
660
|
+
* Sets horizontal padding, gap, and minimum row height together.
|
|
661
|
+
*/
|
|
662
|
+
density?: Responsive<Density>;
|
|
663
|
+
/**
|
|
664
|
+
* Slot at the left edge of the row.
|
|
665
|
+
*/
|
|
666
|
+
start?: React$1.ReactNode;
|
|
667
|
+
/**
|
|
668
|
+
* Slot at the right edge of the row.
|
|
669
|
+
*/
|
|
670
|
+
end?: React$1.ReactNode;
|
|
671
|
+
}
|
|
672
|
+
/** @beta */
|
|
673
|
+
interface ListButtonItemProps<T extends React$1.ElementType = 'button'> extends ListItemProps {
|
|
674
|
+
/**
|
|
675
|
+
* Element or component to render for the press target.
|
|
676
|
+
*/
|
|
677
|
+
as?: InteractiveAs<T>;
|
|
678
|
+
/**
|
|
679
|
+
* Marks the row as the current selection.
|
|
680
|
+
*/
|
|
681
|
+
selected?: boolean;
|
|
682
|
+
}
|
|
683
|
+
/** @beta */
|
|
684
|
+
interface ListItemTextProps<T extends React$1.ElementType = 'div'> {
|
|
685
|
+
/**
|
|
686
|
+
* HTML element to render.
|
|
687
|
+
*/
|
|
688
|
+
as?: T;
|
|
689
|
+
/**
|
|
690
|
+
* Main label.
|
|
691
|
+
*/
|
|
692
|
+
title?: React$1.ReactNode;
|
|
693
|
+
/**
|
|
694
|
+
* Text below the title.
|
|
695
|
+
*/
|
|
696
|
+
subtitle?: React$1.ReactNode;
|
|
697
|
+
}
|
|
698
|
+
declare function ListRoot<T extends ListTag = 'ul'>(props: ListProps<T> & Omit<ComponentPropsWithRef<T>, keyof ListProps<T>>): import("react").JSX.Element;
|
|
699
|
+
declare namespace ListRoot {
|
|
700
|
+
var displayName: string;
|
|
701
|
+
var Item: typeof ListItem;
|
|
702
|
+
var ButtonItem: typeof ListButtonItem;
|
|
703
|
+
var ItemText: typeof ListItemText;
|
|
704
|
+
var ItemImage: typeof ListItemImage;
|
|
705
|
+
}
|
|
706
|
+
declare function ListItem({ density, ...props }: ListItemProps): import("react").JSX.Element;
|
|
707
|
+
declare function ListButtonItem<T extends ElementType = 'button'>({ density, ...props }: ListButtonItemProps<T> & Omit<ComponentPropsWithRef<T>, keyof ListButtonItemProps<T>>): import("react").JSX.Element;
|
|
708
|
+
declare function ListItemText<T extends ElementType = 'div'>(props: ListItemTextProps<T> & Omit<ComponentPropsWithRef<T>, keyof ListItemTextProps<T>>): import("react").JSX.Element;
|
|
709
|
+
declare function ListItemImage(props: ComponentProps<'img'>): import("react").JSX.Element;
|
|
710
|
+
/** @beta */
|
|
711
|
+
export declare const List: typeof ListRoot;
|
|
712
|
+
declare const PLACEMENT: readonly ["top", "top-start", "top-end", "right", "right-start", "right-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end"];
|
|
713
|
+
/** @public */
|
|
714
|
+
type Placement = (typeof PLACEMENT)[number];
|
|
715
|
+
/** @public */
|
|
716
|
+
type PlacementProps = {
|
|
717
|
+
/** Placement relative to anchor */
|
|
718
|
+
placement?: Placement;
|
|
719
|
+
};
|
|
720
|
+
/** @beta */
|
|
721
|
+
interface PopoverProps extends Omit<React.ComponentProps<'div'>, 'children' | 'content'>, PlacementProps {
|
|
722
|
+
/**
|
|
723
|
+
* Shared anchor identifier.
|
|
724
|
+
* @remarks Set the same value on a Tooltip and a Popover to point both at one trigger.
|
|
725
|
+
*/
|
|
726
|
+
anchorName?: React.ReactNode;
|
|
727
|
+
/**
|
|
728
|
+
* The trigger element.
|
|
729
|
+
* @remarks Popover clones it and attaches the `popovertarget` attribute that opens the floating layer.
|
|
730
|
+
*/
|
|
731
|
+
children: React.ReactElement<Record<string, unknown>>;
|
|
732
|
+
/**
|
|
733
|
+
* The floating content.
|
|
734
|
+
*/
|
|
735
|
+
content?: React.ReactNode;
|
|
736
|
+
/**
|
|
737
|
+
* Renders the content into `document.body` through a React portal instead of inline.
|
|
738
|
+
*/
|
|
739
|
+
portal?: boolean;
|
|
740
|
+
}
|
|
741
|
+
declare function PopoverRoot({ placement, ...props }: PopoverProps & {
|
|
742
|
+
triggerProps?: Record<string, unknown>;
|
|
743
|
+
}): import("react").JSX.Element;
|
|
744
|
+
/** @beta */
|
|
745
|
+
export declare const Popover: typeof PopoverRoot & {
|
|
746
|
+
forwardsTriggerProps: boolean;
|
|
747
|
+
};
|
|
748
|
+
/** @public */
|
|
749
|
+
interface PressAreaProps<T extends React.ElementType = 'button'> {
|
|
750
|
+
/**
|
|
751
|
+
* Element or component to render.
|
|
752
|
+
*/
|
|
753
|
+
as?: InteractiveAs<T>;
|
|
754
|
+
}
|
|
755
|
+
/** @public */
|
|
756
|
+
export declare function PressArea<T extends ElementType = 'button'>(props: PressAreaProps<T> & Omit<ComponentPropsWithRef<T>, keyof PressAreaProps<T>>): import("react").JSX.Element;
|
|
757
|
+
/** @beta */
|
|
758
|
+
interface RadioProps extends React.ComponentProps<'input'> {}
|
|
759
|
+
/** @beta */
|
|
760
|
+
export declare function Radio(props: RadioProps): import("react").JSX.Element;
|
|
761
|
+
declare const FORM_ELEMENT_DENSITY: readonly ["regular", "loose"];
|
|
762
|
+
type FormElementDensity = (typeof FORM_ELEMENT_DENSITY)[number];
|
|
763
|
+
/** @public */
|
|
764
|
+
type FormElementDensityProps = {
|
|
765
|
+
/**
|
|
766
|
+
* Sets padding, gap, and other spacing values on the form element.
|
|
767
|
+
*/
|
|
768
|
+
density?: FormElementDensity;
|
|
769
|
+
};
|
|
770
|
+
/** @public */
|
|
771
|
+
interface SelectProps extends React.ComponentProps<'select'>, FormElementDensityProps {
|
|
772
|
+
/**
|
|
773
|
+
* Used to trigger styling for invalid states.
|
|
774
|
+
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
775
|
+
*/
|
|
776
|
+
hasError?: boolean;
|
|
777
|
+
}
|
|
778
|
+
/** @public */
|
|
779
|
+
export declare function Select({ density, hasError, ...props }: SelectProps): import("react").JSX.Element;
|
|
780
|
+
/** @beta */
|
|
781
|
+
interface SkipToContentProps extends React.ComponentProps<'a'> {
|
|
782
|
+
/**
|
|
783
|
+
* Same-page fragment to jump to.
|
|
784
|
+
* @remarks Note: The hash character # is required for proper linking.
|
|
785
|
+
*/
|
|
786
|
+
href: string;
|
|
787
|
+
/**
|
|
788
|
+
* Visible and announced text.
|
|
789
|
+
*/
|
|
790
|
+
label: string;
|
|
791
|
+
/**
|
|
792
|
+
* Not accepted.
|
|
793
|
+
* @remarks Pass text via `label`.
|
|
794
|
+
*/
|
|
795
|
+
children?: never;
|
|
796
|
+
}
|
|
797
|
+
/** @beta */
|
|
798
|
+
export declare function SkipToContent(props: SkipToContentProps): import("react").JSX.Element;
|
|
799
|
+
/** @public */
|
|
800
|
+
interface SpinnerProps extends React.ComponentProps<'svg'> {
|
|
801
|
+
/**
|
|
802
|
+
* Size of the spinner icon.
|
|
803
|
+
*/
|
|
804
|
+
size?: Responsive<IconSize>;
|
|
805
|
+
}
|
|
806
|
+
/** @public */
|
|
807
|
+
export declare function Spinner({ size, ...props }: SpinnerProps): import("react").JSX.Element;
|
|
808
|
+
/** @beta */
|
|
809
|
+
interface SwitchProps extends React.ComponentProps<'input'> {
|
|
810
|
+
/**
|
|
811
|
+
* Applies error styling to the switch track for invalid states.
|
|
812
|
+
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
813
|
+
*/
|
|
814
|
+
hasError?: boolean;
|
|
815
|
+
}
|
|
816
|
+
/** @beta */
|
|
817
|
+
export declare function Switch(props: SwitchProps): import("react").JSX.Element;
|
|
818
|
+
/** @public */
|
|
819
|
+
interface TabsProps extends React.ComponentProps<'div'> {
|
|
820
|
+
/** The `value` of the active Tabs.Tab */
|
|
821
|
+
value: string;
|
|
822
|
+
/** An updater function to set `value` - will be invoked with the `value` of the selected Tabs.Tab */
|
|
823
|
+
onValueChange: (value: string) => void;
|
|
824
|
+
}
|
|
825
|
+
type TabsListLabelProps = {
|
|
826
|
+
'aria-labelledby': string;
|
|
827
|
+
'aria-label'?: never;
|
|
828
|
+
} | {
|
|
829
|
+
'aria-label': string;
|
|
830
|
+
'aria-labelledby'?: never;
|
|
991
831
|
};
|
|
992
|
-
|
|
993
|
-
|
|
832
|
+
/** @public */
|
|
833
|
+
type TabsListProps = Omit<React.ComponentProps<'div'>, 'id' | 'role'> & TabsListLabelProps;
|
|
834
|
+
/** @public */
|
|
835
|
+
interface TabProps extends Omit<React.ComponentProps<'button'>, 'aria-disabled' | 'disabled' | 'id' | 'role'>, ToneProps {
|
|
836
|
+
/** Optional icon for the tab */
|
|
837
|
+
icon?: React.ElementType | React.ReactNode;
|
|
838
|
+
/** Text label to display in the tab */
|
|
839
|
+
label: string;
|
|
840
|
+
/** Unique string used to identify this tab and its matching Tabs.Panel */
|
|
841
|
+
value: string;
|
|
842
|
+
}
|
|
843
|
+
/** @public */
|
|
844
|
+
interface TabsPanelProps extends Omit<React.ComponentProps<'div'>, 'id' | 'role'>, LayoutProps {
|
|
845
|
+
/** Unique string used to identify this panel and its matching Tabs.Tab */
|
|
846
|
+
value: string;
|
|
847
|
+
}
|
|
848
|
+
declare function TabsRoot({ value, onValueChange, ...props }: TabsProps): import("react").JSX.Element;
|
|
849
|
+
declare namespace TabsRoot {
|
|
850
|
+
var displayName: string;
|
|
851
|
+
var List: typeof TabsList;
|
|
852
|
+
var Tab: ({ value, tone, ...props }: TabProps) => import("react").JSX.Element;
|
|
853
|
+
var Panel: typeof TabPanel;
|
|
854
|
+
}
|
|
855
|
+
declare function TabsList(props: TabsListProps): import("react").JSX.Element;
|
|
856
|
+
declare function TabPanel({ value, ...props }: TabsPanelProps): import("react").JSX.Element;
|
|
857
|
+
/** @public */
|
|
858
|
+
export declare const Tabs: typeof TabsRoot;
|
|
859
|
+
declare const TEXT_SIZE: readonly [0, 1, 2, 3, 4];
|
|
860
|
+
/** @public */
|
|
861
|
+
type TextSize = (typeof TEXT_SIZE)[number];
|
|
862
|
+
/** @public */
|
|
863
|
+
interface TextProps<T extends React.ElementType = 'span'> extends TypographyProps {
|
|
864
|
+
/**
|
|
865
|
+
* HTML element to render.
|
|
866
|
+
*/
|
|
867
|
+
as?: T;
|
|
868
|
+
/**
|
|
869
|
+
* Sets font size.
|
|
870
|
+
*/
|
|
871
|
+
size?: Responsive<TextSize>;
|
|
872
|
+
}
|
|
873
|
+
/** @public */
|
|
874
|
+
export declare function Text<T extends ElementType = 'span'>({ size, ...props }: TextProps<T> & Omit<ComponentPropsWithRef<T>, keyof TextProps<T>>): import("react").JSX.Element;
|
|
875
|
+
/** @public */
|
|
876
|
+
interface TextAreaProps extends React.ComponentProps<'textarea'>, FormElementDensityProps, Pick<HeightProps, 'maxHeight'> {
|
|
877
|
+
/**
|
|
878
|
+
* Sizes the textarea to its content via the CSS `field-sizing` property.
|
|
879
|
+
*/
|
|
880
|
+
autoResize?: boolean;
|
|
881
|
+
/**
|
|
882
|
+
* Used to trigger styling for invalid states.
|
|
883
|
+
*/
|
|
884
|
+
hasError?: boolean;
|
|
885
|
+
/**
|
|
886
|
+
* The html `rows` attribute. Defaults to 5.
|
|
887
|
+
*/
|
|
888
|
+
rows?: number;
|
|
889
|
+
}
|
|
890
|
+
/** @public */
|
|
891
|
+
export declare function TextArea({ autoResize, density, hasError, rows, ...props }: TextAreaProps): import("react").JSX.Element;
|
|
892
|
+
declare const TEXT_INPUT_EXCLUDED_TYPES: readonly ["button", "checkbox", "color", "file", "hidden", "image", "radio", "range", "reset", "submit"];
|
|
893
|
+
/** @public */
|
|
894
|
+
type TextInputExcludedTypes = (typeof TEXT_INPUT_EXCLUDED_TYPES)[number];
|
|
895
|
+
/** @public */
|
|
896
|
+
type TextInputType = Exclude<React.HTMLInputTypeAttribute, TextInputExcludedTypes>;
|
|
897
|
+
/** @public */
|
|
898
|
+
interface TextInputProps extends Omit<React.ComponentProps<'input'>, 'type'>, FormElementDensityProps {
|
|
899
|
+
/**
|
|
900
|
+
* Used to trigger styling for invalid states.
|
|
901
|
+
* @remarks Use when form validation fails. Pair with a visible error message.
|
|
902
|
+
*/
|
|
903
|
+
hasError?: boolean;
|
|
904
|
+
/**
|
|
905
|
+
* The html `type` attribute, with non-text based types excluded.
|
|
906
|
+
*/
|
|
907
|
+
type?: TextInputType;
|
|
908
|
+
}
|
|
909
|
+
/** @public */
|
|
910
|
+
export declare function TextInput({ density, hasError, type, ...props }: TextInputProps): import("react").JSX.Element;
|
|
911
|
+
/** @beta */
|
|
912
|
+
interface TooltipProps extends Omit<React.ComponentProps<'div'>, 'children' | 'content'>, PlacementProps {
|
|
913
|
+
/**
|
|
914
|
+
* Shared anchor identifier.
|
|
915
|
+
*/
|
|
916
|
+
anchorName?: React.ReactNode;
|
|
917
|
+
/**
|
|
918
|
+
* The trigger element.
|
|
919
|
+
*/
|
|
920
|
+
children: React.ReactElement<Record<string, unknown>>;
|
|
921
|
+
/**
|
|
922
|
+
* The tooltip label.
|
|
923
|
+
*/
|
|
924
|
+
content?: React.ReactNode;
|
|
925
|
+
/**
|
|
926
|
+
* Renders the label into `document.body` through a React portal instead of inline.
|
|
927
|
+
*/
|
|
928
|
+
portal?: boolean;
|
|
929
|
+
}
|
|
930
|
+
declare function TooltipRoot({ placement, ...props }: TooltipProps & {
|
|
931
|
+
triggerProps?: Record<string, unknown>;
|
|
932
|
+
}): import("react").JSX.Element;
|
|
933
|
+
/** @beta */
|
|
934
|
+
export declare const Tooltip: typeof TooltipRoot;
|
|
935
|
+
/** @public */
|
|
936
|
+
interface TooltipGroupProps<T extends React.ElementType = 'div'> {
|
|
937
|
+
/**
|
|
938
|
+
* HTML element to render.
|
|
939
|
+
*/
|
|
940
|
+
as?: T;
|
|
941
|
+
}
|
|
942
|
+
/** @public */
|
|
943
|
+
export declare function TooltipGroup<T extends ElementType = 'div'>(props: TooltipGroupProps<T> & Omit<ComponentPropsWithRef<T>, keyof TooltipGroupProps<T>>): import("react").JSX.Element;
|
|
944
|
+
/** @public */
|
|
945
|
+
interface VStackProps<T extends React.ElementType = 'div'> extends Pick<FlexProps<T>, 'as' | 'gap'> {}
|
|
946
|
+
/** @public */
|
|
947
|
+
export declare function VStack<T extends ElementType = 'div'>({ className, ...props }: VStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof VStackProps<T>>): import("react").JSX.Element;
|
|
948
|
+
/** @public */
|
|
949
|
+
interface VisuallyHiddenProps<T extends React.ElementType = 'span'> {
|
|
950
|
+
/**
|
|
951
|
+
* HTML element to render.
|
|
952
|
+
*/
|
|
953
|
+
as?: T;
|
|
954
|
+
/**
|
|
955
|
+
* If true, the element becomes visible on `:focus-visible`.
|
|
956
|
+
*/
|
|
957
|
+
visibleOnFocus?: boolean;
|
|
958
|
+
}
|
|
959
|
+
/** @public */
|
|
960
|
+
export declare function VisuallyHidden<T extends ElementType = 'span'>(props: VisuallyHiddenProps<T> & Omit<ComponentPropsWithRef<T>, keyof VisuallyHiddenProps<T>>): import("react").JSX.Element;
|
|
961
|
+
/** @public */
|
|
962
|
+
export declare function useIsClient(): boolean;
|
|
963
|
+
export type { AlignItems, AvatarCounterProps, AvatarProps, AvatarStackProps, BadgeProps, BoxProps, ButtonProps, CardProps, CheckboxProps, CodeProps, CodeSize, ContainerProps, ContainerSize, Density, DialogProps, DisplayBlock, DisplayFlex, DisplayGrid, DividerProps, EyebrowProps, EyebrowSize, FlexDirection, FlexParentProps, FlexProps, FlexWrap, FontWeight, GapProps, GridAutoFlow, GridParentProps, GridProps, HStackProps, HeadingProps, HeadingSize, HotkeysProps, IconButtonProps, IconProps, IconSize, IndicatorProps, IndicatorStackProps, InlineProps, JustifyContent, KBDProps, LayoutProps, LinkProps, ListButtonItemProps, ListItemProps, ListItemTextProps, ListProps, MarginProps, Overflow, PaddingProps, Placement, PlacementProps, PopoverProps, Position, PressAreaProps, RadioProps, Radius, Responsive, SelectProps, Shadow, SkipToContentProps, Space, SpaceAuto, SpaceAutoNegative, SpaceInherit, SpinnerProps, SwitchProps, TabProps, TabsListProps, TabsPanelProps, TabsProps, TextAlign, TextAreaProps, TextInputProps, TextProps, TextSize, Tone, TooltipGroupProps, TooltipProps, TypographyProps, VStackProps, VisuallyHiddenProps };
|
|
964
|
+
//# sourceMappingURL=index.d.ts.map
|