@krosoft/react 0.0.381 → 0.0.382
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/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/core/cards/DashboardCard.js +18 -0
- package/dist/components/core/cards/KpiCard.js +36 -0
- package/dist/components/core/cards/KpiCards.js +29 -0
- package/dist/components/core/cards/MetricCard.js +63 -0
- package/dist/components/core/cards/SkeletonCard.js +13 -0
- package/dist/components/core/cards/SkeletonCards.js +11 -0
- package/dist/components/core/cards/index.js +7 -1
- package/dist/components/core/changelog/AppChangelog.js +123 -0
- package/dist/components/core/changelog/AppChangelogEntry.js +85 -0
- package/dist/components/core/changelog/AppChangelogNav.js +39 -0
- package/dist/components/core/changelog/AppChangelogTagFilter.js +39 -0
- package/dist/components/core/changelog/index.js +1 -1
- package/dist/components/core/charts/BarChartHorizontal.js +80 -0
- package/dist/components/core/charts/BarChartVertical.js +68 -0
- package/dist/components/core/charts/ChartCard.js +44 -0
- package/dist/components/core/charts/CircularGauge.js +58 -0
- package/dist/components/core/charts/LineChart.js +69 -0
- package/dist/components/core/charts/PieChart.js +55 -0
- package/dist/components/core/charts/chartColors.js +10 -0
- package/dist/components/core/charts/chartTooltip.helper.js +15 -0
- package/dist/components/core/charts/index.js +8 -1
- package/dist/components/core/dialogs/AboutDialog.js +59 -0
- package/dist/components/core/dialogs/AppDialog.js +81 -0
- package/dist/components/core/dialogs/ConfirmationDialog.js +42 -0
- package/dist/components/core/dialogs/FormDialog.js +105 -0
- package/dist/components/core/dialogs/index.js +7 -4
- package/dist/components/core/filters/ActiveFilters.js +69 -0
- package/dist/components/core/filters/AdvancedFilters.js +103 -0
- package/dist/components/core/filters/ConditionFilter.js +162 -0
- package/dist/components/core/filters/ConditionFilterGroup.js +44 -0
- package/dist/components/core/filters/FilterField.js +64 -0
- package/dist/components/core/filters/FilterPills.js +13 -0
- package/dist/components/core/filters/FilterPillsGroup.js +39 -0
- package/dist/components/core/filters/FiltersContainer.js +54 -0
- package/dist/components/core/filters/FiltersMobileDrawer.js +57 -0
- package/dist/components/core/filters/TableFilter.js +101 -0
- package/dist/components/core/filters/index.js +11 -645
- package/dist/{GenericForm-Dxd6k7l-.js → components/core/forms/GenericForm.js} +45 -43
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/icons/FlagFrIcon.js +28 -0
- package/dist/{icons-n0m_1w7z.js → components/core/icons/FlagGbIcon.js} +3 -26
- package/dist/components/core/icons/index.js +3 -1
- package/dist/components/core/index.js +71 -27
- package/dist/components/core/inputs/DatePicker.js +46 -0
- package/dist/components/core/inputs/DateRangePicker.js +92 -0
- package/dist/{inputs-CBojnClc.js → components/core/inputs/FileDropzone.js} +8 -37
- package/dist/{ImageInput-BeIOm3GY.js → components/core/inputs/ImageInput.js} +5 -5
- package/dist/components/core/inputs/MultiSelect.js +191 -0
- package/dist/components/core/inputs/RatingInput.js +36 -0
- package/dist/{SearchInput-IT_Rvthr.js → components/core/inputs/SearchInput.js} +4 -4
- package/dist/components/core/inputs/SingleSelect.js +198 -0
- package/dist/components/core/inputs/index.js +9 -6
- package/dist/components/core/inputs/select.helper.js +46 -0
- package/dist/{language-DY0EYabh.js → components/core/language/LanguageSelector.js} +13 -12
- package/dist/components/core/language/index.js +1 -1
- package/dist/{AppActions-8HjAaTQK.js → components/core/layouts/AppActions.js} +19 -19
- package/dist/components/core/layouts/AppPageHeader.js +44 -0
- package/dist/{AppSubTitle-DI62BaaB.js → components/core/layouts/AppSubTitle.js} +3 -3
- package/dist/{AppTitle-BXoTrXQc.js → components/core/layouts/AppTitle.js} +3 -3
- package/dist/components/core/layouts/KpiCardsLayout.js +8 -0
- package/dist/components/core/layouts/index.js +6 -50
- package/dist/components/core/markdown/AppMarkdown.js +134 -0
- package/dist/components/core/markdown/AppMarkdownHeading.js +45 -0
- package/dist/components/core/markdown/index.js +1 -1
- package/dist/components/core/navbar/GlobalSearch.js +128 -0
- package/dist/components/core/navbar/NotificationsBell.js +133 -0
- package/dist/components/core/navbar/Sidebar.js +99 -0
- package/dist/components/core/navbar/SidebarHeader.js +26 -0
- package/dist/components/core/navbar/SidebarNavItem.js +72 -0
- package/dist/components/core/navbar/Topbar.js +25 -0
- package/dist/components/core/navbar/index.js +7 -1
- package/dist/{ErrorAlert-cJnfBL8H.js → components/core/states/ErrorAlert.js} +5 -5
- package/dist/{states-CJ8xE_Nm.js → components/core/states/ErrorState.js} +4 -11
- package/dist/components/core/states/LoadingState.js +12 -0
- package/dist/components/core/states/index.js +3 -2
- package/dist/components/core/table/DataTable.js +108 -0
- package/dist/components/core/table/JsonTableOutput.js +75 -0
- package/dist/components/core/table/TableActions.js +75 -0
- package/dist/components/core/table/TableBody.js +130 -0
- package/dist/components/core/table/TableBulkActions.js +47 -0
- package/dist/components/core/table/TableHeader.js +103 -0
- package/dist/components/core/table/TablePagination.js +102 -0
- package/dist/components/core/table/TableSettings.js +117 -0
- package/dist/components/core/table/index.js +9 -709
- package/dist/components/core/tabs/AppTabContainer.js +17 -0
- package/dist/components/core/tabs/AppTabHeader.js +19 -0
- package/dist/components/core/tabs/AppTabs.js +56 -0
- package/dist/components/core/tabs/AppVerticalTabs.js +105 -0
- package/dist/components/core/tabs/index.js +5 -188
- package/dist/{theme-DSumNHLX.js → components/core/theme/ThemeSelector.js} +13 -12
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +117 -34
- package/dist/components/ui/accordion.js +34 -0
- package/dist/components/ui/alert-dialog.js +54 -0
- package/dist/{alert-REQGK9bR.js → components/ui/alert.js} +2 -2
- package/dist/components/ui/aspect-ratio.js +5 -0
- package/dist/components/ui/avatar.js +25 -0
- package/dist/components/ui/badge.js +22 -0
- package/dist/components/ui/breadcrumb.js +60 -0
- package/dist/{tooltip-_geGvbS7.js → components/ui/button.js} +7 -17
- package/dist/components/ui/calendar.js +44 -0
- package/dist/components/ui/card.js +42 -0
- package/dist/components/ui/carousel.js +115 -0
- package/dist/{chart-wW-fwL3s.js → components/ui/chart.js} +51 -89
- package/dist/components/ui/checkbox.js +31 -0
- package/dist/components/ui/collapsible.js +5 -0
- package/dist/components/ui/command.js +84 -0
- package/dist/components/ui/context-menu.js +71 -0
- package/dist/components/ui/control.js +5 -0
- package/dist/components/ui/dialog.js +49 -0
- package/dist/components/ui/drawer.js +47 -0
- package/dist/components/ui/dropdown-menu.js +72 -0
- package/dist/components/ui/form.js +78 -0
- package/dist/components/ui/hover-card.js +15 -0
- package/dist/components/ui/index.js +49 -9
- package/dist/components/ui/input-otp.js +41 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/label.js +14 -0
- package/dist/components/ui/menubar.js +86 -0
- package/dist/components/ui/navigation-menu.js +58 -0
- package/dist/components/ui/pagination.js +62 -0
- package/dist/components/ui/popover.js +15 -0
- package/dist/components/ui/progress.js +17 -0
- package/dist/components/ui/radio-group.js +24 -0
- package/dist/components/ui/resizable.js +18 -0
- package/dist/components/ui/scroll-area.js +29 -0
- package/dist/{select-KWMg2_7Z.js → components/ui/select.js} +3 -3
- package/dist/components/ui/separator.js +15 -0
- package/dist/components/ui/sheet.js +58 -0
- package/dist/components/ui/simple-table.js +57 -0
- package/dist/{skeleton-D6Ga4BLw.js → components/ui/skeleton.js} +2 -2
- package/dist/components/ui/slider.js +17 -0
- package/dist/components/ui/sonner.js +23 -0
- package/dist/components/ui/switch.js +14 -0
- package/dist/components/ui/tabs.js +58 -0
- package/dist/components/ui/textarea.js +12 -0
- package/dist/components/ui/toast.js +53 -0
- package/dist/components/ui/toaster.js +22 -0
- package/dist/components/ui/toggle-group.js +37 -0
- package/dist/components/ui/toggle.js +34 -0
- package/dist/components/ui/tooltip.js +14 -0
- package/dist/{datatable-COQcYUrk.js → constants/datatable.js} +1 -1
- package/dist/constants/index.js +3 -5
- package/dist/constants/search.js +4 -0
- package/dist/contexts/index.js +3 -1
- package/dist/{sidebar.context-BahtU6hE.js → contexts/page.context.js} +2 -2
- package/dist/contexts/sidebar.context.js +5 -0
- package/dist/helpers/changelog.helper.js +69 -0
- package/dist/helpers/index.js +6 -166
- package/dist/{markdown.helper-YJE2H5KQ.js → helpers/markdown.helper.js} +1 -1
- package/dist/helpers/supabase.helper.js +41 -0
- package/dist/helpers/table.helper.js +56 -0
- package/dist/{tailwind.helper-CJaRYBmL.js → helpers/tailwind.helper.js} +1 -1
- package/dist/hooks/behavior/index.js +10 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.js +21 -0
- package/dist/hooks/behavior/useConfirmationDialog.js +23 -0
- package/dist/hooks/behavior/useDebounce.js +14 -0
- package/dist/hooks/behavior/useDebouncedValue.js +15 -0
- package/dist/hooks/behavior/useDialog.js +21 -0
- package/dist/hooks/behavior/usePage.js +10 -0
- package/dist/hooks/behavior/useSidebar.js +10 -0
- package/dist/hooks/behavior/useTable.js +83 -0
- package/dist/hooks/behavior/useUrlState.js +46 -0
- package/dist/hooks/index.js +20 -11
- package/dist/hooks/ui/index.js +11 -10
- package/dist/{useFixedColumns-Bo-Az3Hp.js → hooks/ui/useDataTable.js} +16 -52
- package/dist/{useDocumentTitle-VoQkict_.js → hooks/ui/useDocumentTitle.js} +2 -2
- package/dist/hooks/ui/useFixedColumns.js +38 -0
- package/dist/{useLanguage-DRnSb5H1.js → hooks/ui/useLanguage.js} +3 -3
- package/dist/{useMobile-pTQ8lWvt.js → hooks/ui/useMobile.js} +1 -1
- package/dist/{useNotifications-CyhTruIG.js → hooks/ui/useNotifications.js} +2 -2
- package/dist/{useScrollFade-D9kqJBDh.js → hooks/ui/useScrollFade.js} +1 -1
- package/dist/{ui-nQGnCss1.js → hooks/ui/useServerTable.js} +2 -2
- package/dist/{useTheme-DIZjiF5F.js → hooks/ui/useTheme.js} +3 -3
- package/dist/{useToast-UeDRLovh.js → hooks/ui/useToast.js} +1 -1
- package/dist/i18n/index.js +4 -1
- package/dist/i18n/krosoftLocales.js +13 -0
- package/dist/i18n/useDateFnsLocale.js +13 -0
- package/dist/i18n/useKrosoftTranslation.js +13 -0
- package/dist/locales/en.json.js +174 -0
- package/dist/locales/fr.json.js +174 -0
- package/dist/providers/SidebarProvider.js +42 -0
- package/dist/providers/index.js +1 -42
- package/dist/pwa/PwaUpdater.js +30 -0
- package/dist/pwa/index.js +3 -50
- package/dist/pwa/pwaUpdateToast.js +25 -0
- package/dist/seasonal/EffectSwitch.js +24 -0
- package/dist/seasonal/EmojiSnowfall.js +24 -0
- package/dist/seasonal/HalloweenEffect.js +17 -0
- package/dist/seasonal/SeasonalEffects.js +8 -0
- package/dist/seasonal/SeasonalEffectsSettings.js +35 -0
- package/dist/seasonal/SnowEffect.js +12 -0
- package/dist/seasonal/index.js +7 -120
- package/dist/seasonal/overlayStyle.js +12 -0
- package/dist/seasonal/seasons.js +7 -0
- package/dist/seasonal/useSeasonalEffects.js +20 -0
- package/dist/seasonal/useStoredToggle.js +21 -0
- package/dist/tailwind/index.js +7 -53
- package/dist/tokens/apply.js +16 -0
- package/dist/tokens/index.js +3 -38
- package/dist/tokens/radius.js +26 -0
- package/dist/types/index.js +0 -1
- package/dist/vendor/tailwindcss/lib/public/create-plugin.js +19 -0
- package/dist/vendor/tailwindcss/lib/util/createPlugin.js +30 -0
- package/dist/vendor/tailwindcss/plugin.js +10 -0
- package/package.json +3 -3
- package/dist/AppMarkdown-CAxm82x0.js +0 -171
- package/dist/MultiSelect-DPN046kI.js +0 -228
- package/dist/SingleSelect-DLY5WylQ.js +0 -313
- package/dist/behavior-B0BYivtN.js +0 -201
- package/dist/cards-DPzVebUM.js +0 -132
- package/dist/changelog-DyPFIscf.js +0 -257
- package/dist/charts-C7rKxkli.js +0 -342
- package/dist/dialogs-CG9Q7pqY.js +0 -269
- package/dist/i18n-BhLphJa3.js +0 -364
- package/dist/navbar-DD0V0pNE.js +0 -432
- package/dist/sheet-cWJO_wkT.js +0 -225
- package/dist/switch-DspImmo_.js +0 -24
- package/dist/ui-Fxy95kSJ.js +0 -1163
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Card as e, CardContent as t, CardHeader as n } from "../../ui/card.js";
|
|
2
|
+
import { AppTabHeader as r } from "./AppTabHeader.js";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/core/tabs/AppTabContainer.tsx
|
|
5
|
+
function o({ titleKey: o, descriptionKey: s, actions: c = [], className: l, children: u, isSubTitle: d }) {
|
|
6
|
+
return /* @__PURE__ */ a(e, { children: [/* @__PURE__ */ i(n, { children: /* @__PURE__ */ i(r, {
|
|
7
|
+
titleKey: o,
|
|
8
|
+
descriptionKey: s,
|
|
9
|
+
actions: c,
|
|
10
|
+
className: l
|
|
11
|
+
}) }), /* @__PURE__ */ i(t, {
|
|
12
|
+
className: "space-y-4",
|
|
13
|
+
children: u
|
|
14
|
+
})] });
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { o as AppTabContainer };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AppActions as e } from "../layouts/AppActions.js";
|
|
2
|
+
import { AppTitle as t } from "../layouts/AppTitle.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/core/tabs/AppTabHeader.tsx
|
|
5
|
+
function i({ titleKey: i, descriptionKey: a, actions: o = [], className: s }) {
|
|
6
|
+
return /* @__PURE__ */ r("div", {
|
|
7
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
8
|
+
children: [/* @__PURE__ */ n(t, {
|
|
9
|
+
titleKey: i,
|
|
10
|
+
descriptionKey: a,
|
|
11
|
+
isSubTitle: !0
|
|
12
|
+
}), /* @__PURE__ */ n(e, {
|
|
13
|
+
actions: o,
|
|
14
|
+
className: s
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { i as AppTabHeader };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn as e } from "../../../helpers/tailwind.helper.js";
|
|
2
|
+
import { useKrosoftTranslation as t } from "../../../i18n/useKrosoftTranslation.js";
|
|
3
|
+
import { Tabs as n, TabsContent as r, TabsList as i, TabsTrigger as a } from "../../ui/tabs.js";
|
|
4
|
+
import { useEffect as o, useRef as s } from "react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { useSearchParams as u } from "react-router-dom";
|
|
7
|
+
//#region src/components/core/tabs/AppTabs.tsx
|
|
8
|
+
function d({ tabs: d, itemId: f, item: p, fit: m, paramName: h = "tab" }) {
|
|
9
|
+
let { t: g } = t(), [_, v] = u(), y = _.get(h), b = d.find((e) => e.value === y)?.value ?? d[0]?.value, x = (e) => {
|
|
10
|
+
let t = new URLSearchParams(_);
|
|
11
|
+
t.set(h, e), v(t);
|
|
12
|
+
}, S = s(null);
|
|
13
|
+
return o(() => {
|
|
14
|
+
(S.current?.querySelector("[data-state=\"active\"]"))?.scrollIntoView?.({
|
|
15
|
+
behavior: "smooth",
|
|
16
|
+
block: "nearest",
|
|
17
|
+
inline: "nearest"
|
|
18
|
+
});
|
|
19
|
+
}, [b]), /* @__PURE__ */ l(n, {
|
|
20
|
+
value: b,
|
|
21
|
+
onValueChange: x,
|
|
22
|
+
children: [/* @__PURE__ */ c(i, {
|
|
23
|
+
ref: S,
|
|
24
|
+
className: e("w-full justify-start", m && "sm:w-fit"),
|
|
25
|
+
children: d.map((e) => /* @__PURE__ */ l(a, {
|
|
26
|
+
value: e.value,
|
|
27
|
+
className: "gap-2",
|
|
28
|
+
disabled: e.disabled,
|
|
29
|
+
children: [
|
|
30
|
+
e.icon ? /* @__PURE__ */ c("span", {
|
|
31
|
+
className: "hidden sm:inline",
|
|
32
|
+
children: /* @__PURE__ */ c(e.icon, { className: "size-4" })
|
|
33
|
+
}) : null,
|
|
34
|
+
/* @__PURE__ */ c("span", {
|
|
35
|
+
className: "text-xs sm:text-sm",
|
|
36
|
+
children: g(e.titleKey) ?? ""
|
|
37
|
+
}),
|
|
38
|
+
e.count ? /* @__PURE__ */ l("span", {
|
|
39
|
+
className: "text-gray-500 text-xs",
|
|
40
|
+
children: [
|
|
41
|
+
"(",
|
|
42
|
+
e.count(p),
|
|
43
|
+
")"
|
|
44
|
+
]
|
|
45
|
+
}) : null
|
|
46
|
+
]
|
|
47
|
+
}, e.value))
|
|
48
|
+
}), d.map((e) => /* @__PURE__ */ c(r, {
|
|
49
|
+
value: e.value,
|
|
50
|
+
className: "mt-4",
|
|
51
|
+
children: e.component ? e.component(f) : null
|
|
52
|
+
}, e.value))]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { d as AppTabs };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useKrosoftTranslation as e } from "../../../i18n/useKrosoftTranslation.js";
|
|
2
|
+
import { ScrollArea as t } from "../../ui/scroll-area.js";
|
|
3
|
+
import { Select as n, SelectContent as r, SelectItem as i, SelectTrigger as a, SelectValue as o } from "../../ui/select.js";
|
|
4
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
import { ConstructionIcon as l } from "lucide-react";
|
|
6
|
+
import { useSearchParams as u } from "react-router-dom";
|
|
7
|
+
//#region src/components/core/tabs/AppVerticalTabs.tsx
|
|
8
|
+
var d = ({ tabs: d, item: f }) => {
|
|
9
|
+
let { t: p } = e(), [m, h] = u(), g = m.get("tab"), _ = d.find((e) => e.value === g)?.value ?? d[0]?.value, v = (e) => {
|
|
10
|
+
let t = new URLSearchParams();
|
|
11
|
+
t.set("tab", e), h(t);
|
|
12
|
+
}, y = () => {
|
|
13
|
+
let e = d.find((e) => e.value === _);
|
|
14
|
+
return e ? e.component ? e.component() : b() : null;
|
|
15
|
+
}, b = () => /* @__PURE__ */ s("div", {
|
|
16
|
+
className: "p-4 lg:p-6",
|
|
17
|
+
children: /* @__PURE__ */ s("div", {
|
|
18
|
+
className: "flex items-center justify-center h-64 text-gray-500",
|
|
19
|
+
children: /* @__PURE__ */ c("div", {
|
|
20
|
+
className: "text-center",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ s(l, { className: "h-12 w-12 mx-auto mb-4 text-amber-500" }),
|
|
23
|
+
/* @__PURE__ */ s("p", {
|
|
24
|
+
className: "text-lg font-medium",
|
|
25
|
+
children: p("states.underConstruction")
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ s("p", {
|
|
28
|
+
className: "text-sm text-gray-400",
|
|
29
|
+
children: p("states.comingSoon")
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ c("div", {
|
|
36
|
+
className: "flex flex-col md:flex-row h-full min-w-0 ",
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ s("div", {
|
|
39
|
+
className: "w-64 lg:w-80 flex-shrink-0 hidden md:block border-r border-gray-200 dark:border-gray-700 pr-4",
|
|
40
|
+
children: /* @__PURE__ */ s(t, {
|
|
41
|
+
className: "h-full",
|
|
42
|
+
children: /* @__PURE__ */ s("div", {
|
|
43
|
+
className: "space-y-1",
|
|
44
|
+
children: d.map((e, t) => /* @__PURE__ */ c("div", {
|
|
45
|
+
className: `px-2 py-2 rounded-control text-sm transition-colors flex items-center gap-2 ${e.disabled ? "text-gray-400 cursor-not-allowed opacity-50" : _ === e.value ? "crm-color-styled font-medium cursor-pointer" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 cursor-pointer"}`,
|
|
46
|
+
onClick: () => !e.disabled && v(e.value),
|
|
47
|
+
children: [
|
|
48
|
+
e.icon && /* @__PURE__ */ s(e.icon, { className: "size-4" }),
|
|
49
|
+
/* @__PURE__ */ s("span", {
|
|
50
|
+
className: "flex-1",
|
|
51
|
+
children: p(e.titleKey)
|
|
52
|
+
}),
|
|
53
|
+
e.count && /* @__PURE__ */ c("span", {
|
|
54
|
+
className: "text-xs text-gray-500",
|
|
55
|
+
children: [
|
|
56
|
+
"(",
|
|
57
|
+
e.count(f),
|
|
58
|
+
")"
|
|
59
|
+
]
|
|
60
|
+
}),
|
|
61
|
+
!e.component && /* @__PURE__ */ s(l, { className: "size-4 text-amber-500" })
|
|
62
|
+
]
|
|
63
|
+
}, t))
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ s("div", {
|
|
68
|
+
className: "md:hidden w-full border-b pb-4 mb-4",
|
|
69
|
+
children: /* @__PURE__ */ c(n, {
|
|
70
|
+
value: _,
|
|
71
|
+
onValueChange: v,
|
|
72
|
+
children: [/* @__PURE__ */ s(a, {
|
|
73
|
+
className: "w-full",
|
|
74
|
+
children: /* @__PURE__ */ s(o, { placeholder: p("select.section") })
|
|
75
|
+
}), /* @__PURE__ */ s(r, { children: d.map((e, t) => /* @__PURE__ */ s(i, {
|
|
76
|
+
value: e.value,
|
|
77
|
+
disabled: e.disabled,
|
|
78
|
+
children: /* @__PURE__ */ c("div", {
|
|
79
|
+
className: "flex items-center gap-2",
|
|
80
|
+
children: [
|
|
81
|
+
e.icon && /* @__PURE__ */ s(e.icon, { className: "size-4" }),
|
|
82
|
+
/* @__PURE__ */ s("span", { children: p(e.titleKey) }),
|
|
83
|
+
e.count && /* @__PURE__ */ c("span", {
|
|
84
|
+
className: "text-xs text-gray-500",
|
|
85
|
+
children: [
|
|
86
|
+
"(",
|
|
87
|
+
e.count(f),
|
|
88
|
+
")"
|
|
89
|
+
]
|
|
90
|
+
}),
|
|
91
|
+
!e.component && /* @__PURE__ */ s(l, { className: "size-4 text-amber-500" })
|
|
92
|
+
]
|
|
93
|
+
})
|
|
94
|
+
}, t)) })]
|
|
95
|
+
})
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ s("div", {
|
|
98
|
+
className: "flex-1 md:px-4 min-w-0 overflow-auto",
|
|
99
|
+
children: y()
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
//#endregion
|
|
105
|
+
export { d as AppVerticalTabs };
|
|
@@ -1,188 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { i as u, l as d, n as f, t as p, u as m } from "../../../select-KWMg2_7Z.js";
|
|
7
|
-
import { t as h } from "../../../AppActions-8HjAaTQK.js";
|
|
8
|
-
import { t as g } from "../../../AppTitle-BXoTrXQc.js";
|
|
9
|
-
import { useEffect as _, useRef as v } from "react";
|
|
10
|
-
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
11
|
-
import { ConstructionIcon as x } from "lucide-react";
|
|
12
|
-
import { useSearchParams as S } from "react-router-dom";
|
|
13
|
-
//#region src/components/core/tabs/AppTabHeader.tsx
|
|
14
|
-
function C({ titleKey: e, descriptionKey: t, actions: n = [], className: r }) {
|
|
15
|
-
return /* @__PURE__ */ b("div", {
|
|
16
|
-
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
17
|
-
children: [/* @__PURE__ */ y(g, {
|
|
18
|
-
titleKey: e,
|
|
19
|
-
descriptionKey: t,
|
|
20
|
-
isSubTitle: !0
|
|
21
|
-
}), /* @__PURE__ */ y(h, {
|
|
22
|
-
actions: n,
|
|
23
|
-
className: r
|
|
24
|
-
})]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/components/core/tabs/AppTabContainer.tsx
|
|
29
|
-
function w({ titleKey: e, descriptionKey: i, actions: a = [], className: o, children: s, isSubTitle: c }) {
|
|
30
|
-
return /* @__PURE__ */ b(r, { children: [/* @__PURE__ */ y(n, { children: /* @__PURE__ */ y(C, {
|
|
31
|
-
titleKey: e,
|
|
32
|
-
descriptionKey: i,
|
|
33
|
-
actions: a,
|
|
34
|
-
className: o
|
|
35
|
-
}) }), /* @__PURE__ */ y(t, {
|
|
36
|
-
className: "space-y-4",
|
|
37
|
-
children: s
|
|
38
|
-
})] });
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/components/core/tabs/AppTabs.tsx
|
|
42
|
-
function T({ tabs: t, itemId: n, item: r, fit: l, paramName: u = "tab" }) {
|
|
43
|
-
let { t: d } = i(), [f, p] = S(), m = f.get(u), h = t.find((e) => e.value === m)?.value ?? t[0]?.value, g = (e) => {
|
|
44
|
-
let t = new URLSearchParams(f);
|
|
45
|
-
t.set(u, e), p(t);
|
|
46
|
-
}, x = v(null);
|
|
47
|
-
return _(() => {
|
|
48
|
-
(x.current?.querySelector("[data-state=\"active\"]"))?.scrollIntoView?.({
|
|
49
|
-
behavior: "smooth",
|
|
50
|
-
block: "nearest",
|
|
51
|
-
inline: "nearest"
|
|
52
|
-
});
|
|
53
|
-
}, [h]), /* @__PURE__ */ b(c, {
|
|
54
|
-
value: h,
|
|
55
|
-
onValueChange: g,
|
|
56
|
-
children: [/* @__PURE__ */ y(o, {
|
|
57
|
-
ref: x,
|
|
58
|
-
className: e("w-full justify-start", l && "sm:w-fit"),
|
|
59
|
-
children: t.map((e) => /* @__PURE__ */ b(a, {
|
|
60
|
-
value: e.value,
|
|
61
|
-
className: "gap-2",
|
|
62
|
-
disabled: e.disabled,
|
|
63
|
-
children: [
|
|
64
|
-
e.icon ? /* @__PURE__ */ y("span", {
|
|
65
|
-
className: "hidden sm:inline",
|
|
66
|
-
children: /* @__PURE__ */ y(e.icon, { className: "size-4" })
|
|
67
|
-
}) : null,
|
|
68
|
-
/* @__PURE__ */ y("span", {
|
|
69
|
-
className: "text-xs sm:text-sm",
|
|
70
|
-
children: d(e.titleKey) ?? ""
|
|
71
|
-
}),
|
|
72
|
-
e.count ? /* @__PURE__ */ b("span", {
|
|
73
|
-
className: "text-gray-500 text-xs",
|
|
74
|
-
children: [
|
|
75
|
-
"(",
|
|
76
|
-
e.count(r),
|
|
77
|
-
")"
|
|
78
|
-
]
|
|
79
|
-
}) : null
|
|
80
|
-
]
|
|
81
|
-
}, e.value))
|
|
82
|
-
}), t.map((e) => /* @__PURE__ */ y(s, {
|
|
83
|
-
value: e.value,
|
|
84
|
-
className: "mt-4",
|
|
85
|
-
children: e.component ? e.component(n) : null
|
|
86
|
-
}, e.value))]
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/components/core/tabs/AppVerticalTabs.tsx
|
|
91
|
-
var E = ({ tabs: e, item: t }) => {
|
|
92
|
-
let { t: n } = i(), [r, a] = S(), o = r.get("tab"), s = e.find((e) => e.value === o)?.value ?? e[0]?.value, c = (e) => {
|
|
93
|
-
let t = new URLSearchParams();
|
|
94
|
-
t.set("tab", e), a(t);
|
|
95
|
-
}, h = () => {
|
|
96
|
-
let t = e.find((e) => e.value === s);
|
|
97
|
-
return t ? t.component ? t.component() : g() : null;
|
|
98
|
-
}, g = () => /* @__PURE__ */ y("div", {
|
|
99
|
-
className: "p-4 lg:p-6",
|
|
100
|
-
children: /* @__PURE__ */ y("div", {
|
|
101
|
-
className: "flex items-center justify-center h-64 text-gray-500",
|
|
102
|
-
children: /* @__PURE__ */ b("div", {
|
|
103
|
-
className: "text-center",
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ y(x, { className: "h-12 w-12 mx-auto mb-4 text-amber-500" }),
|
|
106
|
-
/* @__PURE__ */ y("p", {
|
|
107
|
-
className: "text-lg font-medium",
|
|
108
|
-
children: n("states.underConstruction")
|
|
109
|
-
}),
|
|
110
|
-
/* @__PURE__ */ y("p", {
|
|
111
|
-
className: "text-sm text-gray-400",
|
|
112
|
-
children: n("states.comingSoon")
|
|
113
|
-
})
|
|
114
|
-
]
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
});
|
|
118
|
-
return /* @__PURE__ */ b("div", {
|
|
119
|
-
className: "flex flex-col md:flex-row h-full min-w-0 ",
|
|
120
|
-
children: [
|
|
121
|
-
/* @__PURE__ */ y("div", {
|
|
122
|
-
className: "w-64 lg:w-80 flex-shrink-0 hidden md:block border-r border-gray-200 dark:border-gray-700 pr-4",
|
|
123
|
-
children: /* @__PURE__ */ y(l, {
|
|
124
|
-
className: "h-full",
|
|
125
|
-
children: /* @__PURE__ */ y("div", {
|
|
126
|
-
className: "space-y-1",
|
|
127
|
-
children: e.map((e, r) => /* @__PURE__ */ b("div", {
|
|
128
|
-
className: `px-2 py-2 rounded-control text-sm transition-colors flex items-center gap-2 ${e.disabled ? "text-gray-400 cursor-not-allowed opacity-50" : s === e.value ? "crm-color-styled font-medium cursor-pointer" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 cursor-pointer"}`,
|
|
129
|
-
onClick: () => !e.disabled && c(e.value),
|
|
130
|
-
children: [
|
|
131
|
-
e.icon && /* @__PURE__ */ y(e.icon, { className: "size-4" }),
|
|
132
|
-
/* @__PURE__ */ y("span", {
|
|
133
|
-
className: "flex-1",
|
|
134
|
-
children: n(e.titleKey)
|
|
135
|
-
}),
|
|
136
|
-
e.count && /* @__PURE__ */ b("span", {
|
|
137
|
-
className: "text-xs text-gray-500",
|
|
138
|
-
children: [
|
|
139
|
-
"(",
|
|
140
|
-
e.count(t),
|
|
141
|
-
")"
|
|
142
|
-
]
|
|
143
|
-
}),
|
|
144
|
-
!e.component && /* @__PURE__ */ y(x, { className: "size-4 text-amber-500" })
|
|
145
|
-
]
|
|
146
|
-
}, r))
|
|
147
|
-
})
|
|
148
|
-
})
|
|
149
|
-
}),
|
|
150
|
-
/* @__PURE__ */ y("div", {
|
|
151
|
-
className: "md:hidden w-full border-b pb-4 mb-4",
|
|
152
|
-
children: /* @__PURE__ */ b(p, {
|
|
153
|
-
value: s,
|
|
154
|
-
onValueChange: c,
|
|
155
|
-
children: [/* @__PURE__ */ y(d, {
|
|
156
|
-
className: "w-full",
|
|
157
|
-
children: /* @__PURE__ */ y(m, { placeholder: n("select.section") })
|
|
158
|
-
}), /* @__PURE__ */ y(f, { children: e.map((e, r) => /* @__PURE__ */ y(u, {
|
|
159
|
-
value: e.value,
|
|
160
|
-
disabled: e.disabled,
|
|
161
|
-
children: /* @__PURE__ */ b("div", {
|
|
162
|
-
className: "flex items-center gap-2",
|
|
163
|
-
children: [
|
|
164
|
-
e.icon && /* @__PURE__ */ y(e.icon, { className: "size-4" }),
|
|
165
|
-
/* @__PURE__ */ y("span", { children: n(e.titleKey) }),
|
|
166
|
-
e.count && /* @__PURE__ */ b("span", {
|
|
167
|
-
className: "text-xs text-gray-500",
|
|
168
|
-
children: [
|
|
169
|
-
"(",
|
|
170
|
-
e.count(t),
|
|
171
|
-
")"
|
|
172
|
-
]
|
|
173
|
-
}),
|
|
174
|
-
!e.component && /* @__PURE__ */ y(x, { className: "size-4 text-amber-500" })
|
|
175
|
-
]
|
|
176
|
-
})
|
|
177
|
-
}, r)) })]
|
|
178
|
-
})
|
|
179
|
-
}),
|
|
180
|
-
/* @__PURE__ */ y("div", {
|
|
181
|
-
className: "flex-1 md:px-4 min-w-0 overflow-auto",
|
|
182
|
-
children: h()
|
|
183
|
-
})
|
|
184
|
-
]
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
//#endregion
|
|
188
|
-
export { w as AppTabContainer, C as AppTabHeader, T as AppTabs, E as AppVerticalTabs };
|
|
1
|
+
import { AppTabHeader as e } from "./AppTabHeader.js";
|
|
2
|
+
import { AppTabContainer as t } from "./AppTabContainer.js";
|
|
3
|
+
import { AppTabs as n } from "./AppTabs.js";
|
|
4
|
+
import { AppVerticalTabs as r } from "./AppVerticalTabs.js";
|
|
5
|
+
export { t as AppTabContainer, e as AppTabHeader, n as AppTabs, r as AppVerticalTabs };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useKrosoftTranslation as e } from "../../../i18n/useKrosoftTranslation.js";
|
|
2
|
+
import { Button as t } from "../../ui/button.js";
|
|
3
|
+
import { Select as n, SelectContent as r, SelectItem as i, SelectTrigger as a, SelectValue as o } from "../../ui/select.js";
|
|
4
|
+
import { Tooltip as s, TooltipContent as c, TooltipProvider as l, TooltipTrigger as u } from "../../ui/tooltip.js";
|
|
5
|
+
import { useTheme as d } from "../../../hooks/ui/useTheme.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/core/theme/ThemeSelector.tsx
|
|
@@ -9,7 +10,7 @@ function m({ themeOptions: m, variant: h = "select", id: g, className: _ }) {
|
|
|
9
10
|
let { t: v } = e(), { theme: y, handleThemeChange: b, currentThemeOption: x, nextThemeOption: S, cycleTheme: C } = d(m);
|
|
10
11
|
if (h === "mini") {
|
|
11
12
|
let e = x?.icon;
|
|
12
|
-
return /* @__PURE__ */ f(
|
|
13
|
+
return /* @__PURE__ */ f(l, { children: /* @__PURE__ */ p(s, { children: [/* @__PURE__ */ f(u, {
|
|
13
14
|
asChild: !0,
|
|
14
15
|
children: /* @__PURE__ */ p(t, {
|
|
15
16
|
id: g,
|
|
@@ -22,7 +23,7 @@ function m({ themeOptions: m, variant: h = "select", id: g, className: _ }) {
|
|
|
22
23
|
children: ["Thème actuel : ", x?.label]
|
|
23
24
|
})]
|
|
24
25
|
})
|
|
25
|
-
}), /* @__PURE__ */ p(
|
|
26
|
+
}), /* @__PURE__ */ p(c, {
|
|
26
27
|
side: "bottom",
|
|
27
28
|
align: "center",
|
|
28
29
|
children: ["Passer en ", S?.label]
|
|
@@ -30,16 +31,16 @@ function m({ themeOptions: m, variant: h = "select", id: g, className: _ }) {
|
|
|
30
31
|
}
|
|
31
32
|
return /* @__PURE__ */ p("div", {
|
|
32
33
|
className: "space-y-2",
|
|
33
|
-
children: [/* @__PURE__ */ p(
|
|
34
|
+
children: [/* @__PURE__ */ p(n, {
|
|
34
35
|
value: y,
|
|
35
36
|
onValueChange: b,
|
|
36
|
-
children: [/* @__PURE__ */ f(
|
|
37
|
+
children: [/* @__PURE__ */ f(a, {
|
|
37
38
|
id: g,
|
|
38
39
|
className: "w-full",
|
|
39
|
-
children: /* @__PURE__ */ f(
|
|
40
|
-
}), /* @__PURE__ */ f(
|
|
40
|
+
children: /* @__PURE__ */ f(o, { placeholder: v("select.theme") })
|
|
41
|
+
}), /* @__PURE__ */ f(r, { children: m.map((e) => {
|
|
41
42
|
let t = e.icon;
|
|
42
|
-
return /* @__PURE__ */ f(
|
|
43
|
+
return /* @__PURE__ */ f(i, {
|
|
43
44
|
value: e.value,
|
|
44
45
|
children: /* @__PURE__ */ p("div", {
|
|
45
46
|
className: "flex items-center gap-2",
|
|
@@ -54,4 +55,4 @@ function m({ themeOptions: m, variant: h = "select", id: g, className: _ }) {
|
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
//#endregion
|
|
57
|
-
export { m as
|
|
58
|
+
export { m as ThemeSelector };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ThemeSelector } from "./ThemeSelector.js";
|