@rojaostudio/ds 1.0.2 → 2.0.0-next.1

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 -52
  116. package/dist/components/index.js +190 -74
  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,94 +1,62 @@
1
1
  "use client";
2
- import "../chunk-ORMEWXMH.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { useEffect, useId } from "react";
5
- import { X } from "lucide-react";
6
- import { createPortal } from "react-dom";
7
- import { useFocusTrap } from "./use-focus-trap.js";
8
- const SIZE_WIDTH = {
9
- sm: "w-80",
10
- // 320px
11
- md: "w-96",
12
- // 384px
13
- lg: "w-[480px]",
14
- xl: "w-[640px]"
15
- };
16
- function Drawer({
17
- open,
18
- onClose,
19
- title,
20
- subtitle,
21
- children,
22
- footer,
23
- side = "right",
24
- size,
25
- width,
26
- closeOnBackdrop = true,
27
- hideClose = false,
28
- className = "",
29
- container
30
- }) {
31
- const widthClass = width != null ? width : SIZE_WIDTH[size != null ? size : "md"];
32
- const titleId = useId();
33
- const panelRef = useFocusTrap(open);
34
- useEffect(() => {
35
- if (!open) return;
36
- const prev = document.body.style.overflow;
37
- document.body.style.overflow = "hidden";
38
- const onKey = (e) => {
39
- if (e.key === "Escape") onClose();
40
- };
41
- document.addEventListener("keydown", onKey);
42
- return () => {
43
- document.body.style.overflow = prev;
44
- document.removeEventListener("keydown", onKey);
45
- };
46
- }, [open, onClose]);
47
- if (!open) return null;
48
- return createPortal(
49
- /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex", children: [
50
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 [background:var(--overlay-scrim)]", onClick: closeOnBackdrop ? onClose : void 0, "aria-hidden": "true" }),
51
- /* @__PURE__ */ jsxs(
52
- "div",
53
- {
54
- ref: panelRef,
55
- role: "dialog",
56
- "aria-modal": "true",
57
- "aria-labelledby": title ? titleId : void 0,
58
- tabIndex: -1,
59
- className: [
60
- "relative z-10 flex flex-col bg-surface-default shadow-xl h-full max-w-full",
61
- "focus:outline-none",
62
- widthClass,
63
- side === "right" ? "ml-auto" : "mr-auto",
64
- className
65
- ].join(" "),
66
- children: [
67
- (title || !hideClose) && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 px-6 py-4 border-b border-stroke-default shrink-0", children: [
68
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
69
- title && /* @__PURE__ */ jsx("h2", { id: titleId, className: "text-body font-semibold text-fg-primary", children: title }),
70
- subtitle && /* @__PURE__ */ jsx("p", { className: "text-label text-fg-muted mt-0.5", children: subtitle })
71
- ] }),
72
- !hideClose && /* @__PURE__ */ jsx(
73
- "button",
74
- {
75
- type: "button",
76
- onClick: onClose,
77
- className: "shrink-0 text-fg-muted hover:text-fg-primary transition-colors rounded focus-visible:ring-2 focus-visible:ring-stroke-focus focus-visible:outline-none p-0.5",
78
- "aria-label": "Fechar",
79
- children: /* @__PURE__ */ jsx(X, { size: 20 })
80
- }
81
- )
82
- ] }),
83
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto px-6 py-4", children }),
84
- footer && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end gap-3 px-6 py-4 border-t border-stroke-default shrink-0", children: footer })
85
- ]
86
- }
87
- )
88
- ] }),
89
- container != null ? container : document.body
2
+ import {
3
+ __objRest,
4
+ __spreadValues
5
+ } from "../chunk-ORMEWXMH.js";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import { useRef, useState } from "react";
8
+ import { ModalClose, ModalShell } from "./internal/modal.js";
9
+ const DISMISS_DISTANCE = 80;
10
+ function Drawer(_a) {
11
+ var _b = _a, { open, defaultOpen, onOpenChange } = _b, props = __objRest(_b, ["open", "defaultOpen", "onOpenChange"]);
12
+ const [own, setOwn] = useState(defaultOpen != null ? defaultOpen : false);
13
+ const isOpen = open != null ? open : own;
14
+ const setOpen = (next) => {
15
+ setOwn(next);
16
+ onOpenChange == null ? void 0 : onOpenChange(next);
17
+ };
18
+ const start = useRef(null);
19
+ const [drag, setDrag] = useState(0);
20
+ const reset = () => {
21
+ start.current = null;
22
+ setDrag(0);
23
+ };
24
+ const handle = /* @__PURE__ */ jsx(
25
+ "div",
26
+ {
27
+ className: "rds-drawer__handle-area",
28
+ "aria-hidden": "true",
29
+ onPointerDown: (event) => {
30
+ var _a2, _b2;
31
+ start.current = event.clientY;
32
+ (_b2 = (_a2 = event.currentTarget).setPointerCapture) == null ? void 0 : _b2.call(_a2, event.pointerId);
33
+ },
34
+ onPointerMove: (event) => {
35
+ if (start.current !== null) setDrag(Math.max(0, event.clientY - start.current));
36
+ },
37
+ onPointerUp: (event) => {
38
+ if (start.current !== null && event.clientY - start.current > DISMISS_DISTANCE) setOpen(false);
39
+ reset();
40
+ },
41
+ onPointerCancel: reset,
42
+ children: /* @__PURE__ */ jsx("span", { className: "rds-drawer__handle" })
43
+ }
44
+ );
45
+ return /* @__PURE__ */ jsx(
46
+ ModalShell,
47
+ __spreadValues({
48
+ prefix: "rds-drawer",
49
+ closeButton: false,
50
+ stackedFooter: true,
51
+ handle,
52
+ open: isOpen,
53
+ onOpenChange: setOpen,
54
+ boxStyle: drag ? { transform: `translateY(${drag}px)`, animation: "none" } : void 0
55
+ }, props)
90
56
  );
91
57
  }
