@ngrok/mantle 0.82.1 → 0.83.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 (138) hide show
  1. package/dist/accordion.d.ts +7 -7
  2. package/dist/agent.json +3 -1
  3. package/dist/{alert-BWwNPOMI.d.ts → alert-B1HXfkYn.d.ts} +9 -7
  4. package/dist/{alert-vwFd7qdp.js → alert-BuG2qS5l.js} +1 -1
  5. package/dist/alert-center.d.ts +3 -3
  6. package/dist/alert-center.js +1 -1
  7. package/dist/alert-dialog.d.ts +18 -18
  8. package/dist/alert.d.ts +1 -1
  9. package/dist/alert.js +1 -1
  10. package/dist/anchor.d.ts +2 -2
  11. package/dist/app-layout.js +1 -1
  12. package/dist/area-chart.d.ts +67 -19
  13. package/dist/area-chart.js +1 -1
  14. package/dist/avatar.d.ts +319 -0
  15. package/dist/avatar.js +1 -0
  16. package/dist/bar-chart.d.ts +73 -20
  17. package/dist/bar-chart.js +1 -1
  18. package/dist/breadcrumb.d.ts +50 -17
  19. package/dist/breadcrumb.js +1 -1
  20. package/dist/browser-only.d.ts +3 -3
  21. package/dist/{button-C-gMbPso.d.ts → button-BIf69CSV.d.ts} +2 -2
  22. package/dist/button-BLDjW1u9.js +1 -0
  23. package/dist/{button-IlxHhjPK.js → button-CCkGqE1t.js} +1 -1
  24. package/dist/{button-C7vAl6lS.d.ts → button-DJ7AAgII.d.ts} +4 -6
  25. package/dist/{button-DARFK2KJ.d.ts → button-PoIujPMX.d.ts} +2 -2
  26. package/dist/button.d.ts +3 -3
  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.d.ts +15 -15
  31. package/dist/{chart-1cVjAcj8.d.ts → chart-0zcFJh4n.d.ts} +75 -22
  32. package/dist/chart-DBxT9BNl.js +2 -0
  33. package/dist/{choice-BNRQXszu.d.ts → choice-CVdQrs-m.d.ts} +118 -6
  34. package/dist/choice.d.ts +1 -1
  35. package/dist/{code-block-C9uaM9-V.js → code-block-CIE0F2fu.js} +1 -1
  36. package/dist/{code-block-B6OlZrSI.d.ts → code-block-CZWPrV4k.d.ts} +3 -3
  37. package/dist/code-block.d.ts +10 -7
  38. package/dist/code-block.js +2 -2
  39. package/dist/code-block_highlight-utils.d.ts +1 -1
  40. package/dist/code-block_highlight-utils.js +1 -1
  41. package/dist/combobox.d.ts +8 -9
  42. package/dist/command.d.ts +668 -106
  43. package/dist/command.js +1 -1
  44. package/dist/data-table.d.ts +6 -6
  45. package/dist/data-table.js +1 -1
  46. package/dist/dialog-32Hq6w6P.js +1 -0
  47. package/dist/dialog-B6h1BCDL.d.ts +895 -0
  48. package/dist/dialog.d.ts +2 -805
  49. package/dist/dialog.js +1 -1
  50. package/dist/dropdown-menu-BcALUQMp.d.ts +1 -0
  51. package/dist/{dropdown-menu-D6pMAY7I.d.ts → dropdown-menu-DZOfj6HB.d.ts} +1 -1
  52. package/dist/dropdown-menu.d.ts +2 -2
  53. package/dist/field.d.ts +5 -5
  54. package/dist/field.js +1 -1
  55. package/dist/flag.js +1 -1
  56. package/dist/hooks.d.ts +16 -17
  57. package/dist/hooks.js +1 -1
  58. package/dist/icons-DEVx1oP9.js +1 -0
  59. package/dist/icons.d.ts +7 -6
  60. package/dist/icons.js +1 -1
  61. package/dist/{in-view-DDEGUKDR.d.ts → in-view-gxyc9Q1_.d.ts} +1 -1
  62. package/dist/{input-BuYDU6CF.d.ts → input-DpnC3Xgj.d.ts} +2 -2
  63. package/dist/input.d.ts +1 -1
  64. package/dist/kbd.d.ts +1 -1
  65. package/dist/line-chart.d.ts +60 -13
  66. package/dist/line-chart.js +1 -1
  67. package/dist/list-CwL23L_B.js +1 -0
  68. package/dist/list.d.ts +2 -2
  69. package/dist/list.js +1 -1
  70. package/dist/llms.txt +3 -1
  71. package/dist/mantle-dark-high-contrast.css +30 -17
  72. package/dist/mantle-dark.css +48 -13
  73. package/dist/mantle-light-high-contrast.css +33 -15
  74. package/dist/mantle.css +436 -26
  75. package/dist/media-object.d.ts +5 -1
  76. package/dist/multi-select.d.ts +7 -7
  77. package/dist/multi-select.js +1 -1
  78. package/dist/otp-input.d.ts +4 -4
  79. package/dist/otp-input.js +1 -1
  80. package/dist/pagination.d.ts +2 -2
  81. package/dist/pagination.js +1 -1
  82. package/dist/progress.d.ts +4 -4
  83. package/dist/qr-code.d.ts +2 -2
  84. package/dist/sandbar.d.ts +471 -0
  85. package/dist/sandbar.js +1 -0
  86. package/dist/sandboxed-on-click.d.ts +4 -6
  87. package/dist/scatter-plot.d.ts +69 -24
  88. package/dist/scatter-plot.js +1 -1
  89. package/dist/{select-0z7HVS6r.d.ts → select-DVHmgih8.d.ts} +13 -7
  90. package/dist/select-LK9NX-vV.js +1 -0
  91. package/dist/select.d.ts +1 -1
  92. package/dist/select.js +1 -1
  93. package/dist/selectable-list.d.ts +4 -4
  94. package/dist/selectable-list.js +1 -1
  95. package/dist/{separator-B5UmkVRL.d.ts → separator-CNDs98Dv.d.ts} +2 -2
  96. package/dist/separator.d.ts +1 -1
  97. package/dist/{sheet-BxvTfPLM.js → sheet-BOSknSN9.js} +1 -1
  98. package/dist/sheet.d.ts +1 -1
  99. package/dist/sheet.js +1 -1
  100. package/dist/sidebar.d.ts +347 -366
  101. package/dist/sidebar.js +1 -1
  102. package/dist/slider.d.ts +1 -1
  103. package/dist/split-button.d.ts +12 -12
  104. package/dist/split-button.js +1 -1
  105. package/dist/switch.d.ts +2 -1
  106. package/dist/{table-CGxJwtbL.js → table-C_Nm_RSV.js} +1 -1
  107. package/dist/{table-CZBYEmyK.d.ts → table-D51ZtV4U.d.ts} +18 -8
  108. package/dist/table.d.ts +1 -1
  109. package/dist/table.js +1 -1
  110. package/dist/tabs.d.ts +8 -13
  111. package/dist/tabs.js +1 -1
  112. package/dist/{theme-FbfjYiD3.d.ts → theme-6OxNhf6l.d.ts} +6 -6
  113. package/dist/theme-CVfq037P.js +1 -0
  114. package/dist/theme-switcher.d.ts +3 -3
  115. package/dist/theme-switcher.js +1 -1
  116. package/dist/theme.d.ts +86 -23
  117. package/dist/theme.js +1 -1
  118. package/dist/toast.d.ts +9 -9
  119. package/dist/toast.js +1 -1
  120. package/dist/{tooltip-mrpLz4DZ.d.ts → tooltip-DuXGxIse.d.ts} +6 -4
  121. package/dist/tooltip.d.ts +1 -1
  122. package/dist/use-breakpoint-Dqu12Szq.js +1 -0
  123. package/dist/use-callback-ref-IYti9y7x.js +1 -0
  124. package/dist/use-is-apple-platform-Cxwrb86L.js +1 -0
  125. package/dist/use-matches-media-query-Bd_GhhVd.js +1 -0
  126. package/dist/utils.d.ts +1 -1
  127. package/package.json +5 -3
  128. package/dist/button-DvHMWAPl.js +0 -1
  129. package/dist/chart-B3pAvmkk.js +0 -2
  130. package/dist/dialog-DozL6n-F.js +0 -1
  131. package/dist/dropdown-menu-BbbQuae2.d.ts +0 -1
  132. package/dist/icons-Bb_zF2OV.js +0 -1
  133. package/dist/list-CJABVHwi.js +0 -1
  134. package/dist/platform-BVD3gpKD.js +0 -1
  135. package/dist/select-BReznXaw.js +0 -1
  136. package/dist/theme-BorfgnNh.js +0 -1
  137. package/dist/use-breakpoint-Wd7_5-Mu.js +0 -1
  138. package/dist/use-matches-media-query-CMSxHR9n.js +0 -1
