@discourser/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 +21 -0
- package/README.md +213 -0
- package/dist/index.cjs +1250 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +456 -0
- package/dist/index.d.ts +456 -0
- package/dist/index.js +1234 -0
- package/dist/index.js.map +1 -0
- package/package.json +123 -0
- package/styled-system/css/conditions.mjs +36 -0
- package/styled-system/css/css.d.ts +22 -0
- package/styled-system/css/css.mjs +45 -0
- package/styled-system/css/cva.d.ts +6 -0
- package/styled-system/css/cva.mjs +87 -0
- package/styled-system/css/cx.d.ts +5 -0
- package/styled-system/css/cx.mjs +15 -0
- package/styled-system/css/index.d.ts +5 -0
- package/styled-system/css/index.mjs +4 -0
- package/styled-system/css/sva.d.ts +4 -0
- package/styled-system/css/sva.mjs +41 -0
- package/styled-system/helpers.mjs +336 -0
- package/styled-system/jsx/aspect-ratio.d.ts +10 -0
- package/styled-system/jsx/aspect-ratio.mjs +14 -0
- package/styled-system/jsx/bleed.d.ts +10 -0
- package/styled-system/jsx/bleed.mjs +14 -0
- package/styled-system/jsx/box.d.ts +10 -0
- package/styled-system/jsx/box.mjs +14 -0
- package/styled-system/jsx/center.d.ts +10 -0
- package/styled-system/jsx/center.mjs +14 -0
- package/styled-system/jsx/circle.d.ts +10 -0
- package/styled-system/jsx/circle.mjs +14 -0
- package/styled-system/jsx/container.d.ts +10 -0
- package/styled-system/jsx/container.mjs +14 -0
- package/styled-system/jsx/cq.d.ts +10 -0
- package/styled-system/jsx/cq.mjs +14 -0
- package/styled-system/jsx/divider.d.ts +10 -0
- package/styled-system/jsx/divider.mjs +14 -0
- package/styled-system/jsx/factory-helper.mjs +22 -0
- package/styled-system/jsx/factory.d.ts +3 -0
- package/styled-system/jsx/factory.mjs +80 -0
- package/styled-system/jsx/flex.d.ts +10 -0
- package/styled-system/jsx/flex.mjs +14 -0
- package/styled-system/jsx/float.d.ts +10 -0
- package/styled-system/jsx/float.mjs +14 -0
- package/styled-system/jsx/grid-item.d.ts +10 -0
- package/styled-system/jsx/grid-item.mjs +14 -0
- package/styled-system/jsx/grid.d.ts +10 -0
- package/styled-system/jsx/grid.mjs +14 -0
- package/styled-system/jsx/hstack.d.ts +10 -0
- package/styled-system/jsx/hstack.mjs +14 -0
- package/styled-system/jsx/index.d.ts +24 -0
- package/styled-system/jsx/index.mjs +22 -0
- package/styled-system/jsx/is-valid-prop.d.ts +11 -0
- package/styled-system/jsx/is-valid-prop.mjs +17 -0
- package/styled-system/jsx/link-overlay.d.ts +10 -0
- package/styled-system/jsx/link-overlay.mjs +14 -0
- package/styled-system/jsx/spacer.d.ts +10 -0
- package/styled-system/jsx/spacer.mjs +14 -0
- package/styled-system/jsx/square.d.ts +10 -0
- package/styled-system/jsx/square.mjs +14 -0
- package/styled-system/jsx/stack.d.ts +10 -0
- package/styled-system/jsx/stack.mjs +14 -0
- package/styled-system/jsx/visually-hidden.d.ts +10 -0
- package/styled-system/jsx/visually-hidden.mjs +14 -0
- package/styled-system/jsx/vstack.d.ts +10 -0
- package/styled-system/jsx/vstack.mjs +14 -0
- package/styled-system/jsx/wrap.d.ts +10 -0
- package/styled-system/jsx/wrap.mjs +14 -0
- package/styled-system/patterns/aspect-ratio.d.ts +21 -0
- package/styled-system/patterns/aspect-ratio.mjs +38 -0
- package/styled-system/patterns/bleed.d.ts +22 -0
- package/styled-system/patterns/bleed.mjs +24 -0
- package/styled-system/patterns/box.d.ts +21 -0
- package/styled-system/patterns/box.mjs +15 -0
- package/styled-system/patterns/center.d.ts +21 -0
- package/styled-system/patterns/center.mjs +21 -0
- package/styled-system/patterns/circle.d.ts +21 -0
- package/styled-system/patterns/circle.mjs +25 -0
- package/styled-system/patterns/container.d.ts +21 -0
- package/styled-system/patterns/container.mjs +21 -0
- package/styled-system/patterns/cq.d.ts +22 -0
- package/styled-system/patterns/cq.mjs +21 -0
- package/styled-system/patterns/divider.d.ts +23 -0
- package/styled-system/patterns/divider.mjs +25 -0
- package/styled-system/patterns/flex.d.ts +27 -0
- package/styled-system/patterns/flex.mjs +26 -0
- package/styled-system/patterns/float.d.ts +24 -0
- package/styled-system/patterns/float.mjs +52 -0
- package/styled-system/patterns/grid-item.d.ts +26 -0
- package/styled-system/patterns/grid-item.mjs +25 -0
- package/styled-system/patterns/grid.d.ts +25 -0
- package/styled-system/patterns/grid.mjs +27 -0
- package/styled-system/patterns/hstack.d.ts +22 -0
- package/styled-system/patterns/hstack.mjs +24 -0
- package/styled-system/patterns/index.d.ts +21 -0
- package/styled-system/patterns/index.mjs +20 -0
- package/styled-system/patterns/link-overlay.d.ts +21 -0
- package/styled-system/patterns/link-overlay.mjs +24 -0
- package/styled-system/patterns/spacer.d.ts +21 -0
- package/styled-system/patterns/spacer.mjs +21 -0
- package/styled-system/patterns/square.d.ts +21 -0
- package/styled-system/patterns/square.mjs +24 -0
- package/styled-system/patterns/stack.d.ts +24 -0
- package/styled-system/patterns/stack.mjs +24 -0
- package/styled-system/patterns/visually-hidden.d.ts +21 -0
- package/styled-system/patterns/visually-hidden.mjs +18 -0
- package/styled-system/patterns/vstack.d.ts +22 -0
- package/styled-system/patterns/vstack.mjs +24 -0
- package/styled-system/patterns/wrap.d.ts +25 -0
- package/styled-system/patterns/wrap.mjs +25 -0
- package/styled-system/recipes/button.d.ts +39 -0
- package/styled-system/recipes/button.mjs +40 -0
- package/styled-system/recipes/card.d.ts +39 -0
- package/styled-system/recipes/card.mjs +36 -0
- package/styled-system/recipes/create-recipe.mjs +82 -0
- package/styled-system/recipes/dialog.d.ts +35 -0
- package/styled-system/recipes/dialog.mjs +63 -0
- package/styled-system/recipes/icon-button.d.ts +39 -0
- package/styled-system/recipes/icon-button.mjs +39 -0
- package/styled-system/recipes/index.d.ts +7 -0
- package/styled-system/recipes/index.mjs +6 -0
- package/styled-system/recipes/input.d.ts +40 -0
- package/styled-system/recipes/input.mjs +40 -0
- package/styled-system/recipes/switch-control.d.ts +35 -0
- package/styled-system/recipes/switch-control.mjs +53 -0
- package/styled-system/recipes/switch.d.ts +35 -0
- package/styled-system/recipes/switch.mjs +53 -0
- package/styled-system/tokens/index.d.ts +9 -0
- package/styled-system/tokens/index.mjs +924 -0
- package/styled-system/tokens/tokens.d.ts +48 -0
- package/styled-system/types/composition.d.ts +164 -0
- package/styled-system/types/conditions.d.ts +306 -0
- package/styled-system/types/csstype.d.ts +21298 -0
- package/styled-system/types/global.d.ts +20 -0
- package/styled-system/types/index.d.ts +8 -0
- package/styled-system/types/jsx.d.ts +52 -0
- package/styled-system/types/parts.d.ts +8 -0
- package/styled-system/types/pattern.d.ts +78 -0
- package/styled-system/types/prop-type.d.ts +224 -0
- package/styled-system/types/recipe.d.ts +181 -0
- package/styled-system/types/selectors.d.ts +59 -0
- package/styled-system/types/static-css.d.ts +56 -0
- package/styled-system/types/style-props.d.ts +7468 -0
- package/styled-system/types/system-types.d.ts +109 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 TastyMakers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# @tastymakers/design-system
|
|
2
|
+
|
|
3
|
+
[](https://github.com/tastymakers/design-system/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@tastymakers/design-system)
|
|
5
|
+
|
|
6
|
+
An aesthetic-agnostic design system built with Panda CSS and Ark UI. **Swap design languages by changing a single import.**
|
|
7
|
+
|
|
8
|
+
## โจ Features
|
|
9
|
+
|
|
10
|
+
- ๐จ **Swappable Aesthetics** - Material Design 3 by default, but change the entire look with one import
|
|
11
|
+
- ๐ฏ **Zero Runtime CSS** - SSR-safe with Panda CSS
|
|
12
|
+
- โฟ **Accessible** - WAI-ARIA compliant via Ark UI
|
|
13
|
+
- ๐ฆ **Tree-shakeable** - Only import what you need
|
|
14
|
+
- ๐ **Dark Mode** - Built-in light/dark theme support
|
|
15
|
+
- ๐ **Type-safe** - Full TypeScript support with strict mode
|
|
16
|
+
- โก **Fast** - Optimized builds with code splitting
|
|
17
|
+
|
|
18
|
+
## ๐ Technologies
|
|
19
|
+
|
|
20
|
+
- **Panda CSS** - Zero-runtime CSS-in-JS with token-first architecture
|
|
21
|
+
- **Ark UI** - Headless, accessible React components
|
|
22
|
+
- **React 19** - Latest React with Server Components support
|
|
23
|
+
- **TypeScript** - Strict type safety
|
|
24
|
+
- **Material Design 3** - Default design language (TastyMakers green #63A002)
|
|
25
|
+
- **Storybook 8** - Component documentation
|
|
26
|
+
- **Vitest** - Unit testing with 83 passing tests
|
|
27
|
+
- **tsup** - Build tool for ESM/CJS output
|
|
28
|
+
|
|
29
|
+
## ๐ฆ Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @tastymakers/design-system
|
|
33
|
+
# or
|
|
34
|
+
pnpm add @tastymakers/design-system
|
|
35
|
+
# or
|
|
36
|
+
yarn add @tastymakers/design-system
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## ๐ฏ Quick Start
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Button, Card, IconButton } from '@tastymakers/design-system';
|
|
43
|
+
import '@tastymakers/design-system/styled-system';
|
|
44
|
+
|
|
45
|
+
function App() {
|
|
46
|
+
return (
|
|
47
|
+
<Card variant="elevated">
|
|
48
|
+
<h2>Welcome to TastyMakers</h2>
|
|
49
|
+
<p>An aesthetic-agnostic design system</p>
|
|
50
|
+
<Button variant="filled" size="md">
|
|
51
|
+
Get Started
|
|
52
|
+
</Button>
|
|
53
|
+
<IconButton variant="tonal" aria-label="Settings">
|
|
54
|
+
<SettingsIcon />
|
|
55
|
+
</IconButton>
|
|
56
|
+
</Card>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## ๐ Components
|
|
62
|
+
|
|
63
|
+
### Button
|
|
64
|
+
|
|
65
|
+
Material Design 3 button with 5 variants and 3 sizes.
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { Button } from '@tastymakers/design-system';
|
|
69
|
+
|
|
70
|
+
<Button variant="filled" size="md" leftIcon={<Icon />}>
|
|
71
|
+
Click me
|
|
72
|
+
</Button>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Variants:** `filled` | `outlined` | `text` | `elevated` | `tonal`
|
|
76
|
+
**Sizes:** `sm` | `md` | `lg`
|
|
77
|
+
|
|
78
|
+
### Card
|
|
79
|
+
|
|
80
|
+
Container component with 3 variants and optional interactive state.
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { Card } from '@tastymakers/design-system';
|
|
84
|
+
|
|
85
|
+
<Card variant="elevated" interactive>
|
|
86
|
+
<h3>Card Title</h3>
|
|
87
|
+
<p>Card content goes here</p>
|
|
88
|
+
</Card>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Variants:** `elevated` | `filled` | `outlined`
|
|
92
|
+
**Interactive:** `true` | `false` (adds hover/click states)
|
|
93
|
+
|
|
94
|
+
### IconButton
|
|
95
|
+
|
|
96
|
+
Icon-only button with 4 variants and 3 sizes. Requires `aria-label` for accessibility.
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
import { IconButton } from '@tastymakers/design-system';
|
|
100
|
+
|
|
101
|
+
<IconButton variant="filled" size="md" aria-label="Settings">
|
|
102
|
+
<SettingsIcon />
|
|
103
|
+
</IconButton>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Variants:** `standard` | `filled` | `tonal` | `outlined`
|
|
107
|
+
**Sizes:** `sm` | `md` | `lg`
|
|
108
|
+
|
|
109
|
+
## ๐จ Three-Layer Architecture
|
|
110
|
+
|
|
111
|
+
This design system uses an aesthetic-agnostic architecture:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Layer 1: Infrastructure (Unchanging)
|
|
115
|
+
โโโ Token pipeline
|
|
116
|
+
โโโ Build system (tsup, Storybook)
|
|
117
|
+
โโโ Component logic (Ark UI)
|
|
118
|
+
โโโ Type contracts
|
|
119
|
+
|
|
120
|
+
Layer 2: Design Language (Swappable)
|
|
121
|
+
โโโ Token values (colors, spacing, radii)
|
|
122
|
+
โโโ Semantic mappings
|
|
123
|
+
โโโ Motion patterns
|
|
124
|
+
|
|
125
|
+
Layer 3: Component Recipes (Derived)
|
|
126
|
+
โโโ Visual styling via Panda recipes
|
|
127
|
+
โโโ Variant definitions
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Swapping Design Languages
|
|
131
|
+
|
|
132
|
+
To change from Material 3 to another design language:
|
|
133
|
+
|
|
134
|
+
1. Create your language file (e.g., `fluent.language.ts`)
|
|
135
|
+
2. Update `src/languages/index.ts`:
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
// Change this import to swap the entire aesthetic
|
|
139
|
+
export { fluentLanguage as activeLanguage } from './fluent.language';
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
3. Rebuild: `pnpm build:panda`
|
|
143
|
+
|
|
144
|
+
## ๐ ๏ธ Development
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Install dependencies
|
|
148
|
+
pnpm install
|
|
149
|
+
|
|
150
|
+
# Start Storybook
|
|
151
|
+
pnpm dev
|
|
152
|
+
|
|
153
|
+
# Run tests
|
|
154
|
+
pnpm test
|
|
155
|
+
|
|
156
|
+
# Type check
|
|
157
|
+
pnpm typecheck
|
|
158
|
+
|
|
159
|
+
# Build
|
|
160
|
+
pnpm build
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## ๐งช Testing
|
|
164
|
+
|
|
165
|
+
The design system has comprehensive test coverage:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
pnpm test # Run tests in watch mode
|
|
169
|
+
pnpm test --run # Run tests once
|
|
170
|
+
pnpm test --ui # Open Vitest UI
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Test Stats:**
|
|
174
|
+
- 83 tests passing
|
|
175
|
+
- Components: Button (30), Card (24), IconButton (29)
|
|
176
|
+
- 100% of components have tests
|
|
177
|
+
|
|
178
|
+
## ๐ Scripts
|
|
179
|
+
|
|
180
|
+
| Command | Description |
|
|
181
|
+
|---------|-------------|
|
|
182
|
+
| `pnpm dev` | Start Storybook on port 6006 |
|
|
183
|
+
| `pnpm build` | Build library (Panda + tsup) |
|
|
184
|
+
| `pnpm build:panda` | Generate styled-system |
|
|
185
|
+
| `pnpm build:lib` | Build library only |
|
|
186
|
+
| `pnpm build:storybook` | Build static Storybook |
|
|
187
|
+
| `pnpm test` | Run tests |
|
|
188
|
+
| `pnpm test:ui` | Open Vitest UI |
|
|
189
|
+
| `pnpm typecheck` | TypeScript validation |
|
|
190
|
+
| `pnpm lint` | ESLint |
|
|
191
|
+
|
|
192
|
+
## ๐ค Contributing
|
|
193
|
+
|
|
194
|
+
See [.github/README.md](.github/README.md) for CI/CD workflow documentation.
|
|
195
|
+
|
|
196
|
+
1. Fork the repository
|
|
197
|
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
198
|
+
3. Make your changes
|
|
199
|
+
4. Run tests: `pnpm test --run`
|
|
200
|
+
5. Run type check: `pnpm typecheck`
|
|
201
|
+
6. Commit: `git commit -m 'Add amazing feature'`
|
|
202
|
+
7. Push: `git push origin feature/amazing-feature`
|
|
203
|
+
8. Open a Pull Request
|
|
204
|
+
|
|
205
|
+
## ๐ License
|
|
206
|
+
|
|
207
|
+
MIT ยฉ TastyMakers
|
|
208
|
+
|
|
209
|
+
## ๐ Links
|
|
210
|
+
|
|
211
|
+
- [Storybook Documentation](https://tastymakers.github.io/design-system/)
|
|
212
|
+
- [npm Package](https://www.npmjs.com/package/@tastymakers/design-system)
|
|
213
|
+
- [GitHub Repository](https://github.com/tastymakers/design-system)
|