@inspirare/design-system 0.0.22 → 0.0.24

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 (297) hide show
  1. package/README.md +82 -61
  2. package/dist/book-logo-filled.svg +55 -0
  3. package/dist/components/ui/accessibility-improvements.js +26 -23
  4. package/dist/components/ui/accordion.js +34 -24
  5. package/dist/components/ui/alert-dialog.js +91 -57
  6. package/dist/components/ui/alert.js +38 -26
  7. package/dist/components/ui/aspect-ratio.js +11 -3
  8. package/dist/components/ui/avatar.js +30 -8
  9. package/dist/components/ui/badge.js +20 -14
  10. package/dist/components/ui/breadcrumb.js +69 -56
  11. package/dist/components/ui/button-group.js +17 -13
  12. package/dist/components/ui/button.js +19 -15
  13. package/dist/components/ui/calendar.js +63 -59
  14. package/dist/components/ui/card.js +11 -9
  15. package/dist/components/ui/carousel.js +70 -75
  16. package/dist/components/ui/chart.js +75 -72
  17. package/dist/components/ui/checkbox.js +4 -5
  18. package/dist/components/ui/collapsible.js +12 -14
  19. package/dist/components/ui/color-picker.js +60 -80
  20. package/dist/components/ui/combobox.js +153 -33
  21. package/dist/components/ui/command.js +50 -48
  22. package/dist/components/ui/context-menu.js +129 -68
  23. package/dist/components/ui/dialog.js +65 -60
  24. package/dist/components/ui/drawer.js +81 -40
  25. package/dist/components/ui/dropdown-menu.js +100 -87
  26. package/dist/components/ui/empty.js +7 -6
  27. package/dist/components/ui/field.js +44 -47
  28. package/dist/components/ui/form.js +22 -23
  29. package/dist/components/ui/hover-card.js +14 -11
  30. package/dist/components/ui/input-group.js +16 -13
  31. package/dist/components/ui/input-otp.js +37 -32
  32. package/dist/components/ui/input.js +9 -7
  33. package/dist/components/ui/item.js +42 -36
  34. package/dist/components/ui/kbd.js +2 -1
  35. package/dist/components/ui/label.js +6 -7
  36. package/dist/components/ui/menubar.js +124 -93
  37. package/dist/components/ui/navigation-menu.js +79 -54
  38. package/dist/components/ui/pagination.js +78 -58
  39. package/dist/components/ui/popover.js +35 -16
  40. package/dist/components/ui/progress.js +37 -13
  41. package/dist/components/ui/radio-group.js +14 -14
  42. package/dist/components/ui/resizable.js +24 -15
  43. package/dist/components/ui/scroll-area.js +29 -11
  44. package/dist/components/ui/select.js +98 -56
  45. package/dist/components/ui/separator.js +5 -7
  46. package/dist/components/ui/sheet.js +47 -42
  47. package/dist/components/ui/sidebar.js +279 -248
  48. package/dist/components/ui/skeleton.js +4 -40
  49. package/dist/components/ui/slider.js +27 -29
  50. package/dist/components/ui/sonner.js +27 -10
  51. package/dist/components/ui/spinner.js +2 -0
  52. package/dist/components/ui/switch.js +3 -4
  53. package/dist/components/ui/table.js +6 -6
  54. package/dist/components/ui/tabs.js +45 -22
  55. package/dist/components/ui/textarea.js +3 -2
  56. package/dist/components/ui/theme-toggle.js +38 -41
  57. package/dist/components/ui/toggle-group.js +30 -21
  58. package/dist/components/ui/toggle.js +8 -9
  59. package/dist/components/ui/tooltip.js +28 -23
  60. package/dist/index.css +1 -1
  61. package/dist/index.d.ts +446 -468
  62. package/dist/index.js +58 -58
  63. package/package.json +42 -41
  64. package/src/App.tsx +28 -34
  65. package/src/components/branding/assets/book-logo-filled.svg +55 -0
  66. package/src/components/branding/logo/logo.tsx +56 -0
  67. package/src/components/ui/accessibility-improvements.stories.tsx +18 -0
  68. package/src/components/ui/accessibility-improvements.test.tsx +13 -0
  69. package/src/components/ui/accessibility-improvements.tsx +16 -6
  70. package/src/components/ui/accordion.stories.tsx +19 -0
  71. package/src/components/ui/accordion.test.tsx +14 -0
  72. package/src/components/ui/accordion.tsx +28 -20
  73. package/src/components/ui/alert-dialog.stories.tsx +19 -0
  74. package/src/components/ui/alert-dialog.test.tsx +14 -0
  75. package/src/components/ui/alert-dialog.tsx +159 -123
  76. package/src/components/ui/alert.stories.tsx +19 -0
  77. package/src/components/ui/alert.test.tsx +14 -0
  78. package/src/components/ui/alert.tsx +60 -41
  79. package/src/components/ui/aspect-ratio.stories.tsx +19 -0
  80. package/src/components/ui/aspect-ratio.test.tsx +14 -0
  81. package/src/components/ui/aspect-ratio.tsx +19 -2
  82. package/src/components/ui/attachment.stories.tsx +19 -0
  83. package/src/components/ui/attachment.test.tsx +14 -0
  84. package/src/components/ui/attachment.tsx +209 -0
  85. package/src/components/ui/avatar.stories.tsx +19 -0
  86. package/src/components/ui/avatar.test.tsx +14 -0
  87. package/src/components/ui/avatar.tsx +73 -17
  88. package/src/components/ui/badge.stories.tsx +19 -0
  89. package/src/components/ui/badge.test.tsx +14 -0
  90. package/src/components/ui/badge.tsx +33 -25
  91. package/src/components/ui/breadcrumb.stories.tsx +19 -0
  92. package/src/components/ui/breadcrumb.test.tsx +14 -0
  93. package/src/components/ui/breadcrumb.tsx +98 -86
  94. package/src/components/ui/bubble.stories.tsx +19 -0
  95. package/src/components/ui/bubble.test.tsx +14 -0
  96. package/src/components/ui/bubble.tsx +130 -0
  97. package/src/components/ui/button-group.stories.tsx +19 -0
  98. package/src/components/ui/button-group.test.tsx +14 -0
  99. package/src/components/ui/button-group.tsx +26 -20
  100. package/src/components/ui/button.stories.tsx +19 -0
  101. package/src/components/ui/button.test.tsx +14 -0
  102. package/src/components/ui/button.tsx +30 -31
  103. package/src/components/ui/calendar.stories.tsx +19 -0
  104. package/src/components/ui/calendar.test.tsx +14 -0
  105. package/src/components/ui/calendar.tsx +28 -26
  106. package/src/components/ui/card.stories.tsx +19 -0
  107. package/src/components/ui/card.test.tsx +14 -0
  108. package/src/components/ui/card.tsx +30 -17
  109. package/src/components/ui/carousel.stories.tsx +19 -0
  110. package/src/components/ui/carousel.test.tsx +14 -0
  111. package/src/components/ui/carousel.tsx +115 -135
  112. package/src/components/ui/chart.stories.tsx +18 -0
  113. package/src/components/ui/chart.test.tsx +13 -0
  114. package/src/components/ui/chart.tsx +220 -216
  115. package/src/components/ui/checkbox.stories.tsx +19 -0
  116. package/src/components/ui/checkbox.test.tsx +14 -0
  117. package/src/components/ui/checkbox.tsx +7 -10
  118. package/src/components/ui/collapsible.stories.tsx +19 -0
  119. package/src/components/ui/collapsible.test.tsx +14 -0
  120. package/src/components/ui/collapsible.tsx +11 -26
  121. package/src/components/ui/color-picker.stories.tsx +19 -0
  122. package/src/components/ui/color-picker.test.tsx +14 -0
  123. package/src/components/ui/color-picker.tsx +36 -26
  124. package/src/components/ui/combobox.stories.tsx +19 -0
  125. package/src/components/ui/combobox.test.tsx +14 -0
  126. package/src/components/ui/combobox.tsx +281 -96
  127. package/src/components/ui/command.stories.tsx +19 -0
  128. package/src/components/ui/command.test.tsx +14 -0
  129. package/src/components/ui/command.tsx +59 -47
  130. package/src/components/ui/context-menu.stories.tsx +19 -0
  131. package/src/components/ui/context-menu.test.tsx +14 -0
  132. package/src/components/ui/context-menu.tsx +231 -160
  133. package/src/components/ui/dialog.stories.tsx +19 -0
  134. package/src/components/ui/dialog.test.tsx +14 -0
  135. package/src/components/ui/dialog.tsx +81 -72
  136. package/src/components/ui/direction.stories.tsx +19 -0
  137. package/src/components/ui/direction.test.tsx +14 -0
  138. package/src/components/ui/direction.tsx +6 -0
  139. package/src/components/ui/drawer.stories.tsx +19 -0
  140. package/src/components/ui/drawer.test.tsx +14 -0
  141. package/src/components/ui/drawer.tsx +143 -64
  142. package/src/components/ui/dropdown-menu.stories.tsx +19 -0
  143. package/src/components/ui/dropdown-menu.test.tsx +14 -0
  144. package/src/components/ui/dropdown-menu.tsx +199 -153
  145. package/src/components/ui/empty.stories.tsx +18 -0
  146. package/src/components/ui/empty.test.tsx +13 -0
  147. package/src/components/ui/empty.tsx +11 -9
  148. package/src/components/ui/field.stories.tsx +18 -0
  149. package/src/components/ui/field.test.tsx +13 -0
  150. package/src/components/ui/field.tsx +26 -32
  151. package/src/components/ui/form.stories.tsx +22 -0
  152. package/src/components/ui/form.test.tsx +15 -0
  153. package/src/components/ui/form.tsx +1 -2
  154. package/src/components/ui/hover-card.stories.tsx +19 -0
  155. package/src/components/ui/hover-card.test.tsx +14 -0
  156. package/src/components/ui/hover-card.tsx +34 -32
  157. package/src/components/ui/input-group.stories.tsx +18 -0
  158. package/src/components/ui/input-group.test.tsx +13 -0
  159. package/src/components/ui/input-group.tsx +21 -28
  160. package/src/components/ui/input-otp.stories.tsx +19 -0
  161. package/src/components/ui/input-otp.test.tsx +14 -0
  162. package/src/components/ui/input-otp.tsx +58 -42
  163. package/src/components/ui/input.stories.tsx +19 -0
  164. package/src/components/ui/input.test.tsx +14 -0
  165. package/src/components/ui/input.tsx +9 -8
  166. package/src/components/ui/item.stories.tsx +18 -0
  167. package/src/components/ui/item.test.tsx +13 -0
  168. package/src/components/ui/item.tsx +38 -28
  169. package/src/components/ui/kbd.stories.tsx +18 -0
  170. package/src/components/ui/kbd.test.tsx +13 -0
  171. package/src/components/ui/kbd.tsx +3 -3
  172. package/src/components/ui/label.stories.tsx +18 -0
  173. package/src/components/ui/label.test.tsx +13 -0
  174. package/src/components/ui/label.tsx +7 -11
  175. package/src/components/ui/marker.stories.tsx +19 -0
  176. package/src/components/ui/marker.test.tsx +14 -0
  177. package/src/components/ui/marker.tsx +73 -0
  178. package/src/components/ui/menubar.stories.tsx +19 -0
  179. package/src/components/ui/menubar.test.tsx +14 -0
  180. package/src/components/ui/menubar.tsx +226 -202
  181. package/src/components/ui/message-scroller.stories.tsx +19 -0
  182. package/src/components/ui/message-scroller.test.tsx +14 -0
  183. package/src/components/ui/message-scroller.tsx +131 -0
  184. package/src/components/ui/message.stories.tsx +19 -0
  185. package/src/components/ui/message.test.tsx +14 -0
  186. package/src/components/ui/message.tsx +94 -0
  187. package/src/components/ui/native-select.stories.tsx +18 -0
  188. package/src/components/ui/native-select.test.tsx +13 -0
  189. package/src/components/ui/native-select.tsx +63 -0
  190. package/src/components/ui/navigation-menu.stories.tsx +19 -0
  191. package/src/components/ui/navigation-menu.test.tsx +14 -0
  192. package/src/components/ui/navigation-menu.tsx +145 -103
  193. package/src/components/ui/pagination.stories.tsx +19 -0
  194. package/src/components/ui/pagination.test.tsx +14 -0
  195. package/src/components/ui/pagination.tsx +114 -83
  196. package/src/components/ui/popover.stories.tsx +19 -0
  197. package/src/components/ui/popover.test.tsx +14 -0
  198. package/src/components/ui/popover.tsx +68 -33
  199. package/src/components/ui/progress.stories.tsx +19 -0
  200. package/src/components/ui/progress.test.tsx +14 -0
  201. package/src/components/ui/progress.tsx +67 -15
  202. package/src/components/ui/questionnaire.stories.tsx +19 -0
  203. package/src/components/ui/questionnaire.test.tsx +14 -0
  204. package/src/components/ui/questionnaire.tsx +324 -0
  205. package/src/components/ui/radio-group.stories.tsx +19 -0
  206. package/src/components/ui/radio-group.test.tsx +14 -0
  207. package/src/components/ui/radio-group.tsx +15 -20
  208. package/src/components/ui/resizable.stories.tsx +19 -0
  209. package/src/components/ui/resizable.test.tsx +14 -0
  210. package/src/components/ui/resizable.tsx +37 -30
  211. package/src/components/ui/scroll-area.stories.tsx +19 -0
  212. package/src/components/ui/scroll-area.test.tsx +14 -0
  213. package/src/components/ui/scroll-area.tsx +41 -19
  214. package/src/components/ui/select.stories.tsx +19 -0
  215. package/src/components/ui/select.test.tsx +14 -0
  216. package/src/components/ui/select.tsx +145 -78
  217. package/src/components/ui/separator.stories.tsx +19 -0
  218. package/src/components/ui/separator.test.tsx +14 -0
  219. package/src/components/ui/separator.tsx +8 -11
  220. package/src/components/ui/sheet.stories.tsx +19 -0
  221. package/src/components/ui/sheet.test.tsx +14 -0
  222. package/src/components/ui/sheet.tsx +56 -71
  223. package/src/components/ui/sidebar.stories.tsx +18 -0
  224. package/src/components/ui/sidebar.test.tsx +13 -0
  225. package/src/components/ui/sidebar.tsx +469 -513
  226. package/src/components/ui/skeleton.stories.tsx +19 -0
  227. package/src/components/ui/skeleton.test.tsx +14 -0
  228. package/src/components/ui/skeleton.tsx +8 -114
  229. package/src/components/ui/slider.stories.tsx +19 -0
  230. package/src/components/ui/slider.test.tsx +14 -0
  231. package/src/components/ui/slider.tsx +31 -40
  232. package/src/components/ui/sonner.stories.tsx +19 -0
  233. package/src/components/ui/sonner.test.tsx +14 -0
  234. package/src/components/ui/sonner.tsx +39 -7
  235. package/src/components/ui/spinner.stories.tsx +18 -0
  236. package/src/components/ui/spinner.test.tsx +13 -0
  237. package/src/components/ui/spinner.tsx +3 -7
  238. package/src/components/ui/switch.stories.tsx +19 -0
  239. package/src/components/ui/switch.test.tsx +14 -0
  240. package/src/components/ui/switch.tsx +4 -7
  241. package/src/components/ui/table.stories.tsx +19 -0
  242. package/src/components/ui/table.test.tsx +14 -0
  243. package/src/components/ui/table.tsx +17 -17
  244. package/src/components/ui/tabs.stories.tsx +19 -0
  245. package/src/components/ui/tabs.test.tsx +14 -0
  246. package/src/components/ui/tabs.tsx +71 -31
  247. package/src/components/ui/textarea.stories.tsx +19 -0
  248. package/src/components/ui/textarea.test.tsx +14 -0
  249. package/src/components/ui/textarea.tsx +7 -5
  250. package/src/components/ui/theme-toggle.stories.tsx +18 -0
  251. package/src/components/ui/theme-toggle.test.tsx +13 -0
  252. package/src/components/ui/theme-toggle.tsx +35 -37
  253. package/src/components/ui/toggle-group.stories.tsx +19 -0
  254. package/src/components/ui/toggle-group.test.tsx +14 -0
  255. package/src/components/ui/toggle-group.tsx +41 -25
  256. package/src/components/ui/toggle.stories.tsx +19 -0
  257. package/src/components/ui/toggle.test.tsx +14 -0
  258. package/src/components/ui/toggle.tsx +17 -19
  259. package/src/components/ui/tooltip.stories.tsx +19 -0
  260. package/src/components/ui/tooltip.test.tsx +14 -0
  261. package/src/components/ui/tooltip.tsx +53 -44
  262. package/src/demo/AIDemo.tsx +50 -0
  263. package/src/demo/ButtonsDemo.tsx +41 -18
  264. package/src/demo/CalendarDemo.tsx +1 -1
  265. package/src/demo/FeedbackDemo.tsx +4 -6
  266. package/src/demo/FormsDemo.tsx +34 -11
  267. package/src/demo/NavigationDemo.tsx +38 -13
  268. package/src/demo/OverlaysDemo.tsx +22 -36
  269. package/src/demo/update-demos.js +82 -0
  270. package/src/index.css +66 -46
  271. package/src/lib/utils.ts +3 -3
  272. package/src/stories/Button.stories.ts +54 -0
  273. package/src/stories/Button.tsx +36 -0
  274. package/src/stories/Configure.mdx +388 -0
  275. package/src/stories/Header.stories.ts +34 -0
  276. package/src/stories/Header.tsx +55 -0
  277. package/src/stories/Page.stories.ts +33 -0
  278. package/src/stories/Page.tsx +73 -0
  279. package/src/stories/assets/accessibility.png +0 -0
  280. package/src/stories/assets/accessibility.svg +1 -0
  281. package/src/stories/assets/addon-library.png +0 -0
  282. package/src/stories/assets/assets.png +0 -0
  283. package/src/stories/assets/avif-test-image.avif +0 -0
  284. package/src/stories/assets/context.png +0 -0
  285. package/src/stories/assets/discord.svg +1 -0
  286. package/src/stories/assets/docs.png +0 -0
  287. package/src/stories/assets/figma-plugin.png +0 -0
  288. package/src/stories/assets/github.svg +1 -0
  289. package/src/stories/assets/share.png +0 -0
  290. package/src/stories/assets/styling.png +0 -0
  291. package/src/stories/assets/testing.png +0 -0
  292. package/src/stories/assets/theming.png +0 -0
  293. package/src/stories/assets/tutorials.svg +1 -0
  294. package/src/stories/assets/youtube.svg +1 -0
  295. package/src/stories/button.css +30 -0
  296. package/src/stories/header.css +32 -0
  297. package/src/stories/page.css +68 -0
