@nqlib/nqui 0.3.2 → 0.3.3

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 (81) hide show
  1. package/README.md +6 -1
  2. package/dist/nqui.cjs.js +1 -1
  3. package/dist/nqui.es.js +3 -3
  4. package/dist/pages/ComponentShowcase.d.ts.map +1 -1
  5. package/dist/styles.css +0 -8
  6. package/docs/components/README.md +119 -0
  7. package/docs/components/nqui-accordion.md +20 -0
  8. package/docs/components/nqui-alert-dialog.md +31 -0
  9. package/docs/components/nqui-alert.md +19 -0
  10. package/docs/components/nqui-aspect-ratio.md +17 -0
  11. package/docs/components/nqui-avatar.md +18 -0
  12. package/docs/components/nqui-badge.md +42 -0
  13. package/docs/components/nqui-breadcrumb.md +24 -0
  14. package/docs/components/nqui-button-group.md +31 -0
  15. package/docs/components/nqui-button.md +56 -0
  16. package/docs/components/nqui-calendar.md +46 -0
  17. package/docs/components/nqui-card.md +31 -0
  18. package/docs/components/nqui-carousel.md +22 -0
  19. package/docs/components/nqui-checkbox.md +34 -0
  20. package/docs/components/nqui-code-block.md +39 -0
  21. package/docs/components/nqui-code-editor.md +21 -0
  22. package/docs/components/nqui-collapsible.md +18 -0
  23. package/docs/components/nqui-color-picker.md +38 -0
  24. package/docs/components/nqui-color-slider.md +23 -0
  25. package/docs/components/nqui-combobox.md +65 -0
  26. package/docs/components/nqui-command-palette.md +29 -0
  27. package/docs/components/nqui-command.md +39 -0
  28. package/docs/components/nqui-context-menu.md +33 -0
  29. package/docs/components/nqui-dialog.md +36 -0
  30. package/docs/components/nqui-drawer.md +27 -0
  31. package/docs/components/nqui-dropdown-menu.md +56 -0
  32. package/docs/components/nqui-empty.md +22 -0
  33. package/docs/components/nqui-field.md +42 -0
  34. package/docs/components/nqui-frosted-glass.md +19 -0
  35. package/docs/components/nqui-hover-card.md +18 -0
  36. package/docs/components/nqui-input-group.md +22 -0
  37. package/docs/components/nqui-input-otp.md +23 -0
  38. package/docs/components/nqui-input.md +25 -0
  39. package/docs/components/nqui-item.md +25 -0
  40. package/docs/components/nqui-kbd.md +25 -0
  41. package/docs/components/nqui-label.md +16 -0
  42. package/docs/components/nqui-logo.md +16 -0
  43. package/docs/components/nqui-menubar.md +22 -0
  44. package/docs/components/nqui-native-select.md +28 -0
  45. package/docs/components/nqui-navigation-menu.md +25 -0
  46. package/docs/components/nqui-pagination.md +25 -0
  47. package/docs/components/nqui-popover.md +34 -0
  48. package/docs/components/nqui-progress.md +22 -0
  49. package/docs/components/nqui-radio-group.md +34 -0
  50. package/docs/components/nqui-rating.md +35 -0
  51. package/docs/components/nqui-resizable.md +23 -0
  52. package/docs/components/nqui-sandbox.md +27 -0
  53. package/docs/components/nqui-scroll-area.md +32 -0
  54. package/docs/components/nqui-segmented-control.md +18 -0
  55. package/docs/components/nqui-select.md +50 -0
  56. package/docs/components/nqui-separator.md +16 -0
  57. package/docs/components/nqui-sheet.md +27 -0
  58. package/docs/components/nqui-sidebar.md +45 -0
  59. package/docs/components/nqui-skeleton.md +15 -0
  60. package/docs/components/nqui-slider.md +16 -0
  61. package/docs/components/nqui-snippet.md +28 -0
  62. package/docs/components/nqui-sortable.md +46 -0
  63. package/docs/components/nqui-spinner.md +16 -0
  64. package/docs/components/nqui-switch.md +15 -0
  65. package/docs/components/nqui-table-of-contents.md +37 -0
  66. package/docs/components/nqui-tabs.md +35 -0
  67. package/docs/components/nqui-textarea.md +15 -0
  68. package/docs/components/nqui-toaster.md +44 -0
  69. package/docs/components/nqui-toggle-group.md +21 -0
  70. package/docs/components/nqui-toggle.md +15 -0
  71. package/docs/components/nqui-tooltip.md +24 -0
  72. package/docs/components/nqui-tracker.md +38 -0
  73. package/docs/internal-notes/BUILD_VERIFICATION.md +174 -0
  74. package/docs/internal-notes/DASHBOARD_LAYOUT_DESIGN.md +1429 -0
  75. package/docs/internal-notes/FROSTED_GLASS_FIX.md +50 -0
  76. package/docs/internal-notes/PUBLISHING.md +339 -0
  77. package/docs/internal-notes/layoutdesign.md +616 -0
  78. package/docs/internal-notes/progress.md +348 -0
  79. package/docs/internal-notes/stacked-avatar-implementation.md +38 -0
  80. package/package.json +2 -1
  81. /package/{INSTALLATION.md → docs/internal-notes/INSTALLATION.md} +0 -0
