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,230 @@
|
|
|
1
|
+
import {useEffect, useRef, useState} from 'react';
|
|
2
|
+
import './filters.scss';
|
|
3
|
+
import {shortenText} from '../../../utils/functions';
|
|
4
|
+
import {Icon, IIcon} from '../../Elements/Icon/Icon';
|
|
5
|
+
import {Button, IButton} from '../../Elements/Button/Button';
|
|
6
|
+
import {Checkbox} from '../Checkbox/Checkbox';
|
|
7
|
+
import {Radio} from '../Radio/Radio';
|
|
8
|
+
import {Badge} from '../../Elements/Badge/Badge';
|
|
9
|
+
|
|
10
|
+
export interface IFilters extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
11
|
+
// base
|
|
12
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
13
|
+
fill?: 'outline' | 'rounded' | 'underline' | 'unstyled' | 'background';
|
|
14
|
+
placeholder: string;
|
|
15
|
+
button: IButton;
|
|
16
|
+
buttonCleaner: IButton;
|
|
17
|
+
section?: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
label: string;
|
|
21
|
+
options?: {name: string; iconItem?: IIcon; onClick?: () => void}[];
|
|
22
|
+
}[];
|
|
23
|
+
|
|
24
|
+
// boolean
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
error?: boolean;
|
|
27
|
+
|
|
28
|
+
// events
|
|
29
|
+
onChangeFilters?: (filters: FilterValue[]) => void;
|
|
30
|
+
|
|
31
|
+
// react
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FilterValue {
|
|
36
|
+
name: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
value: string[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Filters = ({
|
|
42
|
+
size = 'sm',
|
|
43
|
+
fill = 'outline',
|
|
44
|
+
disabled = false,
|
|
45
|
+
placeholder,
|
|
46
|
+
error,
|
|
47
|
+
section,
|
|
48
|
+
button,
|
|
49
|
+
buttonCleaner,
|
|
50
|
+
onChangeFilters,
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: IFilters) => {
|
|
54
|
+
const [visibleDropdown, setVisibleDropdown] = useState(false);
|
|
55
|
+
const [visibleCleaner, setvisibleCleaner] = useState(false);
|
|
56
|
+
const [visibleAplicate, setvisibleAplicate] = useState(false);
|
|
57
|
+
const [filterValues, setFilterValues] = useState<FilterValue[]>([]);
|
|
58
|
+
const [filterValuesChanged, setFilterValuesChanged] = useState<FilterValue[]>([]);
|
|
59
|
+
|
|
60
|
+
const handleFilterChange = (type: string, filterName: string, selectedValue: string) => {
|
|
61
|
+
const sectionIndex = filterValues.findIndex(f => f.name === filterName);
|
|
62
|
+
const newValues = [...filterValues];
|
|
63
|
+
|
|
64
|
+
if (type === 'radio') {
|
|
65
|
+
if (sectionIndex >= 0) {
|
|
66
|
+
newValues[sectionIndex] = {name: filterName, value: [selectedValue]};
|
|
67
|
+
} else {
|
|
68
|
+
newValues.push({name: filterName, value: [selectedValue]});
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
const valueIndex = filterValues[sectionIndex]?.value?.indexOf(selectedValue);
|
|
72
|
+
if (sectionIndex >= 0 && valueIndex >= 0) {
|
|
73
|
+
newValues[sectionIndex].value.splice(valueIndex, 1);
|
|
74
|
+
} else if (sectionIndex >= 0) {
|
|
75
|
+
newValues[sectionIndex].value.push(selectedValue);
|
|
76
|
+
} else {
|
|
77
|
+
newValues.push({name: filterName, value: [selectedValue]});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (newValues[sectionIndex]?.value.length === 0) {
|
|
82
|
+
newValues.splice(sectionIndex, 1);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (newValues.length > 0) {
|
|
86
|
+
setvisibleAplicate(true);
|
|
87
|
+
}
|
|
88
|
+
setFilterValues(newValues);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const handleApplyFilters = () => {
|
|
92
|
+
if (onChangeFilters) {
|
|
93
|
+
onChangeFilters(filterValues);
|
|
94
|
+
setFilterValuesChanged(filterValues);
|
|
95
|
+
setvisibleAplicate(false);
|
|
96
|
+
|
|
97
|
+
if (filterValues.length === 0) {
|
|
98
|
+
setvisibleCleaner(false);
|
|
99
|
+
} else {
|
|
100
|
+
setvisibleCleaner(true);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const handleCleanFilter = () => {
|
|
106
|
+
setFilterValues([]);
|
|
107
|
+
|
|
108
|
+
const containers = document.querySelectorAll('.section__options');
|
|
109
|
+
containers.forEach(container => {
|
|
110
|
+
const labels = container.querySelectorAll('label');
|
|
111
|
+
|
|
112
|
+
labels.forEach(label => {
|
|
113
|
+
const inputs = label.querySelectorAll('input');
|
|
114
|
+
inputs.forEach(input => {
|
|
115
|
+
input.checked = false;
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
setvisibleCleaner(false);
|
|
120
|
+
setvisibleAplicate(false);
|
|
121
|
+
|
|
122
|
+
if (onChangeFilters) {
|
|
123
|
+
onChangeFilters([]);
|
|
124
|
+
setFilterValuesChanged([]);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
function changeDrop(): React.MouseEventHandler<HTMLDivElement> {
|
|
129
|
+
return (event: React.MouseEvent<HTMLDivElement>) => {
|
|
130
|
+
setVisibleDropdown(!visibleDropdown);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const dropRef = useRef<HTMLDivElement>(null);
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
function handleClickOutside(event: MouseEvent) {
|
|
137
|
+
if (dropRef.current && !dropRef.current.contains(event.target as Node)) {
|
|
138
|
+
setVisibleDropdown(false);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
document.addEventListener('click', handleClickOutside);
|
|
143
|
+
|
|
144
|
+
return () => {
|
|
145
|
+
document.removeEventListener('click', handleClickOutside);
|
|
146
|
+
};
|
|
147
|
+
}, [dropRef]);
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<div className="elv-component elv-filters" {...props}>
|
|
151
|
+
<div className={`filter-container ${className ? className : ''}`} ref={dropRef}>
|
|
152
|
+
<div
|
|
153
|
+
className={[
|
|
154
|
+
'filter-container__filter',
|
|
155
|
+
`filter--${fill}`,
|
|
156
|
+
`filter--${size}`,
|
|
157
|
+
`${error ? `filter--error` : ''} ${disabled ? `filter--disabled` : ''}`,
|
|
158
|
+
,
|
|
159
|
+
].join(' ')}
|
|
160
|
+
onClick={changeDrop()}
|
|
161
|
+
>
|
|
162
|
+
<Icon icon="fa-solid fa-filter" className={'filter'} />
|
|
163
|
+
<span className="placeholder">{shortenText(placeholder, 25)}</span>
|
|
164
|
+
{filterValuesChanged.length > 0 && <Badge color="primary" text={filterValuesChanged.length.toString()} />}
|
|
165
|
+
<Icon icon="fa-solid fa-chevron-down" className={'chebron'} />
|
|
166
|
+
</div>
|
|
167
|
+
<div className={`filter-container__dropdown filter--${size} ${visibleDropdown ? 'filter-container__dropdown--active' : ''}`}>
|
|
168
|
+
{section?.map(s => (
|
|
169
|
+
<div key={s.name} className="section">
|
|
170
|
+
<p className="section__title is-5">{s.label}</p>
|
|
171
|
+
<div className={`section__options ${s.type == 'radio' ? 'control' : 'checkbox'} is-flex is-flex-direction-column`}>
|
|
172
|
+
{s.options?.map(o => (
|
|
173
|
+
<div key={o.name}>
|
|
174
|
+
<label
|
|
175
|
+
htmlFor={o.name}
|
|
176
|
+
className={`filter-label ${s.type == 'radio' ? 'radio' : 'checkbox'} is-flex is-justify-content-space-between`}
|
|
177
|
+
>
|
|
178
|
+
<span className="filter-label__name is-flex">
|
|
179
|
+
{o.iconItem && <Icon {...o.iconItem}></Icon>}
|
|
180
|
+
<p className="">{o.name}</p>
|
|
181
|
+
</span>
|
|
182
|
+
{s.type == 'radio' ? (
|
|
183
|
+
<Radio label="" name={s.name} size="md" value={o.name} onCheck={() => handleFilterChange(s.type, s.name, o.name)} />
|
|
184
|
+
) : (
|
|
185
|
+
<Checkbox
|
|
186
|
+
label=""
|
|
187
|
+
size="md"
|
|
188
|
+
value={o.name}
|
|
189
|
+
name={s.name}
|
|
190
|
+
onCheck={() => handleFilterChange(s.type, s.name, o.name)}
|
|
191
|
+
/>
|
|
192
|
+
)}
|
|
193
|
+
</label>
|
|
194
|
+
</div>
|
|
195
|
+
))}
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
))}
|
|
199
|
+
{visibleAplicate || visibleCleaner ? (
|
|
200
|
+
<div className="actionButtons is-flex is-flex-direction-column">
|
|
201
|
+
{visibleAplicate && (
|
|
202
|
+
<span className="button-aplicate is-flex is-justify-content-center">
|
|
203
|
+
<Button
|
|
204
|
+
label={button.label !== undefined ? shortenText(button.label, 25) : ''}
|
|
205
|
+
trailingIcon={button.trailingIcon}
|
|
206
|
+
isFullWidth={true}
|
|
207
|
+
onClick={handleApplyFilters}
|
|
208
|
+
{...button}
|
|
209
|
+
/>
|
|
210
|
+
</span>
|
|
211
|
+
)}
|
|
212
|
+
{visibleCleaner && (
|
|
213
|
+
<span className="button-cleaner is-flex is-justify-content-center">
|
|
214
|
+
<Button
|
|
215
|
+
{...buttonCleaner}
|
|
216
|
+
label={buttonCleaner.label !== undefined ? shortenText(buttonCleaner.label, 25) : ''}
|
|
217
|
+
trailingIcon={buttonCleaner.trailingIcon}
|
|
218
|
+
onClick={handleCleanFilter}
|
|
219
|
+
/>
|
|
220
|
+
</span>
|
|
221
|
+
)}
|
|
222
|
+
</div>
|
|
223
|
+
) : (
|
|
224
|
+
<></>
|
|
225
|
+
)}
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
);
|
|
230
|
+
};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
@import '/src/sass/utilities/variables';
|
|
2
|
+
|
|
3
|
+
.elv-filters {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
|
|
6
|
+
.filter-container {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: inline-block;
|
|
9
|
+
|
|
10
|
+
&__filter {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: 4px;
|
|
17
|
+
font-weight: 500;
|
|
18
|
+
color: #171717;
|
|
19
|
+
background-color: white;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
padding: 8px 12px 8px 12px;
|
|
22
|
+
|
|
23
|
+
.fa_icon.filter {
|
|
24
|
+
font-size: 9px;
|
|
25
|
+
color: $text-600;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.placeholder {
|
|
29
|
+
margin-left: 4px;
|
|
30
|
+
margin-right: 7px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.fa_icon.chebron {
|
|
34
|
+
font-size: 7px;
|
|
35
|
+
color: $text-400;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.badge {
|
|
39
|
+
border-radius: 15px;
|
|
40
|
+
font-size: 10px;
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 3px 8px 3px 7.5px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// =================== VARIABLES ====================
|
|
46
|
+
/*outline*/
|
|
47
|
+
&.filter--outline {
|
|
48
|
+
border: 1px solid #d4d4d4;
|
|
49
|
+
border-radius: 12px;
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
border: 1px solid $primary-600;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:focus {
|
|
56
|
+
background-color: rgba(18, 69, 150, 0.1);
|
|
57
|
+
outline: 2px solid $primary-600;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.filter--error {
|
|
61
|
+
border: 2px solid red;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&[disabled] {
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
background-color: #ffffff;
|
|
67
|
+
border: 1px solid #d4d4d4;
|
|
68
|
+
color: #171717;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/*rounded*/
|
|
73
|
+
&.filter--rounded {
|
|
74
|
+
border: 1px solid #d4d4d4;
|
|
75
|
+
border-radius: 16px;
|
|
76
|
+
|
|
77
|
+
&:hover {
|
|
78
|
+
border: 1px solid $primary-600;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:focus {
|
|
82
|
+
background-color: rgba(18, 69, 150, 0.1);
|
|
83
|
+
outline: 2px solid $primary-600;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.filter--error {
|
|
87
|
+
border: 2px solid #dc2626;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&[disabled] {
|
|
91
|
+
cursor: not-allowed;
|
|
92
|
+
background-color: #ffffff;
|
|
93
|
+
border: 1px solid #d4d4d4;
|
|
94
|
+
color: #171717;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/*underline*/
|
|
99
|
+
&.filter--underline {
|
|
100
|
+
border: none;
|
|
101
|
+
border-bottom: 1px solid #d4d4d4;
|
|
102
|
+
|
|
103
|
+
&:hover {
|
|
104
|
+
border-bottom: 1px solid $primary-600;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&:focus {
|
|
108
|
+
background-color: rgba(18, 69, 150, 0.1);
|
|
109
|
+
outline: none;
|
|
110
|
+
border-bottom: 2px solid $primary-600;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.filter--error {
|
|
114
|
+
outline: none;
|
|
115
|
+
border-bottom: 2px solid #dc2626;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.filter--disabled {
|
|
119
|
+
cursor: not-allowed;
|
|
120
|
+
border-bottom: 1px solid #d4d4d4;
|
|
121
|
+
color: #171717;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/*unstyled*/
|
|
126
|
+
&.filter--unstyled {
|
|
127
|
+
border: 1px solid transparent;
|
|
128
|
+
border-radius: 12px;
|
|
129
|
+
|
|
130
|
+
&:focus {
|
|
131
|
+
outline: none;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/*background*/
|
|
136
|
+
&.filter--background {
|
|
137
|
+
border: 1px solid #d4d4d4;
|
|
138
|
+
border-radius: 12px;
|
|
139
|
+
background-color: #f5f5f5;
|
|
140
|
+
|
|
141
|
+
&:hover {
|
|
142
|
+
border: 1px solid $primary-600;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&:focus {
|
|
146
|
+
background-color: rgba(18, 69, 150, 0.1);
|
|
147
|
+
outline: 2px solid $primary-600;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&.filter--error {
|
|
151
|
+
border: 2px solid #dc2626;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&[disabled] {
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
background-color: #ffffff;
|
|
157
|
+
border: 1px solid #d4d4d4;
|
|
158
|
+
color: #171717;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// =================== SIZES ====================
|
|
163
|
+
&.filter--xs {
|
|
164
|
+
font-size: 10px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&.filter--sm {
|
|
168
|
+
font-size: 12px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&.filter--md {
|
|
172
|
+
font-size: 14px;
|
|
173
|
+
// width: 105px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&.filter--lg {
|
|
177
|
+
font-size: 16px;
|
|
178
|
+
// width: 120px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.filter--xl {
|
|
182
|
+
font-size: 18px;
|
|
183
|
+
// width: 130px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&.filter--xxl {
|
|
187
|
+
font-size: 20px;
|
|
188
|
+
// width: 140px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// =================== STATES ====================
|
|
192
|
+
&.filter--disabled {
|
|
193
|
+
cursor: not-allowed;
|
|
194
|
+
pointer-events: none;
|
|
195
|
+
background-color: white;
|
|
196
|
+
border-color: $muted-300;
|
|
197
|
+
color: $muted-400;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&.filter--error {
|
|
201
|
+
border-color: 1px solid red;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&__dropdown {
|
|
206
|
+
display: none;
|
|
207
|
+
position: absolute;
|
|
208
|
+
background-color: white;
|
|
209
|
+
background: #ffffff;
|
|
210
|
+
width: 236px;
|
|
211
|
+
padding: 16px;
|
|
212
|
+
box-shadow: 0px 14px 24px rgba(20, 23, 38, 0.12);
|
|
213
|
+
border-radius: 6px;
|
|
214
|
+
z-index: 1;
|
|
215
|
+
|
|
216
|
+
&--active {
|
|
217
|
+
display: block;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.section {
|
|
221
|
+
padding: 0;
|
|
222
|
+
|
|
223
|
+
&__title {
|
|
224
|
+
font-size: 10px;
|
|
225
|
+
color: $text-400;
|
|
226
|
+
margin: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&__options {
|
|
230
|
+
.filter-label {
|
|
231
|
+
&__name {
|
|
232
|
+
gap: 10px;
|
|
233
|
+
font-size: 14px;
|
|
234
|
+
margin: 2px 12px;
|
|
235
|
+
|
|
236
|
+
i {
|
|
237
|
+
font-size: 20px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
svg {
|
|
241
|
+
height: 20px;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
padding-bottom: 15px;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.actionButtons {
|
|
250
|
+
gap: 10px;
|
|
251
|
+
|
|
252
|
+
.button-cleaner {
|
|
253
|
+
.button {
|
|
254
|
+
color: $error-600;
|
|
255
|
+
font-weight: $fw-semibold;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ComponentStory, ComponentMeta} from '@storybook/react';
|
|
2
|
+
import {Input} from './Input';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Form/Input',
|
|
6
|
+
component: Input,
|
|
7
|
+
args: {
|
|
8
|
+
type: 'text',
|
|
9
|
+
color: 'none',
|
|
10
|
+
size: 'normal',
|
|
11
|
+
placeholder: 'Input placeholder',
|
|
12
|
+
onChangeInput: event => console.log('Input value changed:', event.target.value),
|
|
13
|
+
},
|
|
14
|
+
} as ComponentMeta<typeof Input>;
|
|
15
|
+
|
|
16
|
+
const Template: ComponentStory<typeof Input> = args => <Input {...args} />;
|
|
17
|
+
|
|
18
|
+
export const Standard = Template.bind({});
|
|
19
|
+
Standard.args = {};
|
|
20
|
+
|
|
21
|
+
export const Icons = Template.bind({});
|
|
22
|
+
Icons.args = {
|
|
23
|
+
iconLeft: {icon: 'fas fa-envelope'},
|
|
24
|
+
iconRight: {icon: 'fas fa-check'},
|
|
25
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {useState} from 'react';
|
|
2
|
+
import {IIcon, Icon} from '../../Elements/Icon/Icon';
|
|
3
|
+
import './input.scss';
|
|
4
|
+
|
|
5
|
+
export interface IInput extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
6
|
+
// base
|
|
7
|
+
type: 'text' | 'password' | 'email' | 'tel' | 'number';
|
|
8
|
+
color: 'none' | 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
9
|
+
size: 'small' | 'normal' | 'medium' | 'large';
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
|
|
13
|
+
iconLeft?: IIcon;
|
|
14
|
+
iconRight?: IIcon;
|
|
15
|
+
|
|
16
|
+
// boolean
|
|
17
|
+
isRounded?: boolean;
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
hasError?: boolean;
|
|
21
|
+
|
|
22
|
+
// events
|
|
23
|
+
onChangeInput?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
24
|
+
|
|
25
|
+
// react
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Input = ({
|
|
30
|
+
type,
|
|
31
|
+
color,
|
|
32
|
+
size,
|
|
33
|
+
placeholder,
|
|
34
|
+
defaultValue,
|
|
35
|
+
iconLeft,
|
|
36
|
+
iconRight,
|
|
37
|
+
isRounded,
|
|
38
|
+
isLoading,
|
|
39
|
+
isDisabled,
|
|
40
|
+
hasError,
|
|
41
|
+
className,
|
|
42
|
+
onChangeInput,
|
|
43
|
+
...props
|
|
44
|
+
}: IInput) => {
|
|
45
|
+
return (
|
|
46
|
+
<div className="elv-component elv-input" {...props}>
|
|
47
|
+
<div className={`field e-input ${className ? className : ''}`}>
|
|
48
|
+
<p
|
|
49
|
+
className={[
|
|
50
|
+
'control',
|
|
51
|
+
`${iconLeft ? ' has-icons-left' : ''}`,
|
|
52
|
+
`${iconRight ? ' has-icons-right' : ''}`,
|
|
53
|
+
`${isLoading ? ' is-loading' : ''}`,
|
|
54
|
+
].join('')}
|
|
55
|
+
>
|
|
56
|
+
<input
|
|
57
|
+
className={[
|
|
58
|
+
'input',
|
|
59
|
+
`${' is-' + size}`,
|
|
60
|
+
`${color !== 'none' ? ' is-' + color : ''}`,
|
|
61
|
+
`${isRounded ? ' is-rounded' : ''}`,
|
|
62
|
+
`${hasError ? ' has-error' : ''}`,
|
|
63
|
+
].join('')}
|
|
64
|
+
type={type}
|
|
65
|
+
placeholder={placeholder}
|
|
66
|
+
defaultValue={defaultValue}
|
|
67
|
+
disabled={isDisabled}
|
|
68
|
+
onChange={e => {
|
|
69
|
+
onChangeInput && onChangeInput(e);
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
{iconLeft && (
|
|
73
|
+
<span className={`icon is-left ${'is-' + size}`}>
|
|
74
|
+
<Icon {...iconLeft}></Icon>
|
|
75
|
+
</span>
|
|
76
|
+
)}
|
|
77
|
+
{iconRight && (
|
|
78
|
+
<span className={`icon is-right ${'is-' + size}`}>
|
|
79
|
+
<Icon {...iconRight}></Icon>
|
|
80
|
+
</span>
|
|
81
|
+
)}
|
|
82
|
+
</p>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
$input-color: $text-strong !default
|
|
2
|
+
$input-background-color: $scheme-main !default
|
|
3
|
+
$input-border-color: $border !default
|
|
4
|
+
$input-height: $control-height !default
|
|
5
|
+
$input-shadow: inset 0 0.0625em 0.125em rgba($scheme-invert, 0.05) !default
|
|
6
|
+
$input-placeholder-color: bulmaRgba($input-color, 0.3) !default
|
|
7
|
+
|
|
8
|
+
$input-hover-color: $text-strong !default
|
|
9
|
+
$input-hover-border-color: $border-hover !default
|
|
10
|
+
|
|
11
|
+
$input-focus-color: $text-strong !default
|
|
12
|
+
$input-focus-border-color: $link !default
|
|
13
|
+
$input-focus-box-shadow-size: 0 0 0 0.125em !default
|
|
14
|
+
$input-focus-box-shadow-color: bulmaRgba($link, 0.25) !default
|
|
15
|
+
|
|
16
|
+
$input-disabled-color: $text-light !default
|
|
17
|
+
$input-disabled-background-color: $background !default
|
|
18
|
+
$input-disabled-border-color: $background !default
|
|
19
|
+
$input-disabled-placeholder-color: bulmaRgba($input-disabled-color, 0.3) !default
|
|
20
|
+
|
|
21
|
+
$input-arrow: $link !default
|
|
22
|
+
|
|
23
|
+
$input-icon-color: $border !default
|
|
24
|
+
$input-icon-active-color: $text !default
|
|
25
|
+
|
|
26
|
+
$input-radius: 12px !default
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import '/src/sass/utilities/variables';
|
|
2
|
+
|
|
3
|
+
.elv-input {
|
|
4
|
+
.input {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
|
|
7
|
+
&.is-small {
|
|
8
|
+
border-radius: 12px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.has-error {
|
|
12
|
+
border-color: $error-600;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&:focus {
|
|
16
|
+
background-color: rgba(18, 69, 150, 0.1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {ComponentStory, ComponentMeta} from '@storybook/react';
|
|
2
|
+
import {useState} from 'react';
|
|
3
|
+
import {InputForm} from './Input-form-control';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Form/Input Form Control',
|
|
7
|
+
component: InputForm,
|
|
8
|
+
args: {
|
|
9
|
+
input: {
|
|
10
|
+
color: 'none',
|
|
11
|
+
placeholder: 'Input placeholder',
|
|
12
|
+
size: 'normal',
|
|
13
|
+
type: 'text',
|
|
14
|
+
iconLeft: {icon: 'fas fa-user'},
|
|
15
|
+
},
|
|
16
|
+
label: 'Label',
|
|
17
|
+
helperText: 'Helper text',
|
|
18
|
+
defaultValue: '',
|
|
19
|
+
maxLength: 10,
|
|
20
|
+
},
|
|
21
|
+
} as ComponentMeta<typeof InputForm>;
|
|
22
|
+
|
|
23
|
+
const Template: ComponentStory<typeof InputForm> = args => <InputForm {...args} />;
|
|
24
|
+
|
|
25
|
+
export const Standard = Template.bind({});
|
|
26
|
+
Standard.args = {};
|