@vezham/template 0.0.0-stage → 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 (40) hide show
  1. package/LICENSE +173 -0
  2. package/README.md +2 -2
  3. package/dist/index.css +1 -0
  4. package/dist/index.d.ts +4 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +7 -0
  7. package/dist/lib/components/error-page.d.ts +6 -0
  8. package/dist/lib/components/error-page.d.ts.map +1 -0
  9. package/dist/lib/components/error-page.js +16 -0
  10. package/dist/lib/components/index.d.ts +4 -0
  11. package/dist/lib/components/index.d.ts.map +1 -0
  12. package/dist/lib/components/index.js +4 -0
  13. package/dist/lib/components/loading.d.ts +2 -0
  14. package/dist/lib/components/loading.d.ts.map +1 -0
  15. package/dist/lib/components/loading.js +13 -0
  16. package/dist/lib/components/not-found.d.ts +8 -0
  17. package/dist/lib/components/not-found.d.ts.map +1 -0
  18. package/dist/lib/components/not-found.js +63 -0
  19. package/dist/lib/pages/home/empty-state.d.ts +2 -0
  20. package/dist/lib/pages/home/empty-state.d.ts.map +1 -0
  21. package/dist/lib/pages/home/empty-state.js +85 -0
  22. package/dist/lib/pages/home/index.d.ts +6 -0
  23. package/dist/lib/pages/home/index.d.ts.map +1 -0
  24. package/dist/lib/pages/home/index.js +139 -0
  25. package/dist/lib/pages/home/posts.d.ts +2 -0
  26. package/dist/lib/pages/home/posts.d.ts.map +1 -0
  27. package/dist/lib/pages/home/posts.js +15 -0
  28. package/dist/lib/pages/index.d.ts +3 -0
  29. package/dist/lib/pages/index.d.ts.map +1 -0
  30. package/dist/lib/pages/index.js +3 -0
  31. package/dist/lib/pages/pro/index.d.ts +2 -0
  32. package/dist/lib/pages/pro/index.d.ts.map +1 -0
  33. package/dist/lib/pages/pro/index.js +6 -0
  34. package/dist/lib/store/index.d.ts +2 -0
  35. package/dist/lib/store/index.d.ts.map +1 -0
  36. package/dist/lib/store/index.js +2 -0
  37. package/dist/lib/store/use-posts/index.d.ts +8 -0
  38. package/dist/lib/store/use-posts/index.d.ts.map +1 -0
  39. package/dist/lib/store/use-posts/index.js +14 -0
  40. package/package.json +53 -3