@@ -59,7 +59,7 @@ type AccordionMultipleProps = {
59
59
  type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit<ComponentProps<"div">, "defaultValue"> & WithAsChild;
60
60
  /**
61
61
  * A vertically stacked set of disclosure sections. The root owns the open/closed
62
- * state and provides it to its items.
62
+ * state and passes it to its items.
63
63
  *
64
64
  * Built without a UI framework's collapsible: each section's collapsed content
65
65
  * stays in the DOM with `hidden="until-found"`, so the browser's find-in-page
@@ -73,10 +73,10 @@ type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit
73
73
  * the classic accordion where opening a section auto-closes the previously open
74
74
  * one.
75
75
  *
76
- * Items are separated by a hairline divider drawn with `divide-y` on the root,
77
- * colored with the shared `separator` token so it matches `Separator` and every
78
- * other divider in the system. Disable the dividers with `divide-y-0` on the root
79
- * (e.g. pair it with `space-y-*` for a spaced-card layout).
76
+ * `divide-y` on the root draws a hairline divider between items. The shared
77
+ * `separator` token colors it, so it matches `Separator` and every other divider
78
+ * in the system. Disable the dividers with `divide-y-0` on the root (e.g. pair it
79
+ * with `space-y-*` for a spaced-card layout).
80
80
  *
81
81
  * @see https://mantle.ngrok.com/components/data-display/accordion#accordionroot
82
82
  *
@@ -99,7 +99,7 @@ declare const Root: (props: AccordionRootProps) => import("react").JSX.Element;
99
99
  * same accessibility role the browser gives a native `<details>`. Derives its
100
100
  * open state from {@link Root}.
101
101
  *
102
- * Because the item is just a `<div>`, its header can be any layout — e.g. a flex
102
+ * Because the item is a plain `<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
105
  * @see https://mantle.ngrok.com/components/data-display/accordion#accordionitem
@@ -123,7 +123,7 @@ declare const Item: ({ children, value, ref, ...props }: ComponentProps<"div"> &
123
123
  }) => import("react").JSX.Element;
124
124
  /**
125
125
  * The interactive header that toggles its section, rendered as a `<button>` with
126
- * `aria-expanded` — the disclosure semantics a native `<summary>` provides, but
126
+ * `aria-expanded` — the disclosure semantics a native `<summary>` carries, but
127
127
  * via a real button so the role is consistent across browsers (native summary's
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.
package/dist/agent.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.82.1",
3
+ "version": "0.83.1",
4
4
  "origin": "https://mantle.ngrok.com",
5
5
  "endpoints": {
6
6
  "docs": "https://mantle.ngrok.com/",
@@ -23,6 +23,7 @@
23
23
  "@ngrok/mantle/anchor",
24
24
  "@ngrok/mantle/app-layout",
25
25
  "@ngrok/mantle/area-chart",
26
+ "@ngrok/mantle/avatar",
26
27
  "@ngrok/mantle/badge",
27
28
  "@ngrok/mantle/bar-chart",
28
29
  "@ngrok/mantle/breadcrumb",
@@ -65,6 +66,7 @@
65
66
  "@ngrok/mantle/progress",
66
67
  "@ngrok/mantle/qr-code",
67
68
  "@ngrok/mantle/radio-group",
69
+ "@ngrok/mantle/sandbar",
68
70
  "@ngrok/mantle/sandboxed-on-click",
69
71
  "@ngrok/mantle/scatter-plot",
70
72
  "@ngrok/mantle/select",
@@ -1,7 +1,7 @@
1
1
  import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
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";
3
+ import { r as ButtonProps } from "./button-PoIujPMX.js";
4
+ import { n as IconButtonProps, r as IconButtonAppearance } from "./button-DJ7AAgII.js";
5
5
  import { ComponentProps, ReactNode } from "react";
6
6
  //#region src/components/alert/alert.d.ts
7
7
  declare const intents: readonly ["danger", "important", "info", "success", "warning"];
@@ -16,7 +16,7 @@ type AlertProps = ComponentProps<"div"> & {
16
16
  intent: AlertIntent;
17
17
  /**
18
18
  * Controls the visual style of the Alert.
19
- * - "default" provides standard rounded corners and borders.
19
+ * - "default" keeps the standard rounded corners and borders.
20
20
  * - "banner" creates a banner-style alert with no rounded corners, sticky positioning, and no left/right borders.
21
21
  *
22
22
  * @default "default"
@@ -59,9 +59,9 @@ type AlertIconProps = Omit<SvgAttributes, "children"> & {
59
59
  svg?: ReactNode;
60
60
  };
61
61
  /**
62
- * An optional icon that visually represents the intent of the Alert.
62
+ * An optional icon that visually represents the intent of the `Alert`.
63
63
  *
64
- * The default rendered icon be overridden with a custom icon using the `svg` prop.
64
+ * Pass the `svg` prop to replace the default icon.
65
65
  *
66
66
  * @see https://mantle.ngrok.com/components/feedback/alert#alerticon
67
67
  *
@@ -327,7 +327,7 @@ declare const Alert: {
327
327
  */
328
328
  readonly Description: typeof Description;
329
329
  /**
330
- * An optional dismiss button that can be used to close the alert.
330
+ * An optional, compact, trailing control for dismissing an alert.
331
331
  * It inherits the `--alert-control-color`, `--alert-control-hover-color`, and
332
332
  * `--alert-control-hover-bg` variables from `Alert.Root`, shared with the
333
333
  * expand control.
@@ -349,7 +349,9 @@ declare const Alert: {
349
349
  */
350
350
  readonly DismissIconButton: typeof DismissIconButton;
351
351
  /**
352
- * An optional icon that visually represents the intent of the Alert.
352
+ * An optional icon that visually represents the intent of the `Alert`.
353
+ *
354
+ * Pass the `svg` prop to replace the default icon.
353
355
  *
354
356
  * @see https://mantle.ngrok.com/components/feedback/alert#alerticon
355
357
  *
@@ -1 +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};
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-CCkGqE1t.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};
@@ -1,5 +1,5 @@
1
1
  import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
2
- import { t as Alert } from "./alert-BWwNPOMI.js";
2
+ import { t as Alert } from "./alert-B1HXfkYn.js";
3
3
  import { ComponentProps, ReactNode } from "react";
4
4
  //#region src/components/alert-center/alert-center.d.ts
5
5
  /**
@@ -130,7 +130,7 @@ type AlertCenterItemProps = {
130
130
  /**
131
131
  * The banner content: compose `Alert.Icon`, `Alert.Content`, `Alert.Title`,
132
132
  * `Alert.Description`, and `AlertCenter.DismissIconButton`. Do NOT include
133
- * `Alert.Root` — the center provides the chrome (with this item's `intent`)
133
+ * `Alert.Root` — the center renders the chrome (with this item's `intent`)
134
134
  * at whichever placement the item ranks into.
135
135
  */
136
136
  children: ReactNode;
@@ -140,7 +140,7 @@ type AlertCenterItemProps = {
140
140
  * with the center and renders its children through a portal into a stable
141
141
  * per-id host element that `AlertCenter.Bar` / `AlertCenter.Content`
142
142
  * physically adopt into their chrome. Mount it to show the alert, unmount it
143
- * to remove it — dismissal is just your state flipping the condition off.
143
+ * to remove it — dismissal is your state flipping the condition off.
144
144
  *
145
145
  * Because the children stay in YOUR React tree (only their DOM lands in the
146
146
  * chrome), context providers and error boundaries around the item work, and
@@ -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"./data-slot-EM6s2WEU.js";import{n as i,t as a}from"./alert-vwFd7qdp.js";import{createContext as o,useCallback as s,useContext as c,useEffect as l,useId as u,useMemo as d,useReducer as f,useRef as p,useState as m,useSyncExternalStore as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{createPortal as y}from"react-dom";const b={danger:5,warning:4,important:3,info:2,success:1};function x(e,t){if(t.parentElement===e)return!1;if(typeof e.moveBefore==`function`&&t.isConnected&&e.isConnected)try{return e.moveBefore(t,null),!0}catch{}return e.appendChild(t),!0}function S(e){return e.replace(/\s+/g,` `).trim()}function C(e){let t=e.querySelector(`[data-slot="alert-title"]`);if(t==null)return``;let n=t.cloneNode(!0);if(!(n instanceof Element))return S(t.textContent??``);for(let e of n.querySelectorAll(`button`))e.remove();let r=S(n.textContent??``);for(let e of n.querySelectorAll(`a`))e.remove();let i=S(n.textContent??``);return i===``?r:i}function w(e){return e.toSorted((e,t)=>b[t.intent]-b[e.intent]||e.sequence-t.sequence)}function T(e,t){if(t===0)return``;if(e===``)return`${t} alert${t===1?``:`s`}`;let n=t-1;return n===0?e:`${e}, and ${n} more alert${n===1?``:`s`}`}const E=[];var D=class{#e=new Set;#t=new Map;#n=new Map;#r=new Map;#i=0;#a=E;#o=``;#s=!1;getHost(e){let t=this.#r.get(e);if(t!=null)return t;let n=document.createElement(`div`);return n.style.display=`contents`,n.setAttribute(`data-slot`,`alert-center-item-host`),n.setAttribute(`data-alert-host`,e),this.#r.set(e,n),n}#c=null;captureHostSnapshot(e){if(e!==this.#a[0]?.id)return;let t=this.#r.get(e);t!=null&&t.hasChildNodes()&&(this.#c={id:e,content:t.cloneNode(!0)})}getHostSnapshot=e=>this.#c?.id===e?this.#c.content:null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#a;hasAlert=e=>this.#t.has(e);getTopLabel=()=>this.#o;setTopLabel(e){this.#o!==e&&(this.#o=e,this.#p())}#l=null;requestFocusRestore(e){this.#l=e}flushFocusRestore(){let e=this.#l;e==null||!e.isConnected||(this.#l=null,document.activeElement!==e&&e.focus({preventScroll:!0}))}#u=null;#d=0;getPlacementVersion=()=>this.#d;notifyPlacementChange(){this.#d++,this.#p()}setBarElement(e){this.#u=e}getBarElement=()=>this.#u;getContentMounted=()=>this.#s;setContentMounted(e){this.#s!==e&&(this.#s=e,this.#p())}register(e){g(!this.#t.has(e.id),`AlertCenter.Item id "${e.id}" is already registered by another mounted item — ids must be unique under one <AlertCenter.Root>. Render one item per id, or give each alert its own id.`);let t=this.#n.get(e.id)??this.#i++;this.#n.set(e.id,t);let n={...e,sequence:t};return this.#t.set(e.id,n),this.#f(),()=>{this.#t.get(e.id)===n&&(this.#t.delete(e.id),this.#f())}}#f(){this.#a=w([...this.#t.values()]),this.#p()}#p(){for(let e of this.#e)e()}};const O=o(null),k=o(null);function A(e){let t=c(O);return g(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}function j(e){let t=c(k);return g(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}const M=e=>h(e.subscribe,e.getSnapshot,e.getSnapshot),N=o(!1);function P({store:e}){let t=M(e);return _(`div`,{"data-slot":`alert-center-announcer`,className:`sr-only`,role:`status`,"aria-live":`polite`,children:T(h(e.subscribe,e.getTopLabel,e.getTopLabel),t.length)})}const F=({children:e,defaultOpen:t,onOpenChange:n,open:r})=>{let[i]=m(()=>new D),a=u(),[o,c]=m(t??!1),l=r??o,f=s(e=>{r??c(e),n?.(e)},[r,n]),p=d(()=>({store:i,contentId:a}),[i,a]),h=d(()=>({isExpanded:l,setExpanded:f}),[l,f]);return v(O.Provider,{value:p,children:[_(k.Provider,{value:h,children:e}),_(P,{store:i})]})},I=({children:t,className:n,id:r,intent:a})=>{let{store:o}=A(`AlertCenter.Item`);g(!c(N),`AlertCenter.Item cannot be rendered inside another item's children.`);let[s,l]=m(null);return e(()=>{l(o.getHost(r))},[o,r]),e(()=>o.register({id:r,intent:a,className:n}),[o,r,a,n]),e(()=>{o.captureHostSnapshot(r)}),s==null?null:y(_(i,{intent:a,children:_(N.Provider,{value:!0,children:t})}),s)},L=({"data-slot":n,label:i,ref:o,...s})=>{g(c(N),`AlertCenter.DismissIconButton must be composed inside an <AlertCenter.Item>'s children.`);let{store:l}=A(`AlertCenter.DismissIconButton`);h(l.subscribe,l.getPlacementVersion,l.getPlacementVersion);let u=p(null),d=t(u,o),[f,v]=m(null);return e(()=>{if(i!=null)return;let e=u.current?.closest(`[data-alert-id]`),t=e==null?``:C(e);v(t===``?null:`Dismiss ${t}`)}),_(a.DismissIconButton,{ref:d,label:i??f??void 0,...s,"data-slot":r(n,`alert-center-dismiss-icon-button`)})};function R(e,t){switch(t){case`show`:return`open`;case`hide`:return e===`closed`?`closed`:`closing`;case`exited`:return e===`closing`?`closed`:e}}function z({present:t}){let[n,r]=f(R,t?`open`:`closed`);e(()=>{r(t?`show`:`hide`)},[t]),l(()=>{if(n!==`closing`)return;let e=window.setTimeout(()=>r(`exited`),200);return()=>window.clearTimeout(e)},[n]);let i=s(e=>{e.target===e.currentTarget&&e.propertyName===`height`&&r(`exited`)},[]);return{isMounted:n!==`closed`,dataState:n===`open`?`open`:`closed`,onExitTransitionEnd:i}}function B({containerRef:t,isAttached:n}){let r=p(null);return e(()=>{let e=t.current;if(!n||e==null)return;let i=e=>{e.target instanceof Element&&(r.current=e.target)},a=t=>{t.relatedTarget instanceof Node&&!e.contains(t.relatedTarget)&&(r.current=null)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[t,n]),{lastFocusedWithinRef:r}}function V(){let e=document.querySelector(`main, [role="main"]`);e!=null&&(e.hasAttribute(`tabindex`)||(e.tabIndex=-1),e.focus({preventScroll:!0}))}function H({isMounted:t,store:n,topId:r}){let i=p(null),{lastFocusedWithinRef:a}=B({containerRef:i,isAttached:t}),o=p(r);return e(()=>{let e=o.current;if(o.current=r,e==null||r===e)return;let t=a.current;if(n.hasAlert(e)){t instanceof HTMLElement&&document.activeElement!==t&&n.requestFocusRestore(t);return}if(t==null||t.isConnected)return;a.current=null;let s=i.current;if(r==null){V();return}s!=null&&(s.querySelector(`[data-alert-dismiss], [data-alert-expand]`)??s).focus()},[n,r]),{wrapperRef:i}}const U=`gap-2 py-2 pr-2 [&_[data-slot=alert-icon]]:shrink-0`,W={Root:F,Bar:({className:t,"data-slot":i,ref:o,...s})=>{let{store:c,contentId:l}=A(`AlertCenter.Bar`),{isExpanded:u,setExpanded:d}=j(`AlertCenter.Bar`),f=M(c),m=h(c.subscribe,c.getContentMounted,c.getContentMounted),g=f[0]??null,y=g!=null,{isMounted:b,dataState:S,onExitTransitionEnd:w}=z({present:y}),T=p(g);e(()=>{g!=null&&(T.current=g)},[g]);let E=g??T.current,D=p(null);e(()=>{let e=D.current;if(e==null)return;if(g!=null){let t=c.getHost(g.id);t.parentElement!==e&&e.childNodes.length>0&&e.replaceChildren(),x(e,t)&&c.notifyPlacementChange(),c.flushFocusRestore();return}let t=E==null?null:c.getHostSnapshot(E.id);t!=null&&t.parentNode!==e&&e.replaceChildren(t)});let{wrapperRef:O}=H({isMounted:b,store:c,topId:g?.id});if(e(()=>{let e=O.current;c.setTopLabel(y&&e!=null?C(e):``)}),e(()=>{let e=O.current;if(e==null)return;let t=new MutationObserver(()=>{c.setTopLabel(y?C(e):``)});return t.observe(e,{subtree:!0,childList:!0,characterData:!0}),()=>{t.disconnect()}},[c,y,b]),e(()=>()=>{c.setTopLabel(``)},[c]),e(()=>{c.setBarElement(O.current)}),e(()=>()=>{c.setBarElement(null)},[c]),!b||E==null)return null;let k=y?f.length-1:0;return _(`div`,{ref:O,"data-slot":`alert-center-bar-wrapper`,tabIndex:-1,inert:!y,className:`shrink-0 overflow-hidden transition-[height,opacity] duration-200 ease-out [interpolate-size:allow-keywords] starting:h-0 starting:opacity-0 data-state-closed:h-0 data-state-closed:opacity-0 data-state-closed:duration-150 motion-reduce:transition-none`,"data-state":S,onTransitionEnd:w,children:v(a.Root,{ref:o,appearance:`banner`,intent:E.intent,className:n(U,`not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:top-1/2 not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:-translate-y-1/2`,`has-data-alert-expand:[&_[data-alert-dismiss]]:right-16 md:has-data-alert-expand:[&_[data-alert-dismiss]]:right-24`,t,E.className),...s,"data-slot":r(i,`alert-center-bar`),"data-placement":`bar`,"data-alert-id":E.id,children:[_(`div`,{ref:D,className:`contents`,"data-slot":`alert-center-bar-mount`}),k>0&&m&&_(a.ExpandButton,{count:k,expanded:u,"aria-controls":l,onClick:()=>d(!u)})]})})},Content:({"aria-label":i=`More alerts`,"aria-labelledby":o,className:s,"data-slot":c,ref:l,...u})=>{let{store:d,contentId:f}=A(`AlertCenter.Content`),{isExpanded:m,setExpanded:h}=j(`AlertCenter.Content`),g=M(d).slice(1),v=g.length>0;e(()=>(d.setContentMounted(!0),()=>{d.setContentMounted(!1)}),[d]);let y=p(v);e(()=>{let e=y.current&&!v;y.current=v,e&&m&&h(!1)},[v,m,h]);let b=p(null),S=t(b,l),{lastFocusedWithinRef:C}=B({containerRef:b,isAttached:v}),w=g.map(e=>e.id).join(` `);return e(()=>{let e=b.current;if(e==null)return;let t=!1;for(let n of e.querySelectorAll(`[data-alert-mount]`)){let e=n.getAttribute(`data-alert-mount`);e!=null&&x(n,d.getHost(e))&&(t=!0)}t&&d.notifyPlacementChange(),d.flushFocusRestore()},[d,w]),e(()=>{let e=C.current;if(e==null)return;if(e.isConnected){let t=b.current;e instanceof HTMLElement&&document.activeElement!==e&&(t==null||!t.contains(e))&&(C.current=null,e.focus({preventScroll:!0}));return}C.current=null;let t=b.current?.querySelector(`[data-alert-dismiss]`);if(t!=null){t.focus();return}let n=d.getBarElement()?.querySelector(`[data-alert-dismiss], [data-alert-expand]`);if(n!=null){n.focus();return}V()},[d,w]),g.length===0?null:_(`div`,{...u,ref:S,"data-slot":r(c,`alert-center-content`),id:f,"data-state":m?`open`:`closed`,className:n(`h-0 overflow-hidden invisible [content-visibility:hidden] transition-[height,visibility,content-visibility] transition-discrete duration-200 ease-out [interpolate-size:allow-keywords] data-state-open:h-auto data-state-open:visible data-state-open:[content-visibility:visible] motion-reduce:transition-none`,s),children:_(`ul`,{"aria-label":o==null?i:void 0,"aria-labelledby":o,className:`flex w-full flex-col`,children:g.map(e=>_(`li`,{children:_(a.Root,{appearance:`banner`,intent:e.intent,className:n(U,e.className),"data-slot":`alert-center-item`,"data-placement":`list`,"data-alert-id":e.id,children:_(`div`,{className:`contents`,"data-alert-mount":e.id})})},e.id))})})},Item:I,DismissIconButton:L};export{W as AlertCenter};
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"./data-slot-EM6s2WEU.js";import{n as i,t as a}from"./alert-BuG2qS5l.js";import{createContext as o,useCallback as s,useContext as c,useEffect as l,useId as u,useMemo as d,useReducer as f,useRef as p,useState as m,useSyncExternalStore as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{createPortal as y}from"react-dom";const b={danger:5,warning:4,important:3,info:2,success:1};function x(e,t){if(t.parentElement===e)return!1;if(typeof e.moveBefore==`function`&&t.isConnected&&e.isConnected)try{return e.moveBefore(t,null),!0}catch{}return e.appendChild(t),!0}function S(e){return e.replace(/\s+/g,` `).trim()}function C(e){let t=e.querySelector(`[data-slot="alert-title"]`);if(t==null)return``;let n=t.cloneNode(!0);if(!(n instanceof Element))return S(t.textContent??``);for(let e of n.querySelectorAll(`button`))e.remove();let r=S(n.textContent??``);for(let e of n.querySelectorAll(`a`))e.remove();let i=S(n.textContent??``);return i===``?r:i}function w(e){return e.toSorted((e,t)=>b[t.intent]-b[e.intent]||e.sequence-t.sequence)}function T(e,t){if(t===0)return``;if(e===``)return`${t} alert${t===1?``:`s`}`;let n=t-1;return n===0?e:`${e}, and ${n} more alert${n===1?``:`s`}`}const E=[];var D=class{#e=new Set;#t=new Map;#n=new Map;#r=new Map;#i=0;#a=E;#o=``;#s=!1;getHost(e){let t=this.#r.get(e);if(t!=null)return t;let n=document.createElement(`div`);return n.style.display=`contents`,n.setAttribute(`data-slot`,`alert-center-item-host`),n.setAttribute(`data-alert-host`,e),this.#r.set(e,n),n}#c=null;captureHostSnapshot(e){if(e!==this.#a[0]?.id)return;let t=this.#r.get(e);t!=null&&t.hasChildNodes()&&(this.#c={id:e,content:t.cloneNode(!0)})}getHostSnapshot=e=>this.#c?.id===e?this.#c.content:null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#a;hasAlert=e=>this.#t.has(e);getTopLabel=()=>this.#o;setTopLabel(e){this.#o!==e&&(this.#o=e,this.#p())}#l=null;requestFocusRestore(e){this.#l=e}flushFocusRestore(){let e=this.#l;e==null||!e.isConnected||(this.#l=null,document.activeElement!==e&&e.focus({preventScroll:!0}))}#u=null;#d=0;getPlacementVersion=()=>this.#d;notifyPlacementChange(){this.#d++,this.#p()}setBarElement(e){this.#u=e}getBarElement=()=>this.#u;getContentMounted=()=>this.#s;setContentMounted(e){this.#s!==e&&(this.#s=e,this.#p())}register(e){g(!this.#t.has(e.id),`AlertCenter.Item id "${e.id}" is already registered by another mounted item — ids must be unique under one <AlertCenter.Root>. Render one item per id, or give each alert its own id.`);let t=this.#n.get(e.id)??this.#i++;this.#n.set(e.id,t);let n={...e,sequence:t};return this.#t.set(e.id,n),this.#f(),()=>{this.#t.get(e.id)===n&&(this.#t.delete(e.id),this.#f())}}#f(){this.#a=w([...this.#t.values()]),this.#p()}#p(){for(let e of this.#e)e()}};const O=o(null),k=o(null);function A(e){let t=c(O);return g(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}function j(e){let t=c(k);return g(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}const M=e=>h(e.subscribe,e.getSnapshot,e.getSnapshot),N=o(!1);function P({store:e}){let t=M(e),n=h(e.subscribe,e.getTopLabel,e.getTopLabel);return _(`div`,{"data-slot":`alert-center-announcer`,className:`sr-only`,role:`status`,"aria-live":`polite`,children:T(n,t.length)})}const F=({children:e,defaultOpen:t,onOpenChange:n,open:r})=>{let[i]=m(()=>new D),a=u(),[o,c]=m(t??!1),l=r??o,f=s(e=>{r??c(e),n?.(e)},[r,n]),p=d(()=>({store:i,contentId:a}),[i,a]),h=d(()=>({isExpanded:l,setExpanded:f}),[l,f]);return v(O.Provider,{value:p,children:[_(k.Provider,{value:h,children:e}),_(P,{store:i})]})},I=({children:t,className:n,id:r,intent:a})=>{let{store:o}=A(`AlertCenter.Item`),s=c(N);g(!s,`AlertCenter.Item cannot be rendered inside another item's children.`);let[l,u]=m(null);return e(()=>{u(o.getHost(r))},[o,r]),e(()=>o.register({id:r,intent:a,className:n}),[o,r,a,n]),e(()=>{o.captureHostSnapshot(r)}),l==null?null:y(_(i,{intent:a,children:_(N.Provider,{value:!0,children:t})}),l)},L=({"data-slot":n,label:i,ref:o,...s})=>{let l=c(N);g(l,`AlertCenter.DismissIconButton must be composed inside an <AlertCenter.Item>'s children.`);let{store:u}=A(`AlertCenter.DismissIconButton`);h(u.subscribe,u.getPlacementVersion,u.getPlacementVersion);let d=p(null),f=t(d,o),[v,y]=m(null);return e(()=>{if(i!=null)return;let e=d.current?.closest(`[data-alert-id]`),t=e==null?``:C(e);y(t===``?null:`Dismiss ${t}`)}),_(a.DismissIconButton,{ref:f,label:i??v??void 0,...s,"data-slot":r(n,`alert-center-dismiss-icon-button`)})};function R(e,t){switch(t){case`show`:return`open`;case`hide`:return e===`closed`?`closed`:`closing`;case`exited`:return e===`closing`?`closed`:e}}function z({present:t}){let[n,r]=f(R,t?`open`:`closed`);e(()=>{r(t?`show`:`hide`)},[t]),l(()=>{if(n!==`closing`)return;let e=window.setTimeout(()=>r(`exited`),200);return()=>window.clearTimeout(e)},[n]);let i=s(e=>{e.target===e.currentTarget&&e.propertyName===`height`&&r(`exited`)},[]);return{isMounted:n!==`closed`,dataState:n===`open`?`open`:`closed`,onExitTransitionEnd:i}}function B({containerRef:t,isAttached:n}){let r=p(null);return e(()=>{let e=t.current;if(!n||e==null)return;let i=e=>{e.target instanceof Element&&(r.current=e.target)},a=t=>{t.relatedTarget instanceof Node&&!e.contains(t.relatedTarget)&&(r.current=null)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[t,n]),{lastFocusedWithinRef:r}}function V(){let e=document.querySelector(`main, [role="main"]`);e!=null&&(e.hasAttribute(`tabindex`)||(e.tabIndex=-1),e.focus({preventScroll:!0}))}function H({isMounted:t,store:n,topId:r}){let i=p(null),{lastFocusedWithinRef:a}=B({containerRef:i,isAttached:t}),o=p(r);return e(()=>{let e=o.current;if(o.current=r,e==null||r===e)return;let t=a.current;if(n.hasAlert(e)){t instanceof HTMLElement&&document.activeElement!==t&&n.requestFocusRestore(t);return}if(t==null||t.isConnected)return;a.current=null;let s=i.current;if(r==null){V();return}s!=null&&(s.querySelector(`[data-alert-dismiss], [data-alert-expand]`)??s).focus()},[n,r]),{wrapperRef:i}}const U=`gap-2 py-2 pr-2 [&_[data-slot=alert-icon]]:shrink-0`,W={Root:F,Bar:({className:t,"data-slot":i,ref:o,...s})=>{let{store:c,contentId:l}=A(`AlertCenter.Bar`),{isExpanded:u,setExpanded:d}=j(`AlertCenter.Bar`),f=M(c),m=h(c.subscribe,c.getContentMounted,c.getContentMounted),g=f[0]??null,y=g!=null,{isMounted:b,dataState:S,onExitTransitionEnd:w}=z({present:y}),T=p(g);e(()=>{g!=null&&(T.current=g)},[g]);let E=g??T.current,D=p(null);e(()=>{let e=D.current;if(e==null)return;if(g!=null){let t=c.getHost(g.id);t.parentElement!==e&&e.childNodes.length>0&&e.replaceChildren(),x(e,t)&&c.notifyPlacementChange(),c.flushFocusRestore();return}let t=E==null?null:c.getHostSnapshot(E.id);t!=null&&t.parentNode!==e&&e.replaceChildren(t)});let{wrapperRef:O}=H({isMounted:b,store:c,topId:g?.id});if(e(()=>{let e=O.current;c.setTopLabel(y&&e!=null?C(e):``)}),e(()=>{let e=O.current;if(e==null)return;let t=new MutationObserver(()=>{c.setTopLabel(y?C(e):``)});return t.observe(e,{subtree:!0,childList:!0,characterData:!0}),()=>{t.disconnect()}},[c,y,b]),e(()=>()=>{c.setTopLabel(``)},[c]),e(()=>{c.setBarElement(O.current)}),e(()=>()=>{c.setBarElement(null)},[c]),!b||E==null)return null;let k=y?f.length-1:0;return _(`div`,{ref:O,"data-slot":`alert-center-bar-wrapper`,tabIndex:-1,inert:!y,className:`shrink-0 overflow-hidden transition-[height,opacity] duration-200 ease-out [interpolate-size:allow-keywords] starting:h-0 starting:opacity-0 data-state-closed:h-0 data-state-closed:opacity-0 data-state-closed:duration-150 motion-reduce:transition-none`,"data-state":S,onTransitionEnd:w,children:v(a.Root,{ref:o,appearance:`banner`,intent:E.intent,className:n(U,`not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:top-1/2 not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:-translate-y-1/2`,`has-data-alert-expand:[&_[data-alert-dismiss]]:right-16 md:has-data-alert-expand:[&_[data-alert-dismiss]]:right-24`,t,E.className),...s,"data-slot":r(i,`alert-center-bar`),"data-placement":`bar`,"data-alert-id":E.id,children:[_(`div`,{ref:D,className:`contents`,"data-slot":`alert-center-bar-mount`}),k>0&&m&&_(a.ExpandButton,{count:k,expanded:u,"aria-controls":l,onClick:()=>d(!u)})]})})},Content:({"aria-label":i=`More alerts`,"aria-labelledby":o,className:s,"data-slot":c,ref:l,...u})=>{let{store:d,contentId:f}=A(`AlertCenter.Content`),{isExpanded:m,setExpanded:h}=j(`AlertCenter.Content`),g=M(d).slice(1),v=g.length>0;e(()=>(d.setContentMounted(!0),()=>{d.setContentMounted(!1)}),[d]);let y=p(v);e(()=>{let e=y.current&&!v;y.current=v,e&&m&&h(!1)},[v,m,h]);let b=p(null),S=t(b,l),{lastFocusedWithinRef:C}=B({containerRef:b,isAttached:v}),w=g.map(e=>e.id).join(` `);return e(()=>{let e=b.current;if(e==null)return;let t=!1;for(let n of e.querySelectorAll(`[data-alert-mount]`)){let e=n.getAttribute(`data-alert-mount`);e!=null&&x(n,d.getHost(e))&&(t=!0)}t&&d.notifyPlacementChange(),d.flushFocusRestore()},[d,w]),e(()=>{let e=C.current;if(e==null)return;if(e.isConnected){let t=b.current;e instanceof HTMLElement&&document.activeElement!==e&&(t==null||!t.contains(e))&&(C.current=null,e.focus({preventScroll:!0}));return}C.current=null;let t=b.current?.querySelector(`[data-alert-dismiss]`);if(t!=null){t.focus();return}let n=d.getBarElement()?.querySelector(`[data-alert-dismiss], [data-alert-expand]`);if(n!=null){n.focus();return}V()},[d,w]),g.length===0?null:_(`div`,{...u,ref:S,"data-slot":r(c,`alert-center-content`),id:f,"data-state":m?`open`:`closed`,className:n(`h-0 overflow-hidden invisible [content-visibility:hidden] transition-[height,visibility,content-visibility] transition-discrete duration-200 ease-out [interpolate-size:allow-keywords] data-state-open:h-auto data-state-open:visible data-state-open:[content-visibility:visible] motion-reduce:transition-none`,s),children:_(`ul`,{"aria-label":o==null?i:void 0,"aria-labelledby":o,className:`flex w-full flex-col`,children:g.map(e=>_(`li`,{children:_(a.Root,{appearance:`banner`,intent:e.intent,className:n(U,e.className),"data-slot":`alert-center-item`,"data-placement":`list`,"data-alert-id":e.id,children:_(`div`,{className:`contents`,"data-alert-mount":e.id})})},e.id))})})},Item:I,DismissIconButton:L};export{W as AlertCenter};
@@ -1,7 +1,7 @@
1
1
  import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
2
  import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
3
3
  import { t as ButtonIntent } from "./button-DdSKSj1c.js";
4
- import { n as ButtonAppearance, r as ButtonProps } from "./button-DARFK2KJ.js";
4
+ import { n as ButtonAppearance, r as ButtonProps } from "./button-PoIujPMX.js";
5
5
  import { a as Root$1, n as Content$1, o as Title$1, r as Description$1, s as Trigger$1, t as Close$1 } from "./dialog-BM4wPCft.js";
6
6
  import { ComponentProps, ReactNode } from "react";
7
7
  //#region src/components/alert-dialog/alert-dialog.d.ts
@@ -17,8 +17,8 @@ type AlertDialogProps = ComponentProps<typeof Root$1> & {
17
17
  };
18
18
  /**
19
19
  * A modal dialog that interrupts the user with important content and expects a
20
- * response.
21
- * The root stateful component for the Alert Dialog.
20
+ * response. Holds the open state and the `intent` that `AlertDialog.Icon` and
21
+ * `AlertDialog.Action` read.
22
22
  *
23
23
  * `AlertDialog` renders its floating layer at Tailwind `z-50`, Mantle's
24
24
  * shared floating z-index. When multiple shared layers are open, the most
@@ -257,7 +257,7 @@ declare const Footer: ({ asChild, className, ref, ...props }: ComponentProps<"di
257
257
  /**
258
258
  * An accessible name to be announced when the dialog is opened.
259
259
  *
260
- * Alternatively, you can provide `aria-label` or `aria-labelledby` to
260
+ * Alternatively, pass `aria-label` or `aria-labelledby` to
261
261
  * `AlertDialogContent` and exclude this component.
262
262
  *
263
263
  * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogtitle
@@ -298,7 +298,7 @@ declare const Title: ({ className, ref, ...props }: ComponentProps<typeof Title$
298
298
  * Renders as a `div` by default, but can be changed to any other element using
299
299
  * the `asChild` prop.
300
300
  *
301
- * Alternatively, you can provide `aria-describedby` to `AlertDialogContent` and
301
+ * Alternatively, pass `aria-describedby` to `AlertDialogContent` and
302
302
  * exclude this component.
303
303
  *
304
304
  * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogdescription
@@ -353,8 +353,9 @@ type AlertDialogActionProps = Omit<ButtonProps, "appearance" | "intent"> & {
353
353
  };
354
354
  /**
355
355
  * A button that confirms the Alert Dialog action.
356
- * Will default to appearance="filled", with a tone derived from the `AlertDialog`'s
357
- * intent: danger dialogs get a danger button, info dialogs get a neutral one.
356
+ * Defaults to `appearance="filled"`, with a tone derived from the parent
357
+ * `AlertDialog.Root`'s intent: danger dialogs get a danger button, info dialogs
358
+ * get a neutral one.
358
359
  * Does not close the alert dialog by default.
359
360
  *
360
361
  * These buttons should be distinguished visually from the AlertDialogCancel button.
@@ -413,7 +414,7 @@ type AlertDialogCancelProps = Omit<ButtonProps, "appearance" | "intent"> & {
413
414
  };
414
415
  /**
415
416
  * A button that closes the dialog and cancels the action.
416
- * Will default to appearance="outlined" and intent="neutral".
417
+ * Defaults to `appearance="outlined"` and `intent="neutral"`.
417
418
  *
418
419
  * This button should be distinguished visually from AlertDialogAction buttons.
419
420
  *
@@ -502,7 +503,7 @@ declare const Icon: ({ className, ref, svg, ...props }: AlertDialogIconProps) =>
502
503
  * `AlertDialog.Cancel` already closes the dialog by default. Reach for
503
504
  * `AlertDialog.Close` when you need to attach close behavior to a custom
504
505
  * element (typically wrapping `AlertDialog.Action` with `asChild` so the
505
- * action both performs the operation and dismisses the dialog).
506
+ * action both runs the operation and dismisses the dialog).
506
507
  *
507
508
  * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogclose
508
509
  *
@@ -602,11 +603,10 @@ declare const Close: ({ ref, ...props }: ComponentProps<typeof Close$1>) => impo
602
603
  */
603
604
  declare const AlertDialog: {
604
605
  /**
605
- * The root stateful component for the Alert Dialog. Wraps the trigger and
606
- * content and exposes the required `intent` prop (`"danger"` for
607
- * destructive actions, `"info"` for informational confirmations) — the tone
608
- * its color communicates which propagates color to descendants like
609
- * `AlertDialog.Icon` and `AlertDialog.Action`.
606
+ * Wraps the trigger and the content. Holds the open state and the required
607
+ * `intent` prop `"danger"` for destructive actions, `"info"` for
608
+ * informational confirmations. `AlertDialog.Icon` and `AlertDialog.Action`
609
+ * read that intent for their color.
610
610
  *
611
611
  * `AlertDialog` renders its floating layer at Tailwind `z-50`, Mantle's
612
612
  * shared floating z-index. When multiple shared layers are open, the most
@@ -649,8 +649,8 @@ declare const AlertDialog: {
649
649
  * A button that confirms the Alert Dialog action. Defaults to
650
650
  * `appearance="filled"`, with a tone derived from the parent
651
651
  * `AlertDialog.Root`'s intent: danger dialogs get a danger button, info
652
- * dialogs get a neutral one. Does not close the dialog by default — wrap with
653
- * `AlertDialog.Close asChild` if the action should also dismiss.
652
+ * dialogs get a neutral one. Does not close the dialog by default — if the
653
+ * action should also dismiss, wrap it with `AlertDialog.Close asChild`.
654
654
  *
655
655
  * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogaction
656
656
  *
@@ -762,7 +762,7 @@ declare const AlertDialog: {
762
762
  readonly Cancel: typeof Cancel;
763
763
  /**
764
764
  * A button that closes the Alert Dialog. (Unstyled) Typically wrapped
765
- * around `AlertDialog.Action` with `asChild` so the action both performs
765
+ * around `AlertDialog.Action` with `asChild` so the action both runs
766
766
  * the operation and dismisses the dialog.
767
767
  *
768
768
  * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogclose
@@ -992,7 +992,7 @@ declare const AlertDialog: {
992
992
  readonly Icon: typeof Icon;
993
993
  /**
994
994
  * An accessible name to be announced when the dialog is opened.
995
- * Alternatively, provide `aria-label` or `aria-labelledby` to
995
+ * Alternatively, pass `aria-label` or `aria-labelledby` to
996
996
  * `AlertDialog.Content` and exclude this component.
997
997
  *
998
998
  * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogtitle
package/dist/alert.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Alert } from "./alert-BWwNPOMI.js";
1
+ import { t as Alert } from "./alert-B1HXfkYn.js";
2
2
  export { Alert };
package/dist/alert.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./alert-vwFd7qdp.js";export{e as Alert};
1
+ import{t as e}from"./alert-BuG2qS5l.js";export{e as Alert};
package/dist/anchor.d.ts CHANGED
@@ -66,7 +66,7 @@ type AnchorProps = Omit<ComponentProps<"a">, "rel"> & WithAsChild & {
66
66
  *
67
67
  * **Accessibility.** Link text must be self-describing — avoid "click
68
68
  * here" / "read more". For purely decorative icons, no extra labeling is
69
- * needed; for icon-only links, provide an `aria-label`.
69
+ * needed; for icon-only links, pass an `aria-label`.
70
70
  *
71
71
  * @see https://mantle.ngrok.com/components/navigation/anchor
72
72
  *
@@ -99,7 +99,7 @@ declare const Anchor: ({ asChild, children, className, rel: propRel, icon, iconP
99
99
  /**
100
100
  * Resolves the `rel` attribute to a string.
101
101
  *
102
- * If the value is an array, it will be filtered for empty values, ensure uniqueness, sorted, and joined with a space.
102
+ * If the value is an array, it drops the empty values, de-duplicates, sorts, and joins with a space.
103
103
  */
104
104
  declare function resolveRel(rel: Rel | (string & {}) | undefined | null | (Rel | (string & {}) | undefined | null)[]): string | undefined;
105
105
  //#endregion
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{jsx as r}from"react/jsx-runtime";const i={Root:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout`),className:e(`group/app-layout bg-base relative isolate flex h-full w-full flex-col`,`overflow-clip`,o),...c,children:a}),Notice:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-notice`),className:e(`flex w-full shrink-0 flex-col`,o),...c,children:a}),Workspace:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-workspace`),className:e(`flex min-h-0 flex-1`,o),...c,children:a}),Content:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-content`),className:e(`bg-card border-card-muted relative flex min-w-0 flex-1 flex-col rounded-xl border shadow-sm`,`m-[var(--app-layout-card-gutter,0.5rem)]`,`overflow-clip`,o),...c,children:a}),Header:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-header`),className:e(`border-card-muted flex h-14 shrink-0 items-center gap-2 border-b px-4`,`group-has-[[data-slot~=sidebar-header]]/app-layout:h-[calc(var(--sidebar-header-height,4.5rem)-2*var(--app-layout-card-gutter,0.5rem)-2px)]`,o),...c,children:a}),Body:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-body`),className:e(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,o),...c,children:a})};export{i as AppLayout};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{jsx as r}from"react/jsx-runtime";const i={Root:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout`),className:e(`group/app-layout bg-base relative isolate flex h-full w-full flex-col`,`overflow-clip`,o),...c,children:a}),Notice:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-notice`),className:e(`flex w-full shrink-0 flex-col`,o),...c,children:a}),Workspace:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-workspace`),className:e(`flex min-h-0 flex-1`,o),...c,children:a}),Content:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-content`),className:e(`bg-card border-card-muted relative flex min-w-0 flex-1 flex-col rounded-xl border shadow-sm`,`m-(--app-layout-card-gutter,0.5rem)`,`overflow-clip`,o),...c,children:a}),Header:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-header`),className:e(`border-card-muted flex h-14 shrink-0 items-center gap-2 border-b px-4`,`group-has-data-[slot~=sidebar-header]/app-layout:h-[calc(var(--sidebar-header-height,4.5rem)-2*var(--app-layout-card-gutter,0.5rem)-2px)]`,o),...c,children:a}),Body:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`app-layout-body`),className:e(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,o),...c,children:a})};export{i as AppLayout};
@@ -1,4 +1,4 @@
1
- import { _ as SeriesColor, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, g as PointShape, h as CurveKind, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ContinuousXScale, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps } from "./chart-1cVjAcj8.js";
1
+ import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, g as CurveKind, h as ContinuousXScale, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-0zcFJh4n.js";
2
2
  //#region src/components/area-chart/area-chart.d.ts
3
3
  /**
4
4
  * Props for {@link AreaChart.Root}. Areas fill from a shared zero baseline, so
@@ -27,12 +27,26 @@ type AreaChartAreaProps = {
27
27
  /** Display name for the legend, tooltip, and data table. Defaults to `dataKey`. */
28
28
  label?: string;
29
29
  /**
30
- * One of the validated chart tokens (`"chart-1"`…`"chart-8"`, `"chart-other"`)
31
- * or any CSS color as an escape hatch. Defaults to the next sticky slot in
32
- * mount order. Static colors (raw hex) do not adapt across themes; custom
33
- * palettes must be validated for colorblind-safe adjacency and surface
34
- * contrast, and a series that carries good/bad meaning should wear the
35
- * semantic status colors, never a categorical slot.
30
+ * A fixed visual identity slot. Slots `1` through `8` select a paired chart
31
+ * color and point shape. `"other"` selects the shared neutral treatment.
32
+ *
33
+ * Series receive unreserved slots in composition order. Set `seriesSlot` to
34
+ * give a series a fixed visual identity.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <AreaChart.Area dataKey="errors" seriesSlot={4} />
39
+ * ```
40
+ */
41
+ seriesSlot?: ChartSeriesSlot;
42
+ /**
43
+ * Override the color channel with a chart token or any CSS color. This does
44
+ * not change the series slot or its paired point shape. When omitted, the
45
+ * series paints the color from its slot.
46
+ *
47
+ * A static color (raw hex) cannot follow the four themes, so prefer a
48
+ * `var(--your-token)` declared per theme. A series that carries good/bad
49
+ * meaning should wear the semantic status colors, never a categorical slot.
36
50
  */
