@vezham/template 26.0.0-alpha.5 → 26.0.0-alpha.6

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.
Files changed (39) hide show
  1. package/README.md +2 -0
  2. package/dist/index.css +1 -0
  3. package/dist/index.d.ts +3 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +7 -0
  6. package/dist/lib/components/error-page.d.ts +6 -0
  7. package/dist/lib/components/error-page.d.ts.map +1 -0
  8. package/dist/lib/components/error-page.js +16 -0
  9. package/dist/lib/components/index.d.ts +4 -0
  10. package/dist/lib/components/index.d.ts.map +1 -0
  11. package/dist/lib/components/index.js +4 -0
  12. package/dist/lib/components/loading.d.ts +2 -0
  13. package/dist/lib/components/loading.d.ts.map +1 -0
  14. package/dist/lib/components/loading.js +13 -0
  15. package/dist/lib/components/not-found.d.ts +8 -0
  16. package/dist/lib/components/not-found.d.ts.map +1 -0
  17. package/dist/lib/components/not-found.js +63 -0
  18. package/dist/lib/pages/home/empty-state.d.ts +2 -0
  19. package/dist/lib/pages/home/empty-state.d.ts.map +1 -0
  20. package/dist/lib/pages/home/empty-state.js +85 -0
  21. package/dist/lib/pages/home/index.d.ts +6 -0
  22. package/dist/lib/pages/home/index.d.ts.map +1 -0
  23. package/dist/lib/pages/home/index.js +139 -0
  24. package/dist/lib/pages/home/posts.d.ts +2 -0
  25. package/dist/lib/pages/home/posts.d.ts.map +1 -0
  26. package/dist/lib/pages/home/posts.js +15 -0
  27. package/dist/lib/pages/index.d.ts +3 -0
  28. package/dist/lib/pages/index.d.ts.map +1 -0
  29. package/dist/lib/pages/index.js +3 -0
  30. package/dist/lib/pages/pro/index.d.ts +2 -0
  31. package/dist/lib/pages/pro/index.d.ts.map +1 -0
  32. package/dist/lib/pages/pro/index.js +6 -0
  33. package/dist/lib/store/index.d.ts +2 -0
  34. package/dist/lib/store/index.d.ts.map +1 -0
  35. package/dist/lib/store/index.js +2 -0
  36. package/dist/lib/store/use-posts/index.d.ts +8 -0
  37. package/dist/lib/store/use-posts/index.d.ts.map +1 -0
  38. package/dist/lib/store/use-posts/index.js +14 -0
  39. package/package.json +30 -1
package/README.md CHANGED
@@ -1 +1,3 @@
1
1
  # @vezham/template
