@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.
Files changed (126) hide show
  1. package/dist/Combination-D2GKeTwa.js +1162 -0
  2. package/dist/Combination-D2GKeTwa.js.map +1 -0
  3. package/dist/Dialog-BWa_flly.js +424 -0
  4. package/dist/Dialog-BWa_flly.js.map +1 -0
  5. package/dist/Dialog-CCrUyF91.js +424 -0
  6. package/dist/Dialog-CCrUyF91.js.map +1 -0
  7. package/dist/assets/style.css +61 -8
  8. package/dist/chevron-down-CfJmko7t.js +14 -0
  9. package/dist/chevron-down-CfJmko7t.js.map +1 -0
  10. package/dist/components/Attachments.js +2 -1
  11. package/dist/components/Attachments.js.map +1 -1
  12. package/dist/components/ConfirmationModalDialog.js +1 -1
  13. package/dist/components/ConfirmationModalDialog.js.map +1 -1
  14. package/dist/components/Modal.js +1 -1
  15. package/dist/components/Modal.js.map +1 -1
  16. package/dist/components/datatable/DataTable.js +3 -2
  17. package/dist/components/datatable/DataTable.js.map +1 -1
  18. package/dist/components/datatable/DataTableServer.js +96 -61
  19. package/dist/components/datatable/DataTableServer.js.map +1 -1
  20. package/dist/components/form/AutocompleteSearchBar.js +5 -4
  21. package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
  22. package/dist/components/form/AutocompleteSearchBarServer.js +2 -1
  23. package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
  24. package/dist/components/form/DateRangeField.js +2 -2
  25. package/dist/components/form/DateRangeField.js.map +1 -1
  26. package/dist/components/form/FileInput.js +3 -2
  27. package/dist/components/form/FileInput.js.map +1 -1
  28. package/dist/components/form/FileInputMultiple.js +3 -2
  29. package/dist/components/form/FileInputMultiple.js.map +1 -1
  30. package/dist/components/form/FormField.js +8 -7
  31. package/dist/components/form/FormField.js.map +1 -1
  32. package/dist/components/form/InputField.js +3 -2
  33. package/dist/components/form/InputField.js.map +1 -1
  34. package/dist/components/form/PositionsSelectorSingle.js +2 -1
  35. package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
  36. package/dist/components/form/RadioGroup.js +1 -1
  37. package/dist/components/form/RadioGroup.js.map +1 -1
  38. package/dist/components/form/SelectField.js +5 -4
  39. package/dist/components/form/SelectField.js.map +1 -1
  40. package/dist/components/layout/Neoptimizovano.js +2 -1
  41. package/dist/components/layout/Neoptimizovano.js.map +1 -1
  42. package/dist/components/layout/PageTitle.js +1 -1
  43. package/dist/components/layout/PageTitle.js.map +1 -1
  44. package/dist/components/layout/SectionTitle.js +1 -1
  45. package/dist/components/layout/SectionTitle.js.map +1 -1
  46. package/dist/components/profiles/ProfileOverview.js +2 -1
  47. package/dist/components/profiles/ProfileOverview.js.map +1 -1
  48. package/dist/components/ui/Combobox.js +1 -1
  49. package/dist/components/ui/DatePicker.js +1 -1
  50. package/dist/components/ui/DateTimePicker.js +1 -1
  51. package/dist/components/ui/Dialog.js +1 -1
  52. package/dist/components/ui/ScrollArea.js +2 -2
  53. package/dist/components/ui/async-combobox.d.ts +40 -0
  54. package/dist/components/ui/async-combobox.js +5706 -0
  55. package/dist/components/ui/async-combobox.js.map +1 -0
  56. package/dist/components/ui/badge.d.ts +9 -0
  57. package/dist/components/ui/badge.js +27 -0
  58. package/dist/components/ui/badge.js.map +1 -0
  59. package/dist/components/ui/checkbox.js +4 -4
  60. package/dist/components/ui/command.js +2 -2
  61. package/dist/components/ui/multi-select.d.ts +67 -0
  62. package/dist/components/ui/multi-select.js +295 -0
  63. package/dist/components/ui/multi-select.js.map +1 -0
  64. package/dist/components/ui/popover.js +1 -1
  65. package/dist/components/ui/radioGroup.js +5 -5
  66. package/dist/components/ui/select.js +8 -16
  67. package/dist/components/ui/select.js.map +1 -1
  68. package/dist/components/ui/toast.js +5 -5
  69. package/dist/components/ui/tooltip.js +6 -6
  70. package/dist/index-B0wyIFEr.js +47 -0
  71. package/dist/index-B0wyIFEr.js.map +1 -0
  72. package/dist/index-BcR8DnnV.js +234 -0
  73. package/dist/index-BcR8DnnV.js.map +1 -0
  74. package/dist/index-CDptxuif.js +234 -0
  75. package/dist/index-CDptxuif.js.map +1 -0
  76. package/dist/index-CK9QfV6i.js +40 -0
  77. package/dist/index-CK9QfV6i.js.map +1 -0
  78. package/dist/index-CcNKXchf.js +2203 -0
  79. package/dist/index-CcNKXchf.js.map +1 -0
  80. package/dist/index-CpcwEIT_.js +18 -0
  81. package/dist/index-CpcwEIT_.js.map +1 -0
  82. package/dist/index-CulRZKWg.js +2212 -0
  83. package/dist/index-CulRZKWg.js.map +1 -0
  84. package/dist/index-D75exu1X.js +18 -0
  85. package/dist/index-D75exu1X.js.map +1 -0
  86. package/dist/index-DoYsULhE.js +28878 -0
  87. package/dist/index-DoYsULhE.js.map +1 -0
  88. package/dist/index-Dr6Ds0Bg.js +1162 -0
  89. package/dist/index-Dr6Ds0Bg.js.map +1 -0
  90. package/dist/index-DsU1clfi.js +36 -0
  91. package/dist/index-DsU1clfi.js.map +1 -0
  92. package/dist/index-DzfDO78K.js +15 -0
  93. package/dist/index-DzfDO78K.js.map +1 -0
  94. package/dist/index-NZPkObcw.js +110 -0
  95. package/dist/index-NZPkObcw.js.map +1 -0
  96. package/dist/index-Vp9wI6hE.js +2203 -0
  97. package/dist/index-Vp9wI6hE.js.map +1 -0
  98. package/dist/index-qqHvAsVd.js +2266 -0
  99. package/dist/index-qqHvAsVd.js.map +1 -0
  100. package/dist/index-wO-IHm1z.js +131 -0
  101. package/dist/index-wO-IHm1z.js.map +1 -0
  102. package/dist/main.d.ts +1 -0
  103. package/dist/main.js +3 -1
  104. package/dist/main.js.map +1 -1
  105. package/dist/plus-sawBIbEd.js +26 -0
  106. package/dist/plus-sawBIbEd.js.map +1 -0
  107. package/dist/popover-CcrzvSk7.js +319 -0
  108. package/dist/popover-CcrzvSk7.js.map +1 -0
  109. package/dist/popover-DhdNw4fZ.js +319 -0
  110. package/dist/popover-DhdNw4fZ.js.map +1 -0
  111. package/lib/components/ConfirmationModalDialog.tsx +1 -1
  112. package/lib/components/Modal.tsx +1 -1
  113. package/lib/components/datatable/DataTable.tsx +1 -1
  114. package/lib/components/datatable/DataTableServer.tsx +113 -58
  115. package/lib/components/form/AutocompleteSearchBar.tsx +3 -3
  116. package/lib/components/form/DateRangeField.tsx +2 -2
  117. package/lib/components/form/FormField.tsx +6 -6
  118. package/lib/components/form/InputField.tsx +3 -2
  119. package/lib/components/form/RadioGroup.tsx +1 -1
  120. package/lib/components/form/SelectField.tsx +3 -3
  121. package/lib/components/layout/PageTitle.tsx +19 -19
  122. package/lib/components/layout/SectionTitle.tsx +1 -1
  123. package/lib/components/ui/badge.tsx +36 -0
  124. package/lib/components/ui/multi-select.tsx +365 -0
  125. package/lib/main.ts +4 -0
  126. 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: response.data?.content ? response.data.empty : true,
