@datacrest/dcuikit 0.0.4 → 0.0.7
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/build/components/Atom/Button/Button.d.ts +1 -11
- package/build/components/Atom/Button/Button.stories.d.ts +1 -1
- package/build/components/Atom/Button/Button.types.d.ts +10 -0
- package/build/components/Atom/Button/index.d.ts +1 -2
- package/build/components/Atom/Checkbox/Checkbox.d.ts +12 -0
- package/build/components/Atom/Checkbox/Checkbox.stories.d.ts +4 -0
- package/build/components/Atom/Checkbox/Checkbox.test.d.ts +1 -0
- package/build/components/Atom/Checkbox/Checkbox.types.d.ts +2 -0
- package/build/components/Atom/Checkbox/index.d.ts +3 -0
- package/build/components/Atom/Icon/Custom/Icons/Success.d.ts +3 -0
- package/build/components/Atom/Icon/Custom/index.d.ts +1 -0
- package/build/components/Atom/Icon/Icon.d.ts +1 -8
- package/build/components/Atom/Icon/Icon.stories.d.ts +1 -1
- package/build/components/Atom/Icon/Icon.types.d.ts +8 -0
- package/build/components/Atom/Icon/index.d.ts +1 -1
- package/build/components/Atom/Input/Input.d.ts +21 -0
- package/build/components/Atom/Input/Input.stories.d.ts +8 -0
- package/build/components/Atom/Input/Input.test.d.ts +1 -0
- package/build/components/Atom/Input/Input.types.d.ts +6 -0
- package/build/components/Atom/Input/index.d.ts +3 -0
- package/build/components/Atom/Typography/Heading.stories.d.ts +5 -0
- package/build/components/Atom/Typography/Heading.test.d.ts +1 -0
- package/build/components/Atom/Typography/Text.stories.d.ts +5 -0
- package/build/components/Atom/Typography/Text.test.d.ts +1 -0
- package/build/components/Atom/Typography/Typography.d.ts +4 -0
- package/build/components/Atom/Typography/Typography.types.d.ts +20 -0
- package/build/components/Atom/Typography/index.d.ts +2 -0
- package/build/components/Molecule/Message/Message.d.ts +13 -0
- package/build/components/Molecule/Message/Message.stories.d.ts +4 -0
- package/build/components/Molecule/Message/Message.test.d.ts +1 -0
- package/build/components/Molecule/Message/Message.types.d.ts +6 -0
- package/build/components/Molecule/Message/MessageManager.d.ts +20 -0
- package/build/components/Molecule/Message/index.d.ts +3 -0
- package/build/components/Molecule/Table/Table.d.ts +3 -0
- package/build/components/Molecule/Table/Table.stories.d.ts +5 -0
- package/build/components/Molecule/Table/Table.test.d.ts +1 -0
- package/build/components/Molecule/Table/Table.types.d.ts +23 -0
- package/build/components/Molecule/Table/index.d.ts +2 -0
- package/build/components/Molecule/Tooltip/Tooltip.d.ts +13 -0
- package/build/components/Molecule/Tooltip/Tooltip.stories.d.ts +5 -0
- package/build/components/Molecule/Tooltip/Tooltip.test.d.ts +1 -0
- package/build/components/Molecule/Tooltip/index.d.ts +2 -0
- package/build/index.d.ts +8 -0
- package/build/index.esm.js +29 -0
- package/build/index.esm.js.map +1 -0
- package/build/index.js +28 -1
- package/build/index.js.map +1 -1
- package/build/tsconfig.prod.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -2
- package/build/components/Atom/Button/Button.js +0 -2
- package/build/components/Atom/Button/Button.js.map +0 -1
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
variant: ButtonVariants;
|
|
6
|
-
size: ButtonSizes[number];
|
|
7
|
-
iconLeft?: React.ReactNode;
|
|
8
|
-
iconRight?: React.ReactNode;
|
|
9
|
-
fluid?: boolean;
|
|
10
|
-
loading?: boolean;
|
|
11
|
-
dataTestId?: string;
|
|
12
|
-
}
|
|
2
|
+
import { ButtonProps } from './Button.types';
|
|
13
3
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
export type ButtonVariants = 'primary' | 'secondary' | 'tertiary' | 'critical' | 'danger' | 'link';
|
|
2
2
|
export type ButtonSizes = ['small', 'medium', 'large'];
|
|
3
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
variant: ButtonVariants;
|
|
6
|
+
size: ButtonSizes[number];
|
|
7
|
+
iconLeft?: React.ReactNode;
|
|
8
|
+
iconRight?: React.ReactNode;
|
|
9
|
+
fluid?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CheckboxSizes } from './Checkbox.types';
|
|
3
|
+
export interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children'> {
|
|
4
|
+
checkboxSize?: CheckboxSizes[number];
|
|
5
|
+
dataTestId?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
marginRight?: 'small' | 'medium' | 'large';
|
|
9
|
+
marginLeft?: 'small' | 'medium' | 'large';
|
|
10
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -7,5 +7,6 @@ export { Upload } from './Icons/Upload';
|
|
|
7
7
|
export { EditFilled } from './Icons/EditFilled';
|
|
8
8
|
export { FileUpload } from './Icons/FileUpload';
|
|
9
9
|
export { ExcelFile } from './Icons/ExcelFile';
|
|
10
|
+
export { Success } from './Icons/Success';
|
|
10
11
|
export { FBLike } from './Icons/FBLike';
|
|
11
12
|
export { FBLove } from './Icons/FBLove';
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import * as CustomIconComponent from './Custom';
|
|
4
|
-
export type IconName = keyof typeof IconComponent;
|
|
5
|
-
export type CustomIconName = keyof typeof CustomIconComponent;
|
|
6
|
-
export interface IconProps extends IconComponent.IconProps {
|
|
7
|
-
name: CustomIconName | IconName;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
2
|
+
import { IconProps } from './Icon.types';
|
|
10
3
|
export declare const Icon: ({ name, color, size, strokeWidth, className, ...iconProps }: IconProps) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StoryFn, Meta } from '@storybook/react';
|
|
2
|
-
import { IconProps } from './Icon';
|
|
3
2
|
import { CustomIconProps } from './Custom/types';
|
|
3
|
+
import { IconProps } from './Icon.types';
|
|
4
4
|
declare const _default: Meta;
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Icon: StoryFn<IconProps & CustomIconProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as IconComponent from 'react-feather';
|
|
2
|
+
import * as CustomIconComponent from './Custom';
|
|
3
|
+
export type IconName = keyof typeof IconComponent;
|
|
4
|
+
export type CustomIconName = keyof typeof CustomIconComponent;
|
|
5
|
+
export interface IconProps extends IconComponent.IconProps {
|
|
6
|
+
name: CustomIconName | IconName;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Icon } from './Icon';
|
|
2
|
-
export type { IconProps, IconName } from './Icon';
|
|
2
|
+
export type { IconProps, IconName } from './Icon.types';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextProps } from '../Typography';
|
|
3
|
+
import { InputSizes } from './Input.types';
|
|
4
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, Record<string, any> {
|
|
5
|
+
label: string;
|
|
6
|
+
fluid?: boolean;
|
|
7
|
+
inputSize?: InputSizes[number];
|
|
8
|
+
success?: StateProps;
|
|
9
|
+
error?: StateProps;
|
|
10
|
+
hint?: StateProps;
|
|
11
|
+
leftIcon?: React.ReactNode;
|
|
12
|
+
rightIcon?: React.ReactNode;
|
|
13
|
+
togglePassword?: boolean;
|
|
14
|
+
hintTextProps?: TextProps;
|
|
15
|
+
className?: string;
|
|
16
|
+
dataTestId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface StateProps {
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const Input: ({ value, fluid, label, leftIcon, rightIcon, togglePassword, error, success, hint, disabled, type, hintTextProps, className, dataTestId, inputSize, ...props }: InputProps) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type InputSizes = ['small', 'normal'];
|
|
2
|
+
export type InputStates = ['default', 'hover', 'active', 'disabled'];
|
|
3
|
+
export type HintStates = ['hint', 'success', 'error'];
|
|
4
|
+
export type HintStateKeys = ['color', 'borderColor', 'placeholderColor'];
|
|
5
|
+
export type InputSizeKeys = ['fontSize', 'lineHeight', 'spacing'];
|
|
6
|
+
export type InputStateKeys = ['color', 'borderColor'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type MarginSize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';
|
|
2
|
+
export type LetterSpacingSize = 'tight' | 'normal' | 'wide' | 'wider' | 'widest';
|
|
3
|
+
export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
4
|
+
variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
5
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary' | 'white';
|
|
6
|
+
marginTop?: MarginSize;
|
|
7
|
+
marginBottom?: MarginSize;
|
|
8
|
+
letterSpacing?: LetterSpacingSize;
|
|
9
|
+
textAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
10
|
+
fontWeight?: 'normal' | 'bold' | 'semibold' | 'light';
|
|
11
|
+
}
|
|
12
|
+
export interface TextProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
13
|
+
variant: 'body' | 'paragraph' | 'caption' | 'small' | 'regular' | 'paragraphSm' | 'captionSm';
|
|
14
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary' | 'white';
|
|
15
|
+
marginTop?: MarginSize;
|
|
16
|
+
marginBottom?: MarginSize;
|
|
17
|
+
letterSpacing?: LetterSpacingSize;
|
|
18
|
+
textAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
19
|
+
fontWeight?: 'normal' | 'bold' | 'semibold' | 'light';
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { MessageVariants } from './Message.types';
|
|
3
|
+
export interface MessageProps {
|
|
4
|
+
id: string;
|
|
5
|
+
destroy: () => void;
|
|
6
|
+
title: string | ReactElement;
|
|
7
|
+
duration?: number;
|
|
8
|
+
variant: MessageVariants;
|
|
9
|
+
animationDuration?: number;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const MessageComponent: ({ id, destroy, title, variant, duration, animationDuration, icon, dataTestId, }: MessageProps) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MessageProps } from './Message';
|
|
2
|
+
export interface MessageOptions extends Omit<MessageProps, 'id' | 'destroy'> {
|
|
3
|
+
id?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class MessageManager {
|
|
6
|
+
private isSetup;
|
|
7
|
+
private containerRef;
|
|
8
|
+
private root;
|
|
9
|
+
private messages;
|
|
10
|
+
constructor();
|
|
11
|
+
setup(): void;
|
|
12
|
+
show(options: MessageOptions): void;
|
|
13
|
+
destroy(id: string): void;
|
|
14
|
+
success(options: Omit<MessageOptions, 'variant'>): void;
|
|
15
|
+
error(options: Omit<MessageOptions, 'variant'>): void;
|
|
16
|
+
warning(options: Omit<MessageOptions, 'variant'>): void;
|
|
17
|
+
info(options: Omit<MessageOptions, 'variant'>): void;
|
|
18
|
+
private render;
|
|
19
|
+
}
|
|
20
|
+
export declare const message: MessageManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum TableColumnAlign {
|
|
2
|
+
Left = "left",
|
|
3
|
+
Center = "center",
|
|
4
|
+
Right = "right"
|
|
5
|
+
}
|
|
6
|
+
export interface TableColumn {
|
|
7
|
+
key: string;
|
|
8
|
+
title: string;
|
|
9
|
+
width?: string;
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
align?: TableColumnAlign;
|
|
12
|
+
}
|
|
13
|
+
export type PageSizeOptions = 5 | 10 | 20 | 50;
|
|
14
|
+
export interface TableProps {
|
|
15
|
+
columns: TableColumn[];
|
|
16
|
+
data: Record<string, any>[];
|
|
17
|
+
sortable?: boolean;
|
|
18
|
+
pagination?: boolean;
|
|
19
|
+
currentPage?: number;
|
|
20
|
+
pageSize?: PageSizeOptions;
|
|
21
|
+
onSort?: (key: string, direction: 'asc' | 'desc') => void;
|
|
22
|
+
onPageChange?: (page: number) => void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipProps as TooltipBaseProps } from 'rc-tooltip/lib/Tooltip';
|
|
3
|
+
export interface TooltipContentProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
footer?: string | React.ReactNode;
|
|
7
|
+
dataTestId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TooltipProps extends Omit<TooltipBaseProps, 'overlay'>, TooltipContentProps {
|
|
10
|
+
overlay?: React.ReactNode | (() => React.ReactNode);
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const Tooltip: ({ overlay, title, description, footer, children, ...props }: TooltipProps) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
package/build/index.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export * from './components/Atom/Button';
|
|
2
|
+
export * from './components/Atom/Checkbox';
|
|
3
|
+
export * from './components/Atom/Icon';
|
|
4
|
+
export * from './components/Atom/Icon/Custom';
|
|
5
|
+
export * from './components/Atom/Input';
|
|
6
|
+
export * from './components/Atom/Typography';
|
|
7
|
+
export * from './components/Molecule/Message';
|
|
8
|
+
export * from './components/Molecule/Table';
|
|
9
|
+
export * from './components/Molecule/Tooltip';
|
|
2
10
|
export type { Variants } from './types/variant.types';
|