@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.
Files changed (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +213 -0
  3. package/dist/index.cjs +1250 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +456 -0
  6. package/dist/index.d.ts +456 -0
  7. package/dist/index.js +1234 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +123 -0
  10. package/styled-system/css/conditions.mjs +36 -0
  11. package/styled-system/css/css.d.ts +22 -0
  12. package/styled-system/css/css.mjs +45 -0
  13. package/styled-system/css/cva.d.ts +6 -0
  14. package/styled-system/css/cva.mjs +87 -0
  15. package/styled-system/css/cx.d.ts +5 -0
  16. package/styled-system/css/cx.mjs +15 -0
  17. package/styled-system/css/index.d.ts +5 -0
  18. package/styled-system/css/index.mjs +4 -0
  19. package/styled-system/css/sva.d.ts +4 -0
  20. package/styled-system/css/sva.mjs +41 -0
  21. package/styled-system/helpers.mjs +336 -0
  22. package/styled-system/jsx/aspect-ratio.d.ts +10 -0
  23. package/styled-system/jsx/aspect-ratio.mjs +14 -0
  24. package/styled-system/jsx/bleed.d.ts +10 -0
  25. package/styled-system/jsx/bleed.mjs +14 -0
  26. package/styled-system/jsx/box.d.ts +10 -0
  27. package/styled-system/jsx/box.mjs +14 -0
  28. package/styled-system/jsx/center.d.ts +10 -0
  29. package/styled-system/jsx/center.mjs +14 -0
  30. package/styled-system/jsx/circle.d.ts +10 -0
  31. package/styled-system/jsx/circle.mjs +14 -0
  32. package/styled-system/jsx/container.d.ts +10 -0
  33. package/styled-system/jsx/container.mjs +14 -0
  34. package/styled-system/jsx/cq.d.ts +10 -0
  35. package/styled-system/jsx/cq.mjs +14 -0
  36. package/styled-system/jsx/divider.d.ts +10 -0
  37. package/styled-system/jsx/divider.mjs +14 -0
  38. package/styled-system/jsx/factory-helper.mjs +22 -0
  39. package/styled-system/jsx/factory.d.ts +3 -0
  40. package/styled-system/jsx/factory.mjs +80 -0
  41. package/styled-system/jsx/flex.d.ts +10 -0
  42. package/styled-system/jsx/flex.mjs +14 -0
  43. package/styled-system/jsx/float.d.ts +10 -0
  44. package/styled-system/jsx/float.mjs +14 -0
  45. package/styled-system/jsx/grid-item.d.ts +10 -0
  46. package/styled-system/jsx/grid-item.mjs +14 -0
  47. package/styled-system/jsx/grid.d.ts +10 -0
  48. package/styled-system/jsx/grid.mjs +14 -0
  49. package/styled-system/jsx/hstack.d.ts +10 -0
  50. package/styled-system/jsx/hstack.mjs +14 -0
  51. package/styled-system/jsx/index.d.ts +24 -0
  52. package/styled-system/jsx/index.mjs +22 -0
  53. package/styled-system/jsx/is-valid-prop.d.ts +11 -0
  54. package/styled-system/jsx/is-valid-prop.mjs +17 -0
  55. package/styled-system/jsx/link-overlay.d.ts +10 -0
  56. package/styled-system/jsx/link-overlay.mjs +14 -0
  57. package/styled-system/jsx/spacer.d.ts +10 -0
  58. package/styled-system/jsx/spacer.mjs +14 -0
  59. package/styled-system/jsx/square.d.ts +10 -0
  60. package/styled-system/jsx/square.mjs +14 -0
  61. package/styled-system/jsx/stack.d.ts +10 -0
  62. package/styled-system/jsx/stack.mjs +14 -0
  63. package/styled-system/jsx/visually-hidden.d.ts +10 -0
  64. package/styled-system/jsx/visually-hidden.mjs +14 -0
  65. package/styled-system/jsx/vstack.d.ts +10 -0
  66. package/styled-system/jsx/vstack.mjs +14 -0
  67. package/styled-system/jsx/wrap.d.ts +10 -0
  68. package/styled-system/jsx/wrap.mjs +14 -0
  69. package/styled-system/patterns/aspect-ratio.d.ts +21 -0
  70. package/styled-system/patterns/aspect-ratio.mjs +38 -0
  71. package/styled-system/patterns/bleed.d.ts +22 -0
  72. package/styled-system/patterns/bleed.mjs +24 -0
  73. package/styled-system/patterns/box.d.ts +21 -0
  74. package/styled-system/patterns/box.mjs +15 -0
  75. package/styled-system/patterns/center.d.ts +21 -0
  76. package/styled-system/patterns/center.mjs +21 -0
  77. package/styled-system/patterns/circle.d.ts +21 -0
  78. package/styled-system/patterns/circle.mjs +25 -0
  79. package/styled-system/patterns/container.d.ts +21 -0
  80. package/styled-system/patterns/container.mjs +21 -0
  81. package/styled-system/patterns/cq.d.ts +22 -0
  82. package/styled-system/patterns/cq.mjs +21 -0
  83. package/styled-system/patterns/divider.d.ts +23 -0
  84. package/styled-system/patterns/divider.mjs +25 -0
  85. package/styled-system/patterns/flex.d.ts +27 -0
  86. package/styled-system/patterns/flex.mjs +26 -0
  87. package/styled-system/patterns/float.d.ts +24 -0
  88. package/styled-system/patterns/float.mjs +52 -0
  89. package/styled-system/patterns/grid-item.d.ts +26 -0
  90. package/styled-system/patterns/grid-item.mjs +25 -0
  91. package/styled-system/patterns/grid.d.ts +25 -0
  92. package/styled-system/patterns/grid.mjs +27 -0
  93. package/styled-system/patterns/hstack.d.ts +22 -0
  94. package/styled-system/patterns/hstack.mjs +24 -0
  95. package/styled-system/patterns/index.d.ts +21 -0
  96. package/styled-system/patterns/index.mjs +20 -0
  97. package/styled-system/patterns/link-overlay.d.ts +21 -0
  98. package/styled-system/patterns/link-overlay.mjs +24 -0
  99. package/styled-system/patterns/spacer.d.ts +21 -0
  100. package/styled-system/patterns/spacer.mjs +21 -0
  101. package/styled-system/patterns/square.d.ts +21 -0
  102. package/styled-system/patterns/square.mjs +24 -0
  103. package/styled-system/patterns/stack.d.ts +24 -0
  104. package/styled-system/patterns/stack.mjs +24 -0
  105. package/styled-system/patterns/visually-hidden.d.ts +21 -0
  106. package/styled-system/patterns/visually-hidden.mjs +18 -0
  107. package/styled-system/patterns/vstack.d.ts +22 -0
  108. package/styled-system/patterns/vstack.mjs +24 -0
  109. package/styled-system/patterns/wrap.d.ts +25 -0
  110. package/styled-system/patterns/wrap.mjs +25 -0
  111. package/styled-system/recipes/button.d.ts +39 -0
  112. package/styled-system/recipes/button.mjs +40 -0
  113. package/styled-system/recipes/card.d.ts +39 -0
  114. package/styled-system/recipes/card.mjs +36 -0
  115. package/styled-system/recipes/create-recipe.mjs +82 -0
  116. package/styled-system/recipes/dialog.d.ts +35 -0
  117. package/styled-system/recipes/dialog.mjs +63 -0
  118. package/styled-system/recipes/icon-button.d.ts +39 -0
  119. package/styled-system/recipes/icon-button.mjs +39 -0
  120. package/styled-system/recipes/index.d.ts +7 -0
  121. package/styled-system/recipes/index.mjs +6 -0
  122. package/styled-system/recipes/input.d.ts +40 -0
  123. package/styled-system/recipes/input.mjs +40 -0
  124. package/styled-system/recipes/switch-control.d.ts +35 -0
  125. package/styled-system/recipes/switch-control.mjs +53 -0
  126. package/styled-system/recipes/switch.d.ts +35 -0
  127. package/styled-system/recipes/switch.mjs +53 -0
  128. package/styled-system/tokens/index.d.ts +9 -0
  129. package/styled-system/tokens/index.mjs +924 -0
  130. package/styled-system/tokens/tokens.d.ts +48 -0
  131. package/styled-system/types/composition.d.ts +164 -0
  132. package/styled-system/types/conditions.d.ts +306 -0
  133. package/styled-system/types/csstype.d.ts +21298 -0
  134. package/styled-system/types/global.d.ts +20 -0
  135. package/styled-system/types/index.d.ts +8 -0
  136. package/styled-system/types/jsx.d.ts +52 -0
  137. package/styled-system/types/parts.d.ts +8 -0
  138. package/styled-system/types/pattern.d.ts +78 -0
  139. package/styled-system/types/prop-type.d.ts +224 -0
  140. package/styled-system/types/recipe.d.ts +181 -0
  141. package/styled-system/types/selectors.d.ts +59 -0
  142. package/styled-system/types/static-css.d.ts +56 -0
  143. package/styled-system/types/style-props.d.ts +7468 -0
  144. 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
+ [![CI](https://github.com/tastymakers/design-system/actions/workflows/ci.yml/badge.svg)](https://github.com/tastymakers/design-system/actions/workflows/ci.yml)
4
+ [![npm version](https://badge.fury.io/js/@tastymakers%2Fdesign-system.svg)](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)