anteriority-ui 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/.github/workflows/ci.yml +31 -0
- package/.github/workflows/publish.yml +45 -0
- package/.npmrc.bak +1 -0
- package/.storybook/main.js +15 -0
- package/.storybook/preview.jsx +26 -0
- package/AnteriorityUI.md +2400 -0
- package/CLAUDE.md +91 -0
- package/README.md +182 -0
- package/assets/anteriorityUI/AnteriorityUI.logo.jpeg +0 -0
- package/assets/favicon/anteriorityUI.ico +0 -0
- package/common/api/client.js +43 -0
- package/common/storage/LocalStorage.js +13 -0
- package/common/styles/typography.css +5 -0
- package/common/styles/variables.css +192 -0
- package/common/theme/muiTheme.js +9 -0
- package/features/password-reset/api.js +39 -0
- package/features/user-profile/api.js +5 -0
- package/hooks/useAdminPasswordReset.js +133 -0
- package/index.js +57 -0
- package/package.json +57 -0
- package/pnpm-workspace.yaml +3 -0
- package/screens/components/AlertModal/AlertModal.jsx +259 -0
- package/screens/components/AlertModal/AlertModal.module.css +185 -0
- package/screens/components/AlertModal/AlertModal.stories.jsx +87 -0
- package/screens/components/Avatar/index.jsx +0 -0
- package/screens/components/Avatar/index.module.css +0 -0
- package/screens/components/Avatar/utils.js +0 -0
- package/screens/components/Badge/index.jsx +33 -0
- package/screens/components/Badge/index.module.css +18 -0
- package/screens/components/Badge/index.stories.jsx +40 -0
- package/screens/components/Barnner/index.jsx +21 -0
- package/screens/components/Barnner/index.module.css +33 -0
- package/screens/components/Barnner/index.stories.jsx +39 -0
- package/screens/components/Barnner/utils.js +0 -0
- package/screens/components/BlueLink/index.jsx +27 -0
- package/screens/components/BlueLink/index.module.css +11 -0
- package/screens/components/BlueLink/index.stories.jsx +29 -0
- package/screens/components/Breadcrumbs/index.jsx +62 -0
- package/screens/components/Breadcrumbs/index.module.css +158 -0
- package/screens/components/Breadcrumbs/index.stories.jsx +37 -0
- package/screens/components/Button/index.jsx +169 -0
- package/screens/components/Button/index.module.css +168 -0
- package/screens/components/Button/index.stories.jsx +71 -0
- package/screens/components/Button/utils.js +28 -0
- package/screens/components/CalendarComponent/CustomDatePicker.jsx +248 -0
- package/screens/components/CalendarComponent/CustomDatePicker.module.css +323 -0
- package/screens/components/CalendarComponent/CustomDatePicker.stories.jsx +45 -0
- package/screens/components/CalendarPicker/Constants.js +12 -0
- package/screens/components/CalendarPicker/index.jsx +263 -0
- package/screens/components/CalendarPicker/index.module.css +147 -0
- package/screens/components/CalendarPicker/index.stories.jsx +45 -0
- package/screens/components/CalendarPicker/utils.js +42 -0
- package/screens/components/CardV1/index.jsx +165 -0
- package/screens/components/CardV1/index.module.css +232 -0
- package/screens/components/CardV1/index.stories.jsx +62 -0
- package/screens/components/CardV1/utils.js +49 -0
- package/screens/components/ChatWindow/index.jsx +251 -0
- package/screens/components/ChatWindow/index.module.css +311 -0
- package/screens/components/ChatWindow/index.stories.jsx +62 -0
- package/screens/components/Checks/index.jsx +31 -0
- package/screens/components/Checks/index.module.css +32 -0
- package/screens/components/Checks/index.stories.jsx +32 -0
- package/screens/components/Container/index.jsx +36 -0
- package/screens/components/Container/index.module.css +24 -0
- package/screens/components/Container/index.stories.jsx +32 -0
- package/screens/components/CopyText/index.jsx +42 -0
- package/screens/components/CopyText/index.module.css +52 -0
- package/screens/components/CopyText/index.stories.jsx +24 -0
- package/screens/components/CountdownBar/constants.js +3 -0
- package/screens/components/CountdownBar/index.jsx +81 -0
- package/screens/components/CountdownBar/index.module.css +45 -0
- package/screens/components/CountdownBar/index.stories.jsx +43 -0
- package/screens/components/CountdownBar/utils.js +119 -0
- package/screens/components/DateTag/index.jsx +33 -0
- package/screens/components/DateTag/index.module.css +12 -0
- package/screens/components/DateTag/index.stories.jsx +29 -0
- package/screens/components/DesplegablePanel/constants.js +0 -0
- package/screens/components/DesplegablePanel/index.jsx +61 -0
- package/screens/components/DesplegablePanel/index.module.css +120 -0
- package/screens/components/DesplegablePanel/index.stories.jsx +44 -0
- package/screens/components/DesplegablePanel/utils.js +0 -0
- package/screens/components/DrawPanel/index.jsx +217 -0
- package/screens/components/DrawPanel/index.module.css +252 -0
- package/screens/components/DrawPanel/index.stories.jsx +66 -0
- package/screens/components/DrawPanel/utils.js +0 -0
- package/screens/components/Filter/index.jsx +105 -0
- package/screens/components/Filter/index.module.css +91 -0
- package/screens/components/Filter/index.stories.jsx +46 -0
- package/screens/components/Filter/utils.js +0 -0
- package/screens/components/FormControls/FormControls.module.css +86 -0
- package/screens/components/FormControls/index.jsx +51 -0
- package/screens/components/FormControls/index.stories.jsx +36 -0
- package/screens/components/Frame/index.jsx +54 -0
- package/screens/components/Frame/index.module.css +102 -0
- package/screens/components/Frame/index.stories.jsx +37 -0
- package/screens/components/Frame/utils.js +0 -0
- package/screens/components/GreenHighlight/index.jsx +11 -0
- package/screens/components/GreenHighlight/index.module.css +7 -0
- package/screens/components/GreenHighlight/index.stories.jsx +26 -0
- package/screens/components/GreenHighlight/utils.jsx +45 -0
- package/screens/components/HoursPicker/Constants.js +26 -0
- package/screens/components/HoursPicker/index.jsx +350 -0
- package/screens/components/HoursPicker/index.module.css +99 -0
- package/screens/components/HoursPicker/index.stories.jsx +44 -0
- package/screens/components/HoursPicker/utils.js +48 -0
- package/screens/components/InfoTooltip/index.jsx +59 -0
- package/screens/components/InfoTooltip/index.module.css +98 -0
- package/screens/components/InfoTooltip/index.stories.jsx +35 -0
- package/screens/components/Input/index.jsx +36 -0
- package/screens/components/Input/index.module.css +49 -0
- package/screens/components/Input/index.stories.jsx +37 -0
- package/screens/components/Input/utils.js +0 -0
- package/screens/components/Loading/index.jsx +76 -0
- package/screens/components/Loading/index.module.css +193 -0
- package/screens/components/Loading/index.stories.jsx +38 -0
- package/screens/components/Loading/utils.js +0 -0
- package/screens/components/MarkdownContent/index.jsx +16 -0
- package/screens/components/MarkdownContent/index.module.css +149 -0
- package/screens/components/MarkdownContent/index.stories.jsx +30 -0
- package/screens/components/MarkdownEditor/index.jsx +430 -0
- package/screens/components/MarkdownEditor/index.module.css +192 -0
- package/screens/components/MarkdownEditor/index.stories.jsx +50 -0
- package/screens/components/Material-UI/Components/InputWithIcon/index.jsx +87 -0
- package/screens/components/Material-UI/Components/InputWithIcon/index.stories.jsx +49 -0
- package/screens/components/Material-UI/Components/MenuPopover/index.jsx +117 -0
- package/screens/components/Material-UI/Components/MenuPopover/index.stories.jsx +36 -0
- package/screens/components/Material-UI/Components/MultilinePlaceholder/index.jsx +44 -0
- package/screens/components/Material-UI/Components/MultilinePlaceholder/index.stories.jsx +45 -0
- package/screens/components/Material-UI/Components/Paginador/index.jsx +79 -0
- package/screens/components/Material-UI/Components/Paginador/index.stories.jsx +49 -0
- package/screens/components/Material-UI/Components/Search/index.jsx +81 -0
- package/screens/components/Material-UI/Components/Search/index.stories.jsx +68 -0
- package/screens/components/Material-UI/Components/Selector/index.jsx +100 -0
- package/screens/components/Material-UI/Components/Selector/index.module.css +0 -0
- package/screens/components/Material-UI/Components/Selector/index.stories.jsx +52 -0
- package/screens/components/Material-UI/Components/Selector/utils.js +0 -0
- package/screens/components/Material-UI/Components/TextField/index.jsx +61 -0
- package/screens/components/Material-UI/Components/TextField/index.stories.jsx +53 -0
- package/screens/components/ModalTooltip/ModalTooltip.jsx +122 -0
- package/screens/components/ModalTooltip/ModalTooltip.module.css +65 -0
- package/screens/components/ModalTooltip/ModalTooltip.stories.jsx +39 -0
- package/screens/components/Notification/Error/ErrorMessage.jsx +30 -0
- package/screens/components/Notification/Error/ErrorMessage.module.css +57 -0
- package/screens/components/Notification/Error/ErrorMessage.stories.jsx +37 -0
- package/screens/components/PasswordResetPanel/index.jsx +325 -0
- package/screens/components/PasswordResetPanel/index.stories.jsx +26 -0
- package/screens/components/PlaceholderButton/index.jsx +169 -0
- package/screens/components/PlaceholderButton/index.module.css +162 -0
- package/screens/components/PlaceholderButton/index.stories.jsx +69 -0
- package/screens/components/PlaceholderButton/utils.js +42 -0
- package/screens/components/Profile/Avatar/index.jsx +125 -0
- package/screens/components/Profile/Avatar/index.module.css +86 -0
- package/screens/components/Profile/Avatar/index.stories.jsx +48 -0
- package/screens/components/Profile/Avatar/utils.js +18 -0
- package/screens/components/Profile/index.jsx +58 -0
- package/screens/components/Profile/index.module.css +0 -0
- package/screens/components/Profile/index.stories.jsx +38 -0
- package/screens/components/Profile/utils.js +0 -0
- package/screens/components/ScrollBar/index.jsx +62 -0
- package/screens/components/ScrollBar/index.module.css +78 -0
- package/screens/components/ScrollBar/index.stories.jsx +64 -0
- package/screens/components/ScrollBar/utils.js +127 -0
- package/screens/components/Sidebar/constants.js +16 -0
- package/screens/components/Sidebar/index.jsx +399 -0
- package/screens/components/Sidebar/index.module.css +405 -0
- package/screens/components/Sidebar/index.stories.jsx +86 -0
- package/screens/components/Sidebar/utils.js +75 -0
- package/screens/components/Skeleton/index.jsx +11 -0
- package/screens/components/Skeleton/index.module.css +26 -0
- package/screens/components/Skeleton/index.stories.jsx +42 -0
- package/screens/components/SubSidebarLayout/index.jsx +44 -0
- package/screens/components/SubSidebarLayout/index.module.css +80 -0
- package/screens/components/SubSidebarLayout/index.stories.jsx +51 -0
- package/screens/components/SummaryCard/index.jsx +50 -0
- package/screens/components/SummaryCard/index.module.css +30 -0
- package/screens/components/SummaryCard/index.stories.jsx +29 -0
- package/screens/components/Swich/constants.js +4 -0
- package/screens/components/Swich/index.jsx +85 -0
- package/screens/components/Swich/index.module.css +68 -0
- package/screens/components/Swich/index.stories.jsx +44 -0
- package/screens/components/Swich/utils.js +0 -0
- package/screens/components/TableA/index.jsx +156 -0
- package/screens/components/TableA/index.module.css +105 -0
- package/screens/components/TableA/index.stories.jsx +116 -0
- package/screens/components/TableA/utils.js +11 -0
- package/screens/components/TableB/index.jsx +222 -0
- package/screens/components/TableB/index.module.css +295 -0
- package/screens/components/TableB/index.stories.jsx +110 -0
- package/screens/components/TableB/utils.js +11 -0
- package/screens/components/ToggleCard/index.jsx +64 -0
- package/screens/components/ToggleCard/index.module.css +111 -0
- package/screens/components/ToggleCard/index.stories.jsx +49 -0
- package/screens/components/UserEditPopover/index.jsx +102 -0
- package/screens/components/UserEditPopover/index.module.css +97 -0
- package/screens/components/UserEditPopover/index.stories.jsx +49 -0
- package/scripts/build.mjs +129 -0
- package/scripts/check-case.mjs +127 -0
- package/scripts/verify-dist.mjs +45 -0
- package/vitest.config.js +36 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
.tableContainer {
|
|
2
|
+
width: 100%;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
border-radius: 12px;
|
|
5
|
+
background-color: var(--tableB-surface, #ffffff);
|
|
6
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
|
|
7
|
+
border: 1px solid var(--tableB-border, #e5e7eb);
|
|
8
|
+
margin-top: 1rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.tableLoadingContainer {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
min-height: 200px;
|
|
16
|
+
background-color: #ffffff;
|
|
17
|
+
border-radius: 8px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.modernTable {
|
|
22
|
+
width: 100%;
|
|
23
|
+
border-collapse: separate;
|
|
24
|
+
border-spacing: 0;
|
|
25
|
+
text-align: left;
|
|
26
|
+
background-color: var(--tableB-surface, #ffffff);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.modernTable th {
|
|
30
|
+
padding: 16px 20px;
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
color: var(--tableB-heading-text, #6b7280);
|
|
34
|
+
text-transform: uppercase;
|
|
35
|
+
letter-spacing: 0.05em;
|
|
36
|
+
background-color: var(--tableB-header, #f9fafb);
|
|
37
|
+
border-bottom: 1px solid var(--tableB-border, #e5e7eb);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.headerFilterWrap {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 0.25rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.headerFilterBtn {
|
|
47
|
+
padding: 0 !important;
|
|
48
|
+
min-width: unset !important;
|
|
49
|
+
width: 20px !important;
|
|
50
|
+
height: 20px !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.modernTable td {
|
|
54
|
+
padding: 16px 20px;
|
|
55
|
+
vertical-align: middle;
|
|
56
|
+
border-bottom: 1px solid var(--tableB-row-border, #f3f4f6);
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
color: var(--tableB-text, #374151);
|
|
59
|
+
transition: background-color 0.2s ease;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tableRow {
|
|
63
|
+
transition: all 0.2s ease;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.tableRow:hover {
|
|
67
|
+
background-color: var(--tableB-hover, #f9fafb);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.rowExpanded {
|
|
71
|
+
background-color: rgba(66, 153, 225, 0.03);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.rowExpanded:hover {
|
|
75
|
+
background-color: rgba(66, 153, 225, 0.05);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.expandHeader {
|
|
79
|
+
width: 50px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.expandCell {
|
|
83
|
+
width: 50px;
|
|
84
|
+
text-align: center;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.expandIconWrapper {
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
width: 32px;
|
|
92
|
+
height: 32px;
|
|
93
|
+
border-radius: 50%;
|
|
94
|
+
color: var(--gray-500, #6b7280);
|
|
95
|
+
transition: all 0.2s ease;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.tableRow:hover .expandIconWrapper {
|
|
99
|
+
background-color: var(--gray-100, #f3f4f6);
|
|
100
|
+
color: var(--gray-700, #374151);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.rowExpanded .expandIconWrapper {
|
|
104
|
+
background-color: var(--primary-color, #4299e1);
|
|
105
|
+
color: white;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.expandedContentRow td {
|
|
109
|
+
padding: 0;
|
|
110
|
+
border-bottom: 1px solid var(--tableB-border, #e5e7eb);
|
|
111
|
+
background-color: var(--tableB-header, #f9fafb);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.expandedWrapper {
|
|
115
|
+
padding: 24px;
|
|
116
|
+
animation: slideDown 0.3s ease-out forwards;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@keyframes slideDown {
|
|
120
|
+
from {
|
|
121
|
+
opacity: 0;
|
|
122
|
+
transform: translateY(-10px);
|
|
123
|
+
}
|
|
124
|
+
to {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
transform: translateY(0);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Loading & States */
|
|
131
|
+
.centerSection {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
padding: 60px 20px;
|
|
137
|
+
background-color: var(--tableB-surface, white);
|
|
138
|
+
border-radius: 12px;
|
|
139
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.02);
|
|
140
|
+
border: 1px solid var(--tableB-border, #e5e7eb);
|
|
141
|
+
margin-top: 1rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.loaderWrapper {
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
align-items: center;
|
|
148
|
+
gap: 16px;
|
|
149
|
+
color: var(--primary-color, #4299e1);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.spinningLoader {
|
|
153
|
+
animation: spin 1s linear infinite;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.loaderText {
|
|
157
|
+
font-weight: 500;
|
|
158
|
+
font-size: 15px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.errorMessage {
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
gap: 12px;
|
|
165
|
+
color: #e53e3e;
|
|
166
|
+
background-color: #fff5f5;
|
|
167
|
+
padding: 16px 24px;
|
|
168
|
+
border-radius: 8px;
|
|
169
|
+
font-weight: 500;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.retryBtn {
|
|
173
|
+
margin-top: 16px;
|
|
174
|
+
padding: 8px 16px;
|
|
175
|
+
background-color: var(--primary-color, #4299e1);
|
|
176
|
+
color: white;
|
|
177
|
+
border: none;
|
|
178
|
+
border-radius: 6px;
|
|
179
|
+
font-weight: 500;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
transition: opacity 0.2s;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.retryBtn:hover {
|
|
185
|
+
opacity: 0.9;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.emptyState {
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-direction: column;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
padding: 3rem 1.5rem;
|
|
194
|
+
text-align: center;
|
|
195
|
+
color: var(--tableB-muted-text, #64748b);
|
|
196
|
+
background-color: var(--tableB-header, #f8fafc);
|
|
197
|
+
border-radius: 12px;
|
|
198
|
+
box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
|
|
199
|
+
border: 1px dashed var(--tableB-border, #cbd5e1);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.emptyIcon {
|
|
203
|
+
color: var(--tableB-muted-text, #94a3b8);
|
|
204
|
+
margin-bottom: 1rem;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@keyframes spin {
|
|
208
|
+
100% {
|
|
209
|
+
transform: rotate(360deg);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Actions */
|
|
214
|
+
.actionButtons {
|
|
215
|
+
display: flex;
|
|
216
|
+
gap: 8px;
|
|
217
|
+
align-items: center;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.actionBtn {
|
|
221
|
+
border: none;
|
|
222
|
+
border-radius: 8px;
|
|
223
|
+
padding: 6px 12px;
|
|
224
|
+
cursor: pointer;
|
|
225
|
+
font-weight: 600;
|
|
226
|
+
font-size: 12px;
|
|
227
|
+
display: inline-flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
gap: 6px;
|
|
230
|
+
transition: all 0.2s ease;
|
|
231
|
+
white-space: nowrap;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.actionBtn:disabled {
|
|
235
|
+
opacity: 0.55;
|
|
236
|
+
cursor: not-allowed;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.actionBtnPrimary {
|
|
240
|
+
background: var(--button-blue, #3b82f6);
|
|
241
|
+
color: white;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.actionBtnPrimary:hover:not(:disabled) {
|
|
245
|
+
filter: brightness(1.1);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.actionBtnDanger {
|
|
249
|
+
background: linear-gradient(135deg, #ef4444, #dc2626);
|
|
250
|
+
color: white;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.actionBtnDanger:hover:not(:disabled) {
|
|
254
|
+
filter: brightness(1.1);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.actionIcon {
|
|
258
|
+
width: 16px;
|
|
259
|
+
height: 16px;
|
|
260
|
+
object-fit: contain;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.actionIconInvert {
|
|
264
|
+
filter: invert(1) brightness(1.2);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* Badges */
|
|
268
|
+
.badge {
|
|
269
|
+
display: inline-flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
justify-content: center;
|
|
272
|
+
padding: 4px 10px;
|
|
273
|
+
border-radius: 7px;
|
|
274
|
+
font-size: 12px;
|
|
275
|
+
font-weight: 700;
|
|
276
|
+
letter-spacing: 0.02em;
|
|
277
|
+
text-transform: capitalize;
|
|
278
|
+
background: #e2e8f0;
|
|
279
|
+
color: #334155;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.badgeSuccess {
|
|
283
|
+
background: var(--tableB-badge-success-bg, #dcfce7) !important;
|
|
284
|
+
color: var(--tableB-badge-success-color, #166534) !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.badgeWarning {
|
|
288
|
+
background: var(--tableB-badge-warning-bg, #fef3c7) !important;
|
|
289
|
+
color: var(--tableB-badge-warning-color, #92400e) !important;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.badgeDanger {
|
|
293
|
+
background: var(--tableB-badge-danger-bg, #fee2e2) !important;
|
|
294
|
+
color: var(--tableB-badge-danger-color, #991b1b) !important;
|
|
295
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import TableB from './index';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/TableB',
|
|
6
|
+
component: TableB,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const columns = [
|
|
10
|
+
{ key: 'name', label: 'Nombre' },
|
|
11
|
+
{ key: 'species', label: 'Especie' },
|
|
12
|
+
{ key: 'status', label: 'Estado', type: 'badge', badgeType: (row) => (row.status === 'Activo' ? 'success' : 'warning') },
|
|
13
|
+
{
|
|
14
|
+
key: 'actions',
|
|
15
|
+
label: 'Acciones',
|
|
16
|
+
type: 'actions',
|
|
17
|
+
align: 'right',
|
|
18
|
+
actions: [
|
|
19
|
+
{ label: 'Editar', onClick: (row) => console.log('edit', row) },
|
|
20
|
+
{ label: 'Eliminar', onClick: (row) => console.log('delete', row) },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const data = [
|
|
26
|
+
{ id: 1, name: 'Firulais', species: 'Perro', status: 'Activo' },
|
|
27
|
+
{ id: 2, name: 'Michi', species: 'Gato', status: 'Inactivo' },
|
|
28
|
+
{ id: 3, name: 'Piolin', species: 'Ave', status: 'Activo' },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export const Default = {
|
|
32
|
+
args: {
|
|
33
|
+
columns,
|
|
34
|
+
data,
|
|
35
|
+
rowKey: 'id',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Expandable = {
|
|
40
|
+
args: {
|
|
41
|
+
columns,
|
|
42
|
+
data,
|
|
43
|
+
rowKey: 'id',
|
|
44
|
+
expandable: {
|
|
45
|
+
rowExpandable: () => true,
|
|
46
|
+
expandedRowRender: (row) => (
|
|
47
|
+
<div style={{ padding: '8px 0' }}>
|
|
48
|
+
<p style={{ margin: 0 }}>Detalles adicionales para {row.name}</p>
|
|
49
|
+
</div>
|
|
50
|
+
),
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Loading = {
|
|
56
|
+
args: {
|
|
57
|
+
columns,
|
|
58
|
+
data: [],
|
|
59
|
+
skeletonRows: 4,
|
|
60
|
+
loading: true,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const ErrorState = {
|
|
65
|
+
args: {
|
|
66
|
+
columns,
|
|
67
|
+
data: [],
|
|
68
|
+
error: 'Error al cargar la información',
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Empty = {
|
|
73
|
+
args: {
|
|
74
|
+
columns,
|
|
75
|
+
data: [],
|
|
76
|
+
emptyMessage: 'No hay mascotas registradas',
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const STATUS_FILTER_OPTIONS = [
|
|
81
|
+
{ value: '', label: 'Todos' },
|
|
82
|
+
{ value: 'Activo', label: 'Activo' },
|
|
83
|
+
{ value: 'Inactivo', label: 'Inactivo' },
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
export const WithColumnFilter = {
|
|
87
|
+
render: () => {
|
|
88
|
+
const [statusFilter, setStatusFilter] = useState('');
|
|
89
|
+
|
|
90
|
+
const filterableColumns = [
|
|
91
|
+
{ key: 'name', label: 'Nombre' },
|
|
92
|
+
{ key: 'species', label: 'Especie' },
|
|
93
|
+
{
|
|
94
|
+
key: 'status',
|
|
95
|
+
label: 'Estado',
|
|
96
|
+
type: 'badge',
|
|
97
|
+
badgeType: (row) => (row.status === 'Activo' ? 'success' : 'warning'),
|
|
98
|
+
filter: {
|
|
99
|
+
options: STATUS_FILTER_OPTIONS,
|
|
100
|
+
value: statusFilter,
|
|
101
|
+
onChange: setStatusFilter,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
const filteredData = statusFilter ? data.filter((row) => row.status === statusFilter) : data;
|
|
107
|
+
|
|
108
|
+
return <TableB columns={filterableColumns} data={filteredData} rowKey="id" />;
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function getNextFilterValue(options, currentValue) {
|
|
2
|
+
if (!Array.isArray(options) || options.length === 0) return currentValue;
|
|
3
|
+
const currentIndex = options.findIndex((option) => option.value === currentValue);
|
|
4
|
+
const nextIndex = (currentIndex + 1) % options.length;
|
|
5
|
+
return options[nextIndex].value;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function getFilterOptionLabel(options, value) {
|
|
9
|
+
if (!Array.isArray(options)) return undefined;
|
|
10
|
+
return options.find((option) => option.value === value)?.label;
|
|
11
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from './index.module.css';
|
|
3
|
+
import { formatHighlightedText } from '../GreenHighlight/utils';
|
|
4
|
+
|
|
5
|
+
const ToggleCard = ({
|
|
6
|
+
title,
|
|
7
|
+
description,
|
|
8
|
+
icon: Icon,
|
|
9
|
+
action,
|
|
10
|
+
children,
|
|
11
|
+
onClose,
|
|
12
|
+
closeText = "Cerrar",
|
|
13
|
+
variant = "default", // "floating" or "default"
|
|
14
|
+
onClick,
|
|
15
|
+
backgroundColor,
|
|
16
|
+
borderColor,
|
|
17
|
+
titleColor,
|
|
18
|
+
descriptionColor,
|
|
19
|
+
iconColor,
|
|
20
|
+
}) => {
|
|
21
|
+
const containerClass = `${styles.toggleContainer} ${variant === 'floating' ? styles.floatingVariant : ''}`;
|
|
22
|
+
|
|
23
|
+
const formattedTitle = typeof title === 'string' ? formatHighlightedText(title) : title;
|
|
24
|
+
const formattedDescription = typeof description === 'string' ? formatHighlightedText(description) : description;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
className={containerClass}
|
|
29
|
+
onClick={onClick}
|
|
30
|
+
style={{
|
|
31
|
+
...(backgroundColor && { backgroundColor }),
|
|
32
|
+
...(borderColor && { borderColor }),
|
|
33
|
+
...(onClick && { cursor: 'pointer' }),
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<div className={styles.content}>
|
|
37
|
+
<div className={styles.textBlock}>
|
|
38
|
+
<div className={styles.headerLine}>
|
|
39
|
+
{Icon && <Icon size={18} className={styles.icon} style={iconColor ? { color: iconColor } : undefined} />}
|
|
40
|
+
<span className={styles.label} style={titleColor ? { color: titleColor } : undefined}>
|
|
41
|
+
{formattedTitle}
|
|
42
|
+
</span>
|
|
43
|
+
</div>
|
|
44
|
+
{description && (
|
|
45
|
+
<p className={styles.description} style={descriptionColor ? { color: descriptionColor } : undefined}>
|
|
46
|
+
{formattedDescription}
|
|
47
|
+
</p>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
<div className={styles.actionSection}>
|
|
51
|
+
{action}
|
|
52
|
+
{onClose && (
|
|
53
|
+
<button onClick={onClose} className={styles.closeBtn}>
|
|
54
|
+
{closeText}
|
|
55
|
+
</button>
|
|
56
|
+
)}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
{children && <div className={styles.childrenWrapper}>{children}</div>}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default ToggleCard;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.toggleContainer {
|
|
2
|
+
background: #ffffff;
|
|
3
|
+
border: 1px solid #cbcbcb;
|
|
4
|
+
border-radius: 12px;
|
|
5
|
+
padding: 1.25rem;
|
|
6
|
+
margin-bottom: 1rem;
|
|
7
|
+
/* border-color: #0fd423;
|
|
8
|
+
border-width: 3px; */
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.floatingVariant {
|
|
12
|
+
position: fixed;
|
|
13
|
+
top: 20px;
|
|
14
|
+
left: 50%;
|
|
15
|
+
transform: translateX(-50%);
|
|
16
|
+
z-index: 9999;
|
|
17
|
+
width: 90%;
|
|
18
|
+
max-width: 500px;
|
|
19
|
+
animation: fadeInDownToast 0.5s ease-out;
|
|
20
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
21
|
+
border: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes fadeInDownToast {
|
|
25
|
+
from { opacity: 0; transform: translate(-50%, -20px); }
|
|
26
|
+
to { opacity: 1; transform: translate(-50%, 0); }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.content {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 1.5rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.textBlock {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
gap: 6px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.headerLine {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 10px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon {
|
|
49
|
+
color: #64748b;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.label {
|
|
53
|
+
font-size: 0.95rem;
|
|
54
|
+
font-weight: 700;
|
|
55
|
+
color: #1e293b;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.description {
|
|
59
|
+
margin: 0;
|
|
60
|
+
font-size: 0.85rem;
|
|
61
|
+
color: #64748b;
|
|
62
|
+
line-height: 1.4;
|
|
63
|
+
max-width: 320px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.actionSection {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
gap: 12px;
|
|
71
|
+
min-width: 50px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.closeBtn {
|
|
75
|
+
background: #f1f5f9;
|
|
76
|
+
color: #475569;
|
|
77
|
+
border: 1px solid #e2e8f0;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
padding: 0.4rem 0.8rem;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
font-size: 0.85rem;
|
|
83
|
+
transition: all 0.2s ease;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.closeBtn:hover {
|
|
87
|
+
background: #e2e8f0;
|
|
88
|
+
color: #1e293b;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.childrenWrapper {
|
|
92
|
+
margin-top: 1rem;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Responsive */
|
|
96
|
+
@media (max-width: 640px) {
|
|
97
|
+
.content {
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
align-items: flex-start;
|
|
100
|
+
gap: 1rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.actionSection {
|
|
104
|
+
min-width: unset;
|
|
105
|
+
align-self: flex-end;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.description {
|
|
109
|
+
max-width: 100%;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Info, Sparkles } from 'lucide-react';
|
|
2
|
+
import ToggleCard from './index';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/ToggleCard',
|
|
6
|
+
component: ToggleCard,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Default = {
|
|
10
|
+
args: {
|
|
11
|
+
title: 'Nueva funcionalidad disponible',
|
|
12
|
+
description: 'Ahora puedes **destacar** información importante directamente en el texto.',
|
|
13
|
+
icon: Info,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const Floating = {
|
|
18
|
+
args: {
|
|
19
|
+
title: 'Sugerencia inteligente',
|
|
20
|
+
description: 'Este mensaje aparece flotando sobre el contenido principal.',
|
|
21
|
+
icon: Sparkles,
|
|
22
|
+
variant: 'floating',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Closable = {
|
|
27
|
+
args: {
|
|
28
|
+
title: 'Aviso importante',
|
|
29
|
+
description: 'Puedes cerrar este mensaje cuando quieras.',
|
|
30
|
+
icon: Info,
|
|
31
|
+
onClose: () => console.log('closed'),
|
|
32
|
+
closeText: 'Cerrar',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const WithActionAndCustomColors = {
|
|
37
|
+
args: {
|
|
38
|
+
title: 'Acción requerida',
|
|
39
|
+
description: 'Revisa los cambios pendientes antes de continuar.',
|
|
40
|
+
icon: Info,
|
|
41
|
+
action: <button type="button" onClick={() => console.log('action clicked')}>Revisar</button>,
|
|
42
|
+
backgroundColor: '#fef3c7',
|
|
43
|
+
borderColor: '#f59e0b',
|
|
44
|
+
titleColor: '#92400e',
|
|
45
|
+
descriptionColor: '#78350f',
|
|
46
|
+
iconColor: '#b45309',
|
|
47
|
+
onClick: () => console.log('card clicked'),
|
|
48
|
+
},
|
|
49
|
+
};
|