@caipira/tamandua 0.0.1
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/.editorconfig +12 -0
- package/.prettierrc +5 -0
- package/.storybook/main.ts +25 -0
- package/.storybook/preview-body.html +3 -0
- package/.storybook/preview.ts +24 -0
- package/App.vue +1 -0
- package/Dockerfile +21 -0
- package/LICENSE +674 -0
- package/README.md +11 -0
- package/assets/icons/account.svg +1 -0
- package/assets/icons/alert-octagon-outline.svg +1 -0
- package/assets/icons/alert-octagon.svg +1 -0
- package/assets/icons/archive-outline.svg +1 -0
- package/assets/icons/archive.svg +1 -0
- package/assets/icons/arrow-left.svg +1 -0
- package/assets/icons/arrow-right.svg +1 -0
- package/assets/icons/bank-outline.svg +1 -0
- package/assets/icons/bank.svg +1 -0
- package/assets/icons/camera.svg +1 -0
- package/assets/icons/cards-outline.svg +1 -0
- package/assets/icons/cards-variant.svg +1 -0
- package/assets/icons/cart-outline.svg +1 -0
- package/assets/icons/chart-box-outline.svg +1 -0
- package/assets/icons/chart-box.svg +1 -0
- package/assets/icons/check-circle-outline.svg +1 -0
- package/assets/icons/check-circle.svg +1 -0
- package/assets/icons/check.svg +1 -0
- package/assets/icons/checkbox-dark.svg +1 -0
- package/assets/icons/checkbox-indeterminate-dark.svg +1 -0
- package/assets/icons/checkbox-indeterminate.svg +1 -0
- package/assets/icons/checkbox.svg +1 -0
- package/assets/icons/chevron-down.svg +1 -0
- package/assets/icons/chevron-left.svg +1 -0
- package/assets/icons/chevron-right.svg +1 -0
- package/assets/icons/chevron-up.svg +1 -0
- package/assets/icons/circle.svg +1 -0
- package/assets/icons/clock.svg +1 -0
- package/assets/icons/close-circle-outline.svg +1 -0
- package/assets/icons/close-circle.svg +1 -0
- package/assets/icons/close.svg +1 -0
- package/assets/icons/cog.svg +1 -0
- package/assets/icons/color-fill.svg +1 -0
- package/assets/icons/copy.svg +1 -0
- package/assets/icons/credit-card-plus.svg +1 -0
- package/assets/icons/credit-card.svg +1 -0
- package/assets/icons/currency.svg +1 -0
- package/assets/icons/database.svg +1 -0
- package/assets/icons/dots-grid.svg +1 -0
- package/assets/icons/dots-vertical.svg +1 -0
- package/assets/icons/email-open-outline.svg +1 -0
- package/assets/icons/email-outline.svg +1 -0
- package/assets/icons/eye-off.svg +1 -0
- package/assets/icons/eye.svg +1 -0
- package/assets/icons/file-document-plus-outline.svg +1 -0
- package/assets/icons/filmstrip.svg +1 -0
- package/assets/icons/filter.svg +1 -0
- package/assets/icons/fullscreen-exit.svg +1 -0
- package/assets/icons/fullscreen.svg +1 -0
- package/assets/icons/group.svg +1 -0
- package/assets/icons/image-album-outline.svg +1 -0
- package/assets/icons/image-album.svg +1 -0
- package/assets/icons/image-outline.svg +1 -0
- package/assets/icons/image.svg +1 -0
- package/assets/icons/info-outline.svg +1 -0
- package/assets/icons/key-chain.svg +1 -0
- package/assets/icons/key-variant.svg +1 -0
- package/assets/icons/key.svg +1 -0
- package/assets/icons/listbox-outline.svg +1 -0
- package/assets/icons/loading.svg +1 -0
- package/assets/icons/lock-outline.svg +1 -0
- package/assets/icons/lock.svg +1 -0
- package/assets/icons/logout.svg +1 -0
- package/assets/icons/menu-down.svg +1 -0
- package/assets/icons/menu-left.svg +1 -0
- package/assets/icons/menu-right.svg +1 -0
- package/assets/icons/menu.svg +1 -0
- package/assets/icons/minus-circle-outline.svg +1 -0
- package/assets/icons/minus-circle.svg +1 -0
- package/assets/icons/minus.svg +1 -0
- package/assets/icons/moon.svg +1 -0
- package/assets/icons/open-in-new.svg +1 -0
- package/assets/icons/pencil.svg +1 -0
- package/assets/icons/people.svg +1 -0
- package/assets/icons/piggy-bank-outline.svg +1 -0
- package/assets/icons/plus-circle-outline.svg +1 -0
- package/assets/icons/plus-circle.svg +1 -0
- package/assets/icons/plus.svg +1 -0
- package/assets/icons/qrcode-scan.svg +1 -0
- package/assets/icons/radio-dark.svg +1 -0
- package/assets/icons/radio.svg +1 -0
- package/assets/icons/refresh.svg +1 -0
- package/assets/icons/save.svg +1 -0
- package/assets/icons/search.svg +1 -0
- package/assets/icons/spotlight.svg +1 -0
- package/assets/icons/store-outline.svg +1 -0
- package/assets/icons/sun.svg +1 -0
- package/assets/icons/swap-horizontal.svg +1 -0
- package/assets/icons/swap-left.svg +1 -0
- package/assets/icons/swap-right.svg +1 -0
- package/assets/icons/swap.svg +1 -0
- package/assets/icons/system-theme.svg +1 -0
- package/assets/icons/tag-outline.svg +1 -0
- package/assets/icons/trash-can-outline.svg +1 -0
- package/assets/icons/trash-can.svg +1 -0
- package/assets/icons/upload.svg +1 -0
- package/assets/icons/user-circle.svg +1 -0
- package/assets/icons/zip-box.svg +1 -0
- package/assets/images/fs/apk.svg +11 -0
- package/assets/images/fs/bmp.svg +7 -0
- package/assets/images/fs/css.svg +8 -0
- package/assets/images/fs/doc.svg +9 -0
- package/assets/images/fs/docx.svg +9 -0
- package/assets/images/fs/folder-adwaita.svg +8 -0
- package/assets/images/fs/folder-black.svg +8 -0
- package/assets/images/fs/folder-brown.svg +8 -0
- package/assets/images/fs/folder-grey.svg +8 -0
- package/assets/images/fs/folder-nordic.svg +8 -0
- package/assets/images/fs/folder-orange.svg +8 -0
- package/assets/images/fs/folder-palebrown.svg +8 -0
- package/assets/images/fs/folder-paleorange.svg +8 -0
- package/assets/images/fs/folder-teal.svg +8 -0
- package/assets/images/fs/folder-white.svg +8 -0
- package/assets/images/fs/folder-yellow.svg +8 -0
- package/assets/images/fs/gif.svg +7 -0
- package/assets/images/fs/go.svg +9 -0
- package/assets/images/fs/ics.svg +24 -0
- package/assets/images/fs/iso.svg +10 -0
- package/assets/images/fs/jpeg.svg +7 -0
- package/assets/images/fs/jpg.svg +7 -0
- package/assets/images/fs/js.svg +9 -0
- package/assets/images/fs/json.svg +9 -0
- package/assets/images/fs/lua.svg +9 -0
- package/assets/images/fs/m4v.svg +7 -0
- package/assets/images/fs/md.svg +10 -0
- package/assets/images/fs/mov.svg +7 -0
- package/assets/images/fs/mp3.svg +9 -0
- package/assets/images/fs/mp4.svg +7 -0
- package/assets/images/fs/pdf.svg +9 -0
- package/assets/images/fs/pgp.svg +8 -0
- package/assets/images/fs/php.svg +9 -0
- package/assets/images/fs/png.svg +7 -0
- package/assets/images/fs/ppt.svg +9 -0
- package/assets/images/fs/py.svg +9 -0
- package/assets/images/fs/rar.svg +20 -0
- package/assets/images/fs/rpm.svg +7 -0
- package/assets/images/fs/rs.svg +9 -0
- package/assets/images/fs/sh.svg +9 -0
- package/assets/images/fs/tar.svg +20 -0
- package/assets/images/fs/txt.svg +8 -0
- package/assets/images/fs/unknown.svg +8 -0
- package/assets/images/fs/xls.svg +9 -0
- package/assets/images/fs/xlsx.svg +9 -0
- package/assets/images/fs/xml.svg +8 -0
- package/assets/images/fs/yaml.svg +9 -0
- package/assets/images/fs/zip.svg +20 -0
- package/components/Avatar/Avatar.story.ts +55 -0
- package/components/Avatar/Avatar.vue +82 -0
- package/components/Avatar/index.ts +12 -0
- package/components/Backdrop/Backdrop.vue +27 -0
- package/components/Backdrop/index.ts +12 -0
- package/components/Button/Button.story.ts +74 -0
- package/components/Button/Button.vue +230 -0
- package/components/Button/index.ts +12 -0
- package/components/ButtonCopy/ButtonCopy.vue +61 -0
- package/components/ButtonCopy/index.ts +12 -0
- package/components/Drawer/Drawer.vue +102 -0
- package/components/Drawer/index.ts +12 -0
- package/components/Dropdown/Dropdown.vue +258 -0
- package/components/Dropdown/index.ts +12 -0
- package/components/EventListener/EventListener.vue +12 -0
- package/components/FileDrop/FileDrop.vue +116 -0
- package/components/FileDrop/index.ts +12 -0
- package/components/Form/Form.spec.ts +72 -0
- package/components/Form/Form.vue +134 -0
- package/components/Form/index.ts +12 -0
- package/components/FormItem/FormItem.vue +85 -0
- package/components/FormItem/index.ts +12 -0
- package/components/GraphyEmpty/GraphyEmpty.vue +16 -0
- package/components/GraphyEmpty/index.ts +12 -0
- package/components/GraphyLabel/GraphyLabel.vue +34 -0
- package/components/GraphyLabel/index.ts +12 -0
- package/components/GraphyPrice/GraphyPrice.story.ts +37 -0
- package/components/GraphyPrice/GraphyPrice.vue +65 -0
- package/components/GraphyPrice/index.ts +12 -0
- package/components/GraphySubtitle/GraphySubtitle.vue +22 -0
- package/components/GraphySubtitle/index.ts +12 -0
- package/components/GraphyTitle/GraphyTitle.vue +13 -0
- package/components/GraphyTitle/index.ts +12 -0
- package/components/Icon/Icon.vue +84 -0
- package/components/Icon/index.ts +12 -0
- package/components/IconButton/IconButton.vue +168 -0
- package/components/IconButton/index.ts +12 -0
- package/components/InputAvatar/InputAvatar.vue +63 -0
- package/components/InputAvatar/index.ts +12 -0
- package/components/InputCheckbox/InputCheckbox.vue +77 -0
- package/components/InputCheckbox/index.ts +12 -0
- package/components/InputColor/InputColor.vue +54 -0
- package/components/InputColor/index.ts +12 -0
- package/components/InputDate/InputDate.story.ts +15 -0
- package/components/InputDate/InputDate.vue +368 -0
- package/components/InputDate/index.ts +12 -0
- package/components/InputMultiplier/InputMultiplier.vue +144 -0
- package/components/InputMultiplier/index.ts +12 -0
- package/components/InputPassword/InputPassword.vue +168 -0
- package/components/InputPassword/index.ts +12 -0
- package/components/InputPhone/InputPhone.vue +125 -0
- package/components/InputPhone/index.ts +12 -0
- package/components/InputPrice/InputPrice.vue +96 -0
- package/components/InputPrice/index.ts +12 -0
- package/components/InputRadio/InputRadio.vue +41 -0
- package/components/InputRadio/InputRadioGroup.story.ts +24 -0
- package/components/InputRadio/InputRadioGroup.vue +48 -0
- package/components/InputRadio/index.ts +14 -0
- package/components/InputSelect/InputSelect.story.ts +87 -0
- package/components/InputSelect/InputSelect.vue +507 -0
- package/components/InputSelect/index.ts +12 -0
- package/components/InputSwitch/InputSwitch.story.ts +34 -0
- package/components/InputSwitch/InputSwitch.vue +82 -0
- package/components/InputSwitch/index.ts +12 -0
- package/components/InputText/InputText.vue +62 -0
- package/components/InputText/index.ts +12 -0
- package/components/InputTextarea/InputTextarea.vue +64 -0
- package/components/InputTextarea/index.ts +12 -0
- package/components/LineChart/LineChart.vue +14 -0
- package/components/LineChart/index.ts +12 -0
- package/components/Modal/Modal.vue +106 -0
- package/components/Modal/index.ts +12 -0
- package/components/ModalForm/ModalForm.vue +141 -0
- package/components/ModalForm/index.ts +12 -0
- package/components/Pagination/Pagination.story.ts +15 -0
- package/components/Pagination/Pagination.vue +138 -0
- package/components/Pagination/index.ts +12 -0
- package/components/PieChart/PieChart.vue +14 -0
- package/components/PieChart/index.ts +12 -0
- package/components/Popconfirm/Popconfirm.vue +80 -0
- package/components/Popconfirm/index.ts +12 -0
- package/components/Popover/Popover.vue +133 -0
- package/components/Popover/index.ts +12 -0
- package/components/ProgressCircle/ProgressCircle.story.ts +31 -0
- package/components/ProgressCircle/ProgressCircle.vue +82 -0
- package/components/ProgressCircle/index.ts +12 -0
- package/components/ProgressLine/ProgressLine.story.ts +27 -0
- package/components/ProgressLine/ProgressLine.vue +104 -0
- package/components/ProgressLine/index.ts +12 -0
- package/components/SensitiveInfo/SensitiveInfo.vue +18 -0
- package/components/SensitiveInfo/index.ts +12 -0
- package/components/Tab/Tab.vue +58 -0
- package/components/Tab/index.ts +12 -0
- package/components/Table/Table.story.ts +32 -0
- package/components/Table/Table.vue +318 -0
- package/components/Table/index.ts +12 -0
- package/components/Tag/Tag.vue +73 -0
- package/components/Tag/index.ts +12 -0
- package/components/Toast/Toast.vue +75 -0
- package/components/Toast/index.ts +12 -0
- package/components/index.ts +43 -0
- package/components/plugins.ts +89 -0
- package/composables/index.ts +2 -0
- package/composables/useBreakpoints.ts +30 -0
- package/composables/useRender.ts +29 -0
- package/entrypoint.sh +19 -0
- package/enums/app.ts +5 -0
- package/enums/form.ts +25 -0
- package/enums/ui.ts +160 -0
- package/env.d.ts +8 -0
- package/i18n.ts +20 -0
- package/index.css +383 -0
- package/index.html +22 -0
- package/index.ts +14 -0
- package/main.ts +31 -0
- package/package.json +70 -0
- package/plugins/register-component.ts +5 -0
- package/postcss.config.js +6 -0
- package/services/clipboard.ts +5 -0
- package/services/date.ts +27 -0
- package/services/form/crud.ts +109 -0
- package/services/form/form-data-transformers.ts +148 -0
- package/services/form/form-json-transformers.ts +91 -0
- package/services/form/form-transformer.ts +54 -0
- package/services/form/form-value-transformers.ts +35 -0
- package/services/form/form.test.ts +98 -0
- package/services/form/form.ts +80 -0
- package/services/password.ts +309 -0
- package/services/ui.ts +43 -0
- package/tailwind.config.js +16 -0
- package/tsconfig.json +23 -0
- package/types/address.ts +44 -0
- package/types/api.ts +28 -0
- package/types/common.ts +5 -0
- package/types/form.ts +144 -0
- package/types/index.ts +5 -0
- package/types/ui.ts +55 -0
- package/types/website.ts +16 -0
- package/vite.config.mts +38 -0
- package/vitest.setup.ts +21 -0
package/index.css
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
/*
|
|
7
|
+
Theme configuration:
|
|
8
|
+
|
|
9
|
+
--caipira-primary: [Accent color] Background color of content (pages, cards, etc)
|
|
10
|
+
--caipira-secondary: [Contrast color] Hover color
|
|
11
|
+
--caipira-tertiary: [Background color] Border color, unfocused text color, app background color
|
|
12
|
+
--caipira-quaternary: [Unused]
|
|
13
|
+
--caipira-quinary: [Unused]
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
Light theme
|
|
18
|
+
*/
|
|
19
|
+
--caipira-light-primary: #fff;
|
|
20
|
+
--caipira-light-secondary: #f1f3f4;
|
|
21
|
+
--caipira-light-tertiary: #d3d3d3;
|
|
22
|
+
--caipira-light-quaternary: #d1d1d1;
|
|
23
|
+
--caipira-light-quinary: #efefef;
|
|
24
|
+
--caipira-light-red: #e64553;
|
|
25
|
+
--caipira-light-green: #16a34ae6;
|
|
26
|
+
--caipira-light-yellow: #df8e1d;
|
|
27
|
+
--caipira-light-blue: #1e66f5;
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
Dark theme
|
|
31
|
+
*/
|
|
32
|
+
--caipira-dark-primary: #121212;
|
|
33
|
+
--caipira-dark-secondary: #282828;
|
|
34
|
+
--caipira-dark-tertiary: #262626;
|
|
35
|
+
--caipira-dark-quaternary: #525252;
|
|
36
|
+
--caipira-dark-quinary: #202020;
|
|
37
|
+
--caipira-dark-red: #f38ba8;
|
|
38
|
+
--caipira-dark-green: #a6e3a1;
|
|
39
|
+
--caipira-dark-yellow: #f9e2af;
|
|
40
|
+
--caipira-dark-blue: #4089ff;
|
|
41
|
+
|
|
42
|
+
&:not(.dark) {
|
|
43
|
+
/* Colors */
|
|
44
|
+
--caipira-primary: var(--caipira-light-primary);
|
|
45
|
+
--caipira-primary-inverted: var(--caipira-dark-primary);
|
|
46
|
+
--caipira-secondary: var(--caipira-light-secondary);
|
|
47
|
+
--caipira-secondary-inverted: var(--caipira-dark-secondary);
|
|
48
|
+
--caipira-tertiary: var(--caipira-light-tertiary);
|
|
49
|
+
--caipira-quaternary: var(--caipira-light-quaternary);
|
|
50
|
+
--caipira-quinary: var(--caipira-light-quinary);
|
|
51
|
+
--caipira-red: var(--caipira-light-red);
|
|
52
|
+
--caipira-green: var(--caipira-light-green);
|
|
53
|
+
--caipira-yellow: var(--caipira-light-yellow);
|
|
54
|
+
--caipira-blue: var(--caipira-light-blue);
|
|
55
|
+
|
|
56
|
+
/* Functional color pointers */
|
|
57
|
+
--border-color: var(--caipira-light-tertiary);
|
|
58
|
+
--unfocused-color: var(--caipira-light-tertiary);
|
|
59
|
+
--hover-color: var(--caipira-light-secondary);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.dark {
|
|
63
|
+
/* Colors */
|
|
64
|
+
--caipira-primary: var(--caipira-dark-primary);
|
|
65
|
+
--caipira-primary-inverted: var(--caipira-light-primary);
|
|
66
|
+
--caipira-secondary: var(--caipira-dark-secondary);
|
|
67
|
+
--caipira-secondary-inverted: var(--caipira-light-secondary);
|
|
68
|
+
--caipira-tertiary: var(--caipira-dark-tertiary);
|
|
69
|
+
--caipira-quaternary: var(--caipira-dark-quaternary);
|
|
70
|
+
--caipira-quinary: var(--caipira-dark-quinary);
|
|
71
|
+
--caipira-red: var(--caipira-dark-red);
|
|
72
|
+
--caipira-green: var(--caipira-dark-green);
|
|
73
|
+
--caipira-yellow: var(--caipira-dark-yellow);
|
|
74
|
+
--caipira-blue: var(--caipira-dark-blue);
|
|
75
|
+
|
|
76
|
+
/* Functional color pointers */
|
|
77
|
+
--border-color: var(--caipira-dark-tertiary);
|
|
78
|
+
--unfocused-color: var(--caipira-dark-tertiary);
|
|
79
|
+
--hover-color: var(--caipira-dark-quinary);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@layer components {
|
|
84
|
+
/* Background */
|
|
85
|
+
.bg-caipira-primary {
|
|
86
|
+
background-color: var(--caipira-primary);
|
|
87
|
+
}
|
|
88
|
+
.bg-caipira-primary-inverted {
|
|
89
|
+
background-color: var(--caipira-primary-inverted);
|
|
90
|
+
}
|
|
91
|
+
.bg-caipira-secondary {
|
|
92
|
+
background-color: var(--caipira-secondary);
|
|
93
|
+
}
|
|
94
|
+
.bg-caipira-tertiary {
|
|
95
|
+
background-color: var(--caipira-tertiary);
|
|
96
|
+
}
|
|
97
|
+
.bg-caipira-blue {
|
|
98
|
+
background-color: var(--caipira-blue);
|
|
99
|
+
}
|
|
100
|
+
.bg-caipira-red {
|
|
101
|
+
background-color: var(--caipira-red);
|
|
102
|
+
}
|
|
103
|
+
.bg-caipira-yellow {
|
|
104
|
+
background-color: var(--caipira-yellow);
|
|
105
|
+
}
|
|
106
|
+
.bg-caipira-green {
|
|
107
|
+
background-color: var(--caipira-green);
|
|
108
|
+
}
|
|
109
|
+
.bg-hover {
|
|
110
|
+
background-color: var(--hover-color);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Border */
|
|
114
|
+
.border-color {
|
|
115
|
+
border-color: var(--border-color);
|
|
116
|
+
}
|
|
117
|
+
.border-caipira-primary-inverted {
|
|
118
|
+
border-color: var(--caipira-primary-inverted);
|
|
119
|
+
}
|
|
120
|
+
.border-caipira-tertiary {
|
|
121
|
+
border-color: var(--caipira-tertiary);
|
|
122
|
+
}
|
|
123
|
+
.border-caipira-blue {
|
|
124
|
+
border-color: var(--caipira-blue);
|
|
125
|
+
}
|
|
126
|
+
.border-caipira-red {
|
|
127
|
+
border-color: var(--caipira-red);
|
|
128
|
+
}
|
|
129
|
+
.border-caipira-yellow {
|
|
130
|
+
border-color: var(--caipira-yellow);
|
|
131
|
+
}
|
|
132
|
+
.border-caipira-green {
|
|
133
|
+
border-color: var(--caipira-green);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Text */
|
|
137
|
+
.color-caipira-primary {
|
|
138
|
+
color: var(--caipira-primary);
|
|
139
|
+
}
|
|
140
|
+
.color-caipira-primary-inverted {
|
|
141
|
+
color: var(--caipira-primary-inverted);
|
|
142
|
+
}
|
|
143
|
+
.color-text {
|
|
144
|
+
color: var(--caipira-secondary-inverted);
|
|
145
|
+
}
|
|
146
|
+
.color-unfocused-text {
|
|
147
|
+
color: var(--caipira-tertiary);
|
|
148
|
+
}
|
|
149
|
+
.color-caipira-blue {
|
|
150
|
+
color: var(--caipira-blue);
|
|
151
|
+
}
|
|
152
|
+
.color-caipira-red {
|
|
153
|
+
color: var(--caipira-red);
|
|
154
|
+
}
|
|
155
|
+
.color-caipira-yellow {
|
|
156
|
+
color: var(--caipira-yellow);
|
|
157
|
+
}
|
|
158
|
+
.color-caipira-green {
|
|
159
|
+
color: var(--caipira-green);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Fill */
|
|
163
|
+
.fill-caipira-primary-inverted {
|
|
164
|
+
fill: var(--caipira-primary-inverted);
|
|
165
|
+
}
|
|
166
|
+
.fill-caipira-blue {
|
|
167
|
+
fill: var(--caipira-blue);
|
|
168
|
+
}
|
|
169
|
+
.fill-caipira-red {
|
|
170
|
+
fill: var(--caipira-red);
|
|
171
|
+
}
|
|
172
|
+
.fill-caipira-yellow {
|
|
173
|
+
fill: var(--caipira-yellow);
|
|
174
|
+
}
|
|
175
|
+
.fill-caipira-green {
|
|
176
|
+
fill: var(--caipira-green);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Input */
|
|
180
|
+
.input-border {
|
|
181
|
+
border-color: var(--border-color);
|
|
182
|
+
}
|
|
183
|
+
.input-roundness {
|
|
184
|
+
@apply rounded-sm;
|
|
185
|
+
}
|
|
186
|
+
.input-outline {
|
|
187
|
+
@apply focus:outline focus:outline-1 focus:ring-1;
|
|
188
|
+
outline-color: var(--caipira-blue);
|
|
189
|
+
|
|
190
|
+
&:focus {
|
|
191
|
+
box-shadow: none !important;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
.input-bg-color {
|
|
195
|
+
@apply bg-caipira-primary;
|
|
196
|
+
}
|
|
197
|
+
.input-text-color {
|
|
198
|
+
@apply color-text;
|
|
199
|
+
}
|
|
200
|
+
.input-padding {
|
|
201
|
+
@apply pl-2 pr-1;
|
|
202
|
+
}
|
|
203
|
+
.input-control {
|
|
204
|
+
@apply flex justify-center items-center w-12 input-bg-color;
|
|
205
|
+
}
|
|
206
|
+
.input-label {
|
|
207
|
+
@apply select-none color-text;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Card */
|
|
211
|
+
.card {
|
|
212
|
+
@apply relative max-w-md w-full rounded border border-color color-text bg-caipira-primary;
|
|
213
|
+
}
|
|
214
|
+
.card-grid {
|
|
215
|
+
@apply flex flex-wrap justify-center md:justify-start items-stretch gap-3;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* Page */
|
|
219
|
+
.page-margin {
|
|
220
|
+
@apply p-2 md:p-6 pb-12;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Floatables (Modal, Popover, etc) */
|
|
224
|
+
.floatable {
|
|
225
|
+
@apply shadow border border-color color-text bg-caipira-primary;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.favicon {
|
|
230
|
+
width: 1.2rem;
|
|
231
|
+
margin-right: 0.5rem;
|
|
232
|
+
display: inline-block;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.fs {
|
|
236
|
+
width: 20px;
|
|
237
|
+
height: 20px;
|
|
238
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/unknown.svg");
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.fs.bmp {
|
|
242
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/bmp.svg");
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.fs.ics {
|
|
246
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/ics.svg");
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.fs.jpg {
|
|
250
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/jpg.svg");
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.fs.jpeg {
|
|
254
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/jpeg.svg");
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.fs.doc {
|
|
258
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/doc.svg");
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.fs.docx {
|
|
262
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/docx.svg");
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.fs.gif {
|
|
266
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/gif.svg");
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.fs.mp3 {
|
|
270
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/mp3.svg");
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.fs.mp4 {
|
|
274
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/mp4.svg");
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.fs.pdf {
|
|
278
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/pdf.svg");
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.fs.png {
|
|
282
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/png.svg");
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.fs.rar {
|
|
286
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/rar.svg");
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.fs.tar {
|
|
290
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/tar.svg");
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.fs.txt {
|
|
294
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/txt.svg");
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.fs.xls {
|
|
298
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/xls.svg");
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.fs.xlsx {
|
|
302
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/xlsx.svg");
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.fs.xml {
|
|
306
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/xml.svg");
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.fs.yaml {
|
|
310
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/yaml.svg");
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.fs.zip {
|
|
314
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/zip.svg");
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.fs.dir {
|
|
318
|
+
content: url("https://static.%GLOBAL_DOMAIN%/site/assets/images/fs/folder-paleorange.svg");
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
html,
|
|
322
|
+
body {
|
|
323
|
+
font-family: "San Francisco", sans-serif; /* font-family: "Inter", sans-serif; */
|
|
324
|
+
-webkit-font-smoothing: antialiased;
|
|
325
|
+
font-size: 16px; /* Min font size not to trigger zoom effect on input on safari */
|
|
326
|
+
position: relative;
|
|
327
|
+
margin: 0;
|
|
328
|
+
border: 0;
|
|
329
|
+
padding: 0;
|
|
330
|
+
width: 100%;
|
|
331
|
+
height: 100%;
|
|
332
|
+
overflow: hidden;
|
|
333
|
+
overflow: auto;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/* Scrollbar */
|
|
337
|
+
|
|
338
|
+
.scrollbar {
|
|
339
|
+
&::-webkit-scrollbar {
|
|
340
|
+
width: 7px;
|
|
341
|
+
height: 10px;
|
|
342
|
+
border-radius: 5px;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
&::-webkit-scrollbar-track {
|
|
346
|
+
background: var(--caipira-secondary);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
&::-webkit-scrollbar-thumb {
|
|
350
|
+
background-color: var(--caipira-quaternary);
|
|
351
|
+
border-radius: 5px;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/* Tailwind form hack to show the data images */
|
|
356
|
+
|
|
357
|
+
&:not(.dark) {
|
|
358
|
+
.form-radio:checked {
|
|
359
|
+
background-image: url("/assets/icons/radio-dark.svg");
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.form-checkbox:checked {
|
|
363
|
+
background-image: url("/assets/icons/checkbox.svg");
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.form-checkbox:indeterminate {
|
|
367
|
+
background-image: url("/assets/icons/checkbox-indeterminate.svg");
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
&.dark {
|
|
372
|
+
.form-radio:checked {
|
|
373
|
+
background-image: url("/assets/icons/radio.svg");
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.form-checkbox:checked {
|
|
377
|
+
background-image: url("/assets/icons/checkbox-dark.svg");
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.form-checkbox:indeterminate {
|
|
381
|
+
background-image: url("/assets/icons/checkbox-indeterminate-dark.svg");
|
|
382
|
+
}
|
|
383
|
+
}
|
package/index.html
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link
|
|
6
|
+
rel="icon"
|
|
7
|
+
href="/assets/images/favicon.ico"
|
|
8
|
+
/>
|
|
9
|
+
<meta
|
|
10
|
+
name="viewport"
|
|
11
|
+
content="width=device-width, initial-scale=1.0"
|
|
12
|
+
/>
|
|
13
|
+
<title>Caipira Cloud</title>
|
|
14
|
+
</head>
|
|
15
|
+
<body class="text-base color-text bg-caipira-tertiary">
|
|
16
|
+
<div id="app"></div>
|
|
17
|
+
<script
|
|
18
|
+
type="module"
|
|
19
|
+
src="./main.ts"
|
|
20
|
+
></script>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
package/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { App, Plugin } from "vue";
|
|
2
|
+
|
|
3
|
+
import * as plugins from "@/components/plugins";
|
|
4
|
+
|
|
5
|
+
const plugin: Plugin = {
|
|
6
|
+
install(app: App) {
|
|
7
|
+
for (const componentKey in plugins) {
|
|
8
|
+
app.use(plugins[componentKey]);
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export * from "@/components";
|
|
14
|
+
export default plugin;
|
package/main.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import i18n from "@/i18n";
|
|
2
|
+
import Tamandua from "@/index";
|
|
3
|
+
import { createApp } from "vue";
|
|
4
|
+
|
|
5
|
+
import App from "@/App.vue";
|
|
6
|
+
import "@/index.css";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Chart,
|
|
10
|
+
Legend,
|
|
11
|
+
Tooltip,
|
|
12
|
+
ArcElement,
|
|
13
|
+
LinearScale,
|
|
14
|
+
LineElement,
|
|
15
|
+
PointElement,
|
|
16
|
+
CategoryScale,
|
|
17
|
+
LineController,
|
|
18
|
+
} from "chart.js";
|
|
19
|
+
|
|
20
|
+
Chart.register(
|
|
21
|
+
Legend,
|
|
22
|
+
Tooltip,
|
|
23
|
+
ArcElement,
|
|
24
|
+
LinearScale,
|
|
25
|
+
LineElement,
|
|
26
|
+
PointElement,
|
|
27
|
+
CategoryScale,
|
|
28
|
+
LineController,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
createApp(App).use(i18n).use(Tamandua).mount("#app");
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@caipira/tamandua",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "UI library for the Caipira ecosystem",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"homepage": "https://caipira.io",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Theone Lucas",
|
|
9
|
+
"email": "theone@caipira.io"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/caipira-io/tamandua.git"
|
|
14
|
+
},
|
|
15
|
+
"typings": "dist/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
"./*": "./*"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"start": "vite --host",
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"preview": "vite preview",
|
|
23
|
+
"start:test": "vitest",
|
|
24
|
+
"test": "vitest --run",
|
|
25
|
+
"typecheck": "vue-tsc --noEmit --skipLibCheck -p tsconfig.json --composite false",
|
|
26
|
+
"start:sb": "storybook dev",
|
|
27
|
+
"build:sb": "storybook build"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"chart.js": "^4.0.0",
|
|
31
|
+
"date-fns": "^2.25.0",
|
|
32
|
+
"gsap": "^3.12.2",
|
|
33
|
+
"vue-chartjs": "^5.2.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"vue": "^3.0.0",
|
|
37
|
+
"vue-i18n": "9"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@faker-js/faker": "^8.4.1",
|
|
41
|
+
"@popperjs/core": "^2.10.1",
|
|
42
|
+
"@storybook/addon-actions": "^8.0.5",
|
|
43
|
+
"@storybook/addon-essentials": "^8.0.5",
|
|
44
|
+
"@storybook/addon-interactions": "^8.0.5",
|
|
45
|
+
"@storybook/addon-links": "^8.0.5",
|
|
46
|
+
"@storybook/addon-themes": "^8.0.5",
|
|
47
|
+
"@storybook/blocks": "^8.0.5",
|
|
48
|
+
"@storybook/builder-vite": "^8.0.5",
|
|
49
|
+
"@storybook/testing-library": "^0.2.2",
|
|
50
|
+
"@storybook/vue3": "^8.0.5",
|
|
51
|
+
"@storybook/vue3-vite": "^8.0.5",
|
|
52
|
+
"@tailwindcss/forms": "^0.5.6",
|
|
53
|
+
"@types/js-cookie": "^2.2.7",
|
|
54
|
+
"@types/node": "^20.11.30",
|
|
55
|
+
"@vitejs/plugin-vue": "^5.0.4",
|
|
56
|
+
"@vue/test-utils": "^2.4.1",
|
|
57
|
+
"autoprefixer": "^10.4.0",
|
|
58
|
+
"jsdom": "^24.0.0",
|
|
59
|
+
"postcss": "^8.4.5",
|
|
60
|
+
"storybook": "^8.0.5",
|
|
61
|
+
"tailwindcss": "^3.4.3",
|
|
62
|
+
"ts-node": "^10.9.1",
|
|
63
|
+
"typescript": "^5.1.3",
|
|
64
|
+
"vite": "^5.2.6",
|
|
65
|
+
"vite-tsconfig-paths": "^4.2.0",
|
|
66
|
+
"vitest": "^1.4.0",
|
|
67
|
+
"vue": "^3.4.21",
|
|
68
|
+
"vue-tsc": "^1.8.0"
|
|
69
|
+
}
|
|
70
|
+
}
|
package/services/date.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
format,
|
|
3
|
+
isToday,
|
|
4
|
+
setDate,
|
|
5
|
+
setYear,
|
|
6
|
+
addMonths,
|
|
7
|
+
subMonths,
|
|
8
|
+
addMinutes,
|
|
9
|
+
getUnixTime,
|
|
10
|
+
formatDistance,
|
|
11
|
+
getDaysInMonth,
|
|
12
|
+
formatDistanceToNow,
|
|
13
|
+
} from "date-fns";
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
format,
|
|
17
|
+
isToday,
|
|
18
|
+
setDate,
|
|
19
|
+
setYear,
|
|
20
|
+
addMonths,
|
|
21
|
+
subMonths,
|
|
22
|
+
addMinutes,
|
|
23
|
+
getUnixTime,
|
|
24
|
+
formatDistance,
|
|
25
|
+
getDaysInMonth,
|
|
26
|
+
formatDistanceToNow,
|
|
27
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { FormStates } from "@/enums/form";
|
|
2
|
+
|
|
3
|
+
import Form from "@/components/Form/Form.vue";
|
|
4
|
+
|
|
5
|
+
export default class CrudService {
|
|
6
|
+
id: string = "";
|
|
7
|
+
visible = false;
|
|
8
|
+
state = FormStates.ADD;
|
|
9
|
+
title = "";
|
|
10
|
+
titles = {
|
|
11
|
+
ADD: `Add `,
|
|
12
|
+
EDIT: `Edit `,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
isLoading: boolean = false;
|
|
16
|
+
formReference: InstanceType<typeof Form> | null = null;
|
|
17
|
+
|
|
18
|
+
constructor(entity: string, formReference: any) {
|
|
19
|
+
this.titles.ADD = this.titles.ADD + entity;
|
|
20
|
+
this.titles.EDIT = this.titles.EDIT + entity;
|
|
21
|
+
|
|
22
|
+
this.formReference = formReference;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get isEditing(): boolean {
|
|
26
|
+
return this.state === FormStates.EDIT;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get isCreating(): boolean {
|
|
30
|
+
return this.state === FormStates.ADD;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
show(state: FormStates = FormStates.ADD) {
|
|
34
|
+
switch (state) {
|
|
35
|
+
case FormStates.ADD:
|
|
36
|
+
this.id = "";
|
|
37
|
+
this.title = this.titles.ADD;
|
|
38
|
+
this.state = FormStates.ADD;
|
|
39
|
+
break;
|
|
40
|
+
case FormStates.EDIT:
|
|
41
|
+
this.title = this.titles.EDIT;
|
|
42
|
+
this.state = FormStates.EDIT;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
this.visible = true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
setLoading(value: boolean = true) {
|
|
50
|
+
this.isLoading = value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
edit(id: string) {
|
|
54
|
+
this.id = id;
|
|
55
|
+
|
|
56
|
+
this.show(FormStates.EDIT);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
close() {
|
|
60
|
+
this.reset();
|
|
61
|
+
this.visible = false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
reset() {
|
|
65
|
+
this.id = "";
|
|
66
|
+
|
|
67
|
+
if (this.formReference && this.formReference.reset) {
|
|
68
|
+
this.formReference?.reset();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (this.isLoading) {
|
|
72
|
+
this.isLoading = false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
save() {
|
|
77
|
+
if (!this.formReference) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
this.isLoading = true;
|
|
82
|
+
this.formReference.submit();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
onSave(close: boolean = true) {
|
|
86
|
+
if (close) {
|
|
87
|
+
this.close();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this.reset();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
delete() {
|
|
94
|
+
if (!this.formReference) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
this.isLoading = true;
|
|
99
|
+
this.formReference.deleteItem();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
onDelete(close: boolean = true) {
|
|
103
|
+
if (close) {
|
|
104
|
+
this.close();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
this.reset();
|
|
108
|
+
}
|
|
109
|
+
}
|