@krosoft/react 0.0.260 → 0.0.262
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/AppActions-D8KKXpq-.js +60 -0
- package/dist/{AppSubTitle-C8zoMJo_.js → AppSubTitle-CVhjWRBp.js} +7 -7
- package/dist/{AppTitle-BR4JFZfp.js → AppTitle-DBGJRsjU.js} +6 -6
- package/dist/{ErrorAlert-DClCk3Ey.js → ErrorAlert-6ECy_Dox.js} +5 -5
- package/dist/{GenericForm-JqObtUCQ.js → GenericForm-C86_Jk7X.js} +104 -105
- package/dist/{ImageInput-BLIo5LYH.js → ImageInput-DvHgBYsy.js} +5 -5
- package/dist/{MultiSelect-B0Ke0cfS.js → MultiSelect-TGu_k3KM.js} +7 -7
- package/dist/{SearchInput-CXZd2rSc.js → SearchInput-Csflv8Az.js} +31 -31
- package/dist/{behavior-DDtrNBAq.js → behavior-C4WdfbR1.js} +1 -1
- package/dist/{cards-Ct4wFYa8.js → cards-nqZOcSkh.js} +42 -42
- package/dist/{charts-CwT9AFWj.js → charts-BfeSrTmX.js} +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/index.js +3 -3
- package/dist/components/core/filters/ActiveFilters.d.ts +2 -2
- package/dist/components/core/filters/ActiveFilters.d.ts.map +1 -1
- package/dist/components/core/filters/SearchableFilterPill.d.ts +2 -2
- package/dist/components/core/filters/SearchableFilterPill.d.ts.map +1 -1
- package/dist/components/core/filters/TableFilter.d.ts.map +1 -1
- package/dist/components/core/filters/index.js +127 -127
- package/dist/components/core/forms/GenericForm.d.ts.map +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +21 -21
- package/dist/components/core/inputs/index.js +4 -4
- package/dist/components/core/language/index.js +1 -1
- package/dist/components/core/layouts/index.js +26 -26
- package/dist/components/core/navbar/NotificationsBell.d.ts +8 -2
- package/dist/components/core/navbar/NotificationsBell.d.ts.map +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/DataTable.d.ts +4 -26
- package/dist/components/core/table/DataTable.d.ts.map +1 -1
- package/dist/components/core/table/TableActions.d.ts +2 -2
- package/dist/components/core/table/TableActions.d.ts.map +1 -1
- package/dist/components/core/table/TableBody.d.ts +7 -8
- package/dist/components/core/table/TableBody.d.ts.map +1 -1
- package/dist/components/core/table/TableBulkActions.d.ts +2 -2
- package/dist/components/core/table/TableBulkActions.d.ts.map +1 -1
- package/dist/components/core/table/TableHeader.d.ts +2 -2
- package/dist/components/core/table/TableHeader.d.ts.map +1 -1
- package/dist/components/core/table/TablePagination.d.ts.map +1 -1
- package/dist/components/core/table/TableSettings.d.ts +2 -2
- package/dist/components/core/table/TableSettings.d.ts.map +1 -1
- package/dist/components/core/table/index.d.ts +0 -2
- package/dist/components/core/table/index.d.ts.map +1 -1
- package/dist/components/core/table/index.js +2 -2
- package/dist/components/core/tabs/AppVerticalTabs.d.ts.map +1 -1
- package/dist/components/core/tabs/index.js +39 -40
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +21 -21
- package/dist/components/ui/command.d.ts +13 -13
- package/dist/components/ui/index.js +2 -2
- package/dist/constants/datatable.d.ts +1 -1
- package/dist/dialogs-BiPcEbRx.js +207 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +37 -1
- package/dist/helpers/table.helper.d.ts +31 -0
- package/dist/helpers/table.helper.d.ts.map +1 -0
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +6 -6
- package/dist/hooks/ui/index.js +5 -5
- package/dist/hooks/ui/useDataTable.d.ts +1 -1
- package/dist/hooks/ui/useDataTable.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/krosoftLocales.d.ts +22 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -1
- package/dist/i18n/useKrosoftTranslation.d.ts +9 -6
- package/dist/i18n/useKrosoftTranslation.d.ts.map +1 -1
- package/dist/{i18n-DW5zKBEK.js → i18n-CevI9Cgk.js} +35 -13
- package/dist/{inputs-CNDApo_M.js → inputs-BUXmTc40.js} +3 -3
- package/dist/{language-CK_kDejF.js → language-DeQC57bX.js} +9 -9
- package/dist/{navbar-UsCqs4DK.js → navbar-Cl4welok.js} +75 -62
- package/dist/pwa/index.js +4 -4
- package/dist/{sheet-_rrCMue7.js → sheet-RYwa4-Nl.js} +7 -7
- package/dist/{states-BusGNKku.js → states-C6lWnADN.js} +2 -2
- package/dist/table-BWEBIVqj.js +607 -0
- package/dist/{theme-QayeX440.js → theme-Dwc4zNXG.js} +9 -9
- package/dist/types/AppAction.d.ts +1 -1
- package/dist/types/AppAction.d.ts.map +1 -1
- package/dist/types/{BulkAction.d.ts → DataTableBulkAction.d.ts} +3 -3
- package/dist/types/DataTableBulkAction.d.ts.map +1 -0
- package/dist/types/{ColumnDef.d.ts → DataTableColumn.d.ts} +3 -3
- package/dist/types/DataTableColumn.d.ts.map +1 -0
- package/dist/types/DataTableConfig.d.ts +43 -0
- package/dist/types/DataTableConfig.d.ts.map +1 -0
- package/dist/types/DataTableMessages.d.ts +12 -0
- package/dist/types/DataTableMessages.d.ts.map +1 -0
- package/dist/types/{RowAction.d.ts → DataTableRowAction.d.ts} +3 -3
- package/dist/types/DataTableRowAction.d.ts.map +1 -0
- package/dist/types/DataTableServerState.d.ts +20 -0
- package/dist/types/DataTableServerState.d.ts.map +1 -0
- package/dist/types/FilterFieldConfig.d.ts +2 -2
- package/dist/types/FilterFieldConfig.d.ts.map +1 -1
- package/dist/types/FilterSection.d.ts +1 -1
- package/dist/types/FilterSection.d.ts.map +1 -1
- package/dist/types/UseDataTableProps.d.ts +10 -16
- package/dist/types/UseDataTableProps.d.ts.map +1 -1
- package/dist/types/UseDataTableResult.d.ts +3 -3
- package/dist/types/UseDataTableResult.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/{ui-hnbBp9RZ.js → ui-D7YSs2kF.js} +1 -1
- package/dist/{ui-Dg7lq9J8.js → ui-IEH46J4v.js} +4 -4
- package/dist/{useDocumentTitle-D7MywIeB.js → useDocumentTitle-C5TsEDqh.js} +4 -4
- package/dist/{useFixedColumns-DnzqhbfT.js → useFixedColumns-BVZs3wbh.js} +27 -27
- package/dist/{useLanguage-B1dusDJk.js → useLanguage-DdVIzhME.js} +1 -1
- package/dist/{useTheme-D1APOG9I.js → useTheme-ZzPZl0MM.js} +1 -1
- package/package.json +1 -1
- package/dist/AppActions-CcU3ClFS.js +0 -60
- package/dist/components/core/table/columnAlignment.d.ts +0 -13
- package/dist/components/core/table/columnAlignment.d.ts.map +0 -1
- package/dist/components/core/table/fixedColumns.d.ts +0 -19
- package/dist/components/core/table/fixedColumns.d.ts.map +0 -1
- package/dist/dialogs-BDtZIxQa.js +0 -208
- package/dist/table-BSjo9t9_.js +0 -644
- package/dist/types/BulkAction.d.ts.map +0 -1
- package/dist/types/ColumnDef.d.ts.map +0 -1
- package/dist/types/RowAction.d.ts.map +0 -1
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
type InterpolationValues = Record<string, string | number>;
|
|
2
2
|
/**
|
|
3
|
-
* Traduction
|
|
3
|
+
* Traduction unifiée du package : un seul `t`, que la clé vienne de
|
|
4
|
+
* l'application (`headerKey`, `labelKey`, `emptyKey`…) ou du package lui-même.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Résolution, dans l'ordre :
|
|
7
|
+
* 1. le namespace de l'application — une clé qu'elle a enregistrée (ou une
|
|
8
|
+
* surcharge d'un libellé du package) gagne toujours ;
|
|
9
|
+
* 2. le namespace `krosoft`, si l'application a appelé `registerKrosoftLocales` :
|
|
10
|
+
* les libellés du package suivent alors sa langue ;
|
|
11
|
+
* 3. le français embarqué du package ;
|
|
12
|
+
* 4. la clé elle-même — le repli i18next habituel.
|
|
10
13
|
*/
|
|
11
14
|
export declare const useKrosoftTranslation: () => {
|
|
12
15
|
t: (key: string, values?: InterpolationValues) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKrosoftTranslation.d.ts","sourceRoot":"","sources":["../../src/i18n/useKrosoftTranslation.ts"],"names":[],"mappings":"AAIA,KAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAe3D
|
|
1
|
+
{"version":3,"file":"useKrosoftTranslation.d.ts","sourceRoot":"","sources":["../../src/i18n/useKrosoftTranslation.ts"],"names":[],"mappings":"AAIA,KAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAe3D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,QAAO;IAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB,KAAK,MAAM,CAAA;CAqBlG,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { enGB as e, fr as t } from "date-fns/locale";
|
|
2
|
+
import { useTranslation as n } from "react-i18next";
|
|
3
3
|
var r = {
|
|
4
4
|
actions: {
|
|
5
5
|
cancel: "Cancel",
|
|
@@ -35,7 +35,8 @@ var r = {
|
|
|
35
35
|
title: "Notifications",
|
|
36
36
|
empty: "No notifications.",
|
|
37
37
|
markAllAsRead: "Mark all as read",
|
|
38
|
-
remove: "Delete notification"
|
|
38
|
+
remove: "Delete notification",
|
|
39
|
+
seeAll: "See all"
|
|
39
40
|
},
|
|
40
41
|
select: {
|
|
41
42
|
placeholder: "Select...",
|
|
@@ -52,6 +53,12 @@ var r = {
|
|
|
52
53
|
filters: {
|
|
53
54
|
advanced: "Advanced filters",
|
|
54
55
|
more: "More filters",
|
|
56
|
+
active: "Active filters:",
|
|
57
|
+
apply: "Search",
|
|
58
|
+
clear: "Clear filters",
|
|
59
|
+
clearAll: "Clear all",
|
|
60
|
+
selectAll: "Select all",
|
|
61
|
+
deselectAll: "Deselect all",
|
|
55
62
|
yes: "Yes",
|
|
56
63
|
no: "No"
|
|
57
64
|
},
|
|
@@ -68,7 +75,11 @@ var r = {
|
|
|
68
75
|
},
|
|
69
76
|
table: {
|
|
70
77
|
previousPage: "Previous page",
|
|
71
|
-
nextPage: "Next page"
|
|
78
|
+
nextPage: "Next page",
|
|
79
|
+
selectedCount: "{{count}} selected",
|
|
80
|
+
clearSelection: "Clear selection",
|
|
81
|
+
rangeOfTotal: "{{range}} of {{total}}",
|
|
82
|
+
perPage: "{{count}} / page"
|
|
72
83
|
},
|
|
73
84
|
sidebar: {
|
|
74
85
|
menu: "Navigation menu",
|
|
@@ -120,7 +131,8 @@ var r = {
|
|
|
120
131
|
title: "Notifications",
|
|
121
132
|
empty: "Aucune notification.",
|
|
122
133
|
markAllAsRead: "Tout marquer comme lu",
|
|
123
|
-
remove: "Supprimer la notification"
|
|
134
|
+
remove: "Supprimer la notification",
|
|
135
|
+
seeAll: "Voir tout"
|
|
124
136
|
},
|
|
125
137
|
select: {
|
|
126
138
|
placeholder: "Sélectionner...",
|
|
@@ -137,6 +149,12 @@ var r = {
|
|
|
137
149
|
filters: {
|
|
138
150
|
advanced: "Filtres avancés",
|
|
139
151
|
more: "Plus de filtres",
|
|
152
|
+
active: "Filtres actifs :",
|
|
153
|
+
apply: "Rechercher",
|
|
154
|
+
clear: "Effacer les filtres",
|
|
155
|
+
clearAll: "Effacer tout",
|
|
156
|
+
selectAll: "Tout sélectionner",
|
|
157
|
+
deselectAll: "Tout désélectionner",
|
|
140
158
|
yes: "Oui",
|
|
141
159
|
no: "Non"
|
|
142
160
|
},
|
|
@@ -153,7 +171,11 @@ var r = {
|
|
|
153
171
|
},
|
|
154
172
|
table: {
|
|
155
173
|
previousPage: "Page précédente",
|
|
156
|
-
nextPage: "Page suivante"
|
|
174
|
+
nextPage: "Page suivante",
|
|
175
|
+
selectedCount: "{{count}} sélectionné(s)",
|
|
176
|
+
clearSelection: "Désélectionner",
|
|
177
|
+
rangeOfTotal: "{{range}} sur {{total}}",
|
|
178
|
+
perPage: "{{count}} / page"
|
|
157
179
|
},
|
|
158
180
|
sidebar: {
|
|
159
181
|
menu: "Menu de navigation",
|
|
@@ -178,17 +200,17 @@ var r = {
|
|
|
178
200
|
e.addResourceBundle?.(n, a, r, !0, t);
|
|
179
201
|
});
|
|
180
202
|
}, c = {
|
|
181
|
-
fr:
|
|
182
|
-
en:
|
|
183
|
-
}, l =
|
|
184
|
-
let { i18n:
|
|
185
|
-
return u(
|
|
203
|
+
fr: t,
|
|
204
|
+
en: e
|
|
205
|
+
}, l = t, u = (e) => e === void 0 ? l : c[e.split("-")[0]] ?? l, d = () => {
|
|
206
|
+
let { i18n: e, ready: t } = n(a, { useSuspense: !1 });
|
|
207
|
+
return u(t ? e.resolvedLanguage ?? e.language : void 0);
|
|
186
208
|
}, f = (e) => {
|
|
187
209
|
let t = e.split(".").reduce((e, t) => typeof e == "object" && e ? e[t] : void 0, i);
|
|
188
210
|
return typeof t == "string" ? t : void 0;
|
|
189
211
|
}, p = (e, t) => t === void 0 ? e : e.replace(/\{\{(\w+)\}\}/g, (e, n) => n in t ? String(t[n]) : e), m = () => {
|
|
190
|
-
let { t, i18n:
|
|
191
|
-
return { t: (
|
|
212
|
+
let { t: e, i18n: t, ready: r } = n(a, { useSuspense: !1 }), { t: i } = n(void 0, { useSuspense: !1 });
|
|
213
|
+
return { t: (n, a) => r && t.exists(n) ? i(n, a ?? {}) : r && t.exists(n, { ns: "krosoft" }) ? e(n, a ?? {}) : p(f(n) ?? n, a) };
|
|
192
214
|
};
|
|
193
215
|
//#endregion
|
|
194
216
|
export { o as a, a as i, u as n, s as o, d as r, m as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import "./ImageInput-
|
|
3
|
-
import "./MultiSelect-
|
|
4
|
-
import "./SearchInput-
|
|
2
|
+
import "./ImageInput-DvHgBYsy.js";
|
|
3
|
+
import "./MultiSelect-TGu_k3KM.js";
|
|
4
|
+
import "./SearchInput-Csflv8Az.js";
|
|
5
5
|
import { jsx as t } from "react/jsx-runtime";
|
|
6
6
|
import { Heart as n, Star as r } from "lucide-react";
|
|
7
7
|
//#region src/components/core/inputs/RatingInput.tsx
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as a } from "./
|
|
1
|
+
import { t as e } from "./i18n-CevI9Cgk.js";
|
|
2
|
+
import { i as t, n, r, s as i, t as a } from "./tooltip-BmZ9Bfou.js";
|
|
3
3
|
import { i as o, l as s, n as c, t as l, u } from "./select-DmLScQKX.js";
|
|
4
|
-
import { t as d } from "./useLanguage-
|
|
4
|
+
import { t as d } from "./useLanguage-DdVIzhME.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
7
|
import { LanguagesIcon as m } from "lucide-react";
|
|
8
8
|
//#region src/components/core/language/LanguageSelector.tsx
|
|
9
9
|
function h({ languageOptions: h, variant: g = "select", id: _, className: v }) {
|
|
10
|
-
let { t: y } =
|
|
10
|
+
let { t: y } = e(), { currentLanguageOption: b, nextLanguageOption: x, changeLanguage: S, cycleLanguage: C } = d(h);
|
|
11
11
|
if (g === "mini") {
|
|
12
|
-
let
|
|
13
|
-
return /* @__PURE__ */ f(
|
|
12
|
+
let e = b?.icon ?? m;
|
|
13
|
+
return /* @__PURE__ */ f(r, { children: /* @__PURE__ */ p(a, { children: [/* @__PURE__ */ f(t, {
|
|
14
14
|
asChild: !0,
|
|
15
|
-
children: /* @__PURE__ */ p(
|
|
15
|
+
children: /* @__PURE__ */ p(i, {
|
|
16
16
|
id: _,
|
|
17
17
|
variant: "ghost",
|
|
18
18
|
size: "icon",
|
|
19
19
|
onClick: C,
|
|
20
20
|
className: v,
|
|
21
|
-
children: [/* @__PURE__ */ f(
|
|
21
|
+
children: [/* @__PURE__ */ f(e, { className: "size-4" }), /* @__PURE__ */ f("span", {
|
|
22
22
|
className: "sr-only",
|
|
23
23
|
children: y("language.current", { language: b?.label ?? "" })
|
|
24
24
|
})]
|
|
25
25
|
})
|
|
26
|
-
}), /* @__PURE__ */ f(
|
|
26
|
+
}), /* @__PURE__ */ f(n, {
|
|
27
27
|
side: "bottom",
|
|
28
28
|
align: "center",
|
|
29
29
|
children: y("language.switchTo", { language: x?.label ?? "" })
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as o } from "./
|
|
4
|
-
import { C as s, S as c, b as l, d as u, g as d, h as f, i as p, l as m, m as h, p as g, r as _, t as v, v as y, x as b, y as x } from "./sheet-
|
|
2
|
+
import { t } from "./i18n-CevI9Cgk.js";
|
|
3
|
+
import { i as n, n as r, r as i, s as a, t as o } from "./tooltip-BmZ9Bfou.js";
|
|
4
|
+
import { C as s, S as c, b as l, d as u, g as d, h as f, i as p, l as m, m as h, p as g, r as _, t as v, v as y, x as b, y as x } from "./sheet-RYwa4-Nl.js";
|
|
5
5
|
import { t as S } from "./skeleton-D6Ga4BLw.js";
|
|
6
|
-
import { c as C } from "./behavior-
|
|
6
|
+
import { c as C } from "./behavior-C4WdfbR1.js";
|
|
7
7
|
import "./hooks/index.js";
|
|
8
8
|
import * as w from "react";
|
|
9
9
|
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
10
10
|
import { BellIcon as O, ChevronDownIcon as k, LoaderCircleIcon as A, MenuIcon as j, SearchIcon as M, Trash2Icon as N } from "lucide-react";
|
|
11
11
|
//#region src/components/core/navbar/GlobalSearch.tsx
|
|
12
|
-
var P = ({ groups:
|
|
13
|
-
let { t: N } =
|
|
12
|
+
var P = ({ groups: n, search: r, onSearch: i, onSelect: o, loading: u = !1, open: d, onOpenChange: f, trigger: p = !0, triggerLabel: m, shortcut: h = !0, shortcutLabel: g = "Ctrl+K", placeholder: _, emptyLabel: v, loadingLabel: S, title: C, description: O, hint: k, className: j }) => {
|
|
13
|
+
let { t: N } = t(), [P, F] = w.useState(!1), I = d !== void 0, L = I ? d : P, R = w.useCallback((e) => {
|
|
14
14
|
I || F(e), f?.(e);
|
|
15
15
|
}, [I, f]);
|
|
16
16
|
w.useEffect(() => {
|
|
@@ -27,9 +27,9 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
27
27
|
R
|
|
28
28
|
]);
|
|
29
29
|
let z = (e) => {
|
|
30
|
-
R(!1),
|
|
31
|
-
}, B =
|
|
32
|
-
return /* @__PURE__ */ D(T, { children: [p && /* @__PURE__ */ E(
|
|
30
|
+
R(!1), i(""), o(e);
|
|
31
|
+
}, B = n.some((e) => e.items.length > 0);
|
|
32
|
+
return /* @__PURE__ */ D(T, { children: [p && /* @__PURE__ */ E(a, {
|
|
33
33
|
variant: "ghost",
|
|
34
34
|
size: "icon",
|
|
35
35
|
"aria-label": m ?? N("search.trigger"),
|
|
@@ -48,8 +48,8 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
48
48
|
className: j,
|
|
49
49
|
children: [
|
|
50
50
|
/* @__PURE__ */ E(b, {
|
|
51
|
-
value:
|
|
52
|
-
onValueChange:
|
|
51
|
+
value: r,
|
|
52
|
+
onValueChange: i,
|
|
53
53
|
placeholder: _ ?? N("search.placeholder")
|
|
54
54
|
}),
|
|
55
55
|
/* @__PURE__ */ D(s, { children: [
|
|
@@ -58,7 +58,7 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
58
58
|
children: [/* @__PURE__ */ E(A, { className: "size-4 animate-spin" }), S ?? N("search.loading")]
|
|
59
59
|
}),
|
|
60
60
|
!B && !u && /* @__PURE__ */ E(x, { children: v ?? N("states.noResultDot") }),
|
|
61
|
-
|
|
61
|
+
n.map((t) => t.items.length === 0 ? null : /* @__PURE__ */ E(l, {
|
|
62
62
|
heading: t.heading,
|
|
63
63
|
children: t.items.map((t) => {
|
|
64
64
|
let n = t.icon;
|
|
@@ -91,68 +91,68 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
91
91
|
})
|
|
92
92
|
]
|
|
93
93
|
})] });
|
|
94
|
-
}, F = 9, I = ({ items:
|
|
95
|
-
let { t:
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
|
|
94
|
+
}, F = 9, I = ({ items: n, onSelect: r, onMarkAllAsRead: i, onRemove: o, onSeeAll: s, isLoading: c = !1, unreadCount: l, maxBadgeCount: d = F, open: p, onOpenChange: m, triggerLabel: _, title: v, emptyLabel: y, loadingLabel: b, markAllAsReadLabel: x, removeLabel: S, seeAllLabel: C, className: T, contentClassName: k, badgeClassName: A, itemClassName: j, unreadItemClassName: M }) => {
|
|
95
|
+
let { t: P } = t(), [I, L] = w.useState(!1), R = p !== void 0, z = R ? p : I, B = (e) => {
|
|
96
|
+
R || L(e), m?.(e);
|
|
97
|
+
}, V = l ?? n.filter((e) => !e.read).length, H = _ ?? P("notifications.trigger"), U = (e) => {
|
|
98
|
+
B(!1), r?.(e);
|
|
99
99
|
};
|
|
100
100
|
return /* @__PURE__ */ D(g, {
|
|
101
|
-
open:
|
|
102
|
-
onOpenChange:
|
|
101
|
+
open: z,
|
|
102
|
+
onOpenChange: B,
|
|
103
103
|
children: [/* @__PURE__ */ E(f, {
|
|
104
104
|
asChild: !0,
|
|
105
|
-
children: /* @__PURE__ */ D(
|
|
105
|
+
children: /* @__PURE__ */ D(a, {
|
|
106
106
|
type: "button",
|
|
107
107
|
variant: "ghost",
|
|
108
108
|
size: "icon",
|
|
109
|
-
className: e("relative rounded-control",
|
|
110
|
-
"aria-label":
|
|
111
|
-
title:
|
|
112
|
-
children: [/* @__PURE__ */ E(O, { className: "size-4" }),
|
|
113
|
-
className: e("absolute right-1 top-1 flex size-4 items-center justify-center rounded-full bg-primary text-[10px] font-bold leading-none text-primary-foreground",
|
|
114
|
-
children:
|
|
109
|
+
className: e("relative rounded-control", T),
|
|
110
|
+
"aria-label": V > 0 ? `${H} (${String(V)})` : H,
|
|
111
|
+
title: H,
|
|
112
|
+
children: [/* @__PURE__ */ E(O, { className: "size-4" }), V > 0 && /* @__PURE__ */ E("span", {
|
|
113
|
+
className: e("absolute right-1 top-1 flex size-4 items-center justify-center rounded-full bg-primary text-[10px] font-bold leading-none text-primary-foreground", A),
|
|
114
|
+
children: V > d ? `${String(d)}+` : V
|
|
115
115
|
})]
|
|
116
116
|
})
|
|
117
117
|
}), /* @__PURE__ */ D(h, {
|
|
118
118
|
align: "end",
|
|
119
|
-
className: e("w-80 p-0",
|
|
119
|
+
className: e("w-80 p-0", k),
|
|
120
120
|
children: [
|
|
121
121
|
/* @__PURE__ */ D("div", {
|
|
122
122
|
className: "flex items-center justify-between gap-2 border-b px-3 py-2",
|
|
123
123
|
children: [/* @__PURE__ */ E("span", {
|
|
124
124
|
className: "text-sm font-medium",
|
|
125
|
-
children:
|
|
126
|
-
}),
|
|
125
|
+
children: v ?? P("notifications.title")
|
|
126
|
+
}), i && V > 0 && /* @__PURE__ */ E(a, {
|
|
127
127
|
type: "button",
|
|
128
128
|
variant: "ghost",
|
|
129
129
|
size: "sm",
|
|
130
130
|
className: "h-7 text-xs",
|
|
131
|
-
onClick:
|
|
132
|
-
children:
|
|
131
|
+
onClick: i,
|
|
132
|
+
children: x ?? P("notifications.markAllAsRead")
|
|
133
133
|
})]
|
|
134
134
|
}),
|
|
135
|
-
|
|
135
|
+
c && /* @__PURE__ */ E("p", {
|
|
136
136
|
className: "px-3 py-6 text-center text-sm text-muted-foreground",
|
|
137
|
-
children:
|
|
137
|
+
children: b ?? P("states.loading")
|
|
138
138
|
}),
|
|
139
|
-
!
|
|
139
|
+
!c && n.length === 0 && /* @__PURE__ */ E("p", {
|
|
140
140
|
className: "px-3 py-6 text-center text-sm text-muted-foreground",
|
|
141
|
-
children:
|
|
141
|
+
children: y ?? P("notifications.empty")
|
|
142
142
|
}),
|
|
143
|
-
!
|
|
143
|
+
!c && n.length > 0 && /* @__PURE__ */ E(u, {
|
|
144
144
|
className: "max-h-96",
|
|
145
145
|
children: /* @__PURE__ */ E("ul", {
|
|
146
146
|
className: "divide-y",
|
|
147
|
-
children:
|
|
147
|
+
children: n.map((t) => {
|
|
148
148
|
let n = t.icon;
|
|
149
149
|
return /* @__PURE__ */ D("li", {
|
|
150
|
-
className: e("flex items-start gap-2 px-3 py-2", !t.read && (
|
|
150
|
+
className: e("flex items-start gap-2 px-3 py-2", !t.read && (M ?? "bg-accent/40"), j),
|
|
151
151
|
children: [/* @__PURE__ */ D("button", {
|
|
152
152
|
type: "button",
|
|
153
153
|
className: "flex min-w-0 flex-1 items-start gap-2 rounded-sm text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
154
154
|
onClick: () => {
|
|
155
|
-
|
|
155
|
+
U(t);
|
|
156
156
|
},
|
|
157
157
|
children: [n && /* @__PURE__ */ E("span", {
|
|
158
158
|
className: e("mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground", t.iconClassName),
|
|
@@ -180,30 +180,43 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
180
180
|
})
|
|
181
181
|
]
|
|
182
182
|
})]
|
|
183
|
-
}),
|
|
183
|
+
}), o && /* @__PURE__ */ E(a, {
|
|
184
184
|
type: "button",
|
|
185
185
|
variant: "ghost",
|
|
186
186
|
size: "icon",
|
|
187
187
|
className: "size-7 shrink-0 text-muted-foreground hover:text-destructive",
|
|
188
188
|
onClick: () => {
|
|
189
|
-
|
|
189
|
+
o(t);
|
|
190
190
|
},
|
|
191
|
-
"aria-label":
|
|
192
|
-
title:
|
|
191
|
+
"aria-label": S ?? P("notifications.remove"),
|
|
192
|
+
title: S ?? P("notifications.remove"),
|
|
193
193
|
children: /* @__PURE__ */ E(N, { className: "size-3.5" })
|
|
194
194
|
})]
|
|
195
195
|
}, t.key);
|
|
196
196
|
})
|
|
197
197
|
})
|
|
198
|
+
}),
|
|
199
|
+
s && /* @__PURE__ */ E("div", {
|
|
200
|
+
className: "border-t p-1",
|
|
201
|
+
children: /* @__PURE__ */ E(a, {
|
|
202
|
+
type: "button",
|
|
203
|
+
variant: "ghost",
|
|
204
|
+
size: "sm",
|
|
205
|
+
className: "h-8 w-full justify-center text-xs font-medium",
|
|
206
|
+
onClick: () => {
|
|
207
|
+
B(!1), s?.();
|
|
208
|
+
},
|
|
209
|
+
children: C ?? P("notifications.seeAll")
|
|
210
|
+
})
|
|
198
211
|
})
|
|
199
212
|
]
|
|
200
213
|
})]
|
|
201
214
|
});
|
|
202
|
-
}, L = (e, t, n) => t === e ? !0 : e === "/" || !t.startsWith(`${e}/`) ? !1 : !n.some((n) => n !== e && n.startsWith(`${e}/`) && (t === n || t.startsWith(`${n}/`))), R = ({ path:
|
|
203
|
-
let p = c?.map((e) => e.path) ?? [], [m, h] = w.useState(c?.some((e) => L(e.path, l, p)) ?? !1), g =
|
|
204
|
-
href:
|
|
215
|
+
}, L = (e, t, n) => t === e ? !0 : e === "/" || !t.startsWith(`${e}/`) ? !1 : !n.some((n) => n !== e && n.startsWith(`${e}/`) && (t === n || t.startsWith(`${n}/`))), R = ({ path: t, icon: i, label: a, badge: s, subItems: c, currentPath: l, collapsed: u, dense: d = !1, onItemClick: f }) => {
|
|
216
|
+
let p = c?.map((e) => e.path) ?? [], [m, h] = w.useState(c?.some((e) => L(e.path, l, p)) ?? !1), g = t ? l === t || t !== "/" && l.startsWith(`${t}/`) : !1, _ = c?.some((e) => L(e.path, l, p)), v = /* @__PURE__ */ D("a", {
|
|
217
|
+
href: t ?? "#",
|
|
205
218
|
onClick: (e) => {
|
|
206
|
-
e.ctrlKey || e.metaKey || e.button === 1 || (e.preventDefault(), c && c.length > 0 ? u || h(!m) :
|
|
219
|
+
e.ctrlKey || e.metaKey || e.button === 1 || (e.preventDefault(), c && c.length > 0 ? u || h(!m) : t && f(t));
|
|
207
220
|
},
|
|
208
221
|
className: e("flex items-center cursor-pointer transition-all duration-200 group rounded-control", d ? "gap-2.5 mb-0.5" : "gap-3 mb-1", u ? d ? "justify-center p-2 h-9 w-9 mx-auto" : "justify-center p-3 h-12 w-12 mx-auto" : d ? "px-3 py-1.5 h-9" : "px-4 py-3 h-12", g || !u && _ ? d ? "bg-sidebar-primary text-sidebar-primary-foreground" : "bg-sidebar-primary text-sidebar-primary-foreground shadow-lg" : "hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground"),
|
|
209
222
|
children: [/* @__PURE__ */ E("div", {
|
|
@@ -212,7 +225,7 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
212
225
|
}), !u && /* @__PURE__ */ D(T, { children: [
|
|
213
226
|
/* @__PURE__ */ E("span", {
|
|
214
227
|
className: e("flex-grow transition-opacity duration-150 font-medium", d ? "text-sm" : ""),
|
|
215
|
-
children:
|
|
228
|
+
children: a
|
|
216
229
|
}),
|
|
217
230
|
s !== void 0 && /* @__PURE__ */ E("span", {
|
|
218
231
|
className: "bg-red-500 text-white text-xs rounded-full py-1 min-w-[20px] text-center px-2 font-semibold",
|
|
@@ -221,10 +234,10 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
221
234
|
c && c.length > 0 && /* @__PURE__ */ E(k, { className: e("size-4 transition-transform duration-200", m ? "rotate-180" : "") })
|
|
222
235
|
] })]
|
|
223
236
|
});
|
|
224
|
-
return /* @__PURE__ */ D(T, { children: [u ? /* @__PURE__ */ D(
|
|
237
|
+
return /* @__PURE__ */ D(T, { children: [u ? /* @__PURE__ */ D(o, { children: [/* @__PURE__ */ E(n, {
|
|
225
238
|
asChild: !0,
|
|
226
239
|
children: v
|
|
227
|
-
}), /* @__PURE__ */ E(
|
|
240
|
+
}), /* @__PURE__ */ E(r, {
|
|
228
241
|
side: "right",
|
|
229
242
|
sideOffset: 6,
|
|
230
243
|
className: "rounded-surface z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
|
|
@@ -234,7 +247,7 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
234
247
|
className: "flex items-center gap-2",
|
|
235
248
|
children: [/* @__PURE__ */ E("p", {
|
|
236
249
|
className: "font-semibold",
|
|
237
|
-
children:
|
|
250
|
+
children: a
|
|
238
251
|
}), s !== void 0 && /* @__PURE__ */ D("span", {
|
|
239
252
|
className: "ml-1 text-xs",
|
|
240
253
|
children: [
|
|
@@ -262,10 +275,10 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
262
275
|
}, n);
|
|
263
276
|
})
|
|
264
277
|
})] });
|
|
265
|
-
}, z = ({ groups:
|
|
266
|
-
let { t: u } =
|
|
267
|
-
|
|
268
|
-
}, P = O.trim().toLowerCase(), F = P === "" ?
|
|
278
|
+
}, z = ({ groups: n, currentPath: r, onItemClick: a, slots: o, search: s, dense: c = !1, loading: l = !1 }) => {
|
|
279
|
+
let { t: u } = t(), { enabled: f = !1, placeholder: h } = s ?? {}, { header: g, footer: y } = o ?? {}, { collapsed: b, isMobile: x, setCollapsed: T } = C(), [O, k] = w.useState(""), A = !x && b, j = !b, N = (e) => {
|
|
280
|
+
a(e), x && T(!0);
|
|
281
|
+
}, P = O.trim().toLowerCase(), F = P === "" ? n : n.map((e) => ({
|
|
269
282
|
...e,
|
|
270
283
|
items: e.items.filter((e) => e.label.toLowerCase().includes(P) || (e.subItems?.some((e) => e.label.toLowerCase().includes(P)) ?? !1))
|
|
271
284
|
})).filter((e) => e.items.length > 0), I = /* @__PURE__ */ D("div", {
|
|
@@ -292,7 +305,7 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
292
305
|
children: l ? Array.from({ length: 5 }).map((t, n) => /* @__PURE__ */ D("div", {
|
|
293
306
|
className: e("flex items-center gap-3", c ? "mb-1 h-9" : "mb-2 h-12", A ? "justify-center px-3" : "px-4"),
|
|
294
307
|
children: [/* @__PURE__ */ E(S, { className: "size-5 flex-shrink-0 rounded-control" }), !A && /* @__PURE__ */ E(S, { className: "h-4 flex-1" })]
|
|
295
|
-
}, n)) : F.map((t,
|
|
308
|
+
}, n)) : F.map((t, n) => /* @__PURE__ */ D("div", {
|
|
296
309
|
className: c ? "mb-3" : "mb-6",
|
|
297
310
|
children: [!A && t.title !== void 0 && t.title !== "" && /* @__PURE__ */ E("h3", {
|
|
298
311
|
className: e("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", c ? "mb-1" : "mb-2"),
|
|
@@ -301,13 +314,13 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
301
314
|
className: e("flex flex-col", c ? "gap-0.5" : "gap-1"),
|
|
302
315
|
children: t.items.map((e, t) => /* @__PURE__ */ E(R, {
|
|
303
316
|
...e,
|
|
304
|
-
currentPath:
|
|
317
|
+
currentPath: r,
|
|
305
318
|
collapsed: A,
|
|
306
319
|
dense: c,
|
|
307
320
|
onItemClick: N
|
|
308
321
|
}, t))
|
|
309
322
|
})]
|
|
310
|
-
},
|
|
323
|
+
}, n))
|
|
311
324
|
}),
|
|
312
325
|
y && /* @__PURE__ */ E("div", {
|
|
313
326
|
className: e("border-t border-sidebar-border", c ? "p-2" : "p-4", A ? "flex justify-center" : ""),
|
|
@@ -335,7 +348,7 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
335
348
|
I
|
|
336
349
|
]
|
|
337
350
|
})
|
|
338
|
-
}) : /* @__PURE__ */ E(
|
|
351
|
+
}) : /* @__PURE__ */ E(i, {
|
|
339
352
|
delayDuration: 0,
|
|
340
353
|
children: /* @__PURE__ */ E("aside", {
|
|
341
354
|
className: e("flex flex-col bg-sidebar h-screen border-r border-sidebar-border transition-all duration-300", A ? "w-[--navbar-width-icon]" : "w-[--navbar-width]", "flex"),
|
|
@@ -364,12 +377,12 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
364
377
|
})]
|
|
365
378
|
})]
|
|
366
379
|
});
|
|
367
|
-
}, V = ({ collapsed: t, isMobile: n, onToggleSidebar: r, actionsNode:
|
|
380
|
+
}, V = ({ collapsed: t, isMobile: n, onToggleSidebar: r, actionsNode: i, userMenuNode: o }) => /* @__PURE__ */ D("header", {
|
|
368
381
|
className: e("fixed top-0 right-0 z-[60] h-16 md:h-20 bg-topbar text-topbar-foreground flex items-center justify-between px-4 transition-all duration-300", n && "left-0", !n && t && "left-[5rem]", !n && !t && "left-[16rem]"),
|
|
369
382
|
tabIndex: -1,
|
|
370
383
|
children: [/* @__PURE__ */ E("div", {
|
|
371
384
|
className: "flex items-center min-w-0 flex-1",
|
|
372
|
-
children: /* @__PURE__ */ E(
|
|
385
|
+
children: /* @__PURE__ */ E(a, {
|
|
373
386
|
variant: "ghost",
|
|
374
387
|
size: "icon",
|
|
375
388
|
onClick: r,
|
|
@@ -378,7 +391,7 @@ var P = ({ groups: t, search: n, onSearch: r, onSelect: a, loading: u = !1, open
|
|
|
378
391
|
})
|
|
379
392
|
}), /* @__PURE__ */ D("div", {
|
|
380
393
|
className: "flex items-center gap-2 md:gap-4 flex-shrink-0",
|
|
381
|
-
children: [
|
|
394
|
+
children: [i, o]
|
|
382
395
|
})]
|
|
383
396
|
});
|
|
384
397
|
//#endregion
|
package/dist/pwa/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "../i18n-CevI9Cgk.js";
|
|
2
|
+
import { useEffect as t } from "react";
|
|
3
3
|
import { toast as n } from "sonner";
|
|
4
4
|
import { useRegisterSW as r } from "virtual:pwa-register/react";
|
|
5
5
|
//#region src/pwa/PwaUpdater.tsx
|
|
6
6
|
var i = 36e5, a = ({ checkIntervalMs: a = i } = {}) => {
|
|
7
|
-
let { t: o } =
|
|
7
|
+
let { t: o } = e(), { needRefresh: [s, c], updateServiceWorker: l } = r({ onRegisteredSW(e, t) {
|
|
8
8
|
t && setInterval(() => void t.update(), a);
|
|
9
9
|
} });
|
|
10
|
-
return
|
|
10
|
+
return t(() => {
|
|
11
11
|
s && n(o("pwa.updateAvailable"), {
|
|
12
12
|
duration: Infinity,
|
|
13
13
|
closeButton: !0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
2
|
import "./helpers/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { t } from "./i18n-CevI9Cgk.js";
|
|
4
|
+
import { a as n } from "./tooltip-BmZ9Bfou.js";
|
|
5
5
|
import * as r from "react";
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
import { SearchIcon as o, X as s } from "lucide-react";
|
|
@@ -60,8 +60,8 @@ var w = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(l, {
|
|
|
60
60
|
...n
|
|
61
61
|
}));
|
|
62
62
|
w.displayName = l.displayName;
|
|
63
|
-
var T = ({ title:
|
|
64
|
-
let { t: u } =
|
|
63
|
+
var T = ({ title: n, description: r, shouldFilter: o, className: s, children: c, ...l }) => {
|
|
64
|
+
let { t: u } = t();
|
|
65
65
|
return /* @__PURE__ */ i(p, {
|
|
66
66
|
...l,
|
|
67
67
|
children: /* @__PURE__ */ a(y, {
|
|
@@ -69,7 +69,7 @@ var T = ({ title: t, description: r, shouldFilter: o, className: s, children: c,
|
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ i(S, {
|
|
71
71
|
className: "sr-only",
|
|
72
|
-
children:
|
|
72
|
+
children: n ?? u("search.commandTitle")
|
|
73
73
|
}),
|
|
74
74
|
/* @__PURE__ */ i(C, {
|
|
75
75
|
className: "sr-only",
|
|
@@ -130,9 +130,9 @@ var M = ({ className: t, ...n }) => /* @__PURE__ */ i("span", {
|
|
|
130
130
|
M.displayName = "CommandShortcut";
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/components/ui/input.tsx
|
|
133
|
-
var N = r.forwardRef(({ className:
|
|
133
|
+
var N = r.forwardRef(({ className: t, type: r, ...a }, o) => /* @__PURE__ */ i("input", {
|
|
134
134
|
type: r,
|
|
135
|
-
className: e(
|
|
135
|
+
className: e(n, "flex w-full text-base file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 md:text-sm", t),
|
|
136
136
|
ref: o,
|
|
137
137
|
...a
|
|
138
138
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./i18n-
|
|
2
|
-
import "./ErrorAlert-
|
|
1
|
+
import { t as e } from "./i18n-CevI9Cgk.js";
|
|
2
|
+
import "./ErrorAlert-6ECy_Dox.js";
|
|
3
3
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
4
|
import { Loader2Icon as r } from "lucide-react";
|
|
5
5
|
//#region src/components/core/states/ErrorState.tsx
|