@alepha/ui 0.10.6 → 0.11.0

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.
@@ -0,0 +1,96 @@
1
+ import { NestedView, useRouterEvents } from "@alepha/react";
2
+ import { ModalsProvider } from "@mantine/modals";
3
+ import { ColorSchemeScript, MantineProvider } from "@mantine/core";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import React from "react";
6
+ import { Notifications } from "@mantine/notifications";
7
+ import { IconDashboard, IconFileText, IconHome, IconSearch, IconSettings, IconUser } from "@tabler/icons-react";
8
+ import { NavigationProgress, nprogress } from "@mantine/nprogress";
9
+ import { Spotlight } from "@mantine/spotlight";
10
+
11
+ //#region src/components/Omnibar.tsx
12
+ const defaultActions = [
13
+ {
14
+ id: "home",
15
+ label: "Home",
16
+ description: "Go to home page",
17
+ onClick: () => console.log("Home"),
18
+ leftSection: /* @__PURE__ */ jsx(IconHome, { size: 20 })
19
+ },
20
+ {
21
+ id: "dashboard",
22
+ label: "Dashboard",
23
+ description: "View your dashboard",
24
+ onClick: () => console.log("Dashboard"),
25
+ leftSection: /* @__PURE__ */ jsx(IconDashboard, { size: 20 })
26
+ },
27
+ {
28
+ id: "documents",
29
+ label: "Documents",
30
+ description: "Browse all documents",
31
+ onClick: () => console.log("Documents"),
32
+ leftSection: /* @__PURE__ */ jsx(IconFileText, { size: 20 })
33
+ },
34
+ {
35
+ id: "profile",
36
+ label: "Profile",
37
+ description: "View and edit your profile",
38
+ onClick: () => console.log("Profile"),
39
+ leftSection: /* @__PURE__ */ jsx(IconUser, { size: 20 })
40
+ },
41
+ {
42
+ id: "settings",
43
+ label: "Settings",
44
+ description: "Manage application settings",
45
+ onClick: () => console.log("Settings"),
46
+ leftSection: /* @__PURE__ */ jsx(IconSettings, { size: 20 })
47
+ }
48
+ ];
49
+ const Omnibar = (props) => {
50
+ const actions = props.actions ?? defaultActions;
51
+ const shortcut = props.shortcut ?? "mod+K";
52
+ const searchPlaceholder = props.searchPlaceholder ?? "Search...";
53
+ const nothingFound = props.nothingFound ?? "Nothing found...";
54
+ return /* @__PURE__ */ jsx(Spotlight, {
55
+ actions,
56
+ shortcut,
57
+ searchProps: {
58
+ leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 20 }),
59
+ placeholder: searchPlaceholder
60
+ },
61
+ nothingFound
62
+ });
63
+ };
64
+ var Omnibar_default = Omnibar;
65
+
66
+ //#endregion
67
+ //#region src/components/AlephaMantineProvider.tsx
68
+ const AlephaMantineProvider = (props) => {
69
+ useRouterEvents({
70
+ onBegin: () => {
71
+ nprogress.start();
72
+ },
73
+ onEnd: () => {
74
+ nprogress.complete();
75
+ }
76
+ });
77
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ColorSchemeScript, {
78
+ defaultColorScheme: props.mantine?.defaultColorScheme,
79
+ ...props.colorSchemeScript
80
+ }), /* @__PURE__ */ jsxs(MantineProvider, {
81
+ ...props.mantine,
82
+ children: [
83
+ /* @__PURE__ */ jsx(Notifications, { ...props.notifications }),
84
+ /* @__PURE__ */ jsx(NavigationProgress, { ...props.navigationProgress }),
85
+ /* @__PURE__ */ jsxs(ModalsProvider, {
86
+ ...props.modals,
87
+ children: [/* @__PURE__ */ jsx(Omnibar_default, { ...props.omnibar }), props.children ?? /* @__PURE__ */ jsx(NestedView, {})]
88
+ })
89
+ ]
90
+ })] });
91
+ };
92
+ var AlephaMantineProvider_default = AlephaMantineProvider;
93
+
94
+ //#endregion
95
+ export { Omnibar_default as n, AlephaMantineProvider_default as t };
96
+ //# sourceMappingURL=AlephaMantineProvider-DDbIijPF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlephaMantineProvider-DDbIijPF.js","names":["defaultActions: SpotlightActionData[]","Omnibar"],"sources":["../src/components/Omnibar.tsx","../src/components/AlephaMantineProvider.tsx"],"sourcesContent":["import { Spotlight, type SpotlightActionData } from \"@mantine/spotlight\";\nimport {\n IconDashboard,\n IconFileText,\n IconHome,\n IconSearch,\n IconSettings,\n IconUser,\n} from \"@tabler/icons-react\";\n// biome-ignore lint/correctness/noUnusedImports: required\nimport React, { type ReactNode } from \"react\";\n\nexport interface OmnibarProps {\n actions?: SpotlightActionData[];\n shortcut?: string | string[];\n searchPlaceholder?: string;\n nothingFound?: ReactNode;\n}\n\nconst defaultActions: SpotlightActionData[] = [\n {\n id: \"home\",\n label: \"Home\",\n description: \"Go to home page\",\n onClick: () => console.log(\"Home\"),\n leftSection: <IconHome size={20} />,\n },\n {\n id: \"dashboard\",\n label: \"Dashboard\",\n description: \"View your dashboard\",\n onClick: () => console.log(\"Dashboard\"),\n leftSection: <IconDashboard size={20} />,\n },\n {\n id: \"documents\",\n label: \"Documents\",\n description: \"Browse all documents\",\n onClick: () => console.log(\"Documents\"),\n leftSection: <IconFileText size={20} />,\n },\n {\n id: \"profile\",\n label: \"Profile\",\n description: \"View and edit your profile\",\n onClick: () => console.log(\"Profile\"),\n leftSection: <IconUser size={20} />,\n },\n {\n id: \"settings\",\n label: \"Settings\",\n description: \"Manage application settings\",\n onClick: () => console.log(\"Settings\"),\n leftSection: <IconSettings size={20} />,\n },\n];\n\nconst Omnibar = (props: OmnibarProps) => {\n const actions = props.actions ?? defaultActions;\n const shortcut = props.shortcut ?? \"mod+K\";\n const searchPlaceholder = props.searchPlaceholder ?? \"Search...\";\n const nothingFound = props.nothingFound ?? \"Nothing found...\";\n\n return (\n <Spotlight\n actions={actions}\n shortcut={shortcut}\n searchProps={{\n leftSection: <IconSearch size={20} />,\n placeholder: searchPlaceholder,\n }}\n nothingFound={nothingFound}\n />\n );\n};\n\nexport default Omnibar;\n","import { NestedView, useRouterEvents } from \"@alepha/react\";\nimport type {\n ColorSchemeScriptProps,\n MantineProviderProps,\n} from \"@mantine/core\";\nimport { ColorSchemeScript, MantineProvider } from \"@mantine/core\";\nimport { ModalsProvider, type ModalsProviderProps } from \"@mantine/modals\";\nimport { Notifications, type NotificationsProps } from \"@mantine/notifications\";\nimport type { NavigationProgressProps } from \"@mantine/nprogress\";\nimport { NavigationProgress, nprogress } from \"@mantine/nprogress\";\nimport type { ReactNode } from \"react\";\nimport Omnibar, { type OmnibarProps } from \"./Omnibar\";\n\nexport interface AlephaMantineProviderProps {\n children?: ReactNode;\n mantine?: MantineProviderProps;\n colorSchemeScript?: ColorSchemeScriptProps;\n navigationProgress?: NavigationProgressProps;\n notifications?: NotificationsProps;\n modals?: ModalsProviderProps;\n omnibar?: OmnibarProps;\n}\n\nconst AlephaMantineProvider = (props: AlephaMantineProviderProps) => {\n useRouterEvents({\n onBegin: () => {\n nprogress.start();\n },\n onEnd: () => {\n nprogress.complete();\n },\n });\n\n return (\n <>\n <ColorSchemeScript\n defaultColorScheme={props.mantine?.defaultColorScheme}\n {...props.colorSchemeScript}\n />\n <MantineProvider {...props.mantine}>\n <Notifications {...props.notifications} />\n <NavigationProgress {...props.navigationProgress} />\n <ModalsProvider {...props.modals}>\n <Omnibar {...props.omnibar} />\n {props.children ?? <NestedView />}\n </ModalsProvider>\n </MantineProvider>\n </>\n );\n};\n\nexport default AlephaMantineProvider;\n"],"mappings":";;;;;;;;;;;AAmBA,MAAMA,iBAAwC;CAC5C;EACE,IAAI;EACJ,OAAO;EACP,aAAa;EACb,eAAe,QAAQ,IAAI,OAAO;EAClC,aAAa,oBAAC,YAAS,MAAM,KAAM;EACpC;CACD;EACE,IAAI;EACJ,OAAO;EACP,aAAa;EACb,eAAe,QAAQ,IAAI,YAAY;EACvC,aAAa,oBAAC,iBAAc,MAAM,KAAM;EACzC;CACD;EACE,IAAI;EACJ,OAAO;EACP,aAAa;EACb,eAAe,QAAQ,IAAI,YAAY;EACvC,aAAa,oBAAC,gBAAa,MAAM,KAAM;EACxC;CACD;EACE,IAAI;EACJ,OAAO;EACP,aAAa;EACb,eAAe,QAAQ,IAAI,UAAU;EACrC,aAAa,oBAAC,YAAS,MAAM,KAAM;EACpC;CACD;EACE,IAAI;EACJ,OAAO;EACP,aAAa;EACb,eAAe,QAAQ,IAAI,WAAW;EACtC,aAAa,oBAAC,gBAAa,MAAM,KAAM;EACxC;CACF;AAED,MAAM,WAAW,UAAwB;CACvC,MAAM,UAAU,MAAM,WAAW;CACjC,MAAM,WAAW,MAAM,YAAY;CACnC,MAAM,oBAAoB,MAAM,qBAAqB;CACrD,MAAM,eAAe,MAAM,gBAAgB;AAE3C,QACE,oBAAC;EACU;EACC;EACV,aAAa;GACX,aAAa,oBAAC,cAAW,MAAM,KAAM;GACrC,aAAa;GACd;EACa;GACd;;AAIN,sBAAe;;;;ACrDf,MAAM,yBAAyB,UAAsC;AACnE,iBAAgB;EACd,eAAe;AACb,aAAU,OAAO;;EAEnB,aAAa;AACX,aAAU,UAAU;;EAEvB,CAAC;AAEF,QACE,4CACE,oBAAC;EACC,oBAAoB,MAAM,SAAS;EACnC,GAAI,MAAM;GACV,EACF,qBAAC;EAAgB,GAAI,MAAM;;GACzB,oBAAC,iBAAc,GAAI,MAAM,gBAAiB;GAC1C,oBAAC,sBAAmB,GAAI,MAAM,qBAAsB;GACpD,qBAAC;IAAe,GAAI,MAAM;eACxB,oBAACC,mBAAQ,GAAI,MAAM,UAAW,EAC7B,MAAM,YAAY,oBAAC,eAAa;KAClB;;GACD,IACjB;;AAIP,oCAAe"}
@@ -0,0 +1,3 @@
1
+ import { t as AlephaMantineProvider_default } from "./AlephaMantineProvider-DDbIijPF.js";
2
+
3
+ export { AlephaMantineProvider_default as default };