58
+ const DrawerClose = ModalClose;
92
59
  export {
93
- Drawer
60
+ Drawer,
61
+ DrawerClose
94
62
  };
@@ -0,0 +1,63 @@
1
+ import * as react from 'react';
2
+ import { ReactElement, ReactNode } from 'react';
3
+ import { MenuItemContentProps, MenuItemTone } from './internal/menu.js';
4
+
5
+ type DropdownMenuAlign = 'start' | 'center' | 'end';
6
+ type DropdownMenuSide = 'top' | 'bottom' | 'left' | 'right';
7
+ type DropdownMenuItemTone = MenuItemTone;
8
+ interface DropdownMenuProps {
9
+ /** The button that opens it, usually the "⋯" IconButton named after the item whose actions it lists. */
10
+ trigger: ReactElement;
11
+ /** The DropdownMenuItems, with a DropdownMenuSeparator between groups (Figma: the `items` slot). */
12
+ children: ReactNode;
13
+ /** Where it lines up with the button: start (its left edge), end (its right edge). */
14
+ align?: DropdownMenuAlign;
15
+ side?: DropdownMenuSide;
16
+ open?: boolean;
17
+ defaultOpen?: boolean;
18
+ onOpenChange?: (open: boolean) => void;
19
+ /** The menu's name, when the trigger's own name doesn't say it. */
20
+ 'aria-label'?: string;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * DropdownMenu — Figma [RDS] Overlays/DropdownMenu. The actions of an item that don't fit on the screen (Radix
25
+ * DropdownMenu): role="menu"; the focus goes to the first item; the arrows move (disabled items are skipped),
26
+ * typing a letter jumps, Enter or Space chooses, Escape closes and gives the focus back to the button.
27
+ * Up to 7 items; the one that destroys goes last, after a separator. Styles: internal/menu.css.
28
+ */
29
+ declare function DropdownMenu({ trigger, children, align, side, open, defaultOpen, onOpenChange, className, 'aria-label': ariaLabel, }: DropdownMenuProps): react.JSX.Element;
30
+ interface DropdownMenuItemProps extends MenuItemContentProps {
31
+ /** Runs when the item is chosen (click, Enter or Space); the menu then closes. A destructive action asks first (AlertDialog). */
32
+ onSelect?: () => void;
33
+ /** danger for what destroys: last, after a separator (Figma: `tone`). */
34
+ tone?: DropdownMenuItemTone;
35
+ /** Stays in the list, can't be chosen, and the arrows skip it. */
36
+ disabled?: boolean;
37
+ /** The text typing jumps by, when the label is not plain text. */
38
+ textValue?: string;
39
+ /** Render the single child element (a link) as the item: a place to go instead of an action. */
40
+ asChild?: boolean;
41
+ }
42
+ /** One action (Figma .menu/item): role="menuitem". */
43
+ declare function DropdownMenuItem({ children, icon, shortcut, onSelect, tone, disabled, textValue, asChild }: DropdownMenuItemProps): react.JSX.Element;
44
+ interface DropdownMenuRadioGroupProps {
45
+ /** The chosen item's value. */
46
+ value: string;
47
+ onValueChange: (value: string) => void;
48
+ /** The DropdownMenuRadioItems. */
49
+ children: ReactNode;
50
+ }
51
+ /** A group of items of which one is chosen (a filter's options): role="group" of menuitemradio. */
52
+ declare function DropdownMenuRadioGroup({ value, onValueChange, children }: DropdownMenuRadioGroupProps): react.JSX.Element;
53
+ interface DropdownMenuRadioItemProps extends MenuItemContentProps {
54
+ value: string;
55
+ disabled?: boolean;
56
+ textValue?: string;
57
+ }
58
+ /** One option of a DropdownMenuRadioGroup: role="menuitemradio", aria-checked; the chosen one shows a check. */
59
+ declare function DropdownMenuRadioItem({ value, children, icon, shortcut, disabled, textValue }: DropdownMenuRadioItemProps): react.JSX.Element;
60
+ /** The line between groups of actions (Figma: the Separator in the `items` slot). */
61
+ declare function DropdownMenuSeparator(): react.JSX.Element;
62
+
63
+ export { DropdownMenu, type DropdownMenuAlign, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemTone, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSide };
@@ -0,0 +1,62 @@
1
+ "use client";
2
+ import "../chunk-ORMEWXMH.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import * as Menu from "@radix-ui/react-dropdown-menu";
5
+ import { CheckIcon } from "./internal/icons.js";
6
+ import { MenuItemContent, menuItemClassName } from "./internal/menu.js";
7
+ function DropdownMenu({
8
+ trigger,
9
+ children,
10
+ align = "start",
11
+ side = "bottom",
12
+ open,
13
+ defaultOpen,
14
+ onOpenChange,
15
+ className,
16
+ "aria-label": ariaLabel
17
+ }) {
18
+ return (
19
+ // Not modal: the page is not hidden from screen readers (aria-hidden over the focusable trigger) nor locked; a
20
+ // click outside, Escape or Tab still close it, and the focus goes back to the trigger.
21
+ /* @__PURE__ */ jsxs(Menu.Root, { open, defaultOpen, onOpenChange, modal: false, children: [
22
+ /* @__PURE__ */ jsx(Menu.Trigger, { asChild: true, children: trigger }),
23
+ /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(
24
+ Menu.Content,
25
+ {
26
+ align,
27
+ side,
28
+ sideOffset: 4,
29
+ collisionPadding: 8,
30
+ "aria-label": ariaLabel,
31
+ className: ["rds-menu", "rds-dropdown-menu", className].filter(Boolean).join(" "),
32
+ children
33
+ }
34
+ ) })
35
+ ] })
36
+ );
37
+ }
38
+ function DropdownMenuItem({ children, icon, shortcut, onSelect, tone, disabled, textValue, asChild }) {
39
+ if (asChild) {
40
+ return /* @__PURE__ */ jsx(Menu.Item, { asChild: true, onSelect, disabled, textValue, className: menuItemClassName(tone), children });
41
+ }
42
+ return /* @__PURE__ */ jsx(Menu.Item, { onSelect, disabled, textValue, className: menuItemClassName(tone), children: /* @__PURE__ */ jsx(MenuItemContent, { icon, shortcut, children }) });
43
+ }
44
+ function DropdownMenuRadioGroup({ value, onValueChange, children }) {
45
+ return /* @__PURE__ */ jsx(Menu.RadioGroup, { value, onValueChange, children });
46
+ }
47
+ function DropdownMenuRadioItem({ value, children, icon, shortcut, disabled, textValue }) {
48
+ return /* @__PURE__ */ jsxs(Menu.RadioItem, { value, disabled, textValue, className: menuItemClassName(), children: [
49
+ /* @__PURE__ */ jsx(MenuItemContent, { icon, shortcut, children }),
50
+ /* @__PURE__ */ jsx(Menu.ItemIndicator, { className: "rds-menu__check", "aria-hidden": "true", children: /* @__PURE__ */ jsx(CheckIcon, {}) })
51
+ ] });
52
+ }
53
+ function DropdownMenuSeparator() {
54
+ return /* @__PURE__ */ jsx(Menu.Separator, { className: "rds-menu__separator" });
55
+ }
56
+ export {
57
+ DropdownMenu,
58
+ DropdownMenuItem,
59
+ DropdownMenuRadioGroup,
60
+ DropdownMenuRadioItem,
61
+ DropdownMenuSeparator
62
+ };
@@ -2,9 +2,8 @@ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
 
