@rojaostudio/ds 1.0.2 → 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 (356) 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 -93
  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 +67 -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 -90
  15. package/dist/components/badge.d.ts +30 -41
  16. package/dist/components/badge.js +13 -110
  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 +38 -56
  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 +45 -108
  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 +31 -46
  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 +87 -81
  43. package/dist/components/chip-input.d.ts +46 -20
  44. package/dist/components/chip-input.js +172 -176
  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 -62
  49. package/dist/components/choice-carousel.d.ts +9 -0
  50. package/dist/components/choice-carousel.js +28 -44
  51. package/dist/components/choice-preview-card.d.ts +10 -20
  52. package/dist/components/choice-preview-card.js +12 -40
  53. package/dist/components/color-input.d.ts +36 -11
  54. package/dist/components/color-input.js +131 -59
  55. package/dist/components/combobox.d.ts +60 -57
  56. package/dist/components/combobox.js +210 -213
  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 +41 -68
  63. package/dist/components/copy-field.d.ts +10 -5
  64. package/dist/components/copy-field.js +24 -29
  65. package/dist/components/currency-input.d.ts +25 -11
  66. package/dist/components/currency-input.js +29 -65
  67. package/dist/components/danger-zone.d.ts +10 -1
  68. package/dist/components/danger-zone.js +14 -18
  69. package/dist/components/data-table-header.d.ts +13 -2
  70. package/dist/components/data-table-header.js +114 -190
  71. package/dist/components/date-picker.d.ts +31 -32
  72. package/dist/components/date-picker.js +119 -254
  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 +57 -89
  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 -58
  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 -51
  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 -61
  93. package/dist/components/floating-stepper.d.ts +7 -18
  94. package/dist/components/floating-stepper.js +27 -55
  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 +44 -64
  111. package/dist/components/image-crop-modal.d.ts +3 -3
  112. package/dist/components/image-crop-modal.js +32 -39
  113. package/dist/components/image-upload.d.ts +21 -29
  114. package/dist/components/image-upload.js +55 -259
  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 +104 -137
  121. package/dist/components/insight-card.d.ts +25 -9
  122. package/dist/components/insight-card.js +42 -27
  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 -27
  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 -137
  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 -34
  185. package/dist/components/page-skeleton.d.ts +15 -21
  186. package/dist/components/page-skeleton.js +28 -25
  187. package/dist/components/pagination.d.ts +32 -22
  188. package/dist/components/pagination.js +78 -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 +75 -64
  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 +30 -131
  197. package/dist/components/pricing-card.d.ts +9 -25
  198. package/dist/components/pricing-card.js +9 -40
  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 +6 -22
  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 +45 -103
  211. package/dist/components/row-actions.d.ts +5 -0
  212. package/dist/components/row-actions.js +27 -34
  213. package/dist/components/saving-bar-context.d.ts +0 -5
  214. package/dist/components/saving-bar-context.js +16 -40
  215. package/dist/components/saving-bar.d.ts +26 -11
  216. package/dist/components/saving-bar.js +50 -65
  217. package/dist/components/section-card.d.ts +18 -4
  218. package/dist/components/section-card.js +29 -50
  219. package/dist/components/section-header.d.ts +8 -12
  220. package/dist/components/section-header.js +5 -10
  221. package/dist/components/select.d.ts +44 -16
  222. package/dist/components/select.js +83 -154
  223. package/dist/components/selectable-card.d.ts +11 -19
  224. package/dist/components/selectable-card.js +4 -28
  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 +10 -23
  229. package/dist/components/settings-list.d.ts +10 -12
  230. package/dist/components/settings-list.js +7 -19
  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 -37
  237. package/dist/components/slider.d.ts +21 -23
  238. package/dist/components/slider.js +59 -64
  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 +34 -37
  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 +18 -16
  251. package/dist/components/summary-bar.d.ts +20 -20
  252. package/dist/components/summary-bar.js +13 -55
  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 +59 -58
  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 -91
  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 +185 -203
  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 +19 -86
  271. package/dist/components/toggle-card.d.ts +11 -2
  272. package/dist/components/toggle-card.js +8 -77
  273. package/dist/components/toggle-group.d.ts +21 -59
  274. package/dist/components/toggle-group.js +31 -80
  275. package/dist/components/toggle.d.ts +19 -9
  276. package/dist/components/toggle.js +16 -61
  277. package/dist/components/tooltip.d.ts +25 -12
  278. package/dist/components/tooltip.js +15 -88
  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 -24
  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/targets/native/components/index.d.ts +0 -2
  295. package/dist/targets/native/components/index.js +0 -4
  296. package/dist/targets/native/preset.cjs +0 -1
  297. package/dist/targets/native/theme.css +58 -60
  298. package/dist/targets/native/theme.d.ts +58 -60
  299. package/dist/targets/native/theme.js +58 -60
  300. package/package.json +34 -12
  301. package/styles/_primitives.generated.css +40 -0
  302. package/styles/base.css +12 -18
  303. package/styles/rds/components-styles.css +11365 -0
  304. package/styles/rds/components.css +993 -0
  305. package/styles/rds/foundation.css +74 -0
  306. package/styles/rds/theme.css +261 -0
  307. package/styles/rds.css +6 -0
  308. package/styles/themes/rojao.css +46 -53
  309. package/dist/components/blocker-card.d.ts +0 -42
  310. package/dist/components/blocker-card.js +0 -54
  311. package/dist/components/bottom-sheet.d.ts +0 -31
  312. package/dist/components/bottom-sheet.js +0 -127
  313. package/dist/components/chat-bubble.d.ts +0 -16
  314. package/dist/components/chat-bubble.js +0 -56
  315. package/dist/components/chips.d.ts +0 -22
  316. package/dist/components/chips.js +0 -101
  317. package/dist/components/copilot-hint.d.ts +0 -18
  318. package/dist/components/copilot-hint.js +0 -72
  319. package/dist/components/divider.d.ts +0 -20
  320. package/dist/components/divider.js +0 -50
  321. package/dist/components/empty-state.d.ts +0 -48
  322. package/dist/components/empty-state.js +0 -94
  323. package/dist/components/form-card-header.d.ts +0 -13
  324. package/dist/components/form-card-header.js +0 -16
  325. package/dist/components/label.d.ts +0 -16
  326. package/dist/components/label.js +0 -48
  327. package/dist/components/menu.d.ts +0 -50
  328. package/dist/components/menu.js +0 -83
  329. package/dist/components/modal.d.ts +0 -25
  330. package/dist/components/modal.js +0 -86
  331. package/dist/components/notice.d.ts +0 -50
  332. package/dist/components/notice.js +0 -121
  333. package/dist/components/page-tabs.d.ts +0 -35
  334. package/dist/components/page-tabs.js +0 -68
  335. package/dist/components/paywall-banner.d.ts +0 -37
  336. package/dist/components/paywall-banner.js +0 -58
  337. package/dist/components/paywall.d.ts +0 -44
  338. package/dist/components/paywall.js +0 -65
  339. package/dist/components/phone-frame.d.ts +0 -9
  340. package/dist/components/phone-frame.js +0 -19
  341. package/dist/components/pix-icon.d.ts +0 -8
  342. package/dist/components/search.d.ts +0 -30
  343. package/dist/components/search.js +0 -86
  344. package/dist/components/themed.d.ts +0 -36
  345. package/dist/components/themed.js +0 -23
  346. package/dist/components/toaster.d.ts +0 -84
  347. package/dist/components/toaster.js +0 -290
  348. package/dist/components/use-dismiss.d.ts +0 -9
  349. package/dist/components/use-dismiss.js +0 -28
  350. package/dist/components/use-focus-trap.d.ts +0 -5
  351. package/dist/components/use-focus-trap.js +0 -54
  352. package/dist/targets/native/components/paywall-banner.d.ts +0 -11
  353. package/dist/targets/native/components/paywall-banner.js +0 -55
  354. package/dist/targets/native/components/paywall.d.ts +0 -18
  355. package/dist/targets/native/components/paywall.js +0 -71
  356. /package/dist/{components/pix-icon.js → icons/pix.js} +0 -0
