@alume/alume-design-system 4.13.21 → 4.13.22
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/dist/assets/icons/email.js +3 -3
- package/dist/assets/icons/index.d.ts +2 -0
- package/dist/assets/icons/index.js +2 -0
- package/dist/assets/icons/send-email.d.ts +2 -0
- package/dist/assets/icons/send-email.js +4 -0
- package/dist/assets/icons/whatsapp-support.d.ts +2 -0
- package/dist/assets/icons/whatsapp-support.js +4 -0
- package/dist/assets/icons/whatsapp.js +3 -3
- package/dist/components/autocomplete-input/autocompleteInput.component.d.ts +3 -1
- package/dist/components/autocomplete-input/autocompleteInput.component.js +5 -4
- package/dist/components/autocomplete-input/autocompleteInput.styled.d.ts +2 -0
- package/dist/components/autocomplete-input/autocompleteInput.styled.js +15 -2
- package/dist/components/button/button.component.d.ts +1 -1
- package/dist/components/button/button.styled.d.ts +1 -1
- package/dist/components/chart/chart.component.d.ts +10 -0
- package/dist/components/chart/chart.component.js +37 -0
- package/dist/components/chart/index.d.ts +1 -0
- package/dist/components/chart/index.js +1 -0
- package/dist/components/datepicker/datepicker.component.d.ts +34 -0
- package/dist/components/datepicker/datepicker.component.js +11 -0
- package/dist/components/datepicker/datepicker.style.css +103 -0
- package/dist/components/datepicker/index.d.ts +1 -0
- package/dist/components/datepicker/index.js +1 -0
- package/dist/components/disclaimer/disclaimer.component.d.ts +1 -1
- package/dist/components/disclaimer/disclaimer.component.js +14 -2
- package/dist/components/dropdown/dropdown.component.d.ts +7 -0
- package/dist/components/dropdown/dropdown.component.js +48 -0
- package/dist/components/dropdown/dropdown.styled.d.ts +5 -0
- package/dist/components/dropdown/dropdown.styled.js +43 -0
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/components/dropdown/index.js +1 -0
- package/dist/components/feedback-input/feedbackInput.styled.js +7 -6
- package/dist/components/grid/grid.component.d.ts +2 -2
- package/dist/components/grid/grid.styled.d.ts +2 -2
- package/dist/components/horizontal-timeline/horizontalTimeline.component.d.ts +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/large-selector/largeSelector.component.d.ts +1 -1
- package/dist/components/link/link.component.d.ts +1 -1
- package/dist/components/list/list.component.d.ts +3 -3
- package/dist/components/menu/index.d.ts +1 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/menu/menu.component.d.ts +15 -0
- package/dist/components/menu/menu.component.js +15 -0
- package/dist/components/menu/menu.styled.d.ts +10 -0
- package/dist/components/menu/menu.styled.js +86 -0
- package/dist/components/multiselect/multiselect.style.js +1 -1
- package/dist/components/radio/radio.component.d.ts +2 -1
- package/dist/components/radio/radio.component.js +2 -2
- package/dist/components/range-input/rangeInput.component.d.ts +3 -4
- package/dist/components/range-input/rangeInput.component.js +8 -8
- package/dist/components/select/select.component.d.ts +1 -0
- package/dist/components/select/select.component.js +13 -11
- package/dist/components/select/select.styled.d.ts +4 -1
- package/dist/components/select/select.styled.js +21 -4
- package/dist/components/table/table.component.d.ts +1 -1
- package/dist/components/table/table.styled.d.ts +4 -2
- package/dist/components/table/table.styled.js +13 -2
- package/dist/components/text-area-input/textAreaInput.component.js +3 -2
- package/dist/components/text-area-input/textAreaInput.styled.js +5 -1
- package/dist/components/text-input/textInput.component.d.ts +1 -1
- package/dist/components/text-input/textInput.styled.js +1 -1
- package/dist/components/vertical-timeline/verticalTimeline.component.d.ts +1 -1
- package/dist/constants/styles.d.ts +2 -2
- package/dist/helpers/currency.d.ts +1 -0
- package/dist/helpers/currency.js +7 -0
- package/package.json +6 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export const EmailIcon = (props) => (React.createElement("svg", Object.assign({
|
|
3
|
-
React.createElement("
|
|
4
|
-
React.createElement("path", {
|
|
2
|
+
export const EmailIcon = (props) => (React.createElement("svg", Object.assign({ width: "27", height: "21", viewBox: "0 0 27 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", strokeWidth: "3" }, props),
|
|
3
|
+
React.createElement("rect", { x: "1.5", y: "2.38574", width: "23.5143", height: "17.1143", rx: "2.5" }),
|
|
4
|
+
React.createElement("path", { d: "M2.74219 3.6286L13.2565 10.4857L24.2279 3.6286" })));
|
|
@@ -12,12 +12,14 @@ export * from "./share";
|
|
|
12
12
|
export * from "./checkMark";
|
|
13
13
|
export * from "./indicatorRound";
|
|
14
14
|
export * from "./email";
|
|
15
|
+
export * from "./send-email";
|
|
15
16
|
export * from "./information";
|
|
16
17
|
export * from "./legal";
|
|
17
18
|
export * from "./love";
|
|
18
19
|
export * from "./safe";
|
|
19
20
|
export * from "./simulation";
|
|
20
21
|
export * from "./whatsapp";
|
|
22
|
+
export * from "./whatsapp-support";
|
|
21
23
|
export * from "./plus";
|
|
22
24
|
export * from "./emptyBullet";
|
|
23
25
|
export * from "./animated-bullet";
|
|
@@ -12,12 +12,14 @@ export * from "./share";
|
|
|
12
12
|
export * from "./checkMark";
|
|
13
13
|
export * from "./indicatorRound";
|
|
14
14
|
export * from "./email";
|
|
15
|
+
export * from "./send-email";
|
|
15
16
|
export * from "./information";
|
|
16
17
|
export * from "./legal";
|
|
17
18
|
export * from "./love";
|
|
18
19
|
export * from "./safe";
|
|
19
20
|
export * from "./simulation";
|
|
20
21
|
export * from "./whatsapp";
|
|
22
|
+
export * from "./whatsapp-support";
|
|
21
23
|
export * from "./plus";
|
|
22
24
|
export * from "./emptyBullet";
|
|
23
25
|
export * from "./animated-bullet";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const SendEmailIcon = (props) => (React.createElement("svg", Object.assign({ height: "24px", width: "24px", version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", x: "0", y: "0", viewBox: "0 0 40 24", xmlSpace: "preserve" }, props),
|
|
3
|
+
React.createElement("path", { fill: "none", d: "M0 0h40v24H0z" }),
|
|
4
|
+
React.createElement("path", { className: "st1", d: "M3.2 9.5h6v1h-6zM5.2 6.5h4v1h-4zM7.2 3.5h2v1h-2zM11.8 3.5l-4.2 17h25l4.2-17h-25zm22.4 1l-12.9 6.9-7.8-6.9h20.7zm-2.4 15h-23l3.6-14.6 8.6 7.7L35.5 5l-3.7 14.5z" })));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const WhatsappSupportIcon = (props) => (React.createElement("svg", Object.assign({ height: "64px", width: "64px", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64" }, props),
|
|
3
|
+
React.createElement("circle", { cx: "32", cy: "32", r: "32", fill: "#25D366" }),
|
|
4
|
+
React.createElement("path", { d: "M32.3 47.2c-2.8 0-5.3-.7-7.6-1.9L16 48l2.8-8.4c-1.4-2.3-2.3-5.1-2.3-8 0-8.6 7-15.6 15.7-15.6C41 16 48 23 48 31.6s-7 15.6-15.7 15.6m0-28.7c-7.3 0-13.2 5.9-13.2 13.1 0 2.9.9 5.5 2.5 7.7l-1.7 4.9 5.1-1.6c2.1 1.4 4.6 2.2 7.3 2.2 7.3 0 13.2-5.9 13.2-13.1 0-7.3-5.9-13.2-13.2-13.2m7.9 16.7c-.1-.2-.4-.3-.7-.4-.4-.2-2.3-1.1-2.6-1.2-.4-.1-.6-.2-.9.2-.3.4-1 1.2-1.2 1.5-.2.3-.4.3-.8.1-.4-.2-1.6-.6-3.1-1.9-1.1-1-1.9-2.3-2.1-2.6-.2-.4 0-.6.2-.8.2-.2.4-.4.6-.7.2-.2.3-.4.4-.6.1-.3.1-.5 0-.7-.1-.2-.9-2.1-1.2-2.8-.3-.8-.6-.6-.9-.6h-.7c-.3 0-.7.1-1 .5-.4.4-1.3 1.3-1.3 3.2 0 1.9 1.4 3.7 1.6 4 .2.3 2.7 4.2 6.6 5.8 3.9 1.5 3.9 1 4.6 1 .7-.1 2.3-.9 2.6-1.8 0-1.3 0-2.1-.1-2.2", fillRule: "evenodd", clipRule: "evenodd", fill: "#fff" })));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export const WhatsappIcon = (props) => (React.createElement("svg", Object.assign({ height: "
|
|
3
|
-
React.createElement("
|
|
4
|
-
React.createElement("path", { d: "
|
|
2
|
+
export const WhatsappIcon = (props) => (React.createElement("svg", Object.assign({ width: "27", height: "27", viewBox: "0 0 27 27", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
3
|
+
React.createElement("path", { d: "M12.1013 0.031311C12.7337 0.031311 13.3662 0.031311 13.9986 0.031311C14.2349 0.0636783 14.4713 0.0950181 14.7071 0.127899C18.0502 0.594399 20.8394 2.09768 23.0029 4.68398C25.285 7.41208 26.2869 10.5815 26.0038 14.1316C25.7659 17.1176 24.6058 19.7163 22.5631 21.9029C20.153 24.4825 17.1639 25.8722 13.6426 26.07C11.5335 26.1887 9.50828 25.7813 7.58833 24.892C7.33145 24.7728 7.09769 24.7522 6.82539 24.818C4.8402 25.2968 2.85243 25.7654 0.865183 26.2355C0.385839 26.349 0.24147 26.2868 0 25.8748V25.6698C0.0323673 25.5552 0.0714136 25.4417 0.0955606 25.3256C0.509657 23.3209 0.919642 21.3151 1.33888 19.3114C1.39077 19.0623 1.35737 18.8485 1.24794 18.6225C0.810724 17.7208 0.496812 16.776 0.282572 15.7962C0.151047 15.1951 0.0981294 14.5838 0 13.9785V12.1839C0.0405876 11.8541 0.0729549 11.5227 0.123818 11.1944C0.599566 8.12827 1.96413 5.53221 4.25347 3.43193C6.10817 1.72982 8.28038 0.661189 10.7588 0.221918C11.2037 0.142798 11.6533 0.0939906 12.1013 0.031311ZM13.1483 23.2109C13.4381 23.1976 13.8558 23.2063 14.2735 23.1529C15.915 22.9443 17.4254 22.3853 18.7823 21.4431C20.6365 20.155 21.9404 18.4396 22.6622 16.2956C23.3656 14.2061 23.3856 12.0971 22.7311 9.99787C22.0642 7.85855 20.7978 6.13229 18.9852 4.81242C16.9055 3.29784 14.5637 2.66899 12.0227 2.93255C9.02226 3.24389 6.59009 4.63415 4.79858 7.07659C3.15761 9.31405 2.5976 11.8336 2.95827 14.5689C3.13295 15.8928 3.62206 17.1094 4.25707 18.2726C4.36599 18.4725 4.38808 18.6631 4.34081 18.8855C4.09934 20.022 3.86815 21.1605 3.63593 22.299C3.57068 22.6175 3.60561 22.6535 3.92364 22.579C4.94655 22.3396 5.97408 22.1156 6.98877 21.8438C7.40852 21.7313 7.75274 21.7821 8.12984 21.984C9.6547 22.8004 11.2777 23.2515 13.1483 23.2119V23.2109Z" }),
|
|
4
|
+
React.createElement("path", { d: "M6.44753 9.77183C6.39769 9.10753 6.79997 8.38055 7.36974 7.72242C7.59888 7.45731 7.85319 7.21482 8.12754 6.99646C8.6259 6.60086 9.30664 6.72622 9.58202 7.30061C9.9658 8.10106 10.3126 8.91949 10.6635 9.73535C10.814 10.0847 10.7585 10.4223 10.5289 10.7269C10.3799 10.9247 10.2242 11.1179 10.0778 11.3172C9.76235 11.7457 9.7531 12.1346 10.0639 12.5693C10.796 13.5937 11.7234 14.425 12.7006 15.2044C13.1481 15.561 13.6125 15.8964 14.1314 16.1466C14.5851 16.365 14.9375 16.3172 15.3049 15.973C15.498 15.7922 15.6773 15.5964 15.8674 15.4125C16.1392 15.1499 16.4608 15.0431 16.8313 15.1479C17.6697 15.3842 18.5113 15.6108 19.3415 15.8733C20.0084 16.0845 20.2237 16.7457 19.8507 17.3365C19.5851 17.7568 19.2758 18.1411 18.9238 18.494C18.1475 19.2719 17.177 19.4507 16.1382 19.3911C14.7264 19.3104 13.4625 18.7812 12.2937 18.0245C10.4092 16.8043 8.79287 15.2974 7.56394 13.4047C6.89759 12.3777 6.46962 11.2633 6.44701 9.77235L6.44753 9.77183Z" })));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { Option } from "../../types";
|
|
2
3
|
interface AutocompleteInputProps<T> {
|
|
3
4
|
value: T;
|
|
@@ -6,6 +7,7 @@ interface AutocompleteInputProps<T> {
|
|
|
6
7
|
noOptionsMessage?: string;
|
|
7
8
|
placeholder?: string;
|
|
8
9
|
onChange?: (value: T) => void;
|
|
10
|
+
error?: string | boolean;
|
|
9
11
|
}
|
|
10
|
-
export declare const AutocompleteInput: <T extends unknown>({ placeholder, value, onChange, options, label, noOptionsMessage, ...props }: AutocompleteInputProps<T>) => JSX.Element;
|
|
12
|
+
export declare const AutocompleteInput: <T extends unknown>({ placeholder, value, onChange, options, label, error, noOptionsMessage, ...props }: AutocompleteInputProps<T>) => JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -10,10 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { useEffect, useRef, useState } from "react";
|
|
13
|
-
import { MultiselectContainer, MultiselectLabel, MultiselectOption, MultiselectOptionsContainer, MultiselectSearchContainer, MultiselectSearchInput, MultiselectSelectedValueLabel, } from "./autocompleteInput.styled";
|
|
13
|
+
import { MultiselectContainer, MultiselectLabel, MultiselectOption, MultiselectOptionsContainer, MultiselectSearchContainer, MultiselectSearchInput, MultiselectSelectedValueLabel, StyleErrorSpan, } from "./autocompleteInput.styled";
|
|
14
14
|
export const AutocompleteInput = (_a) => {
|
|
15
15
|
var _b;
|
|
16
|
-
var { placeholder, value, onChange, options = [], label, noOptionsMessage } = _a, props = __rest(_a, ["placeholder", "value", "onChange", "options", "label", "noOptionsMessage"]);
|
|
16
|
+
var { placeholder, value, onChange, options = [], label, error, noOptionsMessage } = _a, props = __rest(_a, ["placeholder", "value", "onChange", "options", "label", "error", "noOptionsMessage"]);
|
|
17
17
|
const selectorRef = useRef(null);
|
|
18
18
|
const inputRef = useRef(null);
|
|
19
19
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -47,9 +47,10 @@ export const AutocompleteInput = (_a) => {
|
|
|
47
47
|
});
|
|
48
48
|
const selectItemLabel = ((_b = options.find(({ value: itemValue }) => value === itemValue)) === null || _b === void 0 ? void 0 : _b.label) || "";
|
|
49
49
|
return (React.createElement(MultiselectContainer, { ref: selectorRef },
|
|
50
|
-
React.createElement(MultiselectSearchContainer,
|
|
50
|
+
React.createElement(MultiselectSearchContainer, { hasError: !!error },
|
|
51
51
|
React.createElement(MultiselectLabel, { onClick: handleLabelClick, riseLabel: isOpen || !!selectItemLabel }, label),
|
|
52
52
|
React.createElement(MultiselectSearchInput, Object.assign({ ref: inputRef, placeholder: isOpen && placeholder, onChange: handleSearchInputChange, onFocus: () => setIsOpen(true), value: searchValue }, props)),
|
|
53
53
|
!isOpen && (React.createElement(MultiselectSelectedValueLabel, { onClick: handleLabelClick }, selectItemLabel))),
|
|
54
|
-
React.createElement(MultiselectOptionsContainer, { isOpen: isOpen }, optionsToRender.length > 0 ? (optionsToRender) : (React.createElement(MultiselectOption, { cursor: "default" }, noOptionsMessage)))
|
|
54
|
+
React.createElement(MultiselectOptionsContainer, { isOpen: isOpen }, optionsToRender.length > 0 ? (optionsToRender) : (React.createElement(MultiselectOption, { cursor: "default" }, noOptionsMessage))),
|
|
55
|
+
error && React.createElement(StyleErrorSpan, null, error)));
|
|
55
56
|
};
|
|
@@ -3,6 +3,7 @@ export interface MultiselectSearchContainerProps {
|
|
|
3
3
|
stretch?: boolean;
|
|
4
4
|
hasLabel?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
hasError?: boolean;
|
|
6
7
|
[key: string]: unknown;
|
|
7
8
|
}
|
|
8
9
|
export declare const MultiselectSearchContainer: import("styled-components").StyledComponent<"div", any, MultiselectSearchContainerProps, never>;
|
|
@@ -21,4 +22,5 @@ interface MultiselectOptionProps {
|
|
|
21
22
|
selected?: boolean;
|
|
22
23
|
}
|
|
23
24
|
export declare const MultiselectOption: import("styled-components").StyledComponent<"div", any, MultiselectOptionProps, never>;
|
|
25
|
+
export declare const StyleErrorSpan: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
24
26
|
export {};
|
|
@@ -17,18 +17,23 @@ export const MultiselectSearchContainer = styled.div `
|
|
|
17
17
|
top: 2px;
|
|
18
18
|
font-size: 16px;
|
|
19
19
|
color: ${colors.textGreen};
|
|
20
|
-
border-bottom: 1px solid
|
|
20
|
+
border-bottom: 1px solid
|
|
21
|
+
${({ hasError }) => (hasError ? colors.red : colors.lightGrey)};
|
|
21
22
|
width: ${({ stretch }) => (stretch ? "100%" : "auto")};
|
|
22
23
|
box-sizing: content-box;
|
|
23
24
|
cursor: ${({ disabled }) => (!disabled ? "pointer" : "default")};
|
|
24
25
|
|
|
26
|
+
> label {
|
|
27
|
+
color: ${({ hasError }) => (hasError ? colors.red : colors.textGreen)};
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
&:focus {
|
|
26
31
|
outline: none;
|
|
27
32
|
}
|
|
28
33
|
`;
|
|
29
34
|
export const MultiselectLabel = styled.label `
|
|
30
35
|
position: absolute;
|
|
31
|
-
color: ${colors.
|
|
36
|
+
color: ${colors.textGreen};
|
|
32
37
|
cursor: pointer;
|
|
33
38
|
transition: transform 0.4s, font-size 0.4s;
|
|
34
39
|
transition-timing-function: ease;
|
|
@@ -46,6 +51,7 @@ export const MultiselectSearchInput = styled.input `
|
|
|
46
51
|
width: 100%;
|
|
47
52
|
background-color: transparent;
|
|
48
53
|
border: none;
|
|
54
|
+
color: ${colors.textGreen};
|
|
49
55
|
`;
|
|
50
56
|
export const MultiselectSelectedValueLabel = styled.label `
|
|
51
57
|
position: absolute;
|
|
@@ -87,3 +93,10 @@ export const MultiselectOption = styled.div `
|
|
|
87
93
|
}
|
|
88
94
|
`}
|
|
89
95
|
`;
|
|
96
|
+
export const StyleErrorSpan = styled.span `
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: flex-end;
|
|
99
|
+
width: 100%;
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
color: ${colors.red};
|
|
102
|
+
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
|
+
import type { EChartsOption, SetOptionOpts } from "echarts";
|
|
3
|
+
export interface ChartProps {
|
|
4
|
+
options: EChartsOption;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
settings?: SetOptionOpts;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
theme?: "light" | "dark";
|
|
9
|
+
}
|
|
10
|
+
export declare const Chart: React.FC<ChartProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from "react";
|
|
2
|
+
import { init } from "echarts";
|
|
3
|
+
import { colors } from "../../constants";
|
|
4
|
+
export const Chart = ({ options, style, loading, theme, settings, }) => {
|
|
5
|
+
const chartRef = useRef(null);
|
|
6
|
+
const chartInstanceRef = useRef({ chart: null });
|
|
7
|
+
options.color = options.color || [colors.darkGreen, colors.lightGreen];
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!chartRef.current)
|
|
10
|
+
return;
|
|
11
|
+
// Initialize chart
|
|
12
|
+
chartInstanceRef.current.chart = init(chartRef.current, theme);
|
|
13
|
+
// Add chart resize listener
|
|
14
|
+
function resizeChart() {
|
|
15
|
+
chartInstanceRef.current.chart.resize();
|
|
16
|
+
}
|
|
17
|
+
window.addEventListener("resize", resizeChart);
|
|
18
|
+
// Return cleanup function
|
|
19
|
+
return () => {
|
|
20
|
+
chartInstanceRef.current.chart.dispose();
|
|
21
|
+
window.removeEventListener("resize", resizeChart);
|
|
22
|
+
};
|
|
23
|
+
}, [theme]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!chartRef.current)
|
|
26
|
+
return;
|
|
27
|
+
chartInstanceRef.current.chart.setOption(options, settings);
|
|
28
|
+
}, [options, settings]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!chartRef.current)
|
|
31
|
+
return;
|
|
32
|
+
loading === true
|
|
33
|
+
? chartInstanceRef.current.chart.showLoading()
|
|
34
|
+
: chartInstanceRef.current.chart.hideLoading();
|
|
35
|
+
}, [loading]);
|
|
36
|
+
return (React.createElement("div", { ref: chartRef, style: Object.assign({ width: "100%", height: "400px" }, style) }));
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./chart.component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./chart.component";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "react-datepicker/dist/react-datepicker.css";
|
|
3
|
+
import "./datepicker.style.css";
|
|
4
|
+
interface DatePickerProps {
|
|
5
|
+
label: string;
|
|
6
|
+
selected: Date | null;
|
|
7
|
+
onChange: (date: Date) => void;
|
|
8
|
+
onSelect?: (date: Date) => void;
|
|
9
|
+
calendarStartDay?: number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
startDate?: Date;
|
|
12
|
+
endDate?: Date;
|
|
13
|
+
excludeDates?: Array<Date>;
|
|
14
|
+
excludeDateIntervals?: Array<{
|
|
15
|
+
start: Date;
|
|
16
|
+
end: Date;
|
|
17
|
+
}>;
|
|
18
|
+
filterDate?: (date: Date) => boolean;
|
|
19
|
+
maxDate?: Date;
|
|
20
|
+
minDate?: Date;
|
|
21
|
+
onInputError?: (err: {
|
|
22
|
+
code: number;
|
|
23
|
+
msg: string;
|
|
24
|
+
}) => void;
|
|
25
|
+
placeholderText?: string;
|
|
26
|
+
readOnly?: boolean;
|
|
27
|
+
value?: string;
|
|
28
|
+
selectsRange?: boolean;
|
|
29
|
+
isClearable?: boolean;
|
|
30
|
+
selectsStart?: boolean;
|
|
31
|
+
selectsEnd?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const Datepicker: React.FC<DatePickerProps>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "react-datepicker/dist/react-datepicker.css";
|
|
3
|
+
import DatePicker from "react-datepicker";
|
|
4
|
+
import ptBR from "date-fns/locale/pt-BR";
|
|
5
|
+
import "./datepicker.style.css";
|
|
6
|
+
import { TextInput } from "../text-input";
|
|
7
|
+
const CustomInput = forwardRef((props, ref) => (React.createElement("div", { ref: ref },
|
|
8
|
+
React.createElement(TextInput, Object.assign({ label: props.label }, props)))));
|
|
9
|
+
export const Datepicker = (props) => {
|
|
10
|
+
return (React.createElement(DatePicker, Object.assign({ className: "react-datepicker__input", dateFormat: "dd/MM/yyyy", locale: ptBR, customInput: React.createElement(CustomInput, { label: props.label }) }, props)));
|
|
11
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
.react-datepicker-wrapper {
|
|
2
|
+
width: initial;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.react-datepicker__input-container {
|
|
6
|
+
width: calc(100% + 26px);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.react-datepicker__input {
|
|
10
|
+
border: 2px solid #007681;
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
color: #004851;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.react-datepicker {
|
|
17
|
+
border: 2px solid #007681;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.react-datepicker__header {
|
|
22
|
+
background-color: #007681;
|
|
23
|
+
border: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.react-datepicker__current-month {
|
|
27
|
+
color: #fff;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.react-datepicker__day-name {
|
|
31
|
+
color: #fff;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.react-datepicker__day {
|
|
35
|
+
color: #004852;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.react-datepicker__day--selected,
|
|
39
|
+
.react-datepicker__day--in-selecting-range,
|
|
40
|
+
.react-datepicker__day--in-range {
|
|
41
|
+
background-color: #007681;
|
|
42
|
+
color: #fff;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.react-datepicker__day--selected:hover,
|
|
46
|
+
.react-datepicker__day--in-selecting-range:hover,
|
|
47
|
+
.react-datepicker__day--in-range:hover {
|
|
48
|
+
background-color: #007681;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.react-datepicker__day--keyboard-selected {
|
|
52
|
+
background-color: #00768120;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.react-datepicker__day--today:not(.react-datepicker__day--selected) {
|
|
56
|
+
position: relative;
|
|
57
|
+
color: #00dcc0;
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
}
|
|
61
|
+
.react-datepicker__day--today:not(.react-datepicker__day--selected)::after {
|
|
62
|
+
content: "";
|
|
63
|
+
position: absolute;
|
|
64
|
+
width: 4px;
|
|
65
|
+
height: 4px;
|
|
66
|
+
background: #3cdbc0;
|
|
67
|
+
border-radius: 10px;
|
|
68
|
+
bottom: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.react-datepicker__day--outside-month {
|
|
72
|
+
opacity: 0.5;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.react-datepicker__triangle {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.react-datepicker__navigation-icon {
|
|
80
|
+
top: 0;
|
|
81
|
+
font-size: initial;
|
|
82
|
+
}
|
|
83
|
+
.react-datepicker__navigation-icon::before {
|
|
84
|
+
border-color: #fff;
|
|
85
|
+
border-width: 2px 2px 0px 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.react-datepicker__navigation-icon--previous {
|
|
89
|
+
right: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.react-datepicker__navigation-icon--next {
|
|
93
|
+
left: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.react-datepicker__close-icon::after {
|
|
97
|
+
color: #004851;
|
|
98
|
+
background-color: unset;
|
|
99
|
+
font-size: 20px;
|
|
100
|
+
font-weight: 500;
|
|
101
|
+
width: 20px;
|
|
102
|
+
right: 2px;
|
|
103
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./datepicker.component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./datepicker.component";
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import React from "react";
|
|
2
13
|
import { colors } from "../../constants";
|
|
3
14
|
import { StyledTag } from "./disclaimer.styled";
|
|
@@ -7,6 +18,7 @@ const colorByType = {
|
|
|
7
18
|
error: { fontColor: red, backgroundColor: backgroundRed },
|
|
8
19
|
success: { fontColor: darkGreen, backgroundColor: backgroundGreen },
|
|
9
20
|
};
|
|
10
|
-
export const Disclaimer = (
|
|
11
|
-
|
|
21
|
+
export const Disclaimer = (_a) => {
|
|
22
|
+
var { children, type = "warning", fontSize, marginTop } = _a, props = __rest(_a, ["children", "type", "fontSize", "marginTop"]);
|
|
23
|
+
return (React.createElement(StyledTag, Object.assign({ customColors: colorByType[type], fontSize: fontSize, marginTop: marginTop }, props), children));
|
|
12
24
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
13
|
+
import { StyledChevron, StyledContainer, StyledContent, StyledTrigger, } from "./dropdown.styled";
|
|
14
|
+
const Context = React.createContext({});
|
|
15
|
+
export const Dropdown = (_a) => {
|
|
16
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
17
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
18
|
+
const contextValue = {
|
|
19
|
+
isOpen,
|
|
20
|
+
toggleContent: () => setIsOpen(!isOpen),
|
|
21
|
+
};
|
|
22
|
+
return (React.createElement(Context.Provider, { value: contextValue },
|
|
23
|
+
React.createElement(StyledContainer, Object.assign({}, props), children)));
|
|
24
|
+
};
|
|
25
|
+
const Trigger = (_a) => {
|
|
26
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
27
|
+
const { isOpen, toggleContent } = useContext(Context);
|
|
28
|
+
return (React.createElement(StyledTrigger, Object.assign({ "data-state": getState(isOpen), onClick: toggleContent }, props),
|
|
29
|
+
children,
|
|
30
|
+
React.createElement(StyledChevron, null)));
|
|
31
|
+
};
|
|
32
|
+
const Content = (_a) => {
|
|
33
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
34
|
+
const { isOpen } = useContext(Context);
|
|
35
|
+
const [height, setHeight] = useState(0);
|
|
36
|
+
const ref = useRef(null);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setHeight(ref.current.clientHeight);
|
|
39
|
+
}, []);
|
|
40
|
+
return (React.createElement(StyledContent, Object.assign({ ref: ref, "data-state": getState(isOpen), style: {
|
|
41
|
+
[`--content-height`]: height ? `${height}px` : undefined,
|
|
42
|
+
} }, props), children));
|
|
43
|
+
};
|
|
44
|
+
Dropdown.Trigger = Trigger;
|
|
45
|
+
Dropdown.Content = Content;
|
|
46
|
+
function getState(open) {
|
|
47
|
+
return open ? "open" : "closed";
|
|
48
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledChevron: import("styled-components").StyledComponent<import("react").FunctionComponent<import("react").SVGAttributes<HTMLOrSVGElement>>, any, {}, never>;
|
|
3
|
+
export declare const StyledContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const StyledTrigger: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
5
|
+
export declare const StyledContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import styled, { keyframes } from "styled-components";
|
|
2
|
+
import { DropdownIcon } from "../../assets/icons";
|
|
3
|
+
const open = keyframes({
|
|
4
|
+
from: { height: 0 },
|
|
5
|
+
to: { height: "var(--content-height)" },
|
|
6
|
+
});
|
|
7
|
+
const close = keyframes({
|
|
8
|
+
from: { height: "var(--content-height)" },
|
|
9
|
+
to: { height: 0 },
|
|
10
|
+
});
|
|
11
|
+
export const StyledChevron = styled(DropdownIcon) `
|
|
12
|
+
transition: transform 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
13
|
+
[data-state="open"] & {
|
|
14
|
+
transform: rotate(180deg);
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
export const StyledContainer = styled.div ``;
|
|
18
|
+
export const StyledTrigger = styled.button `
|
|
19
|
+
width: 100%;
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
border: 0;
|
|
24
|
+
background: none;
|
|
25
|
+
padding: 6px 12px;
|
|
26
|
+
border-radius: 8px;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
transition: 0.2s;
|
|
29
|
+
|
|
30
|
+
:hover {
|
|
31
|
+
background: rgba(0, 0, 0, 0.1);
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
export const StyledContent = styled.div `
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
|
|
37
|
+
&[data-state="open"] {
|
|
38
|
+
animation: ${open} 300ms cubic-bezier(0.87, 0, 0.13, 1) forwards;
|
|
39
|
+
}
|
|
40
|
+
&[data-state="closed"] {
|
|
41
|
+
animation: ${close} 300ms cubic-bezier(0.87, 0, 0.13, 1) forwards;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dropdown.component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dropdown.component";
|
|
@@ -7,13 +7,14 @@ export const ScoreButton = styled.button `
|
|
|
7
7
|
width: 28px;
|
|
8
8
|
height: 28px;
|
|
9
9
|
line-height: 14px;
|
|
10
|
-
color: ${colors.textGreen};
|
|
11
10
|
cursor: pointer;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
${({ active }) => `
|
|
12
|
+
color: ${active ? colors.white : colors.textGreen};
|
|
13
|
+
background-color: ${active ? colors.darkGreen : colors.lightGrey};
|
|
14
|
+
:hover {
|
|
15
|
+
background-color: ${!active && colors.grey}
|
|
16
|
+
}
|
|
17
|
+
`}
|
|
17
18
|
`;
|
|
18
19
|
export const FeedbackInputContainer = styled.div `
|
|
19
20
|
display: flex;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyledGridItemProps } from "./grid.styled";
|
|
3
|
-
|
|
3
|
+
type Proportion = "1/2" | "2/2";
|
|
4
4
|
interface GridItemProps extends StyledGridItemProps {
|
|
5
5
|
proportion?: Proportion;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type GridType = {
|
|
8
8
|
Item: React.FunctionComponent<GridItemProps>;
|
|
9
9
|
};
|
|
10
10
|
export declare const Grid: React.FunctionComponent & GridType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const StyledGridContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type SmallSpan = 1 | 2 | 3 | 4;
|
|
3
|
+
type LargeSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
4
4
|
interface GridSpan {
|
|
5
5
|
xs?: SmallSpan;
|
|
6
6
|
md?: LargeSpan;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { HorizontalTimelineBarProps, HorizontalTimelineNodeProps } from "./horizontalTimeline.styled";
|
|
3
|
-
|
|
3
|
+
type HorizontalTimelineType = {
|
|
4
4
|
Bar: React.FunctionComponent<HorizontalTimelineBarProps>;
|
|
5
5
|
Node: React.FunctionComponent<HorizontalTimelineNodeProps>;
|
|
6
6
|
};
|
package/dist/components/index.js
CHANGED