@ngrok/mantle 0.81.1 → 0.82.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/accordion.js +1 -1
  2. package/dist/agent.json +4 -1
  3. package/dist/alert-BWwNPOMI.d.ts +391 -0
  4. package/dist/alert-center.d.ts +647 -0
  5. package/dist/alert-center.js +1 -0
  6. package/dist/alert-dialog.js +1 -1
  7. package/dist/alert-vwFd7qdp.js +1 -0
  8. package/dist/alert.d.ts +1 -390
  9. package/dist/alert.js +1 -1
  10. package/dist/{anchor-DfeXTpKW.js → anchor-3OGK2UKU.js} +1 -1
  11. package/dist/anchor.js +1 -1
  12. package/dist/app-layout.d.ts +566 -0
  13. package/dist/app-layout.js +1 -0
  14. package/dist/area-chart.js +1 -1
  15. package/dist/badge.js +1 -1
  16. package/dist/bar-chart.js +1 -1
  17. package/dist/breadcrumb.d.ts +1 -1
  18. package/dist/breadcrumb.js +1 -1
  19. package/dist/browser-only-CmEEzfU3.js +1 -0
  20. package/dist/browser-only.js +1 -1
  21. package/dist/{button-DjpEKt2X.js → button-Cnja9Bsr.js} +1 -1
  22. package/dist/{button-D9n09xUg.js → button-DmJkYfyl.js} +1 -1
  23. package/dist/{button-BAno7KIU.js → button-IlxHhjPK.js} +1 -1
  24. package/dist/button.js +1 -1
  25. package/dist/calendar.d.ts +1 -1
  26. package/dist/card.js +1 -1
  27. package/dist/centered-layout.d.ts +9 -9
  28. package/dist/centered-layout.js +1 -1
  29. package/dist/chart-B3pAvmkk.js +2 -0
  30. package/dist/{choice-BHwFSSyv.js → choice-CnwfjSEu.js} +1 -1
  31. package/dist/choice.js +1 -1
  32. package/dist/code-block.js +1 -1
  33. package/dist/code.js +1 -1
  34. package/dist/combobox.js +1 -1
  35. package/dist/command.js +1 -1
  36. package/dist/cookie-ca4g5CKp.js +1 -0
  37. package/dist/{copy-to-clipboard-BsCQ9m6K.js → copy-to-clipboard-B4UB6pts.js} +1 -1
  38. package/dist/data-slot-EM6s2WEU.js +1 -0
  39. package/dist/data-table.js +1 -1
  40. package/dist/description-list.js +1 -1
  41. package/dist/{dialog-DWZWd5Jt.js → dialog-DozL6n-F.js} +1 -1
  42. package/dist/dialog.d.ts +1 -1
  43. package/dist/dialog.js +1 -1
  44. package/dist/dropdown-menu-BRH0Wd_z.js +1 -0
  45. package/dist/dropdown-menu.js +1 -1
  46. package/dist/empty.js +1 -1
  47. package/dist/field.d.ts +1 -1
  48. package/dist/field.js +1 -1
  49. package/dist/hooks.js +1 -1
  50. package/dist/{icons-DLCs1hLP.js → icons-Bb_zF2OV.js} +1 -1
  51. package/dist/icons.js +1 -1
  52. package/dist/input.js +1 -1
  53. package/dist/line-chart.js +1 -1
  54. package/dist/{list-51KQvENW.js → list-CJABVHwi.js} +1 -1
  55. package/dist/list.js +1 -1
  56. package/dist/llms.txt +4 -1
  57. package/dist/main.d.ts +35 -1
  58. package/dist/main.js +1 -1
  59. package/dist/mantle.css +21 -1
  60. package/dist/media-object.js +1 -1
  61. package/dist/multi-select.d.ts +10 -2
  62. package/dist/multi-select.js +1 -1
  63. package/dist/otp-input.js +1 -1
  64. package/dist/pagination.js +1 -1
  65. package/dist/platform-BVD3gpKD.js +1 -0
  66. package/dist/{primitive-trJDqIXJ.js → primitive-D-9GIFWb.js} +1 -1
  67. package/dist/progress.d.ts +8 -8
  68. package/dist/qr-code.js +1 -1
  69. package/dist/radio-group.d.ts +10 -0
  70. package/dist/radio-group.js +1 -1
  71. package/dist/sandboxed-on-click.js +1 -1
  72. package/dist/scatter-plot.d.ts +2 -1
  73. package/dist/scatter-plot.js +1 -1
  74. package/dist/{select-BCHWvmyC.js → select-BReznXaw.js} +1 -1
  75. package/dist/select.js +1 -1
  76. package/dist/selectable-list.js +1 -1
  77. package/dist/{separator-bpE_kooz.js → separator-D0D6VyyM.js} +1 -1
  78. package/dist/separator.js +1 -1
  79. package/dist/sheet-BxvTfPLM.js +1 -0
  80. package/dist/sheet.d.ts +1 -1
  81. package/dist/sheet.js +1 -1
  82. package/dist/sidebar.d.ts +2558 -0
  83. package/dist/sidebar.js +1 -0
  84. package/dist/{skeleton-CsbUHbBA.js → skeleton-BhcJMpem.js} +1 -1
  85. package/dist/skeleton.js +1 -1
  86. package/dist/skip-to-main-link.js +1 -1
  87. package/dist/slot-DdgxmuI5.d.ts +67 -0
  88. package/dist/slot-DpNWVci8.js +1 -0
  89. package/dist/slot.d.ts +1 -1
  90. package/dist/slot.js +1 -1
  91. package/dist/split-button.js +1 -1
  92. package/dist/tabs.js +1 -1
  93. package/dist/theme-BorfgnNh.js +1 -0
  94. package/dist/theme-switcher.d.ts +1 -1
  95. package/dist/theme-switcher.js +1 -1
  96. package/dist/theme.js +1 -1
  97. package/dist/toast.js +1 -1
  98. package/dist/tooltip-Dnu35cjU.js +1 -0
  99. package/dist/tooltip-mrpLz4DZ.d.ts +218 -0
  100. package/dist/tooltip.d.ts +1 -217
  101. package/dist/tooltip.js +1 -1
  102. package/dist/use-breakpoint-Wd7_5-Mu.js +1 -0
  103. package/dist/use-copy-to-clipboard-CSyp4Zk0.js +1 -0
  104. package/dist/use-is-hydrated-DDCqXmju.js +1 -0
  105. package/dist/{use-prefers-reduced-motion-CagaNRgm.js → use-prefers-reduced-motion-Bk5zAfHY.js} +1 -1
  106. package/dist/utils.js +1 -1
  107. package/dist/well.js +1 -1
  108. package/package.json +16 -13
  109. package/dist/browser-only-CPH56Xw_.js +0 -1
  110. package/dist/chart-Do2qkrxl.js +0 -2
  111. package/dist/dropdown-menu-RyDWoKHx.js +0 -1
  112. package/dist/slot-BtwKJTLq.d.ts +0 -25
  113. package/dist/slot-CDk0Bb9z.js +0 -1
  114. package/dist/theme-C26-Xolp.js +0 -1
  115. package/dist/use-copy-to-clipboard-DqQ0_N3E.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-d-nMCfAI.js";import{t as n}from"./slot-CDk0Bb9z.js";import{t as r}from"./button-DjpEKt2X.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./primitive-trJDqIXJ.js";import{createContext as f,useContext as p,useMemo as m}from"react";import h from"tiny-invariant";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{InfoIcon as v}from"@phosphor-icons/react/Info";import{WarningIcon as y}from"@phosphor-icons/react/Warning";const b=f(null);function x(){let e=p(b);return h(e,`AlertDialog child component used outside of AlertDialog parent!`),e}function S({intent:e,...t}){let n=m(()=>({intent:e}),[e]);return g(b.Provider,{value:n,children:g(c,{...t})})}const C=({ref:e,...t})=>g(a,{ref:e,"data-slot":`alert-dialog-trigger`,...t}),w=i,T=({className:t,ref:n,...r})=>g(o,{"data-slot":`alert-dialog-overlay`,className:e(`data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-xs`,t),...r,ref:n}),E=({className:t,preferredWidth:n=`max-w-md`,ref:r,...i})=>_(w,{children:[g(T,{}),g(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:g(s,{"data-slot":`alert-dialog-content`,"data-mantle-modal-content":!0,ref:r,className:e(`flex w-full flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start`,`outline-hidden focus-within:outline-hidden`,`p-6`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,n,t),...i})})]}),D=({asChild:t=!1,className:r,ref:i,...a})=>g(t?n:`div`,{"data-slot":`alert-dialog-body`,className:e(`flex-1 space-y-4`,r),ref:i,...a}),O=({asChild:t=!1,className:r,ref:i,...a})=>g(t?n:`div`,{"data-slot":`alert-dialog-header`,className:e(`flex flex-col space-y-2 text-center sm:text-start`,r),ref:i,...a}),k=({asChild:t=!1,className:r,ref:i,...a})=>g(t?n:`div`,{"data-slot":`alert-dialog-footer`,className:e(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,r),ref:i,...a}),A=({className:t,ref:n,...r})=>g(u,{ref:n,"data-slot":`alert-dialog-title`,className:e(`text-strong text-center text-lg font-medium sm:text-start`,t),...r}),j=({className:t,ref:n,...r})=>g(l,{ref:n,"data-slot":`alert-dialog-description`,className:e(`text-body text-center text-sm font-normal sm:text-start`,t),...r}),M={danger:`danger`,info:`neutral`},N=({appearance:e=`filled`,intent:t,ref:n,...i})=>{let a=x(),o=M[a.intent];return g(r,{appearance:e,"data-slot":`alert-dialog-action`,intent:t??o,ref:n,...i})},P=({appearance:t=`outlined`,className:n,intent:i=`neutral`,ref:a,...o})=>g(d,{asChild:!0,children:g(r,{appearance:t,"data-slot":`alert-dialog-cancel`,className:e(`mt-2 sm:mt-0`,n),intent:i,ref:a,...o})}),F={danger:g(y,{}),info:g(v,{})},I={danger:`text-danger-600`,info:`text-accent-600`},L={Root:S,Action:N,Body:D,Cancel:P,Close:({ref:e,...t})=>g(d,{ref:e,"data-slot":`alert-dialog-close`,...t}),Content:E,Description:j,Footer:k,Header:O,Icon:({className:n,ref:r,svg:i,...a})=>{let o=x(),s=I[o.intent],c=F[o.intent];return g(t,{ref:r,"data-slot":`alert-dialog-icon`,className:e(`size-12 sm:size-7`,s,n),svg:i??c,...a})},Title:A,Trigger:C};export{L as AlertDialog};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-d-nMCfAI.js";import{t as n}from"./slot-DpNWVci8.js";import{t as r}from"./button-Cnja9Bsr.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./primitive-D-9GIFWb.js";import{createContext as f,useContext as p,useMemo as m}from"react";import h from"tiny-invariant";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{InfoIcon as v}from"@phosphor-icons/react/Info";import{WarningIcon as y}from"@phosphor-icons/react/Warning";const b=f(null);function x(){let e=p(b);return h(e,`AlertDialog child component used outside of AlertDialog parent!`),e}function S({intent:e,...t}){let n=m(()=>({intent:e}),[e]);return g(b.Provider,{value:n,children:g(c,{...t})})}const C=({ref:e,...t})=>g(a,{ref:e,"data-slot":`alert-dialog-trigger`,...t}),w=i,T=({className:t,ref:n,...r})=>g(o,{"data-slot":`alert-dialog-overlay`,className:e(`data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-xs`,t),...r,ref:n}),E=({className:t,preferredWidth:n=`max-w-md`,ref:r,...i})=>_(w,{children:[g(T,{}),g(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:g(s,{"data-slot":`alert-dialog-content`,"data-mantle-modal-content":!0,ref:r,className:e(`flex w-full flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start`,`outline-hidden focus-within:outline-hidden`,`p-6`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,n,t),...i})})]}),D=({asChild:t=!1,className:r,ref:i,...a})=>g(t?n:`div`,{"data-slot":`alert-dialog-body`,className:e(`flex-1 space-y-4`,r),ref:i,...a}),O=({asChild:t=!1,className:r,ref:i,...a})=>g(t?n:`div`,{"data-slot":`alert-dialog-header`,className:e(`flex flex-col space-y-2 text-center sm:text-start`,r),ref:i,...a}),k=({asChild:t=!1,className:r,ref:i,...a})=>g(t?n:`div`,{"data-slot":`alert-dialog-footer`,className:e(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,r),ref:i,...a}),A=({className:t,ref:n,...r})=>g(u,{ref:n,"data-slot":`alert-dialog-title`,className:e(`text-strong text-center text-lg font-medium sm:text-start`,t),...r}),j=({className:t,ref:n,...r})=>g(l,{ref:n,"data-slot":`alert-dialog-description`,className:e(`text-body text-center text-sm font-normal sm:text-start`,t),...r}),M={danger:`danger`,info:`neutral`},N=({appearance:e=`filled`,intent:t,ref:n,...i})=>{let a=x(),o=M[a.intent];return g(r,{appearance:e,"data-slot":`alert-dialog-action`,intent:t??o,ref:n,...i})},P=({appearance:t=`outlined`,className:n,intent:i=`neutral`,ref:a,...o})=>g(d,{asChild:!0,children:g(r,{appearance:t,"data-slot":`alert-dialog-cancel`,className:e(`mt-2 sm:mt-0`,n),intent:i,ref:a,...o})}),F={danger:g(y,{}),info:g(v,{})},I={danger:`text-danger-600`,info:`text-accent-600`},L={Root:S,Action:N,Body:D,Cancel:P,Close:({ref:e,...t})=>g(d,{ref:e,"data-slot":`alert-dialog-close`,...t}),Content:E,Description:j,Footer:k,Header:O,Icon:({className:n,ref:r,svg:i,...a})=>{let o=x(),s=I[o.intent],c=F[o.intent];return g(t,{ref:r,"data-slot":`alert-dialog-icon`,className:e(`size-12 sm:size-7`,s,n),svg:i??c,...a})},Title:A,Trigger:C};export{L as AlertDialog};
