contentoh-components-library 21.1.97 → 21.2.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/.env.development +3 -1
- package/.env.production +3 -1
- package/dist/components/atoms/FeatureTag/styles.js +1 -1
- package/dist/components/atoms/Graphic/Graphic.stories.js +9 -1
- package/dist/components/atoms/Graphic/index.js +4 -9
- package/dist/components/atoms/Graphic/styles.js +1 -1
- package/dist/components/atoms/MetricCard/MetricCard.stories.js +31 -0
- package/dist/components/atoms/MetricCard/index.js +24 -0
- package/dist/components/atoms/MetricCard/styles.js +20 -0
- package/dist/components/atoms/MetricSelect/MetricSelect.stories.js +46 -0
- package/dist/components/atoms/MetricSelect/index.js +36 -0
- package/dist/components/atoms/MetricSelect/styles.js +20 -0
- package/dist/components/organisms/Calendar/Calendar.stories.js +28 -0
- package/dist/components/organisms/Calendar/index.js +33 -0
- package/dist/components/organisms/Calendar/styles.js +20 -0
- package/dist/components/organisms/DashboardMetric/DashboardMetric.stories.js +45 -0
- package/dist/components/organisms/DashboardMetric/index.js +171 -0
- package/dist/components/organisms/DashboardMetric/styles.js +20 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/pages/Dashboard/Dashboard.stories.js +28 -0
- package/dist/components/pages/Dashboard/index.js +254 -0
- package/dist/components/pages/Dashboard/styles.js +18 -0
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +68 -120
- package/dist/components/pages/ProviderProductEdition/index.js +16 -7
- package/dist/components/pages/RetailerProductEdition/index.js +20 -13
- package/package.json +1 -1
- package/src/components/atoms/FeatureTag/styles.js +6 -0
- package/src/components/atoms/Graphic/Graphic.stories.js +8 -0
- package/src/components/atoms/Graphic/index.js +3 -9
- package/src/components/atoms/Graphic/styles.js +1 -2
- package/src/components/atoms/MetricCard/MetricCard.stories.js +14 -0
- package/src/components/atoms/MetricCard/index.js +10 -0
- package/src/components/atoms/MetricCard/styles.js +30 -0
- package/src/components/atoms/MetricSelect/MetricSelect.stories.js +37 -0
- package/src/components/atoms/MetricSelect/index.js +22 -0
- package/src/components/atoms/MetricSelect/styles.js +20 -0
- package/src/components/organisms/Calendar/Calendar.stories.js +10 -0
- package/src/components/organisms/Calendar/index.js +17 -0
- package/src/components/organisms/Calendar/styles.js +851 -0
- package/src/components/organisms/DashboardMetric/DashboardMetric.stories.js +28 -0
- package/src/components/organisms/DashboardMetric/index.js +128 -0
- package/src/components/organisms/DashboardMetric/styles.js +60 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/pages/Dashboard/Dashboard.stories.js +10 -0
- package/src/components/pages/Dashboard/index.js +126 -0
- package/src/components/pages/Dashboard/styles.js +24 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +77 -145
- package/src/components/pages/ProviderProductEdition/index.js +12 -8
- package/src/components/pages/RetailerProductEdition/index.js +18 -12
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MetricCard } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/atoms/MetricCard",
|
|
5
|
+
component: MetricCard,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <MetricCard {...args} />;
|
|
9
|
+
export const MetricCardDefault = Template.bind({});
|
|
10
|
+
|
|
11
|
+
MetricCardDefault.args = {
|
|
12
|
+
label: "Productos Totales",
|
|
13
|
+
number: 2367,
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
padding: 10px 20px;
|
|
6
|
+
border: 1px solid ${GlobalColors.s3};
|
|
7
|
+
width: fit-content;
|
|
8
|
+
text-align: center;
|
|
9
|
+
border-radius: 10px;
|
|
10
|
+
|
|
11
|
+
p {
|
|
12
|
+
color: #000;
|
|
13
|
+
font-size: 25px;
|
|
14
|
+
font-family: ${FontFamily.Raleway_600};
|
|
15
|
+
font-size: 25px;
|
|
16
|
+
font-feature-settings: "pnum", "lnum";
|
|
17
|
+
|
|
18
|
+
&:first-of-type {
|
|
19
|
+
color: ${GlobalColors.s3};
|
|
20
|
+
font-family: ${FontFamily.Raleway};
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
font-size: 13px;
|
|
23
|
+
line-height: 13px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
& + * {
|
|
27
|
+
margin-top: 3px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { MetricSelect } from ".";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/atoms/MetricSelect",
|
|
6
|
+
component: MetricSelect,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = (args) => {
|
|
10
|
+
const [optionSelected, setSelectedOption] = useState("Semana actual");
|
|
11
|
+
const onChange = (e) => {
|
|
12
|
+
setSelectedOption(e.target.value);
|
|
13
|
+
};
|
|
14
|
+
return (
|
|
15
|
+
<MetricSelect
|
|
16
|
+
{...args}
|
|
17
|
+
optionSelected={optionSelected}
|
|
18
|
+
onChange={onChange}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export const MetricSelectDefault = Template.bind({});
|
|
23
|
+
MetricSelectDefault.args = {
|
|
24
|
+
options: [
|
|
25
|
+
"12/12/12",
|
|
26
|
+
"12/12/13",
|
|
27
|
+
"12/12/14",
|
|
28
|
+
"12/12/15",
|
|
29
|
+
"12/12/16",
|
|
30
|
+
"12/12/17",
|
|
31
|
+
"12/12/18",
|
|
32
|
+
"12/12/19",
|
|
33
|
+
"12/12/20",
|
|
34
|
+
"12/12/21",
|
|
35
|
+
"12/12/22",
|
|
36
|
+
],
|
|
37
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
|
|
3
|
+
export const MetricSelect = ({
|
|
4
|
+
options,
|
|
5
|
+
optionSelected,
|
|
6
|
+
onChange,
|
|
7
|
+
label,
|
|
8
|
+
className,
|
|
9
|
+
}) => {
|
|
10
|
+
return (
|
|
11
|
+
<Container className={className}>
|
|
12
|
+
<select value={optionSelected} onChange={onChange}>
|
|
13
|
+
<option value="">{label}</option>
|
|
14
|
+
{options?.map((option) => (
|
|
15
|
+
<option key={option.name} value={option.id}>
|
|
16
|
+
{option.name}
|
|
17
|
+
</option>
|
|
18
|
+
))}
|
|
19
|
+
</select>
|
|
20
|
+
</Container>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
background-color: ${GlobalColors.s2};
|
|
6
|
+
width: fit-content;
|
|
7
|
+
display: block;
|
|
8
|
+
padding-right: 10px;
|
|
9
|
+
border-radius: 5px;
|
|
10
|
+
|
|
11
|
+
select {
|
|
12
|
+
color: ${GlobalColors.s4};
|
|
13
|
+
outline: none;
|
|
14
|
+
padding: 10px;
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
border: none;
|
|
17
|
+
option:first-of-type {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Container } from "./styles";
|
|
2
|
+
import DatePicker from "react-datepicker";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
export const Calendar = ({ onChange, startDate, endDate }) => {
|
|
6
|
+
return (
|
|
7
|
+
<Container>
|
|
8
|
+
<DatePicker
|
|
9
|
+
selected={startDate}
|
|
10
|
+
onChange={onChange}
|
|
11
|
+
startDate={startDate}
|
|
12
|
+
endDate={endDate}
|
|
13
|
+
selectsRange
|
|
14
|
+
/>
|
|
15
|
+
</Container>
|
|
16
|
+
);
|
|
17
|
+
};
|