@ngrok/mantle 0.82.0 → 0.83.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 (175) hide show
  1. package/dist/accordion.d.ts +7 -7
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +3 -1
  4. package/dist/{alert-BWwNPOMI.d.ts → alert-B1HXfkYn.d.ts} +9 -7
  5. package/dist/{alert-QMs0PqMq.js → alert-BuG2qS5l.js} +1 -1
  6. package/dist/alert-center.d.ts +220 -22
  7. package/dist/alert-center.js +1 -1
  8. package/dist/alert-dialog.d.ts +18 -18
  9. package/dist/alert-dialog.js +1 -1
  10. package/dist/alert.d.ts +1 -1
  11. package/dist/alert.js +1 -1
  12. package/dist/{anchor-DvbNsphX.js → anchor-3OGK2UKU.js} +1 -1
  13. package/dist/anchor.d.ts +2 -2
  14. package/dist/anchor.js +1 -1
  15. package/dist/app-layout.d.ts +296 -213
  16. package/dist/app-layout.js +1 -1
  17. package/dist/area-chart.d.ts +67 -19
  18. package/dist/area-chart.js +1 -1
  19. package/dist/avatar.d.ts +319 -0
  20. package/dist/avatar.js +1 -0
  21. package/dist/badge.js +1 -1
  22. package/dist/bar-chart.d.ts +73 -20
  23. package/dist/bar-chart.js +1 -1
  24. package/dist/breadcrumb.d.ts +50 -17
  25. package/dist/breadcrumb.js +1 -1
  26. package/dist/browser-only.d.ts +3 -3
  27. package/dist/{button-C-gMbPso.d.ts → button-BIf69CSV.d.ts} +2 -2
  28. package/dist/button-BLDjW1u9.js +1 -0
  29. package/dist/{button-C0S8RbaJ.js → button-CCkGqE1t.js} +1 -1
  30. package/dist/{button-BUospUB3.js → button-Cnja9Bsr.js} +1 -1
  31. package/dist/{button-C7vAl6lS.d.ts → button-DJ7AAgII.d.ts} +4 -6
  32. package/dist/{button-BO2CKsz6.js → button-DmJkYfyl.js} +1 -1
  33. package/dist/{button-DARFK2KJ.d.ts → button-PoIujPMX.d.ts} +2 -2
  34. package/dist/button.d.ts +3 -3
  35. package/dist/button.js +1 -1
  36. package/dist/calendar.d.ts +1 -1
  37. package/dist/calendar.js +1 -1
  38. package/dist/card.d.ts +15 -15
  39. package/dist/card.js +1 -1
  40. package/dist/centered-layout.js +1 -1
  41. package/dist/{chart-1cVjAcj8.d.ts → chart-0zcFJh4n.d.ts} +75 -22
  42. package/dist/chart-DBxT9BNl.js +2 -0
  43. package/dist/{choice-BNRQXszu.d.ts → choice-CVdQrs-m.d.ts} +118 -6
  44. package/dist/{choice-C9gLKECf.js → choice-CnwfjSEu.js} +1 -1
  45. package/dist/choice.d.ts +1 -1
  46. package/dist/choice.js +1 -1
  47. package/dist/{code-block-C9uaM9-V.js → code-block-CIE0F2fu.js} +1 -1
  48. package/dist/{code-block-B6OlZrSI.d.ts → code-block-CZWPrV4k.d.ts} +3 -3
  49. package/dist/code-block.d.ts +10 -7
  50. package/dist/code-block.js +2 -2
  51. package/dist/code-block_highlight-utils.d.ts +1 -1
  52. package/dist/code-block_highlight-utils.js +1 -1
  53. package/dist/code.js +1 -1
  54. package/dist/combobox.d.ts +8 -9
  55. package/dist/combobox.js +1 -1
  56. package/dist/command.d.ts +668 -106
  57. package/dist/command.js +1 -1
  58. package/dist/cookie-ca4g5CKp.js +1 -0
  59. package/dist/data-table.d.ts +6 -6
  60. package/dist/data-table.js +1 -1
  61. package/dist/description-list.js +1 -1
  62. package/dist/dialog-02mNrAT1.d.ts +806 -0
  63. package/dist/{dialog-Bsj_dX6r.js → dialog-BRjTD83p.js} +1 -1
  64. package/dist/dialog.d.ts +2 -805
  65. package/dist/dialog.js +1 -1
  66. package/dist/{dropdown-menu-fUMqjRC0.js → dropdown-menu-BRH0Wd_z.js} +1 -1
  67. package/dist/dropdown-menu-BcALUQMp.d.ts +1 -0
  68. package/dist/{dropdown-menu-D6pMAY7I.d.ts → dropdown-menu-DZOfj6HB.d.ts} +1 -1
  69. package/dist/dropdown-menu.d.ts +2 -2
  70. package/dist/dropdown-menu.js +1 -1
  71. package/dist/empty.js +1 -1
  72. package/dist/field.d.ts +5 -5
  73. package/dist/field.js +1 -1
  74. package/dist/flag.js +1 -1
  75. package/dist/hooks.d.ts +16 -17
  76. package/dist/hooks.js +1 -1
  77. package/dist/icons-DEVx1oP9.js +1 -0
  78. package/dist/icons.d.ts +7 -6
  79. package/dist/icons.js +1 -1
  80. package/dist/{in-view-DDEGUKDR.d.ts → in-view-gxyc9Q1_.d.ts} +1 -1
  81. package/dist/{input-BuYDU6CF.d.ts → input-DpnC3Xgj.d.ts} +2 -2
  82. package/dist/input.d.ts +1 -1
  83. package/dist/kbd.d.ts +1 -1
  84. package/dist/line-chart.d.ts +60 -13
  85. package/dist/line-chart.js +1 -1
  86. package/dist/list-CwL23L_B.js +1 -0
  87. package/dist/list.d.ts +2 -2
  88. package/dist/list.js +1 -1
  89. package/dist/llms.txt +3 -1
  90. package/dist/main.d.ts +32 -1
  91. package/dist/mantle-dark-high-contrast.css +30 -17
  92. package/dist/mantle-dark.css +48 -13
  93. package/dist/mantle-light-high-contrast.css +33 -15
  94. package/dist/mantle.css +436 -26
  95. package/dist/media-object.d.ts +5 -1
  96. package/dist/media-object.js +1 -1
  97. package/dist/multi-select.d.ts +7 -7
  98. package/dist/multi-select.js +1 -1
  99. package/dist/otp-input.d.ts +4 -4
  100. package/dist/otp-input.js +1 -1
  101. package/dist/pagination.d.ts +2 -2
  102. package/dist/pagination.js +1 -1
  103. package/dist/{primitive-Dv-3snU3.js → primitive-D-9GIFWb.js} +1 -1
  104. package/dist/progress.d.ts +4 -4
  105. package/dist/qr-code.d.ts +2 -2
  106. package/dist/qr-code.js +1 -1
  107. package/dist/radio-group.js +1 -1
  108. package/dist/sandbar.d.ts +471 -0
  109. package/dist/sandbar.js +1 -0
  110. package/dist/sandboxed-on-click.d.ts +4 -6
  111. package/dist/sandboxed-on-click.js +1 -1
  112. package/dist/scatter-plot.d.ts +69 -24
  113. package/dist/scatter-plot.js +1 -1
  114. package/dist/{select-0z7HVS6r.d.ts → select-DVHmgih8.d.ts} +13 -7
  115. package/dist/select-LK9NX-vV.js +1 -0
  116. package/dist/select.d.ts +1 -1
  117. package/dist/select.js +1 -1
  118. package/dist/selectable-list.d.ts +4 -4
  119. package/dist/selectable-list.js +1 -1
  120. package/dist/{separator-B5UmkVRL.d.ts → separator-CNDs98Dv.d.ts} +2 -2
  121. package/dist/{separator-BepAcFFy.js → separator-D0D6VyyM.js} +1 -1
  122. package/dist/separator.d.ts +1 -1
  123. package/dist/separator.js +1 -1
  124. package/dist/{sheet-_fXLjiq2.js → sheet-BOSknSN9.js} +1 -1
  125. package/dist/sheet.d.ts +1 -1
  126. package/dist/sheet.js +1 -1
  127. package/dist/sidebar.d.ts +783 -328
  128. package/dist/sidebar.js +1 -1
  129. package/dist/{skeleton-DsHXIa9j.js → skeleton-BhcJMpem.js} +1 -1
  130. package/dist/skeleton.js +1 -1
  131. package/dist/skip-to-main-link.js +1 -1
  132. package/dist/slider.d.ts +1 -1
  133. package/dist/slot-DdgxmuI5.d.ts +67 -0
  134. package/dist/slot-DpNWVci8.js +1 -0
  135. package/dist/slot.d.ts +1 -1
  136. package/dist/slot.js +1 -1
  137. package/dist/split-button.d.ts +12 -12
  138. package/dist/split-button.js +1 -1
  139. package/dist/switch.d.ts +2 -1
  140. package/dist/{table-CGxJwtbL.js → table-C_Nm_RSV.js} +1 -1
  141. package/dist/{table-CZBYEmyK.d.ts → table-D51ZtV4U.d.ts} +18 -8
  142. package/dist/table.d.ts +1 -1
  143. package/dist/table.js +1 -1
  144. package/dist/tabs.d.ts +8 -13
  145. package/dist/tabs.js +1 -1
  146. package/dist/{theme-FbfjYiD3.d.ts → theme-6OxNhf6l.d.ts} +6 -6
  147. package/dist/theme-CVfq037P.js +1 -0
  148. package/dist/theme-switcher.d.ts +4 -4
  149. package/dist/theme-switcher.js +1 -1
  150. package/dist/theme.d.ts +86 -23
  151. package/dist/theme.js +1 -1
  152. package/dist/toast.d.ts +9 -9
  153. package/dist/toast.js +1 -1
  154. package/dist/tooltip-Dnu35cjU.js +1 -0
  155. package/dist/tooltip-DuXGxIse.d.ts +220 -0
  156. package/dist/tooltip.d.ts +1 -217
  157. package/dist/tooltip.js +1 -1
  158. package/dist/use-breakpoint-Dqu12Szq.js +1 -0
  159. package/dist/use-callback-ref-IYti9y7x.js +1 -0
  160. package/dist/use-is-apple-platform-Cxwrb86L.js +1 -0
  161. package/dist/use-matches-media-query-Bd_GhhVd.js +1 -0
  162. package/dist/utils.d.ts +1 -1
  163. package/dist/well.js +1 -1
  164. package/package.json +4 -2
  165. package/dist/button-DvHMWAPl.js +0 -1
  166. package/dist/chart-DdBQ3xwx.js +0 -2
  167. package/dist/dropdown-menu-BbbQuae2.d.ts +0 -1
  168. package/dist/icons-CPbOq7cF.js +0 -1
  169. package/dist/list-CQFWx6Z8.js +0 -1
  170. package/dist/select-B-9yWrif.js +0 -1
  171. package/dist/slot-BtwKJTLq.d.ts +0 -25
  172. package/dist/slot-Dpsqz16D.js +0 -1
  173. package/dist/theme-IAnQ35bd.js +0 -1
  174. package/dist/use-breakpoint-Wd7_5-Mu.js +0 -1
  175. package/dist/use-matches-media-query-CMSxHR9n.js +0 -1
