@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 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 (adjust path to your node_modules)
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
- Or manually create `.cursor/rules/madecki-ui.mdc` with content from `cursor-rule-template.md`.
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
 
@@ -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: Rules for using @madecki/ui component library
10
- globs: **/*.{tsx,jsx,ts,js}
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. ALWAYS use library components instead of creating custom ones.
15
+ This project uses @madecki/ui for UI components. This rule applies to ALL frontend development tasks.
16
16
 
17
- ## Required: Check Library First
17
+ ## IMPORTANT: Read Library Documentation First
18
18
 
19
- Before creating ANY UI component, check if @madecki/ui has it:
19
+ Before creating ANY UI component or writing frontend code, read the library's context file:
20
20
 
21
- ### Layout
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
- ### Typography
27
- - `Heading` - h1-h6 with consistent styling
28
- - `Text` - Body text with variants
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
- ### Interactive
31
- - `Button`, `ButtonTransparent`, `GradientButton` - Buttons
32
- - `Input` - Form inputs
33
- - `Tabs` - Tab navigation
34
- - `RadioButtons` - Radio groups
29
+ ## When This Applies
35
30
 
36
- ### Feedback
37
- - `Spinner`, `SpinnerOverlay` - Loading states
38
- - `ContentBox` - Info/warning/success/danger boxes
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
- ### Content
41
- - `BlockQuote`, `Hr` - Content elements
37
+ ## Quick Rules
42
38
 
43
- ### Icons
44
- - `Heart`, `Share`, `Search`, `Info`, `Warning`
45
- - `TwitterIcon`, `LinkedInIcon`, `InstagramIcon`
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
- ```tsx
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
- ### Spacing (gap, padding, margin)
62
- `1`-`10` (4px to 40px scale)
51
+ ## When Starting a New Project
63
52
 
64
- ### Typography
65
- `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl`
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
- ### Border Radius
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
- ## Rules
60
+ If you're not sure what components are available or how to use them:
89
61
 
90
- 1. NEVER create custom Button, Input, Heading, or Text components
91
- 2. NEVER use arbitrary Tailwind values like `bg-[#123456]` or `p-[17px]`
92
- 3. ALWAYS use `Container` for page wrappers
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
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madecki/ui",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Reusable React UI components with Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",