@qdesignsystems/design-system-core 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md ADDED
@@ -0,0 +1,145 @@
1
+ # Q Design System — AI Agent Rules
2
+
3
+ ## CRITICAL: Component Import Rule
4
+
5
+ **NEVER install or use local shadcn/ui components (via `npx shadcn@latest add ...`).**
6
+ **ALWAYS import components from `@qdesignsystems/design-system-core`.**
7
+
8
+ This project uses a pre-built design system package. All components are already available — do not scaffold new ones.
9
+
10
+ ---
11
+
12
+ ## How to Import Components
13
+
14
+ All components come from one package:
15
+
16
+ ```tsx
17
+ import { Button, Card, Input, Badge, ... } from '@qdesignsystems/design-system-core';
18
+ ```
19
+
20
+ ### Base Components
21
+
22
+ ```tsx
23
+ import {
24
+ // Layout
25
+ Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, CardAction,
26
+
27
+ // Inputs
28
+ Button, Input, Textarea, Checkbox, RadioGroup, RadioGroupItem, Switch, Toggle,
29
+
30
+ // Display
31
+ Badge, Alert, AlertTitle, AlertDescription, Separator, Skeleton, Label,
32
+
33
+ // Navigation
34
+ Pagination, PaginationContent, PaginationLink, PaginationItem,
35
+ PaginationPrevious, PaginationNext, PaginationEllipsis,
36
+
37
+ // Overlay
38
+ Popover, PopoverTrigger, PopoverContent,
39
+ DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem,
40
+ DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuGroup,
41
+
42
+ // Structure
43
+ Accordion, AccordionItem, AccordionTrigger, AccordionContent,
44
+ Collapsible, CollapsibleTrigger, CollapsibleContent,
45
+
46
+ // Form
47
+ Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField,
48
+
49
+ // Sidebar
50
+ Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent,
51
+ SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton,
52
+ SidebarMenuItem, SidebarProvider, SidebarTrigger, SidebarInset,
53
+
54
+ // Utilities
55
+ cn, ThemeProvider,
56
+ } from '@qdesignsystems/design-system-core';
57
+ ```
58
+
59
+ ### Pre-built Composite Components
60
+
61
+ These are ready-to-use demo components. Use them as-is or as a starting point:
62
+
63
+ ```tsx
64
+ // Buttons
65
+ import { Button14, Button16, Button17, Button19, Button20 } from '@qdesignsystems/design-system-core';
66
+
67
+ // Button Groups
68
+ import { ButtonGroup01, ButtonGroup02, ButtonGroup03 } from '@qdesignsystems/design-system-core';
69
+
70
+ // Cards
71
+ import { Card01, Card02, Card03, Card04, Card05, Card06, Card10, Card13, Card14 } from '@qdesignsystems/design-system-core';
72
+
73
+ // Inputs
74
+ import { Input01, Input02, Input03 /* ... up to Input46 */ } from '@qdesignsystems/design-system-core';
75
+
76
+ // Badges
77
+ import { Badge01, Badge02 /* ... up to Badge24 */ } from '@qdesignsystems/design-system-core';
78
+
79
+ // Forms
80
+ import { Form01, Form02, Form03 /* ... up to Form10 */ } from '@qdesignsystems/design-system-core';
81
+
82
+ // Checkboxes
83
+ import { Checkbox01, Checkbox02 /* ... up to Checkbox16 */ } from '@qdesignsystems/design-system-core';
84
+
85
+ // Radio Groups
86
+ import { RadioGroup01, RadioGroup02 /* ... up to RadioGroup13 */ } from '@qdesignsystems/design-system-core';
87
+
88
+ // Dropdowns
89
+ import { DropdownMenu01, DropdownMenu05, DropdownMenu08, DropdownMenu09 } from '@qdesignsystems/design-system-core';
90
+
91
+ // Popovers
92
+ import { Popover01, Popover02 /* ... up to Popover12 */ } from '@qdesignsystems/design-system-core';
93
+
94
+ // Pagination
95
+ import { Pagination01, Pagination02 /* ... up to Pagination15 */ } from '@qdesignsystems/design-system-core';
96
+
97
+ // Calendars
98
+ import { Calendar01, Calendar02 /* ... up to Calendar21 */ } from '@qdesignsystems/design-system-core';
99
+
100
+ // Comboboxes
101
+ import { Combobox01, Combobox02 /* ... up to Combobox12 */ } from '@qdesignsystems/design-system-core';
102
+
103
+ // Data Tables
104
+ import { DataTable01, DataTable02, DataTable03, DataTable05, DataTable07, DataTable08, DataTable09, DataTable13 } from '@qdesignsystems/design-system-core';
105
+
106
+ // Collapsibles
107
+ import { Collapsible01, Collapsible02 /* ... up to Collapsible09 */ } from '@qdesignsystems/design-system-core';
108
+
109
+ // Toasts / Notifications
110
+ import { Sonner01, Sonner02 /* ... up to Sonner20 */ } from '@qdesignsystems/design-system-core';
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Rules
116
+
117
+ 1. **Never run `npx shadcn@latest add <component>`** — components already exist in the package
118
+ 2. **Never create files in `src/components/ui/`** — do not scaffold local shadcn components
119
+ 3. **Always import from `@qdesignsystems/design-system-core`**
120
+ 4. **Use Tailwind utility classes** for layout and spacing — the theme CSS variables are already loaded
121
+ 5. **Do not add a `:root { }` or `.dark { }` block** to any CSS file — this overrides the theme
122
+
123
+ ---
124
+
125
+ ## CSS Setup (must be correct)
126
+
127
+ `src/main.tsx` must have these imports at the very top:
128
+
129
+ ```tsx
130
+ import '@qdesignsystems/design-system-core/styles.css';
131
+ import '@qdesignsystems/theme-myra/styles.css'; // or theme-q
132
+ ```
133
+
134
+ `src/index.css` must NOT contain `:root { }` or `.dark { }` variable blocks. It should only contain:
135
+
136
+ ```css
137
+ @tailwind base;
138
+ @tailwind components;
139
+ @tailwind utilities;
140
+
141
+ @layer base {
142
+ * { @apply border-border; }
143
+ body { @apply bg-background text-foreground; }
144
+ }
145
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qdesignsystems/design-system-core",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -28,7 +28,9 @@
28
28
  ],
