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