4
4
  /**
5
- * Dropzone — área de arrastar-e-soltar / clicar para selecionar arquivos.
6
- * Substitui `<div className="border-2 border-dashed rounded-xl" onDrop=...>` reimplementado.
7
- * Gerencia estado de drag, input file escondido e clique. O conteúdo (ícone + texto) é livre.
5
+ * @deprecated Use `<FileInput variant="dropzone">` (Figma [RDS] Forms/FileInput), which has the label, the hint, the
6
+ * error and the chosen file's row. Kept as a thin wrapper so 1.x code keeps compiling.
8
7
  */
9
8
  interface DropzoneProps {
10
9
  onFiles: (files: FileList) => void;
@@ -12,8 +11,15 @@ interface DropzoneProps {
12
11
  multiple?: boolean;
13
12
  disabled?: boolean;
14
13
  className?: string;
14
+ /** The call inside the area (FileInput's `dropTitle`). */
15
15
  children: ReactNode;
16
+ /** The area's name for screen readers: a Dropzone has no visible label. */
17
+ 'aria-label'?: string;
16
18
  }
17
- declare function Dropzone({ onFiles, accept, multiple, disabled, className, children }: DropzoneProps): react.JSX.Element;
19
+ /**
20
+ * @deprecated Use `<FileInput variant="dropzone">`. A drop target only: it hands the files over and stays empty,
21
+ * ready for the next ones, as the 1.x Dropzone did.
22
+ */
23
+ declare function Dropzone({ onFiles, accept, multiple, disabled, className, children, 'aria-label': ariaLabel, }: DropzoneProps): react.JSX.Element;
18
24
 
19
25
  export { Dropzone, type DropzoneProps };
@@ -1,65 +1,37 @@
1
1
  "use client";
2
2
  import "../chunk-ORMEWXMH.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { useRef, useState } from "react";
5
- function Dropzone({ onFiles, accept, multiple = false, disabled = false, className = "", children }) {
6
- const inputRef = useRef(null);
7
- const [dragging, setDragging] = useState(false);
8
- function handleDrop(e) {
9
- var _a;
10
- e.preventDefault();
11
- setDragging(false);
12
- if (disabled) return;
13
- if ((_a = e.dataTransfer.files) == null ? void 0 : _a.length) onFiles(e.dataTransfer.files);
14
- }
15
- return /* @__PURE__ */ jsxs(
16
- "div",
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { FileInput } from "./file-input.js";
5
+ function Dropzone({
6
+ onFiles,
7
+ accept,
8
+ multiple = false,
9
+ disabled = false,
10
+ className,
11
+ children,
12
+ "aria-label": ariaLabel = "Enviar arquivo"
13
+ }) {
14
+ return /* @__PURE__ */ jsx(
15
+ FileInput,
17
16
  {
18
- role: "button",
19
- tabIndex: disabled ? -1 : 0,
20
- onClick: () => {
21
- var _a;
22
- return !disabled && ((_a = inputRef.current) == null ? void 0 : _a.click());
17
+ variant: "dropzone",
18
+ "aria-label": ariaLabel,
19
+ dropTitle: children,
20
+ fileName: "",
21
+ accept,
22
+ multiple,
23
+ disabled,
24
+ className,
25
+ onFiles: (files) => {
26
+ const copy = new DataTransfer();
27
+ for (const file of Array.from(files)) copy.items.add(file);
28
+ onFiles(copy.files);
23
29
  },
24
- onKeyDown: (e) => {
25
- var _a;
26
- if (!disabled && (e.key === "Enter" || e.key === " ")) {
27
- e.preventDefault();
28
- (_a = inputRef.current) == null ? void 0 : _a.click();
29
- }
30
- },
31
- onDragOver: (e) => {
32
- e.preventDefault();
33
- if (!disabled) setDragging(true);
34
- },
35
- onDragLeave: () => setDragging(false),
36
- onDrop: handleDrop,
37
- className: [
38
- "flex flex-col items-center justify-center gap-3 rounded-(--radius-card) border-2 border-dashed py-10 transition-colors",
39
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus",
40
- disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
41
- dragging ? "border-stroke-focus bg-surface-raised" : "border-stroke-control hover:border-stroke-strong hover:bg-surface-page",
42
- className
43
- ].filter(Boolean).join(" "),
44
- children: [
45
- /* @__PURE__ */ jsx(
46
- "input",
47
- {
48
- ref: inputRef,
49
- type: "file",
50
- accept,
51
- multiple,
52
- disabled,
53
- className: "hidden",
54
- onChange: (e) => {
55
- var _a;
56
- if ((_a = e.target.files) == null ? void 0 : _a.length) onFiles(e.target.files);
57
- e.target.value = "";
58
- }
59
- }
60
- ),
61
- children
62
- ]
30
+ onChange: (event) => {
31
+ queueMicrotask(() => {
32
+ event.target.value = "";
33
+ });
34
+ }
63
35
  }
64
36
  );
65
37
  }
@@ -0,0 +1,29 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+
4
+ type Heading = 'h2' | 'h3' | 'h4';
5
+ interface EmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
6
+ /** What is missing (Figma: `title`): "Nenhum pedido por aqui". No "Ops!", and no blaming the person. */
7
+ title: ReactNode;
8
+ /** The heading level that fits the page's heading order. */
9
+ titleAs?: Heading;
10
+ /** How to change that (Figma: `showDescription` + `description`). */
11
+ description?: ReactNode;
12
+ /** The screen's subject (Figma: `showIcon`), an inline SVG shown in a soft lg Tile. */
13
+ icon?: ReactNode;
14
+ /**
15
+ * The Tile's tone. neutral (the Figma), or danger when the content failed to load (the Table's error state).
16
+ */
17
+ tone?: 'neutral' | 'danger';
18
+ /** The way out (Figma: `showAction`): a fill Button. */
19
+ action?: ReactNode;
20
+ /** A second way (Figma: `showSecondaryAction`): an outline Button. */
21
+ secondaryAction?: ReactNode;
22
+ }
23
+ /**
24
+ * Empty — Figma [RDS] Content/Empty. The empty state: what is missing, why, and what to do. A system error is an
25
+ * Alert, not an Empty. Styles: empty.css.
26
+ */
27
+ declare function Empty({ title, titleAs: Title, description, icon, tone, action, secondaryAction, className, ...rest }: EmptyProps): react.JSX.Element;
28
+
29
+ export { Empty, type EmptyProps };
@@ -0,0 +1,42 @@
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "../chunk-ORMEWXMH.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Tile } from "./tile.js";
8
+ function Empty(_a) {
9
+ var _b = _a, {
10
+ title,
11
+ titleAs: Title = "h3",
12
+ description,
13
+ icon,
14
+ tone = "neutral",
15
+ action,
16
+ secondaryAction,
17
+ className
18
+ } = _b, rest = __objRest(_b, [
19
+ "title",
20
+ "titleAs",
21
+ "description",
22
+ "icon",
23
+ "tone",
24
+ "action",
25
+ "secondaryAction",
26
+ "className"
27
+ ]);
28
+ return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-empty", className].filter(Boolean).join(" "), children: [
29
+ icon && /* @__PURE__ */ jsx(Tile, { icon, tone, variant: "soft", size: "lg" }),
30
+ /* @__PURE__ */ jsxs("div", { className: "rds-empty__text", children: [
31
+ /* @__PURE__ */ jsx(Title, { className: "rds-empty__title", children: title }),
32
+ description && /* @__PURE__ */ jsx("p", { className: "rds-empty__description", children: description })
33
+ ] }),
34
+ (action || secondaryAction) && /* @__PURE__ */ jsxs("div", { className: "rds-empty__actions", children: [
35
+ action,
36
+ secondaryAction
37
+ ] })
38
+ ] }));
39
+ }
40
+ export {
41
+ Empty
42
+ };
@@ -1,14 +1,38 @@
1
1
  import * as react from 'react';
