@carbonplan/components 13.2.2 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dst/index.d.mts +503 -0
- package/dst/index.d.ts +503 -0
- package/dst/index.js +3651 -2
- package/dst/index.js.map +1 -1
- package/dst/index.mjs +3585 -0
- package/dst/index.mjs.map +1 -0
- package/package.json +14 -7
- package/dst/index.esm.js +0 -2
- package/dst/index.esm.js.map +0 -1
- package/dst/index.modern.js +0 -2
- package/dst/index.modern.js.map +0 -1
package/dst/index.d.ts
ADDED
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import * as theme_ui from 'theme-ui';
|
|
3
|
+
import { BoxProps, GridProps, ResponsiveStyleValue, ThemeUIStyleObject, FlexProps, ThemeUICSSObject, IconButtonProps, Input, LinkProps as LinkProps$1, Slider } from 'theme-ui';
|
|
4
|
+
|
|
5
|
+
interface AvatarProps extends BoxProps {
|
|
6
|
+
color?: string;
|
|
7
|
+
width?: string;
|
|
8
|
+
maxWidth?: string | number;
|
|
9
|
+
name?: string;
|
|
10
|
+
github?: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
src?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const Avatar: ({ color, width, maxWidth, name, github, alt, src, sx, ...props }: AvatarProps) => React.JSX.Element;
|
|
15
|
+
|
|
16
|
+
type RowProps = GridProps;
|
|
17
|
+
declare const Row: ({ children, sx, columns, gap, ...props }: GridProps) => React.JSX.Element;
|
|
18
|
+
|
|
19
|
+
declare const sizes$1: {
|
|
20
|
+
xs: number[];
|
|
21
|
+
sm: number[];
|
|
22
|
+
md: number[];
|
|
23
|
+
lg: number[];
|
|
24
|
+
xl: number[];
|
|
25
|
+
};
|
|
26
|
+
type SizeKey$1 = keyof typeof sizes$1;
|
|
27
|
+
type Direction = 'horizontal' | 'vertical';
|
|
28
|
+
type SpacingValue = SizeKey$1 | ResponsiveStyleValue<number | string>;
|
|
29
|
+
interface GroupProps {
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
direction?: Direction;
|
|
32
|
+
spacing?: SpacingValue;
|
|
33
|
+
sx?: ThemeUIStyleObject;
|
|
34
|
+
}
|
|
35
|
+
declare const Group: ({ children, direction, spacing, sx, }: GroupProps) => React.JSX.Element;
|
|
36
|
+
|
|
37
|
+
declare const sizes: {
|
|
38
|
+
xs: number[];
|
|
39
|
+
sm: number[];
|
|
40
|
+
md: number[];
|
|
41
|
+
lg: number[];
|
|
42
|
+
xl: number[];
|
|
43
|
+
};
|
|
44
|
+
type SizeKey = keyof typeof sizes;
|
|
45
|
+
type Alignment = 'left' | 'right';
|
|
46
|
+
interface AvatarGroupProps extends RowProps, GroupProps {
|
|
47
|
+
members: AvatarProps[];
|
|
48
|
+
direction?: 'horizontal' | 'vertical';
|
|
49
|
+
align?: Alignment | Alignment[];
|
|
50
|
+
spacing?: SizeKey | GridProps['gap'];
|
|
51
|
+
limit?: number;
|
|
52
|
+
width?: string;
|
|
53
|
+
maxWidth?: string | number;
|
|
54
|
+
fixedCount?: number;
|
|
55
|
+
}
|
|
56
|
+
declare const AvatarGroup: ({ members, direction, align, spacing, limit, width, maxWidth, fixedCount, sx, ...props }: AvatarGroupProps) => React.JSX.Element;
|
|
57
|
+
|
|
58
|
+
type BadgeProps = BoxProps;
|
|
59
|
+
declare const Badge: ({ sx, children, ...props }: BadgeProps) => React.JSX.Element;
|
|
60
|
+
|
|
61
|
+
type BlockquoteProps = PropsWithChildren<{}>;
|
|
62
|
+
declare const Blockquote: ({ children }: BlockquoteProps) => React.JSX.Element;
|
|
63
|
+
|
|
64
|
+
interface ButtonProps extends Omit<BoxProps, 'prefix'>, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BoxProps | 'prefix'> {
|
|
65
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
66
|
+
align?: 'baseline' | 'sub' | 'super' | 'text-top' | 'text-bottom' | 'middle' | 'top' | 'bottom' | 'initial';
|
|
67
|
+
suffix?: (React.ReactElement & {
|
|
68
|
+
props?: {
|
|
69
|
+
sx?: ThemeUIStyleObject;
|
|
70
|
+
};
|
|
71
|
+
}) | null;
|
|
72
|
+
prefix?: (React.ReactElement & {
|
|
73
|
+
props?: {
|
|
74
|
+
sx?: ThemeUIStyleObject;
|
|
75
|
+
};
|
|
76
|
+
}) | null;
|
|
77
|
+
inverted?: boolean;
|
|
78
|
+
href?: string;
|
|
79
|
+
internal?: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare const _default$5: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
82
|
+
|
|
83
|
+
interface CalloutProps extends React.AnchorHTMLAttributes<HTMLElement>, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof React.AnchorHTMLAttributes<HTMLElement>> {
|
|
84
|
+
label: ReactNode;
|
|
85
|
+
children: ReactNode;
|
|
86
|
+
inverted?: boolean;
|
|
87
|
+
internal?: boolean;
|
|
88
|
+
sx?: ThemeUIStyleObject;
|
|
89
|
+
}
|
|
90
|
+
declare const _default$4: React.ForwardRefExoticComponent<CalloutProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
91
|
+
|
|
92
|
+
interface CaptionProps {
|
|
93
|
+
as?: BoxProps['as'];
|
|
94
|
+
number?: number;
|
|
95
|
+
children: ReactNode;
|
|
96
|
+
label?: string;
|
|
97
|
+
}
|
|
98
|
+
declare const Caption: ({ as, number, children, label, }: CaptionProps) => React.JSX.Element;
|
|
99
|
+
|
|
100
|
+
type SetClim = (setter: (prev: [number, number]) => [number, number]) => void;
|
|
101
|
+
interface ColorbarProps extends FlexProps {
|
|
102
|
+
colormap: string[];
|
|
103
|
+
label?: ReactNode;
|
|
104
|
+
clim?: [number, number];
|
|
105
|
+
setClim?: SetClim;
|
|
106
|
+
setClimStep?: number;
|
|
107
|
+
units?: ReactNode;
|
|
108
|
+
width?: ThemeUICSSObject['width'];
|
|
109
|
+
height?: ThemeUICSSObject['height'];
|
|
110
|
+
format?: (d: number) => ReactNode;
|
|
111
|
+
discrete?: boolean;
|
|
112
|
+
horizontal?: boolean;
|
|
113
|
+
bottom?: boolean;
|
|
114
|
+
sxClim?: ThemeUIStyleObject;
|
|
115
|
+
}
|
|
116
|
+
declare const Colorbar: ({ colormap, label, clim, setClim, setClimStep, discrete, units, width, height, format, horizontal, bottom, sx, sxClim, ...props }: ColorbarProps) => React.JSX.Element;
|
|
117
|
+
|
|
118
|
+
interface InlineColorProps extends BoxProps {
|
|
119
|
+
color: string;
|
|
120
|
+
children: ReactNode;
|
|
121
|
+
}
|
|
122
|
+
type ColorProps = Omit<InlineColorProps, 'color'>;
|
|
123
|
+
declare const Primary: (props: ColorProps) => React.JSX.Element;
|
|
124
|
+
declare const Secondary: (props: ColorProps) => React.JSX.Element;
|
|
125
|
+
declare const Background: (props: ColorProps) => React.JSX.Element;
|
|
126
|
+
declare const Red: (props: ColorProps) => React.JSX.Element;
|
|
127
|
+
declare const Orange: (props: ColorProps) => React.JSX.Element;
|
|
128
|
+
declare const Yellow: (props: ColorProps) => React.JSX.Element;
|
|
129
|
+
declare const Green: (props: ColorProps) => React.JSX.Element;
|
|
130
|
+
declare const Teal: (props: ColorProps) => React.JSX.Element;
|
|
131
|
+
declare const Blue: (props: ColorProps) => React.JSX.Element;
|
|
132
|
+
declare const Purple: (props: ColorProps) => React.JSX.Element;
|
|
133
|
+
declare const Pink: (props: ColorProps) => React.JSX.Element;
|
|
134
|
+
declare const Grey: (props: ColorProps) => React.JSX.Element;
|
|
135
|
+
|
|
136
|
+
declare const colors_Background: typeof Background;
|
|
137
|
+
declare const colors_Blue: typeof Blue;
|
|
138
|
+
declare const colors_Green: typeof Green;
|
|
139
|
+
declare const colors_Grey: typeof Grey;
|
|
140
|
+
declare const colors_Orange: typeof Orange;
|
|
141
|
+
declare const colors_Pink: typeof Pink;
|
|
142
|
+
declare const colors_Primary: typeof Primary;
|
|
143
|
+
declare const colors_Purple: typeof Purple;
|
|
144
|
+
declare const colors_Red: typeof Red;
|
|
145
|
+
declare const colors_Secondary: typeof Secondary;
|
|
146
|
+
declare const colors_Teal: typeof Teal;
|
|
147
|
+
declare const colors_Yellow: typeof Yellow;
|
|
148
|
+
declare namespace colors {
|
|
149
|
+
export { colors_Background as Background, colors_Blue as Blue, colors_Green as Green, colors_Grey as Grey, colors_Orange as Orange, colors_Pink as Pink, colors_Primary as Primary, colors_Purple as Purple, colors_Red as Red, colors_Secondary as Secondary, colors_Teal as Teal, colors_Yellow as Yellow };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface ColumnProps extends BoxProps {
|
|
153
|
+
start?: number | 'auto' | (number | 'auto')[];
|
|
154
|
+
width?: number | 'auto' | (number | 'auto')[];
|
|
155
|
+
dl?: 0.5 | 1;
|
|
156
|
+
dr?: 0.5 | 1;
|
|
157
|
+
}
|
|
158
|
+
declare const Column: ({ start, width, dl, dr, children, sx, ...props }: ColumnProps) => React.JSX.Element;
|
|
159
|
+
|
|
160
|
+
declare const Custom404: () => React.JSX.Element;
|
|
161
|
+
|
|
162
|
+
type DimmerProps = IconButtonProps;
|
|
163
|
+
declare const Dimmer: ({ sx, ...props }: DimmerProps) => React.JSX.Element;
|
|
164
|
+
|
|
165
|
+
interface ExpanderProps {
|
|
166
|
+
value: IconButtonProps['aria-checked'];
|
|
167
|
+
id?: IconButtonProps['id'];
|
|
168
|
+
onClick: IconButtonProps['onClick'];
|
|
169
|
+
sx?: IconButtonProps['sx'];
|
|
170
|
+
}
|
|
171
|
+
declare const Expander: ({ value, id, onClick, sx }: ExpanderProps) => React.JSX.Element;
|
|
172
|
+
|
|
173
|
+
interface FadeInProps extends BoxProps {
|
|
174
|
+
duration?: number;
|
|
175
|
+
delay?: number;
|
|
176
|
+
}
|
|
177
|
+
declare const FadeIn: ({ duration, delay, children, ...delegated }: FadeInProps) => React.JSX.Element;
|
|
178
|
+
|
|
179
|
+
interface FigureProps {
|
|
180
|
+
as?: React.ElementType;
|
|
181
|
+
children?: React.ReactNode;
|
|
182
|
+
sx?: ThemeUIStyleObject;
|
|
183
|
+
}
|
|
184
|
+
declare const Figure: ({ as, children, sx }: FigureProps) => React.JSX.Element;
|
|
185
|
+
|
|
186
|
+
type FigureCaptionProps = CaptionProps;
|
|
187
|
+
declare const FigureCaption: {
|
|
188
|
+
({ as, number, children, }: CaptionProps): React.JSX.Element;
|
|
189
|
+
displayName: string;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
interface FilterProps<T> extends BoxProps {
|
|
193
|
+
values: {
|
|
194
|
+
[Property in keyof T]: boolean;
|
|
195
|
+
};
|
|
196
|
+
setValues: (updated: {
|
|
197
|
+
[Property in keyof T]: boolean;
|
|
198
|
+
}) => void;
|
|
199
|
+
order?: (keyof T)[];
|
|
200
|
+
colors?: {
|
|
201
|
+
[Property in keyof T]: string;
|
|
202
|
+
};
|
|
203
|
+
labels?: {
|
|
204
|
+
[Property in keyof T]: ReactNode;
|
|
205
|
+
};
|
|
206
|
+
label?: ReactNode;
|
|
207
|
+
showAll?: boolean;
|
|
208
|
+
multiSelect?: boolean;
|
|
209
|
+
}
|
|
210
|
+
declare const Filter: <T>({ values, setValues, label, colors, order, labels, showAll, multiSelect, ...props }: FilterProps<T>) => React.JSX.Element;
|
|
211
|
+
|
|
212
|
+
declare const Footer: () => React.JSX.Element;
|
|
213
|
+
|
|
214
|
+
interface GuideProps {
|
|
215
|
+
color?: string;
|
|
216
|
+
}
|
|
217
|
+
declare const Guide: ({ color }: GuideProps) => React.JSX.Element;
|
|
218
|
+
|
|
219
|
+
interface HeaderProps {
|
|
220
|
+
status?: string;
|
|
221
|
+
mode?: 'homepage' | 'local' | 'remote';
|
|
222
|
+
nav?: string;
|
|
223
|
+
menuItems?: ReactNode;
|
|
224
|
+
}
|
|
225
|
+
declare const Header: ({ status, mode, nav, menuItems }: HeaderProps) => React.JSX.Element;
|
|
226
|
+
|
|
227
|
+
interface HeadingProps {
|
|
228
|
+
children: ReactNode;
|
|
229
|
+
sidenote?: ReactNode;
|
|
230
|
+
variant?: 'h1' | 'h2';
|
|
231
|
+
description?: ReactNode;
|
|
232
|
+
descriptionStart?: number[];
|
|
233
|
+
descriptionWidth?: number[];
|
|
234
|
+
sx?: ThemeUIStyleObject;
|
|
235
|
+
}
|
|
236
|
+
declare const Heading: ({ children, sidenote, variant, description, descriptionStart, descriptionWidth, sx, }: HeadingProps) => React.JSX.Element;
|
|
237
|
+
|
|
238
|
+
interface InputProps extends Omit<React.ComponentPropsWithRef<typeof Input>, 'size'> {
|
|
239
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
240
|
+
inverted?: boolean;
|
|
241
|
+
}
|
|
242
|
+
declare const _default$3: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
243
|
+
|
|
244
|
+
interface SettingsProps extends Omit<IconButtonProps, 'value' | 'onClick'> {
|
|
245
|
+
value: boolean;
|
|
246
|
+
onClick?: (e?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
247
|
+
}
|
|
248
|
+
declare const Settings: ({ value, sx, ...props }: SettingsProps) => React.JSX.Element;
|
|
249
|
+
|
|
250
|
+
interface LayoutProps {
|
|
251
|
+
title?: string;
|
|
252
|
+
description?: string;
|
|
253
|
+
url?: string;
|
|
254
|
+
card?: string;
|
|
255
|
+
children?: ReactNode;
|
|
256
|
+
status?: string;
|
|
257
|
+
nav?: string;
|
|
258
|
+
settings?: SettingsProps;
|
|
259
|
+
footer?: boolean;
|
|
260
|
+
header?: boolean;
|
|
261
|
+
metadata?: 'mouse' | 'scroll' | boolean;
|
|
262
|
+
links?: 'remote' | 'local' | 'homepage';
|
|
263
|
+
dimmer?: 'bottom' | 'top';
|
|
264
|
+
guide?: boolean | string;
|
|
265
|
+
scrollbar?: boolean;
|
|
266
|
+
fade?: boolean;
|
|
267
|
+
container?: boolean;
|
|
268
|
+
printable?: boolean;
|
|
269
|
+
}
|
|
270
|
+
declare const Layout: ({ title, description, url, card, children, status, nav, settings, footer, header, metadata, links, dimmer, guide, scrollbar, fade, container, printable, }: LayoutProps) => React.JSX.Element;
|
|
271
|
+
|
|
272
|
+
interface LinkProps extends LinkProps$1 {
|
|
273
|
+
href?: string;
|
|
274
|
+
internal?: boolean;
|
|
275
|
+
}
|
|
276
|
+
declare const _default$2: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
277
|
+
|
|
278
|
+
interface LinkGroupProps {
|
|
279
|
+
members: {
|
|
280
|
+
href: string;
|
|
281
|
+
label: string;
|
|
282
|
+
}[];
|
|
283
|
+
color?: string;
|
|
284
|
+
inverted?: boolean;
|
|
285
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
286
|
+
rowGap?: ThemeUICSSObject['rowGap'];
|
|
287
|
+
columnGap?: ThemeUICSSObject['columnGap'];
|
|
288
|
+
direction?: 'horizontal' | 'vertical';
|
|
289
|
+
sx?: ThemeUIStyleObject;
|
|
290
|
+
}
|
|
291
|
+
declare const LinkGroup: ({ members, color, inverted, size, rowGap, columnGap, direction, sx, }: LinkGroupProps) => React.JSX.Element;
|
|
292
|
+
|
|
293
|
+
type LogoProps = BoxProps;
|
|
294
|
+
declare const Logo: ({ ...props }: LogoProps) => React.JSX.Element;
|
|
295
|
+
|
|
296
|
+
interface MenuProps extends Omit<IconButtonProps, 'value'> {
|
|
297
|
+
value?: boolean;
|
|
298
|
+
}
|
|
299
|
+
declare const Menu: ({ value, sx, ...props }: MenuProps) => React.JSX.Element;
|
|
300
|
+
|
|
301
|
+
interface MetaProps {
|
|
302
|
+
title?: string;
|
|
303
|
+
description?: string;
|
|
304
|
+
card?: string;
|
|
305
|
+
url?: string;
|
|
306
|
+
}
|
|
307
|
+
declare const Meta: ({ title, description, card, url }: MetaProps) => React.JSX.Element;
|
|
308
|
+
|
|
309
|
+
interface MetadataProps {
|
|
310
|
+
mode: 'mouse' | 'scroll';
|
|
311
|
+
}
|
|
312
|
+
declare const Metadata: ({ mode }: MetadataProps) => React.JSX.Element;
|
|
313
|
+
|
|
314
|
+
type MonogramProps = BoxProps;
|
|
315
|
+
declare const Monogram: ({ ...props }: MonogramProps) => React.JSX.Element;
|
|
316
|
+
|
|
317
|
+
declare const Scrollbar: () => null;
|
|
318
|
+
|
|
319
|
+
interface SelectProps extends Omit<BoxProps, 'onChange'>, Omit<React.SelectHTMLAttributes<HTMLSelectElement>, keyof BoxProps | 'onChange' | 'size'> {
|
|
320
|
+
size?: 'xs' | 'sm' | 'md';
|
|
321
|
+
sxSelect?: ThemeUIStyleObject;
|
|
322
|
+
onChange?: React.ChangeEventHandler<HTMLSelectElement>;
|
|
323
|
+
}
|
|
324
|
+
declare const Select: ({ children, size, sx, sxSelect, onChange, ...props }: SelectProps) => React.JSX.Element;
|
|
325
|
+
|
|
326
|
+
interface SidenoteProps {
|
|
327
|
+
children: ReactNode;
|
|
328
|
+
variant?: 'h1' | 'h2';
|
|
329
|
+
}
|
|
330
|
+
declare const Sidenote: ({ children, variant }: SidenoteProps) => React.JSX.Element;
|
|
331
|
+
|
|
332
|
+
type SliderProps = React.ComponentPropsWithRef<typeof Slider>;
|
|
333
|
+
declare const _default$1: React.ForwardRefExoticComponent<Omit<Omit<Omit<theme_ui.SliderProps, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & {
|
|
334
|
+
ref?: ((instance: HTMLInputElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLInputElement> | null | undefined;
|
|
335
|
+
}, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* A responsive value that maps to screen breakpoints
|
|
339
|
+
* `[mobile (<40em), tablet (≥40em), desktop (≥64em), large (≥102em)]`.
|
|
340
|
+
* A single number applies to all breakpoints; an array specifies per-breakpoint values.
|
|
341
|
+
*
|
|
342
|
+
* Arrays of length 1, 2, or 4 are supported:
|
|
343
|
+
* - `[n]` — same value at all breakpoints
|
|
344
|
+
* - `[a, b]` — `a` for mobile and tablet, `b` for desktop and large
|
|
345
|
+
* - `[mobile, tablet, desktop, large]` — explicit value at each breakpoint
|
|
346
|
+
*
|
|
347
|
+
* Note: this differs from theme-ui's native responsive arrays (e.g. in `sx`),
|
|
348
|
+
* where the last value carries forward to all larger breakpoints. Here, `[a, b]`
|
|
349
|
+
* is expanded to `[a, a, b, b]` (split at 64em), whereas theme-ui would treat it
|
|
350
|
+
* as `a` below 40em and `b` at 40em+ (split at 40em).
|
|
351
|
+
*/
|
|
352
|
+
type ResponsiveNumber = number | number[];
|
|
353
|
+
/**
|
|
354
|
+
* A table built on the CarbonPlan grid system.
|
|
355
|
+
*
|
|
356
|
+
* `start` and `width` are arrays with one entry per table column.
|
|
357
|
+
* Each entry is a {@link ResponsiveNumber} controlling that column's
|
|
358
|
+
* grid position or span.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* // 2-column table: stacked on mobile, side-by-side on tablet+
|
|
362
|
+
* // (from soil-protocols-explainer/metric-table)
|
|
363
|
+
* <Table
|
|
364
|
+
* columns={[6]}
|
|
365
|
+
* start={[
|
|
366
|
+
* [1, 1, 1, 1],
|
|
367
|
+
* [1, 3, 3, 3],
|
|
368
|
+
* ]}
|
|
369
|
+
* width={[
|
|
370
|
+
* [6, 2, 2, 2],
|
|
371
|
+
* [6, 4, 4, 4],
|
|
372
|
+
* ]}
|
|
373
|
+
* data={[
|
|
374
|
+
* ['Rigor', 'Approach to quantifying soil carbon...'],
|
|
375
|
+
* ['Additionality', 'Approach to analyzing causal relationship...'],
|
|
376
|
+
* ]}
|
|
377
|
+
* />
|
|
378
|
+
*/
|
|
379
|
+
interface TableProps {
|
|
380
|
+
/**
|
|
381
|
+
* The tabular data as a 2D array: `data[row][tableColumn]`.
|
|
382
|
+
* Each inner array is a row; each element becomes a `<td>`.
|
|
383
|
+
* Elements can be strings, numbers, or React nodes.
|
|
384
|
+
*/
|
|
385
|
+
data: ReactNode[][];
|
|
386
|
+
/**
|
|
387
|
+
* Total number of grid columns the table spans, as a responsive value.
|
|
388
|
+
* This is passed to the underlying `Row` component and controls the
|
|
389
|
+
* grid template, not the number of visible table columns.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* columns={[6]} // 6 grid columns at all breakpoints
|
|
393
|
+
* columns={[4, 6, 6, 6]} // 4 on mobile, 6 on tablet+
|
|
394
|
+
*/
|
|
395
|
+
columns: ResponsiveNumber;
|
|
396
|
+
/**
|
|
397
|
+
* Grid column where each table column starts, as an array with one entry
|
|
398
|
+
* per table column. Each entry is a {@link ResponsiveNumber}.
|
|
399
|
+
*
|
|
400
|
+
* - Outer array length = number of table columns (must match `data[n].length`)
|
|
401
|
+
* - Inner value = grid column start position, optionally responsive
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* // 2 table columns: stacked on mobile, side-by-side on tablet+
|
|
405
|
+
* // (from soil-protocols-explainer/metric-table)
|
|
406
|
+
* start={[
|
|
407
|
+
* [1, 1, 1, 1], // table col 0 starts at grid col 1 at all breakpoints
|
|
408
|
+
* [1, 3, 3, 3], // table col 1 starts at grid col 1 on mobile, 3 on tablet+
|
|
409
|
+
* ]}
|
|
410
|
+
*
|
|
411
|
+
* // 5 table columns: stacked on mobile, spread across grid on tablet+
|
|
412
|
+
* // (from ton-year-explainer/examples-table)
|
|
413
|
+
* start={[
|
|
414
|
+
* [1, 1, 1, 1], // table col 0 at grid col 1
|
|
415
|
+
* [1, 3, 3, 3], // table col 1 at grid col 1 on mobile, 3 on tablet+
|
|
416
|
+
* [2, 4, 4, 4], // table col 2 at grid col 2 on mobile, 4 on tablet+
|
|
417
|
+
* [3, 5, 5, 5], // ...
|
|
418
|
+
* [4, 6, 6, 6],
|
|
419
|
+
* ]}
|
|
420
|
+
*/
|
|
421
|
+
start: ResponsiveNumber[];
|
|
422
|
+
/**
|
|
423
|
+
* Number of grid columns each table column spans, as an array with one
|
|
424
|
+
* entry per table column. Each entry is a {@link ResponsiveNumber}.
|
|
425
|
+
*
|
|
426
|
+
* - Outer array length = number of table columns (must match `data[n].length`)
|
|
427
|
+
* - Inner value = grid column span, optionally responsive
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* // 2 table columns: full-width on mobile, split on tablet+
|
|
431
|
+
* // (from soil-protocols-explainer/metric-table)
|
|
432
|
+
* width={[
|
|
433
|
+
* [6, 2, 2, 2], // table col 0 spans 6 grid cols on mobile, 2 on tablet+
|
|
434
|
+
* [6, 4, 4, 4], // table col 1 spans 6 grid cols on mobile, 4 on tablet+
|
|
435
|
+
* ]}
|
|
436
|
+
*
|
|
437
|
+
* // 5 table columns: label full-width on mobile, all 1-col on tablet+
|
|
438
|
+
* // (from ton-year-explainer/examples-table)
|
|
439
|
+
* width={[
|
|
440
|
+
* [4, 2, 2, 2], // table col 0 (label) spans 4 on mobile, 2 on tablet+
|
|
441
|
+
* [1, 1, 1, 1], // table cols 1-4 always span 1 grid col
|
|
442
|
+
* [1, 1, 1, 1],
|
|
443
|
+
* [1, 1, 1, 1],
|
|
444
|
+
* [1, 1, 1, 1],
|
|
445
|
+
* ]}
|
|
446
|
+
*/
|
|
447
|
+
width: ResponsiveNumber[];
|
|
448
|
+
/** Whether to style the first table column as an index with uppercase heading font. @default true */
|
|
449
|
+
index?: boolean;
|
|
450
|
+
/** Whether to render a border below the last row. @default true */
|
|
451
|
+
borderBottom?: boolean;
|
|
452
|
+
/** Whether to render a border above the first row. @default true */
|
|
453
|
+
borderTop?: boolean;
|
|
454
|
+
/** Theme UI style overrides applied to the outer `<table>` element. */
|
|
455
|
+
sx?: ThemeUIStyleObject;
|
|
456
|
+
/** Theme UI color for the header row text (e.g. `'secondary'`, `'orange'`). */
|
|
457
|
+
color?: string;
|
|
458
|
+
/** Content rendered in a header row above the data rows. */
|
|
459
|
+
header?: ReactNode;
|
|
460
|
+
}
|
|
461
|
+
declare const Table: ({ data, sx, color, header, columns, start, width, index, borderBottom, borderTop, }: TableProps) => React.JSX.Element;
|
|
462
|
+
|
|
463
|
+
interface TableCaptionProps {
|
|
464
|
+
as?: BoxProps['as'];
|
|
465
|
+
number?: number;
|
|
466
|
+
children: ReactNode;
|
|
467
|
+
}
|
|
468
|
+
declare const TableCaption: {
|
|
469
|
+
({ as, number, children, }: TableCaptionProps): React.JSX.Element;
|
|
470
|
+
displayName: string;
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
interface TagProps extends BoxProps, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BoxProps | 'value'> {
|
|
474
|
+
label?: BoxProps['aria-label'];
|
|
475
|
+
value?: boolean;
|
|
476
|
+
}
|
|
477
|
+
declare const Tag: ({ label, value, sx, children, ...props }: TagProps) => React.JSX.Element;
|
|
478
|
+
|
|
479
|
+
interface ToggleProps extends Omit<BoxProps, 'value'>, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BoxProps | 'value'> {
|
|
480
|
+
value?: boolean;
|
|
481
|
+
}
|
|
482
|
+
declare const _default: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
483
|
+
|
|
484
|
+
interface TrayProps {
|
|
485
|
+
expanded: boolean;
|
|
486
|
+
sx?: ThemeUIStyleObject;
|
|
487
|
+
children: ReactNode;
|
|
488
|
+
}
|
|
489
|
+
declare const Tray: ({ expanded, sx, children }: TrayProps) => React.JSX.Element;
|
|
490
|
+
|
|
491
|
+
interface FormatDateOptions {
|
|
492
|
+
month?: string | boolean;
|
|
493
|
+
day?: string | boolean;
|
|
494
|
+
year?: string | boolean;
|
|
495
|
+
separator?: string;
|
|
496
|
+
}
|
|
497
|
+
declare const formatDate: (date: string, options?: FormatDateOptions) => string;
|
|
498
|
+
|
|
499
|
+
declare const getScrollbarWidth: (document: Document) => number;
|
|
500
|
+
|
|
501
|
+
declare const useScrollbarClass: () => string | null;
|
|
502
|
+
|
|
503
|
+
export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Blockquote, type BlockquoteProps, _default$5 as Button, type ButtonProps, _default$4 as Callout, type CalloutProps, Caption, type CaptionProps, Colorbar, type ColorbarProps, colors as Colors, Column, type ColumnProps, Custom404, Dimmer, type DimmerProps, Expander, type ExpanderProps, FadeIn, type FadeInProps, Figure, FigureCaption, type FigureCaptionProps, type FigureProps, Filter, type FilterProps, Footer, Group, type GroupProps, Guide, type GuideProps, Header, type HeaderProps, Heading, type HeadingProps, _default$3 as Input, type InputProps, Layout, type LayoutProps, _default$2 as Link, LinkGroup, type LinkGroupProps, type LinkProps, Logo, type LogoProps, Menu, type MenuProps, Meta, type MetaProps, Metadata, type MetadataProps, Monogram, type MonogramProps, Row, type RowProps, Scrollbar, Select, type SelectProps, Settings, type SettingsProps, Sidenote, type SidenoteProps, _default$1 as Slider, type SliderProps, Table, TableCaption, type TableCaptionProps, type TableProps, Tag, type TagProps, _default as Toggle, type ToggleProps, Tray, type TrayProps, formatDate, getScrollbarWidth, useScrollbarClass };
|