@@ -1,45 +1,41 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, KeyboardEvent } from 'react';
3
- import { LucideIcon } from 'lucide-react';
2
+ import { ReactNode, KeyboardEvent, ComponentType } from 'react';
4
3
 
5
- /**
6
- * OptionTile / OptionTileGrid — grade de escolha única (onboarding #449).
7
- *
8
- * MESMA FAMÍLIA visual do ChoiceCard (os dois single-choice): casca idle suave
9
- * (borda 1px border-default, hover border-strong) e selecionado = fill SÓLIDO
10
- * derivado da camada semântica de seleção (--selection-fill-active). Baixa visão:
11
- * a seleção é distinguível por mais que cor — fill de alto contraste + check
12
- * redundante (badge on-fill, glifo fill), nunca só um realce sutil. Todo conteúdo
13
- * sobre o fill ativo usa tokens de contraste próprios (*-active → on-fill), nunca
14
- * os tokens de superfície clara.
15
- *
16
- * Acessibilidade: OptionTileGrid é um radiogroup com roving tabindex — só um tile é
17
- * tabbable; setas movem foco E seleção (padrão ARIA), Home/End vão às pontas.
18
- */
4
+ /** @deprecated Use ChoiceCardProps. */
19
5
  interface OptionTileProps {
20
6
  selected: boolean;
21
7
  label: string;
22
8
  onClick: () => void;
23
9
  icon?: ReactNode;
24
10
  disabled?: boolean;
11
+ /** true: a checkbox (several chosen); false: a radio (one at a time). */
25
12
  multiple?: boolean;
26
13
  tabIndex?: number;
14
+ /** Ignored: the native radio handles the keyboard. */
27
15
  onKeyDown?: (e: KeyboardEvent<HTMLButtonElement>) => void;
16
+ /** Ignored: the control is an <input>, not a <button>. */
28
17
  buttonRef?: (el: HTMLButtonElement | null) => void;
18
+ /** Takes the whole line of the grid. */
29
19
  fullSpan?: boolean;
30
20
  className?: string;
31
21
  }
