@ngrok/mantle 0.93.7 → 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 +73 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1234 -84
- package/dist/alert-BkJHDx9X.js +1 -0
- package/dist/{alert-BcSBNR3S.d.ts → alert-D0zRRUHV.d.ts} +35 -25
- package/dist/alert-center.d.ts +67 -55
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +35 -10
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +6 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-Dc6IgvXV.js +1 -0
- package/dist/anchor.d.ts +17 -5
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +33 -18
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +153 -97
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +36 -24
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +19 -7
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +155 -100
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +47 -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.d.ts +8 -0
- package/dist/browser-only.js +1 -1
- package/dist/{button-BX-4lYUn.d.ts → button-5Pc7Mby_.d.ts} +4 -4
- package/dist/button-B9bChDgl.js +1 -0
- package/dist/button-D8jixIbH.js +1 -0
- package/dist/button-DNLTJ32M.js +1 -0
- package/dist/{button-CPsKGDK0.d.ts → button-Ddj6yr10.d.ts} +34 -27
- package/dist/{button-Yxyu1XMd.d.ts → button-DnYv7IOT.d.ts} +29 -22
- package/dist/button.d.ts +9 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +8 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +7 -2
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +34 -23
- package/dist/centered-layout.js +1 -1
- package/dist/chart-BLCqzt56.js +1 -0
- package/dist/chart-CChZiCrt.js +1 -0
- package/dist/chart-CUmSu9d7.js +1 -0
- package/dist/{chart-BpfbtOUN.d.ts → chart-Dl8gFo_D.d.ts} +117 -121
- package/dist/chart-DtgZBAas.js +2 -0
- package/dist/checkbox-Cu5cgZmk.js +1 -0
- package/dist/checkbox.d.ts +15 -2
- package/dist/checkbox.js +1 -1
- package/dist/choice-CCVG2hb9.js +1 -0
- package/dist/{choice-BLR0_MeB.d.ts → choice-CNiOSzqV.d.ts} +26 -20
- package/dist/choice.d.ts +6 -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 +28 -19
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +6 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +16 -3
- package/dist/code.js +1 -1
- package/dist/color-CHZbU1Ww.js +1 -0
- package/dist/color.js +1 -1
- package/dist/combobox.d.ts +42 -28
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +59 -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/cx.js +1 -1
- package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
- package/dist/data-table.d.ts +83 -52
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +13 -2
- package/dist/description-list.js +1 -1
- package/dist/{dialog-2fRO4ca4.d.ts → dialog-CIEuwNys.d.ts} +32 -8
- package/dist/dialog-CbEEA0fl.d.ts +32 -0
- package/dist/dialog-DmzoDfY3.js +1 -0
- package/dist/dialog.d.ts +7 -2
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-CpjRwMWe.d.ts → dropdown-menu-CeY498yk.d.ts} +41 -33
- package/dist/dropdown-menu-uheL0prz.js +1 -0
- package/dist/dropdown-menu.d.ts +6 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +7 -2
- package/dist/empty.js +1 -1
- package/dist/field-Bpvn4tQp.js +1 -0
- package/dist/{field-V_gnkcmN.d.ts → field-BshcNVe_.d.ts} +1 -1
- package/dist/field-Cai_4c1l.js +1 -0
- package/dist/field.d.ts +53 -42
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +11 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +35 -10
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +25 -14
- package/dist/hover-card.js +1 -1
- package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
- package/dist/{icon-ByLVhdYq.d.ts → icon-DuIYoyft.d.ts} +8 -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 +8 -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 +13 -1
- package/dist/icons.js +1 -1
- package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
- package/dist/{index-BhfgyurF.d.ts → index-KJ06KK6t.d.ts} +3 -3
- package/dist/input-BjCDSOPA.js +1 -0
- package/dist/{input-Dx5owTCc.d.ts → input-DC4nW0Sr.d.ts} +12 -2
- package/dist/input-fW8QSZEO.js +1 -0
- package/dist/input.d.ts +37 -5
- package/dist/input.js +1 -1
- package/dist/kbd-P1nQshWo.js +1 -0
- package/dist/kbd.d.ts +17 -5
- package/dist/kbd.js +1 -1
- package/dist/label-DO1RlMKl.js +1 -0
- package/dist/{label-Dn5CPJUj.d.ts → label-epgtywRz.d.ts} +14 -8
- package/dist/label.d.ts +6 -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 +147 -90
- package/dist/line-chart.js +1 -1
- package/dist/list-cQZPSjfz.js +1 -0
- package/dist/list.d.ts +34 -16
- package/dist/list.js +1 -1
- package/dist/live-region-Dhapu8a5.js +1 -0
- package/dist/live-region.d.ts +15 -2
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +82 -79
- package/dist/main-CHyWYDak.js +1 -0
- package/dist/main.d.ts +13 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +133 -88
- package/dist/media-object.d.ts +16 -4
- package/dist/media-object.js +1 -1
- 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 +42 -29
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +20 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +93 -4
- package/dist/pagination.js +1 -1
- package/dist/{popover-BfB2I9G0.d.ts → popover-Bei0jyfH.d.ts} +87 -12
- package/dist/popover-DhgunktK.js +1 -0
- package/dist/popover-T2EyaqGK.d.ts +1 -0
- package/dist/popover.d.ts +7 -2
- package/dist/popover.js +1 -1
- package/dist/primitive-D8CzV_Ft.js +1 -0
- package/dist/progress.d.ts +28 -11
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +11 -3
- package/dist/qr-code.js +1 -1
- package/dist/query-filter.d.ts +6 -6
- package/dist/query.d.ts +9 -4
- package/dist/query.js +1 -1
- package/dist/radio-group-BJQ6EOqh.d.ts +27 -0
- package/dist/radio-group-BliblUqe.js +1 -0
- package/dist/radio-group-ggEkCi0V.js +1 -0
- package/dist/radio-group.d.ts +21 -100
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +43 -30
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-D4PL5_GR.js +1 -0
- package/dist/sandboxed-on-click.d.ts +8 -0
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +137 -76
- 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-1xuUx_os.js +1 -0
- package/dist/{select-BkhBxtOT.d.ts → select-BpaXHxJm.d.ts} +33 -25
- package/dist/select.d.ts +6 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +29 -18
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-D9AWEkcJ.d.ts → separator-Ck4sPrdN.d.ts} +4 -2
- package/dist/separator-DnvhwY2J.js +1 -0
- package/dist/separator.d.ts +6 -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 +36 -7
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +53 -37
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-DHfyjuQi.js +1 -0
- package/dist/skeleton.d.ts +15 -4
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +12 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +11 -1
- package/dist/slider.js +1 -1
- package/dist/slot-B7rwscwd.js +1 -0
- package/dist/{slot-C0OCJjdJ.d.ts → slot-BEMQMbk3.d.ts} +6 -4
- package/dist/slot.d.ts +6 -1
- package/dist/slot.js +1 -1
- package/dist/source-all.css +5 -1
- package/dist/split-button.d.ts +20 -9
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +35 -22
- package/dist/strata.js +1 -1
- package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
- package/dist/switch.d.ts +14 -2
- package/dist/switch.js +1 -1
- package/dist/table-BnLdXUai.js +1 -0
- package/dist/{table-vT6Okwfa.d.ts → table-Ii9hHUWN.d.ts} +84 -5
- package/dist/table.d.ts +6 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +24 -12
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +12 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-BNdZl352.js +1 -0
- package/dist/theme-switcher.d.ts +18 -4
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +25 -11
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +15 -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-NcLIeBy5.d.ts → tooltip-CstGDKwy.d.ts} +18 -11
- package/dist/tooltip-DQO40Mrq.js +1 -0
- package/dist/tooltip.d.ts +6 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.d.ts +28 -14
- package/dist/truncated-text.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.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 +14 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +7 -2
- package/dist/well.js +1 -1
- package/package.json +21 -7
- package/src/components/chart/d3-license.md +25 -0
- package/dist/alert-P9lwn25X.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-B8k98Pby.js +0 -1
- package/dist/button-Dge0D5bl.js +0 -1
- package/dist/chart-BpWfQAwf.js +0 -2
- package/dist/checkbox-DmSQXs26.js +0 -1
- package/dist/choice-2Lrv8_nl.js +0 -1
- package/dist/code-DUJzSl4K.js +0 -1
- package/dist/compose-refs-sFdxsL7k.js +0 -1
- package/dist/dialog-7TUgiSzX.js +0 -1
- package/dist/dialog-Dp0QGWwo.d.ts +0 -28
- package/dist/dropdown-menu-BHBzCDSZ.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-CDLz5lpI.js +0 -1
- package/dist/icons-CSwTVV2m.js +0 -1
- package/dist/icons-DP3lQw5O.js +0 -1
- package/dist/input-CpQ6jlpI.js +0 -1
- package/dist/kbd-CLHsJ99p.js +0 -1
- package/dist/label-nHqqYS7e.js +0 -1
- package/dist/layer-container-kEQiE4zV.js +0 -1
- package/dist/list-RFRIQxU2.js +0 -1
- package/dist/live-region-DQ1QLv3L.js +0 -1
- package/dist/main-CC1L9IsH.js +0 -1
- package/dist/popover-C96V8SXi.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/sandboxed-on-click-C7pPu-2M.js +0 -1
- package/dist/select-CAAYk4Yj.js +0 -1
- package/dist/separator-DfzxVutO.js +0 -1
- package/dist/sheet-CSJc_sB4.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-C-glc5Q-.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-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-DceYk1Id.js +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
3
|
+
import { t as Color } from "./index-BZhHLrBi.js";
|
|
3
4
|
import { ComponentProps, ReactNode } from "react";
|
|
4
5
|
/**
|
|
5
6
|
* Shared types for the internal canvas chart engine.
|
|
6
7
|
*
|
|
7
|
-
* This module is internal shared implementation
|
|
8
|
+
* This module is internal shared implementation. It is not exported from the
|
|
8
9
|
* package. The public components built on it are `BarChart` (../bar-chart),
|
|
9
10
|
* `LineChart` (../line-chart), `AreaChart` (../area-chart), and
|
|
10
11
|
* `ScatterPlot` (../scatter-plot), mirroring how `dialog/primitive` backs
|
|
@@ -16,7 +17,7 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
16
17
|
*/
|
|
17
18
|
type XValue = string | number | Date;
|
|
18
19
|
/**
|
|
19
|
-
* A single row of chart data
|
|
20
|
+
* A single row of chart data: any object shape. Series read one numeric key
|
|
20
21
|
* per row; the x key identifies the row's position on the x axis. Missing
|
|
21
22
|
* keys and `null` values are rendered as gaps. Typed as `object` (not an
|
|
22
23
|
* index signature) so interface-typed rows compose without ceremony; reads
|
|
@@ -26,10 +27,10 @@ type ChartDatum = object;
|
|
|
26
27
|
/**
|
|
27
28
|
* How x values map onto the x axis:
|
|
28
29
|
*
|
|
29
|
-
* - `"band"
|
|
30
|
-
* - `"point"
|
|
31
|
-
* - `"linear"
|
|
32
|
-
* - `"time"
|
|
30
|
+
* - `"band"`: categorical bands with air between them (bar charts).
|
|
31
|
+
* - `"point"`: categorical positions with no band thickness (line/area over categories).
|
|
32
|
+
* - `"linear"`: continuous numeric axis.
|
|
33
|
+
* - `"time"`: continuous time axis with calendar-aware ticks.
|
|
33
34
|
*/
|
|
34
35
|
type XScaleKind = "band" | "point" | "linear" | "time";
|
|
35
36
|
/**
|
|
@@ -42,31 +43,21 @@ type ContinuousXScale = Exclude<XScaleKind, "band">;
|
|
|
42
43
|
*/
|
|
43
44
|
type SeriesMark = "bar" | "line" | "area" | "scatter";
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* overflow and folded-tail series.
|
|
48
|
-
*/
|
|
49
|
-
type ChartColorToken = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | "chart-other";
|
|
50
|
-
/**
|
|
51
|
-
* A series' visual identity slot. Slots `1` through `8` pair one validated
|
|
52
|
-
* chart color with one point shape. `"other"` selects the shared neutral
|
|
53
|
-
* overflow treatment.
|
|
54
|
-
*/
|
|
55
|
-
type ChartSeriesSlot = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | "other";
|
|
56
|
-
/**
|
|
57
|
-
* A series color: one of the validated chart tokens (preferred — they adapt to
|
|
58
|
-
* the light and dark themes) or any CSS color string as an escape hatch.
|
|
46
|
+
* A series color: a mantle color name, the same `Color` that `Badge` takes, or
|
|
47
|
+
* any CSS color string as an escape hatch.
|
|
59
48
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
49
|
+
* A name paints that color's chart token, `--color-chart-<name>`: the color's
|
|
50
|
+
* 600 step in light mode and its 500 step in dark mode. Most names reach 3:1
|
|
51
|
+
* contrast on the card surface, and the docs list the names that do not.
|
|
52
|
+
* Mantle does not guarantee that any set of names stays apart for a
|
|
53
|
+
* color-blind reader. Functional names (`success`, `danger`, …) alias the hue
|
|
54
|
+
* their status color uses. `neutral` is the color for an "Other" series.
|
|
63
55
|
*
|
|
64
|
-
* A static color (raw hex) cannot follow the two themes, so prefer a
|
|
56
|
+
* A static CSS color (raw hex) cannot follow the two themes, so prefer a
|
|
65
57
|
* `var(--your-token)` a consumer declares per theme. A series that carries
|
|
66
|
-
* good/bad meaning (error rate, pass/fail) should wear
|
|
67
|
-
* colors, never a categorical chart slot.
|
|
58
|
+
* good/bad meaning (error rate, pass/fail) should wear a functional color.
|
|
68
59
|
*/
|
|
69
|
-
type SeriesColor =
|
|
60
|
+
type SeriesColor = Color | (string & {});
|
|
70
61
|
/**
|
|
71
62
|
* Line/area interpolation between points.
|
|
72
63
|
*/
|
|
@@ -76,10 +67,7 @@ type CurveKind = "linear" | "monotone" | "step";
|
|
|
76
67
|
* the hover dot on line/area charts. Shape is a redundant encoding alongside
|
|
77
68
|
* color, so series stay distinguishable without color vision.
|
|
78
69
|
*
|
|
79
|
-
*
|
|
80
|
-
* the pairing: a series that sets no `shape` wears the glyph of the slot it
|
|
81
|
-
* holds — slot 1 the circle, slot 2 the square, on down to slot 8 and the
|
|
82
|
-
* star. The shared `"chart-other"` treatment uses the circle.
|
|
70
|
+
* A series that sets no `shape` wears the circle.
|
|
83
71
|
*
|
|
84
72
|
* What each added name draws:
|
|
85
73
|
*
|
|
@@ -98,25 +86,25 @@ type PointShape = "circle" | "square" | "triangle" | "diamond" | "triangle-down"
|
|
|
98
86
|
* The fill texture a bar series wears: solid color (the default), diagonal
|
|
99
87
|
* hatch lines at 45° (`"hatch"`), the 135° mirror (`"hatch-reverse"`), both
|
|
100
88
|
* (`"crosshatch"`), rungs perpendicular to the bar's length
|
|
101
|
-
* (`"perpendicular"
|
|
102
|
-
* it (`"parallel"
|
|
89
|
+
* (`"perpendicular"`: horizontal lines on vertical bars), rungs parallel to
|
|
90
|
+
* it (`"parallel"`: vertical lines on vertical bars), the orthogonal lattice
|
|
103
91
|
* of both rung directions (`"grid"`), or an offset dot field (`"dots"`).
|
|
104
92
|
*
|
|
105
93
|
* The two rung textures flip with `orientation`, in opposite senses. Every
|
|
106
|
-
* other value is direction-free, `"grid"` included
|
|
107
|
-
* lattice against `"crosshatch"`'s diagonal one.
|
|
108
|
-
* palette's eight series slots.
|
|
94
|
+
* other value is direction-free, `"grid"` included. It is the orthogonal
|
|
95
|
+
* lattice against `"crosshatch"`'s diagonal one.
|
|
109
96
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* distinguishable without color vision, in
|
|
113
|
-
* colors.
|
|
97
|
+
* A textured series paints its marks in the full series color over a light
|
|
98
|
+
* tint of it. Texture is a redundant identity encoding alongside color, so
|
|
99
|
+
* grouped and stacked series stay distinguishable without color vision, in
|
|
100
|
+
* grayscale print, and under forced colors. Two series can share one color and
|
|
101
|
+
* stay apart by texture.
|
|
114
102
|
*/
|
|
115
103
|
type BarTexture = "solid" | "hatch" | "hatch-reverse" | "crosshatch" | "perpendicular" | "parallel" | "grid" | "dots";
|
|
116
104
|
/**
|
|
117
105
|
* The direction a bar chart's bars run: vertical columns rising from a bottom
|
|
118
106
|
* baseline (the default), or horizontal bars growing rightward from a left
|
|
119
|
-
* baseline
|
|
107
|
+
* baseline: the layout for long category labels, which move into the left
|
|
120
108
|
* gutter at full width instead of colliding under the plot.
|
|
121
109
|
*/
|
|
122
110
|
type BarOrientation = "vertical" | "horizontal";
|
|
@@ -128,17 +116,13 @@ type SeriesMeta = {
|
|
|
128
116
|
dataKey: string;
|
|
129
117
|
label: string;
|
|
130
118
|
mark: SeriesMark;
|
|
131
|
-
/** The CSS color string the series paints with (token
|
|
119
|
+
/** The CSS color string the series paints with (a color name resolves to its chart token). */
|
|
132
120
|
color: string;
|
|
133
|
-
/** The color as authored (
|
|
121
|
+
/** The color as authored (a color name or a CSS string) before resolution. */
|
|
134
122
|
colorInput: SeriesColor;
|
|
135
123
|
/**
|
|
136
124
|
* The point glyph the series wears (scatter marks, legend keys, hover
|
|
137
|
-
* dots)
|
|
138
|
-
* series slot.
|
|
139
|
-
*
|
|
140
|
-
* A bar paints no glyph. Its legend key wears `texture` instead, so nothing
|
|
141
|
-
* draws the glyph a bar series is paired with.
|
|
125
|
+
* dots). A bar paints no glyph; its legend key wears `texture` instead.
|
|
142
126
|
*/
|
|
143
127
|
shape: PointShape;
|
|
144
128
|
/** The fill texture the series wears (bar marks and their legend keys). */
|
|
@@ -169,7 +153,7 @@ type YTickContext = {
|
|
|
169
153
|
};
|
|
170
154
|
/**
|
|
171
155
|
* The hover/keyboard snapshot published by the engine. One snapshot describes
|
|
172
|
-
* the active x position and every series' value at it
|
|
156
|
+
* the active x position and every series' value at it. The tooltip, the
|
|
173
157
|
* aria-live announcement, and `onDatumActivate` all read from it.
|
|
174
158
|
*/
|
|
175
159
|
type HoverSnapshot = {
|
|
@@ -192,6 +176,11 @@ type HoverSnapshot = {
|
|
|
192
176
|
value: number | null;
|
|
193
177
|
color: string;
|
|
194
178
|
}>;
|
|
179
|
+
/**
|
|
180
|
+
* The sum of every series' value at the active index. Set only on a stacked
|
|
181
|
+
* chart with two or more series, where the tooltip leads with it.
|
|
182
|
+
*/
|
|
183
|
+
total?: number;
|
|
195
184
|
/** The depth value at the active index (3D scatter plots only). */
|
|
196
185
|
zValue?: number | null;
|
|
197
186
|
/** Whether the snapshot came from keyboard stepping (vs pointer hover). */
|
|
@@ -233,23 +222,24 @@ type YDomain = [number | "auto", number | "auto"];
|
|
|
233
222
|
* composed Tooltip part customizes the readout; omitting it never removes the
|
|
234
223
|
* hover layer, and no part removal can strip keyboard access to the data.
|
|
235
224
|
*
|
|
236
|
-
* A Root mounts dormant:
|
|
237
|
-
*
|
|
238
|
-
* the
|
|
239
|
-
*
|
|
240
|
-
* tables until a reader
|
|
225
|
+
* A Root mounts dormant: a shell of the plot, the named overlay, and the
|
|
226
|
+
* sr-only description. It builds its paint surface and its engine once it
|
|
227
|
+
* nears the viewport, takes focus, or prints, and it mounts the data table
|
|
228
|
+
* once focus lands inside it. A list of 100 charts pays for the ones a reader
|
|
229
|
+
* can see, and a table of sparklines holds no hidden tables until a reader
|
|
230
|
+
* asks for one.
|
|
241
231
|
*
|
|
242
|
-
* This module is internal shared implementation
|
|
232
|
+
* This module is internal shared implementation. It is not exported from the
|
|
243
233
|
* package.
|
|
244
234
|
*/
|
|
245
235
|
/**
|
|
246
236
|
* Every interactive chart must have an accessible name: either a direct
|
|
247
237
|
* `aria-label` or an `aria-labelledby` reference to a visible title (preferred
|
|
248
|
-
* when the chart sits under a heading
|
|
238
|
+
* when the chart sits under a heading, so no duplicated text can drift).
|
|
249
239
|
* Enforced at the type level; the name lands on the interaction overlay (the
|
|
250
|
-
* chart's single named element
|
|
251
|
-
* announces the chart twice). Decorative charts are exempt
|
|
252
|
-
* {@link ChartAccessibilityProps}.
|
|
240
|
+
* chart's single named element: the canvas itself is aria-hidden, so assistive
|
|
241
|
+
* technology never announces the chart twice). Decorative charts are exempt;
|
|
242
|
+
* see {@link ChartAccessibilityProps}.
|
|
253
243
|
*/
|
|
254
244
|
type ChartAccessibleName = {
|
|
255
245
|
"aria-label": string;
|
|
@@ -328,8 +318,8 @@ type ChartAccessibilityProps<TMode extends ChartMode = ChartMode> = {
|
|
|
328
318
|
* name and a description; only its values live in the text beside it.
|
|
329
319
|
* One hundred sparklines in a table as one hundred Tab stops is a focus
|
|
330
320
|
* order no reader wants, and a readout that only a pointer can reach
|
|
331
|
-
* fails WCAG 1.
|
|
332
|
-
* only source of its values stays `"interactive"`.
|
|
321
|
+
* fails WCAG 2.2 SC 2.1.1 (Keyboard), so `"static"` offers neither. A
|
|
322
|
+
* chart that is the only source of its values stays `"interactive"`.
|
|
333
323
|
*
|
|
334
324
|
* **`"static"`** names the plot `role="img"`, with the consumer's
|
|
335
325
|
* `aria-label` or `aria-labelledby` and an `aria-describedby` to the
|
|
@@ -346,7 +336,7 @@ type ChartAccessibilityProps<TMode extends ChartMode = ChartMode> = {
|
|
|
346
336
|
* technology (no name, no description, no table, no live region), out of
|
|
347
337
|
* the tab order, and inert to pointer and keyboard. Every series paints
|
|
348
338
|
* `--color-chart-decorative`, one neutral fill that outranks a series'
|
|
349
|
-
* `color
|
|
339
|
+
* `color`: a backdrop encodes no series identity, and a
|
|
350
340
|
* hue on values that are not information invites a reader to decode it.
|
|
351
341
|
* The token is the darkest neutral step that keeps `text-muted` over the
|
|
352
342
|
* WCAG AA floor for 14px text in both themes (4.56:1 in light, 4.93:1
|
|
@@ -369,8 +359,8 @@ type ChartAccessibilityProps<TMode extends ChartMode = ChartMode> = {
|
|
|
369
359
|
* <LineChart.Grid />
|
|
370
360
|
* <LineChart.XAxis />
|
|
371
361
|
* <LineChart.YAxis />
|
|
372
|
-
* <LineChart.Line dataKey="p50" label="p50" />
|
|
373
|
-
* <LineChart.Line dataKey="p99" label="p99" />
|
|
362
|
+
* <LineChart.Line dataKey="p50" label="p50" color="blue" />
|
|
363
|
+
* <LineChart.Line dataKey="p99" label="p99" color="emerald" />
|
|
374
364
|
* <LineChart.Tooltip />
|
|
375
365
|
* <LineChart.Legend />
|
|
376
366
|
* </LineChart.Root>
|
|
@@ -387,7 +377,7 @@ type ChartAccessibilityProps<TMode extends ChartMode = ChartMode> = {
|
|
|
387
377
|
* aria-label={`Requests for ${service.name}, last 30 days`}
|
|
388
378
|
* className="aspect-auto h-6 w-28"
|
|
389
379
|
* >
|
|
390
|
-
* <BarChart.Bar dataKey="count" label="Requests" />
|
|
380
|
+
* <BarChart.Bar dataKey="count" label="Requests" color="blue" />
|
|
391
381
|
* </BarChart.Root>
|
|
392
382
|
* <span className="text-muted text-xs tabular-nums">{compact(service.requestTotal)}</span>
|
|
393
383
|
* </div>
|
|
@@ -398,7 +388,7 @@ type ChartAccessibilityProps<TMode extends ChartMode = ChartMode> = {
|
|
|
398
388
|
* // Decorative: the message is a sibling of the chart, so AT still announces it.
|
|
399
389
|
* <div className="relative w-full">
|
|
400
390
|
* <BarChart.Root data={placeholderUsage} xKey="day" mode="decorative">
|
|
401
|
-
* <BarChart.Bar dataKey="value" />
|
|
391
|
+
* <BarChart.Bar dataKey="value" color="blue" />
|
|
402
392
|
* </BarChart.Root>
|
|
403
393
|
* <Empty.Root className="absolute inset-0 m-auto h-fit w-fit">
|
|
404
394
|
* <Empty.Title>No usage yet</Empty.Title>
|
|
@@ -418,30 +408,44 @@ type ChartAccessibilityProps<TMode extends ChartMode = ChartMode> = {
|
|
|
418
408
|
mode?: "interactive";
|
|
419
409
|
} & ChartAccessibleName & ChartInteractionProps);
|
|
420
410
|
/**
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
* it, which would silently make the required accessible name optional and
|
|
425
|
-
* erase the `mode` discriminant.
|
|
411
|
+
* The copy button part: copies the chart's data as a Markdown table.
|
|
412
|
+
*
|
|
413
|
+
* This module is internal shared implementation, not exported from the package.
|
|
426
414
|
*/
|
|
427
|
-
type
|
|
415
|
+
type CopyButtonPrimitiveProps = Omit<ComponentProps<"button">, "aria-label" | "children" | "type" | "onCopy"> & SelfClosingWithAsChild & WithDataSlot & {
|
|
428
416
|
/**
|
|
429
|
-
*
|
|
430
|
-
*
|
|
417
|
+
* Not part of the API: `label` is the single way to name the button.
|
|
418
|
+
* Typed `never` rather than only omitted because TypeScript skips
|
|
419
|
+
* excess-attribute checks for hyphenated JSX attributes; the `never`
|
|
420
|
+
* type makes the JSX call site a compile error.
|
|
431
421
|
*/
|
|
432
|
-
|
|
433
|
-
/** Override the automatic y domain. */
|
|
434
|
-
yDomain?: YDomain;
|
|
435
|
-
/** Stack the series in registration order, from the baseline out (bar/area charts). */
|
|
436
|
-
stacked?: boolean;
|
|
437
|
-
/** Animate enter/update transitions. `prefers-reduced-motion` always wins. */
|
|
438
|
-
animate?: boolean;
|
|
422
|
+
"aria-label"?: never;
|
|
439
423
|
/**
|
|
440
|
-
*
|
|
441
|
-
*
|
|
424
|
+
* The accessible name for the copy button, rendered as its `aria-label`
|
|
425
|
+
* (like the `alt` text on an `<img>`).
|
|
426
|
+
*
|
|
427
|
+
* @default "Copy data as Markdown"
|
|
442
428
|
*/
|
|
443
|
-
|
|
429
|
+
label?: string;
|
|
430
|
+
/**
|
|
431
|
+
* Callback fired after a successful copy, passes the serialized markdown.
|
|
432
|
+
*/
|
|
433
|
+
onCopy?: (value: string) => void;
|
|
434
|
+
/**
|
|
435
|
+
* Callback fired when an error occurs during copying.
|
|
436
|
+
*/
|
|
437
|
+
onCopyError?: (error: unknown) => void;
|
|
444
438
|
};
|
|
439
|
+
type LegendPrimitiveProps = Omit<ComponentProps<"div">, "children"> & {
|
|
440
|
+
/**
|
|
441
|
+
* Classes for the legend. The legend wraps its items and does not shrink.
|
|
442
|
+
* Past `max-h-16` it scrolls; set another `max-h-*` to change the bound.
|
|
443
|
+
*/
|
|
444
|
+
className?: string;
|
|
445
|
+
/** Replace the default legend items; receives the registered series. */
|
|
446
|
+
children?: (series: SeriesMeta[]) => ReactNode;
|
|
447
|
+
};
|
|
448
|
+
type ChartListPrimitiveProps = ComponentProps<"div"> & WithDataSlot;
|
|
445
449
|
type GridPrimitiveProps = {
|
|
446
450
|
/** Which gridlines to draw. */
|
|
447
451
|
lines?: GridLines;
|
|
@@ -457,7 +461,7 @@ type XAxisPrimitiveProps = {
|
|
|
457
461
|
/**
|
|
458
462
|
* Target tick count (continuous scales only; a density-derived default
|
|
459
463
|
* otherwise). Approximate: ticks land on human-friendly steps, and a linear
|
|
460
|
-
* axis whose x values are all integers never renders fractional ticks
|
|
464
|
+
* axis whose x values are all integers never renders fractional ticks:
|
|
461
465
|
* the integer step wins over the requested count.
|
|
462
466
|
*/
|
|
463
467
|
tickCount?: number;
|
|
@@ -488,10 +492,35 @@ type ReferenceLinePrimitiveProps = {
|
|
|
488
492
|
/** Line color; defaults to the neutral reference color. */
|
|
489
493
|
color?: SeriesColor;
|
|
490
494
|
};
|
|
495
|
+
/**
|
|
496
|
+
* Root props shared by every chart kind, WITHOUT the accessibility/interaction
|
|
497
|
+
* union or the data/x props. Public wrappers `Omit` from this base and
|
|
498
|
+
* re-intersect `ChartAccessibilityProps`: `Omit` over a union type flattens
|
|
499
|
+
* it, which would silently make the required accessible name optional and
|
|
500
|
+
* erase the `mode` discriminant.
|
|
501
|
+
*/
|
|
502
|
+
type ChartRootBaseProps = Omit<ComponentProps<"div">, "aria-label" | "aria-labelledby"> & WithDataSlot & {
|
|
503
|
+
/**
|
|
504
|
+
* Classes for the Root. The Root is `aspect-video` by default. To size it
|
|
505
|
+
* another way, set `aspect-auto` and a height: `className="aspect-auto h-52"`.
|
|
506
|
+
*/
|
|
507
|
+
className?: string;
|
|
508
|
+
/** Override the automatic y domain. */
|
|
509
|
+
yDomain?: YDomain;
|
|
510
|
+
/** Stack the series in registration order, from the baseline out (bar/area charts). */
|
|
511
|
+
stacked?: boolean;
|
|
512
|
+
/** Animate enter/update transitions. `prefers-reduced-motion` always wins. */
|
|
513
|
+
animate?: boolean;
|
|
514
|
+
/**
|
|
515
|
+
* Hold the previous render at reduced opacity while fresh data loads.
|
|
516
|
+
* Never swap a chart that has rendered once for a skeleton.
|
|
517
|
+
*/
|
|
518
|
+
pending?: boolean;
|
|
519
|
+
};
|
|
491
520
|
type TooltipPrimitiveProps = Omit<ComponentProps<"div">, "children"> & {
|
|
492
521
|
/** Format the x/label row of the readout. */
|
|
493
522
|
labelFormat?: (value: XValue) => ReactNode;
|
|
494
|
-
/** Format each series value. */
|
|
523
|
+
/** Format each series value. The Total row of a stacked chart passes the `dataKey` `"total"`. */
|
|
495
524
|
valueFormat?: (value: number, dataKey: string) => ReactNode;
|
|
496
525
|
/** The per-series color key: a short stroke (default) or nothing. */
|
|
497
526
|
indicator?: "line" | "none";
|
|
@@ -500,37 +529,4 @@ type TooltipPrimitiveProps = Omit<ComponentProps<"div">, "children"> & {
|
|
|
500
529
|
/** Replace the entire readout. */
|
|
501
530
|
children?: (snapshot: HoverSnapshot) => ReactNode;
|
|
502
531
|
};
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Classes for the legend. The legend wraps its items and does not shrink.
|
|
506
|
-
* Past `max-h-16` it scrolls; set another `max-h-*` to change the bound.
|
|
507
|
-
*/
|
|
508
|
-
className?: string;
|
|
509
|
-
/** Replace the default legend items; receives the registered series. */
|
|
510
|
-
children?: (series: SeriesMeta[]) => ReactNode;
|
|
511
|
-
};
|
|
512
|
-
type CopyButtonPrimitiveProps = Omit<ComponentProps<"button">, "aria-label" | "children" | "type" | "onCopy"> & SelfClosingWithAsChild & {
|
|
513
|
-
/**
|
|
514
|
-
* Not part of the API: `label` is the single way to name the button.
|
|
515
|
-
* Typed `never` rather than only omitted because TypeScript skips
|
|
516
|
-
* excess-attribute checks for hyphenated JSX attributes; the `never`
|
|
517
|
-
* type makes the JSX call site a compile error.
|
|
518
|
-
*/
|
|
519
|
-
"aria-label"?: never;
|
|
520
|
-
/**
|
|
521
|
-
* The accessible name for the copy button, rendered as its `aria-label`
|
|
522
|
-
* (like the `alt` text on an `<img>`).
|
|
523
|
-
*
|
|
524
|
-
* @default "Copy data as Markdown"
|
|
525
|
-
*/
|
|
526
|
-
label?: string;
|
|
527
|
-
/**
|
|
528
|
-
* Callback fired after a successful copy, passes the serialized markdown.
|
|
529
|
-
*/
|
|
530
|
-
onCopy?: (value: string) => void;
|
|
531
|
-
/**
|
|
532
|
-
* Callback fired when an error occurs during copying.
|
|
533
|
-
*/
|
|
534
|
-
onCopyError?: (error: unknown) => void;
|
|
535
|
-
};
|
|
536
|
-
export { CurveKind as _, GridPrimitiveProps as a, TooltipPrimitiveProps as c, BarOrientation as d, BarTexture as f, ContinuousXScale as g, ChartSeriesSlot as h, CopyButtonPrimitiveProps as i, XAxisPrimitiveProps as l, ChartDatumEvent as m, ChartMode as n, LegendPrimitiveProps as o, ChartDatum as p, ChartRootBaseProps as r, ReferenceLinePrimitiveProps as s, ChartAccessibilityProps as t, YAxisPrimitiveProps as u, PointShape as v, SeriesColor as y };
|
|
532
|
+
export { CurveKind as _, XAxisPrimitiveProps as a, LegendPrimitiveProps as c, ChartMode as d, BarOrientation as f, ContinuousXScale as g, ChartDatumEvent as h, ReferenceLinePrimitiveProps as i, CopyButtonPrimitiveProps as l, ChartDatum as m, ChartRootBaseProps as n, YAxisPrimitiveProps as o, BarTexture as p, GridPrimitiveProps as r, ChartListPrimitiveProps as s, TooltipPrimitiveProps as t, ChartAccessibilityProps as u, PointShape as v, SeriesColor as y };
|