@marigold/components 0.1.0 → 0.2.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/ActionGroup/ActionGroup.d.ts +9 -0
- package/dist/ActionGroup/index.d.ts +1 -0
- package/dist/Alert/Alert.d.ts +16 -1
- package/dist/Box/Box.d.ts +2 -1
- package/dist/Button/Button.d.ts +4 -6
- package/dist/Card/Card.d.ts +9 -0
- package/dist/Card/index.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts +3 -0
- package/dist/Checkbox/CheckboxIcons.d.ts +9 -0
- package/dist/Column/Column.d.ts +3 -1
- package/dist/Dialog/Dialog.d.ts +8 -1
- package/dist/Dialog/ModalDialog.d.ts +5 -0
- package/dist/Field/Field.d.ts +4 -2
- package/dist/Label/Label.d.ts +2 -1
- package/dist/Provider/MarigoldProvider.d.ts +3 -0
- package/dist/Provider/index.d.ts +3 -0
- package/dist/Radio/Radio.d.ts +3 -0
- package/dist/Radio/RadioIcons.d.ts +9 -0
- package/dist/Select/ListBox.d.ts +8 -0
- package/dist/Select/ListBoxSection.d.ts +8 -0
- package/dist/Select/Option.d.ts +8 -0
- package/dist/Select/Popover.d.ts +9 -0
- package/dist/Select/Select.d.ts +11 -4
- package/dist/Stack/Stack.d.ts +1 -3
- package/dist/Textarea/Textarea.d.ts +2 -1
- package/dist/components.cjs.development.js +868 -357
- package/dist/components.cjs.development.js.map +1 -1
- package/dist/components.cjs.production.min.js +1 -1
- package/dist/components.cjs.production.min.js.map +1 -1
- package/dist/components.esm.js +837 -359
- package/dist/components.esm.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +18 -3
- package/src/ActionGroup/ActionGroup.stories.mdx +62 -0
- package/src/ActionGroup/ActionGroup.test.tsx +83 -0
- package/src/ActionGroup/ActionGroup.tsx +43 -0
- package/src/ActionGroup/index.ts +1 -0
- package/src/Alert/Alert.stories.mdx +28 -38
- package/src/Alert/Alert.test.tsx +1 -1
- package/src/Alert/Alert.tsx +11 -33
- package/src/Badge/Badge.stories.mdx +48 -34
- package/src/Badge/Badge.test.tsx +7 -15
- package/src/Badge/Badge.tsx +1 -2
- package/src/Box/Box.stories.mdx +322 -26
- package/src/Box/Box.tsx +58 -50
- package/src/Button/Button.stories.mdx +54 -166
- package/src/Button/Button.test.tsx +48 -8
- package/src/Button/Button.tsx +47 -18
- package/src/Card/Card.stories.mdx +49 -0
- package/src/Card/Card.test.tsx +66 -0
- package/src/Card/Card.tsx +36 -0
- package/src/Card/index.ts +1 -0
- package/src/Checkbox/Checkbox.stories.mdx +76 -71
- package/src/Checkbox/Checkbox.test.tsx +70 -24
- package/src/Checkbox/Checkbox.tsx +68 -49
- package/src/Checkbox/CheckboxIcons.tsx +49 -0
- package/src/Column/Column.stories.mdx +39 -64
- package/src/Column/Column.test.tsx +8 -0
- package/src/Column/Column.tsx +12 -2
- package/src/Columns/Columns.stories.mdx +58 -240
- package/src/Container/Container.stories.mdx +8 -25
- package/src/Dialog/Dialog.stories.mdx +65 -56
- package/src/Dialog/Dialog.test.tsx +64 -24
- package/src/Dialog/Dialog.tsx +64 -12
- package/src/Dialog/ModalDialog.tsx +47 -0
- package/src/Divider/Divider.stories.mdx +28 -34
- package/src/Field/Field.stories.mdx +88 -48
- package/src/Field/Field.test.tsx +31 -40
- package/src/Field/Field.tsx +26 -21
- package/src/Heading/Heading.stories.mdx +30 -82
- package/src/Hidden/Hidden.stories.mdx +29 -54
- package/src/Image/Image.stories.mdx +26 -30
- package/src/Input/Input.stories.mdx +52 -36
- package/src/Label/Label.stories.mdx +47 -29
- package/src/Label/Label.test.tsx +15 -1
- package/src/Label/Label.tsx +20 -7
- package/src/Link/Link.stories.mdx +36 -29
- package/src/Menu/Menu.stories.mdx +71 -39
- package/src/Menu/Menu.test.tsx +4 -4
- package/src/Menu/Menu.tsx +12 -14
- package/src/MenuItem/MenuItem.stories.mdx +32 -27
- package/src/MenuItem/MenuItem.test.tsx +15 -11
- package/src/MenuItem/MenuItem.tsx +7 -10
- package/src/Message/Message.stories.mdx +35 -35
- package/src/Message/Message.tsx +2 -10
- package/src/Provider/MarigoldProvider.test.tsx +126 -0
- package/src/Provider/MarigoldProvider.tsx +29 -0
- package/src/Provider/index.ts +3 -0
- package/src/Radio/Radio.stories.mdx +78 -92
- package/src/Radio/Radio.test.tsx +57 -15
- package/src/Radio/Radio.tsx +71 -51
- package/src/Radio/RadioIcons.tsx +39 -0
- package/src/Select/ListBox.tsx +39 -0
- package/src/Select/ListBoxSection.tsx +40 -0
- package/src/Select/Option.tsx +48 -0
- package/src/Select/Popover.tsx +50 -0
- package/src/Select/Select.stories.mdx +70 -36
- package/src/Select/Select.test.tsx +279 -35
- package/src/Select/Select.tsx +151 -18
- package/src/Slider/Slider.stories.mdx +22 -49
- package/src/Stack/Stack.stories.mdx +40 -94
- package/src/Stack/Stack.test.tsx +84 -65
- package/src/Stack/Stack.tsx +25 -41
- package/src/Text/Text.stories.mdx +52 -52
- package/src/Text/Text.tsx +13 -14
- package/src/Textarea/Textarea.stories.mdx +65 -56
- package/src/Textarea/Textarea.test.tsx +4 -5
- package/src/Textarea/Textarea.tsx +28 -37
- package/src/ValidationMessage/ValidationMessage.stories.mdx +26 -26
- package/src/ValidationMessage/ValidationMessage.test.tsx +4 -4
- package/src/ValidationMessage/ValidationMessage.tsx +11 -12
- package/src/index.ts +5 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ResponsiveStyleValue } from '@marigold/system';
|
|
3
|
+
import { ComponentProps } from '@marigold/types';
|
|
4
|
+
export declare type ActionGroupProps = {
|
|
5
|
+
variant?: string;
|
|
6
|
+
space?: ResponsiveStyleValue<number | string>;
|
|
7
|
+
verticalAlignment?: boolean;
|
|
8
|
+
} & ComponentProps<'div'>;
|
|
9
|
+
export declare const ActionGroup: React.FC<ActionGroupProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActionGroup';
|
package/dist/Alert/Alert.d.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentProps } from '@marigold/types';
|
|
3
|
+
declare const ICON_MAP: {
|
|
4
|
+
readonly success: ({ className, ...props }: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
readonly warning: ({ className, ...props }: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
readonly error: ({ className, ...props }: {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
}) => JSX.Element;
|
|
16
|
+
};
|
|
3
17
|
export declare type AlertProps = {
|
|
4
|
-
variant?:
|
|
18
|
+
variant?: keyof typeof ICON_MAP;
|
|
5
19
|
} & ComponentProps<'div'>;
|
|
6
20
|
export declare const Alert: React.FC<AlertProps>;
|
|
21
|
+
export {};
|
package/dist/Box/Box.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ResponsiveStyleValue } from '@marigold/system';
|
|
1
|
+
import { CSSObject, ResponsiveStyleValue } from '@marigold/system';
|
|
2
2
|
import { PolymorphicPropsWithRef, PolymorphicComponentWithRef } from '@marigold/types';
|
|
3
3
|
export declare type BoxOwnProps = {
|
|
4
4
|
className?: string;
|
|
5
5
|
variant?: string | string[];
|
|
6
|
+
css?: CSSObject;
|
|
6
7
|
display?: ResponsiveStyleValue<string>;
|
|
7
8
|
height?: ResponsiveStyleValue<number | string>;
|
|
8
9
|
width?: ResponsiveStyleValue<number | string>;
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
export declare type ButtonProps =
|
|
4
|
-
|
|
5
|
-
} & ComponentPropsWithRef<'button'>;
|
|
6
|
-
export declare const Button: React.FC<ButtonProps>;
|
|
1
|
+
import { PolymorphicComponentWithRef, PolymorphicPropsWithRef } from '@marigold/types';
|
|
2
|
+
import { BoxOwnProps } from '../Box';
|
|
3
|
+
export declare type ButtonProps = PolymorphicPropsWithRef<BoxOwnProps, 'button'>;
|
|
4
|
+
export declare const Button: PolymorphicComponentWithRef<BoxOwnProps, 'button'>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ResponsiveStyleValue } from '@marigold/system';
|
|
3
|
+
import { ComponentProps } from '@marigold/types';
|
|
4
|
+
export declare type CardProps = {
|
|
5
|
+
title?: string;
|
|
6
|
+
width?: ResponsiveStyleValue<string>;
|
|
7
|
+
variant?: string;
|
|
8
|
+
} & ComponentProps<'div'>;
|
|
9
|
+
export declare const Card: React.FC<CardProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Card';
|
|
@@ -2,11 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { ComponentProps } from '@marigold/types';
|
|
3
3
|
declare type CheckboxInputProps = {
|
|
4
4
|
variant?: string;
|
|
5
|
+
error?: boolean;
|
|
5
6
|
} & ComponentProps<'input'>;
|
|
6
7
|
export declare type CheckboxProps = {
|
|
7
8
|
id: string;
|
|
8
9
|
label?: string;
|
|
9
10
|
required?: boolean;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
errorMessage?: string;
|
|
10
13
|
} & CheckboxInputProps;
|
|
11
14
|
export declare const Checkbox: React.FC<CheckboxProps>;
|
|
12
15
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CheckboxChecked: ({ disabled, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
disabled?: boolean | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
5
|
+
export declare const CheckboxUnchecked: ({ disabled, error, ...props }: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
error?: boolean | undefined;
|
|
9
|
+
}) => JSX.Element;
|
package/dist/Column/Column.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
declare type WidthValues = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
2
3
|
export declare type ColumnProps = {
|
|
3
4
|
className?: string;
|
|
4
|
-
width?:
|
|
5
|
+
width?: WidthValues | WidthValues[];
|
|
5
6
|
};
|
|
6
7
|
export declare const Column: React.FC<ColumnProps>;
|
|
8
|
+
export {};
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { ComponentProps } from '@marigold/types';
|
|
3
3
|
import { Button } from '../Button';
|
|
4
4
|
export declare type DialogProps = {
|
|
5
|
-
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
close: ComponentProps<typeof Button>['onClick'];
|
|
7
|
+
title?: string;
|
|
6
8
|
} & ComponentProps<'div'>;
|
|
7
9
|
export declare const Dialog: React.FC<DialogProps>;
|
|
10
|
+
export declare const useDialogButtonProps: () => {
|
|
11
|
+
state: import("@react-stately/overlays").OverlayTriggerState;
|
|
12
|
+
openButtonProps: React.HTMLAttributes<HTMLSpanElement>;
|
|
13
|
+
openButtonRef: React.RefObject<HTMLElement>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OverlayProps } from '@react-aria/overlays';
|
|
3
|
+
import { AriaDialogProps } from '@react-types/dialog';
|
|
4
|
+
export declare type ModalDialogProps = OverlayProps & AriaDialogProps;
|
|
5
|
+
export declare const ModalDialog: React.FC<ModalDialogProps>;
|
package/dist/Field/Field.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentProps } from '@marigold/types';
|
|
3
3
|
export declare type FieldProps = {
|
|
4
|
-
variant?: string;
|
|
5
4
|
htmlFor: string;
|
|
6
5
|
label: string;
|
|
7
|
-
|
|
6
|
+
required?: boolean;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
disabled?: boolean;
|
|
8
10
|
} & ComponentProps<'input'>;
|
|
9
11
|
export declare const Field: React.FC<FieldProps>;
|
package/dist/Label/Label.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentProps } from '@marigold/types';
|
|
3
3
|
export declare type LabelProps = {
|
|
4
|
-
htmlFor
|
|
4
|
+
htmlFor?: string;
|
|
5
5
|
variant?: string;
|
|
6
|
+
required?: boolean;
|
|
6
7
|
} & ComponentProps<'label'>;
|
|
7
8
|
export declare const Label: React.FC<LabelProps>;
|
package/dist/Radio/Radio.d.ts
CHANGED
|
@@ -2,11 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { ComponentProps } from '@marigold/types';
|
|
3
3
|
declare type RadioInputProps = {
|
|
4
4
|
variant?: string;
|
|
5
|
+
error?: boolean;
|
|
5
6
|
} & ComponentProps<'input'>;
|
|
6
7
|
export declare type RadioProps = {
|
|
7
8
|
id: string;
|
|
8
9
|
label?: string;
|
|
9
10
|
required?: boolean;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
errorMessage?: string;
|
|
10
13
|
} & RadioInputProps;
|
|
11
14
|
export declare const Radio: React.FC<RadioProps>;
|
|
12
15
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const RadioChecked: ({ disabled, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
disabled?: boolean | undefined;
|
|
4
|
+
}) => JSX.Element;
|
|
5
|
+
export declare const RadioUnchecked: ({ disabled, error, ...props }: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
error?: boolean | undefined;
|
|
9
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AriaListBoxOptions } from '@react-aria/listbox';
|
|
2
|
+
import type { ListState } from '@react-stately/list';
|
|
3
|
+
interface ListBoxProps extends AriaListBoxOptions<unknown> {
|
|
4
|
+
state: ListState<unknown>;
|
|
5
|
+
error?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const ListBox: (props: ListBoxProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ListState } from '@react-stately/list';
|
|
2
|
+
import type { Node } from '@react-types/shared';
|
|
3
|
+
interface SectionProps {
|
|
4
|
+
section: Node<unknown>;
|
|
5
|
+
state: ListState<unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare const ListBoxSection: ({ section, state }: SectionProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ListState } from '@react-stately/list';
|
|
2
|
+
import type { Node } from '@react-types/shared';
|
|
3
|
+
interface OptionProps {
|
|
4
|
+
item: Node<unknown>;
|
|
5
|
+
state: ListState<unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare const Option: ({ item, state }: OptionProps) => JSX.Element;
|
|
8
|
+
export {};
|
package/dist/Select/Select.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { AriaSelectProps } from '@react-types/select';
|
|
2
|
+
import { SingleSelection } from '@react-types/shared';
|
|
2
3
|
import { ComponentProps } from '@marigold/types';
|
|
4
|
+
import { ResponsiveStyleValue } from '@marigold/system';
|
|
3
5
|
export declare type SelectProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
width?: ResponsiveStyleValue<number | string>;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
errorMessage?: string;
|
|
12
|
+
} & ComponentProps<'select'> & AriaSelectProps<object> & SingleSelection;
|
|
13
|
+
export declare const Select: ({ placeholder, disabled, required, error, errorMessage, width, className, ...props }: SelectProps) => JSX.Element;
|
package/dist/Stack/Stack.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ResponsiveStyleValue } from '@marigold/system';
|
|
3
3
|
export declare type StackProps = {
|
|
4
|
-
|
|
5
|
-
space?: ResponsiveStyleValue<number | string>;
|
|
4
|
+
space?: ResponsiveStyleValue<string>;
|
|
6
5
|
align?: 'left' | 'right' | 'center';
|
|
7
|
-
title?: string;
|
|
8
6
|
};
|
|
9
7
|
export declare const Stack: React.FC<StackProps>;
|
|
@@ -4,7 +4,8 @@ export declare type TextareaProps = {
|
|
|
4
4
|
variant?: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
htmlFor?: string;
|
|
7
|
-
errorMessage?: string;
|
|
8
7
|
required?: boolean;
|
|
8
|
+
error?: boolean;
|
|
9
|
+
errorMessage?: string;
|
|
9
10
|
} & ComponentProps<'textarea'>;
|
|
10
11
|
export declare const Textarea: React.FC<TextareaProps>;
|