@madecki/ui 1.1.0 → 1.2.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/README.md +5 -2
- package/cursor-rule-template.md +34 -64
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,11 +133,14 @@ Copy the rule template to your MFE project:
|
|
|
133
133
|
# Create the rules directory
|
|
134
134
|
mkdir -p .cursor/rules
|
|
135
135
|
|
|
136
|
-
# Copy the template
|
|
136
|
+
# Copy the template
|
|
137
137
|
cp node_modules/@madecki/ui/cursor-rule-template.md .cursor/rules/madecki-ui.mdc
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
**Why this works:** The rule tells the AI to read `node_modules/@madecki/ui/llm-context.md` at runtime. This means:
|
|
141
|
+
- The rule file is static and rarely changes
|
|
142
|
+
- The actual component docs are read from whatever version is installed
|
|
143
|
+
- Updating `@madecki/ui` automatically updates what the AI sees
|
|
141
144
|
|
|
142
145
|
#### Option B: Point AI to Documentation
|
|
143
146
|
|
package/cursor-rule-template.md
CHANGED
|
@@ -6,90 +6,60 @@ Copy the content below to `.cursor/rules/madecki-ui.mdc` in your MFE project:
|
|
|
6
6
|
|
|
7
7
|
```markdown
|
|
8
8
|
---
|
|
9
|
-
description:
|
|
10
|
-
|
|
9
|
+
description: Use @madecki/ui component library for all UI development
|
|
10
|
+
alwaysApply: true
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# @madecki/ui Component Library
|
|
14
14
|
|
|
15
|
-
This project uses @madecki/ui for UI components.
|
|
15
|
+
This project uses @madecki/ui for UI components. This rule applies to ALL frontend development tasks.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## IMPORTANT: Read Library Documentation First
|
|
18
18
|
|
|
19
|
-
Before creating ANY UI component,
|
|
19
|
+
Before creating ANY UI component or writing frontend code, read the library's context file:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
- `Container` - Page wrapper with max-width
|
|
23
|
-
- `Stack` - Vertical/horizontal flex layout
|
|
24
|
-
- `Grid` / `GridItem` - CSS grid layout
|
|
21
|
+
**Read this file:** `node_modules/@madecki/ui/llm-context.md`
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
23
|
+
This file contains:
|
|
24
|
+
- All available components and their props
|
|
25
|
+
- Design tokens (colors, spacing, typography)
|
|
26
|
+
- Usage patterns and examples
|
|
27
|
+
- Rules for consistent usage
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
- `Button`, `ButtonTransparent`, `GradientButton` - Buttons
|
|
32
|
-
- `Input` - Form inputs
|
|
33
|
-
- `Tabs` - Tab navigation
|
|
34
|
-
- `RadioButtons` - Radio groups
|
|
29
|
+
## When This Applies
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
31
|
+
- Creating new pages or components
|
|
32
|
+
- Building forms, layouts, or navigation
|
|
33
|
+
- Adding buttons, inputs, or any interactive elements
|
|
34
|
+
- Styling with Tailwind CSS
|
|
35
|
+
- Setting up a new frontend project
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
- `BlockQuote`, `Hr` - Content elements
|
|
37
|
+
## Quick Rules
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
1. ALWAYS read `node_modules/@madecki/ui/llm-context.md` before creating UI
|
|
40
|
+
2. ALWAYS import from "@madecki/ui", never create custom versions of library components
|
|
41
|
+
3. ALWAYS use design tokens from the library (e.g., `bg-primary`, `p-5`, `text-lg`)
|
|
42
|
+
4. NEVER use arbitrary Tailwind values like `bg-[#123456]` or `p-[17px]`
|
|
46
43
|
|
|
47
44
|
## Import Pattern
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
\`\`\`tsx
|
|
50
47
|
import { Container, Stack, Heading, Text, Button } from "@madecki/ui";
|
|
51
48
|
import { Heart, Info } from "@madecki/ui";
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## Design Tokens
|
|
55
|
-
|
|
56
|
-
ALWAYS use these Tailwind classes, NEVER arbitrary values:
|
|
57
|
-
|
|
58
|
-
### Colors
|
|
59
|
-
`primary`, `darkgray`, `gray`, `lightgray`, `icongray`, `white`, `success`, `danger`, `warning`, `info`, `blue`, `neutral`
|
|
49
|
+
\`\`\`
|
|
60
50
|
|
|
61
|
-
|
|
62
|
-
`1`-`10` (4px to 40px scale)
|
|
51
|
+
## When Starting a New Project
|
|
63
52
|
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
1. Install the library: `npm install @madecki/ui`
|
|
54
|
+
2. Configure Tailwind to use the preset (see README)
|
|
55
|
+
3. Read `node_modules/@madecki/ui/llm-context.md` for available components
|
|
56
|
+
4. Use library components for all UI elements
|
|
66
57
|
|
|
67
|
-
|
|
68
|
-
`sm` (10px), `md` (20px), `circle` (50%)
|
|
69
|
-
|
|
70
|
-
## Page Structure Pattern
|
|
71
|
-
|
|
72
|
-
```tsx
|
|
73
|
-
import { Container, Stack, Heading, Text } from "@madecki/ui";
|
|
74
|
-
|
|
75
|
-
export function Page() {
|
|
76
|
-
return (
|
|
77
|
-
<Container size="lg">
|
|
78
|
-
<Stack gap="6">
|
|
79
|
-
<Heading level={1}>Page Title</Heading>
|
|
80
|
-
<Text color="muted">Page description</Text>
|
|
81
|
-
{/* Content */}
|
|
82
|
-
</Stack>
|
|
83
|
-
</Container>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
```
|
|
58
|
+
## When Unsure
|
|
87
59
|
|
|
88
|
-
|
|
60
|
+
If you're not sure what components are available or how to use them:
|
|
89
61
|
|
|
90
|
-
1.
|
|
91
|
-
2.
|
|
92
|
-
3.
|
|
93
|
-
4. ALWAYS use `Stack` or `Grid` for component layouts
|
|
94
|
-
5. ALWAYS support dark mode when adding custom styles
|
|
62
|
+
1. Read `node_modules/@madecki/ui/llm-context.md` for quick reference
|
|
63
|
+
2. Read `node_modules/@madecki/ui/README.md` for full documentation
|
|
64
|
+
3. Check TypeScript types for prop definitions
|
|
95
65
|
```
|