32
- declare function OptionTile({ selected, label, onClick, icon, disabled, multiple, tabIndex, onKeyDown, buttonRef, fullSpan, className, }: OptionTileProps): react.JSX.Element;
22
+ /**
23
+ * @deprecated Use ChoiceCard with layout="tile" (Figma [RDS] Content/ChoiceCard). A thin wrapper over it: `label` is
24
+ * the children, `onClick` is `onSelect`. A native radio (a checkbox with `multiple`), no longer a button.
25
+ */
26
+ declare function OptionTile({ selected, label, onClick, icon, disabled, multiple, tabIndex, fullSpan, className }: OptionTileProps): react.JSX.Element;
27
+ /** @deprecated Use ChoiceCardGroup's items. */
33
28
  interface OptionTileItem<T extends string = string> {
34
29
  value: T;
35
30
  label: string;
36
- icon?: LucideIcon;
31
+ /** An icon component (lucide or your own); absent, the tile is text only. */
32
+ icon?: ComponentType;
37
33
  fullSpan?: boolean;
38
34
  }
39
35
  interface OptionTileGridBase<T extends string = string> {
40
36
  label?: ReactNode;
41
37
  options: OptionTileItem<T>[];
42
- /** 2 = sempre 2 colunas; 3 = 2 no mobile, 3 no >= sm. default 3. */
38
+ /** Ignored: the grid fits as many 160 cells as the width allows. */
43
39
  columns?: 2 | 3;
44
40
  className?: string;
45
41
  'aria-label'?: string;
@@ -54,7 +50,12 @@ type OptionTileGridMulti<T extends string = string> = OptionTileGridBase<T> & {
54
50
  value: T[];
55
51
  onChange: (value: T[]) => void;
56
52
  };
53
+ /** @deprecated Use ChoiceCardGroupProps. */
57
54
  type OptionTileGridProps<T extends string = string> = OptionTileGridSingle<T> | OptionTileGridMulti<T>;
55
+ /**
56
+ * @deprecated Use ChoiceCardGroup with layout="tile". A thin wrapper over it: `label` (or `aria-label`) is the legend.
57
+ * With `multiple` the tiles are checkboxes, each toggling its value in the list.
58
+ */
58
59
  declare function OptionTileGrid<T extends string = string>(props: OptionTileGridProps<T>): react.JSX.Element;
59
60
 
60
61
  export { OptionTile, OptionTileGrid, type OptionTileGridProps, type OptionTileItem, type OptionTileProps };
@@ -1,148 +1,63 @@
1
1
  "use client";
2
- import "../chunk-ORMEWXMH.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { useId, useRef } from "react";
5
- import { Check } from "lucide-react";
6
- function OptionTile({
7
- selected,
8
- label,
9
- onClick,
10
- icon,
11
- disabled = false,
12
- multiple = false,
13
- tabIndex,
14
- onKeyDown,
15
- buttonRef,
16
- fullSpan = false,
17
- className = ""
18
- }) {
19
- return /* @__PURE__ */ jsxs(
20
- "button",
2
+ import {
3
+ __objRest,
4
+ __spreadProps,
5
+ __spreadValues
6
+ } from "../chunk-ORMEWXMH.js";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import { ChoiceCardControl, ChoiceCardGroup } from "./internal/choice-card.js";
9
+ function OptionTile({ selected, label, onClick, icon, disabled, multiple = false, tabIndex, fullSpan, className }) {
10
+ return /* @__PURE__ */ jsx(
11
+ ChoiceCardControl,
21
12
  {
22
- type: "button",
23
- role: multiple ? "checkbox" : "radio",
24
- "aria-checked": selected,
25
- tabIndex,
13
+ control: multiple ? "checkbox" : "radio",
14
+ layout: "tile",
15
+ selected,
16
+ onSelect: onClick,
17
+ icon,
26
18
  disabled,
27
- ref: buttonRef,
28
- onClick,
29
- onKeyDown,
30
- className: [
31
- "relative flex w-full flex-col items-center justify-center gap-2 rounded-(--radius-card) border text-center transition-all",
32
- icon ? "min-h-[88px] px-3 py-4" : "min-h-[52px] px-3 py-3",
33
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus focus-visible:ring-offset-2",
34
- selected ? "[border-color:var(--option-tile-border-active)] [background:var(--option-tile-bg-active)]" : "[border-color:var(--option-tile-border)] [background:var(--option-tile-bg)] hover:[border-color:var(--option-tile-border-hover)]",
35
- disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
36
- fullSpan ? "col-span-full" : "",
37
- className
38
- ].filter(Boolean).join(" "),
39
- children: [
40
- selected && /* @__PURE__ */ jsx("span", { className: "absolute right-2 top-2 flex size-4 items-center justify-center rounded-full [background:var(--option-tile-check)] [color:var(--option-tile-check-icon)]", children: /* @__PURE__ */ jsx(Check, { size: 11, strokeWidth: 3 }) }),
41
- icon && /* @__PURE__ */ jsx(
42
- "span",
43
- {
44
- className: [
45
- "flex size-10 items-center justify-center rounded-(--radius-card) transition-colors [&_svg]:size-5",
46
- selected ? "[background:var(--option-tile-icon-bg-active)] [color:var(--option-tile-icon-active)]" : "[background:var(--option-tile-icon-bg)] [color:var(--option-tile-icon)]"
47
- ].join(" "),
48
- children: icon
49
- }
50
- ),
51
- /* @__PURE__ */ jsx(
52
- "span",
53
- {
54
- className: [
55
- icon ? "text-caption" : "text-label",
56
- "font-semibold leading-tight",
57
- selected ? "[color:var(--option-tile-label-active)]" : "[color:var(--option-tile-label)]"
58
- ].join(" "),
59
- children: label
60
- }
61
- )
62
- ]
19
+ tabIndex,
20
+ className,
21
+ style: fullSpan ? { gridColumn: "1 / -1" } : void 0,
22
+ children: label
63
23
  }
64
24
  );
65
25
  }
66
26
  function OptionTileGrid(props) {
67
- const { label, options, columns = 3, className = "" } = props;
68
- const ariaLabel = props["aria-label"];
69
- const multiple = props.multiple === true;
70
- const groupId = useId();
71
- const btns = useRef([]);
72
- const isSel = (v) => multiple ? props.value.includes(v) : props.value === v;
73
- const activate = (v) => {
74
- if (props.multiple) {
75
- const cur = props.value;
76
- props.onChange(cur.includes(v) ? cur.filter((x) => x !== v) : [...cur, v]);
77
- } else {
78
- props.onChange(v);
79
- }
27
+ var _a;
28
+ const { label, options, className } = props;
29
+ const legend = (_a = label != null ? label : props["aria-label"]) != null ? _a : "";
30
+ const tile = (opt) => {
31
+ const Icon = opt.icon;
32
+ return {
33
+ key: opt.value,
34
+ value: opt.value,
35
+ icon: Icon ? /* @__PURE__ */ jsx(Icon, {}) : void 0,
36
+ style: opt.fullSpan ? { gridColumn: "1 / -1" } : void 0,
37
+ children: opt.label
38
+ };
80
39
  };
81
- const activeIdx = multiple ? -1 : Math.max(0, options.findIndex((o) => isSel(o.value)));
82
- const move = (i) => {
83
- var _a;
84
- const n = options.length;
85
- const idx = (i % n + n) % n;
86
- (_a = btns.current[idx]) == null ? void 0 : _a.focus();
87
- if (!multiple) activate(options[idx].value);
88
- };
89
- const onKeyDown = (e, i) => {
90
- if (multiple) return;
91
- switch (e.key) {
92
- case "ArrowRight":
93
- case "ArrowDown":
94
- e.preventDefault();
95
- move(i + 1);
96
- break;
97
- case "ArrowLeft":
98
- case "ArrowUp":
99
- e.preventDefault();
100
- move(i - 1);
101
- break;
102
- case "Home":
103
- e.preventDefault();
104
- move(0);
105
- break;
106
- case "End":
107
- e.preventDefault();
108
- move(options.length - 1);
109
- break;
110
- }
111
- };
112
- const grid = /* @__PURE__ */ jsx(
113
- "div",
114
- {
115
- id: groupId,
116
- role: multiple ? "group" : "radiogroup",
117
- "aria-label": ariaLabel,
118
- className: ["grid gap-2", columns === 2 ? "grid-cols-2" : "grid-cols-2 sm:grid-cols-3", label ? "" : className].join(" "),
119
- children: options.map((opt, i) => {
120
- const Icon = opt.icon;
121
- return /* @__PURE__ */ jsx(
122
- OptionTile,
123
- {
124
- multiple,
125
- selected: isSel(opt.value),
126
- label: opt.label,
127
- icon: Icon ? /* @__PURE__ */ jsx(Icon, {}) : void 0,
128
- fullSpan: opt.fullSpan,
129
- onClick: () => activate(opt.value),
130
- tabIndex: multiple ? 0 : i === activeIdx ? 0 : -1,
131
- onKeyDown: (e) => onKeyDown(e, i),
132
- buttonRef: (el) => {
133
- btns.current[i] = el;
134
- }
135
- },
136
- opt.value
137
- );
138
- })
139
- }
140
- );
141
- if (!label) return grid;
142
- return /* @__PURE__ */ jsxs("div", { className: ["flex flex-col gap-2", className].join(" "), children: [
143
- /* @__PURE__ */ jsx("span", { className: "text-label font-medium text-fg-primary", children: label }),
144
- grid
145
- ] });
40
+ if (props.multiple) {
41
+ const { value: value2, onChange: onChange2 } = props;
42
+ return /* @__PURE__ */ jsx(ChoiceCardGroup, { legend, layout: "tile", className, children: options.map((opt) => {
43
+ const _a2 = tile(opt), { key } = _a2, rest = __objRest(_a2, ["key"]);
44
+ return /* @__PURE__ */ jsx(
45
+ ChoiceCardControl,
46
+ __spreadProps(__spreadValues({}, rest), {
47
+ value: void 0,
48
+ control: "checkbox",
49
+ selected: value2.includes(opt.value),
50
+ onSelect: () => onChange2(value2.includes(opt.value) ? value2.filter((v) => v !== opt.value) : [...value2, opt.value])
51
+ }),
52
+ key
53
+ );
54
+ }) });
55
+ }
56
+ const { value, onChange } = props;
57
+ return /* @__PURE__ */ jsx(ChoiceCardGroup, { legend, layout: "tile", value: value != null ? value : "", onValueChange: (next) => onChange(next), className, children: options.map((opt) => {
58
+ const _a2 = tile(opt), { key } = _a2, rest = __objRest(_a2, ["key"]);
59
+ return /* @__PURE__ */ jsx(ChoiceCardControl, __spreadProps(__spreadValues({}, rest), { control: "radio" }), key);
60
+ }) });
146
61
  }
147
62
  export {
148
63
  OptionTile,
@@ -0,0 +1,31 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+
4
+ type PageHeaderHeading = 'h1' | 'h2' | 'h3';
5
+ interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
6
+ /** The screen's name (Figma: `title`). It does not repeat the path. */
7
+ title: ReactNode;
8
+ /** What the screen does, in one sentence (Figma: `showDescription` + `description`). */
9
+ description?: ReactNode;
10
+ /** Where the person is: a Breadcrumb (Figma: `showBreadcrumb`). */
11
+ breadcrumb?: ReactNode;
12
+ /** Up to two actions on the right, the main one a Button action fill (Figma: the `actions` slot). */
13
+ actions?: ReactNode;
14
+ /**
15
+ * A TabsList, when the screen splits into views (Figma: `showTabs`). The Tabs root wraps the PageHeader and the
16
+ * TabsContent panels under it.
17
+ */
18
+ tabs?: ReactNode;
19
+ /**
20
+ * The title's heading level. h1 (default) for the top of a screen, inside a <header>; h2 or h3 for a section
21
+ * inside the page, following its outline (then a <div>). Not in the Figma: it only changes the semantics.
22
+ */
23
+ titleAs?: PageHeaderHeading;
24
+ }
25
+ /**
26
+ * PageHeader — Figma [RDS] Navigation/PageHeader. The top of a screen: path, title, what it does, the main actions
27
+ * and, when the screen splits, the tabs. On a phone the actions go under the title. Styles: page-header.css.
28
+ */
29
+ declare function PageHeader({ title, description, breadcrumb, actions, tabs, titleAs, className, ...rest }: PageHeaderProps): react.JSX.Element;
30
+
31
+ export { PageHeader, type PageHeaderHeading, type PageHeaderProps };
@@ -0,0 +1,25 @@
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "../chunk-ORMEWXMH.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ function PageHeader(_a) {
8
+ var _b = _a, { title, description, breadcrumb, actions, tabs, titleAs = "h1", className } = _b, rest = __objRest(_b, ["title", "description", "breadcrumb", "actions", "tabs", "titleAs", "className"]);
9
+ const Root = titleAs === "h1" ? "header" : "div";
10
+ const Title = titleAs;
11
+ return /* @__PURE__ */ jsxs(Root, __spreadProps(__spreadValues({}, rest), { className: ["rds-page-header", className].filter(Boolean).join(" "), children: [
12
+ breadcrumb,
13
+ /* @__PURE__ */ jsxs("div", { className: "rds-page-header__row", children: [
14
+ /* @__PURE__ */ jsxs("div", { className: "rds-page-header__heading", children: [
15
+ /* @__PURE__ */ jsx(Title, { className: "rds-page-header__title", children: title }),
16
+ description && /* @__PURE__ */ jsx("p", { className: "rds-page-header__description", children: description })
17
+ ] }),
18
+ actions && /* @__PURE__ */ jsx("div", { className: "rds-page-header__actions", children: actions })
19
+ ] }),
20
+ tabs
21
+ ] }));
22
+ }
23
+ export {
24
+ PageHeader
25
+ };
@@ -3,12 +3,18 @@ import { ReactNode } from 'react';
3
3
 
4
4
  type PageShellWidth = 'narrow' | 'default' | 'wide';
5
5
  interface PageShellProps {
6
+ /** narrow 768, default 1280, wide 1536. */
6
7
  maxWidth?: PageShellWidth;
8
+ /** The page's gutters: 24 on top and bottom, 16 on the sides (24 from 640, 32 from 1024). Default true. */
7
9
  padded?: boolean;
8
10
  children: ReactNode;
9
11
  className?: string;
10
12
  }
11
- declare function PageShell({ maxWidth, padded, children, className, }: PageShellProps): react.JSX.Element;
13
+ /**
14
+ * PageShell — the page container: centred, at most `maxWidth` wide, with the page's gutters. PageShell.Header is
15
+ * the PageHeader (deprecated wrapper) and PageShell.Body stacks the sections 24 apart. Styles: page-shell.css.
16
+ */
17
+ declare function PageShell({ maxWidth, padded, children, className }: PageShellProps): react.JSX.Element;
12
18
  declare namespace PageShell {
13
19
  var Header: typeof PageShellHeader;
14
20
  var Body: typeof PageShellBody;
@@ -19,6 +25,10 @@ interface PageShellHeaderProps {
19
25
  actions?: ReactNode;
20
26
  className?: string;
21
27
  }
28
+ /**
29
+ * @deprecated Use PageHeader (Figma [RDS] Navigation/PageHeader). A thin wrapper over it: title and actions pass
30
+ * through; eyebrow (not in the Figma) becomes the description line.
31
+ */
22
32
  declare function PageShellHeader({ title, eyebrow, actions, className }: PageShellHeaderProps): react.JSX.Element;
23
33
  interface PageShellBodyProps {
24
34
  children: ReactNode;
@@ -1,40 +1,14 @@
1
1
  import "../chunk-ORMEWXMH.js";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- const WIDTH_CLS = {
4
- narrow: "max-w-screen-md",
5
- default: "max-w-screen-xl",
6
- wide: "max-w-screen-2xl"
7
- };
8
- function PageShell({
9
- maxWidth = "default",
10
- padded = true,
11
- children,
12
- className = ""
13
- }) {
14
- return /* @__PURE__ */ jsx(
15
- "div",
16
- {
17
- className: [
18
- "mx-auto w-full",
19
- WIDTH_CLS[maxWidth],
20
- padded ? "px-4 sm:px-6 lg:px-8 py-6" : "",
21
- className
22
- ].filter(Boolean).join(" "),
23
- children
24
- }
25
- );
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { PageHeader } from "./page-header.js";
4
+ function PageShell({ maxWidth = "default", padded = true, children, className }) {
5
+ return /* @__PURE__ */ jsx("div", { className: ["rds-page-shell", `rds-page-shell--${maxWidth}`, padded && "rds-page-shell--padded", className].filter(Boolean).join(" "), children });
26
6
  }
27
- function PageShellHeader({ title, eyebrow, actions, className = "" }) {
28
- return /* @__PURE__ */ jsxs("div", { className: ["flex items-start justify-between gap-4 mb-6", className].filter(Boolean).join(" "), children: [
29
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
30
- eyebrow && /* @__PURE__ */ jsx("p", { className: "text-caption font-medium text-fg-muted mb-1", children: eyebrow }),
31
- /* @__PURE__ */ jsx("h1", { className: "text-heading-md font-semibold text-fg-primary truncate", children: title })
32
- ] }),
33
- actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 shrink-0", children: actions })
34
- ] });
7
+ function PageShellHeader({ title, eyebrow, actions, className }) {
8
+ return /* @__PURE__ */ jsx(PageHeader, { title, description: eyebrow, actions, className: ["rds-page-shell__header", className].filter(Boolean).join(" ") });
35
9
  }
36
- function PageShellBody({ children, className = "" }) {
37
- return /* @__PURE__ */ jsx("div", { className: ["space-y-6", className].filter(Boolean).join(" "), children });
10
+ function PageShellBody({ children, className }) {
11
+ return /* @__PURE__ */ jsx("div", { className: ["rds-page-shell__body", className].filter(Boolean).join(" "), children });
38
12
  }
39
13
  PageShell.Header = PageShellHeader;
40
14
  PageShell.Body = PageShellBody;
@@ -1,35 +1,29 @@
1
1
  import * as react from 'react';
2
2
 
3
3
  /**
4
- * PageSkeleton — loading state padrão pra páginas com tabela.
5
- * Header (título + botão) + tabela com header + N rows.
6
- *
7
- * `padded` (default true) controla o padding interno. Use `padded={false}`
8
- * quando o skeleton já vive dentro de um container que aplica padding
9
- * (ex.: PageRoot/PageLayout), evitando padding duplicado.
10
- *
11
- * Uso:
12
- * <PageSkeleton rows={8} />
13
- * <PageSkeleton rows={8} padded={false} /> // dentro de um container
4
+ * PageSkeleton and CardsSkeleton — compositions of the Skeleton (Figma [RDS] Content/Skeleton) inside Cards: the
5
+ * loading state of a page, in the shape of what is coming. The region is aria-busy and says "Carregando…" to
6
+ * screen readers only; the shapes are hidden from them. Styles: page-skeleton.css.
14
7
  */
15
8
  interface PageSkeletonProps {
9
+ /** How many table rows. Default 5. */
16
10
  rows?: number;
11
+ /** The page's padding (24). Turn it off inside a container that already pads. Default true. */
17
12
  padded?: boolean;
13
+ /** What screen readers hear. */
14
+ label?: string;
18
15
  }
19
- declare function PageSkeleton({ rows, padded }: PageSkeletonProps): react.JSX.Element;
20
- /**
21
- * CardsSkeleton — loading state pra páginas com KPIs (4 cards no topo + 2 charts).
22
- *
23
- * `padded` (default true) — ver PageSkeleton.
24
- *
25
- * Uso:
26
- * <CardsSkeleton count={4} />
27
- * <CardsSkeleton count={4} padded={false} /> // dentro de um container
28
- */
16
+ /** A page with a table: the title and a button, then the table's header and `rows` rows. */
17
+ declare function PageSkeleton({ rows, padded, label }: PageSkeletonProps): react.JSX.Element;
29
18
  interface CardsSkeletonProps {
19
+ /** How many indicator cards. Default 4. */
30
20
  count?: number;
21
+ /** The page's padding (24). Turn it off inside a container that already pads. Default true. */
31
22
  padded?: boolean;
23
+ /** What screen readers hear. */
24
+ label?: string;
32
25
  }
33
- declare function CardsSkeleton({ count, padded }: CardsSkeletonProps): react.JSX.Element;
26
+ /** A page of indicators: the title, `count` cards (2 per row, 4 from 1024) and two charts. */
27
+ declare function CardsSkeleton({ count, padded, label }: CardsSkeletonProps): react.JSX.Element;
34
28
 
35
29
  export { CardsSkeleton, type CardsSkeletonProps, PageSkeleton, type PageSkeletonProps };
@@ -1,38 +1,41 @@
1
1
  import "../chunk-ORMEWXMH.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Card } from "./card.js";
3
4
  import { Skeleton } from "./skeleton.js";
4
- function PageSkeleton({ rows = 5, padded = true }) {
5
- return /* @__PURE__ */ jsxs("div", { className: `space-y-6 ${padded ? "p-6" : ""}`, children: [
6
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
7
- /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-48" }),
8
- /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-28" })
5
+ function PageSkeleton({ rows = 5, padded = true, label = "Carregando\u2026" }) {
6
+ return /* @__PURE__ */ jsxs("div", { className: ["rds-page-skeleton", padded && "rds-page-skeleton--padded"].filter(Boolean).join(" "), role: "status", "aria-busy": "true", children: [
7
+ /* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: label }),
8
+ /* @__PURE__ */ jsxs("div", { className: "rds-page-skeleton__heading", children: [
9
+ /* @__PURE__ */ jsx(Skeleton, { width: 192, height: 28 }),
10
+ /* @__PURE__ */ jsx(Skeleton, { shape: "rect", width: 112, height: 36 })
9
11
  ] }),
10
- /* @__PURE__ */ jsxs("div", { className: "border border-stroke-default rounded-(--radius-card) overflow-hidden", children: [
11
- /* @__PURE__ */ jsxs("div", { className: "bg-surface-raised border-b border-stroke-default px-4 py-3 flex gap-4", children: [
12
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" }),
13
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }),
14
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" })
12
+ /* @__PURE__ */ jsxs(Card, { as: "div", size: "sm", className: "rds-page-skeleton__table", children: [
13
+ /* @__PURE__ */ jsxs("div", { className: "rds-page-skeleton__row rds-page-skeleton__row--head", children: [
14
+ /* @__PURE__ */ jsx(Skeleton, { width: 128 }),
15
+ /* @__PURE__ */ jsx(Skeleton, { width: 96 }),
16
+ /* @__PURE__ */ jsx(Skeleton, { width: 80 })
15
17
  ] }),
16
- Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "px-4 py-3.5 flex gap-4 items-center border-b border-stroke-subtle last:border-0", children: [
17
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-40" }),
18
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-28" }),
19
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-16" }),
20
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20 ml-auto" })
18
+ Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxs("div", { className: "rds-page-skeleton__row", children: [
19
+ /* @__PURE__ */ jsx(Skeleton, { width: 160 }),
20
+ /* @__PURE__ */ jsx(Skeleton, { width: 112 }),
21
+ /* @__PURE__ */ jsx(Skeleton, { width: 64 }),
22
+ /* @__PURE__ */ jsx(Skeleton, { width: 80, className: "rds-page-skeleton__end" })
21
23
  ] }, i))
22
24
  ] })
23
25
  ] });
24
26
  }
25
- function CardsSkeleton({ count = 4, padded = true }) {
26
- return /* @__PURE__ */ jsxs("div", { className: `space-y-6 ${padded ? "p-6" : ""}`, children: [
27
- /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-48" }),
28
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-4", children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "border border-stroke-default rounded-(--radius-card) p-4 space-y-3", children: [
29
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }),
30
- /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-32" }),
31
- /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-20" })
27
+ function CardsSkeleton({ count = 4, padded = true, label = "Carregando\u2026" }) {
28
+ return /* @__PURE__ */ jsxs("div", { className: ["rds-page-skeleton", padded && "rds-page-skeleton--padded"].filter(Boolean).join(" "), role: "status", "aria-busy": "true", children: [
29
+ /* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: label }),
30
+ /* @__PURE__ */ jsx(Skeleton, { width: 192, height: 28 }),
31
+ /* @__PURE__ */ jsx("div", { className: "rds-page-skeleton__grid rds-page-skeleton__grid--stats", children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsxs(Card, { as: "div", size: "sm", className: "rds-page-skeleton__card", children: [
32
+ /* @__PURE__ */ jsx(Skeleton, { width: 96 }),
33
+ /* @__PURE__ */ jsx(Skeleton, { width: 128, height: 32 }),
34
+ /* @__PURE__ */ jsx(Skeleton, { width: 80, height: 12 })
32
35
  ] }, i)) }),
33
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-4", children: Array.from({ length: 2 }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "border border-stroke-default rounded-(--radius-card) p-4 space-y-3", children: [
34
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-32" }),
35
- /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full" })
36
+ /* @__PURE__ */ jsx("div", { className: "rds-page-skeleton__grid rds-page-skeleton__grid--charts", children: [0, 1].map((i) => /* @__PURE__ */ jsxs(Card, { as: "div", size: "sm", className: "rds-page-skeleton__card", children: [
37
+ /* @__PURE__ */ jsx(Skeleton, { width: 128, height: 20 }),
38
+ /* @__PURE__ */ jsx(Skeleton, { shape: "rect", height: 128 })
36
39
  ] }, i)) })
37
40
  ] });
38
41
  }
@@ -1,31 +1,41 @@
1
1
  import * as react from 'react';
2
+ import { HTMLAttributes, ComponentType, ReactNode } from 'react';
2
3
 
3
- /**
4
- * Pagination — navegação por páginas em listas longas.
5
- *
6
- * Uso:
7
- * <Pagination
8
- * page={2}
9
- * totalPages={10}
10
- * onChange={p => setPage(p)}
11
- * />
12
- *
13
- * <Pagination page={1} totalPages={20} onChange={...} siblings={2} />
14
- *
15
- * Renderiza: Prev | 1 ... 4 5 [6] 7 8 ... 20 | Next
16
- */
17
- interface PaginationProps {
4
+ type PaginationLinkComponent = ComponentType<{
5
+ href: string;
6
+ className?: string;
7
+ 'aria-label'?: string;
8
+ 'aria-current'?: 'page';
9
+ children: ReactNode;
10
+ }>;
11
+ interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
12
+ /** The open page, from 1. */
18
13
  page: number;
14
+ /** How many pages there are. */
19
15
  totalPages: number;
20
- onChange: (page: number) => void;
21
- /** Páginas vizinhas a mostrar de cada lado da atual. default = 1. */
16
+ /** Buttons: called with the page to open. Leave it out and pass `href` for links. */
17
+ onChange?: (page: number) => void;
18
+ /** Links: the address of each page. */
19
+ href?: (page: number) => string;
20
+ /** The link element when `href` is given (default `<a>`). Pass a framework Link to navigate on the client. */
21
+ linkAs?: PaginationLinkComponent;
22
+ /** The range and the total, on the left ("21–40 de 340"); never hide the total (Figma: `showSummary` + `summary`). */
23
+ summary?: ReactNode;
24
+ /** Pages shown on each side of the open one. Default 1. */
22
25
  siblings?: number;
23
- /** Páginas fixas no início e no fim (sempre visíveis). default = 1. */
26
+ /** Pages always shown at the start and at the end. Default 1. */
24
27
  boundaries?: number;
25
- className?: string;
26
- /** Esconde quando totalPages <= 1. default = true. */
28
+ /** Render nothing when there is a single page. Default true. */
27
29
  hideOnSinglePage?: boolean;
28
30
  }
29
- declare const Pagination: react.ForwardRefExoticComponent<PaginationProps & react.RefAttributes<HTMLElement>>;
31
+ type Entry = number | 'ellipsis-start' | 'ellipsis-end';
32
+ /** First and last (`boundaries`), the open page and `siblings` on each side; a gap of one page shows the page, a longer one "…". */
33
+ declare function pageItems(page: number, totalPages: number, siblings?: number, boundaries?: number): Entry[];
34
+ /**
35
+ * Pagination — Figma [RDS] Navigation/Pagination. To walk a long list one page at a time: a <nav aria-label="Paginação">;
36
+ * the open page has aria-current="page", every number is named "Página N", previous and next are named and turn
37
+ * disabled at the ends. Buttons with `onChange`, links with `href`. Styles: pagination.css.
38
+ */
39
+ declare function Pagination({ page, totalPages, onChange, href, linkAs: Link, summary, siblings, boundaries, hideOnSinglePage, className, ...rest }: PaginationProps): react.JSX.Element | null;
30
40
 
31
- export { Pagination, type PaginationProps };
41
+ export { Pagination, type PaginationLinkComponent, type PaginationProps, pageItems };