@integrigo/integrigo-ui 1.6.7-c → 1.6.10-a
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/index.d.ts +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/src/components/atoms/Alert/Alert.d.ts +10 -0
- package/lib/src/components/atoms/Alert/Alert.stories.d.ts +6 -0
- package/lib/src/components/atoms/Alert/index.d.ts +1 -0
- package/lib/src/components/atoms/Avatar/Avatar.d.ts +8 -0
- package/lib/src/components/atoms/Avatar/Avatar.stories.d.ts +13 -0
- package/lib/src/components/atoms/Avatar/Avatar.test.d.ts +1 -0
- package/lib/src/components/atoms/Avatar/index.d.ts +1 -0
- package/lib/src/components/atoms/Card/Card.d.ts +5 -0
- package/lib/src/components/atoms/Card/Card.stories.d.ts +5 -0
- package/lib/src/components/atoms/Card/index.d.ts +1 -0
- package/lib/src/components/atoms/Chip/Chip.d.ts +25 -0
- package/lib/src/components/atoms/Chip/Chip.stories.d.ts +6 -0
- package/lib/src/components/atoms/Chip/Chip.test.d.ts +1 -0
- package/lib/src/components/atoms/Chip/index.d.ts +1 -0
- package/lib/src/components/atoms/Divider/Divider.d.ts +5 -0
- package/lib/src/components/atoms/Divider/Divider.stories.d.ts +14 -0
- package/lib/src/components/atoms/Divider/index.d.ts +1 -0
- package/lib/src/components/atoms/Dot/Dot.d.ts +9 -0
- package/lib/src/components/atoms/Dot/Dot.stories.d.ts +42 -0
- package/lib/src/components/atoms/Dot/Dot.test.d.ts +1 -0
- package/lib/src/components/atoms/Dot/index.d.ts +1 -0
- package/lib/src/components/atoms/Field/FieldLabel.d.ts +7 -0
- package/lib/src/components/atoms/Field/FieldWrapper.d.ts +4 -0
- package/lib/src/components/atoms/Field/fieldSizeVariants.d.ts +22 -0
- package/lib/src/components/atoms/Field/index.d.ts +3 -0
- package/lib/src/components/atoms/Icon/Icon.d.ts +42 -0
- package/lib/src/components/atoms/Icon/Icon.stories.d.ts +18 -0
- package/lib/src/components/atoms/Icon/IconAddition.d.ts +12 -0
- package/lib/src/components/atoms/Icon/icons/AngleDown.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/ArrowLeft.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Bars.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Bell.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/ChechSquare.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/CheckCircle.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/ClipboardNotes.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Close.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/DiceFive.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Edit.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Envelope.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/ExclamationCircle.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/ExclamationTriangle.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Exit.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Facebook.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Home.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/ImageEdit.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Instagram.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Linkedin.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Lock.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Minus.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Phone.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Plus.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/PointsCircle.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Process.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Redo.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Setting.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/UserCircle.d.ts +3 -0
- package/lib/src/components/atoms/Icon/icons/Users.d.ts +3 -0
- package/lib/src/components/atoms/Icon/index.d.ts +3 -0
- package/lib/src/components/atoms/Initials/Initials.d.ts +7 -0
- package/lib/src/components/atoms/Initials/Initials.stories.d.ts +11 -0
- package/lib/src/components/atoms/Initials/index.d.ts +1 -0
- package/lib/src/components/atoms/Nav/Nav.d.ts +4 -0
- package/lib/src/components/atoms/Nav/Nav.stories.d.ts +5 -0
- package/lib/src/components/atoms/Nav/index.d.ts +1 -0
- package/lib/src/components/atoms/Pill/Pill.d.ts +4 -0
- package/lib/src/components/atoms/Pill/Pill.stories.d.ts +6 -0
- package/lib/src/components/atoms/Pill/index.d.ts +1 -0
- package/lib/src/components/atoms/Spinner/Spinner.d.ts +4 -0
- package/lib/src/components/atoms/Spinner/Spinner.stories.d.ts +5 -0
- package/lib/src/components/atoms/Spinner/index.d.ts +1 -0
- package/lib/src/components/atoms/Typography/Body.d.ts +6 -0
- package/lib/src/components/atoms/Typography/Body.stories.d.ts +8 -0
- package/lib/src/components/atoms/Typography/Hero.d.ts +5 -0
- package/lib/src/components/atoms/Typography/Hero.stories.d.ts +9 -0
- package/lib/src/components/atoms/Typography/Label.d.ts +7 -0
- package/lib/src/components/atoms/Typography/Label.stories.d.ts +9 -0
- package/lib/src/components/atoms/Typography/index.d.ts +6 -0
- package/lib/src/components/atoms/index.d.ts +11 -0
- package/lib/src/components/molecules/Button/BasicButton.d.ts +35 -0
- package/lib/src/components/molecules/Button/Button.d.ts +12 -0
- package/lib/src/components/molecules/Button/Button.stories.d.ts +11 -0
- package/lib/src/components/molecules/Button/Button.test.d.ts +1 -0
- package/lib/src/components/molecules/Button/Ghost.d.ts +16 -0
- package/lib/src/components/molecules/Button/Primary.d.ts +7 -0
- package/lib/src/components/molecules/Button/index.d.ts +1 -0
- package/lib/src/components/molecules/Checkbox/Checkbox.d.ts +9 -0
- package/lib/src/components/molecules/Checkbox/Checkbox.stories.d.ts +19 -0
- package/lib/src/components/molecules/Checkbox/index.d.ts +1 -0
- package/lib/src/components/molecules/Dropdown/Dropdown.d.ts +15 -0
- package/lib/src/components/molecules/Dropdown/Dropdown.stories.d.ts +12 -0
- package/lib/src/components/molecules/Dropdown/Option.d.ts +2 -0
- package/lib/src/components/molecules/Dropdown/index.d.ts +1 -0
- package/lib/src/components/molecules/InfoCard/InfoCard.d.ts +9 -0
- package/lib/src/components/molecules/InfoCard/InfoCard.stories.d.ts +7 -0
- package/lib/src/components/molecules/InfoCard/index.d.ts +1 -0
- package/lib/src/components/molecules/Input/Input.d.ts +20 -0
- package/lib/src/components/molecules/Input/Input.stories.d.ts +75 -0
- package/lib/src/components/molecules/Input/index.d.ts +1 -0
- package/lib/src/components/molecules/Profile/Profile.d.ts +8 -0
- package/lib/src/components/molecules/Profile/Profile.stories.d.ts +33 -0
- package/lib/src/components/molecules/Profile/Profile.test.d.ts +1 -0
- package/lib/src/components/molecules/Profile/index.d.ts +1 -0
- package/lib/src/components/molecules/Radio/Radio.d.ts +15 -0
- package/lib/src/components/molecules/Radio/Radio.stories.d.ts +20 -0
- package/lib/src/components/molecules/Radio/Radio.test.d.ts +1 -0
- package/lib/src/components/molecules/Radio/index.d.ts +1 -0
- package/lib/src/components/molecules/TextArea/TextArea.d.ts +6 -0
- package/lib/src/components/molecules/TextArea/TextArea.stories.d.ts +8 -0
- package/lib/src/components/molecules/TextArea/index.d.ts +1 -0
- package/lib/src/components/molecules/index.d.ts +8 -0
- package/lib/src/components/organisms/Menu/Menu.d.ts +12 -0
- package/lib/src/components/organisms/Menu/Menu.stories.d.ts +9 -0
- package/lib/src/components/organisms/Menu/MenuItem.d.ts +9 -0
- package/lib/src/components/organisms/Menu/index.d.ts +1 -0
- package/lib/src/components/organisms/Setting/Setting.d.ts +10 -0
- package/lib/src/components/organisms/Setting/Setting.stories.d.ts +5 -0
- package/lib/src/components/organisms/Setting/index.d.ts +1 -0
- package/lib/src/components/organisms/index.d.ts +2 -0
- package/lib/src/helpers/validation.d.ts +3 -0
- package/lib/src/index.d.ts +4 -0
- package/lib/src/styles/colors.d.ts +24 -0
- package/lib/src/styles/global.d.ts +1 -0
- package/lib/src/styles/index.d.ts +2 -0
- package/lib/src/types/validation.d.ts +1 -0
- package/package.json +1 -1
- package/src/.storybook/main.js +12 -0
- package/src/.storybook/preview.js +20 -0
- package/src/components/atoms/Alert/Alert.stories.tsx +26 -0
- package/src/components/atoms/Alert/Alert.tsx +107 -0
- package/src/components/atoms/Alert/index.ts +1 -0
- package/src/components/atoms/Avatar/Avatar.stories.tsx +25 -0
- package/src/components/atoms/Avatar/Avatar.test.tsx +17 -0
- package/src/components/atoms/Avatar/Avatar.tsx +34 -0
- package/src/components/atoms/Avatar/__snapshots__/Avatar.test.tsx.snap +13 -0
- package/src/components/atoms/Avatar/index.ts +1 -0
- package/src/components/atoms/Card/Card.stories.tsx +29 -0
- package/src/components/atoms/Card/Card.tsx +32 -0
- package/src/components/atoms/Card/index.ts +1 -0
- package/src/components/atoms/Chip/Chip.stories.tsx +62 -0
- package/src/components/atoms/Chip/Chip.test.tsx +23 -0
- package/src/components/atoms/Chip/Chip.tsx +233 -0
- package/src/components/atoms/Chip/__snapshots__/Chip.test.tsx.snap +58 -0
- package/src/components/atoms/Chip/index.ts +1 -0
- package/src/components/atoms/Divider/Divider.stories.tsx +27 -0
- package/src/components/atoms/Divider/Divider.tsx +12 -0
- package/src/components/atoms/Divider/index.ts +1 -0
- package/src/components/atoms/Dot/Dot.stories.tsx +35 -0
- package/src/components/atoms/Dot/Dot.test.tsx +9 -0
- package/src/components/atoms/Dot/Dot.tsx +42 -0
- package/src/components/atoms/Dot/index.ts +1 -0
- package/src/components/atoms/Field/FieldLabel.tsx +32 -0
- package/src/components/atoms/Field/FieldWrapper.tsx +14 -0
- package/src/components/atoms/Field/fieldSizeVariants.tsx +22 -0
- package/src/components/atoms/Field/index.ts +3 -0
- package/src/components/atoms/Icon/Icon.stories.tsx +39 -0
- package/src/components/atoms/Icon/Icon.tsx +109 -0
- package/src/components/atoms/Icon/IconAddition.tsx +94 -0
- package/src/components/atoms/Icon/icons/AngleDown.tsx +9 -0
- package/src/components/atoms/Icon/icons/ArrowLeft.tsx +9 -0
- package/src/components/atoms/Icon/icons/Bars.tsx +9 -0
- package/src/components/atoms/Icon/icons/Bell.tsx +9 -0
- package/src/components/atoms/Icon/icons/ChechSquare.tsx +9 -0
- package/src/components/atoms/Icon/icons/CheckCircle.tsx +9 -0
- package/src/components/atoms/Icon/icons/ClipboardNotes.tsx +9 -0
- package/src/components/atoms/Icon/icons/Close.tsx +9 -0
- package/src/components/atoms/Icon/icons/DiceFive.tsx +9 -0
- package/src/components/atoms/Icon/icons/Edit.tsx +9 -0
- package/src/components/atoms/Icon/icons/Envelope.tsx +9 -0
- package/src/components/atoms/Icon/icons/ExclamationCircle.tsx +9 -0
- package/src/components/atoms/Icon/icons/ExclamationTriangle.tsx +9 -0
- package/src/components/atoms/Icon/icons/Exit.tsx +9 -0
- package/src/components/atoms/Icon/icons/Facebook.tsx +9 -0
- package/src/components/atoms/Icon/icons/Home.tsx +9 -0
- package/src/components/atoms/Icon/icons/ImageEdit.tsx +9 -0
- package/src/components/atoms/Icon/icons/Instagram.tsx +9 -0
- package/src/components/atoms/Icon/icons/Linkedin.tsx +9 -0
- package/src/components/atoms/Icon/icons/Lock.tsx +9 -0
- package/src/components/atoms/Icon/icons/Minus.tsx +9 -0
- package/src/components/atoms/Icon/icons/Phone.tsx +9 -0
- package/src/components/atoms/Icon/icons/Plus.tsx +9 -0
- package/src/components/atoms/Icon/icons/PointsCircle.tsx +9 -0
- package/src/components/atoms/Icon/icons/Process.tsx +9 -0
- package/src/components/atoms/Icon/icons/Redo.tsx +9 -0
- package/src/components/atoms/Icon/icons/Setting.tsx +9 -0
- package/src/components/atoms/Icon/icons/UserCircle.tsx +9 -0
- package/src/components/atoms/Icon/icons/Users.tsx +9 -0
- package/src/components/atoms/Icon/index.ts +3 -0
- package/src/components/atoms/Initials/Initials.stories.tsx +23 -0
- package/src/components/atoms/Initials/Initials.tsx +36 -0
- package/src/components/atoms/Initials/index.ts +1 -0
- package/src/components/atoms/Nav/Nav.stories.tsx +19 -0
- package/src/components/atoms/Nav/Nav.tsx +21 -0
- package/src/components/atoms/Nav/index.ts +1 -0
- package/src/components/atoms/Pill/Pill.stories.tsx +27 -0
- package/src/components/atoms/Pill/Pill.tsx +17 -0
- package/src/components/atoms/Pill/index.ts +1 -0
- package/src/components/atoms/Spinner/Spinner.stories.tsx +20 -0
- package/src/components/atoms/Spinner/Spinner.tsx +20 -0
- package/src/components/atoms/Spinner/index.ts +1 -0
- package/src/components/atoms/Typography/Body.stories.tsx +36 -0
- package/src/components/atoms/Typography/Body.tsx +16 -0
- package/src/components/atoms/Typography/Hero.stories.tsx +36 -0
- package/src/components/atoms/Typography/Hero.tsx +27 -0
- package/src/components/atoms/Typography/Label.stories.tsx +36 -0
- package/src/components/atoms/Typography/Label.tsx +43 -0
- package/src/components/atoms/Typography/index.ts +5 -0
- package/src/components/atoms/index.ts +11 -0
- package/src/components/molecules/Button/BasicButton.tsx +137 -0
- package/src/components/molecules/Button/Button.stories.tsx +74 -0
- package/src/components/molecules/Button/Button.test.tsx +63 -0
- package/src/components/molecules/Button/Button.tsx +180 -0
- package/src/components/molecules/Button/Ghost.tsx +75 -0
- package/src/components/molecules/Button/Primary.tsx +41 -0
- package/src/components/molecules/Button/__snapshots__/Button.test.tsx.snap +208 -0
- package/src/components/molecules/Button/index.ts +1 -0
- package/src/components/molecules/Checkbox/Checkbox.stories.tsx +33 -0
- package/src/components/molecules/Checkbox/Checkbox.tsx +147 -0
- package/src/components/molecules/Checkbox/index.tsx +1 -0
- package/src/components/molecules/Dropdown/Dropdown.stories.tsx +30 -0
- package/src/components/molecules/Dropdown/Dropdown.tsx +95 -0
- package/src/components/molecules/Dropdown/Option.tsx +5 -0
- package/src/components/molecules/Dropdown/index.ts +1 -0
- package/src/components/molecules/InfoCard/InfoCard.stories.tsx +32 -0
- package/src/components/molecules/InfoCard/InfoCard.tsx +69 -0
- package/src/components/molecules/InfoCard/index.tsx +1 -0
- package/src/components/molecules/Input/Input.stories.tsx +80 -0
- package/src/components/molecules/Input/Input.tsx +120 -0
- package/src/components/molecules/Input/index.ts +1 -0
- package/src/components/molecules/Profile/Profile.stories.tsx +32 -0
- package/src/components/molecules/Profile/Profile.test.tsx +19 -0
- package/src/components/molecules/Profile/Profile.tsx +60 -0
- package/src/components/molecules/Profile/index.ts +1 -0
- package/src/components/molecules/Radio/Radio.stories.tsx +37 -0
- package/src/components/molecules/Radio/Radio.test.tsx +43 -0
- package/src/components/molecules/Radio/Radio.tsx +203 -0
- package/src/components/molecules/Radio/__snapshots__/Radio.test.tsx.snap +82 -0
- package/src/components/molecules/Radio/index.tsx +1 -0
- package/src/components/molecules/TextArea/TextArea.stories.tsx +37 -0
- package/src/components/molecules/TextArea/TextArea.tsx +50 -0
- package/src/components/molecules/TextArea/index.ts +1 -0
- package/src/components/molecules/index.ts +8 -0
- package/src/components/organisms/Menu/Menu.stories.tsx +20 -0
- package/src/components/organisms/Menu/Menu.tsx +29 -0
- package/src/components/organisms/Menu/MenuItem.tsx +62 -0
- package/src/components/organisms/Menu/index.ts +1 -0
- package/src/components/organisms/Setting/Setting.stories.tsx +21 -0
- package/src/components/organisms/Setting/Setting.tsx +97 -0
- package/src/components/organisms/Setting/index.ts +1 -0
- package/src/components/organisms/index.ts +2 -0
- package/src/global.d.ts +6 -0
- package/src/helpers/validation.ts +31 -0
- package/src/index.ts +28 -0
- package/src/styles/colors.ts +30 -0
- package/src/styles/global.ts +94 -0
- package/src/styles/index.ts +2 -0
- package/src/types/validation.ts +1 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ValidationType } from '../../../types/validation';
|
3
|
+
import { Option } from './Option';
|
4
|
+
export interface DropdwonStaticProps {
|
5
|
+
Option: typeof Option;
|
6
|
+
}
|
7
|
+
export interface DropdownProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
8
|
+
validationType: ValidationType;
|
9
|
+
label?: string;
|
10
|
+
size: 'xl' | 'l' | 'm' | 's';
|
11
|
+
}
|
12
|
+
declare const DropdownWithStatic: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLSelectElement>> & {
|
13
|
+
Option: React.FC<{}>;
|
14
|
+
};
|
15
|
+
export { DropdownWithStatic as Dropdown };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("./Dropdown").DropdownProps & React.RefAttributes<HTMLSelectElement>> & {
|
4
|
+
Option: React.FC<{}>;
|
5
|
+
}>;
|
6
|
+
export default _default;
|
7
|
+
export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<import("./Dropdown").DropdownProps & React.RefAttributes<HTMLSelectElement>> & {
|
8
|
+
Option: React.FC<{}>;
|
9
|
+
}>;
|
10
|
+
export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<import("./Dropdown").DropdownProps & React.RefAttributes<HTMLSelectElement>> & {
|
11
|
+
Option: React.FC<{}>;
|
12
|
+
}>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Dropdown } from './Dropdown';
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
declare const _default: ComponentMeta<React.FC<import("./InfoCard").InfoCardProps>>;
|
4
|
+
export default _default;
|
5
|
+
export declare const Basic: ComponentStory<React.FC<import("./InfoCard").InfoCardProps>>;
|
6
|
+
export declare const WithBackground: ComponentStory<React.FC<import("./InfoCard").InfoCardProps>>;
|
7
|
+
export declare const Inversed: ComponentStory<React.FC<import("./InfoCard").InfoCardProps>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { InfoCard } from './InfoCard';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { FieldProps } from 'formik';
|
3
|
+
import { ValidationType } from '../../../types/validation';
|
4
|
+
import { IconType } from '../../atoms/Icon';
|
5
|
+
export declare type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> & FieldProps & {
|
6
|
+
label?: string;
|
7
|
+
validationType?: ValidationType;
|
8
|
+
icon?: IconType;
|
9
|
+
size?: 'xl' | 'l' | 'm' | 's';
|
10
|
+
direction?: 'ltr' | 'rtl';
|
11
|
+
onIconClick?: () => void;
|
12
|
+
};
|
13
|
+
export declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & FieldProps<any, any> & {
|
14
|
+
label?: string | undefined;
|
15
|
+
validationType?: ValidationType | undefined;
|
16
|
+
icon?: "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "close" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
17
|
+
size?: "xl" | "l" | "m" | "s" | undefined;
|
18
|
+
direction?: "ltr" | "rtl" | undefined;
|
19
|
+
onIconClick?: (() => void) | undefined;
|
20
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
4
|
+
label?: string | undefined;
|
5
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
6
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
7
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
8
|
+
direction?: "rtl" | "ltr" | undefined;
|
9
|
+
onIconClick?: (() => void) | undefined;
|
10
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
11
|
+
export default _default;
|
12
|
+
export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
13
|
+
label?: string | undefined;
|
14
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
15
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
16
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
17
|
+
direction?: "rtl" | "ltr" | undefined;
|
18
|
+
onIconClick?: (() => void) | undefined;
|
19
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
20
|
+
export declare const Success: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
21
|
+
label?: string | undefined;
|
22
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
23
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
24
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
25
|
+
direction?: "rtl" | "ltr" | undefined;
|
26
|
+
onIconClick?: (() => void) | undefined;
|
27
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
28
|
+
export declare const Error: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
29
|
+
label?: string | undefined;
|
30
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
31
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
32
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
33
|
+
direction?: "rtl" | "ltr" | undefined;
|
34
|
+
onIconClick?: (() => void) | undefined;
|
35
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
36
|
+
export declare const Disabled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
37
|
+
label?: string | undefined;
|
38
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
39
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
40
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
41
|
+
direction?: "rtl" | "ltr" | undefined;
|
42
|
+
onIconClick?: (() => void) | undefined;
|
43
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
44
|
+
export declare const IconLTR: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
45
|
+
label?: string | undefined;
|
46
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
47
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
48
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
49
|
+
direction?: "rtl" | "ltr" | undefined;
|
50
|
+
onIconClick?: (() => void) | undefined;
|
51
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
52
|
+
export declare const IconRTL: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
53
|
+
label?: string | undefined;
|
54
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
55
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
56
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
57
|
+
direction?: "rtl" | "ltr" | undefined;
|
58
|
+
onIconClick?: (() => void) | undefined;
|
59
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
60
|
+
export declare const DisabledIcon: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
61
|
+
label?: string | undefined;
|
62
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
63
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
64
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
65
|
+
direction?: "rtl" | "ltr" | undefined;
|
66
|
+
onIconClick?: (() => void) | undefined;
|
67
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
68
|
+
export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & import("formik").FieldProps<any, any> & {
|
69
|
+
label?: string | undefined;
|
70
|
+
validationType?: import("../../../types/validation").ValidationType | undefined;
|
71
|
+
icon?: "close" | "angle-down" | "arrow-left" | "bars" | "bell" | "check-circle" | "check-square" | "clipboad-notes" | "dice-five" | "edit" | "envelope" | "exclamation-circle" | "exclamation-triangle" | "exit" | "facebook" | "home" | "image-edit" | "instagram" | "linkedin" | "lock" | "minus" | "phone" | "plus" | "process" | "points-circle" | "redo" | "setting" | "user-circle" | "users" | undefined;
|
72
|
+
size?: "s" | "m" | "l" | "xl" | undefined;
|
73
|
+
direction?: "rtl" | "ltr" | undefined;
|
74
|
+
onIconClick?: (() => void) | undefined;
|
75
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Input } from './Input';
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
declare const _default: ComponentMeta<import("react").FC<Partial<{
|
4
|
+
src: string;
|
5
|
+
alt: string;
|
6
|
+
size?: "s" | "m" | "l" | "xl" | "xxl" | undefined;
|
7
|
+
} & {
|
8
|
+
children?: import("react").ReactNode;
|
9
|
+
}> & {
|
10
|
+
name: string;
|
11
|
+
children?: import("react").ReactNode;
|
12
|
+
}>>;
|
13
|
+
export default _default;
|
14
|
+
export declare const Basic: ComponentStory<import("react").FC<Partial<{
|
15
|
+
src: string;
|
16
|
+
alt: string;
|
17
|
+
size?: "s" | "m" | "l" | "xl" | "xxl" | undefined;
|
18
|
+
} & {
|
19
|
+
children?: import("react").ReactNode;
|
20
|
+
}> & {
|
21
|
+
name: string;
|
22
|
+
children?: import("react").ReactNode;
|
23
|
+
}>>;
|
24
|
+
export declare const WithInitials: ComponentStory<import("react").FC<Partial<{
|
25
|
+
src: string;
|
26
|
+
alt: string;
|
27
|
+
size?: "s" | "m" | "l" | "xl" | "xxl" | undefined;
|
28
|
+
} & {
|
29
|
+
children?: import("react").ReactNode;
|
30
|
+
}> & {
|
31
|
+
name: string;
|
32
|
+
children?: import("react").ReactNode;
|
33
|
+
}>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Profile } from './Profile';
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare enum Size {
|
3
|
+
xl = "xl",
|
4
|
+
l = "l",
|
5
|
+
m = "m",
|
6
|
+
s = "s"
|
7
|
+
}
|
8
|
+
export declare type RadioProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> & {
|
9
|
+
size?: Size;
|
10
|
+
label?: string;
|
11
|
+
};
|
12
|
+
export declare const Radio: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
13
|
+
size?: Size | undefined;
|
14
|
+
label?: string | undefined;
|
15
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
3
|
+
import { Size } from './Radio';
|
4
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
5
|
+
size?: Size | undefined;
|
6
|
+
label?: string | undefined;
|
7
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
8
|
+
export default _default;
|
9
|
+
export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
10
|
+
size?: Size | undefined;
|
11
|
+
label?: string | undefined;
|
12
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
13
|
+
export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
14
|
+
size?: Size | undefined;
|
15
|
+
label?: string | undefined;
|
16
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
17
|
+
export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
18
|
+
size?: Size | undefined;
|
19
|
+
label?: string | undefined;
|
20
|
+
} & React.RefAttributes<HTMLInputElement>>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Radio } from './Radio';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ValidationType } from '../../../types/validation';
|
3
|
+
export interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
4
|
+
validationType?: ValidationType;
|
5
|
+
}
|
6
|
+
export declare const TextArea: React.FC<TextAreaProps>;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
declare const _default: ComponentMeta<React.FC<import("./TextArea").TextAreaProps>>;
|
4
|
+
export default _default;
|
5
|
+
export declare const Basic: ComponentStory<React.FC<import("./TextArea").TextAreaProps>>;
|
6
|
+
export declare const Success: ComponentStory<React.FC<import("./TextArea").TextAreaProps>>;
|
7
|
+
export declare const Error: ComponentStory<React.FC<import("./TextArea").TextAreaProps>>;
|
8
|
+
export declare const Disabled: ComponentStory<React.FC<import("./TextArea").TextAreaProps>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { TextArea } from './TextArea';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export { InfoCard } from './InfoCard';
|
2
|
+
export { Input } from './Input';
|
3
|
+
export { TextArea } from './TextArea';
|
4
|
+
export { Button } from './Button';
|
5
|
+
export { Checkbox } from './Checkbox';
|
6
|
+
export { Dropdown } from './Dropdown';
|
7
|
+
export { Radio } from './Radio';
|
8
|
+
export { Profile } from './Profile';
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { MenuItem } from './MenuItem';
|
3
|
+
export interface MenuStaticProps {
|
4
|
+
Item: typeof MenuItem;
|
5
|
+
}
|
6
|
+
export interface MenuProps {
|
7
|
+
children: React.ReactNode;
|
8
|
+
}
|
9
|
+
declare const MenuWithStatic: React.FC<MenuProps> & {
|
10
|
+
Item: React.FC<import("./MenuItem").MenuItemProps>;
|
11
|
+
};
|
12
|
+
export { MenuWithStatic as Menu };
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
declare const _default: ComponentMeta<React.FC<import("./Menu").MenuProps> & {
|
4
|
+
Item: React.FC<import("./MenuItem").MenuItemProps>;
|
5
|
+
}>;
|
6
|
+
export default _default;
|
7
|
+
export declare const Basic: ComponentStory<React.FC<import("./Menu").MenuProps> & {
|
8
|
+
Item: React.FC<import("./MenuItem").MenuItemProps>;
|
9
|
+
}>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IconType } from '../../atoms/Icon';
|
3
|
+
export interface MenuItemProps {
|
4
|
+
active?: boolean;
|
5
|
+
label: string;
|
6
|
+
icon: IconType;
|
7
|
+
}
|
8
|
+
export declare const MenuItem: React.FC<MenuItemProps>;
|
9
|
+
export declare const Root: import("styled-components").StyledComponent<"div", any, Pick<MenuItemProps, "active">, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Menu } from './Menu';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { IconType } from "../../atoms/Icon";
|
3
|
+
export interface SettingProps {
|
4
|
+
icon?: IconType;
|
5
|
+
title: string;
|
6
|
+
subtitle?: string;
|
7
|
+
trigger: string;
|
8
|
+
children?: React.ReactNode;
|
9
|
+
}
|
10
|
+
export declare const Setting: React.FCS<SettingProps>;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
declare const _default: ComponentMeta<React.FCS<import("./Setting").SettingProps>>;
|
4
|
+
export default _default;
|
5
|
+
export declare const Basic: ComponentStory<React.FCS<import("./Setting").SettingProps>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Setting } from './Setting';
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export { Alert, Avatar, Card, Divider, Icon, Nav, Pill, Typography, Spinner, Chip, Dot, } from "./components/atoms";
|
2
|
+
export { InfoCard, Input, TextArea, Button, Checkbox, Dropdown, Profile, Radio, } from "./components/molecules";
|
3
|
+
export { Menu, Setting } from "./components/organisms";
|
4
|
+
export { GlobalStyles as IntegrigoUI, Color } from "./styles";
|
@@ -0,0 +1,24 @@
|
|
1
|
+
export declare enum Color {
|
2
|
+
White = "#FFF",
|
3
|
+
Ecru = "#F9F1E5",
|
4
|
+
Navy = "#172142",
|
5
|
+
Orange = "#E09A33",
|
6
|
+
Red = "#CF544B",
|
7
|
+
Green = "#6B8B4A",
|
8
|
+
Grey100 = "#1A1A1A",
|
9
|
+
Grey80 = "#595959",
|
10
|
+
Grey60 = "#8C8C8C",
|
11
|
+
Grey40 = "#CCCCCC",
|
12
|
+
Grey20 = "#F2F2F2",
|
13
|
+
Grey0 = "#fff",
|
14
|
+
Success100 = "#6B8B4A",
|
15
|
+
Success20 = "#DDE4D7",
|
16
|
+
Success10 = "#ECEFE8",
|
17
|
+
Error100 = "#CF544B",
|
18
|
+
Error20 = "#FFCCCC",
|
19
|
+
Error10 = "#FFF5F5"
|
20
|
+
}
|
21
|
+
export declare enum ShadesOfGrey {
|
22
|
+
}
|
23
|
+
export declare enum SuccessColors {
|
24
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const GlobalStyles: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare type ValidationType = 'success' | 'error';
|
package/package.json
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
module.exports = {
|
2
|
+
"stories": [
|
3
|
+
"../components/**/*.stories.mdx",
|
4
|
+
"../components/**/*.stories.@(js|jsx|ts|tsx)"
|
5
|
+
],
|
6
|
+
"addons": [
|
7
|
+
"@storybook/addon-links",
|
8
|
+
"@storybook/addon-essentials",
|
9
|
+
"@storybook/addon-interactions"
|
10
|
+
],
|
11
|
+
"framework": "@storybook/react"
|
12
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { GlobalStyles } from '../styles'
|
2
|
+
|
3
|
+
export const parameters = {
|
4
|
+
actions: { argTypesRegex: "^on[A-Z].*" },
|
5
|
+
controls: {
|
6
|
+
matchers: {
|
7
|
+
color: /(background|color)$/i,
|
8
|
+
date: /Date$/,
|
9
|
+
},
|
10
|
+
},
|
11
|
+
}
|
12
|
+
|
13
|
+
export const decorators = [
|
14
|
+
(Story) => (
|
15
|
+
<>
|
16
|
+
<GlobalStyles/>
|
17
|
+
<Story />
|
18
|
+
</>
|
19
|
+
),
|
20
|
+
];
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
|
4
|
+
import { Alert } from './Alert';
|
5
|
+
|
6
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
7
|
+
export default {
|
8
|
+
title: 'Atoms/Alert',
|
9
|
+
component: Alert,
|
10
|
+
} as ComponentMeta<typeof Alert>;
|
11
|
+
|
12
|
+
const Template: ComponentStory<typeof Alert> = (args) => (
|
13
|
+
<Alert {...args}>Content</Alert>
|
14
|
+
);
|
15
|
+
|
16
|
+
export const Basic = Template.bind({});
|
17
|
+
Basic.args = {
|
18
|
+
type: 'info',
|
19
|
+
};
|
20
|
+
|
21
|
+
export const Controlled = Template.bind({});
|
22
|
+
Controlled.args = {
|
23
|
+
type: 'info',
|
24
|
+
controlled: true,
|
25
|
+
open: true,
|
26
|
+
};
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { Color } from '../../../styles';
|
4
|
+
import { fieldSizeVariants } from '../Field';
|
5
|
+
import { Icon, IconType } from '../Icon';
|
6
|
+
|
7
|
+
export interface AlertProps {
|
8
|
+
type: 'error' | 'success' | 'info' | 'warning';
|
9
|
+
open?: boolean;
|
10
|
+
controlled?: boolean;
|
11
|
+
size?: 'xl' | 'l' | 'm' | 's';
|
12
|
+
onClose?: () => void;
|
13
|
+
children: React.ReactNode;
|
14
|
+
}
|
15
|
+
|
16
|
+
const colorVariants = {
|
17
|
+
error: {
|
18
|
+
background: Color.Error10,
|
19
|
+
color: Color.Error100,
|
20
|
+
},
|
21
|
+
warning: {
|
22
|
+
background: Color.Grey0,
|
23
|
+
color: Color.Orange,
|
24
|
+
},
|
25
|
+
info: {
|
26
|
+
background: Color.Grey0,
|
27
|
+
color: Color.Navy,
|
28
|
+
},
|
29
|
+
success: {
|
30
|
+
background: Color.Grey0,
|
31
|
+
color: Color.Green,
|
32
|
+
},
|
33
|
+
};
|
34
|
+
|
35
|
+
const iconVariants: Record<AlertProps['type'], IconType> = {
|
36
|
+
error: 'exclamation-circle',
|
37
|
+
warning: 'exclamation-triangle',
|
38
|
+
info: 'exclamation-circle',
|
39
|
+
success: 'check-circle',
|
40
|
+
};
|
41
|
+
|
42
|
+
export const Alert: React.FC<AlertProps> = ({
|
43
|
+
type = 'info',
|
44
|
+
open = true,
|
45
|
+
size = 'm',
|
46
|
+
controlled = false,
|
47
|
+
onClose,
|
48
|
+
children,
|
49
|
+
}) => {
|
50
|
+
if (!open && controlled) {
|
51
|
+
return null;
|
52
|
+
}
|
53
|
+
|
54
|
+
return (
|
55
|
+
<AlertWrapper type={type} sizeVariant={size}>
|
56
|
+
<Icon
|
57
|
+
fill={colorVariants[type].color}
|
58
|
+
size="ultra-small"
|
59
|
+
type={iconVariants[type]}
|
60
|
+
/>{' '}
|
61
|
+
{children}
|
62
|
+
{controlled && (
|
63
|
+
<CloseIcon>
|
64
|
+
<Icon
|
65
|
+
size="ultra-small"
|
66
|
+
type="close"
|
67
|
+
fill={Color.Grey60}
|
68
|
+
onClick={onClose}
|
69
|
+
/>
|
70
|
+
</CloseIcon>
|
71
|
+
)}
|
72
|
+
</AlertWrapper>
|
73
|
+
);
|
74
|
+
};
|
75
|
+
|
76
|
+
const AlertWrapper = styled.div<{
|
77
|
+
type: 'error' | 'success' | 'info' | 'warning';
|
78
|
+
sizeVariant: 'xl' | 'l' | 'm' | 's';
|
79
|
+
}>`
|
80
|
+
width: 100%;
|
81
|
+
border-radius: 5px;
|
82
|
+
color: ${(p) => colorVariants[p.type].color};
|
83
|
+
background-color: ${(p) => colorVariants[p.type].background};
|
84
|
+
padding: var(--padding-s);
|
85
|
+
font-weight: var(--font-bold);
|
86
|
+
font-size: ${(p) => fieldSizeVariants[p.sizeVariant].font};
|
87
|
+
display: flex;
|
88
|
+
align-items: center;
|
89
|
+
gap: 12px;
|
90
|
+
margin-top: var(--padding-s);
|
91
|
+
`;
|
92
|
+
|
93
|
+
const CloseIcon = styled.div`
|
94
|
+
flex: 1;
|
95
|
+
display: flex;
|
96
|
+
align-items: center;
|
97
|
+
justify-content: flex-end;
|
98
|
+
|
99
|
+
& > svg {
|
100
|
+
transition: fill var(--transition-speed);
|
101
|
+
}
|
102
|
+
|
103
|
+
& > svg:hover {
|
104
|
+
cursor: pointer;
|
105
|
+
fill: var(--shades-of-grey-100);
|
106
|
+
}
|
107
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Alert } from './Alert';
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
+
|
4
|
+
import { Avatar } from './Avatar';
|
5
|
+
|
6
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
7
|
+
export default {
|
8
|
+
title: 'Atoms/Avatar',
|
9
|
+
component: Avatar,
|
10
|
+
argTypes: {
|
11
|
+
size: {
|
12
|
+
control: 'select',
|
13
|
+
options: ['s', 'm', 'l', 'xl', 'xxl'],
|
14
|
+
defaultValue: 'm',
|
15
|
+
},
|
16
|
+
},
|
17
|
+
} as ComponentMeta<typeof Avatar>;
|
18
|
+
|
19
|
+
const Template: ComponentStory<typeof Avatar> = (args) => <Avatar {...args} />;
|
20
|
+
|
21
|
+
export const Basic = Template.bind({});
|
22
|
+
Basic.args = {
|
23
|
+
src: 'https://img.freepik.com/darmowe-zdjecie/dosc-usmiechnieta-radosnie-kobieta-o-jasnych-wlosach-ubrana-swobodnie-wygladajaca-z-zadowoleniem_176420-15187.jpg?w=1380&t=st=1660198496~exp=1660199096~hmac=7401572065d2cd7bb67d9f43dbde5c116b90aad419b179fffac1196df24869f2',
|
24
|
+
alt: 'Jane Doe',
|
25
|
+
};
|