@marigold/components 6.2.3 → 6.2.5

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.
@@ -0,0 +1,751 @@
1
+ export { useAsyncList, useListData } from '@react-stately/data';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as react from 'react';
4
+ import { ReactElement, ReactNode, Key, HTMLAttributes, LabelHTMLAttributes, ComponentPropsWithRef, RefObject, ForwardRefExoticComponent, RefAttributes } from 'react';
5
+ import { AriaAccordionProps } from '@react-aria/accordion';
6
+ import * as _react_types_shared from '@react-types/shared';
7
+ import { ItemElement, ItemProps, Node, PressEvents, FocusableDOMProps, CollectionElement, StyleProps, LabelableProps, HelpTextProps } from '@react-types/shared';
8
+ import { TreeState } from '@react-stately/tree';
9
+ import { GapSpaceProp, AspectProp, WidthProp, AlignmentProp, alignment, PaddingSpaceProp, PaddingSpacePropX, PaddingSpacePropY, PaddingRightProp, PaddingLeftProp, PaddingBottomProp, PaddingTopProp, PlaceItemsProp, GridColumn, GridColsAlignProp, StateAttrProps, TextAlignProp, ObjectFitProp, ObjectPositionProp, Theme, ThemeProviderProps, FontSizeProp, FontWeightProp, FontStyleProp, CursorProp, SVGProps } from '@marigold/system';
10
+ export { ThemeProvider, useTheme } from '@marigold/system';
11
+ import { NonZeroPercentage, HtmlProps, PropsOf, PolymorphicComponent } from '@marigold/types';
12
+ import { SearchAutocompleteProps } from '@react-types/autocomplete';
13
+ import { ComboBoxProps as ComboBoxProps$1 } from '@react-types/combobox';
14
+ import { AriaCheckboxProps, AriaCheckboxGroupProps } from '@react-types/checkbox';
15
+ import { CheckboxGroupState } from '@react-stately/checkbox';
16
+ import { AriaDialogProps } from '@react-types/dialog';
17
+ import { SeparatorProps } from '@react-aria/separator';
18
+ import { DateValue, CalendarDate } from '@internationalized/date';
19
+ import { AriaDateFieldProps, AriaDatePickerProps } from '@react-aria/datepicker';
20
+ import { AriaCalendarProps, DateValue as DateValue$1, AriaCalendarCellProps, AriaCalendarGridProps } from '@react-aria/calendar';
21
+ import { CalendarState } from '@react-stately/calendar';
22
+ import { AriaNumberFieldProps } from '@react-types/numberfield';
23
+ import { OverlayProps as OverlayProps$1, AriaPopoverProps, AriaModalOverlayProps } from '@react-aria/overlays';
24
+ import { OverlayTriggerState } from '@react-stately/overlays';
25
+ import { AriaRadioGroupProps, AriaRadioProps } from '@react-types/radio';
26
+ import { Item, Section } from '@react-stately/collections';
27
+ import { AriaSelectProps } from '@react-types/select';
28
+ import { AriaSliderProps } from '@react-types/slider';
29
+ import { AriaSwitchProps } from '@react-types/switch';
30
+ import { AriaTableProps } from '@react-aria/table';
31
+ import { TableStateProps, RowProps as RowProps$1, TableBody, Cell, TableHeader, ColumnProps as ColumnProps$1 } from '@react-stately/table';
32
+ import { AriaTextFieldProps } from '@react-types/textfield';
33
+ import { PositionProps } from '@react-types/overlays';
34
+ import { TooltipTriggerProps as TooltipTriggerProps$1 } from '@react-types/tooltip';
35
+ import { AriaTagGroupProps } from '@react-aria/tag';
36
+ export { VisuallyHidden } from '@react-aria/visually-hidden';
37
+ import { AriaTabListProps } from '@react-types/tabs';
38
+
39
+ interface AccordionProps extends Omit<AriaAccordionProps<object>, 'children' | 'expandedKeys' | 'disabledKeys' | 'onExpandedChange'> {
40
+ children: ItemElement<object>[] | ItemElement<object>;
41
+ selectionMode?: string;
42
+ }
43
+ declare const Accordion: {
44
+ ({ children, ...props }: AccordionProps): react_jsx_runtime.JSX.Element;
45
+ Item: <T>(props: AccordionOwnItemProps<T>) => JSX.Element;
46
+ };
47
+ interface AccordionOwnItemProps<T> extends ItemProps<T> {
48
+ variant?: string;
49
+ size?: string;
50
+ title: string | ReactElement;
51
+ }
52
+
53
+ interface AccordionItemProps {
54
+ item: Node<object>;
55
+ state: TreeState<object>;
56
+ title: string | ReactNode;
57
+ variant?: string;
58
+ size?: string;
59
+ }
60
+ declare const AccordionItem: ({ item, state, title, variant, size, ...props }: AccordionItemProps) => react_jsx_runtime.JSX.Element;
61
+
62
+ interface AsideProps extends GapSpaceProp {
63
+ children: [ReactElement, ReactElement];
64
+ side?: 'left' | 'right';
65
+ sideWidth?: string;
66
+ stretch?: boolean;
67
+ wrap?: NonZeroPercentage;
68
+ }
69
+ declare const Aside: ({ children, sideWidth, space, side, stretch, wrap, }: AsideProps) => react_jsx_runtime.JSX.Element;
70
+
71
+ interface AspectProps extends HtmlProps<'div'>, AspectProp {
72
+ children?: ReactNode;
73
+ maxWidth?: string;
74
+ }
75
+ declare const Aspect: ({ ratio, maxWidth, children, }: AspectProps) => react_jsx_runtime.JSX.Element;
76
+
77
+ interface AutocompleteProps extends Omit<SearchAutocompleteProps<object>, 'isDisabled' | 'isRequired' | 'isReadonly' | 'validationState' | 'icon' | 'onInputChange' | 'inputValue' | 'defaultInputValue'> {
78
+ disabled?: boolean;
79
+ required?: boolean;
80
+ readOnly?: boolean;
81
+ error?: boolean;
82
+ defaultValue?: SearchAutocompleteProps<object>['defaultInputValue'];
83
+ value?: SearchAutocompleteProps<object>['inputValue'];
84
+ /**
85
+ * Handler that is called when the input value changes.
86
+ */
87
+ onChange?: SearchAutocompleteProps<object>['onInputChange'];
88
+ /**
89
+ * Handler that is called when the SearchAutocomplete is submitted.
90
+ *
91
+ * A `key` will be passed if the submission is a selected item (e.g. a user
92
+ * clicks or presses enter on an option). If the input is a custom `value`, `key` will be `null`.
93
+ *
94
+ * A `value` will be passed if the submission is a custom value (e.g. a user
95
+ * types then presses enter). If the input is a selected item, `value` will be `null`.
96
+ */
97
+ onSubmit?: (key: Key | null, value: string | null) => void;
98
+ variant?: string;
99
+ size?: string;
100
+ width?: WidthProp['width'];
101
+ }
102
+ declare const Autocomplete: {
103
+ ({ disabled, required, readOnly, error, onChange, value, defaultValue, variant, size, width, ...rest }: AutocompleteProps): react_jsx_runtime.JSX.Element;
104
+ Item: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
105
+ };
106
+
107
+ interface ComboBoxProps extends Omit<ComboBoxProps$1<object>, 'isDisabled' | 'isRequired' | 'isReadOnly' | 'defaultInputValue' | 'inputValue' | 'onInputChange'> {
108
+ variant?: string;
109
+ size?: string;
110
+ error?: boolean;
111
+ width?: WidthProp['width'];
112
+ disabled?: boolean;
113
+ required?: boolean;
114
+ readOnly?: boolean;
115
+ defaultValue?: ComboBoxProps$1<object>['defaultInputValue'];
116
+ value?: ComboBoxProps$1<object>['inputValue'];
117
+ onChange?: ComboBoxProps$1<object>['onInputChange'];
118
+ }
119
+ declare const ComboBox: {
120
+ ({ error, width, disabled, required, readOnly, defaultValue, value, onChange, variant, size, ...rest }: ComboBoxProps): react_jsx_runtime.JSX.Element;
121
+ Item: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
122
+ };
123
+
124
+ interface BadgeProps extends HtmlProps<'div'> {
125
+ children?: React.ReactNode;
126
+ variant?: string;
127
+ size?: string;
128
+ }
129
+ declare const Badge: ({ variant, size, children, ...props }: BadgeProps) => react_jsx_runtime.JSX.Element;
130
+
131
+ interface BreakoutProps extends HtmlProps<'div'>, AlignmentProp {
132
+ children?: ReactNode;
133
+ height?: string;
134
+ alignX?: keyof typeof alignment.horizontal.alignmentX;
135
+ alignY?: keyof typeof alignment.horizontal.alignmentY;
136
+ }
137
+ declare const Breakout: ({ height, children, orientation, alignX, alignY, ...props }: BreakoutProps) => react_jsx_runtime.JSX.Element;
138
+
139
+ interface BodyProps extends HtmlProps<'section'> {
140
+ children?: ReactNode;
141
+ variant?: string;
142
+ size?: string;
143
+ }
144
+ declare const Body: ({ children, variant, size, ...props }: BodyProps) => react_jsx_runtime.JSX.Element;
145
+
146
+ interface ButtonOwnProps extends PressEvents, FocusableDOMProps, HtmlProps<'button'> {
147
+ children?: ReactNode;
148
+ variant?: string;
149
+ size?: string;
150
+ fullWidth?: boolean;
151
+ }
152
+ interface ButtonProps extends PropsOf<typeof Button> {
153
+ }
154
+ declare const Button: PolymorphicComponent<"button", ButtonOwnProps>;
155
+
156
+ interface CardProps extends HtmlProps<'div'>, GapSpaceProp, PaddingSpaceProp, PaddingSpacePropX, PaddingSpacePropY, PaddingRightProp, PaddingLeftProp, PaddingBottomProp, PaddingTopProp {
157
+ children?: ReactNode;
158
+ variant?: string;
159
+ size?: string;
160
+ p?: PaddingSpaceProp['space'];
161
+ px?: PaddingSpacePropX['spaceX'];
162
+ py?: PaddingSpacePropY['spaceY'];
163
+ }
164
+ declare const Card: ({ children, variant, size, space, p, px, py, pt, pb, pl, pr, ...props }: CardProps) => react_jsx_runtime.JSX.Element;
165
+
166
+ interface CenterProps extends HtmlProps<'div'>, GapSpaceProp {
167
+ children?: ReactNode;
168
+ maxWidth?: string;
169
+ }
170
+ declare const Center: ({ maxWidth, space, children, ...props }: CenterProps) => react_jsx_runtime.JSX.Element;
171
+
172
+ /**
173
+ * `react-aria` has a slightly different API for the above events.
174
+ * Thus, we adjust our regular props to match them.
175
+ */
176
+ type CustomCheckboxProps = 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp';
177
+ interface CheckboxProps extends Omit<HtmlProps<'input'>, 'size' | 'type' | 'defaultValue' | CustomCheckboxProps>, Pick<AriaCheckboxProps, CustomCheckboxProps> {
178
+ children?: ReactNode;
179
+ indeterminate?: boolean;
180
+ error?: boolean;
181
+ variant?: string;
182
+ size?: string;
183
+ }
184
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
185
+
186
+ interface CheckboxGroupContextProps extends CheckboxGroupState {
187
+ error?: boolean;
188
+ }
189
+ /**
190
+ * Needs to be falsy so we can check if a checkbox is used as standalone
191
+ * or in a group.
192
+ */
193
+ declare const CheckboxGroupContext: react.Context<CheckboxGroupContextProps>;
194
+ declare const useCheckboxGroupContext: () => CheckboxGroupContextProps;
195
+ interface CheckboxGroupProps extends Omit<HtmlProps<'div'>, 'onChange'>, AriaCheckboxGroupProps {
196
+ children: ReactNode;
197
+ variant?: string;
198
+ size?: string;
199
+ label?: ReactNode;
200
+ required?: boolean;
201
+ disabled?: boolean;
202
+ readOnly?: boolean;
203
+ error?: boolean;
204
+ value?: string[];
205
+ defaultValue?: string[];
206
+ onChange?: (value: string[]) => void;
207
+ width?: WidthProp['width'];
208
+ }
209
+ declare const CheckboxGroup: ({ children, required, disabled, readOnly, error, width, ...rest }: CheckboxGroupProps) => react_jsx_runtime.JSX.Element;
210
+
211
+ interface ColumnsProps extends GapSpaceProp {
212
+ children?: ReactNode;
213
+ columns: Array<number>;
214
+ collapseAt?: string | 0;
215
+ stretch?: boolean;
216
+ }
217
+ declare const Columns: ({ space, columns, collapseAt, stretch, children, ...props }: ColumnsProps) => react_jsx_runtime.JSX.Element;
218
+
219
+ interface ContainerProps extends HtmlProps<'div'>, PlaceItemsProp, GridColumn, GridColsAlignProp {
220
+ children?: ReactNode;
221
+ contentType?: 'content' | 'header';
222
+ size?: keyof typeof content | keyof typeof header;
223
+ align?: 'left' | 'right' | 'center';
224
+ alignItems?: PlaceItemsProp['align'];
225
+ }
226
+ declare const content: {
227
+ small: string;
228
+ medium: string;
229
+ large: string;
230
+ };
231
+ declare const header: {
232
+ small: string;
233
+ medium: string;
234
+ large: string;
235
+ };
236
+ declare const Container: ({ contentType, size, align, alignItems, children, ...props }: ContainerProps) => react_jsx_runtime.JSX.Element;
237
+
238
+ interface DialogControllerProps {
239
+ children: ReactNode;
240
+ dismissable?: boolean;
241
+ keyboardDismissable?: boolean;
242
+ open?: boolean;
243
+ onOpenChange?: (isOpen: boolean) => void;
244
+ }
245
+
246
+ interface DialogTriggerProps {
247
+ children: [trigger: ReactNode, menu: ReactNode];
248
+ dismissable?: boolean;
249
+ keyboardDismissable?: boolean;
250
+ }
251
+
252
+ interface DialogContextProps {
253
+ open?: boolean;
254
+ close?: () => void;
255
+ }
256
+
257
+ interface DialogChildProps {
258
+ close: DialogContextProps['close'];
259
+ titleProps: HTMLAttributes<HTMLElement>;
260
+ }
261
+ interface DialogProps extends AriaDialogProps {
262
+ children?: ReactNode | ((props: DialogChildProps) => ReactNode);
263
+ variant?: string;
264
+ size?: string;
265
+ closeButton?: boolean;
266
+ }
267
+ declare const Dialog: {
268
+ ({ children, variant, size, closeButton, ...props }: DialogProps): react_jsx_runtime.JSX.Element;
269
+ Trigger: ({ children, dismissable, keyboardDismissable, }: DialogTriggerProps) => react_jsx_runtime.JSX.Element;
270
+ Controller: ({ children, dismissable, keyboardDismissable, open, onOpenChange, }: DialogControllerProps) => react_jsx_runtime.JSX.Element;
271
+ };
272
+
273
+ interface DividerProps extends SeparatorProps {
274
+ variant?: string;
275
+ }
276
+ declare const Divider: ({ variant, ...props }: DividerProps) => react_jsx_runtime.JSX.Element;
277
+
278
+ interface LabelProps extends HtmlProps<'label'> {
279
+ as?: 'label' | 'span';
280
+ variant?: string;
281
+ size?: string;
282
+ labelWidth?: string;
283
+ }
284
+ declare const Label: ({ as, children, variant, size, labelWidth, ...props }: LabelProps) => react_jsx_runtime.JSX.Element;
285
+
286
+ interface FieldBaseProps extends WidthProp {
287
+ children?: ReactNode;
288
+ variant?: string;
289
+ size?: string;
290
+ disabled?: boolean;
291
+ label?: ReactNode;
292
+ labelProps?: LabelHTMLAttributes<HTMLLabelElement> & Pick<LabelProps, 'as'>;
293
+ description?: ReactNode;
294
+ descriptionProps?: HTMLAttributes<HTMLElement>;
295
+ error?: boolean;
296
+ errorMessage?: ReactNode;
297
+ errorMessageProps?: HTMLAttributes<HTMLElement>;
298
+ stateProps?: StateAttrProps;
299
+ }
300
+ declare const FieldBase: ({ children, variant, size, width, disabled, label, labelProps, description, descriptionProps, error, errorMessage, errorMessageProps, stateProps, ...props }: FieldBaseProps) => react_jsx_runtime.JSX.Element;
301
+
302
+ interface FieldGroupContextProps {
303
+ labelWidth?: string;
304
+ }
305
+ declare const FieldGroupContext: react.Context<FieldGroupContextProps>;
306
+ declare const useFieldGroupContext: () => FieldGroupContextProps;
307
+ interface FieldGroupProps {
308
+ labelWidth?: string;
309
+ children: ReactNode;
310
+ }
311
+ declare const FieldGroup: ({ labelWidth, children }: FieldGroupProps) => react_jsx_runtime.JSX.Element;
312
+
313
+ interface FooterProps extends HtmlProps<'footer'> {
314
+ children?: ReactNode;
315
+ variant?: string;
316
+ size?: string;
317
+ }
318
+ declare const Footer: ({ children, variant, size, ...props }: FooterProps) => react_jsx_runtime.JSX.Element;
319
+
320
+ interface HeaderProps extends HtmlProps<'header'> {
321
+ children?: ReactNode;
322
+ variant?: string;
323
+ size?: string;
324
+ }
325
+ declare const Header: ({ children, variant, size, className, ...props }: HeaderProps) => react_jsx_runtime.JSX.Element;
326
+
327
+ interface HeadlineProps extends HtmlProps<'h1'>, TextAlignProp {
328
+ children?: ReactNode;
329
+ level?: '1' | '2' | '3' | '4' | '5' | '6';
330
+ color?: string;
331
+ variant?: string;
332
+ size?: string;
333
+ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
334
+ }
335
+ declare const Headline: ({ children, variant, size, align, color, level, as, ...props }: HeadlineProps) => react_jsx_runtime.JSX.Element;
336
+
337
+ interface ImageProps extends HtmlProps<'img'>, ObjectFitProp, ObjectPositionProp {
338
+ variant?: string;
339
+ size?: string;
340
+ children?: never;
341
+ alt: string;
342
+ }
343
+ declare const Image: ({ variant, size, fit, position, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
344
+
345
+ interface InlineProps extends AlignmentProp, GapSpaceProp {
346
+ children?: ReactNode;
347
+ alignX?: keyof typeof alignment.horizontal.alignmentX;
348
+ alignY?: keyof typeof alignment.horizontal.alignmentY;
349
+ }
350
+ declare const Inline: ({ space, orientation, alignX, alignY, children, ...props }: InlineProps) => react_jsx_runtime.JSX.Element;
351
+
352
+ interface InputOwnProps extends Omit<HtmlProps<'input'>, 'size' | 'className'> {
353
+ icon?: ReactElement;
354
+ action?: ReactElement;
355
+ variant?: string;
356
+ size?: string;
357
+ className?: {
358
+ container?: string;
359
+ input?: string;
360
+ icon?: string;
361
+ };
362
+ }
363
+ interface InputProps extends Omit<ComponentPropsWithRef<'input'>, 'size' | 'className'>, InputOwnProps {
364
+ }
365
+ declare const Input: react.ForwardRefExoticComponent<InputOwnProps & react.RefAttributes<HTMLInputElement>>;
366
+
367
+ interface DateFieldProps extends Omit<AriaDateFieldProps<DateValue>, 'isDisabled' | 'isReadOnly' | 'isRequired'> {
368
+ onChange?: (value: DateValue) => void;
369
+ value?: DateValue | null;
370
+ defaultValue?: DateValue | null;
371
+ ref?: RefObject<unknown> | undefined;
372
+ triggerRef?: RefObject<HTMLDivElement> | undefined;
373
+ action?: ReactElement;
374
+ isPressed?: boolean;
375
+ error?: boolean;
376
+ errorMessageProps?: HTMLAttributes<HTMLElement>;
377
+ disabled?: boolean;
378
+ readOnly?: boolean;
379
+ required?: boolean;
380
+ variant?: string;
381
+ size?: string;
382
+ width?: WidthProp['width'];
383
+ }
384
+ declare const DateField: ({ disabled, readOnly, required, error, errorMessage, errorMessageProps, variant, size, action, isPressed, triggerRef, width, ...res }: DateFieldProps) => react_jsx_runtime.JSX.Element;
385
+
386
+ interface CalendarProps extends Omit<AriaCalendarProps<DateValue$1>, 'isDisabled' | 'isReadOnly'> {
387
+ disabled?: boolean;
388
+ readOnly?: boolean;
389
+ variant?: string;
390
+ size?: string;
391
+ }
392
+ declare const Calendar: ({ disabled, readOnly, size, variant, ...rest }: CalendarProps) => react_jsx_runtime.JSX.Element;
393
+
394
+ interface CalendarCellProps extends AriaCalendarCellProps {
395
+ state: CalendarState;
396
+ }
397
+ declare const CalendarCell: (props: CalendarCellProps) => react_jsx_runtime.JSX.Element;
398
+
399
+ interface CalendarGridProps extends AriaCalendarGridProps {
400
+ state: CalendarState;
401
+ }
402
+ declare const CalendarGrid: ({ state, ...props }: CalendarGridProps) => react_jsx_runtime.JSX.Element;
403
+
404
+ interface DatePickerProps extends Omit<AriaDatePickerProps<CalendarDate>, 'isDisabled' | 'isRequired' | 'isReadOnly' | 'isOpen'> {
405
+ disabled?: boolean;
406
+ required?: boolean;
407
+ readonly?: boolean;
408
+ open?: boolean;
409
+ error?: boolean;
410
+ shouldCloseOnSelect?: boolean;
411
+ variant?: string;
412
+ size?: string;
413
+ }
414
+ declare const DatePicker: ({ disabled, required, readonly, open, error, shouldCloseOnSelect, variant, size, ...rest }: DatePickerProps) => react_jsx_runtime.JSX.Element;
415
+
416
+ type InsetProps = {
417
+ children: ReactNode;
418
+ space?: never;
419
+ spaceX?: PaddingSpacePropX['spaceX'];
420
+ spaceY?: PaddingSpacePropY['spaceY'];
421
+ } | {
422
+ children: ReactNode;
423
+ space?: PaddingSpaceProp['space'];
424
+ spaceX?: never;
425
+ spaceY?: never;
426
+ };
427
+ declare const Inset: ({ space, spaceX, spaceY, children }: InsetProps) => react_jsx_runtime.JSX.Element;
428
+
429
+ interface LinkOwnProps extends PressEvents {
430
+ disabled?: boolean;
431
+ variant?: string;
432
+ size?: string;
433
+ children?: ReactNode;
434
+ }
435
+ interface LinkProps extends PropsOf<typeof Link> {
436
+ }
437
+ declare const Link: PolymorphicComponent<"a", LinkOwnProps>;
438
+
439
+ interface ListItemProps extends HtmlProps<'li'> {
440
+ children?: ReactNode;
441
+ }
442
+
443
+ interface ListProps extends HtmlProps<'ul'> {
444
+ variant?: string;
445
+ size?: string;
446
+ as?: 'ul' | 'ol';
447
+ children?: ReactNode;
448
+ }
449
+ declare const List: {
450
+ ({ as, children, variant, size, ...props }: ListProps): react_jsx_runtime.JSX.Element;
451
+ Item: ({ children, ...props }: ListItemProps) => react_jsx_runtime.JSX.Element;
452
+ };
453
+
454
+ interface MenuTriggerProps {
455
+ children: [trigger: ReactNode, menu: ReactNode];
456
+ disabled?: boolean;
457
+ open?: boolean;
458
+ onOpenChange?: (isOpen: boolean) => void;
459
+ }
460
+
461
+ interface MenuProps extends Omit<HtmlProps<'ul'>, 'onSelect' | 'size'> {
462
+ children: CollectionElement<object> | CollectionElement<object>[];
463
+ variant?: string;
464
+ size?: string;
465
+ onAction?: (key: Key) => void;
466
+ }
467
+ declare const Menu: {
468
+ ({ variant, size, ...props }: MenuProps): react_jsx_runtime.JSX.Element;
469
+ Trigger: ({ disabled, open, onOpenChange, children, }: MenuTriggerProps) => react_jsx_runtime.JSX.Element;
470
+ Item: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
471
+ Section: <T_1>(props: _react_types_shared.SectionProps<T_1>) => JSX.Element;
472
+ };
473
+
474
+ interface ActionMenuProps extends MenuProps {
475
+ }
476
+ declare const ActionMenu: (props: ActionMenuProps) => react_jsx_runtime.JSX.Element;
477
+
478
+ declare const icons: {
479
+ info: () => react_jsx_runtime.JSX.Element;
480
+ warning: () => react_jsx_runtime.JSX.Element;
481
+ error: () => react_jsx_runtime.JSX.Element;
482
+ };
483
+ interface MessageProps extends HtmlProps<'div'> {
484
+ messageTitle: ReactNode;
485
+ variant?: keyof typeof icons;
486
+ size?: string;
487
+ }
488
+ declare const Message: ({ messageTitle, variant, size, children, ...props }: MessageProps) => react_jsx_runtime.JSX.Element;
489
+
490
+ /**
491
+ * `react-aria` has a slightly different API for some DOM props.
492
+ * Thus, we adjust our regular props to match them.
493
+ */
494
+ type CustomProps = 'size' | 'width' | 'type' | 'value' | 'defaultValue' | 'step' | 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'min' | 'max';
495
+ interface NumberFieldProps extends Omit<HtmlProps<'input'>, CustomProps>, Omit<AriaNumberFieldProps, 'isDisabled' | 'isRequired' | 'isReadOnly'>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
496
+ variant?: string;
497
+ size?: string;
498
+ width?: WidthProp['width'];
499
+ hideStepper?: boolean;
500
+ }
501
+ declare const NumberField: react.ForwardRefExoticComponent<NumberFieldProps & react.RefAttributes<HTMLInputElement>>;
502
+
503
+ interface ModalProps extends HTMLAttributes<HTMLElement> {
504
+ children?: ReactNode;
505
+ open?: boolean;
506
+ onClose?: () => void;
507
+ dismissable?: boolean;
508
+ keyboardDismissable?: boolean;
509
+ }
510
+ declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDivElement>>;
511
+
512
+ interface OverlayProps {
513
+ open: boolean;
514
+ children: OverlayProps$1['children'];
515
+ container?: OverlayProps$1['portalContainer'];
516
+ }
517
+ declare const Overlay: ({ children, container, open }: OverlayProps) => react_jsx_runtime.JSX.Element | null;
518
+
519
+ interface PopoverProps extends Pick<AriaPopoverProps, 'triggerRef' | 'scrollRef' | 'isNonModal'> {
520
+ keyboardDismissDisabled?: AriaPopoverProps['isKeyboardDismissDisabled'];
521
+ state: OverlayTriggerState;
522
+ children: ReactNode;
523
+ }
524
+ declare const Popover: react.ForwardRefExoticComponent<PopoverProps & react.RefAttributes<HTMLDivElement>>;
525
+
526
+ interface TrayProps extends AriaModalOverlayProps, StyleProps, OverlayProps$1 {
527
+ children: ReactNode;
528
+ state: OverlayTriggerState;
529
+ }
530
+ interface TrayWrapperProps extends TrayProps {
531
+ }
532
+ declare const Tray: react.ForwardRefExoticComponent<TrayProps & react.RefAttributes<HTMLDivElement>>;
533
+ declare const TrayWrapper: react.ForwardRefExoticComponent<TrayWrapperProps & react.RefAttributes<HTMLDivElement>>;
534
+
535
+ interface UnderlayProps extends HTMLAttributes<HTMLElement> {
536
+ variant?: string;
537
+ size?: string;
538
+ }
539
+ declare const Underlay: ({ size, variant, ...props }: UnderlayProps) => react_jsx_runtime.JSX.Element;
540
+
541
+ interface MarigoldProviderProps<T extends Theme> extends ThemeProviderProps<T> {
542
+ }
543
+ declare function MarigoldProvider<T extends Theme>({ children, theme, }: MarigoldProviderProps<T>): react_jsx_runtime.JSX.Element;
544
+
545
+ interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'isDisabled' | 'isRquired' | 'isReadOnly ' | 'validationState'> {
546
+ children: ReactNode[];
547
+ width?: WidthProp['width'];
548
+ required?: boolean;
549
+ disabled?: boolean;
550
+ readOnly?: boolean;
551
+ error?: boolean;
552
+ }
553
+ declare const RadioGroup: ({ children, orientation, width, required, disabled, readOnly, error, ...rest }: RadioGroupProps) => react_jsx_runtime.JSX.Element;
554
+
555
+ type CustomRadioProps = 'size' | 'width' | 'type' | 'defaultChecked' | 'value' | 'onFocus' | 'onBlur' | 'onKeyUp' | 'onKeyDown';
556
+ interface RadioProps extends Omit<HtmlProps<'input'>, CustomRadioProps>, AriaRadioProps {
557
+ width?: string;
558
+ variant?: string;
559
+ size?: string;
560
+ disabled?: boolean;
561
+ }
562
+ declare const Radio: RadioComponent;
563
+ /**
564
+ * We need this so that TypeScripts allows us to add
565
+ * additional properties to the component (function).
566
+ */
567
+ interface RadioComponent extends ForwardRefExoticComponent<RadioProps & RefAttributes<HTMLInputElement>> {
568
+ Group: typeof RadioGroup;
569
+ }
570
+
571
+ interface SelectProps extends Omit<AriaSelectProps<object>, 'autoComplete' | 'isOpen' | 'isLoading' | 'onLoadMore' | 'isDisabled' | 'isRequired' | 'validationState' | 'onSelectionChange'>, Omit<HtmlProps<'select'>, 'onKeyUp' | 'onKeyDown' | 'onFocus' | 'onBlur' | 'children' | 'size' | 'onChange'> {
572
+ variant?: string;
573
+ size?: string;
574
+ width?: WidthProp['width'];
575
+ open?: boolean;
576
+ disabled?: boolean;
577
+ required?: boolean;
578
+ error?: boolean;
579
+ onChange?: AriaSelectProps<object>['onSelectionChange'];
580
+ }
581
+ declare const Select: SelectComponent;
582
+ /**
583
+ * We need this so that TypeScripts allows us to add
584
+ * additional properties to the component (function).
585
+ */
586
+ interface SelectComponent extends ForwardRefExoticComponent<SelectProps & RefAttributes<HTMLButtonElement>> {
587
+ Option: typeof Item;
588
+ Section: typeof Section;
589
+ }
590
+
591
+ interface SliderProps extends Omit<HtmlProps<'input'>, 'step' | 'value' | 'defaultValue' | 'onChange' | 'onFocus' | 'onBlur' | 'size' | 'width'>,
592
+ /**
593
+ * `react-aria` has a slightly different API for some events e.g `onChange`, `onFocus`
594
+ * `onBlur`. Thus, we adjust our regular props to match them.
595
+ */
596
+ Pick<AriaSliderProps, 'maxValue' | 'step' | 'value' | 'defaultValue' | 'onChange'> {
597
+ variant?: string;
598
+ size?: string;
599
+ width?: string;
600
+ formatOptions?: Intl.NumberFormatOptions;
601
+ children?: ReactNode;
602
+ }
603
+ /**
604
+ * The slider consists of two parts.
605
+ * A label + the output value and the slider functionality itself.
606
+ * The slider itself consists of a track line and a thumb.
607
+ */
608
+ declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLDivElement>>;
609
+
610
+ interface SplitProps extends HtmlProps<'div'> {
611
+ }
612
+ declare const Split: (props: SplitProps) => react_jsx_runtime.JSX.Element;
613
+
614
+ interface StackProps extends AlignmentProp, GapSpaceProp {
615
+ children?: ReactNode;
616
+ stretch?: boolean;
617
+ alignX?: keyof typeof alignment.vertical.alignmentX;
618
+ alignY?: keyof typeof alignment.vertical.alignmentY;
619
+ }
620
+ declare const Stack: ({ children, space, stretch, orientation, alignX, alignY, ...props }: StackProps) => react_jsx_runtime.JSX.Element;
621
+
622
+ type CustomSwitchProps = 'size' | 'value' | 'onBlur' | 'onChange' | 'onFocus' | 'onKeyDown' | 'onKeyUp';
623
+ interface SwitchProps extends Omit<AriaSwitchProps, 'isSelected'>, Omit<HtmlProps<'input'>, CustomSwitchProps> {
624
+ selected?: boolean;
625
+ variant?: string;
626
+ size?: string;
627
+ width?: string;
628
+ }
629
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
630
+
631
+ interface TableProps extends Pick<AriaTableProps<object>, 'focusMode' | 'onRowAction' | 'onCellAction'>, Omit<TableStateProps<object>, 'showSelectionCheckboxes'> {
632
+ variant?: string;
633
+ size?: string;
634
+ stretch?: boolean;
635
+ }
636
+ interface RowProps extends RowProps$1<any> {
637
+ variant?: string;
638
+ size?: string;
639
+ }
640
+ interface ColumnProps extends Omit<ColumnProps$1<any>, 'width'>, WidthProp {
641
+ }
642
+ declare const Table: Table;
643
+ /**
644
+ * Necessary since TypeScript can not infer the
645
+ * types of the @react-stately components.
646
+ */
647
+ interface Table {
648
+ (props: TableProps): JSX.Element;
649
+ Body: typeof TableBody;
650
+ Cell: typeof Cell;
651
+ Header: typeof TableHeader;
652
+ Column: (props: ColumnProps) => JSX.Element;
653
+ Row: (props: RowProps) => JSX.Element;
654
+ }
655
+
656
+ interface TextProps extends HtmlProps<'p'>, TextAlignProp, FontSizeProp, FontWeightProp, FontStyleProp, CursorProp {
657
+ children?: React.ReactNode;
658
+ variant?: string;
659
+ color?: string;
660
+ size?: string;
661
+ }
662
+ declare const Text: ({ variant, size, color, align, cursor, weight, fontSize, fontStyle, children, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
663
+
664
+ /**
665
+ * `react-aria` has a slightly different API for the above events.
666
+ * Thus, we adjust our regular props to match them.
667
+ */
668
+ type CustomTextAreaEvents = 'onChange' | 'onFocus' | 'onBlur' | 'onCopy' | 'onSelect' | 'onPaste' | 'onCut' | 'onCompositionStart' | 'onCompositionUpdate' | 'onCompositionEnd' | 'onBeforeInput' | 'onInput' | 'onKeyDown' | 'onKeyUp';
669
+ interface TextAreaProps extends Omit<HtmlProps<'textarea'>, 'value' | 'defaultValue' | 'size' | CustomTextAreaEvents>, Pick<AriaTextFieldProps, CustomTextAreaEvents>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
670
+ variant?: string;
671
+ size?: string;
672
+ width?: WidthProp['width'];
673
+ value?: string;
674
+ defaultValue?: string;
675
+ }
676
+ declare const TextArea: react.ForwardRefExoticComponent<TextAreaProps & react.RefAttributes<HTMLTextAreaElement>>;
677
+
678
+ /**
679
+ * `react-aria` has a slightly different API for the above events.
680
+ * Thus, we adjust our regular props to match them.
681
+ */
682
+ type CustomTextFieldEvents = 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp';
683
+ interface TextFieldProps extends Omit<HtmlProps<'input'>, 'value' | 'defaultValue' | 'size' | 'width' | CustomTextFieldEvents>,
684
+ /**
685
+ * `react-aria` has a slightly different API for `onChange`, `onFocus`
686
+ * and `onBlur` events. Thus, we adjust our regular props to match them.
687
+ */
688
+ Pick<AriaTextFieldProps, CustomTextFieldEvents>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
689
+ variant?: string;
690
+ size?: string;
691
+ width?: WidthProp['width'];
692
+ value?: string;
693
+ defaultValue?: string;
694
+ }
695
+ declare const TextField: react.ForwardRefExoticComponent<TextFieldProps & react.RefAttributes<HTMLInputElement>>;
696
+
697
+ interface TilesProps extends GapSpaceProp {
698
+ children: ReactNode;
699
+ tilesWidth: string;
700
+ stretch?: boolean;
701
+ equalHeight?: boolean;
702
+ }
703
+ declare const Tiles: ({ space, stretch, equalHeight, tilesWidth, children, ...props }: TilesProps) => react_jsx_runtime.JSX.Element;
704
+
705
+ interface TooltipTriggerProps extends Omit<TooltipTriggerProps$1, 'isDisabled' | 'isOpen'>, Omit<PositionProps, 'isOpen'> {
706
+ children: [trigger: ReactElement, menu: ReactElement];
707
+ disabled?: boolean;
708
+ open?: boolean;
709
+ }
710
+
711
+ interface TooltipProps extends HtmlProps<'div'> {
712
+ children?: ReactNode;
713
+ variant?: string;
714
+ size?: string;
715
+ }
716
+ declare const Tooltip: {
717
+ ({ children, variant, size }: TooltipProps): react_jsx_runtime.JSX.Element;
718
+ Trigger: ({ disabled, open, delay, placement, children, ...rest }: TooltipTriggerProps) => react_jsx_runtime.JSX.Element;
719
+ };
720
+
721
+ interface TagGroupProps extends Omit<AriaTagGroupProps<object>, 'isRequired' | 'validationState'>, LabelableProps, HelpTextProps {
722
+ width?: WidthProp['width'];
723
+ required?: boolean;
724
+ error?: boolean;
725
+ allowsRemoving?: boolean;
726
+ }
727
+ declare const TagGroup: ({ width, required, error, allowsRemoving, ...rest }: TagGroupProps) => react_jsx_runtime.JSX.Element;
728
+
729
+ declare const Tag: TagComponent;
730
+ /**
731
+ * We need this so that TypeScripts allows us to add
732
+ * additional properties to the component (function).
733
+ */
734
+ type ItemComponent = typeof Item;
735
+ interface TagComponent extends ItemComponent {
736
+ Group: typeof TagGroup;
737
+ }
738
+
739
+ declare const XLoader: react.ForwardRefExoticComponent<SVGProps & react.RefAttributes<SVGElement>>;
740
+
741
+ interface TabsProps extends Omit<AriaTabListProps<object>, 'orientation' | 'isDisabled'>, GapSpaceProp {
742
+ size?: 'small' | 'medium' | 'large';
743
+ disabled?: boolean;
744
+ variant?: string;
745
+ }
746
+ declare const Tabs: {
747
+ ({ space, size, disabled, variant, ...rest }: TabsProps): react_jsx_runtime.JSX.Element;
748
+ Item: <T>(props: _react_types_shared.ItemProps<T>) => JSX.Element;
749
+ };
750
+
751
+ export { Accordion, AccordionItem, AccordionItemProps, AccordionOwnItemProps, AccordionProps, ActionMenu, Aside, AsideProps, Aspect, AspectProps, Autocomplete, AutocompleteProps, Badge, BadgeProps, Body, BodyProps, Breakout, BreakoutProps, Button, ButtonOwnProps, ButtonProps, Calendar, CalendarCell, CalendarCellProps, CalendarGrid, CalendarGridProps, CalendarProps, Card, CardProps, Center, CenterProps, Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupContextProps, CheckboxGroupProps, CheckboxProps, Columns, ColumnsProps, ComboBox, ComboBoxProps, Container, ContainerProps, CustomCheckboxProps, CustomRadioProps, CustomSwitchProps, CustomTextAreaEvents, CustomTextFieldEvents, DateField, DateFieldProps, DatePicker, DatePickerProps, Dialog, DialogChildProps, DialogProps, Divider, DividerProps, FieldBase, FieldBaseProps, FieldGroup, FieldGroupContext, FieldGroupContextProps, FieldGroupProps, Footer, FooterProps, Header, HeaderProps, Headline, HeadlineProps, Image, ImageProps, Inline, InlineProps, Input, InputOwnProps, InputProps, Inset, InsetProps, Label, LabelProps, Link, LinkOwnProps, LinkProps, List, ListProps, MarigoldProvider, MarigoldProviderProps, Menu, MenuProps, Message, MessageProps, Modal, ModalProps, NumberField, NumberFieldProps, Overlay, OverlayProps, Popover, PopoverProps, Radio, RadioComponent, RadioGroup, RadioGroupProps, RadioProps, RowProps, Select, SelectComponent, SelectProps, Slider, SliderProps, Split, SplitProps, Stack, StackProps, Switch, SwitchProps, Table, TableProps, Tabs, Tag, TagComponent, Text, TextArea, TextAreaProps, TextField, TextFieldProps, TextProps, Tiles, TilesProps, Tooltip, TooltipProps, Tray, TrayProps, TrayWrapper, Underlay, UnderlayProps, XLoader, useCheckboxGroupContext, useFieldGroupContext };
package/dist/index.d.ts CHANGED
@@ -424,7 +424,7 @@ type InsetProps = {
424
424
  spaceX?: never;
425
425
  spaceY?: never;
426
426
  };
427
- declare const Inset: ({ space, spaceX, spaceY, children, }: InsetProps) => react_jsx_runtime.JSX.Element;
427
+ declare const Inset: ({ space, spaceX, spaceY, children }: InsetProps) => react_jsx_runtime.JSX.Element;
428
428
 
429
429
  interface LinkOwnProps extends PressEvents {
430
430
  disabled?: boolean;
package/dist/index.js CHANGED
@@ -2552,17 +2552,13 @@ var DatePicker = ({
2552
2552
  // src/Inset/Inset.tsx
2553
2553
  var import_system40 = require("@marigold/system");
2554
2554
  var import_jsx_runtime52 = require("react/jsx-runtime");
2555
- var Inset = ({
2556
- space = 0,
2557
- spaceX = 0,
2558
- spaceY = 0,
2559
- children
2560
- }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2555
+ var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2561
2556
  "div",
2562
2557
  {
2563
2558
  className: (0, import_system40.cn)(
2564
- space ? import_system40.paddingSpace[space] : import_system40.paddingSpaceX[spaceX],
2565
- import_system40.paddingSpaceY[spaceY]
2559
+ space && import_system40.paddingSpace[space],
2560
+ !space && spaceX && import_system40.paddingSpaceX[spaceX],
2561
+ !space && spaceY && import_system40.paddingSpaceY[spaceY]
2566
2562
  ),
2567
2563
  children
2568
2564
  }
package/dist/index.mjs CHANGED
@@ -2525,17 +2525,13 @@ import {
2525
2525
  paddingSpaceY as paddingSpaceY2
2526
2526
  } from "@marigold/system";
2527
2527
  import { jsx as jsx52 } from "react/jsx-runtime";
2528
- var Inset = ({
2529
- space = 0,
2530
- spaceX = 0,
2531
- spaceY = 0,
2532
- children
2533
- }) => /* @__PURE__ */ jsx52(
2528
+ var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ jsx52(
2534
2529
  "div",
2535
2530
  {
2536
2531
  className: cn28(
2537
- space ? paddingSpace2[space] : paddingSpaceX2[spaceX],
2538
- paddingSpaceY2[spaceY]
2532
+ space && paddingSpace2[space],
2533
+ !space && spaceX && paddingSpaceX2[spaceX],
2534
+ !space && spaceY && paddingSpaceY2[spaceY]
2539
2535
  ),
2540
2536
  children
2541
2537
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marigold/components",
3
- "version": "6.2.3",
3
+ "version": "6.2.5",
4
4
  "description": "Components for the Marigold Design System",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -83,8 +83,8 @@
83
83
  "@react-types/table": "3.8.0",
84
84
  "@react-types/tooltip": "3.4.3",
85
85
  "react-is": "18.2.0",
86
- "@marigold/icons": "1.2.12",
87
- "@marigold/system": "6.2.3",
86
+ "@marigold/icons": "1.2.14",
87
+ "@marigold/system": "6.2.5",
88
88
  "@marigold/types": "1.0.1"
89
89
  },
90
90
  "peerDependencies": {
@@ -95,7 +95,7 @@
95
95
  "@types/react": "18.2.14",
96
96
  "react": "18.2.0",
97
97
  "react-dom": "18.2.0",
98
- "tsup": "6.7.0",
98
+ "tsup": "7.2.0",
99
99
  "@marigold/tsconfig": "0.4.0"
100
100
  },
101
101
  "scripts": {