w-design-system 0.0.83 → 0.0.85
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/.storybook/main.ts +8 -5
- package/.storybook/preview.ts +4 -13
- package/dist/components/Banner/index.d.ts +1 -1
- package/dist/components/Banner/styles.d.ts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/styles.d.ts +2 -2
- package/dist/components/Button/test.d.ts +0 -1
- package/dist/components/ButtonRadiusIcon/index.d.ts +1 -1
- package/dist/components/ButtonRadiusIcon/styles.d.ts +1 -1
- package/dist/components/ButtonRound/index.d.ts +1 -1
- package/dist/components/ButtonRound/styles.d.ts +1 -1
- package/dist/components/CardStories/index.d.ts +1 -1
- package/dist/components/CardStories/index.d.ts.map +1 -1
- package/dist/components/CardStories/stories.d.ts +2 -2
- package/dist/components/CountryStateSelector/index.d.ts +1 -2
- package/dist/components/DatePicker/index.d.ts +2 -7
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/index.d.ts +1 -1
- package/dist/components/DateRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/styles.d.ts +7 -7
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/stories.d.ts +1 -1
- package/dist/components/EmptyState/styles.d.ts +1 -1
- package/dist/components/IconWrapper/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/styles.d.ts +6 -6
- package/dist/components/InputTag/index.d.ts +1 -1
- package/dist/components/InputTag/index.d.ts.map +1 -1
- package/dist/components/InputTag/styles.d.ts +6 -6
- package/dist/components/Loading/index.d.ts +1 -1
- package/dist/components/Loading/stories.d.ts +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/styles.d.ts +2 -2
- package/dist/components/MultiSelect/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Paginate/index.d.ts +1 -1
- package/dist/components/Paginate/index.d.ts.map +1 -1
- package/dist/components/Paginate/styles.d.ts +1 -1
- package/dist/components/Paragraph/index.d.ts +1 -1
- package/dist/components/Paragraph/stories.d.ts +1 -1
- package/dist/components/PortalSelect/index.d.ts +1 -1
- package/dist/components/PortalSelect/styles.d.ts +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/styles.d.ts +9 -9
- package/dist/components/Sidebar/SidebarGroup/index.d.ts +1 -2
- package/dist/components/Sidebar/SidebarGroup/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarGroup/styles.d.ts +3 -3
- package/dist/components/Sidebar/SidebarItem/index.d.ts +1 -1
- package/dist/components/Sidebar/SidebarItem/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarItem/styles.d.ts +2 -2
- package/dist/components/Sidebar/SidebarLogo/index.d.ts +1 -1
- package/dist/components/Sidebar/SidebarLogo/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarLogo/styles.d.ts +1 -1
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/styles.d.ts +4 -4
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/stories.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tabs/styles.d.ts +2 -2
- package/dist/components/Title/index.d.ts +1 -1
- package/dist/components/Title/stories.d.ts +1 -1
- package/dist/favicon.ico +0 -0
- package/dist/index.html +43 -0
- package/dist/logo192.png +0 -0
- package/dist/logo512.png +0 -0
- package/dist/manifest.json +25 -0
- package/dist/robots.txt +3 -0
- package/dist/setupTests.d.ts +0 -1
- package/dist/src/globalStyles.d.ts +1 -1
- package/dist/stories/Button.d.ts +1 -2
- package/dist/stories/Button.d.ts.map +1 -1
- package/dist/stories/Button.stories.d.ts +3 -3
- package/dist/stories/Header.d.ts +1 -2
- package/dist/stories/Header.d.ts.map +1 -1
- package/dist/stories/Header.stories.d.ts +5 -5
- package/dist/stories/Page.d.ts +1 -2
- package/dist/stories/Page.stories.d.ts +2 -2
- package/dist/w-design-system.es.js +4656 -0
- package/dist/w-design-system.umd.js +1412 -0
- package/eslint.config.ts +21 -0
- package/package.json +28 -45
- package/prettier.config.js +11 -0
- package/src/components/Input/index.tsx +3 -6
- package/src/components/InputTag/index.tsx +3 -5
- package/src/components/Select/styles.ts +1 -1
- package/tsconfig.json +5 -18
- package/vite.config.ts +31 -0
- package/.babelrc +0 -8
- package/dist/assets/icon/index.js +0 -41
- package/dist/assets/icon/index.js.map +0 -1
- package/dist/components/Banner/index.js +0 -44
- package/dist/components/Banner/index.js.map +0 -1
- package/dist/components/Banner/stories.js +0 -25
- package/dist/components/Banner/stories.js.map +0 -1
- package/dist/components/Banner/styles.js +0 -56
- package/dist/components/Banner/styles.js.map +0 -1
- package/dist/components/Button/index.js +0 -66
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Button/stories.js +0 -88
- package/dist/components/Button/stories.js.map +0 -1
- package/dist/components/Button/styles.js +0 -217
- package/dist/components/Button/styles.js.map +0 -1
- package/dist/components/Button/test.js +0 -33
- package/dist/components/Button/test.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/index.js +0 -25
- package/dist/components/ButtonRadiusIcon/index.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/stories.js +0 -42
- package/dist/components/ButtonRadiusIcon/stories.js.map +0 -1
- package/dist/components/ButtonRadiusIcon/styles.js +0 -150
- package/dist/components/ButtonRadiusIcon/styles.js.map +0 -1
- package/dist/components/ButtonRound/index.js +0 -21
- package/dist/components/ButtonRound/index.js.map +0 -1
- package/dist/components/ButtonRound/stories.js +0 -43
- package/dist/components/ButtonRound/stories.js.map +0 -1
- package/dist/components/ButtonRound/styles.js +0 -134
- package/dist/components/ButtonRound/styles.js.map +0 -1
- package/dist/components/CardStories/index.js +0 -43
- package/dist/components/CardStories/index.js.map +0 -1
- package/dist/components/CardStories/stories.js +0 -35
- package/dist/components/CardStories/stories.js.map +0 -1
- package/dist/components/CountryStateSelector/index.js +0 -106
- package/dist/components/CountryStateSelector/index.js.map +0 -1
- package/dist/components/CountryStateSelector/stories.js +0 -46
- package/dist/components/CountryStateSelector/stories.js.map +0 -1
- package/dist/components/DatePicker/index.js +0 -22
- package/dist/components/DatePicker/index.js.map +0 -1
- package/dist/components/DatePicker/stories.js +0 -61
- package/dist/components/DatePicker/stories.js.map +0 -1
- package/dist/components/DateRangePicker/index.js +0 -187
- package/dist/components/DateRangePicker/index.js.map +0 -1
- package/dist/components/DateRangePicker/stories.js +0 -65
- package/dist/components/DateRangePicker/stories.js.map +0 -1
- package/dist/components/DateRangePicker/styles.js +0 -122
- package/dist/components/DateRangePicker/styles.js.map +0 -1
- package/dist/components/EmptyState/index.js +0 -14
- package/dist/components/EmptyState/index.js.map +0 -1
- package/dist/components/EmptyState/stories.js +0 -31
- package/dist/components/EmptyState/stories.js.map +0 -1
- package/dist/components/EmptyState/styles.js +0 -29
- package/dist/components/EmptyState/styles.js.map +0 -1
- package/dist/components/IconWrapper/index.js +0 -34
- package/dist/components/IconWrapper/index.js.map +0 -1
- package/dist/components/Input/index.js +0 -91
- package/dist/components/Input/index.js.map +0 -1
- package/dist/components/Input/stories.js +0 -55
- package/dist/components/Input/stories.js.map +0 -1
- package/dist/components/Input/styles.js +0 -86
- package/dist/components/Input/styles.js.map +0 -1
- package/dist/components/InputTag/index.js +0 -124
- package/dist/components/InputTag/index.js.map +0 -1
- package/dist/components/InputTag/stories.js +0 -25
- package/dist/components/InputTag/stories.js.map +0 -1
- package/dist/components/InputTag/styles.js +0 -146
- package/dist/components/InputTag/styles.js.map +0 -1
- package/dist/components/Loading/index.js +0 -50
- package/dist/components/Loading/index.js.map +0 -1
- package/dist/components/Loading/stories.js +0 -46
- package/dist/components/Loading/stories.js.map +0 -1
- package/dist/components/Modal/index.js +0 -31
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/components/Modal/stories.js +0 -24
- package/dist/components/Modal/stories.js.map +0 -1
- package/dist/components/Modal/styles.js +0 -48
- package/dist/components/Modal/styles.js.map +0 -1
- package/dist/components/MultiSelect/index.js +0 -284
- package/dist/components/MultiSelect/index.js.map +0 -1
- package/dist/components/MultiSelect/stories.js +0 -39
- package/dist/components/MultiSelect/stories.js.map +0 -1
- package/dist/components/MultiSelect/styles.d.ts +0 -14
- package/dist/components/MultiSelect/styles.d.ts.map +0 -1
- package/dist/components/MultiSelect/styles.js +0 -66
- package/dist/components/MultiSelect/styles.js.map +0 -1
- package/dist/components/Paginate/index.js +0 -63
- package/dist/components/Paginate/index.js.map +0 -1
- package/dist/components/Paginate/stories.js +0 -44
- package/dist/components/Paginate/stories.js.map +0 -1
- package/dist/components/Paginate/styles.js +0 -64
- package/dist/components/Paginate/styles.js.map +0 -1
- package/dist/components/Paragraph/index.js +0 -51
- package/dist/components/Paragraph/index.js.map +0 -1
- package/dist/components/Paragraph/stories.js +0 -113
- package/dist/components/Paragraph/stories.js.map +0 -1
- package/dist/components/PortalSelect/index.js +0 -141
- package/dist/components/PortalSelect/index.js.map +0 -1
- package/dist/components/PortalSelect/stories.js +0 -82
- package/dist/components/PortalSelect/stories.js.map +0 -1
- package/dist/components/PortalSelect/styles.js +0 -9
- package/dist/components/PortalSelect/styles.js.map +0 -1
- package/dist/components/Select/index.js +0 -260
- package/dist/components/Select/index.js.map +0 -1
- package/dist/components/Select/stories.js +0 -40
- package/dist/components/Select/stories.js.map +0 -1
- package/dist/components/Select/styles.js +0 -90
- package/dist/components/Select/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarGroup/index.js +0 -42
- package/dist/components/Sidebar/SidebarGroup/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarGroup/styles.js +0 -68
- package/dist/components/Sidebar/SidebarGroup/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarItem/index.js +0 -26
- package/dist/components/Sidebar/SidebarItem/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarItem/styles.js +0 -64
- package/dist/components/Sidebar/SidebarItem/styles.js.map +0 -1
- package/dist/components/Sidebar/SidebarLogo/index.js +0 -12
- package/dist/components/Sidebar/SidebarLogo/index.js.map +0 -1
- package/dist/components/Sidebar/SidebarLogo/styles.js +0 -48
- package/dist/components/Sidebar/SidebarLogo/styles.js.map +0 -1
- package/dist/components/Sidebar/index.js +0 -45
- package/dist/components/Sidebar/index.js.map +0 -1
- package/dist/components/Sidebar/stories.js +0 -94
- package/dist/components/Sidebar/stories.js.map +0 -1
- package/dist/components/Sidebar/styles.js +0 -73
- package/dist/components/Sidebar/styles.js.map +0 -1
- package/dist/components/Table/index.js +0 -95
- package/dist/components/Table/index.js.map +0 -1
- package/dist/components/Table/stories.js +0 -163
- package/dist/components/Table/stories.js.map +0 -1
- package/dist/components/Table/styles.js +0 -2
- package/dist/components/Table/styles.js.map +0 -1
- package/dist/components/Tabs/index.js +0 -13
- package/dist/components/Tabs/index.js.map +0 -1
- package/dist/components/Tabs/stories.js +0 -31
- package/dist/components/Tabs/stories.js.map +0 -1
- package/dist/components/Tabs/styles.js +0 -22
- package/dist/components/Tabs/styles.js.map +0 -1
- package/dist/components/Themes/index.js +0 -88
- package/dist/components/Themes/index.js.map +0 -1
- package/dist/components/Title/index.js +0 -17
- package/dist/components/Title/index.js.map +0 -1
- package/dist/components/Title/stories.js +0 -61
- package/dist/components/Title/stories.js.map +0 -1
- package/dist/components/Types/index.js +0 -2
- package/dist/components/Types/index.js.map +0 -1
- package/dist/components/index.js +0 -16
- package/dist/components/index.js.map +0 -1
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -1
- package/dist/prettier.config.js +0 -13
- package/dist/prettier.config.js.map +0 -1
- package/dist/reportWebVitals.d.ts +0 -4
- package/dist/reportWebVitals.d.ts.map +0 -1
- package/dist/reportWebVitals.js +0 -14
- package/dist/reportWebVitals.js.map +0 -1
- package/dist/setupTests.js +0 -6
- package/dist/setupTests.js.map +0 -1
- package/dist/src/globalStyles.js +0 -15
- package/dist/src/globalStyles.js.map +0 -1
- package/dist/stories/Button.js +0 -22
- package/dist/stories/Button.js.map +0 -1
- package/dist/stories/Button.stories.js +0 -45
- package/dist/stories/Button.stories.js.map +0 -1
- package/dist/stories/Header.js +0 -21
- package/dist/stories/Header.js.map +0 -1
- package/dist/stories/Header.stories.js +0 -27
- package/dist/stories/Header.stories.js.map +0 -1
- package/dist/stories/Page.js +0 -38
- package/dist/stories/Page.js.map +0 -1
- package/dist/stories/Page.stories.js +0 -34
- package/dist/stories/Page.stories.js.map +0 -1
- package/dist/utils/constanst.js +0 -3
- package/dist/utils/constanst.js.map +0 -1
- package/src/reportWebVitals.ts +0 -16
|
@@ -1,187 +0,0 @@
|
|
|
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, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
|
-
import { calendarSVG, chevronLeftSVG, chevronRightSVG } from '../../assets/icon';
|
|
14
|
-
import { IconWrapper } from '../IconWrapper';
|
|
15
|
-
import { Select } from '../Select';
|
|
16
|
-
import { theme } from '../Themes';
|
|
17
|
-
import { CalendarDay, CalendarDaySelectedBackground, CalendarDayValue, CalendarGrid, CalendarHeader, CalendarWeekDayLabel, Footer, } from './styles';
|
|
18
|
-
const monthNames = [
|
|
19
|
-
'Janeiro',
|
|
20
|
-
'Fevereiro',
|
|
21
|
-
'Março',
|
|
22
|
-
'Abril',
|
|
23
|
-
'Maio',
|
|
24
|
-
'Junho',
|
|
25
|
-
'Julho',
|
|
26
|
-
'Agosto',
|
|
27
|
-
'Setembro',
|
|
28
|
-
'Outubro',
|
|
29
|
-
'Novembro',
|
|
30
|
-
'Dezembro',
|
|
31
|
-
];
|
|
32
|
-
const weekDays = ['DOM', 'SEG', 'TER', 'QUA', 'QUI', 'SEX', 'SAB'];
|
|
33
|
-
export const DateRangePicker = (_a) => {
|
|
34
|
-
var _b, _c, _d, _e;
|
|
35
|
-
var { label, options, selectedOption, onSelectedOptionChange, placeholder, onSelectedCustomRange, startCustomDate, endCustomDate, isRange, rangeDayLimit, footerMessage, onOpenChange } = _a, props = __rest(_a, ["label", "options", "selectedOption", "onSelectedOptionChange", "placeholder", "onSelectedCustomRange", "startCustomDate", "endCustomDate", "isRange", "rangeDayLimit", "footerMessage", "onOpenChange"]);
|
|
36
|
-
const [currentYear, setCurrentYear] = useState(0);
|
|
37
|
-
const [currentMonth, setCurrentMonth] = useState(0);
|
|
38
|
-
const [currentMouseHoverDate, setCurrentMouseHoverDate] = useState(null);
|
|
39
|
-
const selectRef = useRef(null);
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
const date = new Date();
|
|
42
|
-
setCurrentYear(date.getFullYear());
|
|
43
|
-
setCurrentMonth(date.getMonth());
|
|
44
|
-
}, []);
|
|
45
|
-
const resetTime = useCallback((date) => {
|
|
46
|
-
if (!date)
|
|
47
|
-
return null;
|
|
48
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
|
|
49
|
-
}, []);
|
|
50
|
-
const days = [];
|
|
51
|
-
const changeMonth = (delta) => {
|
|
52
|
-
const newDate = new Date(currentYear, currentMonth + delta);
|
|
53
|
-
setCurrentYear(newDate.getFullYear());
|
|
54
|
-
setCurrentMonth(newDate.getMonth());
|
|
55
|
-
};
|
|
56
|
-
const onSelectedOptionChangeHandler = (option) => {
|
|
57
|
-
var _a;
|
|
58
|
-
if (onSelectedOptionChange) {
|
|
59
|
-
onSelectedOptionChange(option);
|
|
60
|
-
if (onSelectedCustomRange)
|
|
61
|
-
onSelectedCustomRange(null, null);
|
|
62
|
-
(_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(false);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const differenceInDays = (date1, date2) => {
|
|
66
|
-
const diffTime = Math.abs(date2.getTime() - date1.getTime());
|
|
67
|
-
return Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
68
|
-
};
|
|
69
|
-
const onDayClick = (date) => {
|
|
70
|
-
var _a, _b, _c;
|
|
71
|
-
if (onSelectedOptionChange)
|
|
72
|
-
onSelectedOptionChange(null);
|
|
73
|
-
if (!startCustomDate) {
|
|
74
|
-
onSelectedCustomRange && onSelectedCustomRange(date, null);
|
|
75
|
-
currentMouseHoverDate && setCurrentMouseHoverDate(resetTime(date));
|
|
76
|
-
if (isRange === false)
|
|
77
|
-
(_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(false);
|
|
78
|
-
}
|
|
79
|
-
else if (!endCustomDate) {
|
|
80
|
-
let firstDate = startCustomDate;
|
|
81
|
-
let secondDate = date;
|
|
82
|
-
if (firstDate && secondDate && firstDate > secondDate) {
|
|
83
|
-
const temp = firstDate;
|
|
84
|
-
firstDate = secondDate;
|
|
85
|
-
secondDate = temp;
|
|
86
|
-
}
|
|
87
|
-
onSelectedCustomRange && onSelectedCustomRange(firstDate, secondDate);
|
|
88
|
-
(_b = selectRef.current) === null || _b === void 0 ? void 0 : _b.setOpen(false);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
if (isRange === false)
|
|
92
|
-
(_c = selectRef.current) === null || _c === void 0 ? void 0 : _c.setOpen(false);
|
|
93
|
-
onSelectedCustomRange && onSelectedCustomRange(date, null);
|
|
94
|
-
setCurrentMouseHoverDate(resetTime(date));
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const onOpenChangeHandler = (open) => {
|
|
98
|
-
if (!open && startCustomDate && !endCustomDate) {
|
|
99
|
-
let firstDate = startCustomDate;
|
|
100
|
-
let secondDate = startCustomDate;
|
|
101
|
-
onSelectedCustomRange && onSelectedCustomRange(firstDate, secondDate);
|
|
102
|
-
}
|
|
103
|
-
onOpenChange && onOpenChange(open);
|
|
104
|
-
};
|
|
105
|
-
const onMouseEnter = (date) => {
|
|
106
|
-
if (startCustomDate && !endCustomDate) {
|
|
107
|
-
setCurrentMouseHoverDate(resetTime(date));
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
const onMouseLeave = (date) => { };
|
|
111
|
-
const day = new Date(currentYear, currentMonth, 1);
|
|
112
|
-
for (let i = 0; i < day.getDay(); i++) {
|
|
113
|
-
days.push({ type: 'empty', key: `before-${i}` });
|
|
114
|
-
}
|
|
115
|
-
const todayString = new Date().toDateString();
|
|
116
|
-
let firstDate = resetTime(startCustomDate);
|
|
117
|
-
let secondDate = (_b = resetTime(endCustomDate)) !== null && _b !== void 0 ? _b : currentMouseHoverDate;
|
|
118
|
-
if (firstDate && secondDate && firstDate > secondDate) {
|
|
119
|
-
const temp = firstDate;
|
|
120
|
-
firstDate = secondDate;
|
|
121
|
-
secondDate = temp;
|
|
122
|
-
}
|
|
123
|
-
while (day.getMonth() === currentMonth) {
|
|
124
|
-
const isSelected = (_c = (firstDate && secondDate && day >= firstDate && day <= secondDate)) !== null && _c !== void 0 ? _c : false;
|
|
125
|
-
let isBlocked = false;
|
|
126
|
-
if (rangeDayLimit !== undefined && startCustomDate && endCustomDate === null) {
|
|
127
|
-
const diff = differenceInDays(startCustomDate, day);
|
|
128
|
-
isBlocked = diff > rangeDayLimit - 1;
|
|
129
|
-
}
|
|
130
|
-
days.push({
|
|
131
|
-
type: 'day',
|
|
132
|
-
value: day.getDate(),
|
|
133
|
-
today: day.toDateString() === todayString,
|
|
134
|
-
selected: isSelected,
|
|
135
|
-
date: resetTime(new Date(day)),
|
|
136
|
-
isFirstSelected: (_d = (firstDate && firstDate.toDateString() === day.toDateString())) !== null && _d !== void 0 ? _d : false,
|
|
137
|
-
isLastSelected: (_e = (secondDate && secondDate.toDateString() === day.toDateString())) !== null && _e !== void 0 ? _e : false,
|
|
138
|
-
isBlocked,
|
|
139
|
-
});
|
|
140
|
-
day.setDate(day.getDate() + 1);
|
|
141
|
-
}
|
|
142
|
-
const value = useMemo(() => {
|
|
143
|
-
if (selectedOption !== null)
|
|
144
|
-
return '';
|
|
145
|
-
if (!firstDate && !secondDate)
|
|
146
|
-
return '';
|
|
147
|
-
if (firstDate && !secondDate)
|
|
148
|
-
return firstDate.toLocaleDateString();
|
|
149
|
-
if (secondDate && (firstDate === null || firstDate === void 0 ? void 0 : firstDate.toLocaleDateString()) === secondDate.toLocaleDateString())
|
|
150
|
-
return firstDate.toLocaleDateString();
|
|
151
|
-
if (firstDate && secondDate)
|
|
152
|
-
return `${firstDate.toLocaleDateString()} - ${secondDate.toLocaleDateString()}`;
|
|
153
|
-
return '';
|
|
154
|
-
}, [selectedOption, firstDate, secondDate]);
|
|
155
|
-
placeholder = placeholder !== null && placeholder !== void 0 ? placeholder : 'Selecione um período';
|
|
156
|
-
const { customOption, optionComputed } = useMemo(() => {
|
|
157
|
-
if (options && options.length > 0) {
|
|
158
|
-
const customOptionId = Math.max(...options.map(option => { var _a; return (_a = option.id) !== null && _a !== void 0 ? _a : 0; })) + 1;
|
|
159
|
-
const customOption = {
|
|
160
|
-
text: 'Período Personalizado',
|
|
161
|
-
id: customOptionId,
|
|
162
|
-
};
|
|
163
|
-
const optionComputed = [...options, customOption];
|
|
164
|
-
return { customOption, optionComputed };
|
|
165
|
-
}
|
|
166
|
-
return { customOption: null, optionComputed: [] };
|
|
167
|
-
}, [options]);
|
|
168
|
-
return (React.createElement(Select, Object.assign({ disableSearch: true, dropDownWidth: "284px", dropDownMaxHeight: "auto", ref: selectRef, placeholder: placeholder, label: label, value: value, leftIcon: React.createElement(IconWrapper, { className: "icon", src: calendarSVG, width: "20px", height: "20px", color: theme.colors.shade30 }), options: optionComputed, selectedOption: selectedOption !== null && selectedOption !== void 0 ? selectedOption : (firstDate ? customOption : null), onOptionChange: onSelectedOptionChangeHandler, onOpenChange: onOpenChangeHandler }, props),
|
|
169
|
-
React.createElement(CalendarHeader, null,
|
|
170
|
-
React.createElement(IconWrapper, { className: "icon", src: chevronLeftSVG, width: "14px", onClick: () => changeMonth(-1) }),
|
|
171
|
-
monthNames[currentMonth],
|
|
172
|
-
" ",
|
|
173
|
-
currentYear,
|
|
174
|
-
React.createElement(IconWrapper, { className: "icon", src: chevronRightSVG, width: "14px", onClick: () => changeMonth(1) })),
|
|
175
|
-
React.createElement(CalendarGrid, null,
|
|
176
|
-
weekDays.map(weekDay => (React.createElement(CalendarWeekDayLabel, { key: weekDay }, weekDay))),
|
|
177
|
-
days.map(day => {
|
|
178
|
-
if (day.type === 'empty') {
|
|
179
|
-
return React.createElement("div", { key: day.key });
|
|
180
|
-
}
|
|
181
|
-
return (React.createElement(CalendarDay, { "$isFirstSelected": day.isFirstSelected, "$isLastSelected": day.isLastSelected, "$isBlocked": day.isBlocked, key: day.value, "$today": day.today, onClick: () => !day.isBlocked && onDayClick(day.date), onMouseEnter: () => !day.isBlocked && onMouseEnter(day.date), onMouseLeave: () => !day.isBlocked && onMouseLeave(day.date) },
|
|
182
|
-
React.createElement(CalendarDaySelectedBackground, { "$isFirstSelected": day.isFirstSelected, "$isLastSelected": day.isLastSelected, "$selected": day.selected, "$today": day.today, "$isBlocked": day.isBlocked }),
|
|
183
|
-
React.createElement(CalendarDayValue, null, day.value)));
|
|
184
|
-
})),
|
|
185
|
-
footerMessage && React.createElement(Footer, null, footerMessage)));
|
|
186
|
-
};
|
|
187
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src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O,CAAwB,CACrE,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACd,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;oBACzB,OAAO,6BAAK,GAAG,EAAE,GAAG,CAAC,GAAG,GAAQ,CAAA;gBAClC,CAAC;gBACD,OAAO,CACL,oBAAC,WAAW,wBACQ,GAAG,CAAC,eAAe,qBACpB,GAAG,CAAC,cAAc,gBACvB,GAAG,CAAC,SAAS,EACzB,GAAG,EAAE,GAAG,CAAC,KAAK,YACN,GAAG,CAAC,KAAK,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EACrD,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAC5D,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;oBAE5D,oBAAC,6BAA6B,wBACV,GAAG,CAAC,eAAe,qBACpB,GAAG,CAAC,cAAc,eACxB,GAAG,CAAC,QAAQ,YACf,GAAG,CAAC,KAAK,gBACL,GAAG,CAAC,SAAS,GACzB;oBACF,oBAAC,gBAAgB,QAAE,GAAG,CAAC,KAAK,CAAoB,CACpC,CACf,CAAA;YACH,CAAC,CAAC,CACW;QACd,aAAa,IAAI,oBAAC,MAAM,QAAE,aAAa,CAAU,CAC3C,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,65 +0,0 @@
|
|
|
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 from 'react';
|
|
13
|
-
import { DateRangePicker } from './index';
|
|
14
|
-
const meta = {
|
|
15
|
-
title: 'Components/DateRangePicker',
|
|
16
|
-
component: DateRangePicker,
|
|
17
|
-
tags: ['autodocs'],
|
|
18
|
-
argTypes: {
|
|
19
|
-
placeholder: { control: 'text' },
|
|
20
|
-
label: { control: 'text' },
|
|
21
|
-
readonly: { control: 'boolean' },
|
|
22
|
-
disabled: { control: 'boolean' },
|
|
23
|
-
selectedOption: { control: 'number' },
|
|
24
|
-
startCustomDate: { control: 'date' },
|
|
25
|
-
endCustomDate: { control: 'date' },
|
|
26
|
-
onSelectedOptionChange: { action: 'selectedOptionChange' },
|
|
27
|
-
onSelectedCustomRange: { action: 'selectedCustomRange' },
|
|
28
|
-
rangeDayLimit: { control: 'number' },
|
|
29
|
-
footerMessage: { control: 'text' },
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export default meta;
|
|
33
|
-
const ComponentWrapper = (_a) => {
|
|
34
|
-
var { options } = _a, args = __rest(_a, ["options"]);
|
|
35
|
-
const [selectedOption, setSelectOption] = React.useState(null);
|
|
36
|
-
const [startDate, setStartDate] = React.useState(null);
|
|
37
|
-
const [endDate, setEndDate] = React.useState(null);
|
|
38
|
-
return (React.createElement(DateRangePicker, Object.assign({}, args, { selectedOption: selectedOption, startCustomDate: startDate, endCustomDate: endDate, onSelectedCustomRange: (start, end) => {
|
|
39
|
-
setStartDate(start);
|
|
40
|
-
setEndDate(end);
|
|
41
|
-
}, onSelectedOptionChange: option => setSelectOption(option), options: options !== null && options !== void 0 ? options : [
|
|
42
|
-
{
|
|
43
|
-
text: 'Últimos 30 dias',
|
|
44
|
-
id: 30,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
text: 'Últimos 60 dias',
|
|
48
|
-
id: 60,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
text: 'Últimos 90 dias',
|
|
52
|
-
id: 90,
|
|
53
|
-
},
|
|
54
|
-
] })));
|
|
55
|
-
};
|
|
56
|
-
export const SelecionarIntervaloDeDatas = {
|
|
57
|
-
render: args => React.createElement(ComponentWrapper, { label: "Per\u00EDodo da Disputa", placeholder: "Placeholder" }),
|
|
58
|
-
};
|
|
59
|
-
export const SelecionarIntervaloDeDatasSimples = {
|
|
60
|
-
render: args => React.createElement(ComponentWrapper, { options: [] }),
|
|
61
|
-
};
|
|
62
|
-
export const SelecionarIntervaloDeDatasLimitado = {
|
|
63
|
-
render: args => React.createElement(ComponentWrapper, Object.assign({ label: "Per\u00EDodo da Disputa", placeholder: "Placeholder", rangeDayLimit: 15 }, args, { footerMessage: 'O intervalo de pesquisa limita-se ao m\u00E1ximo de 15 dias.' })),
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/DateRangePicker/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAwB,MAAM,SAAS,CAAA;AAE/D,MAAM,IAAI,GAAiC;IACzC,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAChC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1B,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;QAChC,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;QAChC,cAA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,iBAAiB;gBACvB,EAAE,EAAE,EAAE;aACP;YACD;gBACE,IAAI,EAAE,iBAAiB;gBACvB,EAAE,EAAE,EAAE;aACP;SACF,IAEH,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAU;IAC/C,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,oBAAC,gBAAgB,IAAC,KAAK,EAAC,yBAAoB,EAAC,WAAW,EAAC,aAAa,GAAG;CAC1F,CAAA;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAU;IACtD,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,oBAAC,gBAAgB,IAAC,OAAO,EAAE,EAAE,GAAI;CAClD,CAAA;AAED,MAAM,CAAC,MAAM,kCAAkC,GAAU;IACvD,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,oBAAC,gBAAgB,kBAAC,KAAK,EAAC,yBAAoB,EAAC,WAAW,EAAC,aAAa,EAAC,aAAa,EAAE,EAAE,IAAM,IAAI,IAAE,aAAa,EAAC,8DAAyD,IAAG;CAC/L,CAAA"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { theme } from '../Themes';
|
|
3
|
-
export const CalendarGrid = styled.div `
|
|
4
|
-
display: grid;
|
|
5
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
6
|
-
grid-template-columns: repeat(7, 36px);
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-items: center;
|
|
9
|
-
grid-column-gap: 0px;
|
|
10
|
-
grid-row-gap: 0px;
|
|
11
|
-
height: 100%;
|
|
12
|
-
width: 100%;
|
|
13
|
-
font-size: ${theme.paragraph.small};
|
|
14
|
-
color: ${theme.colors.shade50};
|
|
15
|
-
`;
|
|
16
|
-
export const CalendarWeekDayLabel = styled.div `
|
|
17
|
-
font-size: ${theme.paragraph['xx-small']};
|
|
18
|
-
color: ${theme.colors.shade30};
|
|
19
|
-
font-weight: 600;
|
|
20
|
-
margin-bottom: 4px;
|
|
21
|
-
`;
|
|
22
|
-
export const CalendarHeader = styled.div `
|
|
23
|
-
display: flex;
|
|
24
|
-
justify-content: space-between;
|
|
25
|
-
align-items: center;
|
|
26
|
-
font-size: ${theme.paragraph.small};
|
|
27
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
28
|
-
font-weight: 600;
|
|
29
|
-
|
|
30
|
-
.icon,
|
|
31
|
-
.icon svg,
|
|
32
|
-
.icon svg path {
|
|
33
|
-
fill: ${theme.colors.shade50} !important;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.icon:hover,
|
|
37
|
-
.icon:hover svg,
|
|
38
|
-
.icon:hover svg path {
|
|
39
|
-
fill: ${theme.colors.cyan30} !important;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.icon-disabled,
|
|
43
|
-
.icon-disabled svg,
|
|
44
|
-
.icon-disabled svg path {
|
|
45
|
-
fill: ${theme.colors.shade20} !important;
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
export const CalendarDay = styled.div `
|
|
49
|
-
position: relative;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
width: 36px;
|
|
52
|
-
height: 36px;
|
|
53
|
-
color: ${({ $isFirstSelected: isFirstSelected, $isLastSelected: isLastSelected, $isBlocked: isBlocked }) => isFirstSelected || isLastSelected ? theme.colors.white : isBlocked ? theme.colors.shade30 : theme.colors.shade50};
|
|
54
|
-
|
|
55
|
-
&:before {
|
|
56
|
-
position: absolute;
|
|
57
|
-
content: '';
|
|
58
|
-
inset: 0;
|
|
59
|
-
border-radius: 50%;
|
|
60
|
-
pointer-events: none;
|
|
61
|
-
|
|
62
|
-
${({ $today: today, $isFirstSelected: isFirstSelected, $isLastSelected: isLastSelected }) => today && !(isFirstSelected || isLastSelected) ? `border: 1px solid ${theme.colors.cyan40}` : ''};
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
65
|
-
export const CalendarDaySelectedBackground = styled.div `
|
|
66
|
-
position: absolute;
|
|
67
|
-
background-color: ${({ $selected: selected }) => selected && theme.colors.cyan30opacity16};
|
|
68
|
-
width: 100%;
|
|
69
|
-
height: 100%;
|
|
70
|
-
inset: 0;
|
|
71
|
-
|
|
72
|
-
border-radius: ${({ $isFirstSelected: isFirstSelected, $isLastSelected: isLastSelected }) => {
|
|
73
|
-
if (isFirstSelected && isLastSelected)
|
|
74
|
-
return '50%';
|
|
75
|
-
if (isFirstSelected)
|
|
76
|
-
return '50% 0 0 50%';
|
|
77
|
-
if (isLastSelected)
|
|
78
|
-
return '0 50% 50% 0';
|
|
79
|
-
return '0';
|
|
80
|
-
}};
|
|
81
|
-
|
|
82
|
-
&:hover {
|
|
83
|
-
border-radius: ${({ $isFirstSelected: isFirstSelected, $isLastSelected: isLastSelected, $selected: selected }) => {
|
|
84
|
-
if (isFirstSelected && isLastSelected)
|
|
85
|
-
return '50%';
|
|
86
|
-
if (isFirstSelected)
|
|
87
|
-
return '50% 0 0 50%';
|
|
88
|
-
if (isLastSelected)
|
|
89
|
-
return '0 50% 50% 0';
|
|
90
|
-
if (selected)
|
|
91
|
-
return '0';
|
|
92
|
-
return '50%';
|
|
93
|
-
}};
|
|
94
|
-
background-color: ${({ $isBlocked: isBlocked }) => (isBlocked ? 'transparant' : theme.colors.cyan30opacity16)};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&::before {
|
|
98
|
-
content: '';
|
|
99
|
-
border-radius: 50%;
|
|
100
|
-
background-color: ${({ $isFirstSelected: isFirstSelected, $isLastSelected: isLastSelected, $isBlocked: isBlocked }) => (isFirstSelected || isLastSelected) && !isBlocked ? theme.colors.cyan40 : 'transparent'};
|
|
101
|
-
position: absolute;
|
|
102
|
-
inset: 0;
|
|
103
|
-
}
|
|
104
|
-
`;
|
|
105
|
-
export const CalendarDayValue = styled.div `
|
|
106
|
-
position: absolute;
|
|
107
|
-
inset: 0;
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
justify-content: center;
|
|
111
|
-
pointer-events: none;
|
|
112
|
-
`;
|
|
113
|
-
export const Footer = styled.div `
|
|
114
|
-
display: flex;
|
|
115
|
-
justify-content: space-between;
|
|
116
|
-
align-items: center;
|
|
117
|
-
margin-top: 16px;
|
|
118
|
-
font-size: ${theme.paragraph.small};
|
|
119
|
-
color: ${theme.colors.shade50};
|
|
120
|
-
font-family: 'Nunito Sans', sans-serif;
|
|
121
|
-
`;
|
|
122
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/DateRangePicker/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;eAUvB,KAAK,CAAC,SAAS,CAAC,KAAK;WACzB,KAAK,CAAC,MAAM,CAAC,OAAO;CAC9B,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;eAC/B,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;WAC/B,KAAK,CAAC,MAAM,CAAC,OAAO;;;CAG9B,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;eAIzB,KAAK,CAAC,SAAS,CAAC,KAAK;;;;;;;YAOxB,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;;YAMpB,KAAK,CAAC,MAAM,CAAC,MAAM;;;;;;YAMnB,KAAK,CAAC,MAAM,CAAC,OAAO;;CAE/B,CAAA;AAQD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAkB;;;;;WAK5C,CAAC,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,CACz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AC,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC;;;;;;wBAMzF,CAAC,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,CACpH,CAAC,eAAe,IAAI,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa;;;;CAI5F,CAAA;AACD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOzC,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;eAKjB,KAAK,CAAC,SAAS,CAAC,KAAK;WACzB,KAAK,CAAC,MAAM,CAAC,OAAO;;CAE9B,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ContainerEmptyState } from './styles';
|
|
3
|
-
import { Paragraph } from '../Paragraph';
|
|
4
|
-
import { theme } from '../Themes';
|
|
5
|
-
import { logoWaveGrayPNG } from '../../assets/icon';
|
|
6
|
-
export const EmptyState = ({ title, subTitle, description }) => {
|
|
7
|
-
return (React.createElement(ContainerEmptyState, null,
|
|
8
|
-
React.createElement(Paragraph, { strongBod: true, color: theme.colors.cyan50, size: 'large' }, title),
|
|
9
|
-
React.createElement(Paragraph, { color: theme.colors.shade40, size: 'medium' }, subTitle),
|
|
10
|
-
React.createElement(Paragraph, { color: theme.colors.cyan40, size: 'medium' }, description),
|
|
11
|
-
React.createElement("div", { className: 'empty-state-logo' },
|
|
12
|
-
React.createElement("img", { src: logoWaveGrayPNG, alt: "Logo", className: 'clearer-image' }))));
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/EmptyState/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAQnD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAmB,EAAE,EAAE;IAC9E,OAAO,CACL,oBAAC,mBAAmB;QAClB,oBAAC,SAAS,IAAC,SAAS,QAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,IAC3D,KAAK,CACI;QACZ,oBAAC,SAAS,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,IACnD,QAAQ,CACC;QACZ,oBAAC,SAAS,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,IAClD,WAAW,CACF;QAEZ,6BAAK,SAAS,EAAE,kBAAkB;YAChC,6BAAK,GAAG,EAAE,eAAe,EAAE,GAAG,EAAC,MAAM,EAAC,SAAS,EAAE,eAAe,GAAI,CAChE,CACc,CACvB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { EmptyState } from './index';
|
|
2
|
-
const meta = {
|
|
3
|
-
title: 'Components/CardEmptyState',
|
|
4
|
-
component: EmptyState,
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: 'centered',
|
|
7
|
-
},
|
|
8
|
-
argTypes: {
|
|
9
|
-
title: {
|
|
10
|
-
control: 'text',
|
|
11
|
-
description: 'Title of the empty state card',
|
|
12
|
-
},
|
|
13
|
-
subTitle: {
|
|
14
|
-
control: 'text',
|
|
15
|
-
description: 'Subtitle of the empty state card',
|
|
16
|
-
},
|
|
17
|
-
description: {
|
|
18
|
-
control: 'text',
|
|
19
|
-
description: 'Description of the empty state card',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
export default meta;
|
|
24
|
-
export const Default = {
|
|
25
|
-
args: {
|
|
26
|
-
title: 'Licitações sem proposta',
|
|
27
|
-
subTitle: 'A data de disputa está próxima e você não enviou uma proposta!',
|
|
28
|
-
description: 'Você não possui propostas aguardando disputa!',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/EmptyState/stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,2BAA2B;IAClC,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,+BAA+B;SAC7C;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,kCAAkC;SAChD;QACD,WAAW,EAAE;YACX,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,qCAAqC;SACnD;KACF;CACgC,CAAA;AAEnC,eAAe,IAAI,CAAA;AAGnB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,yBAAyB;QAChC,QAAQ,EAAE,gEAAgE;QAC1E,WAAW,EAAE,+CAA+C;KAC7D;CACF,CAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { theme } from '../Themes';
|
|
3
|
-
export const ContainerEmptyState = styled.div `
|
|
4
|
-
padding: 36px;
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
max-height: 550px;
|
|
8
|
-
max-width: 800px;
|
|
9
|
-
background: white;
|
|
10
|
-
border-radius: 8px;
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
gap: ${theme.spacing.space3};
|
|
14
|
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
15
|
-
|
|
16
|
-
.empty-state-logo {
|
|
17
|
-
display: flex;
|
|
18
|
-
width: 100%;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
height: 100%;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.clearer-image {
|
|
25
|
-
margin-right: 20px;
|
|
26
|
-
opacity: 0.2;
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/EmptyState/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAEjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;SAUpC,KAAK,CAAC,OAAO,CAAC,MAAM;;;;;;;;;;;;;;;CAe5B,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled, { keyframes, css } from 'styled-components';
|
|
3
|
-
import { ReactSVG } from 'react-svg';
|
|
4
|
-
const spinAnimation = keyframes `
|
|
5
|
-
0% { transform: rotate(0deg); }
|
|
6
|
-
100% { transform: rotate(360deg); }
|
|
7
|
-
`;
|
|
8
|
-
const StyledIconWrapper = styled.div `
|
|
9
|
-
height: 100%;
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
flex-shrink: 0;
|
|
14
|
-
cursor: ${({ clickable }) => (clickable ? 'pointer' : 'default')};
|
|
15
|
-
|
|
16
|
-
svg {
|
|
17
|
-
width: ${({ width }) => width || '24px'};
|
|
18
|
-
height: ${({ height }) => height || '24px'};
|
|
19
|
-
fill: ${({ color }) => color || 'black'};
|
|
20
|
-
|
|
21
|
-
${({ loading }) => loading &&
|
|
22
|
-
css `
|
|
23
|
-
animation: ${css `
|
|
24
|
-
${spinAnimation}`} 2s linear infinite;
|
|
25
|
-
`}
|
|
26
|
-
|
|
27
|
-
path {
|
|
28
|
-
fill: ${({ color }) => color || 'black'};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
export const IconWrapper = ({ src, color, width, height, className, onClick, loading }) => (React.createElement(StyledIconWrapper, { color: color, width: width, height: height, className: className, clickable: !!onClick, loading: loading, onClick: onClick },
|
|
33
|
-
React.createElement(ReactSVG, { src: src })));
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/IconWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAoBpC,MAAM,aAAa,GAAG,SAAS,CAAA;;;CAG9B,CAAA;AAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAwB;;;;;;YAMhD,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;;;aAGrD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,IAAI,MAAM;cAC7B,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,IAAI,MAAM;YAClC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,IAAI,OAAO;;MAErC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAChB,OAAO;IACP,GAAG,CAAA;qBACY,GAAG,CAAA;cACV,aAAa,EAAE;OACtB;;;cAGO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,IAAI,OAAO;;;CAG5C,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACrH,oBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,CAAC,OAAO,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO;IAEhB,oBAAC,QAAQ,IAAC,GAAG,EAAE,GAAG,GAAI,CACJ,CACrB,CAAA"}
|
|
@@ -1,91 +0,0 @@
|
|
|
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, { useCallback, useEffect, useId, useRef } from 'react';
|
|
13
|
-
import { InputWrapper, StyledInput, StyledInputBorder, StyledInputContent, StyledLabel } from './styles';
|
|
14
|
-
export const Input = (_a) => {
|
|
15
|
-
var { label, readonly, onChange, onInput, value, onKeyDown, disabled, onKeyUp, leftIcon, rightIcon } = _a, props = __rest(_a, ["label", "readonly", "onChange", "onInput", "value", "onKeyDown", "disabled", "onKeyUp", "leftIcon", "rightIcon"]);
|
|
16
|
-
const id = useId();
|
|
17
|
-
const [labelPosition, setLabelPosition] = React.useState({
|
|
18
|
-
x: 0,
|
|
19
|
-
y: 0,
|
|
20
|
-
width: 0,
|
|
21
|
-
height: 0,
|
|
22
|
-
});
|
|
23
|
-
const [contentPosition, setContentPosition] = React.useState({
|
|
24
|
-
x: 0,
|
|
25
|
-
y: 0,
|
|
26
|
-
width: 0,
|
|
27
|
-
height: 0,
|
|
28
|
-
});
|
|
29
|
-
const contentRef = useRef(null);
|
|
30
|
-
const labelRef = useRef(null);
|
|
31
|
-
const inputRef = useRef(null);
|
|
32
|
-
const updatePositions = useCallback(() => {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
34
|
-
const margin = 30;
|
|
35
|
-
const marginLabel = 4;
|
|
36
|
-
setContentPosition({
|
|
37
|
-
x: ((_b = (_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.offsetLeft) !== null && _b !== void 0 ? _b : 0) - margin,
|
|
38
|
-
y: ((_d = (_c = contentRef.current) === null || _c === void 0 ? void 0 : _c.offsetTop) !== null && _d !== void 0 ? _d : 0) - margin,
|
|
39
|
-
width: ((_f = (_e = contentRef.current) === null || _e === void 0 ? void 0 : _e.offsetWidth) !== null && _f !== void 0 ? _f : 0) + margin * 2,
|
|
40
|
-
height: ((_h = (_g = contentRef.current) === null || _g === void 0 ? void 0 : _g.offsetHeight) !== null && _h !== void 0 ? _h : 0) + margin * 2,
|
|
41
|
-
});
|
|
42
|
-
setLabelPosition({
|
|
43
|
-
x: ((_k = (_j = labelRef.current) === null || _j === void 0 ? void 0 : _j.offsetLeft) !== null && _k !== void 0 ? _k : 0) - marginLabel,
|
|
44
|
-
y: ((_m = (_l = labelRef.current) === null || _l === void 0 ? void 0 : _l.offsetTop) !== null && _m !== void 0 ? _m : 0) - marginLabel,
|
|
45
|
-
width: ((_p = (_o = labelRef.current) === null || _o === void 0 ? void 0 : _o.offsetWidth) !== null && _p !== void 0 ? _p : 0) + marginLabel * 2,
|
|
46
|
-
height: ((_r = (_q = labelRef.current) === null || _q === void 0 ? void 0 : _q.offsetHeight) !== null && _r !== void 0 ? _r : 0) + marginLabel * 2,
|
|
47
|
-
});
|
|
48
|
-
}, []);
|
|
49
|
-
const onClickHandler = (event) => {
|
|
50
|
-
var _a;
|
|
51
|
-
let element = event.target;
|
|
52
|
-
if (element.tagName !== "INPUT") {
|
|
53
|
-
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
const handler = () => updatePositions();
|
|
58
|
-
let resizeObserver = null;
|
|
59
|
-
if (ResizeObserver) {
|
|
60
|
-
resizeObserver = new ResizeObserver(handler);
|
|
61
|
-
if (contentRef.current) {
|
|
62
|
-
resizeObserver.observe(contentRef.current);
|
|
63
|
-
}
|
|
64
|
-
if (labelRef.current) {
|
|
65
|
-
resizeObserver.observe(labelRef.current);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
window.addEventListener('resize', handler);
|
|
70
|
-
}
|
|
71
|
-
return () => {
|
|
72
|
-
if (resizeObserver) {
|
|
73
|
-
resizeObserver.disconnect();
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
window.removeEventListener('resize', handler);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}, [updatePositions]);
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
updatePositions();
|
|
82
|
-
}, [label, updatePositions]);
|
|
83
|
-
return (React.createElement(InputWrapper, Object.assign({}, props),
|
|
84
|
-
React.createElement(StyledInputContent, { disabled: disabled, ref: contentRef, onClick: onClickHandler },
|
|
85
|
-
React.createElement(StyledInputBorder, { content: contentPosition, label: labelPosition }),
|
|
86
|
-
React.createElement(StyledLabel, { htmlFor: id, ref: labelRef }, label),
|
|
87
|
-
leftIcon,
|
|
88
|
-
React.createElement(StyledInput, { id: id, disabled: disabled, value: value, placeholder: props.placeholder, ref: inputRef, onChange: onChange, onInput: onInput, onKeyDown: onKeyDown, onKeyUp: onKeyUp, readOnly: readonly }),
|
|
89
|
-
rightIcon)));
|
|
90
|
-
};
|
|
91
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAA6B,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAc,MAAM,OAAO,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAuBxG,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAY3C,EAAE,EAAE;QAZuC,EAC1C,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,OAEV,EADI,KAAK,cAXkC,kHAY3C,CADS;IAER,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAClB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAW;QACjE,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;KACV,CAAC,C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