@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,26 @@
|
|
|
1
|
+
//#region src/tokens/radius.ts
|
|
2
|
+
var e = {
|
|
3
|
+
square: {
|
|
4
|
+
"--radius": "0rem",
|
|
5
|
+
"--k-radius-control": "0rem",
|
|
6
|
+
"--k-radius-surface": "0rem",
|
|
7
|
+
"--k-radius-control-dense": "0rem",
|
|
8
|
+
"--k-radius-surface-dense": "0rem"
|
|
9
|
+
},
|
|
10
|
+
soft: {
|
|
11
|
+
"--radius": "0.5rem",
|
|
12
|
+
"--k-radius-control": "0.5rem",
|
|
13
|
+
"--k-radius-surface": "0.75rem",
|
|
14
|
+
"--k-radius-control-dense": "0.5rem",
|
|
15
|
+
"--k-radius-surface-dense": "0.75rem"
|
|
16
|
+
},
|
|
17
|
+
round: {
|
|
18
|
+
"--radius": "0.75rem",
|
|
19
|
+
"--k-radius-control": "9999px",
|
|
20
|
+
"--k-radius-surface": "1.25rem",
|
|
21
|
+
"--k-radius-control-dense": "0.5rem",
|
|
22
|
+
"--k-radius-surface-dense": "0.75rem"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { e as radiusPresets };
|
package/dist/types/index.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./forms/index.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_createPlugin as t } from "../util/createPlugin.js";
|
|
3
|
+
//#region node_modules/tailwindcss/lib/public/create-plugin.js
|
|
4
|
+
var n = /* @__PURE__ */ e(((e) => {
|
|
5
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "default", {
|
|
6
|
+
enumerable: !0,
|
|
7
|
+
get: function() {
|
|
8
|
+
return i;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var n = /*#__PURE__*/ r(t());
|
|
12
|
+
function r(e) {
|
|
13
|
+
return e && e.__esModule ? e : { default: e };
|
|
14
|
+
}
|
|
15
|
+
var i = n.default;
|
|
16
|
+
}));
|
|
17
|
+
//#endregion
|
|
18
|
+
export default n();
|
|
19
|
+
export { n as require_create_plugin };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/tailwindcss/lib/util/createPlugin.js
|
|
3
|
+
var t = /* @__PURE__ */ e(((e) => {
|
|
4
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "default", {
|
|
5
|
+
enumerable: !0,
|
|
6
|
+
get: function() {
|
|
7
|
+
return n;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
function t(e, t) {
|
|
11
|
+
return {
|
|
12
|
+
handler: e,
|
|
13
|
+
config: t
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
t.withOptions = function(e, t = () => ({})) {
|
|
17
|
+
let n = function(n) {
|
|
18
|
+
return {
|
|
19
|
+
__options: n,
|
|
20
|
+
handler: e(n),
|
|
21
|
+
config: t(n)
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
return n.__isOptionsFunction = !0, n.__pluginFunction = e, n.__configFunction = t, n;
|
|
25
|
+
};
|
|
26
|
+
var n = t;
|
|
27
|
+
}));
|
|
28
|
+
//#endregion
|
|
29
|
+
export default t();
|
|
30
|
+
export { t as require_createPlugin };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __commonJSMin as e } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_create_plugin as t } from "./lib/public/create-plugin.js";
|
|
3
|
+
//#region node_modules/tailwindcss/plugin.js
|
|
4
|
+
var n = /* @__PURE__ */ e(((e, n) => {
|
|
5
|
+
var r = t();
|
|
6
|
+
n.exports = (r.__esModule ? r : { default: r }).default;
|
|
7
|
+
}));
|
|
8
|
+
//#endregion
|
|
9
|
+
export default n();
|
|
10
|
+
export { n as require_plugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krosoft/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.382",
|
|
4
4
|
"description": "Krosoft shared React package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -110,8 +110,8 @@
|
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@krosoft/core": "^0.0.75",
|
|
113
|
-
"@krosoft/tooling-eslint": "^0.0.
|
|
114
|
-
"@krosoft/tooling-eslint-react": "^0.0.
|
|
113
|
+
"@krosoft/tooling-eslint": "^0.0.37",
|
|
114
|
+
"@krosoft/tooling-eslint-react": "^0.0.32",
|
|
115
115
|
"@krosoft/tooling-prettier": "^0.0.20",
|
|
116
116
|
"@krosoft/tooling-tsconfig-react": "^0.0.10",
|
|
117
117
|
"@storybook/addon-docs": "^10.6.5",
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { t } from "./markdown.helper-YJE2H5KQ.js";
|
|
3
|
-
import { t as n } from "./i18n-BhLphJa3.js";
|
|
4
|
-
import { t as r } from "./useNotifications-CyhTruIG.js";
|
|
5
|
-
import { useEffect as i } from "react";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
import { LinkIcon as s } from "lucide-react";
|
|
8
|
-
import { useLocation as c, useNavigate as l } from "react-router-dom";
|
|
9
|
-
import u from "react-markdown";
|
|
10
|
-
import d from "rehype-slug";
|
|
11
|
-
import f from "remark-gfm";
|
|
12
|
-
//#region src/components/core/markdown/AppMarkdownHeading.tsx
|
|
13
|
-
var p = {
|
|
14
|
-
2: "h2",
|
|
15
|
-
3: "h3",
|
|
16
|
-
4: "h4"
|
|
17
|
-
}, m = ({ level: t, className: i, id: u, anchor: d = !0, children: f }) => {
|
|
18
|
-
let { t: m } = n(), { showSuccess: h, showError: g } = r(), _ = c(), v = l(), y = p[t];
|
|
19
|
-
if (!d || !u) return /* @__PURE__ */ a(y, {
|
|
20
|
-
id: u,
|
|
21
|
-
className: i,
|
|
22
|
-
children: f
|
|
23
|
-
});
|
|
24
|
-
let b = async () => {
|
|
25
|
-
v({
|
|
26
|
-
search: _.search,
|
|
27
|
-
hash: `#${u}`
|
|
28
|
-
}, { replace: !0 });
|
|
29
|
-
let e = `${window.location.origin}${_.pathname}${_.search}#${u}`;
|
|
30
|
-
try {
|
|
31
|
-
await navigator.clipboard.writeText(e), h(m("markdown.linkCopied"));
|
|
32
|
-
} catch {
|
|
33
|
-
g(m("markdown.linkCopyError"));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
return /* @__PURE__ */ o(y, {
|
|
37
|
-
id: u,
|
|
38
|
-
className: e("group", i),
|
|
39
|
-
children: [f, /* @__PURE__ */ a("button", {
|
|
40
|
-
type: "button",
|
|
41
|
-
onClick: () => void b(),
|
|
42
|
-
title: m("markdown.copyLink"),
|
|
43
|
-
"aria-label": m("markdown.copyLink"),
|
|
44
|
-
className: "ml-2 inline-flex align-middle text-muted-foreground transition-opacity hover:text-primary md:opacity-0 md:group-hover:opacity-100 md:focus-visible:opacity-100",
|
|
45
|
-
children: /* @__PURE__ */ a(s, { className: "size-4" })
|
|
46
|
-
})]
|
|
47
|
-
});
|
|
48
|
-
}, h = ({ content: n, headingAnchors: r = !0 }) => {
|
|
49
|
-
let o = c(), s = l(), { hash: p } = o;
|
|
50
|
-
i(() => {
|
|
51
|
-
if (!r || !p) return;
|
|
52
|
-
let e = decodeURIComponent(p.slice(1)), t = requestAnimationFrame(() => {
|
|
53
|
-
document.getElementById(e)?.scrollIntoView({
|
|
54
|
-
behavior: "smooth",
|
|
55
|
-
block: "start"
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
return () => {
|
|
59
|
-
cancelAnimationFrame(t);
|
|
60
|
-
};
|
|
61
|
-
}, [
|
|
62
|
-
r,
|
|
63
|
-
p,
|
|
64
|
-
n
|
|
65
|
-
]);
|
|
66
|
-
let h = (e, t) => {
|
|
67
|
-
let n = decodeURIComponent(t.slice(1)), i = document.getElementById(n);
|
|
68
|
-
i && (e.preventDefault(), r ? s({
|
|
69
|
-
search: o.search,
|
|
70
|
-
hash: t
|
|
71
|
-
}) : i.scrollIntoView({
|
|
72
|
-
behavior: "smooth",
|
|
73
|
-
block: "start"
|
|
74
|
-
}));
|
|
75
|
-
};
|
|
76
|
-
return /* @__PURE__ */ a(u, {
|
|
77
|
-
remarkPlugins: [f],
|
|
78
|
-
rehypePlugins: [d, t],
|
|
79
|
-
components: {
|
|
80
|
-
h1: ({ id: e, children: t }) => /* @__PURE__ */ a("h1", {
|
|
81
|
-
id: e,
|
|
82
|
-
className: "text-2xl font-bold text-foreground mt-2 mb-4 first:mt-0 scroll-mt-4",
|
|
83
|
-
children: t
|
|
84
|
-
}),
|
|
85
|
-
h2: ({ id: t, children: n }) => /* @__PURE__ */ a(m, {
|
|
86
|
-
anchor: r,
|
|
87
|
-
level: 2,
|
|
88
|
-
id: t,
|
|
89
|
-
className: e("text-xl font-semibold text-foreground mt-8 mb-3 border-b pb-2 scroll-mt-4", !r && "first:mt-0"),
|
|
90
|
-
children: n
|
|
91
|
-
}),
|
|
92
|
-
h3: ({ id: e, children: t }) => /* @__PURE__ */ a(m, {
|
|
93
|
-
anchor: r,
|
|
94
|
-
level: 3,
|
|
95
|
-
id: e,
|
|
96
|
-
className: "text-base font-semibold text-foreground mt-6 mb-2 scroll-mt-4",
|
|
97
|
-
children: t
|
|
98
|
-
}),
|
|
99
|
-
h4: ({ id: e, children: t }) => /* @__PURE__ */ a(m, {
|
|
100
|
-
anchor: r,
|
|
101
|
-
level: 4,
|
|
102
|
-
id: e,
|
|
103
|
-
className: "text-sm font-semibold text-foreground mt-4 mb-2 scroll-mt-4",
|
|
104
|
-
children: t
|
|
105
|
-
}),
|
|
106
|
-
p: ({ children: e }) => /* @__PURE__ */ a("p", {
|
|
107
|
-
className: "text-sm text-foreground leading-relaxed mb-3",
|
|
108
|
-
children: e
|
|
109
|
-
}),
|
|
110
|
-
a: ({ href: e, children: t }) => {
|
|
111
|
-
let n = e?.startsWith("#");
|
|
112
|
-
return /* @__PURE__ */ a("a", {
|
|
113
|
-
href: e,
|
|
114
|
-
target: n ? void 0 : "_blank",
|
|
115
|
-
rel: n ? void 0 : "noopener noreferrer",
|
|
116
|
-
onClick: n && e ? (t) => {
|
|
117
|
-
h(t, e);
|
|
118
|
-
} : void 0,
|
|
119
|
-
className: "text-primary underline underline-offset-2 hover:opacity-80",
|
|
120
|
-
children: t
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
ul: ({ children: e }) => /* @__PURE__ */ a("ul", {
|
|
124
|
-
className: "list-disc pl-6 mb-3 space-y-1 text-sm text-foreground",
|
|
125
|
-
children: e
|
|
126
|
-
}),
|
|
127
|
-
ol: ({ children: e }) => /* @__PURE__ */ a("ol", {
|
|
128
|
-
className: "list-decimal pl-6 mb-3 space-y-1 text-sm text-foreground",
|
|
129
|
-
children: e
|
|
130
|
-
}),
|
|
131
|
-
blockquote: ({ children: e }) => /* @__PURE__ */ a("blockquote", {
|
|
132
|
-
className: "border-l-4 border-muted-foreground/30 bg-muted/50 px-4 py-2 mb-3 text-sm text-muted-foreground [&>p]:mb-0",
|
|
133
|
-
children: e
|
|
134
|
-
}),
|
|
135
|
-
code: ({ className: e, children: t }) => e ? /* @__PURE__ */ a("code", {
|
|
136
|
-
className: `${e} block text-xs font-mono`,
|
|
137
|
-
children: t
|
|
138
|
-
}) : /* @__PURE__ */ a("code", {
|
|
139
|
-
className: "text-xs font-mono bg-muted px-1.5 py-0.5 rounded",
|
|
140
|
-
children: t
|
|
141
|
-
}),
|
|
142
|
-
pre: ({ children: e }) => /* @__PURE__ */ a("pre", {
|
|
143
|
-
className: "bg-muted rounded-md p-4 mb-3 overflow-x-auto",
|
|
144
|
-
children: e
|
|
145
|
-
}),
|
|
146
|
-
table: ({ children: e }) => /* @__PURE__ */ a("div", {
|
|
147
|
-
className: "overflow-x-auto mb-3",
|
|
148
|
-
children: /* @__PURE__ */ a("table", {
|
|
149
|
-
className: "w-full text-sm border-collapse",
|
|
150
|
-
children: e
|
|
151
|
-
})
|
|
152
|
-
}),
|
|
153
|
-
thead: ({ children: e }) => /* @__PURE__ */ a("thead", {
|
|
154
|
-
className: "border-b",
|
|
155
|
-
children: e
|
|
156
|
-
}),
|
|
157
|
-
th: ({ children: e }) => /* @__PURE__ */ a("th", {
|
|
158
|
-
className: "text-left font-semibold text-foreground px-3 py-2",
|
|
159
|
-
children: e
|
|
160
|
-
}),
|
|
161
|
-
td: ({ children: e }) => /* @__PURE__ */ a("td", {
|
|
162
|
-
className: "border-b border-muted px-3 py-2 text-foreground",
|
|
163
|
-
children: e
|
|
164
|
-
}),
|
|
165
|
-
hr: () => /* @__PURE__ */ a("hr", { className: "my-6 border-muted" })
|
|
166
|
-
},
|
|
167
|
-
children: n
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
//#endregion
|
|
171
|
-
export { h as t };
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { t } from "./i18n-BhLphJa3.js";
|
|
3
|
-
import { Mn as n, vn as r } from "./ui-Fxy95kSJ.js";
|
|
4
|
-
import { a as i, o as a, s as o } from "./tooltip-_geGvbS7.js";
|
|
5
|
-
import { h as s, m as c, p as l } from "./sheet-cWJO_wkT.js";
|
|
6
|
-
import { useCallback as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
7
|
-
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
-
import { ChevronDownIcon as v, SearchIcon as y, XIcon as b } from "lucide-react";
|
|
9
|
-
import { Command as x } from "cmdk";
|
|
10
|
-
//#region src/components/core/inputs/select.helper.tsx
|
|
11
|
-
var S = 40, C = 224, w = 6;
|
|
12
|
-
function T(e, t, n) {
|
|
13
|
-
let r = p(null), [i, a] = m(0), [o, s] = m(0), c = o || (n ? 52 : 40), l = t > S, f = l ? Math.max(0, Math.floor(i / c) - w) : 0, h = l ? Math.min(t, Math.ceil((i + C) / c) + w) : t, g = l ? f * c : 0, _ = l ? (t - h) * c : 0;
|
|
14
|
-
d(() => {
|
|
15
|
-
if (!e) return;
|
|
16
|
-
let t = r.current?.querySelector("[cmdk-item]");
|
|
17
|
-
if (t) {
|
|
18
|
-
let e = t.getBoundingClientRect().height;
|
|
19
|
-
e > 0 && Math.abs(e - o) > .5 && s(e);
|
|
20
|
-
}
|
|
21
|
-
}, [
|
|
22
|
-
e,
|
|
23
|
-
t,
|
|
24
|
-
o
|
|
25
|
-
]);
|
|
26
|
-
let v = u(() => {
|
|
27
|
-
a(0), r.current && (r.current.scrollTop = 0);
|
|
28
|
-
}, []);
|
|
29
|
-
return {
|
|
30
|
-
listRef: r,
|
|
31
|
-
virtualized: l,
|
|
32
|
-
startIndex: f,
|
|
33
|
-
endIndex: h,
|
|
34
|
-
padTop: g,
|
|
35
|
-
padBottom: _,
|
|
36
|
-
onScroll: l ? (e) => {
|
|
37
|
-
a(e.currentTarget.scrollTop);
|
|
38
|
-
} : void 0,
|
|
39
|
-
resetScroll: v
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
var E = (t, n) => t === void 0 ? null : t ? /* @__PURE__ */ g("img", {
|
|
43
|
-
src: t,
|
|
44
|
-
alt: "",
|
|
45
|
-
loading: "lazy",
|
|
46
|
-
className: e("h-9 w-12 shrink-0 rounded object-cover", n)
|
|
47
|
-
}) : /* @__PURE__ */ g("span", {
|
|
48
|
-
className: e("flex h-9 w-12 shrink-0 items-center justify-center rounded bg-muted text-[9px] text-muted-foreground", n),
|
|
49
|
-
children: "—"
|
|
50
|
-
}), D = ({ options: u, selected: d, onToggle: p, onClear: S, onSelectAll: C, variant: w = "input", placeholder: D, labelKey: O, searchable: ee = !1, searchPlaceholder: te, disabled: k = !1, modal: ne = !0, chips: re = !1, maxCount: A, className: j, ...M }) => {
|
|
51
|
-
let { t: N } = t(), [P, F] = m(""), [I, ie] = m(!1), L = w === "pill", R = w === "input" ? void 0 : a, z = f(() => P === "" ? u : u.filter((e) => e.label.toLowerCase().includes(P.toLowerCase())), [u, P]), B = f(() => z.filter((e) => e.disabled !== !0).map((e) => e.value), [z]), V = f(() => d.filter((e) => u.find((t) => t.value === e)?.disabled === !0), [u, d]), H = f(() => B.length !== 0 && B.every((e) => d.includes(e)), [B, d]), U = f(() => d.map((e) => u.find((t) => t.value === e)?.label ?? e), [u, d]), 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 } = T(I, z.length, u.some((e) => e.imageUrl !== void 0)), se = q ? z.slice(J, ae) : z, ce = (e) => {
|
|
52
|
-
ie(e), e ? Z() : F("");
|
|
53
|
-
}, Q = (e) => {
|
|
54
|
-
F(e), Z();
|
|
55
|
-
}, le = () => {
|
|
56
|
-
V.length > 0 ? C === void 0 ? d.filter((e) => !V.includes(e)).forEach((e) => {
|
|
57
|
-
p(e);
|
|
58
|
-
}) : C(V) : S === void 0 ? C === void 0 ? d.forEach((e) => {
|
|
59
|
-
p(e);
|
|
60
|
-
}) : C([]) : S();
|
|
61
|
-
}, ue = () => {
|
|
62
|
-
if (H) C === void 0 ? S !== void 0 && d.every((e) => B.includes(e)) ? S() : B.forEach((e) => {
|
|
63
|
-
p(e);
|
|
64
|
-
}) : C(d.filter((e) => !B.includes(e)));
|
|
65
|
-
else if (C !== void 0) {
|
|
66
|
-
let e = [...d];
|
|
67
|
-
B.forEach((t) => {
|
|
68
|
-
e.includes(t) || e.push(t);
|
|
69
|
-
}), C(e);
|
|
70
|
-
} else B.forEach((e) => {
|
|
71
|
-
d.includes(e) || p(e);
|
|
72
|
-
});
|
|
73
|
-
}, $ = f(() => d.map((e) => ({
|
|
74
|
-
value: e,
|
|
75
|
-
option: u.find((t) => t.value === e)
|
|
76
|
-
})), [u, d]), de = L ? /* @__PURE__ */ _("button", {
|
|
77
|
-
...M,
|
|
78
|
-
type: "button",
|
|
79
|
-
disabled: k,
|
|
80
|
-
className: e(i, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors", d.length > 0 ? "border-primary bg-primary/10 text-primary font-medium" : "hover:bg-muted", R, j),
|
|
81
|
-
children: [/* @__PURE__ */ g("span", {
|
|
82
|
-
className: "truncate",
|
|
83
|
-
children: O === void 0 ? D ?? N("select.placeholder") : N(O)
|
|
84
|
-
}), /* @__PURE__ */ _("div", {
|
|
85
|
-
className: "flex shrink-0 items-center gap-1.5",
|
|
86
|
-
children: [d.length > 0 && /* @__PURE__ */ g("span", {
|
|
87
|
-
className: "flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground",
|
|
88
|
-
children: d.length
|
|
89
|
-
}), /* @__PURE__ */ g(v, { className: e("size-3.5 opacity-60 transition-transform", I && "rotate-180") })]
|
|
90
|
-
})]
|
|
91
|
-
}) : /* @__PURE__ */ _("button", {
|
|
92
|
-
...M,
|
|
93
|
-
type: "button",
|
|
94
|
-
disabled: k,
|
|
95
|
-
className: e(o, "w-full", R, I && "ring-2 ring-ring ring-offset-2", d.length === 0 && "text-muted-foreground", j),
|
|
96
|
-
children: [/* @__PURE__ */ g("span", {
|
|
97
|
-
className: "truncate",
|
|
98
|
-
children: d.length === 0 ? D ?? N("select.placeholder") : W.join(", ")
|
|
99
|
-
}), /* @__PURE__ */ _("div", {
|
|
100
|
-
className: "flex shrink-0 items-center gap-1",
|
|
101
|
-
children: [
|
|
102
|
-
G > 0 && /* @__PURE__ */ _("span", {
|
|
103
|
-
className: "rounded-control bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground",
|
|
104
|
-
children: ["+", G]
|
|
105
|
-
}),
|
|
106
|
-
d.length > 0 && !k && /* @__PURE__ */ g("span", {
|
|
107
|
-
role: "button",
|
|
108
|
-
tabIndex: -1,
|
|
109
|
-
onClick: (e) => {
|
|
110
|
-
e.stopPropagation();
|
|
111
|
-
},
|
|
112
|
-
onPointerDown: (e) => {
|
|
113
|
-
e.preventDefault(), e.stopPropagation(), le();
|
|
114
|
-
},
|
|
115
|
-
className: "text-muted-foreground hover:text-foreground",
|
|
116
|
-
children: /* @__PURE__ */ g(b, { className: "size-4" })
|
|
117
|
-
}),
|
|
118
|
-
/* @__PURE__ */ g(v, { className: e("size-4 opacity-50 shrink-0 transition-transform", I && "rotate-180") })
|
|
119
|
-
]
|
|
120
|
-
})]
|
|
121
|
-
}), fe = re && $.length > 0 ? /* @__PURE__ */ g("div", {
|
|
122
|
-
className: "mt-2 flex flex-wrap gap-1.5",
|
|
123
|
-
children: $.map(({ value: e, option: t }) => {
|
|
124
|
-
let r = t?.disabled === !0;
|
|
125
|
-
return /* @__PURE__ */ _(n, {
|
|
126
|
-
variant: "secondary",
|
|
127
|
-
className: "flex items-center gap-1 border border-primary/20 bg-primary/10 py-0.5 pl-2 pr-1 text-primary",
|
|
128
|
-
children: [/* @__PURE__ */ g("span", {
|
|
129
|
-
className: "max-w-[16rem] truncate",
|
|
130
|
-
children: t?.label ?? e
|
|
131
|
-
}), !r && /* @__PURE__ */ g("button", {
|
|
132
|
-
type: "button",
|
|
133
|
-
onClick: () => {
|
|
134
|
-
p(e);
|
|
135
|
-
},
|
|
136
|
-
className: "rounded-full p-0.5 hover:bg-primary/20",
|
|
137
|
-
"aria-label": N("filters.remove"),
|
|
138
|
-
children: /* @__PURE__ */ g(b, { className: "size-3" })
|
|
139
|
-
})]
|
|
140
|
-
}, e);
|
|
141
|
-
})
|
|
142
|
-
}) : null;
|
|
143
|
-
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(l, {
|
|
144
|
-
open: I,
|
|
145
|
-
onOpenChange: ce,
|
|
146
|
-
modal: ne,
|
|
147
|
-
children: [/* @__PURE__ */ g(s, {
|
|
148
|
-
asChild: !0,
|
|
149
|
-
children: de
|
|
150
|
-
}), /* @__PURE__ */ _(c, {
|
|
151
|
-
className: e("p-0", L ? "w-72 max-w-[var(--radix-popover-content-available-width)]" : "w-[var(--radix-popover-trigger-width)]"),
|
|
152
|
-
align: "start",
|
|
153
|
-
children: [/* @__PURE__ */ _(x, {
|
|
154
|
-
shouldFilter: !1,
|
|
155
|
-
className: "flex flex-col",
|
|
156
|
-
children: [ee ? /* @__PURE__ */ g("div", {
|
|
157
|
-
className: "border-b border-border p-2",
|
|
158
|
-
children: /* @__PURE__ */ _("div", {
|
|
159
|
-
className: "relative",
|
|
160
|
-
children: [/* @__PURE__ */ g(y, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ g(x.Input, {
|
|
161
|
-
value: P,
|
|
162
|
-
onValueChange: Q,
|
|
163
|
-
placeholder: te ?? N("search.placeholder"),
|
|
164
|
-
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",
|
|
165
|
-
autoFocus: !0
|
|
166
|
-
})]
|
|
167
|
-
})
|
|
168
|
-
}) : /* @__PURE__ */ g(x.Input, {
|
|
169
|
-
autoFocus: !0,
|
|
170
|
-
tabIndex: -1,
|
|
171
|
-
className: "sr-only"
|
|
172
|
-
}), /* @__PURE__ */ _(x.List, {
|
|
173
|
-
ref: K,
|
|
174
|
-
onScroll: oe,
|
|
175
|
-
className: e("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"),
|
|
176
|
-
children: [
|
|
177
|
-
z.length === 0 && /* @__PURE__ */ g("p", {
|
|
178
|
-
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
179
|
-
children: N("states.noResult")
|
|
180
|
-
}),
|
|
181
|
-
Y > 0 && /* @__PURE__ */ g("div", {
|
|
182
|
-
"aria-hidden": !0,
|
|
183
|
-
style: { height: Y }
|
|
184
|
-
}),
|
|
185
|
-
se.map((e) => /* @__PURE__ */ _(x.Item, {
|
|
186
|
-
value: e.value,
|
|
187
|
-
disabled: e.disabled,
|
|
188
|
-
onSelect: () => {
|
|
189
|
-
p(e.value);
|
|
190
|
-
},
|
|
191
|
-
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",
|
|
192
|
-
children: [
|
|
193
|
-
/* @__PURE__ */ g("span", {
|
|
194
|
-
className: "pointer-events-none shrink-0",
|
|
195
|
-
children: /* @__PURE__ */ g(r, { checked: d.includes(e.value) })
|
|
196
|
-
}),
|
|
197
|
-
E(e.imageUrl),
|
|
198
|
-
e.color && /* @__PURE__ */ g("span", {
|
|
199
|
-
className: "size-2.5 shrink-0 rounded-full",
|
|
200
|
-
style: { backgroundColor: e.color }
|
|
201
|
-
}),
|
|
202
|
-
/* @__PURE__ */ g("span", {
|
|
203
|
-
className: "min-w-0 flex-1 truncate",
|
|
204
|
-
title: e.label,
|
|
205
|
-
children: e.label
|
|
206
|
-
})
|
|
207
|
-
]
|
|
208
|
-
}, e.value)),
|
|
209
|
-
X > 0 && /* @__PURE__ */ g("div", {
|
|
210
|
-
"aria-hidden": !0,
|
|
211
|
-
style: { height: X }
|
|
212
|
-
})
|
|
213
|
-
]
|
|
214
|
-
})]
|
|
215
|
-
}), B.length > 0 && /* @__PURE__ */ g("div", {
|
|
216
|
-
className: "border-t border-border p-1.5",
|
|
217
|
-
children: /* @__PURE__ */ g("button", {
|
|
218
|
-
type: "button",
|
|
219
|
-
onClick: ue,
|
|
220
|
-
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",
|
|
221
|
-
children: N(H ? "filters.deselectAll" : "filters.selectAll")
|
|
222
|
-
})
|
|
223
|
-
})]
|
|
224
|
-
})]
|
|
225
|
-
}), fe] });
|
|
226
|
-
};
|
|
227
|
-
//#endregion
|
|
228
|
-
export { E as n, T as r, D as t };
|