@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
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { filterChangelog as t, getChangelogItemAnchors as n, getChangelogTags as r, parseChangelog as i, splitChangelogItems as a } from "./helpers/index.js";
|
|
3
|
-
import { r as o, t as s } from "./i18n-BhLphJa3.js";
|
|
4
|
-
import { Nn as c } from "./ui-Fxy95kSJ.js";
|
|
5
|
-
import { t as l } from "./SearchInput-IT_Rvthr.js";
|
|
6
|
-
import { t as u } from "./useNotifications-CyhTruIG.js";
|
|
7
|
-
import { t as d } from "./AppMarkdown-CAxm82x0.js";
|
|
8
|
-
import { useEffect as f, useMemo as p, useState as m } from "react";
|
|
9
|
-
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
|
-
import { HashIcon as _, LinkIcon as v, TagIcon as y } from "lucide-react";
|
|
11
|
-
import { useLocation as b, useNavigate as x } from "react-router-dom";
|
|
12
|
-
import { format as S } from "date-fns";
|
|
13
|
-
//#region src/components/core/changelog/AppChangelogEntry.tsx
|
|
14
|
-
var C = ({ entry: t, onSelect: r, onCopyLink: i, selectedTags: c, linkedId: l }) => {
|
|
15
|
-
let { t: u } = s(), f = o(), m = p(() => a(t.content), [t.content]), b = p(() => n(t.id, m), [t.id, m]), x = t.date ? S(t.date, t.hasTime ? "d MMMM yyyy - HH:mm" : "d MMMM yyyy", { locale: f }) : void 0, C = (e) => {
|
|
16
|
-
e.preventDefault(), r(t.id);
|
|
17
|
-
}, w = /* @__PURE__ */ h("button", {
|
|
18
|
-
type: "button",
|
|
19
|
-
onClick: () => {
|
|
20
|
-
i(t.id);
|
|
21
|
-
},
|
|
22
|
-
title: u("markdown.copyLink"),
|
|
23
|
-
"aria-label": u("markdown.copyLink"),
|
|
24
|
-
className: "inline-flex shrink-0 text-muted-foreground transition-opacity hover:text-primary md:opacity-0 md:focus-visible:opacity-100 md:group-hover:opacity-100",
|
|
25
|
-
children: /* @__PURE__ */ h(v, { className: "size-4" })
|
|
26
|
-
});
|
|
27
|
-
return /* @__PURE__ */ g("article", {
|
|
28
|
-
id: t.id,
|
|
29
|
-
className: "group scroll-mt-4 py-8 first:pt-0",
|
|
30
|
-
children: [/* @__PURE__ */ g("div", {
|
|
31
|
-
className: "mb-4 flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
32
|
-
children: [
|
|
33
|
-
t.version === void 0 ? null : /* @__PURE__ */ g("span", {
|
|
34
|
-
title: u("changelog.version", { version: t.version }),
|
|
35
|
-
className: "inline-flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/10 px-2.5 py-0.5 font-mono text-xs font-semibold text-primary",
|
|
36
|
-
children: [/* @__PURE__ */ h(y, {
|
|
37
|
-
className: "size-3",
|
|
38
|
-
"aria-hidden": "true"
|
|
39
|
-
}), t.version]
|
|
40
|
-
}),
|
|
41
|
-
t.title === void 0 ? null : /* @__PURE__ */ h("h2", {
|
|
42
|
-
className: "text-lg font-semibold leading-tight text-foreground",
|
|
43
|
-
children: t.title
|
|
44
|
-
}),
|
|
45
|
-
x === void 0 ? null : /* @__PURE__ */ h("a", {
|
|
46
|
-
href: `#${t.id}`,
|
|
47
|
-
onClick: C,
|
|
48
|
-
className: "text-sm font-medium text-muted-foreground hover:text-primary",
|
|
49
|
-
children: x
|
|
50
|
-
}),
|
|
51
|
-
w
|
|
52
|
-
]
|
|
53
|
-
}), /* @__PURE__ */ h("div", {
|
|
54
|
-
className: "space-y-4 pl-4 sm:pl-6",
|
|
55
|
-
children: m.map((t, n) => {
|
|
56
|
-
let r = b[n];
|
|
57
|
-
return /* @__PURE__ */ g("div", {
|
|
58
|
-
id: r,
|
|
59
|
-
className: e("scroll-mt-4 rounded-md", r !== void 0 && r === l && "-mx-3 bg-primary/5 px-3 py-2 ring-1 ring-primary/20"),
|
|
60
|
-
children: [t.tag === void 0 || r === void 0 ? null : /* @__PURE__ */ g("p", {
|
|
61
|
-
className: e("mb-1 flex items-center gap-1.5 text-sm font-semibold", c.includes(t.tag) ? "text-primary" : "text-foreground"),
|
|
62
|
-
children: [/* @__PURE__ */ h("button", {
|
|
63
|
-
type: "button",
|
|
64
|
-
onClick: () => {
|
|
65
|
-
i(r);
|
|
66
|
-
},
|
|
67
|
-
title: u("markdown.copyLink"),
|
|
68
|
-
"aria-label": u("markdown.copyLink"),
|
|
69
|
-
className: "inline-flex shrink-0 text-muted-foreground opacity-60 transition hover:text-primary hover:opacity-100",
|
|
70
|
-
children: /* @__PURE__ */ h(_, {
|
|
71
|
-
className: "size-3.5",
|
|
72
|
-
"aria-hidden": "true"
|
|
73
|
-
})
|
|
74
|
-
}), t.tag]
|
|
75
|
-
}), /* @__PURE__ */ h("div", {
|
|
76
|
-
className: e("min-w-0 [&>*:last-child]:mb-0", t.tag !== void 0 && "pl-5"),
|
|
77
|
-
children: /* @__PURE__ */ h(d, {
|
|
78
|
-
content: t.content,
|
|
79
|
-
headingAnchors: !1
|
|
80
|
-
})
|
|
81
|
-
})]
|
|
82
|
-
}, r ?? `item-${String(n)}`);
|
|
83
|
-
})
|
|
84
|
-
})]
|
|
85
|
-
});
|
|
86
|
-
}, w = ({ entries: t, activeId: n, onSelect: r, className: i }) => {
|
|
87
|
-
let { t: a } = s(), c = o();
|
|
88
|
-
return /* @__PURE__ */ g("nav", {
|
|
89
|
-
"aria-label": a("changelog.nav"),
|
|
90
|
-
className: i,
|
|
91
|
-
children: [/* @__PURE__ */ h("p", {
|
|
92
|
-
className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
93
|
-
children: a("changelog.nav")
|
|
94
|
-
}), /* @__PURE__ */ h("ul", {
|
|
95
|
-
className: "space-y-1",
|
|
96
|
-
children: t.map((t) => {
|
|
97
|
-
let i = t.id === n, o = t.date ? S(t.date, t.hasTime ? "d MMM yyyy - HH:mm" : "d MMM yyyy", { locale: c }) : void 0, s = t.title ?? o ?? t.heading, l = [t.version === void 0 ? void 0 : a("changelog.version", { version: t.version }), t.title === void 0 ? void 0 : o].filter(Boolean).join(" ");
|
|
98
|
-
return /* @__PURE__ */ h("li", { children: /* @__PURE__ */ g("a", {
|
|
99
|
-
href: `#${t.id}`,
|
|
100
|
-
onClick: (e) => {
|
|
101
|
-
e.preventDefault(), r(t.id);
|
|
102
|
-
},
|
|
103
|
-
"aria-current": i ? "location" : void 0,
|
|
104
|
-
className: e("block rounded-md border border-transparent px-3 py-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground", i && "border-border bg-muted text-foreground"),
|
|
105
|
-
children: [/* @__PURE__ */ h("span", {
|
|
106
|
-
className: e("block", i && "font-semibold"),
|
|
107
|
-
children: s
|
|
108
|
-
}), l === "" ? null : /* @__PURE__ */ h("span", {
|
|
109
|
-
className: "mt-0.5 block whitespace-pre text-xs text-muted-foreground",
|
|
110
|
-
children: l
|
|
111
|
-
})]
|
|
112
|
-
}) }, t.id);
|
|
113
|
-
})
|
|
114
|
-
})]
|
|
115
|
-
});
|
|
116
|
-
}, T = ({ tags: t, selected: n, onToggle: r, onClear: i, className: a }) => {
|
|
117
|
-
let { t: o } = s();
|
|
118
|
-
return /* @__PURE__ */ g("div", {
|
|
119
|
-
className: a,
|
|
120
|
-
children: [/* @__PURE__ */ g("div", {
|
|
121
|
-
className: "mb-2 flex items-center justify-between gap-2",
|
|
122
|
-
children: [/* @__PURE__ */ h("p", {
|
|
123
|
-
className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
124
|
-
children: o("changelog.tagsPlaceholder")
|
|
125
|
-
}), n.length > 0 ? /* @__PURE__ */ h("button", {
|
|
126
|
-
type: "button",
|
|
127
|
-
onClick: i,
|
|
128
|
-
className: "text-xs text-muted-foreground hover:text-foreground",
|
|
129
|
-
children: o("actions.clear")
|
|
130
|
-
}) : null]
|
|
131
|
-
}), /* @__PURE__ */ h("div", {
|
|
132
|
-
className: "flex flex-wrap gap-1.5",
|
|
133
|
-
children: t.map((t) => {
|
|
134
|
-
let i = n.includes(t);
|
|
135
|
-
return /* @__PURE__ */ h("button", {
|
|
136
|
-
type: "button",
|
|
137
|
-
"aria-pressed": i,
|
|
138
|
-
onClick: () => {
|
|
139
|
-
r(t);
|
|
140
|
-
},
|
|
141
|
-
className: e(c({ variant: i ? "default" : "outline" }), "cursor-pointer font-medium focus:ring-0 focus-visible:ring-2", !i && "hover:bg-muted"),
|
|
142
|
-
children: t
|
|
143
|
-
}, t);
|
|
144
|
-
})
|
|
145
|
-
})]
|
|
146
|
-
});
|
|
147
|
-
}, E = "0px 0px -60% 0px", D = ({ content: o, showNav: c = !0, showSearch: d = !0 }) => {
|
|
148
|
-
let { t: _ } = s(), { showSuccess: v, showError: y } = u(), S = b(), D = x(), [O, k] = m(""), [A, j] = m([]), [M, N] = m(), P = p(() => i(o), [o]), F = p(() => r(P), [P]), I = p(() => t(P, O, A), [
|
|
149
|
-
P,
|
|
150
|
-
O,
|
|
151
|
-
A
|
|
152
|
-
]), L = (e) => {
|
|
153
|
-
j((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
154
|
-
}, R = p(() => {
|
|
155
|
-
let e = /* @__PURE__ */ new Map();
|
|
156
|
-
return I.forEach((t) => {
|
|
157
|
-
n(t.id, a(t.content)).forEach((n) => {
|
|
158
|
-
n !== void 0 && e.set(n, t.id);
|
|
159
|
-
});
|
|
160
|
-
}), e;
|
|
161
|
-
}, [I]), z = decodeURIComponent(S.hash.slice(1)), B = I.some((e) => e.id === z) ? z : R.get(z), V = B === void 0 ? void 0 : z, H = I.some((e) => e.id === M) ? M : B ?? I[0]?.id;
|
|
162
|
-
f(() => {
|
|
163
|
-
if (!V) return;
|
|
164
|
-
let e = requestAnimationFrame(() => {
|
|
165
|
-
document.getElementById(V)?.scrollIntoView({
|
|
166
|
-
behavior: "smooth",
|
|
167
|
-
block: "start"
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
return () => {
|
|
171
|
-
cancelAnimationFrame(e);
|
|
172
|
-
};
|
|
173
|
-
}, [V]), f(() => {
|
|
174
|
-
let e = /* @__PURE__ */ new Set(), t = new IntersectionObserver((t) => {
|
|
175
|
-
t.forEach((t) => {
|
|
176
|
-
t.isIntersecting ? e.add(t.target.id) : e.delete(t.target.id);
|
|
177
|
-
});
|
|
178
|
-
let n = I.find((t) => e.has(t.id));
|
|
179
|
-
n && N(n.id);
|
|
180
|
-
}, { rootMargin: E });
|
|
181
|
-
return I.forEach((e) => {
|
|
182
|
-
let n = document.getElementById(e.id);
|
|
183
|
-
n && t.observe(n);
|
|
184
|
-
}), () => {
|
|
185
|
-
t.disconnect();
|
|
186
|
-
};
|
|
187
|
-
}, [I]);
|
|
188
|
-
let U = (e) => {
|
|
189
|
-
D({
|
|
190
|
-
search: S.search,
|
|
191
|
-
hash: `#${e}`
|
|
192
|
-
}, { replace: !0 });
|
|
193
|
-
}, W = async (e) => {
|
|
194
|
-
U(e);
|
|
195
|
-
let t = `${window.location.origin}${S.pathname}${S.search}#${e}`;
|
|
196
|
-
try {
|
|
197
|
-
await navigator.clipboard.writeText(t), v(_("markdown.linkCopied"));
|
|
198
|
-
} catch {
|
|
199
|
-
y(_("markdown.linkCopyError"));
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
if (P.length === 0) return /* @__PURE__ */ h("p", {
|
|
203
|
-
className: "text-sm text-muted-foreground",
|
|
204
|
-
children: _("changelog.empty")
|
|
205
|
-
});
|
|
206
|
-
let G = /* @__PURE__ */ g("div", {
|
|
207
|
-
className: "flex flex-col gap-4",
|
|
208
|
-
children: [/* @__PURE__ */ h(l, {
|
|
209
|
-
search: O,
|
|
210
|
-
onSearch: k,
|
|
211
|
-
className: "md:w-full"
|
|
212
|
-
}), F.length > 0 ? /* @__PURE__ */ h(T, {
|
|
213
|
-
tags: F,
|
|
214
|
-
selected: A,
|
|
215
|
-
onToggle: L,
|
|
216
|
-
onClear: () => {
|
|
217
|
-
j([]);
|
|
218
|
-
}
|
|
219
|
-
}) : null]
|
|
220
|
-
});
|
|
221
|
-
return /* @__PURE__ */ g("div", {
|
|
222
|
-
className: "flex gap-10",
|
|
223
|
-
children: [c ? /* @__PURE__ */ g("aside", {
|
|
224
|
-
className: "sticky top-4 hidden max-h-[calc(100vh-2rem)] w-60 shrink-0 flex-col gap-8 self-start lg:flex",
|
|
225
|
-
children: [d ? G : null, I.length > 0 ? /* @__PURE__ */ h(w, {
|
|
226
|
-
entries: I,
|
|
227
|
-
activeId: H,
|
|
228
|
-
onSelect: U,
|
|
229
|
-
className: "min-h-0 flex-1 overflow-y-auto"
|
|
230
|
-
}) : null]
|
|
231
|
-
}) : null, /* @__PURE__ */ g("div", {
|
|
232
|
-
className: e("min-w-0 flex-1", c && "lg:border-l lg:pl-10"),
|
|
233
|
-
children: [
|
|
234
|
-
d ? /* @__PURE__ */ h("div", {
|
|
235
|
-
className: e("mb-6 md:max-w-md", c && "lg:hidden"),
|
|
236
|
-
children: G
|
|
237
|
-
}) : null,
|
|
238
|
-
I.length === 0 ? /* @__PURE__ */ h("p", {
|
|
239
|
-
className: "text-sm text-muted-foreground",
|
|
240
|
-
children: _("changelog.noResult")
|
|
241
|
-
}) : null,
|
|
242
|
-
/* @__PURE__ */ h("div", {
|
|
243
|
-
className: "divide-y",
|
|
244
|
-
children: I.map((e) => /* @__PURE__ */ h(C, {
|
|
245
|
-
entry: e,
|
|
246
|
-
onSelect: U,
|
|
247
|
-
onCopyLink: (e) => void W(e),
|
|
248
|
-
selectedTags: A,
|
|
249
|
-
linkedId: V
|
|
250
|
-
}, e.id))
|
|
251
|
-
})
|
|
252
|
-
]
|
|
253
|
-
})]
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
//#endregion
|
|
257
|
-
export { D as t };
|
package/dist/charts-C7rKxkli.js
DELETED
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { a as t, c as n, d as r, f as i, l as a, n as o, o as s, r as c, s as l, t as u } from "./chart-wW-fwL3s.js";
|
|
3
|
-
import { t as d } from "./i18n-BhLphJa3.js";
|
|
4
|
-
import { t as f } from "./skeleton-D6Ga4BLw.js";
|
|
5
|
-
import { t as p } from "./useMobile-pTQ8lWvt.js";
|
|
6
|
-
import * as m from "react";
|
|
7
|
-
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
-
import { Bar as _, BarChart as v, CartesianGrid as y, Line as b, LineChart as x, Pie as S, PieChart as C, Rectangle as w, Sector as T, XAxis as E, YAxis as D } from "recharts";
|
|
9
|
-
//#region src/components/core/charts/chartTooltip.helper.tsx
|
|
10
|
-
var O = (e, t) => e ? (n, r) => /* @__PURE__ */ g("div", {
|
|
11
|
-
className: "flex flex-1 justify-between gap-4",
|
|
12
|
-
children: [/* @__PURE__ */ h("span", {
|
|
13
|
-
className: "text-muted-foreground",
|
|
14
|
-
children: t ?? String(r)
|
|
15
|
-
}), /* @__PURE__ */ h("span", {
|
|
16
|
-
className: "font-mono font-medium tabular-nums text-foreground",
|
|
17
|
-
children: e(Number(n))
|
|
18
|
-
})]
|
|
19
|
-
}) : void 0, k = .35, A = (e, t) => t > 0 && e.length > t ? `${e.slice(0, t)}…` : e, j = ({ data: n, label: r = "Valeur", color: i = "hsl(var(--primary))", categoryWidth: a = 140, maxLabelLength: o = 22, valueFormatter: c, onSelect: l, className: d }) => {
|
|
20
|
-
let [f, p] = m.useState(null), b = m.useMemo(() => ({ value: {
|
|
21
|
-
label: r,
|
|
22
|
-
color: i
|
|
23
|
-
} }), [r, i]), x = m.useMemo(() => O(c, r), [c, r]), S = m.useMemo(() => n.some((e) => e.color !== void 0) ? n.map((e) => ({
|
|
24
|
-
...e,
|
|
25
|
-
fill: e.color ?? i
|
|
26
|
-
})) : n, [n, i]);
|
|
27
|
-
return /* @__PURE__ */ h(u, {
|
|
28
|
-
config: b,
|
|
29
|
-
className: e("aspect-auto size-full", d),
|
|
30
|
-
children: /* @__PURE__ */ g(v, {
|
|
31
|
-
data: S,
|
|
32
|
-
layout: "vertical",
|
|
33
|
-
margin: {
|
|
34
|
-
top: 5,
|
|
35
|
-
right: 20,
|
|
36
|
-
left: 0,
|
|
37
|
-
bottom: 5
|
|
38
|
-
},
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ h(y, {
|
|
41
|
-
strokeDasharray: "3 3",
|
|
42
|
-
horizontal: !1
|
|
43
|
-
}),
|
|
44
|
-
/* @__PURE__ */ h(E, {
|
|
45
|
-
type: "number",
|
|
46
|
-
dataKey: "value",
|
|
47
|
-
allowDecimals: !1,
|
|
48
|
-
tickLine: !1,
|
|
49
|
-
axisLine: !1,
|
|
50
|
-
tickMargin: 8,
|
|
51
|
-
tickFormatter: c ? (e) => c(Number(e)) : void 0
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ h(D, {
|
|
54
|
-
type: "category",
|
|
55
|
-
dataKey: "name",
|
|
56
|
-
width: a,
|
|
57
|
-
tickLine: !1,
|
|
58
|
-
axisLine: !1,
|
|
59
|
-
tickFormatter: (e) => A(String(e), o)
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ h(t, { content: /* @__PURE__ */ h(s, { formatter: x }) }),
|
|
62
|
-
/* @__PURE__ */ h(_, {
|
|
63
|
-
dataKey: "value",
|
|
64
|
-
fill: "var(--color-value)",
|
|
65
|
-
radius: [
|
|
66
|
-
0,
|
|
67
|
-
4,
|
|
68
|
-
4,
|
|
69
|
-
0
|
|
70
|
-
],
|
|
71
|
-
className: l ? "cursor-pointer" : void 0,
|
|
72
|
-
onMouseEnter: l ? (e, t) => {
|
|
73
|
-
p(t);
|
|
74
|
-
} : void 0,
|
|
75
|
-
onMouseLeave: l ? () => {
|
|
76
|
-
p(null);
|
|
77
|
-
} : void 0,
|
|
78
|
-
shape: (e) => /* @__PURE__ */ h(w, {
|
|
79
|
-
...e,
|
|
80
|
-
fillOpacity: f !== null && f !== e.index ? k : 1
|
|
81
|
-
}),
|
|
82
|
-
onClick: l ? (e, t) => {
|
|
83
|
-
l(n[t], t);
|
|
84
|
-
} : void 0
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
})
|
|
88
|
-
});
|
|
89
|
-
}, M = ({ data: n, label: r = "Valeur", color: i = "hsl(var(--primary))", labelAngle: a, valueFormatter: o, allowDecimals: c = !1, onSelect: l, className: d }) => {
|
|
90
|
-
let f = m.useMemo(() => ({ value: {
|
|
91
|
-
label: r,
|
|
92
|
-
color: i
|
|
93
|
-
} }), [r, i]), p = m.useMemo(() => O(o, r), [o, r]), b = a !== void 0 && a !== 0, x = m.useMemo(() => n.some((e) => e.color !== void 0) ? n.map((e) => ({
|
|
94
|
-
...e,
|
|
95
|
-
fill: e.color ?? i
|
|
96
|
-
})) : n, [n, i]);
|
|
97
|
-
return /* @__PURE__ */ h(u, {
|
|
98
|
-
config: f,
|
|
99
|
-
className: e("aspect-auto size-full", d),
|
|
100
|
-
children: /* @__PURE__ */ g(v, {
|
|
101
|
-
data: x,
|
|
102
|
-
margin: {
|
|
103
|
-
top: 10,
|
|
104
|
-
right: 10,
|
|
105
|
-
left: 0,
|
|
106
|
-
bottom: b ? 20 : 10
|
|
107
|
-
},
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ h(y, {
|
|
110
|
-
strokeDasharray: "3 3",
|
|
111
|
-
vertical: !1
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ h(E, {
|
|
114
|
-
dataKey: "name",
|
|
115
|
-
angle: a,
|
|
116
|
-
textAnchor: b ? "end" : "middle",
|
|
117
|
-
height: b ? 50 : void 0,
|
|
118
|
-
tickLine: !1,
|
|
119
|
-
axisLine: !1,
|
|
120
|
-
tickMargin: 8
|
|
121
|
-
}),
|
|
122
|
-
/* @__PURE__ */ h(D, {
|
|
123
|
-
allowDecimals: c,
|
|
124
|
-
tickLine: !1,
|
|
125
|
-
axisLine: !1,
|
|
126
|
-
width: o ? 48 : 32,
|
|
127
|
-
tickFormatter: o ? (e) => o(Number(e)) : void 0
|
|
128
|
-
}),
|
|
129
|
-
/* @__PURE__ */ h(t, { content: /* @__PURE__ */ h(s, { formatter: p }) }),
|
|
130
|
-
/* @__PURE__ */ h(_, {
|
|
131
|
-
dataKey: "value",
|
|
132
|
-
fill: "var(--color-value)",
|
|
133
|
-
radius: [
|
|
134
|
-
4,
|
|
135
|
-
4,
|
|
136
|
-
0,
|
|
137
|
-
0
|
|
138
|
-
],
|
|
139
|
-
className: l ? "cursor-pointer" : void 0,
|
|
140
|
-
onClick: l ? (e, t) => {
|
|
141
|
-
l(n[t], t);
|
|
142
|
-
} : void 0
|
|
143
|
-
})
|
|
144
|
-
]
|
|
145
|
-
})
|
|
146
|
-
});
|
|
147
|
-
}, N = [
|
|
148
|
-
"hsl(var(--k-chart-1))",
|
|
149
|
-
"hsl(var(--k-chart-2))",
|
|
150
|
-
"hsl(var(--k-chart-3))",
|
|
151
|
-
"hsl(var(--k-chart-4))",
|
|
152
|
-
"hsl(var(--k-chart-5))"
|
|
153
|
-
], P = (e) => N[e % N.length], F = ({ title: t, description: o, icon: s, actions: c, footer: u, isLoading: p = !1, isEmpty: m = !1, emptyLabel: _, height: v = 300, className: y, contentClassName: b, children: x }) => {
|
|
154
|
-
let { t: S } = d(), C = s;
|
|
155
|
-
return /* @__PURE__ */ g(l, {
|
|
156
|
-
className: y,
|
|
157
|
-
children: [/* @__PURE__ */ h(r, { children: /* @__PURE__ */ g("div", {
|
|
158
|
-
className: "flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",
|
|
159
|
-
children: [/* @__PURE__ */ g("div", {
|
|
160
|
-
className: "min-w-0",
|
|
161
|
-
children: [/* @__PURE__ */ g(i, {
|
|
162
|
-
className: "flex items-center gap-2",
|
|
163
|
-
children: [C && /* @__PURE__ */ h(C, { className: "size-5 shrink-0" }), /* @__PURE__ */ h("span", {
|
|
164
|
-
className: "truncate",
|
|
165
|
-
children: t
|
|
166
|
-
})]
|
|
167
|
-
}), o !== void 0 && o !== "" ? /* @__PURE__ */ h(a, { children: o }) : null]
|
|
168
|
-
}), c == null ? null : /* @__PURE__ */ h("div", {
|
|
169
|
-
className: "shrink-0",
|
|
170
|
-
children: c
|
|
171
|
-
})]
|
|
172
|
-
}) }), /* @__PURE__ */ g(n, { children: [/* @__PURE__ */ h("div", {
|
|
173
|
-
className: e("w-full", b),
|
|
174
|
-
style: v === null ? void 0 : { height: v },
|
|
175
|
-
children: p ? /* @__PURE__ */ h(f, { className: "size-full rounded-surface" }) : m ? /* @__PURE__ */ h("div", {
|
|
176
|
-
className: "flex size-full items-center justify-center",
|
|
177
|
-
children: /* @__PURE__ */ h("p", {
|
|
178
|
-
className: "text-sm text-muted-foreground",
|
|
179
|
-
children: _ ?? S("states.noData")
|
|
180
|
-
})
|
|
181
|
-
}) : x
|
|
182
|
-
}), !p && !m && u != null ? /* @__PURE__ */ h("div", {
|
|
183
|
-
className: "mt-4",
|
|
184
|
-
children: u
|
|
185
|
-
}) : null] })]
|
|
186
|
-
});
|
|
187
|
-
}, I = {
|
|
188
|
-
warning: 50,
|
|
189
|
-
danger: 80
|
|
190
|
-
}, L = (e, t) => e >= t.danger ? "hsl(var(--destructive))" : e >= t.warning ? "hsl(var(--k-warning))" : "hsl(var(--k-success))", R = ({ value: t, max: n = 100, size: r = 120, strokeWidth: i = 8, label: a, unit: o = "%", color: s, thresholds: c = I, valueFormatter: l = (e) => e.toFixed(1), className: u }) => {
|
|
191
|
-
let d = (r - i) / 2, f = d * 2 * Math.PI, p = n > 0 ? Math.min(100, Math.max(0, t / n * 100)) : 0, m = s ?? L(p, c);
|
|
192
|
-
return /* @__PURE__ */ g("div", {
|
|
193
|
-
className: e("flex flex-col items-center gap-2", u),
|
|
194
|
-
children: [/* @__PURE__ */ g("div", {
|
|
195
|
-
className: "relative",
|
|
196
|
-
style: {
|
|
197
|
-
width: r,
|
|
198
|
-
height: r
|
|
199
|
-
},
|
|
200
|
-
children: [/* @__PURE__ */ g("svg", {
|
|
201
|
-
width: r,
|
|
202
|
-
height: r,
|
|
203
|
-
className: "-rotate-90",
|
|
204
|
-
children: [/* @__PURE__ */ h("circle", {
|
|
205
|
-
cx: r / 2,
|
|
206
|
-
cy: r / 2,
|
|
207
|
-
r: d,
|
|
208
|
-
className: "stroke-muted",
|
|
209
|
-
strokeWidth: i,
|
|
210
|
-
fill: "transparent"
|
|
211
|
-
}), /* @__PURE__ */ h("circle", {
|
|
212
|
-
cx: r / 2,
|
|
213
|
-
cy: r / 2,
|
|
214
|
-
r: d,
|
|
215
|
-
stroke: m,
|
|
216
|
-
strokeWidth: i,
|
|
217
|
-
fill: "transparent",
|
|
218
|
-
strokeDasharray: f,
|
|
219
|
-
strokeDashoffset: f - p / 100 * f,
|
|
220
|
-
strokeLinecap: "round",
|
|
221
|
-
className: "transition-all duration-500 ease-out"
|
|
222
|
-
})]
|
|
223
|
-
}), /* @__PURE__ */ g("div", {
|
|
224
|
-
className: "absolute inset-0 flex flex-col items-center justify-center",
|
|
225
|
-
children: [/* @__PURE__ */ h("span", {
|
|
226
|
-
className: "text-2xl font-bold text-card-foreground",
|
|
227
|
-
children: l(t)
|
|
228
|
-
}), o !== "" && /* @__PURE__ */ h("span", {
|
|
229
|
-
className: "text-sm text-muted-foreground",
|
|
230
|
-
children: o
|
|
231
|
-
})]
|
|
232
|
-
})]
|
|
233
|
-
}), a !== void 0 && a !== "" ? /* @__PURE__ */ h("span", {
|
|
234
|
-
className: "text-sm font-medium text-muted-foreground",
|
|
235
|
-
children: a
|
|
236
|
-
}) : null]
|
|
237
|
-
});
|
|
238
|
-
}, z = ({ data: n, label: r = "Valeur", color: i = "hsl(var(--primary))", yAxisDomain: a, valueFormatter: o, labelFormatter: c, showDots: l = !0, className: d }) => {
|
|
239
|
-
let f = m.useMemo(() => ({ value: {
|
|
240
|
-
label: r,
|
|
241
|
-
color: i
|
|
242
|
-
} }), [r, i]), p = m.useMemo(() => O(o, r), [o, r]);
|
|
243
|
-
return /* @__PURE__ */ h(u, {
|
|
244
|
-
config: f,
|
|
245
|
-
className: e("aspect-auto size-full", d),
|
|
246
|
-
children: /* @__PURE__ */ g(x, {
|
|
247
|
-
data: n,
|
|
248
|
-
margin: {
|
|
249
|
-
top: 10,
|
|
250
|
-
right: 20,
|
|
251
|
-
left: 0,
|
|
252
|
-
bottom: 10
|
|
253
|
-
},
|
|
254
|
-
children: [
|
|
255
|
-
/* @__PURE__ */ h(y, {
|
|
256
|
-
strokeDasharray: "3 3",
|
|
257
|
-
vertical: !1
|
|
258
|
-
}),
|
|
259
|
-
/* @__PURE__ */ h(E, {
|
|
260
|
-
dataKey: "name",
|
|
261
|
-
tickLine: !1,
|
|
262
|
-
axisLine: !1,
|
|
263
|
-
tickMargin: 8,
|
|
264
|
-
interval: "preserveStartEnd",
|
|
265
|
-
tickFormatter: c ? (e) => c(String(e)) : void 0
|
|
266
|
-
}),
|
|
267
|
-
/* @__PURE__ */ h(D, {
|
|
268
|
-
domain: a,
|
|
269
|
-
tickLine: !1,
|
|
270
|
-
axisLine: !1,
|
|
271
|
-
width: o ? 48 : 32,
|
|
272
|
-
tickFormatter: o ? (e) => o(Number(e)) : void 0
|
|
273
|
-
}),
|
|
274
|
-
/* @__PURE__ */ h(t, { content: /* @__PURE__ */ h(s, {
|
|
275
|
-
formatter: p,
|
|
276
|
-
labelFormatter: c ? (e) => c(String(e)) : void 0
|
|
277
|
-
}) }),
|
|
278
|
-
/* @__PURE__ */ h(b, {
|
|
279
|
-
type: "monotone",
|
|
280
|
-
dataKey: "value",
|
|
281
|
-
stroke: "var(--color-value)",
|
|
282
|
-
strokeWidth: 2,
|
|
283
|
-
dot: l ? {
|
|
284
|
-
fill: "var(--color-value)",
|
|
285
|
-
strokeWidth: 0,
|
|
286
|
-
r: 3
|
|
287
|
-
} : !1,
|
|
288
|
-
activeDot: {
|
|
289
|
-
r: 5,
|
|
290
|
-
strokeWidth: 2,
|
|
291
|
-
className: "stroke-background"
|
|
292
|
-
}
|
|
293
|
-
})
|
|
294
|
-
]
|
|
295
|
-
})
|
|
296
|
-
});
|
|
297
|
-
}, B = 6, V = ({ data: n, innerRadius: r, outerRadius: i, showLegend: a = !0, showLabels: l = !1, valueFormatter: d, onSelect: f, className: _ }) => {
|
|
298
|
-
let v = p(), y = m.useMemo(() => n.map((e, t) => ({
|
|
299
|
-
...e,
|
|
300
|
-
fill: e.color ?? P(t)
|
|
301
|
-
})), [n]), b = m.useMemo(() => Object.fromEntries(n.map((e, t) => [e.name, {
|
|
302
|
-
label: e.name,
|
|
303
|
-
color: e.color ?? P(t)
|
|
304
|
-
}])), [n]), x = m.useMemo(() => O(d), [d]), w = r ?? (v ? 45 : 60), E = i ?? (v ? 80 : 100);
|
|
305
|
-
return /* @__PURE__ */ h(u, {
|
|
306
|
-
config: b,
|
|
307
|
-
className: e("aspect-auto size-full", _),
|
|
308
|
-
children: /* @__PURE__ */ g(C, { children: [
|
|
309
|
-
/* @__PURE__ */ h(t, { content: /* @__PURE__ */ h(s, {
|
|
310
|
-
nameKey: "name",
|
|
311
|
-
hideLabel: !0,
|
|
312
|
-
formatter: x
|
|
313
|
-
}) }),
|
|
314
|
-
/* @__PURE__ */ h(S, {
|
|
315
|
-
data: y,
|
|
316
|
-
dataKey: "value",
|
|
317
|
-
nameKey: "name",
|
|
318
|
-
cx: "50%",
|
|
319
|
-
cy: a ? "45%" : "50%",
|
|
320
|
-
innerRadius: w,
|
|
321
|
-
outerRadius: E,
|
|
322
|
-
paddingAngle: w > 0 ? 2 : 0,
|
|
323
|
-
label: l ? ({ name: e, value: t }) => `${String(e)} (${String(t)})` : void 0,
|
|
324
|
-
isAnimationActive: !1,
|
|
325
|
-
className: e("stroke-background", f && "cursor-pointer"),
|
|
326
|
-
shape: (e) => /* @__PURE__ */ h(T, {
|
|
327
|
-
...e,
|
|
328
|
-
outerRadius: f && e.isActive ? e.outerRadius + B : e.outerRadius
|
|
329
|
-
}),
|
|
330
|
-
onClick: f ? (e, t) => {
|
|
331
|
-
f(n[t], t);
|
|
332
|
-
} : void 0
|
|
333
|
-
}),
|
|
334
|
-
a && /* @__PURE__ */ h(o, { content: /* @__PURE__ */ h(c, {
|
|
335
|
-
nameKey: "name",
|
|
336
|
-
className: "flex-wrap text-muted-foreground"
|
|
337
|
-
}) })
|
|
338
|
-
] })
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
//#endregion
|
|
342
|
-
export { N as a, j as c, F as i, z as n, P as o, R as r, M as s, V as t };
|