@marigold/components 2.1.3 → 3.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.
- package/dist/index.d.ts +43 -24
- package/dist/index.js +141 -125
- package/dist/index.mjs +145 -126
- package/package.json +45 -44
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { useAsyncList, useListData } from '@react-stately/data';
|
|
2
|
-
import { ThemeExtension, ThemeComponentProps, ThemeExtensionsWithParts, CSSObject, BoxOwnProps, StateAttrProps, Theme as Theme$1,
|
|
2
|
+
import { ThemeExtension, ThemeComponentProps, ResponsiveStyleValue, ThemeExtensionsWithParts, CSSObject, BoxOwnProps, StateAttrProps, Theme as Theme$1, ThemeProviderProps, GlobalProps } from '@marigold/system';
|
|
3
3
|
export { Box, BoxOwnProps, BoxProps, StyleProps, ThemeProvider, useTheme } from '@marigold/system';
|
|
4
4
|
import React, { ReactNode, HTMLAttributes, Key, LabelHTMLAttributes, ForwardRefExoticComponent, RefAttributes, ReactElement } from 'react';
|
|
5
5
|
import { ComponentProps, PolymorphicPropsWithRef, PolymorphicComponentWithRef, NonZeroPercentage } from '@marigold/types';
|
|
@@ -34,6 +34,13 @@ interface BadgeProps extends ComponentProps<'div'> {
|
|
|
34
34
|
}
|
|
35
35
|
declare const Badge: ({ variant, size, children, ...props }: BadgeProps) => JSX.Element;
|
|
36
36
|
|
|
37
|
+
interface BodyThemeExtension extends ThemeExtension<'Body'> {
|
|
38
|
+
}
|
|
39
|
+
interface BodyProps extends ThemeComponentProps, ComponentProps<'section'> {
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const Body: ({ children, variant, size, ...props }: BodyProps) => JSX.Element;
|
|
43
|
+
|
|
37
44
|
interface ButtonThemeExtension extends ThemeExtension<'Button'> {
|
|
38
45
|
}
|
|
39
46
|
interface ButtonOwnProps extends PressEvents, ComponentProps<'button'> {
|
|
@@ -50,8 +57,15 @@ interface CardThemeExtension extends ThemeExtension<'Card'> {
|
|
|
50
57
|
}
|
|
51
58
|
interface CardProps extends ThemeComponentProps, ComponentProps<'div'> {
|
|
52
59
|
children?: ReactNode;
|
|
60
|
+
p?: ResponsiveStyleValue<string>;
|
|
61
|
+
px?: ResponsiveStyleValue<string>;
|
|
62
|
+
py?: ResponsiveStyleValue<string>;
|
|
63
|
+
pt?: ResponsiveStyleValue<string>;
|
|
64
|
+
pb?: ResponsiveStyleValue<string>;
|
|
65
|
+
pl?: ResponsiveStyleValue<string>;
|
|
66
|
+
pr?: ResponsiveStyleValue<string>;
|
|
53
67
|
}
|
|
54
|
-
declare const Card: ({ children, variant, size, ...props }: CardProps) => JSX.Element;
|
|
68
|
+
declare const Card: ({ children, variant, size, p, px, py, pt, pb, pl, pr, ...props }: CardProps) => JSX.Element;
|
|
55
69
|
|
|
56
70
|
interface CheckboxThemeExtension extends ThemeExtensionsWithParts<'Checkbox', [
|
|
57
71
|
'container',
|
|
@@ -63,7 +77,7 @@ interface CheckboxThemeExtension extends ThemeExtensionsWithParts<'Checkbox', [
|
|
|
63
77
|
* `react-aria` has a slightly different API for the above events.
|
|
64
78
|
* Thus, we adjust our regular props to match them.
|
|
65
79
|
*/
|
|
66
|
-
declare type CustomCheckboxProps = 'value' | 'onChange' | 'onFocus' | 'onBlur';
|
|
80
|
+
declare type CustomCheckboxProps = 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp';
|
|
67
81
|
interface CheckboxProps extends ThemeComponentProps, Omit<ComponentProps<'input'>, 'size' | 'type' | 'defaultValue' | CustomCheckboxProps>, Pick<AriaCheckboxProps, CustomCheckboxProps> {
|
|
68
82
|
children?: ReactNode;
|
|
69
83
|
indeterminate?: boolean;
|
|
@@ -99,13 +113,6 @@ interface CheckboxGroupProps extends Omit<ComponentProps<'div'>, 'onChange'>, Ar
|
|
|
99
113
|
}
|
|
100
114
|
declare const CheckboxGroup: ({ children, variant, size, required, disabled, readOnly, error, ...rest }: CheckboxGroupProps) => JSX.Element;
|
|
101
115
|
|
|
102
|
-
interface ContentThemeExtension extends ThemeExtension<'Content'> {
|
|
103
|
-
}
|
|
104
|
-
interface ContentProps extends ThemeComponentProps, ComponentProps<'section'> {
|
|
105
|
-
children?: ReactNode;
|
|
106
|
-
}
|
|
107
|
-
declare const Content: ({ children, variant, size, ...props }: ContentProps) => JSX.Element;
|
|
108
|
-
|
|
109
116
|
interface DialogTriggerProps {
|
|
110
117
|
children: [trigger: ReactNode, menu: ReactNode];
|
|
111
118
|
dismissable?: boolean;
|
|
@@ -470,8 +477,8 @@ interface TextAreaThemeExtension extends ThemeExtension<'TextArea'> {
|
|
|
470
477
|
* `react-aria` has a slightly different API for the above events.
|
|
471
478
|
* Thus, we adjust our regular props to match them.
|
|
472
479
|
*/
|
|
473
|
-
declare type
|
|
474
|
-
interface TextAreaProps extends Omit<ComponentProps<'textarea'>, 'value' | 'defaultValue' | 'size' |
|
|
480
|
+
declare type CustomTextAreaEvents = 'onChange' | 'onFocus' | 'onBlur' | 'onCopy' | 'onSelect' | 'onPaste' | 'onCut' | 'onCompositionStart' | 'onCompositionUpdate' | 'onCompositionEnd' | 'onBeforeInput' | 'onInput' | 'onKeyDown' | 'onKeyUp';
|
|
481
|
+
interface TextAreaProps extends Omit<ComponentProps<'textarea'>, 'value' | 'defaultValue' | 'size' | CustomTextAreaEvents>, Pick<AriaTextFieldProps, CustomTextAreaEvents>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
|
|
475
482
|
variant?: string;
|
|
476
483
|
size?: string;
|
|
477
484
|
width?: string;
|
|
@@ -498,11 +505,15 @@ declare const Tooltip: {
|
|
|
498
505
|
Trigger: ({ disabled, open, delay, placement, children, ...rest }: TooltipTriggerProps) => JSX.Element;
|
|
499
506
|
};
|
|
500
507
|
|
|
501
|
-
interface ComponentStyles extends BadgeThemeExtension, ButtonThemeExtension, CardThemeExtension, CheckboxThemeExtension, CheckboxGroupThemeExtension,
|
|
508
|
+
interface ComponentStyles extends BadgeThemeExtension, ButtonThemeExtension, CardThemeExtension, CheckboxThemeExtension, CheckboxGroupThemeExtension, BodyThemeExtension, DialogThemeExtension, DividerThemeExtension, FooterThemeExtension, HeaderThemeExtension, HeadlineThemeExtension, HelpTextThemeExtension, ImageThemeExtension, InputThemeExtension, LabelThemeExtension, LinkThemeExtension, ListThemeExtension, ListBoxThemeExtension, MenuThemeExtension, MessageThemeExtension, NumberFieldThemeExtension, RadioThemeExtension, RadioGroupThemeExtension, SelectThemeExtension, SliderThemeExtension, SwitchThemeExtension, TableThemeExtension, TextThemeExtension, TextAreaThemeExtension, TooltipThemeExtension, UnderlayThemeExtension {
|
|
502
509
|
}
|
|
503
510
|
interface Theme extends Theme$1 {
|
|
504
511
|
components: ComponentStyles;
|
|
505
512
|
}
|
|
513
|
+
interface CustomizedTheme extends Theme$1 {
|
|
514
|
+
components?: Partial<ComponentStyles>;
|
|
515
|
+
}
|
|
516
|
+
declare const extendTheme: (baseTheme: Theme, extendTheme: CustomizedTheme) => Theme;
|
|
506
517
|
|
|
507
518
|
interface AsideProps {
|
|
508
519
|
children: [ReactElement, ReactElement];
|
|
@@ -527,10 +538,11 @@ declare const Aspect: ({ ratio, maxWidth, children, }: AspectProps) => JSX.Eleme
|
|
|
527
538
|
|
|
528
539
|
interface BreakoutProps extends ComponentProps<'div'> {
|
|
529
540
|
children?: ReactNode;
|
|
530
|
-
|
|
531
|
-
|
|
541
|
+
alignY?: 'top' | 'bottom' | 'center';
|
|
542
|
+
alignX?: 'left' | 'right' | 'center';
|
|
543
|
+
height?: string;
|
|
532
544
|
}
|
|
533
|
-
declare const Breakout: ({
|
|
545
|
+
declare const Breakout: ({ alignX, alignY, height, children, ...props }: BreakoutProps) => JSX.Element;
|
|
534
546
|
|
|
535
547
|
interface CenterProps extends ComponentProps<'div'> {
|
|
536
548
|
children?: ReactNode;
|
|
@@ -544,18 +556,19 @@ interface ColumnsProps {
|
|
|
544
556
|
columns: Array<number>;
|
|
545
557
|
space?: ResponsiveStyleValue<string>;
|
|
546
558
|
columnLimit?: number;
|
|
547
|
-
collapseAt?: string;
|
|
559
|
+
collapseAt?: string | 0;
|
|
560
|
+
stretch?: boolean;
|
|
548
561
|
}
|
|
549
|
-
declare const Columns: ({ space, columns, collapseAt, children, ...props }: ColumnsProps) => JSX.Element;
|
|
562
|
+
declare const Columns: ({ space, columns, collapseAt, stretch, children, ...props }: ColumnsProps) => JSX.Element;
|
|
550
563
|
|
|
551
564
|
interface ContainerProps extends ComponentProps<'div'> {
|
|
552
565
|
children?: ReactNode;
|
|
553
566
|
contentType?: 'content' | 'header';
|
|
554
567
|
size?: keyof typeof size.content | keyof typeof size.header;
|
|
555
568
|
align?: 'left' | 'right' | 'center';
|
|
556
|
-
|
|
569
|
+
alignItems?: 'left' | 'right' | 'center' | 'none';
|
|
557
570
|
}
|
|
558
|
-
declare const Container: ({ contentType, size, align,
|
|
571
|
+
declare const Container: ({ contentType, size, align, alignItems, children, ...props }: ContainerProps) => JSX.Element;
|
|
559
572
|
|
|
560
573
|
declare const ALIGNMENT_X$1: {
|
|
561
574
|
left: string;
|
|
@@ -584,17 +597,18 @@ interface SplitProps extends ComponentProps<'div'> {
|
|
|
584
597
|
declare const Split: (props: SplitProps) => JSX.Element;
|
|
585
598
|
|
|
586
599
|
declare const ALIGNMENT_X: {
|
|
600
|
+
none: string;
|
|
587
601
|
left: string;
|
|
588
602
|
center: string;
|
|
589
603
|
right: string;
|
|
590
604
|
};
|
|
591
605
|
declare const ALIGNMENT_Y: {
|
|
606
|
+
none: string;
|
|
592
607
|
top: string;
|
|
593
608
|
center: string;
|
|
594
609
|
bottom: string;
|
|
595
610
|
};
|
|
596
611
|
interface StackProps {
|
|
597
|
-
as?: 'div' | 'ul' | 'ol';
|
|
598
612
|
children?: ReactNode;
|
|
599
613
|
space?: ResponsiveStyleValue<string>;
|
|
600
614
|
alignX?: keyof typeof ALIGNMENT_X;
|
|
@@ -603,12 +617,17 @@ interface StackProps {
|
|
|
603
617
|
}
|
|
604
618
|
declare const Stack: ({ children, space, alignX, alignY, stretch, ...props }: StackProps) => JSX.Element;
|
|
605
619
|
|
|
606
|
-
|
|
620
|
+
/**
|
|
621
|
+
* `react-aria` has a slightly different API for the above events.
|
|
622
|
+
* Thus, we adjust our regular props to match them.
|
|
623
|
+
*/
|
|
624
|
+
declare type CustomTextFieldEvents = 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp';
|
|
625
|
+
interface TextFieldProps extends Omit<ComponentProps<'input'>, 'value' | 'defaultValue' | 'size' | 'width' | CustomTextFieldEvents>,
|
|
607
626
|
/**
|
|
608
627
|
* `react-aria` has a slightly different API for `onChange`, `onFocus`
|
|
609
628
|
* and `onBlur` events. Thus, we adjust our regular props to match them.
|
|
610
629
|
*/
|
|
611
|
-
Pick<AriaTextFieldProps,
|
|
630
|
+
Pick<AriaTextFieldProps, CustomTextFieldEvents>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
|
|
612
631
|
variant?: string;
|
|
613
632
|
size?: string;
|
|
614
633
|
width?: string;
|
|
@@ -624,4 +643,4 @@ interface TilesProps {
|
|
|
624
643
|
}
|
|
625
644
|
declare const Tiles: React.ForwardRefExoticComponent<TilesProps & React.RefAttributes<HTMLDivElement>>;
|
|
626
645
|
|
|
627
|
-
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,
|
|
646
|
+
export { Aside, AsideProps, Aspect, AspectProps, Badge, BadgeProps, BadgeThemeExtension, Body, BodyProps, BodyThemeExtension, Breakout, BreakoutProps, Button, ButtonOwnProps, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Center, CenterProps, Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupContextProps, CheckboxGroupThemeExtension, CheckboxProps, CheckboxThemeExtension, Columns, ColumnsProps, Container, ContainerProps, CustomCheckboxProps, CustomRadioProps, CustomSwitchProps, CustomTextAreaEvents, CustomTextFieldEvents, CustomizedTheme, 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, List, ListProps, ListThemeExtension, MarigoldProvider, MarigoldProviderProps, Menu, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, NumberField, NumberFieldProps, NumberFieldThemeExtension, Overlay, OverlayProps, Popover, PopoverProps, Radio, RadioComponent, RadioGroupProps, RadioGroupThemeExtension, RadioProps, RadioThemeExtension, Select, SelectComponent, SelectProps, SelectThemeExtension, Slider, SliderProps, SliderThemeExtension, Split, SplitProps, 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, extendTheme, useCheckboxGroupContext };
|