@discourser/design-system 0.3.0 → 0.4.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.
@@ -0,0 +1,195 @@
1
+ # Discourser Design System Guidelines
2
+
3
+ This project uses the `@discourser/design-system` package, a Material Design 3 implementation built with Panda CSS and Ark UI.
4
+
5
+ ## IMPORTANT: Always Read These First
6
+
7
+ Before writing any code, follow these steps IN ORDER:
8
+
9
+ ### Step 1: Read Overview Files (REQUIRED)
10
+
11
+ Read ALL files with a name that starts with "overview-":
12
+
13
+ - `overview-components.md` - Available components and usage patterns
14
+
15
+ ### Step 2: Read Design Token Files (REQUIRED)
16
+
17
+ Read ALL files in the `design-tokens/` folder:
18
+
19
+ - `design-tokens/colors.md`
20
+ - `design-tokens/typography.md`
21
+ - `design-tokens/spacing.md`
22
+ - `design-tokens/elevation.md`
23
+
24
+ ### Step 3: Plan Components Needed (REQUIRED)
25
+
26
+ Identify which components you need to use.
27
+
28
+ ### Step 4: Read Component Guidelines BEFORE Using Components (REQUIRED)
29
+
30
+ BEFORE using ANY component, you MUST read its guidelines file first:
31
+
32
+ **Interactive Elements:**
33
+
34
+ - Using Button? → Read `components/button.md` FIRST
35
+ - Using IconButton? → Read `components/icon-button.md` FIRST
36
+ - Using Switch? → Read `components/switch.md` FIRST
37
+ - Using Checkbox? → Read `components/checkbox.md` FIRST
38
+ - Using RadioGroup? → Read `components/radio-group.md` FIRST
39
+
40
+ **Form Elements:**
41
+
42
+ - Using Input? → Read `components/input.md` FIRST
43
+ - Using Textarea? → Read `components/textarea.md` FIRST
44
+ - Using Select? → Read `components/select.md` FIRST
45
+
46
+ **Layout & Container:**
47
+
48
+ - Using Card? → Read `components/card.md` FIRST
49
+ - Using Accordion? → Read `components/accordion.md` FIRST
50
+ - Using Tabs? → Read `components/tabs.md` FIRST
51
+ - Using Drawer? → Read `components/drawer.md` FIRST
52
+
53
+ **Overlay Elements:**
54
+
55
+ - Using Dialog? → Read `components/dialog.md` FIRST
56
+ - Using Popover? → Read `components/popover.md` FIRST
57
+ - Using Tooltip? → Read `components/tooltip.md` FIRST
58
+
59
+ **Feedback & Status:**
60
+
61
+ - Using Badge? → Read `components/badge.md` FIRST
62
+ - Using Avatar? → Read `components/avatar.md` FIRST
63
+ - Using Toast? → Read `components/toast.md` FIRST
64
+ - Using Progress? → Read `components/progress.md` FIRST
65
+ - Using Skeleton? → Read `components/skeleton.md` FIRST
66
+
67
+ **Typography:**
68
+
69
+ - Using Heading? → Read `components/heading.md` FIRST
70
+
71
+ DO NOT write code using a component until you have read its specific guidelines.
72
+
73
+ ## Core Principles
74
+
75
+ - **Always prefer design system components** over native HTML elements
76
+ - **Use semantic tokens** (e.g., `primary`, `onPrimary`) not raw colors
77
+ - **Follow M3 patterns** for variants, sizing, and state layers
78
+ - **Do not override styles** unless absolutely necessary
79
+ - **Never use inline styles** with raw color values
80
+
81
+ ## Package Installation
82
+
83
+ ```bash
84
+ npm install @discourser/design-system react react-dom
85
+ ```
86
+
87
+ ## Package Imports
88
+
89
+ ```typescript
90
+ // Simple Components (exported directly)
91
+ import {
92
+ Button,
93
+ Card,
94
+ Input,
95
+ Textarea,
96
+ Heading,
97
+ Badge,
98
+ Toaster,
99
+ toaster,
100
+ } from '@discourser/design-system';
101
+
102
+ // Compound Components (exported as namespaces)
103
+ import * as Checkbox from '@discourser/design-system';
104
+ import * as RadioGroup from '@discourser/design-system';
105
+ import * as Select from '@discourser/design-system';
106
+ import * as Dialog from '@discourser/design-system';
107
+ import * as Drawer from '@discourser/design-system';
108
+ import * as Popover from '@discourser/design-system';
109
+ import * as Tooltip from '@discourser/design-system';
110
+ import * as Accordion from '@discourser/design-system';
111
+ import * as Tabs from '@discourser/design-system';
112
+ import * as Avatar from '@discourser/design-system';
113
+ import * as Progress from '@discourser/design-system';
114
+ import * as Skeleton from '@discourser/design-system';
115
+ import * as IconButton from '@discourser/design-system';
116
+ import * as Switch from '@discourser/design-system';
117
+
118
+ // For advanced styling (use sparingly)
119
+ import { css } from '@discourser/design-system/styled-system/css';
120
+ import { button } from '@discourser/design-system/styled-system/recipes';
121
+ ```
122
+
123
+ ## Quick Reference
124
+
125
+ **Interactive Elements:**
126
+
127
+ | Component | Key Variants | Guidelines |
128
+ | ---------- | --------------------------------------- | --------------------------- |
129
+ | Button | filled, outlined, text, elevated, tonal | `components/button.md` |
130
+ | IconButton | standard, filled, tonal, outlined | `components/icon-button.md` |
131
+ | Switch | - | `components/switch.md` |
132
+ | Checkbox | solid, outline, subtle | `components/checkbox.md` |
133
+ | RadioGroup | solid | `components/radio-group.md` |
134
+
135
+ **Form Elements:**
136
+
137
+ | Component | Key Variants | Guidelines |
138
+ | --------- | --------------------------------- | ------------------------ |
139
+ | Input | surface, outline, subtle | `components/input.md` |
140
+ | Textarea | surface, outline, subtle, flushed | `components/textarea.md` |
141
+ | Select | outline, surface | `components/select.md` |
142
+
143
+ **Layout & Containers:**
144
+
145
+ | Component | Key Variants | Guidelines |
146
+ | --------- | ----------------------------------- | ------------------------- |
147
+ | Card | elevated, filled, outlined | `components/card.md` |
148
+ | Accordion | outline, plain | `components/accordion.md` |
149
+ | Tabs | line, subtle, enclosed | `components/tabs.md` |
150
+ | Drawer | Placements: start, end, top, bottom | `components/drawer.md` |
151
+
152
+ **Overlays:**
153
+
154
+ | Component | Key Features | Guidelines |
155
+ | --------- | ----------------------------- | ----------------------- |
156
+ | Dialog | Sizes: sm, md, lg, fullscreen | `components/dialog.md` |
157
+ | Popover | 12 positioning options | `components/popover.md` |
158
+ | Tooltip | Lightweight contextual help | `components/tooltip.md` |
159
+
160
+ **Feedback & Status:**
161
+
162
+ | Component | Key Variants | Guidelines |
163
+ | --------- | ------------------------------------------------ | ------------------------ |
164
+ | Badge | subtle, solid, surface, outline | `components/badge.md` |
165
+ | Avatar | Sizes: 2xs to 2xl, Shapes: full, rounded, square | `components/avatar.md` |
166
+ | Toast | Types: success, error, warning, loading | `components/toast.md` |
167
+ | Progress | Shapes: linear, circular | `components/progress.md` |
168
+ | Skeleton | Animations: pulse, shine, none | `components/skeleton.md` |
169
+
170
+ **Typography:**
171
+
172
+ | Component | Key Features | Guidelines |
173
+ | --------- | --------------------------------- | ----------------------- |
174
+ | Heading | Sizes: xs to 7xl (M3 text styles) | `components/heading.md` |
175
+
176
+ ## Theme Support
177
+
178
+ The design system supports light and dark themes. The theme is controlled by the `data-theme` attribute on a parent element (typically `html` or `body`):
179
+
180
+ ```tsx
181
+ // Light theme (default)
182
+ <html data-theme="light">
183
+
184
+ // Dark theme
185
+ <html data-theme="dark">
186
+ ```
187
+
188
+ All semantic color tokens automatically adapt to the current theme.
189
+
190
+ ## Getting Help
191
+
192
+ For questions or issues, visit:
193
+
194
+ - GitHub: https://github.com/Tasty-Maker-Studio/Discourser-Design-System
195
+ - Documentation: Read the overview and component-specific guidelines in this folder