@ngrok/mantle 0.94.0 → 0.94.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.
- package/README.md +11 -2
- package/dist/accordion.d.ts +61 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +61 -56
- package/dist/alert-BkJHDx9X.js +1 -0
- package/dist/{alert-HffaioZM.d.ts → alert-D0zRRUHV.d.ts} +6 -6
- package/dist/alert-center.d.ts +53 -53
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +22 -10
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-Dc6IgvXV.js +1 -0
- package/dist/anchor.d.ts +5 -5
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +18 -18
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +13 -13
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +24 -24
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +7 -7
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +12 -12
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +36 -36
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only-CZfkNw5A.js +1 -0
- package/dist/browser-only-ymFoM3Ya.js +1 -0
- package/dist/browser-only.js +1 -1
- package/dist/{button-K0pKc3GN.d.ts → button-5Pc7Mby_.d.ts} +3 -3
- package/dist/button-B9bChDgl.js +1 -0
- package/dist/button-D8jixIbH.js +1 -0
- package/dist/button-DNLTJ32M.js +1 -0
- package/dist/{button-Cgf2IcEC.d.ts → button-Ddj6yr10.d.ts} +26 -26
- package/dist/{button-BGwOPjGV.d.ts → button-DnYv7IOT.d.ts} +22 -21
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +23 -23
- package/dist/centered-layout.js +1 -1
- package/dist/{chart-CE5Uaqz9.js → chart-BLCqzt56.js} +1 -1
- package/dist/{chart-DCTGGlWL.js → chart-CChZiCrt.js} +1 -1
- package/dist/{chart-BO9EwQ60.js → chart-CUmSu9d7.js} +1 -1
- package/dist/{chart-jitNqimS.d.ts → chart-Dl8gFo_D.d.ts} +22 -22
- package/dist/chart-DtgZBAas.js +2 -0
- package/dist/checkbox-Cu5cgZmk.js +1 -0
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/choice-CCVG2hb9.js +1 -0
- package/dist/{choice-BwfmbepO.d.ts → choice-CNiOSzqV.d.ts} +20 -20
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/code-BPKNY1_w.js +1 -0
- package/dist/{code-block-BGdV4Yty.d.ts → code-block-BDw6MEwH.d.ts} +9 -9
- package/dist/{code-block-W3kWPxCJ.js → code-block-CKzsAMzj.js} +3 -3
- package/dist/code-block.d.ts +15 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +3 -3
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +15 -15
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +47 -47
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdRUneoc.js +1 -0
- package/dist/{copy-to-clipboard-DInu78k_.js → copy-to-clipboard-Dd83caRw.js} +1 -1
- package/dist/cx.d.ts +4 -4
- package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
- package/dist/data-table.d.ts +36 -36
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +1 -1
- package/dist/description-list.js +1 -1
- package/dist/{dialog-DD5H3EH1.d.ts → dialog-CIEuwNys.d.ts} +24 -8
- package/dist/{dialog-B9JAGy_x.d.ts → dialog-CbEEA0fl.d.ts} +7 -3
- package/dist/dialog-DmzoDfY3.js +1 -0
- package/dist/dialog.d.ts +2 -2
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-DmDxYPde.d.ts → dropdown-menu-CeY498yk.d.ts} +10 -10
- package/dist/dropdown-menu-uheL0prz.js +1 -0
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +2 -2
- package/dist/empty.js +1 -1
- package/dist/field-Bpvn4tQp.js +1 -0
- package/dist/field-Cai_4c1l.js +1 -0
- package/dist/field.d.ts +41 -41
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +3 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +30 -10
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +3 -3
- package/dist/hover-card.js +1 -1
- package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
- package/dist/{icon-NYvyyRMG.d.ts → icon-DuIYoyft.d.ts} +2 -2
- package/dist/{icon-DXDyhy2N.d.ts → icon-QCm1ui29.d.ts} +2 -2
- package/dist/icon-xb7d9M7X.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons-DEDCLZ8B.js +1 -0
- package/dist/icons-DXadFwpo.js +1 -0
- package/dist/icons-DcesO4Ng.js +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -1
- package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
- package/dist/{input-q8o5uMhW.d.ts → input-DC4nW0Sr.d.ts} +1 -1
- package/dist/input-fW8QSZEO.js +1 -0
- package/dist/input.d.ts +4 -4
- package/dist/input.js +1 -1
- package/dist/kbd-P1nQshWo.js +1 -0
- package/dist/kbd.d.ts +5 -5
- package/dist/kbd.js +1 -1
- package/dist/label-DO1RlMKl.js +1 -0
- package/dist/{label-r2sJcSQ4.d.ts → label-epgtywRz.d.ts} +8 -8
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/layer-container-DL4yclOu.js +1 -0
- package/dist/layer-container.d.ts +2 -2
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.d.ts +12 -12
- package/dist/line-chart.js +1 -1
- package/dist/list-cQZPSjfz.js +1 -0
- package/dist/list.d.ts +17 -17
- package/dist/list.js +1 -1
- package/dist/live-region-Dhapu8a5.js +1 -0
- package/dist/live-region.d.ts +1 -1
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +23 -22
- package/dist/main-CHyWYDak.js +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +25 -25
- package/dist/media-object.d.ts +4 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +28 -28
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +3 -3
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +4 -4
- package/dist/pagination.js +1 -1
- package/dist/{popover-lwkwWcRW.d.ts → popover-Bei0jyfH.d.ts} +73 -7
- package/dist/popover-DhgunktK.js +1 -0
- package/dist/popover-T2EyaqGK.d.ts +1 -0
- package/dist/popover.d.ts +2 -2
- package/dist/popover.js +1 -1
- package/dist/primitive-D8CzV_Ft.js +1 -0
- package/dist/progress.d.ts +1 -1
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +3 -3
- package/dist/qr-code.js +1 -1
- package/dist/query-filter.d.ts +6 -6
- package/dist/query.d.ts +8 -3
- package/dist/query.js +1 -1
- package/dist/{radio-group-sLz5AA9I.d.ts → radio-group-BJQ6EOqh.d.ts} +1 -1
- package/dist/radio-group-BliblUqe.js +1 -0
- package/dist/radio-group-ggEkCi0V.js +1 -0
- package/dist/radio-group.d.ts +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +30 -30
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-D4PL5_GR.js +1 -0
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +13 -14
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control.d.ts +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/select-1xuUx_os.js +1 -0
- package/dist/{select-BqmpVJJT.d.ts → select-BpaXHxJm.d.ts} +6 -6
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +18 -18
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-QfH0ot5K.d.ts → separator-Ck4sPrdN.d.ts} +1 -1
- package/dist/separator-DnvhwY2J.js +1 -0
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/{shake-DL6WhMXM.js → shake-CAUpKBHe.js} +1 -1
- package/dist/sheet-DHy_vlme.js +1 -0
- package/dist/sheet.d.ts +23 -7
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +37 -37
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-DHfyjuQi.js +1 -0
- package/dist/skeleton.d.ts +4 -4
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/slider.js +1 -1
- package/dist/slot-B7rwscwd.js +1 -0
- package/dist/{slot-D12N_fZJ.d.ts → slot-BEMQMbk3.d.ts} +4 -4
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/source-all.css +5 -1
- package/dist/split-button.d.ts +9 -9
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +22 -22
- package/dist/strata.js +1 -1
- package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/dist/table-BnLdXUai.js +1 -0
- package/dist/{table-rWiVWEgB.d.ts → table-Ii9hHUWN.d.ts} +5 -5
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +2 -2
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-BNdZl352.js +1 -0
- package/dist/theme-switcher.d.ts +4 -4
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +14 -12
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +2 -2
- package/dist/toast.js +1 -1
- package/dist/tokens.dark.json +3261 -0
- package/dist/tokens.json +4933 -0
- package/dist/tokens.resolver.json +37 -0
- package/dist/{tooltip-CpK3XTor.d.ts → tooltip-CstGDKwy.d.ts} +4 -4
- package/dist/tooltip-DQO40Mrq.js +1 -0
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.d.ts +1 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-breakpoint-B4Kh0xE6.js +1 -0
- package/dist/use-callback-ref-DiOXFQzM.js +1 -0
- package/dist/use-composed-refs-DPYmLDSe.js +1 -0
- package/dist/use-copy-to-clipboard-hBL6_65i.js +1 -0
- package/dist/use-inert-siblings-C4RHXrZc.js +1 -0
- package/dist/use-is-apple-platform-Bq6_KbVX.js +1 -0
- package/dist/use-is-hydrated-BeLOGKwE.js +1 -0
- package/dist/use-is-hydrated-after-paint-CrHt3OHw.js +1 -0
- package/dist/use-isomorphic-layout-effect-CL6iq0Bj.js +1 -0
- package/dist/use-matches-media-query-FfvtNKQe.js +1 -0
- package/dist/use-prefers-reduced-motion-Ck6dnOM9.js +1 -0
- package/dist/use-swipe-to-dismiss-BYdlca8r.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +1 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +1 -1
- package/dist/well.js +1 -1
- package/package.json +16 -2
- package/dist/alert-CH99Rw-R.js +0 -1
- package/dist/anchor-CgcbWEUs.js +0 -1
- package/dist/browser-only-BTSrYWLj.js +0 -1
- package/dist/button-69InNC_m.js +0 -1
- package/dist/button-BWGUuWnu.js +0 -1
- package/dist/button-Cu9e3SM7.js +0 -1
- package/dist/chart-DudCw24t.js +0 -2
- package/dist/checkbox-CS504fKk.js +0 -1
- package/dist/choice-uyYccm0A.js +0 -1
- package/dist/code-DUJzSl4K.js +0 -1
- package/dist/compose-refs-sFdxsL7k.js +0 -1
- package/dist/dialog-CsugEt2A.js +0 -1
- package/dist/dropdown-menu-DHdgaw4P.js +0 -1
- package/dist/field-Bihblt8U.js +0 -1
- package/dist/field-CPvjazWN.js +0 -1
- package/dist/icon-kK0c-POG.js +0 -1
- package/dist/icons-4JA-SGfv.js +0 -1
- package/dist/icons-CDLz5lpI.js +0 -1
- package/dist/icons-CSwTVV2m.js +0 -1
- package/dist/input-DHovzBjS.js +0 -1
- package/dist/kbd-CLHsJ99p.js +0 -1
- package/dist/label-DmDwzPD8.js +0 -1
- package/dist/layer-container-kEQiE4zV.js +0 -1
- package/dist/list-CO_yLdln.js +0 -1
- package/dist/live-region-DQ1QLv3L.js +0 -1
- package/dist/main-CC1L9IsH.js +0 -1
- package/dist/popover-BhTFutCz.d.ts +0 -1
- package/dist/popover-DxOqLKxy.js +0 -1
- package/dist/primitive-Dz9Al-us.js +0 -1
- package/dist/radio-group-HDVxTNPi.js +0 -1
- package/dist/radio-group-jj2abc0t.js +0 -1
- package/dist/sandboxed-on-click-C7pPu-2M.js +0 -1
- package/dist/select-C6Su0dU0.js +0 -1
- package/dist/separator-DfzxVutO.js +0 -1
- package/dist/sheet-Bd2LIhzF.js +0 -1
- package/dist/skeleton-DBpI-ko5.js +0 -1
- package/dist/slot-DdYN1L1C.js +0 -1
- package/dist/table-CFHiDBW8.js +0 -1
- package/dist/theme-DdZgLvKH.js +0 -1
- package/dist/tooltip-b6oiTaWq.js +0 -1
- package/dist/use-breakpoint--mo7kr9d.js +0 -1
- package/dist/use-callback-ref-BvVyI5K1.js +0 -1
- package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +0 -1
- package/dist/use-inert-siblings-CNmNuS2h.js +0 -1
- package/dist/use-is-apple-platform-D4nifHMx.js +0 -1
- package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +0 -1
- package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +0 -1
- package/dist/use-matches-media-query-m860lols.js +0 -1
- package/dist/use-prefers-reduced-motion-CU6mWmOe.js +0 -1
- package/dist/use-swipe-to-dismiss-i__cTF2v.js +0 -1
package/dist/bar-chart.d.ts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/charts/bar-chart
|
|
5
5
|
*/
|
|
6
|
-
import { a as XAxisPrimitiveProps, c as LegendPrimitiveProps, d as ChartMode, f as BarOrientation, h as ChartDatumEvent, i as ReferenceLinePrimitiveProps, l as CopyButtonPrimitiveProps, m as ChartDatum, n as ChartRootBaseProps, o as YAxisPrimitiveProps, p as BarTexture, r as GridPrimitiveProps, s as ChartListPrimitiveProps, t as TooltipPrimitiveProps, u as ChartAccessibilityProps, y as SeriesColor } from "./chart-
|
|
6
|
+
import { a as XAxisPrimitiveProps, c as LegendPrimitiveProps, d as ChartMode, f as BarOrientation, h as ChartDatumEvent, i as ReferenceLinePrimitiveProps, l as CopyButtonPrimitiveProps, m as ChartDatum, n as ChartRootBaseProps, o as YAxisPrimitiveProps, p as BarTexture, r as GridPrimitiveProps, s as ChartListPrimitiveProps, t as TooltipPrimitiveProps, u as ChartAccessibilityProps, y as SeriesColor } from "./chart-Dl8gFo_D.js";
|
|
7
7
|
/**
|
|
8
8
|
* Props for {@link BarChart.List}.
|
|
9
9
|
*/
|
|
10
10
|
type BarChartListProps = ChartListPrimitiveProps;
|
|
11
11
|
/**
|
|
12
12
|
* Props for {@link BarChart.Root}. Bars encode value by length from a shared
|
|
13
|
-
* zero baseline, so the y domain minimum is fixed at `0
|
|
13
|
+
* zero baseline, so the y domain minimum is fixed at `0`. A truncated-bar
|
|
14
14
|
* axis is unrepresentable.
|
|
15
15
|
*/
|
|
16
16
|
type BarChartRootProps<TDatum extends ChartDatum = ChartDatum, TMode extends ChartMode = "interactive"> = Omit<ChartRootBaseProps, "yDomain"> & ChartAccessibilityProps<TMode> & {
|
|
@@ -23,10 +23,10 @@ type BarChartRootProps<TDatum extends ChartDatum = ChartDatum, TMode extends Cha
|
|
|
23
23
|
/** Override the automatic y maximum. The minimum is always the zero baseline. */
|
|
24
24
|
yDomain?: [0, number | "auto"];
|
|
25
25
|
/**
|
|
26
|
-
* The direction the bars point
|
|
26
|
+
* The direction the bars point. This names the bars, not an axis.
|
|
27
27
|
* `"vertical"` (default) bars stand up from a bottom baseline with
|
|
28
28
|
* categories along the x axis; `"horizontal"` bars run rightward from a
|
|
29
|
-
* left baseline with categories down the y axis
|
|
29
|
+
* left baseline with categories down the y axis, better for long category
|
|
30
30
|
* labels or many categories. The value axis, baseline, reference lines, and
|
|
31
31
|
* the two rung textures (`"perpendicular"` and `"parallel"`) all flip to
|
|
32
32
|
* match.
|
|
@@ -64,13 +64,13 @@ type BarChartBarProps = {
|
|
|
64
64
|
* The fill texture the series wears, on the bars and on its legend key:
|
|
65
65
|
* `"solid"` (default), diagonal hatch lines at 45° (`"hatch"`), the 135°
|
|
66
66
|
* mirror (`"hatch-reverse"`), both (`"crosshatch"`), rungs perpendicular
|
|
67
|
-
* to the bar's length (`"perpendicular"
|
|
68
|
-
* bars), rungs parallel to it (`"parallel"
|
|
67
|
+
* to the bar's length (`"perpendicular"`: horizontal lines on vertical
|
|
68
|
+
* bars), rungs parallel to it (`"parallel"`: vertical lines on vertical
|
|
69
69
|
* bars), the orthogonal lattice of both rung directions (`"grid"`), or an
|
|
70
70
|
* offset dot field (`"dots"`).
|
|
71
71
|
*
|
|
72
72
|
* The two rung textures flip with the Root's `orientation`, in opposite
|
|
73
|
-
* senses. Every other value is direction-free, `"grid"` included
|
|
73
|
+
* senses. Every other value is direction-free, `"grid"` included: it is the
|
|
74
74
|
* orthogonal lattice against `"crosshatch"`'s diagonal one.
|
|
75
75
|
*
|
|
76
76
|
* A textured series paints its marks in the full series color over a light
|
|
@@ -170,7 +170,7 @@ type BarChartCopyButtonProps = CopyButtonPrimitiveProps;
|
|
|
170
170
|
*/
|
|
171
171
|
declare const Root: <TDatum extends ChartDatum = ChartDatum, TMode extends ChartMode = "interactive">(props: BarChartRootProps<TDatum, TMode>) => import("react").JSX.Element;
|
|
172
172
|
/**
|
|
173
|
-
* One bar series. Renders nothing itself
|
|
173
|
+
* One bar series. Renders nothing itself: it registers the series with the
|
|
174
174
|
* chart, which paints it. Compose one `Bar` per series; with
|
|
175
175
|
* `stacked` on the Root, bars stack from the baseline up in registration
|
|
176
176
|
* order, so a `Bar` that mounts later stacks on top whatever its position in
|
|
@@ -273,7 +273,7 @@ declare const ReferenceLine: (props: BarChartReferenceLineProps) => null;
|
|
|
273
273
|
/**
|
|
274
274
|
* Customizes the hover/keyboard tooltip readout. The tooltip itself is part
|
|
275
275
|
* of `BarChart.Root`'s interaction contract and renders even when this part is
|
|
276
|
-
* absent
|
|
276
|
+
* absent. Compose it to format the label or values, append a footer, or
|
|
277
277
|
* replace the content entirely via the render-prop `children`.
|
|
278
278
|
*
|
|
279
279
|
* **Structure.** A `children` readout renders inside a
|
|
@@ -306,7 +306,7 @@ declare const ReferenceLine: (props: BarChartReferenceLineProps) => null;
|
|
|
306
306
|
declare const Tooltip: (props: BarChartTooltipProps) => null;
|
|
307
307
|
/**
|
|
308
308
|
* The legend: series names keyed by color swatches, rendered as real DOM in
|
|
309
|
-
* flow below the plot. Always compose it on multi-series charts
|
|
309
|
+
* flow below the plot. Always compose it on multi-series charts: identity
|
|
310
310
|
* must never rely on color-matching alone. It renders nothing for a single
|
|
311
311
|
* series (the chart's title already names it).
|
|
312
312
|
*
|
|
@@ -342,8 +342,8 @@ declare const Tooltip: (props: BarChartTooltipProps) => null;
|
|
|
342
342
|
declare const Legend: (props: BarChartLegendProps) => import("react").JSX.Element;
|
|
343
343
|
/**
|
|
344
344
|
* A button that copies the chart's current data to the clipboard as a
|
|
345
|
-
* markdown table (ISO dates, plain numbers, one column per series)
|
|
346
|
-
*
|
|
345
|
+
* markdown table (ISO dates, plain numbers, one column per series). The table
|
|
346
|
+
* pastes into Slack, issues, docs, spreadsheets, and LLM chats. Renders
|
|
347
347
|
* in flow where composed (alongside `Legend`, below the plot); `Root` is
|
|
348
348
|
* relatively positioned, so `className` can dock it over a corner instead
|
|
349
349
|
* (e.g. `absolute right-0 top-0`).
|
package/dist/bar-chart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t,c as n,d as r,l as i,n as a,o,s,t as c,u as l}from"./chart-
|
|
1
|
+
"use client";import{_ as e,a as t,c as n,d as r,l as i,n as a,o,s,t as c,u as l}from"./chart-DtgZBAas.js";import{t as u}from"./chart-CChZiCrt.js";import{c as d}from"react/compiler-runtime";import{jsx as f}from"react/jsx-runtime";const p={Root:e=>{let t=d(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ f(c,{kind:`bar`,componentName:`BarChart`,slotName:`bar-chart`,paintBackend:u,...e}),t[0]=e,t[1]=n),n},Bar:e=>s(`BarChart.Bar`,`bar`,e),Grid:e=>t(`BarChart.Grid`,e),XAxis:e=>n(`BarChart.XAxis`,e),YAxis:e=>i(`BarChart.YAxis`,e),ReferenceLine:e=>o(`BarChart.ReferenceLine`,e),Tooltip:e=>a(`BarChart.Tooltip`,e),Legend:e=>{let t=d(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ f(r,{partName:`BarChart.Legend`,slotName:`bar-chart`,...e}),t[0]=e,t[1]=n),n},CopyButton:t=>{let n=d(2),r;return n[0]===t?r=n[1]:(r=/* @__PURE__ */ f(e,{partName:`BarChart.CopyButton`,slotName:`bar-chart`,...t}),n[0]=t,n[1]=r),r},List:e=>{let t=d(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ f(l,{slotName:`bar-chart-list`,...e}),t[0]=e,t[1]=n),n}};export{p as BarChart};
|
package/dist/breadcrumb.d.ts
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
5
5
|
*/
|
|
6
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
7
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
7
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
8
8
|
import { ComponentProps, ReactNode } from "react";
|
|
9
9
|
/**
|
|
10
10
|
* The breadcrumb landmark. Renders a `<nav>` with a default
|
|
11
|
-
* `aria-label="Breadcrumb"` per the WAI-ARIA breadcrumb pattern
|
|
11
|
+
* `aria-label="Breadcrumb"` per the WAI-ARIA breadcrumb pattern. Pass your
|
|
12
12
|
* own `aria-label` to override it (e.g. for localization or when a page has
|
|
13
13
|
* multiple breadcrumb trails). Carries no visual styling. Its one layout class
|
|
14
14
|
* is `min-w-0`: inside a flex row such as `AppLayout.Header` the landmark must
|
|
@@ -38,7 +38,7 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
38
38
|
*/
|
|
39
39
|
declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"nav"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
40
40
|
/**
|
|
41
|
-
* The ordered list of crumbs. Renders an `<ol>`
|
|
41
|
+
* The ordered list of crumbs. Renders an `<ol>` (an **ordered** list), because
|
|
42
42
|
* the order of the items is the hierarchy, from the root to the current page.
|
|
43
43
|
* Lays the crumbs out in one row of muted, small text.
|
|
44
44
|
*
|
|
@@ -48,10 +48,10 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ref,
|
|
|
48
48
|
* out, and an edge with nothing beyond it stays flush.
|
|
49
49
|
*
|
|
50
50
|
* The trail keeps its end in view, because the end is the current page. It
|
|
51
|
-
* scrolls itself there whenever that end moves
|
|
52
|
-
* swaps the crumbs, and when the row around it resizes
|
|
53
|
-
* own scroll position alone
|
|
54
|
-
* focus. Tabbing to a crumb the trail has scrolled past is the browser's own
|
|
51
|
+
* scrolls itself there whenever that end moves: on mount, when a navigation
|
|
52
|
+
* swaps the crumbs, and when the row around it resizes. The rest of the time,
|
|
53
|
+
* it leaves the reader's own scroll position alone, including while a crumb
|
|
54
|
+
* holds focus. Tabbing to a crumb the trail has scrolled past is the browser's own
|
|
55
55
|
* job, and `scroll-padding` the width of the fade zone is what lands that crumb
|
|
56
56
|
* clear of the fade rather than under it.
|
|
57
57
|
*
|
|
@@ -83,8 +83,8 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ref,
|
|
|
83
83
|
declare const List: ({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"ol"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
84
84
|
/**
|
|
85
85
|
* A single crumb. Renders an `<li>` (`role="listitem"`) that lays out its
|
|
86
|
-
* content
|
|
87
|
-
*
|
|
86
|
+
* content (a `Breadcrumb.Link`, a `Breadcrumb.Label`, or a `Breadcrumb.Page`)
|
|
87
|
+
* inline.
|
|
88
88
|
*
|
|
89
89
|
* The crumb never shrinks (`shrink-0`). A squeezed crumb would break its own
|
|
90
90
|
* label across two lines, so a trail too wide for its container scrolls in
|
|
@@ -113,8 +113,8 @@ declare const List: ({ asChild, children, className, "data-slot": dataSlot, ref,
|
|
|
113
113
|
*/
|
|
114
114
|
declare const Item: ({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"li"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
115
115
|
/**
|
|
116
|
-
* A link to an ancestor page in the hierarchy. Renders an `<a>` by default
|
|
117
|
-
*
|
|
116
|
+
* A link to an ancestor page in the hierarchy. Renders an `<a>` by default.
|
|
117
|
+
* The component is router-agnostic: use `asChild` to compose the styling
|
|
118
118
|
* onto your app router's link (e.g. react-router's `<Link>`) so client-side
|
|
119
119
|
* navigation kicks in.
|
|
120
120
|
*
|
|
@@ -148,7 +148,7 @@ declare const Item: ({ asChild, children, className, "data-slot": dataSlot, ref,
|
|
|
148
148
|
*/
|
|
149
149
|
declare const Link: ({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"a"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
150
150
|
/**
|
|
151
|
-
* A crumb that is not a link
|
|
151
|
+
* A crumb that is not a link: a level with no page of its own, such as a
|
|
152
152
|
* section whose index URL only redirects (`Settings` in `Settings > General`).
|
|
153
153
|
* Renders a `<span>` with no `aria-current` and no link semantics, so the
|
|
154
154
|
* trail shows the level without offering it as a destination. Use
|
|
@@ -174,7 +174,7 @@ declare const Link: ({ asChild, children, className, "data-slot": dataSlot, ref,
|
|
|
174
174
|
*/
|
|
175
175
|
declare const Label: ({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"span"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
176
176
|
/**
|
|
177
|
-
* The current page
|
|
177
|
+
* The current page (the last crumb in the trail). Renders a `<span>` (not a
|
|
178
178
|
* link; the user is already here) with `aria-current="page"`. The ARIA is the
|
|
179
179
|
* part's whole contract, so `aria-current` is always emitted and is not
|
|
180
180
|
* overridable via props.
|
|
@@ -204,8 +204,8 @@ declare const Page: ({ asChild, children, className, "data-slot": dataSlot, ref,
|
|
|
204
204
|
/**
|
|
205
205
|
* The props for `Breadcrumb.Separator`. When `asChild` is set, `children` is
|
|
206
206
|
* required: the child element is what gets rendered, so an `asChild` separator
|
|
207
|
-
* without children would clone the default caret icon into the list
|
|
208
|
-
* `<ol>` content. The union makes that misuse a compile error.
|
|
207
|
+
* without children would clone the default caret icon into the list, which is
|
|
208
|
+
* invalid `<ol>` content. The union makes that misuse a compile error.
|
|
209
209
|
*/
|
|
210
210
|
type BreadcrumbSeparatorProps = Omit<ComponentProps<"li">, "children"> & ({
|
|
211
211
|
asChild: true;
|
|
@@ -216,12 +216,12 @@ type BreadcrumbSeparatorProps = Omit<ComponentProps<"li">, "children"> & ({
|
|
|
216
216
|
});
|
|
217
217
|
/**
|
|
218
218
|
* A purely visual divider between crumbs, hidden from assistive technology.
|
|
219
|
-
* Renders an `<li>` with `role="presentation"` and `aria-hidden="true"
|
|
219
|
+
* Renders an `<li>` with `role="presentation"` and `aria-hidden="true"`: a
|
|
220
220
|
* listitem sibling of `Breadcrumb.Item` elements per the APG breadcrumb
|
|
221
221
|
* pattern, so it never counts as a crumb. Children default to a size-3.5
|
|
222
222
|
* caret icon (`<Icon svg={<CaretRightIcon />} className="size-3.5" />`); pass
|
|
223
223
|
* your own children (e.g. a slash) to replace it. With `asChild`, children
|
|
224
|
-
* are required
|
|
224
|
+
* are required: the child element is what renders.
|
|
225
225
|
*
|
|
226
226
|
* Like `Breadcrumb.Item`, the divider never shrinks (`shrink-0`), so a trail
|
|
227
227
|
* too wide for its container scrolls in `Breadcrumb.List` instead.
|
|
@@ -264,7 +264,7 @@ type BreadcrumbSkeletonProps = Omit<ComponentProps<"li">, "children"> & {
|
|
|
264
264
|
/**
|
|
265
265
|
* A placeholder crumb for a label that is still loading. Renders one `<li>`
|
|
266
266
|
* as a crumb-sized pulsing bar carrying a screen-reader-only `role="status"`
|
|
267
|
-
* announcement. The bar is `w-24` by default
|
|
267
|
+
* announcement. The bar is `w-24` by default. Pass a `w-*` utility for your
|
|
268
268
|
* best-guess width, so the row's shape holds when the real crumb replaces it.
|
|
269
269
|
* One skeleton usually stands in for a whole pending segment; compose several
|
|
270
270
|
* with `Breadcrumb.Separator` when the segment's shape matters.
|
|
@@ -286,7 +286,7 @@ type BreadcrumbSkeletonProps = Omit<ComponentProps<"li">, "children"> & {
|
|
|
286
286
|
*/
|
|
287
287
|
declare const BreadcrumbSkeleton: ({ className, "data-slot": dataSlot, label, ref, ...props }: BreadcrumbSkeletonProps & WithDataSlot) => import("react").JSX.Element;
|
|
288
288
|
/**
|
|
289
|
-
* Compound component for WAI-ARIA breadcrumb navigation
|
|
289
|
+
* Compound component for WAI-ARIA breadcrumb navigation: the path from a
|
|
290
290
|
* root to the current page as an ordered list of links inside a labeled
|
|
291
291
|
* `<nav>` landmark. Router-agnostic: compose `Breadcrumb.Link` onto your app
|
|
292
292
|
* router's link via `asChild`. A trail too wide for its row scrolls sideways
|
|
@@ -338,7 +338,7 @@ declare const BreadcrumbSkeleton: ({ className, "data-slot": dataSlot, label, re
|
|
|
338
338
|
declare const Breadcrumb: {
|
|
339
339
|
/**
|
|
340
340
|
* The breadcrumb landmark. Renders a `<nav>` with a default
|
|
341
|
-
* `aria-label="Breadcrumb"
|
|
341
|
+
* `aria-label="Breadcrumb"`. Pass your own `aria-label` to override it.
|
|
342
342
|
* Carries no visual styling; `min-w-0` is what lets the landmark shrink
|
|
343
343
|
* inside a flex row so the trail scrolls.
|
|
344
344
|
*
|
|
@@ -365,7 +365,7 @@ declare const Breadcrumb: {
|
|
|
365
365
|
*/
|
|
366
366
|
readonly Root: typeof Root;
|
|
367
367
|
/**
|
|
368
|
-
* The ordered list of crumbs. Renders an `<ol
|
|
368
|
+
* The ordered list of crumbs. Renders an `<ol>`: the order of the items
|
|
369
369
|
* is the hierarchy, from the root to the current page. A trail wider than
|
|
370
370
|
* its container scrolls sideways with a faded edge instead of wrapping, and
|
|
371
371
|
* starts at the current page.
|
|
@@ -446,7 +446,7 @@ declare const Breadcrumb: {
|
|
|
446
446
|
*/
|
|
447
447
|
readonly Link: typeof Link;
|
|
448
448
|
/**
|
|
449
|
-
* A crumb that is not a link
|
|
449
|
+
* A crumb that is not a link: a level with no page of its own, such as a
|
|
450
450
|
* section whose index URL only redirects. Renders a `<span>` with no
|
|
451
451
|
* `aria-current` and no link semantics.
|
|
452
452
|
*
|
|
@@ -469,7 +469,7 @@ declare const Breadcrumb: {
|
|
|
469
469
|
*/
|
|
470
470
|
readonly Label: typeof Label;
|
|
471
471
|
/**
|
|
472
|
-
* The current page
|
|
472
|
+
* The current page (the last crumb). Renders a `<span>` (not a link) with
|
|
473
473
|
* `aria-current="page"`; the ARIA is the part's whole contract and is not
|
|
474
474
|
* overridable.
|
|
475
475
|
*
|
|
@@ -526,7 +526,7 @@ declare const Breadcrumb: {
|
|
|
526
526
|
/**
|
|
527
527
|
* A placeholder crumb for a label that is still loading: one `<li>` as a
|
|
528
528
|
* crumb-sized pulsing bar, plus a screen-reader-only `role="status"`
|
|
529
|
-
* announcement. `w-24` by default
|
|
529
|
+
* announcement. `w-24` by default. Pass a `w-*` utility for your
|
|
530
530
|
* best-guess width, so the row's shape holds when the real crumb arrives.
|
|
531
531
|
*
|
|
532
532
|
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#breadcrumbskeleton
|
|
@@ -547,7 +547,7 @@ declare const Breadcrumb: {
|
|
|
547
547
|
readonly Skeleton: typeof BreadcrumbSkeleton;
|
|
548
548
|
};
|
|
549
549
|
/**
|
|
550
|
-
* One crumb a route contributes
|
|
550
|
+
* One crumb a route contributes: a discriminated union on `kind`. Create
|
|
551
551
|
* these with {@link routeBreadcrumb}; the factory stamps the discriminant, so
|
|
552
552
|
* no call site hand-writes one.
|
|
553
553
|
*
|
|
@@ -570,8 +570,8 @@ type Crumb = {
|
|
|
570
570
|
to?: string;
|
|
571
571
|
} | {
|
|
572
572
|
/**
|
|
573
|
-
* A prefix crumb: it names a level with no page of its own
|
|
574
|
-
* whose index URL only redirects
|
|
573
|
+
* A prefix crumb: it names a level with no page of its own (a section
|
|
574
|
+
* whose index URL only redirects), so the renderer draws it as a
|
|
575
575
|
* non-link `Breadcrumb.Label`.
|
|
576
576
|
*/
|
|
577
577
|
kind: "label";
|
|
@@ -596,7 +596,7 @@ type Crumb = {
|
|
|
596
596
|
/**
|
|
597
597
|
* Creates the crumb a route contributes: a link crumb, whose omitted `to`
|
|
598
598
|
* resolves to the contributing route's own `pathname`. Two members cover the
|
|
599
|
-
* crumbs that are not plain links
|
|
599
|
+
* crumbs that are not plain links: `routeBreadcrumb.label` for a section
|
|
600
600
|
* prefix that never links, and `routeBreadcrumb.content` for a trail segment
|
|
601
601
|
* that renders itself from fetched data.
|
|
602
602
|
*
|
|
@@ -611,7 +611,7 @@ type Crumb = {
|
|
|
611
611
|
* ```tsx
|
|
612
612
|
* routeBreadcrumb("Endpoints"); // links to the contributing route's pathname
|
|
613
613
|
* routeBreadcrumb("Endpoints", { to: "/endpoints" }); // links to an explicit path
|
|
614
|
-
* routeBreadcrumb.label("Settings"); // never links
|
|
614
|
+
* routeBreadcrumb.label("Settings"); // never links; renders as Breadcrumb.Label
|
|
615
615
|
* routeBreadcrumb.content(<AppTrail appId="app_123" />); // renders its own items from query data
|
|
616
616
|
* ```
|
|
617
617
|
*/
|
|
@@ -619,7 +619,7 @@ declare const routeBreadcrumb: ((label: ReactNode, options?: {
|
|
|
619
619
|
to?: string;
|
|
620
620
|
}) => Crumb) & {
|
|
621
621
|
/**
|
|
622
|
-
* Creates a prefix crumb
|
|
622
|
+
* Creates a prefix crumb: one that never links. The renderer draws it as
|
|
623
623
|
* a non-link `Breadcrumb.Label`.
|
|
624
624
|
*
|
|
625
625
|
* @example
|
|
@@ -629,7 +629,7 @@ declare const routeBreadcrumb: ((label: ReactNode, options?: {
|
|
|
629
629
|
*/
|
|
630
630
|
label: (label: ReactNode) => Crumb;
|
|
631
631
|
/**
|
|
632
|
-
* Creates a content crumb
|
|
632
|
+
* Creates a content crumb: a complete rendered trail segment, for labels
|
|
633
633
|
* and links that only exist in fetched data. The node decides link vs
|
|
634
634
|
* current page itself, because the trail builder cannot see inside it.
|
|
635
635
|
*
|
|
@@ -671,7 +671,7 @@ declare const routeBreadcrumb: ((label: ReactNode, options?: {
|
|
|
671
671
|
type RouteBreadcrumb<TMatch = unknown> = string | ((match: TMatch) => ReadonlyArray<Crumb>);
|
|
672
672
|
/**
|
|
673
673
|
* The `handle` shape a route exports to appear in the trail. Omitting `handle`
|
|
674
|
-
* entirely is the opt-out
|
|
674
|
+
* entirely is the opt-out, with no filter list to maintain.
|
|
675
675
|
*
|
|
676
676
|
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#routebreadcrumb
|
|
677
677
|
*
|
|
@@ -701,12 +701,12 @@ type BreadcrumbMatch = {
|
|
|
701
701
|
id: string;
|
|
702
702
|
/** The URL portion this route matched. */
|
|
703
703
|
pathname: string;
|
|
704
|
-
/** The route module's `handle` export
|
|
704
|
+
/** The route module's `handle` export (`unknown` until narrowed). */
|
|
705
705
|
handle: unknown;
|
|
706
706
|
};
|
|
707
707
|
/**
|
|
708
|
-
* A crumb with its link and React key resolved
|
|
709
|
-
* consumes. Link crumbs carry a definite `to`; label crumbs carry none, which
|
|
708
|
+
* A crumb with its link and React key resolved (what a trail renderer
|
|
709
|
+
* consumes). Link crumbs carry a definite `to`; label crumbs carry none, which
|
|
710
710
|
* is what makes an unlinked link crumb unrepresentable.
|
|
711
711
|
*
|
|
712
712
|
* @see https://mantle.ngrok.com/components/navigation/breadcrumb#buildcrumbs
|
|
@@ -755,7 +755,7 @@ declare function hasBreadcrumb<TMatch extends BreadcrumbMatch>(match: TMatch): m
|
|
|
755
755
|
*
|
|
756
756
|
* Pure: no hooks, no browser APIs, no clock. It runs identically on the
|
|
757
757
|
* server and the client, which is the whole reason the trail needs no state
|
|
758
|
-
* and no effects
|
|
758
|
+
* and no effects. You can also assert the trail as a plain value.
|
|
759
759
|
* Router-agnostic: it reads only {@link BreadcrumbMatch}'s three fields, which
|
|
760
760
|
* react-router's `UIMatch` satisfies structurally.
|
|
761
761
|
*
|
package/dist/breadcrumb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-
|
|
1
|
+
"use client";import{t as e}from"./use-isomorphic-layout-effect-CL6iq0Bj.js";import{t}from"./use-composed-refs-DPYmLDSe.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./icon-xb7d9M7X.js";import{t as a}from"./skeleton-DHfyjuQi.js";import{t as o}from"./slot-B7rwscwd.js";import{c as s}from"react/compiler-runtime";import{cloneElement as c,isValidElement as l,useEffect as u,useRef as d}from"react";import{jsx as f}from"react/jsx-runtime";import{CaretRightIcon as p}from"@phosphor-icons/react/CaretRight";const m=e=>{let t=s(18),i,a,c,l,u,d;t[0]===e?(i=t[1],a=t[2],c=t[3],l=t[4],u=t[5],d=t[6]):({asChild:i,children:a,className:c,"data-slot":l,ref:d,...u}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=c,t[4]=l,t[5]=u,t[6]=d);let p=i?o:`nav`,m;t[7]===l?m=t[8]:(m=r(l,`breadcrumb`),t[7]=l,t[8]=m);let h;t[9]===c?h=t[10]:(h=n(`min-w-0`,c),t[9]=c,t[10]=h);let g;return t[11]!==p||t[12]!==a||t[13]!==u||t[14]!==d||t[15]!==m||t[16]!==h?(g=/* @__PURE__ */ f(p,{ref:d,"data-slot":m,"aria-label":`Breadcrumb`,className:h,...u,children:a}),t[11]=p,t[12]=a,t[13]=u,t[14]=d,t[15]=m,t[16]=h,t[17]=g):g=t[17],g};function h(e,t){let n=e.scrollWidth-e.clientWidth;return n===t||e.contains(document.activeElement)?t:(e.scrollLeft=n,n)}const g={Root:m,List:i=>{let a=s(21),c,l,p,m,g,_;a[0]===i?(c=a[1],l=a[2],p=a[3],m=a[4],g=a[5],_=a[6]):({asChild:c,children:l,className:p,"data-slot":m,ref:_,...g}=i,a[0]=i,a[1]=c,a[2]=l,a[3]=p,a[4]=m,a[5]=g,a[6]=_);let v=c?o:`ol`,y=d(null),b=t(y,_),x=d(void 0),S;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{let e=y.current;e!=null&&(x.current=h(e,x.current))},a[7]=S):S=a[7],e(S);let C,w;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{let e=y.current;if(e==null)return;let t=new ResizeObserver(()=>{x.current=h(e,x.current)});return t.observe(e),()=>{t.disconnect()}},w=[],a[8]=C,a[9]=w):(C=a[8],w=a[9]),u(C,w);let T;a[10]===m?T=a[11]:(T=r(m,`breadcrumb-list`),a[10]=m,a[11]=T);let E;a[12]===p?E=a[13]:(E=n(`text-muted flex items-center gap-1.5 text-sm`,`scroll-fade-x min-w-0 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,`scroll-px-10`,p),a[12]=p,a[13]=E);let D;return a[14]!==v||a[15]!==l||a[16]!==b||a[17]!==g||a[18]!==T||a[19]!==E?(D=/* @__PURE__ */ f(v,{ref:b,"data-slot":T,className:E,...g,children:l}),a[14]=v,a[15]=l,a[16]=b,a[17]=g,a[18]=T,a[19]=E,a[20]=D):D=a[20],D},Item:e=>{let t=s(18),i,a,c,l,u,d;t[0]===e?(i=t[1],a=t[2],c=t[3],l=t[4],u=t[5],d=t[6]):({asChild:i,children:a,className:c,"data-slot":l,ref:d,...u}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=c,t[4]=l,t[5]=u,t[6]=d);let p=i?o:`li`,m;t[7]===l?m=t[8]:(m=r(l,`breadcrumb-item`),t[7]=l,t[8]=m);let h;t[9]===c?h=t[10]:(h=n(`inline-flex shrink-0 items-center gap-1.5`,c),t[9]=c,t[10]=h);let g;return t[11]!==p||t[12]!==a||t[13]!==u||t[14]!==d||t[15]!==m||t[16]!==h?(g=/* @__PURE__ */ f(p,{ref:d,"data-slot":m,className:h,...u,children:a}),t[11]=p,t[12]=a,t[13]=u,t[14]=d,t[15]=m,t[16]=h,t[17]=g):g=t[17],g},Link:e=>{let t=s(18),i,a,c,l,u,d;t[0]===e?(i=t[1],a=t[2],c=t[3],l=t[4],u=t[5],d=t[6]):({asChild:i,children:a,className:c,"data-slot":l,ref:d,...u}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=c,t[4]=l,t[5]=u,t[6]=d);let p=i?o:`a`,m;t[7]===l?m=t[8]:(m=r(l,`breadcrumb-link`),t[7]=l,t[8]=m);let h;t[9]===c?h=t[10]:(h=n(`hover:text-strong transition-colors`,c),t[9]=c,t[10]=h);let g;return t[11]!==p||t[12]!==a||t[13]!==u||t[14]!==d||t[15]!==m||t[16]!==h?(g=/* @__PURE__ */ f(p,{ref:d,"data-slot":m,className:h,...u,children:a}),t[11]=p,t[12]=a,t[13]=u,t[14]=d,t[15]=m,t[16]=h,t[17]=g):g=t[17],g},Label:e=>{let t=s(18),i,a,c,l,u,d;t[0]===e?(i=t[1],a=t[2],c=t[3],l=t[4],u=t[5],d=t[6]):({asChild:i,children:a,className:c,"data-slot":l,ref:d,...u}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=c,t[4]=l,t[5]=u,t[6]=d);let p=i?o:`span`,m;t[7]===l?m=t[8]:(m=r(l,`breadcrumb-label`),t[7]=l,t[8]=m);let h;t[9]===c?h=t[10]:(h=n(`text-muted`,c),t[9]=c,t[10]=h);let g;return t[11]!==p||t[12]!==a||t[13]!==u||t[14]!==d||t[15]!==m||t[16]!==h?(g=/* @__PURE__ */ f(p,{ref:d,"data-slot":m,className:h,...u,children:a}),t[11]=p,t[12]=a,t[13]=u,t[14]=d,t[15]=m,t[16]=h,t[17]=g):g=t[17],g},Page:e=>{let t=s(21),i,a,u,d,p,m;t[0]===e?(i=t[1],a=t[2],u=t[3],d=t[4],p=t[5],m=t[6]):({asChild:i,children:a,className:u,"data-slot":d,ref:m,...p}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=u,t[4]=d,t[5]=p,t[6]=m);let h=i?o:`span`,g;t[7]!==i||t[8]!==a?(g=i&&l(a)?c(a,{"aria-current":`page`}):a,t[7]=i,t[8]=a,t[9]=g):g=t[9];let _=g,v;t[10]===d?v=t[11]:(v=r(d,`breadcrumb-page`),t[10]=d,t[11]=v);let y;t[12]===u?y=t[13]:(y=n(`text-muted`,u),t[12]=u,t[13]=y);let b;return t[14]!==h||t[15]!==_||t[16]!==p||t[17]!==m||t[18]!==v||t[19]!==y?(b=/* @__PURE__ */ f(h,{ref:m,"data-slot":v,className:y,...p,"aria-current":`page`,children:_}),t[14]=h,t[15]=_,t[16]=p,t[17]=m,t[18]=v,t[19]=y,t[20]=b):b=t[20],b},Separator:e=>{let t=s(21),a,u,d,m,h,g;t[0]===e?(a=t[1],u=t[2],d=t[3],m=t[4],h=t[5],g=t[6]):({asChild:a,children:u,className:d,"data-slot":m,ref:g,...h}=e,t[0]=e,t[1]=a,t[2]=u,t[3]=d,t[4]=m,t[5]=h,t[6]=g);let _=a?o:`li`,v;t[7]!==a||t[8]!==u?(v=a&&l(u)?c(u,{role:`presentation`,"aria-hidden":`true`}):u??/* @__PURE__ */ f(i,{svg:/* @__PURE__ */ f(p,{}),className:`size-3.5`}),t[7]=a,t[8]=u,t[9]=v):v=t[9];let y=v,b;t[10]===m?b=t[11]:(b=r(m,`breadcrumb-separator`),t[10]=m,t[11]=b);let x;t[12]===d?x=t[13]:(x=n(`shrink-0`,d),t[12]=d,t[13]=x);let S;return t[14]!==_||t[15]!==y||t[16]!==h||t[17]!==g||t[18]!==b||t[19]!==x?(S=/* @__PURE__ */ f(_,{ref:g,"data-slot":b,className:x,...h,role:`presentation`,"aria-hidden":`true`,children:y}),t[14]=_,t[15]=y,t[16]=h,t[17]=g,t[18]=b,t[19]=x,t[20]=S):S=t[20],S},Skeleton:e=>{let t=s(18),i,o,c,l,u;t[0]===e?(i=t[1],o=t[2],c=t[3],l=t[4],u=t[5]):({className:i,"data-slot":o,label:u,ref:l,...c}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=c,t[4]=l,t[5]=u);let d=u===void 0?`Loading breadcrumbs…`:u,p;t[6]===o?p=t[7]:(p=r(o,`breadcrumb-skeleton`),t[6]=o,t[7]=p);let m;t[8]===i?m=t[9]:(m=n(`w-24 shrink-0`,i),t[8]=i,t[9]=m);let h;t[10]===d?h=t[11]:(h=/* @__PURE__ */ f(`span`,{role:`status`,className:`sr-only`,children:d}),t[10]=d,t[11]=h);let g;return t[12]!==c||t[13]!==l||t[14]!==p||t[15]!==m||t[16]!==h?(g=/* @__PURE__ */ f(a,{asChild:!0,"aria-hidden":!1,children:/* @__PURE__ */ f(`li`,{ref:l,"data-slot":p,className:m,...c,children:h})}),t[12]=c,t[13]=l,t[14]=p,t[15]=m,t[16]=h,t[17]=g):g=t[17],g}},_=Object.assign((e,t={})=>({kind:`link`,label:e,...t}),{label:e=>({kind:`label`,label:e}),content:e=>({kind:`content`,content:e})});function v(e){let{handle:t}=e;if(typeof t!=`object`||!t||!(`breadcrumb`in t))return!1;let{breadcrumb:n}=t;return typeof n==`string`||typeof n==`function`}function y(e){return e.filter(v).flatMap(e=>{let{breadcrumb:t}=e.handle;return(typeof t==`string`?[_(t)]:t(e)).map((t,n)=>{let r=`${e.id}:${n}`;return t.kind===`content`?{kind:`content`,key:r,content:t.content}:t.kind===`label`?{kind:`label`,key:r,label:t.label}:{kind:`link`,key:r,label:t.label,to:t.to??e.pathname}})})}export{g as Breadcrumb,y as buildCrumbs,v as hasBreadcrumb,_ as routeBreadcrumb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./use-is-hydrated-BeLOGKwE.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n():i}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return typeof window<`u`&&typeof document<`u`}export{e as t};
|
package/dist/browser-only.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{t as e}from"./browser-only-CZfkNw5A.js";import{t}from"./browser-only-ymFoM3Ya.js";export{e as BrowserOnly,t as canUseDOM};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./button-
|
|
2
|
-
import "./button-
|
|
1
|
+
import "./button-Ddj6yr10.js";
|
|
2
|
+
import "./button-DnYv7IOT.js";
|
|
3
3
|
import { r as VariantProps } from "./index-KJ06KK6t.js";
|
|
4
4
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
5
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
5
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
6
6
|
import { ComponentProps } from "react";
|
|
7
7
|
declare const buttonGroupVariants: (props?: ({
|
|
8
8
|
appearance?: "ghost" | "outlined" | "panel" | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./booleanish-BfvnW6vy.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{n as r,r as i}from"./button-DNLTJ32M.js";import{t as a}from"./slot-B7rwscwd.js";import{t as o}from"./button-BQZ6eoD3.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,isValidElement as u}from"react";import d from"tiny-invariant";import{jsx as f}from"react/jsx-runtime";import{CircleNotchIcon as p}from"@phosphor-icons/react/CircleNotch";const m=m=>{let h=s(58),g,_,v,y,b,x,S,C,w,T,E,D,O,k,A;h[0]===m?(g=h[1],_=h[2],v=h[3],y=h[4],b=h[5],x=h[6],S=h[7],C=h[8],w=h[9],T=h[10],E=h[11],D=h[12],O=h[13],k=h[14],A=h[15]):({"aria-disabled":g,"data-slot":x,appearance:v,asChild:D,children:y,className:b,disabled:_,icon:w,intent:S,isLoading:O,label:C,ref:E,size:k,type:A,...T}=m,h[0]=m,h[1]=g,h[2]=_,h[3]=v,h[4]=y,h[5]=b,h[6]=x,h[7]=S,h[8]=C,h[9]=w,h[10]=T,h[11]=E,h[12]=D,h[13]=O,h[14]=k,h[15]=A);let j=D!==void 0&&D,M=O!==void 0&&O,N=k===void 0?`md`:k,P;h[16]!==g||h[17]!==_||h[18]!==M?(P=e(_??M)||e(g),h[16]=g,h[17]=_,h[18]=M,h[19]=P):P=h[19];let F=P,I;h[20]===x?I=h[21]:(I=n(x,`icon-button`),h[20]=x,h[21]=I);let L;h[22]!==v||h[23]!==b||h[24]!==S||h[25]!==M||h[26]!==N?(L=t(o({appearance:v,intent:S,isLoading:M,size:N}),b),h[22]=v,h[23]=b,h[24]=S,h[25]=M,h[26]=N,h[27]=L):L=h[27];let R=F?``:void 0,z=M?``:void 0,B;h[28]!==v||h[29]!==F||h[30]!==S||h[31]!==C||h[32]!==T||h[33]!==E||h[34]!==N||h[35]!==I||h[36]!==L||h[37]!==R||h[38]!==z?(B={"aria-disabled":F,"data-slot":I,className:L,"data-appearance":v,"data-disabled":R,"data-icon-button":!0,"data-intent":S,"data-loading":z,"data-size":N,ref:E,...T,"aria-label":C},h[28]=v,h[29]=F,h[30]=S,h[31]=C,h[32]=T,h[33]=E,h[34]=N,h[35]=I,h[36]=L,h[37]=R,h[38]=z,h[39]=B):B=h[39];let V=B,H=M?`loading`:`idle`,U;h[40]===Symbol.for(`react.memo_cache_sentinel`)?(U=/* @__PURE__ */ f(p,{className:`animate-spin`}),h[40]=U):U=h[40];let W;h[41]===w?W=h[42]:(W={idle:w,loading:U},h[41]=w,h[42]=W);let G;h[43]!==H||h[44]!==W?(G=/* @__PURE__ */ f(i,{active:H,icons:W}),h[43]=H,h[44]=W,h[45]=G):G=h[45];let K=G;if(j){d(u(y)&&c.only(y),"When using `asChild`, IconButton must be passed a single child as a JSX tag.");let e;h[46]!==y||h[47]!==F||h[48]!==K?(e=l(y,F?r:{},K),h[46]=y,h[47]=F,h[48]=K,h[49]=e):e=h[49];let t;return h[50]!==V||h[51]!==e?(t=/* @__PURE__ */ f(a,{...V,children:e}),h[50]=V,h[51]=e,h[52]=t):t=h[52],t}let q=A??`button`,J;return h[53]!==V||h[54]!==F||h[55]!==K||h[56]!==q?(J=/* @__PURE__ */ f(`button`,{...V,disabled:F,type:q,children:K}),h[53]=V,h[54]=F,h[55]=K,h[56]=q,h[57]=J):J=h[57],J};export{m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-B7rwscwd.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(`border-form inline-flex items-center rounded-md`,{variants:{appearance:{panel:`bg-form gap-0.5 border p-0.75 [--icon-button-border-radius:0.125rem] [&>.separator]:mx-px`,ghost:`gap-0.5`,outlined:``}}}),s=a=>{let s=r(20),c,l,u,d,f,p,m;s[0]===a?(c=s[1],l=s[2],u=s[3],d=s[4],f=s[5],p=s[6],m=s[7]):({"data-slot":f,appearance:c,asChild:l,className:d,children:u,ref:m,...p}=a,s[0]=a,s[1]=c,s[2]=l,s[3]=u,s[4]=d,s[5]=f,s[6]=p,s[7]=m);let h=l?n:`div`,g;s[8]===f?g=s[9]:(g=t(f,`button-group`),s[8]=f,s[9]=g);let _;s[10]!==c||s[11]!==d?(_=e(o({appearance:c}),d),s[10]=c,s[11]=d,s[12]=_):_=s[12];let v;return s[13]!==h||s[14]!==u||s[15]!==p||s[16]!==m||s[17]!==g||s[18]!==_?(v=/* @__PURE__ */ i(h,{"data-slot":g,className:_,ref:m,...p,children:u}),s[13]=h,s[14]=u,s[15]=p,s[16]=m,s[17]=g,s[18]=_,s[19]=v):v=s[19],v};export{s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./booleanish-BfvnW6vy.js";import{t}from"./clsx-DUGZgXfJ.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as ee}from"./icon-xb7d9M7X.js";import{t as i}from"./slot-B7rwscwd.js";import{c as a}from"react/compiler-runtime";import{Children as o,cloneElement as s,isValidElement as c}from"react";import l from"tiny-invariant";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{CircleNotchIcon as m}from"@phosphor-icons/react/CircleNotch";const h=e=>{let t=a(20),i,o,s,c,l;t[0]===e?(i=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":s,active:i,className:o,icons:c,...l}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u;t[6]===s?u=t[7]:(u=r(s,`icon-swap`),t[6]=s,t[7]=u);let f;t[8]===o?f=t[9]:(f=n(`inline-grid shrink-0 place-items-center`,o),t[8]=o,t[9]=f);let p;t[10]===c?p=t[11]:(p=Object.entries(c),t[10]=c,t[11]=p);let m;t[12]!==i||t[13]!==p?(m=p.map(e=>{let[t,r]=e,a=t===i;return/* @__PURE__ */ d(`span`,{"data-slot":`icon-swap-item`,"data-state":a?`active`:`inactive`,"aria-hidden":!a||void 0,className:n(`col-start-1 row-start-1 grid place-items-center`,`motion-safe:transition-[opacity,scale,filter,visibility] motion-safe:duration-200 motion-safe:ease-out-strong`,`data-state-inactive:opacity-0 motion-safe:data-state-inactive:scale-50 motion-safe:data-state-inactive:blur-[2px] motion-safe:data-state-inactive:duration-150`,`data-state-inactive:invisible`,`data-state-inactive:*:paused`),children:/* @__PURE__ */ d(ee,{svg:r})},t)}),t[12]=i,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==l||t[16]!==u||t[17]!==f||t[18]!==m?(h=/* @__PURE__ */ d(`span`,{"data-slot":u,className:f,...l,children:m}),t[15]=l,t[16]=u,t[17]=f,t[18]=m,t[19]=h):h=t[19],h},te=p(``,{variants:{appearance:{filled:`bg-filled-accent text-white focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover border border-transparent text-sm font-medium`,ghost:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border border-transparent text-sm font-medium`,outlined:`border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border text-sm font-medium`,link:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link border-transparent`},isLoading:{false:``,true:`opacity-50`},intent:{accent:``,danger:``,neutral:``},size:{xs:``,sm:``,md:``,lg:``,xl:``}},defaultVariants:{isLoading:!1,size:`md`},compoundVariants:[{appearance:[`filled`,`ghost`,`outlined`],size:`xs`,class:`h-6 px-2`},{appearance:[`filled`,`ghost`,`outlined`],size:`sm`,class:`h-7 px-2.5`},{appearance:[`filled`,`ghost`,`outlined`],size:`md`,class:`h-9 px-3`},{appearance:[`filled`,`ghost`,`outlined`],size:`lg`,class:`h-10 px-3.5`},{appearance:[`filled`,`ghost`,`outlined`],size:`xl`,class:`h-12 px-4`},{appearance:`ghost`,intent:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 border-transparent`},{appearance:`outlined`,intent:`danger`,class:`border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700`},{appearance:`filled`,intent:`danger`,class:`bg-filled-danger focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover border-transparent`},{appearance:`link`,intent:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger`},{appearance:`ghost`,intent:`neutral`,class:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`},{appearance:`outlined`,intent:`neutral`,class:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600 focus-visible:not-disabled:active:border-accent-600`},{appearance:`filled`,intent:`neutral`,class:`bg-filled-neutral not-disabled:hover:bg-filled-neutral-hover border-transparent focus-visible:border-transparent text-neutral-50`},{appearance:`link`,intent:`neutral`,class:`text-strong focus-visible:ring-focus-accent`}]}),ne={xs:`ps-1.5`,sm:`ps-2`,md:`ps-2.5`,lg:`ps-3`,xl:`ps-3.5`},re={xs:`pe-1.5`,sm:`pe-2`,md:`pe-2.5`,lg:`pe-3`,xl:`pe-3.5`},g=p=>{let g=a(68),_,v,y,b,x,S,C,w,T,E,D,O,k,A,j;g[0]===p?(_=g[1],v=g[2],y=g[3],b=g[4],x=g[5],S=g[6],C=g[7],w=g[8],T=g[9],E=g[10],D=g[11],O=g[12],k=g[13],A=g[14],j=g[15]):({"aria-disabled":_,"data-slot":C,appearance:y,asChild:b,children:x,className:S,disabled:v,icon:T,iconPlacement:O,intent:w,isLoading:k,ref:D,size:A,type:j,...E}=p,g[0]=p,g[1]=_,g[2]=v,g[3]=y,g[4]=b,g[5]=x,g[6]=S,g[7]=C,g[8]=w,g[9]=T,g[10]=E,g[11]=D,g[12]=O,g[13]=k,g[14]=A,g[15]=j);let M=O===void 0?`start`:O,N=k!==void 0&&k,P=A===void 0?`md`:A,F;g[16]!==_||g[17]!==v||g[18]!==N?(F=e(v??N)||e(_),g[16]=_,g[17]=v,g[18]=N,g[19]=F):F=g[19];let I=F,L;g[20]===Symbol.for(`react.memo_cache_sentinel`)?(L=/* @__PURE__ */ d(m,{className:`animate-spin`}),g[20]=L):L=g[20];let ae=L,R=M===`end`&&`order-last`,z;g[21]===R?z=g[22]:(z=t(R),g[21]=R,g[22]=z);let B=z,V;g[23]!==B||g[24]!==N||g[25]!==T?(V=T?/* @__PURE__ */ d(h,{active:N?`loading`:`idle`,icons:{idle:T,loading:ae},className:B}):N&&/* @__PURE__ */ d(ee,{svg:ae,className:B}),g[23]=B,g[24]=N,g[25]=T,g[26]=V):V=g[26];let H=V,U=H&&y!==`link`,W;g[27]===C?W=g[28]:(W=r(C,`button`),g[27]=C,g[28]=W);let G;g[29]!==y||g[30]!==S||g[31]!==U||g[32]!==M||g[33]!==w||g[34]!==N||g[35]!==P?(G=n(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`,te({appearance:y,intent:w,isLoading:N,size:P}),y!==`link`&&`font-sans`,U&&M===`start`&&ne[P],U&&M===`end`&&re[P],S),g[29]=y,g[30]=S,g[31]=U,g[32]=M,g[33]=w,g[34]=N,g[35]=P,g[36]=G):G=g[36];let K=I?``:void 0,q=N?``:void 0,J=y===`link`?void 0:P,Y;g[37]!==y||g[38]!==I||g[39]!==w||g[40]!==E||g[41]!==D||g[42]!==G||g[43]!==K||g[44]!==q||g[45]!==J||g[46]!==W?(Y={"aria-disabled":I,"data-slot":W,className:G,"data-appearance":y,"data-disabled":K,"data-intent":w,"data-loading":q,"data-size":J,ref:D,...E},g[37]=y,g[38]=I,g[39]=w,g[40]=E,g[41]=D,g[42]=G,g[43]=K,g[44]=q,g[45]=J,g[46]=W,g[47]=Y):Y=g[47];let X=Y;if(b){l(c(x)&&o.only(x),"When using `asChild`, Button must be passed a single child as a JSX tag.");let e;if(g[48]!==x||g[49]!==I||g[50]!==H){let t;g[52]===x.props.children?t=g[53]:(t=/* @__PURE__ */ d(`span`,{"data-slot":`button-label`,className:`contents`,children:x.props.children}),g[52]=x.props.children,g[53]=t);let n;g[54]!==H||g[55]!==t?(n=/* @__PURE__ */ f(u,{children:[H,t]}),g[54]=H,g[55]=t,g[56]=n):n=g[56],e=s(x,I?ie:{},n),g[48]=x,g[49]=I,g[50]=H,g[51]=e}else e=g[51];let t;return g[57]!==X||g[58]!==e?(t=/* @__PURE__ */ d(i,{...X,children:e}),g[57]=X,g[58]=e,g[59]=t):t=g[59],t}let Z=j??`button`,Q;g[60]===x?Q=g[61]:(Q=/* @__PURE__ */ d(`span`,{"data-slot":`button-label`,className:`contents`,children:x}),g[60]=x,g[61]=Q);let $;return g[62]!==X||g[63]!==I||g[64]!==H||g[65]!==Z||g[66]!==Q?($=/* @__PURE__ */ f(`button`,{...X,disabled:I,type:Z,children:[H,Q]}),g[62]=X,g[63]=I,g[64]=H,g[65]=Z,g[66]=Q,g[67]=$):$=g[67],$},ie={tabIndex:-1,onClickCapture:e=>{e.preventDefault(),e.stopPropagation()}};export{ie as n,h as r,g as t};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
2
|
import { r as VariantProps } from "./index-KJ06KK6t.js";
|
|
3
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
3
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
4
4
|
import { ComponentProps, ReactNode } from "react";
|
|
5
5
|
/**
|
|
6
6
|
* The tone axis of the text-labelled button family (`Button` and
|
|
7
|
-
* `SplitButton`)
|
|
7
|
+
* `SplitButton`): the purpose a button's color communicates to the user.
|
|
8
8
|
*
|
|
9
|
-
* - `"neutral"
|
|
9
|
+
* - `"neutral"`: the workhorse tone: routine and secondary actions, and the
|
|
10
10
|
* default primary action (`appearance="filled" intent="neutral"`)
|
|
11
|
-
* - `"accent"
|
|
11
|
+
* - `"accent"`: deliberate brand emphasis, colored with the accent tokens
|
|
12
12
|
* (e.g. `bg-filled-accent`, `text-accent-600`); reach for it when an
|
|
13
13
|
* action should carry the brand color, not as the routine primary
|
|
14
|
-
* - `"danger"
|
|
14
|
+
* - `"danger"`: a destructive or irreversible action
|
|
15
15
|
*
|
|
16
16
|
* There is no default: `intent` is a required prop on the button family so
|
|
17
17
|
* every call site states the tone it means. `IconButton` takes the narrower
|
|
18
|
-
* `IconButtonIntent
|
|
18
|
+
* `IconButtonIntent`: an icon carries no text to name the action a tone
|
|
19
19
|
* colors, so it draws the neutral tone only.
|
|
20
20
|
*
|
|
21
21
|
* See `decisions/2026-07-13-button-size-and-intent-api.md`.
|
|
@@ -33,10 +33,10 @@ type ButtonIntent = "accent" | "danger" | "neutral";
|
|
|
33
33
|
* The visual style of a `Button`: how much visual weight the button carries,
|
|
34
34
|
* independent of its tone (`intent`).
|
|
35
35
|
*
|
|
36
|
-
* - `"filled"
|
|
37
|
-
* - `"outlined"
|
|
38
|
-
* - `"ghost"
|
|
39
|
-
* - `"link"
|
|
36
|
+
* - `"filled"`: solid fill; the heaviest weight on the page
|
|
37
|
+
* - `"outlined"`: bordered on the form background
|
|
38
|
+
* - `"ghost"`: no border or fill until hovered
|
|
39
|
+
* - `"link"`: renders like an inline link (inherits surrounding typography)
|
|
40
40
|
* while remaining a button that runs an action
|
|
41
41
|
*/
|
|
42
42
|
type ButtonAppearance = "filled" | "ghost" | "link" | "outlined";
|
|
@@ -52,8 +52,8 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
|
52
52
|
*/
|
|
53
53
|
type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance" | "intent"> & WithAsChild & {
|
|
54
54
|
/**
|
|
55
|
-
* The visual style of the Button. Required
|
|
56
|
-
* every call site states the weight it means.
|
|
55
|
+
* The visual style of the Button. Required: there is no default, so
|
|
56
|
+
* every call site states the visual weight it means.
|
|
57
57
|
*
|
|
58
58
|
* @enum
|
|
59
59
|
* - `"filled"`: solid fill; the heaviest visual weight
|
|
@@ -63,12 +63,12 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
63
63
|
*/
|
|
64
64
|
appearance: ButtonAppearance;
|
|
65
65
|
/**
|
|
66
|
-
* The tone of the Button
|
|
67
|
-
* user. Required
|
|
66
|
+
* The tone of the Button (the purpose its color communicates to the
|
|
67
|
+
* user). Required: there is no default, so every call site states the
|
|
68
68
|
* tone it means.
|
|
69
69
|
*
|
|
70
70
|
* @enum
|
|
71
|
-
* - `"neutral"`: the workhorse tone
|
|
71
|
+
* - `"neutral"`: the workhorse tone: routine and secondary actions, and the default primary action (`appearance="filled" intent="neutral"`)
|
|
72
72
|
* - `"accent"`: deliberate brand emphasis; reach for it when an action should carry the brand color, not as the routine primary
|
|
73
73
|
* - `"danger"`: a destructive or irreversible action
|
|
74
74
|
*/
|
|
@@ -84,7 +84,7 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
84
84
|
* The icon gets `size-5`. A size class on the icon element wins, as in
|
|
85
85
|
* `icon={<GearIcon className="size-4" />}`.
|
|
86
86
|
*
|
|
87
|
-
* For an icon-only button, do not use `Button
|
|
87
|
+
* For an icon-only button, do not use `Button`. Use `IconButton`
|
|
88
88
|
* instead: it requires an accessible `label` and renders a square box
|
|
89
89
|
* on the same shared size scale.
|
|
90
90
|
*/
|
|
@@ -97,7 +97,7 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
97
97
|
iconPlacement?: "start" | "end";
|
|
98
98
|
/**
|
|
99
99
|
* The behavior of the button when activated. Defaults to `"button"`, so the
|
|
100
|
-
* button does not accidentally submit a surrounding `<form
|
|
100
|
+
* button does not accidentally submit a surrounding `<form>`. Pass
|
|
101
101
|
* `type="submit"` to submit a form, or `type="reset"` to reset it.
|
|
102
102
|
*
|
|
103
103
|
* When `asChild` is used, `type` has no effect and is not forwarded to the
|
|
@@ -120,14 +120,14 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
120
120
|
* other assistive technology. Once activated, it then runs an action, such
|
|
121
121
|
* as submitting a form or opening a dialog.
|
|
122
122
|
*
|
|
123
|
-
* `appearance` (visual weight) and `intent` (tone) are required
|
|
123
|
+
* `appearance` (visual weight) and `intent` (tone) are required: every call
|
|
124
124
|
* site states what it means; there are no implicit defaults.
|
|
125
125
|
*
|
|
126
|
-
* The primary action button should be `appearance="filled" intent="neutral"
|
|
126
|
+
* The primary action button should be `appearance="filled" intent="neutral"`,
|
|
127
127
|
* the system's default primary action. Reserve `intent="accent"` for
|
|
128
128
|
* deliberate brand emphasis.
|
|
129
129
|
*
|
|
130
|
-
* An icon-only button is not a `Button
|
|
130
|
+
* An icon-only button is not a `Button`. Use `IconButton` instead: an
|
|
131
131
|
* icon-only `Button` has no accessible name and keeps its text-box padding,
|
|
132
132
|
* while `IconButton` requires a screen-reader `label` and renders a square
|
|
133
133
|
* box on the same shared size scale.
|
|
@@ -138,11 +138,11 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
138
138
|
*
|
|
139
139
|
* **Structure.** `children` render inside a `<span data-slot="button-label">`,
|
|
140
140
|
* beside the `icon` slot. The span carries `display: contents`, so it lays out
|
|
141
|
-
* nothing of its own
|
|
141
|
+
* nothing of its own: every child stays a flex item of the button, and the
|
|
142
142
|
* button's `gap` still falls between them. The span exists so a newly-appearing
|
|
143
143
|
* icon inserts before an element sibling: a browser translation engine reparents
|
|
144
|
-
* text nodes, and an insert aimed at one throws. To style the label as a box
|
|
145
|
-
* `truncate` to clamp a long one
|
|
144
|
+
* text nodes, and an insert aimed at one throws. To style the label as a box
|
|
145
|
+
* (`truncate` to clamp a long one), give the slot a display of its own first, with
|
|
146
146
|
* `[&>[data-slot=button-label]]:block`.
|
|
147
147
|
*
|
|
148
148
|
* **Disabled and loading.** A native `<button>` gets the `disabled` attribute.
|
|
@@ -178,7 +178,7 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
178
178
|
* @see https://mantle.ngrok.com/components/actions/button
|
|
179
179
|
*
|
|
180
180
|
* @example
|
|
181
|
-
* The default primary action
|
|
181
|
+
* The default primary action (filled + neutral):
|
|
182
182
|
* ```tsx
|
|
183
183
|
* <Button appearance="filled" intent="neutral" onClick={handleClick}>
|
|
184
184
|
* Click me
|
|
@@ -186,7 +186,7 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
186
186
|
* ```
|
|
187
187
|
*
|
|
188
188
|
* @example
|
|
189
|
-
* Submit a form
|
|
189
|
+
* Submit a form. Opt in with `type="submit"` (the default `"button"` does not submit):
|
|
190
190
|
* ```tsx
|
|
191
191
|
* <Button type="submit" appearance="filled" intent="neutral">
|
|
192
192
|
* Save
|
|
@@ -228,7 +228,7 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
228
228
|
* ```
|
|
229
229
|
*
|
|
230
230
|
* @example
|
|
231
|
-
* Icon-only buttons are not `Button`s
|
|
231
|
+
* Icon-only buttons are not `Button`s. Use `IconButton` instead (an icon-only
|
|
232
232
|
* `Button` has no accessible name and keeps its text-box padding):
|
|
233
233
|
* ```tsx
|
|
234
234
|
* // ❌ <Button appearance="outlined" intent="neutral" icon={<CopyIcon />} onClick={copyPage} />
|