@@ -0,0 +1,324 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Questionnaire as QuestionnairePrimitive } from "@shadcn/react/questionnaire"
5
+
6
+ import { cn } from "@/lib/utils"
7
+ import { buttonVariants, type Button } from "@/components/ui/button"
8
+ import { CheckIcon } from "lucide-react"
9
+
10
+ function Questionnaire({
11
+ className,
12
+ ...props
13
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Root>) {
14
+ return (
15
+ <QuestionnairePrimitive.Root
16
+ data-slot="questionnaire"
17
+ className={cn("flex w-full min-w-0 flex-col gap-4", className)}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ function QuestionnaireProgress({
24
+ className,
25
+ ...props
26
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Progress>) {
27
+ return (
28
+ <QuestionnairePrimitive.Progress
29
+ data-slot="questionnaire-progress"
30
+ className={cn(
31
+ "min-h-[1lh] w-fit min-w-[14ch] text-xs font-medium text-muted-foreground tabular-nums",
32
+ className
33
+ )}
34
+ {...props}
35
+ />
36
+ )
37
+ }
38
+
39
+ function QuestionnaireItem({
40
+ className,
41
+ ...props
42
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Item>) {
43
+ return (
44
+ <QuestionnairePrimitive.Item
45
+ data-slot="questionnaire-item"
46
+ className={cn(
47
+ "flex min-w-0 flex-col gap-4 border-0 p-0 outline-none",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ )
53
+ }
54
+
55
+ function QuestionnaireTitle({
56
+ className,
57
+ ...props
58
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Title>) {
59
+ return (
60
+ <QuestionnairePrimitive.Title
61
+ data-slot="questionnaire-title"
62
+ className={cn(
63
+ "font-heading text-base leading-snug font-medium text-pretty [&:not(:has(~[data-slot=questionnaire-description]))]:mb-4",
64
+ className
65
+ )}
66
+ {...props}
67
+ />
68
+ )
69
+ }
70
+
71
+ function QuestionnaireDescription({
72
+ className,
73
+ ...props
74
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Description>) {
75
+ return (
76
+ <QuestionnairePrimitive.Description
77
+ data-slot="questionnaire-description"
78
+ className={cn("text-sm text-pretty text-muted-foreground", className)}
79
+ {...props}
80
+ />
81
+ )
82
+ }
83
+
84
+ function QuestionnaireChoices({
85
+ className,
86
+ ...props
87
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Choices>) {
88
+ return (
89
+ <QuestionnairePrimitive.Choices
90
+ data-slot="questionnaire-choices"
91
+ className={cn(
92
+ "group/questionnaire-choices grid min-w-0 gap-2",
93
+ className
94
+ )}
95
+ {...props}
96
+ />
97
+ )
98
+ }
99
+
100
+ function QuestionnaireChoice({
101
+ children,
102
+ className,
103
+ ...props
104
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Choice>) {
105
+ return (
106
+ <QuestionnairePrimitive.Choice
107
+ data-slot="questionnaire-choice"
108
+ className={cn(
109
+ "group/questionnaire-choice relative flex min-h-11 cursor-pointer items-start gap-2.5 rounded-lg border border-input bg-transparent px-3 py-2.5 text-start text-sm transition-colors outline-none select-none hover:bg-muted/50 has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-3 has-[>input:focus-visible]:ring-ring/50 data-invalid:border-destructive dark:bg-input/20 data-checked:border-primary/40 data-checked:bg-muted dark:data-checked:bg-muted",
110
+ "data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
111
+ className
112
+ )}
113
+ {...props}
114
+ >
115
+ <QuestionnairePrimitive.ChoiceInput
116
+ data-slot="questionnaire-choice-input"
117
+ className="absolute inset-0 z-10 size-full cursor-pointer opacity-0"
118
+ />
119
+ <span
120
+ aria-hidden="true"
121
+ data-slot="questionnaire-choice-indicator"
122
+ className="pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-[4px] border border-input group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=radio]/questionnaire-choice:rounded-full group-data-checked/questionnaire-choice:border-primary group-data-checked/questionnaire-choice:bg-primary group-data-checked/questionnaire-choice:text-primary-foreground dark:bg-input/30 dark:group-data-checked/questionnaire-choice:bg-primary"
123
+ >
124
+ <span
125
+ data-slot="questionnaire-choice-indicator-dot"
126
+ className="hidden size-2 rounded-full bg-primary-foreground group-data-[type=checkbox]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block"
127
+ />
128
+ <CheckIcon data-slot="questionnaire-choice-indicator-check" className="hidden size-3.5 group-data-[type=radio]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block" />
129
+ </span>
130
+ <QuestionnairePrimitive.ChoiceLabel
131
+ data-slot="questionnaire-choice-label"
132
+ className="flex min-w-0 flex-1 flex-col gap-0.5 leading-snug"
133
+ >
134
+ {children}
135
+ </QuestionnairePrimitive.ChoiceLabel>
136
+ <QuestionnairePrimitive.ChoiceShortcut
137
+ data-slot="questionnaire-choice-shortcut"
138
+ className="pointer-events-none ms-auto hidden size-5 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-md border border-input bg-background font-mono text-[0.625rem] leading-none font-medium text-muted-foreground group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[shortcut]/questionnaire-choice:inline-flex"
139
+ />
140
+ </QuestionnairePrimitive.Choice>
141
+ )
142
+ }
143
+
144
+ function QuestionnaireChoiceDescription({
145
+ className,
146
+ ...props
147
+ }: React.ComponentProps<"span">) {
148
+ return (
149
+ <span
150
+ data-slot="questionnaire-choice-description"
151
+ className={cn("text-muted-foreground", className)}
152
+ {...props}
153
+ />
154
+ )
155
+ }
156
+
157
+ function QuestionnaireInput({
158
+ className,
159
+ ...props
160
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Input>) {
161
+ return (
162
+ <div
163
+ data-slot="questionnaire-input-wrapper"
164
+ className="group/questionnaire-input relative w-full min-w-0"
165
+ >
166
+ <QuestionnairePrimitive.Input
167
+ data-slot="questionnaire-input"
168
+ className={cn(
169
+ "h-8 min-h-11 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-[color,box-shadow,background-color] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 sm:min-h-0 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
170
+ "selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground",
171
+ className
172
+ )}
173
+ {...props}
174
+ />
175
+ </div>
176
+ )
177
+ }
178
+
179
+ function QuestionnaireError({
180
+ className,
181
+ ...props
182
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Error>) {
183
+ return (
184
+ <QuestionnairePrimitive.Error
185
+ data-slot="questionnaire-error"
186
+ className={cn("mt-2 text-sm text-destructive", className)}
187
+ {...props}
188
+ />
189
+ )
190
+ }
191
+
192
+ function QuestionnaireActions({
193
+ className,
194
+ ...props
195
+ }: React.ComponentProps<"div">) {
196
+ return (
197
+ <div
198
+ data-slot="questionnaire-actions"
199
+ className={cn(
200
+ "grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 sm:min-h-8",
201
+ className
202
+ )}
203
+ {...props}
204
+ />
205
+ )
206
+ }
207
+
208
+ function QuestionnairePrevious({
209
+ children,
210
+ className,
211
+ size = "default",
212
+ variant = "outline",
213
+ ...props
214
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Previous> &
215
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
216
+ return (
217
+ <QuestionnairePrimitive.Previous
218
+ data-slot="questionnaire-previous"
219
+ data-size={size}
220
+ data-variant={variant}
221
+ className={cn(
222
+ buttonVariants({ size, variant }),
223
+ "col-start-1 row-start-1 min-h-11 justify-self-start sm:min-h-0",
224
+ className
225
+ )}
226
+ {...props}
227
+ >
228
+ {children ?? "Previous"}
229
+ </QuestionnairePrimitive.Previous>
230
+ )
231
+ }
232
+
233
+ function QuestionnaireSkip({
234
+ children,
235
+ className,
236
+ size = "default",
237
+ variant = "outline",
238
+ ...props
239
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Skip> &
240
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
241
+ return (
242
+ <QuestionnairePrimitive.Skip
243
+ data-slot="questionnaire-skip"
244
+ data-size={size}
245
+ data-variant={variant}
246
+ className={cn(
247
+ buttonVariants({ size, variant }),
248
+ "col-start-2 row-start-1 min-h-11 justify-self-end sm:min-h-0",
249
+ className
250
+ )}
251
+ {...props}
252
+ >
253
+ {children ?? "Skip"}
254
+ </QuestionnairePrimitive.Skip>
255
+ )
256
+ }
257
+
258
+ function QuestionnaireNext({
259
+ children,
260
+ className,
261
+ size = "default",
262
+ variant = "default",
263
+ ...props
264
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Next> &
265
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
266
+ return (
267
+ <QuestionnairePrimitive.Next
268
+ data-slot="questionnaire-next"
269
+ data-size={size}
270
+ data-variant={variant}
271
+ className={cn(
272
+ buttonVariants({ size, variant }),
273
+ "col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0",
274
+ className
275
+ )}
276
+ {...props}
277
+ >
278
+ {children ?? "Next"}
279
+ </QuestionnairePrimitive.Next>
280
+ )
281
+ }
282
+
283
+ function QuestionnaireSubmit({
284
+ children,
285
+ className,
286
+ size = "default",
287
+ variant = "default",
288
+ ...props
289
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Submit> &
290
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
291
+ return (
292
+ <QuestionnairePrimitive.Submit
293
+ data-slot="questionnaire-submit"
294
+ data-size={size}
295
+ data-variant={variant}
296
+ className={cn(
297
+ buttonVariants({ size, variant }),
298
+ "col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0",
299
+ className
300
+ )}
301
+ {...props}
302
+ >
303
+ {children ?? "Submit"}
304
+ </QuestionnairePrimitive.Submit>
305
+ )
306
+ }
307
+
308
+ export {
309
+ Questionnaire,
310
+ QuestionnaireActions,
311
+ QuestionnaireChoice,
312
+ QuestionnaireChoiceDescription,
313
+ QuestionnaireChoices,
314
+ QuestionnaireDescription,
315
+ QuestionnaireError,
316
+ QuestionnaireInput,
317
+ QuestionnaireItem,
318
+ QuestionnaireNext,
319
+ QuestionnairePrevious,
320
+ QuestionnaireProgress,
321
+ QuestionnaireSkip,
322
+ QuestionnaireSubmit,
323
+ QuestionnaireTitle,
324
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { RadioGroup, RadioGroupItem } from "./radio-group"; import { Label } from "./label";
3
+
4
+ const meta = {
5
+ title: 'Design System/RadioGroup',
6
+ parameters: { layout: 'centered' },
7
+ tags: ['autodocs'],
8
+ } satisfies Meta;
9
+
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const Default: Story = {
14
+ render: () => (
15
+ <div className="p-4 w-full h-full flex items-center justify-center">
16
+ <RadioGroup defaultValue="option-one"><div className="flex items-center space-x-2"><RadioGroupItem value="option-one" id="option-one" /><Label htmlFor="option-one">Option One</Label></div><div className="flex items-center space-x-2"><RadioGroupItem value="option-two" id="option-two" /><Label htmlFor="option-two">Option Two</Label></div></RadioGroup>
17
+ </div>
18
+ )
19
+ };
@@ -0,0 +1,14 @@
1
+ import { render } from '@testing-library/react';
2
+ import { axe } from 'jest-axe';
3
+ import { RadioGroup, RadioGroupItem } from "./radio-group"; import { Label } from "./label";
4
+
5
+ describe('RadioGroup Accessibility', () => {
6
+ it('should have no accessibility violations in basic render', async () => {
7
+ const Wrapper = () => (
8
+ <RadioGroup defaultValue="option-one"><div className="flex items-center space-x-2"><RadioGroupItem value="option-one" id="option-one" /><Label htmlFor="option-one">Option One</Label></div><div className="flex items-center space-x-2"><RadioGroupItem value="option-two" id="option-two" /><Label htmlFor="option-two">Option Two</Label></div></RadioGroup>
9
+ );
10
+ const { container } = render(<Wrapper />);
11
+ const results = await axe(container);
12
+ expect(results).toHaveNoViolations();
13
+ });
14
+ });
@@ -1,42 +1,37 @@
1
- import * as React from "react"
2
- import { CircleIcon } from "lucide-react"
3
- import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
1
+ "use client"
2
+
3
+ import { Radio as RadioPrimitive } from "@base-ui/react/radio"
4
+ import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group"
4
5
 
5
6
  import { cn } from "@/lib/utils"
6
7
 
7
- function RadioGroup({
8
- className,
9
- ...props
10
- }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
8
+ function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
11
9
  return (
12
- <RadioGroupPrimitive.Root
10
+ <RadioGroupPrimitive
13
11
  data-slot="radio-group"
14
- className={cn("grid gap-3", className)}
12
+ className={cn("grid w-full gap-2", className)}
15
13
  {...props}
16
14
  />
17
15
  )
18
16
  }
19
17
 
20
- function RadioGroupItem({
21
- className,
22
- ...props
23
- }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
18
+ function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
24
19
  return (
25
- <RadioGroupPrimitive.Item
20
+ <RadioPrimitive.Root
26
21
  data-slot="radio-group-item"
27
22
  className={cn(
28
- "aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
23
+ "group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary cursor-pointer cursor-pointer",
29
24
  className
30
25
  )}
31
26
  {...props}
32
27
  >
33
- <RadioGroupPrimitive.Indicator
28
+ <RadioPrimitive.Indicator
34
29
  data-slot="radio-group-indicator"
35
- className="relative flex items-center justify-center"
30
+ className="flex size-4 items-center justify-center"
36
31
  >
37
- <CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" />
38
- </RadioGroupPrimitive.Indicator>
39
- </RadioGroupPrimitive.Item>
32
+ <span className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" />
33
+ </RadioPrimitive.Indicator>
34
+ </RadioPrimitive.Root>
40
35
  )
41
36
  }
42
37
 
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "./resizable";
3
+
4
+ const meta = {
5
+ title: 'Design System/Resizable',
6
+ parameters: { layout: 'centered' },
7
+ tags: ['autodocs'],
8
+ } satisfies Meta;
9
+
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const Default: Story = {
14
+ render: () => (
15
+ <div className="p-4 w-full h-full flex items-center justify-center">
16
+ <ResizablePanelGroup className="max-w-md rounded-lg border"><ResizablePanel defaultSize={50}><div className="flex h-[200px] items-center justify-center p-6">One</div></ResizablePanel><ResizableHandle /><ResizablePanel defaultSize={50}><div className="flex h-[200px] items-center justify-center p-6">Two</div></ResizablePanel></ResizablePanelGroup>
17
+ </div>
18
+ )
19
+ };
@@ -0,0 +1,14 @@
1
+ import { render } from '@testing-library/react';
2
+ import { axe } from 'jest-axe';
3
+ import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "./resizable";
4
+
5
+ describe('Resizable Accessibility', () => {
6
+ it('should have no accessibility violations in basic render', async () => {
7
+ const Wrapper = () => (
8
+ <ResizablePanelGroup className="max-w-md rounded-lg border"><ResizablePanel defaultSize={50}><div className="flex h-[200px] items-center justify-center p-6">One</div></ResizablePanel><ResizableHandle /><ResizablePanel defaultSize={50}><div className="flex h-[200px] items-center justify-center p-6">Two</div></ResizablePanel></ResizablePanelGroup>
9
+ );
10
+ const { container } = render(<Wrapper />);
11
+ const results = await axe(container);
12
+ expect(results).toHaveNoViolations();
13
+ });
14
+ });
@@ -1,43 +1,50 @@
1
1
  "use client"
2
2
 
3
- import { GripVertical } from "lucide-react"
4
3
  import * as ResizablePrimitive from "react-resizable-panels"
5
4
 
6
5
  import { cn } from "@/lib/utils"
7
6
 
8
- const ResizablePanelGroup = ({
7
+ function ResizablePanelGroup({
9
8
  className,
10
9
  ...props
11
- }: React.ComponentProps<typeof ResizablePrimitive.Group>) => (
12
- <ResizablePrimitive.Group
13
- className={cn(
14
- "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
15
- className
16
- )}
17
- {...props}
18
- />
19
- )
10
+ }: ResizablePrimitive.GroupProps) {
11
+ return (
12
+ <ResizablePrimitive.Group
13
+ data-slot="resizable-panel-group"
14
+ className={cn(
15
+ "flex h-full w-full aria-[orientation=vertical]:flex-col",
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ )
21
+ }
20
22
 
21
- const ResizablePanel = ResizablePrimitive.Panel
23
+ function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
24
+ return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
25
+ }
22
26
 
23
- const ResizableHandle = ({
24
- children,
27
+ function ResizableHandle({
28
+ withHandle,
25
29
  className,
26
30
  ...props
27
- }: React.ComponentProps<typeof ResizablePrimitive.Separator>) => (
28
- <ResizablePrimitive.Separator
29
- className={cn(
30
- "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
31
- className
32
- )}
33
- {...props}
34
- >
35
- {children ?? (
36
- <div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
37
- <GripVertical className="h-2.5 w-2.5" />
38
- </div>
39
- )}
40
- </ResizablePrimitive.Separator>
41
- )
31
+ }: ResizablePrimitive.SeparatorProps & {
32
+ withHandle?: boolean
33
+ }) {
34
+ return (
35
+ <ResizablePrimitive.Separator
36
+ data-slot="resizable-handle"
37
+ className={cn(
38
+ "relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
39
+ className
40
+ )}
41
+ {...props}
42
+ >
43
+ {withHandle && (
44
+ <div className="z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border" />
45
+ )}
46
+ </ResizablePrimitive.Separator>
47
+ )
48
+ }
42
49
 
43
- export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
50
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { ScrollArea } from "./scroll-area";
3
+
4
+ const meta = {
5
+ title: 'Design System/ScrollArea',
6
+ parameters: { layout: 'centered' },
7
+ tags: ['autodocs'],
8
+ } satisfies Meta;
9
+
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const Default: Story = {
14
+ render: () => (
15
+ <div className="p-4 w-full h-full flex items-center justify-center">
16
+ <ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">Jokester began sneaking into the castle in the middle of the night and leaving jokes all over the place.</ScrollArea>
17
+ </div>
18
+ )
19
+ };
@@ -0,0 +1,14 @@
1
+ import { render } from '@testing-library/react';
2
+ import { axe } from 'jest-axe';
3
+ import { ScrollArea } from "./scroll-area";
4
+
5
+ describe('ScrollArea Accessibility', () => {
6
+ it('should have no accessibility violations in basic render', async () => {
7
+ const Wrapper = () => (
8
+ <ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">Jokester began sneaking into the castle in the middle of the night and leaving jokes all over the place.</ScrollArea>
9
+ );
10
+ const { container } = render(<Wrapper />);
11
+ const results = await axe(container);
12
+ expect(results).toHaveNoViolations();
13
+ });
14
+ });
@@ -1,32 +1,54 @@
1
- "use client";
1
+ "use client"
2
2
 
3
- import { cn } from "@/lib/utils";
4
- import * as React from "react";
3
+ import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
5
4
 
6
- export type ScrollAreaProps = {
7
- className?: string;
8
- children?: React.ReactNode;
9
- };
5
+ import { cn } from "@/lib/utils"
10
6
 
11
- const ScrollArea = React.memo(function ScrollArea({
7
+ function ScrollArea({
12
8
  className,
13
9
  children,
14
- }: ScrollAreaProps) {
10
+ ...props
11
+ }: ScrollAreaPrimitive.Root.Props) {
15
12
  return (
16
- <div
13
+ <ScrollAreaPrimitive.Root
17
14
  data-slot="scroll-area"
18
- className={cn("relative overflow-auto", className)}
15
+ className={cn("relative", className)}
16
+ {...props}
19
17
  >
20
- <div
18
+ <ScrollAreaPrimitive.Viewport
21
19
  data-slot="scroll-area-viewport"
22
- className="size-full rounded-[inherit]"
20
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
23
21
  >
24
22
  {children}
25
- </div>
26
- </div>
27
- );
28
- });
23
+ </ScrollAreaPrimitive.Viewport>
24
+ <ScrollBar />
25
+ <ScrollAreaPrimitive.Corner />
26
+ </ScrollAreaPrimitive.Root>
27
+ )
28
+ }
29
29
 
30
- const ScrollBar = () => null;
30
+ function ScrollBar({
31
+ className,
32
+ orientation = "vertical",
33
+ ...props
34
+ }: ScrollAreaPrimitive.Scrollbar.Props) {
35
+ return (
36
+ <ScrollAreaPrimitive.Scrollbar
37
+ data-slot="scroll-area-scrollbar"
38
+ data-orientation={orientation}
39
+ orientation={orientation}
40
+ className={cn(
41
+ "flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",
42
+ className
43
+ )}
44
+ {...props}
45
+ >
46
+ <ScrollAreaPrimitive.Thumb
47
+ data-slot="scroll-area-thumb"
48
+ className="relative flex-1 rounded-full bg-border"
49
+ />
50
+ </ScrollAreaPrimitive.Scrollbar>
51
+ )
52
+ }
31
53
 
32
- export { ScrollArea, ScrollBar };
54
+ export { ScrollArea, ScrollBar }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from "./select";
3
+
4
+ const meta = {
5
+ title: 'Design System/Select',
6
+ parameters: { layout: 'centered' },
7
+ tags: ['autodocs'],
8
+ } satisfies Meta;
9
+
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const Default: Story = {
14
+ render: () => (
15
+ <div className="p-4 w-full h-full flex items-center justify-center">
16
+ <Select><SelectTrigger aria-label="Select a theme" className="w-[180px]"><SelectValue placeholder="Theme" /></SelectTrigger><SelectContent><SelectItem value="light">Light</SelectItem><SelectItem value="dark">Dark</SelectItem><SelectItem value="system">System</SelectItem></SelectContent></Select>
17
+ </div>
18
+ )
19
+ };