@ngrok/mantle 0.81.0 → 0.82.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 (133) hide show
  1. package/dist/accordion.d.ts +6 -6
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +4 -1
  4. package/dist/alert-BWwNPOMI.d.ts +391 -0
  5. package/dist/alert-QMs0PqMq.js +1 -0
  6. package/dist/alert-center.d.ts +449 -0
  7. package/dist/alert-center.js +1 -0
  8. package/dist/alert-dialog.js +1 -1
  9. package/dist/alert.d.ts +1 -288
  10. package/dist/alert.js +1 -1
  11. package/dist/{anchor-DfeXTpKW.js → anchor-DvbNsphX.js} +1 -1
  12. package/dist/anchor.js +1 -1
  13. package/dist/app-layout.d.ts +483 -0
  14. package/dist/app-layout.js +1 -0
  15. package/dist/area-chart.d.ts +4 -3
  16. package/dist/area-chart.js +1 -1
  17. package/dist/badge.js +1 -1
  18. package/dist/bar-chart.d.ts +4 -3
  19. package/dist/bar-chart.js +1 -1
  20. package/dist/breadcrumb.d.ts +1 -1
  21. package/dist/breadcrumb.js +1 -1
  22. package/dist/browser-only-CmEEzfU3.js +1 -0
  23. package/dist/browser-only.js +1 -1
  24. package/dist/{button-D9n09xUg.js → button-BO2CKsz6.js} +1 -1
  25. package/dist/{button-DjpEKt2X.js → button-BUospUB3.js} +1 -1
  26. package/dist/{button-BAno7KIU.js → button-C0S8RbaJ.js} +1 -1
  27. package/dist/button.js +1 -1
  28. package/dist/calendar.d.ts +1 -1
  29. package/dist/calendar.js +1 -1
  30. package/dist/card.js +1 -1
  31. package/dist/centered-layout.d.ts +9 -9
  32. package/dist/centered-layout.js +1 -1
  33. package/dist/{chart-BcOC6Qj0.d.ts → chart-1cVjAcj8.d.ts} +81 -22
  34. package/dist/chart-DdBQ3xwx.js +2 -0
  35. package/dist/checkbox.d.ts +12 -0
  36. package/dist/{choice-BHwFSSyv.js → choice-C9gLKECf.js} +1 -1
  37. package/dist/choice.js +1 -1
  38. package/dist/code-block.d.ts +46 -0
  39. package/dist/code-block.js +1 -1
  40. package/dist/code.js +1 -1
  41. package/dist/combobox.js +1 -1
  42. package/dist/command.d.ts +67 -9
  43. package/dist/command.js +1 -1
  44. package/dist/{copy-to-clipboard-BsCQ9m6K.js → copy-to-clipboard-B4UB6pts.js} +1 -1
  45. package/dist/data-slot-EM6s2WEU.js +1 -0
  46. package/dist/data-table.d.ts +1 -1
  47. package/dist/data-table.js +1 -1
  48. package/dist/description-list.d.ts +36 -16
  49. package/dist/description-list.js +1 -1
  50. package/dist/{dialog-DWZWd5Jt.js → dialog-Bsj_dX6r.js} +1 -1
  51. package/dist/dialog.d.ts +1 -1
  52. package/dist/dialog.js +1 -1
  53. package/dist/dropdown-menu-BbbQuae2.d.ts +1 -0
  54. package/dist/{dropdown-menu-DZg-Cd69.d.ts → dropdown-menu-D6pMAY7I.d.ts} +138 -0
  55. package/dist/dropdown-menu-fUMqjRC0.js +1 -0
  56. package/dist/dropdown-menu.d.ts +2 -2
  57. package/dist/dropdown-menu.js +1 -1
  58. package/dist/empty.js +1 -1
  59. package/dist/field.d.ts +12 -9
  60. package/dist/field.js +1 -1
  61. package/dist/flag.d.ts +1 -1
  62. package/dist/hooks.js +1 -1
  63. package/dist/{icons-DLCs1hLP.js → icons-CPbOq7cF.js} +1 -1
  64. package/dist/icons.d.ts +52 -1
  65. package/dist/icons.js +1 -1
  66. package/dist/input.js +1 -1
  67. package/dist/line-chart.d.ts +4 -3
  68. package/dist/line-chart.js +1 -1
  69. package/dist/{list-51KQvENW.js → list-CQFWx6Z8.js} +1 -1
  70. package/dist/list.js +1 -1
  71. package/dist/llms.txt +4 -1
  72. package/dist/main.d.ts +4 -1
  73. package/dist/main.js +1 -1
  74. package/dist/mantle.css +21 -1
  75. package/dist/media-object.d.ts +42 -0
  76. package/dist/media-object.js +1 -1
  77. package/dist/multi-select.d.ts +10 -2
  78. package/dist/multi-select.js +1 -1
  79. package/dist/otp-input.js +1 -1
  80. package/dist/pagination.d.ts +6 -7
  81. package/dist/pagination.js +1 -1
  82. package/dist/{primitive-trJDqIXJ.js → primitive-Dv-3snU3.js} +1 -1
  83. package/dist/progress.d.ts +8 -8
  84. package/dist/qr-code.js +1 -1
  85. package/dist/radio-group.d.ts +129 -0
  86. package/dist/radio-group.js +1 -1
  87. package/dist/sandboxed-on-click.d.ts +2 -2
  88. package/dist/sandboxed-on-click.js +1 -1
  89. package/dist/scatter-plot.d.ts +4 -3
  90. package/dist/scatter-plot.js +1 -1
  91. package/dist/{select-BCHWvmyC.js → select-B-9yWrif.js} +1 -1
  92. package/dist/select.js +1 -1
  93. package/dist/selectable-list.js +1 -1
  94. package/dist/{separator-bpE_kooz.js → separator-BepAcFFy.js} +1 -1
  95. package/dist/separator.js +1 -1
  96. package/dist/sheet-_fXLjiq2.js +1 -0
  97. package/dist/sheet.d.ts +11 -11
  98. package/dist/sheet.js +1 -1
  99. package/dist/sidebar.d.ts +2084 -0
  100. package/dist/sidebar.js +1 -0
  101. package/dist/{skeleton-CsbUHbBA.js → skeleton-DsHXIa9j.js} +1 -1
  102. package/dist/skeleton.js +1 -1
  103. package/dist/skip-to-main-link.js +1 -1
  104. package/dist/slot-Dpsqz16D.js +1 -0
  105. package/dist/slot.js +1 -1
  106. package/dist/split-button.d.ts +147 -8
  107. package/dist/split-button.js +1 -1
  108. package/dist/{table-Bo0vNxIJ.d.ts → table-CZBYEmyK.d.ts} +2 -2
  109. package/dist/table.d.ts +1 -1
  110. package/dist/tabs.js +1 -1
  111. package/dist/text-area.d.ts +1 -1
  112. package/dist/{theme-CYNpplwN.d.ts → theme-FbfjYiD3.d.ts} +16 -0
  113. package/dist/{theme-C26-Xolp.js → theme-IAnQ35bd.js} +1 -1
  114. package/dist/theme-switcher.d.ts +2 -2
  115. package/dist/theme-switcher.js +1 -1
  116. package/dist/theme.d.ts +42 -2
  117. package/dist/theme.js +1 -1
  118. package/dist/toast.d.ts +4 -0
  119. package/dist/toast.js +1 -1
  120. package/dist/types.js +1 -1
  121. package/dist/use-breakpoint-Wd7_5-Mu.js +1 -0
  122. package/dist/use-copy-to-clipboard-CSyp4Zk0.js +1 -0
  123. package/dist/use-is-hydrated-DDCqXmju.js +1 -0
  124. package/dist/{use-prefers-reduced-motion-CagaNRgm.js → use-prefers-reduced-motion-Bk5zAfHY.js} +1 -1
  125. package/dist/utils.js +1 -1
  126. package/dist/well.js +1 -1
  127. package/package.json +18 -15
  128. package/dist/browser-only-CPH56Xw_.js +0 -1
  129. package/dist/chart-BROa2gqt.js +0 -2
  130. package/dist/dropdown-menu-Dw-OtXPm.d.ts +0 -1
  131. package/dist/dropdown-menu-RyDWoKHx.js +0 -1
  132. package/dist/slot-CDk0Bb9z.js +0 -1
  133. package/dist/use-copy-to-clipboard-DqQ0_N3E.js +0 -1
