@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,156 @@
1
+ 'use client'
2
+ import { ark } from '@ark-ui/react/factory'
3
+ import { Slider, useSliderContext } from '@ark-ui/react/slider'
4
+ import type React from 'react'
5
+ import { type ComponentProps, forwardRef, createContext, useContext } from 'react'
6
+ import { slider } from 'styled-system/recipes'
7
+ import type { RecipeVariantProps } from 'styled-system/types/recipe'
8
+
9
+ // Create StyleContext for child components
10
+ type SliderVariantProps = RecipeVariantProps<typeof slider>
11
+ const StyleContextInternal = createContext<ReturnType<typeof slider> | null>(null)
12
+
13
+ // Custom Root component that applies Panda styles while passing all props to Ark UI
14
+ export const Root = forwardRef<HTMLDivElement, ComponentProps<typeof Slider.Root> & SliderVariantProps & { colorPalette?: string }>(
15
+ function SliderRoot(props, ref) {
16
+ const { orientation, size, variant, colorPalette, className, ...arkProps } = props
17
+
18
+ // Generate Panda CSS classes using the recipe
19
+ const styles = slider({ orientation, size, variant })
20
+
21
+ // Build className with color palette and custom classes
22
+ const colorPaletteClass = colorPalette ? `color-palette_${colorPalette}` : ''
23
+ const combinedClassName = [styles.root, colorPaletteClass, className].filter(Boolean).join(' ')
24
+
25
+ // Pass ALL props including orientation to Ark UI, and add Panda CSS classes
26
+ return (
27
+ <StyleContextInternal.Provider value={styles}>
28
+ <Slider.Root
29
+ ref={ref}
30
+ orientation={orientation}
31
+ className={combinedClassName}
32
+ {...arkProps}
33
+ />
34
+ </StyleContextInternal.Provider>
35
+ )
36
+ }
37
+ )
38
+
39
+ // Create typed wrapper for each component
40
+ const createStyledComponent = (
41
+ Component: typeof Slider.Control,
42
+ slot: keyof ReturnType<typeof slider>,
43
+ displayName: string
44
+ ) => {
45
+ const StyledComponent = forwardRef<HTMLDivElement, ComponentProps<typeof Component>>((props, ref) => {
46
+ const styles = useContext(StyleContextInternal)
47
+ const slotClass = styles?.[slot]
48
+ const { className, ...rest } = props
49
+ return <Component ref={ref} className={`${slotClass} ${className || ''}`.trim()} {...rest} />
50
+ })
51
+ StyledComponent.displayName = displayName
52
+ return StyledComponent
53
+ }
54
+
55
+ export const Control = createStyledComponent(Slider.Control, 'control', 'Control')
56
+ export const Track = createStyledComponent(Slider.Track, 'track', 'Track')
57
+ export const Range = createStyledComponent(Slider.Range, 'range', 'Range')
58
+
59
+ export const Thumb = forwardRef<HTMLDivElement, ComponentProps<typeof Slider.Thumb>>((props, ref) => {
60
+ const styles = useContext(StyleContextInternal)
61
+ const slotClass = styles?.thumb
62
+ const { className, ...rest } = props
63
+ return <Slider.Thumb ref={ref} className={`${slotClass} ${className || ''}`.trim()} {...rest} />
64
+ })
65
+ Thumb.displayName = 'Thumb'
66
+
67
+ // eslint-disable-next-line no-undef
68
+ export const Label = forwardRef<HTMLLabelElement, ComponentProps<typeof Slider.Label>>((props, ref) => {
69
+ const styles = useContext(StyleContextInternal)
70
+ const slotClass = styles?.label
71
+ const { className, ...rest } = props
72
+ return <Slider.Label ref={ref} className={`${slotClass} ${className || ''}`.trim()} {...rest} />
73
+ })
74
+ Label.displayName = 'Label'
75
+
76
+ export const ValueText = forwardRef<HTMLDivElement, ComponentProps<typeof Slider.ValueText>>((props, ref) => {
77
+ const styles = useContext(StyleContextInternal)
78
+ const slotClass = styles?.valueText
79
+ const { className, ...rest } = props
80
+ return <Slider.ValueText ref={ref} className={`${slotClass} ${className || ''}`.trim()} {...rest} />
81
+ })
82
+ ValueText.displayName = 'ValueText'
83
+
84
+ // eslint-disable-next-line no-undef
85
+ export const Marker = forwardRef<HTMLSpanElement, ComponentProps<typeof Slider.Marker>>((props, ref) => {
86
+ const styles = useContext(StyleContextInternal)
87
+ const slotClass = styles?.marker
88
+ const { className, ...rest } = props
89
+ return <Slider.Marker ref={ref} className={`${slotClass} ${className || ''}`.trim()} {...rest} />
90
+ })
91
+ Marker.displayName = 'Marker'
92
+
93
+ export const MarkerGroup = forwardRef<HTMLDivElement, ComponentProps<typeof Slider.MarkerGroup>>((props, ref) => {
94
+ const styles = useContext(StyleContextInternal)
95
+ const slotClass = styles?.markerGroup
96
+ const { className, ...rest } = props
97
+ return <Slider.MarkerGroup ref={ref} className={`${slotClass} ${className || ''}`.trim()} {...rest} />
98
+ })
99
+ MarkerGroup.displayName = 'MarkerGroup'
100
+
101
+ export const MarkerIndicator = forwardRef<HTMLDivElement, ComponentProps<typeof ark.div>>((props, ref) => {
102
+ const styles = useContext(StyleContextInternal)
103
+ const slotClass = styles?.markerIndicator
104
+ const { className, ...rest } = props
105
+ return <ark.div ref={ref} className={`${slotClass} ${className || ''}`.trim()} {...rest} />
106
+ })
107
+ MarkerIndicator.displayName = 'MarkerIndicator'
108
+
109
+ export const DraggingIndicator = forwardRef<HTMLDivElement, ComponentProps<typeof Slider.DraggingIndicator>>((props, ref) => {
110
+ const styles = useContext(StyleContextInternal)
111
+ const slotClass = styles?.draggingIndicator
112
+ const { className, ...rest } = props
113
+ return <Slider.DraggingIndicator ref={ref} className={`${slotClass} ${className || ''}`.trim()} {...rest} />
114
+ })
115
+ DraggingIndicator.displayName = 'DraggingIndicator'
116
+
117
+ export const HiddenInput = Slider.HiddenInput
118
+
119
+ export { SliderContext as Context } from '@ark-ui/react/slider'
120
+
121
+ export type RootProps = ComponentProps<typeof Root>
122
+ export type MarkerGroupProps = ComponentProps<typeof MarkerGroup>
123
+ export type ThumbProps = ComponentProps<typeof Thumb>
124
+
125
+ export interface MarksProps extends MarkerGroupProps {
126
+ marks?: Array<number | { value: number; label: React.ReactNode }> | undefined
127
+ }
128
+
129
+ export const Marks = forwardRef<HTMLDivElement, MarksProps>(function Marks(props, ref) {
130
+ const { marks, ...rest } = props
131
+ if (!marks?.length) return null
132
+
133
+ return (
134
+ <MarkerGroup ref={ref} {...rest}>
135
+ {marks.map((mark, index) => {
136
+ const value = typeof mark === 'number' ? mark : mark.value
137
+ const label = typeof mark === 'number' ? undefined : mark.label
138
+ return (
139
+ <Marker key={index} value={value}>
140
+ <MarkerIndicator />
141
+ {label != null && <span>{label}</span>}
142
+ </Marker>
143
+ )
144
+ })}
145
+ </MarkerGroup>
146
+ )
147
+ })
148
+
149
+ export const Thumbs = (props: Omit<ThumbProps, 'index'>) => {
150
+ const slider = useSliderContext()
151
+ return slider.value.map((_, index) => (
152
+ <Thumb key={index} index={index} {...props}>
153
+ <HiddenInput />
154
+ </Thumb>
155
+ ))
156
+ }
@@ -0,0 +1,7 @@
1
+ import { ark } from '@ark-ui/react/factory'
2
+ import type { ComponentProps } from 'react'
3
+ import { styled } from 'styled-system/jsx'
4
+ import { spinner } from 'styled-system/recipes'
5
+
6
+ export type SpinnerProps = ComponentProps<typeof Spinner>
7
+ export const Spinner = styled(ark.span, spinner)
@@ -0,0 +1,19 @@
1
+ 'use client'
2
+ import { Switch } from '@ark-ui/react/switch'
3
+ import type { ComponentProps } from 'react'
4
+ import { createStyleContext } from 'styled-system/jsx'
5
+ import { switchComponent } from 'styled-system/recipes'
6
+
7
+ const { withProvider, withContext } = createStyleContext(switchComponent)
8
+
9
+ export type RootProps = ComponentProps<typeof Root>
10
+ export const Root = withProvider(Switch.Root, 'root')
11
+ export const Label = withContext(Switch.Label, 'label')
12
+ export const Thumb = withContext(Switch.Thumb, 'thumb')
13
+ export const HiddenInput = Switch.HiddenInput
14
+
15
+ export const Control = withContext(Switch.Control, 'control', {
16
+ defaultProps: { children: <Thumb /> },
17
+ })
18
+
19
+ export { SwitchContext as Context } from '@ark-ui/react/switch'
@@ -0,0 +1,17 @@
1
+ 'use client'
2
+ import { Tabs } from '@ark-ui/react/tabs'
3
+ import type { ComponentProps } from 'react'
4
+ import { createStyleContext } from 'styled-system/jsx'
5
+ import { tabs } from 'styled-system/recipes'
6
+
7
+ const { withProvider, withContext } = createStyleContext(tabs)
8
+
9
+ export type RootProps = ComponentProps<typeof Root>
10
+ export const Root = withProvider(Tabs.Root, 'root')
11
+ export const RootProvider = withProvider(Tabs.RootProvider, 'root')
12
+ export const List = withContext(Tabs.List, 'list')
13
+ export const Trigger = withContext(Tabs.Trigger, 'trigger')
14
+ export const Content = withContext(Tabs.Content, 'content')
15
+ export const Indicator = withContext(Tabs.Indicator, 'indicator')
16
+
17
+ export { TabsContext as Context } from '@ark-ui/react/tabs'
@@ -0,0 +1,7 @@
1
+ import { Field } from '@ark-ui/react/field'
2
+ import type { ComponentProps } from 'react'
3
+ import { styled } from 'styled-system/jsx'
4
+ import { textarea } from 'styled-system/recipes'
5
+
6
+ export type TextareaProps = ComponentProps<typeof Textarea>
7
+ export const Textarea = styled(Field.Textarea, textarea)
@@ -0,0 +1,96 @@
1
+ 'use client'
2
+ import { Portal } from '@ark-ui/react/portal'
3
+ import { Toaster as ArkToaster, createToaster, Toast, useToastContext } from '@ark-ui/react/toast'
4
+ import type React from 'react'
5
+ import { type ComponentPropsWithRef, forwardRef } from 'react'
6
+ import { createStyleContext, Stack, styled } from 'styled-system/jsx'
7
+ import { toast } from 'styled-system/recipes'
8
+ import { CloseButton } from './CloseButton'
9
+ import { Icon, type IconProps } from './Icon'
10
+ import { Spinner } from './Spinner'
11
+
12
+ const CheckCircleIcon = () => (
13
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
14
+ <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
15
+ <path d="m9 11 3 3L22 4"></path>
16
+ </svg>
17
+ )
18
+
19
+ const CircleAlertIcon = () => (
20
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
21
+ <circle cx="12" cy="12" r="10"></circle>
22
+ <line x1="12" x2="12" y1="8" y2="12"></line>
23
+ <line x1="12" x2="12.01" y1="16" y2="16"></line>
24
+ </svg>
25
+ )
26
+
27
+ const CircleXIcon = () => (
28
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
29
+ <circle cx="12" cy="12" r="10"></circle>
30
+ <path d="m15 9-6 6"></path>
31
+ <path d="m9 9 6 6"></path>
32
+ </svg>
33
+ )
34
+
35
+ const { withProvider, withContext } = createStyleContext(toast)
36
+
37
+ const Root = withProvider(Toast.Root, 'root')
38
+ const Title = withContext(Toast.Title, 'title')
39
+ const Description = withContext(Toast.Description, 'description')
40
+ const ActionTrigger = withContext(Toast.ActionTrigger, 'actionTrigger')
41
+ const CloseTrigger = withContext(Toast.CloseTrigger, 'closeTrigger')
42
+ const StyledToaster = styled(ArkToaster)
43
+
44
+ const iconMap: Record<string, React.ElementType> = {
45
+ warning: CircleAlertIcon,
46
+ success: CheckCircleIcon,
47
+ error: CircleXIcon,
48
+ }
49
+
50
+ // eslint-disable-next-line no-undef
51
+ const Indicator = forwardRef<SVGSVGElement, IconProps & ComponentPropsWithRef<'svg'>>(function ToastIndicator(props, ref) {
52
+ const toast = useToastContext()
53
+
54
+ const StatusIcon = iconMap[toast.type]
55
+ if (!StatusIcon) return null
56
+
57
+ return (
58
+ <Icon ref={ref} data-type={toast.type} {...props}>
59
+ <StatusIcon />
60
+ </Icon>
61
+ )
62
+ })
63
+
64
+ export const toaster: ReturnType<typeof createToaster> = createToaster({
65
+ placement: 'bottom-end',
66
+ pauseOnPageIdle: true,
67
+ overlap: true,
68
+ max: 5,
69
+ })
70
+
71
+ export const Toaster = () => {
72
+ return (
73
+ <Portal>
74
+ <StyledToaster toaster={toaster} insetInline={{ mdDown: '4' }}>
75
+ {(toast) => (
76
+ <Root>
77
+ {toast.type === 'loading' ? <Spinner color="colorPalette.plain.fg" /> : <Indicator />}
78
+
79
+ <Stack gap="3" alignItems="start">
80
+ <Stack gap="1">
81
+ {toast.title && <Title>{toast.title}</Title>}
82
+ {toast.description && <Description>{toast.description}</Description>}
83
+ </Stack>
84
+ {toast.action && <ActionTrigger>{toast.action.label}</ActionTrigger>}
85
+ </Stack>
86
+ {toast.closable && (
87
+ <CloseTrigger asChild>
88
+ <CloseButton size="sm" />
89
+ </CloseTrigger>
90
+ )}
91
+ </Root>
92
+ )}
93
+ </StyledToaster>
94
+ </Portal>
95
+ )
96
+ }
@@ -0,0 +1,65 @@
1
+ 'use client'
2
+ import { Portal } from '@ark-ui/react/portal'
3
+ import { Tooltip as ArkTooltip } from '@ark-ui/react/tooltip'
4
+ import type React from 'react'
5
+ import { type ComponentProps, forwardRef } from 'react'
6
+ import { createStyleContext } from 'styled-system/jsx'
7
+ import { tooltip } from 'styled-system/recipes'
8
+
9
+ const { withRootProvider, withContext } = createStyleContext(tooltip)
10
+
11
+ type RootProps = ComponentProps<typeof Root>
12
+ type ContentProps = ComponentProps<typeof Content>
13
+ const Root = withRootProvider(ArkTooltip.Root, {
14
+ defaultProps: { unmountOnExit: true, lazyMount: true },
15
+ })
16
+ const Arrow = withContext(ArkTooltip.Arrow, 'arrow')
17
+ const ArrowTip = withContext(ArkTooltip.ArrowTip, 'arrowTip')
18
+ const Content = withContext(ArkTooltip.Content, 'content')
19
+ const Positioner = withContext(ArkTooltip.Positioner, 'positioner')
20
+ const Trigger = withContext(ArkTooltip.Trigger, 'trigger')
21
+
22
+ export { TooltipContext as Context } from '@ark-ui/react/tooltip'
23
+
24
+ export interface TooltipProps extends Omit<RootProps, 'content'> {
25
+ showArrow?: boolean
26
+ portalled?: boolean
27
+ portalRef?: React.RefObject<HTMLElement | null>
28
+ children: React.ReactNode | undefined
29
+ content: React.ReactNode | string
30
+ contentProps?: ContentProps
31
+ disabled?: boolean
32
+ }
33
+
34
+ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(props, ref) {
35
+ const {
36
+ showArrow,
37
+ children,
38
+ disabled,
39
+ portalled = true,
40
+ content,
41
+ contentProps,
42
+ portalRef,
43
+ ...rootProps
44
+ } = props
45
+
46
+ if (disabled) return children
47
+
48
+ return (
49
+ <Root {...rootProps}>
50
+ <Trigger asChild>{children}</Trigger>
51
+ <Portal disabled={!portalled} container={portalRef}>
52
+ <Positioner>
53
+ <Content ref={ref} {...contentProps}>
54
+ {showArrow && (
55
+ <Arrow>
56
+ <ArrowTip />
57
+ </Arrow>
58
+ )}
59
+ {content}
60
+ </Content>
61
+ </Positioner>
62
+ </Portal>
63
+ </Root>
64
+ )
65
+ })
@@ -0,0 +1,48 @@
1
+ // Simple Components (directly usable)
2
+ // Button - export directly, Group available via separate ButtonGroup export
3
+ export {
4
+ Button,
5
+ ButtonGroup,
6
+ type ButtonProps,
7
+ type ButtonGroupProps,
8
+ } from './Button';
9
+
10
+ // IconButton (simple component)
11
+ export { IconButton, type IconButtonProps } from './IconButton';
12
+
13
+ // Form Components (simple)
14
+ export { Input, type InputProps } from './Input';
15
+ export { InputAddon, type InputAddonProps } from './InputAddon';
16
+ export { InputGroup, type InputGroupProps } from './InputGroup';
17
+ export { Textarea, type TextareaProps } from './Textarea';
18
+
19
+ // Typography Components (simple)
20
+ export { Heading, type HeadingProps } from './Heading';
21
+
22
+ // Feedback & Status Components (simple)
23
+ export { Badge, type BadgeProps } from './Badge';
24
+ export { Spinner, type SpinnerProps } from './Spinner';
25
+ export { Toaster, toaster } from './Toast';
26
+
27
+ // Compound Components (namespace pattern)
28
+ export * as Card from './Card';
29
+ export * as Dialog from './Dialog';
30
+ export * as Switch from './Switch';
31
+ export * as Accordion from './Accordion';
32
+ export * as Drawer from './Drawer';
33
+ export * as Tabs from './Tabs';
34
+ export * as Checkbox from './Checkbox';
35
+ export * as RadioGroup from './RadioGroup';
36
+ export * as Select from './Select';
37
+ export * as Slider from './Slider';
38
+ export * as Avatar from './Avatar';
39
+ export * as Progress from './Progress';
40
+ export * as Skeleton from './Skeleton';
41
+ export * as Popover from './Popover';
42
+ export * as Tooltip from './Tooltip';
43
+
44
+ // Utility Components (namespace pattern - may have multiple exports)
45
+ export * as CloseButton from './CloseButton';
46
+ export * as Icon from './Icon';
47
+ export * as AbsoluteCenter from './AbsoluteCenter';
48
+ export * as Group from './Group';
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Design Language Contract
3
+ *
4
+ * Any aesthetic (M3, Carbon, Fluent, custom) must implement this interface.
5
+ * This enables swapping aesthetics by changing one import.
6
+ */
7
+
8
+ export interface DesignLanguageContract {
9
+ name: string;
10
+ version: string;
11
+ colors: ColorPalettes;
12
+ semantic: SemanticColors;
13
+ semanticDark?: SemanticColors; // Optional dark theme overrides
14
+ typography: TypographyConfig;
15
+ spacing: SpacingScale;
16
+ shape: ShapeConfig;
17
+ elevation: ElevationConfig;
18
+ motion: MotionConfig;
19
+ border: BorderConfig;
20
+ }
21
+
22
+ // Color Types
23
+ export interface ColorPalettes {
24
+ primary: TonalPalette;
25
+ secondary: TonalPalette;
26
+ tertiary: TonalPalette;
27
+ neutral: TonalPalette;
28
+ neutralVariant: TonalPalette;
29
+ error: TonalPalette;
30
+ }
31
+
32
+ export interface TonalPalette {
33
+ 0: string;
34
+ 10: string;
35
+ 20: string;
36
+ 30: string;
37
+ 40: string;
38
+ 50: string;
39
+ 60: string;
40
+ 70: string;
41
+ 80: string;
42
+ 90: string;
43
+ 95: string;
44
+ 99: string;
45
+ 100: string;
46
+ }
47
+
48
+ export interface SemanticColors {
49
+ primary: string;
50
+ onPrimary: string;
51
+ primaryContainer: string;
52
+ onPrimaryContainer: string;
53
+ secondary: string;
54
+ onSecondary: string;
55
+ secondaryContainer: string;
56
+ onSecondaryContainer: string;
57
+ tertiary: string;
58
+ onTertiary: string;
59
+ tertiaryContainer: string;
60
+ onTertiaryContainer: string;
61
+ error: string;
62
+ onError: string;
63
+ errorContainer: string;
64
+ onErrorContainer: string;
65
+ surface: string;
66
+ onSurface: string;
67
+ surfaceVariant: string;
68
+ onSurfaceVariant: string;
69
+ surfaceContainerLowest: string;
70
+ surfaceContainerLow: string;
71
+ surfaceContainer: string;
72
+ surfaceContainerHigh: string;
73
+ surfaceContainerHighest: string;
74
+ outline: string;
75
+ outlineVariant: string;
76
+ inverseSurface: string;
77
+ inverseOnSurface: string;
78
+ inversePrimary: string;
79
+ background: string;
80
+ onBackground: string;
81
+ scrim: string;
82
+ shadow: string;
83
+ }
84
+
85
+ // Typography Types
86
+ export interface TypographyConfig {
87
+ fonts: {
88
+ display: string;
89
+ body: string;
90
+ mono: string;
91
+ };
92
+ scale: TypographyScale;
93
+ }
94
+
95
+ export interface TypographyScale {
96
+ displayLarge: TypeStyle;
97
+ displayMedium: TypeStyle;
98
+ displaySmall: TypeStyle;
99
+ headlineLarge: TypeStyle;
100
+ headlineMedium: TypeStyle;
101
+ headlineSmall: TypeStyle;
102
+ titleLarge: TypeStyle;
103
+ titleMedium: TypeStyle;
104
+ titleSmall: TypeStyle;
105
+ bodyLarge: TypeStyle;
106
+ bodyMedium: TypeStyle;
107
+ bodySmall: TypeStyle;
108
+ labelLarge: TypeStyle;
109
+ labelMedium: TypeStyle;
110
+ labelSmall: TypeStyle;
111
+ }
112
+
113
+ export interface TypeStyle {
114
+ fontSize: string;
115
+ lineHeight: string;
116
+ fontWeight: string;
117
+ letterSpacing: string;
118
+ fontFamily?: 'display' | 'body' | 'mono';
119
+ }
120
+
121
+ // Spacing Types
122
+ export interface SpacingScale {
123
+ none: string;
124
+ xxs: string;
125
+ xs: string;
126
+ sm: string;
127
+ md: string;
128
+ lg: string;
129
+ xl: string;
130
+ xxl: string;
131
+ xxxl: string;
132
+ }
133
+
134
+ // Shape Types
135
+ export interface ShapeConfig {
136
+ radii: RadiiScale;
137
+ style: 'sharp' | 'rounded' | 'soft' | 'organic';
138
+ }
139
+
140
+ export interface RadiiScale {
141
+ none: string;
142
+ extraSmall: string;
143
+ small: string;
144
+ medium: string;
145
+ large: string;
146
+ extraLarge: string;
147
+ full: string;
148
+ }
149
+
150
+ // Elevation Types
151
+ export interface ElevationConfig {
152
+ levels: ElevationScale;
153
+ style: 'shadow' | 'border' | 'blur' | 'flat';
154
+ }
155
+
156
+ export interface ElevationScale {
157
+ level0: string;
158
+ level1: string;
159
+ level2: string;
160
+ level3: string;
161
+ level4: string;
162
+ level5: string;
163
+ }
164
+
165
+ // Motion Types
166
+ export interface MotionConfig {
167
+ durations: DurationScale;
168
+ easings: EasingScale;
169
+ style: 'expressive' | 'productive' | 'minimal';
170
+ }
171
+
172
+ export interface DurationScale {
173
+ instant: string;
174
+ fast: string;
175
+ normal: string;
176
+ slow: string;
177
+ slower: string;
178
+ }
179
+
180
+ export interface EasingScale {
181
+ standard: string;
182
+ standardDecelerate: string;
183
+ standardAccelerate: string;
184
+ emphasized: string;
185
+ emphasizedDecelerate: string;
186
+ emphasizedAccelerate: string;
187
+ }
188
+
189
+ // Border Types
190
+ export interface BorderConfig {
191
+ widths: BorderWidthScale;
192
+ }
193
+
194
+ export interface BorderWidthScale {
195
+ thin: string;
196
+ medium: string;
197
+ thick: string;
198
+ }
package/src/global.css ADDED
@@ -0,0 +1,4 @@
1
+ /* Google Fonts */
2
+ @import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,300;1,9..144,400;1,9..144,500;1,9..144,600;1,9..144,700&family=Poppins:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');
3
+
4
+ @layer reset, base, tokens, recipes, utilities;
package/src/index.ts ADDED
@@ -0,0 +1,18 @@
1
+ // Components
2
+ // Pipeline validation: Testing automated release workflow
3
+ export * from './components';
4
+
5
+ // Recipes (for direct usage)
6
+ export * from './recipes';
7
+
8
+ // Language system
9
+ export * from './languages';
10
+
11
+ // Contracts
12
+ export type * from './contracts/design-language.contract';
13
+
14
+ // Utilities
15
+ export { cn } from './utils/cn';
16
+
17
+ // Panda CSS Preset
18
+ export { discourserPandaPreset } from './preset';
@@ -0,0 +1,9 @@
1
+ // Export the active language
2
+ // Change this import to switch aesthetics
3
+ export { material3Language as activeLanguage } from './material3.language';
4
+
5
+ // Re-export transformer
6
+ export { transformToPandaTheme } from './transform';
7
+
8
+ // Re-export types
9
+ export type { DesignLanguageContract } from '../contracts/design-language.contract';