37
51
  color?: SeriesColor;
38
52
  /**
@@ -46,9 +60,11 @@ type AreaChartAreaProps = {
46
60
  */
47
61
  connectNulls?: boolean;
48
62
  /**
49
- * The glyph the hover dot wears: `"circle"` (default), `"square"`,
50
- * `"triangle"`, or `"diamond"` a redundant encoding alongside color that
51
- * keeps series distinguishable without color vision.
63
+ * The glyph the hover dot and the legend key wear: `"circle"`, `"square"`,
64
+ * `"triangle"`, `"diamond"`, `"triangle-down"`, `"plus"`, `"cross"`, or
65
+ * `"star"`. Shape is a redundant encoding alongside color that keeps series
66
+ * distinguishable without color vision. When omitted, the series wears the
67
+ * glyph paired to its series slot, so both channels name one slot.
52
68
  */
53
69
  shape?: PointShape;
54
70
  };
@@ -88,8 +104,18 @@ type AreaChartCopyButtonProps = CopyButtonPrimitiveProps;
88
104
  * tooltip, keyboard stepping with polite announcements, an sr-only data
89
105
  * table, Enter/Space + click activation). Areas fill with a 10% wash of the
90
106
  * series color plus a 2px band-edge stroke; `stacked` on the Root stacks the