129
- first: response.data?.content ? response.data.first : true,
130
- last: response.data?.content ? response.data.last : true,
131
- number: response.data?.content ? response.data.number : 0,
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
- if (value !== null && value !== "") {
178
- acc[key] = value;
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, // Pass the AbortController signal to the request
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=" px-0"
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-gray-900"
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="flex inline-flex align-middle"
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
- <div className="w-full p-5 flex gap-5 justify-between md:flex-row flex-col">
951
- <div className="flex gap-5 text-sm ">
952
- {data && (
953
- <Button
954
- variant="secondary"
955
- onClick={prevPage}
956
- className="flex items-center"
957
- disabled={data.first || isLoading}
958
- >
959
- <MdArrowBack className="mr-1.5" /> Předchozí
960
- </Button>
961
- )}
962
- {data && (
963
- <Button
964
- variant="secondary"
965
- onClick={nextPage}
966
- className="flex items-center"
967
- disabled={data.last || isLoading}
968
- >
969
- Následující <MdArrowForward className="ml-2" size={20} />
970
- </Button>
971
- )}
972
- </div>
973
- <div className="flex items-center justify-center text-gray-800">
974
- {paginationDisplay}
975
- </div>
976
- <div className="content-center w-auto items-center justify-end flex-row gap-5 flex md:mt-0 mt-5">
977
- <span className=" whitespace-nowrap flex-grow">
978
- Počet řádků na stránku:
979
- </span>
980
- <SelectField
981
- name="itemsPerPage"
982
- onInputChange={handleItemsPerPageChange}
983
- className="!w-[100px]"
984
- options={itemsPerPageOptions || defaultItemsPerPageOptions}
985
- value={itemsPerPageLocal}
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
- </div>
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-gray-900 lext-lg"
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-gray-900 lext-lg"
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-gray-900 lext-lg"
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-gray-900"
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-gray-900 text-sm font-normal leading-tight focus:border-none bg-transparent w-full"
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-gray-900 text-sm font-normal leading-tight focus:border-none bg-transparent w-max-full "
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-gray-900 text-sm font-normal leading-tight">
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-gray-900 text-sm font-normal leading-tight focus:border-none "
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-gray-900 text-sm font-normal leading-tight focus:border-none"
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-gray-900 text-sm font-normal leading-tight focus:border-none bg-transparent w-full"
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-gray-900 text-sm font-normal leading-tight focus:border-none outline-none shadow-none
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-gray-900 text-sm font-normal leading-normal outline-none shadow-none
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-gray-900 text-sm font-normal leading-tight">
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-gray-900 text-sm font-normal leading-normal">
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-gray-900 text-sm font-normal leading-normal text-ellipsis overflow-hidden w-full"
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-slate-400 font-normal">
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-gray-900 ${textSize} font-medium font-['Inter'] leading-7 mb-5`;
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-gray-900 ${textSize} font-semibold font-['Inter'] leading-7 mb-3`;
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 };