@flodesk/grain 11.35.1 → 11.35.3
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/README.md +1 -1
- package/es/components/autocomplete.js +2 -2
- package/es/components/autocomplete2.js +5 -5
- package/es/components/checkbox.js +5 -5
- package/es/components/icon-toggle.js +7 -7
- package/es/components/radio.js +4 -4
- package/es/components/select.js +3 -3
- package/es/components/slider.js +4 -4
- package/es/components/switch.js +3 -3
- package/es/components/text-input.js +3 -3
- package/es/components/text-toggle.js +5 -5
- package/es/components/textarea.js +5 -5
- package/es/foundational/field.js +5 -13
- package/es/foundational/styles.js +2 -5
- package/es/styles/foundational.js +4 -3
- package/es/styles/variables.js +1 -1
- package/es/types/components/arrange.d.ts +18 -0
- package/es/types/components/autocomplete.d.ts +39 -0
- package/es/types/components/autocomplete2.d.ts +45 -0
- package/es/types/components/badge.d.ts +12 -0
- package/es/types/components/box.d.ts +59 -0
- package/es/types/components/breakpoints-provider.d.ts +15 -0
- package/es/types/components/button.d.ts +19 -0
- package/es/types/components/checkbox.d.ts +23 -0
- package/es/types/components/dropdown.d.ts +26 -0
- package/es/types/components/flex.d.ts +22 -0
- package/es/types/components/icon-button.d.ts +16 -0
- package/es/types/components/icon-toggle.d.ts +14 -0
- package/es/types/components/icon.d.ts +11 -0
- package/es/types/components/index.d.ts +32 -0
- package/es/types/components/link.d.ts +12 -0
- package/es/types/components/modal.d.ts +27 -0
- package/es/types/components/nav.d.ts +17 -0
- package/es/types/components/pagination.d.ts +9 -0
- package/es/types/components/popover.d.ts +18 -0
- package/es/types/components/progress.d.ts +8 -0
- package/es/types/components/provider.d.ts +11 -0
- package/es/types/components/radio.d.ts +23 -0
- package/es/types/components/select.d.ts +26 -0
- package/es/types/components/slider.d.ts +21 -0
- package/es/types/components/spinner.d.ts +9 -0
- package/es/types/components/stack.d.ts +10 -0
- package/es/types/components/switch.d.ts +12 -0
- package/es/types/components/tab.d.ts +17 -0
- package/es/types/components/text-button.d.ts +16 -0
- package/es/types/components/text-input.d.ts +25 -0
- package/es/types/components/text-toggle.d.ts +14 -0
- package/es/types/components/text.d.ts +17 -0
- package/es/types/components/textarea.d.ts +22 -0
- package/es/types/components/toast.d.ts +17 -0
- package/es/types/components/tooltip.d.ts +19 -0
- package/es/types/foundational/field.d.ts +30 -0
- package/es/types/foundational/index.d.ts +3 -0
- package/es/types/foundational/menu.d.ts +58 -0
- package/es/types/foundational/styles.d.ts +37 -0
- package/es/types/hooks/index.d.ts +2 -0
- package/es/types/hooks/useMedia.d.ts +1 -0
- package/es/types/hooks/useOnClickOutside.d.ts +4 -0
- package/es/types/icons/common.d.ts +3 -0
- package/es/types/icons/index.d.ts +85 -0
- package/es/types/index.d.ts +15 -0
- package/es/types/shared.d.ts +41 -0
- package/es/types/tokens.d.ts +141 -0
- package/es/types/utilities/index.d.ts +2 -0
- package/es/types/utilities/responsive.d.ts +20 -0
- package/es/types/utilities/styles.d.ts +20 -0
- package/es/types/variables/colors.d.ts +14 -0
- package/es/types/variables/index.d.ts +2 -0
- package/es/types/variables/vars.d.ts +92 -0
- package/es/utilities/responsive.js +1 -5
- package/es/utilities/style-config.js +3 -3
- package/es/utilities/styles.js +2 -10
- package/es/variables/vars.js +1 -32
- package/package.json +2 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FC, InputHTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
4
|
+
id: string;
|
|
5
|
+
onChange?: (_event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
isChecked?: boolean;
|
|
8
|
+
isIndeterminate?: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
hint?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CheckboxBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
14
|
+
onChange?: (_event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isChecked?: boolean;
|
|
17
|
+
isIndeterminate?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Checkbox: FC<CheckboxProps> & {
|
|
21
|
+
Label: FC<LabelHTMLAttributes<HTMLLabelElement> & { children: React.ReactNode }>;
|
|
22
|
+
Box: FC<CheckboxBoxProps>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { DimensionPropType } from '../shared';
|
|
3
|
+
import { MenuPlacement } from '../foundational/menu';
|
|
4
|
+
|
|
5
|
+
export interface DropdownOption {
|
|
6
|
+
type?: 'divider' | 'node';
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
content?: React.ReactNode;
|
|
9
|
+
variant?: 'neutral' | 'danger';
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
node?: (_props: { requestClose: () => void }) => React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface DropdownProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
options: DropdownOption[];
|
|
16
|
+
menuPlacement?: MenuPlacement;
|
|
17
|
+
menuWidth?: DimensionPropType;
|
|
18
|
+
menuZIndex?: number;
|
|
19
|
+
trigger?: React.ReactNode;
|
|
20
|
+
hasPortal?: boolean;
|
|
21
|
+
onOpenChange?: (_isOpen: boolean) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Dropdown: FC<DropdownProps> & {
|
|
25
|
+
Trigger: FC<HTMLAttributes<HTMLDivElement> & { children: React.ReactNode }>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BoxProps } from './box';
|
|
3
|
+
import {
|
|
4
|
+
DirectionType,
|
|
5
|
+
FlexWrapType,
|
|
6
|
+
ContentPositionType,
|
|
7
|
+
AlignmentType,
|
|
8
|
+
DimensionPropType,
|
|
9
|
+
} from '../shared';
|
|
10
|
+
|
|
11
|
+
export interface FlexProps extends BoxProps {
|
|
12
|
+
direction?: DirectionType;
|
|
13
|
+
wrap?: FlexWrapType;
|
|
14
|
+
justifyContent?: ContentPositionType;
|
|
15
|
+
alignItems?: AlignmentType;
|
|
16
|
+
alignContent?: ContentPositionType;
|
|
17
|
+
gap?: DimensionPropType;
|
|
18
|
+
columnGap?: DimensionPropType;
|
|
19
|
+
rowGap?: DimensionPropType;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Flex: FC<FlexProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FC, ButtonHTMLAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IconButtonProps
|
|
4
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'>,
|
|
5
|
+
Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
color?: string;
|
|
10
|
+
variant?: 'neutral' | 'danger';
|
|
11
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
|
+
isActive?: boolean;
|
|
13
|
+
tag?: 'button' | 'a' | 'span';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const IconButton: FC<IconButtonProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IconToggleGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IconToggleProps extends HTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const IconToggleGroup: FC<IconToggleGroupProps>;
|
|
14
|
+
export const IconToggle: FC<IconToggleProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface IconProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
hasEvenBoundary?: boolean;
|
|
7
|
+
size?: 's' | 'm' | 'l' | 'xl' | 'xxl' | number | string;
|
|
8
|
+
color?: ColorPropType;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Icon: FC<IconProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export * from './arrange';
|
|
2
|
+
export * from './autocomplete';
|
|
3
|
+
export * from './autocomplete2';
|
|
4
|
+
export * from './badge';
|
|
5
|
+
export * from './box';
|
|
6
|
+
export * from './button';
|
|
7
|
+
export * from './checkbox';
|
|
8
|
+
export * from './dropdown';
|
|
9
|
+
export * from './flex';
|
|
10
|
+
export * from './icon';
|
|
11
|
+
export * from './icon-button';
|
|
12
|
+
export * from './icon-toggle';
|
|
13
|
+
export * from './link';
|
|
14
|
+
export * from './modal';
|
|
15
|
+
export * from './nav';
|
|
16
|
+
export * from './pagination';
|
|
17
|
+
export * from './popover';
|
|
18
|
+
export * from './progress';
|
|
19
|
+
export * from './provider';
|
|
20
|
+
export * from './radio';
|
|
21
|
+
export * from './select';
|
|
22
|
+
export * from './slider';
|
|
23
|
+
export * from './spinner';
|
|
24
|
+
export * from './stack';
|
|
25
|
+
export * from './switch';
|
|
26
|
+
export * from './tab';
|
|
27
|
+
export * from './text-button';
|
|
28
|
+
export * from './text-input';
|
|
29
|
+
export * from './text-toggle';
|
|
30
|
+
export * from './textarea';
|
|
31
|
+
export * from './toast';
|
|
32
|
+
export * from './tooltip';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
href?: string;
|
|
6
|
+
target?: string;
|
|
7
|
+
variant?: 'neutral' | 'subtle';
|
|
8
|
+
tag?: 'a' | 'button' | 'span';
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Link: FC<LinkProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FC, ForwardRefExoticComponent, RefAttributes, HTMLAttributes } from 'react';
|
|
2
|
+
import { DimensionPropType, RadiusPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
hasCloseButton?: boolean;
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
cardPadding?: DimensionPropType;
|
|
12
|
+
cardMaxWidth?: number | string | 'narrow' | 'medium' | 'wide';
|
|
13
|
+
cardHeight?: DimensionPropType;
|
|
14
|
+
cardMaxHeight?: DimensionPropType;
|
|
15
|
+
cardRadius?: RadiusPropType;
|
|
16
|
+
cardTop?: DimensionPropType;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
initialFocus?: React.RefObject<HTMLElement>;
|
|
19
|
+
returnFocus?: React.RefObject<HTMLElement>;
|
|
20
|
+
closeButtonProps?: Record<string, unknown>;
|
|
21
|
+
paddingX?: DimensionPropType;
|
|
22
|
+
disableCloseHandler?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Modal: ForwardRefExoticComponent<ModalProps & RefAttributes<HTMLDivElement>> & {
|
|
26
|
+
Title: FC<{ children: React.ReactNode } & HTMLAttributes<HTMLDivElement>>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { DirectionType } from '../shared';
|
|
3
|
+
import { BoxProps } from './box';
|
|
4
|
+
|
|
5
|
+
export interface NavProps extends BoxProps, HTMLAttributes<HTMLElement> {
|
|
6
|
+
direction?: DirectionType;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface NavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
href?: string;
|
|
12
|
+
icon?: React.ReactNode;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const Nav: FC<NavProps>;
|
|
17
|
+
export const NavItem: FC<NavItemProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { DimensionPropType } from '../shared';
|
|
3
|
+
import { MenuPlacement } from '../foundational/menu';
|
|
4
|
+
|
|
5
|
+
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
padding?: DimensionPropType;
|
|
7
|
+
width?: DimensionPropType;
|
|
8
|
+
placement?: MenuPlacement;
|
|
9
|
+
trigger?: React.ReactNode;
|
|
10
|
+
zIndex?: number;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
hasPortal?: boolean;
|
|
14
|
+
strategy?: 'absolute' | 'fixed';
|
|
15
|
+
offset?: DimensionPropType;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Popover: FC<PopoverProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
breakpoints?: {
|
|
6
|
+
tablet?: number;
|
|
7
|
+
mobile?: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const GrainProvider: FC<ProviderProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FC, InputHTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
4
|
+
id: string;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
isChecked?: boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
hint?: React.ReactNode;
|
|
10
|
+
onChange?: (_e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RadioBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
14
|
+
onChange?: (_e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isChecked?: boolean;
|
|
17
|
+
name?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Radio: FC<RadioProps> & {
|
|
21
|
+
Label: FC<LabelHTMLAttributes<HTMLLabelElement> & { children: React.ReactNode }>;
|
|
22
|
+
Box: FC<RadioBoxProps>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FC, SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface SelectOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'onChange'> {
|
|
11
|
+
id?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
onChange?: (_value: string) => void;
|
|
15
|
+
options: SelectOption[];
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
label?: React.ReactNode;
|
|
18
|
+
hint?: React.ReactNode;
|
|
19
|
+
hasError?: boolean;
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
isDisabled?: boolean;
|
|
22
|
+
isReadOnly?: boolean;
|
|
23
|
+
backgroundColor?: ColorPropType;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const Select: FC<SelectProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface SliderProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
value?: number;
|
|
6
|
+
defaultValue?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
onChange?: (_value: number) => void;
|
|
11
|
+
onChangeEnd?: (_value: number) => void;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
hint?: React.ReactNode;
|
|
15
|
+
hasError?: boolean;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
trackColor?: ColorPropType;
|
|
18
|
+
thumbColor?: ColorPropType;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Slider: FC<SliderProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { BoxProps } from './box';
|
|
3
|
+
import { DimensionPropType, AlignmentType } from '../shared';
|
|
4
|
+
|
|
5
|
+
export interface StackProps extends BoxProps, HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
gap?: DimensionPropType;
|
|
7
|
+
alignItems?: AlignmentType;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Stack: FC<StackProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC, InputHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
4
|
+
id: string;
|
|
5
|
+
isChecked?: boolean;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
onChange?: (_e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
hint?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Switch: FC<SwitchProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { DimensionPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface TabGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
height?: DimensionPropType;
|
|
7
|
+
hasFullWidth?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TabProps extends HTMLAttributes<HTMLButtonElement> {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
isActive?: boolean;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const TabGroup: FC<TabGroupProps>;
|
|
17
|
+
export const Tab: FC<TabProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FC, ButtonHTMLAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TextButtonProps
|
|
4
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'>,
|
|
5
|
+
Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
iconPosition?: 'left' | 'right';
|
|
9
|
+
variant?: 'neutral' | 'danger';
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
trimSide?: 'left' | 'right';
|
|
12
|
+
type?: 'button' | 'submit' | 'reset';
|
|
13
|
+
tag?: 'button' | 'a' | 'span';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const TextButton: FC<TextButtonProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ColorPropType } from '../shared';
|
|
2
|
+
|
|
3
|
+
export interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
id?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onChange?: (_event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
onFocus?: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
9
|
+
onBlur?: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
10
|
+
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
hint?: React.ReactNode;
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
hasError?: boolean;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
isReadOnly?: boolean;
|
|
19
|
+
backgroundColor?: ColorPropType;
|
|
20
|
+
onClear?: () => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const TextInput: React.ForwardRefExoticComponent<
|
|
24
|
+
TextInputProps & React.RefAttributes<HTMLInputElement>
|
|
25
|
+
>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TextToggleGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface TextToggleProps extends HTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const TextToggleGroup: FC<TextToggleGroupProps>;
|
|
14
|
+
export const TextToggle: FC<TextToggleProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'label';
|
|
7
|
+
size?: string;
|
|
8
|
+
weight?: string;
|
|
9
|
+
color?: ColorPropType;
|
|
10
|
+
align?: 'left' | 'center' | 'right';
|
|
11
|
+
display?: 'block' | 'inline-block' | 'inline';
|
|
12
|
+
transform?: 'capitalize' | 'uppercase' | 'lowercase';
|
|
13
|
+
trimTop?: boolean;
|
|
14
|
+
trimBottom?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Text: FC<TextProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FC, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { ColorPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface TextareaProps
|
|
5
|
+
extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'> {
|
|
6
|
+
id?: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onChange?: (_e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
hint?: React.ReactNode;
|
|
13
|
+
hasError?: boolean;
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isReadOnly?: boolean;
|
|
17
|
+
backgroundColor?: ColorPropType;
|
|
18
|
+
rows?: number;
|
|
19
|
+
maxLength?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Textarea: FC<TextareaProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { DimensionPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface ToastProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
duration?: number;
|
|
10
|
+
hasCloseButton?: boolean;
|
|
11
|
+
variant?: 'neutral' | 'success' | 'warning' | 'danger';
|
|
12
|
+
position?: 'top' | 'bottom';
|
|
13
|
+
offset?: DimensionPropType;
|
|
14
|
+
zIndex?: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Toast: FC<ToastProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { MenuPlacement } from '../foundational/menu';
|
|
3
|
+
|
|
4
|
+
export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
placement?: MenuPlacement;
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
hasPortal?: boolean;
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
placementMethod?: 'static' | 'dynamic';
|
|
10
|
+
offset?: 'xs' | 's';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TooltipContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Tooltip: FC<TooltipProps> & {
|
|
18
|
+
Content: FC<TooltipContentProps>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { ColorPropType, DimensionPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export interface InputFieldProps {
|
|
5
|
+
paddingLeft?: DimensionPropType;
|
|
6
|
+
paddingRight?: DimensionPropType;
|
|
7
|
+
hasError?: boolean;
|
|
8
|
+
isReadOnly?: boolean;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
backgroundColor?: ColorPropType;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface FieldLabelProps {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
htmlFor?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface FieldHintProps {
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface FieldClearButtonProps {
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
tag?: 'button' | 'a' | 'span';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const InputField: FC<InputFieldProps>;
|
|
28
|
+
export const FieldLabel: FC<FieldLabelProps>;
|
|
29
|
+
export const FieldHint: FC<FieldHintProps>;
|
|
30
|
+
export const FieldClearButton: FC<FieldClearButtonProps>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { DimensionPropType } from '../shared';
|
|
3
|
+
|
|
4
|
+
export type MenuPlacement =
|
|
5
|
+
| 'top'
|
|
6
|
+
| 'topStart'
|
|
7
|
+
| 'topEnd'
|
|
8
|
+
| 'bottom'
|
|
9
|
+
| 'bottomStart'
|
|
10
|
+
| 'bottomEnd'
|
|
11
|
+
| 'right'
|
|
12
|
+
| 'rightStart'
|
|
13
|
+
| 'rightEnd'
|
|
14
|
+
| 'left'
|
|
15
|
+
| 'leftStart'
|
|
16
|
+
| 'leftEnd';
|
|
17
|
+
|
|
18
|
+
export interface MenuPositionConfig {
|
|
19
|
+
menuWidth?: DimensionPropType;
|
|
20
|
+
menuPlacement?: MenuPlacement;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface MenuCardProps {
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
zIndex?: number;
|
|
26
|
+
maxHeight?: DimensionPropType;
|
|
27
|
+
maxWidth?: DimensionPropType;
|
|
28
|
+
isDisabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface MenuItemProps {
|
|
32
|
+
isSelected?: boolean;
|
|
33
|
+
isActive?: boolean;
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
icon?: React.ReactNode;
|
|
36
|
+
variant?: 'neutral' | 'danger';
|
|
37
|
+
hasEllipsis?: boolean;
|
|
38
|
+
checkVariant?: 'check' | 'none';
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
onClick?: () => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface MenuGroupTitleProps {
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
hasDivider?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const MenuCard: FC<MenuCardProps>;
|
|
49
|
+
export const MenuItem: FC<MenuItemProps>;
|
|
50
|
+
export const MenuGroupTitle: FC<MenuGroupTitleProps>;
|
|
51
|
+
export const MenuItemDivider: FC;
|
|
52
|
+
|
|
53
|
+
export function useMenuPosition(config: MenuPositionConfig): {
|
|
54
|
+
refs: any;
|
|
55
|
+
reference: (node: HTMLElement | null) => void;
|
|
56
|
+
floating: (node: HTMLElement | null) => void;
|
|
57
|
+
floatingStyles: React.CSSProperties;
|
|
58
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const capHeight: string;
|
|
2
|
+
export const lineHeightAndCapHeightOffset: string;
|
|
3
|
+
|
|
4
|
+
export const componentVars: {
|
|
5
|
+
strokeSize: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const styles: {
|
|
9
|
+
buttonReset: string;
|
|
10
|
+
transitions: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export interface ClearButtonStylesConfig {
|
|
14
|
+
variant?: 'neutral' | 'danger';
|
|
15
|
+
isActive?: boolean;
|
|
16
|
+
isDisabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ClearButtonStyles {
|
|
20
|
+
box: string;
|
|
21
|
+
icon: string;
|
|
22
|
+
text: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getClearButtonStyles(config: ClearButtonStylesConfig): ClearButtonStyles;
|
|
26
|
+
|
|
27
|
+
export const placementStyles: {
|
|
28
|
+
[key: string]: {
|
|
29
|
+
top?: string;
|
|
30
|
+
bottom?: string;
|
|
31
|
+
left?: string;
|
|
32
|
+
right?: string;
|
|
33
|
+
transform?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const capStyles: string;
|