@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
@@ -1,110 +1,141 @@
1
+ "use client"
2
+
1
3
  import * as React from "react"
2
- import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
3
4
 
4
5
  import { cn } from "@/lib/utils"
5
- import { type ButtonProps, buttonVariants } from "@/components/ui/button"
6
+ import { Button } from "@/components/ui/button"
7
+ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
8
+ import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
6
9
 
7
- const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
8
- <nav
9
- role="navigation"
10
- aria-label="pagination"
11
- className={cn("mx-auto flex w-full justify-center", className)}
12
- {...props}
13
- />
14
- )
15
- Pagination.displayName = "Pagination"
10
+ function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
11
+ return (
12
+ <nav
13
+ role="navigation"
14
+ aria-label="pagination"
15
+ data-slot="pagination"
16
+ className={cn("mx-auto flex w-full justify-center", className)}
17
+ {...props}
18
+ />
19
+ )
20
+ }
16
21
 
17
- const PaginationContent = React.forwardRef<
18
- HTMLUListElement,
19
- React.ComponentProps<"ul">
20
- >(({ className, ...props }, ref) => (
21
- <ul
22
- ref={ref}
23
- className={cn("flex flex-row items-center gap-1", className)}
24
- {...props}
25
- />
26
- ))
27
- PaginationContent.displayName = "PaginationContent"
22
+ function PaginationContent({
23
+ className,
24
+ ...props
25
+ }: React.ComponentProps<"ul">) {
26
+ return (
27
+ <ul
28
+ data-slot="pagination-content"
29
+ className={cn("flex items-center gap-0.5", className)}
30
+ {...props}
31
+ />
32
+ )
33
+ }
28
34
 
29
- const PaginationItem = React.forwardRef<
30
- HTMLLIElement,
31
- React.ComponentProps<"li">
32
- >(({ className, ...props }, ref) => (
33
- <li ref={ref} className={cn("", className)} {...props} />
34
- ))
35
- PaginationItem.displayName = "PaginationItem"
35
+ function PaginationItem({ ...props }: React.ComponentProps<"li">) {
36
+ return <li data-slot="pagination-item" {...props} />
37
+ }
36
38
 
37
39
  type PaginationLinkProps = {
38
40
  isActive?: boolean
39
- } & Pick<ButtonProps, "size"> &
41
+ } & Pick<React.ComponentProps<typeof Button>, "size"> &
40
42
  React.ComponentProps<"a">
41
43
 
42
- const PaginationLink = ({
44
+ function PaginationLink({
43
45
  className,
44
46
  isActive,
45
47
  size = "icon",
46
48
  ...props
47
- }: PaginationLinkProps) => (
48
- <a
49
- aria-current={isActive ? "page" : undefined}
50
- className={cn(
51
- buttonVariants({
52
- variant: isActive ? "outline" : "ghost",
53
- size,
54
- }),
55
- className
56
- )}
57
- {...props}
58
- />
59
- )
60
- PaginationLink.displayName = "PaginationLink"
49
+ }: PaginationLinkProps) {
50
+ return (
51
+ <Button
52
+ variant={isActive ? "outline" : "ghost"}
53
+ size={size}
54
+ className={cn(className)}
55
+ nativeButton={false}
56
+ render={
57
+ // eslint-disable-next-line jsx-a11y/anchor-has-content -- children pass through {...props}
58
+ <a
59
+ aria-current={isActive ? "page" : undefined}
60
+ data-slot="pagination-link"
61
+ data-active={isActive}
62
+ {...props}
63
+ />
64
+ }
65
+ />
66
+ )
67
+ }
61
68
 
