@flodesk/grain 11.42.1 → 11.42.2
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/es/types/components/arrange.d.ts +1 -1
- package/es/types/components/autocomplete2.d.ts +2 -2
- package/es/types/components/box.d.ts +3 -6
- package/es/types/components/button.d.ts +5 -2
- package/es/types/components/checkbox.d.ts +2 -2
- package/es/types/components/select.d.ts +8 -4
- package/es/types/components/slider.d.ts +3 -3
- package/es/types/components/switch.d.ts +2 -2
- package/es/types/components/text-area.d.ts +1 -1
- package/es/types/components/text-button.d.ts +10 -4
- package/es/types/components/text-input.d.ts +3 -3
- package/es/types/components/text-toggle.d.ts +5 -3
- package/es/types/components/toast.d.ts +6 -12
- package/es/types/foundational/field.d.ts +5 -5
- package/es/types/shared.d.ts +8 -0
- package/es/types/variables/vars.d.ts +3 -3
- package/package.json +3 -1
|
@@ -2,7 +2,7 @@ import type { FC } from 'react';
|
|
|
2
2
|
import { BoxProps } from './box';
|
|
3
3
|
import { DimensionPropType, AlignmentType, DirectionType } from '../shared';
|
|
4
4
|
|
|
5
|
-
export interface ArrangeProps extends BoxProps {
|
|
5
|
+
export interface ArrangeProps extends Omit<BoxProps, 'rows'> {
|
|
6
6
|
gap?: DimensionPropType;
|
|
7
7
|
columnGap?: DimensionPropType;
|
|
8
8
|
rowGap?: DimensionPropType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import { ColorPropType } from '../shared';
|
|
2
|
+
import { ColorPropType, ComponentBaseProps } from '../shared';
|
|
3
3
|
import { MenuPlacement } from '../foundational/menu';
|
|
4
4
|
|
|
5
5
|
export interface Autocomplete2Option {
|
|
@@ -15,7 +15,7 @@ export interface Autocomplete2Option {
|
|
|
15
15
|
isDisabled?: boolean;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export interface Autocomplete2Props {
|
|
18
|
+
export interface Autocomplete2Props extends Omit<ComponentBaseProps, 'onChange' | 'label'> {
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
options: Autocomplete2Option[];
|
|
21
21
|
value?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FC
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
ColorPropType,
|
|
4
4
|
DimensionPropType,
|
|
@@ -10,14 +10,11 @@ import {
|
|
|
10
10
|
TransitionPropType,
|
|
11
11
|
CursorPropType,
|
|
12
12
|
AlignSelfPropType,
|
|
13
|
+
ComponentBaseProps,
|
|
13
14
|
} from '../shared';
|
|
14
15
|
import { ShadowTokens } from '../tokens';
|
|
15
16
|
|
|
16
|
-
export interface BoxProps
|
|
17
|
-
extends PropsWithChildren,
|
|
18
|
-
RefAttributes<HTMLDivElement>,
|
|
19
|
-
Partial<HTMLDivElement>,
|
|
20
|
-
DOMAttributes<HTMLDivElement> {
|
|
17
|
+
export interface BoxProps extends Omit<ComponentBaseProps, 'height' | 'width'> {
|
|
21
18
|
children?: React.ReactNode;
|
|
22
19
|
color?: ColorPropType;
|
|
23
20
|
colorHover?: ColorPropType;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
+
import { ComponentBaseProps } from '../shared';
|
|
2
3
|
|
|
3
4
|
export type ButtonVariant = 'neutral' | 'accent' | 'danger';
|
|
4
5
|
export type ButtonTag = 'button' | 'a' | 'span';
|
|
5
6
|
|
|
6
|
-
export interface ButtonProps {
|
|
7
|
+
export interface ButtonProps extends ComponentBaseProps {
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
variant?: ButtonVariant;
|
|
9
10
|
isDisabled?: boolean;
|
|
@@ -13,7 +14,9 @@ export interface ButtonProps {
|
|
|
13
14
|
hasSpinner?: boolean;
|
|
14
15
|
type?: 'button' | 'submit' | 'reset';
|
|
15
16
|
tag?: ButtonTag;
|
|
16
|
-
onClick?: (
|
|
17
|
+
onClick?: (
|
|
18
|
+
event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLSpanElement>,
|
|
19
|
+
) => void;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export const Button: FC<ButtonProps>;
|
|
@@ -2,7 +2,7 @@ import type { FC, InputHTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
4
4
|
id: string;
|
|
5
|
-
onChange?: (
|
|
5
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
6
|
isDisabled?: boolean;
|
|
7
7
|
isChecked?: boolean;
|
|
8
8
|
isIndeterminate?: boolean;
|
|
@@ -11,7 +11,7 @@ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export interface CheckboxBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
14
|
-
onChange?: (
|
|
14
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
15
|
isDisabled?: boolean;
|
|
16
16
|
isChecked?: boolean;
|
|
17
17
|
isIndeterminate?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FC
|
|
2
|
-
import { ColorPropType } from '../shared';
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { ColorPropType, ComponentBaseProps } from '../shared';
|
|
3
3
|
|
|
4
4
|
export interface SelectOption {
|
|
5
5
|
value: string;
|
|
@@ -7,7 +7,7 @@ export interface SelectOption {
|
|
|
7
7
|
isDisabled?: boolean;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export interface SelectProps extends Omit<
|
|
10
|
+
export interface SelectProps extends Omit<ComponentBaseProps, 'onChange' | 'label'> {
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
id?: string;
|
|
13
13
|
value?: string;
|
|
@@ -22,6 +22,10 @@ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement
|
|
|
22
22
|
isDisabled?: boolean;
|
|
23
23
|
isReadOnly?: boolean;
|
|
24
24
|
backgroundColor?: ColorPropType;
|
|
25
|
+
menuWidth?: string | number;
|
|
26
|
+
menuMaxHeight?: string | number;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
export const Select: FC<SelectProps
|
|
29
|
+
export const Select: FC<SelectProps> & {
|
|
30
|
+
Trigger: React.ComponentType<any>;
|
|
31
|
+
};
|
|
@@ -8,9 +8,9 @@ export interface SliderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
min?: number;
|
|
9
9
|
max?: number;
|
|
10
10
|
step?: number;
|
|
11
|
-
onChange?: (
|
|
12
|
-
onChangeEnd?: (
|
|
13
|
-
|
|
11
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
+
onChangeEnd?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
14
|
label?: React.ReactNode;
|
|
15
15
|
hint?: React.ReactNode;
|
|
16
16
|
hasError?: boolean;
|
|
@@ -3,8 +3,8 @@ import type { FC, InputHTMLAttributes } from 'react';
|
|
|
3
3
|
export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
id: string;
|
|
6
|
-
|
|
7
|
-
onChange?: (
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
isDisabled?: boolean;
|
|
9
9
|
label?: string;
|
|
10
10
|
hint?: React.ReactNode;
|
|
@@ -6,7 +6,7 @@ export interface TextareaProps
|
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
value?: string;
|
|
8
8
|
defaultValue?: string;
|
|
9
|
-
onChange?: (
|
|
9
|
+
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
hint?: React.ReactNode;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type { FC
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { ComponentBaseProps } from '../shared';
|
|
3
|
+
import { ButtonTag } from './button';
|
|
2
4
|
|
|
3
|
-
export interface TextButtonProps extends
|
|
5
|
+
export interface TextButtonProps extends ComponentBaseProps {
|
|
4
6
|
children?: React.ReactNode;
|
|
5
7
|
variant?: 'neutral' | 'accent' | 'danger';
|
|
6
8
|
isDisabled?: boolean;
|
|
7
9
|
type?: 'button' | 'submit' | 'reset';
|
|
8
|
-
tag?:
|
|
9
|
-
onClick?: (
|
|
10
|
+
tag?: ButtonTag;
|
|
11
|
+
onClick?: (
|
|
12
|
+
event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLSpanElement>,
|
|
13
|
+
) => void;
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
iconPosition?: 'left' | 'right';
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
export const TextButton: FC<TextButtonProps>;
|
|
@@ -4,9 +4,9 @@ export interface TextInputProps extends React.InputHTMLAttributes<HTMLInputEleme
|
|
|
4
4
|
id?: string;
|
|
5
5
|
value?: string;
|
|
6
6
|
defaultValue?: string;
|
|
7
|
-
onChange?: (
|
|
8
|
-
onFocus?: (
|
|
9
|
-
onBlur?: (
|
|
7
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
9
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
10
10
|
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
label?: React.ReactNode;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { FC
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { ComponentBaseProps } from '../shared';
|
|
2
3
|
|
|
3
|
-
export interface TextToggleGroupProps extends
|
|
4
|
+
export interface TextToggleGroupProps extends ComponentBaseProps {
|
|
4
5
|
children?: React.ReactNode;
|
|
6
|
+
hasFullWidth?: boolean;
|
|
5
7
|
}
|
|
6
8
|
|
|
7
|
-
export interface TextToggleProps extends
|
|
9
|
+
export interface TextToggleProps extends ComponentBaseProps {
|
|
8
10
|
children?: React.ReactNode;
|
|
9
11
|
isActive?: boolean;
|
|
10
12
|
}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
-
import { DimensionPropType } from '../shared';
|
|
1
|
+
import type { FC, HTMLAttributes, ReactNode } from 'react';
|
|
3
2
|
|
|
4
3
|
export interface ToastProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
children
|
|
6
|
-
isOpen: boolean;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
title?: React.ReactNode;
|
|
9
|
-
description?: React.ReactNode;
|
|
10
|
-
duration?: number;
|
|
11
|
-
hasCloseButton?: boolean;
|
|
12
|
-
variant?: 'neutral' | 'success' | 'warning' | 'danger';
|
|
13
|
-
position?: 'top' | 'bottom';
|
|
14
|
-
offset?: DimensionPropType;
|
|
4
|
+
children: ReactNode;
|
|
15
5
|
zIndex?: number;
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
variant?: 'success' | 'danger' | 'neutral';
|
|
8
|
+
dismissTimeout?: number;
|
|
9
|
+
onDismiss?: () => void;
|
|
16
10
|
}
|
|
17
11
|
|
|
18
12
|
export const Toast: FC<ToastProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import { ColorPropType, DimensionPropType } from '../shared';
|
|
2
|
+
import { ColorPropType, ComponentBaseProps, DimensionPropType } from '../shared';
|
|
3
3
|
|
|
4
|
-
export interface InputFieldProps {
|
|
4
|
+
export interface InputFieldProps extends ComponentBaseProps {
|
|
5
5
|
paddingLeft?: DimensionPropType;
|
|
6
6
|
paddingRight?: DimensionPropType;
|
|
7
7
|
hasError?: boolean;
|
|
@@ -10,16 +10,16 @@ export interface InputFieldProps {
|
|
|
10
10
|
backgroundColor?: ColorPropType;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export interface FieldLabelProps {
|
|
13
|
+
export interface FieldLabelProps extends ComponentBaseProps {
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
htmlFor?: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export interface FieldHintProps {
|
|
18
|
+
export interface FieldHintProps extends ComponentBaseProps {
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export interface FieldClearButtonProps {
|
|
22
|
+
export interface FieldClearButtonProps extends ComponentBaseProps {
|
|
23
23
|
onClick?: () => void;
|
|
24
24
|
tag?: 'button' | 'a' | 'span';
|
|
25
25
|
}
|
package/es/types/shared.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ import {
|
|
|
21
21
|
textDisplays,
|
|
22
22
|
textAlignments,
|
|
23
23
|
} from '../types';
|
|
24
|
+
import { AllHTMLAttributes, RefAttributes } from 'react';
|
|
25
|
+
import { SerializedStyles } from '@emotion/react';
|
|
24
26
|
|
|
25
27
|
export type OverflowPropType = (typeof overflows)[number];
|
|
26
28
|
export type DimensionPropType = number | string | object | keyof SpaceTokens;
|
|
@@ -42,3 +44,9 @@ export type TextTransformType = (typeof textTransforms)[number];
|
|
|
42
44
|
export type TextDisplayType = (typeof textDisplays)[number];
|
|
43
45
|
export type TextAlignType = (typeof textAlignments)[number];
|
|
44
46
|
export type IconSizePropType = number | string | keyof IconTokens;
|
|
47
|
+
|
|
48
|
+
export interface ComponentBaseProps
|
|
49
|
+
extends AllHTMLAttributes<HTMLElement>,
|
|
50
|
+
RefAttributes<HTMLElement> {
|
|
51
|
+
css?: SerializedStyles | false;
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorTokens } from '../tokens';
|
|
1
|
+
import { ColorTokens, WeightTokens } from '../tokens';
|
|
2
2
|
|
|
3
3
|
export interface Texts {
|
|
4
4
|
s: string;
|
|
@@ -29,8 +29,8 @@ export interface Spaces {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export interface Weights {
|
|
32
|
-
normal:
|
|
33
|
-
medium:
|
|
32
|
+
normal: keyof WeightTokens;
|
|
33
|
+
medium: keyof WeightTokens;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export interface Radii {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flodesk/grain",
|
|
3
|
-
"version": "11.42.
|
|
3
|
+
"version": "11.42.2",
|
|
4
4
|
"description": "Flodesk design system",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"types": "es/types/index.d.ts",
|
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"@semantic-release/git": "^10.0.1",
|
|
55
55
|
"@semantic-release/gitlab": "^9.3.1",
|
|
56
56
|
"@semantic-release/npm": "^9.0.1",
|
|
57
|
+
"@types/react": "^16.14.62",
|
|
58
|
+
"@types/react-dom": "^16.9.25",
|
|
57
59
|
"colord": "^2.9.2",
|
|
58
60
|
"cross-env": "^7.0.3",
|
|
59
61
|
"del-cli": "^4.0.1",
|