package/LICENSE ADDED
@@ -0,0 +1,173 @@
1
+ SPDX-License-Identifier: BUSL-1.1
2
+
3
+ Business Source License 1.1
4
+
5
+ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
6
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
7
+
8
+ ---
9
+
10
+ Parameters
11
+
12
+ Licensor: Vezham Technologies Private Limited
13
+
14
+ Licensed Work: The source code and packages in this repository (“the Licensed Work”).
15
+ The Licensed Work is (c) 2025–present Vezham Technologies Private Limited
16
+
17
+ Release Tag: The applicable release tag or commit identifier (for example, “v1.0.0”)
18
+ published by the Licensor for this version of the Licensed Work.
19
+ Users must cross-check the tag or commit identifier to verify
20
+ the release version and applicable Change Date.
21
+
22
+ Additional Use Grant: 1. You may make non-production use of the Licensed Work.
23
+
24
+ 2. You may make production use of the Licensed Work, provided
25
+ your use does not include offering the Licensed Work, or any
26
+ derivative thereof, to third parties on a hosted, embedded,
27
+ or managed basis in order to compete with the Licensor’s
28
+ commercial offerings based on the Licensed Work, or offerings
29
+ that provide substantially similar functionality.
30
+
31
+ For purposes of this license:
32
+
33
+ A “competitive offering” is a Product that is offered to third
34
+ parties on a paid basis, including through paid support,
35
+ consulting, managed service arrangements, or similar commercial
36
+ relationships, that significantly overlaps with the capabilities
37
+ or functionality of the Licensor’s commercial offerings based on
38
+ the Licensed Work.
39
+
40
+ If your Product is not a competitive offering when you first
41
+ make it generally available, it will not become a competitive
42
+ offering solely because the Licensor releases a new version of the
43
+ Licensed Work with additional features or capabilities. Products
44
+ that are not provided on a paid basis are not competitive offerings.
45
+
46
+ “Product” means any software or service that is (a) offered to end
47
+ users for deployment in their own environments (self-managed), or
48
+ (b) offered as a hosted, cloud, or managed service by you or on
49
+ your behalf.
50
+
51
+ “Embedded” means including the source code or executable code of
52
+ the Licensed Work in a competitive offering. “Embedded” also means
53
+ packaging or distributing the competitive offering in a way that
54
+ requires the Licensed Work to be accessed, invoked, or downloaded
55
+ for the competitive offering to function.
56
+
57
+ Hosting or using the Licensed Work internally within your own
58
+ organization, including your affiliates under common control,
59
+ is not considered a competitive offering.
60
+
61
+ 3. Educational institutions and legally recognised non-profit
62
+ organizations may use the Licensed Work in a production
63
+ environment without restriction, provided such use is not
64
+ for commercial profit.
65
+
66
+ For binding interpretive guidance on using Vezham products under
67
+ the Business Source License, please visit our licensing FAQ:
68
+ https://trust.vezham.com/legal/license-faq
69
+
70
+ Change Date: Four (4) years from the date the Licensed Work is first publicly
71
+ released under the specified Release Tag
72
+
73
+ Change License: GNU Affero General Public License v3.0 (AGPL-3.0-or-later)
74
+ The full text of the Change License is available at:
75
+ https://www.gnu.org/licenses/agpl-3.0.html
76
+
77
+ For information about commercial licensing or alternative arrangements,
78
+ please contact the Licensor at: https://vezham.com
79
+ or email: license@vezham.com
80
+
81
+ For formal legal notices or IP-related correspondence,
82
+ please contact: licensor@vezham.com
83
+
84
+ ---
85
+
86
+ Notice
87
+
88
+ The Business Source License (this document, or the "License") is not an Open
89
+ Source license. However, the Licensed Work will eventually be made available
90
+ under an Open Source License, as stated in this License.
91
+
92
+ For more information on the use of the Business Source License generally,
93
+ please visit the Adopting and Developing Business Source License FAQ at:
94
+ https://mariadb.com/bsl-faq-adopting
95
+
96
+ ---
97
+
98
+ Business Source License 1.1
99
+
100
+ ---
101
+
102
+ Terms
103
+
104
+ The Licensor hereby grants you the right to copy, modify, create derivative
105
+ works, redistribute, and make non-production use of the Licensed Work.
106
+ The Licensor may make an Additional Use Grant, above, permitting limited
107
+ production use.
108
+
109
+ Effective on the Change Date, or the fourth anniversary of the first publicly
110
+ available distribution of a specific version of the Licensed Work under this
111
+ License, whichever comes first, the Licensor hereby grants you rights under
112
+ the terms of the Change License, and the rights granted in the paragraph
113
+ above terminate.
114
+
115
+ If your use of the Licensed Work does not comply with the requirements
116
+ currently in effect as described in this License, you must purchase a
117
+ commercial license from the Licensor, its affiliated entities, or authorized
118
+ resellers, or you must refrain from using the Licensed Work.
119
+
120
+ All copies of the original and modified Licensed Work, and derivative works
121
+ of the Licensed Work, are subject to this License. This License applies
122
+ separately for each version of the Licensed Work, and the Change Date may
123
+ vary for each version of the Licensed Work released by the Licensor.
124
+
125
+ You must conspicuously display this License on each original or modified copy
126
+ of the Licensed Work. If you receive the Licensed Work in original or modified
127
+ form from a third party, the terms and conditions set forth in this License
128
+ apply to your use of that work.
129
+
130
+ Any use of the Licensed Work in violation of this License will automatically
131
+ terminate your rights under this License for the current and all other versions
132
+ of the Licensed Work.
133
+
134
+ This License does not grant you any right in any trademark or logo of the
135
+ Licensor or its affiliates (provided that you may use a trademark or logo of
136
+ the Licensor as expressly required by this License).
137
+
138
+ ---
139
+
140
+ Disclaimer
141
+
142
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
143
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
144
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
145
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
146
+ TITLE.
147
+
148
+ -----------------------------------------------------------------------------
149
+
150
+ MariaDB hereby grants you permission to use this License’s text to license your
151
+ works, and to refer to it using the trademark "Business Source License", as long
152
+ as you comply with the Covenants of Licensor below.
153
+
154
+ Covenants of Licensor
155
+
156
+ In consideration of the right to use this License’s text and the "Business
157
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
158
+ other recipients of the licensed work to be provided by Licensor:
159
+
160
+ 1. To specify as the Change License the GPL Version 3.0 or any later version,
161
+ or a license that is compatible with GPL Version 3.0 or a later version,
162
+ where "compatible" means that software provided under the Change License can
163
+ be included in a program with software provided under GPL Version 3.0 or a
164
+ later version. Licensor may specify additional Change Licenses without
165
+ limitation.
166
+
167
+ 2. To either: (a) specify an additional grant of rights to use that does not
168
+ impose any additional restriction on the right granted in this License, as
169
+ the Additional Use Grant; or (b) insert the text "None".
170
+
171
+ 3. To specify a Change Date.
172
+
173
+ 4. Not to modify this License in any other way.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
1
+ # @vezham/template
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared app template pages, components, and store defaults.
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ @source './**/*.js';
@@ -0,0 +1,4 @@
1
+ export * from './lib/components';
2
+ export * from './lib/pages';
3
+ export * from './lib/store';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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 ADDED
@@ -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,6 +1,56 @@
1
1
  {
2
2
  "name": "@vezham/template",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "26.0.0-alpha.6",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/vezham/vx-fe-pkgs.git",
7
+ "directory": "packages/template"
8
+ },
9
+ "sideEffects": [
10
+ "**/*.css"
11
+ ],
12
+ "type": "module",
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
+ },
38
+ ".": {
39
+ "style": "./dist/index.css",
40
+ "@vx/fe-kit": "./src/index.ts",
41
+ "types": "./dist/index.d.ts",
42
+ "import": "./dist/index.js",
43
+ "default": "./dist/index.js"
44
+ },
45
+ "./package.json": "./package.json"
46
+ },
47
+ "main": "./dist/index.js",
48
+ "module": "./dist/index.js",
49
+ "types": "./dist/index.d.ts",
50
+ "style": "./dist/index.css",
51
+ "files": [
52
+ "!**/*.tsbuildinfo",
53
+ "dist",
54
+ "LICENSE"
55
+ ]
6
56
  }