62
- const PaginationPrevious = ({
69
+ function PaginationPrevious({
63
70
  className,
71
+ text = "Previous",
64
72
  ...props
65
- }: React.ComponentProps<typeof PaginationLink>) => (
66
- <PaginationLink
67
- aria-label="Go to previous page"
68
- size="default"
69
- className={cn("gap-1 pl-2.5", className)}
70
- {...props}
71
- >
72
- <ChevronLeft className="h-4 w-4" />
73
- <span>Previous</span>
74
- </PaginationLink>
75
- )
76
- PaginationPrevious.displayName = "PaginationPrevious"
73
+ }: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
74
+ return (
75
+ <Tooltip>
76
+ <TooltipTrigger
77
+ render={
78
+ <PaginationLink
79
+ aria-label="Go to previous page"
80
+ size="default"
81
+ className={cn("pl-1.5!", className)}
82
+ {...props}
83
+ >
84
+ <ChevronLeftIcon data-icon="inline-start" />
85
+ <span className="hidden sm:block">{text}</span>
86
+ </PaginationLink>
87
+ }
88
+ />
89
+ <TooltipContent>Voltar</TooltipContent>
90
+ </Tooltip>
91
+ )
92
+ }
77
93
 
78
- const PaginationNext = ({
94
+ function PaginationNext({
79
95
  className,
96
+ text = "Next",
80
97
  ...props
81
- }: React.ComponentProps<typeof PaginationLink>) => (
82
- <PaginationLink
83
- aria-label="Go to next page"
84
- size="default"
85
- className={cn("gap-1 pr-2.5", className)}
86
- {...props}
87
- >
88
- <span>Next</span>
89
- <ChevronRight className="h-4 w-4" />
90
- </PaginationLink>
91
- )
92
- PaginationNext.displayName = "PaginationNext"
98
+ }: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
99
+ return (
100
+ <Tooltip>
101
+ <TooltipTrigger
102
+ render={
103
+ <PaginationLink
104
+ aria-label="Go to next page"
105
+ size="default"
106
+ className={cn("pr-1.5!", className)}
107
+ {...props}
108
+ >
109
+ <span className="hidden sm:block">{text}</span>
110
+ <ChevronRightIcon data-icon="inline-end" />
111
+ </PaginationLink>
112
+ }
113
+ />
114
+ <TooltipContent>Próximo</TooltipContent>
115
+ </Tooltip>
116
+ )
117
+ }
93
118
 
94
- const PaginationEllipsis = ({
119
+ function PaginationEllipsis({
95
120
  className,
96
121
  ...props
97
- }: React.ComponentProps<"span">) => (
98
- <span
99
- aria-hidden
100
- className={cn("flex h-9 w-9 items-center justify-center", className)}
101
- {...props}
102
- >
103
- <MoreHorizontal className="h-4 w-4" />
104
- <span className="sr-only">More pages</span>
105
- </span>
106
- )
107
- PaginationEllipsis.displayName = "PaginationEllipsis"
122
+ }: React.ComponentProps<"span">) {
123
+ return (
124
+ <span
125
+ aria-hidden
126
+ data-slot="pagination-ellipsis"
127
+ className={cn(
128
+ "flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
129
+ className
130
+ )}
131
+ {...props}
132
+ >
133
+ <MoreHorizontalIcon
134
+ />
135
+ <span className="sr-only">More pages</span>
136
+ </span>
137
+ )
138
+ }
108
139
 
109
140
  export {
110
141
  Pagination,
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Popover, PopoverTrigger, PopoverContent } from "./popover";
3
+
4
+ const meta = {
5
+ title: 'Design System/Popover',
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
+ <Popover><PopoverTrigger className="px-4 py-2 border rounded">Open popover</PopoverTrigger><PopoverContent className="w-80">Place content for the popover here.</PopoverContent></Popover>
17
+ </div>
18
+ )
19
+ };
@@ -0,0 +1,14 @@
1
+ import { render } from '@testing-library/react';
2
+ import { axe } from 'jest-axe';
3
+ import { Popover, PopoverTrigger, PopoverContent } from "./popover";
4
+
5
+ describe('Popover Accessibility', () => {
6
+ it('should have no accessibility violations in basic render', async () => {
7
+ const Wrapper = () => (
8
+ <Popover><PopoverTrigger className="px-4 py-2 border rounded">Open popover</PopoverTrigger><PopoverContent className="w-80">Place content for the popover here.</PopoverContent></Popover>
9
+ );
10
+ const { container } = render(<Wrapper />);
11
+ const results = await axe(container);
12
+ expect(results).toHaveNoViolations();
13
+ });
14
+ });
@@ -1,55 +1,90 @@
1
- "use client";
1
+ "use client"
2
2
 