91
- * composed series, the first series at the baseline. Large datasets decimate
92
- * before painting on canvas. Compose the chrome and series parts as children.
107
+ * series in registration order, the first-registered series at the baseline.
108
+ * Large datasets decimate before painting on canvas. Compose the chrome and
109
+ * series parts as children.
110
+ *
111
+ * The Root's own subtree is addressable by slot: `area-chart` on the wrapper,
112
+ * then `area-chart-plot`, `area-chart-canvas`, `area-chart-crosshair`,
113
+ * `area-chart-hover-band`, `area-chart-markers`, `area-chart-tooltip`, and
114
+ * `area-chart-data-table`. An area chart shows the crosshair and one marker dot
115
+ * per series, and never the band, but all three layers mount on every kind.
116
+ * Each hover dot carries `chart-active-point` plus a `data-shape` of
117
+ * `"circle"`, `"square"`, `"triangle"`, `"diamond"`, `"triangle-down"`,
118
+ * `"plus"`, `"cross"`, or `"star"`, naming the glyph its series wears.
93
119
  *
94
120
  * @see https://mantle.ngrok.com/components/charts/area-chart#areachartroot
95
121
  *
@@ -116,8 +142,9 @@ declare const Root: <TDatum extends ChartDatum = ChartDatum>(props: AreaChartRoo
116
142
  /**
117
143
  * One area series. Renders nothing itself — it registers the series with the
118
144
  * chart, which paints it on canvas. Compose one `Area` per series; with
119
- * `stacked` on the Root, areas stack in composition order with the first
120
- * series at the baseline.
145
+ * `stacked` on the Root, areas stack in registration order with the
146
+ * first-registered series at the baseline, so an `Area` that mounts later
147
+ * stacks on top whatever its position in the JSX.
121
148
  *
122
149
  * @see https://mantle.ngrok.com/components/charts/area-chart#areachartarea
123
150
  *
@@ -218,9 +245,9 @@ declare const YAxis: (props: AreaChartYAxisProps) => null;
218
245
  declare const ReferenceLine: (props: AreaChartReferenceLineProps) => null;
219
246
  /**
220
247
  * Customizes the hover/keyboard tooltip readout. The tooltip itself is part
221
- * of `AreaChart.Root`'s interaction contract and renders whether or not this
222
- * part is composed — compose it to format the label or values, append a
223
- * footer, or replace the content entirely via the render-prop `children`.
248
+ * of `AreaChart.Root`'s interaction contract and renders even when this part
249
+ * is absent — compose it to format the label or values, append a footer, or
250
+ * replace the content entirely via the render-prop `children`.
224
251
  *
225
252
  * @see https://mantle.ngrok.com/components/charts/area-chart#areacharttooltip
226
253
  *
@@ -244,6 +271,13 @@ declare const Tooltip: (props: AreaChartTooltipProps) => null;
244
271
  * must never rely on color-matching alone. It renders nothing for a single
245
272
  * series (the chart's title already names it).
246
273
  *
274
+ * **Data attributes:**
275
+ *
276
+ * | Data Attribute | Value | Description |
277
+ * | --- | --- | --- |
278
+ * | `data-slot` | `"area-chart-legend"` | The legend list. `AreaChart.Legend` renders it in flow below the plot. |
279
+ * | `data-shape` | `"circle"` \| `"square"` \| `"triangle"` \| `"diamond"` \| `"triangle-down"` \| `"plus"` \| `"cross"` \| `"star"` | On each series' swatch, naming the glyph its `AreaChart.Area` wears — the `shape` it set, else the one paired to its series slot. The swatch clips itself to that glyph, so target this only to restyle a key. |
280
+ *
247
281
  * @see https://mantle.ngrok.com/components/charts/area-chart#areachartlegend
248
282
  *
249
283
  * @example
@@ -285,14 +319,28 @@ declare const CopyButton: (props: AreaChartCopyButtonProps) => import("react").J
285
319
  * A canvas-rendered area chart for showing how values — and, when stacked, a
286
320
  * total and its parts — change over a continuous x axis. Each area fills with
287
321
  * a 10% wash of the series color plus a 2px band-edge stroke; the Root-level
288
- * `stacked` prop stacks the composed series in composition order from the
289
- * baseline. Series colors come from the theme's validated `--color-chart-*`
322
+ * `stacked` prop stacks the series in registration order from the baseline.
323
+ * Series colors come from the theme's validated `--color-chart-*`
290
324
  * tokens; areas keep a fixed slot color for the chart's lifetime even as
291
325
  * other series are filtered in and out. Interaction — a crosshair with an
292
326
  * every-series tooltip, keyboard stepping, aria-live announcements, and an
293
327
  * sr-only data table — ships with `Root` unconditionally; large datasets
294
328
  * decimate before painting on canvas.
295
329
  *
330
+ * **CSS variables (public API):**
331
+ *
332
+ * | CSS Variable | Default | Description |
333
+ * | --- | --- | --- |
334
+ * | `--color-chart-1` … `--color-chart-8` | per theme | The validated categorical series slots, in assignment order. |
335
+ * | `--color-chart-other` | `--color-neutral-500` | The neutral overflow slot a series wears once every slot is held. |
336
+ *
337
+ * Two ways to change a series color, both public API. The `color` prop on
338
+ * `AreaChart.Area` sets one series and takes any CSS color. To restyle a slot itself,
339
+ * redeclare its token on `Root` —
340
+ * `className="[--color-chart-1:var(--color-brand)]"`. The engine resolves every
341
+ * token through a probe inside `Root`, so a declaration scoped there wins for
342
+ * that chart and leaves every other chart on the page alone.
343
+ *
296
344
  * @see https://mantle.ngrok.com/components/charts/area-chart
297
345
  *
298
346
  * @example
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-B3pAvmkk.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`area`,componentName:`AreaChart`,slotName:`area-chart`,...e}),Area:e=>a(`AreaChart.Area`,`area`,e),Grid:e=>n(`AreaChart.Grid`,e),XAxis:e=>t(`AreaChart.XAxis`,e),YAxis:e=>r(`AreaChart.YAxis`,e),ReferenceLine:t=>e(`AreaChart.ReferenceLine`,t),Tooltip:e=>s(`AreaChart.Tooltip`,e),Legend:e=>l(i,{partName:`AreaChart.Legend`,slotName:`area-chart`,...e}),CopyButton:e=>l(c,{partName:`AreaChart.CopyButton`,slotName:`area-chart`,...e})};export{u as AreaChart};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DBxT9BNl.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`area`,componentName:`AreaChart`,slotName:`area-chart`,...e}),Area:e=>a(`AreaChart.Area`,`area`,e),Grid:e=>n(`AreaChart.Grid`,e),XAxis:e=>t(`AreaChart.XAxis`,e),YAxis:e=>r(`AreaChart.YAxis`,e),ReferenceLine:t=>e(`AreaChart.ReferenceLine`,t),Tooltip:e=>s(`AreaChart.Tooltip`,e),Legend:e=>l(i,{partName:`AreaChart.Legend`,slotName:`area-chart`,...e}),CopyButton:e=>l(c,{partName:`AreaChart.CopyButton`,slotName:`area-chart`,...e})};export{u as AreaChart};