@@ -78,7 +78,7 @@ type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit
78
78
  * other divider in the system. Disable the dividers with `divide-y-0` on the root
79
79
  * (e.g. pair it with `space-y-*` for a spaced-card layout).
80
80
  *
81
- * @see https://mantle.ngrok.com/components/data-display/accordion#api-accordion
81
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordionroot
82
82
  *
83
83
  * @example
84
84
  * <Accordion.Root type="single" defaultValue="shipping">
@@ -102,7 +102,7 @@ declare const Root: (props: AccordionRootProps) => import("react").JSX.Element;
102
102
  * Because the item is just a `<div>`, its header can be any layout — e.g. a flex
103
103
  * row with the {@link Trigger} alongside a separate, non-toggling action button.
104
104
  *
105
- * @see https://mantle.ngrok.com/components/data-display/accordion#api-accordion-item
105
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordionitem
106
106
  *
107
107
  * @example
108
108
  * <Accordion.Root type="single" defaultValue="item-1">
@@ -128,7 +128,7 @@ declare const Item: ({ children, value, ref, ...props }: ComponentProps<"div"> &
128
128
  * role varies). Place the {@link TriggerIcon} as the last child so the default
129
129
  * `justify-between` layout pushes it to the trailing edge.
130
130
  *
131
- * @see https://mantle.ngrok.com/components/data-display/accordion#api-accordion-trigger
131
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordiontrigger
132
132
  *
133
133
  * @example
134
134
  * <Accordion.Root type="single" defaultValue="item-1">