3
- import * as React from "react";
4
- import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ import * as React from "react"
4
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover"
5
5
 
6
- import { cn } from "@/lib/utils";
6
+ import { cn } from "@/lib/utils"
7
7
 
8
- function Popover({
9
- ...props
10
- }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
- return <PopoverPrimitive.Root data-slot="popover" {...props} />;
8
+ function Popover({ ...props }: PopoverPrimitive.Root.Props) {
9
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
10
  }
13
11
 
14
- function PopoverTrigger({
15
- className,
16
- ...props
17
- }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
18
- return (
19
- <PopoverPrimitive.Trigger
20
- data-slot="popover-trigger"
21
- className={cn("cursor-pointer", className)}
22
- {...props}
23
- />
24
- );
12
+ function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
13
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
25
14
  }
26
15
 
27
16
  function PopoverContent({
28
17
  className,
29
18
  align = "center",
19
+ alignOffset = 0,
20
+ side = "bottom",
30
21
  sideOffset = 4,
31
22
  ...props
32
- }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
23
+ }: PopoverPrimitive.Popup.Props &
24
+ Pick<
25
+ PopoverPrimitive.Positioner.Props,
26
+ "align" | "alignOffset" | "side" | "sideOffset"
27
+ >) {
33
28
  return (
34
29
  <PopoverPrimitive.Portal>
35
- <PopoverPrimitive.Content
36
- data-slot="popover-content"
30
+ <PopoverPrimitive.Positioner
37
31
  align={align}
32
+ alignOffset={alignOffset}
33
+ side={side}
38
34
  sideOffset={sideOffset}
39
- className={cn(
40
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
41
- className
42
- )}
43
- {...props}
44
- />
35
+ className="isolate z-50"
36
+ >
37
+ <PopoverPrimitive.Popup
38
+ data-slot="popover-content"
39
+ className={cn(
40
+ "z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ </PopoverPrimitive.Positioner>
45
46
  </PopoverPrimitive.Portal>
46
- );
47
+ )
48
+ }
49
+
50
+ function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
51
+ return (
52
+ <div
53
+ data-slot="popover-header"
54
+ className={cn("flex flex-col gap-0.5 text-sm", className)}
55
+ {...props}
56
+ />
57
+ )
47
58
  }
48
59
 
49
- function PopoverAnchor({
60
+ function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {
61
+ return (
62
+ <PopoverPrimitive.Title
63
+ data-slot="popover-title"
64
+ className={cn("font-medium", className)}
65
+ {...props}
66
+ />
67
+ )
68
+ }
69
+
70
+ function PopoverDescription({
71
+ className,
50
72
  ...props
51
- }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
52
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
73
+ }: PopoverPrimitive.Description.Props) {
74
+ return (
75
+ <PopoverPrimitive.Description
76
+ data-slot="popover-description"
77
+ className={cn("text-muted-foreground", className)}
78
+ {...props}
79
+ />
80
+ )
53
81
  }
54
82
 
55
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
83
+ export {
84
+ Popover,
85
+ PopoverContent,
86
+ PopoverDescription,
87
+ PopoverHeader,
88
+ PopoverTitle,
89
+ PopoverTrigger,
90
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Progress } from "./progress";
3
+
4
+ const meta = {
5
+ title: 'Design System/Progress',
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
+ <Progress value={33} aria-label="Loading progress" className="w-[60%]" />
17
+ </div>
18
+ )
19
+ };
@@ -0,0 +1,14 @@
1
+ import { render } from '@testing-library/react';
2
+ import { axe } from 'jest-axe';
3
+ import { Progress } from "./progress";
4
+
5
+ describe('Progress Accessibility', () => {
6
+ it('should have no accessibility violations in basic render', async () => {
7
+ const Wrapper = () => (
8
+ <Progress value={33} aria-label="Loading progress" className="w-[60%]" />
9
+ );
10
+ const { container } = render(<Wrapper />);
11
+ const results = await axe(container);
12
+ expect(results).toHaveNoViolations();
13
+ });
14
+ });
@@ -1,31 +1,83 @@
1
- "use client";
1
+ "use client"
2
2
 
