@nqlib/nqui 0.1.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.
- package/INSTALLATION.md +221 -0
- package/README.md +276 -0
- package/dist/App.d.ts +3 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/components/AppLayout.d.ts +2 -0
- package/dist/components/AppLayout.d.ts.map +1 -0
- package/dist/components/app-sidebar.d.ts +4 -0
- package/dist/components/app-sidebar.d.ts.map +1 -0
- package/dist/components/component-example.d.ts +2 -0
- package/dist/components/component-example.d.ts.map +1 -0
- package/dist/components/custom/color-picker.d.ts +9 -0
- package/dist/components/custom/color-picker.d.ts.map +1 -0
- package/dist/components/custom/color-slider.d.ts +22 -0
- package/dist/components/custom/color-slider.d.ts.map +1 -0
- package/dist/components/custom/enhanced-button.d.ts +34 -0
- package/dist/components/custom/enhanced-button.d.ts.map +1 -0
- package/dist/components/custom/enhanced-checkbox.d.ts +28 -0
- package/dist/components/custom/enhanced-checkbox.d.ts.map +1 -0
- package/dist/components/custom/enhanced-radio-group.d.ts +36 -0
- package/dist/components/custom/enhanced-radio-group.d.ts.map +1 -0
- package/dist/components/custom/enhanced-scroll-area.d.ts +34 -0
- package/dist/components/custom/enhanced-scroll-area.d.ts.map +1 -0
- package/dist/components/custom/enhanced-separator.d.ts +36 -0
- package/dist/components/custom/enhanced-separator.d.ts.map +1 -0
- package/dist/components/custom/nqui-logo.d.ts +9 -0
- package/dist/components/custom/nqui-logo.d.ts.map +1 -0
- package/dist/components/custom/rating.d.ts +60 -0
- package/dist/components/custom/rating.d.ts.map +1 -0
- package/dist/components/custom/table-of-contents.d.ts +77 -0
- package/dist/components/custom/table-of-contents.d.ts.map +1 -0
- package/dist/components/debug/crosshair.d.ts +5 -0
- package/dist/components/debug/crosshair.d.ts.map +1 -0
- package/dist/components/debug/debug-panel.d.ts +5 -0
- package/dist/components/debug/debug-panel.d.ts.map +1 -0
- package/dist/components/debug/dependencies.d.ts +23 -0
- package/dist/components/debug/dependencies.d.ts.map +1 -0
- package/dist/components/debug/index.d.ts +17 -0
- package/dist/components/debug/index.d.ts.map +1 -0
- package/dist/components/debug/magnifier.d.ts +9 -0
- package/dist/components/debug/magnifier.d.ts.map +1 -0
- package/dist/components/debug/ui-tester.d.ts +13 -0
- package/dist/components/debug/ui-tester.d.ts.map +1 -0
- package/dist/components/debug/utils/css-variable-parser.d.ts +28 -0
- package/dist/components/debug/utils/css-variable-parser.d.ts.map +1 -0
- package/dist/components/debug/utils/element-selector.d.ts +24 -0
- package/dist/components/debug/utils/element-selector.d.ts.map +1 -0
- package/dist/components/debug/utils/style-injector.d.ts +40 -0
- package/dist/components/debug/utils/style-injector.d.ts.map +1 -0
- package/dist/components/debug/utils/style-parser.d.ts +53 -0
- package/dist/components/debug/utils/style-parser.d.ts.map +1 -0
- package/dist/components/example.d.ts +7 -0
- package/dist/components/example.d.ts.map +1 -0
- package/dist/components/login-form.d.ts +2 -0
- package/dist/components/login-form.d.ts.map +1 -0
- package/dist/components/nav-user.d.ts +8 -0
- package/dist/components/nav-user.d.ts.map +1 -0
- package/dist/components/showcase/app-builder/app-builder-context.d.ts +16 -0
- package/dist/components/showcase/app-builder/app-builder-context.d.ts.map +1 -0
- package/dist/components/showcase/app-builder/app-canvas.d.ts +11 -0
- package/dist/components/showcase/app-builder/app-canvas.d.ts.map +1 -0
- package/dist/components/showcase/app-builder/widget-configurator.d.ts +10 -0
- package/dist/components/showcase/app-builder/widget-configurator.d.ts.map +1 -0
- package/dist/components/showcase/app-builder/widget-palette.d.ts +6 -0
- package/dist/components/showcase/app-builder/widget-palette.d.ts.map +1 -0
- package/dist/components/showcase/app-builder/widget-registry.d.ts +29 -0
- package/dist/components/showcase/app-builder/widget-registry.d.ts.map +1 -0
- package/dist/components/showcase/app-builder/widget-renderer.d.ts +7 -0
- package/dist/components/showcase/app-builder/widget-renderer.d.ts.map +1 -0
- package/dist/components/theme-toggle.d.ts +2 -0
- package/dist/components/theme-toggle.d.ts.map +1 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +41 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/combobox.d.ts +25 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/command.d.ts +19 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/drawer.d.ts +14 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/menubar.d.ts +27 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/native-select.d.ts +9 -0
- package/dist/components/ui/native-select.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/pagination.d.ts +14 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +26 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sidebar.d.ts +66 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +12 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +11 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-scroll-spy.d.ts +50 -0
- package/dist/hooks/use-scroll-spy.d.ts.map +1 -0
- package/dist/index.d.ts +80 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/mockdata/toc.d.ts +11 -0
- package/dist/mockdata/toc.d.ts.map +1 -0
- package/dist/nqui.cjs.js +521 -0
- package/dist/nqui.css +148 -0
- package/dist/nqui.es.js +35453 -0
- package/dist/pages/AppBuilder.d.ts +2 -0
- package/dist/pages/AppBuilder.d.ts.map +1 -0
- package/dist/pages/Dashboard.d.ts +2 -0
- package/dist/pages/Dashboard.d.ts.map +1 -0
- package/dist/pages/Drafts.d.ts +2 -0
- package/dist/pages/Drafts.d.ts.map +1 -0
- package/dist/pages/Inbox.d.ts +2 -0
- package/dist/pages/Inbox.d.ts.map +1 -0
- package/dist/pages/Junk.d.ts +2 -0
- package/dist/pages/Junk.d.ts.map +1 -0
- package/dist/pages/Sent.d.ts +2 -0
- package/dist/pages/Sent.d.ts.map +1 -0
- package/dist/pages/Settings.d.ts +2 -0
- package/dist/pages/Settings.d.ts.map +1 -0
- package/dist/pages/Trash.d.ts +2 -0
- package/dist/pages/Trash.d.ts.map +1 -0
- package/dist/styles.css +544 -0
- package/dist/vite.svg +1 -0
- package/package.json +128 -0
- package/scripts/build-styles.js +205 -0
- package/scripts/examples/nextjs-layout.tsx +30 -0
- package/scripts/examples/nextjs-page.tsx +66 -0
- package/scripts/init-css.js +568 -0
- package/scripts/init-debug-css.js +123 -0
- package/scripts/publish-npmjs.js +87 -0
- package/scripts/validate-exports.mjs +117 -0
package/package.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nqlib/nqui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A React component library with enhanced UI components and developer tools",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/nqui.cjs.js",
|
|
7
|
+
"module": "./dist/nqui.es.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/nqui.es.js",
|
|
13
|
+
"require": "./dist/nqui.cjs.js"
|
|
14
|
+
},
|
|
15
|
+
"./styles": {
|
|
16
|
+
"import": "./dist/styles.css",
|
|
17
|
+
"require": "./dist/styles.css",
|
|
18
|
+
"default": "./dist/styles.css"
|
|
19
|
+
},
|
|
20
|
+
"./debug.css": "./dist/nqui.css"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"scripts",
|
|
25
|
+
"README.md",
|
|
26
|
+
"INSTALLATION.md"
|
|
27
|
+
],
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"**/*.css"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"registry": "https://registry.npmjs.com",
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/nqlib/nqui.git"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"ui",
|
|
41
|
+
"components",
|
|
42
|
+
"react",
|
|
43
|
+
"typescript",
|
|
44
|
+
"nextjs",
|
|
45
|
+
"vite",
|
|
46
|
+
"tailwind",
|
|
47
|
+
"shadcn",
|
|
48
|
+
"radix-ui"
|
|
49
|
+
],
|
|
50
|
+
"author": "",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"scripts": {
|
|
53
|
+
"dev": "vite",
|
|
54
|
+
"build": "npm run build:lib",
|
|
55
|
+
"build:lib": "vite build --mode library && npm run build:types && npm run build:styles && npm run copy:css",
|
|
56
|
+
"build:types": "tsc -p tsconfig.lib.json",
|
|
57
|
+
"build:styles": "node scripts/build-styles.js",
|
|
58
|
+
"copy:css": "cp src/components/debug/debug.css dist/nqui.css",
|
|
59
|
+
"build:app": "tsc -b && vite build",
|
|
60
|
+
"build:all": "npm run build:lib && npm run build:app",
|
|
61
|
+
"prepublishOnly": "npm run build:lib",
|
|
62
|
+
"publish:github": "npm publish --registry=https://npm.pkg.github.com",
|
|
63
|
+
"publish:npm": "node scripts/publish-npmjs.js",
|
|
64
|
+
"publish:both": "npm run publish:github && npm run publish:npm",
|
|
65
|
+
"lint": "eslint .",
|
|
66
|
+
"preview": "vite preview",
|
|
67
|
+
"preview:app": "vite preview --outDir dist-app",
|
|
68
|
+
"init-debug-css": "node scripts/init-debug-css.js"
|
|
69
|
+
},
|
|
70
|
+
"bin": {
|
|
71
|
+
"nqui": "./scripts/init-css.js",
|
|
72
|
+
"nqui-init-css": "./scripts/init-css.js",
|
|
73
|
+
"nqui-init-debug": "./scripts/init-debug-css.js"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@base-ui/react": "^1.0.0",
|
|
77
|
+
"@fontsource-variable/inter": "^5.2.8",
|
|
78
|
+
"@hugeicons/core-free-icons": "^3.1.1",
|
|
79
|
+
"@hugeicons/react": "^1.1.4",
|
|
80
|
+
"@radix-ui/react-avatar": "^1.1.11",
|
|
81
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
82
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
83
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
84
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
85
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
86
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
87
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
88
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
89
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
90
|
+
"class-variance-authority": "^0.7.1",
|
|
91
|
+
"clsx": "^2.1.1",
|
|
92
|
+
"cmdk": "^1.1.1",
|
|
93
|
+
"date-fns": "^4.1.0",
|
|
94
|
+
"embla-carousel-react": "^8.6.0",
|
|
95
|
+
"html2canvas-pro": "^1.6.3",
|
|
96
|
+
"input-otp": "^1.4.2",
|
|
97
|
+
"lucide-react": "^0.562.0",
|
|
98
|
+
"next-themes": "^0.4.6",
|
|
99
|
+
"package": "^1.0.1",
|
|
100
|
+
"radix-ui": "^1.4.3",
|
|
101
|
+
"react": "^19.2.0",
|
|
102
|
+
"react-day-picker": "^9.13.0",
|
|
103
|
+
"react-dom": "^19.2.0",
|
|
104
|
+
"react-resizable-panels": "^4.2.1",
|
|
105
|
+
"react-router-dom": "^7.11.0",
|
|
106
|
+
"recharts": "^2.15.4",
|
|
107
|
+
"sonner": "^2.0.7",
|
|
108
|
+
"tailwind-merge": "^3.4.0",
|
|
109
|
+
"tailwindcss": "^4.1.17",
|
|
110
|
+
"tw-animate-css": "^1.4.0",
|
|
111
|
+
"vaul": "^1.1.2"
|
|
112
|
+
},
|
|
113
|
+
"devDependencies": {
|
|
114
|
+
"@eslint/js": "^9.39.1",
|
|
115
|
+
"@types/node": "^24.10.1",
|
|
116
|
+
"@types/react": "^19.2.5",
|
|
117
|
+
"@types/react-dom": "^19.2.3",
|
|
118
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
119
|
+
"eslint": "^9.39.1",
|
|
120
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
121
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
122
|
+
"globals": "^16.5.0",
|
|
123
|
+
"shadcn": "^3.6.2",
|
|
124
|
+
"typescript": "~5.9.3",
|
|
125
|
+
"typescript-eslint": "^8.46.4",
|
|
126
|
+
"vite": "^7.2.4"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build script to extract CSS for package export
|
|
5
|
+
*
|
|
6
|
+
* Generates dist/styles.css with only nqui CSS variables (no framework-specific directives)
|
|
7
|
+
* This file is used for package export: import "@nqlib/nqui/styles"
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFileSync, writeFileSync, existsSync } from 'fs';
|
|
11
|
+
import { join, dirname, resolve } from 'path';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
13
|
+
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = dirname(__filename);
|
|
16
|
+
|
|
17
|
+
// Get the project root
|
|
18
|
+
const projectRoot = resolve(__dirname, '..');
|
|
19
|
+
const indexCssPath = join(projectRoot, 'src', 'index.css');
|
|
20
|
+
const colorsCssPath = join(projectRoot, 'src', 'styles', 'colors.css');
|
|
21
|
+
const outputPath = join(projectRoot, 'dist', 'styles.css');
|
|
22
|
+
|
|
23
|
+
function extractStandaloneCSS() {
|
|
24
|
+
// Read the source CSS files
|
|
25
|
+
if (!existsSync(indexCssPath)) {
|
|
26
|
+
throw new Error(`Source CSS file not found: ${indexCssPath}`);
|
|
27
|
+
}
|
|
28
|
+
if (!existsSync(colorsCssPath)) {
|
|
29
|
+
throw new Error(`Colors CSS file not found: ${colorsCssPath}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let indexCss = readFileSync(indexCssPath, 'utf-8');
|
|
33
|
+
let colorsCss = readFileSync(colorsCssPath, 'utf-8');
|
|
34
|
+
|
|
35
|
+
// Extract :root and .dark blocks from colors.css (they're wrapped in @layer base)
|
|
36
|
+
const colorsRootMatch = colorsCss.match(/@layer base\s*\{\s*:root\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}\s*\.dark\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}\s*\}/s);
|
|
37
|
+
|
|
38
|
+
let colorsRootContent = '';
|
|
39
|
+
let colorsDarkContent = '';
|
|
40
|
+
|
|
41
|
+
if (colorsRootMatch) {
|
|
42
|
+
colorsRootContent = colorsRootMatch[1].trim();
|
|
43
|
+
colorsDarkContent = colorsRootMatch[2].trim();
|
|
44
|
+
} else {
|
|
45
|
+
// Fallback: try to extract without @layer base wrapper
|
|
46
|
+
const rootMatch = colorsCss.match(/:root\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}/s);
|
|
47
|
+
const darkMatch = colorsCss.match(/\.dark\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}/s);
|
|
48
|
+
if (rootMatch) colorsRootContent = rootMatch[1].trim();
|
|
49
|
+
if (darkMatch) colorsDarkContent = darkMatch[1].trim();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Remove imports that require build tools (users should handle these in their own setup)
|
|
53
|
+
indexCss = indexCss
|
|
54
|
+
.replace(/@import\s+["']tailwindcss["'];?\s*\n/g, '')
|
|
55
|
+
.replace(/@import\s+["']tw-animate-css["'];?\s*\n/g, '')
|
|
56
|
+
.replace(/@import\s+["']shadcn\/tailwind\.css["'];?\s*\n/g, '')
|
|
57
|
+
.replace(/@import\s+["']@fontsource-variable\/inter["'];?\s*\n/g, '')
|
|
58
|
+
.replace(/@import\s+["']\.\/styles\/colors\.css["'];?\s*\n/g, '')
|
|
59
|
+
.replace(/\/\*\s*Import enhanced color system\s*\*\//g, '')
|
|
60
|
+
.replace(/@source\s+[^;]+;?\s*\n/g, '')
|
|
61
|
+
.replace(/@custom-variant\s+[^;]+;?\s*\n/g, '');
|
|
62
|
+
|
|
63
|
+
// Extract :root and .dark blocks from index.css
|
|
64
|
+
const indexRootMatch = indexCss.match(/:root\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}/s);
|
|
65
|
+
const indexDarkMatch = indexCss.match(/\.dark\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}/s);
|
|
66
|
+
|
|
67
|
+
let indexRootContent = '';
|
|
68
|
+
let indexDarkContent = '';
|
|
69
|
+
|
|
70
|
+
if (indexRootMatch) indexRootContent = indexRootMatch[1].trim();
|
|
71
|
+
if (indexDarkMatch) indexDarkContent = indexDarkMatch[1].trim();
|
|
72
|
+
|
|
73
|
+
// Merge :root blocks (colors.css first, then index.css)
|
|
74
|
+
const mergedRootContent = colorsRootContent
|
|
75
|
+
? colorsRootContent + '\n\n /* Additional variables from index.css */\n ' + indexRootContent
|
|
76
|
+
: indexRootContent;
|
|
77
|
+
|
|
78
|
+
// Merge .dark blocks (colors.css first, then index.css)
|
|
79
|
+
const mergedDarkContent = colorsDarkContent
|
|
80
|
+
? colorsDarkContent + '\n\n /* Additional variables from index.css */\n ' + indexDarkContent
|
|
81
|
+
: indexDarkContent;
|
|
82
|
+
|
|
83
|
+
// Replace :root and .dark in index.css with merged versions
|
|
84
|
+
if (indexRootMatch) {
|
|
85
|
+
indexCss = indexCss.replace(/:root\s*\{[^}]+(?:\{[^}]*\}[^}]*)*\}/s, `:root {\n ${mergedRootContent}\n}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (indexDarkMatch) {
|
|
89
|
+
indexCss = indexCss.replace(/\.dark\s*\{[^}]+(?:\{[^}]*\}[^}]*)*\}/s, `.dark {\n ${mergedDarkContent}\n}`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Remove duplicate @layer base blocks
|
|
93
|
+
const lines = indexCss.split('\n');
|
|
94
|
+
let inLayerBase = false;
|
|
95
|
+
let layerBaseStart = -1;
|
|
96
|
+
let braceCount = 0;
|
|
97
|
+
const layerBaseBlocks = [];
|
|
98
|
+
|
|
99
|
+
for (let i = 0; i < lines.length; i++) {
|
|
100
|
+
const line = lines[i];
|
|
101
|
+
if (line.includes('@layer base')) {
|
|
102
|
+
if (!inLayerBase) {
|
|
103
|
+
inLayerBase = true;
|
|
104
|
+
layerBaseStart = i;
|
|
105
|
+
braceCount = (line.match(/\{/g) || []).length - (line.match(/\}/g) || []).length;
|
|
106
|
+
} else {
|
|
107
|
+
braceCount += (line.match(/\{/g) || []).length - (line.match(/\}/g) || []).length;
|
|
108
|
+
}
|
|
109
|
+
} else if (inLayerBase) {
|
|
110
|
+
braceCount += (line.match(/\{/g) || []).length - (line.match(/\}/g) || []).length;
|
|
111
|
+
if (braceCount === 0) {
|
|
112
|
+
layerBaseBlocks.push({ start: layerBaseStart, end: i });
|
|
113
|
+
inLayerBase = false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// If we found duplicate @layer base blocks, remove all but the first
|
|
119
|
+
if (layerBaseBlocks.length > 1) {
|
|
120
|
+
const firstBlock = layerBaseBlocks[0];
|
|
121
|
+
const firstBlockContent = lines.slice(firstBlock.start, firstBlock.end + 1).join('\n');
|
|
122
|
+
|
|
123
|
+
const allIdentical = layerBaseBlocks.every(block => {
|
|
124
|
+
const blockContent = lines.slice(block.start, block.end + 1).join('\n');
|
|
125
|
+
return blockContent === firstBlockContent;
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (allIdentical) {
|
|
129
|
+
for (let i = layerBaseBlocks.length - 1; i > 0; i--) {
|
|
130
|
+
const block = layerBaseBlocks[i];
|
|
131
|
+
lines.splice(block.start, block.end - block.start + 1);
|
|
132
|
+
}
|
|
133
|
+
indexCss = lines.join('\n');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Add comment before :root if it doesn't already have one
|
|
138
|
+
let combinedCss = indexCss;
|
|
139
|
+
if (combinedCss.includes(':root') && !combinedCss.includes('nqui Color System')) {
|
|
140
|
+
const rootIndex = combinedCss.indexOf(':root');
|
|
141
|
+
combinedCss = combinedCss.slice(0, rootIndex) +
|
|
142
|
+
'/* ============================================\n' +
|
|
143
|
+
' nqui Color System & Design Tokens\n' +
|
|
144
|
+
' ============================================ */\n\n' +
|
|
145
|
+
combinedCss.slice(rootIndex);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Clean up extra blank lines
|
|
149
|
+
combinedCss = combinedCss.replace(/\n{4,}/g, '\n\n\n');
|
|
150
|
+
|
|
151
|
+
// Add header comment
|
|
152
|
+
const header = `/* nqui Design System CSS
|
|
153
|
+
*
|
|
154
|
+
* This file contains ALL design tokens, CSS variables, and color scales from nqui.
|
|
155
|
+
* It includes everything the library needs to style components correctly.
|
|
156
|
+
*
|
|
157
|
+
* IMPORTANT: This file does NOT include Tailwind CSS imports or framework-specific directives.
|
|
158
|
+
* You must have Tailwind CSS configured in your project and add the appropriate imports.
|
|
159
|
+
*
|
|
160
|
+
* For Next.js with Tailwind CSS v4:
|
|
161
|
+
* @import "tailwindcss";
|
|
162
|
+
* @source "./**/*.{js,ts,jsx,tsx,mdx}";
|
|
163
|
+
* @source "../node_modules/@nqlib/nqui/dist/**/*.js";
|
|
164
|
+
* @import "@nqlib/nqui/styles";
|
|
165
|
+
*
|
|
166
|
+
* For Vite with Tailwind CSS v4:
|
|
167
|
+
* @import "tailwindcss";
|
|
168
|
+
* @import "@nqlib/nqui/styles";
|
|
169
|
+
*
|
|
170
|
+
* This file includes:
|
|
171
|
+
* - All CSS variables (--primary, --background, --foreground, etc.)
|
|
172
|
+
* - Complete color scales (100-600) for all semantic colors
|
|
173
|
+
* - Light and dark mode support
|
|
174
|
+
* - Base layer styles
|
|
175
|
+
* - Utility animations
|
|
176
|
+
*
|
|
177
|
+
* Generated by: npm run build:lib
|
|
178
|
+
* Do not edit manually
|
|
179
|
+
*/
|
|
180
|
+
|
|
181
|
+
`;
|
|
182
|
+
|
|
183
|
+
return header + combinedCss;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function main() {
|
|
187
|
+
try {
|
|
188
|
+
// Ensure dist directory exists
|
|
189
|
+
const distDir = dirname(outputPath);
|
|
190
|
+
if (!existsSync(distDir)) {
|
|
191
|
+
throw new Error(`Dist directory not found: ${distDir}. Run build first.`);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Extract and write CSS
|
|
195
|
+
const standaloneCss = extractStandaloneCSS();
|
|
196
|
+
writeFileSync(outputPath, standaloneCss, 'utf-8');
|
|
197
|
+
console.log(`✅ Generated ${outputPath}`);
|
|
198
|
+
} catch (error) {
|
|
199
|
+
console.error('❌ Error generating styles.css:', error.message);
|
|
200
|
+
process.exit(1);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
main();
|
|
205
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import { ThemeProvider } from "next-themes";
|
|
3
|
+
import "./globals.css";
|
|
4
|
+
|
|
5
|
+
export const metadata: Metadata = {
|
|
6
|
+
title: "nqui Example App",
|
|
7
|
+
description: "Example app using nqui component library",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default function RootLayout({
|
|
11
|
+
children,
|
|
12
|
+
}: Readonly<{
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}>) {
|
|
15
|
+
return (
|
|
16
|
+
<html lang="en" suppressHydrationWarning>
|
|
17
|
+
<body>
|
|
18
|
+
<ThemeProvider
|
|
19
|
+
attribute="class"
|
|
20
|
+
defaultTheme="system"
|
|
21
|
+
enableSystem
|
|
22
|
+
disableTransitionOnChange
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</ThemeProvider>
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Button } from "@nqlib/nqui";
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardDescription,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
} from "@nqlib/nqui";
|
|
11
|
+
import { Input } from "@nqlib/nqui";
|
|
12
|
+
import { Label } from "@nqlib/nqui";
|
|
13
|
+
import { Checkbox } from "@nqlib/nqui";
|
|
14
|
+
import { Separator } from "@nqlib/nqui";
|
|
15
|
+
|
|
16
|
+
export default function Home() {
|
|
17
|
+
return (
|
|
18
|
+
<div className="flex min-h-screen items-center justify-center bg-background p-8">
|
|
19
|
+
<main className="w-full max-w-2xl space-y-8">
|
|
20
|
+
<div className="text-center space-y-2">
|
|
21
|
+
<h1 className="text-4xl font-bold tracking-tight">
|
|
22
|
+
Welcome to nqui
|
|
23
|
+
</h1>
|
|
24
|
+
<p className="text-muted-foreground">
|
|
25
|
+
A React component library with enhanced UI components
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<Card>
|
|
30
|
+
<CardHeader>
|
|
31
|
+
<CardTitle>Example Form</CardTitle>
|
|
32
|
+
<CardDescription>
|
|
33
|
+
This demonstrates some of the nqui components
|
|
34
|
+
</CardDescription>
|
|
35
|
+
</CardHeader>
|
|
36
|
+
<CardContent className="space-y-4">
|
|
37
|
+
<div className="space-y-2">
|
|
38
|
+
<Label htmlFor="name">Name</Label>
|
|
39
|
+
<Input id="name" placeholder="Enter your name" />
|
|
40
|
+
</div>
|
|
41
|
+
<div className="space-y-2">
|
|
42
|
+
<Label htmlFor="email">Email</Label>
|
|
43
|
+
<Input id="email" type="email" placeholder="Enter your email" />
|
|
44
|
+
</div>
|
|
45
|
+
<Checkbox id="terms">
|
|
46
|
+
Accept terms and conditions
|
|
47
|
+
</Checkbox>
|
|
48
|
+
<Separator />
|
|
49
|
+
<div className="flex gap-2">
|
|
50
|
+
<Button variant="default">Submit</Button>
|
|
51
|
+
<Button variant="outline">Cancel</Button>
|
|
52
|
+
<Button variant="success">Success</Button>
|
|
53
|
+
</div>
|
|
54
|
+
</CardContent>
|
|
55
|
+
</Card>
|
|
56
|
+
|
|
57
|
+
<div className="text-center text-sm text-muted-foreground">
|
|
58
|
+
<p>
|
|
59
|
+
Edit <code className="rounded bg-muted px-1 py-0.5">app/page.tsx</code> to get started
|
|
60
|
+
</p>
|
|
61
|
+
</div>
|
|
62
|
+
</main>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|