dgrcorrientes-modulos 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -0
- package/.prettierrc.cjs +8 -0
- package/.storybook/main.cjs +11 -0
- package/.storybook/manager-head.html +2 -0
- package/.storybook/manager.cjs +6 -0
- package/.storybook/preview-head.html +3 -0
- package/.storybook/preview.cjs +11 -0
- package/.storybook/themes.cjs +14 -0
- package/README.md +21 -0
- package/StoryBook.txt +19 -0
- package/dist-config.cjs +57 -0
- package/index.html +13 -0
- package/package.json +60 -0
- package/public/elevation.ico +0 -0
- package/public/elevationImage.png +0 -0
- package/public/vite.svg +1 -0
- package/src/App.scss +36 -0
- package/src/App.tsx +34 -0
- package/src/assets/react.svg +1 -0
- package/src/index.js +70 -0
- package/src/index.scss +63 -0
- package/src/index.ts +108 -0
- package/src/main.tsx +11 -0
- package/src/sass/base/_base.scss +50 -0
- package/src/sass/base/_controls.scss +90 -0
- package/src/sass/base/_datepicker.scss +114 -0
- package/src/sass/base/_typo.scss +71 -0
- package/src/sass/base/fonts/SFUIText-Bold.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-BoldItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Heavy.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-HeavyItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Light.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-LightItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Medium.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-MediumItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Regular.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-RegularItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Semibold.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-SemiboldItalic.ttf +0 -0
- package/src/sass/bulma/bulma-changes.scss +19 -0
- package/src/sass/bulma/extensions/extensions.sass +1 -0
- package/src/sass/bulma/extensions/steps/bulma-steps.sass +3 -0
- package/src/sass/bulma/extensions/steps/index.sass +421 -0
- package/src/sass/bulma/variables/_variables-bulma.sass +16 -0
- package/src/sass/bulma/variables/components/card.sass +20 -0
- package/src/sass/bulma/variables/components/navbar.sass +50 -0
- package/src/sass/bulma/variables/components/tabs.sass +28 -0
- package/src/sass/bulma/variables/elements/button.sass +46 -0
- package/src/sass/bulma/variables/elements/notification.sass +8 -0
- package/src/sass/bulma/variables/elements/title.sass +20 -0
- package/src/sass/bulma/variables/grid/column.sass +2 -0
- package/src/sass/main.sass +16 -0
- package/src/sass/utilities/_bulma-variables.sass +20 -0
- package/src/sass/utilities/_derived-variables.scss +68 -0
- package/src/sass/utilities/_helpers.scss +70 -0
- package/src/sass/utilities/_variables.scss +147 -0
- package/src/stories/Changelog.stories.tsx +73 -0
- package/src/stories/Components/AssistanceDiary/AssistanceDiary.scss +19 -0
- package/src/stories/Components/AssistanceDiary/AssistanceDiary.stories.tsx +25 -0
- package/src/stories/Components/AssistanceDiary/AssistanceDiary.tsx +57 -0
- package/src/stories/Components/AverageAttended/AverageAttended.scss +39 -0
- package/src/stories/Components/AverageAttended/AverageAttended.stories.tsx +71 -0
- package/src/stories/Components/AverageAttended/AverageAttended.tsx +311 -0
- package/src/stories/Components/Breadcrumb/Breadcrumb.stories.tsx +45 -0
- package/src/stories/Components/Breadcrumb/Breadcrumb.tsx +68 -0
- package/src/stories/Components/Breadcrumb/breadcrumb.scss +82 -0
- package/src/stories/Components/CTA/CTA.scss +76 -0
- package/src/stories/Components/CTA/CTA.stories.tsx +46 -0
- package/src/stories/Components/CTA/CTA.tsx +70 -0
- package/src/stories/Components/Cards/Card CTA/CardCta.stories.tsx +34 -0
- package/src/stories/Components/Cards/Card CTA/CardCta.tsx +81 -0
- package/src/stories/Components/Cards/Card CTA/cardCta.scss +71 -0
- package/src/stories/Components/Cards/Card Expiration/cardExpiration.scss +105 -0
- package/src/stories/Components/Cards/Card Expiration/cardExpiration.stories.tsx +40 -0
- package/src/stories/Components/Cards/Card Expiration/cardExpiration.tsx +95 -0
- package/src/stories/Components/Cards/Card Vertical/CardVertical.stories.tsx +43 -0
- package/src/stories/Components/Cards/Card Vertical/CardVertical.tsx +106 -0
- package/src/stories/Components/Cards/Card Vertical/cardVertical.scss +130 -0
- package/src/stories/Components/Cards/CardActivity/cardActivity.scss +31 -0
- package/src/stories/Components/Cards/CardActivity/cardActivity.stories.tsx +20 -0
- package/src/stories/Components/Cards/CardActivity/cardActivity.tsx +48 -0
- package/src/stories/Components/Cards/CardHorizontal/CardHorizontal.stories.tsx +96 -0
- package/src/stories/Components/Cards/CardHorizontal/CardHorizontal.tsx +94 -0
- package/src/stories/Components/Cards/CardHorizontal/cardHorizontal.scss +65 -0
- package/src/stories/Components/Cards/CardUser/CardUser.stories.tsx +135 -0
- package/src/stories/Components/Cards/CardUser/CardUser.tsx +122 -0
- package/src/stories/Components/Cards/CardUser/cardUser.scss +115 -0
- package/src/stories/Components/Cart/Cart.scss +279 -0
- package/src/stories/Components/Cart/Cart.stories.tsx +350 -0
- package/src/stories/Components/Cart/Cart.tsx +277 -0
- package/src/stories/Components/Collapse/Collapse.scss +339 -0
- package/src/stories/Components/Collapse/Collapse.stories.tsx +766 -0
- package/src/stories/Components/Collapse/Collapse.tsx +451 -0
- package/src/stories/Components/CollapseEdit/CollapseEdit.scss +128 -0
- package/src/stories/Components/CollapseEdit/CollapseEdit.stories.tsx +29 -0
- package/src/stories/Components/CollapseEdit/CollapseEdit.tsx +185 -0
- package/src/stories/Components/CompleteDiary/CompleteDiary.scss +165 -0
- package/src/stories/Components/CompleteDiary/CompleteDiary.stories.tsx +219 -0
- package/src/stories/Components/CompleteDiary/CompleteDiary.tsx +394 -0
- package/src/stories/Components/Dropdown/Dropdown.scss +60 -0
- package/src/stories/Components/Dropdown/Dropdown.stories.tsx +19 -0
- package/src/stories/Components/Dropdown/Dropdown.tsx +99 -0
- package/src/stories/Components/EmptyState/EmptyState.stories.tsx +46 -0
- package/src/stories/Components/EmptyState/EmptyState.tsx +44 -0
- package/src/stories/Components/EmptyState/emptyState.scss +75 -0
- package/src/stories/Components/ErrorPage/ErrorPage.scss +65 -0
- package/src/stories/Components/ErrorPage/ErrorPage.stories.tsx +164 -0
- package/src/stories/Components/ErrorPage/ErrorPage.tsx +107 -0
- package/src/stories/Components/IncomingCall/IncomingCall.scss +27 -0
- package/src/stories/Components/IncomingCall/IncomingCall.stories.tsx +43 -0
- package/src/stories/Components/IncomingCall/IncomingCall.tsx +76 -0
- package/src/stories/Components/ModalConfirm/ModalConfirm.scss +30 -0
- package/src/stories/Components/ModalConfirm/ModalConfirm.stories.tsx +21 -0
- package/src/stories/Components/ModalConfirm/ModalConfirm.tsx +118 -0
- package/src/stories/Components/Pagination/Pagination.scss +42 -0
- package/src/stories/Components/Pagination/Pagination.stories.tsx +25 -0
- package/src/stories/Components/Pagination/Pagination.tsx +143 -0
- package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.scss +26 -0
- package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.stories.tsx +27 -0
- package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.tsx +108 -0
- package/src/stories/Components/ShiftDiary/ShiftDiary.scss +45 -0
- package/src/stories/Components/ShiftDiary/ShiftDiary.stories.tsx +32 -0
- package/src/stories/Components/ShiftDiary/ShiftDiary.tsx +92 -0
- package/src/stories/Components/Stepper/Stepper.stories.tsx +26 -0
- package/src/stories/Components/Stepper/Stepper.tsx +102 -0
- package/src/stories/Components/Stepper/stepper.scss +59 -0
- package/src/stories/Components/Tabs/Tabs.stories.tsx +76 -0
- package/src/stories/Components/Tabs/Tabs.tsx +111 -0
- package/src/stories/Components/Tabs/tabs.scss +118 -0
- package/src/stories/Components/Tooltip/Tooltip.scss +235 -0
- package/src/stories/Components/Tooltip/Tooltip.stories.tsx +125 -0
- package/src/stories/Components/Tooltip/Tooltip.tsx +222 -0
- package/src/stories/Elements/Alert/Alert.stories.tsx +65 -0
- package/src/stories/Elements/Alert/Alert.tsx +49 -0
- package/src/stories/Elements/Alert/alert.scss +189 -0
- package/src/stories/Elements/Badge/Badge.stories.tsx +15 -0
- package/src/stories/Elements/Badge/Badge.tsx +21 -0
- package/src/stories/Elements/Badge/badge.scss +24 -0
- package/src/stories/Elements/Button/Button.stories.tsx +54 -0
- package/src/stories/Elements/Button/Button.tsx +118 -0
- package/src/stories/Elements/Button/button.scss +102 -0
- package/src/stories/Elements/Icon/Icon.stories.tsx +33 -0
- package/src/stories/Elements/Icon/Icon.tsx +57 -0
- package/src/stories/Elements/Icon/icon.scss +15 -0
- package/src/stories/Elements/Icon/icono.svg +1 -0
- package/src/stories/Elements/ProgressBar/ProgressBar.scss +26 -0
- package/src/stories/Elements/ProgressBar/ProgressBar.stories.tsx +19 -0
- package/src/stories/Elements/ProgressBar/ProgressBar.tsx +35 -0
- package/src/stories/Form/Autocomplete/Autocomplete.stories.tsx +55 -0
- package/src/stories/Form/Autocomplete/Autocomplete.tsx +160 -0
- package/src/stories/Form/Autocomplete/autocomplete.scss +311 -0
- package/src/stories/Form/Autocomplete-Prueba/Autocomplete.stories.tsx +50 -0
- package/src/stories/Form/Autocomplete-Prueba/AutocompletePrueba.tsx +83 -0
- package/src/stories/Form/Checkbox/Checkbox.stories.tsx +26 -0
- package/src/stories/Form/Checkbox/Checkbox.tsx +89 -0
- package/src/stories/Form/Checkbox/checkbox.scss +41 -0
- package/src/stories/Form/DatePicker/DatePickerExample.stories.tsx +27 -0
- package/src/stories/Form/DatePicker/DatePickerExample.tsx +65 -0
- package/src/stories/Form/DatePickerComponent/DatePickerComponent.scss +116 -0
- package/src/stories/Form/DatePickerComponent/DatePickerComponent.stories.tsx +37 -0
- package/src/stories/Form/DatePickerComponent/DatePickerComponent.tsx +97 -0
- package/src/stories/Form/Filters/Filters.stories.tsx +84 -0
- package/src/stories/Form/Filters/Filters.tsx +230 -0
- package/src/stories/Form/Filters/filters.scss +261 -0
- package/src/stories/Form/Input/Input.stories.tsx +25 -0
- package/src/stories/Form/Input/Input.tsx +86 -0
- package/src/stories/Form/Input/InputVar.sass +26 -0
- package/src/stories/Form/Input/input.scss +19 -0
- package/src/stories/Form/InputFormControl/Input-form-control.stories.tsx +26 -0
- package/src/stories/Form/InputFormControl/Input-form-control.tsx +48 -0
- package/src/stories/Form/InputFormControl/input-form-control.scss +34 -0
- package/src/stories/Form/Radio/Radio.stories.tsx +19 -0
- package/src/stories/Form/Radio/Radio.tsx +84 -0
- package/src/stories/Form/Radio/radio.scss +19 -0
- package/src/stories/Form/Search/Search.scss +50 -0
- package/src/stories/Form/Search/Search.stories.tsx +26 -0
- package/src/stories/Form/Search/Search.tsx +84 -0
- package/src/stories/Form/Select/Select.stories.tsx +55 -0
- package/src/stories/Form/Select/Select.tsx +121 -0
- package/src/stories/Form/Select/select.scss +303 -0
- package/src/stories/Form/Switch/Switch.stories.tsx +17 -0
- package/src/stories/Form/Switch/Switch.tsx +36 -0
- package/src/stories/Form/Switch/switch.scss +123 -0
- package/src/stories/Form/Textarea/Textarea.stories.tsx +19 -0
- package/src/stories/Form/Textarea/Textarea.tsx +52 -0
- package/src/stories/Form/Textarea/textarea.scss +25 -0
- package/src/stories/Form/UploadFileItem/UploadFileItem.scss +49 -0
- package/src/stories/Form/UploadFileItem/UploadFileItem.stories.tsx +18 -0
- package/src/stories/Form/UploadFileItem/UploadFileItem.tsx +89 -0
- package/src/stories/Form/UploadFiles/UploadFiles.scss +17 -0
- package/src/stories/Form/UploadFiles/UploadFiles.stories.tsx +32 -0
- package/src/stories/Form/UploadFiles/UploadFiles.tsx +177 -0
- package/src/stories/Layout/Footer/Footer.scss +129 -0
- package/src/stories/Layout/Footer/Footer.stories.tsx +101 -0
- package/src/stories/Layout/Footer/Footer.tsx +81 -0
- package/src/stories/Layout/Header/Header.scss +190 -0
- package/src/stories/Layout/Header/Header.stories.tsx +223 -0
- package/src/stories/Layout/Header/Header.tsx +278 -0
- package/src/stories/Layout/HeaderTable/HeaderTable.scss +21 -0
- package/src/stories/Layout/HeaderTable/HeaderTable.stories.tsx +112 -0
- package/src/stories/Layout/HeaderTable/HeaderTable.tsx +72 -0
- package/src/stories/Layout/Sidebar/Sidebar.scss +50 -0
- package/src/stories/Layout/Sidebar/Sidebar.stories.tsx +744 -0
- package/src/stories/Layout/Sidebar/Sidebar.tsx +129 -0
- package/src/stories/Layout/SidebarEmpty/SidebarEmpty.scss +64 -0
- package/src/stories/Layout/SidebarEmpty/SidebarEmpty.stories.tsx +26 -0
- package/src/stories/Layout/SidebarEmpty/SidebarEmpty.tsx +100 -0
- package/src/stories/Layout/Subtitle/Subtitle.scss +88 -0
- package/src/stories/Layout/Subtitle/Subtitle.stories.tsx +46 -0
- package/src/stories/Layout/Subtitle/Subtitle.tsx +108 -0
- package/src/stories/Layout/Title/Title.scss +79 -0
- package/src/stories/Layout/Title/Title.stories.tsx +86 -0
- package/src/stories/Layout/Title/Title.tsx +96 -0
- package/src/stories/Welcome.stories.tsx +111 -0
- package/src/stories/assets/404 Page Not Found _Two Color (1).png +0 -0
- package/src/stories/assets/404 Page Not Found _Two Color.png +0 -0
- package/src/stories/assets/Empty Inbox _Two Color.png +0 -0
- package/src/stories/assets/Loading _Two Color.png +0 -0
- package/src/stories/assets/Notifications_Two Color 1.png +0 -0
- package/src/stories/assets/Online protection_Two Color.png +0 -0
- package/src/stories/assets/Under Constructions _Two Color.png +0 -0
- package/src/stories/assets/bulma.png +0 -0
- package/src/stories/assets/burger.svg +5 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/decor-bg.png +0 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/e-isologo.svg +4 -0
- package/src/stories/assets/e-isotype.svg +4 -0
- package/src/stories/assets/e-logo_negative.svg +14 -0
- package/src/stories/assets/e-logotype.svg +14 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/logo_gobierno_corrientes.svg +9 -0
- package/src/stories/assets/logo_rentas_corrientes.svg +10 -0
- package/src/stories/assets/logo_rentas_corrientes_compacto.svg +10 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/stories/assets/storybook.svg +13 -0
- package/src/stories/assets/thumbnail-black.jpg +0 -0
- package/src/stories/assets/thumbnail-black[2].jpg +0 -0
- package/src/stories/assets/thumbnail.jpg +0 -0
- package/src/stories/assets/thumbnail[2].jpg +0 -0
- package/src/stories/changelog.ts +389 -0
- package/src/utils/functions.ts +57 -0
- package/src/vite-env.d.ts +2 -0
- package/static/e-isologo-192.jpg +0 -0
- package/static/e-isologo.svg +4 -0
- package/static/e-logotype.svg +14 -0
- package/static/favicon.ico +0 -0
- package/tsconfig.json +22 -0
- package/tsconfig.node.json +9 -0
- package/vite.config.ts +22 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {useState} from 'react';
|
|
2
|
+
import './checkbox.scss';
|
|
3
|
+
import '/src/sass/base/_controls.scss';
|
|
4
|
+
|
|
5
|
+
export interface ICheckbox extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
6
|
+
// base
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
label?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
name: string;
|
|
11
|
+
|
|
12
|
+
// boolean
|
|
13
|
+
checked?: boolean;
|
|
14
|
+
defaultChecked?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
error?: boolean;
|
|
17
|
+
|
|
18
|
+
// events
|
|
19
|
+
onCheck?: (checked: boolean) => void;
|
|
20
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
|
|
22
|
+
// react
|
|
23
|
+
className?: string;
|
|
24
|
+
key?: string;
|
|
25
|
+
}
|
|
26
|
+
export const Checkbox = ({
|
|
27
|
+
size = 'md',
|
|
28
|
+
label = 'checkbox',
|
|
29
|
+
value,
|
|
30
|
+
name,
|
|
31
|
+
className,
|
|
32
|
+
key,
|
|
33
|
+
defaultChecked,
|
|
34
|
+
checked,
|
|
35
|
+
error,
|
|
36
|
+
disabled = false,
|
|
37
|
+
//hover,
|
|
38
|
+
onCheck,
|
|
39
|
+
onChange,
|
|
40
|
+
...props
|
|
41
|
+
}: ICheckbox) => {
|
|
42
|
+
const [isChecked, setIsChecked] = useState<boolean>(defaultChecked ? defaultChecked : false);
|
|
43
|
+
|
|
44
|
+
const toggleChecked = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
45
|
+
setIsChecked(!isChecked);
|
|
46
|
+
onCheck && onCheck(!isChecked);
|
|
47
|
+
onChange && onChange(e);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className={`elv-component elv-checkbox elv-control`} {...props}>
|
|
52
|
+
<label
|
|
53
|
+
className={[
|
|
54
|
+
'e-control e-checkbox',
|
|
55
|
+
` e-control--${size} e-checkbox--${size}`,
|
|
56
|
+
`${error ? ` e-control--error e-checkbox--error` : ''}`,
|
|
57
|
+
`${disabled ? ` e-control--disabled e-checkbox--disabled` : ''}`,
|
|
58
|
+
' is-relative',
|
|
59
|
+
' is-flex is-flex-direction-row-reverse is-justify-content-flex-end',
|
|
60
|
+
' has-text-dark',
|
|
61
|
+
' is-clickable',
|
|
62
|
+
`${className ? ' ' + className : ''}`,
|
|
63
|
+
].join('')}
|
|
64
|
+
>
|
|
65
|
+
<input
|
|
66
|
+
type="checkbox"
|
|
67
|
+
onChange={e => {
|
|
68
|
+
toggleChecked(e);
|
|
69
|
+
}}
|
|
70
|
+
defaultChecked={defaultChecked}
|
|
71
|
+
id={value}
|
|
72
|
+
value={value}
|
|
73
|
+
name={name}
|
|
74
|
+
checked={checked}
|
|
75
|
+
className={['e-control__input e-checkbox__input'].join('')}
|
|
76
|
+
disabled={disabled}
|
|
77
|
+
/>
|
|
78
|
+
{label && <span className="label-text is-flex is-align-items-center">{label}</span>}
|
|
79
|
+
|
|
80
|
+
<span
|
|
81
|
+
className={[
|
|
82
|
+
'e-control__checkmark e-checkbox__checkmark',
|
|
83
|
+
' is-flex is-align-items-center is-justify-content-center is-relative',
|
|
84
|
+
].join('')}
|
|
85
|
+
/>
|
|
86
|
+
</label>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@import '/src/sass/utilities/variables';
|
|
2
|
+
|
|
3
|
+
.elv-checkbox {
|
|
4
|
+
.e-checkbox {
|
|
5
|
+
&__input:checked ~ .e-control__checkmark {
|
|
6
|
+
background-color: $primary-600;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&__checkmark {
|
|
10
|
+
border-radius: 2px;
|
|
11
|
+
|
|
12
|
+
&:after {
|
|
13
|
+
width: 9px;
|
|
14
|
+
height: 4px;
|
|
15
|
+
border: 2px solid white;
|
|
16
|
+
border-top: none;
|
|
17
|
+
border-right: none;
|
|
18
|
+
background: transparent;
|
|
19
|
+
transform: rotate(-45deg) !important;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--sm {
|
|
24
|
+
.e-checkbox__checkmark {
|
|
25
|
+
&:after {
|
|
26
|
+
width: 6px;
|
|
27
|
+
height: 3px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&--lg {
|
|
33
|
+
.e-checkbox__checkmark {
|
|
34
|
+
&:after {
|
|
35
|
+
width: 12px;
|
|
36
|
+
height: 5px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {ComponentStory, ComponentMeta} from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import {DatePickerExample} from './DatePickerExample';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Example/DatePickerExample',
|
|
8
|
+
component: DatePickerExample,
|
|
9
|
+
args: {},
|
|
10
|
+
} as ComponentMeta<typeof DatePickerExample>;
|
|
11
|
+
|
|
12
|
+
const Template: ComponentStory<typeof DatePickerExample> = args => <DatePickerExample {...args} />;
|
|
13
|
+
|
|
14
|
+
export const Day = Template.bind({});
|
|
15
|
+
Day.args = {type: 'day'};
|
|
16
|
+
|
|
17
|
+
export const Range = Template.bind({});
|
|
18
|
+
Range.args = {type: 'range'};
|
|
19
|
+
|
|
20
|
+
export const Portal = Template.bind({});
|
|
21
|
+
Portal.args = {type: 'portal'};
|
|
22
|
+
|
|
23
|
+
export const Months = Template.bind({});
|
|
24
|
+
Months.args = {type: 'months'};
|
|
25
|
+
|
|
26
|
+
export const Year = Template.bind({});
|
|
27
|
+
Year.args = {type: 'year-select'};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import DatePicker from 'react-datepicker';
|
|
3
|
+
|
|
4
|
+
import 'react-datepicker/dist/react-datepicker.css';
|
|
5
|
+
import '/src/sass/base/_datepicker.scss';
|
|
6
|
+
|
|
7
|
+
export interface DatePickerExampleProps {
|
|
8
|
+
type?: 'day' | 'range' | 'portal' | 'months' | 'year-select';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const DatePickerExample = ({type}: DatePickerExampleProps) => {
|
|
12
|
+
const [startDate, setStartDate] = useState(new Date('2014/02/08'));
|
|
13
|
+
const [startDateMonth, setStartDateMonth] = useState(new Date('2014/02/08'));
|
|
14
|
+
const [endDate, setEndDate] = useState(new Date('2014/02/10'));
|
|
15
|
+
|
|
16
|
+
switch (type) {
|
|
17
|
+
case 'day':
|
|
18
|
+
return <DatePicker showIcon selected={startDate} onChange={(date: React.SetStateAction<Date>) => setStartDate(date)} />;
|
|
19
|
+
case 'range':
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<DatePicker
|
|
23
|
+
selected={startDate}
|
|
24
|
+
onChange={(date: React.SetStateAction<Date>) => setStartDate(date)}
|
|
25
|
+
selectsStart
|
|
26
|
+
startDate={startDate}
|
|
27
|
+
endDate={endDate}
|
|
28
|
+
/>
|
|
29
|
+
<DatePicker
|
|
30
|
+
selected={endDate}
|
|
31
|
+
onChange={(date: React.SetStateAction<Date>) => setEndDate(date)}
|
|
32
|
+
selectsEnd
|
|
33
|
+
startDate={startDate}
|
|
34
|
+
endDate={endDate}
|
|
35
|
+
minDate={startDate}
|
|
36
|
+
/>
|
|
37
|
+
</>
|
|
38
|
+
);
|
|
39
|
+
case 'portal':
|
|
40
|
+
return <DatePicker selected={startDate} onChange={(date: React.SetStateAction<Date>) => setStartDate(date)} withPortal />;
|
|
41
|
+
case 'months':
|
|
42
|
+
return (
|
|
43
|
+
<DatePicker
|
|
44
|
+
selected={startDateMonth}
|
|
45
|
+
onChange={(date: React.SetStateAction<Date>) => setStartDateMonth(date)}
|
|
46
|
+
dateFormat="MM/yyyy"
|
|
47
|
+
excludeDates={[1661990400000, 1664582400000, 1667260800000, 1672531200000]}
|
|
48
|
+
showMonthYearPicker
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
case 'year-select':
|
|
52
|
+
return (
|
|
53
|
+
<DatePicker
|
|
54
|
+
selected={startDate}
|
|
55
|
+
onChange={(date: React.SetStateAction<Date>) => setStartDate(date)}
|
|
56
|
+
showYearPicker
|
|
57
|
+
dateFormat="yyyy"
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
default:
|
|
61
|
+
return (
|
|
62
|
+
<DatePicker showTimeSelect showIcon selected={startDate} onChange={(date: React.SetStateAction<Date>) => setStartDate(date)} />
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
@import '/src/sass/utilities/variables';
|
|
2
|
+
|
|
3
|
+
.elv-datepicker {
|
|
4
|
+
.react-datepicker {
|
|
5
|
+
font-family: 'SF UI Text', sans-serif !important;
|
|
6
|
+
box-shadow: 0px 0px 2px rgba(14, 31, 53, 0.12), 0px 1px 4px rgba(14, 31, 53, 0.06);
|
|
7
|
+
border-radius: 16px;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
&__header {
|
|
11
|
+
background-color: $white;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__input-container {
|
|
15
|
+
input {
|
|
16
|
+
font-family: 'SF UI Text', sans-serif !important;
|
|
17
|
+
// min-width: 160px;
|
|
18
|
+
text-align: center;
|
|
19
|
+
|
|
20
|
+
padding-top: 9px;
|
|
21
|
+
padding-bottom: 8px;
|
|
22
|
+
|
|
23
|
+
border: 1px solid #d4d4d4;
|
|
24
|
+
border-radius: 12px;
|
|
25
|
+
background: transparent;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
border: 1px solid $primary-600;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:focus {
|
|
32
|
+
background: rgba(18, 69, 150, 0.1);
|
|
33
|
+
outline: 2px solid $primary-600;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.react-datepicker__view-calendar-icon {
|
|
38
|
+
input {
|
|
39
|
+
padding-left: 25px !important;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__day {
|
|
45
|
+
border-radius: 50%;
|
|
46
|
+
|
|
47
|
+
&--selected {
|
|
48
|
+
border-radius: 50%;
|
|
49
|
+
background-color: $primary-600;
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: #4355fa;
|
|
53
|
+
background-color: $primary-400;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
background-color: $primary-200;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__month {
|
|
64
|
+
&-text {
|
|
65
|
+
border-radius: 16px;
|
|
66
|
+
|
|
67
|
+
&--selected {
|
|
68
|
+
border-radius: 16px;
|
|
69
|
+
background-color: $primary-600;
|
|
70
|
+
color: white;
|
|
71
|
+
|
|
72
|
+
&:hover {
|
|
73
|
+
border-radius: 16px;
|
|
74
|
+
background-color: #4355fa;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.react-datepicker__month--selected {
|
|
79
|
+
&:hover {
|
|
80
|
+
background-color: #4355fa;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--selected {
|
|
86
|
+
border-radius: 16px;
|
|
87
|
+
background-color: $primary-600;
|
|
88
|
+
color: white;
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
border-radius: 16px;
|
|
92
|
+
background-color: #4355fa;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__year-wrapper {
|
|
98
|
+
justify-content: center;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__year-text {
|
|
102
|
+
border-radius: 16px;
|
|
103
|
+
|
|
104
|
+
&--selected {
|
|
105
|
+
border-radius: 16px;
|
|
106
|
+
background-color: $primary-600;
|
|
107
|
+
color: white;
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
border-radius: 16px;
|
|
111
|
+
background-color: #4355fa;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {ComponentStory, ComponentMeta} from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import {DatePickerComponent} from './DatePickerComponent';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Form/DatePickerComponent',
|
|
8
|
+
component: DatePickerComponent,
|
|
9
|
+
args: {
|
|
10
|
+
startDate: new Date('2017/06/10'),
|
|
11
|
+
endDate: new Date('2017/06/20'),
|
|
12
|
+
dateFormat: 'dd/MM/yyyy',
|
|
13
|
+
onStartDateChange(date) {
|
|
14
|
+
console.log('Start Date: ' + date);
|
|
15
|
+
},
|
|
16
|
+
onStartDateMonthChange(date) {
|
|
17
|
+
console.log('StartDateMonth: ' + date);
|
|
18
|
+
},
|
|
19
|
+
onEndDateChange(date) {
|
|
20
|
+
console.log('EndDate: ' + date);
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
} as ComponentMeta<typeof DatePickerComponent>;
|
|
24
|
+
|
|
25
|
+
const Template: ComponentStory<typeof DatePickerComponent> = args => <DatePickerComponent {...args} />;
|
|
26
|
+
|
|
27
|
+
export const Day = Template.bind({});
|
|
28
|
+
Day.args = {type: 'day'};
|
|
29
|
+
|
|
30
|
+
export const Range = Template.bind({});
|
|
31
|
+
Range.args = {isRange: true};
|
|
32
|
+
|
|
33
|
+
export const Months = Template.bind({});
|
|
34
|
+
Months.args = {type: 'months', dateFormat: 'MM/yyyy'};
|
|
35
|
+
|
|
36
|
+
export const Year = Template.bind({});
|
|
37
|
+
Year.args = {type: 'year', dateFormat: 'yyyy'};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React, {useEffect, useState} from 'react';
|
|
2
|
+
import DatePicker from 'react-datepicker';
|
|
3
|
+
|
|
4
|
+
import 'react-datepicker/dist/react-datepicker.css';
|
|
5
|
+
import './DatePickerComponent.scss';
|
|
6
|
+
|
|
7
|
+
export interface IDatePickerComponent extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
8
|
+
// base
|
|
9
|
+
type: 'day' | 'months' | 'year';
|
|
10
|
+
dateFormat?: string;
|
|
11
|
+
startDate?: Date;
|
|
12
|
+
endDate?: Date;
|
|
13
|
+
|
|
14
|
+
// boolean
|
|
15
|
+
showIcon?: boolean;
|
|
16
|
+
withPortal?: boolean;
|
|
17
|
+
|
|
18
|
+
isRange?: boolean;
|
|
19
|
+
|
|
20
|
+
// events
|
|
21
|
+
onStartDateChange?: (date: Date) => void;
|
|
22
|
+
onStartDateMonthChange?: (date: Date) => void;
|
|
23
|
+
onEndDateChange?: (date: Date) => void;
|
|
24
|
+
|
|
25
|
+
// react
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const DatePickerComponent = ({
|
|
30
|
+
type,
|
|
31
|
+
dateFormat,
|
|
32
|
+
startDate,
|
|
33
|
+
endDate,
|
|
34
|
+
showIcon,
|
|
35
|
+
withPortal,
|
|
36
|
+
isRange,
|
|
37
|
+
onStartDateChange,
|
|
38
|
+
onEndDateChange,
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: IDatePickerComponent) => {
|
|
42
|
+
const [startDateState, setStartDateState] = useState(startDate ? startDate : new Date());
|
|
43
|
+
const [endDateState, setEndDateState] = useState(endDate ? endDate : new Date());
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
onStartDateChange && onStartDateChange(startDateState);
|
|
47
|
+
}, [startDateState]);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
onEndDateChange && onEndDateChange(endDateState);
|
|
51
|
+
}, [endDateState]);
|
|
52
|
+
|
|
53
|
+
return !isRange ? (
|
|
54
|
+
<div className="elv-component elv-datepicker" {...props}>
|
|
55
|
+
<DatePicker
|
|
56
|
+
selected={startDateState}
|
|
57
|
+
onChange={(date: React.SetStateAction<Date>) => setStartDateState(date)}
|
|
58
|
+
withPortal={withPortal}
|
|
59
|
+
showMonthYearPicker={type == 'months' ? true : false}
|
|
60
|
+
showYearPicker={type == 'year' ? true : false}
|
|
61
|
+
dateFormat={dateFormat}
|
|
62
|
+
showIcon={showIcon}
|
|
63
|
+
className={className}
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
) : (
|
|
67
|
+
<div className="elv-component elv-datepicker" {...props}>
|
|
68
|
+
<DatePicker
|
|
69
|
+
selected={startDateState}
|
|
70
|
+
onChange={(date: React.SetStateAction<Date>) => setStartDateState(date)}
|
|
71
|
+
withPortal={withPortal}
|
|
72
|
+
showMonthYearPicker={type == 'months' ? true : false}
|
|
73
|
+
showYearPicker={type == 'year' ? true : false}
|
|
74
|
+
dateFormat={dateFormat}
|
|
75
|
+
showIcon={showIcon}
|
|
76
|
+
selectsStart
|
|
77
|
+
startDate={startDateState}
|
|
78
|
+
endDate={endDateState}
|
|
79
|
+
className={className}
|
|
80
|
+
/>
|
|
81
|
+
<DatePicker
|
|
82
|
+
selected={endDateState}
|
|
83
|
+
onChange={(date: React.SetStateAction<Date>) => setEndDateState(date)}
|
|
84
|
+
withPortal={withPortal}
|
|
85
|
+
showMonthYearPicker={type == 'months' ? true : false}
|
|
86
|
+
showYearPicker={type == 'year' ? true : false}
|
|
87
|
+
dateFormat={dateFormat}
|
|
88
|
+
showIcon={showIcon}
|
|
89
|
+
selectsEnd
|
|
90
|
+
startDate={startDateState}
|
|
91
|
+
endDate={endDateState}
|
|
92
|
+
minDate={startDateState}
|
|
93
|
+
className={className}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {ComponentStory, ComponentMeta} from '@storybook/react';
|
|
2
|
+
import {Filters} from './Filters';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Form/Filters',
|
|
6
|
+
component: Filters,
|
|
7
|
+
args: {
|
|
8
|
+
size: 'sm',
|
|
9
|
+
fill: 'outline',
|
|
10
|
+
disabled: false,
|
|
11
|
+
error: false,
|
|
12
|
+
placeholder: 'Filtrar',
|
|
13
|
+
button: {
|
|
14
|
+
type: 'button',
|
|
15
|
+
color: 'primary',
|
|
16
|
+
size: 'normal',
|
|
17
|
+
fill: 'solid',
|
|
18
|
+
loading: false,
|
|
19
|
+
disabled: false,
|
|
20
|
+
label: 'Aplicar Filtros',
|
|
21
|
+
trailingIcon: true,
|
|
22
|
+
},
|
|
23
|
+
buttonCleaner: {
|
|
24
|
+
type: 'button',
|
|
25
|
+
color: 'tertiary',
|
|
26
|
+
size: 'normal',
|
|
27
|
+
fill: 'unstyled',
|
|
28
|
+
loading: false,
|
|
29
|
+
disabled: false,
|
|
30
|
+
label: 'Borrar Filtros',
|
|
31
|
+
trailingIcon: true,
|
|
32
|
+
},
|
|
33
|
+
onChangeFilters: () => console.log('Filter Change'),
|
|
34
|
+
section: [
|
|
35
|
+
{
|
|
36
|
+
name: 'antiguedad',
|
|
37
|
+
label: 'FILTRAR ANTIGÜEDAD: ',
|
|
38
|
+
type: 'radio',
|
|
39
|
+
options: [{name: 'Más viejo'}, {name: 'Más nuevo'}],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'anio',
|
|
43
|
+
label: 'FILTRAR POR AÑO: ',
|
|
44
|
+
type: 'checkbox',
|
|
45
|
+
options: [{name: '2019'}, {name: '2020'}, {name: '2021'}, {name: '2022'}],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'order',
|
|
49
|
+
label: 'ORDENAR: ',
|
|
50
|
+
type: 'radio',
|
|
51
|
+
options: [
|
|
52
|
+
{icon: 'fa-solid fa-home', name: 'Ascendente', iconItem: {icon: 'fa-solid fa-arrow-up'}},
|
|
53
|
+
{icon: 'fa-solid fa-home', name: 'Descendente', iconItem: {icon: 'fa-solid fa-arrow-down'}},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
} as ComponentMeta<typeof Filters>;
|
|
59
|
+
|
|
60
|
+
const Template: ComponentStory<typeof Filters> = args => <Filters {...args} />;
|
|
61
|
+
|
|
62
|
+
export const Outline = Template.bind({});
|
|
63
|
+
Outline.args = {
|
|
64
|
+
fill: 'outline',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Rounded = Template.bind({});
|
|
68
|
+
Rounded.args = {
|
|
69
|
+
fill: 'rounded',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Underline = Template.bind({});
|
|
73
|
+
Underline.args = {
|
|
74
|
+
fill: 'underline',
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const Unstyled = Template.bind({});
|
|
78
|
+
Unstyled.args = {
|
|
79
|
+
fill: 'unstyled',
|
|
80
|
+
};
|
|
81
|
+
export const Background = Template.bind({});
|
|
82
|
+
Background.args = {
|
|
83
|
+
fill: 'background',
|
|
84
|
+
};
|