@addsign/moje-agenda-shared-lib 2.0.40 → 2.0.42
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/dist/Combination-D2GKeTwa.js +1162 -0
- package/dist/Combination-D2GKeTwa.js.map +1 -0
- package/dist/Dialog-BWa_flly.js +424 -0
- package/dist/Dialog-BWa_flly.js.map +1 -0
- package/dist/Dialog-CCrUyF91.js +424 -0
- package/dist/Dialog-CCrUyF91.js.map +1 -0
- package/dist/assets/style.css +61 -8
- package/dist/chevron-down-CfJmko7t.js +14 -0
- package/dist/chevron-down-CfJmko7t.js.map +1 -0
- package/dist/components/Attachments.js +2 -1
- package/dist/components/Attachments.js.map +1 -1
- package/dist/components/ConfirmationModalDialog.js +1 -1
- package/dist/components/ConfirmationModalDialog.js.map +1 -1
- package/dist/components/Modal.js +1 -1
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/datatable/DataTable.js +3 -2
- package/dist/components/datatable/DataTable.js.map +1 -1
- package/dist/components/datatable/DataTableServer.js +96 -61
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +5 -4
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBarServer.js +2 -1
- package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
- package/dist/components/form/DateRangeField.js +2 -2
- package/dist/components/form/DateRangeField.js.map +1 -1
- package/dist/components/form/FileInput.js +3 -2
- package/dist/components/form/FileInput.js.map +1 -1
- package/dist/components/form/FileInputMultiple.js +3 -2
- package/dist/components/form/FileInputMultiple.js.map +1 -1
- package/dist/components/form/FormField.js +8 -7
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/InputField.js +3 -2
- package/dist/components/form/InputField.js.map +1 -1
- package/dist/components/form/PositionsSelectorSingle.js +2 -1
- package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
- package/dist/components/form/RadioGroup.js +1 -1
- package/dist/components/form/RadioGroup.js.map +1 -1
- package/dist/components/form/SelectField.js +5 -4
- package/dist/components/form/SelectField.js.map +1 -1
- package/dist/components/layout/Neoptimizovano.js +2 -1
- package/dist/components/layout/Neoptimizovano.js.map +1 -1
- package/dist/components/layout/PageTitle.js +1 -1
- package/dist/components/layout/PageTitle.js.map +1 -1
- package/dist/components/layout/SectionTitle.js +1 -1
- package/dist/components/layout/SectionTitle.js.map +1 -1
- package/dist/components/profiles/ProfileOverview.js +2 -1
- package/dist/components/profiles/ProfileOverview.js.map +1 -1
- package/dist/components/ui/Combobox.js +1 -1
- package/dist/components/ui/DatePicker.js +1 -1
- package/dist/components/ui/DateTimePicker.js +1 -1
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/ScrollArea.js +2 -2
- package/dist/components/ui/async-combobox.d.ts +40 -0
- package/dist/components/ui/async-combobox.js +5706 -0
- package/dist/components/ui/async-combobox.js.map +1 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +27 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/checkbox.js +4 -4
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/multi-select.d.ts +67 -0
- package/dist/components/ui/multi-select.js +295 -0
- package/dist/components/ui/multi-select.js.map +1 -0
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/radioGroup.js +5 -5
- package/dist/components/ui/select.js +8 -16
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/toast.js +5 -5
- package/dist/components/ui/tooltip.js +6 -6
- package/dist/index-B0wyIFEr.js +47 -0
- package/dist/index-B0wyIFEr.js.map +1 -0
- package/dist/index-BcR8DnnV.js +234 -0
- package/dist/index-BcR8DnnV.js.map +1 -0
- package/dist/index-CDptxuif.js +234 -0
- package/dist/index-CDptxuif.js.map +1 -0
- package/dist/index-CK9QfV6i.js +40 -0
- package/dist/index-CK9QfV6i.js.map +1 -0
- package/dist/index-CcNKXchf.js +2203 -0
- package/dist/index-CcNKXchf.js.map +1 -0
- package/dist/index-CpcwEIT_.js +18 -0
- package/dist/index-CpcwEIT_.js.map +1 -0
- package/dist/index-CulRZKWg.js +2212 -0
- package/dist/index-CulRZKWg.js.map +1 -0
- package/dist/index-D75exu1X.js +18 -0
- package/dist/index-D75exu1X.js.map +1 -0
- package/dist/index-DoYsULhE.js +28878 -0
- package/dist/index-DoYsULhE.js.map +1 -0
- package/dist/index-Dr6Ds0Bg.js +1162 -0
- package/dist/index-Dr6Ds0Bg.js.map +1 -0
- package/dist/index-DsU1clfi.js +36 -0
- package/dist/index-DsU1clfi.js.map +1 -0
- package/dist/index-DzfDO78K.js +15 -0
- package/dist/index-DzfDO78K.js.map +1 -0
- package/dist/index-NZPkObcw.js +110 -0
- package/dist/index-NZPkObcw.js.map +1 -0
- package/dist/index-Vp9wI6hE.js +2203 -0
- package/dist/index-Vp9wI6hE.js.map +1 -0
- package/dist/index-qqHvAsVd.js +2266 -0
- package/dist/index-qqHvAsVd.js.map +1 -0
- package/dist/index-wO-IHm1z.js +131 -0
- package/dist/index-wO-IHm1z.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +3 -1
- package/dist/main.js.map +1 -1
- package/dist/plus-sawBIbEd.js +26 -0
- package/dist/plus-sawBIbEd.js.map +1 -0
- package/dist/popover-CcrzvSk7.js +319 -0
- package/dist/popover-CcrzvSk7.js.map +1 -0
- package/dist/popover-DhdNw4fZ.js +319 -0
- package/dist/popover-DhdNw4fZ.js.map +1 -0
- package/lib/components/ConfirmationModalDialog.tsx +1 -1
- package/lib/components/Modal.tsx +1 -1
- package/lib/components/datatable/DataTable.tsx +1 -1
- package/lib/components/datatable/DataTableServer.tsx +113 -58
- package/lib/components/form/AutocompleteSearchBar.tsx +3 -3
- package/lib/components/form/DateRangeField.tsx +2 -2
- package/lib/components/form/FormField.tsx +6 -6
- package/lib/components/form/InputField.tsx +3 -2
- package/lib/components/form/RadioGroup.tsx +1 -1
- package/lib/components/form/SelectField.tsx +3 -3
- package/lib/components/layout/PageTitle.tsx +19 -19
- package/lib/components/layout/SectionTitle.tsx +1 -1
- package/lib/components/ui/badge.tsx +36 -0
- package/lib/components/ui/multi-select.tsx +365 -0
- package/lib/main.ts +4 -0
- package/package.json +1 -1
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
DateRangeField,
|
|
14
14
|
FormField,
|
|
15
15
|
IOptionItem,
|
|
16
|
-
IPageable,
|
|
17
16
|
Spinner,
|
|
18
17
|
handleErrors,
|
|
19
18
|
useFederationContext,
|
|
@@ -32,6 +31,7 @@ import SelectField from "../form/SelectField";
|
|
|
32
31
|
import InputField from "../form/InputField";
|
|
33
32
|
import { Resizable } from "./Resizable";
|
|
34
33
|
import { DatatableSettings } from "./DatatableSettings";
|
|
34
|
+
import { MultiSelect } from "../ui/multi-select";
|
|
35
35
|
|
|
36
36
|
import * as XLSX from "xlsx";
|
|
37
37
|
|
|
@@ -85,6 +85,20 @@ export const resetAllDataTablePaging = () => {
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
|
+
|
|
89
|
+
interface IPageable<T> {
|
|
90
|
+
content: T[];
|
|
91
|
+
empty: boolean;
|
|
92
|
+
first: boolean;
|
|
93
|
+
last: boolean;
|
|
94
|
+
number: number;
|
|
95
|
+
numberOfElements: number;
|
|
96
|
+
size: number;
|
|
97
|
+
totalElements: number;
|
|
98
|
+
totalPages: number;
|
|
99
|
+
isPageable?: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
88
102
|
function DataTableServer<T extends DataTableInternalItems>({
|
|
89
103
|
id,
|
|
90
104
|
url,
|
|
@@ -123,16 +137,18 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
123
137
|
response: any,
|
|
124
138
|
itemsPerPage: number
|
|
125
139
|
): IPageable<T> => {
|
|
140
|
+
const isPageable = !!response.data?.content;
|
|
126
141
|
return {
|
|
127
142
|
content: response.data.content || response.data,
|
|
128
|
-
empty:
|
|
129
|
-
first:
|
|
130
|
-
last:
|
|
131
|
-
number:
|
|
143
|
+
empty: isPageable ? response.data.empty : true,
|
|
144
|
+
first: isPageable ? response.data.first : true,
|
|
145
|
+
last: isPageable ? response.data.last : true,
|
|
146
|
+
number: isPageable ? response.data.number : 0,
|
|
132
147
|
numberOfElements: response.data.numberOfElements || response.data.length,
|
|
133
148
|
size: response.data?.size || itemsPerPage,
|
|
134
149
|
totalElements: response.data?.totalElements || response.data.length,
|
|
135
150
|
totalPages: response.data?.totalPages || 1,
|
|
151
|
+
isPageable: isPageable,
|
|
136
152
|
};
|
|
137
153
|
};
|
|
138
154
|
|
|
@@ -171,12 +187,24 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
171
187
|
if (currentPage === undefined) return;
|
|
172
188
|
setIsLoading(true);
|
|
173
189
|
|
|
174
|
-
//odebrani prazdny filteru
|
|
190
|
+
//odebrani prazdny filteru a transformace multi-select hodnot
|
|
175
191
|
const filteredMergedFilters = Object.entries(mergedFilters).reduce(
|
|
176
192
|
(acc: Record<string, any>, [key, value]) => {
|
|
177
|
-
|
|
178
|
-
|
|
193
|
+
// Skip null and empty string values
|
|
194
|
+
if (value === null || value === "") {
|
|
195
|
+
return acc;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Handle multi-select values (arrays)
|
|
199
|
+
if (Array.isArray(value)) {
|
|
200
|
+
if (value.length > 0) {
|
|
201
|
+
acc[key] = value.join(",");
|
|
202
|
+
}
|
|
203
|
+
return acc;
|
|
179
204
|
}
|
|
205
|
+
|
|
206
|
+
// Handle other values
|
|
207
|
+
acc[key] = value;
|
|
180
208
|
return acc;
|
|
181
209
|
},
|
|
182
210
|
{}
|
|
@@ -184,7 +212,7 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
184
212
|
|
|
185
213
|
federationContext.apiClient
|
|
186
214
|
.get(url, {
|
|
187
|
-
signal: currentAbortController.signal,
|
|
215
|
+
signal: currentAbortController.signal,
|
|
188
216
|
params: {
|
|
189
217
|
...filteredMergedFilters,
|
|
190
218
|
pageSize: itemsPerPageLocal,
|
|
@@ -267,7 +295,6 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
267
295
|
useEffect(() => {
|
|
268
296
|
const fetchFilterOptions = async (column: DataTableColumn<T>) => {
|
|
269
297
|
if (column.filterOptions) {
|
|
270
|
-
// if filterOptions is provided, use it directly
|
|
271
298
|
return column.filterOptions;
|
|
272
299
|
} else if (column.filterSource) {
|
|
273
300
|
try {
|
|
@@ -288,12 +315,14 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
288
315
|
return [];
|
|
289
316
|
}
|
|
290
317
|
};
|
|
318
|
+
|
|
291
319
|
const updateFilterOptions = async () => {
|
|
292
320
|
const newFilterOptions: Record<string, any[]> = {};
|
|
293
321
|
|
|
294
322
|
for (const column of columns) {
|
|
295
323
|
if (
|
|
296
|
-
column.filterType === "select"
|
|
324
|
+
(column.filterType === "select" ||
|
|
325
|
+
column.filterType === "multi-select") &&
|
|
297
326
|
(column.filterSource || column.filterOptions) &&
|
|
298
327
|
column.filterValueKey &&
|
|
299
328
|
column.filterLabelKey &&
|
|
@@ -301,11 +330,13 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
301
330
|
) {
|
|
302
331
|
const options = await fetchFilterOptions(column);
|
|
303
332
|
|
|
304
|
-
if (options) {
|
|
333
|
+
if (options && column.filterType === "select") {
|
|
305
334
|
newFilterOptions[column.filterParam as string] = [
|
|
306
335
|
{ value: "", label: "" },
|
|
307
336
|
...options,
|
|
308
337
|
];
|
|
338
|
+
} else if (options && column.filterType === "multi-select") {
|
|
339
|
+
newFilterOptions[column.filterParam as string] = options;
|
|
309
340
|
}
|
|
310
341
|
}
|
|
311
342
|
}
|
|
@@ -413,7 +444,7 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
413
444
|
// Pagination display logic
|
|
414
445
|
const paginationDisplay = `Strana ${(currentPage || 0) + 1} z ${data?.totalPages || 1}`;
|
|
415
446
|
|
|
416
|
-
const filterHandler = (filterParam: keyof T, value: string) => {
|
|
447
|
+
const filterHandler = (filterParam: keyof T, value: string | string[]) => {
|
|
417
448
|
setColumnFilters((prev) => ({ ...prev, [filterParam]: value }));
|
|
418
449
|
setCurrentPage(0);
|
|
419
450
|
};
|
|
@@ -723,7 +754,6 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
723
754
|
>
|
|
724
755
|
{filterType === "select" ? (
|
|
725
756
|
<SelectField
|
|
726
|
-
// label={header}
|
|
727
757
|
key={JSON.stringify(mergedFilters)}
|
|
728
758
|
name={String(key) + "_filter"}
|
|
729
759
|
onInputChange={(e) =>
|
|
@@ -740,16 +770,37 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
740
770
|
mergedFilters?.[String(filterParam)] ?? ""
|
|
741
771
|
}
|
|
742
772
|
clearable
|
|
743
|
-
className="
|
|
773
|
+
className="px-0"
|
|
744
774
|
placeholder={"Zadejte filtr"}
|
|
745
775
|
rounded={true}
|
|
746
776
|
disabled={Object.keys(
|
|
747
777
|
(filters as object) || {}
|
|
748
778
|
).includes(String(filterParam))}
|
|
749
779
|
/>
|
|
780
|
+
) : filterType === "multi-select" ? (
|
|
781
|
+
<MultiSelect
|
|
782
|
+
key={JSON.stringify(mergedFilters)}
|
|
783
|
+
options={
|
|
784
|
+
filterOptions[String(filterParam)] || []
|
|
785
|
+
}
|
|
786
|
+
onChange={(values) =>
|
|
787
|
+
filterHandler(
|
|
788
|
+
filterParam as keyof T,
|
|
789
|
+
values
|
|
790
|
+
)
|
|
791
|
+
}
|
|
792
|
+
value={
|
|
793
|
+
mergedFilters?.[String(filterParam)] || []
|
|
794
|
+
}
|
|
795
|
+
placeholder={"Zadejte filtr"}
|
|
796
|
+
className="px-0"
|
|
797
|
+
disabled={Object.keys(
|
|
798
|
+
(filters as object) || {}
|
|
799
|
+
).includes(String(filterParam))}
|
|
800
|
+
variant="secondary"
|
|
801
|
+
/>
|
|
750
802
|
) : filterType === "dateRange" ? (
|
|
751
803
|
<DateRangeField
|
|
752
|
-
// label={header}
|
|
753
804
|
key={JSON.stringify(mergedFilters)}
|
|
754
805
|
name={String(filterParam)}
|
|
755
806
|
nameEnd={String(filterParam2)}
|
|
@@ -778,7 +829,6 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
778
829
|
/>
|
|
779
830
|
) : filterType === "date" ? (
|
|
780
831
|
<DateField
|
|
781
|
-
// label={header}
|
|
782
832
|
key={JSON.stringify(mergedFilters)}
|
|
783
833
|
name={String(filterParam)}
|
|
784
834
|
onInputChange={(e) =>
|
|
@@ -801,7 +851,6 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
801
851
|
/>
|
|
802
852
|
) : filterType === "text" ? (
|
|
803
853
|
<InputField
|
|
804
|
-
// label={header}
|
|
805
854
|
key={filterParam}
|
|
806
855
|
name={String(key) + "_filter"}
|
|
807
856
|
onInputChange={(e) =>
|
|
@@ -867,7 +916,7 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
867
916
|
}
|
|
868
917
|
className={`px-3 py-2 ${rowAction ? "cursor-pointer" : ""} ${
|
|
869
918
|
colIndex === 0
|
|
870
|
-
? "font-medium text-
|
|
919
|
+
? "font-medium text-muted-foreground"
|
|
871
920
|
: "text-gray-700"
|
|
872
921
|
} ${classes || ""}`}
|
|
873
922
|
>
|
|
@@ -883,7 +932,7 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
883
932
|
.map((action, actionIndex) => (
|
|
884
933
|
<div
|
|
885
934
|
key={`${rowIndex}-${colIndex}-${actionIndex}`}
|
|
886
|
-
className="
|
|
935
|
+
className="inline-flex align-middle"
|
|
887
936
|
>
|
|
888
937
|
{action.icon && (
|
|
889
938
|
<Button
|
|
@@ -947,45 +996,51 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
947
996
|
)}
|
|
948
997
|
</table>
|
|
949
998
|
</div>
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
999
|
+
|
|
1000
|
+
{data?.isPageable && (
|
|
1001
|
+
<div
|
|
1002
|
+
data-cy="pagination"
|
|
1003
|
+
className="w-full p-5 flex gap-5 justify-between md:flex-row flex-col"
|
|
1004
|
+
>
|
|
1005
|
+
<div className="flex gap-5 text-sm ">
|
|
1006
|
+
{data && (
|
|
1007
|
+
<Button
|
|
1008
|
+
variant="secondary"
|
|
1009
|
+
onClick={prevPage}
|
|
1010
|
+
className="flex items-center"
|
|
1011
|
+
disabled={data.first || isLoading}
|
|
1012
|
+
>
|
|
1013
|
+
<MdArrowBack className="mr-1.5" /> Předchozí
|
|
1014
|
+
</Button>
|
|
1015
|
+
)}
|
|
1016
|
+
{data && (
|
|
1017
|
+
<Button
|
|
1018
|
+
variant="secondary"
|
|
1019
|
+
onClick={nextPage}
|
|
1020
|
+
className="flex items-center"
|
|
1021
|
+
disabled={data.last || isLoading}
|
|
1022
|
+
>
|
|
1023
|
+
Následující <MdArrowForward className="ml-2" size={20} />
|
|
1024
|
+
</Button>
|
|
1025
|
+
)}
|
|
1026
|
+
</div>
|
|
1027
|
+
<div className="flex items-center justify-center text-gray-800">
|
|
1028
|
+
{paginationDisplay}
|
|
1029
|
+
</div>
|
|
1030
|
+
<div className="content-center w-auto items-center justify-end flex-row gap-5 flex md:mt-0 mt-5">
|
|
1031
|
+
<span className=" whitespace-nowrap flex-grow">
|
|
1032
|
+
Počet řádků na stránku:
|
|
1033
|
+
</span>
|
|
1034
|
+
<SelectField
|
|
1035
|
+
name="itemsPerPage"
|
|
1036
|
+
onInputChange={handleItemsPerPageChange}
|
|
1037
|
+
className="!w-[100px]"
|
|
1038
|
+
options={itemsPerPageOptions || defaultItemsPerPageOptions}
|
|
1039
|
+
value={itemsPerPageLocal}
|
|
1040
|
+
/>
|
|
1041
|
+
</div>
|
|
987
1042
|
</div>
|
|
988
|
-
|
|
1043
|
+
)}
|
|
989
1044
|
</div>
|
|
990
1045
|
</>
|
|
991
1046
|
);
|
|
@@ -401,19 +401,19 @@ const SearchInput: React.FC<SearchInputProps> = ({
|
|
|
401
401
|
)}
|
|
402
402
|
{isFocused && !isLoading && (
|
|
403
403
|
<MdExpandLess
|
|
404
|
-
className="material-icons absolute right-0 cursor-pointer text-
|
|
404
|
+
className="material-icons absolute right-0 cursor-pointer text-muted-foreground lext-lg"
|
|
405
405
|
onClick={onBlur}
|
|
406
406
|
/>
|
|
407
407
|
)}
|
|
408
408
|
{!isFocused && !isLoading && (
|
|
409
409
|
<MdExpandMore
|
|
410
|
-
className="material-icons absolute right-0 cursor-pointer text-
|
|
410
|
+
className="material-icons absolute right-0 cursor-pointer text-muted-foreground lext-lg"
|
|
411
411
|
onClick={handleExpandMoreClick}
|
|
412
412
|
/>
|
|
413
413
|
)}
|
|
414
414
|
{value && clearable && !isLoading && (
|
|
415
415
|
<MdClose
|
|
416
|
-
className="material-icons absolute right-6 cursor-pointer text-
|
|
416
|
+
className="material-icons absolute right-6 cursor-pointer text-muted-foreground lext-lg"
|
|
417
417
|
onClick={handleClearQuery}
|
|
418
418
|
/>
|
|
419
419
|
)}
|
|
@@ -83,14 +83,14 @@ export default function DateRangeField({
|
|
|
83
83
|
inputClassName={(className) => {
|
|
84
84
|
return (
|
|
85
85
|
className +
|
|
86
|
-
` focus:!ring-indigo-200 focus:!border-indigo-300 focus:ring-4 border !border-gray-200 !pr-8 !pl-[8px] font-normal ${rounded ? " rounded-lg " : " !rounded-none "} outline-none shadow-none
|
|
86
|
+
` focus:!ring-indigo-200 focus:!border-indigo-300 focus:ring-4 border !border-gray-200 !pr-8 !pl-[8px] font-normal ${rounded ? " rounded-lg " : " !rounded-none "} outline-none shadow-none placeholder-muted-foreground`
|
|
87
87
|
);
|
|
88
88
|
}}
|
|
89
89
|
containerClassName={(className) => {
|
|
90
90
|
return className + " ";
|
|
91
91
|
}}
|
|
92
92
|
separator={"-"}
|
|
93
|
-
toggleClassName="absolute rounded-r-lg right-0 h-full px-3 text-gray-400 focus:outline-none disabled:opacity-80 disabled:cursor-not-allowed text-
|
|
93
|
+
toggleClassName="absolute rounded-r-lg right-0 h-full px-3 text-gray-400 focus:outline-none disabled:opacity-80 disabled:cursor-not-allowed text-muted-foreground"
|
|
94
94
|
{...rest}
|
|
95
95
|
/>
|
|
96
96
|
</div>
|
|
@@ -150,7 +150,7 @@ const FormField: React.FC<FormFieldProps> = ({
|
|
|
150
150
|
<>
|
|
151
151
|
<select
|
|
152
152
|
id={name}
|
|
153
|
-
className="grow shrink basis-0 text-
|
|
153
|
+
className="grow shrink basis-0 text-muted-foreground text-sm font-normal leading-tight focus:border-none bg-transparent w-full"
|
|
154
154
|
disabled={disabled}
|
|
155
155
|
value={value}
|
|
156
156
|
{...rest} // Spread the rest of register's return value
|
|
@@ -185,7 +185,7 @@ const FormField: React.FC<FormFieldProps> = ({
|
|
|
185
185
|
<select
|
|
186
186
|
id={name}
|
|
187
187
|
multiple
|
|
188
|
-
className="grow shrink basis-0 text-
|
|
188
|
+
className="grow shrink basis-0 text-muted-foreground text-sm font-normal leading-tight focus:border-none bg-transparent w-max-full "
|
|
189
189
|
disabled={disabled}
|
|
190
190
|
value={Array.isArray(value) ? value : []} // Ensure value is always an array
|
|
191
191
|
{...rest}
|
|
@@ -226,7 +226,7 @@ const FormField: React.FC<FormFieldProps> = ({
|
|
|
226
226
|
onChange={onInputChange}
|
|
227
227
|
className="text-indigo-600 border-gray-300 focus:ring-indigo-500 mr-2"
|
|
228
228
|
/>
|
|
229
|
-
<span className="text-
|
|
229
|
+
<span className="text-muted-foreground text-sm font-normal leading-tight">
|
|
230
230
|
{option.label}
|
|
231
231
|
</span>
|
|
232
232
|
</label>
|
|
@@ -237,7 +237,7 @@ const FormField: React.FC<FormFieldProps> = ({
|
|
|
237
237
|
return (
|
|
238
238
|
<textarea
|
|
239
239
|
id={name}
|
|
240
|
-
className="grow shrink basis-0 text-
|
|
240
|
+
className="grow shrink basis-0 text-muted-foreground text-sm font-normal leading-tight focus:border-none "
|
|
241
241
|
disabled={disabled}
|
|
242
242
|
value={value}
|
|
243
243
|
rows={3}
|
|
@@ -259,7 +259,7 @@ const FormField: React.FC<FormFieldProps> = ({
|
|
|
259
259
|
<input
|
|
260
260
|
type="checkbox"
|
|
261
261
|
id={name}
|
|
262
|
-
className="shrink basis-0 text-
|
|
262
|
+
className="shrink basis-0 text-muted-foreground text-sm font-normal leading-tight focus:border-none"
|
|
263
263
|
checked={value}
|
|
264
264
|
disabled={disabled}
|
|
265
265
|
{...rest} // Spread the rest of register's return value
|
|
@@ -279,7 +279,7 @@ const FormField: React.FC<FormFieldProps> = ({
|
|
|
279
279
|
return (
|
|
280
280
|
<>
|
|
281
281
|
<input
|
|
282
|
-
className="grow shrink basis-0 text-
|
|
282
|
+
className="grow shrink basis-0 text-muted-foreground text-sm font-normal leading-tight focus:border-none bg-transparent w-full"
|
|
283
283
|
id={name}
|
|
284
284
|
readOnly={disabled}
|
|
285
285
|
value={value}
|
|
@@ -114,7 +114,7 @@ export default function InputField({
|
|
|
114
114
|
<textarea
|
|
115
115
|
id={name}
|
|
116
116
|
name={name}
|
|
117
|
-
className="grow shrink basis-0 text-
|
|
117
|
+
className="grow shrink basis-0 text-muted-foreground text-sm font-normal leading-tight focus:border-none outline-none shadow-none
|
|
118
118
|
bg-white "
|
|
119
119
|
disabled={disabled}
|
|
120
120
|
value={inputValue}
|
|
@@ -137,7 +137,8 @@ export default function InputField({
|
|
|
137
137
|
return (
|
|
138
138
|
<>
|
|
139
139
|
<input
|
|
140
|
-
className={`text-
|
|
140
|
+
className={`text-muted-foreground text-sm font-normal leading-normal outline-none shadow-none
|
|
141
|
+
placeholder-muted-foreground
|
|
141
142
|
text-ellipsis overflow-hidden w-full disabled:cursor-not-allowed bg-white`}
|
|
142
143
|
id={name}
|
|
143
144
|
name={name}
|
|
@@ -43,7 +43,7 @@ export default function RadioGroup({
|
|
|
43
43
|
onChange={onInputChange}
|
|
44
44
|
className=" accent-primary border-gray-300 mr-2"
|
|
45
45
|
/>
|
|
46
|
-
<span className="text-
|
|
46
|
+
<span className="text-muted-foreground text-sm font-normal leading-tight">
|
|
47
47
|
{option.label}
|
|
48
48
|
</span>
|
|
49
49
|
</label>
|
|
@@ -133,7 +133,7 @@ export default function SelectField({
|
|
|
133
133
|
>
|
|
134
134
|
<div className="grow shrink basis-0 px-1 py-2 rounded-md flex-col justify-start items-start gap-2 inline-flex">
|
|
135
135
|
<div className="self-stretch justify-start items-center gap-2 inline-flex">
|
|
136
|
-
<div className="text-
|
|
136
|
+
<div className="text-muted-foreground text-sm font-normal leading-normal">
|
|
137
137
|
{option.label}
|
|
138
138
|
</div>
|
|
139
139
|
{option.description && (
|
|
@@ -199,12 +199,12 @@ export default function SelectField({
|
|
|
199
199
|
>
|
|
200
200
|
<div className="grow shrink basis-0 min-h-[32px] justify-start items-center gap-0 flex whitespace-nowrap w-[calc(100%-40px)] ">
|
|
201
201
|
<div
|
|
202
|
-
className="text-
|
|
202
|
+
className="text-muted-foreground text-sm font-normal leading-normal text-ellipsis overflow-hidden w-full"
|
|
203
203
|
id={name}
|
|
204
204
|
>
|
|
205
205
|
{currentlySelectedOption?.label}
|
|
206
206
|
{!currentlySelectedOption?.label && placeholder && (
|
|
207
|
-
<span className="text-
|
|
207
|
+
<span className="text-muted-foreground font-normal">
|
|
208
208
|
{" "}
|
|
209
209
|
{placeholder}
|
|
210
210
|
</span>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
interface IPageTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
2
|
-
textSize?: string;
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export default function PageTitle({
|
|
7
|
-
children,
|
|
8
|
-
textSize = "text-2xl",
|
|
9
|
-
...props
|
|
10
|
-
}: IPageTitleProps) {
|
|
11
|
-
// Combine textSize with the other fixed class names
|
|
12
|
-
const className = ` text-
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<h1 {...props} className={className}>
|
|
16
|
-
{children}
|
|
17
|
-
</h1>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
1
|
+
interface IPageTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
2
|
+
textSize?: string;
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export default function PageTitle({
|
|
7
|
+
children,
|
|
8
|
+
textSize = "text-2xl",
|
|
9
|
+
...props
|
|
10
|
+
}: IPageTitleProps) {
|
|
11
|
+
// Combine textSize with the other fixed class names
|
|
12
|
+
const className = ` text-muted-foreground ${textSize} font-medium font-['Inter'] leading-7 mb-5`;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<h1 {...props} className={className}>
|
|
16
|
+
{children}
|
|
17
|
+
</h1>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -10,7 +10,7 @@ export default function SectionTitle({
|
|
|
10
10
|
...props
|
|
11
11
|
}: ISectionTitleProps) {
|
|
12
12
|
// Combine textSize with the other fixed class names
|
|
13
|
-
const className = ` text-
|
|
13
|
+
const className = ` text-muted-foreground ${textSize} font-semibold font-['Inter'] leading-7 mb-3`;
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<div className="border-b border-gray-300 pt-2 mb-5 ">
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../utils/utils";
|
|
5
|
+
|
|
6
|
+
const badgeVariants = cva(
|
|
7
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
13
|
+
secondary:
|
|
14
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
+
destructive:
|
|
16
|
+
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
17
|
+
outline: "text-foreground",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export interface BadgeProps
|
|
27
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
28
|
+
VariantProps<typeof badgeVariants> {}
|
|
29
|
+
|
|
30
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { Badge, badgeVariants };
|