2
+
3
+ Shared app template pages, components, and store defaults.
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ @source './**/*.js';
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export {};
1
+ export * from './lib/components';
2
+ export * from './lib/pages';
3
+ export * from './lib/store';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
package/dist/index.js CHANGED
@@ -0,0 +1,7 @@
1
+ import { ErrorPage } from "./lib/components/error-page.js";
2
+ import { Loading } from "./lib/components/loading.js";
3
+ import { NotFound } from "./lib/components/not-found.js";
4
+ import { usePosts } from "./lib/store/use-posts/index.js";
5
+ import { Home } from "./lib/pages/home/index.js";
6
+ import { Pro } from "./lib/pages/pro/index.js";
7
+ export { ErrorPage, Home, Loading, NotFound, Pro, usePosts };
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ error?: unknown;
3
+ };
4
+ export declare const ErrorPage: ({ error }: Props) => import("react").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=error-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-page.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-page.tsx"],"names":[],"mappings":"AAEA,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAUD,eAAO,MAAM,SAAS,GAAI,WAAW,KAAK,gCASzC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { Alert } from "@vezham/react-v3";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/lib/components/error-page.tsx
4
+ var getMessage = (error) => {
5
+ if (error instanceof Error) return error.message;
6
+ return "Something went wrong.";
7
+ };
8
+ var ErrorPage = ({ error }) => /* @__PURE__ */ jsx("main", {
9
+ className: "vx-error-page mx-auto flex min-h-80 max-w-xl flex-col items-center justify-center gap-3 p-6 text-center",
10
+ children: /* @__PURE__ */ jsx(Alert, {
11
+ status: "danger",
12
+ children: /* @__PURE__ */ jsxs(Alert.Content, { children: [/* @__PURE__ */ jsx(Alert.Title, { children: "Unable to load this page" }), /* @__PURE__ */ jsx(Alert.Description, { children: getMessage(error) })] })
13
+ })
14
+ });
15
+ //#endregion
16
+ export { ErrorPage };
@@ -0,0 +1,4 @@
1
+ export * from './error-page';
2
+ export * from './loading';
3
+ export * from './not-found';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { ErrorPage } from "./error-page.js";
2
+ import { Loading } from "./loading.js";
3
+ import { NotFound } from "./not-found.js";
4
+ export { ErrorPage, Loading, NotFound };
@@ -0,0 +1,2 @@
1
+ export declare const Loading: () => import("react").JSX.Element;
2
+ //# sourceMappingURL=loading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../../src/lib/components/loading.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,mCAInB,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { Spinner } from "@vezham/react-v3";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/lib/components/loading.tsx
4
+ var Loading = () => /* @__PURE__ */ jsx("div", {
5
+ className: "vx-loading flex min-h-40 items-center justify-center p-6",
6
+ children: /* @__PURE__ */ jsx(Spinner, {
7
+ "aria-label": "Loading",
8
+ color: "accent",
9
+ size: "lg"
10
+ })
11
+ });
12
+ //#endregion
13
+ export { Loading };
@@ -0,0 +1,8 @@
1
+ type Props = {
2
+ app?: string;
3
+ version?: string;
4
+ homeUrl?: string;
5
+ };
6
+ export declare const NotFound: ({ app, homeUrl, version }: Props) => import("react").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=not-found.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../../src/lib/components/not-found.tsx"],"names":[],"mappings":"AAiBA,KAAK,KAAK,GAAG;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,2BAAwC,KAAK,gCAkDrE,CAAA"}
@@ -0,0 +1,63 @@
1
+ "use client";
2
+ import { EmptyState, Typography, buttonVariants } from "@vezham/react-v3";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useSyncExternalStore } from "react";
5
+ //#region src/lib/components/not-found.tsx
6
+ var getNotFoundImageSrc = (version) => `https://static.cdn.vezham.com/vassets/no-internet.svg?vx=${encodeURIComponent(version)}`;
7
+ var getPathname = () => window.location.pathname || "/";
8
+ var getServerPathname = () => "";
9
+ var subscribeToPathname = (onPathnameChange) => {
10
+ window.addEventListener("popstate", onPathnameChange);
11
+ return () => window.removeEventListener("popstate", onPathnameChange);
12
+ };
13
+ var NotFound = ({ app = "Vx", homeUrl = "/", version }) => {
14
+ const pathname = useSyncExternalStore(subscribeToPathname, getPathname, getServerPathname);
15
+ const imageSrc = version ? getNotFoundImageSrc(version) : void 0;
16
+ return /* @__PURE__ */ jsx("main", {
17
+ className: "vx-not-found flex min-h-screen items-center justify-center p-6 text-left",
18
+ children: /* @__PURE__ */ jsx(EmptyState, {
19
+ className: "w-full max-w-148 items-start gap-0 p-2 text-left",
20
+ children: /* @__PURE__ */ jsxs("div", {
21
+ className: "vx-not-found__content flex w-full max-w-144 flex-col items-start justify-center gap-3",
22
+ children: [
23
+ imageSrc ? /* @__PURE__ */ jsx("img", {
24
+ alt: "Page not found",
25
+ className: "vx-not-found__image mb-3 h-auto max-h-64 w-[min(20rem,70vw)] max-w-full object-contain landscape:max-h-44 landscape:w-[min(14rem,30vw)]",
26
+ src: imageSrc
27
+ }) : null,
28
+ /* @__PURE__ */ jsx(Typography.Heading, {
29
+ className: "vx-not-found__code text-muted",
30
+ level: 1,
31
+ children: "404"
32
+ }),
33
+ /* @__PURE__ */ jsx(Typography.Heading, {
34
+ className: "vx-not-found__title",
35
+ level: 2,
36
+ children: "Page not found"
37
+ }),
38
+ /* @__PURE__ */ jsxs(Typography.Paragraph, {
39
+ className: "vx-not-found__description",
40
+ color: "muted",
41
+ children: [
42
+ app,
43
+ " could not find the page you requested",
44
+ /* @__PURE__ */ jsx("span", {
45
+ className: "vx-not-found__path font-semibold wrap-anywhere",
46
+ "data-vx-not-found-path": true,
47
+ children: pathname ? `: ${pathname}` : null
48
+ }),
49
+ "."
50
+ ]
51
+ }),
52
+ /* @__PURE__ */ jsx("a", {
53
+ className: `vx-not-found__home ${buttonVariants({ variant: "secondary" })}`,
54
+ href: homeUrl,
55
+ children: "Back to Home"
56
+ })
57
+ ]
58
+ })
59
+ })
60
+ });
61
+ };
62
+ //#endregion
63
+ export { NotFound };
@@ -0,0 +1,2 @@
1
+ export declare const PageEmptyState: () => import("react").JSX.Element;
2
+ //# sourceMappingURL=empty-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../../../src/lib/pages/home/empty-state.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,mCAkE1B,CAAA"}
@@ -0,0 +1,85 @@
1
+ import { Button, Kbd, Label, Separator } from "@vezham/react-v3";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { FolderOpen, VezhamLogo } from "@vezham/icons-react";
4
+ import { ContextMenu, EmptyState as EmptyState$1 } from "@vezham/react-pro-v3";
5
+ //#region src/lib/pages/home/empty-state.tsx
6
+ var PageEmptyState = () => {
7
+ return /* @__PURE__ */ jsxs("div", {
8
+ className: "w-105",
9
+ children: [
10
+ /* @__PURE__ */ jsxs(EmptyState$1, { children: [/* @__PURE__ */ jsxs(EmptyState$1.Header, { children: [
11
+ /* @__PURE__ */ jsxs("div", {
12
+ className: "flex flex-row gap-2",
13
+ children: [/* @__PURE__ */ jsx(EmptyState$1.Media, {
14
+ variant: "default",
15
+ children: /* @__PURE__ */ jsx(VezhamLogo, { size: 32 })
16
+ }), /* @__PURE__ */ jsx(EmptyState$1.Media, {
17
+ variant: "icon",
18
+ children: /* @__PURE__ */ jsx(FolderOpen, {
19
+ size: 20,
20
+ weight: "duotone-filled"
21
+ })
22
+ })]
23
+ }),
24
+ /* @__PURE__ */ jsx(EmptyState$1.Title, { children: "No Projects Yet" }),
25
+ /* @__PURE__ */ jsx(EmptyState$1.Description, { children: "You haven't created any projects yet. Get started by creating your first project." })
26
+ ] }), /* @__PURE__ */ jsxs(EmptyState$1.Content, {
27
+ className: "flex-row gap-2",
28
+ children: [/* @__PURE__ */ jsx(Button, { children: "Create Project" }), /* @__PURE__ */ jsx(Button, {
29
+ variant: "outline",
30
+ children: "Import Project"
31
+ })]
32
+ })] }),
33
+ /* @__PURE__ */ jsx(Separator, {}),
34
+ /* @__PURE__ */ jsxs(ContextMenu, { children: [/* @__PURE__ */ jsx(ContextMenu.Trigger, { children: /* @__PURE__ */ jsx("div", {
35
+ className: "border-border text-muted flex h-48 w-80 items-center justify-center rounded-xl border border-dashed text-sm select-none",
36
+ children: "Right-click here | ... @vezham/react-v3"
37
+ }) }), /* @__PURE__ */ jsx(ContextMenu.Popover, { children: /* @__PURE__ */ jsxs(ContextMenu.Menu, { children: [
38
+ /* @__PURE__ */ jsxs(ContextMenu.Item, {
39
+ id: "back",
40
+ textValue: "Back",
41
+ children: [/* @__PURE__ */ jsx(Label, { children: "Back" }), /* @__PURE__ */ jsxs(Kbd, {
42
+ className: "ms-auto",
43
+ slot: "keyboard",
44
+ variant: "light",
45
+ children: [/* @__PURE__ */ jsx(Kbd.Abbr, { keyValue: "command" }), /* @__PURE__ */ jsx(Kbd.Content, { children: "[" })]
46
+ })]
47
+ }),
48
+ /* @__PURE__ */ jsxs(ContextMenu.Item, {
49
+ isDisabled: true,
50
+ id: "forward",
51
+ textValue: "Forward",
52
+ children: [/* @__PURE__ */ jsx(Label, { children: "Forward" }), /* @__PURE__ */ jsxs(Kbd, {
53
+ className: "ms-auto",
54
+ slot: "keyboard",
55
+ variant: "light",
56
+ children: [/* @__PURE__ */ jsx(Kbd.Abbr, { keyValue: "command" }), /* @__PURE__ */ jsx(Kbd.Content, { children: "]" })]
57
+ })]
58
+ }),
59
+ /* @__PURE__ */ jsxs(ContextMenu.Item, {
60
+ id: "reload",
61
+ textValue: "Reload",
62
+ children: [/* @__PURE__ */ jsx(Label, { children: "Reload" }), /* @__PURE__ */ jsxs(Kbd, {
63
+ className: "ms-auto",
64
+ slot: "keyboard",
65
+ variant: "light",
66
+ children: [/* @__PURE__ */ jsx(Kbd.Abbr, { keyValue: "command" }), /* @__PURE__ */ jsx(Kbd.Content, { children: "R" })]
67
+ })]
68
+ }),
69
+ /* @__PURE__ */ jsx(ContextMenu.Separator, {}),
70
+ /* @__PURE__ */ jsx(ContextMenu.Item, {
71
+ id: "view-source",
72
+ textValue: "View Page Source",
73
+ children: /* @__PURE__ */ jsx(Label, { children: "View Page Source" })
74
+ }),
75
+ /* @__PURE__ */ jsx(ContextMenu.Item, {
76
+ id: "inspect",
77
+ textValue: "Inspect",
78
+ children: /* @__PURE__ */ jsx(Label, { children: "Inspect" })
79
+ })
80
+ ] }) })] })
81
+ ]
82
+ });
83
+ };
84
+ //#endregion
85
+ export { PageEmptyState };
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ onPress: () => void;
3
+ };
4
+ export declare const Home: ({ onPress }: Props) => import("react").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/pages/home/index.tsx"],"names":[],"mappings":"AA0BA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,aAAa,KAAK,gCA0GtC,CAAA"}
@@ -0,0 +1,139 @@
1
+ "use client";
2
+ import { PageEmptyState } from "./empty-state.js";
3
+ import { Posts } from "./posts.js";
4
+ import { Avatar, Button, Chip, FieldError, Input, Label, Link, Separator, TextField, Tooltip, buttonVariants } from "@vezham/react-v3";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { useState } from "react";
7
+ import { CheckCircle, QuestionCircle } from "@vezham/icons-react";
8
+ import { Button as Button$1 } from "@vezham/react-v2";
9
+ import { useLogger } from "@vezham/use-logger";
10
+ //#region src/lib/pages/home/index.tsx
11
+ var NAMESPACE = "App/Home";
12
+ var Home = ({ onPress }) => {
13
+ const [value, setValue] = useState("");
14
+ const isInvalid = value.length > 0 && value.length < 3;
15
+ useLogger.log(NAMESPACE, "Hello World :)");
16
+ useLogger.debug(NAMESPACE, "Hello World :)");
17
+ useLogger.info(NAMESPACE, "Hello World :)");
18
+ useLogger.warn(NAMESPACE, "Hello World :)");
19
+ useLogger.error(NAMESPACE, "Hello World :)");
20
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21
+ /* @__PURE__ */ jsxs("div", {
22
+ className: "flex items-center gap-6",
23
+ children: [
24
+ /* @__PURE__ */ jsxs(Tooltip, {
25
+ delay: 0,
26
+ children: [/* @__PURE__ */ jsx(Tooltip.Trigger, {
27
+ "aria-label": "User avatar",
28
+ children: /* @__PURE__ */ jsxs(Avatar, {
29
+ size: "sm",
30
+ children: [/* @__PURE__ */ jsx(Avatar.Image, {
31
+ alt: "Jane Doe",
32
+ src: "https://img.heroui.chat/image/avatar?w=400&h=400&u=4"
33
+ }), /* @__PURE__ */ jsx(Avatar.Fallback, { children: "JD" })]
34
+ })
35
+ }), /* @__PURE__ */ jsxs(Tooltip.Content, {
36
+ showArrow: true,
37
+ children: [/* @__PURE__ */ jsx(Tooltip.Arrow, {}), /* @__PURE__ */ jsxs("div", {
38
+ className: "flex flex-col gap-0 py-1",
39
+ children: [/* @__PURE__ */ jsx("p", {
40
+ className: "font-semibold",
41
+ children: "Jane Doe"
42
+ }), /* @__PURE__ */ jsx("p", {
43
+ className: "text-muted text-xs",
44
+ children: "jane@example.com"
45
+ })]
46
+ })]
47
+ })]
48
+ }),
49
+ /* @__PURE__ */ jsxs(Tooltip, {
50
+ delay: 0,
51
+ children: [/* @__PURE__ */ jsx(Tooltip.Trigger, {
52
+ "aria-label": "Status chip",
53
+ children: /* @__PURE__ */ jsxs(Chip, {
54
+ color: "success",
55
+ children: [/* @__PURE__ */ jsx(CheckCircle, {
56
+ size: 12,
57
+ weight: "filled"
58
+ }), "Active"]
59
+ })
60
+ }), /* @__PURE__ */ jsxs(Tooltip.Content, {
61
+ className: "flex items-center gap-1.5",
62
+ children: [/* @__PURE__ */ jsxs("span", {
63
+ className: "relative flex size-2",
64
+ children: [/* @__PURE__ */ jsx("span", { className: "bg-success absolute inline-flex h-full w-full animate-ping rounded-full opacity-75" }), /* @__PURE__ */ jsx("span", { className: "bg-success relative inline-flex size-2 rounded-full" })]
65
+ }), /* @__PURE__ */ jsx("p", { children: "Jane is currently online" })]
66
+ })]
67
+ }),
68
+ /* @__PURE__ */ jsxs(Tooltip, {
69
+ delay: 0,
70
+ children: [/* @__PURE__ */ jsx(Tooltip.Trigger, {
71
+ "aria-label": "Info icon",
72
+ children: /* @__PURE__ */ jsx("div", {
73
+ className: "bg-accent-soft rounded-full p-2",
74
+ children: /* @__PURE__ */ jsx(QuestionCircle, {
75
+ className: "text-accent",
76
+ size: 16
77
+ })
78
+ })
79
+ }), /* @__PURE__ */ jsxs(Tooltip.Content, {
80
+ showArrow: true,
81
+ children: [/* @__PURE__ */ jsx(Tooltip.Arrow, {}), /* @__PURE__ */ jsxs("div", {
82
+ className: "max-w-xs px-1 py-1.5",
83
+ children: [/* @__PURE__ */ jsx("p", {
84
+ className: "mb-1 font-semibold",
85
+ children: "Help Information"
86
+ }), /* @__PURE__ */ jsx("p", {
87
+ className: "text-muted text-sm",
88
+ children: "This is a helpful tooltip with more detailed information about this feature."
89
+ })]
90
+ })]
91
+ })]
92
+ })
93
+ ]
94
+ }),
95
+ /* @__PURE__ */ jsxs(TextField, {
96
+ className: "w-64",
97
+ isInvalid,
98
+ children: [
99
+ /* @__PURE__ */ jsx(Label, {
100
+ htmlFor: "username",
101
+ children: "Username"
102
+ }),
103
+ /* @__PURE__ */ jsx(Input, {
104
+ id: "username",
105
+ placeholder: "Enter username",
106
+ value,
107
+ onChange: (e) => setValue(e.target.value)
108
+ }),
109
+ /* @__PURE__ */ jsx(FieldError, { children: "Username must be at least 3 characters" })
110
+ ]
111
+ }),
112
+ /* @__PURE__ */ jsx(Button, { children: "Hello World :) - v3" }),
113
+ /* @__PURE__ */ jsx(Button$1, {
114
+ children: "Hello World :) - v2",
115
+ color: "success",
116
+ variant: "solid"
117
+ }),
118
+ /* @__PURE__ */ jsxs(Link, {
119
+ onPress,
120
+ children: ["Pro - Demo", /* @__PURE__ */ jsx(Link.Icon, {})]
121
+ }),
122
+ /* @__PURE__ */ jsxs(Link, {
123
+ href: "/hello-world",
124
+ className: buttonVariants({ variant: "danger-soft" }),
125
+ children: [
126
+ /* @__PURE__ */ jsx(Link.Icon, {}),
127
+ "Hello World :|",
128
+ /* @__PURE__ */ jsx(Link.Icon, {})
129
+ ]
130
+ }),
131
+ /* @__PURE__ */ jsx(Separator, {}),
132
+ /* @__PURE__ */ jsx(PageEmptyState, {}),
133
+ /* @__PURE__ */ jsx(Separator, {}),
134
+ /* @__PURE__ */ jsx("div", { children: "Welcome to Playground!..." }),
135
+ /* @__PURE__ */ jsx(Posts, {})
136
+ ] });
137
+ };
138
+ //#endregion
139
+ export { Home };
@@ -0,0 +1,2 @@
1
+ export declare const Posts: () => import("react").JSX.Element;
2
+ //# sourceMappingURL=posts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../../../src/lib/pages/home/posts.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,mCAkBjB,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { usePosts } from "../../store/use-posts/index.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/lib/pages/home/posts.tsx
4
+ var Posts = () => {
5
+ const { data, error, isPending, isError } = usePosts();
6
+ if (isPending) return /* @__PURE__ */ jsx("div", { children: "Loading..." });
7
+ if (isError) return /* @__PURE__ */ jsxs("span", { children: ["Error: ", error.message] });
8
+ return /* @__PURE__ */ jsx("div", { children: data.map((post) => /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("a", {
9
+ "data-id": post.id,
10
+ href: `/posts/${post.id}`,
11
+ children: post.title
12
+ }) }, post.id)) });
13
+ };
14
+ //#endregion
15
+ export { Posts };
@@ -0,0 +1,3 @@
1
+ export * from './home';
2
+ export * from './pro';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/pages/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Home } from "./home/index.js";
2
+ import { Pro } from "./pro/index.js";
3
+ export { Home, Pro };
@@ -0,0 +1,2 @@
1
+ export declare const Pro: () => import("react").JSX.Element;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/pages/pro/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,mCAA2B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { PageEmptyState } from "../home/empty-state.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/lib/pages/pro/index.tsx
4
+ var Pro = () => /* @__PURE__ */ jsx(PageEmptyState, {});
5
+ //#endregion
6
+ export { Pro };
@@ -0,0 +1,2 @@
1
+ export * from './use-posts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/store/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { usePosts } from "./use-posts/index.js";
2
+ export { usePosts };
@@ -0,0 +1,8 @@
1
+ type Post = {
2
+ id: number;
3
+ title: string;
4
+ body: string;
5
+ };
6
+ export declare const usePosts: () => import("@tanstack/react-query").UseQueryResult<Post[], Error>;
7
+ export {};
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/use-posts/index.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,eAAO,MAAM,QAAQ,qEAapB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ //#region src/lib/store/use-posts/index.ts
3
+ var usePosts = () => {
4
+ return useQuery({
5
+ queryKey: ["posts"],
6
+ queryFn: async () => {
7
+ const response = await fetch("https://jsonplaceholder.typicode.com/posts");
8
+ if (!response.ok) throw new Error(`Unable to load posts: ${response.status}`);
9
+ return await response.json();
10
+ }
11
+ });
12
+ };
13
+ //#endregion
14
+ export { usePosts };
package/package.json CHANGED
@@ -1,14 +1,42 @@
1
1
  {
2
2
  "name": "@vezham/template",
3
- "version": "26.0.0-alpha.5",
3
+ "version": "26.0.0-alpha.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/vezham/vx-fe-pkgs.git",
7
7
  "directory": "packages/template"
8
8
  },
