@atxp/design-system 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.
- package/LICENSE.md +7 -0
- package/README.md +225 -0
- package/dist/index.cjs +2278 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +901 -0
- package/dist/index.d.ts +901 -0
- package/dist/index.js +2155 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +94 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2025, Circuit and Chisel, Inc.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Circuit & Chisel Design System
|
|
2
|
+
|
|
3
|
+
A React component library built with TypeScript, Tailwind CSS, and based on our Figma design system.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @atxp/design-system
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with npm:
|
|
12
|
+
```bash
|
|
13
|
+
npm install @atxp/design-system
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Import Styles
|
|
19
|
+
|
|
20
|
+
First, import the design system styles in your app's entry point:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import '@atxp/design-system/styles.css';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Use Components
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { Badge } from '@atxp/design-system';
|
|
30
|
+
|
|
31
|
+
function App() {
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
<Badge>Default Badge</Badge>
|
|
35
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
36
|
+
<Badge variant="destructive">Error</Badge>
|
|
37
|
+
<Badge variant="success">Success</Badge>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Development
|
|
44
|
+
|
|
45
|
+
### Prerequisites
|
|
46
|
+
|
|
47
|
+
- Node.js 18+ and npm
|
|
48
|
+
- Access to the Figma design file
|
|
49
|
+
|
|
50
|
+
### Setup
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Install dependencies
|
|
54
|
+
pnpm install
|
|
55
|
+
|
|
56
|
+
# Start development mode (watches for changes)
|
|
57
|
+
pnpm dev
|
|
58
|
+
|
|
59
|
+
# Start Storybook for component development
|
|
60
|
+
pnpm storybook
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Build
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Build the package
|
|
67
|
+
pnpm build
|
|
68
|
+
|
|
69
|
+
# Build Storybook for deployment
|
|
70
|
+
pnpm build-storybook
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Linting and Type Checking
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Run ESLint
|
|
77
|
+
pnpm lint
|
|
78
|
+
|
|
79
|
+
# Run TypeScript type checking
|
|
80
|
+
pnpm typecheck
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Syncing with Figma
|
|
84
|
+
|
|
85
|
+
This design system is built from our Figma designs. When the design team updates components in Figma, follow this workflow to sync changes:
|
|
86
|
+
|
|
87
|
+
### Prerequisites
|
|
88
|
+
|
|
89
|
+
1. **Install Claude Code CLI** (if not already installed):
|
|
90
|
+
```bash
|
|
91
|
+
npm install -g @anthropic-ai/claude-code
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
2. **Authenticate with Figma MCP**:
|
|
95
|
+
```bash
|
|
96
|
+
claude mcp add --transport http figma https://mcp.figma.com/mcp
|
|
97
|
+
```
|
|
98
|
+
Then type `/mcp` in Claude Code and authenticate with your Figma account.
|
|
99
|
+
|
|
100
|
+
### Sync Workflow
|
|
101
|
+
|
|
102
|
+
1. **Identify Updated Components**
|
|
103
|
+
- Open the Figma file: https://www.figma.com/design/nadcKNlrnZUHbbLwm9GdK4/C-C-Design-System---Components
|
|
104
|
+
- Note which components have been updated or added
|
|
105
|
+
- Copy the Figma URL for the specific component (right-click → Copy link)
|
|
106
|
+
|
|
107
|
+
2. **Extract Design Tokens** (if colors, spacing, typography changed)
|
|
108
|
+
|
|
109
|
+
Open Claude Code in this directory and run:
|
|
110
|
+
```
|
|
111
|
+
Extract the latest design tokens from the Figma file at:
|
|
112
|
+
https://www.figma.com/design/nadcKNlrnZUHbbLwm9GdK4?node-id=0-1
|
|
113
|
+
|
|
114
|
+
Update src/styles/tokens.css with any new or changed tokens.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
3. **Update Component Code**
|
|
118
|
+
|
|
119
|
+
For each updated component, ask Claude Code:
|
|
120
|
+
```
|
|
121
|
+
Update the [ComponentName] component from this Figma URL:
|
|
122
|
+
[paste the component's Figma URL]
|
|
123
|
+
|
|
124
|
+
Make sure to:
|
|
125
|
+
- Preserve the existing API (props interface)
|
|
126
|
+
- Update the visual styles to match Figma
|
|
127
|
+
- Keep using class-variance-authority for variants
|
|
128
|
+
- Update the Storybook stories if needed
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
4. **Review Changes**
|
|
132
|
+
```bash
|
|
133
|
+
# Start Storybook to review the updated components
|
|
134
|
+
npm run storybook
|
|
135
|
+
|
|
136
|
+
# Check that all variants and states work correctly
|
|
137
|
+
# Compare with Figma designs side-by-side
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
5. **Update Documentation**
|
|
141
|
+
- Update component JSDoc comments if the API changed
|
|
142
|
+
- Update Storybook stories to show new variants/props
|
|
143
|
+
- Update this README if new components were added
|
|
144
|
+
|
|
145
|
+
6. **Version and Publish**
|
|
146
|
+
```bash
|
|
147
|
+
# Update version in package.json following semver:
|
|
148
|
+
# - PATCH: Bug fixes, small styling tweaks
|
|
149
|
+
# - MINOR: New components, new variants, backwards-compatible changes
|
|
150
|
+
# - MAJOR: Breaking changes to component APIs
|
|
151
|
+
|
|
152
|
+
# Build and publish
|
|
153
|
+
pnpm build
|
|
154
|
+
pnpm publish
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Adding New Components
|
|
158
|
+
|
|
159
|
+
When designers add a completely new component to Figma:
|
|
160
|
+
|
|
161
|
+
1. Get the component's Figma URL
|
|
162
|
+
2. Open Claude Code and run:
|
|
163
|
+
```
|
|
164
|
+
Create a new [ComponentName] component from this Figma design:
|
|
165
|
+
[paste Figma URL]
|
|
166
|
+
|
|
167
|
+
Follow the existing pattern:
|
|
168
|
+
- Create src/components/[ComponentName]/[ComponentName].tsx
|
|
169
|
+
- Use class-variance-authority for variants
|
|
170
|
+
- Create src/components/[ComponentName]/[ComponentName].stories.tsx
|
|
171
|
+
- Export from src/components/[ComponentName]/index.ts
|
|
172
|
+
- Add to src/index.ts
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
3. Review in Storybook and test in a consuming application
|
|
176
|
+
|
|
177
|
+
### Design Token Reference
|
|
178
|
+
|
|
179
|
+
Our design tokens are defined in `src/styles/tokens.css` and map to Figma variables:
|
|
180
|
+
|
|
181
|
+
- **Colors**: `--theme-*` (primary, secondary, destructive, success, etc.)
|
|
182
|
+
- **Spacing**: `--spacing-*` (0.5, 2, 3.5, 4, 5, 6, 8)
|
|
183
|
+
- **Typography**: `--font-*` (sizes, weights, line heights, families)
|
|
184
|
+
- **Border Radius**: `--theme-radius`, `--radius-*`
|
|
185
|
+
- **Border Width**: `--border-width-*`
|
|
186
|
+
|
|
187
|
+
These tokens are configured in Tailwind (`tailwind.config.js`) and can be used via Tailwind utilities.
|
|
188
|
+
|
|
189
|
+
## Component Library
|
|
190
|
+
|
|
191
|
+
### Current Components
|
|
192
|
+
|
|
193
|
+
- **Badge**: Display status, categories, or labels
|
|
194
|
+
- Variants: default, secondary, destructive, outline, success
|
|
195
|
+
- Sizes: sm, md
|
|
196
|
+
- [Figma Link](https://www.figma.com/design/nadcKNlrnZUHbbLwm9GdK4?node-id=2673-1675)
|
|
197
|
+
|
|
198
|
+
*More components coming soon as we sync from Figma...*
|
|
199
|
+
|
|
200
|
+
## Architecture
|
|
201
|
+
|
|
202
|
+
- **React 19** with TypeScript 5
|
|
203
|
+
- **Tailwind CSS 4** with CSS-first configuration
|
|
204
|
+
- **class-variance-authority** for component variants
|
|
205
|
+
- **tsup** for bundling (ESM + CJS)
|
|
206
|
+
- **Storybook 10** for documentation and development
|
|
207
|
+
- **Figma MCP** for design-to-code workflow
|
|
208
|
+
|
|
209
|
+
## Publishing
|
|
210
|
+
|
|
211
|
+
This package is published to npm as `@atxp/design-system`.
|
|
212
|
+
|
|
213
|
+
See [PUBLISHING.md](./PUBLISHING.md) for detailed publishing instructions and requirements.
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Build the package
|
|
217
|
+
pnpm build
|
|
218
|
+
|
|
219
|
+
# Publish (requires npm access to @atxp organization)
|
|
220
|
+
pnpm publish
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
MIT
|