@marigold/components 0.7.0 → 1.0.0-beta.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 +390 -232
  2. package/dist/index.js +1967 -1095
  3. package/dist/index.mjs +2024 -1088
  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, 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
19
  import { TooltipTriggerProps } from '@react-types/tooltip';
12
20
  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';
21
+ import { OverlayProps as OverlayProps$1 } from '@react-aria/overlays';
17
22
  export { SSRProvider } from '@react-aria/ssr';
18
23
  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,249 +33,421 @@ 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'> {
47
46
  }
48
- interface ButtonProps extends PolymorphicPropsWithRef<BoxOwnProps, 'button'> {
47
+ interface ButtonOwnProps extends PressEvents {
48
+ children?: ReactNode;
49
+ variant?: string;
50
+ size?: string;
49
51
  }
50
- declare const Button: PolymorphicComponentWithRef<BoxOwnProps, 'button'>;
52
+ interface ButtonProps extends PolymorphicPropsWithRef<ButtonOwnProps, 'button'> {
53
+ }
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 TextThemeExtension<Value> {
135
- text?: {
136
- [key: string]: Value;
137
- };
204
+ interface LinkThemeExtension extends ThemeExtension<'Link'> {
138
205
  }
139
- interface TextOwnProps extends BoxOwnProps {
140
- align?: ResponsiveStyleValue<string>;
141
- color?: ResponsiveStyleValue<string>;
142
- cursor?: ResponsiveStyleValue<string>;
143
- size?: ResponsiveStyleValue<keyof Theme$1['fontSizes'] | string>;
144
- outline?: ResponsiveStyleValue<string>;
145
- userSelect?: ResponsiveStyleValue<string>;
206
+ interface LinkOwnProps extends BoxOwnProps {
207
+ disabled?: boolean;
208
+ variant?: string;
209
+ size?: string;
146
210
  }
147
- interface TextProps extends PolymorphicPropsWithRef<TextOwnProps, 'span'> {
211
+ interface LinkProps extends PolymorphicProps<LinkOwnProps, 'a'> {
148
212
  }
149
- declare const Text: PolymorphicComponentWithRef<TextOwnProps, 'span'>;
213
+ declare const Link: PolymorphicComponent<LinkOwnProps, "a">;
150
214
 
151
- interface LinkThemeExtension<Value> {
152
- link?: Value;
215
+ interface ListBoxThemeExtension extends ThemeExtensionsWithParts<'ListBox', [
216
+ 'container',
217
+ 'list',
218
+ 'option',
219
+ 'section',
220
+ 'sectionTitle'
221
+ ]> {
153
222
  }
154
- interface LinkOwnProps extends TextOwnProps {
223
+
224
+ interface MenuTriggerProps {
225
+ children: [trigger: ReactNode, menu: ReactNode];
155
226
  disabled?: boolean;
156
227
  }
157
- interface LinkProps extends PolymorphicProps<LinkOwnProps, 'a'> {
228
+
229
+ interface MenuThemeExtension extends ThemeExtensionsWithParts<'Menu', ['container', 'item']> {
158
230
  }
159
- declare const Link: PolymorphicComponent<LinkOwnProps, "a">;
231
+ interface MenuProps extends Omit<ComponentProps<'ul'>, 'onSelect' | 'size'> {
232
+ children: CollectionElement<object> | CollectionElement<object>[];
233
+ variant?: string;
234
+ size?: string;
235
+ onSelect?: (key: Key) => void;
236
+ }
237
+ declare const Menu: {
238
+ ({ variant, size, ...props }: MenuProps): JSX.Element;
239
+ Trigger: ({ disabled, children }: MenuTriggerProps) => JSX.Element;
240
+ Item: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
241
+ };
160
242
 
161
- interface MenuThemeExtension<Value> {
162
- menu?: Value;
243
+ interface MessageThemeExtension extends ThemeExtensionsWithParts<'Message', [
244
+ 'container',
245
+ 'icon',
246
+ 'title',
247
+ 'content'
248
+ ]> {
163
249
  }
164
- interface MenuProps {
250
+ interface MessageProps extends ComponentProps<'div'> {
251
+ messageTitle: ReactNode;
165
252
  variant?: string;
166
- label?: string;
167
- onClick: ComponentProps<typeof Button>['onClick'];
168
- show?: boolean;
169
- className?: string;
170
- title?: string;
253
+ size?: string;
171
254
  }
172
- declare const Menu: React.FC<MenuProps>;
255
+ declare const Message: ({ messageTitle, variant, size, children, ...props }: MessageProps) => JSX.Element;
173
256
 
174
- interface MenuItemThemeExtension<Value> {
175
- menuItem?: {
176
- [key: string]: Value;
177
- };
257
+ interface FieldBaseProps {
258
+ children?: ReactNode;
259
+ variant?: string;
260
+ size?: string;
261
+ disabled?: boolean;
262
+ required?: boolean;
263
+ label?: ReactNode;
264
+ labelProps?: LabelHTMLAttributes<HTMLLabelElement> & Pick<LabelProps, 'as'>;
265
+ description?: ReactNode;
266
+ descriptionProps?: HTMLAttributes<HTMLElement>;
267
+ error?: boolean;
268
+ errorMessage?: ReactNode;
269
+ errorMessageProps?: HTMLAttributes<HTMLElement>;
270
+ stateProps?: StateAttrProps;
178
271
  }
179
- interface MenuItemProps extends ComponentProps<typeof Link> {
272
+
273
+ interface NumberFieldThemeExtension extends ThemeExtensionsWithParts<'NumberField', ['group', 'stepper']> {
274
+ }
275
+ /**
276
+ * `react-aria` has a slightly different API for some DOM props.
277
+ * Thus, we adjust our regular props to match them.
278
+ */
279
+ declare type CustomProps = 'size' | 'type' | 'value' | 'defaultValue' | 'step' | 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'min' | 'max';
280
+ interface NumberFieldProps extends Omit<ComponentProps<'input'>, CustomProps>, Omit<AriaNumberFieldProps, 'isDisabled' | 'isRequired' | 'isReadOnly'>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
180
281
  variant?: string;
282
+ size?: string;
283
+ hideStepper?: boolean;
181
284
  }
182
- declare const MenuItem: React.FC<MenuItemProps>;
285
+ declare const NumberField: React.ForwardRefExoticComponent<NumberFieldProps & React.RefAttributes<HTMLInputElement>>;
183
286
 
184
- interface MessageThemeExtension<Value> {
185
- message?: {
186
- [key: string]: Value;
187
- };
287
+ interface OverlayProps extends ComponentProps<'div'> {
288
+ children: ReactNode;
289
+ open?: boolean;
290
+ container?: HTMLElement;
188
291
  }
189
- interface MessageProps extends ComponentProps<'div'> {
190
- messageTitle: string;
292
+ declare const Overlay: ({ children, open, container, ...props }: OverlayProps) => JSX.Element | null;
293
+
294
+ interface PopoverProps extends Omit<OverlayProps$1, 'isOpen' | 'isDismissable' | 'isKeyboardDismissDisabled'> {
295
+ children?: ReactNode;
296
+ open?: boolean;
297
+ dismissable?: boolean;
298
+ keyboardDismissDisabled?: boolean;
299
+ /**
300
+ * Adjust size of the popover. This is used to make the popover
301
+ * at least the same width as its anchor element.
302
+ */
303
+ minWidth?: number | string;
304
+ }
305
+ declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<unknown>>;
306
+
307
+ interface UnderlayThemeExtension extends ThemeExtension<'Underlay'> {
308
+ }
309
+ interface UnderlayProps extends HTMLAttributes<HTMLElement> {
191
310
  variant?: string;
311
+ size?: string;
192
312
  }
193
- declare const Message: React.FC<MessageProps>;
313
+ declare const Underlay: ({ size, variant, ...props }: UnderlayProps) => JSX.Element;
194
314
 
195
- interface RadioIconProps {
315
+ interface RadioGroupThemeExtension extends ThemeExtensionsWithParts<'RadioGroup', ['container', 'group']> {
316
+ }
317
+ interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'isDisabled' | 'isRquired' | 'isReadOnly ' | 'validationState'> {
318
+ children: ReactNode[];
196
319
  variant?: string;
197
- checked?: boolean;
320
+ size?: string;
321
+ required?: boolean;
198
322
  disabled?: boolean;
323
+ readOnly?: boolean;
199
324
  error?: boolean;
200
325
  }
201
326
 
202
- interface RadioThemeExtension<Value> {
203
- radio?: {
204
- [key: string]: Value;
205
- };
327
+ interface RadioThemeExtension extends ThemeExtensionsWithParts<'Radio', ['container', 'label', 'radio']> {
206
328
  }
207
- interface RadioInputProps extends RadioIconProps, ComponentProps<'input'> {
329
+ declare type CustomRadioProps = 'value' | 'onFocus' | 'onBlur' | 'onKeyUp' | 'onKeyDown';
330
+ interface RadioProps extends ThemeComponentProps, Omit<ComponentProps<'input'>, 'size' | 'type' | 'defaultChecked' | CustomRadioProps>, AriaRadioProps {
331
+ disabled?: boolean;
208
332
  }
209
- interface RadioProps extends RadioInputProps {
210
- id: string;
211
- required?: boolean;
212
- labelVariant?: string;
213
- errorMessage?: string;
214
- }
215
- declare const Radio: React.FC<RadioProps>;
216
-
217
- interface SelectThemeExtension<Value> {
218
- select?: {
219
- __default: Value;
220
- disabled?: Value;
221
- listbox?: {
222
- __default: Value;
223
- error?: Value;
224
- };
225
- section?: Value;
226
- option?: Value;
227
- };
333
+ declare const Radio: {
334
+ ({ disabled, ...props }: RadioProps): JSX.Element;
335
+ Group: ({ children, orientation, size, variant, required, disabled, readOnly, error, ...rest }: RadioGroupProps) => JSX.Element;
336
+ };
337
+
338
+ interface SelectThemeExtension extends ThemeExtensionsWithParts<'Select', ['container', 'button', 'icon']> {
228
339
  }
229
- declare type SelectProps = {
230
- labelVariant?: string;
231
- placeholder?: string;
340
+ interface SelectProps extends Omit<AriaSelectProps<object>, 'autoComplete' | 'isOpen' | 'isLoading' | 'onLoadMore' | 'isDisabled' | 'isRequired' | 'validationState'>, Omit<ComponentProps<'select'>, 'onKeyUp' | 'onKeyDown' | 'onFocus' | 'onBlur' | 'children' | 'size'> {
341
+ open?: boolean;
232
342
  disabled?: boolean;
233
343
  required?: boolean;
234
- width?: ResponsiveStyleValue<number | string>;
235
344
  error?: boolean;
236
- errorMessage?: string;
237
- } & ComponentProps<'select'> & AriaSelectProps<object> & SingleSelection;
238
- declare const Select: ({ labelVariant, placeholder, disabled, required, error, errorMessage, width, className, ...props }: SelectProps) => JSX.Element;
345
+ variant?: string;
346
+ size?: string;
347
+ css?: CSSObject;
348
+ }
349
+ declare const Select: {
350
+ ({ open, disabled, required, error, variant, size, css, ...rest }: SelectProps): JSX.Element;
351
+ Option: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
352
+ Section: <T_1>(props: _react_types_shared.SectionProps<T_1>) => JSX.Element;
353
+ };
239
354
 
240
- interface SliderThemeExtension<Value> {
241
- slider?: {
242
- [key: string]: Value;
243
- };
355
+ /**
356
+ * Thanks to react-aria: https://react-spectrum.adobe.com/react-aria/useSlider.html
357
+ */
358
+
359
+ interface SliderThemeExtension extends ThemeExtensionsWithParts<'Slider', [
360
+ 'track',
361
+ 'thumb',
362
+ 'label',
363
+ 'output'
364
+ ]> {
244
365
  }
245
- interface SliderProps extends ComponentProps<'input'> {
366
+ interface SliderProps extends Omit<ComponentProps<'input'>, 'step' | 'value' | 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur' | 'size'>,
367
+ /**
368
+ * `react-aria` has a slightly different API for some events e.g `onChange`, `onFocus`
369
+ * `onBlur`. Thus, we adjust our regular props to match them.
370
+ */
371
+ Pick<AriaSliderProps, 'maxValue' | 'step' | 'value' | 'defaultValue' | 'onChange'> {
246
372
  variant?: string;
373
+ size?: string;
374
+ formatOptions?: Intl.NumberFormatOptions;
375
+ children?: ReactNode;
247
376
  }
248
- declare const Slider: React.FC<SliderProps>;
377
+ /**
378
+ * Component Slider
379
+ * The slider consists of two parts.
380
+ * A label + the output value and the slider functionality itself.
381
+ * The slider itself consists of a track line and a thumb.
382
+ */
383
+ declare const Slider: ({ variant, size, ...props }: SliderProps) => JSX.Element;
249
384
 
250
- interface SwitchThemeExtension<Value> {
251
- switch?: {
252
- [key: string]: Value;
253
- };
385
+ interface SwitchThemeExtension extends ThemeExtensionsWithParts<'Switch', [
386
+ 'container',
387
+ 'label',
388
+ 'track',
389
+ 'thumb'
390
+ ]> {
254
391
  }
255
- declare type SwitchProps = {
392
+ declare type CustomSwitchProps = 'size' | 'value' | 'onBlur' | 'onChange' | 'onFocus' | 'onKeyDown' | 'onKeyUp';
393
+ interface SwitchProps extends Omit<AriaSwitchProps, 'isSelected'>, Omit<ComponentProps<'input'>, CustomSwitchProps> {
394
+ checked?: boolean;
256
395
  variant?: string;
257
- labelVariant?: string;
258
- disabled?: boolean;
259
- } & AriaSwitchProps & ToggleProps & ComponentProps<'input'>;
260
- declare const Switch: React.FC<SwitchProps>;
396
+ size?: string;
397
+ }
398
+ declare const Switch: ({ variant, size, checked, disabled, readOnly, defaultChecked, ...rest }: SwitchProps) => JSX.Element;
261
399
 
262
- interface TextareaThemeExtension<Value> {
263
- textarea?: {
264
- [key: string]: Value;
265
- };
400
+ interface TableThemeExtension extends ThemeExtensionsWithParts<'Table', [
401
+ 'table',
402
+ 'header',
403
+ 'row',
404
+ 'cell'
405
+ ]> {
266
406
  }
267
- declare type TextareaProps = {
407
+ interface TableProps extends Pick<TableProps$1<object>, 'onRowAction' | 'onCellAction'>, TableStateProps<object> {
268
408
  variant?: string;
269
- htmlFor: string;
270
- required?: boolean;
271
- error?: boolean;
272
- } & AriaTextFieldProps & ComponentProps<'textarea'>;
273
- declare const Textarea: React.FC<TextareaProps>;
409
+ size?: string;
410
+ }
411
+ declare const Table: Table;
412
+ /**
413
+ * Necessary since TypeScript can not infer the
414
+ * types of the @react-stately components correctly.
415
+ */
416
+ interface Table {
417
+ (props: TableProps): JSX.Element;
418
+ Body: typeof TableBody;
419
+ Cell: typeof Cell;
420
+ Column: typeof Column;
421
+ Header: typeof TableHeader;
422
+ Row: typeof Row;
423
+ }
424
+
425
+ interface TextThemeExtension extends ThemeExtension<'Text'> {
426
+ }
427
+ interface TextProps extends ThemeComponentProps, ComponentProps<'p'>, Omit<BoxOwnProps, 'variant'> {
428
+ align?: CSSObject['textAlign'];
429
+ color?: string;
430
+ cursor?: string;
431
+ fontSize?: string;
432
+ outline?: string;
433
+ children?: React.ReactNode;
434
+ }
435
+ declare const Text: ({ variant, size, align, color, fontSize, cursor, outline, children, ...props }: TextProps) => JSX.Element;
436
+
437
+ interface TextAreaThemeExtension extends ThemeExtension<'TextArea'> {
438
+ }
439
+ /**
440
+ * `react-aria` has a slightly different API for the above events.
441
+ * Thus, we adjust our regular props to match them.
442
+ */
443
+ declare type CustomTextAreEvents = 'onChange' | 'onFocus' | 'onBlur' | 'onCopy' | 'onSelect' | 'onPaste' | 'onCut' | 'onCompositionStart' | 'onCompositionUpdate' | 'onCompositionEnd' | 'onBeforeInput' | 'onInput';
444
+ interface TextAreaProps extends Omit<ComponentProps<'textarea'>, 'value' | 'defaultValue' | CustomTextAreEvents | 'size'>, Pick<AriaTextFieldProps, CustomTextAreEvents>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
445
+ variant?: string;
446
+ size?: string;
447
+ value?: string;
448
+ defaultValue?: string;
449
+ }
450
+ declare const TextArea: ({ disabled, required, readOnly, error, variant, size, ...props }: TextAreaProps) => JSX.Element;
274
451
 
275
452
  interface TooltipThemeExtension<Value> {
276
453
  tooltip?: {
@@ -287,24 +464,11 @@ declare const TooltipContext: React.Context<{
287
464
  }>;
288
465
  declare const TooltipTrigger: React.FC;
289
466
 
290
- interface ValidationMessageThemeExtension<Value> {
291
- validation?: {
292
- [key: string]: Value;
293
- };
294
- }
295
- interface ValidationMessageProps extends ComponentProps<'span'> {
296
- variant?: string;
297
- }
298
- declare const ValidationMessage: React.FC<ValidationMessageProps>;
299
-
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> {
467
+ 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, UnderlayThemeExtension {
301
468
  }
302
-
303
- interface ActionGroupProps extends ComponentProps<'div'> {
304
- space?: ResponsiveStyleValue<string>;
305
- verticalAlignment?: boolean;
469
+ interface Theme extends Theme$1, RootThemeExtension<CSSObject>, TooltipThemeExtension<CSSObject> {
470
+ components: ComponentStyles;
306
471
  }
307
- declare const ActionGroup: React.FC<ActionGroupProps>;
308
472
 
309
473
  interface AsideProps {
310
474
  children: [ReactChild, ReactChild];
@@ -321,54 +485,40 @@ declare const Aside: ({ children, sideWidth, space, side, stretch, wrap, }: Asid
321
485
  */
322
486
 
323
487
  interface AspectProps extends ComponentProps<'div'> {
488
+ children?: ReactNode;
324
489
  ratio?: keyof typeof aspect;
325
490
  maxWidth?: string;
326
491
  }
327
- declare const Aspect: React.FC<AspectProps>;
492
+ declare const Aspect: ({ ratio, maxWidth, children, }: AspectProps) => JSX.Element;
328
493
 
329
- declare type WidthValues = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
330
- interface ColumnProps {
331
- className?: string;
332
- width?: WidthValues | WidthValues[];
494
+ interface BreakoutProps extends ComponentProps<'div'> {
495
+ horizontalAlign?: 'top' | 'bottom' | 'center';
496
+ verticalAlign?: 'left' | 'right' | 'center';
333
497
  }
334
- declare const Column: React.FC<ColumnProps>;
498
+ declare const Breakout: React.FC<BreakoutProps>;
335
499
 
336
- interface ColumnsProps {
337
- className?: string;
500
+ interface CenterProps extends ComponentProps<'div'> {
501
+ maxWidth?: string;
338
502
  space?: ResponsiveStyleValue<string>;
339
- horizontalAlign?: 'left' | 'right' | 'center';
340
- verticalAlign?: 'top' | 'bottom' | 'center';
341
503
  }
342
- declare const Columns: React.FC<ColumnsProps>;
504
+ declare const Center: React.FC<CenterProps>;
343
505
 
344
- interface ModalDialogProps extends OverlayProps, AriaDialogProps {
345
- variant?: string;
346
- backdropVariant?: string;
506
+ interface ColumnsProps {
507
+ children?: ReactNode;
508
+ columns: Array<number>;
509
+ space?: ResponsiveStyleValue<string>;
510
+ columnLimit?: number;
511
+ collapseAt?: string;
347
512
  }
513
+ declare const Columns: ({ space, columns, collapseAt, children, ...props }: ColumnsProps) => JSX.Element;
348
514
 
349
- interface DialogProps extends ModalDialogProps, ComponentProps<'div'> {
350
- backdropVariant?: string;
351
- close: ComponentProps<typeof Button>['onClick'];
352
- isOpen: boolean;
353
- title?: string;
354
- variant?: string;
355
- role?: 'dialog' | 'alertdialog';
515
+ interface ContainerProps extends ComponentProps<'div'> {
516
+ contentType?: 'content' | 'header';
517
+ size?: keyof typeof size.content | keyof typeof size.header;
518
+ align?: 'left' | 'right' | 'center';
519
+ alignContainer?: 'left' | 'right' | 'center';
356
520
  }
357
- declare const Dialog: React.FC<DialogProps>;
358
- declare const useDialogButtonProps: () => {
359
- state: _react_stately_overlays.OverlayTriggerState;
360
- openButtonProps: React.HTMLAttributes<HTMLSpanElement>;
361
- openButtonRef: React.RefObject<HTMLElement>;
362
- };
363
-
364
- declare type FieldProps = {
365
- variant?: string;
366
- labelVariant?: string;
367
- htmlFor: string;
368
- required?: boolean;
369
- error?: boolean;
370
- } & AriaTextFieldProps & ComponentProps<'input'>;
371
- declare const Field: React.FC<FieldProps>;
521
+ declare const Container: React.FC<ContainerProps>;
372
522
 
373
523
  interface InlineProps {
374
524
  space?: ResponsiveStyleValue<string>;
@@ -377,10 +527,25 @@ interface InlineProps {
377
527
  declare const Inline: React.FC<InlineProps>;
378
528
 
379
529
  interface StackProps {
530
+ as?: 'div' | 'ul' | 'ol';
380
531
  space?: ResponsiveStyleValue<string>;
381
532
  align?: 'left' | 'right' | 'center';
533
+ children?: ReactNode;
382
534
  }
383
- declare const Stack: React.FC<StackProps>;
535
+ declare const Stack: ({ space, align, children, ...props }: StackProps) => JSX.Element;
536
+
537
+ interface TextFieldProps extends Omit<ComponentProps<'input'>, 'value' | 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur' | 'size'>,
538
+ /**
539
+ * `react-aria` has a slightly different API for `onChange`, `onFocus`
540
+ * and `onBlur` events. Thus, we adjust our regular props to match them.
541
+ */
542
+ Pick<AriaTextFieldProps, 'onChange' | 'onFocus' | 'onBlur'>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
543
+ variant?: string;
544
+ size?: string;
545
+ value?: string;
546
+ defaultValue?: string;
547
+ }
548
+ declare const TextField: ({ disabled, required, readOnly, error, variant, size, ...props }: TextFieldProps) => JSX.Element;
384
549
 
385
550
  interface TilesProps {
386
551
  space?: ResponsiveStyleValue<string>;
@@ -388,11 +553,4 @@ interface TilesProps {
388
553
  }
389
554
  declare const Tiles: React.FC<TilesProps>;
390
555
 
391
- interface ContainerProps extends ComponentProps<'div'> {
392
- contentType?: 'content' | 'header';
393
- size?: keyof typeof size.content | keyof typeof size.header;
394
- align?: 'left' | 'right' | 'center';
395
- }
396
- declare const Container: React.FC<ContainerProps>;
397
-
398
- export { ActionGroup, ActionGroupProps, Aside, AsideProps, Aspect, AspectProps, Badge, BadgeProps, BadgeThemeExtension, Button, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Checkbox, CheckboxProps, CheckboxThemeExtension, Column, ColumnProps, 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 };
556
+ 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, TooltipContext, TooltipProps, TooltipThemeExtension, TooltipTrigger, Underlay, UnderlayProps, UnderlayThemeExtension, useCheckboxGroupContext };