@rojaostudio/ds 1.0.1 → 2.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/README.md +75 -13
  2. package/dist/compat/generate.d.ts +0 -1
  3. package/dist/components/accordion.d.ts +30 -20
  4. package/dist/components/accordion.js +31 -87
  5. package/dist/components/action-bar.d.ts +24 -0
  6. package/dist/components/action-bar.js +55 -0
  7. package/dist/components/alert-dialog.d.ts +31 -0
  8. package/dist/components/alert-dialog.js +43 -0
  9. package/dist/components/alert.d.ts +31 -19
  10. package/dist/components/alert.js +74 -65
  11. package/dist/components/attachment.d.ts +37 -0
  12. package/dist/components/attachment.js +76 -0
  13. package/dist/components/avatar.d.ts +43 -36
  14. package/dist/components/avatar.js +59 -83
  15. package/dist/components/badge.d.ts +30 -41
  16. package/dist/components/badge.js +16 -106
  17. package/dist/components/banner.d.ts +27 -0
  18. package/dist/components/banner.js +66 -0
  19. package/dist/components/benefits.d.ts +30 -0
  20. package/dist/components/benefits.js +32 -0
  21. package/dist/components/breadcrumb.d.ts +25 -18
  22. package/dist/components/breadcrumb.js +40 -48
  23. package/dist/components/browser.d.ts +18 -0
  24. package/dist/components/browser.js +32 -0
  25. package/dist/components/bubble.d.ts +29 -0
  26. package/dist/components/bubble.js +33 -0
  27. package/dist/components/button-group.d.ts +19 -0
  28. package/dist/components/button-group.js +20 -0
  29. package/dist/components/button.d.ts +47 -20
  30. package/dist/components/button.js +51 -107
  31. package/dist/components/calendar.d.ts +29 -0
  32. package/dist/components/calendar.js +149 -0
  33. package/dist/components/card.d.ts +47 -19
  34. package/dist/components/card.js +38 -38
  35. package/dist/components/carousel.d.ts +28 -0
  36. package/dist/components/carousel.js +130 -0
  37. package/dist/components/chart.d.ts +49 -0
  38. package/dist/components/chart.js +258 -0
  39. package/dist/components/checkbox-group.d.ts +16 -0
  40. package/dist/components/checkbox-group.js +13 -0
  41. package/dist/components/checkbox.d.ts +25 -10
  42. package/dist/components/checkbox.js +86 -67
  43. package/dist/components/chip-input.d.ts +46 -20
  44. package/dist/components/chip-input.js +171 -158
  45. package/dist/components/chip.d.ts +28 -0
  46. package/dist/components/chip.js +73 -0
  47. package/dist/components/choice-card.d.ts +10 -13
  48. package/dist/components/choice-card.js +11 -56
  49. package/dist/components/choice-carousel.d.ts +9 -0
  50. package/dist/components/choice-carousel.js +67 -78
  51. package/dist/components/choice-preview-card.d.ts +10 -20
  52. package/dist/components/choice-preview-card.js +13 -30
  53. package/dist/components/color-input.d.ts +36 -11
  54. package/dist/components/color-input.js +139 -61
  55. package/dist/components/combobox.d.ts +60 -57
  56. package/dist/components/combobox.js +215 -196
  57. package/dist/components/command.d.ts +58 -0
  58. package/dist/components/command.js +177 -0
  59. package/dist/components/contact.d.ts +23 -0
  60. package/dist/components/contact.js +32 -0
  61. package/dist/components/context-menu.d.ts +34 -26
  62. package/dist/components/context-menu.js +43 -66
  63. package/dist/components/copy-field.d.ts +10 -5
  64. package/dist/components/copy-field.js +25 -27
  65. package/dist/components/currency-input.d.ts +25 -11
  66. package/dist/components/currency-input.js +39 -67
  67. package/dist/components/danger-zone.d.ts +10 -1
  68. package/dist/components/danger-zone.js +20 -14
  69. package/dist/components/data-table-header.d.ts +13 -2
  70. package/dist/components/data-table-header.js +143 -169
  71. package/dist/components/date-picker.d.ts +31 -32
  72. package/dist/components/date-picker.js +126 -242
  73. package/dist/components/delta.d.ts +26 -0
  74. package/dist/components/delta.js +24 -0
  75. package/dist/components/dialog.d.ts +21 -0
  76. package/dist/components/dialog.js +16 -0
  77. package/dist/components/drawer.d.ts +15 -23
  78. package/dist/components/drawer.js +56 -76
  79. package/dist/components/dropdown-menu.d.ts +63 -0
  80. package/dist/components/dropdown-menu.js +62 -0
  81. package/dist/components/dropzone.d.ts +10 -4
  82. package/dist/components/dropzone.js +30 -55
  83. package/dist/components/empty.d.ts +29 -0
  84. package/dist/components/empty.js +42 -0
  85. package/dist/components/fab.d.ts +29 -6
  86. package/dist/components/fab.js +51 -39
  87. package/dist/components/faq.d.ts +21 -0
  88. package/dist/components/faq.js +24 -0
  89. package/dist/components/file-input.d.ts +56 -0
  90. package/dist/components/file-input.js +244 -0
  91. package/dist/components/filter-chip.d.ts +34 -47
  92. package/dist/components/filter-chip.js +61 -57
  93. package/dist/components/floating-stepper.d.ts +7 -18
  94. package/dist/components/floating-stepper.js +17 -35
  95. package/dist/components/footer.d.ts +36 -0
  96. package/dist/components/footer.js +38 -0
  97. package/dist/components/form-actions.d.ts +28 -0
  98. package/dist/components/form-actions.js +24 -0
  99. package/dist/components/google-account-chooser.d.ts +25 -0
  100. package/dist/components/google-account-chooser.js +44 -0
  101. package/dist/components/google-button.d.ts +26 -0
  102. package/dist/components/google-button.js +38 -0
  103. package/dist/components/google-consent.d.ts +23 -0
  104. package/dist/components/google-consent.js +28 -0
  105. package/dist/components/google-sign-in.d.ts +26 -0
  106. package/dist/components/google-sign-in.js +36 -0
  107. package/dist/components/hover-card.d.ts +30 -0
  108. package/dist/components/hover-card.js +55 -0
  109. package/dist/components/icon-button.d.ts +41 -11
  110. package/dist/components/icon-button.js +47 -61
  111. package/dist/components/image-crop-modal.d.ts +3 -3
  112. package/dist/components/image-crop-modal.js +66 -52
  113. package/dist/components/image-upload.d.ts +21 -29
  114. package/dist/components/image-upload.js +59 -219
  115. package/dist/components/index.d.ts +105 -49
  116. package/dist/components/index.js +190 -68
  117. package/dist/components/input-otp.d.ts +35 -0
  118. package/dist/components/input-otp.js +119 -0
  119. package/dist/components/input.d.ts +23 -17
  120. package/dist/components/input.js +103 -108
  121. package/dist/components/insight-card.d.ts +25 -9
  122. package/dist/components/insight-card.js +45 -19
  123. package/dist/components/internal/announce.d.ts +3 -0
  124. package/dist/components/internal/announce.js +20 -0
  125. package/dist/components/internal/block.d.ts +15 -0
  126. package/dist/components/internal/block.js +14 -0
  127. package/dist/components/internal/button.d.ts +23 -0
  128. package/dist/components/internal/button.js +30 -0
  129. package/dist/components/internal/choice-card.d.ts +52 -0
  130. package/dist/components/internal/choice-card.js +117 -0
  131. package/dist/components/internal/choice.d.ts +25 -0
  132. package/dist/components/internal/choice.js +44 -0
  133. package/dist/components/internal/dates.d.ts +17 -0
  134. package/dist/components/internal/dates.js +59 -0
  135. package/dist/components/internal/field.d.ts +66 -0
  136. package/dist/components/internal/field.js +105 -0
  137. package/dist/components/internal/fieldset.d.ts +25 -0
  138. package/dist/components/internal/fieldset.js +56 -0
  139. package/dist/components/internal/focus-after.d.ts +3 -0
  140. package/dist/components/internal/focus-after.js +13 -0
  141. package/dist/components/internal/google.d.ts +47 -0
  142. package/dist/components/internal/google.js +73 -0
  143. package/dist/components/internal/icons.d.ts +108 -0
  144. package/dist/components/internal/icons.js +316 -0
  145. package/dist/components/internal/menu.d.ts +16 -0
  146. package/dist/components/internal/menu.js +14 -0
  147. package/dist/components/internal/modal.d.ts +50 -0
  148. package/dist/components/internal/modal.js +85 -0
  149. package/dist/components/internal/option-content.d.ts +10 -0
  150. package/dist/components/internal/option-content.js +13 -0
  151. package/dist/components/internal/radio-context.d.ts +16 -0
  152. package/dist/components/internal/radio-context.js +6 -0
  153. package/dist/components/internal/toggle.d.ts +7 -0
  154. package/dist/components/internal/toggle.js +13 -0
  155. package/dist/components/internal/use-listbox.d.ts +56 -0
  156. package/dist/components/internal/use-listbox.js +69 -0
  157. package/dist/components/internal/whatsapp.d.ts +8 -0
  158. package/dist/components/internal/whatsapp.js +12 -0
  159. package/dist/components/item.d.ts +32 -0
  160. package/dist/components/item.js +35 -0
  161. package/dist/components/kbd.d.ts +17 -0
  162. package/dist/components/kbd.js +18 -0
  163. package/dist/components/listbox.d.ts +34 -0
  164. package/dist/components/listbox.js +114 -0
  165. package/dist/components/marker.d.ts +24 -0
  166. package/dist/components/marker.js +28 -0
  167. package/dist/components/media-tile.d.ts +17 -14
  168. package/dist/components/media-tile.js +19 -24
  169. package/dist/components/message-scroller.d.ts +20 -0
  170. package/dist/components/message-scroller.js +108 -0
  171. package/dist/components/message.d.ts +33 -0
  172. package/dist/components/message.js +23 -0
  173. package/dist/components/navigation-menu.d.ts +42 -0
  174. package/dist/components/navigation-menu.js +30 -0
  175. package/dist/components/newsletter.d.ts +27 -0
  176. package/dist/components/newsletter.js +75 -0
  177. package/dist/components/number-input.d.ts +60 -0
  178. package/dist/components/number-input.js +234 -0
  179. package/dist/components/option-tile.d.ts +20 -19
  180. package/dist/components/option-tile.js +52 -131
  181. package/dist/components/page-header.d.ts +31 -0
  182. package/dist/components/page-header.js +25 -0
  183. package/dist/components/page-shell.d.ts +11 -1
  184. package/dist/components/page-shell.js +8 -27
  185. package/dist/components/page-skeleton.d.ts +15 -21
  186. package/dist/components/page-skeleton.js +37 -4
  187. package/dist/components/pagination.d.ts +32 -22
  188. package/dist/components/pagination.js +83 -76
  189. package/dist/components/password-input.d.ts +26 -0
  190. package/dist/components/password-input.js +112 -0
  191. package/dist/components/phone-input.d.ts +12 -8
  192. package/dist/components/phone-input.js +77 -47
  193. package/dist/components/phone.d.ts +27 -0
  194. package/dist/components/phone.js +35 -0
  195. package/dist/components/popover.d.ts +25 -36
  196. package/dist/components/popover.js +32 -129
  197. package/dist/components/pricing-card.d.ts +9 -25
  198. package/dist/components/pricing-card.js +9 -25
  199. package/dist/components/pricing.d.ts +48 -0
  200. package/dist/components/pricing.js +64 -0
  201. package/dist/components/progress.d.ts +30 -0
  202. package/dist/components/progress.js +57 -0
  203. package/dist/components/qr-display.d.ts +11 -6
  204. package/dist/components/qr-display.js +8 -19
  205. package/dist/components/questionnaire.d.ts +42 -0
  206. package/dist/components/questionnaire.js +107 -0
  207. package/dist/components/radio-group.d.ts +21 -0
  208. package/dist/components/radio-group.js +40 -0
  209. package/dist/components/radio.d.ts +15 -29
  210. package/dist/components/radio.js +46 -87
  211. package/dist/components/row-actions.d.ts +5 -0
  212. package/dist/components/row-actions.js +57 -56
  213. package/dist/components/saving-bar-context.d.ts +0 -5
  214. package/dist/components/saving-bar-context.js +16 -34
  215. package/dist/components/saving-bar.d.ts +26 -11
  216. package/dist/components/saving-bar.js +53 -65
  217. package/dist/components/section-card.d.ts +18 -4
  218. package/dist/components/section-card.js +26 -39
  219. package/dist/components/section-header.d.ts +8 -12
  220. package/dist/components/section-header.js +7 -2
  221. package/dist/components/select.d.ts +44 -16
  222. package/dist/components/select.js +85 -135
  223. package/dist/components/selectable-card.d.ts +11 -19
  224. package/dist/components/selectable-card.js +4 -21
  225. package/dist/components/separator.d.ts +20 -0
  226. package/dist/components/separator.js +19 -0
  227. package/dist/components/setting-row.d.ts +11 -15
  228. package/dist/components/setting-row.js +11 -14
  229. package/dist/components/settings-list.d.ts +10 -12
  230. package/dist/components/settings-list.js +9 -17
  231. package/dist/components/sheet.d.ts +21 -0
  232. package/dist/components/sheet.js +16 -0
  233. package/dist/components/sidebar.d.ts +79 -0
  234. package/dist/components/sidebar.js +111 -0
  235. package/dist/components/skeleton.d.ts +14 -20
  236. package/dist/components/skeleton.js +8 -36
  237. package/dist/components/slider.d.ts +21 -23
  238. package/dist/components/slider.js +65 -56
  239. package/dist/components/sparkline.d.ts +19 -0
  240. package/dist/components/sparkline.js +32 -0
  241. package/dist/components/spinner.d.ts +16 -8
  242. package/dist/components/spinner.js +35 -32
  243. package/dist/components/star-rating.d.ts +22 -0
  244. package/dist/components/star-rating.js +25 -0
  245. package/dist/components/stat.d.ts +33 -0
  246. package/dist/components/stat.js +29 -0
  247. package/dist/components/status.d.ts +27 -0
  248. package/dist/components/status.js +34 -0
  249. package/dist/components/step-progress.d.ts +13 -6
  250. package/dist/components/step-progress.js +20 -17
  251. package/dist/components/summary-bar.d.ts +20 -20
  252. package/dist/components/summary-bar.js +13 -50
  253. package/dist/components/switch.d.ts +20 -0
  254. package/dist/components/switch.js +46 -0
  255. package/dist/components/table.d.ts +56 -17
  256. package/dist/components/table.js +65 -59
  257. package/dist/components/tabs.d.ts +67 -0
  258. package/dist/components/tabs.js +56 -0
  259. package/dist/components/testimonial.d.ts +30 -0
  260. package/dist/components/testimonial.js +36 -0
  261. package/dist/components/textarea.d.ts +11 -16
  262. package/dist/components/textarea.js +55 -75
  263. package/dist/components/tile.d.ts +24 -0
  264. package/dist/components/tile.js +21 -0
  265. package/dist/components/time-picker.d.ts +40 -25
  266. package/dist/components/time-picker.js +191 -189
  267. package/dist/components/toast.d.ts +63 -0
  268. package/dist/components/toast.js +132 -0
  269. package/dist/components/toggle-card-compact.d.ts +15 -5
  270. package/dist/components/toggle-card-compact.js +22 -81
  271. package/dist/components/toggle-card.d.ts +11 -2
  272. package/dist/components/toggle-card.js +9 -70
  273. package/dist/components/toggle-group.d.ts +21 -59
  274. package/dist/components/toggle-group.js +31 -74
  275. package/dist/components/toggle.d.ts +19 -9
  276. package/dist/components/toggle.js +20 -55
  277. package/dist/components/tooltip.d.ts +25 -12
  278. package/dist/components/tooltip.js +16 -84
  279. package/dist/components/top-navigation.d.ts +33 -0
  280. package/dist/components/top-navigation.js +85 -0
  281. package/dist/components/typing-indicator.d.ts +6 -0
  282. package/dist/components/typing-indicator.js +3 -21
  283. package/dist/components/whatsapp-chat.d.ts +28 -0
  284. package/dist/components/whatsapp-chat.js +95 -0
  285. package/dist/components/whatsapp-message.d.ts +22 -0
  286. package/dist/components/whatsapp-message.js +34 -0
  287. package/dist/components/whatsapp-notification.d.ts +27 -0
  288. package/dist/components/whatsapp-notification.js +73 -0
  289. package/dist/components/whatsapp-template.d.ts +42 -0
  290. package/dist/components/whatsapp-template.js +69 -0
  291. package/dist/icons/index.d.ts +2 -0
  292. package/dist/icons/index.js +2 -0
  293. package/dist/icons/pix.d.ts +16 -0
  294. package/dist/icons/pix.js +29 -0
  295. package/dist/targets/native/components/accordion.js +31 -25
  296. package/dist/targets/native/components/alert.js +22 -16
  297. package/dist/targets/native/components/avatar.js +36 -29
  298. package/dist/targets/native/components/badge.js +4 -3
  299. package/dist/targets/native/components/button.js +11 -4
  300. package/dist/targets/native/components/card.js +2 -1
  301. package/dist/targets/native/components/checkbox.js +18 -15
  302. package/dist/targets/native/components/chips.js +19 -16
  303. package/dist/targets/native/components/choice-card.js +29 -23
  304. package/dist/targets/native/components/context-menu.js +13 -9
  305. package/dist/targets/native/components/currency-input.js +28 -25
  306. package/dist/targets/native/components/danger-zone.js +10 -4
  307. package/dist/targets/native/components/date-picker.js +86 -70
  308. package/dist/targets/native/components/divider.js +3 -2
  309. package/dist/targets/native/components/empty-state.js +6 -1
  310. package/dist/targets/native/components/fab.js +32 -26
  311. package/dist/targets/native/components/filter-chip.js +9 -8
  312. package/dist/targets/native/components/form-field.js +20 -10
  313. package/dist/targets/native/components/form-screen.js +50 -45
  314. package/dist/targets/native/components/google-icon.js +31 -25
  315. package/dist/targets/native/components/icon-button.js +6 -4
  316. package/dist/targets/native/components/icon.js +2 -1
  317. package/dist/targets/native/components/image-upload.js +59 -50
  318. package/dist/targets/native/components/index.d.ts +0 -2
  319. package/dist/targets/native/components/index.js +0 -4
  320. package/dist/targets/native/components/input.js +41 -34
  321. package/dist/targets/native/components/list-item.js +29 -23
  322. package/dist/targets/native/components/menu.js +12 -10
  323. package/dist/targets/native/components/modal.js +41 -32
  324. package/dist/targets/native/components/radio.js +19 -16
  325. package/dist/targets/native/components/search.js +41 -38
  326. package/dist/targets/native/components/select.js +71 -63
  327. package/dist/targets/native/components/sheet.js +36 -30
  328. package/dist/targets/native/components/skeleton.js +6 -5
  329. package/dist/targets/native/components/slider.js +51 -43
  330. package/dist/targets/native/components/spinner.js +2 -1
  331. package/dist/targets/native/components/stepper.js +14 -9
  332. package/dist/targets/native/components/switch.js +15 -14
  333. package/dist/targets/native/components/text.js +2 -1
  334. package/dist/targets/native/components/textarea.js +2 -1
  335. package/dist/targets/native/components/theme.js +2 -1
  336. package/dist/targets/native/components/toaster.js +24 -21
  337. package/dist/targets/native/index.d.ts +1 -1
  338. package/dist/targets/native/index.js +1 -3
  339. package/dist/targets/native/preset.cjs +0 -1
  340. package/dist/targets/native/theme.css +58 -60
  341. package/dist/targets/native/theme.d.ts +58 -60
  342. package/dist/targets/native/theme.js +58 -60
  343. package/package.json +35 -16
  344. package/styles/_primitives.generated.css +40 -0
  345. package/styles/base.css +15 -21
  346. package/styles/rds/components-styles.css +11365 -0
  347. package/styles/rds/components.css +993 -0
  348. package/styles/rds/foundation.css +74 -0
  349. package/styles/rds/theme.css +261 -0
  350. package/styles/rds.css +6 -0
  351. package/styles/themes/rojao.css +46 -53
  352. package/brand/rojao-black-on-white.png +0 -0
  353. package/brand/rojao-black.png +0 -0
  354. package/brand/rojao-white-on-black.png +0 -0
  355. package/brand/rojao-white.png +0 -0
  356. package/dist/components/blocker-card.d.ts +0 -42
  357. package/dist/components/blocker-card.js +0 -45
  358. package/dist/components/bottom-sheet.d.ts +0 -31
  359. package/dist/components/bottom-sheet.js +0 -120
  360. package/dist/components/chat-bubble.d.ts +0 -16
  361. package/dist/components/chat-bubble.js +0 -55
  362. package/dist/components/chips.d.ts +0 -22
  363. package/dist/components/chips.js +0 -94
  364. package/dist/components/copilot-hint.d.ts +0 -18
  365. package/dist/components/copilot-hint.js +0 -63
  366. package/dist/components/divider.d.ts +0 -20
  367. package/dist/components/divider.js +0 -47
  368. package/dist/components/empty-state.d.ts +0 -48
  369. package/dist/components/empty-state.js +0 -91
  370. package/dist/components/form-card-header.d.ts +0 -13
  371. package/dist/components/form-card-header.js +0 -8
  372. package/dist/components/label.d.ts +0 -16
  373. package/dist/components/label.js +0 -43
  374. package/dist/components/menu.d.ts +0 -50
  375. package/dist/components/menu.js +0 -80
  376. package/dist/components/modal.d.ts +0 -25
  377. package/dist/components/modal.js +0 -71
  378. package/dist/components/notice.d.ts +0 -50
  379. package/dist/components/notice.js +0 -103
  380. package/dist/components/page-tabs.d.ts +0 -35
  381. package/dist/components/page-tabs.js +0 -55
  382. package/dist/components/paywall-banner.d.ts +0 -37
  383. package/dist/components/paywall-banner.js +0 -42
  384. package/dist/components/paywall.d.ts +0 -44
  385. package/dist/components/paywall.js +0 -55
  386. package/dist/components/phone-frame.d.ts +0 -9
  387. package/dist/components/phone-frame.js +0 -18
  388. package/dist/components/pix-icon.d.ts +0 -8
  389. package/dist/components/pix-icon.js +0 -24
  390. package/dist/components/search.d.ts +0 -30
  391. package/dist/components/search.js +0 -81
  392. package/dist/components/themed.d.ts +0 -36
  393. package/dist/components/themed.js +0 -22
  394. package/dist/components/toaster.d.ts +0 -84
  395. package/dist/components/toaster.js +0 -284
  396. package/dist/components/use-dismiss.d.ts +0 -9
  397. package/dist/components/use-dismiss.js +0 -28
  398. package/dist/components/use-focus-trap.d.ts +0 -5
  399. package/dist/components/use-focus-trap.js +0 -54
  400. package/dist/targets/native/components/paywall-banner.d.ts +0 -11
  401. package/dist/targets/native/components/paywall-banner.js +0 -46
  402. package/dist/targets/native/components/paywall.d.ts +0 -18
  403. package/dist/targets/native/components/paywall.js +0 -61
