@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.
Files changed (219) hide show
  1. package/INSTALLATION.md +221 -0
  2. package/README.md +276 -0
  3. package/dist/App.d.ts +3 -0
  4. package/dist/App.d.ts.map +1 -0
  5. package/dist/components/AppLayout.d.ts +2 -0
  6. package/dist/components/AppLayout.d.ts.map +1 -0
  7. package/dist/components/app-sidebar.d.ts +4 -0
  8. package/dist/components/app-sidebar.d.ts.map +1 -0
  9. package/dist/components/component-example.d.ts +2 -0
  10. package/dist/components/component-example.d.ts.map +1 -0
  11. package/dist/components/custom/color-picker.d.ts +9 -0
  12. package/dist/components/custom/color-picker.d.ts.map +1 -0
  13. package/dist/components/custom/color-slider.d.ts +22 -0
  14. package/dist/components/custom/color-slider.d.ts.map +1 -0
  15. package/dist/components/custom/enhanced-button.d.ts +34 -0
  16. package/dist/components/custom/enhanced-button.d.ts.map +1 -0
  17. package/dist/components/custom/enhanced-checkbox.d.ts +28 -0
  18. package/dist/components/custom/enhanced-checkbox.d.ts.map +1 -0
  19. package/dist/components/custom/enhanced-radio-group.d.ts +36 -0
  20. package/dist/components/custom/enhanced-radio-group.d.ts.map +1 -0
  21. package/dist/components/custom/enhanced-scroll-area.d.ts +34 -0
  22. package/dist/components/custom/enhanced-scroll-area.d.ts.map +1 -0
  23. package/dist/components/custom/enhanced-separator.d.ts +36 -0
  24. package/dist/components/custom/enhanced-separator.d.ts.map +1 -0
  25. package/dist/components/custom/nqui-logo.d.ts +9 -0
  26. package/dist/components/custom/nqui-logo.d.ts.map +1 -0
  27. package/dist/components/custom/rating.d.ts +60 -0
  28. package/dist/components/custom/rating.d.ts.map +1 -0
  29. package/dist/components/custom/table-of-contents.d.ts +77 -0
  30. package/dist/components/custom/table-of-contents.d.ts.map +1 -0
  31. package/dist/components/debug/crosshair.d.ts +5 -0
  32. package/dist/components/debug/crosshair.d.ts.map +1 -0
  33. package/dist/components/debug/debug-panel.d.ts +5 -0
  34. package/dist/components/debug/debug-panel.d.ts.map +1 -0
  35. package/dist/components/debug/dependencies.d.ts +23 -0
  36. package/dist/components/debug/dependencies.d.ts.map +1 -0
  37. package/dist/components/debug/index.d.ts +17 -0
  38. package/dist/components/debug/index.d.ts.map +1 -0
  39. package/dist/components/debug/magnifier.d.ts +9 -0
  40. package/dist/components/debug/magnifier.d.ts.map +1 -0
  41. package/dist/components/debug/ui-tester.d.ts +13 -0
  42. package/dist/components/debug/ui-tester.d.ts.map +1 -0
  43. package/dist/components/debug/utils/css-variable-parser.d.ts +28 -0
  44. package/dist/components/debug/utils/css-variable-parser.d.ts.map +1 -0
  45. package/dist/components/debug/utils/element-selector.d.ts +24 -0
  46. package/dist/components/debug/utils/element-selector.d.ts.map +1 -0
  47. package/dist/components/debug/utils/style-injector.d.ts +40 -0
  48. package/dist/components/debug/utils/style-injector.d.ts.map +1 -0
  49. package/dist/components/debug/utils/style-parser.d.ts +53 -0
  50. package/dist/components/debug/utils/style-parser.d.ts.map +1 -0
  51. package/dist/components/example.d.ts +7 -0
  52. package/dist/components/example.d.ts.map +1 -0
  53. package/dist/components/login-form.d.ts +2 -0
  54. package/dist/components/login-form.d.ts.map +1 -0
  55. package/dist/components/nav-user.d.ts +8 -0
  56. package/dist/components/nav-user.d.ts.map +1 -0
  57. package/dist/components/showcase/app-builder/app-builder-context.d.ts +16 -0
  58. package/dist/components/showcase/app-builder/app-builder-context.d.ts.map +1 -0
  59. package/dist/components/showcase/app-builder/app-canvas.d.ts +11 -0
  60. package/dist/components/showcase/app-builder/app-canvas.d.ts.map +1 -0
  61. package/dist/components/showcase/app-builder/widget-configurator.d.ts +10 -0
  62. package/dist/components/showcase/app-builder/widget-configurator.d.ts.map +1 -0
  63. package/dist/components/showcase/app-builder/widget-palette.d.ts +6 -0
  64. package/dist/components/showcase/app-builder/widget-palette.d.ts.map +1 -0
  65. package/dist/components/showcase/app-builder/widget-registry.d.ts +29 -0
  66. package/dist/components/showcase/app-builder/widget-registry.d.ts.map +1 -0
  67. package/dist/components/showcase/app-builder/widget-renderer.d.ts +7 -0
  68. package/dist/components/showcase/app-builder/widget-renderer.d.ts.map +1 -0
  69. package/dist/components/theme-toggle.d.ts +2 -0
  70. package/dist/components/theme-toggle.d.ts.map +1 -0
  71. package/dist/components/ui/accordion.d.ts +8 -0
  72. package/dist/components/ui/accordion.d.ts.map +1 -0
  73. package/dist/components/ui/alert-dialog.d.ts +19 -0
  74. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  75. package/dist/components/ui/alert.d.ts +11 -0
  76. package/dist/components/ui/alert.d.ts.map +1 -0
  77. package/dist/components/ui/aspect-ratio.d.ts +4 -0
  78. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  79. package/dist/components/ui/avatar.d.ts +7 -0
  80. package/dist/components/ui/avatar.d.ts.map +1 -0
  81. package/dist/components/ui/badge.d.ts +10 -0
  82. package/dist/components/ui/badge.d.ts.map +1 -0
  83. package/dist/components/ui/breadcrumb.d.ts +20 -0
  84. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  85. package/dist/components/ui/button-group.d.ts +12 -0
  86. package/dist/components/ui/button-group.d.ts.map +1 -0
  87. package/dist/components/ui/button.d.ts +12 -0
  88. package/dist/components/ui/button.d.ts.map +1 -0
  89. package/dist/components/ui/calendar.d.ts +9 -0
  90. package/dist/components/ui/calendar.d.ts.map +1 -0
  91. package/dist/components/ui/card.d.ts +9 -0
  92. package/dist/components/ui/card.d.ts.map +1 -0
  93. package/dist/components/ui/carousel.d.ts +29 -0
  94. package/dist/components/ui/carousel.d.ts.map +1 -0
  95. package/dist/components/ui/chart.d.ts +41 -0
  96. package/dist/components/ui/chart.d.ts.map +1 -0
  97. package/dist/components/ui/checkbox.d.ts +5 -0
  98. package/dist/components/ui/checkbox.d.ts.map +1 -0
  99. package/dist/components/ui/collapsible.d.ts +6 -0
  100. package/dist/components/ui/collapsible.d.ts.map +1 -0
  101. package/dist/components/ui/combobox.d.ts +25 -0
  102. package/dist/components/ui/combobox.d.ts.map +1 -0
  103. package/dist/components/ui/command.d.ts +19 -0
  104. package/dist/components/ui/command.d.ts.map +1 -0
  105. package/dist/components/ui/context-menu.d.ts +28 -0
  106. package/dist/components/ui/context-menu.d.ts.map +1 -0
  107. package/dist/components/ui/dialog.d.ts +18 -0
  108. package/dist/components/ui/dialog.d.ts.map +1 -0
  109. package/dist/components/ui/drawer.d.ts +14 -0
  110. package/dist/components/ui/drawer.d.ts.map +1 -0
  111. package/dist/components/ui/dropdown-menu.d.ts +28 -0
  112. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  113. package/dist/components/ui/empty.d.ts +12 -0
  114. package/dist/components/ui/empty.d.ts.map +1 -0
  115. package/dist/components/ui/field.d.ts +25 -0
  116. package/dist/components/ui/field.d.ts.map +1 -0
  117. package/dist/components/ui/hover-card.d.ts +7 -0
  118. package/dist/components/ui/hover-card.d.ts.map +1 -0
  119. package/dist/components/ui/input-group.d.ts +17 -0
  120. package/dist/components/ui/input-group.d.ts.map +1 -0
  121. package/dist/components/ui/input-otp.d.ts +12 -0
  122. package/dist/components/ui/input-otp.d.ts.map +1 -0
  123. package/dist/components/ui/input.d.ts +4 -0
  124. package/dist/components/ui/input.d.ts.map +1 -0
  125. package/dist/components/ui/item.d.ts +24 -0
  126. package/dist/components/ui/item.d.ts.map +1 -0
  127. package/dist/components/ui/kbd.d.ts +4 -0
  128. package/dist/components/ui/kbd.d.ts.map +1 -0
  129. package/dist/components/ui/label.d.ts +6 -0
  130. package/dist/components/ui/label.d.ts.map +1 -0
  131. package/dist/components/ui/menubar.d.ts +27 -0
  132. package/dist/components/ui/menubar.d.ts.map +1 -0
  133. package/dist/components/ui/native-select.d.ts +9 -0
  134. package/dist/components/ui/native-select.d.ts.map +1 -0
  135. package/dist/components/ui/navigation-menu.d.ts +15 -0
  136. package/dist/components/ui/navigation-menu.d.ts.map +1 -0
  137. package/dist/components/ui/pagination.d.ts +14 -0
  138. package/dist/components/ui/pagination.d.ts.map +1 -0
  139. package/dist/components/ui/popover.d.ts +11 -0
  140. package/dist/components/ui/popover.d.ts.map +1 -0
  141. package/dist/components/ui/progress.d.ts +5 -0
  142. package/dist/components/ui/progress.d.ts.map +1 -0
  143. package/dist/components/ui/radio-group.d.ts +6 -0
  144. package/dist/components/ui/radio-group.d.ts.map +1 -0
  145. package/dist/components/ui/resizable.d.ts +8 -0
  146. package/dist/components/ui/resizable.d.ts.map +1 -0
  147. package/dist/components/ui/scroll-area.d.ts +6 -0
  148. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  149. package/dist/components/ui/select.d.ts +16 -0
  150. package/dist/components/ui/select.d.ts.map +1 -0
  151. package/dist/components/ui/separator.d.ts +5 -0
  152. package/dist/components/ui/separator.d.ts.map +1 -0
  153. package/dist/components/ui/sheet.d.ts +26 -0
  154. package/dist/components/ui/sheet.d.ts.map +1 -0
  155. package/dist/components/ui/sidebar.d.ts +66 -0
  156. package/dist/components/ui/sidebar.d.ts.map +1 -0
  157. package/dist/components/ui/skeleton.d.ts +3 -0
  158. package/dist/components/ui/skeleton.d.ts.map +1 -0
  159. package/dist/components/ui/slider.d.ts +5 -0
  160. package/dist/components/ui/slider.d.ts.map +1 -0
  161. package/dist/components/ui/sonner.d.ts +4 -0
  162. package/dist/components/ui/sonner.d.ts.map +1 -0
  163. package/dist/components/ui/spinner.d.ts +3 -0
  164. package/dist/components/ui/spinner.d.ts.map +1 -0
  165. package/dist/components/ui/switch.d.ts +5 -0
  166. package/dist/components/ui/switch.d.ts.map +1 -0
  167. package/dist/components/ui/table.d.ts +11 -0
  168. package/dist/components/ui/table.d.ts.map +1 -0
  169. package/dist/components/ui/tabs.d.ts +12 -0
  170. package/dist/components/ui/tabs.d.ts.map +1 -0
  171. package/dist/components/ui/textarea.d.ts +4 -0
  172. package/dist/components/ui/textarea.d.ts.map +1 -0
  173. package/dist/components/ui/toggle-group.d.ts +11 -0
  174. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  175. package/dist/components/ui/toggle.d.ts +10 -0
  176. package/dist/components/ui/toggle.d.ts.map +1 -0
  177. package/dist/components/ui/tooltip.d.ts +8 -0
  178. package/dist/components/ui/tooltip.d.ts.map +1 -0
  179. package/dist/hooks/use-mobile.d.ts +2 -0
  180. package/dist/hooks/use-mobile.d.ts.map +1 -0
  181. package/dist/hooks/use-scroll-spy.d.ts +50 -0
  182. package/dist/hooks/use-scroll-spy.d.ts.map +1 -0
  183. package/dist/index.d.ts +80 -0
  184. package/dist/index.d.ts.map +1 -0
  185. package/dist/lib/utils.d.ts +3 -0
  186. package/dist/lib/utils.d.ts.map +1 -0
  187. package/dist/main.d.ts +3 -0
  188. package/dist/main.d.ts.map +1 -0
  189. package/dist/mockdata/toc.d.ts +11 -0
  190. package/dist/mockdata/toc.d.ts.map +1 -0
  191. package/dist/nqui.cjs.js +521 -0
  192. package/dist/nqui.css +148 -0
  193. package/dist/nqui.es.js +35453 -0
  194. package/dist/pages/AppBuilder.d.ts +2 -0
  195. package/dist/pages/AppBuilder.d.ts.map +1 -0
  196. package/dist/pages/Dashboard.d.ts +2 -0
  197. package/dist/pages/Dashboard.d.ts.map +1 -0
  198. package/dist/pages/Drafts.d.ts +2 -0
  199. package/dist/pages/Drafts.d.ts.map +1 -0
  200. package/dist/pages/Inbox.d.ts +2 -0
  201. package/dist/pages/Inbox.d.ts.map +1 -0
  202. package/dist/pages/Junk.d.ts +2 -0
  203. package/dist/pages/Junk.d.ts.map +1 -0
  204. package/dist/pages/Sent.d.ts +2 -0
  205. package/dist/pages/Sent.d.ts.map +1 -0
  206. package/dist/pages/Settings.d.ts +2 -0
  207. package/dist/pages/Settings.d.ts.map +1 -0
  208. package/dist/pages/Trash.d.ts +2 -0
  209. package/dist/pages/Trash.d.ts.map +1 -0
  210. package/dist/styles.css +544 -0
  211. package/dist/vite.svg +1 -0
  212. package/package.json +128 -0
  213. package/scripts/build-styles.js +205 -0
  214. package/scripts/examples/nextjs-layout.tsx +30 -0
  215. package/scripts/examples/nextjs-page.tsx +66 -0
  216. package/scripts/init-css.js +568 -0
  217. package/scripts/init-debug-css.js +123 -0
  218. package/scripts/publish-npmjs.js +87 -0
  219. 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
+