3
- import * as React from "react";
4
- import * as ProgressPrimitive from "@radix-ui/react-progress";
3
+ import { Progress as ProgressPrimitive } from "@base-ui/react/progress"
5
4
 
6
- import { cn } from "@/lib/utils";
5
+ import { cn } from "@/lib/utils"
7
6
 
8
7
  function Progress({
9
8
  className,
9
+ children,
10
10
  value,
11
11
  ...props
12
- }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
12
+ }: ProgressPrimitive.Root.Props) {
13
13
  return (
14
14
  <ProgressPrimitive.Root
15
+ value={value}
15
16
  data-slot="progress"
17
+ className={cn("flex flex-wrap gap-3", className)}
18
+ {...props}
19
+ >
20
+ {children}
21
+ <ProgressTrack>
22
+ <ProgressIndicator />
23
+ </ProgressTrack>
24
+ </ProgressPrimitive.Root>
25
+ )
26
+ }
27
+
28
+ function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {
29
+ return (
30
+ <ProgressPrimitive.Track
16
31
  className={cn(
17
- "bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
32
+ "relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",
18
33
  className
19
34
  )}
35
+ data-slot="progress-track"
20
36
  {...props}
21
- >
22
- <ProgressPrimitive.Indicator
23
- data-slot="progress-indicator"
24
- className="bg-primary h-full w-full flex-1 transition-all"
25
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
26
- />
27
- </ProgressPrimitive.Root>
28
- );
37
+ />
38
+ )
39
+ }
40
+
41
+ function ProgressIndicator({
42
+ className,
43
+ ...props
44
+ }: ProgressPrimitive.Indicator.Props) {
45
+ return (
46
+ <ProgressPrimitive.Indicator
47
+ data-slot="progress-indicator"
48
+ className={cn("h-full bg-primary transition-all", className)}
49
+ {...props}
50
+ />
51
+ )
29
52
  }
30
53
 
31
- export { Progress };
54
+ function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {
55
+ return (
56
+ <ProgressPrimitive.Label
57
+ className={cn("text-sm font-medium", className)}
58
+ data-slot="progress-label"
59
+ {...props}
60
+ />
61
+ )
62
+ }
63
+
64
+ function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {
65
+ return (
66
+ <ProgressPrimitive.Value
67
+ className={cn(
68
+ "ml-auto text-sm text-muted-foreground tabular-nums",
69
+ className
70
+ )}
71
+ data-slot="progress-value"
72
+ {...props}
73
+ />
74
+ )
75
+ }
76
+
77
+ export {
78
+ Progress,
79
+ ProgressTrack,
80
+ ProgressIndicator,
81
+ ProgressLabel,
82
+ ProgressValue,
83
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Questionnaire } from "./questionnaire";
3
+
4
+ const meta = {
5
+ title: 'Design System/Questionnaire',
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
+ <Questionnaire />
17
+ </div>
18
+ )
19
+ };
@@ -0,0 +1,14 @@
1
+ import { render } from '@testing-library/react';
2
+ import { axe } from 'jest-axe';
3
+ import { Questionnaire } from "./questionnaire";
4
+
5
+ describe('Questionnaire Accessibility', () => {
6
+ it('should have no accessibility violations in basic render', async () => {
7
+ const Wrapper = () => (
8
+ <Questionnaire />
9
+ );
10
+ const { container } = render(<Wrapper />);
11
+ const results = await axe(container);
12
+ expect(results).toHaveNoViolations();
13
+ });
14
+ });