@discourser/design-system 0.7.0 → 0.9.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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/guidelines/Guidelines.md +78 -0
- package/guidelines/exp/context/Gem-Smry-1-15-10_45.md +57 -0
- package/guidelines/exp/v1/01-V1-Minimal.md +66 -0
- package/guidelines/exp/v1/TESTING-LOG.md +307 -0
- package/guidelines/exp/v1/quick-ref.md +230 -0
- package/package.json +1 -1
- package/styled-system/types/composition.d.ts +3 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# Component Quick Reference
|
|
2
|
+
|
|
3
|
+
## Component Type Lookup
|
|
4
|
+
|
|
5
|
+
| Component | Type | Usage |
|
|
6
|
+
| ---------- | ------------ | ------------------------------------------------------------- |
|
|
7
|
+
| Button | Simple | `<Button variant="solid" colorPalette="primary">` |
|
|
8
|
+
| Heading | Simple | `<Heading as="h1" size="2xl">` |
|
|
9
|
+
| Input | Simple | `<Input label="..." />` |
|
|
10
|
+
| Textarea | Simple | `<Textarea label="..." />` |
|
|
11
|
+
| Badge | Simple | `<Badge>` |
|
|
12
|
+
| Spinner | Simple | `<Spinner />` |
|
|
13
|
+
| Card | **Compound** | `<Card.Root>` → `.Header`, `.Title`, `.Body`, `.Footer` |
|
|
14
|
+
| Dialog | **Compound** | `<Dialog.Root>` → `.Trigger`, `.Content`, `.Title` |
|
|
15
|
+
| Drawer | **Compound** | `<Drawer.Root>` → `.Trigger`, `.Content` |
|
|
16
|
+
| Switch | **Compound** | `<Switch.Root>` → `.Control`, `.Thumb`, `.Label` |
|
|
17
|
+
| Checkbox | **Compound** | `<Checkbox.Root>` → `.Control`, `.Label` |
|
|
18
|
+
| RadioGroup | **Compound** | `<RadioGroup.Root>` → `.Item`, `.ItemControl`, `.ItemText` |
|
|
19
|
+
| Select | **Compound** | `<Select.Root>` → `.Control`, `.Trigger`, `.Content`, `.Item` |
|
|
20
|
+
| Tabs | **Compound** | `<Tabs.Root>` → `.List`, `.Trigger`, `.Content` |
|
|
21
|
+
| Accordion | **Compound** | `<Accordion.Root>` → `.Item`, `.Trigger`, `.Content` |
|
|
22
|
+
| Avatar | **Compound** | `<Avatar.Root>` → `.Image`, `.Fallback` |
|
|
23
|
+
| Tooltip | **Compound** | `<Tooltip.Root>` → `.Trigger`, `.Content` |
|
|
24
|
+
| Popover | **Compound** | `<Popover.Root>` → `.Trigger`, `.Content` |
|
|
25
|
+
| IconButton | **Compound** | `<IconButton.Root aria-label="...">` |
|
|
26
|
+
| Progress | **Compound** | `<Progress.Root>` → `.Track`, `.Range` |
|
|
27
|
+
| Skeleton | **Compound** | `<Skeleton.Root>` → `.Item` |
|
|
28
|
+
| Slider | **Compound** | `<Slider.Root>` → `.Control`, `.Track`, `.Thumb` |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Button Variants
|
|
33
|
+
|
|
34
|
+
| Variant | colorPalette | Use Case |
|
|
35
|
+
| --------- | ------------ | ------------------------ |
|
|
36
|
+
| `solid` | `primary` | Primary CTA, form submit |
|
|
37
|
+
| `solid` | `error` | Destructive actions |
|
|
38
|
+
| `outline` | `neutral` | Secondary action, cancel |
|
|
39
|
+
| `outline` | `primary` | Alternative primary |
|
|
40
|
+
| `plain` | `primary` | Text link, tertiary |
|
|
41
|
+
| `subtle` | `neutral` | Low emphasis |
|
|
42
|
+
| `surface` | `primary` | Elevated button |
|
|
43
|
+
|
|
44
|
+
**⚠️ ALWAYS include `colorPalette`**
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
// ✅ Correct
|
|
48
|
+
<Button variant="solid" colorPalette="primary">Submit</Button>
|
|
49
|
+
|
|
50
|
+
// ❌ Wrong (missing colorPalette)
|
|
51
|
+
<Button variant="solid">Submit</Button>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Heading Sizes
|
|
57
|
+
|
|
58
|
+
| Size | Usage |
|
|
59
|
+
| ----------- | -------------------- |
|
|
60
|
+
| `3xl`-`7xl` | Page hero, marketing |
|
|
61
|
+
| `2xl` | Page title (h1) |
|
|
62
|
+
| `xl` | Section title (h2) |
|
|
63
|
+
| `lg` | Subsection (h3) |
|
|
64
|
+
| `md`-`sm` | Minor headings |
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<Heading as="h1" size="2xl">Page Title</Heading>
|
|
68
|
+
<Heading as="h2" size="xl">Section</Heading>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Card Structure
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<Card.Root variant="elevated">
|
|
77
|
+
<Card.Header>
|
|
78
|
+
<Card.Title>Title</Card.Title>
|
|
79
|
+
<Card.Description>Description</Card.Description>
|
|
80
|
+
</Card.Header>
|
|
81
|
+
<Card.Body>{/* Main content */}</Card.Body>
|
|
82
|
+
<Card.Footer>
|
|
83
|
+
<Button variant="outline" colorPalette="neutral">
|
|
84
|
+
Cancel
|
|
85
|
+
</Button>
|
|
86
|
+
<Button variant="solid" colorPalette="primary">
|
|
87
|
+
Save
|
|
88
|
+
</Button>
|
|
89
|
+
</Card.Footer>
|
|
90
|
+
</Card.Root>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Card variants: `elevated`, `outline`, `filled`
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Dialog Structure
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
<Dialog.Root>
|
|
101
|
+
<Dialog.Trigger asChild>
|
|
102
|
+
<Button variant="solid" colorPalette="primary">
|
|
103
|
+
Open
|
|
104
|
+
</Button>
|
|
105
|
+
</Dialog.Trigger>
|
|
106
|
+
<Dialog.Content>
|
|
107
|
+
<Dialog.Title>Title</Dialog.Title>
|
|
108
|
+
<Dialog.Description>Description</Dialog.Description>
|
|
109
|
+
{/* Content */}
|
|
110
|
+
<Button variant="outline" colorPalette="neutral">
|
|
111
|
+
Cancel
|
|
112
|
+
</Button>
|
|
113
|
+
<Button variant="solid" colorPalette="primary">
|
|
114
|
+
Confirm
|
|
115
|
+
</Button>
|
|
116
|
+
</Dialog.Content>
|
|
117
|
+
</Dialog.Root>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Switch Structure
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
<Switch.Root checked={value} onCheckedChange={setValue}>
|
|
126
|
+
<Switch.Control>
|
|
127
|
+
<Switch.Thumb />
|
|
128
|
+
</Switch.Control>
|
|
129
|
+
<Switch.Label>Enable feature</Switch.Label>
|
|
130
|
+
</Switch.Root>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Select Structure
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<Select.Root items={items} value={value} onValueChange={setValue}>
|
|
139
|
+
<Select.Label>Choose option</Select.Label>
|
|
140
|
+
<Select.Control>
|
|
141
|
+
<Select.Trigger>
|
|
142
|
+
<Select.ValueText placeholder="Select..." />
|
|
143
|
+
</Select.Trigger>
|
|
144
|
+
</Select.Control>
|
|
145
|
+
<Select.Content>
|
|
146
|
+
{items.map((item) => (
|
|
147
|
+
<Select.Item key={item.value} item={item}>
|
|
148
|
+
<Select.ItemText>{item.label}</Select.ItemText>
|
|
149
|
+
</Select.Item>
|
|
150
|
+
))}
|
|
151
|
+
</Select.Content>
|
|
152
|
+
</Select.Root>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Semantic Tokens
|
|
158
|
+
|
|
159
|
+
### Colors
|
|
160
|
+
|
|
161
|
+
| Token | Usage |
|
|
162
|
+
| ------------------ | ---------------------------- |
|
|
163
|
+
| `primary` | Brand color, primary actions |
|
|
164
|
+
| `onPrimary` | Text on primary bg |
|
|
165
|
+
| `surface` | Default background |
|
|
166
|
+
| `onSurface` | Default text |
|
|
167
|
+
| `surfaceContainer` | Card/panel backgrounds |
|
|
168
|
+
| `error` | Error states |
|
|
169
|
+
| `outline` | Borders |
|
|
170
|
+
|
|
171
|
+
### Spacing
|
|
172
|
+
|
|
173
|
+
`xs` (4px) → `sm` (8px) → `md` (16px) → `lg` (24px) → `xl` (32px)
|
|
174
|
+
|
|
175
|
+
### Border Radius
|
|
176
|
+
|
|
177
|
+
`l1` (4px) → `l2` (8px) → `l3` (12px) → `l4` (16px) → `full`
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Common Patterns
|
|
182
|
+
|
|
183
|
+
### Form with Card
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
<Card.Root variant="elevated">
|
|
187
|
+
<Card.Header>
|
|
188
|
+
<Card.Title>
|
|
189
|
+
<Heading as="h2" size="xl">
|
|
190
|
+
Sign In
|
|
191
|
+
</Heading>
|
|
192
|
+
</Card.Title>
|
|
193
|
+
</Card.Header>
|
|
194
|
+
<Card.Body
|
|
195
|
+
className={css({ display: 'flex', flexDirection: 'column', gap: 'md' })}
|
|
196
|
+
>
|
|
197
|
+
<Input label="Email" type="email" />
|
|
198
|
+
<Input label="Password" type="password" />
|
|
199
|
+
</Card.Body>
|
|
200
|
+
<Card.Footer>
|
|
201
|
+
<Button variant="solid" colorPalette="primary" type="submit">
|
|
202
|
+
Sign In
|
|
203
|
+
</Button>
|
|
204
|
+
</Card.Footer>
|
|
205
|
+
</Card.Root>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Button Group
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
<div className={css({ display: 'flex', gap: 'sm' })}>
|
|
212
|
+
<Button variant="outline" colorPalette="neutral">
|
|
213
|
+
Cancel
|
|
214
|
+
</Button>
|
|
215
|
+
<Button variant="solid" colorPalette="primary">
|
|
216
|
+
Confirm
|
|
217
|
+
</Button>
|
|
218
|
+
</div>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Page Layout
|
|
222
|
+
|
|
223
|
+
```tsx
|
|
224
|
+
<div className={css({ p: 'xl', bg: 'surface', minHeight: '100vh' })}>
|
|
225
|
+
<Heading as="h1" size="2xl" className={css({ mb: 'lg', color: 'onSurface' })}>
|
|
226
|
+
Dashboard
|
|
227
|
+
</Heading>
|
|
228
|
+
{/* Content */}
|
|
229
|
+
</div>
|
|
230
|
+
```
|
package/package.json
CHANGED