@discourser/design-system 0.9.3 → 0.9.4

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 (268) hide show
  1. package/dist/components/AbsoluteCenter.d.ts +4 -0
  2. package/dist/components/AbsoluteCenter.d.ts.map +1 -0
  3. package/dist/components/Accordion.d.ts +12 -0
  4. package/dist/components/Accordion.d.ts.map +1 -0
  5. package/dist/components/Avatar.d.ts +17 -0
  6. package/dist/components/Avatar.d.ts.map +1 -0
  7. package/dist/components/Badge.d.ts +13 -0
  8. package/dist/components/Badge.d.ts.map +1 -0
  9. package/dist/components/Button.d.ts +39 -0
  10. package/dist/components/Button.d.ts.map +1 -0
  11. package/dist/components/Card.d.ts +17 -0
  12. package/dist/components/Card.d.ts.map +1 -0
  13. package/dist/components/Checkbox.d.ts +507 -0
  14. package/dist/components/Checkbox.d.ts.map +1 -0
  15. package/dist/components/CloseButton.d.ts +4 -0
  16. package/dist/components/CloseButton.d.ts.map +1 -0
  17. package/dist/components/Dialog.d.ts +16 -0
  18. package/dist/components/Dialog.d.ts.map +1 -0
  19. package/dist/components/Drawer.d.ts +17 -0
  20. package/dist/components/Drawer.d.ts.map +1 -0
  21. package/dist/components/Group.d.ts +4 -0
  22. package/dist/components/Group.d.ts.map +1 -0
  23. package/dist/components/Heading.d.ts +10 -0
  24. package/dist/components/Heading.d.ts.map +1 -0
  25. package/dist/components/Icon.d.ts +4 -0
  26. package/dist/components/Icon.d.ts.map +1 -0
  27. package/dist/components/IconButton.d.ts +5 -0
  28. package/dist/components/IconButton.d.ts.map +1 -0
  29. package/dist/components/Input.d.ts +5 -0
  30. package/dist/components/Input.d.ts.map +1 -0
  31. package/dist/components/InputAddon.d.ts +4 -0
  32. package/dist/components/InputAddon.d.ts.map +1 -0
  33. package/dist/components/InputGroup.d.ts +14 -0
  34. package/dist/components/InputGroup.d.ts.map +1 -0
  35. package/dist/components/Loader.d.ts +25 -0
  36. package/dist/components/Loader.d.ts.map +1 -0
  37. package/dist/components/Popover.d.ts +20 -0
  38. package/dist/components/Popover.d.ts.map +1 -0
  39. package/dist/components/Progress.d.ts +14 -0
  40. package/dist/components/Progress.d.ts.map +1 -0
  41. package/dist/components/RadioGroup.d.ts +14 -0
  42. package/dist/components/RadioGroup.d.ts.map +1 -0
  43. package/dist/components/Select.d.ts +26 -0
  44. package/dist/components/Select.d.ts.map +1 -0
  45. package/dist/components/Skeleton.d.ts +16 -0
  46. package/dist/components/Skeleton.d.ts.map +1 -0
  47. package/dist/components/Slider.d.ts +34 -0
  48. package/dist/components/Slider.d.ts.map +1 -0
  49. package/dist/components/Spinner.d.ts +4 -0
  50. package/dist/components/Spinner.d.ts.map +1 -0
  51. package/dist/components/Switch.d.ts +10 -0
  52. package/dist/components/Switch.d.ts.map +1 -0
  53. package/dist/components/Tabs.d.ts +11 -0
  54. package/dist/components/Tabs.d.ts.map +1 -0
  55. package/dist/components/Textarea.d.ts +5 -0
  56. package/dist/components/Textarea.d.ts.map +1 -0
  57. package/dist/components/Toast.d.ts +4 -0
  58. package/dist/components/Toast.d.ts.map +1 -0
  59. package/dist/components/Tooltip.d.ts +19 -0
  60. package/dist/components/Tooltip.d.ts.map +1 -0
  61. package/dist/components/index.d.ts +30 -0
  62. package/dist/components/index.d.ts.map +1 -0
  63. package/dist/contracts/design-language.contract.d.ts +175 -0
  64. package/dist/contracts/design-language.contract.d.ts.map +1 -0
  65. package/dist/index.d.ts +7 -21506
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/languages/index.d.ts +4 -0
  68. package/dist/languages/index.d.ts.map +1 -0
  69. package/dist/languages/material3.language.d.ts +9 -0
  70. package/dist/languages/material3.language.d.ts.map +1 -0
  71. package/dist/languages/transform.d.ts +98 -0
  72. package/dist/languages/transform.d.ts.map +1 -0
  73. package/dist/main.d.ts +2 -0
  74. package/dist/main.d.ts.map +1 -0
  75. package/dist/preset/colors/index.d.ts +1485 -0
  76. package/dist/preset/colors/index.d.ts.map +1 -0
  77. package/dist/preset/colors/m3-error.d.ts +295 -0
  78. package/dist/preset/colors/m3-error.d.ts.map +1 -0
  79. package/dist/preset/colors/m3-neutral.d.ts +301 -0
  80. package/dist/preset/colors/m3-neutral.d.ts.map +1 -0
  81. package/dist/preset/colors/m3-primary.d.ts +312 -0
  82. package/dist/preset/colors/m3-primary.d.ts.map +1 -0
  83. package/dist/preset/index.d.ts +3 -0
  84. package/dist/preset/index.d.ts.map +1 -0
  85. package/dist/preset/layer-styles.d.ts +6 -0
  86. package/dist/preset/layer-styles.d.ts.map +1 -0
  87. package/dist/preset/recipes/absolute-center.d.ts +2 -0
  88. package/dist/preset/recipes/absolute-center.d.ts.map +1 -0
  89. package/dist/preset/recipes/accordion.d.ts +2 -0
  90. package/dist/preset/recipes/accordion.d.ts.map +1 -0
  91. package/dist/preset/recipes/avatar.d.ts +2 -0
  92. package/dist/preset/recipes/avatar.d.ts.map +1 -0
  93. package/dist/preset/recipes/badge.d.ts +2 -0
  94. package/dist/preset/recipes/badge.d.ts.map +1 -0
  95. package/dist/preset/recipes/button.d.ts +2 -0
  96. package/dist/preset/recipes/button.d.ts.map +1 -0
  97. package/dist/preset/recipes/card.d.ts +2 -0
  98. package/dist/preset/recipes/card.d.ts.map +1 -0
  99. package/dist/preset/recipes/checkbox.d.ts +2 -0
  100. package/dist/preset/recipes/checkbox.d.ts.map +1 -0
  101. package/dist/preset/recipes/dialog.d.ts +2 -0
  102. package/dist/preset/recipes/dialog.d.ts.map +1 -0
  103. package/dist/preset/recipes/drawer.d.ts +2 -0
  104. package/dist/preset/recipes/drawer.d.ts.map +1 -0
  105. package/dist/preset/recipes/field.d.ts +2 -0
  106. package/dist/preset/recipes/field.d.ts.map +1 -0
  107. package/dist/preset/recipes/group.d.ts +2 -0
  108. package/dist/preset/recipes/group.d.ts.map +1 -0
  109. package/dist/preset/recipes/heading.d.ts +2 -0
  110. package/dist/preset/recipes/heading.d.ts.map +1 -0
  111. package/dist/preset/recipes/index.d.ts +28 -0
  112. package/dist/preset/recipes/index.d.ts.map +1 -0
  113. package/dist/preset/recipes/input-addon.d.ts +2 -0
  114. package/dist/preset/recipes/input-addon.d.ts.map +1 -0
  115. package/dist/preset/recipes/input-group.d.ts +2 -0
  116. package/dist/preset/recipes/input-group.d.ts.map +1 -0
  117. package/dist/preset/recipes/input.d.ts +114 -0
  118. package/dist/preset/recipes/input.d.ts.map +1 -0
  119. package/dist/preset/recipes/popover.d.ts +2 -0
  120. package/dist/preset/recipes/popover.d.ts.map +1 -0
  121. package/dist/preset/recipes/progress.d.ts +2 -0
  122. package/dist/preset/recipes/progress.d.ts.map +1 -0
  123. package/dist/preset/recipes/radio-group.d.ts +2 -0
  124. package/dist/preset/recipes/radio-group.d.ts.map +1 -0
  125. package/dist/preset/recipes/select.d.ts +2 -0
  126. package/dist/preset/recipes/select.d.ts.map +1 -0
  127. package/dist/preset/recipes/skeleton.d.ts +2 -0
  128. package/dist/preset/recipes/skeleton.d.ts.map +1 -0
  129. package/dist/preset/recipes/slider.d.ts +2 -0
  130. package/dist/preset/recipes/slider.d.ts.map +1 -0
  131. package/dist/preset/recipes/spinner.d.ts +2 -0
  132. package/dist/preset/recipes/spinner.d.ts.map +1 -0
  133. package/dist/preset/recipes/switch.d.ts +2 -0
  134. package/dist/preset/recipes/switch.d.ts.map +1 -0
  135. package/dist/preset/recipes/tabs.d.ts +2 -0
  136. package/dist/preset/recipes/tabs.d.ts.map +1 -0
  137. package/dist/preset/recipes/textarea.d.ts +2 -0
  138. package/dist/preset/recipes/textarea.d.ts.map +1 -0
  139. package/dist/preset/recipes/toast.d.ts +2 -0
  140. package/dist/preset/recipes/toast.d.ts.map +1 -0
  141. package/dist/preset/recipes/tooltip.d.ts +2 -0
  142. package/dist/preset/recipes/tooltip.d.ts.map +1 -0
  143. package/dist/preset/semantic-tokens.d.ts +197 -0
  144. package/dist/preset/semantic-tokens.d.ts.map +1 -0
  145. package/dist/preset/shadows.d.ts +49 -0
  146. package/dist/preset/shadows.d.ts.map +1 -0
  147. package/dist/preset/text-styles.d.ts +6 -0
  148. package/dist/preset/text-styles.d.ts.map +1 -0
  149. package/dist/recipes/button.recipe.d.ts +2 -0
  150. package/dist/recipes/button.recipe.d.ts.map +1 -0
  151. package/dist/recipes/card.recipe.d.ts +2 -0
  152. package/dist/recipes/card.recipe.d.ts.map +1 -0
  153. package/dist/recipes/dialog.recipe.d.ts +2 -0
  154. package/dist/recipes/dialog.recipe.d.ts.map +1 -0
  155. package/dist/recipes/icon-button.recipe.d.ts +2 -0
  156. package/dist/recipes/icon-button.recipe.d.ts.map +1 -0
  157. package/dist/recipes/index.d.ts +7 -0
  158. package/dist/recipes/index.d.ts.map +1 -0
  159. package/dist/recipes/input.recipe.d.ts +2 -0
  160. package/dist/recipes/input.recipe.d.ts.map +1 -0
  161. package/dist/recipes/switch.recipe.d.ts +2 -0
  162. package/dist/recipes/switch.recipe.d.ts.map +1 -0
  163. package/dist/stories/foundations/components/ColorSwatch.d.ts +21 -0
  164. package/dist/stories/foundations/components/ColorSwatch.d.ts.map +1 -0
  165. package/dist/stories/foundations/components/ElevationCard.d.ts +11 -0
  166. package/dist/stories/foundations/components/ElevationCard.d.ts.map +1 -0
  167. package/dist/stories/foundations/components/SpacingBox.d.ts +11 -0
  168. package/dist/stories/foundations/components/SpacingBox.d.ts.map +1 -0
  169. package/dist/stories/foundations/components/TypeSpecimen.d.ts +12 -0
  170. package/dist/stories/foundations/components/TypeSpecimen.d.ts.map +1 -0
  171. package/dist/utils/cn.d.ts +6 -0
  172. package/dist/utils/cn.d.ts.map +1 -0
  173. package/package.json +4 -2
  174. package/src/components/AbsoluteCenter.tsx +7 -0
  175. package/src/components/Accordion.tsx +27 -0
  176. package/src/components/Avatar.tsx +55 -0
  177. package/src/components/Badge.tsx +29 -0
  178. package/src/components/Button.tsx +116 -0
  179. package/src/components/Card.tsx +24 -0
  180. package/src/components/Checkbox.tsx +48 -0
  181. package/src/components/CloseButton.tsx +21 -0
  182. package/src/components/Dialog.tsx +25 -0
  183. package/src/components/Drawer.tsx +29 -0
  184. package/src/components/Group.tsx +7 -0
  185. package/src/components/Heading.tsx +9 -0
  186. package/src/components/Icon.tsx +6 -0
  187. package/src/components/IconButton.tsx +10 -0
  188. package/src/components/Input.tsx +7 -0
  189. package/src/components/InputAddon.tsx +7 -0
  190. package/src/components/InputGroup.tsx +44 -0
  191. package/src/components/Loader.tsx +71 -0
  192. package/src/components/Popover.tsx +34 -0
  193. package/src/components/Progress.tsx +19 -0
  194. package/src/components/RadioGroup.tsx +21 -0
  195. package/src/components/Select.tsx +70 -0
  196. package/src/components/Skeleton.tsx +37 -0
  197. package/src/components/Slider.tsx +156 -0
  198. package/src/components/Spinner.tsx +7 -0
  199. package/src/components/Switch.tsx +19 -0
  200. package/src/components/Tabs.tsx +17 -0
  201. package/src/components/Textarea.tsx +7 -0
  202. package/src/components/Toast.tsx +96 -0
  203. package/src/components/Tooltip.tsx +65 -0
  204. package/src/components/index.ts +48 -0
  205. package/src/contracts/design-language.contract.ts +198 -0
  206. package/src/global.css +4 -0
  207. package/src/index.ts +18 -0
  208. package/src/languages/index.ts +9 -0
  209. package/src/languages/material3.language.ts +379 -0
  210. package/src/languages/transform.ts +131 -0
  211. package/src/main.ts +33 -0
  212. package/src/preset/colors/index.ts +14 -0
  213. package/src/preset/colors/m3-error.ts +76 -0
  214. package/src/preset/colors/m3-neutral.ts +89 -0
  215. package/src/preset/colors/m3-primary.ts +107 -0
  216. package/src/preset/index.ts +189 -0
  217. package/src/preset/layer-styles.ts +14 -0
  218. package/src/preset/recipes/absolute-center.ts +37 -0
  219. package/src/preset/recipes/accordion.ts +92 -0
  220. package/src/preset/recipes/avatar.ts +152 -0
  221. package/src/preset/recipes/badge.ts +49 -0
  222. package/src/preset/recipes/button.ts +110 -0
  223. package/src/preset/recipes/card.ts +69 -0
  224. package/src/preset/recipes/checkbox.ts +109 -0
  225. package/src/preset/recipes/dialog.ts +157 -0
  226. package/src/preset/recipes/drawer.ts +203 -0
  227. package/src/preset/recipes/field.ts +40 -0
  228. package/src/preset/recipes/group.ts +77 -0
  229. package/src/preset/recipes/heading.ts +26 -0
  230. package/src/preset/recipes/index.ts +40 -0
  231. package/src/preset/recipes/input-addon.ts +42 -0
  232. package/src/preset/recipes/input-group.ts +66 -0
  233. package/src/preset/recipes/input.ts +87 -0
  234. package/src/preset/recipes/popover.ts +77 -0
  235. package/src/preset/recipes/progress.ts +120 -0
  236. package/src/preset/recipes/radio-group.ts +99 -0
  237. package/src/preset/recipes/select.ts +175 -0
  238. package/src/preset/recipes/skeleton.ts +64 -0
  239. package/src/preset/recipes/slider.ts +174 -0
  240. package/src/preset/recipes/spinner.ts +33 -0
  241. package/src/preset/recipes/switch.ts +136 -0
  242. package/src/preset/recipes/tabs.ts +177 -0
  243. package/src/preset/recipes/textarea.ts +82 -0
  244. package/src/preset/recipes/toast.ts +51 -0
  245. package/src/preset/recipes/tooltip.ts +38 -0
  246. package/src/preset/semantic-tokens.ts +75 -0
  247. package/src/preset/shadows.ts +50 -0
  248. package/src/preset/text-styles.ts +21 -0
  249. package/src/recipes/button.recipe.ts +120 -0
  250. package/src/recipes/card.recipe.ts +50 -0
  251. package/src/recipes/dialog.recipe.ts +130 -0
  252. package/src/recipes/icon-button.recipe.ts +96 -0
  253. package/src/recipes/index.ts +6 -0
  254. package/src/recipes/input.recipe.ts +93 -0
  255. package/src/recipes/switch.recipe.ts +117 -0
  256. package/src/stories/foundations/Colors.mdx +380 -0
  257. package/src/stories/foundations/Elevation.mdx +292 -0
  258. package/src/stories/foundations/Spacing.mdx +223 -0
  259. package/src/stories/foundations/Typography.mdx +264 -0
  260. package/src/stories/foundations/components/ColorSwatch.tsx +166 -0
  261. package/src/stories/foundations/components/ElevationCard.tsx +81 -0
  262. package/src/stories/foundations/components/SpacingBox.tsx +94 -0
  263. package/src/stories/foundations/components/TypeSpecimen.tsx +117 -0
  264. package/src/test/setup.ts +12 -0
  265. package/src/test/vitest.d.ts +29 -0
  266. package/src/utils/cn.ts +8 -0
  267. package/src/vite-env.d.ts +1 -0
  268. package/dist/index.d.cts +0 -21506
