@marigold/components 0.9.0 → 1.0.1
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/dist/index.d.ts +266 -192
- package/dist/index.js +1595 -1100
- package/dist/index.mjs +1615 -1096
- package/package.json +20 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { Theme as Theme$1, ThemeProviderProps, ThemeExtension, ThemeComponentProps, ThemeExtensionsWithParts, BoxOwnProps,
|
|
1
|
+
import { Theme as Theme$1, ThemeProviderProps, ThemeExtension, ThemeComponentProps, ThemeExtensionsWithParts, BoxOwnProps, StateAttrProps, CSSObject, ResponsiveStyleValue } from '@marigold/system';
|
|
2
2
|
export { Box, BoxOwnProps, BoxProps, StyleProps, ThemeProvider, useTheme } from '@marigold/system';
|
|
3
|
-
import React, { ReactNode, Key, LabelHTMLAttributes,
|
|
3
|
+
import React, { ReactNode, HTMLAttributes, Key, LabelHTMLAttributes, ReactElement, ReactChild } from 'react';
|
|
4
4
|
import { ComponentProps, PolymorphicPropsWithRef, PolymorphicComponentWithRef, PolymorphicProps, PolymorphicComponent, NonZeroPercentage } from '@marigold/types';
|
|
5
5
|
import * as _react_types_shared from '@react-types/shared';
|
|
6
|
-
import { PressEvents, CollectionElement
|
|
7
|
-
import { AriaCheckboxProps, AriaCheckboxGroupProps
|
|
6
|
+
import { PressEvents, CollectionElement } from '@react-types/shared';
|
|
7
|
+
import { AriaCheckboxProps, AriaCheckboxGroupProps } from '@react-types/checkbox';
|
|
8
8
|
import { CheckboxGroupState } from '@react-stately/checkbox';
|
|
9
|
+
import { AriaDialogProps } from '@react-types/dialog';
|
|
9
10
|
import { SeparatorProps } from '@react-aria/separator';
|
|
10
|
-
import {
|
|
11
|
+
import { AriaNumberFieldProps } from '@react-types/numberfield';
|
|
12
|
+
import { AriaRadioGroupProps, AriaRadioProps } from '@react-types/radio';
|
|
11
13
|
import { AriaSelectProps } from '@react-types/select';
|
|
14
|
+
import { AriaSliderProps } from '@react-types/slider';
|
|
12
15
|
import { AriaSwitchProps } from '@react-types/switch';
|
|
13
16
|
import { TableProps as TableProps$1 } from '@react-aria/table';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
17
|
+
import { TableStateProps, TableBody, Cell, Column, TableHeader, Row } from '@react-stately/table';
|
|
18
|
+
import { AriaTextFieldProps } from '@react-types/textfield';
|
|
19
|
+
import { PositionProps } from '@react-types/overlays';
|
|
20
|
+
import { TooltipTriggerProps as TooltipTriggerProps$1 } from '@react-types/tooltip';
|
|
16
21
|
import { aspect, size } from '@marigold/tokens';
|
|
17
|
-
import * as _react_stately_overlays from '@react-stately/overlays';
|
|
18
22
|
import { OverlayProps as OverlayProps$1 } from '@react-aria/overlays';
|
|
19
|
-
import { AriaDialogProps } from '@react-types/dialog';
|
|
20
|
-
export { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
21
23
|
export { SSRProvider } from '@react-aria/ssr';
|
|
22
|
-
|
|
23
|
-
export { Item, Section } from '@react-stately/collections';
|
|
24
|
+
export { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
24
25
|
|
|
25
26
|
interface RootThemeExtension<Value> {
|
|
26
27
|
root?: {
|
|
@@ -82,12 +83,16 @@ interface CheckboxGroupContextProps extends CheckboxGroupState {
|
|
|
82
83
|
variant?: string;
|
|
83
84
|
size?: string;
|
|
84
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Needs to be falsy so we can check if a checkbox is used as standalone
|
|
88
|
+
* or in a group.
|
|
89
|
+
*/
|
|
85
90
|
declare const CheckboxGroupContext: React.Context<CheckboxGroupContextProps>;
|
|
86
91
|
declare const useCheckboxGroupContext: () => CheckboxGroupContextProps;
|
|
87
92
|
interface CheckboxGroupThemeExtension extends ThemeExtensionsWithParts<'CheckboxGroup', ['container', 'group']> {
|
|
88
93
|
}
|
|
89
94
|
interface CheckboxGroupProps extends Omit<ComponentProps<'div'>, 'onChange'>, AriaCheckboxGroupProps {
|
|
90
|
-
children
|
|
95
|
+
children: ReactNode;
|
|
91
96
|
variant?: string;
|
|
92
97
|
size?: string;
|
|
93
98
|
label?: ReactNode;
|
|
@@ -108,6 +113,34 @@ interface ContentProps extends ThemeComponentProps, ComponentProps<'section'> {
|
|
|
108
113
|
}
|
|
109
114
|
declare const Content: ({ children, variant, size, ...props }: ContentProps) => JSX.Element;
|
|
110
115
|
|
|
116
|
+
interface DialogTriggerProps {
|
|
117
|
+
children: [trigger: ReactNode, menu: ReactNode];
|
|
118
|
+
dismissable?: boolean;
|
|
119
|
+
keyboardDismissable?: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface DialogContextProps {
|
|
123
|
+
open?: boolean;
|
|
124
|
+
close?: () => void;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface DialogThemeExtension extends ThemeExtensionsWithParts<'Dialog', ['container', 'closeButton']> {
|
|
128
|
+
}
|
|
129
|
+
interface DialogChildProps {
|
|
130
|
+
close: DialogContextProps['close'];
|
|
131
|
+
titleProps: HTMLAttributes<HTMLElement>;
|
|
132
|
+
}
|
|
133
|
+
interface DialogProps extends AriaDialogProps {
|
|
134
|
+
children?: ReactNode | ((props: DialogChildProps) => ReactNode);
|
|
135
|
+
variant?: string;
|
|
136
|
+
size?: string;
|
|
137
|
+
closeButton?: boolean;
|
|
138
|
+
}
|
|
139
|
+
declare const Dialog: {
|
|
140
|
+
({ children, variant, size, closeButton, ...props }: DialogProps): JSX.Element;
|
|
141
|
+
Trigger: ({ children, dismissable, keyboardDismissable, }: DialogTriggerProps) => JSX.Element;
|
|
142
|
+
};
|
|
143
|
+
|
|
111
144
|
interface DividerThemeExtension extends ThemeExtension<'Divider'> {
|
|
112
145
|
}
|
|
113
146
|
interface DividerProps extends SeparatorProps {
|
|
@@ -144,6 +177,7 @@ interface ImageThemeExtension extends ThemeExtension<'Image'> {
|
|
|
144
177
|
}
|
|
145
178
|
interface ImageProps extends ComponentProps<'img'> {
|
|
146
179
|
variant?: string;
|
|
180
|
+
size?: string;
|
|
147
181
|
children?: never;
|
|
148
182
|
}
|
|
149
183
|
declare const Image: ({ variant, ...props }: ImageProps) => JSX.Element;
|
|
@@ -158,8 +192,15 @@ interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, 'size'>,
|
|
|
158
192
|
}
|
|
159
193
|
declare const Input: React.ForwardRefExoticComponent<InputOwnProps & React.RefAttributes<HTMLInputElement>>;
|
|
160
194
|
|
|
161
|
-
interface LabelThemeExtension
|
|
195
|
+
interface LabelThemeExtension extends ThemeExtension<'Label'> {
|
|
196
|
+
}
|
|
197
|
+
interface LabelProps extends ComponentProps<'label'> {
|
|
198
|
+
as?: 'label' | 'span';
|
|
199
|
+
variant?: string;
|
|
200
|
+
size?: string;
|
|
201
|
+
required?: boolean;
|
|
162
202
|
}
|
|
203
|
+
declare const Label: ({ as, required, children, variant, size, ...props }: LabelProps) => JSX.Element;
|
|
163
204
|
|
|
164
205
|
interface LinkThemeExtension extends ThemeExtension<'Link'> {
|
|
165
206
|
}
|
|
@@ -167,11 +208,21 @@ interface LinkOwnProps extends BoxOwnProps {
|
|
|
167
208
|
disabled?: boolean;
|
|
168
209
|
variant?: string;
|
|
169
210
|
size?: string;
|
|
211
|
+
children?: ReactNode;
|
|
170
212
|
}
|
|
171
213
|
interface LinkProps extends PolymorphicProps<LinkOwnProps, 'a'> {
|
|
172
214
|
}
|
|
173
215
|
declare const Link: PolymorphicComponent<LinkOwnProps, "a">;
|
|
174
216
|
|
|
217
|
+
interface ListBoxThemeExtension extends ThemeExtensionsWithParts<'ListBox', [
|
|
218
|
+
'container',
|
|
219
|
+
'list',
|
|
220
|
+
'option',
|
|
221
|
+
'section',
|
|
222
|
+
'sectionTitle'
|
|
223
|
+
]> {
|
|
224
|
+
}
|
|
225
|
+
|
|
175
226
|
interface MenuTriggerProps {
|
|
176
227
|
children: [trigger: ReactNode, menu: ReactNode];
|
|
177
228
|
disabled?: boolean;
|
|
@@ -191,26 +242,29 @@ declare const Menu: {
|
|
|
191
242
|
Item: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
|
|
192
243
|
};
|
|
193
244
|
|
|
194
|
-
interface
|
|
245
|
+
interface MessageThemeExtension extends ThemeExtensionsWithParts<'Message', [
|
|
246
|
+
'container',
|
|
247
|
+
'icon',
|
|
248
|
+
'title',
|
|
249
|
+
'content'
|
|
250
|
+
]> {
|
|
195
251
|
}
|
|
196
|
-
interface
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
fontSize?: string;
|
|
201
|
-
outline?: string;
|
|
202
|
-
children?: React.ReactNode;
|
|
252
|
+
interface MessageProps extends ComponentProps<'div'> {
|
|
253
|
+
messageTitle: ReactNode;
|
|
254
|
+
variant?: string;
|
|
255
|
+
size?: string;
|
|
203
256
|
}
|
|
204
|
-
declare const
|
|
257
|
+
declare const Message: ({ messageTitle, variant, size, children, ...props }: MessageProps) => JSX.Element;
|
|
205
258
|
|
|
206
259
|
interface FieldBaseProps {
|
|
207
260
|
children?: ReactNode;
|
|
208
261
|
variant?: string;
|
|
209
262
|
size?: string;
|
|
263
|
+
width?: string;
|
|
210
264
|
disabled?: boolean;
|
|
211
265
|
required?: boolean;
|
|
212
266
|
label?: ReactNode;
|
|
213
|
-
labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
|
|
267
|
+
labelProps?: LabelHTMLAttributes<HTMLLabelElement> & Pick<LabelProps, 'as'>;
|
|
214
268
|
description?: ReactNode;
|
|
215
269
|
descriptionProps?: HTMLAttributes<HTMLElement>;
|
|
216
270
|
error?: boolean;
|
|
@@ -219,133 +273,136 @@ interface FieldBaseProps {
|
|
|
219
273
|
stateProps?: StateAttrProps;
|
|
220
274
|
}
|
|
221
275
|
|
|
222
|
-
interface
|
|
276
|
+
interface NumberFieldThemeExtension extends ThemeExtensionsWithParts<'NumberField', ['group', 'stepper']> {
|
|
223
277
|
}
|
|
224
278
|
/**
|
|
225
|
-
* `react-aria` has a slightly different API for
|
|
279
|
+
* `react-aria` has a slightly different API for some DOM props.
|
|
226
280
|
* Thus, we adjust our regular props to match them.
|
|
227
281
|
*/
|
|
228
|
-
declare type
|
|
229
|
-
interface
|
|
230
|
-
|
|
231
|
-
|
|
282
|
+
declare type CustomProps = 'size' | 'width' | 'type' | 'value' | 'defaultValue' | 'step' | 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'min' | 'max';
|
|
283
|
+
interface NumberFieldProps extends Omit<ComponentProps<'input'>, CustomProps>, Omit<AriaNumberFieldProps, 'isDisabled' | 'isRequired' | 'isReadOnly'>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
|
|
284
|
+
variant?: string;
|
|
285
|
+
size?: string;
|
|
286
|
+
width?: string;
|
|
287
|
+
hideStepper?: boolean;
|
|
232
288
|
}
|
|
233
|
-
declare const
|
|
289
|
+
declare const NumberField: React.ForwardRefExoticComponent<NumberFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
234
290
|
|
|
235
|
-
interface
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
291
|
+
interface OverlayProps extends ComponentProps<'div'> {
|
|
292
|
+
children: ReactNode;
|
|
293
|
+
open?: boolean;
|
|
294
|
+
container?: HTMLElement;
|
|
239
295
|
}
|
|
240
|
-
declare
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
296
|
+
declare const Overlay: ({ children, open, container, ...props }: OverlayProps) => JSX.Element | null;
|
|
297
|
+
|
|
298
|
+
interface PopoverProps extends Omit<OverlayProps$1, 'isOpen' | 'isDismissable' | 'isKeyboardDismissDisabled'> {
|
|
299
|
+
children?: ReactNode;
|
|
300
|
+
open?: boolean;
|
|
301
|
+
dismissable?: boolean;
|
|
302
|
+
keyboardDismissDisabled?: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Adjust size of the popover. This is used to make the popover
|
|
305
|
+
* at least the same width as its anchor element.
|
|
306
|
+
*/
|
|
307
|
+
minWidth?: number | string;
|
|
249
308
|
}
|
|
250
|
-
declare const
|
|
309
|
+
declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<unknown>>;
|
|
251
310
|
|
|
252
|
-
interface
|
|
253
|
-
message?: {
|
|
254
|
-
[key: string]: Value;
|
|
255
|
-
};
|
|
311
|
+
interface UnderlayThemeExtension extends ThemeExtension<'Underlay'> {
|
|
256
312
|
}
|
|
257
|
-
interface
|
|
258
|
-
messageTitle: string;
|
|
313
|
+
interface UnderlayProps extends HTMLAttributes<HTMLElement> {
|
|
259
314
|
variant?: string;
|
|
315
|
+
size?: string;
|
|
260
316
|
}
|
|
261
|
-
declare const
|
|
317
|
+
declare const Underlay: ({ size, variant, ...props }: UnderlayProps) => JSX.Element;
|
|
262
318
|
|
|
263
|
-
interface
|
|
319
|
+
interface RadioGroupThemeExtension extends ThemeExtensionsWithParts<'RadioGroup', ['container', 'group']> {
|
|
320
|
+
}
|
|
321
|
+
interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'isDisabled' | 'isRquired' | 'isReadOnly ' | 'validationState'> {
|
|
322
|
+
children: ReactNode[];
|
|
264
323
|
variant?: string;
|
|
265
|
-
|
|
324
|
+
size?: string;
|
|
325
|
+
width?: string;
|
|
326
|
+
required?: boolean;
|
|
266
327
|
disabled?: boolean;
|
|
328
|
+
readOnly?: boolean;
|
|
267
329
|
error?: boolean;
|
|
268
330
|
}
|
|
269
331
|
|
|
270
|
-
interface RadioThemeExtension<
|
|
271
|
-
radio?: {
|
|
272
|
-
[key: string]: Value;
|
|
273
|
-
};
|
|
332
|
+
interface RadioThemeExtension extends ThemeExtensionsWithParts<'Radio', ['container', 'label', 'radio']> {
|
|
274
333
|
}
|
|
275
|
-
|
|
334
|
+
declare type CustomRadioProps = 'size' | 'width' | 'type' | 'defaultChecked' | 'value' | 'onFocus' | 'onBlur' | 'onKeyUp' | 'onKeyDown';
|
|
335
|
+
interface RadioProps extends ThemeComponentProps, Omit<ComponentProps<'input'>, CustomRadioProps>, AriaRadioProps {
|
|
336
|
+
width?: string;
|
|
337
|
+
disabled?: boolean;
|
|
276
338
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
required
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
declare const Radio: React.FC<RadioProps>;
|
|
284
|
-
|
|
285
|
-
interface SelectThemeExtension<Value> {
|
|
286
|
-
select?: {
|
|
287
|
-
__default: Value;
|
|
288
|
-
disabled?: Value;
|
|
289
|
-
listbox?: {
|
|
290
|
-
__default: Value;
|
|
291
|
-
error?: Value;
|
|
292
|
-
};
|
|
293
|
-
section?: Value;
|
|
294
|
-
option?: Value;
|
|
295
|
-
};
|
|
339
|
+
declare const Radio: {
|
|
340
|
+
({ width, disabled, ...props }: RadioProps): JSX.Element;
|
|
341
|
+
Group: ({ children, orientation, size, variant, width, required, disabled, readOnly, error, ...rest }: RadioGroupProps) => JSX.Element;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
interface SelectThemeExtension extends ThemeExtensionsWithParts<'Select', ['container', 'button', 'icon']> {
|
|
296
345
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
346
|
+
interface SelectProps extends Omit<AriaSelectProps<object>, 'autoComplete' | 'isOpen' | 'isLoading' | 'onLoadMore' | 'isDisabled' | 'isRequired' | 'validationState'>, Omit<ComponentProps<'select'>, 'onKeyUp' | 'onKeyDown' | 'onFocus' | 'onBlur' | 'children' | 'size'> {
|
|
347
|
+
variant?: string;
|
|
348
|
+
size?: string;
|
|
349
|
+
width?: string;
|
|
350
|
+
open?: boolean;
|
|
300
351
|
disabled?: boolean;
|
|
301
352
|
required?: boolean;
|
|
302
|
-
width?: ResponsiveStyleValue<number | string>;
|
|
303
353
|
error?: boolean;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
354
|
+
}
|
|
355
|
+
declare const Select: {
|
|
356
|
+
({ variant, size, width, open, disabled, required, error, ...rest }: SelectProps): JSX.Element;
|
|
357
|
+
Option: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
|
|
358
|
+
Section: <T_1>(props: _react_types_shared.SectionProps<T_1>) => JSX.Element;
|
|
359
|
+
};
|
|
307
360
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
361
|
+
/**
|
|
362
|
+
* Thanks to react-aria: https://react-spectrum.adobe.com/react-aria/useSlider.html
|
|
363
|
+
*/
|
|
364
|
+
|
|
365
|
+
interface SliderThemeExtension extends ThemeExtensionsWithParts<'Slider', [
|
|
366
|
+
'track',
|
|
367
|
+
'thumb',
|
|
368
|
+
'label',
|
|
369
|
+
'output'
|
|
370
|
+
]> {
|
|
312
371
|
}
|
|
313
|
-
interface SliderProps extends ComponentProps<'input'
|
|
372
|
+
interface SliderProps extends Omit<ComponentProps<'input'>, 'step' | 'value' | 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur' | 'size' | 'width'>,
|
|
373
|
+
/**
|
|
374
|
+
* `react-aria` has a slightly different API for some events e.g `onChange`, `onFocus`
|
|
375
|
+
* `onBlur`. Thus, we adjust our regular props to match them.
|
|
376
|
+
*/
|
|
377
|
+
Pick<AriaSliderProps, 'maxValue' | 'step' | 'value' | 'defaultValue' | 'onChange'> {
|
|
314
378
|
variant?: string;
|
|
379
|
+
size?: string;
|
|
380
|
+
width?: string;
|
|
381
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
382
|
+
children?: ReactNode;
|
|
315
383
|
}
|
|
316
|
-
|
|
384
|
+
/**
|
|
385
|
+
* The slider consists of two parts.
|
|
386
|
+
* A label + the output value and the slider functionality itself.
|
|
387
|
+
* The slider itself consists of a track line and a thumb.
|
|
388
|
+
*/
|
|
389
|
+
declare const Slider: ({ variant, size, width, ...props }: SliderProps) => JSX.Element;
|
|
317
390
|
|
|
318
|
-
interface SwitchThemeExtension<
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
391
|
+
interface SwitchThemeExtension extends ThemeExtensionsWithParts<'Switch', [
|
|
392
|
+
'container',
|
|
393
|
+
'label',
|
|
394
|
+
'track',
|
|
395
|
+
'thumb'
|
|
396
|
+
]> {
|
|
322
397
|
}
|
|
323
|
-
declare type
|
|
398
|
+
declare type CustomSwitchProps = 'size' | 'value' | 'onBlur' | 'onChange' | 'onFocus' | 'onKeyDown' | 'onKeyUp';
|
|
399
|
+
interface SwitchProps extends Omit<AriaSwitchProps, 'isSelected'>, Omit<ComponentProps<'input'>, CustomSwitchProps> {
|
|
400
|
+
checked?: boolean;
|
|
324
401
|
variant?: string;
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
} & AriaSwitchProps & ToggleProps & ComponentProps<'input'>;
|
|
328
|
-
declare const Switch: React.FC<SwitchProps>;
|
|
329
|
-
|
|
330
|
-
interface TableCellProps {
|
|
331
|
-
item: Node<object>;
|
|
332
|
-
state: TableState<object>;
|
|
333
|
-
/**
|
|
334
|
-
* Wheter it is a cell with a checkbox or a regular data cell
|
|
335
|
-
*/
|
|
336
|
-
isSelectionCell?: boolean;
|
|
337
|
-
align?: 'left' | 'center' | 'right';
|
|
338
|
-
css?: CSSObject;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
interface TableColumnHeaderProps {
|
|
342
|
-
chilren?: ReactNode;
|
|
343
|
-
item: Node<object>;
|
|
344
|
-
state: TableState<object>;
|
|
345
|
-
isSelectionColumn?: boolean;
|
|
346
|
-
align?: 'left' | 'center' | 'right';
|
|
347
|
-
css?: CSSObject;
|
|
402
|
+
size?: string;
|
|
403
|
+
width?: string;
|
|
348
404
|
}
|
|
405
|
+
declare const Switch: ({ variant, size, width, checked, disabled, readOnly, defaultChecked, ...rest }: SwitchProps) => JSX.Element;
|
|
349
406
|
|
|
350
407
|
interface TableThemeExtension extends ThemeExtensionsWithParts<'Table', [
|
|
351
408
|
'table',
|
|
@@ -354,16 +411,14 @@ interface TableThemeExtension extends ThemeExtensionsWithParts<'Table', [
|
|
|
354
411
|
'cell'
|
|
355
412
|
]> {
|
|
356
413
|
}
|
|
357
|
-
interface TableProps extends Pick<TableProps$1<object>, 'onRowAction' | 'onCellAction'>, TableStateProps<object> {
|
|
358
|
-
align?: TableCellProps['align'];
|
|
359
|
-
alignHeader?: TableColumnHeaderProps['align'];
|
|
414
|
+
interface TableProps extends Pick<TableProps$1<object>, 'focusMode' | 'onRowAction' | 'onCellAction'>, Omit<TableStateProps<object>, 'showSelectionCheckboxes'> {
|
|
360
415
|
variant?: string;
|
|
361
416
|
size?: string;
|
|
362
417
|
}
|
|
363
418
|
declare const Table: Table;
|
|
364
419
|
/**
|
|
365
420
|
* Necessary since TypeScript can not infer the
|
|
366
|
-
* types of the @react-stately components
|
|
421
|
+
* types of the @react-stately components.
|
|
367
422
|
*/
|
|
368
423
|
interface Table {
|
|
369
424
|
(props: TableProps): JSX.Element;
|
|
@@ -374,34 +429,55 @@ interface Table {
|
|
|
374
429
|
Row: typeof Row;
|
|
375
430
|
}
|
|
376
431
|
|
|
377
|
-
interface
|
|
378
|
-
tooltip?: {
|
|
379
|
-
[key: string]: Value;
|
|
380
|
-
};
|
|
432
|
+
interface TextThemeExtension extends ThemeExtension<'Text'> {
|
|
381
433
|
}
|
|
382
|
-
interface
|
|
434
|
+
interface TextProps extends ThemeComponentProps, ComponentProps<'p'>, Omit<BoxOwnProps, 'variant'> {
|
|
435
|
+
align?: CSSObject['textAlign'];
|
|
436
|
+
color?: string;
|
|
437
|
+
cursor?: string;
|
|
438
|
+
fontSize?: string;
|
|
439
|
+
outline?: string;
|
|
440
|
+
children?: React.ReactNode;
|
|
441
|
+
}
|
|
442
|
+
declare const Text: ({ variant, size, align, color, fontSize, cursor, outline, children, ...props }: TextProps) => JSX.Element;
|
|
443
|
+
|
|
444
|
+
interface TextAreaThemeExtension extends ThemeExtension<'TextArea'> {
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* `react-aria` has a slightly different API for the above events.
|
|
448
|
+
* Thus, we adjust our regular props to match them.
|
|
449
|
+
*/
|
|
450
|
+
declare type CustomTextAreEvents = 'onChange' | 'onFocus' | 'onBlur' | 'onCopy' | 'onSelect' | 'onPaste' | 'onCut' | 'onCompositionStart' | 'onCompositionUpdate' | 'onCompositionEnd' | 'onBeforeInput' | 'onInput';
|
|
451
|
+
interface TextAreaProps extends Omit<ComponentProps<'textarea'>, 'value' | 'defaultValue' | 'size' | CustomTextAreEvents>, Pick<AriaTextFieldProps, CustomTextAreEvents>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
|
|
383
452
|
variant?: string;
|
|
453
|
+
size?: string;
|
|
454
|
+
width?: string;
|
|
455
|
+
value?: string;
|
|
456
|
+
defaultValue?: string;
|
|
384
457
|
}
|
|
385
|
-
declare const
|
|
458
|
+
declare const TextArea: ({ variant, size, width, disabled, required, readOnly, error, rows, ...props }: TextAreaProps) => JSX.Element;
|
|
386
459
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
460
|
+
interface TooltipTriggerProps extends Omit<TooltipTriggerProps$1, 'isDisabled' | 'isOpen'>, Omit<PositionProps, 'isOpen'> {
|
|
461
|
+
children: [trigger: ReactElement, menu: ReactElement];
|
|
462
|
+
disabled?: boolean;
|
|
463
|
+
open?: boolean;
|
|
464
|
+
}
|
|
391
465
|
|
|
392
|
-
interface
|
|
393
|
-
validation?: {
|
|
394
|
-
[key: string]: Value;
|
|
395
|
-
};
|
|
466
|
+
interface TooltipThemeExtension extends ThemeExtensionsWithParts<'Tooltip', ['container', 'arrow']> {
|
|
396
467
|
}
|
|
397
|
-
interface
|
|
468
|
+
interface TooltipProps extends ComponentProps<'div'> {
|
|
469
|
+
children?: ReactNode;
|
|
398
470
|
variant?: string;
|
|
471
|
+
size?: string;
|
|
399
472
|
}
|
|
400
|
-
declare const
|
|
473
|
+
declare const Tooltip: {
|
|
474
|
+
({ children, variant, size }: TooltipProps): JSX.Element;
|
|
475
|
+
Trigger: ({ disabled, open, delay, placement, children, ...rest }: TooltipTriggerProps) => JSX.Element;
|
|
476
|
+
};
|
|
401
477
|
|
|
402
|
-
interface ComponentStyles extends BadgeThemeExtension, ButtonThemeExtension, CardThemeExtension, CheckboxThemeExtension, CheckboxGroupThemeExtension, ContentThemeExtension, DividerThemeExtension, FooterThemeExtension, HeaderThemeExtension, HeadlineThemeExtension, HelpTextThemeExtension, ImageThemeExtension, InputThemeExtension, LabelThemeExtension
|
|
478
|
+
interface ComponentStyles extends BadgeThemeExtension, ButtonThemeExtension, CardThemeExtension, CheckboxThemeExtension, CheckboxGroupThemeExtension, ContentThemeExtension, DialogThemeExtension, DividerThemeExtension, FooterThemeExtension, HeaderThemeExtension, HeadlineThemeExtension, HelpTextThemeExtension, ImageThemeExtension, InputThemeExtension, LabelThemeExtension, LinkThemeExtension, ListBoxThemeExtension, MenuThemeExtension, MessageThemeExtension, NumberFieldThemeExtension, RadioThemeExtension, RadioGroupThemeExtension, SelectThemeExtension, SliderThemeExtension, SwitchThemeExtension, TableThemeExtension, TextThemeExtension, TextAreaThemeExtension, TooltipThemeExtension, UnderlayThemeExtension {
|
|
403
479
|
}
|
|
404
|
-
interface Theme extends Theme$1, RootThemeExtension<CSSObject
|
|
480
|
+
interface Theme extends Theme$1, RootThemeExtension<CSSObject> {
|
|
405
481
|
components: ComponentStyles;
|
|
406
482
|
}
|
|
407
483
|
|
|
@@ -427,96 +503,94 @@ interface AspectProps extends ComponentProps<'div'> {
|
|
|
427
503
|
declare const Aspect: ({ ratio, maxWidth, children, }: AspectProps) => JSX.Element;
|
|
428
504
|
|
|
429
505
|
interface BreakoutProps extends ComponentProps<'div'> {
|
|
506
|
+
children?: ReactNode;
|
|
430
507
|
horizontalAlign?: 'top' | 'bottom' | 'center';
|
|
431
508
|
verticalAlign?: 'left' | 'right' | 'center';
|
|
432
509
|
}
|
|
433
|
-
declare const Breakout:
|
|
510
|
+
declare const Breakout: ({ horizontalAlign, verticalAlign, children, ...props }: BreakoutProps) => JSX.Element;
|
|
434
511
|
|
|
435
512
|
interface CenterProps extends ComponentProps<'div'> {
|
|
513
|
+
children?: ReactNode;
|
|
436
514
|
maxWidth?: string;
|
|
437
515
|
space?: ResponsiveStyleValue<string>;
|
|
438
516
|
}
|
|
439
|
-
declare const Center:
|
|
517
|
+
declare const Center: ({ maxWidth, space, children, ...props }: CenterProps) => JSX.Element;
|
|
440
518
|
|
|
441
519
|
interface ColumnsProps {
|
|
520
|
+
children?: ReactNode;
|
|
442
521
|
columns: Array<number>;
|
|
443
522
|
space?: ResponsiveStyleValue<string>;
|
|
444
523
|
columnLimit?: number;
|
|
445
524
|
collapseAt?: string;
|
|
446
525
|
}
|
|
447
|
-
declare const Columns:
|
|
526
|
+
declare const Columns: ({ space, columns, collapseAt, children, ...props }: ColumnsProps) => JSX.Element;
|
|
448
527
|
|
|
449
|
-
interface
|
|
450
|
-
|
|
451
|
-
|
|
528
|
+
interface ContainerProps extends ComponentProps<'div'> {
|
|
529
|
+
children?: ReactNode;
|
|
530
|
+
contentType?: 'content' | 'header';
|
|
531
|
+
size?: keyof typeof size.content | keyof typeof size.header;
|
|
532
|
+
align?: 'left' | 'right' | 'center';
|
|
533
|
+
alignContainer?: 'left' | 'right' | 'center';
|
|
452
534
|
}
|
|
535
|
+
declare const Container: ({ contentType, size, align, alignContainer, children, ...props }: ContainerProps) => JSX.Element;
|
|
453
536
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
declare const useDialogButtonProps: () => {
|
|
464
|
-
state: _react_stately_overlays.OverlayTriggerState;
|
|
465
|
-
openButtonProps: React.HTMLAttributes<HTMLSpanElement>;
|
|
466
|
-
openButtonRef: React.RefObject<HTMLElement>;
|
|
537
|
+
declare const ALIGNMENT_X$1: {
|
|
538
|
+
left: string;
|
|
539
|
+
center: string;
|
|
540
|
+
right: string;
|
|
541
|
+
};
|
|
542
|
+
declare const ALIGNMENT_Y$1: {
|
|
543
|
+
top: string;
|
|
544
|
+
center: string;
|
|
545
|
+
bottom: string;
|
|
467
546
|
};
|
|
468
|
-
|
|
469
547
|
interface InlineProps {
|
|
470
|
-
space?: ResponsiveStyleValue<string>;
|
|
471
|
-
align?: 'top' | 'center' | 'bottom';
|
|
472
|
-
}
|
|
473
|
-
declare const Inline: React.FC<InlineProps>;
|
|
474
|
-
|
|
475
|
-
interface OverlayProps extends ComponentProps<'div'> {
|
|
476
|
-
children: ReactNode;
|
|
477
|
-
open?: boolean;
|
|
478
|
-
container?: Element;
|
|
479
|
-
}
|
|
480
|
-
declare const Overlay: ({ children, open, container, ...props }: OverlayProps) => JSX.Element | null;
|
|
481
|
-
|
|
482
|
-
interface PopoverProps extends Omit<OverlayProps$1, 'isOpen' | 'isDismissable' | 'isKeyboardDismissDisabled'> {
|
|
483
548
|
children?: ReactNode;
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
549
|
+
space?: ResponsiveStyleValue<string>;
|
|
550
|
+
alignX?: keyof typeof ALIGNMENT_X$1;
|
|
551
|
+
alignY?: keyof typeof ALIGNMENT_Y$1;
|
|
487
552
|
}
|
|
488
|
-
declare const
|
|
553
|
+
declare const Inline: ({ space, alignX, alignY, children, ...props }: InlineProps) => JSX.Element;
|
|
489
554
|
|
|
555
|
+
declare const ALIGNMENT_X: {
|
|
556
|
+
left: string;
|
|
557
|
+
center: string;
|
|
558
|
+
right: string;
|
|
559
|
+
};
|
|
560
|
+
declare const ALIGNMENT_Y: {
|
|
561
|
+
top: string;
|
|
562
|
+
center: string;
|
|
563
|
+
bottom: string;
|
|
564
|
+
};
|
|
490
565
|
interface StackProps {
|
|
491
566
|
as?: 'div' | 'ul' | 'ol';
|
|
567
|
+
children?: ReactNode;
|
|
492
568
|
space?: ResponsiveStyleValue<string>;
|
|
493
|
-
|
|
569
|
+
alignX?: keyof typeof ALIGNMENT_X;
|
|
570
|
+
alignY?: keyof typeof ALIGNMENT_Y;
|
|
571
|
+
stretch?: boolean;
|
|
494
572
|
}
|
|
495
|
-
declare const Stack:
|
|
573
|
+
declare const Stack: ({ children, space, alignX, alignY, stretch, ...props }: StackProps) => JSX.Element;
|
|
496
574
|
|
|
497
|
-
interface TextFieldProps extends Omit<ComponentProps<'input'>, 'value' | 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur'>,
|
|
575
|
+
interface TextFieldProps extends Omit<ComponentProps<'input'>, 'value' | 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur' | 'size' | 'width'>,
|
|
498
576
|
/**
|
|
499
577
|
* `react-aria` has a slightly different API for `onChange`, `onFocus`
|
|
500
578
|
* and `onBlur` events. Thus, we adjust our regular props to match them.
|
|
501
579
|
*/
|
|
502
580
|
Pick<AriaTextFieldProps, 'onChange' | 'onFocus' | 'onBlur'>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
|
|
581
|
+
variant?: string;
|
|
582
|
+
size?: string;
|
|
583
|
+
width?: string;
|
|
503
584
|
value?: string;
|
|
504
585
|
defaultValue?: string;
|
|
505
586
|
}
|
|
506
|
-
declare const TextField: ({ disabled, required, readOnly, error, ...props }: TextFieldProps) => JSX.Element;
|
|
587
|
+
declare const TextField: ({ variant, size, width, disabled, required, readOnly, error, ...props }: TextFieldProps) => JSX.Element;
|
|
507
588
|
|
|
508
589
|
interface TilesProps {
|
|
590
|
+
children: ReactNode;
|
|
509
591
|
space?: ResponsiveStyleValue<string>;
|
|
510
592
|
itemMinWidth?: ResponsiveStyleValue<string>;
|
|
511
593
|
}
|
|
512
|
-
declare const Tiles: React.
|
|
513
|
-
|
|
514
|
-
interface ContainerProps extends ComponentProps<'div'> {
|
|
515
|
-
contentType?: 'content' | 'header';
|
|
516
|
-
size?: keyof typeof size.content | keyof typeof size.header;
|
|
517
|
-
align?: 'left' | 'right' | 'center';
|
|
518
|
-
alignContainer?: 'left' | 'right' | 'center';
|
|
519
|
-
}
|
|
520
|
-
declare const Container: React.FC<ContainerProps>;
|
|
594
|
+
declare const Tiles: React.ForwardRefExoticComponent<TilesProps & React.RefAttributes<HTMLDivElement>>;
|
|
521
595
|
|
|
522
|
-
export { Aside, AsideProps, Aspect, AspectProps, Badge, BadgeProps, BadgeThemeExtension, Breakout, BreakoutProps, Button, ButtonOwnProps, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Center, CenterProps, Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupContextProps, CheckboxGroupThemeExtension, CheckboxProps, CheckboxThemeExtension, Columns, ColumnsProps, Container, ContainerProps, Content, ContentProps, ContentThemeExtension, CustomCheckboxProps, CustomTextAreEvents, Dialog, DialogProps, Divider, DividerProps, DividerThemeExtension, Footer, FooterProps, FooterThemeExtension, Header, HeaderProps, HeaderThemeExtension, Headline, HeadlineProps, HeadlineThemeExtension, Image, ImageProps, ImageThemeExtension, Inline, InlineProps, Input, InputOwnProps, InputProps, InputThemeExtension, Label,
|
|
596
|
+
export { Aside, AsideProps, Aspect, AspectProps, Badge, BadgeProps, BadgeThemeExtension, Breakout, BreakoutProps, Button, ButtonOwnProps, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Center, CenterProps, Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupContextProps, CheckboxGroupThemeExtension, CheckboxProps, CheckboxThemeExtension, Columns, ColumnsProps, Container, ContainerProps, Content, ContentProps, ContentThemeExtension, CustomCheckboxProps, CustomRadioProps, CustomSwitchProps, CustomTextAreEvents, Dialog, DialogChildProps, DialogProps, DialogThemeExtension, Divider, DividerProps, DividerThemeExtension, Footer, FooterProps, FooterThemeExtension, Header, HeaderProps, HeaderThemeExtension, Headline, HeadlineProps, HeadlineThemeExtension, Image, ImageProps, ImageThemeExtension, Inline, InlineProps, Input, InputOwnProps, InputProps, InputThemeExtension, Label, LabelProps, LabelThemeExtension, Link, LinkOwnProps, LinkProps, LinkThemeExtension, MarigoldProvider, MarigoldProviderProps, Menu, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, NumberField, NumberFieldProps, NumberFieldThemeExtension, Overlay, OverlayProps, Popover, PopoverProps, Radio, RadioGroupProps, RadioGroupThemeExtension, RadioProps, RadioThemeExtension, RootThemeExtension, Select, SelectProps, SelectThemeExtension, Slider, SliderProps, SliderThemeExtension, Stack, StackProps, Switch, SwitchProps, SwitchThemeExtension, Table, TableProps, TableThemeExtension, Text, TextArea, TextAreaProps, TextAreaThemeExtension, TextField, TextFieldProps, TextProps, TextThemeExtension, Theme, Tiles, TilesProps, Tooltip, TooltipProps, TooltipThemeExtension, Underlay, UnderlayProps, UnderlayThemeExtension, useCheckboxGroupContext };
|