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.
Files changed (49) hide show
  1. package/.env.development +3 -1
  2. package/.env.production +3 -1
  3. package/dist/components/atoms/FeatureTag/styles.js +1 -1
  4. package/dist/components/atoms/Graphic/Graphic.stories.js +9 -1
  5. package/dist/components/atoms/Graphic/index.js +4 -9
  6. package/dist/components/atoms/Graphic/styles.js +1 -1
  7. package/dist/components/atoms/MetricCard/MetricCard.stories.js +31 -0
  8. package/dist/components/atoms/MetricCard/index.js +24 -0
  9. package/dist/components/atoms/MetricCard/styles.js +20 -0
  10. package/dist/components/atoms/MetricSelect/MetricSelect.stories.js +46 -0
  11. package/dist/components/atoms/MetricSelect/index.js +36 -0
  12. package/dist/components/atoms/MetricSelect/styles.js +20 -0
  13. package/dist/components/organisms/Calendar/Calendar.stories.js +28 -0
  14. package/dist/components/organisms/Calendar/index.js +33 -0
  15. package/dist/components/organisms/Calendar/styles.js +20 -0
  16. package/dist/components/organisms/DashboardMetric/DashboardMetric.stories.js +45 -0
  17. package/dist/components/organisms/DashboardMetric/index.js +171 -0
  18. package/dist/components/organisms/DashboardMetric/styles.js +20 -0
  19. package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
  20. package/dist/components/pages/Dashboard/Dashboard.stories.js +28 -0
  21. package/dist/components/pages/Dashboard/index.js +254 -0
  22. package/dist/components/pages/Dashboard/styles.js +18 -0
  23. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +68 -120
  24. package/dist/components/pages/ProviderProductEdition/index.js +16 -7
  25. package/dist/components/pages/RetailerProductEdition/index.js +20 -13
  26. package/package.json +1 -1
  27. package/src/components/atoms/FeatureTag/styles.js +6 -0
  28. package/src/components/atoms/Graphic/Graphic.stories.js +8 -0
  29. package/src/components/atoms/Graphic/index.js +3 -9
  30. package/src/components/atoms/Graphic/styles.js +1 -2
  31. package/src/components/atoms/MetricCard/MetricCard.stories.js +14 -0
  32. package/src/components/atoms/MetricCard/index.js +10 -0
  33. package/src/components/atoms/MetricCard/styles.js +30 -0
  34. package/src/components/atoms/MetricSelect/MetricSelect.stories.js +37 -0
  35. package/src/components/atoms/MetricSelect/index.js +22 -0
  36. package/src/components/atoms/MetricSelect/styles.js +20 -0
  37. package/src/components/organisms/Calendar/Calendar.stories.js +10 -0
  38. package/src/components/organisms/Calendar/index.js +17 -0
  39. package/src/components/organisms/Calendar/styles.js +851 -0
  40. package/src/components/organisms/DashboardMetric/DashboardMetric.stories.js +28 -0
  41. package/src/components/organisms/DashboardMetric/index.js +128 -0
  42. package/src/components/organisms/DashboardMetric/styles.js +60 -0
  43. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  44. package/src/components/pages/Dashboard/Dashboard.stories.js +10 -0
  45. package/src/components/pages/Dashboard/index.js +126 -0
  46. package/src/components/pages/Dashboard/styles.js +24 -0
  47. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +77 -145
  48. package/src/components/pages/ProviderProductEdition/index.js +12 -8
  49. package/src/components/pages/RetailerProductEdition/index.js +18 -12
@@ -1,4 +1,3 @@
1
1
  import styled from "styled-components";
2
2
 
3
- export const Container = styled.div`
4
- `;
3
+ export const Container = styled.div``;
@@ -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,10 @@
1
+ import { Container } from "./styles";
2
+
3
+ export const MetricCard = ({ label, number }) => {
4
+ return (
5
+ <Container>
6
+ <p>{label}</p>
7
+ <p>{number}</p>
8
+ </Container>
9
+ );
10
+ };
@@ -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,10 @@
1
+ import { Calendar } from ".";
2
+
3
+ export default {
4
+ title: "Components/organisms/Calendar",
5
+ component: Calendar,
6
+ };
7
+
8
+ const Template = (args) => <Calendar {...args} />;
9
+ export const CalendarDefault = Template.bind({});
10
+ CalendarDefault.args = {};
@@ -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
+ };