@@ -0,0 +1,89 @@
1
+ import { defineSemanticTokens } from '@pandacss/dev';
2
+ import { material3Language } from '../../languages/material3.language';
3
+
4
+ const m3 = material3Language.colors.neutral;
5
+
6
+ export const neutral = defineSemanticTokens.colors({
7
+ '1': { value: { base: m3[99], _dark: m3[10] } },
8
+ '2': { value: { base: m3[95], _dark: m3[20] } },
9
+ '3': { value: { base: m3[90], _dark: m3[20] } },
10
+ '4': { value: { base: m3[80], _dark: m3[30] } },
11
+ '5': { value: { base: m3[70], _dark: m3[30] } },
12
+ '6': { value: { base: m3[60], _dark: m3[40] } },
13
+ '7': { value: { base: m3[50], _dark: m3[50] } },
14
+ '8': { value: { base: m3[40], _dark: m3[60] } },
15
+ '9': { value: { base: m3[40], _dark: m3[60] } },
16
+ '10': { value: { base: m3[30], _dark: m3[70] } },
17
+ '11': { value: { base: m3[30], _dark: m3[80] } },
18
+ '12': { value: { base: m3[10], _dark: m3[90] } },
19
+
20
+ // Alpha variants
21
+ a1: { value: { base: '#00000003', _dark: '#ffffff05' } },
22
+ a2: { value: { base: '#00000006', _dark: '#ffffff09' } },
23
+ a3: { value: { base: '#0000000f', _dark: '#ffffff12' } },
24
+ a4: { value: { base: '#00000017', _dark: '#ffffff1b' } },
25
+ a5: { value: { base: '#0000001f', _dark: '#ffffff22' } },
26
+ a6: { value: { base: '#00000026', _dark: '#ffffff2c' } },
27
+ a7: { value: { base: '#00000031', _dark: '#ffffff3b' } },
28
+ a8: { value: { base: '#00000044', _dark: '#ffffff55' } },
29
+ a9: { value: { base: '#00000072', _dark: '#ffffff64' } },
30
+ a10: { value: { base: '#0000007c', _dark: '#ffffff72' } },
31
+ a11: { value: { base: '#0000009b', _dark: '#ffffffaf' } },
32
+ a12: { value: { base: '#000000df', _dark: '#ffffffed' } },
33
+
34
+ // Semantic variants
35
+ solid: {
36
+ bg: {
37
+ DEFAULT: { value: { base: '{colors.black}', _dark: '{colors.white}' } },
38
+ hover: { value: { base: '{colors.neutral.12}', _dark: '{colors.neutral.12}' } },
39
+ },
40
+ fg: {
41
+ DEFAULT: { value: { base: '{colors.white}', _dark: '{colors.black}' } }
42
+ },
43
+ },
44
+ subtle: {
45
+ bg: {
46
+ DEFAULT: { value: { base: '{colors.neutral.a3}', _dark: '{colors.neutral.a3}' } },
47
+ hover: { value: { base: '{colors.neutral.a4}', _dark: '{colors.neutral.a4}' } },
48
+ active: { value: { base: '{colors.neutral.a5}', _dark: '{colors.neutral.a5}' } },
49
+ },
50
+ fg: {
51
+ DEFAULT: { value: { base: '{colors.neutral.12}', _dark: '{colors.neutral.12}' } }
52
+ },
53
+ },
54
+ surface: {
55
+ bg: {
56
+ DEFAULT: { value: { base: '{colors.white}', _dark: '{colors.neutral.1}' } },
57
+ hover: { value: { base: '{colors.neutral.2}', _dark: '{colors.neutral.2}' } },
58
+ active: { value: { base: '{colors.neutral.3}', _dark: '{colors.neutral.3}' } },
59
+ },
60
+ border: {
61
+ DEFAULT: { value: { base: '{colors.neutral.6}', _dark: '{colors.neutral.6}' } },
62
+ hover: { value: { base: '{colors.neutral.7}', _dark: '{colors.neutral.7}' } },
63
+ },
64
+ fg: {
65
+ DEFAULT: { value: { base: '{colors.neutral.12}', _dark: '{colors.neutral.12}' } }
66
+ },
67
+ },
68
+ outline: {
69
+ bg: {
70
+ hover: { value: { base: '{colors.neutral.a2}', _dark: '{colors.neutral.a2}' } },
71
+ active: { value: { base: '{colors.neutral.a3}', _dark: '{colors.neutral.a3}' } },
72
+ },
73
+ border: {
74
+ DEFAULT: { value: { base: '{colors.neutral.6}', _dark: '{colors.neutral.6}' } }
75
+ },
76
+ fg: {
77
+ DEFAULT: { value: { base: '{colors.neutral.12}', _dark: '{colors.neutral.12}' } }
78
+ },
79
+ },
80
+ plain: {
81
+ bg: {
82
+ hover: { value: { base: '{colors.neutral.a3}', _dark: '{colors.neutral.a3}' } },
83
+ active: { value: { base: '{colors.neutral.a4}', _dark: '{colors.neutral.a4}' } },
84
+ },
85
+ fg: {
86
+ DEFAULT: { value: { base: '{colors.neutral.12}', _dark: '{colors.neutral.12}' } }
87
+ },
88
+ },
89
+ });
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Material 3 Primary Color → Park UI Radix Scale
3
+ *
4
+ * Mapping Strategy:
5
+ * - Radix 1-12 represents light → dark in light mode
6
+ * - M3 tonal palette 100 → 0 (white to black)
7
+ *
8
+ * Radix Scale Semantics:
9
+ * 1-2: App background
10
+ * 3-4: Subtle backgrounds
11
+ * 5-6: UI element backgrounds
12
+ * 7-8: Borders and separators
13
+ * 9: Solid backgrounds (primary action color)
14
+ * 10: Hovered solid backgrounds
15
+ * 11: Low-contrast text
16
+ * 12: High-contrast text
17
+ */
18
+
19
+ import { defineSemanticTokens } from '@pandacss/dev';
20
+ import { material3Language } from '../../languages/material3.language';
21
+
22
+ const m3 = material3Language.colors.primary;
23
+
24
+ export const primary = defineSemanticTokens.colors({
25
+ // Base scale mapping M3 tonal to Radix
26
+ '1': { value: { base: m3[99], _dark: m3[10] } },
27
+ '2': { value: { base: m3[95], _dark: m3[20] } },
28
+ '3': { value: { base: m3[90], _dark: m3[30] } },
29
+ '4': { value: { base: m3[80], _dark: m3[30] } },
30
+ '5': { value: { base: m3[70], _dark: m3[40] } },
31
+ '6': { value: { base: m3[60], _dark: m3[40] } },
32
+ '7': { value: { base: m3[50], _dark: m3[50] } },
33
+ '8': { value: { base: m3[40], _dark: m3[60] } },
34
+ '9': { value: { base: m3[40], _dark: m3[80] } }, // Primary action color
35
+ '10': { value: { base: m3[30], _dark: m3[70] } }, // Hover state
36
+ '11': { value: { base: m3[30], _dark: m3[90] } }, // Low-contrast text
37
+ '12': { value: { base: m3[10], _dark: m3[95] } }, // High-contrast text
38
+
39
+ // Alpha variants (for overlays/transparency)
40
+ a1: { value: { base: `${m3[40]}08`, _dark: `${m3[80]}08` } },
41
+ a2: { value: { base: `${m3[40]}10`, _dark: `${m3[80]}10` } },
42
+ a3: { value: { base: `${m3[40]}18`, _dark: `${m3[80]}18` } },
43
+ a4: { value: { base: `${m3[40]}24`, _dark: `${m3[80]}24` } },
44
+ a5: { value: { base: `${m3[40]}32`, _dark: `${m3[80]}32` } },
45
+ a6: { value: { base: `${m3[40]}48`, _dark: `${m3[80]}48` } },
46
+ a7: { value: { base: `${m3[40]}64`, _dark: `${m3[80]}64` } },
47
+ a8: { value: { base: `${m3[40]}80`, _dark: `${m3[80]}80` } },
48
+ a9: { value: { base: `${m3[40]}96`, _dark: `${m3[80]}96` } },
49
+ a10: { value: { base: `${m3[40]}AA`, _dark: `${m3[80]}AA` } },
50
+ a11: { value: { base: `${m3[40]}CC`, _dark: `${m3[80]}CC` } },
51
+ a12: { value: { base: `${m3[40]}EE`, _dark: `${m3[80]}EE` } },
52
+
53
+ // Semantic variants (Park UI component styling)
54
+ solid: {
55
+ bg: {
56
+ DEFAULT: { value: { base: '{colors.primary.9}', _dark: '{colors.primary.9}' } },
57
+ hover: { value: { base: '{colors.primary.10}', _dark: '{colors.primary.10}' } },
58
+ },
59
+ fg: {
60
+ DEFAULT: { value: { base: '{colors.white}', _dark: '{colors.primary.1}' } }
61
+ },
62
+ },
63
+ subtle: {
64
+ bg: {
65
+ DEFAULT: { value: { base: '{colors.primary.a3}', _dark: '{colors.primary.a3}' } },
66
+ hover: { value: { base: '{colors.primary.a4}', _dark: '{colors.primary.a4}' } },
67
+ active: { value: { base: '{colors.primary.a5}', _dark: '{colors.primary.a5}' } },
68
+ },
69
+ fg: {
70
+ DEFAULT: { value: { base: '{colors.primary.a11}', _dark: '{colors.primary.a11}' } }
71
+ },
72
+ },
73
+ surface: {
74
+ bg: {
75
+ DEFAULT: { value: { base: '{colors.primary.a2}', _dark: '{colors.primary.a2}' } },
76
+ active: { value: { base: '{colors.primary.a3}', _dark: '{colors.primary.a3}' } },
77
+ },
78
+ border: {
79
+ DEFAULT: { value: { base: '{colors.primary.a6}', _dark: '{colors.primary.a6}' } },
80
+ hover: { value: { base: '{colors.primary.a7}', _dark: '{colors.primary.a7}' } },
81
+ },
82
+ fg: {
83
+ DEFAULT: { value: { base: '{colors.primary.a11}', _dark: '{colors.primary.a11}' } }
84
+ },
85
+ },
86
+ outline: {
87
+ bg: {
88
+ hover: { value: { base: '{colors.primary.a2}', _dark: '{colors.primary.a2}' } },
89
+ active: { value: { base: '{colors.primary.a3}', _dark: '{colors.primary.a3}' } },
90
+ },
91
+ border: {
92
+ DEFAULT: { value: { base: '{colors.primary.a7}', _dark: '{colors.primary.a7}' } }
93
+ },
94
+ fg: {
95
+ DEFAULT: { value: { base: '{colors.primary.a11}', _dark: '{colors.primary.a11}' } }
96
+ },
97
+ },
98
+ plain: {
99
+ bg: {
100
+ hover: { value: { base: '{colors.primary.a3}', _dark: '{colors.primary.a3}' } },
101
+ active: { value: { base: '{colors.primary.a4}', _dark: '{colors.primary.a4}' } },
102
+ },
103
+ fg: {
104
+ DEFAULT: { value: { base: '{colors.primary.a11}', _dark: '{colors.primary.a11}' } }
105
+ },
106
+ },
107
+ });
@@ -0,0 +1,189 @@
1
+ import type { Preset } from '@pandacss/dev';
2
+ import { activeLanguage, transformToPandaTheme } from '../languages';
3
+ import { colors as m3Colors } from './colors';
4
+ import { m3SemanticTokens } from './semantic-tokens';
5
+
6
+ // Park UI recipes - Core
7
+ import { button as parkButton } from './recipes/button';
8
+ import { input as parkInput } from './recipes/input';
9
+ import { inputAddon } from './recipes/input-addon';
10
+ import { inputGroup } from './recipes/input-group';
11
+ import { field as parkField } from './recipes/field';
12
+ import { group } from './recipes/group';
13
+ import { spinner } from './recipes/spinner';
14
+ import { absoluteCenter } from './recipes/absolute-center';
15
+
16
+ // Park UI recipes - Layout & Containers
17
+ import { card as parkCard } from './recipes/card';
18
+ import { accordion } from './recipes/accordion';
19
+ import { drawer } from './recipes/drawer';
20
+ import { tabs } from './recipes/tabs';
21
+
22
+ // Park UI recipes - Form Elements
23
+ import { switchRecipe } from './recipes/switch';
24
+ import { checkbox } from './recipes/checkbox';
25
+ import { radioGroup } from './recipes/radio-group';
26
+ import { select } from './recipes/select';
27
+ import { textarea } from './recipes/textarea';
28
+ import { slider } from './recipes/slider';
29
+
30
+ // Park UI recipes - Feedback & Status
31
+ import { avatar } from './recipes/avatar';
32
+ import { badge } from './recipes/badge';
33
+ import { progress } from './recipes/progress';
34
+ import { skeleton } from './recipes/skeleton';
35
+ import { toast } from './recipes/toast';
36
+
37
+ // Park UI recipes - Overlays
38
+ import { dialog } from './recipes/dialog';
39
+ import { popover } from './recipes/popover';
40
+ import { tooltip } from './recipes/tooltip';
41
+
42
+ // Park UI recipes - Typography
43
+ import { heading } from './recipes/heading';
44
+ // Park UI theme extensions
45
+ import { layerStyles } from './layer-styles';
46
+ import { textStyles as parkTextStyles } from './text-styles';
47
+ import { shadows as parkShadows } from './shadows';
48
+
49
+ const theme = transformToPandaTheme(activeLanguage);
50
+
51
+ export const discourserPandaPreset: Preset = {
52
+ name: 'discourser-design-system-preset',
53
+
54
+ theme: {
55
+ extend: {
56
+ // Add M3 tokens to Panda preset (colors, fonts, spacing, etc.)
57
+ tokens: {
58
+ colors: theme.tokens.colors,
59
+ fonts: theme.tokens.fonts,
60
+ fontSizes: theme.tokens.fontSizes,
61
+ lineHeights: theme.tokens.lineHeights,
62
+ fontWeights: theme.tokens.fontWeights,
63
+ letterSpacings: theme.tokens.letterSpacings,
64
+ spacing: theme.tokens.spacing,
65
+ radii: theme.tokens.radii,
66
+ shadows: theme.tokens.shadows,
67
+ durations: theme.tokens.durations,
68
+ easings: theme.tokens.easings,
69
+ borderWidths: theme.tokens.borderWidths,
70
+ },
71
+
72
+ // Park UI layer styles for common UI patterns (disabled, etc.)
73
+ layerStyles,
74
+
75
+ // Combined text styles: M3 + Park UI
76
+ textStyles: {
77
+ ...theme.textStyles,
78
+ ...parkTextStyles,
79
+ },
80
+
81
+ // Semantic tokens: M3 colors + Park UI aliases + shadows + radii
82
+ semanticTokens: {
83
+ colors: {
84
+ // M3-to-Radix color bridges
85
+ ...m3Colors,
86
+
87
+ // Park UI-style aliases for component compatibility
88
+ fg: {
89
+ default: {
90
+ value: { base: '{colors.gray.12}', _dark: '{colors.gray.12}' },
91
+ },
92
+ muted: {
93
+ value: { base: '{colors.gray.11}', _dark: '{colors.gray.11}' },
94
+ },
95
+ subtle: {
96
+ value: { base: '{colors.gray.10}', _dark: '{colors.gray.10}' },
97
+ },
98
+ },
99
+ canvas: {
100
+ value: { base: '{colors.gray.1}', _dark: '{colors.gray.1}' },
101
+ },
102
+ border: {
103
+ default: {
104
+ value: { base: '{colors.gray.6}', _dark: '{colors.gray.6}' },
105
+ },
106
+ muted: {
107
+ value: { base: '{colors.gray.4}', _dark: '{colors.gray.4}' },
108
+ },
109
+ },
110
+
111
+ // M3 semantic tokens (surface, onSurface, etc.)
112
+ ...m3SemanticTokens,
113
+
114
+ // Base colors
115
+ white: { value: '#FFFFFF' },
116
+ black: { value: '#000000' },
117
+ },
118
+
119
+ // Park UI shadow tokens
120
+ shadows: parkShadows,
121
+
122
+ // Park UI radii tokens (l1, l2, l3 for consistent border radius)
123
+ radii: {
124
+ l1: { value: '0.125rem' }, // 2px (xs)
125
+ l2: { value: '0.375rem' }, // 6px (sm)
126
+ l3: { value: '0.5rem' }, // 8px (md)
127
+ },
128
+ },
129
+
130
+ // Recipes: Park UI components (simple recipes)
131
+ recipes: {
132
+ // Core
133
+ button: parkButton,
134
+ input: parkInput,
135
+ inputAddon,
136
+ group,
137
+ spinner,
138
+ absoluteCenter,
139
+ // Typography
140
+ heading,
141
+ // Feedback & Status
142
+ badge,
143
+ skeleton,
144
+ textarea,
145
+ },
146
+ slotRecipes: {
147
+ // Core
148
+ field: parkField,
149
+ inputGroup,
150
+ // Layout & Containers
151
+ card: parkCard,
152
+ accordion,
153
+ drawer,
154
+ tabs,
155
+ // Form Elements
156
+ switchComponent: switchRecipe,
157
+ checkbox,
158
+ radioGroup,
159
+ select,
160
+ slider,
161
+ // Feedback & Status
162
+ avatar,
163
+ progress,
164
+ toast,
165
+ // Overlays
166
+ dialog,
167
+ popover,
168
+ tooltip,
169
+ },
170
+ },
171
+ },
172
+
173
+ conditions: {
174
+ light: '[data-theme=light] &, .light &',
175
+ dark: '[data-theme=dark] &, .dark &',
176
+ },
177
+
178
+ globalCss: {
179
+ html: {
180
+ colorScheme: 'light dark',
181
+ bg: 'canvas',
182
+ color: 'fg.default',
183
+ },
184
+ body: {
185
+ fontFamily: 'body',
186
+ textStyle: 'bodyMedium',
187
+ },
188
+ },
189
+ };
@@ -0,0 +1,14 @@
1
+ import { defineLayerStyles } from '@pandacss/dev';
2
+
3
+ /**
4
+ * Layer styles from Park UI
5
+ * These provide reusable style combinations for common UI patterns
6
+ */
7
+ export const layerStyles = defineLayerStyles({
8
+ disabled: {
9
+ value: {
10
+ cursor: 'not-allowed',
11
+ opacity: '0.5',
12
+ },
13
+ },
14
+ });
@@ -0,0 +1,37 @@
1
+ import { defineRecipe } from '@pandacss/dev'
2
+
3
+ export const absoluteCenter = defineRecipe({
4
+ className: 'absolute-center',
5
+ base: {
6
+ position: 'absolute',
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ justifyContent: 'center',
10
+ },
11
+ defaultVariants: {
12
+ axis: 'both',
13
+ },
14
+ variants: {
15
+ axis: {
16
+ horizontal: {
17
+ insetStart: '50%',
18
+ translate: '-50%',
19
+ _rtl: {
20
+ translate: '50%',
21
+ },
22
+ },
23
+ vertical: {
24
+ top: '50%',
25
+ translate: '0 -50%',
26
+ },
27
+ both: {
28
+ insetStart: '50%',
29
+ top: '50%',
30
+ translate: '-50% -50%',
31
+ _rtl: {
32
+ translate: '50% -50%',
33
+ },
34
+ },
35
+ },
36
+ },
37
+ })
@@ -0,0 +1,92 @@
1
+ import { accordionAnatomy } from '@ark-ui/react/anatomy'
2
+ import { defineSlotRecipe } from '@pandacss/dev'
3
+
4
+ export const accordion = defineSlotRecipe({
5
+ className: 'accordion',
6
+ slots: accordionAnatomy.extendWith('itemBody').keys(),
7
+ base: {
8
+ root: {
9
+ width: 'full',
10
+ '--accordion-radius': 'radii.l2',
11
+ },
12
+ item: {
13
+ overflowAnchor: 'none',
14
+ },
15
+ itemTrigger: {
16
+ alignItems: 'center',
17
+ borderRadius: 'var(--accordion-radius)',
18
+ color: 'fg.default',
19
+ cursor: 'pointer',
20
+ display: 'flex',
21
+ fontWeight: 'semibold',
22
+ gap: '3',
23
+ justifyContent: 'space-between',
24
+ textAlign: 'start',
25
+ textStyle: 'lg',
26
+ width: 'full',
27
+ _focusVisible: {
28
+ outlineWidth: 'medium',
29
+ outlineStyle: 'solid',
30
+ outlineColor: 'colorPalette.focusRing',
31
+ },
32
+ _disabled: {
33
+ layerStyle: 'disabled',
34
+ },
35
+ },
36
+ itemIndicator: {
37
+ transition: 'rotate 0.2s',
38
+ transformOrigin: 'center',
39
+ color: 'fg.subtle',
40
+ _open: {
41
+ rotate: '180deg',
42
+ },
43
+ _icon: {
44
+ width: '1.2em',
45
+ height: '1.2em',
46
+ },
47
+ },
48
+ itemBody: {
49
+ pb: 'calc(var(--accordion-padding-y) * 2)',
50
+ color: 'fg.muted',
51
+ },
52
+ itemContent: {
53
+ overflow: 'hidden',
54
+ borderRadius: 'var(--accordion-radius)',
55
+ _open: {
56
+ animationName: 'expand-height, fade-in',
57
+ animationDuration: 'normal',
58
+ },
59
+ _closed: {
60
+ animationName: 'collapse-height, fade-out',
61
+ animationDuration: 'normal',
62
+ display: 'none',
63
+ },
64
+ },
65
+ },
66
+ defaultVariants: {
67
+ size: 'md',
68
+ variant: 'outline',
69
+ },
70
+ variants: {
71
+ variant: {
72
+ outline: {
73
+ item: {
74
+ borderBottomWidth: '1px',
75
+ },
76
+ },
77
+ plain: {},
78
+ },
79
+ size: {
80
+ md: {
81
+ root: {
82
+ '--accordion-padding-x': 'spacing.4',
83
+ '--accordion-padding-y': 'spacing.3',
84
+ },
85
+ itemTrigger: {
86
+ textStyle: 'md',
87
+ py: 'var(--accordion-padding-y)',
88
+ },
89
+ },
90
+ },
91
+ },
92
+ })
@@ -0,0 +1,152 @@
1
+ import { avatarAnatomy } from '@ark-ui/react/anatomy'
2
+ import { defineSlotRecipe } from '@pandacss/dev'
3
+
4
+ export const avatar = defineSlotRecipe({
5
+ className: 'avatar',
6
+ slots: avatarAnatomy.keys(),
7
+ base: {
8
+ root: {
9
+ display: 'inline-flex',
10
+ alignItems: 'center',
11
+ justifyContent: 'center',
12
+ fontWeight: 'medium',
13
+ position: 'relative',
14
+ verticalAlign: 'top',
15
+ flexShrink: '0',
16
+ userSelect: 'none',
17
+ width: 'var(--avatar-size)',
18
+ height: 'var(--avatar-size)',
19
+ fontSize: 'var(--avatar-font-size)',
20
+ borderRadius: 'var(--avatar-radius)',
21
+ },
22
+ fallback: {
23
+ lineHeight: '1',
24
+ textTransform: 'uppercase',
25
+ fontWeight: 'medium',
26
+ fontSize: 'var(--avatar-font-size)',
27
+ borderRadius: 'var(--avatar-radius)',
28
+ },
29
+ image: {
30
+ width: '100%',
31
+ height: '100%',
32
+ objectFit: 'cover',
33
+ borderRadius: 'var(--avatar-radius)',
34
+ },
35
+ },
36
+ defaultVariants: {
37
+ size: 'md',
38
+ shape: 'full',
39
+ variant: 'subtle',
40
+ },
41
+ variants: {
42
+ size: {
43
+ full: {
44
+ root: {
45
+ '--avatar-size': '100%',
46
+ '--avatar-font-size': '100%',
47
+ },
48
+ },
49
+ '2xs': {
50
+ root: {
51
+ '--avatar-font-size': 'fontSizes.2xs',
52
+ '--avatar-size': 'sizes.6',
53
+ },
54
+ fallback: {
55
+ _icon: { width: '3', height: '3' },
56
+ },
57
+ },
58
+ xs: {
59
+ root: {
60
+ '--avatar-font-size': 'fontSizes.xs',
61
+ '--avatar-size': 'sizes.8',
62
+ },
63
+ fallback: {
64
+ _icon: { width: '4', height: '4' },
65
+ },
66
+ },
67
+ sm: {
68
+ root: {
69
+ '--avatar-font-size': 'fontSizes.sm',
70
+ '--avatar-size': 'sizes.9',
71
+ },
72
+ fallback: {
73
+ _icon: { width: '4.5', height: '4.5' },
74
+ },
75
+ },
76
+ md: {
77
+ root: {
78
+ '--avatar-font-size': 'fontSizes.md',
79
+ '--avatar-size': 'sizes.10',
80
+ },
81
+ fallback: {
82
+ _icon: { width: '5', height: '5' },
83
+ },
84
+ },
85
+ lg: {
86
+ root: {
87
+ '--avatar-font-size': 'fontSizes.md',
88
+ '--avatar-size': 'sizes.11',
89
+ },
90
+ fallback: {
91
+ _icon: { width: '5.5', height: '5.5' },
92
+ },
93
+ },
94
+ xl: {
95
+ root: {
96
+ '--avatar-font-size': 'fontSizes.lg',
97
+ '--avatar-size': 'sizes.12',
98
+ },
99
+ fallback: {
100
+ _icon: { width: '6', height: '6' },
101
+ },
102
+ },
103
+ '2xl': {
104
+ root: {
105
+ '--avatar-font-size': 'fontSizes.xl',
106
+ '--avatar-size': 'sizes.16',
107
+ },
108
+ fallback: {
109
+ _icon: { width: '8', height: '8' },
110
+ },
111
+ },
112
+ },
113
+ variant: {
114
+ solid: {
115
+ root: {
116
+ bg: 'colorPalette.solid.bg',
117
+ color: 'colorPalette.solid.fg',
118
+ },
119
+ },
120
+ surface: {
121
+ root: {
122
+ bg: 'colorPalette.surface.bg',
123
+ borderWidth: '1px',
124
+ borderColor: 'colorPalette.surface.border',
125
+ color: 'colorPalette.surface.fg',
126
+ },
127
+ },
128
+ subtle: {
129
+ root: {
130
+ bg: 'colorPalette.subtle.bg',
131
+ color: 'colorPalette.subtle.fg',
132
+ },
133
+ },
134
+ outline: {
135
+ root: {
136
+ borderWidth: '1px',
137
+ borderColor: 'colorPalette.outline.border',
138
+ color: 'colorPalette.outline.fg',
139
+ },
140
+ },
141
+ },
142
+ shape: {
143
+ square: {},
144
+ rounded: {
145
+ root: { '--avatar-radius': 'radii.l3' },
146
+ },
147
+ full: {
148
+ root: { '--avatar-radius': 'radii.full' },
149
+ },
150
+ },
151
+ },
152
+ })