29
29
  "files": [
30
30
  "dist",
31
- "scripts/init.cjs"
31
+ "scripts/init.cjs",
32
+ "README.md",
33
+ "AGENTS.md"
32
34
  ],
33
35
  "scripts": {
34
36
  "build": "tsup && node scripts/strip-css-sourcemap.cjs",
package/scripts/init.cjs CHANGED
@@ -134,7 +134,23 @@ if (!entryPatched) {
134
134
  log(YELLOW, '⚠', 'Could not find main entry file — please add imports manually (see below)');
135
135
  }
136
136
 
137
- // ─── 3. Summary ───────────────────────────────────────────────────────────────
137
+ // ─── 3. Copy AGENTS.md to project root ───────────────────────────────────────
138
+ // AGENTS.md tells AI assistants (Lovable, Cursor, etc.) to use our components
139
+ const agentsSrc = path.join(__dirname, '..', 'AGENTS.md');
140
+ const agentsDest = path.join(projectRoot, 'AGENTS.md');
141
+
142
+ if (fs.existsSync(agentsSrc)) {
143
+ if (fs.existsSync(agentsDest)) {
144
+ log(GREEN, '✔', 'AGENTS.md already exists at project root');
145
+ } else {
146
+ fs.copyFileSync(agentsSrc, agentsDest);
147
+ log(GREEN, '✔', 'Copied AGENTS.md to project root (tells AI to use design system components)');
148
+ }
149
+ } else {
150
+ log(YELLOW, '⚠', 'Could not find AGENTS.md in package — skipping');
151
+ }
152
+
153
+ // ─── 4. Summary ───────────────────────────────────────────────────────────────
138
154
  console.log('');
139
155
  console.log(`${BOLD}Setup complete!${RESET}`);
140
156
  console.log('');