@@ -0,0 +1,44 @@
1
+ # nqui Toaster
2
+
3
+ > Toast notifications (sonner). Semantic types, promise pattern.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Toaster, toast } from "@nqlib/nqui"
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ ```tsx
14
+ // Add once (e.g. layout)
15
+ <Toaster />
16
+ ```
17
+
18
+ ## Types
19
+
20
+ ```tsx
21
+ toast.success("Saved")
22
+ toast.error("Failed")
23
+ toast.warning("Warning")
24
+ toast.info("Info")
25
+ toast("Default")
26
+ toast.loading("Loading...")
27
+ ```
28
+
29
+ ## Promise
30
+
31
+ ```tsx
32
+ toast.promise(fetchData(), {
33
+ loading: "Loading...",
34
+ success: "Done",
35
+ error: "Failed"
36
+ })
37
+ ```
38
+
39
+ ## Options
40
+
41
+ ```tsx
42
+ toast.success("Msg", { duration: 5000 })
43
+ // Toaster: position, richColors, etc.
44
+ ```
@@ -0,0 +1,21 @@
1
+ # nqui ToggleGroup
2
+
3
+ > Group of toggle buttons. Single or multiple selection.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { ToggleGroup, ToggleGroupItem } from "@nqlib/nqui"
9
+ ```
10
+
11
+ ## Basic
12
+
13
+ ```tsx
14
+ <ToggleGroup type="single" value={v} onValueChange={setV}>
15
+ <ToggleGroupItem value="a">A</ToggleGroupItem>
16
+ <ToggleGroupItem value="b">B</ToggleGroupItem>
17
+ </ToggleGroup>
18
+ <ToggleGroup type="multiple" value={vals} onValueChange={setVals}>
19
+ ...
20
+ </ToggleGroup>
21
+ ```
@@ -0,0 +1,15 @@
1
+ # nqui Toggle
2
+
3
+ > Toggle button. Core Radix.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Toggle } from "@nqlib/nqui"
9
+ ```
10
+
11
+ ## Basic
12
+
13
+ ```tsx
14
+ <Toggle pressed={pressed} onPressedChange={setPressed}>Toggle</Toggle>
15
+ ```
@@ -0,0 +1,24 @@
1
+ # nqui Tooltip
2
+
3
+ > Hover tooltip. Wrap app in TooltipProvider.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "@nqlib/nqui"
9
+ ```
10
+
11
+ ## Basic
12
+
13
+ ```tsx
14
+ <TooltipProvider>
15
+ <Tooltip>
16
+ <TooltipTrigger asChild><Button>Hover</Button></TooltipTrigger>
17
+ <TooltipContent>Tooltip text</TooltipContent>
18
+ </Tooltip>
19
+ </TooltipProvider>
20
+ ```
21
+
22
+ ## Provider
23
+
24
+ Place once at app root (or layout).
@@ -0,0 +1,38 @@
1
+ # nqui Tracker
2
+
3
+ > GitHub-style block strip. Activity/status visualization. Tooltips.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Tracker } from "@nqlib/nqui"
9
+ import type { TrackerBlockProps } from "@nqlib/nqui"
10
+ ```
11
+
12
+ ## Basic
13
+
14
+ ```tsx
15
+ <Tracker
16
+ data={[
17
+ { color: "bg-emerald-600", tooltip: "Active" },
18
+ { color: "bg-red-600", tooltip: "Error" },
19
+ { tooltip: "No data" }
20
+ ]}
21
+ />
22
+ ```
23
+
24
+ ## Options
25
+
26
+ ```tsx
27
+ <Tracker
28
+ data={data}
29
+ hoverEffect
30
+ defaultBackgroundColor="bg-muted"
31
+ />
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ - `color` must be Tailwind class (e.g. `bg-emerald-600`), not hex.
37
+ - Wrap in `TooltipProvider` for tooltips.
38
+ - Blocks without `color` use `defaultBackgroundColor`.
@@ -0,0 +1,174 @@
1
+ # Build Verification Report
2
+
3
+ This document provides a comprehensive comparison between source CSS files and the built `dist/styles.css` to ensure no content is missing or broken during the build process.
4
+
5
+ ## Verification Script
6
+
7
+ Run the verification script after building:
8
+
9
+ ```bash
10
+ npm run verify:build
11
+ ```
12
+
13
+ Or manually:
14
+
15
+ ```bash
16
+ node scripts/verify-build.js
17
+ ```
18
+
19
+ ## Verification Checks
20
+
21
+ The verification script performs the following checks:
22
+
23
+ ### 1. @source inline() Directives
24
+ - ✅ Verifies all 15 `@source inline()` directives are preserved
25
+ - ✅ Checks that all categories are present (Layout, Spacing, Typography, etc.)
26
+ - ✅ Ensures no directives are missing or duplicated
27
+
28
+ ### 2. :root CSS Variables
29
+ - ✅ Extracts all CSS variables from `src/index.css`, `src/styles/colors.css`, and `src/styles/elevation.css`
30
+ - ✅ Verifies all variables are present in the built CSS
31
+ - ✅ Checks for missing or extra variables
32
+
33
+ ### 3. .dark CSS Variables
34
+ - ✅ Extracts all dark mode CSS variables from source files
35
+ - ✅ Verifies all dark mode variables are preserved
36
+ - ✅ Ensures proper merging of variables from multiple sources
37
+
38
+ ### 4. Custom CSS Classes
39
+ - ✅ Checks for custom `.nqui-*` classes (e.g., `.nqui-button-gradient`, `.nqui-debug-panel`)
40
+ - ✅ Verifies all custom classes are present in the built CSS
41
+
42
+ ### 5. Utility Classes in @source inline()
43
+ - ✅ Extracts all utility class names from `@source inline()` directives
44
+ - ✅ Verifies all 137+ utility classes are preserved
45
+ - ✅ Ensures no utility classes are missing
46
+
47
+ ### 6. Critical Patterns
48
+ - ✅ Checks for presence of `@source inline()` directives
49
+ - ✅ Verifies `:root` and `.dark` blocks exist
50
+ - ✅ Validates specific elevation variables (--z-base, --z-content, etc.)
51
+ - ✅ Validates specific color variables (--primary-500, --background, etc.)
52
+
53
+ ### 7. Unwanted Patterns
54
+ - ✅ Ensures `@import` directives are removed
55
+ - ✅ Ensures `@custom-variant` directives are removed
56
+ - ✅ Ensures framework-specific `@source` directives are removed
57
+
58
+ ## Expected Results
59
+
60
+ ### File Sizes
61
+ - **Source index.css**: ~20 KB
62
+ - **Built styles.css**: ~35 KB (includes merged colors.css and elevation.css)
63
+ - **Colors.css**: ~6 KB
64
+ - **Elevation.css**: ~10 KB
65
+
66
+ ### Content Counts
67
+ - **@source inline() directives**: 15 (17 occurrences including comments)
68
+ - **:root blocks**: 1 (merged from all sources)
69
+ - **.dark blocks**: 1 (merged from all sources)
70
+ - **CSS variables**: ~240 total
71
+ - **Custom classes**: 4 (.nqui-button-gradient, .nqui-button-shadow, .nqui-debug-panel, .nqui-shiki-container)
72
+ - **@keyframes**: 6
73
+ - **@layer base**: 1
74
+
75
+ ### Structure Verification
76
+ - ✅ `@source inline()` directives present
77
+ - ✅ `@theme inline` present
78
+ - ✅ `:root` block present
79
+ - ✅ `.dark` block present
80
+ - ✅ Elevation variables present (11 variables)
81
+ - ✅ Color variables present (all primary, background, foreground, etc.)
82
+ - ✅ Custom classes present
83
+ - ✅ No `@import` directives
84
+ - ✅ No `@custom-variant` directives
85
+
86
+ ## Build Process
87
+
88
+ The build process (`scripts/build-styles.js`) performs the following steps:
89
+
90
+ 1. **Extract @source inline() directives** - Preserves all `@source inline()` directives before processing
91
+ 2. **Remove framework-specific directives** - Removes `@import`, `@custom-variant`, and non-inline `@source` directives
92
+ 3. **Extract CSS variables** - Extracts `:root` and `.dark` blocks from:
93
+ - `src/index.css`
94
+ - `src/styles/colors.css`
95
+ - `src/styles/elevation.css`
96
+ 4. **Merge variables** - Merges variables from all sources in the correct order:
97
+ - Elevation variables first
98
+ - Color system variables second
99
+ - Additional variables from index.css last
100
+ 5. **Preserve custom classes** - Keeps all custom CSS classes (`.nqui-*`)
101
+ 6. **Preserve @theme inline** - Keeps the `@theme inline` block
102
+ 7. **Preserve @keyframes** - Keeps all animation keyframes
103
+ 8. **Add header** - Adds documentation header
104
+ 9. **Prepend @source inline()** - Adds extracted `@source inline()` directives at the top
105
+
106
+ ## Common Issues
107
+
108
+ ### Missing @source inline() Directives
109
+ **Symptom**: Verification fails with "Missing @source inline() directives"
110
+
111
+ **Cause**: The build script's regex might not be matching multiline directives correctly.
112
+
113
+ **Fix**: Ensure the regex uses `[\s\S]*?` for multiline matching:
114
+ ```javascript
115
+ const sourceInlineRegex = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\/\s*@source\s+inline\([\s\S]*?\)\s*;/g;
116
+ ```
117
+
118
+ ### Missing CSS Variables
119
+ **Symptom**: Verification fails with "Missing X variables"
120
+
121
+ **Cause**: The extraction regex might not be handling nested braces correctly.
122
+
123
+ **Fix**: Ensure the regex uses a pattern that handles nested braces:
124
+ ```javascript
125
+ const regex = /:root\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}/s;
126
+ ```
127
+
128
+ ### Duplicate @source inline() Directives
129
+ **Symptom**: Verification shows more directives than expected
130
+
131
+ **Cause**: The removal regex might not be matching correctly, causing directives to be added twice.
132
+
133
+ **Fix**: Ensure the removal regex matches the extraction regex exactly.
134
+
135
+ ## Integration with CI/CD
136
+
137
+ Add verification to your build pipeline:
138
+
139
+ ```yaml
140
+ # Example GitHub Actions workflow
141
+ - name: Build library
142
+ run: npm run build:lib
143
+
144
+ - name: Verify build integrity
145
+ run: npm run verify:build
146
+ ```
147
+
148
+ ## Manual Verification
149
+
150
+ To manually verify specific aspects:
151
+
152
+ ```bash
153
+ # Check @source inline() directives
154
+ grep -c "@source inline" dist/styles.css
155
+
156
+ # Check CSS variables
157
+ grep -c "--.*:" dist/styles.css
158
+
159
+ # Check custom classes
160
+ grep -c "\.nqui-" dist/styles.css
161
+
162
+ # Check for unwanted patterns
163
+ grep "@import" dist/styles.css # Should return nothing
164
+ grep "@custom-variant" dist/styles.css # Should return nothing
165
+ ```
166
+
167
+ ## Related Files
168
+
169
+ - `scripts/build-styles.js` - Build script that generates `dist/styles.css`
170
+ - `scripts/verify-build.js` - Verification script
171
+ - `src/index.css` - Main source CSS file
172
+ - `src/styles/colors.css` - Color system variables
173
+ - `src/styles/elevation.css` - Z-index elevation variables
174
+ - `dist/styles.css` - Built CSS file (generated)