@krosoft/react 0.0.391 → 0.0.392

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 (189) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +1 -2
  2. package/dist/components/core/cards/DashboardCard.js +7 -8
  3. package/dist/components/core/cards/KpiCard.js +13 -14
  4. package/dist/components/core/cards/KpiCards.js +1 -2
  5. package/dist/components/core/cards/MetricCard.js +1 -2
  6. package/dist/components/core/cards/SkeletonCard.js +1 -2
  7. package/dist/components/core/cards/SkeletonCards.js +1 -2
  8. package/dist/components/core/changelog/AppChangelog.js +13 -14
  9. package/dist/components/core/changelog/AppChangelogEntry.js +19 -20
  10. package/dist/components/core/changelog/AppChangelogNav.js +1 -2
  11. package/dist/components/core/changelog/AppChangelogTagFilter.js +11 -12
  12. package/dist/components/core/charts/BarChartHorizontal.js +6 -7
  13. package/dist/components/core/charts/BarChartVertical.js +6 -7
  14. package/dist/components/core/charts/ChartCard.js +7 -8
  15. package/dist/components/core/charts/CircularGauge.js +1 -2
  16. package/dist/components/core/charts/LineChart.js +6 -7
  17. package/dist/components/core/charts/PieChart.js +12 -13
  18. package/dist/components/core/charts/chartColors.js +1 -2
  19. package/dist/components/core/charts/chartTooltip.helper.js +1 -2
  20. package/dist/components/core/dialogs/AboutDialog.js +11 -12
  21. package/dist/components/core/dialogs/AppDialog.js +27 -28
  22. package/dist/components/core/dialogs/ConfirmationDialog.js +15 -16
  23. package/dist/components/core/dialogs/FormDialog.js +7 -8
  24. package/dist/components/core/dialogs/index.js +4 -4
  25. package/dist/components/core/filters/ActiveFilters.js +1 -2
  26. package/dist/components/core/filters/AdvancedFilters.js +1 -2
  27. package/dist/components/core/filters/ConditionFilter.js +19 -20
  28. package/dist/components/core/filters/ConditionFilterGroup.js +1 -2
  29. package/dist/components/core/filters/FilterField.js +9 -10
  30. package/dist/components/core/filters/FilterPills.js +1 -2
  31. package/dist/components/core/filters/FilterPillsGroup.js +1 -2
  32. package/dist/components/core/filters/FiltersContainer.js +6 -7
  33. package/dist/components/core/filters/FiltersMobileDrawer.js +1 -2
  34. package/dist/components/core/filters/TableFilter.js +5 -6
  35. package/dist/components/core/filters/index.js +7 -7
  36. package/dist/components/core/forms/GenericForm.js +119 -120
  37. package/dist/components/core/icons/FlagFrIcon.js +1 -2
  38. package/dist/components/core/icons/FlagGbIcon.js +1 -2
  39. package/dist/components/core/inputs/DatePicker.js +9 -10
  40. package/dist/components/core/inputs/DateRangePicker.js +19 -20
  41. package/dist/components/core/inputs/FileDropzone.js +2 -3
  42. package/dist/components/core/inputs/ImageInput.js +9 -10
  43. package/dist/components/core/inputs/MultiSelect.js +89 -90
  44. package/dist/components/core/inputs/RatingInput.js +1 -2
  45. package/dist/components/core/inputs/SearchInput.js +7 -8
  46. package/dist/components/core/inputs/SingleSelect.js +36 -37
  47. package/dist/components/core/inputs/index.js +5 -5
  48. package/dist/components/core/inputs/select.helper.js +1 -2
  49. package/dist/components/core/language/LanguageSelector.js +1 -2
  50. package/dist/components/core/layouts/AppActions.js +44 -45
  51. package/dist/components/core/layouts/AppPageHeader.js +9 -10
  52. package/dist/components/core/layouts/AppSubTitle.js +1 -2
  53. package/dist/components/core/layouts/AppTitle.js +1 -2
  54. package/dist/components/core/layouts/KpiCardsLayout.js +1 -2
  55. package/dist/components/core/layouts/index.js +4 -4
  56. package/dist/components/core/markdown/AppMarkdown.js +1 -2
  57. package/dist/components/core/markdown/AppMarkdownHeading.js +4 -5
  58. package/dist/components/core/navbar/GlobalSearch.js +16 -17
  59. package/dist/components/core/navbar/NotificationsBell.js +21 -22
  60. package/dist/components/core/navbar/Sidebar.js +32 -33
  61. package/dist/components/core/navbar/SidebarHeader.js +1 -2
  62. package/dist/components/core/navbar/SidebarNavItem.js +20 -21
  63. package/dist/components/core/navbar/Topbar.js +5 -6
  64. package/dist/components/core/navbar/index.js +4 -4
  65. package/dist/components/core/states/ErrorAlert.js +1 -2
  66. package/dist/components/core/states/ErrorState.js +1 -2
  67. package/dist/components/core/states/LoadingState.js +1 -2
  68. package/dist/components/core/table/DataTable.js +1 -2
  69. package/dist/components/core/table/JsonTableOutput.js +17 -18
  70. package/dist/components/core/table/TableActions.js +31 -32
  71. package/dist/components/core/table/TableBody.js +25 -26
  72. package/dist/components/core/table/TableBulkActions.js +11 -12
  73. package/dist/components/core/table/TableHeader.js +15 -16
  74. package/dist/components/core/table/TablePagination.js +1 -2
  75. package/dist/components/core/table/TableSettings.js +20 -21
  76. package/dist/components/core/table/index.js +7 -7
  77. package/dist/components/core/tabs/AppTabContainer.js +1 -2
  78. package/dist/components/core/tabs/AppTabHeader.js +1 -2
  79. package/dist/components/core/tabs/AppTabs.js +10 -11
  80. package/dist/components/core/tabs/AppVerticalTabs.js +10 -11
  81. package/dist/components/core/tabs/index.js +3 -3
  82. package/dist/components/core/theme/ThemeSelector.js +1 -2
  83. package/dist/components/ui/accordion.js +1 -2
  84. package/dist/components/ui/alert-dialog.js +1 -2
  85. package/dist/components/ui/alert.js +1 -2
  86. package/dist/components/ui/aspect-ratio.js +1 -2
  87. package/dist/components/ui/avatar.js +1 -2
  88. package/dist/components/ui/badge.js +1 -2
  89. package/dist/components/ui/breadcrumb.js +1 -2
  90. package/dist/components/ui/button.js +1 -2
  91. package/dist/components/ui/calendar.js +8 -9
  92. package/dist/components/ui/card.js +1 -2
  93. package/dist/components/ui/carousel.js +1 -2
  94. package/dist/components/ui/chart.js +1 -2
  95. package/dist/components/ui/checkbox.js +1 -2
  96. package/dist/components/ui/collapsible.js +1 -2
  97. package/dist/components/ui/command.js +19 -20
  98. package/dist/components/ui/context-menu.js +1 -2
  99. package/dist/components/ui/control.js +1 -2
  100. package/dist/components/ui/dialog.js +1 -2
  101. package/dist/components/ui/drawer.js +1 -2
  102. package/dist/components/ui/dropdown-menu.js +1 -2
  103. package/dist/components/ui/form.js +1 -2
  104. package/dist/components/ui/hover-card.js +1 -2
  105. package/dist/components/ui/index.js +19 -19
  106. package/dist/components/ui/input-otp.js +1 -2
  107. package/dist/components/ui/input.js +1 -2
  108. package/dist/components/ui/label.js +1 -2
  109. package/dist/components/ui/menubar.js +1 -2
  110. package/dist/components/ui/navigation-menu.js +1 -2
  111. package/dist/components/ui/pagination.js +1 -2
  112. package/dist/components/ui/popover.js +1 -2
  113. package/dist/components/ui/progress.js +1 -2
  114. package/dist/components/ui/radio-group.js +1 -2
  115. package/dist/components/ui/resizable.js +1 -2
  116. package/dist/components/ui/scroll-area.js +1 -2
  117. package/dist/components/ui/select.js +1 -2
  118. package/dist/components/ui/separator.js +1 -2
  119. package/dist/components/ui/sheet.js +1 -2
  120. package/dist/components/ui/simple-table.js +1 -2
  121. package/dist/components/ui/skeleton.js +1 -2
  122. package/dist/components/ui/slider.js +1 -2
  123. package/dist/components/ui/sonner.js +1 -2
  124. package/dist/components/ui/switch.js +1 -2
  125. package/dist/components/ui/tabs.js +1 -2
  126. package/dist/components/ui/textarea.js +1 -2
  127. package/dist/components/ui/toast.js +1 -2
  128. package/dist/components/ui/toaster.js +10 -11
  129. package/dist/components/ui/toggle-group.js +1 -2
  130. package/dist/components/ui/toggle.js +1 -2
  131. package/dist/components/ui/tooltip.js +1 -2
  132. package/dist/constants/datatable.js +1 -2
  133. package/dist/constants/search.js +1 -2
  134. package/dist/contexts/page.context.js +1 -2
  135. package/dist/contexts/sidebar.context.js +1 -2
  136. package/dist/helpers/changelog.helper.js +1 -2
  137. package/dist/helpers/markdown.helper.js +1 -2
  138. package/dist/helpers/supabase.helper.js +1 -2
  139. package/dist/helpers/table.helper.js +1 -2
  140. package/dist/helpers/tailwind.helper.js +1 -2
  141. package/dist/hooks/behavior/index.js +6 -6
  142. package/dist/hooks/behavior/useConfirmDeleteDialog.js +1 -2
  143. package/dist/hooks/behavior/useConfirmationDialog.js +1 -2
  144. package/dist/hooks/behavior/useDebounce.js +1 -2
  145. package/dist/hooks/behavior/useDebouncedValue.js +1 -2
  146. package/dist/hooks/behavior/useDialog.js +1 -2
  147. package/dist/hooks/behavior/usePage.js +1 -2
  148. package/dist/hooks/behavior/useSidebar.js +1 -2
  149. package/dist/hooks/behavior/useTable.js +1 -2
  150. package/dist/hooks/behavior/useUrlState.js +1 -2
  151. package/dist/hooks/ui/index.js +10 -10
  152. package/dist/hooks/ui/useDataTable.js +1 -2
  153. package/dist/hooks/ui/useDocumentTitle.js +1 -2
  154. package/dist/hooks/ui/useFixedColumns.js +1 -2
  155. package/dist/hooks/ui/useLanguage.js +1 -2
  156. package/dist/hooks/ui/useMobile.js +1 -2
  157. package/dist/hooks/ui/useNotifications.js +1 -2
  158. package/dist/hooks/ui/useScrollFade.js +1 -2
  159. package/dist/hooks/ui/useServerTable.js +1 -2
  160. package/dist/hooks/ui/useTheme.js +1 -2
  161. package/dist/hooks/ui/useToast.js +1 -2
  162. package/dist/i18n/krosoftLocales.js +1 -2
  163. package/dist/i18n/translateKrosoft.js +1 -2
  164. package/dist/i18n/useDateFnsLocale.js +1 -2
  165. package/dist/i18n/useKrosoftTranslation.js +1 -2
  166. package/dist/locales/en.json.js +1 -2
  167. package/dist/locales/fr.json.js +1 -2
  168. package/dist/providers/SidebarProvider.js +5 -6
  169. package/dist/pwa/PwaUpdater.js +1 -2
  170. package/dist/pwa/index.js +3 -3
  171. package/dist/pwa/pwaUpdateToast.js +1 -2
  172. package/dist/query/createQueryClient.js +1 -2
  173. package/dist/seasonal/EffectSwitch.js +1 -2
  174. package/dist/seasonal/EmojiSnowfall.js +1 -2
  175. package/dist/seasonal/HalloweenEffect.js +5 -6
  176. package/dist/seasonal/SeasonalEffects.js +4 -5
  177. package/dist/seasonal/SeasonalEffectsSettings.js +8 -9
  178. package/dist/seasonal/SnowEffect.js +5 -6
  179. package/dist/seasonal/overlayStyle.js +1 -2
  180. package/dist/seasonal/seasons.js +1 -2
  181. package/dist/seasonal/useSeasonalEffects.js +1 -2
  182. package/dist/seasonal/useStoredToggle.js +1 -2
  183. package/dist/tailwind/index.js +1 -2
  184. package/dist/tokens/apply.js +1 -2
  185. package/dist/tokens/radius.js +1 -2
  186. package/dist/vendor/tailwindcss/lib/public/create-plugin.js +1 -2
  187. package/dist/vendor/tailwindcss/lib/util/createPlugin.js +1 -2
  188. package/dist/vendor/tailwindcss/plugin.js +1 -2
  189. package/package.json +2 -2