@@ -150,7 +150,7 @@ declare const Trigger: ({ className, children, onClick, ref, ...props }: Omit<Co
150
150
  * override it with any icon (the rotation-on-open still applies; override
151
151
  * `className` to change that).
152
152
  *
153
- * @see https://mantle.ngrok.com/components/data-display/accordion#api-accordion-trigger-icon
153
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordiontriggericon
154
154
  *
155
155
  * @example
156
156
  * // Default caret
@@ -197,7 +197,7 @@ declare const TriggerIcon: ({ className, svg, ...props }: Omit<IconProps, "svg">
197
197
  * the section when the browser reveals a match. It is flow content, so it may
198
198
  * contain anything — including interactive elements.
199
199
  *
200
- * @see https://mantle.ngrok.com/components/data-display/accordion#api-accordion-content
200
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordioncontent
201
201
  *
202
202
  * @example
203
203
  * <Accordion.Root type="single" defaultValue="item-1">
@@ -226,7 +226,7 @@ declare const Content: ({ className, children, ref, ...props }: ComponentProps<"
226
226
  * Override `className` to retune the padding (e.g. `pb-0`, `px-6`); `cx` resolves
227
227
  * last-wins.
228
228
  *
229
- * @see https://mantle.ngrok.com/components/data-display/accordion#api-accordion-body
229
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordionbody
230
230
  *
231
231
  * @example
232
232
  * <Accordion.Root type="single" defaultValue="item-1">
package/dist/accordion.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-BdBMM9ga.js";import{t as n}from"./cx-IiQEAKf5.js";import{t as r}from"./icon-lZ48P8Nn.js";import{t as i}from"./slot-CDk0Bb9z.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,useCallback as s,useContext as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import p from"tiny-invariant";import{jsx as m}from"react/jsx-runtime";function h(e,t){return e.includes(t)}function g(e,t,n,r){let i=e.includes(t);return n?r===`single`?i&&e.length===1?e:[t]:i?e:[...e,t]:i?e.filter(e=>e!==t):e}function _(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function v(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function y(){return typeof document<`u`&&document.body!=null&&`onbeforematch`in document.body}const b=o(null);function x(e){let t=c(b);return p(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const S=o(null);function C(e){let t=c(S);return p(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const w=e=>{let{type:t=`multiple`,value:r,defaultValue:a,onValueChange:o,asChild:s,children:c,className:l,ref:d,...p}=e,h=r!=null,[y,x]=f(()=>_(a)),S=h?_(r):y,C=u(()=>({type:t,openValues:S,setItemOpen:(n,r)=>{let i=g(S,n,r,t);i!==S&&(h||x(i),v(e,i))}}),[t,S,h,e]),w={...p,"data-slot":`accordion`,className:n(`w-full divide-y divide-separator`,l)};return m(b.Provider,{value:C,children:m(s?i:`div`,{ref:d,...w,children:c})})},T=({children:e,value:t,ref:n,...r})=>{let{openValues:i,setItemOpen:a}=x(`Accordion.Item`),o=h(i,t),c=s(e=>{a(t,e)},[a,t]),l=u(()=>({open:o,setOpen:c}),[o,c]);return m(S.Provider,{value:l,children:m(`div`,{ref:n,...r,role:`group`,"data-slot":`accordion-item`,"data-state":o?`open`:`closed`,children:e})})},E=({className:e,children:t,onClick:r,ref:i,...a})=>{let{open:o,setOpen:s}=C(`Accordion.Trigger`);return m(`button`,{ref:i,type:`button`,...a,"data-slot":`accordion-trigger`,"data-state":o?`open`:`closed`,"aria-expanded":o,className:n(`group flex w-full cursor-pointer items-center justify-between gap-4 py-4 text-left font-medium outline-none`,`-mx-2 rounded-md px-2`,`transition-[padding] duration-200 ease-out data-state-open:pb-2 motion-reduce:transition-none`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,e),onClick:e=>{r?.(e),s(!o)},children:t})},D=m(a,{weight:`bold`}),O={Root:w,Item:T,Trigger:E,TriggerIcon:({className:e,svg:t=D,...i})=>m(r,{...i,"data-slot":`accordion-trigger-icon`,svg:t,className:n(`size-4 shrink-0 text-muted transition-transform duration-200 group-data-state-open:rotate-180`,e)}),Content:({className:r,children:i,ref:a,...o})=>{let{open:s,setOpen:c}=C(`Accordion.Content`),u=d(null),f=t(u,a);return l(()=>{let e=u.current;if(!e||!y())return;let t=()=>{e.removeAttribute(`hidden`),e.style.height=`auto`,c(!0)};return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},[c]),e(()=>{let e=u.current;e&&(s||!y()?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``))},[s]),m(`div`,{ref:f,...o,"data-slot":`accordion-content`,"data-state":s?`open`:`closed`,className:n(`h-0 overflow-hidden transition-[height,content-visibility] duration-200 ease-out [interpolate-size:allow-keywords] transition-discrete data-state-open:h-auto motion-reduce:transition-none`,r),children:i})},Body:({className:e,ref:t,...r})=>m(`div`,{ref:t,...r,"data-slot":`accordion-body`,className:n(`pt-2 pb-4`,e)})};export{O as Accordion};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-BdBMM9ga.js";import{t as n}from"./cx-IiQEAKf5.js";import{t as r}from"./icon-lZ48P8Nn.js";import{t as i}from"./slot-Dpsqz16D.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,useCallback as s,useContext as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import p from"tiny-invariant";import{jsx as m}from"react/jsx-runtime";function h(e,t){return e.includes(t)}function g(e,t,n,r){let i=e.includes(t);return n?r===`single`?i&&e.length===1?e:[t]:i?e:[...e,t]:i?e.filter(e=>e!==t):e}function _(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function v(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function y(){return typeof document<`u`&&document.body!=null&&`onbeforematch`in document.body}const b=o(null);function x(e){let t=c(b);return p(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const S=o(null);function C(e){let t=c(S);return p(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const w=e=>{let{type:t=`multiple`,value:r,defaultValue:a,onValueChange:o,asChild:s,children:c,className:l,ref:d,...p}=e,h=r!=null,[y,x]=f(()=>_(a)),S=h?_(r):y,C=u(()=>({type:t,openValues:S,setItemOpen:(n,r)=>{let i=g(S,n,r,t);i!==S&&(h||x(i),v(e,i))}}),[t,S,h,e]),w={...p,"data-slot":`accordion`,className:n(`w-full divide-y divide-separator`,l)};return m(b.Provider,{value:C,children:m(s?i:`div`,{ref:d,...w,children:c})})},T=({children:e,value:t,ref:n,...r})=>{let{openValues:i,setItemOpen:a}=x(`Accordion.Item`),o=h(i,t),c=s(e=>{a(t,e)},[a,t]),l=u(()=>({open:o,setOpen:c}),[o,c]);return m(S.Provider,{value:l,children:m(`div`,{ref:n,...r,role:`group`,"data-slot":`accordion-item`,"data-state":o?`open`:`closed`,children:e})})},E=({className:e,children:t,onClick:r,ref:i,...a})=>{let{open:o,setOpen:s}=C(`Accordion.Trigger`);return m(`button`,{ref:i,type:`button`,...a,"data-slot":`accordion-trigger`,"data-state":o?`open`:`closed`,"aria-expanded":o,className:n(`group flex w-full cursor-pointer items-center justify-between gap-4 py-4 text-left font-medium outline-none`,`-mx-2 rounded-md px-2`,`transition-[padding] duration-200 ease-out data-state-open:pb-2 motion-reduce:transition-none`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,e),onClick:e=>{r?.(e),s(!o)},children:t})},D=m(a,{weight:`bold`}),O={Root:w,Item:T,Trigger:E,TriggerIcon:({className:e,svg:t=D,...i})=>m(r,{...i,"data-slot":`accordion-trigger-icon`,svg:t,className:n(`size-4 shrink-0 text-muted transition-transform duration-200 group-data-state-open:rotate-180`,e)}),Content:({className:r,children:i,ref:a,...o})=>{let{open:s,setOpen:c}=C(`Accordion.Content`),u=d(null),f=t(u,a);return l(()=>{let e=u.current;if(!e||!y())return;let t=()=>{e.removeAttribute(`hidden`),e.style.height=`auto`,c(!0)};return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},[c]),e(()=>{let e=u.current;e&&(s||!y()?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``))},[s]),m(`div`,{ref:f,...o,"data-slot":`accordion-content`,"data-state":s?`open`:`closed`,className:n(`h-0 overflow-hidden transition-[height,content-visibility] duration-200 ease-out [interpolate-size:allow-keywords] transition-discrete data-state-open:h-auto motion-reduce:transition-none`,r),children:i})},Body:({className:e,ref:t,...r})=>m(`div`,{ref:t,...r,"data-slot":`accordion-body`,className:n(`pt-2 pb-4`,e)})};export{O as Accordion};
package/dist/agent.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.81.0",
3
+ "version": "0.82.0",
4
4
  "origin": "https://mantle.ngrok.com",
5
5
  "endpoints": {
6
6
  "docs": "https://mantle.ngrok.com/",
@@ -18,8 +18,10 @@
18
18
  "subpaths": [
19
19
  "@ngrok/mantle/accordion",
20
20
  "@ngrok/mantle/alert",
21
+ "@ngrok/mantle/alert-center",
21
22
  "@ngrok/mantle/alert-dialog",
22
23
  "@ngrok/mantle/anchor",
24
+ "@ngrok/mantle/app-layout",
23
25
  "@ngrok/mantle/area-chart",
24
26
  "@ngrok/mantle/badge",
25
27
  "@ngrok/mantle/bar-chart",
@@ -69,6 +71,7 @@
69
71
  "@ngrok/mantle/selectable-list",
70
72
  "@ngrok/mantle/separator",
71
73
  "@ngrok/mantle/sheet",
74
+ "@ngrok/mantle/sidebar",
72
75
  "@ngrok/mantle/skeleton",
73
76
  "@ngrok/mantle/skip-to-main-link",
74
77
  "@ngrok/mantle/slider",
@@ -0,0 +1,391 @@
1
+ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
+ import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
3
+ import { r as ButtonProps } from "./button-DARFK2KJ.js";
4
+ import { n as IconButtonProps, r as IconButtonAppearance } from "./button-C7vAl6lS.js";
5
+ import { ComponentProps, ReactNode } from "react";
6
+ //#region src/components/alert/alert.d.ts
7
+ declare const intents: readonly ["danger", "important", "info", "success", "warning"];
8
+ type AlertIntent = (typeof intents)[number];
9
+ declare const appearances: readonly ["banner", "default"];
10
+ type Appearance = (typeof appearances)[number];
11
+ type AlertProps = ComponentProps<"div"> & {
12
+ /**
13
+ * The intent of the Alert — the status its color communicates to the user,
14
+ * determining the color and styling of the Alert.
15
+ */
16
+ intent: AlertIntent;
17
+ /**
18
+ * Controls the visual style of the Alert.
19
+ * - "default" provides standard rounded corners and borders.
20
+ * - "banner" creates a banner-style alert with no rounded corners, sticky positioning, and no left/right borders.
21
+ *
22
+ * @default "default"
23
+ */
24
+ appearance?: Appearance;
25
+ };
26
+ /**
27
+ * Displays a callout for user attention. Root container for all Alert sub-components.
28
+ *
29
+ * Trailing controls inherit these public CSS variables:
30
+ *
31
+ * | Variable | Default | Purpose |
32
+ * | --- | --- | --- |
33
+ * | `--alert-control-color` | `var(--color-<intent>-700)` | Control text and icon color. |
34
+ * | `--alert-control-hover-color` | `var(--color-<intent>-800)` | Control text and icon color on hover. |
35
+ * | `--alert-control-hover-bg` | `color-mix(in oklab, var(--color-<intent>-500) 10%, transparent)` | Control background on hover. |
36
+ *
37
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertroot
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * <Alert.Root intent="info">
42
+ * <Alert.Icon />
43
+ * <Alert.Content>
44
+ * <Alert.Title>Alert Title</Alert.Title>
45
+ * <Alert.Description>
46
+ * Alert description text.
47
+ * </Alert.Description>
48
+ * <Alert.DismissIconButton />
49
+ * <Alert.ExpandButton count={2} expanded={false} />
50
+ * </Alert.Content>
51
+ * </Alert.Root>
52
+ *```
53
+ */
54
+ declare const Root: ({ appearance, className, intent, ref, style, ...props }: AlertProps) => import("react").JSX.Element;
55
+ type AlertIconProps = Omit<SvgAttributes, "children"> & {
56
+ /**
57
+ * An optional icon that renders in place of the default icon for the Alert intent.
58
+ */
59
+ svg?: ReactNode;
60
+ };
61
+ /**
62
+ * An optional icon that visually represents the intent of the Alert.
63
+ *
64
+ * The default rendered icon be overridden with a custom icon using the `svg` prop.
65
+ *
66
+ * @see https://mantle.ngrok.com/components/feedback/alert#alerticon
67
+ *
68
+ * @example
69
+ * ```tsx
70
+ * <Alert.Root intent="info">
71
+ * <Alert.Icon />
72
+ * <Alert.Content>
73
+ * <Alert.Title>Alert Title</Alert.Title>
74
+ * <Alert.Description>
75
+ * Alert description text.
76
+ * </Alert.Description>
77
+ * <Alert.DismissIconButton />
78
+ * <Alert.ExpandButton count={2} expanded={false} />
79
+ * </Alert.Content>
80
+ * </Alert.Root>
81
+ * ```
82
+ */
83
+ declare const Icon: ({ className, ref, svg, ...props }: AlertIconProps) => import("react").JSX.Element;
84
+ /**
85
+ * The container for the content slot of an alert. Place the title, description,
86
+ * and trailing controls as direct children.
87
+ *
88
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertcontent
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * <Alert.Root intent="info">
93
+ * <Alert.Icon />
94
+ * <Alert.Content>
95
+ * <Alert.Title>Alert Title</Alert.Title>
96
+ * <Alert.Description>
97
+ * Alert description text.
98
+ * </Alert.Description>
99
+ * <Alert.DismissIconButton />
100
+ * <Alert.ExpandButton count={2} expanded={false} />
101
+ * </Alert.Content>
102
+ * </Alert.Root>
103
+ *```
104
+ */
105
+ declare const Content: ({ className, ref, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
106
+ type AlertTitleProps = ComponentProps<"h5"> & WithAsChild;
107
+ /**
108
+ * The title of an alert. Default renders as an h5 element, use asChild to render something else.
109
+ *
110
+ * @see https://mantle.ngrok.com/components/feedback/alert#alerttitle
111
+ *
112
+ * @example
113
+ * ```tsx
114
+ * <Alert.Root intent="info">
115
+ * <Alert.Icon />
116
+ * <Alert.Content>
117
+ * <Alert.Title>Alert Title</Alert.Title>
118
+ * <Alert.Description>
119
+ * Alert description text.
120
+ * </Alert.Description>
121
+ * <Alert.DismissIconButton />
122
+ * <Alert.ExpandButton count={2} expanded={false} />
123
+ * </Alert.Content>
124
+ * </Alert.Root>
125
+ *```
126
+ */
127
+ declare const Title: ({ asChild, className, ref, ...props }: AlertTitleProps) => import("react").JSX.Element;
128
+ type AlertDescriptionProps = ComponentProps<"div"> & WithAsChild;
129
+ /**
130
+ * The optional description of an alert.
131
+ * Renders as a `div` by default, but can be changed to any other element using
132
+ * the `asChild` prop.
133
+ *
134
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertdescription
135
+ *
136
+ * @example
137
+ * ```tsx
138
+ * <Alert.Root intent="info">
139
+ * <Alert.Icon />
140
+ * <Alert.Content>
141
+ * <Alert.Title>Alert Title</Alert.Title>
142
+ * <Alert.Description>
143
+ * Alert description text.
144
+ * </Alert.Description>
145
+ * <Alert.DismissIconButton />
146
+ * <Alert.ExpandButton count={2} expanded={false} />
147
+ * </Alert.Content>
148
+ * </Alert.Root>
149
+ * ```
150
+ */
151
+ declare const Description: ({ asChild, className, ref, ...props }: AlertDescriptionProps) => import("react").JSX.Element;
152
+ type AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, "appearance" | "icon" | "intent">> & {
153
+ /**
154
+ * The visual style of the dismiss button. Optional here —
155
+ * `Alert.DismissIconButton` defaults to `"ghost"` so the dismiss affordance
156
+ * stays visually quiet inside the Alert.
157
+ *
158
+ * @default "ghost"
159
+ */
160
+ appearance?: IconButtonAppearance;
161
+ /**
162
+ * An optional icon to render inside the dismiss button. Defaults to an X icon.
163
+ */
164
+ icon?: ReactNode;
165
+ };
166
+ /**
167
+ * A compact, trailing control for dismissing an alert.
168
+ *
169
+ * It inherits `--alert-control-color`, `--alert-control-hover-color`, and
170
+ * `--alert-control-hover-bg` from `Alert.Root`, shared with
171
+ * `Alert.ExpandButton` when both controls are composed together.
172
+ *
173
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertdismissiconbutton
174
+ *
175
+ * @example
176
+ * ```tsx
177
+ * <Alert.Root intent="warning">
178
+ * <Alert.Icon />
179
+ * <Alert.Content>
180
+ * <Alert.Title>Usage limit approaching</Alert.Title>
181
+ * <Alert.DismissIconButton onClick={dismiss} />
182
+ * <Alert.ExpandButton count={2} expanded={isExpanded} onClick={toggle} />
183
+ * </Alert.Content>
184
+ * </Alert.Root>
185
+ * ```
186
+ */
187
+ declare const DismissIconButton: ({ size, type, label, appearance, className, icon, ...props }: AlertDismissIconButtonProps) => import("react").JSX.Element;
188
+ type AlertExpandButtonProps = Omit<ButtonProps, "appearance" | "asChild" | "children" | "icon" | "iconPlacement" | "intent" | "size"> & {
189
+ /** The number of alerts hidden by a collapsed alert center. */
190
+ count: number;
191
+ /** Whether the alerts controlled by this button are currently visible. */
192
+ expanded: boolean;
193
+ };
194
+ /**
195
+ * A compact, trailing control for expanding or collapsing related alerts.
196
+ *
197
+ * It occupies the trailing control area alongside `Alert.DismissIconButton`
198
+ * when both are present, and marks the alert so `Alert.Content` reserves room
199
+ * for its plus-prefixed count and caret on narrow viewports. It shares the
200
+ * `--alert-control-*` color variables from `Alert.Root` with the dismiss
201
+ * control.
202
+ *
203
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertexpandbutton
204
+ *
205
+ * @example
206
+ * ```tsx
207
+ * <Alert.Root intent="warning">
208
+ * <Alert.Icon />
209
+ * <Alert.Content>
210
+ * <Alert.Title>Usage limit approaching</Alert.Title>
211
+ * <Alert.DismissIconButton />
212
+ * <Alert.ExpandButton count={2} expanded={isExpanded} onClick={toggle} />
213
+ * </Alert.Content>
214
+ * </Alert.Root>
215
+ * ```
216
+ */
217
+ declare const ExpandButton: ({ count, expanded, className, ...props }: AlertExpandButtonProps) => import("react").JSX.Element;
218
+ /**
219
+ * Displays a callout for user attention.
220
+ *
221
+ * @see https://mantle.ngrok.com/components/feedback/alert
222
+ *
223
+ * @example
224
+ * Composition:
225
+ * ```
226
+ * Alert.Root
227
+ * ├── Alert.Icon
228
+ * ├── Alert.Content
229
+ * ├── Alert.Title
230
+ * ├── Alert.Description
231
+ * ├── Alert.DismissIconButton
232
+ * └── Alert.ExpandButton
233
+ * ```
234
+ *
235
+ * @example
236
+ * ```tsx
237
+ * <Alert.Root intent="info">
238
+ * <Alert.Icon />
239
+ * <Alert.Content>
240
+ * <Alert.Title>Alert Title</Alert.Title>
241
+ * <Alert.Description>
242
+ * Alert description text.
243
+ * </Alert.Description>
244
+ * <Alert.DismissIconButton />
245
+ * <Alert.ExpandButton count={2} expanded={false} />
246
+ * </Alert.Content>
247
+ * </Alert.Root>
248
+ *```
249
+ */
250
+ declare const Alert: {
251
+ /**
252
+ * The root container of the alert component.
253
+ *
254
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertroot
255
+ *
256
+ * @example
257
+ * ```tsx
258
+ * <Alert.Root intent="info">
259
+ * <Alert.Icon />
260
+ * <Alert.Content>
261
+ * <Alert.Title>Alert Title</Alert.Title>
262
+ * <Alert.Description>Alert description</Alert.Description>
263
+ * <Alert.DismissIconButton />
264
+ * <Alert.ExpandButton count={2} expanded={false} />
265
+ * </Alert.Content>
266
+ * </Alert.Root>
267
+ * ```
268
+ */
269
+ readonly Root: typeof Root;
270
+ /**
271
+ * The container for the content slot of an alert.
272
+ *
273
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertcontent
274
+ *
275
+ * @example
276
+ * ```tsx
277
+ * <Alert.Root intent="info">
278
+ * <Alert.Icon />
279
+ * <Alert.Content>
280
+ * <Alert.Title>Alert Title</Alert.Title>
281
+ * <Alert.Description>Alert description text.</Alert.Description>
282
+ * <Alert.DismissIconButton />
283
+ * <Alert.ExpandButton count={2} expanded={false} />
284
+ * </Alert.Content>
285
+ * </Alert.Root>
286
+ * ```
287
+ */
288
+ readonly Content: typeof Content;
289
+ /**
290
+ * A compact trailing control for expanding or collapsing related alerts.
291
+ * It inherits the `--alert-control-color`, `--alert-control-hover-color`, and
292
+ * `--alert-control-hover-bg` variables from `Alert.Root`, shared with the
293
+ * dismiss control.
294
+ *
295
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertexpandbutton
296
+ *
297
+ * @example
298
+ * ```tsx
299
+ * <Alert.Root intent="warning">
300
+ * <Alert.Icon />
301
+ * <Alert.Content>
302
+ * <Alert.Title>Usage limit approaching</Alert.Title>
303
+ * <Alert.DismissIconButton />
304
+ * <Alert.ExpandButton count={2} expanded={isExpanded} onClick={toggle} />
305
+ * </Alert.Content>
306
+ * </Alert.Root>
307
+ * ```
308
+ */
309
+ readonly ExpandButton: typeof ExpandButton;
310
+ /**
311
+ * The optional description of an alert.
312
+ *
313
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertdescription
314
+ *
315
+ * @example
316
+ * ```tsx
317
+ * <Alert.Root intent="info">
318
+ * <Alert.Icon />
319
+ * <Alert.Content>
320
+ * <Alert.Title>Alert Title</Alert.Title>
321
+ * <Alert.Description>Alert description text.</Alert.Description>
322
+ * <Alert.DismissIconButton />
323
+ * <Alert.ExpandButton count={2} expanded={false} />
324
+ * </Alert.Content>
325
+ * </Alert.Root>
326
+ * ```
327
+ */
328
+ readonly Description: typeof Description;
329
+ /**
330
+ * An optional dismiss button that can be used to close the alert.
331
+ * It inherits the `--alert-control-color`, `--alert-control-hover-color`, and
332
+ * `--alert-control-hover-bg` variables from `Alert.Root`, shared with the
333
+ * expand control.
334
+ *
335
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertdismissiconbutton
336
+ *
337
+ * @example
338
+ * ```tsx
339
+ * <Alert.Root intent="info">
340
+ * <Alert.Icon />
341
+ * <Alert.Content>
342
+ * <Alert.Title>Alert Title</Alert.Title>
343
+ * <Alert.DismissIconButton />
344
+ * <Alert.Description>Alert description text.</Alert.Description>
345
+ * <Alert.ExpandButton count={2} expanded={false} />
346
+ * </Alert.Content>
347
+ * </Alert.Root>
348
+ * ```
349
+ */
350
+ readonly DismissIconButton: typeof DismissIconButton;
351
+ /**
352
+ * An optional icon that visually represents the intent of the Alert.
353
+ *
354
+ * @see https://mantle.ngrok.com/components/feedback/alert#alerticon
355
+ *
356
+ * @example
357
+ * ```tsx
358
+ * <Alert.Root intent="info">
359
+ * <Alert.Icon />
360
+ * <Alert.Content>
361
+ * <Alert.Title>Alert Title</Alert.Title>
362
+ * <Alert.Description>Alert description text.</Alert.Description>
363
+ * <Alert.DismissIconButton />
364
+ * <Alert.ExpandButton count={2} expanded={false} />
365
+ * </Alert.Content>
366
+ * </Alert.Root>
367
+ * ```
368
+ */
369
+ readonly Icon: typeof Icon;
370
+ /**
371
+ * The title of an alert.
372
+ *
373
+ * @see https://mantle.ngrok.com/components/feedback/alert#alerttitle
374
+ *
375
+ * @example
376
+ * ```tsx
377
+ * <Alert.Root intent="info">
378
+ * <Alert.Icon />
379
+ * <Alert.Content>
380
+ * <Alert.Title>Alert Title</Alert.Title>
381
+ * <Alert.Description>Alert description text.</Alert.Description>
382
+ * <Alert.DismissIconButton />
383
+ * <Alert.ExpandButton count={2} expanded={false} />
384
+ * </Alert.Content>
385
+ * </Alert.Root>
386
+ * ```
387
+ */
388
+ readonly Title: typeof Title;
389
+ };
390
+ //#endregion
391
+ export { Alert as t };
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-d-nMCfAI.js";import{t as n}from"./slot-Dpsqz16D.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./button-BUospUB3.js";import{t as a}from"./button-C0S8RbaJ.js";import{CaretDownIcon as o}from"@phosphor-icons/react/CaretDown";import{createContext as s,useContext as c,useMemo as l}from"react";import u from"tiny-invariant";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{CheckCircleIcon as p}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as m}from"@phosphor-icons/react/Info";import{MegaphoneIcon as h}from"@phosphor-icons/react/Megaphone";import{WarningIcon as g}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as _}from"@phosphor-icons/react/WarningDiamond";import{XIcon as v}from"@phosphor-icons/react/X";import{cva as y}from"class-variance-authority";const b=s(null),x=d(v,{});function S(){let e=c(b);return u(e,`useAlertContext hook used outside of Alert parent!`),e}const C=({children:e,intent:t})=>{let n=l(()=>({intent:t}),[t]);return d(b.Provider,{value:n,children:e})},w=y(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{intent:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a:not([data-slot=button])]:text-danger-700 [&_a:not([data-slot=button])]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a:not([data-slot=button])]:text-important-700 [&_a:not([data-slot=button])]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a:not([data-slot=button])]:text-info-700 [&_a:not([data-slot=button])]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a:not([data-slot=button])]:text-success-700 [&_a:not([data-slot=button])]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a:not([data-slot=button])]:text-warning-700 [&_a:not([data-slot=button])]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}}}),T=({appearance:t=`default`,className:n,intent:i,ref:a,style:o,...s})=>d(C,{intent:i,children:d(`div`,{ref:a,"data-slot":`alert`,className:e(w({appearance:t,intent:i}),`has-data-alert-dismiss:pr-10`,`has-data-alert-expand:[&_[data-slot=alert-dismiss-icon-button]]:right-16`,`md:has-data-alert-expand:[&_[data-slot=alert-dismiss-icon-button]]:right-24`,`has-data-alert-expand:[&_[data-slot=alert-content]]:pr-12`,`md:has-data-alert-expand:[&_[data-slot=alert-content]]:pr-[5.5rem]`,n),style:r({"--alert-control-color":j(i),"--alert-control-hover-color":M(i),"--alert-control-hover-bg":N(i),...o}),...s})}),E={danger:d(g,{}),important:d(h,{mirrored:!0}),info:d(m,{}),success:d(p,{}),warning:d(_,{})},D=({className:n,ref:r,svg:i,...a})=>{let o=S(),s=E[o.intent];return d(t,{ref:r,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:i??s,...a})},O=({className:t,ref:n,...r})=>d(`div`,{ref:n,"data-slot":`alert-content`,className:e(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,t),...r}),k=({asChild:t=!1,className:r,ref:i,...a})=>d(t?n:`h5`,{ref:i,"data-slot":`alert-title`,className:e(`font-medium`,r),...a}),A=({asChild:t=!1,className:r,ref:i,...a})=>d(t?n:`div`,{ref:i,"data-slot":`alert-description`,className:e(`text-sm`,r),...a}),j=e=>`var(--color-${e}-700)`,M=e=>`var(--color-${e}-800)`,N=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`,P={Root:T,Content:O,ExpandButton:({count:t,expanded:n,className:r,...a})=>f(i,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"aria-expanded":n,"aria-label":n?`Collapse additional alerts`:`Show ${t} more ${t===1?`alert`:`alerts`}`,"data-slot":`alert-expand-button`,"data-alert-expand":!0,className:e(`right-1.5 top-1.5 absolute gap-1 px-1.5`,`text-[var(--alert-control-color,currentColor)]`,`not-disabled:hover:bg-[var(--alert-control-hover-bg,transparent)] not-disabled:hover:text-[var(--alert-control-hover-color,currentColor)]`,r),...a,children:[f(`span`,{className:`min-w-[2ch] text-center tabular-nums`,children:[`+`,t]}),d(`span`,{className:`hidden md:inline`,children:`more`}),d(o,{weight:`bold`,className:e(`size-4 transition-transform ease-out duration-150`,n&&`-rotate-180`)})]}),Description:A,DismissIconButton:({size:t=`sm`,type:n=`button`,label:r=`Dismiss Alert`,appearance:i=`ghost`,className:o,icon:s=x,...c})=>d(a,{appearance:i,icon:s,intent:`neutral`,label:r,size:t,"data-slot":`alert-dismiss-icon-button`,"data-alert-dismiss":!0,className:e(`right-1.5 top-1.5 absolute`,`text-[var(--alert-control-color,currentColor)]`,`not-disabled:hover:bg-[var(--alert-control-hover-bg,transparent)] not-disabled:hover:text-[var(--alert-control-hover-color,currentColor)]`,o),type:n,...c}),Icon:D,Title:k};export{C as n,P as t};