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