@@ -1,30 +1,30 @@
1
- import { cn as e } from "../../../helpers/tailwind.helper.js";
2
- import { Card as t, CardContent as n, CardHeader as r } from "../../ui/card.js";
3
- import { useKrosoftTranslation as i } from "../../../i18n/useKrosoftTranslation.js";
4
- import { Button as a } from "../../ui/button.js";
5
- import { Checkbox as o } from "../../ui/checkbox.js";
6
- import { Form as s, FormControl as c, FormField as l, FormItem as u, FormLabel as d, FormMessage as f } from "../../ui/form.js";
7
- import { Input as p } from "../../ui/input.js";
8
- import { Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v } from "../../ui/select.js";
9
- import { Textarea as y } from "../../ui/textarea.js";
10
- import { useToast as b } from "../../../hooks/ui/useToast.js";
11
- import { ImageInput as x } from "../inputs/ImageInput.js";
12
- import { AppSubTitle as S } from "../layouts/AppSubTitle.js";
13
- import { MultiSelect as C } from "../inputs/MultiSelect.js";
14
- import { useEffect as ee, useRef as w, useState as T } from "react";
15
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
16
- import { useForm as O } from "react-hook-form";
17
- import { zodResolver as k } from "@hookform/resolvers/zod";
18
- import { z as A } from "zod";
19
- //#region src/components/core/forms/GenericForm.tsx
20
- var j = (e) => {
1
+ import { useKrosoftTranslation as e } from "../../../i18n/useKrosoftTranslation.js";
2
+ import { ImageInput as t } from "../inputs/ImageInput.js";
3
+ import { AppSubTitle as n } from "../layouts/AppSubTitle.js";
4
+ import { MultiSelect as r } from "../inputs/MultiSelect.js";
5
+ import { Button as i } from "../../ui/button.js";
6
+ import { Card as a, CardContent as o, CardHeader as s } from "../../ui/card.js";
7
+ import { Checkbox as c } from "../../ui/checkbox.js";
8
+ import { Form as l, FormControl as u, FormField as d, FormItem as f, FormLabel as p, FormMessage as m } from "../../ui/form.js";
9
+ import { Input as h } from "../../ui/input.js";
10
+ import { Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b } from "../../ui/select.js";
11
+ import { Textarea as x } from "../../ui/textarea.js";
12
+ import { cn as S } from "../../../helpers/tailwind.helper.js";
13
+ import { useToast as C } from "../../../hooks/ui/useToast.js";
14
+ import { useEffect as w, useRef as T, useState as E } from "react";
15
+ import { jsx as D, jsxs as O } from "react/jsx-runtime";
16
+ import { useForm as k } from "react-hook-form";
17
+ import { zodResolver as A } from "@hookform/resolvers/zod";
18
+ import { z as j } from "zod";
19
+ // src/components/core/forms/GenericForm.tsx
20
+ var ee = (e) => {
21
21
  let t = {};
22
22
  return (e?.sections ?? []).forEach((e) => {
23
23
  e.fields.forEach((e) => {
24
- if (e.rules) t[e.key] = e.rules(A);
24
+ if (e.rules) t[e.key] = e.rules(j);
25
25
  else switch (e.type) {
26
26
  case "checkbox":
27
- t[e.key] = A.boolean().nullable().optional();
27
+ t[e.key] = j.boolean().nullable().optional();
28
28
  break;
29
29
  case "html": break;
30
30
  case "text":
@@ -35,10 +35,10 @@ var j = (e) => {
35
35
  case "select":
36
36
  case "multiSelect":
37
37
  case "color":
38
- case "image": t[e.key] = A.string().nullable().optional();
38
+ case "image": t[e.key] = j.string().nullable().optional();
39
39
  }
40
40
  });
41
- }), A.object(t);
41
+ }), j.object(t);
42
42
  }, M = (e, t) => t || Object.fromEntries((e?.sections ?? []).flatMap((e) => e.fields.map((e) => [e.key, e.defaultValue ?? null]))), N = (e, t) => {
43
43
  let n = {};
44
44
  return t && (e?.sections ?? []).forEach((e) => {
@@ -48,11 +48,11 @@ var j = (e) => {
48
48
  });
49
49
  }), n;
