@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
@@ -0,0 +1,456 @@
1
+ import * as react from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, InputHTMLAttributes } from 'react';
3
+ import { RecipeConfig, RecipeVariantRecord, SlotRecipeConfig } from '@pandacss/types';
4
+ import { ClassValue } from 'clsx';
5
+
6
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
7
+ children: ReactNode;
8
+ leftIcon?: ReactNode;
9
+ rightIcon?: ReactNode;
10
+ /**
11
+ * Visual style variant
12
+ * @default "filled"
13
+ */
14
+ variant?: 'filled' | 'outlined' | 'text' | 'elevated' | 'tonal';
15
+ /**
16
+ * Size variant
17
+ * @default "md"
18
+ */
19
+ size?: 'sm' | 'md' | 'lg';
20
+ }
21
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
22
+
23
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
24
+ children: ReactNode;
25
+ /**
26
+ * Visual style variant
27
+ * @default "filled"
28
+ */
29
+ variant?: 'filled' | 'outlined' | 'elevated';
30
+ /**
31
+ * When true, the card becomes clickable with hover/active states
32
+ */
33
+ interactive?: boolean;
34
+ }
35
+ declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
36
+
37
+ interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
38
+ /**
39
+ * Icon to display in the button
40
+ */
41
+ children: ReactNode;
42
+ /**
43
+ * Accessible label for the button (required for screen readers)
44
+ */
45
+ 'aria-label': string;
46
+ /**
47
+ * Visual style variant
48
+ * @default "standard"
49
+ */
50
+ variant?: 'standard' | 'filled' | 'outlined' | 'tonal';
51
+ /**
52
+ * Size variant
53
+ * @default "md"
54
+ */
55
+ size?: 'sm' | 'md' | 'lg';
56
+ }
57
+ declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
58
+
59
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
60
+ /**
61
+ * Label text for the input
62
+ */
63
+ label?: string;
64
+ /**
65
+ * Helper text to display below the input
66
+ */
67
+ helperText?: string;
68
+ /**
69
+ * Error message to display (also sets error state)
70
+ */
71
+ errorText?: string;
72
+ /**
73
+ * Visual style variant
74
+ * @default "outlined"
75
+ */
76
+ variant?: 'outlined' | 'filled';
77
+ /**
78
+ * Size variant
79
+ * @default "md"
80
+ */
81
+ size?: 'sm' | 'md';
82
+ /**
83
+ * Visual state
84
+ */
85
+ state?: 'error';
86
+ }
87
+ declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
88
+
89
+ interface DialogProps {
90
+ /**
91
+ * Whether the dialog is open
92
+ */
93
+ open?: boolean;
94
+ /**
95
+ * Callback when the dialog open state changes
96
+ */
97
+ onOpenChange?: (details: {
98
+ open: boolean;
99
+ }) => void;
100
+ /**
101
+ * Dialog title
102
+ */
103
+ title?: string;
104
+ /**
105
+ * Dialog description/content
106
+ */
107
+ description?: string;
108
+ /**
109
+ * Dialog content (alternative to description for custom content)
110
+ */
111
+ children?: ReactNode;
112
+ /**
113
+ * Whether to show the close button
114
+ * @default true
115
+ */
116
+ showCloseButton?: boolean;
117
+ /**
118
+ * Custom close button label for accessibility
119
+ * @default 'Close'
120
+ */
121
+ closeLabel?: string;
122
+ /**
123
+ * Size variant
124
+ * @default "md"
125
+ */
126
+ size?: 'sm' | 'md' | 'lg';
127
+ }
128
+ declare const Dialog: react.ForwardRefExoticComponent<DialogProps & react.RefAttributes<HTMLDivElement>>;
129
+
130
+ interface SwitchProps {
131
+ /**
132
+ * Label text for the switch
133
+ */
134
+ label?: string;
135
+ /**
136
+ * Whether the switch is checked
137
+ */
138
+ checked?: boolean;
139
+ /**
140
+ * Default checked state (uncontrolled)
141
+ */
142
+ defaultChecked?: boolean;
143
+ /**
144
+ * Callback when checked state changes
145
+ */
146
+ onCheckedChange?: (details: {
147
+ checked: boolean;
148
+ }) => void;
149
+ /**
150
+ * Whether the switch is disabled
151
+ */
152
+ disabled?: boolean;
153
+ /**
154
+ * Name attribute for form submission
155
+ */
156
+ name?: string;
157
+ /**
158
+ * Value attribute for form submission
159
+ */
160
+ value?: string;
161
+ /**
162
+ * Whether the switch is required
163
+ */
164
+ required?: boolean;
165
+ /**
166
+ * Size variant
167
+ * @default "md"
168
+ */
169
+ size?: 'sm' | 'md';
170
+ }
171
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
172
+
173
+ declare const buttonRecipe: RecipeConfig<RecipeVariantRecord>;
174
+
175
+ declare const cardRecipe: RecipeConfig<RecipeVariantRecord>;
176
+
177
+ declare const iconButtonRecipe: RecipeConfig<RecipeVariantRecord>;
178
+
179
+ declare const inputRecipe: RecipeConfig<RecipeVariantRecord>;
180
+
181
+ declare const dialogRecipe: SlotRecipeConfig;
182
+
183
+ declare const switchRecipe: SlotRecipeConfig;
184
+
185
+ /**
186
+ * Design Language Contract
187
+ *
188
+ * Any aesthetic (M3, Carbon, Fluent, custom) must implement this interface.
189
+ * This enables swapping aesthetics by changing one import.
190
+ */
191
+ interface DesignLanguageContract {
192
+ name: string;
193
+ version: string;
194
+ colors: ColorPalettes;
195
+ semantic: SemanticColors;
196
+ semanticDark?: SemanticColors;
197
+ typography: TypographyConfig;
198
+ spacing: SpacingScale;
199
+ shape: ShapeConfig;
200
+ elevation: ElevationConfig;
201
+ motion: MotionConfig;
202
+ }
203
+ interface ColorPalettes {
204
+ primary: TonalPalette;
205
+ secondary: TonalPalette;
206
+ tertiary: TonalPalette;
207
+ neutral: TonalPalette;
208
+ neutralVariant: TonalPalette;
209
+ error: TonalPalette;
210
+ }
211
+ interface TonalPalette {
212
+ 0: string;
213
+ 10: string;
214
+ 20: string;
215
+ 30: string;
216
+ 40: string;
217
+ 50: string;
218
+ 60: string;
219
+ 70: string;
220
+ 80: string;
221
+ 90: string;
222
+ 95: string;
223
+ 99: string;
224
+ 100: string;
225
+ }
226
+ interface SemanticColors {
227
+ primary: string;
228
+ onPrimary: string;
229
+ primaryContainer: string;
230
+ onPrimaryContainer: string;
231
+ secondary: string;
232
+ onSecondary: string;
233
+ secondaryContainer: string;
234
+ onSecondaryContainer: string;
235
+ tertiary: string;
236
+ onTertiary: string;
237
+ tertiaryContainer: string;
238
+ onTertiaryContainer: string;
239
+ error: string;
240
+ onError: string;
241
+ errorContainer: string;
242
+ onErrorContainer: string;
243
+ surface: string;
244
+ onSurface: string;
245
+ surfaceVariant: string;
246
+ onSurfaceVariant: string;
247
+ surfaceContainerLowest: string;
248
+ surfaceContainerLow: string;
249
+ surfaceContainer: string;
250
+ surfaceContainerHigh: string;
251
+ surfaceContainerHighest: string;
252
+ outline: string;
253
+ outlineVariant: string;
254
+ inverseSurface: string;
255
+ inverseOnSurface: string;
256
+ inversePrimary: string;
257
+ background: string;
258
+ onBackground: string;
259
+ scrim: string;
260
+ shadow: string;
261
+ }
262
+ interface TypographyConfig {
263
+ fonts: {
264
+ display: string;
265
+ body: string;
266
+ mono: string;
267
+ };
268
+ scale: TypographyScale;
269
+ }
270
+ interface TypographyScale {
271
+ displayLarge: TypeStyle;
272
+ displayMedium: TypeStyle;
273
+ displaySmall: TypeStyle;
274
+ headlineLarge: TypeStyle;
275
+ headlineMedium: TypeStyle;
276
+ headlineSmall: TypeStyle;
277
+ titleLarge: TypeStyle;
278
+ titleMedium: TypeStyle;
279
+ titleSmall: TypeStyle;
280
+ bodyLarge: TypeStyle;
281
+ bodyMedium: TypeStyle;
282
+ bodySmall: TypeStyle;
283
+ labelLarge: TypeStyle;
284
+ labelMedium: TypeStyle;
285
+ labelSmall: TypeStyle;
286
+ }
287
+ interface TypeStyle {
288
+ fontSize: string;
289
+ lineHeight: string;
290
+ fontWeight: string;
291
+ letterSpacing: string;
292
+ fontFamily?: 'display' | 'body' | 'mono';
293
+ }
294
+ interface SpacingScale {
295
+ none: string;
296
+ xxs: string;
297
+ xs: string;
298
+ sm: string;
299
+ md: string;
300
+ lg: string;
301
+ xl: string;
302
+ xxl: string;
303
+ xxxl: string;
304
+ }
305
+ interface ShapeConfig {
306
+ radii: RadiiScale;
307
+ style: 'sharp' | 'rounded' | 'soft' | 'organic';
308
+ }
309
+ interface RadiiScale {
310
+ none: string;
311
+ extraSmall: string;
312
+ small: string;
313
+ medium: string;
314
+ large: string;
315
+ extraLarge: string;
316
+ full: string;
317
+ }
318
+ interface ElevationConfig {
319
+ levels: ElevationScale;
320
+ style: 'shadow' | 'border' | 'blur' | 'flat';
321
+ }
322
+ interface ElevationScale {
323
+ level0: string;
324
+ level1: string;
325
+ level2: string;
326
+ level3: string;
327
+ level4: string;
328
+ level5: string;
329
+ }
330
+ interface MotionConfig {
331
+ durations: DurationScale;
332
+ easings: EasingScale;
333
+ style: 'expressive' | 'productive' | 'minimal';
334
+ }
335
+ interface DurationScale {
336
+ instant: string;
337
+ fast: string;
338
+ normal: string;
339
+ slow: string;
340
+ slower: string;
341
+ }
342
+ interface EasingScale {
343
+ standard: string;
344
+ standardDecelerate: string;
345
+ standardAccelerate: string;
346
+ emphasized: string;
347
+ emphasizedDecelerate: string;
348
+ emphasizedAccelerate: string;
349
+ }
350
+
351
+ /**
352
+ * Material Design 3 Language Implementation
353
+ *
354
+ * Source color: #63A002 (TastyMakers green)
355
+ * Generated via Material Theme Builder plugin 2024-12-24
356
+ */
357
+ declare const material3Language: DesignLanguageContract;
358
+
359
+ /**
360
+ * Transforms a DesignLanguageContract into Panda CSS theme configuration
361
+ */
362
+ declare function transformToPandaTheme(language: DesignLanguageContract): {
363
+ tokens: {
364
+ colors: {
365
+ [k: string]: {
366
+ [k: string]: {
367
+ value: any;
368
+ };
369
+ };
370
+ };
371
+ fonts: {
372
+ display: {
373
+ value: string;
374
+ };
375
+ body: {
376
+ value: string;
377
+ };
378
+ mono: {
379
+ value: string;
380
+ };
381
+ };
382
+ fontSizes: {
383
+ [k: string]: {
384
+ value: string;
385
+ };
386
+ };
387
+ lineHeights: {
388
+ [k: string]: {
389
+ value: string;
390
+ };
391
+ };
392
+ fontWeights: {
393
+ [k: string]: {
394
+ value: string;
395
+ };
396
+ };
397
+ letterSpacings: {
398
+ [k: string]: {
399
+ value: string;
400
+ };
401
+ };
402
+ spacing: {
403
+ [k: string]: {
404
+ value: string;
405
+ };
406
+ };
407
+ radii: {
408
+ [k: string]: {
409
+ value: string;
410
+ };
411
+ };
412
+ shadows: {
413
+ [k: string]: {
414
+ value: string;
415
+ };
416
+ };
417
+ durations: {
418
+ [k: string]: {
419
+ value: string;
420
+ };
421
+ };
422
+ easings: {
423
+ [k: string]: {
424
+ value: string;
425
+ };
426
+ };
427
+ };
428
+ semanticTokens: {
429
+ colors: {
430
+ [k: string]: {
431
+ value: {
432
+ base: any;
433
+ _dark: any;
434
+ };
435
+ };
436
+ };
437
+ };
438
+ textStyles: {
439
+ [k: string]: {
440
+ value: {
441
+ fontFamily: any;
442
+ fontSize: any;
443
+ lineHeight: any;
444
+ fontWeight: any;
445
+ letterSpacing: any;
446
+ };
447
+ };
448
+ };
449
+ };
450
+
451
+ /**
452
+ * Utility function to merge class names
453
+ */
454
+ declare function cn(...inputs: ClassValue[]): string;
455
+
456
+ export { Button, type ButtonProps, Card, type CardProps, type ColorPalettes, type DesignLanguageContract, Dialog, type DialogProps, type DurationScale, type EasingScale, type ElevationConfig, type ElevationScale, IconButton, type IconButtonProps, Input, type InputProps, type MotionConfig, type RadiiScale, type SemanticColors, type ShapeConfig, type SpacingScale, Switch, type SwitchProps, type TonalPalette, type TypeStyle, type TypographyConfig, type TypographyScale, material3Language as activeLanguage, buttonRecipe, cardRecipe, cn, dialogRecipe, iconButtonRecipe, inputRecipe, switchRecipe, transformToPandaTheme };