@@ -104,11 +104,11 @@ type OtpInputSlotProps = ComponentProps<"div"> & {
104
104
  declare const OtpInputSlotImpl: ({ className, index, ref, ...props }: OtpInputSlotProps) => import("react").JSX.Element;
105
105
  type OtpInputSeparatorProps = ComponentProps<"div"> & WithAsChild & {
106
106
  /**
107
- * If `true`, the separator will be rendered with `role="separator"` so
108
- * assistive tech announces it as a divider between OTP groups.
107
+ * If `true`, the separator renders with `role="separator"` so assistive
108
+ * tech announces it as a divider between OTP groups.
109
109
  * If `false`, the separator is purely decorative and is removed from
110
110
  * the accessibility tree — preferred inside an OTP control where the
111
- * minus icon is just visual chrome between slot groups.
111
+ * minus icon is visual chrome between slot groups.
112
112
  *
113
113
  * @default false
114
114
  */
@@ -176,7 +176,7 @@ declare const Separator: ({ asChild, children, className, ref, semantic, ...prop
176
176
  declare const OtpInput: {
177
177
  /**
178
178
  * The root of the OTP input. Wraps the hidden input that captures
179
- * keystrokes, paste, and autofill, and provides per-slot state to
179
+ * keystrokes, paste, and autofill, and exposes per-slot state to
180
180
  * descendant `OtpInput.Slot` parts.
181
181
  *
182
182
  * @see https://mantle.ngrok.com/components/forms/otp-input
package/dist/otp-input.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-Dpsqz16D.js";import{t as n}from"./types-D85fCNV3.js";import{a as r,r as i}from"./field-Bpptk_9t.js";import{t as a}from"./field-B1wqeZr4.js";import{useContext as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{MinusIcon as l}from"@phosphor-icons/react/Minus";import{OTPInput as u,OTPInputContext as d,REGEXP_ONLY_CHARS as f,REGEXP_ONLY_DIGITS as p,REGEXP_ONLY_DIGITS_AND_CHARS as m}from"input-otp";const h={error:`danger`,success:`success`,warning:`warning`},g=e=>`var(--color-${e}-600)`,_=e=>`var(--ring-color-focus-${e})`,v=({totalActive:e,total:t})=>e===0?`idle`:e===1?`caret`:e===t?`all`:`range`,y=({children:e,validation:t})=>{let r=o(d),i=r.slots.length,a=r.slots.reduce((e,t)=>e+ +!!t.isActive,0),c=v({totalActive:a,total:i}),l=t?h[t]:void 0,u=l?n({"--otp-validation-border":g(l),"--otp-validation-ring":_(l)}):void 0;return s(`div`,{className:`group/otp contents`,"data-otp-state":c,"data-validation":t||void 0,style:u,children:e})},b={Root:({"aria-invalid":t,children:n,className:c,containerClassName:l,ref:d,validation:f,...p})=>{let m=r(),h=o(a),{ariaInvalid:g,validation:_}=i({"aria-invalid":t,defaultAriaInvalid:!1,validation:f??m});return s(u,{ref:d,"aria-invalid":g,"data-slot":`otp-input`,containerClassName:e(`flex items-center gap-2 has-disabled:opacity-50`,l),className:e(`disabled:cursor-not-allowed`,c),...p,...h?{"aria-describedby":h[`aria-describedby`],"aria-errormessage":h[`aria-errormessage`],id:h.id,name:h.name}:void 0,children:s(y,{validation:_,children:n})})},Group:({asChild:n,children:r,className:i,ref:a,...o})=>s(n?t:`div`,{ref:a,"data-slot":`otp-input-group`,className:e(`relative flex items-center rounded-md`,`has-[[data-active]~[data-active]]:ring-focus-accent has-[[data-active]~[data-active]]:ring-4`,`group-data-validation/otp:has-[[data-active]~[data-active]]:ring-(--otp-validation-ring)`,i),...o,children:r}),Slot:({className:t,index:n,ref:r,...i})=>{let a=o(d).slots[n],l=a?.char??null,u=a?.hasFakeCaret??!1;return c(`div`,{ref:r,"data-slot":`otp-input-slot`,"data-active":a?.isActive??!1?``:void 0,className:e(`border-form bg-form text-strong relative flex h-10 w-10 items-center justify-center border-y border-r text-sm shadow-sm outline-hidden transition-all duration-150 ease-out`,`first:rounded-l-md first:border-l last:rounded-r-md`,`[&:has(+[data-active])]:group-data-[otp-state=caret]/otp:border-r-transparent`,`data-active:group-data-[otp-state=caret]/otp:border-accent-600`,`data-active:group-data-[otp-state=caret]/otp:border-l`,`data-active:group-data-[otp-state=caret]/otp:ring-focus-accent`,`data-active:group-data-[otp-state=caret]/otp:z-20`,`data-active:group-data-[otp-state=caret]/otp:ring-4`,`group-data-[otp-state=all]/otp:border-accent-600`,`group-data-validation/otp:border-y-(--otp-validation-border)`,`group-data-validation/otp:first:border-l-(--otp-validation-border)`,`group-data-validation/otp:last:border-r-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:border-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:ring-(--otp-validation-ring)`,`group-data-validation/otp:group-data-[otp-state=all]/otp:border-(--otp-validation-border)`,t),...i,children:[l,u&&s(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:s(`div`,{className:`bg-strong h-4 w-px animate-pulse`})})]})},Separator:({asChild:n,children:r,className:i,ref:a,semantic:o=!1,...c})=>{let u=n?t:`div`,d=o?{role:`separator`}:{"aria-hidden":!0,role:`none`};return s(u,{ref:a,"data-slot":`otp-input-separator`,className:e(`text-separator flex items-center`,i),...d,...c,children:r??s(l,{weight:`bold`})})}};export{b as OtpInput,f as REGEXP_ONLY_CHARS,p as REGEXP_ONLY_DIGITS,m as REGEXP_ONLY_DIGITS_AND_CHARS};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DpNWVci8.js";import{t as n}from"./types-D85fCNV3.js";import{a as r,r as i}from"./field-Bpptk_9t.js";import{t as a}from"./field-B1wqeZr4.js";import{useContext as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{MinusIcon as l}from"@phosphor-icons/react/Minus";import{OTPInput as u,OTPInputContext as d,REGEXP_ONLY_CHARS as f,REGEXP_ONLY_DIGITS as p,REGEXP_ONLY_DIGITS_AND_CHARS as m}from"input-otp";const h={error:`danger`,success:`success`,warning:`warning`},g=e=>`var(--color-${e}-600)`,_=e=>`var(--ring-color-focus-${e})`,v=({totalActive:e,total:t})=>e===0?`idle`:e===1?`caret`:e===t?`all`:`range`,y=({children:e,validation:t})=>{let r=o(d),i=r.slots.length,a=r.slots.reduce((e,t)=>e+ +!!t.isActive,0),c=v({totalActive:a,total:i}),l=t?h[t]:void 0,u=l?n({"--otp-validation-border":g(l),"--otp-validation-ring":_(l)}):void 0;return s(`div`,{className:`group/otp contents`,"data-otp-state":c,"data-validation":t||void 0,style:u,children:e})},b={Root:({"aria-invalid":t,children:n,className:c,containerClassName:l,ref:d,validation:f,...p})=>{let m=r(),h=o(a),{ariaInvalid:g,validation:_}=i({"aria-invalid":t,defaultAriaInvalid:!1,validation:f??m});return s(u,{ref:d,"aria-invalid":g,"data-slot":`otp-input`,containerClassName:e(`flex items-center gap-2 has-disabled:opacity-50`,l),className:e(`disabled:cursor-not-allowed`,c),...p,...h?{"aria-describedby":h[`aria-describedby`],"aria-errormessage":h[`aria-errormessage`],id:h.id,name:h.name}:void 0,children:s(y,{validation:_,children:n})})},Group:({asChild:n,children:r,className:i,ref:a,...o})=>s(n?t:`div`,{ref:a,"data-slot":`otp-input-group`,className:e(`relative flex items-center rounded-md`,`has-[[data-active]~[data-active]]:ring-focus-accent has-[[data-active]~[data-active]]:ring-4`,`group-data-validation/otp:has-[[data-active]~[data-active]]:ring-(--otp-validation-ring)`,i),...o,children:r}),Slot:({className:t,index:n,ref:r,...i})=>{let a=o(d).slots[n],l=a?.char??null,u=a?.hasFakeCaret??!1,f=a?.isActive??!1;return c(`div`,{ref:r,"data-slot":`otp-input-slot`,"data-active":f?``:void 0,className:e(`border-form bg-form text-strong relative flex h-10 w-10 items-center justify-center border-y border-r text-sm shadow-sm outline-hidden transition-all duration-150 ease-out`,`first:rounded-l-md first:border-l last:rounded-r-md`,`[&:has(+[data-active])]:group-data-[otp-state=caret]/otp:border-r-transparent`,`data-active:group-data-[otp-state=caret]/otp:border-accent-600`,`data-active:group-data-[otp-state=caret]/otp:border-l`,`data-active:group-data-[otp-state=caret]/otp:ring-focus-accent`,`data-active:group-data-[otp-state=caret]/otp:z-20`,`data-active:group-data-[otp-state=caret]/otp:ring-4`,`group-data-[otp-state=all]/otp:border-accent-600`,`group-data-validation/otp:border-y-(--otp-validation-border)`,`group-data-validation/otp:first:border-l-(--otp-validation-border)`,`group-data-validation/otp:last:border-r-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:border-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:ring-(--otp-validation-ring)`,`group-data-validation/otp:group-data-[otp-state=all]/otp:border-(--otp-validation-border)`,t),...i,children:[l,u&&s(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:s(`div`,{className:`bg-strong h-4 w-px animate-pulse`})})]})},Separator:({asChild:n,children:r,className:i,ref:a,semantic:o=!1,...c})=>{let u=n?t:`div`,d=o?{role:`separator`}:{"aria-hidden":!0,role:`none`};return s(u,{ref:a,"data-slot":`otp-input-separator`,className:e(`text-separator flex items-center`,i),...d,...c,children:r??s(l,{weight:`bold`})})}};export{b as OtpInput,f as REGEXP_ONLY_CHARS,p as REGEXP_ONLY_DIGITS,m as REGEXP_ONLY_DIGITS_AND_CHARS};
@@ -1,5 +1,5 @@
1
- import { t as ButtonGroup } from "./button-C-gMbPso.js";
2
- import { t as Select } from "./select-0z7HVS6r.js";
1
+ import { t as ButtonGroup } from "./button-BIf69CSV.js";
2
+ import { t as Select } from "./select-DVHmgih8.js";
3
3
  import { ComponentProps } from "react";
4
4
  //#region src/components/pagination/cursor-pagination.d.ts
5
5
  type CursorPaginationProps = ComponentProps<"div"> & {
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-C0S8RbaJ.js";import{t as n}from"./button-BO2CKsz6.js";import{n as r}from"./separator-BepAcFFy.js";import{t as i}from"./select-B-9yWrif.js";import{createContext as a,useContext as o,useEffect as s,useMemo as c,useState as l}from"react";import u from"tiny-invariant";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{CaretRightIcon as p}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as m}from"@phosphor-icons/react/CaretLeft";const h=a(void 0),g=({className:t,children:n,defaultPageSize:r,ref:i,...a})=>{let[o,s]=l(r),u=c(()=>({defaultPageSize:r,pageSize:o,setPageSize:s}),[r,o]);return d(h.Provider,{value:u,children:d(`div`,{"data-slot":`cursor-pagination`,className:e(`inline-flex items-center justify-between gap-2`,t),ref:i,...a,children:n})})},_=({hasNextPage:e,hasPreviousPage:i,onNextPage:a,onPreviousPage:o,ref:s,...c})=>f(n,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:s,...c,children:[d(t,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:!i,icon:d(m,{}),intent:`neutral`,label:`Previous page`,onClick:o,size:`sm`,type:`button`}),d(r,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),d(t,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:!e,icon:d(p,{}),intent:`neutral`,label:`Next page`,onClick:a,size:`sm`,type:`button`})]}),v=[5,10,20,50,100],y=({className:t,pageSizes:n=v,onChangePageSize:r,ref:a,...s})=>{let c=o(h);return u(c,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),u(n.includes(c.defaultPageSize),`CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes`),u(n.includes(c.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`),f(i.Root,{defaultValue:`${c.pageSize}`,onValueChange:e=>{let t=Number.parseInt(e,10);Number.isNaN(t)&&(t=c.defaultPageSize),c.setPageSize(t),r?.(t)},children:[d(i.Trigger,{ref:a,"data-slot":`cursor-pagination-page-size-select`,className:e(`w-auto min-w-36`,t),value:c.pageSize,...s,children:d(i.Value,{})}),d(i.Content,{width:`trigger`,children:n.map(e=>f(i.Item,{value:`${e}`,children:[e,` per page`]},e))})]})};function b({className:t,...n}){let r=o(h);return u(r,`CursorPageSizeValue must be used as a child of a CursorPagination component`),f(`span`,{"data-slot":`cursor-pagination-page-size-value`,className:e(`text-muted text-sm font-normal`,t),...n,children:[r.pageSize,` per page`]})}const x={Root:g,Buttons:_,PageSizeSelect:y,PageSizeValue:b};function S({listSize:e,pageSize:t}){let[n,r]=l(1),[i,a]=l(t);s(()=>{a(t),r(1)},[t]),s(()=>{r(1)},[e]);let o=Math.ceil(e/i),c=(n-1)*i,u=n>1,d=n<o;function f(e){r(Math.max(1,Math.min(e,o)))}function p(){d&&r(e=>Math.min(e+1,o))}function m(){u&&r(e=>Math.max(e-1,1))}function h(e){a(e),r(1)}function g(){r(o)}function _(){r(1)}return{currentPage:n,goToFirstPage:_,goToLastPage:g,goToPage:f,hasNextPage:d,hasPreviousPage:u,nextPage:p,offset:c,pageSize:i,previousPage:m,setPageSize:h,totalPages:o}}function C(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{x as CursorPagination,C as getOffsetPaginatedSlice,S as useOffsetPagination};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-CCkGqE1t.js";import{t as n}from"./button-DmJkYfyl.js";import{n as r}from"./separator-D0D6VyyM.js";import{t as i}from"./select-LK9NX-vV.js";import{createContext as a,useContext as o,useEffect as s,useMemo as c,useState as l}from"react";import u from"tiny-invariant";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{CaretRightIcon as p}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as m}from"@phosphor-icons/react/CaretLeft";const h=a(void 0),g=({className:t,children:n,defaultPageSize:r,ref:i,...a})=>{let[o,s]=l(r),u=c(()=>({defaultPageSize:r,pageSize:o,setPageSize:s}),[r,o]);return d(h.Provider,{value:u,children:d(`div`,{"data-slot":`cursor-pagination`,className:e(`inline-flex items-center justify-between gap-2`,t),ref:i,...a,children:n})})},_=({hasNextPage:e,hasPreviousPage:i,onNextPage:a,onPreviousPage:o,ref:s,...c})=>f(n,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:s,...c,children:[d(t,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:!i,icon:d(m,{}),intent:`neutral`,label:`Previous page`,onClick:o,size:`sm`,type:`button`}),d(r,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),d(t,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:!e,icon:d(p,{}),intent:`neutral`,label:`Next page`,onClick:a,size:`sm`,type:`button`})]}),v=[5,10,20,50,100],y=({className:t,pageSizes:n=v,onChangePageSize:r,ref:a,...s})=>{let c=o(h);return u(c,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),u(n.includes(c.defaultPageSize),`CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes`),u(n.includes(c.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`),f(i.Root,{defaultValue:`${c.pageSize}`,onValueChange:e=>{let t=Number.parseInt(e,10);Number.isNaN(t)&&(t=c.defaultPageSize),c.setPageSize(t),r?.(t)},children:[d(i.Trigger,{ref:a,"data-slot":`cursor-pagination-page-size-select`,className:e(`w-auto min-w-36`,t),value:c.pageSize,...s,children:d(i.Value,{})}),d(i.Content,{width:`trigger`,children:n.map(e=>f(i.Item,{value:`${e}`,children:[e,` per page`]},e))})]})};function b({className:t,...n}){let r=o(h);return u(r,`CursorPageSizeValue must be used as a child of a CursorPagination component`),f(`span`,{"data-slot":`cursor-pagination-page-size-value`,className:e(`text-muted text-sm font-normal`,t),...n,children:[r.pageSize,` per page`]})}const x={Root:g,Buttons:_,PageSizeSelect:y,PageSizeValue:b};function S({listSize:e,pageSize:t}){let[n,r]=l(1),[i,a]=l(t);s(()=>{a(t),r(1)},[t]),s(()=>{r(1)},[e]);let o=Math.ceil(e/i),c=(n-1)*i,u=n>1,d=n<o;function f(e){r(Math.max(1,Math.min(e,o)))}function p(){d&&r(e=>Math.min(e+1,o))}function m(){u&&r(e=>Math.max(e-1,1))}function h(e){a(e),r(1)}function g(){r(o)}function _(){r(1)}return{currentPage:n,goToFirstPage:_,goToLastPage:g,goToPage:f,hasNextPage:d,hasPreviousPage:u,nextPage:p,offset:c,pageSize:i,previousPage:m,setPageSize:h,totalPages:o}}function C(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{x as CursorPagination,C as getOffsetPaginatedSlice,S as useOffsetPagination};
@@ -1 +1 @@
1
- import{t as e}from"./slot-Dpsqz16D.js";import{t}from"./booleanish-BfvnW6vy.js";import{createContext as n,useContext as r,useEffect as i,useMemo as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";import*as c from"@radix-ui/react-dialog";function l(e){e.target instanceof Element&&e.target.closest(`.overlay-prompt`)&&e.preventDefault()}const u=n({hasDescription:!1,setHasDescription:()=>{}});function d(e){let[t,n]=o(!1),r=a(()=>({hasDescription:t,setHasDescription:n}),[t]);return s(u.Provider,{value:r,children:s(c.Root,{...e})})}const f=c.Trigger,p=c.Portal,m=c.Close,h=e=>s(c.Overlay,{"data-overlay":!0,...e}),g=({onEscapeKeyDown:e,onInteractOutside:t,onPointerDownOutside:n,ref:i,...a})=>{let o=r(u);return s(c.Content,{ref:i,onEscapeKeyDown:t=>{b(t),e?.(t)},onInteractOutside:e=>{l(e),t?.(e)},onPointerDownOutside:e=>{l(e),n?.(e)},...o.hasDescription?{}:{"aria-describedby":void 0},...a})},_=c.Title,v=({asChild:t,children:n,ref:a,...o})=>{let l=r(u);i(()=>(l.setHasDescription(!0),()=>l.setHasDescription(!1)),[l]);let d=t?e:`div`;return s(c.Description,{ref:a,asChild:!0,children:s(d,{...o,children:n})})};function y(e){return e instanceof HTMLElement&&e.hasAttribute(`data-overlay`)}function b(e){if(!w(e.currentTarget))return;let n=e.currentTarget,r=n instanceof Document?n.activeElement:n.ownerDocument?.activeElement??null,i=x(e.target)??x(r),a=i?S(i):null;i!=null&&t(i.getAttribute(`aria-expanded`))&&a!=null&&n.contains(i)&&n.contains(a)&&(a.getAttribute(`data-open`)===`true`||a.getAttribute(`data-state`)===`open`)&&e.preventDefault()}function x(e){return C(e)?e.closest(`[aria-expanded='true'][aria-controls]`):null}function S(e){let t=e.getAttribute(`aria-controls`);if(!t)return null;let n=e.ownerDocument.getElementById(t);return n instanceof HTMLElement?n:null}function C(e){return e instanceof HTMLElement}function w(e){return e instanceof Node&&`querySelector`in e}export{p as a,f as c,h as i,y as l,g as n,d as o,v as r,_ as s,m as t};
1
+ import{t as e}from"./slot-DpNWVci8.js";import{t}from"./booleanish-BfvnW6vy.js";import{createContext as n,useContext as r,useEffect as i,useMemo as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";import*as c from"@radix-ui/react-dialog";function l(e){e.target instanceof Element&&e.target.closest(`.overlay-prompt`)&&e.preventDefault()}const u=n({hasDescription:!1,setHasDescription:()=>{}});function d(e){let[t,n]=o(!1),r=a(()=>({hasDescription:t,setHasDescription:n}),[t]);return s(u.Provider,{value:r,children:s(c.Root,{...e})})}const f=c.Trigger,p=c.Portal,m=c.Close,h=e=>s(c.Overlay,{"data-overlay":!0,...e}),g=({onEscapeKeyDown:e,onInteractOutside:t,onPointerDownOutside:n,ref:i,...a})=>{let o=r(u);return s(c.Content,{ref:i,onEscapeKeyDown:t=>{b(t),e?.(t)},onInteractOutside:e=>{l(e),t?.(e)},onPointerDownOutside:e=>{l(e),n?.(e)},...o.hasDescription?{}:{"aria-describedby":void 0},...a})},_=c.Title,v=({asChild:t,children:n,ref:a,...o})=>{let l=r(u);i(()=>(l.setHasDescription(!0),()=>l.setHasDescription(!1)),[l]);let d=t?e:`div`;return s(c.Description,{ref:a,asChild:!0,children:s(d,{...o,children:n})})};function y(e){return e instanceof HTMLElement&&e.hasAttribute(`data-overlay`)}function b(e){if(!w(e.currentTarget))return;let n=e.currentTarget,r=n instanceof Document?n.activeElement:n.ownerDocument?.activeElement??null,i=x(e.target)??x(r),a=i?S(i):null;i!=null&&t(i.getAttribute(`aria-expanded`))&&a!=null&&n.contains(i)&&n.contains(a)&&(a.getAttribute(`data-open`)===`true`||a.getAttribute(`data-state`)===`open`)&&e.preventDefault()}function x(e){return C(e)?e.closest(`[aria-expanded='true'][aria-controls]`):null}function S(e){let t=e.getAttribute(`aria-controls`);if(!t)return null;let n=e.ownerDocument.getElementById(t);return n instanceof HTMLElement?n:null}function C(e){return e instanceof HTMLElement}function w(e){return e instanceof Node&&`querySelector`in e}export{p as a,f as c,h as i,y as l,g as n,d as o,v as r,_ as s,m as t};
@@ -26,8 +26,8 @@ type Props = SvgAttributes & {
26
26
  strokeWidth?: StrokeWidth;
27
27
  /**
28
28
  * The current value of the progress bar.
29
- * This attribute specifies how much of the task that has been completed.
30
- * It must be a valid floating point number between 0 and max, or between 0 and 100 if max is omitted.
29
+ * This attribute specifies how much of the task is complete.
30
+ * It must be a valid floating point number between 0 and `max`, or, when `max` is omitted, between 0 and 100.
31
31
  * If set to `"indeterminate"`, the progress bar is considered indeterminate.
32
32
  *
33
33
  * @default 0
@@ -159,8 +159,8 @@ type RootProps = ComponentProps<"div"> & {
159
159
  max?: number | undefined;
160
160
  /**
161
161
  * The current value of the progress bar.
162
- * This attribute specifies how much of the task that has been completed.
163
- * It must be a valid floating point number between 0 and max, or between 0 and 100 if max is omitted.
162
+ * This attribute specifies how much of the task is complete.
163
+ * It must be a valid floating point number between 0 and `max`, or, when `max` is omitted, between 0 and 100.
164
164
  * If set to `"indeterminate"`, the progress bar is considered indeterminate. (for now there is no visual difference than 0)
165
165
  *
166
166
  * @default 0
package/dist/qr-code.d.ts CHANGED
@@ -143,8 +143,8 @@ declare const Overlay: ({ asChild, className, ref, ...props }: QrCodeOverlayProp
143
143
  /**
144
144
  * A QR code. Compose `QrCode.Root` with a `QrCode.Frame` wrapping a
145
145
  * `QrCode.Pattern`, and optionally a `QrCode.Overlay` for a centered logo.
146
- * Encoding is handled by the dependency-free `uqr` library; the render logic is
147
- * owned by mantle (no headless runtime).
146
+ * The dependency-free `uqr` library encodes `value`; mantle owns the render
147
+ * logic (no headless runtime).
148
148
  *
149
149
  * `Root` and `Overlay` support the `asChild` prop for polymorphic composition.
150
150
  * `Frame` and `Pattern` render fixed SVG elements and do not.
package/dist/qr-code.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-Dpsqz16D.js";import{createContext as n,useContext as r,useMemo as i}from"react";import a from"tiny-invariant";import{jsx as o}from"react/jsx-runtime";import{encode as s}from"uqr";const c=n(null);function l(e,t){a(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),a(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function u(){let e=r(c);return a(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function d(e,t){let n=[];return e.forEach((e,r)=>{e.forEach((e,i)=>{if(e){let e=i*t,a=r*t;n.push(`M${e},${a}h${t}v${t}h-${t}z`)}})}),n.join(``)}const f={Root:({value:n,ecc:r=`L`,pixelSize:a=10,quietZone:u=4,asChild:f,className:p,children:m,ref:h,...g})=>{l(a,u);let _=i(()=>s(n,{ecc:r,border:u}),[n,r,u]),v=i(()=>d(_.data,a),[_,a]),y=i(()=>({path:v,dimension:_.size*a}),[v,_.size,a]),b=f?t:`div`;return o(c.Provider,{value:y,children:o(b,{ref:h,...g,"data-slot":`qr-code`,className:e(`relative inline-flex bg-static-white text-static-black`,p),children:m})})},Frame:({className:t,children:n,ref:r,...i})=>{let{dimension:a}=u();return o(`svg`,{ref:r,...i,"data-slot":`qr-code-frame`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${a} ${a}`,shapeRendering:`crispEdges`,className:e(`block size-48`,t),children:n})},Pattern:({className:t,ref:n,...r})=>{let{path:i}=u();return o(`path`,{ref:n,...r,"data-slot":`qr-code-pattern`,d:i,className:e(`fill-static-black`,t)})},Overlay:({asChild:n,className:r,ref:i,...a})=>o(n?t:`div`,{ref:i,...a,"data-slot":`qr-code-overlay`,className:e(`absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md bg-static-white text-static-black p-1.5`,r)})};export{f as QrCode};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DpNWVci8.js";import{createContext as n,useContext as r,useMemo as i}from"react";import a from"tiny-invariant";import{jsx as o}from"react/jsx-runtime";import{encode as s}from"uqr";const c=n(null);function l(e,t){a(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),a(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function u(){let e=r(c);return a(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function d(e,t){let n=[];return e.forEach((e,r)=>{e.forEach((e,i)=>{if(e){let e=i*t,a=r*t;n.push(`M${e},${a}h${t}v${t}h-${t}z`)}})}),n.join(``)}const f={Root:({value:n,ecc:r=`L`,pixelSize:a=10,quietZone:u=4,asChild:f,className:p,children:m,ref:h,...g})=>{l(a,u);let _=i(()=>s(n,{ecc:r,border:u}),[n,r,u]),v=i(()=>d(_.data,a),[_,a]),y=i(()=>({path:v,dimension:_.size*a}),[v,_.size,a]),b=f?t:`div`;return o(c.Provider,{value:y,children:o(b,{ref:h,...g,"data-slot":`qr-code`,className:e(`relative inline-flex bg-static-white text-static-black`,p),children:m})})},Frame:({className:t,children:n,ref:r,...i})=>{let{dimension:a}=u();return o(`svg`,{ref:r,...i,"data-slot":`qr-code-frame`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${a} ${a}`,shapeRendering:`crispEdges`,className:e(`block size-48`,t),children:n})},Pattern:({className:t,ref:n,...r})=>{let{path:i}=u();return o(`path`,{ref:n,...r,"data-slot":`qr-code-pattern`,d:i,className:e(`fill-static-black`,t)})},Overlay:({asChild:n,className:r,ref:i,...a})=>o(n?t:`div`,{ref:i,...a,"data-slot":`qr-code-overlay`,className:e(`absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md bg-static-white text-static-black p-1.5`,r)})};export{f as QrCode};
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-Dpsqz16D.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{t as r}from"./field-B1wqeZr4.js";import{t as i}from"./input-CXmS0OFN.js";import{Children as a,cloneElement as o,createContext as s,isValidElement as c,useContext as l,useRef as u}from"react";import{jsx as d}from"react/jsx-runtime";import{Radio as f,RadioGroup as p}from"@headlessui/react";const m=({ref:e,...t})=>d(p,{"data-slot":`radio-group`,...t,ref:e}),h=s({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1}),g=({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{"data-slot":`radio-group-item`,className:e(`group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden`,n),as:`div`,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:i,children:e=>d(h.Provider,{value:e,children:t})})},_=({checked:t,disabled:n,focus:r,hover:i})=>d(`span`,{className:e(`border-form flex size-4 items-center justify-center rounded-full border shrink-0`,n&&`cursor-default opacity-50`,t&&`border-accent-600 bg-accent-600`,r&&!n&&`border-accent-600 ring-focus-accent ring-4`,i&&`border-accent-600`),children:t&&d(`span`,{className:`size-2 rounded-full bg-white shrink-0`})}),v={Button:({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-button`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm`,`h-9`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md`,`not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50`,`aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,n),ref:i,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>d(h.Provider,{value:e,children:t})})},ButtonGroup:({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-button-group`,className:n(`flex flex-row flex-nowrap -space-x-px`,e),...r,ref:t}),Card:({children:e,className:t,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-card`,className:n(`group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600`,t),...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:i,children:t=>d(h.Provider,{value:t,children:e})})},Indicator:({children:t,className:n,...r})=>{let i=l(h);return d(`div`,{"data-slot":`radio-group-indicator`,className:e(`radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0`,n),...r,children:t==null?d(_,{...i}):typeof t==`function`?t(i):t})},InputSandbox:({children:e,onClick:t,onKeyDown:n,...r})=>{let s=u(null),f=l(h),p=a.only(e),m=f.disabled||!f.checked;return d(`div`,{role:`none`,"data-slot":`radio-group-input-sandbox`,ref:s,onKeyDown:e=>{if(f.disabled){e.stopPropagation(),e.preventDefault();return}switch(e.key){case`Enter`:case`Tab`:break;default:e.stopPropagation()}n?.(e)},onClick:e=>{if(f.disabled){e.stopPropagation(),e.preventDefault();return}let n=e.target;i(n)&&window.requestAnimationFrame(()=>{n.focus()}),t?.(e)},...r,children:c(p)?o(p,{disabled:f.disabled||p.props.disabled,tabIndex:m?-1:p.props.tabIndex}):null})},Item:g,ItemContent:({asChild:e=!1,children:r,className:i,...a})=>{let o=l(h);return d(e?t:`div`,{"data-slot":`radio-group-item-content`,className:n(`min-w-0 flex-1`,o.disabled&&`opacity-50`,i),...a,children:r})},List:({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-list`,className:n(`-space-y-px`,e),...r,ref:t}),ListItem:({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-list-item`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,n),ref:i,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>d(h.Provider,{value:e,children:t})})},Root:m};export{v as RadioGroup};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DpNWVci8.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{t as r}from"./field-B1wqeZr4.js";import{t as i}from"./input-CXmS0OFN.js";import{Children as a,cloneElement as o,createContext as s,isValidElement as c,useContext as l,useRef as u}from"react";import{jsx as d}from"react/jsx-runtime";import{Radio as f,RadioGroup as p}from"@headlessui/react";const m=({ref:e,...t})=>d(p,{"data-slot":`radio-group`,...t,ref:e}),h=s({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1}),g=({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{"data-slot":`radio-group-item`,className:e(`group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden`,n),as:`div`,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:i,children:e=>d(h.Provider,{value:e,children:t})})},_=({checked:t,disabled:n,focus:r,hover:i})=>d(`span`,{className:e(`border-form flex size-4 items-center justify-center rounded-full border shrink-0`,n&&`cursor-default opacity-50`,t&&`border-accent-600 bg-accent-600`,r&&!n&&`border-accent-600 ring-focus-accent ring-4`,i&&`border-accent-600`),children:t&&d(`span`,{className:`size-2 rounded-full bg-white shrink-0`})}),v={Button:({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-button`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm`,`h-9`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md`,`not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50`,`aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,n),ref:i,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>d(h.Provider,{value:e,children:t})})},ButtonGroup:({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-button-group`,className:n(`flex flex-row flex-nowrap -space-x-px`,e),...r,ref:t}),Card:({children:e,className:t,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-card`,className:n(`group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600`,t),...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:i,children:t=>d(h.Provider,{value:t,children:e})})},Indicator:({children:t,className:n,...r})=>{let i=l(h);return d(`div`,{"data-slot":`radio-group-indicator`,className:e(`radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0`,n),...r,children:t==null?d(_,{...i}):typeof t==`function`?t(i):t})},InputSandbox:({children:e,onClick:t,onKeyDown:n,...r})=>{let s=u(null),f=l(h),p=a.only(e),m=f.disabled||!f.checked;return d(`div`,{role:`none`,"data-slot":`radio-group-input-sandbox`,ref:s,onKeyDown:e=>{if(f.disabled){e.stopPropagation(),e.preventDefault();return}switch(e.key){case`Enter`:case`Tab`:break;default:e.stopPropagation()}n?.(e)},onClick:e=>{if(f.disabled){e.stopPropagation(),e.preventDefault();return}let n=e.target;i(n)&&window.requestAnimationFrame(()=>{n.focus()}),t?.(e)},...r,children:c(p)?o(p,{disabled:f.disabled||p.props.disabled,tabIndex:m?-1:p.props.tabIndex}):null})},Item:g,ItemContent:({asChild:e=!1,children:r,className:i,...a})=>{let o=l(h);return d(e?t:`div`,{"data-slot":`radio-group-item-content`,className:n(`min-w-0 flex-1`,o.disabled&&`opacity-50`,i),...a,children:r})},List:({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-list`,className:n(`-space-y-px`,e),...r,ref:t}),ListItem:({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-list-item`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,n),ref:i,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>d(h.Provider,{value:e,children:t})})},Root:m};export{v as RadioGroup};
@@ -0,0 +1,471 @@
1
+ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
3
+ import { r as ButtonProps } from "./button-PoIujPMX.js";
4
+ import { ComponentProps, ReactNode, Ref } from "react";
5
+ //#region src/components/sandbar/sandbar.d.ts
6
+ /**
7
+ * The imperative surface of a {@link Sandbar}, exposed via `Sandbar.Root`'s
8
+ * `handleRef` prop. `shake()` is a compound feedback action — it wiggles the
9
+ * panel (skipped under `prefers-reduced-motion`) and always pushes an
10
+ * assertive live-region announcement, so blocked navigation is perceivable
11
+ * with or without motion.
12
+ *
13
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarhandle
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * const sandbarHandle = useRef<SandbarHandle>(null);
18
+ *
19
+ * // hand this to your router's guard — it owns the blocking, the bar reacts
20
+ * const onNavigationBlocked = () => sandbarHandle.current?.shake();
21
+ *
22
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
23
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
24
+ * <Sandbar.Actions>
25
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
26
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
27
+ * </Sandbar.Actions>
28
+ * </Sandbar.Root>
29
+ * ```
30
+ */
31
+ type SandbarHandle = {
32
+ /**
33
+ * Signal that an action (usually navigation) was blocked because changes
34
+ * are still pending: wiggles the panel and announces assertively.
35
+ *
36
+ * The default announcement is save-flavored; pass `announcement` for other
37
+ * intents (e.g. "Publish or discard your pending items before leaving.").
38
+ */
39
+ shake: (options?: {
40
+ announcement?: string;
41
+ }) => void;
42
+ };
43
+ /**
44
+ * Props for `Sandbar.Root`. Extends `<div>` props — which target the visible
45
+ * panel, not the fixed-position wrapper — with the controlled `open` flag and
46
+ * the imperative `handleRef`. Deliberately no `asChild`: Root renders four
47
+ * nodes, so single-child polymorphism has no coherent meaning.
48
+ *
49
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarroot
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
54
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
55
+ * <Sandbar.Actions>
56
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
57
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
58
+ * </Sandbar.Actions>
59
+ * </Sandbar.Root>
60
+ * ```
61
+ */
62
+ type SandbarRootProps = ComponentProps<"div"> & WithDataSlot & {
63
+ /**
64
+ * Whether the sandbar is showing. Controlled-only — the pending state
65
+ * (e.g. a form's dirty flag) lives in your app, not in the component.
66
+ *
67
+ * `Sandbar.Root` must stay mounted and be toggled with `open`, never
68
+ * conditionally mounted (`{isDirty && <Sandbar.Root …>}`). The
69
+ * screen-reader announcement only works when the internal live regions
70
+ * exist in the tree before the message appears. The exit animation needs
71
+ * the panel alive to play. A Root that mounts with `open` already true
72
+ * does not announce (mounting is not a live-region change).
73
+ */
74
+ open: boolean;
75
+ /**
76
+ * Receives the imperative {@link SandbarHandle}. Kept separate from `ref`
77
+ * (which stays the panel's DOM element, like every other mantle part) —
78
+ * wire it to your navigation guard's blocked callback.
79
+ */
80
+ handleRef?: Ref<SandbarHandle>;
81
+ };
82
+ /**
83
+ * The always-mounted shell of the sandbar. Renders a private viewport-fixed
84
+ * wrapper, two persistent visually-hidden live regions (a polite `status`
85
+ * announcer and an assertive `alert` announcer), and the visible panel — a
86
+ * floating island with `role="group"`, named by `Sandbar.Message` via
87
+ * `aria-labelledby` (a consumer `aria-label` wins when passed).
88
+ *
89
+ * The panel is an `invert-theme` island: it renders in the opposite theme of
90
+ * the page (light ⇄ dark, light-high-contrast ⇄ dark-high-contrast), and so
91
+ * does everything composed inside it — the blessed buttons and any custom
92
+ * children.
93
+ *
94
+ * `ref`, `className`, and all other props target the panel. Render it in
95
+ * place at the end of the form it saves — `position: fixed` changes paint
96
+ * position, not tab order, so Tab from the last field lands on the actions.
97
+ * Escape is intentionally inert (a one-keypress discard would destroy data).
98
+ *
99
+ * Data attributes stamped on the panel:
100
+ *
101
+ * | Data Attribute | Value | Description |
102
+ * | -------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
103
+ * | `data-slot` | `"sandbar"` | Stable styling hook for the panel. Survives `className` overrides. |
104
+ * | `data-state` | `"open"` \| `"closed"` | `"open"` only at the resting open pose — `"closed"` covers the pre-enter frame and the exit transition, which is what drives them. |
105
+ *
106
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarroot
107
+ *
108
+ * @example
109
+ * ```tsx
110
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
111
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
112
+ * <Sandbar.Actions>
113
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
114
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
115
+ * </Sandbar.Actions>
116
+ * </Sandbar.Root>
117
+ * ```
118
+ */
119
+ declare const Root: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, children, className, "data-slot": dataSlot, handleRef, onTransitionEnd, open, ref, ...props }: SandbarRootProps) => import("react").JSX.Element;
120
+ /**
121
+ * Props for `Sandbar.Message`. Extends `<p>` props with `asChild`. An `id` is
122
+ * generated when none is passed — it is what `Sandbar.Root` points
123
+ * `aria-labelledby` at, so passing your own keeps that wiring intact.
124
+ *
125
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarmessage
126
+ *
127
+ * @example
128
+ * ```tsx
129
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
130
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
131
+ * <Sandbar.Actions>
132
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
133
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
134
+ * </Sandbar.Actions>
135
+ * </Sandbar.Root>
136
+ * ```
137
+ */
138
+ type SandbarMessageProps = ComponentProps<"p"> & WithAsChild & WithDataSlot;
139
+ /**
140
+ * The visible pending-state text (e.g. "You have unsaved changes"). A plain
141
+ * paragraph: `Sandbar.Root`'s persistent announcer owns the live-region
142
+ * announcement, not this node. The panel's accessible name points here via
143
+ * `aria-labelledby`, so the group name always matches the visible text.
144
+ *
145
+ * Data attributes:
146
+ *
147
+ * | Data Attribute | Value | Description |
148
+ * | -------------- | -------------------- | ----------------------------------------------------------------- |
149
+ * | `data-slot` | `"sandbar-message"` | Stable styling hook. Survives `className` overrides and `asChild`. |
150
+ *
151
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarmessage
152
+ *
153
+ * @example
154
+ * ```tsx
155
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
156
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
157
+ * <Sandbar.Actions>
158
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
159
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
160
+ * </Sandbar.Actions>
161
+ * </Sandbar.Root>
162
+ * ```
163
+ */
164
+ declare const Message: ({ asChild, className, "data-slot": dataSlot, id: propId, ref, ...props }: SandbarMessageProps) => import("react").JSX.Element;
165
+ /**
166
+ * Props for `Sandbar.Actions`. Extends `<div>` props with `asChild`.
167
+ *
168
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbaractions
169
+ *
170
+ * @example
171
+ * ```tsx
172
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
173
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
174
+ * <Sandbar.Actions>
175
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
176
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
177
+ * </Sandbar.Actions>
178
+ * </Sandbar.Root>
179
+ * ```
180
+ */
181
+ type SandbarActionsProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
182
+ /**
183
+ * The action-button row. A plain flex container — deliberately not
184
+ * `role="toolbar"`, which the ARIA APG reserves for 3+ controls with roving
185
+ * tab stops.
186
+ *
187
+ * Data attributes:
188
+ *
189
+ * | Data Attribute | Value | Description |
190
+ * | -------------- | -------------------- | ----------------------------------------------------------------- |
191
+ * | `data-slot` | `"sandbar-actions"` | Stable styling hook. Survives `className` overrides and `asChild`. |
192
+ *
193
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbaractions
194
+ *
195
+ * @example
196
+ * ```tsx
197
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
198
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
199
+ * <Sandbar.Actions>
200
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
201
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
202
+ * </Sandbar.Actions>
203
+ * </Sandbar.Root>
204
+ * ```
205
+ */
206
+ declare const Actions: ({ asChild, className, "data-slot": dataSlot, ...props }: SandbarActionsProps) => import("react").JSX.Element;
207
+ /**
208
+ * Props for `Sandbar.SaveButton`. Extends `Button`'s props — including
209
+ * `asChild` and `isLoading` — but makes `appearance` and `intent` optional
210
+ * with save-flavored defaults, and `children` required.
211
+ *
212
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarsavebutton
213
+ *
214
+ * @example
215
+ * ```tsx
216
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
217
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
218
+ * <Sandbar.Actions>
219
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
220
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
221
+ * </Sandbar.Actions>
222
+ * </Sandbar.Root>
223
+ * ```
224
+ */
225
+ type SandbarSaveButtonProps = Omit<ButtonProps, "appearance" | "children" | "intent"> & WithDataSlot & {
226
+ /**
227
+ * The visual style of the button.
228
+ * @default "filled"
229
+ */
230
+ appearance?: ButtonProps["appearance"];
231
+ /**
232
+ * The tone of the button.
233
+ * @default "neutral"
234
+ */
235
+ intent?: ButtonProps["intent"];
236
+ /**
237
+ * The visible action label (e.g. "Save"). Required — action labels are app
238
+ * voice and must be visible at the call site.
239
+ */
240
+ children: ReactNode;
241
+ };
242
+ /**
243
+ * The primary (save) action. A mantle `Button` defaulting to the system
244
+ * primary style (`appearance="filled" intent="neutral"`), wired into
245
+ * `Sandbar.Root`: while `isLoading`, Root announces "Saving changes…" via the
246
+ * polite live region and catches the focus drop caused by the button going
247
+ * natively disabled while focused.
248
+ *
249
+ * Defaults to `type="button"`; pass `type="submit"` when rendered inside the
250
+ * form it saves. Announce the save's resolution yourself (e.g. a success
251
+ * Toast) — the bar exits silently.
252
+ *
253
+ * Data attributes:
254
+ *
255
+ * | Data Attribute | Value | Description |
256
+ * | ----------------- | ------------------------- | -------------------------------------------------------------------------------------------------- |
257
+ * | `data-slot` | `"sandbar-save-button"` | Stable styling hook. Replaces `Button`'s own `data-slot="button"`, as every Button wrapper does. |
258
+ * | `data-appearance` | the resolved `appearance` | Stamped by `Button`. |
259
+ * | `data-intent` | the resolved `intent` | Stamped by `Button`. |
260
+ * | `data-size` | the resolved `size` | Stamped by `Button`; absent for `appearance="link"`. |
261
+ * | `data-disabled` | `"true"` \| `"false"` | Stamped by `Button`. Value-based, not presence-based — match on the value. |
262
+ * | `data-loading` | `"true"` \| `"false"` | Stamped by `Button`, tracking `isLoading`. Value-based, not presence-based. |
263
+ *
264
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarsavebutton
265
+ *
266
+ * @example
267
+ * ```tsx
268
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
269
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
270
+ * <Sandbar.Actions>
271
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
272
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
273
+ * </Sandbar.Actions>
274
+ * </Sandbar.Root>
275
+ * ```
276
+ */
277
+ declare const SaveButton: ({ appearance, children, "data-slot": dataSlot, intent, isLoading, ref, ...props }: SandbarSaveButtonProps) => import("react").JSX.Element;
278
+ /**
279
+ * Props for `Sandbar.DiscardButton`. Extends `Button`'s props — including
280
+ * `asChild` — but makes `appearance` and `intent` optional with
281
+ * secondary-action defaults, and `children` required.
282
+ *
283
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbardiscardbutton
284
+ *
285
+ * @example
286
+ * ```tsx
287
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
288
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
289
+ * <Sandbar.Actions>
290
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
291
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
292
+ * </Sandbar.Actions>
293
+ * </Sandbar.Root>
294
+ * ```
295
+ */
296
+ type SandbarDiscardButtonProps = Omit<ButtonProps, "appearance" | "children" | "intent"> & WithDataSlot & {
297
+ /**
298
+ * The visual style of the button.
299
+ * @default "outlined"
300
+ */
301
+ appearance?: ButtonProps["appearance"];
302
+ /**
303
+ * The tone of the button.
304
+ * @default "neutral"
305
+ */
306
+ intent?: ButtonProps["intent"];
307
+ /**
308
+ * The visible action label (e.g. "Discard"). Required — action labels are
309
+ * app voice and must be visible at the call site.
310
+ */
311
+ children: ReactNode;
312
+ };
313
+ /**
314
+ * The secondary (discard/reset) action. A mantle `Button` defaulting to
315
+ * `appearance="outlined" intent="neutral"`. Discard is destructive-ish: for
316
+ * large forms, consider confirming before discarding.
317
+ *
318
+ * Data attributes:
319
+ *
320
+ * | Data Attribute | Value | Description |
321
+ * | ----------------- | -------------------------- | -------------------------------------------------------------------------------------------------- |
322
+ * | `data-slot` | `"sandbar-discard-button"` | Stable styling hook. Replaces `Button`'s own `data-slot="button"`, as every Button wrapper does. |
323
+ * | `data-appearance` | the resolved `appearance` | Stamped by `Button`. |
324
+ * | `data-intent` | the resolved `intent` | Stamped by `Button`. |
325
+ * | `data-size` | the resolved `size` | Stamped by `Button`; absent for `appearance="link"`. |
326
+ * | `data-disabled` | `"true"` \| `"false"` | Stamped by `Button`. Value-based, not presence-based — match on the value. |
327
+ * | `data-loading` | `"true"` \| `"false"` | Stamped by `Button`, tracking `isLoading`. Value-based, not presence-based. |
328
+ *
329
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbardiscardbutton
330
+ *
331
+ * @example
332
+ * ```tsx
333
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
334
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
335
+ * <Sandbar.Actions>
336
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
337
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
338
+ * </Sandbar.Actions>
339
+ * </Sandbar.Root>
340
+ * ```
341
+ */
342
+ declare const DiscardButton: ({ appearance, children, "data-slot": dataSlot, intent, ...props }: SandbarDiscardButtonProps) => import("react").JSX.Element;
343
+ /**
344
+ * A persistent, decision-bearing bar that floats near the bottom edge of the
345
+ * viewport. It surfaces pending state — primarily a form's unsaved ("dirty")
346
+ * changes — and stays until the user resolves it. Toast announces something
347
+ * that already happened and leaves on its own; a Sandbar waits for the user's
348
+ * decision. When the message needs no decision, reach for Toast or Alert.
349
+ *
350
+ * The name: a sandbar is a bar that blocks navigation — exactly what this
351
+ * component does while changes are pending. Pair it with your app's
352
+ * navigation guard and call `shake()` on the {@link SandbarHandle} when a
353
+ * navigation attempt is blocked.
354
+ *
355
+ * @see https://mantle.ngrok.com/components/feedback/sandbar
356
+ *
357
+ * @example
358
+ * Composition:
359
+ * ```
360
+ * Sandbar.Root
361
+ * ├── Sandbar.Message
362
+ * └── Sandbar.Actions
363
+ * ├── Sandbar.DiscardButton
364
+ * └── Sandbar.SaveButton
365
+ * ```
366
+ *
367
+ * @example
368
+ * ```tsx
369
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
370
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
371
+ * <Sandbar.Actions>
372
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
373
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
374
+ * </Sandbar.Actions>
375
+ * </Sandbar.Root>
376
+ * ```
377
+ */
378
+ declare const Sandbar: {
379
+ /**
380
+ * The always-mounted shell: fixed positioning, persistent live-region
381
+ * announcers, presence-managed panel. Toggle with the controlled `open`
382
+ * prop — never conditionally mount it.
383
+ *
384
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarroot
385
+ *
386
+ * @example
387
+ * ```tsx
388
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
389
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
390
+ * <Sandbar.Actions>
391
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
392
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
393
+ * </Sandbar.Actions>
394
+ * </Sandbar.Root>
395
+ * ```
396
+ */
397
+ readonly Root: typeof Root;
398
+ /**
399
+ * The visible pending-state text. Also names the panel (via
400
+ * `aria-labelledby`) and feeds the polite screen-reader announcement.
401
+ *
402
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarmessage
403
+ *
404
+ * @example
405
+ * ```tsx
406
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
407
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
408
+ * <Sandbar.Actions>
409
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
410
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
411
+ * </Sandbar.Actions>
412
+ * </Sandbar.Root>
413
+ * ```
414
+ */
415
+ readonly Message: typeof Message;
416
+ /**
417
+ * The action-button row. Holds `Sandbar.DiscardButton` and
418
+ * `Sandbar.SaveButton`, or your own composed `Button`s.
419
+ *
420
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbaractions
421
+ *
422
+ * @example
423
+ * ```tsx
424
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
425
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
426
+ * <Sandbar.Actions>
427
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
428
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
429
+ * </Sandbar.Actions>
430
+ * </Sandbar.Root>
431
+ * ```
432
+ */
433
+ readonly Actions: typeof Actions;
434
+ /**
435
+ * The primary (save) action — announces "Saving changes…" and keeps focus
436
+ * from being lost while the save is pending.
437
+ *
438
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarsavebutton
439
+ *
440
+ * @example
441
+ * ```tsx
442
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
443
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
444
+ * <Sandbar.Actions>
445
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
446
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
447
+ * </Sandbar.Actions>
448
+ * </Sandbar.Root>
449
+ * ```
450
+ */
451
+ readonly SaveButton: typeof SaveButton;
452
+ /**
453
+ * The secondary (discard/reset) action.
454
+ *
455
+ * @see https://mantle.ngrok.com/components/feedback/sandbar#sandbardiscardbutton
456
+ *
457
+ * @example
458
+ * ```tsx
459
+ * <Sandbar.Root open={isDirty} handleRef={sandbarHandle}>
460
+ * <Sandbar.Message>You have unsaved changes</Sandbar.Message>
461
+ * <Sandbar.Actions>
462
+ * <Sandbar.DiscardButton onClick={reset}>Discard</Sandbar.DiscardButton>
463
+ * <Sandbar.SaveButton onClick={save} isLoading={isPending}>Save</Sandbar.SaveButton>
464
+ * </Sandbar.Actions>
465
+ * </Sandbar.Root>
466
+ * ```
467
+ */
468
+ readonly DiscardButton: typeof DiscardButton;
469
+ };
470
+ //#endregion
471
+ export { Sandbar, type SandbarActionsProps, type SandbarDiscardButtonProps, type SandbarHandle, type SandbarMessageProps, type SandbarRootProps, type SandbarSaveButtonProps };