@@ -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-DpNWVci8.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./button-Cnja9Bsr.js";import{t as a}from"./button-IlxHhjPK.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};
package/dist/alert.d.ts CHANGED
@@ -1,391 +1,2 @@
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
1
+ import { t as Alert } from "./alert-BWwNPOMI.js";
391
2
  export { Alert };
package/dist/alert.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-d-nMCfAI.js";import{t as n}from"./slot-CDk0Bb9z.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./button-DjpEKt2X.js";import{t as a}from"./button-BAno7KIU.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=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:``}}}),w=({appearance:t=`default`,className:n,intent:i,ref:a,style:o,...s})=>{let c=l(()=>({intent:i}),[i]);return d(b.Provider,{value:c,children:d(`div`,{ref:a,"data-slot":`alert`,className:e(C({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":A(i),"--alert-control-hover-color":j(i),"--alert-control-hover-bg":M(i),...o}),...s})})},T={danger:d(g,{}),important:d(h,{mirrored:!0}),info:d(m,{}),success:d(p,{}),warning:d(_,{})},E=({className:n,ref:r,svg:i,...a})=>{let o=S(),s=T[o.intent];return d(t,{ref:r,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:i??s,...a})},D=({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}),O=({asChild:t=!1,className:r,ref:i,...a})=>d(t?n:`h5`,{ref:i,"data-slot":`alert-title`,className:e(`font-medium`,r),...a}),k=({asChild:t=!1,className:r,ref:i,...a})=>d(t?n:`div`,{ref:i,"data-slot":`alert-description`,className:e(`text-sm`,r),...a}),A=e=>`var(--color-${e}-700)`,j=e=>`var(--color-${e}-800)`,M=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`,N={Root:w,Content:D,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:k,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:E,Title:O};export{N as Alert};
1
+ import{t as e}from"./alert-vwFd7qdp.js";export{e as Alert};
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./slot-CDk0Bb9z.js";import{Children as r,cloneElement as i,isValidElement as a}from"react";import o from"tiny-invariant";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=t=>e(`cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,t),d=({asChild:e,children:d,className:p,rel:m,icon:h,iconPlacement:g=`start`,ref:_,...v})=>{let y=f(m),b={"data-slot":`anchor`,className:u(p),ref:_,rel:y,...v};if(e){let e=r.only(d);o(a(e),"When using `asChild`, Anchor must be passed a single child as a JSX tag.");let u=e.props?.children;return c(n,{...b,children:i(e,{},l(s,{children:[h&&g===`start`&&c(t,{className:`inline-block mr-1.5`,svg:h}),u,h&&g===`end`&&c(t,{className:`inline-block ml-1.5`,svg:h})]}))})}return l(`a`,{...b,children:[h&&g===`start`&&c(t,{className:`inline-block mr-1.5`,svg:h}),d,h&&g===`end`&&c(t,{className:`inline-block ml-1.5`,svg:h})]})};function f(e){return Array.isArray(e)?[...new Set(e)].map(e=>e?.trim()).filter(Boolean).toSorted().join(` `)||void 0:e?.trim()||void 0}export{u as n,f as r,d as t};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./slot-DpNWVci8.js";import{Children as r,cloneElement as i,isValidElement as a}from"react";import o from"tiny-invariant";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=t=>e(`cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,t),d=({asChild:e,children:d,className:p,rel:m,icon:h,iconPlacement:g=`start`,ref:_,...v})=>{let y=f(m),b={"data-slot":`anchor`,className:u(p),ref:_,rel:y,...v};if(e){let e=r.only(d);o(a(e),"When using `asChild`, Anchor must be passed a single child as a JSX tag.");let u=e.props?.children;return c(n,{...b,children:i(e,{},l(s,{children:[h&&g===`start`&&c(t,{className:`inline-block mr-1.5`,svg:h}),u,h&&g===`end`&&c(t,{className:`inline-block ml-1.5`,svg:h})]}))})}return l(`a`,{...b,children:[h&&g===`start`&&c(t,{className:`inline-block mr-1.5`,svg:h}),d,h&&g===`end`&&c(t,{className:`inline-block ml-1.5`,svg:h})]})};function f(e){return Array.isArray(e)?[...new Set(e)].map(e=>e?.trim()).filter(Boolean).toSorted().join(` `)||void 0:e?.trim()||void 0}export{u as n,f as r,d as t};
package/dist/anchor.js CHANGED
@@ -1 +1 @@
1
- import{n as e,r as t,t as n}from"./anchor-DfeXTpKW.js";export{n as Anchor,e as anchorClassNames,t as resolveRel};
1
+ import{n as e,r as t,t as n}from"./anchor-3OGK2UKU.js";export{n as Anchor,e as anchorClassNames,t as resolveRel};