@ngrok/mantle 0.93.6 → 0.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +13 -1
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1181 -36
- package/dist/alert-CH99Rw-R.js +1 -0
- package/dist/{alert-BcSBNR3S.d.ts → alert-HffaioZM.d.ts} +31 -21
- package/dist/alert-center.d.ts +15 -3
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +15 -2
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +6 -1
- package/dist/alert.js +1 -1
- package/dist/anchor.d.ts +12 -0
- package/dist/app-layout.d.ts +16 -1
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +144 -88
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +12 -0
- package/dist/badge.d.ts +13 -1
- package/dist/bar-chart.d.ts +144 -89
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +11 -0
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.d.ts +8 -0
- package/dist/{button-Yxyu1XMd.d.ts → button-BGwOPjGV.d.ts} +7 -1
- package/dist/{button-B8k98Pby.js → button-BWGUuWnu.js} +1 -1
- package/dist/{button-CPsKGDK0.d.ts → button-Cgf2IcEC.d.ts} +8 -1
- package/dist/button-Cu9e3SM7.js +1 -0
- package/dist/{button-BX-4lYUn.d.ts → button-K0pKc3GN.d.ts} +3 -3
- package/dist/button.d.ts +9 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +7 -0
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +6 -1
- package/dist/centered-layout.d.ts +11 -0
- package/dist/chart-BO9EwQ60.js +1 -0
- package/dist/chart-CE5Uaqz9.js +1 -0
- package/dist/chart-DCTGGlWL.js +1 -0
- package/dist/chart-DudCw24t.js +2 -0
- package/dist/{chart-BpfbtOUN.d.ts → chart-jitNqimS.d.ts} +99 -103
- package/dist/{checkbox-DmSQXs26.js → checkbox-CS504fKk.js} +1 -1
- package/dist/checkbox.d.ts +14 -1
- package/dist/checkbox.js +1 -1
- package/dist/{choice-BLR0_MeB.d.ts → choice-BwfmbepO.d.ts} +7 -1
- package/dist/choice-uyYccm0A.js +1 -0
- package/dist/choice.d.ts +6 -1
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +13 -2
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +5 -0
- package/dist/code.d.ts +13 -0
- package/dist/color-CHZbU1Ww.js +1 -0
- package/dist/color.js +1 -1
- package/dist/combobox.d.ts +28 -14
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +14 -2
- package/dist/command.js +1 -1
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +50 -19
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +12 -1
- package/dist/dialog-B9JAGy_x.d.ts +28 -0
- package/dist/{dialog-7TUgiSzX.js → dialog-CsugEt2A.js} +1 -1
- package/dist/{dialog-2fRO4ca4.d.ts → dialog-DD5H3EH1.d.ts} +10 -2
- package/dist/dialog.d.ts +7 -2
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-DHdgaw4P.js +1 -0
- package/dist/{dropdown-menu-CpjRwMWe.d.ts → dropdown-menu-DmDxYPde.d.ts} +34 -26
- package/dist/dropdown-menu.d.ts +6 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +5 -0
- package/dist/empty.js +1 -1
- package/dist/{field-V_gnkcmN.d.ts → field-BshcNVe_.d.ts} +1 -1
- package/dist/field.d.ts +17 -6
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +8 -0
- package/dist/hooks.d.ts +5 -0
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +23 -12
- package/dist/{icon-ByLVhdYq.d.ts → icon-NYvyyRMG.d.ts} +6 -0
- package/dist/icon.d.ts +7 -2
- package/dist/icon.js +1 -1
- package/dist/{icons-DP3lQw5O.js → icons-4JA-SGfv.js} +1 -1
- package/dist/icons.d.ts +13 -1
- package/dist/icons.js +1 -1
- package/dist/{index-BhfgyurF.d.ts → index-KJ06KK6t.d.ts} +3 -3
- package/dist/input-BjCDSOPA.js +1 -0
- package/dist/input-DHovzBjS.js +1 -0
- package/dist/{input-Dx5owTCc.d.ts → input-q8o5uMhW.d.ts} +11 -1
- package/dist/input.d.ts +34 -2
- package/dist/input.js +1 -1
- package/dist/kbd.d.ts +12 -0
- package/dist/{label-nHqqYS7e.js → label-DmDwzPD8.js} +1 -1
- package/dist/{label-Dn5CPJUj.d.ts → label-r2sJcSQ4.d.ts} +6 -0
- package/dist/label.d.ts +6 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.d.ts +139 -82
- package/dist/line-chart.js +1 -1
- package/dist/{list-RFRIQxU2.js → list-CO_yLdln.js} +1 -1
- package/dist/list.d.ts +19 -1
- package/dist/list.js +1 -1
- package/dist/live-region.d.ts +14 -1
- package/dist/llms.txt +78 -76
- package/dist/main.d.ts +12 -0
- package/dist/mantle.css +110 -65
- package/dist/media-object.d.ts +12 -0
- package/dist/migrations/0014-chart-named-colors.yml +1389 -0
- package/dist/migrations/0015-segmented-control.yml +788 -0
- package/dist/multi-select.d.ts +15 -2
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +17 -5
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +92 -3
- package/dist/pagination.js +1 -1
- package/dist/popover-BhTFutCz.d.ts +1 -0
- package/dist/{popover-BfB2I9G0.d.ts → popover-lwkwWcRW.d.ts} +16 -7
- package/dist/popover.d.ts +7 -2
- package/dist/progress.d.ts +27 -10
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +9 -1
- package/dist/query.d.ts +2 -2
- package/dist/query.js +1 -1
- package/dist/radio-group-jj2abc0t.js +1 -0
- package/dist/radio-group-sLz5AA9I.d.ts +27 -0
- package/dist/radio-group.d.ts +20 -99
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +14 -1
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click.d.ts +8 -0
- package/dist/scatter-plot.d.ts +126 -64
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control.d.ts +136 -0
- package/dist/segmented-control.js +1 -0
- package/dist/{select-BkhBxtOT.d.ts → select-BqmpVJJT.d.ts} +29 -21
- package/dist/select-C6Su0dU0.js +1 -0
- package/dist/select.d.ts +6 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +13 -2
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-D9AWEkcJ.d.ts → separator-QfH0ot5K.d.ts} +3 -1
- package/dist/separator.d.ts +6 -1
- package/dist/{sheet-CSJc_sB4.js → sheet-Bd2LIhzF.js} +1 -1
- package/dist/sheet.d.ts +15 -2
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +19 -3
- package/dist/sidebar.js +1 -1
- package/dist/skeleton.d.ts +11 -0
- package/dist/skip-to-main-link.d.ts +11 -0
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +10 -0
- package/dist/{slot-C0OCJjdJ.d.ts → slot-D12N_fZJ.d.ts} +3 -1
- package/dist/slot.d.ts +6 -1
- package/dist/split-button.d.ts +14 -3
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +13 -0
- package/dist/switch.d.ts +13 -1
- package/dist/switch.js +1 -1
- package/dist/{table-vT6Okwfa.d.ts → table-rWiVWEgB.d.ts} +79 -0
- package/dist/table.d.ts +6 -1
- package/dist/tabs.d.ts +23 -11
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +11 -1
- package/dist/theme-DdZgLvKH.js +1 -0
- package/dist/theme-switcher.d.ts +16 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +12 -0
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +14 -1
- package/dist/toast.js +1 -1
- package/dist/{tooltip-NcLIeBy5.d.ts → tooltip-CpK3XTor.d.ts} +15 -8
- package/dist/tooltip.d.ts +6 -1
- package/dist/truncated-text.d.ts +27 -13
- package/dist/truncated-text.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/use-inert-siblings-CNmNuS2h.js +1 -0
- package/dist/use-swipe-to-dismiss-i__cTF2v.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +13 -0
- package/dist/well.d.ts +6 -1
- package/package.json +7 -7
- package/src/components/chart/d3-license.md +25 -0
- package/dist/alert-P9lwn25X.js +0 -1
- package/dist/button-Dge0D5bl.js +0 -1
- package/dist/chart-BpWfQAwf.js +0 -2
- package/dist/choice-2Lrv8_nl.js +0 -1
- package/dist/dialog-Dp0QGWwo.d.ts +0 -28
- package/dist/dropdown-menu-BHBzCDSZ.js +0 -1
- package/dist/input-CpQ6jlpI.js +0 -1
- package/dist/popover-C96V8SXi.d.ts +0 -1
- package/dist/select-CAAYk4Yj.js +0 -1
- package/dist/theme-C-glc5Q-.js +0 -1
- package/dist/use-swipe-to-dismiss-DceYk1Id.js +0 -1
package/dist/bar-chart.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Bar Chart component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/charts/bar-chart
|
|
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-jitNqimS.js";
|
|
7
|
+
/**
|
|
8
|
+
* Props for {@link BarChart.List}.
|
|
9
|
+
*/
|
|
10
|
+
type BarChartListProps = ChartListPrimitiveProps;
|
|
2
11
|
/**
|
|
3
12
|
* Props for {@link BarChart.Root}. Bars encode value by length from a shared
|
|
4
13
|
* zero baseline, so the y domain minimum is fixed at `0` — a truncated-bar
|
|
@@ -37,31 +46,22 @@ type BarChartBarProps = {
|
|
|
37
46
|
/** Display name for the legend, tooltip, and data table. Defaults to `dataKey`. */
|
|
38
47
|
label?: string;
|
|
39
48
|
/**
|
|
40
|
-
*
|
|
41
|
-
* `
|
|
49
|
+
* The color the series paints: a mantle color name, the same `Color` that
|
|
50
|
+
* `Badge` takes, or any CSS color. Required: name every series' color on
|
|
51
|
+
* purpose. Give an "Other" series `"neutral"`, and a series that means good
|
|
52
|
+
* or bad a functional color such as `"danger"`.
|
|
42
53
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* use distinct textures to tell those bars apart.
|
|
54
|
+
* A static CSS color (raw hex) cannot follow the two themes, so prefer a
|
|
55
|
+
* `var(--your-token)` declared per theme.
|
|
46
56
|
*
|
|
47
57
|
* @example
|
|
48
58
|
* ```tsx
|
|
49
|
-
* <BarChart.Bar dataKey="errors"
|
|
59
|
+
* <BarChart.Bar dataKey="errors" label="Errors" color="danger" />
|
|
50
60
|
* ```
|
|
51
61
|
*/
|
|
52
|
-
|
|
62
|
+
color: SeriesColor;
|
|
53
63
|
/**
|
|
54
|
-
*
|
|
55
|
-
* not change the series slot. When omitted, the series paints the color from
|
|
56
|
-
* its slot.
|
|
57
|
-
*
|
|
58
|
-
* A static color (raw hex) cannot follow the two themes, so prefer a
|
|
59
|
-
* `var(--your-token)` declared per theme. A series that carries good/bad
|
|
60
|
-
* meaning should wear the semantic status colors, never a categorical slot.
|
|
61
|
-
*/
|
|
62
|
-
color?: SeriesColor;
|
|
63
|
-
/**
|
|
64
|
-
* The fill texture the series wears, on canvas and on its legend key:
|
|
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
67
|
* to the bar's length (`"perpendicular"` — horizontal lines on vertical
|
|
@@ -71,15 +71,15 @@ type BarChartBarProps = {
|
|
|
71
71
|
*
|
|
72
72
|
* The two rung textures flip with the Root's `orientation`, in opposite
|
|
73
73
|
* senses. Every other value is direction-free, `"grid"` included — it is the
|
|
74
|
-
* orthogonal lattice against `"crosshatch"`'s diagonal one.
|
|
75
|
-
* match the palette's eight series slots.
|
|
74
|
+
* orthogonal lattice against `"crosshatch"`'s diagonal one.
|
|
76
75
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
76
|
+
* A textured series paints its marks in the full series color over a light
|
|
77
|
+
* tint of it, so it reads as the light member of its color's pair. Texture
|
|
78
|
+
* is a redundant identity encoding alongside color: grouped and stacked
|
|
79
|
+
* series stay distinguishable without color vision, in grayscale print, and
|
|
80
|
+
* under forced colors. Keep it purposeful: two series of one color told
|
|
81
|
+
* apart by texture, such as In and Out traffic, or the series in a pair that
|
|
82
|
+
* color alone cannot separate.
|
|
83
83
|
*/
|
|
84
84
|
texture?: BarTexture;
|
|
85
85
|
};
|
|
@@ -113,14 +113,14 @@ type BarChartLegendProps = LegendPrimitiveProps;
|
|
|
113
113
|
*/
|
|
114
114
|
type BarChartCopyButtonProps = CopyButtonPrimitiveProps;
|
|
115
115
|
/**
|
|
116
|
-
* The root of a bar chart: owns the data, the scales, the
|
|
116
|
+
* The root of a bar chart: owns the data, the scales, the renderer,
|
|
117
117
|
* and the entire interaction contract (per-category hover with a lifted band
|
|
118
118
|
* and tooltip, keyboard stepping with polite announcements, an sr-only
|
|
119
119
|
* description, an sr-only data table, Enter/Space + click activation).
|
|
120
120
|
* Compose the chrome and series parts as children.
|
|
121
121
|
*
|
|
122
122
|
* A Root mounts dormant: a shell of the plot, the named overlay, and its
|
|
123
|
-
* sr-only description. It builds its
|
|
123
|
+
* sr-only description. It builds its paint surface and its engine
|
|
124
124
|
* once it comes within one viewport of the visible area, takes focus, or
|
|
125
125
|
* prints (on-screen charts first, a few milliseconds at a time), and it mounts
|
|
126
126
|
* the sr-only data table once focus lands inside it. A list of charts pays
|
|
@@ -128,14 +128,16 @@ type BarChartCopyButtonProps = CopyButtonPrimitiveProps;
|
|
|
128
128
|
* tables until a reader asks for one.
|
|
129
129
|
*
|
|
130
130
|
* The Root's own subtree is addressable by slot: `bar-chart` on the wrapper,
|
|
131
|
-
* then `bar-chart-plot`, `bar-chart-
|
|
131
|
+
* then `bar-chart-plot`, `bar-chart-svg`,
|
|
132
|
+
* `bar-chart-crosshair`,
|
|
132
133
|
* `bar-chart-hover-band`, `bar-chart-markers`, `bar-chart-tooltip`,
|
|
133
134
|
* `bar-chart-description`, and, once focus lands inside the chart,
|
|
134
135
|
* `bar-chart-data-table`. A bar chart shows the band and never the crosshair
|
|
135
|
-
* or the markers. The
|
|
136
|
-
* from server HTML and from a dormant chart
|
|
137
|
-
*
|
|
138
|
-
*
|
|
136
|
+
* or the markers. The surface and the three layers are engine-owned: absent
|
|
137
|
+
* from server HTML and from a dormant chart. The surface arrives at activation (near the viewport, on
|
|
138
|
+
* focus, or before print), and the layers arrive on the first hover or
|
|
139
|
+
* keyboard step. A static or decorative chart
|
|
140
|
+
* inserts the surface alone. The tooltip surface mounts on the
|
|
139
141
|
* first hover or keyboard step and stays.
|
|
140
142
|
*
|
|
141
143
|
* **Data attributes:**
|
|
@@ -160,8 +162,8 @@ type BarChartCopyButtonProps = CopyButtonPrimitiveProps;
|
|
|
160
162
|
* <BarChart.Grid />
|
|
161
163
|
* <BarChart.XAxis />
|
|
162
164
|
* <BarChart.YAxis />
|
|
163
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
164
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
165
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
166
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
165
167
|
* <BarChart.Legend />
|
|
166
168
|
* </BarChart.Root>
|
|
167
169
|
* ```
|
|
@@ -169,7 +171,7 @@ type BarChartCopyButtonProps = CopyButtonPrimitiveProps;
|
|
|
169
171
|
declare const Root: <TDatum extends ChartDatum = ChartDatum, TMode extends ChartMode = "interactive">(props: BarChartRootProps<TDatum, TMode>) => import("react").JSX.Element;
|
|
170
172
|
/**
|
|
171
173
|
* One bar series. Renders nothing itself — it registers the series with the
|
|
172
|
-
* chart, which paints it
|
|
174
|
+
* chart, which paints it. Compose one `Bar` per series; with
|
|
173
175
|
* `stacked` on the Root, bars stack from the baseline up in registration
|
|
174
176
|
* order, so a `Bar` that mounts later stacks on top whatever its position in
|
|
175
177
|
* the JSX. `texture` adds a pattern fill as a redundant identity encoding
|
|
@@ -183,15 +185,15 @@ declare const Root: <TDatum extends ChartDatum = ChartDatum, TMode extends Chart
|
|
|
183
185
|
* <BarChart.Grid />
|
|
184
186
|
* <BarChart.XAxis />
|
|
185
187
|
* <BarChart.YAxis />
|
|
186
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
187
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
188
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
189
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
188
190
|
* <BarChart.Legend />
|
|
189
191
|
* </BarChart.Root>
|
|
190
192
|
* ```
|
|
191
193
|
*/
|
|
192
194
|
declare const Bar: (props: BarChartBarProps) => null;
|
|
193
195
|
/**
|
|
194
|
-
* Hairline value gridlines behind the bars (renderless;
|
|
196
|
+
* Hairline value gridlines behind the bars (renderless; the chart paints it).
|
|
195
197
|
* The default runs perpendicular to the bars: horizontal lines for vertical
|
|
196
198
|
* bars, vertical lines for horizontal bars. Pass `lines` to force a direction.
|
|
197
199
|
* Omit the part to omit the grid.
|
|
@@ -204,14 +206,14 @@ declare const Bar: (props: BarChartBarProps) => null;
|
|
|
204
206
|
* <BarChart.Grid />
|
|
205
207
|
* <BarChart.XAxis />
|
|
206
208
|
* <BarChart.YAxis />
|
|
207
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
209
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
208
210
|
* <BarChart.Legend />
|
|
209
211
|
* </BarChart.Root>
|
|
210
212
|
* ```
|
|
211
213
|
*/
|
|
212
214
|
declare const Grid: (props: BarChartGridProps) => null;
|
|
213
215
|
/**
|
|
214
|
-
* Category labels for the bars (renderless;
|
|
216
|
+
* Category labels for the bars (renderless; the chart paints it): along the
|
|
215
217
|
* bottom for vertical bars, down the left gutter for horizontal bars. Labels
|
|
216
218
|
* that would collide are skipped, never rotated.
|
|
217
219
|
*
|
|
@@ -223,14 +225,14 @@ declare const Grid: (props: BarChartGridProps) => null;
|
|
|
223
225
|
* <BarChart.Grid />
|
|
224
226
|
* <BarChart.XAxis tickFormat={(month) => String(month).slice(0, 3)} />
|
|
225
227
|
* <BarChart.YAxis />
|
|
226
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
228
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
227
229
|
* <BarChart.Legend />
|
|
228
230
|
* </BarChart.Root>
|
|
229
231
|
* ```
|
|
230
232
|
*/
|
|
231
233
|
declare const XAxis: (props: BarChartXAxisProps) => null;
|
|
232
234
|
/**
|
|
233
|
-
* Value tick labels (renderless;
|
|
235
|
+
* Value tick labels (renderless; the chart paints it): along the left for
|
|
234
236
|
* vertical bars, across the bottom for horizontal bars. Ticks land on clean
|
|
235
237
|
* thousands-separated numbers.
|
|
236
238
|
*
|
|
@@ -242,7 +244,7 @@ declare const XAxis: (props: BarChartXAxisProps) => null;
|
|
|
242
244
|
* <BarChart.Grid />
|
|
243
245
|
* <BarChart.XAxis />
|
|
244
246
|
* <BarChart.YAxis tickFormat={(value) => `${value / 1000}k`} />
|
|
245
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
247
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
246
248
|
* <BarChart.Legend />
|
|
247
249
|
* </BarChart.Root>
|
|
248
250
|
* ```
|
|
@@ -250,7 +252,7 @@ declare const XAxis: (props: BarChartXAxisProps) => null;
|
|
|
250
252
|
declare const YAxis: (props: BarChartYAxisProps) => null;
|
|
251
253
|
/**
|
|
252
254
|
* A dashed marker at the value `y`, such as an SLO threshold, a budget, or a
|
|
253
|
-
* limit (renderless;
|
|
255
|
+
* limit (renderless; the chart paints it). It crosses the value axis: a horizontal
|
|
254
256
|
* line for vertical bars, a vertical line for horizontal bars.
|
|
255
257
|
*
|
|
256
258
|
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartreferenceline
|
|
@@ -261,7 +263,7 @@ declare const YAxis: (props: BarChartYAxisProps) => null;
|
|
|
261
263
|
* <BarChart.Grid />
|
|
262
264
|
* <BarChart.XAxis />
|
|
263
265
|
* <BarChart.YAxis />
|
|
264
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
266
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
265
267
|
* <BarChart.ReferenceLine y={250} label="Capacity" />
|
|
266
268
|
* <BarChart.Legend />
|
|
267
269
|
* </BarChart.Root>
|
|
@@ -295,7 +297,7 @@ declare const ReferenceLine: (props: BarChartReferenceLineProps) => null;
|
|
|
295
297
|
* <BarChart.Grid />
|
|
296
298
|
* <BarChart.XAxis />
|
|
297
299
|
* <BarChart.YAxis />
|
|
298
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
300
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
299
301
|
* <BarChart.Tooltip valueFormat={(value) => `${value} visits`} footer="Click to view logs" />
|
|
300
302
|
* <BarChart.Legend />
|
|
301
303
|
* </BarChart.Root>
|
|
@@ -331,8 +333,8 @@ declare const Tooltip: (props: BarChartTooltipProps) => null;
|
|
|
331
333
|
* <BarChart.Grid />
|
|
332
334
|
* <BarChart.XAxis />
|
|
333
335
|
* <BarChart.YAxis />
|
|
334
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
335
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
336
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
337
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
336
338
|
* <BarChart.Legend />
|
|
337
339
|
* </BarChart.Root>
|
|
338
340
|
* ```
|
|
@@ -351,8 +353,8 @@ declare const Legend: (props: BarChartLegendProps) => import("react").JSX.Elemen
|
|
|
351
353
|
* @example
|
|
352
354
|
* ```tsx
|
|
353
355
|
* <BarChart.Root data={data} xKey="month" aria-label="Visitors by month">
|
|
354
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
355
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
356
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
357
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
356
358
|
* <BarChart.Legend />
|
|
357
359
|
* <BarChart.CopyButton />
|
|
358
360
|
* </BarChart.Root>
|
|
@@ -360,13 +362,37 @@ declare const Legend: (props: BarChartLegendProps) => import("react").JSX.Elemen
|
|
|
360
362
|
*/
|
|
361
363
|
declare const CopyButton: (props: BarChartCopyButtonProps) => import("react").JSX.Element;
|
|
362
364
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
365
|
+
* Groups a list of charts, such as one chart per card, so they share one
|
|
366
|
+
* `role="status"` live region. A page of 100 charts mounts one region instead
|
|
367
|
+
* of one per chart, plus one for each `BarChart.CopyButton`. Each chart keeps
|
|
368
|
+
* its own tooltip, description, and data table.
|
|
369
|
+
*
|
|
370
|
+
* Renders a `div` (`bar-chart-list`) that holds the charts in a `display: contents`
|
|
371
|
+
* wrapper (`bar-chart-list-items`), so a grid or flex layout on the List reaches
|
|
372
|
+
* the cards, and the live region as its last child. No `asChild`: a list
|
|
373
|
+
* element such as `ul` cannot hold the live region as a child.
|
|
374
|
+
*
|
|
375
|
+
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartlist
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```tsx
|
|
379
|
+
* <BarChart.List>
|
|
380
|
+
* {agents.map((agent) => (
|
|
381
|
+
* <BarChart.Root key={agent.id} data={agent.rows} xKey="month" aria-label={agent.name}>
|
|
382
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
383
|
+
* <BarChart.Tooltip />
|
|
384
|
+
* </BarChart.Root>
|
|
385
|
+
* ))}
|
|
386
|
+
* </BarChart.List>
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
declare const List: (props: BarChartListProps) => import("react").JSX.Element;
|
|
390
|
+
/**
|
|
391
|
+
* A bar chart for comparing values across categories, with
|
|
392
|
+
* grouped and stacked variants. Each series names its own `color`. Interaction ships
|
|
367
393
|
* with `Root` unconditionally: a per-category tooltip, keyboard stepping,
|
|
368
394
|
* aria-live announcements, and an sr-only description. A Root builds and paints
|
|
369
|
-
* its
|
|
395
|
+
* its surface once it comes within one viewport of the visible area, takes
|
|
370
396
|
* focus, or prints, and it mounts its sr-only data table once focus lands
|
|
371
397
|
* inside it.
|
|
372
398
|
*
|
|
@@ -374,16 +400,21 @@ declare const CopyButton: (props: BarChartCopyButtonProps) => import("react").JS
|
|
|
374
400
|
*
|
|
375
401
|
* | CSS Variable | Default | Description |
|
|
376
402
|
* | --- | --- | --- |
|
|
377
|
-
* | `--color-chart
|
|
378
|
-
* | `--color-chart-other` | `--color-neutral-500` | The neutral overflow slot a series wears once every slot is held. |
|
|
403
|
+
* | `--color-chart-<name>` | per theme | The color a series with `color="<name>"` paints. Every mantle color name has one: the 600 step of its hue in light mode, and the 500 step in dark mode. Most names reach 3:1 contrast on the card surface, and the docs page lists the names that do not. |
|
|
379
404
|
*
|
|
380
405
|
* Two ways to change a series color, both public API. The `color` prop on
|
|
381
|
-
* `BarChart.Bar`
|
|
382
|
-
*
|
|
383
|
-
* `className="[--color-chart-
|
|
384
|
-
*
|
|
406
|
+
* `BarChart.Bar` takes a color name or any CSS color. To restyle a color name
|
|
407
|
+
* for one chart, redeclare its token on `Root`:
|
|
408
|
+
* `className="[--color-chart-blue:var(--color-brand)]"`. Every token resolves in
|
|
409
|
+
* `Root`'s own cascade, so a declaration scoped there wins for
|
|
385
410
|
* that chart and leaves every other chart on the page alone.
|
|
386
411
|
*
|
|
412
|
+
* @useWhen Compare values across categories, with grouped or stacked bars.
|
|
413
|
+
*
|
|
414
|
+
* @siblings
|
|
415
|
+
* - `LineChart`: the chart shows a trend across an ordered x axis, such as time.
|
|
416
|
+
* - `AreaChart`: a total and its parts change across an ordered x axis, such as time.
|
|
417
|
+
*
|
|
387
418
|
* @see https://mantle.ngrok.com/components/charts/bar-chart
|
|
388
419
|
*
|
|
389
420
|
* @example
|
|
@@ -400,6 +431,12 @@ declare const CopyButton: (props: BarChartCopyButtonProps) => import("react").JS
|
|
|
400
431
|
* └── BarChart.CopyButton
|
|
401
432
|
* ```
|
|
402
433
|
*
|
|
434
|
+
* A List groups Roots:
|
|
435
|
+
* ```
|
|
436
|
+
* BarChart.List
|
|
437
|
+
* └── BarChart.Root (one per chart)
|
|
438
|
+
* ```
|
|
439
|
+
*
|
|
403
440
|
* @example
|
|
404
441
|
* ```tsx
|
|
405
442
|
* const data = [
|
|
@@ -412,8 +449,8 @@ declare const CopyButton: (props: BarChartCopyButtonProps) => import("react").JS
|
|
|
412
449
|
* <BarChart.Grid />
|
|
413
450
|
* <BarChart.XAxis />
|
|
414
451
|
* <BarChart.YAxis />
|
|
415
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
416
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
452
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
453
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
417
454
|
* <BarChart.Tooltip />
|
|
418
455
|
* <BarChart.Legend />
|
|
419
456
|
* </BarChart.Root>
|
|
@@ -421,7 +458,7 @@ declare const CopyButton: (props: BarChartCopyButtonProps) => import("react").JS
|
|
|
421
458
|
*/
|
|
422
459
|
declare const BarChart: {
|
|
423
460
|
/**
|
|
424
|
-
* The root of a bar chart: owns the data, the scales, the
|
|
461
|
+
* The root of a bar chart: owns the data, the scales, the renderer,
|
|
425
462
|
* and the entire interaction contract.
|
|
426
463
|
*
|
|
427
464
|
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartroot
|
|
@@ -432,8 +469,8 @@ declare const BarChart: {
|
|
|
432
469
|
* <BarChart.Grid />
|
|
433
470
|
* <BarChart.XAxis />
|
|
434
471
|
* <BarChart.YAxis />
|
|
435
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
436
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
472
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
473
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
437
474
|
* <BarChart.Tooltip />
|
|
438
475
|
* <BarChart.Legend />
|
|
439
476
|
* </BarChart.Root>
|
|
@@ -441,7 +478,7 @@ declare const BarChart: {
|
|
|
441
478
|
*/
|
|
442
479
|
readonly Root: typeof Root;
|
|
443
480
|
/**
|
|
444
|
-
* One bar series; registers with the chart
|
|
481
|
+
* One bar series; registers with the chart, which paints it.
|
|
445
482
|
*
|
|
446
483
|
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartbar
|
|
447
484
|
*
|
|
@@ -451,8 +488,8 @@ declare const BarChart: {
|
|
|
451
488
|
* <BarChart.Grid />
|
|
452
489
|
* <BarChart.XAxis />
|
|
453
490
|
* <BarChart.YAxis />
|
|
454
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
455
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
491
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
492
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
456
493
|
* <BarChart.Tooltip />
|
|
457
494
|
* <BarChart.Legend />
|
|
458
495
|
* </BarChart.Root>
|
|
@@ -460,7 +497,7 @@ declare const BarChart: {
|
|
|
460
497
|
*/
|
|
461
498
|
readonly Bar: typeof Bar;
|
|
462
499
|
/**
|
|
463
|
-
* Hairline value gridlines behind the bars (renderless;
|
|
500
|
+
* Hairline value gridlines behind the bars (renderless; the chart paints it).
|
|
464
501
|
* The default runs perpendicular to the bars: horizontal lines for vertical
|
|
465
502
|
* bars, vertical lines for horizontal bars. Pass `lines` to force a direction.
|
|
466
503
|
* Omit the part to omit the grid.
|
|
@@ -473,8 +510,8 @@ declare const BarChart: {
|
|
|
473
510
|
* <BarChart.Grid />
|
|
474
511
|
* <BarChart.XAxis />
|
|
475
512
|
* <BarChart.YAxis />
|
|
476
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
477
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
513
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
514
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
478
515
|
* <BarChart.Tooltip />
|
|
479
516
|
* <BarChart.Legend />
|
|
480
517
|
* </BarChart.Root>
|
|
@@ -482,7 +519,7 @@ declare const BarChart: {
|
|
|
482
519
|
*/
|
|
483
520
|
readonly Grid: typeof Grid;
|
|
484
521
|
/**
|
|
485
|
-
* Category labels for the bars (renderless;
|
|
522
|
+
* Category labels for the bars (renderless; the chart paints it): along the
|
|
486
523
|
* bottom for vertical bars, down the left gutter for horizontal bars. Labels
|
|
487
524
|
* that would collide are skipped, never rotated.
|
|
488
525
|
*
|
|
@@ -494,8 +531,8 @@ declare const BarChart: {
|
|
|
494
531
|
* <BarChart.Grid />
|
|
495
532
|
* <BarChart.XAxis tickFormat={(month) => String(month).slice(0, 3)} />
|
|
496
533
|
* <BarChart.YAxis />
|
|
497
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
498
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
534
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
535
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
499
536
|
* <BarChart.Tooltip />
|
|
500
537
|
* <BarChart.Legend />
|
|
501
538
|
* </BarChart.Root>
|
|
@@ -503,7 +540,7 @@ declare const BarChart: {
|
|
|
503
540
|
*/
|
|
504
541
|
readonly XAxis: typeof XAxis;
|
|
505
542
|
/**
|
|
506
|
-
* Value tick labels (renderless;
|
|
543
|
+
* Value tick labels (renderless; the chart paints it): along the left for
|
|
507
544
|
* vertical bars, across the bottom for horizontal bars. Ticks land on clean
|
|
508
545
|
* thousands-separated numbers.
|
|
509
546
|
*
|
|
@@ -515,8 +552,8 @@ declare const BarChart: {
|
|
|
515
552
|
* <BarChart.Grid />
|
|
516
553
|
* <BarChart.XAxis />
|
|
517
554
|
* <BarChart.YAxis tickFormat={(value) => `${value / 1000}k`} />
|
|
518
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
519
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
555
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
556
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
520
557
|
* <BarChart.Tooltip />
|
|
521
558
|
* <BarChart.Legend />
|
|
522
559
|
* </BarChart.Root>
|
|
@@ -525,7 +562,7 @@ declare const BarChart: {
|
|
|
525
562
|
readonly YAxis: typeof YAxis;
|
|
526
563
|
/**
|
|
527
564
|
* A dashed marker at the value `y`, such as an SLO threshold, a budget, or a
|
|
528
|
-
* limit (renderless;
|
|
565
|
+
* limit (renderless; the chart paints it). It crosses the value axis: a horizontal
|
|
529
566
|
* line for vertical bars, a vertical line for horizontal bars.
|
|
530
567
|
*
|
|
531
568
|
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartreferenceline
|
|
@@ -536,7 +573,7 @@ declare const BarChart: {
|
|
|
536
573
|
* <BarChart.Grid />
|
|
537
574
|
* <BarChart.XAxis />
|
|
538
575
|
* <BarChart.YAxis />
|
|
539
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
576
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
540
577
|
* <BarChart.ReferenceLine y={250} label="Capacity" />
|
|
541
578
|
* <BarChart.Tooltip />
|
|
542
579
|
* <BarChart.Legend />
|
|
@@ -555,8 +592,8 @@ declare const BarChart: {
|
|
|
555
592
|
* <BarChart.Grid />
|
|
556
593
|
* <BarChart.XAxis />
|
|
557
594
|
* <BarChart.YAxis />
|
|
558
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
559
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
595
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
596
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
560
597
|
* <BarChart.Tooltip valueFormat={(value) => `${value} visits`} />
|
|
561
598
|
* <BarChart.Legend />
|
|
562
599
|
* </BarChart.Root>
|
|
@@ -575,8 +612,8 @@ declare const BarChart: {
|
|
|
575
612
|
* <BarChart.Grid />
|
|
576
613
|
* <BarChart.XAxis />
|
|
577
614
|
* <BarChart.YAxis />
|
|
578
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
579
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
615
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
616
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
580
617
|
* <BarChart.Tooltip />
|
|
581
618
|
* <BarChart.Legend />
|
|
582
619
|
* </BarChart.Root>
|
|
@@ -591,13 +628,31 @@ declare const BarChart: {
|
|
|
591
628
|
* @example
|
|
592
629
|
* ```tsx
|
|
593
630
|
* <BarChart.Root data={data} xKey="month" aria-label="Visitors by month">
|
|
594
|
-
* <BarChart.Bar dataKey="desktop" label="Desktop" />
|
|
595
|
-
* <BarChart.Bar dataKey="mobile" label="Mobile" />
|
|
631
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
632
|
+
* <BarChart.Bar dataKey="mobile" label="Mobile" color="emerald" />
|
|
596
633
|
* <BarChart.Legend />
|
|
597
634
|
* <BarChart.CopyButton />
|
|
598
635
|
* </BarChart.Root>
|
|
599
636
|
* ```
|
|
600
637
|
*/
|
|
601
638
|
readonly CopyButton: typeof CopyButton;
|
|
639
|
+
/**
|
|
640
|
+
* Groups a list of charts so they share one live region.
|
|
641
|
+
*
|
|
642
|
+
* @see https://mantle.ngrok.com/components/charts/bar-chart#barchartlist
|
|
643
|
+
*
|
|
644
|
+
* @example
|
|
645
|
+
* ```tsx
|
|
646
|
+
* <BarChart.List>
|
|
647
|
+
* {agents.map((agent) => (
|
|
648
|
+
* <BarChart.Root key={agent.id} data={agent.rows} xKey="month" aria-label={agent.name}>
|
|
649
|
+
* <BarChart.Bar dataKey="desktop" label="Desktop" color="blue" />
|
|
650
|
+
* <BarChart.Tooltip />
|
|
651
|
+
* </BarChart.Root>
|
|
652
|
+
* ))}
|
|
653
|
+
* </BarChart.List>
|
|
654
|
+
* ```
|
|
655
|
+
*/
|
|
656
|
+
readonly List: typeof List;
|
|
602
657
|
};
|
|
603
|
-
export { BarChart, type BarChartBarProps, type BarChartCopyButtonProps, type BarChartGridProps, type BarChartLegendProps, type BarChartReferenceLineProps, type BarChartRootProps, type BarChartTooltipProps, type BarChartXAxisProps, type BarChartYAxisProps, type ChartDatumEvent, type ChartMode };
|
|
658
|
+
export { BarChart, type BarChartBarProps, type BarChartCopyButtonProps, type BarChartGridProps, type BarChartLegendProps, type BarChartListProps, type BarChartReferenceLineProps, type BarChartRootProps, type BarChartTooltipProps, type BarChartXAxisProps, type BarChartYAxisProps, type ChartDatumEvent, type ChartMode };
|
package/dist/bar-chart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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-DudCw24t.js";import{t as u}from"./chart-DCTGGlWL.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
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Breadcrumb component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
5
|
+
*/
|
|
1
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
7
|
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
3
8
|
import { ComponentProps, ReactNode } from "react";
|
|
@@ -287,6 +292,12 @@ declare const BreadcrumbSkeleton: ({ className, "data-slot": dataSlot, label, re
|
|
|
287
292
|
* router's link via `asChild`. A trail too wide for its row scrolls sideways
|
|
288
293
|
* with faded edges instead of wrapping, and starts at the current page.
|
|
289
294
|
*
|
|
295
|
+
* @useWhen Show where the current page sits in a hierarchy, as a trail of links from a root page.
|
|
296
|
+
*
|
|
297
|
+
* @siblings
|
|
298
|
+
* - `Tabs`: the user switches between peer views of one page.
|
|
299
|
+
* - `Sidebar`: the app needs persistent navigation to its top-level pages.
|
|
300
|
+
*
|
|
290
301
|
* @see https://mantle.ngrok.com/components/navigation/breadcrumb
|
|
291
302
|
*
|
|
292
303
|
* @example
|
package/dist/breadcrumb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n as t}from"./compose-refs-sFdxsL7k.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-kK0c-POG.js";import{t as a}from"./
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n as t}from"./compose-refs-sFdxsL7k.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-kK0c-POG.js";import{t as a}from"./skeleton-DBpI-ko5.js";import{t as o}from"./slot-DdYN1L1C.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};
|
package/dist/browser-only.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Browser Only component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/primitives/browser-only
|
|
5
|
+
*/
|
|
1
6
|
import { ReactNode } from "react";
|
|
2
7
|
type Props = {
|
|
3
8
|
/**
|
|
@@ -25,6 +30,9 @@ type Props = {
|
|
|
25
30
|
* the `fallback` is rendered.
|
|
26
31
|
* - On the client, after hydration, the `children` render function is called.
|
|
27
32
|
*
|
|
33
|
+
* @useWhen Render children in the browser only, after hydration, when they read browser state such
|
|
34
|
+
* as `window` or `localStorage`.
|
|
35
|
+
*
|
|
28
36
|
* @see https://mantle.ngrok.com/components/primitives/browser-only
|
|
29
37
|
*
|
|
30
38
|
* @example
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
+
import { r as VariantProps } from "./index-KJ06KK6t.js";
|
|
2
3
|
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
3
|
-
import { r as VariantProps } from "./index-BhfgyurF.js";
|
|
4
4
|
import { ComponentProps, ReactNode } from "react";
|
|
5
5
|
/**
|
|
6
6
|
* The visual style of an `IconButton`: how much visual weight it carries.
|
|
@@ -144,6 +144,12 @@ type IconButtonProps = Omit<ComponentProps<"button">, "aria-label"> & WithAsChil
|
|
|
144
144
|
* | `data-loading` | present when `isLoading` | Presence-only, never `"false"`. |
|
|
145
145
|
* | `data-disabled` | present when disabled | Presence-only, never `"false"`, since the `data-disabled:` variant matches the attribute's existence. Set when the button resolves disabled: `disabled`, `aria-disabled="true"`, or `isLoading` with no explicit `disabled`. `disabled={false}` keeps a loading button enabled and omits it. |
|
|
146
146
|
*
|
|
147
|
+
* @useWhen Run an action from a compact button that shows one icon and no text, such as a close or
|
|
148
|
+
* a copy button.
|
|
149
|
+
*
|
|
150
|
+
* @siblings
|
|
151
|
+
* - `Button`: the button shows a text label.
|
|
152
|
+
*
|
|
147
153
|
* @see https://mantle.ngrok.com/components/actions/icon-button
|
|
148
154
|
*
|
|
149
155
|
* @example
|