@krosoft/react 0.0.391 → 0.0.393
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 +1 -2
- package/dist/components/core/cards/DashboardCard.js +7 -8
- package/dist/components/core/cards/KpiCard.js +13 -14
- package/dist/components/core/cards/KpiCards.js +1 -2
- package/dist/components/core/cards/MetricCard.js +1 -2
- package/dist/components/core/cards/SkeletonCard.js +1 -2
- package/dist/components/core/cards/SkeletonCards.js +1 -2
- package/dist/components/core/changelog/AppChangelog.js +13 -14
- package/dist/components/core/changelog/AppChangelogEntry.js +19 -20
- package/dist/components/core/changelog/AppChangelogNav.js +1 -2
- package/dist/components/core/changelog/AppChangelogTagFilter.js +11 -12
- package/dist/components/core/charts/BarChartHorizontal.js +6 -7
- package/dist/components/core/charts/BarChartVertical.js +6 -7
- package/dist/components/core/charts/ChartCard.js +7 -8
- package/dist/components/core/charts/CircularGauge.js +1 -2
- package/dist/components/core/charts/LineChart.js +6 -7
- package/dist/components/core/charts/PieChart.js +12 -13
- package/dist/components/core/charts/chartColors.js +1 -2
- package/dist/components/core/charts/chartTooltip.helper.js +1 -2
- package/dist/components/core/dialogs/AboutDialog.js +11 -12
- package/dist/components/core/dialogs/AppDialog.js +27 -28
- package/dist/components/core/dialogs/ConfirmationDialog.js +15 -16
- package/dist/components/core/dialogs/FormDialog.js +7 -8
- package/dist/components/core/dialogs/index.js +4 -4
- package/dist/components/core/filters/ActiveFilters.js +1 -2
- package/dist/components/core/filters/AdvancedFilters.js +1 -2
- package/dist/components/core/filters/ConditionFilter.js +19 -20
- package/dist/components/core/filters/ConditionFilterGroup.js +1 -2
- package/dist/components/core/filters/FilterField.js +9 -10
- package/dist/components/core/filters/FilterPills.js +1 -2
- package/dist/components/core/filters/FilterPillsGroup.js +1 -2
- package/dist/components/core/filters/FiltersContainer.js +6 -7
- package/dist/components/core/filters/FiltersMobileDrawer.js +1 -2
- package/dist/components/core/filters/TableFilter.js +5 -6
- package/dist/components/core/filters/index.js +7 -7
- package/dist/components/core/forms/GenericForm.js +119 -120
- package/dist/components/core/icons/FlagFrIcon.js +1 -2
- package/dist/components/core/icons/FlagGbIcon.js +1 -2
- package/dist/components/core/inputs/DatePicker.js +9 -10
- package/dist/components/core/inputs/DateRangePicker.js +19 -20
- package/dist/components/core/inputs/FileDropzone.js +2 -3
- package/dist/components/core/inputs/ImageInput.js +9 -10
- package/dist/components/core/inputs/MultiSelect.js +89 -90
- package/dist/components/core/inputs/RatingInput.js +1 -2
- package/dist/components/core/inputs/SearchInput.js +7 -8
- package/dist/components/core/inputs/SingleSelect.js +36 -37
- package/dist/components/core/inputs/index.js +5 -5
- package/dist/components/core/inputs/select.helper.js +1 -2
- package/dist/components/core/language/LanguageSelector.js +1 -2
- package/dist/components/core/layouts/AppActions.js +44 -45
- package/dist/components/core/layouts/AppPageHeader.js +9 -10
- package/dist/components/core/layouts/AppSubTitle.js +1 -2
- package/dist/components/core/layouts/AppTitle.js +1 -2
- package/dist/components/core/layouts/KpiCardsLayout.js +1 -2
- package/dist/components/core/layouts/index.js +4 -4
- package/dist/components/core/markdown/AppMarkdown.js +1 -2
- package/dist/components/core/markdown/AppMarkdownHeading.js +4 -5
- package/dist/components/core/navbar/GlobalSearch.js +16 -17
- package/dist/components/core/navbar/NotificationsBell.js +21 -22
- package/dist/components/core/navbar/Sidebar.js +32 -33
- package/dist/components/core/navbar/SidebarHeader.js +1 -2
- package/dist/components/core/navbar/SidebarNavItem.js +20 -21
- package/dist/components/core/navbar/Topbar.js +5 -6
- package/dist/components/core/navbar/index.js +4 -4
- package/dist/components/core/states/ErrorAlert.js +1 -2
- package/dist/components/core/states/ErrorState.js +1 -2
- package/dist/components/core/states/LoadingState.js +1 -2
- package/dist/components/core/table/DataTable.js +1 -2
- package/dist/components/core/table/JsonTableOutput.js +17 -18
- package/dist/components/core/table/TableActions.js +31 -32
- package/dist/components/core/table/TableBody.js +25 -26
- package/dist/components/core/table/TableBulkActions.js +11 -12
- package/dist/components/core/table/TableHeader.js +15 -16
- package/dist/components/core/table/TablePagination.js +1 -2
- package/dist/components/core/table/TableSettings.js +20 -21
- package/dist/components/core/table/index.js +7 -7
- package/dist/components/core/tabs/AppTabContainer.js +1 -2
- package/dist/components/core/tabs/AppTabHeader.js +1 -2
- package/dist/components/core/tabs/AppTabs.js +10 -11
- package/dist/components/core/tabs/AppVerticalTabs.js +10 -11
- package/dist/components/core/tabs/index.js +3 -3
- package/dist/components/core/theme/ThemeSelector.js +1 -2
- package/dist/components/ui/accordion.js +1 -2
- package/dist/components/ui/alert-dialog.js +1 -2
- package/dist/components/ui/alert.js +1 -2
- package/dist/components/ui/aspect-ratio.js +1 -2
- package/dist/components/ui/avatar.js +1 -2
- package/dist/components/ui/badge.js +1 -2
- package/dist/components/ui/breadcrumb.js +1 -2
- package/dist/components/ui/button.js +1 -2
- package/dist/components/ui/calendar.js +8 -9
- package/dist/components/ui/card.js +1 -2
- package/dist/components/ui/carousel.js +1 -2
- package/dist/components/ui/chart.js +1 -2
- package/dist/components/ui/checkbox.js +1 -2
- package/dist/components/ui/collapsible.js +1 -2
- package/dist/components/ui/command.js +19 -20
- package/dist/components/ui/context-menu.js +1 -2
- package/dist/components/ui/control.js +1 -2
- package/dist/components/ui/dialog.js +1 -2
- package/dist/components/ui/drawer.js +1 -2
- package/dist/components/ui/dropdown-menu.js +1 -2
- package/dist/components/ui/form.js +1 -2
- package/dist/components/ui/hover-card.js +1 -2
- package/dist/components/ui/index.js +19 -19
- package/dist/components/ui/input-otp.js +1 -2
- package/dist/components/ui/input.js +1 -2
- package/dist/components/ui/label.js +1 -2
- package/dist/components/ui/menubar.js +1 -2
- package/dist/components/ui/navigation-menu.js +1 -2
- package/dist/components/ui/pagination.js +1 -2
- package/dist/components/ui/popover.js +1 -2
- package/dist/components/ui/progress.js +1 -2
- package/dist/components/ui/radio-group.js +1 -2
- package/dist/components/ui/resizable.js +1 -2
- package/dist/components/ui/scroll-area.js +1 -2
- package/dist/components/ui/select.js +1 -2
- package/dist/components/ui/separator.js +1 -2
- package/dist/components/ui/sheet.js +1 -2
- package/dist/components/ui/simple-table.js +1 -2
- package/dist/components/ui/skeleton.js +1 -2
- package/dist/components/ui/slider.js +1 -2
- package/dist/components/ui/sonner.js +1 -2
- package/dist/components/ui/switch.js +1 -2
- package/dist/components/ui/tabs.js +1 -2
- package/dist/components/ui/textarea.js +1 -2
- package/dist/components/ui/toast.js +1 -2
- package/dist/components/ui/toaster.js +10 -11
- package/dist/components/ui/toggle-group.js +1 -2
- package/dist/components/ui/toggle.js +1 -2
- package/dist/components/ui/tooltip.js +1 -2
- package/dist/constants/datatable.js +1 -2
- package/dist/constants/search.js +1 -2
- package/dist/contexts/page.context.js +1 -2
- package/dist/contexts/sidebar.context.js +1 -2
- package/dist/helpers/changelog.helper.js +1 -2
- package/dist/helpers/markdown.helper.js +1 -2
- package/dist/helpers/supabase.helper.js +1 -2
- package/dist/helpers/table.helper.js +1 -2
- package/dist/helpers/tailwind.helper.js +1 -2
- package/dist/hooks/behavior/index.js +6 -6
- package/dist/hooks/behavior/useConfirmDeleteDialog.js +1 -2
- package/dist/hooks/behavior/useConfirmationDialog.js +1 -2
- package/dist/hooks/behavior/useDebounce.js +1 -2
- package/dist/hooks/behavior/useDebouncedValue.js +1 -2
- package/dist/hooks/behavior/useDialog.js +1 -2
- package/dist/hooks/behavior/usePage.js +1 -2
- package/dist/hooks/behavior/useSidebar.js +1 -2
- package/dist/hooks/behavior/useTable.js +1 -2
- package/dist/hooks/behavior/useUrlState.js +1 -2
- package/dist/hooks/ui/index.js +10 -10
- package/dist/hooks/ui/useDataTable.js +1 -2
- package/dist/hooks/ui/useDocumentTitle.js +1 -2
- package/dist/hooks/ui/useFixedColumns.js +1 -2
- package/dist/hooks/ui/useLanguage.js +1 -2
- package/dist/hooks/ui/useMobile.js +1 -2
- package/dist/hooks/ui/useNotifications.js +1 -2
- package/dist/hooks/ui/useScrollFade.js +1 -2
- package/dist/hooks/ui/useServerTable.js +1 -2
- package/dist/hooks/ui/useTheme.js +1 -2
- package/dist/hooks/ui/useToast.js +1 -2
- package/dist/i18n/krosoftLocales.js +1 -2
- package/dist/i18n/translateKrosoft.js +1 -2
- package/dist/i18n/useDateFnsLocale.js +1 -2
- package/dist/i18n/useKrosoftTranslation.js +1 -2
- package/dist/locales/en.json.js +1 -2
- package/dist/locales/fr.json.js +1 -2
- package/dist/providers/SidebarProvider.js +5 -6
- package/dist/pwa/PwaUpdater.js +1 -2
- package/dist/pwa/index.js +3 -3
- package/dist/pwa/pwaUpdateToast.js +1 -2
- package/dist/query/createQueryClient.js +1 -2
- package/dist/seasonal/EffectSwitch.js +1 -2
- package/dist/seasonal/EmojiSnowfall.js +1 -2
- package/dist/seasonal/HalloweenEffect.js +5 -6
- package/dist/seasonal/SeasonalEffects.js +4 -5
- package/dist/seasonal/SeasonalEffectsSettings.js +8 -9
- package/dist/seasonal/SnowEffect.js +5 -6
- package/dist/seasonal/overlayStyle.js +1 -2
- package/dist/seasonal/seasons.js +1 -2
- package/dist/seasonal/useSeasonalEffects.js +1 -2
- package/dist/seasonal/useStoredToggle.js +1 -2
- package/dist/tailwind/index.js +1 -2
- package/dist/tokens/apply.js +1 -2
- package/dist/tokens/radius.js +1 -2
- package/dist/vendor/tailwindcss/lib/public/create-plugin.js +1 -2
- package/dist/vendor/tailwindcss/lib/util/createPlugin.js +1 -2
- package/dist/vendor/tailwindcss/plugin.js +1 -2
- package/package.json +3 -3
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Badge as ee } from "../../ui/badge.js";
|
|
1
|
+
import { useKrosoftTranslation as e } from "../../../i18n/useKrosoftTranslation.js";
|
|
2
|
+
import { Badge as t } from "../../ui/badge.js";
|
|
4
3
|
import { Checkbox as n } from "../../ui/checkbox.js";
|
|
5
|
-
import { controlBaseClass as
|
|
6
|
-
import { Popover as a, PopoverContent as o, PopoverTrigger as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
import { controlBaseClass as r, controlFilterWidthClass as ee, controlTriggerClass as i } from "../../ui/control.js";
|
|
5
|
+
import { Popover as a, PopoverContent as o, PopoverTrigger as te } from "../../ui/popover.js";
|
|
6
|
+
import { cn as s } from "../../../helpers/tailwind.helper.js";
|
|
7
|
+
import { renderOptionThumbnail as ne, useOptionWindow as c } from "./select.helper.js";
|
|
8
|
+
import { useMemo as l, useState as u } from "react";
|
|
9
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
import { ChevronDownIcon as m, SearchIcon as re, XIcon as h } from "lucide-react";
|
|
11
|
+
import { Command as g } from "cmdk";
|
|
12
|
+
// src/components/core/inputs/MultiSelect.tsx
|
|
13
|
+
var _ = ({ options: _, selected: v, onToggle: y, onClear: b, onSelectAll: x, variant: S = "input", placeholder: C, labelKey: w, searchable: T = !1, searchPlaceholder: E, disabled: D = !1, modal: O = !0, chips: k = !1, maxCount: A, className: j, ...M }) => {
|
|
14
|
+
let { t: N } = e(), [P, F] = u(""), [I, ie] = u(!1), L = S === "pill", R = S === "input" ? void 0 : ee, z = l(() => P === "" ? _ : _.filter((e) => e.label.toLowerCase().includes(P.toLowerCase())), [_, P]), B = l(() => z.filter((e) => e.disabled !== !0).map((e) => e.value), [z]), V = l(() => v.filter((e) => _.find((t) => t.value === e)?.disabled === !0), [_, v]), H = l(() => B.length !== 0 && B.every((e) => v.includes(e)), [B, v]), U = l(() => v.map((e) => _.find((t) => t.value === e)?.label ?? e), [_, v]), W = A !== void 0 && A > 0 ? U.slice(0, A) : U, G = U.length - W.length, { listRef: K, virtualized: q, startIndex: J, endIndex: ae, padTop: Y, padBottom: X, onScroll: oe, resetScroll: Z } = c(I, z.length, _.some((e) => e.imageUrl !== void 0)), se = q ? z.slice(J, ae) : z, ce = (e) => {
|
|
15
|
+
ie(e), e ? Z() : F("");
|
|
16
16
|
}, le = (e) => {
|
|
17
|
-
|
|
17
|
+
F(e), Z();
|
|
18
18
|
}, ue = () => {
|
|
19
|
-
V.length > 0 ?
|
|
20
|
-
|
|
21
|
-
}) :
|
|
22
|
-
|
|
23
|
-
}) :
|
|
19
|
+
V.length > 0 ? x === void 0 ? v.filter((e) => !V.includes(e)).forEach((e) => {
|
|
20
|
+
y(e);
|
|
21
|
+
}) : x(V) : b === void 0 ? x === void 0 ? v.forEach((e) => {
|
|
22
|
+
y(e);
|
|
23
|
+
}) : x([]) : b();
|
|
24
24
|
}, Q = () => {
|
|
25
|
-
if (H)
|
|
26
|
-
|
|
27
|
-
}) :
|
|
28
|
-
else if (
|
|
29
|
-
let e = [...
|
|
25
|
+
if (H) x === void 0 ? b !== void 0 && v.every((e) => B.includes(e)) ? b() : B.forEach((e) => {
|
|
26
|
+
y(e);
|
|
27
|
+
}) : x(v.filter((e) => !B.includes(e)));
|
|
28
|
+
else if (x !== void 0) {
|
|
29
|
+
let e = [...v];
|
|
30
30
|
B.forEach((t) => {
|
|
31
31
|
e.includes(t) || e.push(t);
|
|
32
|
-
}),
|
|
32
|
+
}), x(e);
|
|
33
33
|
} else B.forEach((e) => {
|
|
34
|
-
|
|
34
|
+
v.includes(e) || y(e);
|
|
35
35
|
});
|
|
36
|
-
}, $ =
|
|
36
|
+
}, $ = l(() => v.map((e) => ({
|
|
37
37
|
value: e,
|
|
38
|
-
option:
|
|
39
|
-
})), [
|
|
40
|
-
...
|
|
38
|
+
option: _.find((t) => t.value === e)
|
|
39
|
+
})), [_, v]), de = L ? /* @__PURE__ */ p("button", {
|
|
40
|
+
...M,
|
|
41
41
|
type: "button",
|
|
42
|
-
disabled:
|
|
43
|
-
className:
|
|
44
|
-
children: [/* @__PURE__ */
|
|
42
|
+
disabled: D,
|
|
43
|
+
className: s(r, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors", v.length > 0 ? "border-primary bg-primary/10 text-primary font-medium" : "hover:bg-muted", R, j),
|
|
44
|
+
children: [/* @__PURE__ */ f("span", {
|
|
45
45
|
className: "truncate",
|
|
46
|
-
children:
|
|
47
|
-
}), /* @__PURE__ */
|
|
46
|
+
children: w === void 0 ? C ?? N("select.placeholder") : N(w)
|
|
47
|
+
}), /* @__PURE__ */ p("div", {
|
|
48
48
|
className: "flex shrink-0 items-center gap-1.5",
|
|
49
|
-
children: [
|
|
49
|
+
children: [v.length > 0 && /* @__PURE__ */ f("span", {
|
|
50
50
|
className: "flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground",
|
|
51
|
-
children:
|
|
52
|
-
}), /* @__PURE__ */
|
|
51
|
+
children: v.length
|
|
52
|
+
}), /* @__PURE__ */ f(m, { className: s("size-3.5 opacity-60 transition-transform", I && "rotate-180") })]
|
|
53
53
|
})]
|
|
54
|
-
}) : /* @__PURE__ */
|
|
55
|
-
...
|
|
54
|
+
}) : /* @__PURE__ */ p("button", {
|
|
55
|
+
...M,
|
|
56
56
|
type: "button",
|
|
57
|
-
disabled:
|
|
58
|
-
className:
|
|
59
|
-
children: [/* @__PURE__ */
|
|
57
|
+
disabled: D,
|
|
58
|
+
className: s(i, "w-full", R, I && "ring-2 ring-ring ring-offset-2", v.length === 0 && "text-muted-foreground", j),
|
|
59
|
+
children: [/* @__PURE__ */ f("span", {
|
|
60
60
|
className: "truncate",
|
|
61
|
-
children:
|
|
62
|
-
}), /* @__PURE__ */
|
|
61
|
+
children: v.length === 0 ? C ?? N("select.placeholder") : W.join(", ")
|
|
62
|
+
}), /* @__PURE__ */ p("div", {
|
|
63
63
|
className: "flex shrink-0 items-center gap-1",
|
|
64
64
|
children: [
|
|
65
|
-
G > 0 && /* @__PURE__ */
|
|
65
|
+
G > 0 && /* @__PURE__ */ p("span", {
|
|
66
66
|
className: "rounded-control bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground",
|
|
67
67
|
children: ["+", G]
|
|
68
68
|
}),
|
|
69
|
-
|
|
69
|
+
v.length > 0 && !D && /* @__PURE__ */ f("span", {
|
|
70
70
|
role: "button",
|
|
71
71
|
tabIndex: -1,
|
|
72
72
|
onClick: (e) => {
|
|
@@ -76,116 +76,115 @@ var g = ({ options: g, selected: _, onToggle: v, onClear: y, onSelectAll: b, var
|
|
|
76
76
|
e.preventDefault(), e.stopPropagation(), ue();
|
|
77
77
|
},
|
|
78
78
|
className: "text-muted-foreground hover:text-foreground",
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ f(h, { className: "size-4" })
|
|
80
80
|
}),
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ f(m, { className: s("size-4 opacity-50 shrink-0 transition-transform", I && "rotate-180") })
|
|
82
82
|
]
|
|
83
83
|
})]
|
|
84
|
-
}), fe =
|
|
84
|
+
}), fe = k && $.length > 0 ? /* @__PURE__ */ f("div", {
|
|
85
85
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
86
|
-
children: $.map(({ value: e, option:
|
|
87
|
-
let
|
|
88
|
-
return /* @__PURE__ */
|
|
86
|
+
children: $.map(({ value: e, option: n }) => {
|
|
87
|
+
let r = n?.disabled === !0;
|
|
88
|
+
return /* @__PURE__ */ p(t, {
|
|
89
89
|
variant: "secondary",
|
|
90
90
|
className: "flex items-center gap-1 border border-primary/20 bg-primary/10 py-0.5 pl-2 pr-1 text-primary",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ f("span", {
|
|
92
92
|
className: "max-w-[16rem] truncate",
|
|
93
|
-
children:
|
|
94
|
-
}), !
|
|
93
|
+
children: n?.label ?? e
|
|
94
|
+
}), !r && /* @__PURE__ */ f("button", {
|
|
95
95
|
type: "button",
|
|
96
96
|
onClick: () => {
|
|
97
|
-
|
|
97
|
+
y(e);
|
|
98
98
|
},
|
|
99
99
|
className: "rounded-full p-0.5 hover:bg-primary/20",
|
|
100
|
-
"aria-label":
|
|
101
|
-
children: /* @__PURE__ */
|
|
100
|
+
"aria-label": N("filters.remove"),
|
|
101
|
+
children: /* @__PURE__ */ f(h, { className: "size-3" })
|
|
102
102
|
})]
|
|
103
103
|
}, e);
|
|
104
104
|
})
|
|
105
105
|
}) : null;
|
|
106
|
-
return /* @__PURE__ */ d
|
|
107
|
-
open:
|
|
106
|
+
return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p(a, {
|
|
107
|
+
open: I,
|
|
108
108
|
onOpenChange: ce,
|
|
109
|
-
modal:
|
|
110
|
-
children: [/* @__PURE__ */
|
|
109
|
+
modal: O,
|
|
110
|
+
children: [/* @__PURE__ */ f(te, {
|
|
111
111
|
asChild: !0,
|
|
112
112
|
children: de
|
|
113
|
-
}), /* @__PURE__ */
|
|
114
|
-
className:
|
|
113
|
+
}), /* @__PURE__ */ p(o, {
|
|
114
|
+
className: s("p-0", L ? "w-72 max-w-[var(--radix-popover-content-available-width)]" : "w-[var(--radix-popover-trigger-width)]"),
|
|
115
115
|
align: "start",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ p(g, {
|
|
117
117
|
shouldFilter: !1,
|
|
118
118
|
className: "flex flex-col",
|
|
119
|
-
children: [
|
|
119
|
+
children: [T ? /* @__PURE__ */ f("div", {
|
|
120
120
|
className: "border-b border-border p-2",
|
|
121
|
-
children: /* @__PURE__ */
|
|
121
|
+
children: /* @__PURE__ */ p("div", {
|
|
122
122
|
className: "relative",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
124
|
-
value:
|
|
123
|
+
children: [/* @__PURE__ */ f(re, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ f(g.Input, {
|
|
124
|
+
value: P,
|
|
125
125
|
onValueChange: le,
|
|
126
|
-
placeholder:
|
|
126
|
+
placeholder: E ?? N("search.placeholder"),
|
|
127
127
|
className: "w-full rounded-control bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
|
|
128
128
|
autoFocus: !0
|
|
129
129
|
})]
|
|
130
130
|
})
|
|
131
|
-
}) : /* @__PURE__ */
|
|
131
|
+
}) : /* @__PURE__ */ f(g.Input, {
|
|
132
132
|
autoFocus: !0,
|
|
133
133
|
tabIndex: -1,
|
|
134
134
|
className: "sr-only"
|
|
135
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ p(g.List, {
|
|
136
136
|
ref: K,
|
|
137
137
|
onScroll: oe,
|
|
138
|
-
className:
|
|
138
|
+
className: s("flex flex-col max-h-56 overflow-y-auto overflow-x-hidden p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", !q && "gap-0.5"),
|
|
139
139
|
children: [
|
|
140
|
-
z.length === 0 && /* @__PURE__ */
|
|
140
|
+
z.length === 0 && /* @__PURE__ */ f("p", {
|
|
141
141
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
142
|
-
children:
|
|
142
|
+
children: N("states.noResult")
|
|
143
143
|
}),
|
|
144
|
-
Y > 0 && /* @__PURE__ */
|
|
144
|
+
Y > 0 && /* @__PURE__ */ f("div", {
|
|
145
145
|
"aria-hidden": !0,
|
|
146
146
|
style: { height: Y }
|
|
147
147
|
}),
|
|
148
|
-
se.map((e) => /* @__PURE__ */
|
|
148
|
+
se.map((e) => /* @__PURE__ */ p(g.Item, {
|
|
149
149
|
value: e.value,
|
|
150
150
|
disabled: e.disabled,
|
|
151
151
|
onSelect: () => {
|
|
152
|
-
|
|
152
|
+
y(e.value);
|
|
153
153
|
},
|
|
154
154
|
className: "flex min-w-0 items-center gap-2.5 rounded-md px-2 py-2 text-sm cursor-pointer transition-colors data-[selected=true]:bg-muted data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
|
|
155
155
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ f("span", {
|
|
157
157
|
className: "pointer-events-none shrink-0",
|
|
158
|
-
children: /* @__PURE__ */
|
|
158
|
+
children: /* @__PURE__ */ f(n, { checked: v.includes(e.value) })
|
|
159
159
|
}),
|
|
160
160
|
ne(e.imageUrl),
|
|
161
|
-
e.color && /* @__PURE__ */
|
|
161
|
+
e.color && /* @__PURE__ */ f("span", {
|
|
162
162
|
className: "size-2.5 shrink-0 rounded-full",
|
|
163
163
|
style: { backgroundColor: e.color }
|
|
164
164
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ f("span", {
|
|
166
166
|
className: "min-w-0 flex-1 truncate",
|
|
167
167
|
title: e.label,
|
|
168
168
|
children: e.label
|
|
169
169
|
})
|
|
170
170
|
]
|
|
171
171
|
}, e.value)),
|
|
172
|
-
X > 0 && /* @__PURE__ */
|
|
172
|
+
X > 0 && /* @__PURE__ */ f("div", {
|
|
173
173
|
"aria-hidden": !0,
|
|
174
174
|
style: { height: X }
|
|
175
175
|
})
|
|
176
176
|
]
|
|
177
177
|
})]
|
|
178
|
-
}), B.length > 0 && /* @__PURE__ */
|
|
178
|
+
}), B.length > 0 && /* @__PURE__ */ f("div", {
|
|
179
179
|
className: "border-t border-border p-1.5",
|
|
180
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ f("button", {
|
|
181
181
|
type: "button",
|
|
182
182
|
onClick: Q,
|
|
183
183
|
className: "w-full rounded-md px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors text-center",
|
|
184
|
-
children:
|
|
184
|
+
children: N(H ? "filters.deselectAll" : "filters.selectAll")
|
|
185
185
|
})
|
|
186
186
|
})]
|
|
187
187
|
})]
|
|
188
188
|
}), fe] });
|
|
189
189
|
};
|
|
190
|
-
|
|
191
|
-
export { g as MultiSelect };
|
|
190
|
+
export { _ as MultiSelect };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../../../helpers/tailwind.helper.js";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { Heart as n, Star as r } from "lucide-react";
|
|
4
|
-
|
|
4
|
+
// src/components/core/inputs/RatingInput.tsx
|
|
5
5
|
var i = {
|
|
6
6
|
heart: {
|
|
7
7
|
Icon: n,
|
|
@@ -32,5 +32,4 @@ function a({ value: n, onChange: r, max: a = 5, size: o = "md", icon: s = "star"
|
|
|
32
32
|
})
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { a as RatingInput };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useKrosoftTranslation as e } from "../../../i18n/useKrosoftTranslation.js";
|
|
2
|
+
import { Input as t } from "../../ui/input.js";
|
|
3
|
+
import { cn as n } from "../../../helpers/tailwind.helper.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { SearchIcon as a, XIcon as o } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/components/core/inputs/SearchInput.tsx
|
|
7
7
|
var s = ({ searchQuery: s, search: c, placeholder: l, onSearch: u, onSubmit: d, onClear: f, className: p }) => {
|
|
8
|
-
let { t: m } =
|
|
8
|
+
let { t: m } = e(), h = s ?? c ?? "";
|
|
9
9
|
return /* @__PURE__ */ i("div", {
|
|
10
|
-
className:
|
|
10
|
+
className: n("relative h-fit w-full md:w-64", p),
|
|
11
11
|
children: [
|
|
12
12
|
/* @__PURE__ */ r(a, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
13
|
-
/* @__PURE__ */ r(
|
|
13
|
+
/* @__PURE__ */ r(t, {
|
|
14
14
|
placeholder: l ?? m("search.placeholder"),
|
|
15
15
|
value: h,
|
|
16
16
|
onChange: (e) => {
|
|
@@ -32,5 +32,4 @@ var s = ({ searchQuery: s, search: c, placeholder: l, onSearch: u, onSubmit: d,
|
|
|
32
32
|
]
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
|
-
//#endregion
|
|
36
35
|
export { s as SearchInput };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { renderOptionThumbnail as
|
|
1
|
+
import { useKrosoftTranslation as e } from "../../../i18n/useKrosoftTranslation.js";
|
|
2
|
+
import { Popover as t, PopoverContent as n, PopoverTrigger as r } from "../../ui/popover.js";
|
|
3
|
+
import { Select as ee, SelectContent as te, SelectItem as ne, SelectTrigger as i, SelectValue as a } from "../../ui/select.js";
|
|
4
|
+
import { controlFilterWidthClass as o, controlTriggerClass as s } from "../../ui/control.js";
|
|
5
|
+
import { cn as c } from "../../../helpers/tailwind.helper.js";
|
|
6
|
+
import { renderOptionThumbnail as l, useOptionWindow as u } from "./select.helper.js";
|
|
7
7
|
import { useMemo as d, useState as f } from "react";
|
|
8
8
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
9
|
import { CheckIcon as h, ChevronDownIcon as g, PlusIcon as _, SearchIcon as v, XIcon as y } from "lucide-react";
|
|
10
10
|
import { Command as b } from "cmdk";
|
|
11
|
-
|
|
11
|
+
// src/components/core/inputs/SingleSelect.tsx
|
|
12
12
|
var x = ({ options: x = [], value: S, onChange: C, onClear: w, searchable: T = !1, onCreate: E, placeholder: D, searchPlaceholder: re, emptyLabel: ie, createLabel: O, disabled: k = !1, modal: A = !0, variant: j = "input", className: M, ...N }) => {
|
|
13
|
-
let { t: P } =
|
|
13
|
+
let { t: P } = e(), [F, I] = f(!1), [L, R] = f(""), z = j === "filter" ? o : void 0, B = S !== void 0 && S !== "", V = d(() => B ? x.find((e) => e.value === S) : void 0, [
|
|
14
14
|
B,
|
|
15
15
|
x,
|
|
16
16
|
S
|
|
@@ -18,25 +18,25 @@ var x = ({ options: x = [], value: S, onChange: C, onClear: w, searchable: T = !
|
|
|
18
18
|
if (U === "") return x;
|
|
19
19
|
let e = U.toLowerCase();
|
|
20
20
|
return x.filter((t) => `${t.label} ${t.description ?? ""}`.toLowerCase().includes(e));
|
|
21
|
-
}, [x, U]), { listRef: G, virtualized: K, startIndex: q, endIndex: J, padTop: Y, padBottom: X, onScroll: ae, resetScroll: Z } =
|
|
22
|
-
if (!T) return /* @__PURE__ */ m(
|
|
21
|
+
}, [x, U]), { listRef: G, virtualized: K, startIndex: q, endIndex: J, padTop: Y, padBottom: X, onScroll: ae, resetScroll: Z } = u(F, W.length, x.some((e) => e.imageUrl !== void 0)), oe = K ? W.slice(q, J) : W;
|
|
22
|
+
if (!T) return /* @__PURE__ */ m(ee, {
|
|
23
23
|
value: S ?? "",
|
|
24
24
|
onValueChange: C,
|
|
25
25
|
disabled: k,
|
|
26
|
-
children: [/* @__PURE__ */ p(
|
|
26
|
+
children: [/* @__PURE__ */ p(i, {
|
|
27
27
|
...N,
|
|
28
|
-
className:
|
|
28
|
+
className: c(!B && "text-muted-foreground", z, M),
|
|
29
29
|
onClear: w !== void 0 && B && !k ? (e) => {
|
|
30
30
|
e.preventDefault(), e.stopPropagation(), w();
|
|
31
31
|
} : void 0,
|
|
32
|
-
children: /* @__PURE__ */ p(
|
|
33
|
-
}), /* @__PURE__ */ p(
|
|
32
|
+
children: /* @__PURE__ */ p(a, { placeholder: D ?? P("select.placeholder") })
|
|
33
|
+
}), /* @__PURE__ */ p(te, { children: x.map((e) => /* @__PURE__ */ p(ne, {
|
|
34
34
|
value: e.value,
|
|
35
35
|
disabled: e.disabled,
|
|
36
36
|
children: /* @__PURE__ */ m("span", {
|
|
37
37
|
className: "flex items-center",
|
|
38
38
|
children: [
|
|
39
|
-
|
|
39
|
+
l(e.imageUrl, "mr-2"),
|
|
40
40
|
e.color !== void 0 && /* @__PURE__ */ p("span", {
|
|
41
41
|
className: "mr-2 size-2.5 shrink-0 rounded-full",
|
|
42
42
|
style: { backgroundColor: e.color }
|
|
@@ -63,11 +63,11 @@ var x = ({ options: x = [], value: S, onChange: C, onClear: w, searchable: T = !
|
|
|
63
63
|
}, le = () => {
|
|
64
64
|
E?.(U), $(!1);
|
|
65
65
|
};
|
|
66
|
-
return /* @__PURE__ */ m(
|
|
66
|
+
return /* @__PURE__ */ m(t, {
|
|
67
67
|
open: F,
|
|
68
68
|
onOpenChange: $,
|
|
69
69
|
modal: A,
|
|
70
|
-
children: [/* @__PURE__ */ p(
|
|
70
|
+
children: [/* @__PURE__ */ p(r, {
|
|
71
71
|
asChild: !0,
|
|
72
72
|
children: /* @__PURE__ */ m("button", {
|
|
73
73
|
...N,
|
|
@@ -75,11 +75,11 @@ var x = ({ options: x = [], value: S, onChange: C, onClear: w, searchable: T = !
|
|
|
75
75
|
role: "combobox",
|
|
76
76
|
"aria-expanded": F,
|
|
77
77
|
disabled: k,
|
|
78
|
-
className:
|
|
78
|
+
className: c(s, "w-full", z, "data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2", !B && "text-muted-foreground", M),
|
|
79
79
|
children: [/* @__PURE__ */ m("div", {
|
|
80
80
|
className: "flex min-w-0 items-center truncate",
|
|
81
81
|
children: [
|
|
82
|
-
|
|
82
|
+
l(V?.imageUrl, "mr-2 h-6 w-8"),
|
|
83
83
|
V?.color && /* @__PURE__ */ p("span", {
|
|
84
84
|
className: "mr-2 size-2.5 shrink-0 rounded-full",
|
|
85
85
|
style: { backgroundColor: V.color }
|
|
@@ -110,10 +110,10 @@ var x = ({ options: x = [], value: S, onChange: C, onClear: w, searchable: T = !
|
|
|
110
110
|
},
|
|
111
111
|
className: "text-muted-foreground hover:text-foreground",
|
|
112
112
|
children: /* @__PURE__ */ p(y, { className: "size-4" })
|
|
113
|
-
}), /* @__PURE__ */ p(g, { className:
|
|
113
|
+
}), /* @__PURE__ */ p(g, { className: c("size-4 shrink-0 opacity-50 transition-transform", F && "rotate-180") })]
|
|
114
114
|
})]
|
|
115
115
|
})
|
|
116
|
-
}), /* @__PURE__ */ p(
|
|
116
|
+
}), /* @__PURE__ */ p(n, {
|
|
117
117
|
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
118
118
|
align: "start",
|
|
119
119
|
children: /* @__PURE__ */ m(b, {
|
|
@@ -134,7 +134,7 @@ var x = ({ options: x = [], value: S, onChange: C, onClear: w, searchable: T = !
|
|
|
134
134
|
}), /* @__PURE__ */ m(b.List, {
|
|
135
135
|
ref: G,
|
|
136
136
|
onScroll: ae,
|
|
137
|
-
className:
|
|
137
|
+
className: c("flex flex-col max-h-56 overflow-y-auto overflow-x-hidden p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", !K && "gap-0.5"),
|
|
138
138
|
children: [
|
|
139
139
|
W.length === 0 && !Q && /* @__PURE__ */ p("div", {
|
|
140
140
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
@@ -144,36 +144,36 @@ var x = ({ options: x = [], value: S, onChange: C, onClear: w, searchable: T = !
|
|
|
144
144
|
"aria-hidden": !0,
|
|
145
145
|
style: { height: Y }
|
|
146
146
|
}),
|
|
147
|
-
oe.map((
|
|
148
|
-
value:
|
|
149
|
-
keywords: [
|
|
150
|
-
disabled:
|
|
147
|
+
oe.map((e) => /* @__PURE__ */ m(b.Item, {
|
|
148
|
+
value: e.value,
|
|
149
|
+
keywords: [e.label, e.description ?? ""],
|
|
150
|
+
disabled: e.disabled,
|
|
151
151
|
onSelect: () => {
|
|
152
|
-
ce(
|
|
152
|
+
ce(e.value);
|
|
153
153
|
},
|
|
154
154
|
className: "flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm cursor-pointer transition-colors data-[selected=true]:bg-muted data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
|
|
155
155
|
children: [
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
l(e.imageUrl),
|
|
157
|
+
e.color && /* @__PURE__ */ p("span", {
|
|
158
158
|
className: "size-2.5 shrink-0 rounded-full",
|
|
159
|
-
style: { backgroundColor:
|
|
159
|
+
style: { backgroundColor: e.color }
|
|
160
160
|
}),
|
|
161
161
|
/* @__PURE__ */ p("span", {
|
|
162
162
|
className: "min-w-0 flex-1 truncate",
|
|
163
|
-
title:
|
|
164
|
-
children:
|
|
163
|
+
title: e.label,
|
|
164
|
+
children: e.label
|
|
165
165
|
}),
|
|
166
|
-
|
|
166
|
+
e.description !== void 0 && /* @__PURE__ */ m("span", {
|
|
167
167
|
className: "shrink-0 truncate text-muted-foreground",
|
|
168
168
|
children: [
|
|
169
169
|
"(",
|
|
170
|
-
|
|
170
|
+
e.description,
|
|
171
171
|
")"
|
|
172
172
|
]
|
|
173
173
|
}),
|
|
174
|
-
/* @__PURE__ */ p(h, { className:
|
|
174
|
+
/* @__PURE__ */ p(h, { className: c("ml-auto size-4 shrink-0", S === e.value ? "opacity-100" : "opacity-0") })
|
|
175
175
|
]
|
|
176
|
-
},
|
|
176
|
+
}, e.value)),
|
|
177
177
|
X > 0 && /* @__PURE__ */ p("div", {
|
|
178
178
|
"aria-hidden": !0,
|
|
179
179
|
style: { height: X }
|
|
@@ -194,5 +194,4 @@ var x = ({ options: x = [], value: S, onChange: C, onClear: w, searchable: T = !
|
|
|
194
194
|
})]
|
|
195
195
|
});
|
|
196
196
|
};
|
|
197
|
-
//#endregion
|
|
198
197
|
export { x as SingleSelect };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ImageInput as e } from "./ImageInput.js";
|
|
2
|
+
import { FileDropzone as t } from "./FileDropzone.js";
|
|
3
|
+
import { SearchInput as n } from "./SearchInput.js";
|
|
4
4
|
import { DatePicker as r } from "./DatePicker.js";
|
|
5
5
|
import { DateRangePicker as i } from "./DateRangePicker.js";
|
|
6
6
|
import { SingleSelect as a } from "./SingleSelect.js";
|
|
7
|
-
import {
|
|
7
|
+
import { MultiSelect as o } from "./MultiSelect.js";
|
|
8
8
|
import { RatingInput as s } from "./RatingInput.js";
|
|
9
|
-
export { r as DatePicker, i as DateRangePicker,
|
|
9
|
+
export { r as DatePicker, i as DateRangePicker, t as FileDropzone, e as ImageInput, o as MultiSelect, s as RatingInput, n as SearchInput, a as SingleSelect };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../../../helpers/tailwind.helper.js";
|
|
2
2
|
import { useCallback as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
|
|
3
3
|
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/core/inputs/select.helper.tsx
|
|
5
5
|
var o = 40, s = 224, c = 6;
|
|
6
6
|
function l(e, a, l) {
|
|
7
7
|
let u = r(null), [d, f] = i(0), [p, m] = i(0), h = p || (l ? 52 : 40), g = a > o, _ = g ? Math.max(0, Math.floor(d / h) - c) : 0, v = g ? Math.min(a, Math.ceil((d + s) / h) + c) : a, y = g ? _ * h : 0, b = g ? (a - v) * h : 0;
|
|
@@ -42,5 +42,4 @@ var u = (t, n) => t === void 0 ? null : t ? /* @__PURE__ */ a("img", {
|
|
|
42
42
|
className: e("flex h-9 w-12 shrink-0 items-center justify-center rounded bg-muted text-[9px] text-muted-foreground", n),
|
|
43
43
|
children: "—"
|
|
44
44
|
});
|
|
45
|
-
//#endregion
|
|
46
45
|
export { u as renderOptionThumbnail, l as useOptionWindow };
|
|
@@ -6,7 +6,7 @@ import { useLanguage as d } from "../../../hooks/ui/useLanguage.js";
|
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
8
|
import { LanguagesIcon as m } from "lucide-react";
|
|
9
|
-
|
|
9
|
+
// src/components/core/language/LanguageSelector.tsx
|
|
10
10
|
function h({ languageOptions: h, variant: g = "select", id: _, className: v }) {
|
|
11
11
|
let { t: y } = e(), { currentLanguageOption: b, nextLanguageOption: x, changeLanguage: S, cycleLanguage: C } = d(h);
|
|
12
12
|
if (g === "mini") {
|
|
@@ -55,5 +55,4 @@ function h({ languageOptions: h, variant: g = "select", id: _, className: v }) {
|
|
|
55
55
|
})]
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { h as LanguageSelector };
|