2
- import { ReactNode } from 'react';
2
+ import { ComponentPropsWithRef, ReactNode } from 'react';
3
3
 
4
+ interface FABProps extends ComponentPropsWithRef<'button'> {
5
+ /** The action's name, a verb ("Novo pedido") (Figma: `label`). Always shown: it is the accessible name. */
6
+ children: ReactNode;
7
+ /** Icon before the text (Figma: `hasIcon`). Decorative, rendered with aria-hidden. */
8
+ icon?: ReactNode;
9
+ /** Rendered as aria-disabled="true": stays in the tab order and takes focus, but clicks do nothing. */
10
+ disabled?: boolean;
11
+ /**
12
+ * Render the single child element (an `<a>`, a framework `Link`) with the FAB's classes and behaviour
13
+ * instead of a `<button>`. Use it when the action navigates.
14
+ */
15
+ asChild?: boolean;
16
+ }
17
+ /**
18
+ * FAB — Figma [RDS] Actions/FAB. The floating button of a screen's main action: a 56 pill in the brand
19
+ * colour, raised. One per screen, never beside a visible button that does the same thing. It does not
20
+ * place itself: FABRoot (below) or the page puts it in the corner. Styles: fab.css.
21
+ */
22
+ declare function FAB({ children, icon, disabled, asChild, type, className, onClick, ...rest }: FABProps): react.JSX.Element;
4
23
  type FABConfig = {
5
24
  label: string;
25
+ /** The FAB's icon. Defaults to a plus. */
26
+ icon?: ReactNode;
27
+ /** Navigates with a plain `<a>`. For client-side routing, render <FAB asChild><Link/></FAB> yourself. */
6
28
  href?: string;
7
29
  onClick?: () => void;
8
- /** cta = primary action button | save = saving-bar with primary + secondary */
30
+ /** cta = the FAB | save = a SavingBar (label saves, secondary discards) */
9
31
  variant?: 'cta' | 'save';
10
32
  disabled?: boolean;
33
+ /** Only for `save`: the bar shows its saving status. */
11
34
  loading?: boolean;
35
+ /** Only for `save`: the discard action. */
12
36
  secondary?: {
13
37
  label: string;
14
38
  onClick: () => void;
@@ -28,11 +52,10 @@ declare function FABProvider({ children }: {
28
52
  }): react.JSX.Element;
29
53
  declare function useFAB(): FABContextValue;
30
54
  /**
31
- * Register the page's primary FAB action.
32
- * Clears the FAB automatically on unmount.
55
+ * Register the page's primary FAB action. Clears the FAB automatically on unmount.
33
56
  * Pass a stable deps array to avoid re-registering on every render.
34
57
  */
35
58
  declare function usePageFAB(config: FABConfig | null, deps?: unknown[]): void;
36
- declare function FABRoot(): react.JSX.Element;
59
+ declare function FABRoot(): react.JSX.Element | null;
37
60
 
38
- export { type FABConfig, FABProvider, FABRoot, useFAB, usePageFAB };
61
+ export { FAB, type FABConfig, type FABProps, FABProvider, FABRoot, useFAB, usePageFAB };