gladvn 0.2.14 → 0.2.15
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/README.md +13 -13
- package/bin/cli.js +18 -18
- package/dist/dev/components/GladvnLogo.d.ts +10 -0
- package/dist/dev/components/{GladcnLogo.d.ts.map → GladvnLogo.d.ts.map} +1 -1
- package/dist/dev/showcase/overview.d.ts.map +1 -1
- package/llms.txt +10 -10
- package/package.json +3 -3
- package/scripts/clean-imports.ts +2 -2
- package/scripts/postinstall.cjs +4 -4
- package/src/dev/App.tsx +4 -4
- package/src/dev/components/{GladcnLogo.tsx → GladvnLogo.tsx} +4 -4
- package/src/dev/index.css +1 -1
- package/src/dev/sections/forms.tsx +1 -1
- package/src/dev/sections/overview.tsx +2 -2
- package/src/dev/showcase/navigation-menu.tsx +2 -2
- package/src/dev/showcase/overview.tsx +63 -18
- package/src/dev/showcase/separator.tsx +2 -2
- package/src/styles/tokens.css +2 -2
- package/dist/dev/components/GladcnLogo.d.ts +0 -10
- /package/src/styles/{gladcn.css → gladvn.css} +0 -0
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# 🌊
|
|
1
|
+
# 🌊 gladvn
|
|
2
2
|
|
|
3
|
-
> **✨ [Explore the Interactive Showcase & Documentation](https://
|
|
3
|
+
> **✨ [Explore the Interactive Showcase & Documentation](https://gladvn.vercel.app/)**
|
|
4
4
|
|
|
5
|
-
A highly composable, accessible, and beautifully designed React component library. Built on top of [shadcn/ui](https://ui.shadcn.com/), [Base UI](https://base-ui.com/), and powered by **Tailwind CSS v4+**, `
|
|
5
|
+
A highly composable, accessible, and beautifully designed React component library. Built on top of [shadcn/ui](https://ui.shadcn.com/), [Base UI](https://base-ui.com/), and powered by **Tailwind CSS v4+**, `gladvn` provides a robust, zero-magic foundation for your next web application.
|
|
6
6
|
|
|
7
|
-
Designed with strict architectural principles, `
|
|
7
|
+
Designed with strict architectural principles, `gladvn` is optimized not just for human developers, but specifically for **AI coding assistants**, ensuring predictable styling and maintenance.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -24,7 +24,7 @@ Designed with strict architectural principles, `gladcn` is optimized not just fo
|
|
|
24
24
|
> [!WARNING]
|
|
25
25
|
> **Please use `npx` to clone the components into your project instead of installing via `npm`.** While installing via `npm` works, using `npx` (Option 1) gives you full control over the source code and styling, which is the core philosophy and intended way to use this library.
|
|
26
26
|
|
|
27
|
-
There are two ways to use `
|
|
27
|
+
There are two ways to use `gladvn` in your project. We highly recommend **Option 1** for maximum flexibility.
|
|
28
28
|
|
|
29
29
|
### Option 1: Clone components to your project (Recommended)
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ This approach automatically copies all component source code, hooks, and styles
|
|
|
34
34
|
npx gladvn init
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
*By default, this will create a `
|
|
37
|
+
*By default, this will create a `gladvn` folder at your project root. If you prefer to place it elsewhere, specify the path:*
|
|
38
38
|
```bash
|
|
39
39
|
npx gladvn init components/ui
|
|
40
40
|
```
|
|
@@ -42,7 +42,7 @@ npx gladvn init components/ui
|
|
|
42
42
|
**Usage:**
|
|
43
43
|
```tsx
|
|
44
44
|
// Import directly from your local folder
|
|
45
|
-
import { Button } from "@/
|
|
45
|
+
import { Button } from "@/gladvn/components/micro/button";
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
### Option 2: Install as an npm package
|
|
@@ -59,11 +59,11 @@ Update your main CSS file to scan the library for Tailwind utility classes and i
|
|
|
59
59
|
```css
|
|
60
60
|
@import "tailwindcss";
|
|
61
61
|
|
|
62
|
-
/* 1. Tell Tailwind to scan
|
|
62
|
+
/* 1. Tell Tailwind to scan gladvn for utility classes */
|
|
63
63
|
@source "../node_modules/gladvn/dist";
|
|
64
64
|
|
|
65
|
-
/* 2. Import
|
|
66
|
-
@import "gladvn/
|
|
65
|
+
/* 2. Import gladvn global CSS variables */
|
|
66
|
+
@import "gladvn/gladvn.css";
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
**Usage:**
|
|
@@ -75,14 +75,14 @@ import { Button, Card, CardHeader, CardTitle, CardContent } from "gladvn";
|
|
|
75
75
|
|
|
76
76
|
## 🏗️ Architecture: Micro vs. Macro
|
|
77
77
|
|
|
78
|
-
Most component libraries fail in their second year because developers become afraid to modify the core files. `
|
|
78
|
+
Most component libraries fail in their second year because developers become afraid to modify the core files. `gladvn` solves this with explicit architectural boundaries:
|
|
79
79
|
|
|
80
80
|
- **Micro Components** (`components/micro/`): "Dumb" presentational primitives (e.g., `Button`, `Badge`, `Input`). They do not contain internal React state (`useState`) or business logic. They strictly rely on props for rendering and avoid dictating layout boundaries (like `w-full`).
|
|
81
81
|
- **Macro Components** (`components/macro/`): "Smart" presets and compositions (e.g., `DatePicker`, `SelectPreset`, `PaginationPreset`). These components combine multiple Micro components and manage complex state, accessibility (a11y), and interactions. Macro components strictly reuse Micro components via pure composition.
|
|
82
82
|
|
|
83
83
|
## 🎨 Theming & Customization
|
|
84
84
|
|
|
85
|
-
`
|
|
85
|
+
`gladvn` uses standard CSS variables for theming, ensuring zero runtime parsing overhead. You can easily override these variables in your own CSS file.
|
|
86
86
|
|
|
87
87
|
```css
|
|
88
88
|
:root {
|
|
@@ -92,7 +92,7 @@ Most component libraries fail in their second year because developers become afr
|
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
If you cloned the components via `npx` (Option 1), you can modify the CSS directly inside the `
|
|
95
|
+
If you cloned the components via `npx` (Option 1), you can modify the CSS directly inside the `gladvn/styles/` directory.
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
package/bin/cli.js
CHANGED
|
@@ -15,17 +15,17 @@ const reset = "\x1b[0m";
|
|
|
15
15
|
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
16
16
|
console.log(`
|
|
17
17
|
Usage:
|
|
18
|
-
npx
|
|
18
|
+
npx gladvn init [destination]
|
|
19
19
|
|
|
20
20
|
Options:
|
|
21
|
-
[destination] The folder where components will be copied. Defaults to "
|
|
21
|
+
[destination] The folder where components will be copied. Defaults to "gladvn".
|
|
22
22
|
--help, -h Show this help message.
|
|
23
23
|
`);
|
|
24
24
|
process.exit(0);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// Find destination
|
|
28
|
-
let userDest = "
|
|
28
|
+
let userDest = "gladvn";
|
|
29
29
|
const args = process.argv.slice(2);
|
|
30
30
|
|
|
31
31
|
if (args[0] === "init") {
|
|
@@ -123,7 +123,7 @@ async function selectOption(message, options) {
|
|
|
123
123
|
|
|
124
124
|
async function main() {
|
|
125
125
|
console.log(`\n${cyan}╔══════════════════════════════════════════════════════════════════╗${reset}`);
|
|
126
|
-
console.log(`${cyan}║ ${bold}
|
|
126
|
+
console.log(`${cyan}║ ${bold}gladvn${reset}${cyan} — Initialization ║${reset}`);
|
|
127
127
|
console.log(`${cyan}╚══════════════════════════════════════════════════════════════════╝${reset}\n`);
|
|
128
128
|
|
|
129
129
|
let targetCss = "app/globals.css";
|
|
@@ -169,7 +169,7 @@ async function main() {
|
|
|
169
169
|
console.log(`\x1b[32m✔\x1b[0m \x1b[1mFound global CSS file\x1b[0m \x1b[90m…\x1b[0m \x1b[36m${targetCss}\x1b[0m`);
|
|
170
170
|
} else {
|
|
171
171
|
// We have more than 1 file, and environment is TTY
|
|
172
|
-
targetCss = await selectOption("Which CSS file should we inject
|
|
172
|
+
targetCss = await selectOption("Which CSS file should we inject gladvn styles into?", cssFiles);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
let cssFilePath = null;
|
|
@@ -184,7 +184,7 @@ async function main() {
|
|
|
184
184
|
dirsToCopy = fs.readdirSync(srcDir).filter(item => !excludeList.includes(item));
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
console.log(`\n\x1b[36mInitializing
|
|
187
|
+
console.log(`\n\x1b[36mInitializing gladvn components into ${userDest}...\x1b[0m`);
|
|
188
188
|
|
|
189
189
|
if (!fs.existsSync(destPath)) {
|
|
190
190
|
fs.mkdirSync(destPath, { recursive: true });
|
|
@@ -211,10 +211,10 @@ async function main() {
|
|
|
211
211
|
|
|
212
212
|
// 2. Inject CSS import
|
|
213
213
|
if (cssFilePath && fs.existsSync(cssFilePath)) {
|
|
214
|
-
const
|
|
214
|
+
const gladvnCssPath = path.resolve(destPath, "styles", "gladvn.css");
|
|
215
215
|
const cssDir = path.dirname(cssFilePath);
|
|
216
216
|
|
|
217
|
-
let relPath = path.relative(cssDir,
|
|
217
|
+
let relPath = path.relative(cssDir, gladvnCssPath);
|
|
218
218
|
if (!relPath.startsWith('.')) {
|
|
219
219
|
relPath = './' + relPath;
|
|
220
220
|
}
|
|
@@ -238,15 +238,15 @@ async function main() {
|
|
|
238
238
|
console.log(`\x1b[32m✔ Injected CSS import into ${targetCss}\x1b[0m`);
|
|
239
239
|
}
|
|
240
240
|
} else if (targetCss) {
|
|
241
|
-
console.log(`\x1b[33m⚠ CSS file not found at ${targetCss}. You will need to manually import ${userDest}/styles/
|
|
241
|
+
console.log(`\x1b[33m⚠ CSS file not found at ${targetCss}. You will need to manually import ${userDest}/styles/gladvn.css\x1b[0m`);
|
|
242
242
|
} else {
|
|
243
|
-
console.log(`\x1b[33m⚠ No CSS file configured. You will need to manually import ${userDest}/styles/
|
|
243
|
+
console.log(`\x1b[33m⚠ No CSS file configured. You will need to manually import ${userDest}/styles/gladvn.css into your project.\x1b[0m`);
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
// 2.5 Configure tsconfig.json
|
|
247
247
|
if (isTTY) {
|
|
248
248
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
249
|
-
const answer = await new Promise((resolve) => rl.question(`\n${yellow}? Do you want to configure tsconfig.json to use the @
|
|
249
|
+
const answer = await new Promise((resolve) => rl.question(`\n${yellow}? Do you want to configure tsconfig.json to use the @gladvn/* alias? (Y/n)${reset} `, resolve));
|
|
250
250
|
rl.close();
|
|
251
251
|
|
|
252
252
|
if (answer.trim().toLowerCase() !== 'n') {
|
|
@@ -255,20 +255,20 @@ async function main() {
|
|
|
255
255
|
let tsContent = fs.readFileSync(tsconfigPath, 'utf8');
|
|
256
256
|
const aliasPath = `./${userDest}/*`;
|
|
257
257
|
|
|
258
|
-
if (tsContent.includes('"@
|
|
259
|
-
console.log(`\x1b[90m⏭ @
|
|
258
|
+
if (tsContent.includes('"@gladvn/*"')) {
|
|
259
|
+
console.log(`\x1b[90m⏭ @gladvn/* alias already exists in tsconfig.json\x1b[0m`);
|
|
260
260
|
} else {
|
|
261
261
|
const pathsRegex = /"paths"\s*:\s*\{/;
|
|
262
262
|
if (pathsRegex.test(tsContent)) {
|
|
263
|
-
tsContent = tsContent.replace(pathsRegex, `"paths": {\n "@
|
|
263
|
+
tsContent = tsContent.replace(pathsRegex, `"paths": {\n "@gladvn/*": ["${aliasPath}"],`);
|
|
264
264
|
fs.writeFileSync(tsconfigPath, tsContent);
|
|
265
|
-
console.log(`\x1b[32m✔ Injected @
|
|
265
|
+
console.log(`\x1b[32m✔ Injected @gladvn/* alias into existing paths\x1b[0m`);
|
|
266
266
|
} else {
|
|
267
267
|
const compilerOptionsRegex = /"compilerOptions"\s*:\s*\{/;
|
|
268
268
|
if (compilerOptionsRegex.test(tsContent)) {
|
|
269
|
-
tsContent = tsContent.replace(compilerOptionsRegex, `"compilerOptions": {\n "paths": {\n "@
|
|
269
|
+
tsContent = tsContent.replace(compilerOptionsRegex, `"compilerOptions": {\n "paths": {\n "@gladvn/*": ["${aliasPath}"]\n },`);
|
|
270
270
|
fs.writeFileSync(tsconfigPath, tsContent);
|
|
271
|
-
console.log(`\x1b[32m✔ Injected paths object and @
|
|
271
|
+
console.log(`\x1b[32m✔ Injected paths object and @gladvn/* alias\x1b[0m`);
|
|
272
272
|
} else {
|
|
273
273
|
console.log(`\x1b[33m⚠ Could not find compilerOptions in tsconfig.json. Please add manually.\x1b[0m`);
|
|
274
274
|
}
|
|
@@ -316,7 +316,7 @@ async function main() {
|
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
if (!hasErrors) {
|
|
319
|
-
console.log(`\n\x1b[32m✨ Successfully initialized
|
|
319
|
+
console.log(`\n\x1b[32m✨ Successfully initialized gladvn files in ${userDest}!\x1b[0m`);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface GladvnLogoProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
/** Size of the icon SVG */
|
|
4
|
+
iconSize?: string;
|
|
5
|
+
/** Show icon only (default) or icon + wordmark */
|
|
6
|
+
variant?: "icon" | "wordmark";
|
|
7
|
+
}
|
|
8
|
+
export declare function GladvnLogo({ className, iconSize, variant, }: GladvnLogoProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=GladvnLogo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"GladvnLogo.d.ts","sourceRoot":"","sources":["../../../src/dev/components/GladvnLogo.tsx"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CAC/B;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,QAAmB,EACnB,OAAgB,GACjB,EAAE,eAAe,+BAiEjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/dev/showcase/overview.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/dev/showcase/overview.tsx"],"names":[],"mappings":"AAmFA,MAAM,CAAC,OAAO,UAAU,eAAe,gCA2iCtC"}
|
package/llms.txt
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# gladvn UI - AI Guidelines
|
|
2
2
|
|
|
3
|
-
You are an AI Coding Assistant helping a developer use the `
|
|
4
|
-
`
|
|
3
|
+
You are an AI Coding Assistant helping a developer use the `gladvn` UI library.
|
|
4
|
+
`gladvn` is a React component library built on top of Radix UI and Tailwind CSS, focusing on beautiful, accessible, and highly composable components.
|
|
5
5
|
|
|
6
|
-
Follow these strict guidelines when generating or modifying code that uses `
|
|
6
|
+
Follow these strict guidelines when generating or modifying code that uses `gladvn`:
|
|
7
7
|
|
|
8
8
|
## 1. Imports
|
|
9
9
|
- **Always** import components directly from the package root:
|
|
10
|
-
`import { Button, Card, Dialog } from "
|
|
11
|
-
- **Never** import from internal paths like
|
|
10
|
+
`import { Button, Card, Dialog } from "gladvn";`
|
|
11
|
+
- **Never** import from internal paths like `gladvn/dist/...` or `src/components/ui/...`.
|
|
12
12
|
|
|
13
13
|
## 2. Composition over Configuration
|
|
14
|
-
`
|
|
14
|
+
`gladvn` heavily uses a composable architecture. When building complex UI, always use the provided sub-components rather than passing large configuration objects.
|
|
15
15
|
|
|
16
16
|
**Correct (Composition):**
|
|
17
17
|
```tsx
|
|
18
|
-
import { Card, CardHeader, CardTitle, CardContent } from "
|
|
18
|
+
import { Card, CardHeader, CardTitle, CardContent } from "gladvn";
|
|
19
19
|
|
|
20
20
|
<Card>
|
|
21
21
|
<CardHeader>
|
|
@@ -36,7 +36,7 @@ import { Card, CardHeader, CardTitle, CardContent } from "@duongy96/gladcn";
|
|
|
36
36
|
## 3. Form Fields
|
|
37
37
|
When building forms, use the `Field` wrapper to automatically handle accessibility, labels, and error messages.
|
|
38
38
|
```tsx
|
|
39
|
-
import { Field, FieldLabel, FieldContent, FieldError, Input } from "
|
|
39
|
+
import { Field, FieldLabel, FieldContent, FieldError, Input } from "gladvn";
|
|
40
40
|
|
|
41
41
|
<Field error={errors.email?.message}>
|
|
42
42
|
<FieldLabel>Email Address</FieldLabel>
|
|
@@ -68,7 +68,7 @@ Always structure them with their respective Trigger and Content wrappers.
|
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
## 6. Icons
|
|
71
|
-
`
|
|
71
|
+
`gladvn` does not bundle an icon library by default, but relies on standard SVG icons (like `lucide-react`). When adding icons inside components like `Button` or `Empty`, use standard SVG elements or Lucide components.
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
*Note to AI: Always prioritize reading the JSDoc/TSDoc definitions of the imported components if you are unsure of the props.*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gladvn",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DO NOT 'npm install'. Use 'npx gladvn init' instead! A highly composable React component library built with Tailwind CSS.",
|
|
6
6
|
"keywords": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"module": "./dist/index.js",
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"bin": {
|
|
19
|
-
"
|
|
19
|
+
"gladvn": "bin/cli.js"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"default": "./dist/index.cjs"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
"./
|
|
32
|
+
"./gladvn.css": "./src/styles/gladvn.css",
|
|
33
33
|
"./tokens.css": "./src/styles/tokens.css"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
package/scripts/clean-imports.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Project } from "ts-morph";
|
|
2
2
|
|
|
3
3
|
const project = new Project({
|
|
4
|
-
tsConfigFilePath: "/Users/y/Desktop/github/
|
|
4
|
+
tsConfigFilePath: "/Users/y/Desktop/github/gladvn/tsconfig.json",
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
const sourceFiles = project.getSourceFiles(
|
|
8
|
-
"/Users/y/Desktop/github/
|
|
8
|
+
"/Users/y/Desktop/github/gladvn/src/dev/showcase/**/*.tsx",
|
|
9
9
|
);
|
|
10
10
|
console.log(`Found ${sourceFiles.length} showcase files to process.`);
|
|
11
11
|
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -85,7 +85,7 @@ function injectImports(cssFilePath, tokensRelPath) {
|
|
|
85
85
|
let content = fs.readFileSync(cssFilePath, "utf8");
|
|
86
86
|
|
|
87
87
|
// Check if already configured
|
|
88
|
-
if (content.includes("gladvn/
|
|
88
|
+
if (content.includes("gladvn/gladvn.css")) {
|
|
89
89
|
console.log(
|
|
90
90
|
`${dim} ⏭ gladvn already configured in this file — skipped${reset}`,
|
|
91
91
|
);
|
|
@@ -95,7 +95,7 @@ function injectImports(cssFilePath, tokensRelPath) {
|
|
|
95
95
|
// Build the import lines
|
|
96
96
|
const sourceDirective = `@source "../node_modules/gladvn/dist";`;
|
|
97
97
|
const tokensImport = `@import "${tokensRelPath}";`;
|
|
98
|
-
const globalsImport = `@import "gladvn/
|
|
98
|
+
const globalsImport = `@import "gladvn/gladvn.css";`;
|
|
99
99
|
|
|
100
100
|
const imports = `\n/* gladvn */\n${sourceDirective}\n${tokensImport}\n${globalsImport}\n`;
|
|
101
101
|
|
|
@@ -109,7 +109,7 @@ function injectImports(cssFilePath, tokensRelPath) {
|
|
|
109
109
|
|
|
110
110
|
fs.writeFileSync(cssFilePath, content);
|
|
111
111
|
console.log(
|
|
112
|
-
`${green} ✅ Injected
|
|
112
|
+
`${green} ✅ Injected gladvn imports into ${path.basename(
|
|
113
113
|
cssFilePath,
|
|
114
114
|
)}${reset}`,
|
|
115
115
|
);
|
|
@@ -188,7 +188,7 @@ ${cyan}╔═══════════════════════
|
|
|
188
188
|
║ ${green}@import "tailwindcss";${cyan} ║
|
|
189
189
|
║ ${green}@source "../node_modules/gladvn/dist";${cyan} ║
|
|
190
190
|
║ ${green}@import "./tokens.css";${cyan} ║
|
|
191
|
-
║ ${green}@import "gladvn/
|
|
191
|
+
║ ${green}@import "gladvn/gladvn.css";${cyan} ║
|
|
192
192
|
║ ║
|
|
193
193
|
║ ${yellow}3. Use components:${cyan} ║
|
|
194
194
|
║ ║
|
package/src/dev/App.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "../components/macro/command-preset";
|
|
15
15
|
import { useDevContext } from "../dev/components/dev-context";
|
|
16
16
|
import { SizeToggle } from "../dev/components/showcase";
|
|
17
|
-
import {
|
|
17
|
+
import { GladvnLogo } from "../dev/components/GladvnLogo";
|
|
18
18
|
import { COMPONENTS } from "../dev/data";
|
|
19
19
|
import OverviewSection from "../dev/showcase/overview";
|
|
20
20
|
import {
|
|
@@ -164,7 +164,7 @@ export default function App() {
|
|
|
164
164
|
)}
|
|
165
165
|
</button>
|
|
166
166
|
<a href="/" className="inline-flex items-center hover:opacity-80 transition-opacity">
|
|
167
|
-
<
|
|
167
|
+
<GladvnLogo variant="wordmark" />
|
|
168
168
|
</a>
|
|
169
169
|
</div>
|
|
170
170
|
|
|
@@ -187,7 +187,7 @@ export default function App() {
|
|
|
187
187
|
<Button
|
|
188
188
|
variant="ghost"
|
|
189
189
|
iconOnly
|
|
190
|
-
render={<a href="https://github.com/duongacy/
|
|
190
|
+
render={<a href="https://github.com/duongacy/gladvn" target="_blank" rel="noreferrer" />}
|
|
191
191
|
nativeButton={false}
|
|
192
192
|
className="text-muted-foreground hover:text-foreground hidden sm:inline-flex"
|
|
193
193
|
>
|
|
@@ -296,7 +296,7 @@ export default function App() {
|
|
|
296
296
|
open={cmdOpen}
|
|
297
297
|
onOpenChange={setCmdOpen}
|
|
298
298
|
title="Tìm component"
|
|
299
|
-
description="Tìm kiếm nhanh component trong
|
|
299
|
+
description="Tìm kiếm nhanh component trong Gladvn UI"
|
|
300
300
|
>
|
|
301
301
|
<Command size="lg">
|
|
302
302
|
<CommandInput placeholder="Nhập tên component..." autoFocus />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../lib/utils";
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface GladvnLogoProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
/** Size of the icon SVG */
|
|
6
6
|
iconSize?: string;
|
|
@@ -8,11 +8,11 @@ interface GladcnLogoProps {
|
|
|
8
8
|
variant?: "icon" | "wordmark";
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export function
|
|
11
|
+
export function GladvnLogo({
|
|
12
12
|
className,
|
|
13
13
|
iconSize = "size-7",
|
|
14
14
|
variant = "icon",
|
|
15
|
-
}:
|
|
15
|
+
}: GladvnLogoProps) {
|
|
16
16
|
const icon = (
|
|
17
17
|
<svg
|
|
18
18
|
viewBox="0 0 32 32"
|
|
@@ -70,7 +70,7 @@ export function GladcnLogo({
|
|
|
70
70
|
<div className={cn("flex items-center gap-2.5", className)}>
|
|
71
71
|
{icon}
|
|
72
72
|
<span className="font-bold text-[15px] tracking-tight leading-none">
|
|
73
|
-
|
|
73
|
+
gladvn
|
|
74
74
|
</span>
|
|
75
75
|
</div>
|
|
76
76
|
);
|
package/src/dev/index.css
CHANGED
|
@@ -138,7 +138,7 @@ export default function FormsSection() {
|
|
|
138
138
|
<InputGroupAddon>
|
|
139
139
|
<InputGroupText>https://</InputGroupText>
|
|
140
140
|
</InputGroupAddon>
|
|
141
|
-
<InputGroupInput id="tf-group" placeholder="
|
|
141
|
+
<InputGroupInput id="tf-group" placeholder="gladvn.ui" />
|
|
142
142
|
<InputGroupAddon>
|
|
143
143
|
<InputGroupText>.com</InputGroupText>
|
|
144
144
|
</InputGroupAddon>
|
|
@@ -69,7 +69,7 @@ export default function OverviewSection() {
|
|
|
69
69
|
<div className="relative z-10 flex flex-col h-full">
|
|
70
70
|
<div>
|
|
71
71
|
<Badge color="secondary" className="mb-3 px-2.5 py-0.5 shadow-sm">
|
|
72
|
-
✨
|
|
72
|
+
✨ gladvn UI v0.2.1
|
|
73
73
|
</Badge>
|
|
74
74
|
<h2 className="text-3xl font-bold tracking-tight mb-2">
|
|
75
75
|
Crafted for Perfection
|
|
@@ -143,7 +143,7 @@ export default function OverviewSection() {
|
|
|
143
143
|
<h3 className="font-semibold">Quick Install</h3>
|
|
144
144
|
</div>
|
|
145
145
|
<p className="text-sm text-muted-foreground mb-4">
|
|
146
|
-
Available on npm. Add
|
|
146
|
+
Available on npm. Add gladvn to your project in seconds.
|
|
147
147
|
</p>
|
|
148
148
|
<div className="rounded-lg bg-muted/50 px-3 py-2.5 font-mono text-xs border border-border flex items-center justify-between">
|
|
149
149
|
<span className="truncate">npm i gladvn</span>
|
|
@@ -72,7 +72,7 @@ function NavigationMenuMicroShowcase() {
|
|
|
72
72
|
}
|
|
73
73
|
>
|
|
74
74
|
<div className="mb-2 mt-4 text-lg font-medium">
|
|
75
|
-
|
|
75
|
+
gladvn/ui
|
|
76
76
|
</div>
|
|
77
77
|
<p className="text-sm leading-tight text-muted-foreground">
|
|
78
78
|
Beautifully designed components built with Radix UI and
|
|
@@ -159,7 +159,7 @@ function NavigationMenuMicroShowcase() {
|
|
|
159
159
|
}
|
|
160
160
|
>
|
|
161
161
|
<div className="mb-2 mt-4 text-lg font-medium">
|
|
162
|
-
|
|
162
|
+
gladvn/ui
|
|
163
163
|
</div>
|
|
164
164
|
<p className="text-sm leading-tight text-muted-foreground">
|
|
165
165
|
Beautifully designed components built with Radix UI
|
|
@@ -17,9 +17,10 @@ import {
|
|
|
17
17
|
} from "lucide-react";
|
|
18
18
|
import { useEffect, useState } from "react";
|
|
19
19
|
import { toast } from "sonner";
|
|
20
|
-
import {
|
|
20
|
+
import { GladvnLogo } from "../../dev/components/GladvnLogo";
|
|
21
21
|
|
|
22
22
|
import { ProgressPreset as Progress } from "../../components/macro/progress-preset";
|
|
23
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../../components/micro/avatar";
|
|
23
24
|
import { Badge } from "../../components/micro/badge";
|
|
24
25
|
import { Button } from "../../components/micro/button";
|
|
25
26
|
import {
|
|
@@ -34,7 +35,8 @@ import {
|
|
|
34
35
|
SelectContent,
|
|
35
36
|
SelectItem,
|
|
36
37
|
SelectTrigger,
|
|
37
|
-
SelectValue, SelectPortal
|
|
38
|
+
SelectValue, SelectPortal
|
|
39
|
+
} from "../../components/micro/select";
|
|
38
40
|
import { Switch } from "../../components/micro/switch";
|
|
39
41
|
import { ColorSwatch } from "../../dev/components/showcase";
|
|
40
42
|
import { COLORS, STATS } from "../../dev/data";
|
|
@@ -139,7 +141,7 @@ export default function OverviewSection() {
|
|
|
139
141
|
style={{ animationDelay: "200ms", animationFillMode: "both" }}
|
|
140
142
|
>
|
|
141
143
|
Component library thường đòi bạn follow quy tắc của họ mãi mãi.
|
|
142
|
-
|
|
144
|
+
gladvn đặt toàn bộ source code vào tay bạn ngay từ đầu —{" "}
|
|
143
145
|
<strong className="text-foreground">
|
|
144
146
|
không vendor lock-in, không breaking change bất ngờ, không
|
|
145
147
|
node_modules ẩn.
|
|
@@ -212,18 +214,18 @@ export default function OverviewSection() {
|
|
|
212
214
|
<SelectValue placeholder="Chọn vùng" />
|
|
213
215
|
</SelectTrigger>
|
|
214
216
|
<SelectPortal>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
217
|
+
<SelectContent>
|
|
218
|
+
<SelectItem value="edge">
|
|
219
|
+
Edge Network (Toàn cầu)
|
|
220
|
+
</SelectItem>
|
|
221
|
+
<SelectItem value="us-east">
|
|
222
|
+
US East (Virginia)
|
|
223
|
+
</SelectItem>
|
|
224
|
+
<SelectItem value="ap-se">
|
|
225
|
+
AP South East (Sing)
|
|
226
|
+
</SelectItem>
|
|
227
|
+
</SelectContent>
|
|
228
|
+
</SelectPortal>
|
|
227
229
|
</Select>
|
|
228
230
|
</div>
|
|
229
231
|
</div>
|
|
@@ -304,7 +306,7 @@ export default function OverviewSection() {
|
|
|
304
306
|
</h2>
|
|
305
307
|
<p className="text-muted-foreground text-lg">
|
|
306
308
|
Phần lớn component library hỏng ở năm thứ hai — khi team cần thay
|
|
307
|
-
đổi nhưng không ai dám sửa vì không biết gì sẽ vỡ.
|
|
309
|
+
đổi nhưng không ai dám sửa vì không biết gì sẽ vỡ. gladvn được xây
|
|
308
310
|
trên{" "}
|
|
309
311
|
<strong className="text-foreground">Các nguyên tắc tường minh</strong>
|
|
310
312
|
{" "}để bạn luôn biết mình đang sửa ở tầng nào và điều gì sẽ bị ảnh
|
|
@@ -966,7 +968,7 @@ export default function OverviewSection() {
|
|
|
966
968
|
nền đen. Đây là điểm mà hầu hết thư viện bỏ cuộc.
|
|
967
969
|
</p>
|
|
968
970
|
<p className="text-muted-foreground text-xl leading-relaxed">
|
|
969
|
-
|
|
971
|
+
gladvn giải quyết bằng{" "}
|
|
970
972
|
<code className="text-sm bg-warning/20 text-warning px-1.5 py-0.5 rounded">
|
|
971
973
|
{"<ThemeWrapper>"}
|
|
972
974
|
</code>{" "}
|
|
@@ -986,7 +988,7 @@ export default function OverviewSection() {
|
|
|
986
988
|
<div className="relative z-10 grid sm:grid-cols-2 gap-6 max-w-3xl">
|
|
987
989
|
<div className="p-6 rounded-2xl border border-success/30 bg-success/10 shadow-sm flex flex-col gap-2">
|
|
988
990
|
<div className="text-success font-semibold text-lg flex items-center gap-2">
|
|
989
|
-
✅
|
|
991
|
+
✅ gladvn — ThemeWrapper
|
|
990
992
|
</div>
|
|
991
993
|
<p className="text-success/80 text-sm leading-relaxed">
|
|
992
994
|
Theme được tunnel xuyên qua Portal boundary. Dialog, Tooltip,
|
|
@@ -1055,6 +1057,49 @@ export default function OverviewSection() {
|
|
|
1055
1057
|
</div>
|
|
1056
1058
|
</section>
|
|
1057
1059
|
|
|
1060
|
+
{/* 🤝 CONTRIBUTORS */}
|
|
1061
|
+
<section className="container max-w-6xl mx-auto px-4 mb-24">
|
|
1062
|
+
<div className="flex flex-col items-center text-center space-y-8">
|
|
1063
|
+
<div className="space-y-4 max-w-2xl">
|
|
1064
|
+
<h2 className="text-3xl font-extrabold tracking-tight">
|
|
1065
|
+
Contributors
|
|
1066
|
+
</h2>
|
|
1067
|
+
</div>
|
|
1068
|
+
|
|
1069
|
+
<div className="flex flex-wrap justify-center gap-6">
|
|
1070
|
+
{[
|
|
1071
|
+
{
|
|
1072
|
+
name: "Ý Le",
|
|
1073
|
+
role: "Creator & Maintainer",
|
|
1074
|
+
avatar: "https://github.com/duongacy.png",
|
|
1075
|
+
url: "https://github.com/duongacy",
|
|
1076
|
+
}
|
|
1077
|
+
].map((user) => (
|
|
1078
|
+
<a
|
|
1079
|
+
key={user.name}
|
|
1080
|
+
href={user.url}
|
|
1081
|
+
target="_blank"
|
|
1082
|
+
rel="noreferrer"
|
|
1083
|
+
className="group flex flex-col items-center gap-3 p-4 rounded-2xl hover:bg-muted/50 transition-colors"
|
|
1084
|
+
>
|
|
1085
|
+
<Avatar className="size-16 border-2 border-transparent group-hover:border-primary/20 transition-all duration-300 group-hover:scale-105">
|
|
1086
|
+
<AvatarImage src={user.avatar} alt={user.name} />
|
|
1087
|
+
<AvatarFallback className="text-lg bg-primary/5 text-primary">{user.name.substring(0, 2).toUpperCase()}</AvatarFallback>
|
|
1088
|
+
</Avatar>
|
|
1089
|
+
<div className="text-center">
|
|
1090
|
+
<div className="font-semibold text-sm group-hover:text-primary transition-colors">{user.name}</div>
|
|
1091
|
+
<div className="text-xs text-muted-foreground mt-0.5">{user.role}</div>
|
|
1092
|
+
</div>
|
|
1093
|
+
</a>
|
|
1094
|
+
))}
|
|
1095
|
+
</div>
|
|
1096
|
+
|
|
1097
|
+
<Button variant="outline" className="mt-4 rounded-full" render={<a href="https://github.com/duongacy/gladcn" target="_blank" rel="noreferrer" />}>
|
|
1098
|
+
Trở thành Contributor
|
|
1099
|
+
</Button>
|
|
1100
|
+
</div>
|
|
1101
|
+
</section>
|
|
1102
|
+
|
|
1058
1103
|
{/* 🚀 FINAL CTA */}
|
|
1059
1104
|
<section className="container max-w-6xl mx-auto px-4">
|
|
1060
1105
|
<div className="rounded-[2.5rem] border-2 border-primary/40 bg-gradient-to-br from-primary/10 via-background to-info/5 p-10 md:p-16 shadow-2xl shadow-primary/5 text-center relative overflow-hidden">
|
|
@@ -21,7 +21,7 @@ function SeparatorMicroShowcase() {
|
|
|
21
21
|
codeString={`<div className="w-full max-w-sm rounded-lg border border-border bg-card p-6">
|
|
22
22
|
<div className="space-y-1">
|
|
23
23
|
<h4 className="text-sm font-medium leading-none">
|
|
24
|
-
|
|
24
|
+
Gladvn UI
|
|
25
25
|
</h4>
|
|
26
26
|
<p className="text-sm text-muted-foreground">
|
|
27
27
|
Bộ UI Component mã nguồn mở.
|
|
@@ -36,7 +36,7 @@ function SeparatorMicroShowcase() {
|
|
|
36
36
|
>
|
|
37
37
|
<div className="w-full max-w-sm rounded-lg border border-border bg-card p-6">
|
|
38
38
|
<div className="space-y-1">
|
|
39
|
-
<h4 className="text-sm font-medium leading-none">
|
|
39
|
+
<h4 className="text-sm font-medium leading-none">Gladvn UI</h4>
|
|
40
40
|
<p className="text-sm text-muted-foreground">
|
|
41
41
|
Bộ UI Component mã nguồn mở.
|
|
42
42
|
</p>
|
package/src/styles/tokens.css
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* gladvn - Design Tokens (Default Theme)
|
|
3
3
|
* ==========================================================================
|
|
4
4
|
* Copy this file into your project's CSS and customize the values below.
|
|
5
|
-
* These CSS variables control the entire look & feel of all
|
|
5
|
+
* These CSS variables control the entire look & feel of all gladvn components.
|
|
6
6
|
*
|
|
7
7
|
* Usage: Copy this content into your project's main CSS BEFORE the
|
|
8
|
-
* @import "gladvn/
|
|
8
|
+
* @import "gladvn/gladvn.css" line.
|
|
9
9
|
*
|
|
10
10
|
* Color format: oklch(lightness chroma hue)
|
|
11
11
|
* Docs: https://oklch.com
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface GladcnLogoProps {
|
|
2
|
-
className?: string;
|
|
3
|
-
/** Size of the icon SVG */
|
|
4
|
-
iconSize?: string;
|
|
5
|
-
/** Show icon only (default) or icon + wordmark */
|
|
6
|
-
variant?: "icon" | "wordmark";
|
|
7
|
-
}
|
|
8
|
-
export declare function GladcnLogo({ className, iconSize, variant, }: GladcnLogoProps): import("react").JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=GladcnLogo.d.ts.map
|
|
File without changes
|