pge-front-common 2.0.0 → 3.0.0
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/lib/components/Button/Button.d.ts +7 -27
- package/lib/components/Button/Button.stories.d.ts +4 -19
- package/lib/components/Button/styles.d.ts +3 -0
- package/lib/components/Input/Input.stories.d.ts +8 -0
- package/lib/components/Input/index.d.ts +4 -0
- package/lib/components/Input/index.types.d.ts +11 -0
- package/lib/components/Input/styles.d.ts +15 -0
- package/lib/components/Modal/Modal.d.ts +8 -0
- package/lib/components/Modal/Modal.stories.d.ts +31 -0
- package/lib/components/Modal/ModalConfirm/ModalConfirm.stories.d.ts +17 -0
- package/lib/components/Modal/ModalConfirm/index.d.ts +8 -0
- package/lib/components/Modal/ModalConfirm/styles.d.ts +1 -0
- package/lib/components/Modal/styles.d.ts +8 -0
- package/lib/components/Select/Select.stories.d.ts +8 -0
- package/lib/components/Select/index.d.ts +4 -0
- package/lib/components/Select/index.types.d.ts +22 -0
- package/lib/components/Select/styles.d.ts +25 -0
- package/lib/components/theme.d.ts +3 -0
- package/lib/icons/add-cell-icon.d.ts +2 -0
- package/lib/icons/add-icon.d.ts +2 -0
- package/lib/icons/arrow-expland-icon.d.ts +2 -0
- package/lib/icons/arrow-to-recall-icon.d.ts +2 -0
- package/lib/icons/calendar-icon.d.ts +2 -0
- package/lib/icons/check-circle-icon.d.ts +2 -0
- package/lib/icons/circle-expland-icon.d.ts +2 -0
- package/lib/icons/circle-to-recall-icon.d.ts +2 -0
- package/lib/icons/close-icon.d.ts +2 -0
- package/lib/icons/delete-icon.d.ts +2 -0
- package/lib/icons/download-icon.d.ts +2 -0
- package/lib/icons/edit-icon.d.ts +2 -0
- package/lib/icons/event-avaliable-icon.d.ts +2 -0
- package/lib/icons/icons.stories.d.ts +5 -0
- package/{src/icons/index.ts → lib/icons/index.d.ts} +24 -49
- package/lib/icons/logout-icon.d.ts +2 -0
- package/lib/icons/new-tab-icon.d.ts +2 -0
- package/lib/icons/pdf-icon.d.ts +2 -0
- package/lib/icons/profile-icon.d.ts +2 -0
- package/lib/icons/remove-icon.d.ts +2 -0
- package/lib/icons/swap-icon.d.ts +2 -0
- package/lib/icons/triangle-expand-icon.d.ts +2 -0
- package/lib/icons/triangle-to-recall-icon.d.ts +2 -0
- package/lib/icons/upload-icon.d.ts +2 -0
- package/lib/icons/visibillity-icon.d.ts +2 -0
- package/lib/icons/warning-icon.d.ts +2 -0
- package/lib/index.d.ts +62 -28
- package/lib/index.esm.js +3138 -28
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3178 -26
- package/lib/index.js.map +1 -1
- package/package.json +9 -3
- package/.storybook/main.ts +0 -22
- package/.storybook/preview.ts +0 -25
- package/rollup.config.mjs +0 -46
- package/src/components/Button/Button.stories.tsx +0 -50
- package/src/components/Button/Button.tsx +0 -28
- package/src/components/Button/styles.tsx +0 -39
- package/src/components/Modal/Modal.stories.tsx +0 -62
- package/src/components/Modal/Modal.tsx +0 -42
- package/src/components/Modal/ModalConfirm/ModalConfirm.stories.tsx +0 -48
- package/src/components/Modal/ModalConfirm/index.tsx +0 -32
- package/src/components/Modal/ModalConfirm/styles.tsx +0 -9
- package/src/components/Modal/styles.tsx +0 -75
- package/src/components/theme.ts +0 -24
- package/src/icons/add-cell-icon.tsx +0 -17
- package/src/icons/add-icon.tsx +0 -17
- package/src/icons/arrow-expland-icon.tsx +0 -17
- package/src/icons/arrow-to-recall-icon.tsx +0 -17
- package/src/icons/calendar-icon.tsx +0 -17
- package/src/icons/check-circle-icon.tsx +0 -17
- package/src/icons/circle-expland-icon.tsx +0 -17
- package/src/icons/circle-to-recall-icon.tsx +0 -17
- package/src/icons/close-icon.tsx +0 -17
- package/src/icons/delete-icon.tsx +0 -17
- package/src/icons/download-icon.tsx +0 -17
- package/src/icons/edit-icon.tsx +0 -17
- package/src/icons/event-avaliable-icon.tsx +0 -17
- package/src/icons/icons.stories.tsx +0 -92
- package/src/icons/logout-icon.tsx +0 -17
- package/src/icons/new-tab-icon.tsx +0 -17
- package/src/icons/pdf-icon.tsx +0 -17
- package/src/icons/profile-icon.tsx +0 -17
- package/src/icons/remove-icon.tsx +0 -14
- package/src/icons/swap-icon.tsx +0 -17
- package/src/icons/triangle-expand-icon.tsx +0 -14
- package/src/icons/triangle-to-recall-icon.tsx +0 -14
- package/src/icons/upload-icon.tsx +0 -17
- package/src/icons/visibillity-icon.tsx +0 -17
- package/src/icons/warning-icon.tsx +0 -17
- package/src/index.ts +0 -56
- package/src/styled-components.d.ts +0 -25
- package/tsconfig.json +0 -23
package/package.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"devDependencies": {
|
|
3
3
|
"@chromatic-com/storybook": "^1.6.0",
|
|
4
4
|
"@radix-ui/react-alert-dialog": "^1.1.1",
|
|
5
|
+
"@rollup/plugin-alias": "^5.1.0",
|
|
6
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
5
7
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
6
8
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
7
9
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
@@ -29,21 +31,25 @@
|
|
|
29
31
|
"react": "^18.2.0",
|
|
30
32
|
"react-dom": "^18.2.0"
|
|
31
33
|
},
|
|
34
|
+
"files": [
|
|
35
|
+
"lib"
|
|
36
|
+
],
|
|
32
37
|
"scripts": {
|
|
33
38
|
"storybook": "storybook dev -p 6006",
|
|
34
39
|
"build-storybook": "storybook build",
|
|
35
|
-
"build": "rollup -c"
|
|
40
|
+
"build": "rollup -c rollup.config.cjs"
|
|
36
41
|
},
|
|
37
42
|
"main": "lib/index.js",
|
|
38
43
|
"module": "lib/index.esm.js",
|
|
39
44
|
"types": "lib/index.d.ts",
|
|
40
45
|
"name": "pge-front-common",
|
|
41
|
-
"version": "
|
|
46
|
+
"version": "3.0.0",
|
|
42
47
|
"description": "",
|
|
43
48
|
"keywords": [],
|
|
44
49
|
"author": "sturmer cesar",
|
|
45
50
|
"license": "ISC",
|
|
46
51
|
"dependencies": {
|
|
47
|
-
"styled-components": "^6.1.11"
|
|
52
|
+
"styled-components": "^6.1.11",
|
|
53
|
+
"tslib": "^2.3.1"
|
|
48
54
|
}
|
|
49
55
|
}
|
package/.storybook/main.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { StorybookConfig } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
const config: StorybookConfig = {
|
|
4
|
-
stories: [
|
|
5
|
-
// "../stories/**/*.mdx",
|
|
6
|
-
// "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
|
|
7
|
-
"../src/**/*.stories.tsx",
|
|
8
|
-
],
|
|
9
|
-
addons: [
|
|
10
|
-
"@storybook/addon-onboarding",
|
|
11
|
-
"@storybook/addon-links",
|
|
12
|
-
"@storybook/addon-essentials",
|
|
13
|
-
"@chromatic-com/storybook",
|
|
14
|
-
"@storybook/addon-interactions",
|
|
15
|
-
"@storybook/addon-themes",
|
|
16
|
-
],
|
|
17
|
-
framework: {
|
|
18
|
-
name: "@storybook/react-vite",
|
|
19
|
-
options: {},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
export default config;
|
package/.storybook/preview.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// .storybook/preview.jsx
|
|
2
|
-
import { createGlobalStyle, ThemeProvider } from "styled-components";
|
|
3
|
-
import { withThemeFromJSXProvider } from "@storybook/addon-themes";
|
|
4
|
-
|
|
5
|
-
import theme from "../src/components/theme";
|
|
6
|
-
|
|
7
|
-
const GlobalStyle = createGlobalStyle`
|
|
8
|
-
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');
|
|
9
|
-
body {
|
|
10
|
-
font-family: 'Open Sans', sans-serif !;
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
/* snipped for brevity */
|
|
15
|
-
|
|
16
|
-
export const decorators = [
|
|
17
|
-
withThemeFromJSXProvider({
|
|
18
|
-
themes: {
|
|
19
|
-
default: theme,
|
|
20
|
-
},
|
|
21
|
-
defaultTheme: "default",
|
|
22
|
-
Provider: ThemeProvider,
|
|
23
|
-
GlobalStyles: GlobalStyle,
|
|
24
|
-
}),
|
|
25
|
-
];
|
package/rollup.config.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import peerDepsExternal from "rollup-plugin-peer-deps-external";
|
|
2
|
-
import resolve from "@rollup/plugin-node-resolve";
|
|
3
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
4
|
-
import typescript from "@rollup/plugin-typescript";
|
|
5
|
-
import postcss from "rollup-plugin-postcss";
|
|
6
|
-
import dts from "rollup-plugin-dts";
|
|
7
|
-
|
|
8
|
-
// This is required to read package.json file when
|
|
9
|
-
// using Native ES modules in Node.js
|
|
10
|
-
// https://rollupjs.org/command-line-interface/#importing-package-json
|
|
11
|
-
import { createRequire } from "node:module";
|
|
12
|
-
const requireFile = createRequire(import.meta.url);
|
|
13
|
-
const packageJson = requireFile("./package.json");
|
|
14
|
-
|
|
15
|
-
export default [
|
|
16
|
-
{
|
|
17
|
-
input: "src/index.ts",
|
|
18
|
-
output: [
|
|
19
|
-
{
|
|
20
|
-
file: packageJson.main,
|
|
21
|
-
format: "cjs",
|
|
22
|
-
sourcemap: true,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
file: packageJson.module,
|
|
26
|
-
format: "esm",
|
|
27
|
-
sourcemap: true,
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
plugins: [
|
|
31
|
-
peerDepsExternal(),
|
|
32
|
-
resolve(),
|
|
33
|
-
commonjs(),
|
|
34
|
-
typescript(),
|
|
35
|
-
postcss({
|
|
36
|
-
extensions: [".css"],
|
|
37
|
-
}),
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
input: "lib/index.d.ts",
|
|
42
|
-
output: [{ file: "lib/index.d.ts", format: "es" }],
|
|
43
|
-
plugins: [dts()],
|
|
44
|
-
external: [/\.css$/],
|
|
45
|
-
},
|
|
46
|
-
];
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { fn } from "@storybook/test";
|
|
3
|
-
import { Button } from "./Button";
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Button> = {
|
|
6
|
-
title: "Example/Button",
|
|
7
|
-
component: Button,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "centered",
|
|
10
|
-
},
|
|
11
|
-
tags: ["autodocs"],
|
|
12
|
-
argTypes: {
|
|
13
|
-
variant: {
|
|
14
|
-
control: { type: "select" },
|
|
15
|
-
options: ["primary", "secondary"],
|
|
16
|
-
},
|
|
17
|
-
text: { control: "text" },
|
|
18
|
-
leftIcon: { control: "text" },
|
|
19
|
-
onClick: { action: "clicked" },
|
|
20
|
-
},
|
|
21
|
-
args: {
|
|
22
|
-
onClick: fn(),
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
|
|
28
|
-
type Story = StoryObj<typeof meta>;
|
|
29
|
-
|
|
30
|
-
export const Primary: Story = {
|
|
31
|
-
args: {
|
|
32
|
-
variant: "primary",
|
|
33
|
-
text: "Primary Button",
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const Secondary: Story = {
|
|
38
|
-
args: {
|
|
39
|
-
variant: "secondary",
|
|
40
|
-
text: "Secondary Button",
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const WithIcon: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
variant: "primary",
|
|
47
|
-
text: "Button with Icon",
|
|
48
|
-
leftIcon: "⭐", // You can use any ReactNode, here we use a simple star emoji for demonstration
|
|
49
|
-
},
|
|
50
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes } from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import * as s from "./styles";
|
|
4
|
-
|
|
5
|
-
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
-
variant: "primary" | "secondary";
|
|
7
|
-
text: string;
|
|
8
|
-
leftIcon?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const StyledButton = styled(s.BaseButton)<{ variant: "primary" | "secondary" }>`
|
|
12
|
-
${({ variant }) =>
|
|
13
|
-
variant === "primary" ? s.PrimaryButton : s.SecondaryButton}
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
export function Button({
|
|
17
|
-
variant,
|
|
18
|
-
text = "",
|
|
19
|
-
leftIcon,
|
|
20
|
-
...props
|
|
21
|
-
}: ButtonProps) {
|
|
22
|
-
return (
|
|
23
|
-
<StyledButton variant={variant} {...props}>
|
|
24
|
-
{leftIcon}
|
|
25
|
-
{text}
|
|
26
|
-
</StyledButton>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import styled, { css } from "styled-components";
|
|
2
|
-
|
|
3
|
-
// Estilos base compartilhados
|
|
4
|
-
export const BaseButton = styled.button`
|
|
5
|
-
all: unset;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
gap: 4px;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
|
|
12
|
-
&:disabled {
|
|
13
|
-
cursor: not-allowed;
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
// Estilos do botão primário
|
|
18
|
-
export const PrimaryButton = css`
|
|
19
|
-
width: fit-content;
|
|
20
|
-
height: fit-content;
|
|
21
|
-
padding: 12px 16px;
|
|
22
|
-
border-radius: 8px;
|
|
23
|
-
border: 1px solid ${({ theme }) => theme.colors.primary};
|
|
24
|
-
color: #fff;
|
|
25
|
-
font-weight: 700;
|
|
26
|
-
background: ${({ theme }) => theme.colors.primary};
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
// Estilos do botão secundário
|
|
30
|
-
export const SecondaryButton = css`
|
|
31
|
-
width: fit-content;
|
|
32
|
-
height: fit-content;
|
|
33
|
-
padding: 12px 8px;
|
|
34
|
-
border-radius: 8px;
|
|
35
|
-
border: 1px solid ${({ theme }) => theme.colors.primary};
|
|
36
|
-
font-weight: 700;
|
|
37
|
-
color: ${({ theme }) => theme.colors.primary};
|
|
38
|
-
background: transparent;
|
|
39
|
-
`;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { Modal } from "./Modal";
|
|
4
|
-
import { fn } from "@storybook/test";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Example/Modal",
|
|
8
|
-
component: Modal,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "centered",
|
|
11
|
-
},
|
|
12
|
-
tags: ["autodocs"],
|
|
13
|
-
argTypes: {
|
|
14
|
-
isModalOpen: { control: "boolean" },
|
|
15
|
-
onOpenChange: { action: "onOpenChange" },
|
|
16
|
-
children: { control: "text" },
|
|
17
|
-
},
|
|
18
|
-
args: {
|
|
19
|
-
isModalOpen: false,
|
|
20
|
-
onOpenChange: fn(),
|
|
21
|
-
children: "This is the modal content.",
|
|
22
|
-
title: "Title",
|
|
23
|
-
},
|
|
24
|
-
} satisfies Meta<typeof Modal>;
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
const Template: Story = {
|
|
30
|
-
render: (args) => {
|
|
31
|
-
const [isModalOpen, setIsModalOpen] = useState(args.isModalOpen);
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Modal
|
|
35
|
-
{...args}
|
|
36
|
-
isModalOpen={isModalOpen}
|
|
37
|
-
onOpenChange={(open) => {
|
|
38
|
-
setIsModalOpen(open);
|
|
39
|
-
args.onOpenChange(open);
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
{args.children}
|
|
43
|
-
</Modal>
|
|
44
|
-
);
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const Default: Story = {
|
|
49
|
-
...Template,
|
|
50
|
-
args: {
|
|
51
|
-
isModalOpen: true,
|
|
52
|
-
children: "This is the modal content.",
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const Closed: Story = {
|
|
57
|
-
...Template,
|
|
58
|
-
args: {
|
|
59
|
-
isModalOpen: false,
|
|
60
|
-
children: "This is the modal content.",
|
|
61
|
-
},
|
|
62
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import * as Alert from "@radix-ui/react-alert-dialog";
|
|
3
|
-
import {
|
|
4
|
-
AlertOverlay,
|
|
5
|
-
ContentContainer,
|
|
6
|
-
ModalHeaderContainer,
|
|
7
|
-
ModalHeaderText,
|
|
8
|
-
CloseBtn,
|
|
9
|
-
ContentChildren,
|
|
10
|
-
} from "./styles";
|
|
11
|
-
import { IconCLose } from "../../icons/close-icon";
|
|
12
|
-
export interface ModalProps {
|
|
13
|
-
isModalOpen: boolean;
|
|
14
|
-
onOpenChange: React.Dispatch<React.SetStateAction<boolean>>;
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
title: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const Modal = ({
|
|
20
|
-
isModalOpen,
|
|
21
|
-
onOpenChange,
|
|
22
|
-
children,
|
|
23
|
-
title,
|
|
24
|
-
}: ModalProps) => {
|
|
25
|
-
return (
|
|
26
|
-
<Alert.Root open={isModalOpen} onOpenChange={onOpenChange}>
|
|
27
|
-
<Alert.Portal>
|
|
28
|
-
<AlertOverlay />
|
|
29
|
-
<ContentContainer>
|
|
30
|
-
<ModalHeaderContainer>
|
|
31
|
-
<ModalHeaderText>{title}</ModalHeaderText>
|
|
32
|
-
<CloseBtn onClick={() => onOpenChange(!isModalOpen)}>
|
|
33
|
-
<IconCLose />
|
|
34
|
-
</CloseBtn>
|
|
35
|
-
</ModalHeaderContainer>
|
|
36
|
-
|
|
37
|
-
<ContentChildren>{children}</ContentChildren>
|
|
38
|
-
</ContentContainer>
|
|
39
|
-
</Alert.Portal>
|
|
40
|
-
</Alert.Root>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import ModalConfirm from "./index";
|
|
4
|
-
import { fn } from "@storybook/test";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Example/ModalConfirm",
|
|
8
|
-
component: ModalConfirm,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "centered",
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
args: {
|
|
14
|
-
isModalOpen: false,
|
|
15
|
-
onOpenChange: fn(),
|
|
16
|
-
children: "conteúdo",
|
|
17
|
-
},
|
|
18
|
-
} satisfies Meta<typeof ModalConfirm>;
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<typeof meta>;
|
|
22
|
-
|
|
23
|
-
const Template: Story = {
|
|
24
|
-
render: (args) => {
|
|
25
|
-
const [isModalOpen, setIsModalOpen] = useState(args.isModalOpen);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<ModalConfirm
|
|
29
|
-
{...args}
|
|
30
|
-
isModalOpen={isModalOpen}
|
|
31
|
-
onOpenChange={(open) => {
|
|
32
|
-
setIsModalOpen(open);
|
|
33
|
-
args.onOpenChange(open);
|
|
34
|
-
}}
|
|
35
|
-
>
|
|
36
|
-
{args.children}
|
|
37
|
-
</ModalConfirm>
|
|
38
|
-
);
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Default: Story = {
|
|
43
|
-
...Template,
|
|
44
|
-
args: {
|
|
45
|
-
isModalOpen: true,
|
|
46
|
-
children: "conteúdo",
|
|
47
|
-
},
|
|
48
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Modal } from "../Modal";
|
|
3
|
-
import { Button } from "../../Button/Button";
|
|
4
|
-
import * as S from "./styles";
|
|
5
|
-
|
|
6
|
-
export interface ModalProps {
|
|
7
|
-
isModalOpen: boolean;
|
|
8
|
-
onOpenChange: React.Dispatch<React.SetStateAction<boolean>>;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const ModalConfirm: React.FC<ModalProps> = ({
|
|
13
|
-
isModalOpen,
|
|
14
|
-
onOpenChange,
|
|
15
|
-
children,
|
|
16
|
-
}) => {
|
|
17
|
-
return (
|
|
18
|
-
<Modal
|
|
19
|
-
isModalOpen={isModalOpen}
|
|
20
|
-
onOpenChange={onOpenChange}
|
|
21
|
-
title="Título (Resumo do conteúdo)"
|
|
22
|
-
>
|
|
23
|
-
{children}
|
|
24
|
-
<S.ContainerModalConfirm>
|
|
25
|
-
<Button variant="secondary" text="Cancelar" />
|
|
26
|
-
<Button variant="primary" text="Ação" />
|
|
27
|
-
</S.ContainerModalConfirm>
|
|
28
|
-
</Modal>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default ModalConfirm;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import styled, { keyframes } from "styled-components";
|
|
2
|
-
|
|
3
|
-
const overlayShow = keyframes`
|
|
4
|
-
from {
|
|
5
|
-
opacity: 0;
|
|
6
|
-
}
|
|
7
|
-
to {
|
|
8
|
-
opacity: 1;
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
const AlertOverlay = styled.div`
|
|
13
|
-
background: rgb(61 62 63 / 0.5);
|
|
14
|
-
position: fixed;
|
|
15
|
-
inset: 0;
|
|
16
|
-
animation: ${overlayShow} 300ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
const ModalHeaderContainer = styled.div`
|
|
20
|
-
width: 410px;
|
|
21
|
-
height: 56px;
|
|
22
|
-
border-radius: 6px 6px 0 0;
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: row;
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: space-between;
|
|
27
|
-
background: ${({ theme }) => theme.colors.primary};
|
|
28
|
-
padding-left: 24px;
|
|
29
|
-
padding-right: 24px;
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
const ModalHeaderText = styled.div`
|
|
33
|
-
font-size: 20px;
|
|
34
|
-
font-weight: 700;
|
|
35
|
-
line-height: 24px;
|
|
36
|
-
text-align: left;
|
|
37
|
-
color: ${({ theme }) => theme.colors.base.white};
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
const CloseBtn = styled.button`
|
|
41
|
-
all: unset;
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
`;
|
|
44
|
-
|
|
45
|
-
const CustomIcon = styled.div`
|
|
46
|
-
color: ${({ theme }) => theme.colors.base.white};
|
|
47
|
-
`;
|
|
48
|
-
|
|
49
|
-
const ContentContainer = styled.div`
|
|
50
|
-
border-radius: 6px;
|
|
51
|
-
box-shadow:
|
|
52
|
-
hsl(206 22% 7% / 35%) 0px 10px 38px -10px,
|
|
53
|
-
hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
|
|
54
|
-
position: fixed;
|
|
55
|
-
top: 50%;
|
|
56
|
-
left: 50%;
|
|
57
|
-
transform: translate(-50%, -50%);
|
|
58
|
-
max-width: 500px;
|
|
59
|
-
height: auto;
|
|
60
|
-
background: ${({ theme }) => theme.colors.base.white};
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
const ContentChildren = styled.div`
|
|
64
|
-
padding: 20px;
|
|
65
|
-
`;
|
|
66
|
-
|
|
67
|
-
export {
|
|
68
|
-
AlertOverlay,
|
|
69
|
-
ModalHeaderContainer,
|
|
70
|
-
ModalHeaderText,
|
|
71
|
-
CloseBtn,
|
|
72
|
-
CustomIcon,
|
|
73
|
-
ContentContainer,
|
|
74
|
-
ContentChildren,
|
|
75
|
-
};
|
package/src/components/theme.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { DefaultTheme } from "styled-components";
|
|
2
|
-
|
|
3
|
-
const theme: DefaultTheme = {
|
|
4
|
-
colors: {
|
|
5
|
-
primary: "#005a92",
|
|
6
|
-
secondary: "",
|
|
7
|
-
hover: "#005A92",
|
|
8
|
-
textSecondary: "",
|
|
9
|
-
iconColor: "#4A4A4B",
|
|
10
|
-
success: "#198754",
|
|
11
|
-
warning: "#CB8700",
|
|
12
|
-
alert: "#CB0A0A",
|
|
13
|
-
information: "#1A95B0",
|
|
14
|
-
border: "#D9D9D9",
|
|
15
|
-
lightGrey: "#C3C3C3",
|
|
16
|
-
grey: "#A0A0A0",
|
|
17
|
-
base: {
|
|
18
|
-
white: "#FFFFFF",
|
|
19
|
-
black: "#303030",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default theme;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { SVGProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const IconAddCell = (props?: SVGProps<SVGSVGElement>) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="21"
|
|
6
|
-
height="21"
|
|
7
|
-
viewBox="0 0 21 21"
|
|
8
|
-
fill="none"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
{...props}
|
|
11
|
-
>
|
|
12
|
-
<path
|
|
13
|
-
d="M9.6665 15.5H11.6665V11.5H15.6665V9.5H11.6665V5.5H9.6665V9.5H5.6665V11.5H9.6665V15.5ZM10.6665 20.5C9.28317 20.5 7.98317 20.2375 6.7665 19.7125C5.54984 19.1875 4.4915 18.475 3.5915 17.575C2.6915 16.675 1.979 15.6167 1.454 14.4C0.929004 13.1833 0.666504 11.8833 0.666504 10.5C0.666504 9.11667 0.929004 7.81667 1.454 6.6C1.979 5.38333 2.6915 4.325 3.5915 3.425C4.4915 2.525 5.54984 1.8125 6.7665 1.2875C7.98317 0.7625 9.28317 0.5 10.6665 0.5C12.0498 0.5 13.3498 0.7625 14.5665 1.2875C15.7832 1.8125 16.8415 2.525 17.7415 3.425C18.6415 4.325 19.354 5.38333 19.879 6.6C20.404 7.81667 20.6665 9.11667 20.6665 10.5C20.6665 11.8833 20.404 13.1833 19.879 14.4C19.354 15.6167 18.6415 16.675 17.7415 17.575C16.8415 18.475 15.7832 19.1875 14.5665 19.7125C13.3498 20.2375 12.0498 20.5 10.6665 20.5ZM10.6665 18.5C12.8998 18.5 14.7915 17.725 16.3415 16.175C17.8915 14.625 18.6665 12.7333 18.6665 10.5C18.6665 8.26667 17.8915 6.375 16.3415 4.825C14.7915 3.275 12.8998 2.5 10.6665 2.5C8.43317 2.5 6.5415 3.275 4.9915 4.825C3.4415 6.375 2.6665 8.26667 2.6665 10.5C2.6665 12.7333 3.4415 14.625 4.9915 16.175C6.5415 17.725 8.43317 18.5 10.6665 18.5Z"
|
|
14
|
-
fill="#4A4A4B"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
);
|
package/src/icons/add-icon.tsx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { SVGProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const IconAdd = (props?: SVGProps<SVGSVGElement>) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="15"
|
|
6
|
-
height="15"
|
|
7
|
-
viewBox="0 0 15 15"
|
|
8
|
-
fill="none"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
{...props}
|
|
11
|
-
>
|
|
12
|
-
<path
|
|
13
|
-
d="M6.6665 8.5H0.666504V6.5H6.6665V0.5H8.6665V6.5H14.6665V8.5H8.6665V14.5H6.6665V8.5Z"
|
|
14
|
-
fill="black"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { SVGProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const IconArrowExpland = (props?: SVGProps<SVGSVGElement>) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="13"
|
|
6
|
-
height="8"
|
|
7
|
-
viewBox="0 0 13 8"
|
|
8
|
-
fill="none"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
{...props}
|
|
11
|
-
>
|
|
12
|
-
<path
|
|
13
|
-
d="M2.0665 7.87498L0.666504 6.47498L6.6665 0.474976L12.6665 6.47498L11.2665 7.87498L6.6665 3.27498L2.0665 7.87498Z"
|
|
14
|
-
fill="black"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { SVGProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const IconArrowRecall = (props?: SVGProps<SVGSVGElement>) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="13"
|
|
6
|
-
height="8"
|
|
7
|
-
viewBox="0 0 13 8"
|
|
8
|
-
fill="none"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
{...props}
|
|
11
|
-
>
|
|
12
|
-
<path
|
|
13
|
-
d="M6.6665 7.87498L0.666504 1.87498L2.0665 0.474976L6.6665 5.07498L11.2665 0.474976L12.6665 1.87498L6.6665 7.87498Z"
|
|
14
|
-
fill="#4A4A4B"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { SVGProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const IconCalendar = (props?: SVGProps<SVGSVGElement>) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="19"
|
|
6
|
-
height="21"
|
|
7
|
-
viewBox="0 0 19 21"
|
|
8
|
-
fill="none"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
{...props}
|
|
11
|
-
>
|
|
12
|
-
<path
|
|
13
|
-
d="M2.6665 20.5C2.1165 20.5 1.64567 20.3042 1.254 19.9125C0.862337 19.5208 0.666504 19.05 0.666504 18.5V4.5C0.666504 3.95 0.862337 3.47917 1.254 3.0875C1.64567 2.69583 2.1165 2.5 2.6665 2.5H3.6665V0.5H5.6665V2.5H13.6665V0.5H15.6665V2.5H16.6665C17.2165 2.5 17.6873 2.69583 18.079 3.0875C18.4707 3.47917 18.6665 3.95 18.6665 4.5V18.5C18.6665 19.05 18.4707 19.5208 18.079 19.9125C17.6873 20.3042 17.2165 20.5 16.6665 20.5H2.6665ZM2.6665 18.5H16.6665V8.5H2.6665V18.5ZM2.6665 6.5H16.6665V4.5H2.6665V6.5ZM9.6665 12.5C9.38317 12.5 9.14567 12.4042 8.954 12.2125C8.76234 12.0208 8.6665 11.7833 8.6665 11.5C8.6665 11.2167 8.76234 10.9792 8.954 10.7875C9.14567 10.5958 9.38317 10.5 9.6665 10.5C9.94984 10.5 10.1873 10.5958 10.379 10.7875C10.5707 10.9792 10.6665 11.2167 10.6665 11.5C10.6665 11.7833 10.5707 12.0208 10.379 12.2125C10.1873 12.4042 9.94984 12.5 9.6665 12.5ZM5.6665 12.5C5.38317 12.5 5.14567 12.4042 4.954 12.2125C4.76234 12.0208 4.6665 11.7833 4.6665 11.5C4.6665 11.2167 4.76234 10.9792 4.954 10.7875C5.14567 10.5958 5.38317 10.5 5.6665 10.5C5.94984 10.5 6.18734 10.5958 6.379 10.7875C6.57067 10.9792 6.6665 11.2167 6.6665 11.5C6.6665 11.7833 6.57067 12.0208 6.379 12.2125C6.18734 12.4042 5.94984 12.5 5.6665 12.5ZM13.6665 12.5C13.3832 12.5 13.1457 12.4042 12.954 12.2125C12.7623 12.0208 12.6665 11.7833 12.6665 11.5C12.6665 11.2167 12.7623 10.9792 12.954 10.7875C13.1457 10.5958 13.3832 10.5 13.6665 10.5C13.9498 10.5 14.1873 10.5958 14.379 10.7875C14.5707 10.9792 14.6665 11.2167 14.6665 11.5C14.6665 11.7833 14.5707 12.0208 14.379 12.2125C14.1873 12.4042 13.9498 12.5 13.6665 12.5ZM9.6665 16.5C9.38317 16.5 9.14567 16.4042 8.954 16.2125C8.76234 16.0208 8.6665 15.7833 8.6665 15.5C8.6665 15.2167 8.76234 14.9792 8.954 14.7875C9.14567 14.5958 9.38317 14.5 9.6665 14.5C9.94984 14.5 10.1873 14.5958 10.379 14.7875C10.5707 14.9792 10.6665 15.2167 10.6665 15.5C10.6665 15.7833 10.5707 16.0208 10.379 16.2125C10.1873 16.4042 9.94984 16.5 9.6665 16.5ZM5.6665 16.5C5.38317 16.5 5.14567 16.4042 4.954 16.2125C4.76234 16.0208 4.6665 15.7833 4.6665 15.5C4.6665 15.2167 4.76234 14.9792 4.954 14.7875C5.14567 14.5958 5.38317 14.5 5.6665 14.5C5.94984 14.5 6.18734 14.5958 6.379 14.7875C6.57067 14.9792 6.6665 15.2167 6.6665 15.5C6.6665 15.7833 6.57067 16.0208 6.379 16.2125C6.18734 16.4042 5.94984 16.5 5.6665 16.5ZM13.6665 16.5C13.3832 16.5 13.1457 16.4042 12.954 16.2125C12.7623 16.0208 12.6665 15.7833 12.6665 15.5C12.6665 15.2167 12.7623 14.9792 12.954 14.7875C13.1457 14.5958 13.3832 14.5 13.6665 14.5C13.9498 14.5 14.1873 14.5958 14.379 14.7875C14.5707 14.9792 14.6665 15.2167 14.6665 15.5C14.6665 15.7833 14.5707 16.0208 14.379 16.2125C14.1873 16.4042 13.9498 16.5 13.6665 16.5Z"
|
|
14
|
-
fill="#4A4A4B"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { SVGProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const IconCheckCircle = (props?: SVGProps<SVGSVGElement>) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="21"
|
|
6
|
-
height="21"
|
|
7
|
-
viewBox="0 0 21 21"
|
|
8
|
-
fill="none"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
{...props}
|
|
11
|
-
>
|
|
12
|
-
<path
|
|
13
|
-
d="M9.2665 15.1L16.3165 8.05L14.9165 6.65L9.2665 12.3L6.4165 9.45L5.0165 10.85L9.2665 15.1ZM10.6665 20.5C9.28317 20.5 7.98317 20.2375 6.7665 19.7125C5.54984 19.1875 4.4915 18.475 3.5915 17.575C2.6915 16.675 1.979 15.6167 1.454 14.4C0.929004 13.1833 0.666504 11.8833 0.666504 10.5C0.666504 9.11667 0.929004 7.81667 1.454 6.6C1.979 5.38333 2.6915 4.325 3.5915 3.425C4.4915 2.525 5.54984 1.8125 6.7665 1.2875C7.98317 0.7625 9.28317 0.5 10.6665 0.5C12.0498 0.5 13.3498 0.7625 14.5665 1.2875C15.7832 1.8125 16.8415 2.525 17.7415 3.425C18.6415 4.325 19.354 5.38333 19.879 6.6C20.404 7.81667 20.6665 9.11667 20.6665 10.5C20.6665 11.8833 20.404 13.1833 19.879 14.4C19.354 15.6167 18.6415 16.675 17.7415 17.575C16.8415 18.475 15.7832 19.1875 14.5665 19.7125C13.3498 20.2375 12.0498 20.5 10.6665 20.5ZM10.6665 18.5C12.8998 18.5 14.7915 17.725 16.3415 16.175C17.8915 14.625 18.6665 12.7333 18.6665 10.5C18.6665 8.26667 17.8915 6.375 16.3415 4.825C14.7915 3.275 12.8998 2.5 10.6665 2.5C8.43317 2.5 6.5415 3.275 4.9915 4.825C3.4415 6.375 2.6665 8.26667 2.6665 10.5C2.6665 12.7333 3.4415 14.625 4.9915 16.175C6.5415 17.725 8.43317 18.5 10.6665 18.5Z"
|
|
14
|
-
fill="black"
|
|
15
|
-
/>
|
|
16
|
-
</svg>
|
|
17
|
-
);
|