50
50
  }, P = ({ schema: P, isLoading: F, error: I, onSubmit: L, onCancel: R, initialData: z, disabled: B = !1, renderActions: V = !0, id: H, defaultCols: U = 4 }) => {
51
- let { t: W } = i(), { toast: G } = b(), [K, q] = T(!1), [J, Y] = T(() => N(P, z)), X = O({
52
- resolver: k(j(P)),
51
+ let { t: W } = e(), { toast: G } = C(), [K, q] = E(!1), [J, Y] = E(() => N(P, z)), X = k({
52
+ resolver: A(ee(P)),
53
53
  defaultValues: M(P, z)
54
- }), Z = w(!!P);
55
- ee(() => {
54
+ }), Z = T(!!P);
55
+ w(() => {
56
56
  P && !Z.current && (Z.current = !0, X.reset(M(P, z)), Y(N(P, z)));
57
57
  }, [
58
58
  X,
@@ -101,92 +101,92 @@ var j = (e) => {
101
101
  return n.typeName === "ZodNullable" ? !0 : n.innerType ? t(n.innerType) : n.type ? t(n.type) : !1;
102
102
  };
103
103
  try {
104
- return t(e(A));
104
+ return t(e(j));
105
105
  } catch {
106
106
  return !1;
107
107
  }
108
108
  }, re = (e) => {
109
109
  if (!e) return !1;
110
- let t = e(A);
110
+ let t = e(j);
111
111
  return t.safeParse(void 0).success ? !1 : t._def.checks?.some((e) => e.kind === "min") ?? !1;
112
- }, ie = (t, n) => {
113
- let r = !!X.formState.errors[t.key], i = B;
114
- switch (t.type) {
112
+ }, ie = (e, n) => {
113
+ let i = !!X.formState.errors[e.key], a = B;
114
+ switch (e.type) {
115
115
  case "text":
116
- case "color": return /* @__PURE__ */ E(p, {
117
- type: t.type,
116
+ case "color": return /* @__PURE__ */ D(h, {
117
+ type: e.type,
118
118
  ...n,
119
- placeholder: t.placeholderKey ? W(t.placeholderKey) : "",
120
- className: e(r && "border-destructive"),
121
- disabled: i,
119
+ placeholder: e.placeholderKey ? W(e.placeholderKey) : "",
120
+ className: S(i && "border-destructive"),
121
+ disabled: a,
122
122
  value: n.value ?? ""
123
123
  });
124
124
  case "image": {
125
- let a = t, o = t.key, s = typeof n.value == "string" ? n.value : void 0, c = a.value === void 0 ? s ?? J[o] : a.value;
126
- return /* @__PURE__ */ E(x, {
125
+ let r = e, o = e.key, s = typeof n.value == "string" ? n.value : void 0, c = r.value === void 0 ? s ?? J[o] : r.value;
126
+ return /* @__PURE__ */ D(t, {
127
127
  value: c ?? "",
128
128
  onChange: (e) => {
129
- if (a.onChange && a.onChange(e), n.onChange(e), e) {
129
+ if (r.onChange && r.onChange(e), n.onChange(e), e) {
130
130
  let t = new FileReader();
131
131
  t.onloadend = () => {
132
132
  $(o, t.result);
133
133
  }, t.readAsDataURL(e);
134
134
  } else $(o, "");
135
135
  },
136
- accept: a.accept,
137
- maxSizeMB: a.maxSizeMB,
138
- hint: a.hint,
139
- disabled: i,
140
- className: e(r && "border-destructive")
136
+ accept: r.accept,
137
+ maxSizeMB: r.maxSizeMB,
138
+ hint: r.hint,
139
+ disabled: a,
140
+ className: S(i && "border-destructive")
141
141
  });
142
142
  }
143
- case "date": return /* @__PURE__ */ E(p, {
143
+ case "date": return /* @__PURE__ */ D(h, {
144
144
  type: "date",
145
145
  ...n,
146
- className: e(r && "border-destructive"),
147
- disabled: i,
146
+ className: S(i && "border-destructive"),
147
+ disabled: a,
148
148
  value: n.value ?? ""
149
149
  });
150
- case "time": return /* @__PURE__ */ E(p, {
150
+ case "time": return /* @__PURE__ */ D(h, {
151
151
  type: "time",
152
152
  ...n,
153
- className: e(r && "border-destructive"),
154
- disabled: i,
153
+ className: S(i && "border-destructive"),
154
+ disabled: a,
155
155
  value: n.value ?? ""
156
156
  });
157
- case "checkbox": return /* @__PURE__ */ D("div", {
157
+ case "checkbox": return /* @__PURE__ */ O("div", {
158
158
  className: "flex items-center space-x-2",
159
- children: [/* @__PURE__ */ E(o, {
160
- id: t.key,
159
+ children: [/* @__PURE__ */ D(c, {
160
+ id: e.key,
161
161
  checked: n.value === !0,
162
162
  onCheckedChange: (e) => {
163
163
  n.onChange(e);
164
164
  },
165
- disabled: i,
166
- className: e(r && "border-destructive")
167
- }), /* @__PURE__ */ E("label", {
168
- htmlFor: t.key,
165
+ disabled: a,
166
+ className: S(i && "border-destructive")
167
+ }), /* @__PURE__ */ D("label", {
168
+ htmlFor: e.key,
169
169
  className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
170
- children: W(t.labelKey)
170
+ children: W(e.labelKey)
171
171
  })]
172
- }, t.key);
173
- case "textarea": return /* @__PURE__ */ E(y, {
172
+ }, e.key);
173
+ case "textarea": return /* @__PURE__ */ D(x, {
174
174
  ...n,
175
- placeholder: t.placeholderKey ? W(t.placeholderKey) : "",
176
- className: e(r && "border-destructive", "min-h-[100px]"),
177
- disabled: i,
175
+ placeholder: e.placeholderKey ? W(e.placeholderKey) : "",
176
+ className: S(i && "border-destructive", "min-h-[100px]"),
177
+ disabled: a,
178
178
  value: n.value ?? ""
179
179
  });
180
180
  case "number": {
181
- let a = t;
182
- return /* @__PURE__ */ E(p, {
181
+ let t = e;
182
+ return /* @__PURE__ */ D(h, {
183
183
  type: "number",
184
184
  ...n,
185
- step: a.step,
186
- min: a.min,
187
- placeholder: t.placeholderKey ? W(t.placeholderKey) : "",
188
- className: e(r && "border-destructive"),
189
- disabled: i,
185
+ step: t.step,
186
+ min: t.min,
187
+ placeholder: e.placeholderKey ? W(e.placeholderKey) : "",
188
+ className: S(i && "border-destructive"),
189
+ disabled: a,
190
190
  value: n.value ?? "",
191
191
  onChange: (e) => {
192
192
  let t = e.target.value === "" ? "" : Number(e.target.value);
@@ -195,31 +195,31 @@ var j = (e) => {
195
195
  });
196
196
  }
197
197
  case "select": {
198
- let a = t, o = ne(t.rules), s = n.value === null || n.value === void 0 ? "" : n.value, l = a.options, u = l.find((e) => e.value === s);
199
- return /* @__PURE__ */ D(m, {
200
- value: s,
198
+ let t = e, r = ne(e.rules), o = n.value === null || n.value === void 0 ? "" : n.value, s = t.options, c = s.find((e) => e.value === o);
199
+ return /* @__PURE__ */ O(g, {
200
+ value: o,
201
201
  onValueChange: n.onChange,
202
- disabled: i,
203
- children: [/* @__PURE__ */ E(c, { children: /* @__PURE__ */ E(_, {
204
- className: e(r && "border-destructive"),
205
- onClear: o && s ? (e) => {
202
+ disabled: a,
203
+ children: [/* @__PURE__ */ D(u, { children: /* @__PURE__ */ D(y, {
204
+ className: S(i && "border-destructive"),
205
+ onClear: r && o ? (e) => {
206
206
  e.preventDefault(), e.stopPropagation(), n.onChange(null);
207
207
  } : void 0,
208
- children: /* @__PURE__ */ E(v, {
209
- placeholder: t.placeholderKey ? W(t.placeholderKey) : "",
210
- children: u ? /* @__PURE__ */ D("div", {
208
+ children: /* @__PURE__ */ D(b, {
209
+ placeholder: e.placeholderKey ? W(e.placeholderKey) : "",
210
+ children: c ? /* @__PURE__ */ O("div", {
211
211
  className: "flex items-center gap-2",
212
- children: [u.color && /* @__PURE__ */ E("div", {
212
+ children: [c.color && /* @__PURE__ */ D("div", {
213
213
  className: "w-4 h-4 rounded-full",
214
- style: { backgroundColor: u.color }
215
- }), u.label]
214
+ style: { backgroundColor: c.color }
215
+ }), c.label]
216
216
  }) : void 0
217
217
  })
218
- }) }), /* @__PURE__ */ E(h, { children: l.map((e, t) => /* @__PURE__ */ E(g, {
218
+ }) }), /* @__PURE__ */ D(_, { children: s.map((e, t) => /* @__PURE__ */ D(v, {
219
219
  value: e.value,
220
- children: /* @__PURE__ */ D("div", {
220
+ children: /* @__PURE__ */ O("div", {
221
221
  className: "flex items-center gap-2",
222
- children: [e.color && /* @__PURE__ */ E("div", {
222
+ children: [e.color && /* @__PURE__ */ D("div", {
223
223
  className: "w-4 h-4 rounded-full",
224
224
  style: { backgroundColor: e.color }
225
225
  }), e.label]
@@ -228,12 +228,12 @@ var j = (e) => {
228
228
  });
229
229
  }
230
230
  case "multiSelect": {
231
- let e = t, r = n.value ?? [];
232
- return /* @__PURE__ */ E(C, {
233
- options: e.options,
234
- selected: r,
231
+ let t = e, i = n.value ?? [];
232
+ return /* @__PURE__ */ D(r, {
233
+ options: t.options,
234
+ selected: i,
235
235
  onToggle: (e) => {
236
- let t = r.includes(e) ? r.filter((t) => t !== e) : [...r, e];
236
+ let t = i.includes(e) ? i.filter((t) => t !== e) : [...i, e];
237
237
  n.onChange(t);
238
238
  },
239
239
  onClear: () => {
@@ -242,63 +242,63 @@ var j = (e) => {
242
242
  onSelectAll: (e) => {
243
243
  n.onChange(e);
244
244
  },
245
- placeholder: t.placeholderKey ? W(t.placeholderKey) : "",
246
- disabled: i
245
+ placeholder: e.placeholderKey ? W(e.placeholderKey) : "",
246
+ disabled: a
247
247
  });
248
248
  }
249
- case "html": return t.render(X.getValues(), t);
249
+ case "html": return e.render(X.getValues(), e);
250
250
  default: return null;
251
251
  }
252
- }, ae = (i, a) => {
253
- let o = /* @__PURE__ */ E("div", {
254
- className: e("grid grid-cols-4 gap-4"),
255
- children: i.fields.map((t) => /* @__PURE__ */ E(l, {
252
+ }, ae = (e, t) => {
253
+ let r = /* @__PURE__ */ D("div", {
254
+ className: S("grid grid-cols-4 gap-4"),
255
+ children: e.fields.map((e) => /* @__PURE__ */ D(d, {
256
256
  control: X.control,
257
- name: t.key,
258
- render: ({ field: n }) => /* @__PURE__ */ D(u, {
259
- className: e(Q(t.layout?.cols ?? U)),
257
+ name: e.key,
258
+ render: ({ field: t }) => /* @__PURE__ */ O(f, {
259
+ className: S(Q(e.layout?.cols ?? U)),
260
260
  children: [
261
- t.type !== "checkbox" && t.type !== "html" && /* @__PURE__ */ D(d, { children: [W(t.labelKey), re(t.rules) && /* @__PURE__ */ E("span", {
261
+ e.type !== "checkbox" && e.type !== "html" && /* @__PURE__ */ O(p, { children: [W(e.labelKey), re(e.rules) && /* @__PURE__ */ D("span", {
262
262
  className: "text-destructive ml-1",
263
263
  children: "*"
264
264
  })] }),
265
- /* @__PURE__ */ E(c, { children: ie(t, n) }),
266
- /* @__PURE__ */ E(f, {})
265
+ /* @__PURE__ */ D(u, { children: ie(e, t) }),
266
+ /* @__PURE__ */ D(m, {})
267
267
  ]
268
268
  })
269
- }, t.key))
269
+ }, e.key))
270
270
  });
271
- return P?.useCards === !1 ? /* @__PURE__ */ D("div", {
271
+ return P?.useCards === !1 ? /* @__PURE__ */ O("div", {
272
272
  className: "space-y-4 mb-6",
273
- children: [i.titleKey && /* @__PURE__ */ E(S, { titleKey: i.titleKey }), o]
274
- }, a) : /* @__PURE__ */ D(t, {
273
+ children: [e.titleKey && /* @__PURE__ */ D(n, { titleKey: e.titleKey }), r]
274
+ }, t) : /* @__PURE__ */ O(a, {
275
275
  className: "mb-6",
276
- children: [i.titleKey && /* @__PURE__ */ E(r, { children: /* @__PURE__ */ E(S, { titleKey: i.titleKey }) }), /* @__PURE__ */ E(n, { children: o })]
277
- }, a);
276
+ children: [e.titleKey && /* @__PURE__ */ D(s, { children: /* @__PURE__ */ D(n, { titleKey: e.titleKey }) }), /* @__PURE__ */ D(o, { children: r })]
277
+ }, t);
278
278
  };
279
- return P ? /* @__PURE__ */ E(s, {
279
+ return P ? /* @__PURE__ */ D(l, {
280
280
  ...X,
281
- children: /* @__PURE__ */ D("form", {
281
+ children: /* @__PURE__ */ O("form", {
282
282
  id: H,
283
283
  onSubmit: (e) => {
284
284
  X.handleSubmit(te)(e);
285
285
  },
286
286
  className: "space-y-4 px-0 w-full",
287
- children: [/* @__PURE__ */ D("div", {
287
+ children: [/* @__PURE__ */ O("div", {
288
288
  className: "space-y-4",
289
- children: [P.sections.map((e, t) => ae(e, t)), I && /* @__PURE__ */ E("div", {
289
+ children: [P.sections.map((e, t) => ae(e, t)), I && /* @__PURE__ */ D("div", {
290
290
  className: "text-sm font-medium text-destructive",
291
291
  children: I.message
292
292
  })]
293
- }), !B && V && /* @__PURE__ */ D("div", {
293
+ }), !B && V && /* @__PURE__ */ O("div", {
294
294
  className: "flex justify-end gap-3 mt-6 border-t pt-4",
295
- children: [R && /* @__PURE__ */ E(a, {
295
+ children: [R && /* @__PURE__ */ D(i, {
296
296
  type: "button",
297
297
  variant: "outline",
298
298
  onClick: R,
299
299
  disabled: K || F,
300
300
  children: W("actions.cancel")
301
- }), /* @__PURE__ */ E(a, {
301
+ }), /* @__PURE__ */ D(i, {
302
302
  variant: "default",
303
303
  type: "submit",
304
304
  disabled: K || (F ?? !1) || X.formState.isSubmitting,
@@ -308,5 +308,4 @@ var j = (e) => {
308
308
  })
309
309
  }) : null;
310
310
  };
311
- //#endregion
312
311
  export { P as GenericForm };
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- //#region src/components/core/icons/FlagFrIcon.tsx
2
+ // src/components/core/icons/FlagFrIcon.tsx
3
3
  var n = ({ className: n }) => /* @__PURE__ */ t("svg", {
4
4
  viewBox: "0 0 640 480",
5
5
  preserveAspectRatio: "xMidYMid slice",
@@ -24,5 +24,4 @@ var n = ({ className: n }) => /* @__PURE__ */ t("svg", {
24
24
  })
25
25
  ]
26
26
  });
27
- //#endregion
28
27
  export { n as FlagFrIcon };
@@ -1,6 +1,6 @@
1
1
  import { useId as e } from "react";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region src/components/core/icons/FlagGbIcon.tsx
3
+ // src/components/core/icons/FlagGbIcon.tsx
4
4
  var r = ({ className: r }) => {
5
5
  let i = e().replace(/:/g, ""), a = `flag-gb-field-${i}`, o = `flag-gb-saltire-${i}`;
6
6
  return /* @__PURE__ */ n("svg", {
@@ -50,5 +50,4 @@ var r = ({ className: r }) => {
50
50
  ]
51
51
  });
52
52
  };
53
- //#endregion
54
53
  export { r as FlagGbIcon };
@@ -1,14 +1,14 @@
1
- import { cn as e } from "../../../helpers/tailwind.helper.js";
2
- import { useDateFnsLocale as t } from "../../../i18n/useDateFnsLocale.js";
3
- import { Button as n } from "../../ui/button.js";
4
- import { Calendar as r } from "../../ui/calendar.js";
1
+ import { Button as e } from "../../ui/button.js";
2
+ import { Calendar as t } from "../../ui/calendar.js";
3
+ import { useDateFnsLocale as n } from "../../../i18n/useDateFnsLocale.js";
4
+ import { cn as r } from "../../../helpers/tailwind.helper.js";
5
5
  import { useEffect as i, useRef as a, useState as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  import { CalendarIcon as l } from "lucide-react";
8
8
  import { format as u } from "date-fns";
9
- //#region src/components/core/inputs/DatePicker.tsx
9
+ // src/components/core/inputs/DatePicker.tsx
10
10
  var d = ({ date: d, onDateChange: f, placeholder: p }) => {
11
- let m = t(), [h, g] = o(!1), _ = a(null);
11
+ let m = n(), [h, g] = o(!1), _ = a(null);
12
12
  return i(() => {
13
13
  if (!h) return;
14
14
  let e = (e) => {
@@ -20,17 +20,17 @@ var d = ({ date: d, onDateChange: f, placeholder: p }) => {
20
20
  }, [h]), /* @__PURE__ */ c("div", {
21
21
  ref: _,
22
22
  className: "relative w-full",
23
- children: [/* @__PURE__ */ c(n, {
23
+ children: [/* @__PURE__ */ c(e, {
24
24
  variant: "outline",
25
25
  type: "button",
26
26
  onClick: () => {
27
27
  g((e) => !e);
28
28
  },
29
- className: e("w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", h && "ring-2 ring-ring ring-offset-2", d === void 0 && "text-muted-foreground"),
29
+ className: r("w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", h && "ring-2 ring-ring ring-offset-2", d === void 0 && "text-muted-foreground"),
30
30
  children: [/* @__PURE__ */ s(l, { className: "mr-2 size-4 shrink-0" }), d === void 0 ? /* @__PURE__ */ s("span", { children: p }) : u(d, "dd/MM/yyyy", { locale: m })]
31
31
  }), h ? /* @__PURE__ */ s("div", {
32
32
  className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",
33
- children: /* @__PURE__ */ s(r, {
33
+ children: /* @__PURE__ */ s(t, {
34
34
  mode: "single",
35
35
  locale: m,
36
36
  defaultMonth: d,
@@ -42,5 +42,4 @@ var d = ({ date: d, onDateChange: f, placeholder: p }) => {
42
42
  }) : null]
43
43
  });
44
44
  };
45
- //#endregion
46
45
  export { d as DatePicker };
@@ -1,36 +1,36 @@
1
- import { cn as e } from "../../../helpers/tailwind.helper.js";
2
- import { useDateFnsLocale as t } from "../../../i18n/useDateFnsLocale.js";
3
- import { useKrosoftTranslation as n } from "../../../i18n/useKrosoftTranslation.js";
4
- import { Button as r } from "../../ui/button.js";
5
- import { Calendar as i } from "../../ui/calendar.js";
6
- import { Popover as a, PopoverContent as o, PopoverTrigger as s } from "../../ui/popover.js";
1
+ import { useDateFnsLocale as e } from "../../../i18n/useDateFnsLocale.js";
2
+ import { useKrosoftTranslation as t } from "../../../i18n/useKrosoftTranslation.js";
3
+ import { Button as n } from "../../ui/button.js";
4
+ import { Calendar as r } from "../../ui/calendar.js";
5
+ import { Popover as i, PopoverContent as a, PopoverTrigger as o } from "../../ui/popover.js";
6
+ import { cn as s } from "../../../helpers/tailwind.helper.js";
7
7
  import * as c from "react";
8
8
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
9
  import { CalendarIcon as d, XIcon as f } from "lucide-react";
10
10
  import { format as p } from "date-fns";
11
- //#region src/components/core/inputs/DateRangePicker.tsx
11
+ // src/components/core/inputs/DateRangePicker.tsx
12
12
  var m = (e) => e ? {
13
13
  from: e.from,
14
14
  to: e.to
15
15
  } : void 0, h = ({ value: h, onChange: g, placeholder: _, className: v }) => {
16
- let { t: y } = n(), b = t(), [x, S] = c.useState(!1), [C, w] = c.useState(m(h));
16
+ let { t: y } = t(), b = e(), [x, S] = c.useState(!1), [C, w] = c.useState(m(h));
17
17
  return c.useEffect(() => {
18
18
  x && w(m(h));
19
19
  }, [x, h]), /* @__PURE__ */ l("div", {
20
- className: e("grid gap-2", v),
21
- children: /* @__PURE__ */ u(a, {
20
+ className: s("grid gap-2", v),
21
+ children: /* @__PURE__ */ u(i, {
22
22
  open: x,
23
23
  onOpenChange: S,
24
- children: [/* @__PURE__ */ l(s, {
24
+ children: [/* @__PURE__ */ l(o, {
25
25
  asChild: !0,
26
- children: /* @__PURE__ */ u(r, {
26
+ children: /* @__PURE__ */ u(n, {
27
27
  id: "date",
28
28
  variant: "outline",
29
- className: e("w-[300px] justify-start text-left font-normal", !h?.from && "text-muted-foreground"),
29
+ className: s("w-[300px] justify-start text-left font-normal", !h?.from && "text-muted-foreground"),
30
30
  children: [
31
31
  /* @__PURE__ */ l(d, { className: "mr-2 size-4" }),
32
32
  ((e) => e?.from ? !e.to || e.from.getTime() === e.to.getTime() ? p(e.from, "dd MMM yyyy", { locale: b }) : `${p(e.from, "dd MMM yyyy", { locale: b })} - ${p(e.to, "dd MMM yyyy", { locale: b })}` : _ ?? y("date.pickPeriod"))(h),
33
- h?.from && /* @__PURE__ */ l(r, {
33
+ h?.from && /* @__PURE__ */ l(n, {
34
34
  type: "button",
35
35
  variant: "ghost",
36
36
  size: "icon",
@@ -43,12 +43,12 @@ var m = (e) => e ? {
43
43
  })
44
44
  ]
45
45
  })
46
- }), /* @__PURE__ */ u(o, {
46
+ }), /* @__PURE__ */ u(a, {
47
47
  className: "w-auto p-0",
48
48
  align: "start",
49
49
  side: "bottom",
50
50
  sideOffset: 4,
51
- children: [/* @__PURE__ */ l(i, {
51
+ children: [/* @__PURE__ */ l(r, {
52
52
  mode: "range",
53
53
  resetOnSelect: !0,
54
54
  defaultMonth: C?.from,
@@ -59,7 +59,7 @@ var m = (e) => e ? {
59
59
  className: "pointer-events-auto p-3"
60
60
  }), /* @__PURE__ */ u("div", {
61
61
  className: "flex items-center justify-between border-t border-border px-3 py-2",
62
- children: [/* @__PURE__ */ l(r, {
62
+ children: [/* @__PURE__ */ l(n, {
63
63
  variant: "ghost",
64
64
  size: "sm",
65
65
  onClick: () => {
@@ -68,14 +68,14 @@ var m = (e) => e ? {
68
68
  children: y("actions.clear")
69
69
  }), /* @__PURE__ */ u("div", {
70
70
  className: "flex gap-2",
71
- children: [/* @__PURE__ */ l(r, {
71
+ children: [/* @__PURE__ */ l(n, {
72
72
  variant: "ghost",
73
73
  size: "sm",
74
74
  onClick: () => {
75
75
  w(m(h)), S(!1);
76
76
  },
77
77
  children: y("actions.cancel")
78
- }), /* @__PURE__ */ l(r, {
78
+ }), /* @__PURE__ */ l(n, {
79
79
  size: "sm",
80
80
  onClick: () => {
81
81
  g(C), S(!1);
@@ -88,5 +88,4 @@ var m = (e) => e ? {
88
88
  })
89
89
  });
90
90
  };
91
- //#endregion
92
91
  export { h as DateRangePicker };
@@ -3,7 +3,7 @@ import { useKrosoftTranslation as t } from "../../../i18n/useKrosoftTranslation.
3
3
  import { useRef as n, useState as r } from "react";
4
4
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
5
  import { Loader2 as s, UploadIcon as c } from "lucide-react";
6
- //#region src/components/core/inputs/FileDropzone.tsx
6
+ // src/components/core/inputs/FileDropzone.tsx
7
7
  var l = ({ onFiles: l, accept: u, multiple: d = !0, title: f, hint: p, formats: m, uploading: h = !1, uploadingLabel: g, icon: _ = c, className: v }) => {
8
8
  let { t: y } = t(), b = n(null), [x, S] = r(!1), C = (e) => {
9
9
  let t = Array.from(e ?? []);
@@ -29,7 +29,7 @@ var l = ({ onFiles: l, accept: u, multiple: d = !0, title: f, hint: p, formats:
29
29
  S(!1);
30
30
  },
31
31
  onDrop: (e) => {
32
- e.preventDefault(), e.stopPropagation(), S(!1), !h && C(e.dataTransfer.files);
32
+ e.preventDefault(), e.stopPropagation(), S(!1), h || C(e.dataTransfer.files);
33
33
  },
34
34
  className: e("group flex min-h-52 w-full flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed p-8 text-center transition-colors", h ? "pointer-events-none border-border bg-muted/30 opacity-50" : x ? "border-primary/50 bg-primary/[0.06]" : "border-border bg-muted/30 hover:border-primary/40 hover:bg-primary/[0.03]", v),
35
35
  children: h ? /* @__PURE__ */ o("span", {
@@ -64,5 +64,4 @@ var l = ({ onFiles: l, accept: u, multiple: d = !0, title: f, hint: p, formats:
64
64
  })] })
65
65
  })] });
66
66
  };
67
- //#endregion
68
67
  export { l as FileDropzone };
@@ -1,13 +1,13 @@
1
- import { cn as e } from "../../../helpers/tailwind.helper.js";
2
- import { useKrosoftTranslation as t } from "../../../i18n/useKrosoftTranslation.js";
3
- import { Button as n } from "../../ui/button.js";
4
- import { useNotifications as r } from "../../../hooks/ui/useNotifications.js";
1
+ import { useKrosoftTranslation as e } from "../../../i18n/useKrosoftTranslation.js";
2
+ import { Button as t } from "../../ui/button.js";
3
+ import { useNotifications as n } from "../../../hooks/ui/useNotifications.js";
4
+ import { cn as r } from "../../../helpers/tailwind.helper.js";
5
5
  import { forwardRef as i, useRef as a, useState as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  import { ImageIcon as l, UploadIcon as u, XIcon as d } from "lucide-react";
8
- //#region src/components/core/inputs/ImageInput.tsx
8
+ // src/components/core/inputs/ImageInput.tsx
9
9
  var f = i(({ value: i, onChange: f, accept: p = "image/jpeg,image/png,image/webp", maxSizeMB: m = 2, disabled: h = !1, className: g = "", hint: _ = "JPG, PNG, WEBP" }, v) => {
10
- let { t: y } = t(), { showError: b } = r(), x = a(null), [S, C] = o(!1), w = (e) => {
10
+ let { t: y } = e(), { showError: b } = n(), x = a(null), [S, C] = o(!1), w = (e) => {
11
11
  p.split(",").map((e) => e.trim()).includes(e.type) ? e.size > m * 1024 * 1024 ? b(y("states.errorTitle"), y("image.tooLarge", { size: m })) : f(e) : b(y("states.errorTitle"), y("image.invalidType", { types: _ }));
12
12
  };
13
13
  return /* @__PURE__ */ s("div", {
@@ -19,7 +19,7 @@ var f = i(({ value: i, onChange: f, accept: p = "image/jpeg,image/png,image/webp
19
19
  src: i,
20
20
  alt: "Preview",
21
21
  className: "w-full h-full object-cover"
22
- }), !h && /* @__PURE__ */ s(n, {
22
+ }), !h && /* @__PURE__ */ s(t, {
23
23
  type: "button",
24
24
  variant: "destructive",
25
25
  size: "sm",
@@ -30,7 +30,7 @@ var f = i(({ value: i, onChange: f, accept: p = "image/jpeg,image/png,image/webp
30
30
  children: /* @__PURE__ */ s(d, { className: "h-4 w-4" })
31
31
  })]
32
32
  }) : h ? /* @__PURE__ */ c("div", {
33
- className: e("flex flex-col items-center justify-center w-full h-32", "border-2 border-dashed border-border rounded-surface", "bg-muted/30"),
33
+ className: r("flex flex-col items-center justify-center w-full h-32", "border-2 border-dashed border-border rounded-surface", "bg-muted/30"),
34
34
  children: [/* @__PURE__ */ s(l, { className: "h-8 w-8 text-muted-foreground/50 mb-2" }), /* @__PURE__ */ s("span", {
35
35
  className: "text-sm text-muted-foreground/50",
36
36
  children: y("image.empty")
@@ -48,7 +48,7 @@ var f = i(({ value: i, onChange: f, accept: p = "image/jpeg,image/png,image/webp
48
48
  let t = e.dataTransfer.files?.[0];
49
49
  t && w(t);
50
50
  },
51
- className: e("flex flex-col items-center justify-center w-full h-32", "border-2 border-dashed rounded-surface", "cursor-pointer hover:bg-muted/50 transition-colors", S ? "border-primary bg-primary/10" : "border-border"),
51
+ className: r("flex flex-col items-center justify-center w-full h-32", "border-2 border-dashed rounded-surface", "cursor-pointer hover:bg-muted/50 transition-colors", S ? "border-primary bg-primary/10" : "border-border"),
52
52
  children: [
53
53
  /* @__PURE__ */ s(u, { className: "h-8 w-8 text-muted-foreground mb-2" }),
54
54
  /* @__PURE__ */ s("span", {
@@ -79,5 +79,4 @@ var f = i(({ value: i, onChange: f, accept: p = "image/jpeg,image/png,image/webp
79
79
  });
80
80
  });
81
81
  f.displayName = "ImageInput";
82
- //#endregion
83
82
  export { f as ImageInput };