@@ -0,0 +1,21 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+
4
+ interface FAQProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
5
+ eyebrow?: ReactNode;
6
+ /** The block's title, an h2 that names the section. */
7
+ title: ReactNode;
8
+ /** The Accordion with the questions (the Figma exposes it). Its items' titles are h3. */
9
+ children: ReactNode;
10
+ /** The support line (Figma: `showSupport` + `supportText`). */
11
+ supportText?: ReactNode;
12
+ /** The way to support: an action ghost Button, or a link through asChild. */
13
+ supportAction?: ReactNode;
14
+ }
15
+ /**
16
+ * FAQ — Figma [RDS] Blocks/FAQ. The frequent questions of a public page, in an Accordion, and the way to support.
17
+ * Adapts to the width of its container (Figma: `screen`). Styles: faq.css.
18
+ */
19
+ declare function FAQ({ eyebrow, title, children, supportText, supportAction, className, ...rest }: FAQProps): react.JSX.Element;
20
+
21
+ export { FAQ, type FAQProps };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import {
3
+ __objRest,
4
+ __spreadProps,
5
+ __spreadValues
6
+ } from "../chunk-ORMEWXMH.js";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { useId } from "react";
9
+ import { BlockHeading } from "./internal/block.js";
10
+ function FAQ(_a) {
11
+ var _b = _a, { eyebrow, title, children, supportText, supportAction, className } = _b, rest = __objRest(_b, ["eyebrow", "title", "children", "supportText", "supportAction", "className"]);
12
+ const titleId = useId();
13
+ return /* @__PURE__ */ jsx("section", __spreadProps(__spreadValues({ "aria-labelledby": titleId }, rest), { className: ["rds-block", "rds-faq", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs("div", { className: "rds-block__inner", children: [
14
+ /* @__PURE__ */ jsx(BlockHeading, { eyebrow, title, titleId }),
15
+ /* @__PURE__ */ jsx("div", { className: "rds-faq__questions", children }),
16
+ (supportText || supportAction) && /* @__PURE__ */ jsxs("div", { className: "rds-faq__support", children: [
17
+ supportText && /* @__PURE__ */ jsx("p", { className: "rds-faq__support-text", children: supportText }),
18
+ supportAction
19
+ ] })
20
+ ] }) }));
21
+ }
22
+ export {
23
+ FAQ
24
+ };
@@ -0,0 +1,56 @@
1
+ import * as react from 'react';
2
+ import { ComponentPropsWithRef, ReactNode } from 'react';
3
+ import { FieldTextProps } from './internal/field.js';
4
+
5
+ type FileInputVariant = 'field' | 'dropzone' | 'tile';
6
+ interface FileInputProps extends Omit<FieldTextProps, 'labelPosition'>, Omit<ComponentPropsWithRef<'input'>, 'type' | 'children' | 'prefix' | 'value' | 'defaultValue' | 'size'> {
7
+ /**
8
+ * The shape (Figma: `variant`). field (default): the Input's box, for a dense form. dropzone: a dashed area to drop
9
+ * the file on, when the file is what the screen is about (a receipt, a spreadsheet). tile: a 112 square with the image's
10
+ * preview, for a photo or a logo.
11
+ */
12
+ variant?: FileInputVariant;
13
+ /** Controlled: the name shown (Figma: `fileName`). By default, the chosen file's name. */
14
+ fileName?: string;
15
+ /** Controlled: the size beside the name in the dropzone (Figma: `fileSize`). By default, the chosen file's, as "1,2 MB". */
16
+ fileSize?: string;
17
+ /**
18
+ * tile: the image shown (a URL). Passing it controls the preview, '' for none; by default, the chosen image. Use it
19
+ * for an image that is already saved.
20
+ */
21
+ preview?: string;
22
+ /** tile: the preview's alternative text. By default "Prévia de <label>". */
23
+ previewAlt?: string;
24
+ /** dropzone: the call in the empty area (Figma: `dropTitle`). */
25
+ dropTitle?: ReactNode;
26
+ /** tile: the text of the empty tile (Figma: `tileText`), such as "Enviar logo". */
27
+ tileText?: ReactNode;
28
+ /** The × that takes the file out (Figma: `showClear`). On by default: the person must be able to change the file. */
29
+ clearable?: boolean;
30
+ /** Called after the × takes the file out. */
31
+ onClear?: () => void;
32
+ /** Called with the files chosen or dropped (after `onChange`, which also fires). */
33
+ onFiles?: (files: FileList) => void;
34
+ /** The ×'s accessible name. By default "Remover arquivo" ("Remover imagem" in the tile). */
35
+ clearLabel?: string;
36
+ /** tile: the name of the button that swaps the image. */
37
+ replaceLabel?: string;
38
+ /** field: the text of the box that opens the file chooser. */
39
+ chooseLabel?: string;
40
+ /** field: what the box says before a file is chosen. */
41
+ emptyLabel?: string;
42
+ }
43
+ /** "1,2 MB", "830 KB", "512 B": the size the way a person reads it. */
44
+ declare function formatFileSize(bytes: number): string;
45
+ /**
46
+ * FileInput — Figma [RDS] Forms/FileInput. A file field in three shapes (`variant`): field, the Input's box with the
47
+ * clip, "Escolher arquivo" and the name; dropzone, a dashed area that takes a dragged file; tile, a square with the
48
+ * image's preview and the buttons to swap or remove it. In every shape the native <input type="file"> does the work:
49
+ * it lies transparent over the box, so a click, Enter or Space open the system's chooser, the label names it,
50
+ * `required` and the form get the file. A file dropped on the box goes into that same input. Say the formats and the
51
+ * size in the hint and check them in code (a failure is the errorMessage). Styles: file-input.css and
52
+ * internal/field.css.
53
+ */
54
+ declare function FileInput({ variant, label, hint, error, errorMessage, required, fileName, fileSize, preview, previewAlt, dropTitle, tileText, clearable, onClear, onFiles, clearLabel, replaceLabel, chooseLabel, emptyLabel, id, disabled, className, style, onChange, ref, ...input }: FileInputProps): react.JSX.Element;
55
+
56
+ export { FileInput, type FileInputProps, type FileInputVariant, formatFileSize };
@@ -0,0 +1,244 @@
1
+ "use client";
2
+ import {
3
+ __objRest,
4
+ __spreadProps,
5
+ __spreadValues
6
+ } from "../chunk-ORMEWXMH.js";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import {
9
+ useEffect,
10
+ useRef,
11
+ useState
12
+ } from "react";
13
+ import { FieldAction, FieldShell, hasContent, useFieldIds, warnIfUnlabelled } from "./internal/field.js";
14
+ import { CloseIcon, ImagePlusIcon, PaperclipIcon, UploadIcon } from "./internal/icons.js";
15
+ function formatFileSize(bytes) {
16
+ const units = ["B", "KB", "MB", "GB"];
17
+ let value = bytes;
18
+ let unit = 0;
19
+ while (value >= 1024 && unit < units.length - 1) {
20
+ value /= 1024;
21
+ unit += 1;
22
+ }
23
+ const digits = unit === 0 || value >= 100 ? 0 : 1;
24
+ return `${value.toLocaleString("pt-BR", { maximumFractionDigits: digits })} ${units[unit]}`;
25
+ }
26
+ function FileInput(_a) {
27
+ var _b = _a, {
28
+ variant = "field",
29
+ label,
30
+ hint,
31
+ error,
32
+ errorMessage,
33
+ required,
34
+ fileName,
35
+ fileSize,
36
+ preview,
37
+ previewAlt,
38
+ dropTitle = "Arraste o arquivo ou clique para escolher",
39
+ tileText = "Enviar imagem",
40
+ clearable = true,
41
+ onClear,
42
+ onFiles,
43
+ clearLabel,
44
+ replaceLabel = "Trocar imagem",
45
+ chooseLabel = "Escolher arquivo",
46
+ emptyLabel = "Nenhum arquivo",
47
+ id,
48
+ disabled,
49
+ className,
50
+ style,
51
+ onChange,
52
+ ref
53
+ } = _b, input = __objRest(_b, [
54
+ "variant",
55
+ "label",
56
+ "hint",
57
+ "error",
58
+ "errorMessage",
59
+ "required",
60
+ "fileName",
61
+ "fileSize",
62
+ "preview",
63
+ "previewAlt",
64
+ "dropTitle",
65
+ "tileText",
66
+ "clearable",
67
+ "onClear",
68
+ "onFiles",
69
+ "clearLabel",
70
+ "replaceLabel",
71
+ "chooseLabel",
72
+ "emptyLabel",
73
+ "id",
74
+ "disabled",
75
+ "className",
76
+ "style",
77
+ "onChange",
78
+ "ref"
79
+ ]);
80
+ var _a2, _b2, _c;
81
+ warnIfUnlabelled("FileInput", label, input["aria-label"], input["aria-labelledby"]);
82
+ const inside = variant === "dropzone";
83
+ const ids = useFieldIds(id, inside ? void 0 : hint, error, errorMessage);
84
+ const { controlId, errorId, invalid } = ids;
85
+ const own = useRef(null);
86
+ const [chosen, setChosen] = useState(null);
87
+ const [dragging, setDragging] = useState(false);
88
+ useEffect(() => () => revoke(chosen), [chosen]);
89
+ const shownName = (_a2 = fileName != null ? fileName : chosen == null ? void 0 : chosen.name) != null ? _a2 : "";
90
+ const shownSize = fileSize != null ? fileSize : fileName === void 0 && chosen ? formatFileSize(chosen.size) : void 0;
91
+ const shownPreview = (_b2 = preview != null ? preview : chosen == null ? void 0 : chosen.url) != null ? _b2 : "";
92
+ const filled = variant === "tile" ? Boolean(shownPreview) : Boolean(shownName);
93
+ const showClear = clearable && filled && !disabled;
94
+ const insideHintId = inside && hasContent(hint) && !filled ? `${controlId}-hint` : void 0;
95
+ const describedBy = [inside ? insideHintId : ids.hintId, errorId, input["aria-describedby"]].filter(Boolean).join(" ") || void 0;
96
+ const removeName = clearLabel != null ? clearLabel : variant === "tile" ? "Remover imagem" : "Remover arquivo";
97
+ function change(event) {
98
+ const files = event.target.files;
99
+ if (!(files == null ? void 0 : files.length)) {
100
+ setChosen(null);
101
+ } else {
102
+ const size = Array.from(files).reduce((sum, file) => sum + file.size, 0);
103
+ const first = files[0];
104
+ const url = variant === "tile" && first.type.startsWith("image/") && typeof URL.createObjectURL === "function" ? URL.createObjectURL(first) : void 0;
105
+ setChosen({ name: files.length === 1 ? first.name : `${files.length} arquivos`, size, url });
106
+ }
107
+ onChange == null ? void 0 : onChange(event);
108
+ if (files == null ? void 0 : files.length) onFiles == null ? void 0 : onFiles(files);
109
+ }
110
+ function setRef(node) {
111
+ own.current = node;
112
+ if (typeof ref === "function") ref(node);
113
+ else if (ref) ref.current = node;
114
+ }
115
+ function clear() {
116
+ var _a3;
117
+ if (own.current) own.current.value = "";
118
+ setChosen(null);
119
+ onClear == null ? void 0 : onClear();
120
+ (_a3 = own.current) == null ? void 0 : _a3.focus();
121
+ }
122
+ function drop(event) {
123
+ var _a3;
124
+ event.preventDefault();
125
+ setDragging(false);
126
+ const target = own.current;
127
+ const files = (_a3 = event.dataTransfer) == null ? void 0 : _a3.files;
128
+ if (disabled || !target || !(files == null ? void 0 : files.length)) return;
129
+ if (input.multiple || files.length === 1) {
130
+ target.files = files;
131
+ } else {
132
+ const one = new DataTransfer();
133
+ one.items.add(files[0]);
134
+ target.files = one.files;
135
+ }
136
+ target.dispatchEvent(new Event("change", { bubbles: true }));
137
+ }
138
+ const boxProps = {
139
+ onDragEnter: (event) => {
140
+ event.preventDefault();
141
+ if (!disabled) setDragging(true);
142
+ },
143
+ onDragOver: (event) => {
144
+ event.preventDefault();
145
+ if (event.dataTransfer) event.dataTransfer.dropEffect = disabled ? "none" : "copy";
146
+ },
147
+ onDragLeave: (event) => {
148
+ if (!event.currentTarget.contains(event.relatedTarget)) setDragging(false);
149
+ },
150
+ onDrop: drop
151
+ };
152
+ const covered = !(variant === "tile" && filled);
153
+ const control = /* @__PURE__ */ jsx(
154
+ "input",
155
+ __spreadProps(__spreadValues({}, input), {
156
+ ref: setRef,
157
+ id: controlId,
158
+ type: "file",
159
+ accept: (_c = input.accept) != null ? _c : variant === "tile" ? "image/*" : void 0,
160
+ className: ["rds-field__control", "rds-file-input__control", !covered && "rds-file-input__control--off"].filter(Boolean).join(" "),
161
+ tabIndex: covered ? input.tabIndex : -1,
162
+ required,
163
+ disabled,
164
+ "aria-invalid": invalid || void 0,
165
+ "aria-describedby": describedBy,
166
+ onChange: change
167
+ })
168
+ );
169
+ const clearButton = showClear && /* @__PURE__ */ jsx(FieldAction, { label: removeName, icon: /* @__PURE__ */ jsx(CloseIcon, {}), onClick: clear });
170
+ let face;
171
+ if (variant === "dropzone") {
172
+ face = filled ? /* @__PURE__ */ jsxs("span", { className: "rds-file-input__file", children: [
173
+ /* @__PURE__ */ jsx("span", { className: "rds-file-input__circle", "aria-hidden": "true", children: /* @__PURE__ */ jsx(PaperclipIcon, {}) }),
174
+ /* @__PURE__ */ jsxs("span", { className: "rds-file-input__file-texts", "aria-hidden": "true", children: [
175
+ /* @__PURE__ */ jsx("span", { className: "rds-file-input__file-name", children: shownName }),
176
+ shownSize && /* @__PURE__ */ jsx("span", { className: "rds-file-input__caption", children: shownSize })
177
+ ] }),
178
+ clearButton
179
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
180
+ /* @__PURE__ */ jsx("span", { className: "rds-file-input__circle", "aria-hidden": "true", children: /* @__PURE__ */ jsx(UploadIcon, {}) }),
181
+ /* @__PURE__ */ jsxs("span", { className: "rds-file-input__texts", children: [
182
+ /* @__PURE__ */ jsx("span", { className: "rds-file-input__title", "aria-hidden": "true", children: dropTitle }),
183
+ hasContent(hint) && /* @__PURE__ */ jsx("span", { id: insideHintId, className: "rds-file-input__caption", children: hint })
184
+ ] })
185
+ ] });
186
+ } else if (variant === "tile") {
187
+ face = filled ? /* @__PURE__ */ jsx("img", { className: "rds-file-input__preview", src: shownPreview, alt: previewAlt != null ? previewAlt : typeof label === "string" ? `Pr\xE9via de ${label}` : "Pr\xE9via" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
188
+ /* @__PURE__ */ jsx("span", { className: "rds-file-input__tile-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ImagePlusIcon, {}) }),
189
+ /* @__PURE__ */ jsx("span", { className: "rds-file-input__tile-text", "aria-hidden": "true", children: tileText })
190
+ ] });
191
+ } else {
192
+ face = /* @__PURE__ */ jsxs(Fragment, { children: [
193
+ /* @__PURE__ */ jsx("span", { className: "rds-field__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(PaperclipIcon, {}) }),
194
+ /* @__PURE__ */ jsxs("span", { className: "rds-file-input__face", "aria-hidden": "true", children: [
195
+ /* @__PURE__ */ jsx("span", { className: "rds-file-input__choose", children: chooseLabel }),
196
+ /* @__PURE__ */ jsx("span", { className: ["rds-file-input__name", !shownName && "rds-file-input__name--empty"].filter(Boolean).join(" "), children: shownName || emptyLabel })
197
+ ] })
198
+ ] });
199
+ }
200
+ const boxClassName = [
201
+ variant === "field" && showClear && "rds-field__box--action",
202
+ variant === "dropzone" && "rds-file-input__area",
203
+ variant === "tile" && "rds-file-input__area rds-file-input__tile",
204
+ variant !== "field" && filled && "rds-file-input__area--filled",
205
+ variant !== "field" && dragging && "rds-file-input__area--dragging"
206
+ ].filter(Boolean).join(" ");
207
+ return /* @__PURE__ */ jsxs(
208
+ FieldShell,
209
+ {
210
+ kind: `rds-file-input rds-file-input--${variant}`,
211
+ controlId,
212
+ hintId: inside ? void 0 : ids.hintId,
213
+ errorId,
214
+ label,
215
+ hint: inside ? void 0 : hint,
216
+ errorMessage,
217
+ invalid,
218
+ required,
219
+ disabled,
220
+ boxClassName: boxClassName || void 0,
221
+ boxProps: variant === "field" ? void 0 : boxProps,
222
+ className,
223
+ style,
224
+ children: [
225
+ face,
226
+ control,
227
+ variant === "tile" ? filled && !disabled && /* @__PURE__ */ jsxs("span", { className: "rds-file-input__actions", children: [
228
+ /* @__PURE__ */ jsx(FieldAction, { label: replaceLabel, icon: /* @__PURE__ */ jsx(UploadIcon, {}), onClick: () => {
229
+ var _a3;
230
+ return (_a3 = own.current) == null ? void 0 : _a3.click();
231
+ } }),
232
+ clearButton
233
+ ] }) : variant === "field" && clearButton
234
+ ]
235
+ }
236
+ );
237
+ }
238
+ function revoke(chosen) {
239
+ if ((chosen == null ? void 0 : chosen.url) && typeof URL.revokeObjectURL === "function") URL.revokeObjectURL(chosen.url);
240
+ }
241
+ export {
242
+ FileInput,
243
+ formatFileSize
244
+ };
@@ -1,54 +1,41 @@
1
1
  import * as react from 'react';
2
+ import { ComponentPropsWithRef, ReactNode, HTMLAttributes } from 'react';
2
3
 
3
- interface FilterChipBaseProps {
4
- label: string;
5
- active: boolean;
6
- count?: number;
4
+ interface FilterChipProps extends Omit<ComponentPropsWithRef<'button'>, 'children'> {
5
+ /** The filter's name (Figma: `label`): Todos, Entradas, Saídas. With `asChild`, the link goes here with it. */
6
+ children: ReactNode;
7
+ /** How many items the filter leaves, after the label (Figma: `hasCount` + `count`). */
8
+ count?: ReactNode;
9
+ /** An icon before the label, in the label's colour (Figma: `showIcon` + `icon`). Decorative. */
10
+ icon?: ReactNode;
11
+ /** Controlled: the filter is on (Figma: state=active). */
12
+ active?: boolean;
13
+ /** Uncontrolled: on at first. */
14
+ defaultActive?: boolean;
15
+ /** Called with the new state when the chip is pressed (a button, not a link). */
16
+ onActiveChange?: (active: boolean) => void;
17
+ /** Rendered as aria-disabled="true": stays in the tab order and takes focus, but does not turn on or navigate. */
7
18
  disabled?: boolean;
8
- className?: string;
9
- }
10
- interface FilterChipLinkProps extends FilterChipBaseProps {
11
- href: string;
12
- onClick?: never;
13
- }
14
- interface FilterChipButtonProps extends FilterChipBaseProps {
15
- onClick: () => void;
16
- href?: never;
17
- }
18
- type FilterChipProps = FilterChipLinkProps | FilterChipButtonProps;
19
- declare function FilterChip({ label, active, count, disabled, href, onClick, className }: FilterChipProps): react.JSX.Element;
20
- type FilterChipItem = {
21
- label: string;
22
- value: string | undefined;
23
- count?: number;
24
- href?: string;
25
- onClick?: () => void;
26
- disabled?: boolean;
27
- };
28
- interface FilterChipGroupProps {
29
- items: FilterChipItem[];
30
- active: string | undefined;
31
- label: string;
32
- className?: string;
19
+ /**
20
+ * Render the single child element (an `<a>`, a framework `Link`) with the chip's classes, for a filter that
21
+ * lives in the URL and should survive back/forward. The link gets aria-current when active.
22
+ */
23
+ asChild?: boolean;
33
24
  }
34
25
  /**
35
- * FilterChipGroup — barra de filtro com pills.
36
- *
37
- * Regra: ≤ 5 opções. Mais que isso → usar Select.
38
- * Renderiza como links (href) para preservar URL e back/forward,
39
- * ou como buttons (onClick) para filtro client-side.
40
- *
41
- * @example
42
- * <FilterChipGroup
43
- * label="Filtrar por tipo"
44
- * items={[
45
- * { label: 'Todos', value: undefined, href: '/stock' },
46
- * { label: 'Entradas', value: 'in', href: '/stock?filter=in' },
47
- * { label: 'Saídas', value: 'out', href: '/stock?filter=out' },
48
- * ]}
49
- * active={searchParams.filter}
50
- * />
26
+ * FilterChip — Figma [RDS] Forms/FilterChip. A pill that turns a cut of the list on (Todos, Entradas, Saídas).
27
+ * A button with aria-pressed, or, with `asChild`, a link with aria-current. Off: card fill, hairline; on: the
28
+ * brand tint, brand border and label. Up to 5 in a FilterChipGroup; more than that, the Select. A value that can
29
+ * be removed is the Chip. Styles: filter-chip.css.
51
30
  */
52
- declare function FilterChipGroup({ items, active, label, className }: FilterChipGroupProps): react.JSX.Element;
31
+ declare function FilterChip({ children, count, icon, active, defaultActive, onActiveChange, disabled, asChild, type, className, onClick, ...rest }: FilterChipProps): react.JSX.Element;
32
+ interface FilterChipGroupProps extends HTMLAttributes<HTMLDivElement> {
33
+ /** Required: what the filters cut, such as "Filtrar por tipo". Several groups on a page must be told apart. */
34
+ 'aria-label': string;
35
+ /** The FilterChips, up to 5. */
36
+ children: ReactNode;
37
+ }
38
+ /** The row of FilterChips: a named group, 8 apart, wrapping on a narrow screen. */
39
+ declare function FilterChipGroup({ className, children, ...rest }: FilterChipGroupProps): react.JSX.Element;
53
40
 
54
- export { FilterChip, FilterChipGroup, type FilterChipGroupProps, type FilterChipItem, type FilterChipProps };
41
+ export { FilterChip, FilterChipGroup, type FilterChipGroupProps, type FilterChipProps };
@@ -1,64 +1,68 @@
1
1
  "use client";
2
- import "../chunk-ORMEWXMH.js";
3
- import Link from "next/link";
4
- const BASE = "h-control-sm inline-flex items-center text-caption font-medium border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus px-[var(--filter-chip-padding-x)] [border-radius:var(--filter-chip-radius)]";
5
- const ACTIVE = "[background:var(--filter-chip-color-surface-active)] [border-color:var(--filter-chip-color-stroke-active)] [color:var(--filter-chip-color-text-active)]";
6
- const INACTIVE = "[background:var(--filter-chip-color-surface-inactive)] [border-color:var(--filter-chip-color-stroke-inactive)] [color:var(--filter-chip-color-text-inactive)] hover:[background:var(--filter-chip-color-surface-hover)] hover:[border-color:var(--filter-chip-color-stroke-hover)] hover:[color:var(--filter-chip-color-text-hover)]";
7
- const DISABLED = "[background:var(--filter-chip-color-surface-disabled)] [border-color:var(--filter-chip-color-stroke-disabled)] [color:var(--filter-chip-color-text-disabled)] opacity-50 pointer-events-none cursor-not-allowed";
8
- function FilterChipBody({ label, count }) {
9
- if (count === void 0) return /* @__PURE__ */ React.createElement(React.Fragment, null, label);
10
- return /* @__PURE__ */ React.createElement(React.Fragment, null, label, /* @__PURE__ */ React.createElement("span", { className: "ml-1 opacity-60 tabular-nums" }, count));
11
- }
12
- function FilterChip({ label, active, count, disabled = false, href, onClick, className = "" }) {
13
- const cls = [BASE, active ? ACTIVE : INACTIVE, disabled ? DISABLED : "", className].filter(Boolean).join(" ");
14
- if (href) {
15
- return /* @__PURE__ */ React.createElement(
16
- Link,
17
- {
18
- href,
19
- "aria-current": active ? "true" : void 0,
20
- "aria-disabled": disabled || void 0,
21
- tabIndex: disabled ? -1 : void 0,
22
- className: cls
23
- },
24
- /* @__PURE__ */ React.createElement(FilterChipBody, { label, count })
25
- );
2
+ import {
3
+ __objRest,
4
+ __spreadProps,
5
+ __spreadValues
6
+ } from "../chunk-ORMEWXMH.js";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { useState } from "react";
9
+ import { Slot, Slottable } from "@radix-ui/react-slot";
10
+ import { blockWhenDisabled } from "./internal/button.js";
11
+ function FilterChip(_a) {
12
+ var _b = _a, {
13
+ children,
14
+ count,
15
+ icon,
16
+ active,
17
+ defaultActive = false,
18
+ onActiveChange,
19
+ disabled,
20
+ asChild,
21
+ type = "button",
22
+ className,
23
+ onClick
24
+ } = _b, rest = __objRest(_b, [
25
+ "children",
26
+ "count",
27
+ "icon",
28
+ "active",
29
+ "defaultActive",
30
+ "onActiveChange",
31
+ "disabled",
32
+ "asChild",
33
+ "type",
34
+ "className",
35
+ "onClick"
36
+ ]);
37
+ const [own, setOwn] = useState(defaultActive);
38
+ const on = active != null ? active : own;
39
+ const Root = asChild ? Slot : "button";
40
+ function click(event) {
41
+ onClick == null ? void 0 : onClick(event);
42
+ if (event.defaultPrevented || asChild) return;
43
+ if (active === void 0) setOwn(!on);
44
+ onActiveChange == null ? void 0 : onActiveChange(!on);
26
45
  }
27
- return /* @__PURE__ */ React.createElement(
28
- "button",
29
- {
30
- type: "button",
31
- onClick,
32
- "aria-pressed": active,
33
- disabled,
34
- className: cls
35
- },
36
- /* @__PURE__ */ React.createElement(FilterChipBody, { label, count })
46
+ return /* @__PURE__ */ jsxs(
47
+ Root,
48
+ __spreadProps(__spreadValues({}, rest), {
49
+ type: asChild ? void 0 : type,
50
+ className: ["rds-filter-chip", on && "rds-filter-chip--active", className].filter(Boolean).join(" "),
51
+ "aria-pressed": asChild ? void 0 : on,
52
+ "aria-current": asChild && on ? "true" : void 0,
53
+ "aria-disabled": disabled || void 0,
54
+ onClick: blockWhenDisabled(disabled, click),
55
+ children: [
56
+ icon && /* @__PURE__ */ jsx("span", { className: "rds-filter-chip__icon", "aria-hidden": "true", children: icon }),
57
+ /* @__PURE__ */ jsx(Slottable, { children: asChild ? children : /* @__PURE__ */ jsx("span", { className: "rds-filter-chip__label", children }) }),
58
+ count !== void 0 && count !== null && count !== "" && /* @__PURE__ */ jsx("span", { className: "rds-filter-chip__count", children: count })
59
+ ]
60
+ })
37
61
  );
38
62
  }
39
- function FilterChipGroup({ items, active, label, className = "" }) {
40
- return /* @__PURE__ */ React.createElement("div", { role: "group", "aria-label": label, className: ["flex flex-wrap [gap:var(--filter-chip-group-gap)]", className].filter(Boolean).join(" ") }, items.map((item) => {
41
- var _a;
42
- if (process.env.NODE_ENV === "development" && !item.href && !item.onClick) {
43
- console.warn(`[FilterChipGroup] item "${item.label}" has neither href nor onClick \u2014 click will have no effect`);
44
- }
45
- const isActive = active === item.value || !active && item.value === void 0;
46
- if (item.href) {
47
- return /* @__PURE__ */ React.createElement(FilterChip, { key: item.label, label: item.label, active: isActive, count: item.count, disabled: item.disabled, href: item.href });
48
- }
49
- return /* @__PURE__ */ React.createElement(
50
- FilterChip,
51
- {
52
- key: item.label,
53
- label: item.label,
54
- active: isActive,
55
- count: item.count,
56
- disabled: item.disabled,
57
- onClick: (_a = item.onClick) != null ? _a : (() => {
58
- })
59
- }
60
- );
61
- }));
63
+ function FilterChipGroup(_c) {
64
+ var _d = _c, { className, children } = _d, rest = __objRest(_d, ["className", "children"]);
65
+ return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({ role: "group" }, rest), { className: ["rds-filter-chip-group", className].filter(Boolean).join(" "), children }));
62
66
  }
63
67
  export {
64
68
  FilterChip,
@@ -2,23 +2,10 @@ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
 
4
4
  /**
5
- * FloatingStepper — pill flutuante de etapas de um fluxo (PDV, checkout).
6
- *
7
- * Mostra as etapas com dot de estado; etapas anteriores são navegáveis
8
- * (volta no fluxo), futuras ficam desabilitadas. `canNavigate` permite
9
- * customizar a regra. Slot `action` pra ação terminal (ex.: Reset).
10
- *
11
- * O POSICIONAMENTO é do caller (absolute/fixed via wrapper ou className) —
12
- * o componente só renderiza a pill.
13
- *
14
- * Uso:
15
- * <FloatingStepper
16
- * steps={[{ key: 'cart', label: 'Carrinho' }, ...]}
17
- * current={step}
18
- * onNavigate={setStep}
19
- * action={{ label: 'Reset', icon: <RotateCcw />, onClick: reset }}
20
- * className="absolute bottom-3 left-1/2 -translate-x-1/2 z-30"
21
- * />
5
+ * FloatingStepper — a composition of the Card (as a pill) and Buttons (Figma [RDS] Actions/Button, neutral): the
6
+ * floating steps of a flow (point of sale, checkout). The current step is the filled Button (aria-current="step");
7
+ * earlier steps go back, later ones are disabled; `canNavigate` changes the rule. `action` is a last Button after
8
+ * a line (Reset). Where it floats is the caller's (className or a wrapper). Styles: floating-stepper.css.
22
9
  */
23
10
  type FloatingStepperStep = {
24
11
  key: string;
@@ -38,7 +25,9 @@ interface FloatingStepperProps {
38
25
  onClick: () => void;
39
26
  };
40
27
  className?: string;
28
+ /** The navigation's name. Default "Etapas". */
29
+ 'aria-label'?: string;
41
30
  }
42
- declare function FloatingStepper({ steps, current, onNavigate, canNavigate, action, className, }: FloatingStepperProps): react.JSX.Element;
31
+ declare function FloatingStepper({ steps, current, onNavigate, canNavigate, action, className, 'aria-label': ariaLabel }: FloatingStepperProps): react.JSX.Element;
43
32
 
44
33
  export { FloatingStepper, type FloatingStepperProps, type FloatingStepperStep };