9
+ "sideEffects": [
10
+ "**/*.css"
11
+ ],
9
12
  "type": "module",
10
13
  "exports": {
14
+ "./components": {
15
+ "@vx/fe-kit": "./src/lib/components/index.ts",
16
+ "types": "./dist/lib/components/index.d.ts",
17
+ "import": "./dist/lib/components/index.js",
18
+ "default": "./dist/lib/components/index.js"
19
+ },
20
+ "./pages": {
21
+ "@vx/fe-kit": "./src/lib/pages/index.ts",
22
+ "types": "./dist/lib/pages/index.d.ts",
23
+ "import": "./dist/lib/pages/index.js",
24
+ "default": "./dist/lib/pages/index.js"
25
+ },
26
+ "./store": {
27
+ "@vx/fe-kit": "./src/lib/store/index.ts",
28
+ "types": "./dist/lib/store/index.d.ts",
29
+ "import": "./dist/lib/store/index.js",
30
+ "default": "./dist/lib/store/index.js"
31
+ },
32
+ "./app": {
33
+ "@vx/fe-kit": "./src/index.ts",
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js",
36
+ "default": "./dist/index.js"
37
+ },
11
38
  ".": {
39
+ "style": "./dist/index.css",
12
40
  "@vx/fe-kit": "./src/index.ts",
13
41
  "types": "./dist/index.d.ts",
14
42
  "import": "./dist/index.js",
@@ -19,6 +47,7 @@
19
47
  "main": "./dist/index.js",
20
48
  "module": "./dist/index.js",
21
49
  "types": "./dist/index.d.ts",
50
+ "style": "./dist/index.css",
22
51
  "files": [
23
52
  "!**/*.tsbuildinfo",
24
53
  "dist",