@integrigo/integrigo-ui 1.6.18-d → 1.6.18-f
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/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/index.js.map +1 -1
- package/lib/src/components/molecules/Checkbox/Checkbox.stories.d.ts +4 -4
- package/lib/src/components/molecules/IconButton/IconButton.d.ts +1 -1
- package/lib/src/components/molecules/Radio/Radio.stories.d.ts +4 -4
- package/lib/src/components/organisms/Comment/Comment.d.ts +11 -0
- package/lib/src/components/organisms/Comment/Comment.stories.d.ts +4 -0
- package/lib/src/components/organisms/Comment/index.d.ts +1 -0
- package/lib/src/components/organisms/index.d.ts +1 -0
- package/lib/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/molecules/IconButton/IconButton.tsx +28 -4
- package/src/components/organisms/Comment/Comment.stories.tsx +29 -0
- package/src/components/organisms/Comment/Comment.tsx +60 -0
- package/src/components/organisms/Comment/index.ts +1 -0
- package/src/components/organisms/index.ts +2 -1
- package/src/index.ts +8 -1
@@ -1,19 +1,19 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
3
|
-
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
3
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
4
4
|
size?: "s" | "m" | "l" | "xl" | undefined;
|
5
5
|
label?: string | undefined;
|
6
6
|
} & React.RefAttributes<HTMLInputElement>>>;
|
7
7
|
export default _default;
|
8
|
-
export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
8
|
+
export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
9
9
|
size?: "s" | "m" | "l" | "xl" | undefined;
|
10
10
|
label?: string | undefined;
|
11
11
|
} & React.RefAttributes<HTMLInputElement>>>;
|
12
|
-
export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
12
|
+
export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
13
13
|
size?: "s" | "m" | "l" | "xl" | undefined;
|
14
14
|
label?: string | undefined;
|
15
15
|
} & React.RefAttributes<HTMLInputElement>>>;
|
16
|
-
export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
16
|
+
export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
17
17
|
size?: "s" | "m" | "l" | "xl" | undefined;
|
18
18
|
label?: string | undefined;
|
19
19
|
} & React.RefAttributes<HTMLInputElement>>>;
|
@@ -1,20 +1,20 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
3
3
|
import { Size } from './Radio';
|
4
|
-
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
4
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
5
5
|
size?: Size | undefined;
|
6
6
|
label?: string | undefined;
|
7
7
|
} & React.RefAttributes<HTMLInputElement>>>;
|
8
8
|
export default _default;
|
9
|
-
export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
9
|
+
export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
10
10
|
size?: Size | undefined;
|
11
11
|
label?: string | undefined;
|
12
12
|
} & React.RefAttributes<HTMLInputElement>>>;
|
13
|
-
export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
13
|
+
export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
14
14
|
size?: Size | undefined;
|
15
15
|
label?: string | undefined;
|
16
16
|
} & React.RefAttributes<HTMLInputElement>>>;
|
17
|
-
export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
17
|
+
export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
18
18
|
size?: Size | undefined;
|
19
19
|
label?: string | undefined;
|
20
20
|
} & React.RefAttributes<HTMLInputElement>>>;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
2
|
+
declare const _default: ComponentMeta<import("react").FCS<import("./Comment").CommentProps>>;
|
3
|
+
export default _default;
|
4
|
+
export declare const Basic: ComponentStory<import("react").FCS<import("./Comment").CommentProps>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Comment } from './Comment';
|
package/lib/src/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
export { Alert, Avatar, Card, Divider, DateTime, Icon, Nav, Pill, Typography, Spinner, Chip, Dot, Gradient, } from "./components/atoms";
|
2
2
|
export { InfoCard, Input, TextArea, Button, Checkbox, Dropdown, Profile, Radio, Tile, Switch, IconButton, } from "./components/molecules";
|
3
|
-
export { Menu, Setting, Modal, Select, Table } from "./components/organisms";
|
3
|
+
export { Menu, Setting, Modal, Select, Table, Comment, } from "./components/organisms";
|
4
4
|
export { GlobalStyles as IntegrigoUI, Color } from "./styles";
|
package/package.json
CHANGED
@@ -4,7 +4,8 @@ import { Color } from "../../../styles";
|
|
4
4
|
import { Icon } from "../../atoms";
|
5
5
|
import { IconType } from "../../atoms/Icon";
|
6
6
|
|
7
|
-
export interface IconButtonProps
|
7
|
+
export interface IconButtonProps
|
8
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
8
9
|
size?: "m" | "l";
|
9
10
|
icon: IconType;
|
10
11
|
}
|
@@ -14,12 +15,21 @@ const sizeVariant = {
|
|
14
15
|
l: 48,
|
15
16
|
};
|
16
17
|
|
17
|
-
export const IconButton: React.FC<IconButtonProps> = ({
|
18
|
+
export const IconButton: React.FC<IconButtonProps> = ({
|
19
|
+
size = "m",
|
20
|
+
icon,
|
21
|
+
...props
|
22
|
+
}) => {
|
18
23
|
const iconSize = (5 / 9) * sizeVariant[size];
|
19
24
|
|
20
25
|
return (
|
21
|
-
<Root size={size}>
|
22
|
-
<Icon
|
26
|
+
<Root size={size} {...props}>
|
27
|
+
<Icon
|
28
|
+
type={icon}
|
29
|
+
width={iconSize}
|
30
|
+
height={iconSize}
|
31
|
+
fill={Color.Orange}
|
32
|
+
/>
|
23
33
|
</Root>
|
24
34
|
);
|
25
35
|
};
|
@@ -27,10 +37,24 @@ export const IconButton: React.FC<IconButtonProps> = ({ size = "m", icon }) => {
|
|
27
37
|
const Root = styled.button<{ size: "m" | "l" }>`
|
28
38
|
border: none;
|
29
39
|
display: flex;
|
40
|
+
cursor: pointer;
|
30
41
|
align-items: center;
|
31
42
|
justify-content: center;
|
32
43
|
width: ${(p) => sizeVariant[p.size]}px;
|
33
44
|
height: ${(p) => sizeVariant[p.size]}px;
|
34
45
|
border-radius: calc(${(p) => sizeVariant[p.size]}px / 2);
|
35
46
|
background-color: var(--color-ecru);
|
47
|
+
transition: background-color var(--transition-speed);
|
48
|
+
|
49
|
+
& svg {
|
50
|
+
transition: fill var(--transition-speed);
|
51
|
+
}
|
52
|
+
|
53
|
+
&:hover {
|
54
|
+
background-color: var(--color-orange);
|
55
|
+
|
56
|
+
& svg {
|
57
|
+
fill: var(--color-ecru);
|
58
|
+
}
|
59
|
+
}
|
36
60
|
`;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
2
|
+
|
3
|
+
import { Comment } from "./Comment";
|
4
|
+
|
5
|
+
export default {
|
6
|
+
title: "Organisms/Comment",
|
7
|
+
component: Comment,
|
8
|
+
argTypes: {
|
9
|
+
show: {
|
10
|
+
control: "boolean",
|
11
|
+
defaultValue: true,
|
12
|
+
},
|
13
|
+
},
|
14
|
+
} as ComponentMeta<typeof Comment>;
|
15
|
+
|
16
|
+
const Template: ComponentStory<typeof Comment> = (args) => (
|
17
|
+
<Comment {...args} />
|
18
|
+
);
|
19
|
+
|
20
|
+
export const Basic = Template.bind({});
|
21
|
+
Basic.args = {
|
22
|
+
avatar: {
|
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
|
+
},
|
26
|
+
body: "Comment body goes here!",
|
27
|
+
author: "Jane Doe",
|
28
|
+
createdAt: new Date(),
|
29
|
+
};
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import styled from "styled-components";
|
3
|
+
import { Avatar, DateTime, Typography } from "../../atoms";
|
4
|
+
|
5
|
+
export interface CommentProps {
|
6
|
+
avatar: {
|
7
|
+
src: string;
|
8
|
+
alt: string;
|
9
|
+
};
|
10
|
+
body: string;
|
11
|
+
author: string;
|
12
|
+
createdAt: Date;
|
13
|
+
}
|
14
|
+
|
15
|
+
export const Comment: React.FCS<CommentProps> = ({
|
16
|
+
avatar,
|
17
|
+
body,
|
18
|
+
author,
|
19
|
+
createdAt,
|
20
|
+
className,
|
21
|
+
}) => {
|
22
|
+
return (
|
23
|
+
<Root className={className}>
|
24
|
+
<Avatar {...avatar} />
|
25
|
+
|
26
|
+
<NameAndDate>
|
27
|
+
<Typography.Hero size="s">{author}</Typography.Hero>
|
28
|
+
<DateTime date={createdAt} />
|
29
|
+
</NameAndDate>
|
30
|
+
|
31
|
+
<div />
|
32
|
+
|
33
|
+
<Typography.Body>{body}</Typography.Body>
|
34
|
+
</Root>
|
35
|
+
);
|
36
|
+
};
|
37
|
+
|
38
|
+
const Root = styled.div`
|
39
|
+
display: grid;
|
40
|
+
grid-template-columns: 32px auto;
|
41
|
+
grid-template-rows: 32px auto;
|
42
|
+
column-gap: var(--padding-m);
|
43
|
+
row-gap: var(--padding-m);
|
44
|
+
|
45
|
+
& > p {
|
46
|
+
margin: 0;
|
47
|
+
}
|
48
|
+
`;
|
49
|
+
|
50
|
+
const NameAndDate = styled.div`
|
51
|
+
display: flex;
|
52
|
+
justify-content: space-between;
|
53
|
+
align-items: center;
|
54
|
+
flex-wrap: wrap;
|
55
|
+
|
56
|
+
& > h5 {
|
57
|
+
margin: 0;
|
58
|
+
color: var(--color-orange);
|
59
|
+
}
|
60
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Comment } from './Comment'
|
package/src/index.ts
CHANGED
@@ -28,6 +28,13 @@ export {
|
|
28
28
|
IconButton,
|
29
29
|
} from "./components/molecules";
|
30
30
|
|
31
|
-
export {
|
31
|
+
export {
|
32
|
+
Menu,
|
33
|
+
Setting,
|
34
|
+
Modal,
|
35
|
+
Select,
|
36
|
+
Table,
|
37
|
+
Comment,
|
38
|
+
} from "./components/organisms";
|
32
39
|
|
33
40
|
export { GlobalStyles as IntegrigoUI, Color } from "./styles";
|