@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
|
@@ -1,23 +1,23 @@
|
|
|
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 visual style of an `IconButton`: how much visual weight it carries.
|
|
7
|
-
* The union matches `Button`'s without `link
|
|
7
|
+
* The union matches `Button`'s without `link`: an icon-only link has no text
|
|
8
8
|
* to read as a link.
|
|
9
9
|
*
|
|
10
|
-
* - `"filled"
|
|
11
|
-
* - `"ghost"
|
|
12
|
-
* - `"outlined"
|
|
10
|
+
* - `"filled"`: solid fill; the heaviest weight on the page
|
|
11
|
+
* - `"ghost"`: no border or fill until hovered
|
|
12
|
+
* - `"outlined"`: bordered on the form background
|
|
13
13
|
*/
|
|
14
14
|
type IconButtonAppearance = "filled" | "ghost" | "outlined";
|
|
15
15
|
/**
|
|
16
|
-
* The tone of an `IconButton`
|
|
17
|
-
* user. Narrower than `ButtonIntent`: an icon carries no text to name the
|
|
16
|
+
* The tone of an `IconButton` (the purpose its color communicates to the
|
|
17
|
+
* user). Narrower than `ButtonIntent`: an icon carries no text to name the
|
|
18
18
|
* action a tone colors, so `IconButton` draws the neutral tone only.
|
|
19
19
|
*
|
|
20
|
-
* - `"neutral"
|
|
20
|
+
* - `"neutral"`: the workhorse tone; the only tone `IconButton` draws
|
|
21
21
|
*/
|
|
22
22
|
type IconButtonIntent = "neutral";
|
|
23
23
|
/**
|
|
@@ -50,8 +50,8 @@ type IconButtonProps = Omit<ComponentProps<"button">, "aria-label"> & WithAsChil
|
|
|
50
50
|
*/
|
|
51
51
|
"aria-label"?: never;
|
|
52
52
|
/**
|
|
53
|
-
* The visual style of the IconButton. Required
|
|
54
|
-
* so every call site states the weight it means. The union matches
|
|
53
|
+
* The visual style of the IconButton. Required: there is no default,
|
|
54
|
+
* so every call site states the visual weight it means. The union matches
|
|
55
55
|
* `Button`'s without `link`.
|
|
56
56
|
*
|
|
57
57
|
* @enum
|
|
@@ -61,13 +61,14 @@ type IconButtonProps = Omit<ComponentProps<"button">, "aria-label"> & WithAsChil
|
|
|
61
61
|
*/
|
|
62
62
|
appearance: IconButtonAppearance;
|
|
63
63
|
/**
|
|
64
|
-
* The tone of the IconButton
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* The tone of the IconButton: the purpose its color communicates to the
|
|
65
|
+
* user. Narrower than `Button`'s: `"neutral"` is the only tone
|
|
66
|
+
* `IconButton` draws, so the accent and danger tones are a type error
|
|
67
|
+
* here. Still required, so a call site reads the same on
|
|
67
68
|
* both components and keeps compiling if more tones land.
|
|
68
69
|
*
|
|
69
70
|
* @enum
|
|
70
|
-
* - `"neutral"`: the workhorse tone
|
|
71
|
+
* - `"neutral"`: the workhorse tone: routine and secondary actions
|
|
71
72
|
*/
|
|
72
73
|
intent: IconButtonIntent;
|
|
73
74
|
/**
|
|
@@ -92,7 +93,7 @@ type IconButtonProps = Omit<ComponentProps<"button">, "aria-label"> & WithAsChil
|
|
|
92
93
|
icon: ReactNode;
|
|
93
94
|
/**
|
|
94
95
|
* The behavior of the button when activated. Defaults to `"button"`, so the
|
|
95
|
-
* button does not accidentally submit a surrounding `<form
|
|
96
|
+
* button does not accidentally submit a surrounding `<form>`. Pass
|
|
96
97
|
* `type="submit"` to submit a form, or `type="reset"` to reset it.
|
|
97
98
|
*
|
|
98
99
|
* When `asChild` is used, `type` has no effect and is not forwarded to the
|
|
@@ -113,19 +114,19 @@ type IconButtonProps = Omit<ComponentProps<"button">, "aria-label"> & WithAsChil
|
|
|
113
114
|
* A button that renders one icon and nothing else. Its required `label` prop
|
|
114
115
|
* carries the accessible name.
|
|
115
116
|
*
|
|
116
|
-
* `appearance` (visual weight) and `intent` (tone) are required
|
|
117
|
+
* `appearance` (visual weight) and `intent` (tone) are required: every call
|
|
117
118
|
* site states what it means; there are no implicit defaults.
|
|
118
119
|
*
|
|
119
120
|
* `IconButton` draws all three of `Button`'s box appearances, each in the
|
|
120
121
|
* neutral tone only, and each one matches its `Button` twin. `link` stays off
|
|
121
|
-
* the union
|
|
122
|
-
* danger tones stay off `intent
|
|
122
|
+
* the union: an icon-only link has no text to read as a link. The accent and
|
|
123
|
+
* danger tones stay off `intent`: an icon carries no text to name the action
|
|
123
124
|
* a tone colors.
|
|
124
125
|
*
|
|
125
126
|
* The border radius is driven by the `--icon-button-border-radius` CSS
|
|
126
127
|
* variable (default: `0.375rem`). Wrappers can set it to slot icon buttons
|
|
127
|
-
* into their chrome
|
|
128
|
-
* `0.125rem`.
|
|
128
|
+
* into their chrome. For example, `ButtonGroup`'s panel appearance tightens
|
|
129
|
+
* it to `0.125rem`.
|
|
129
130
|
*
|
|
130
131
|
* **Disabled and loading.** A native `<button>` gets the `disabled` attribute.
|
|
131
132
|
* Under `asChild`, the child gets no `disabled` attribute, because it is inert
|
|
@@ -165,7 +166,7 @@ type IconButtonProps = Omit<ComponentProps<"button">, "aria-label"> & WithAsChil
|
|
|
165
166
|
* ```
|
|
166
167
|
*
|
|
167
168
|
* @example
|
|
168
|
-
* Submit a form
|
|
169
|
+
* Submit a form. Opt in with `type="submit"` (the default `"button"` does not submit):
|
|
169
170
|
* ```tsx
|
|
170
171
|
* <IconButton
|
|
171
172
|
* type="submit"
|
package/dist/button.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/components/actions/button
|
|
5
5
|
* @see https://mantle.ngrok.com/components/actions/icon-button
|
|
6
6
|
*/
|
|
7
|
-
import { i as ButtonIntent, n as ButtonAppearance, r as ButtonProps, t as Button } from "./button-
|
|
8
|
-
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance, t as IconButton } from "./button-
|
|
9
|
-
import { n as ButtonGroupProps, t as ButtonGroup } from "./button-
|
|
7
|
+
import { i as ButtonIntent, n as ButtonAppearance, r as ButtonProps, t as Button } from "./button-Ddj6yr10.js";
|
|
8
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance, t as IconButton } from "./button-DnYv7IOT.js";
|
|
9
|
+
import { n as ButtonGroupProps, t as ButtonGroup } from "./button-5Pc7Mby_.js";
|
|
10
10
|
import { t as ButtonSize } from "./button-L4exxu_L.js";
|
|
11
11
|
export { Button, type ButtonAppearance, ButtonGroup, type ButtonGroupProps, type ButtonIntent, type ButtonProps, type ButtonSize, IconButton, type IconButtonAppearance, type IconButtonIntent, type IconButtonProps };
|
package/dist/button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-
|
|
1
|
+
import{t as e}from"./button-DNLTJ32M.js";import{t}from"./button-B9bChDgl.js";import{t as n}from"./button-D8jixIbH.js";export{e as Button,n as ButtonGroup,t as IconButton};
|
package/dist/calendar.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/preview/calendar
|
|
5
5
|
*/
|
|
6
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
6
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
7
7
|
import { ComponentProps } from "react";
|
|
8
8
|
import { DateRange, DayPicker } from "react-day-picker";
|
|
9
9
|
/**
|
package/dist/calendar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-BQZ6eoD3.js";import{t as r}from"./icon-
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-BQZ6eoD3.js";import{t as r}from"./icon-xb7d9M7X.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as s}from"@phosphor-icons/react/CaretLeft";import{DayPicker as c}from"react-day-picker";const l=n({appearance:`ghost`,intent:`neutral`,size:`sm`});function u(e){let t=i(2),{orientation:n}=e,c;return t[0]===n?c=t[1]:(c=/* @__PURE__ */ a(r,{svg:a(n===`left`?s:o,{}),className:`size-4`}),t[0]=n,t[1]=c),c}const d={Chevron:u},f={button_next:e(l,`absolute right-0`),button_previous:e(l,`absolute left-0`),caption_label:`text-sm font-medium`,day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,range_middle:`day-range-middle not-disabled:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none not-disabled:aria-selected:hover:bg-filled-accent/25`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`};function p(n){let r=i(27),o,s,l,u,p;r[0]===n?(o=r[1],s=r[2],l=r[3],u=r[4],p=r[5]):({"data-slot":l,className:o,classNames:s,showOutsideDays:p,...u}=n,r[0]=n,r[1]=o,r[2]=s,r[3]=l,r[4]=u,r[5]=p);let m=p!==void 0&&p,h=u.mode,g;r[6]===s?g=r[7]:(g=s??{},r[6]=s,r[7]=g);let _,v;r[8]===g?(_=r[9],v=r[10]):({root:v,..._}=g,r[8]=g,r[9]=_,r[10]=v);let y;r[11]!==o||r[12]!==v?(y=e(`isolate`,o,v),r[11]=o,r[12]=v,r[13]=y):y=r[13];let b=h===`range`&&`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`,x;r[14]===b?x=r[15]:(x=e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,b),r[14]=b,r[15]=x);let S;r[16]!==_||r[17]!==y||r[18]!==x?(S={...f,root:y,day:x,..._},r[16]=_,r[17]=y,r[18]=x,r[19]=S):S=r[19];let C=S,w;r[20]===l?w=r[21]:(w=t(l,`calendar`),r[20]=l,r[21]=w);let T;return r[22]!==C||r[23]!==u||r[24]!==m||r[25]!==w?(T=/* @__PURE__ */ a(c,{"data-slot":w,animate:!1,components:d,classNames:C,showOutsideDays:m,...u}),r[22]=C,r[23]=u,r[24]=m,r[25]=w,r[26]=T):T=r[26],T}export{p as Calendar};
|
package/dist/card.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
7
7
|
import "./index-KJ06KK6t.js";
|
|
8
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
8
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
9
9
|
import { ComponentProps } from "react";
|
|
10
10
|
type CardProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
|
|
11
11
|
/**
|
package/dist/card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-
|
|
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";const a={Root:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`card`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`border-card bg-card relative rounded-md border`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Body:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`card-body`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`p-6 border-t border-card-muted first:border-t-0`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Footer:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`card-footer`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`px-6 py-3 border-t border-card-muted first:border-t-0`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Header:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`card-header`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`px-6 py-3 border-t border-card-muted first:border-t-0`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Title:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":l,className:c,asChild:s,ref:d,...u}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`h3`,p;o[6]===l?p=o[7]:(p=t(l,`card-title`),o[6]=l,o[7]=p);let m;o[8]===c?m=o[9]:(m=e(`text-strong text-base font-medium`,c),o[8]=c,o[9]=m);let h;return o[10]!==f||o[11]!==u||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{ref:d,"data-slot":p,className:m,...u}),o[10]=f,o[11]=u,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as Card};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
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 } from "react";
|
|
9
9
|
/**
|
|
10
10
|
* The outer frame of a centered page flow. Renders a `<div>` with
|
|
@@ -12,7 +12,7 @@ import { ComponentProps } from "react";
|
|
|
12
12
|
* `CenteredLayout.Notice` and `CenteredLayout.Header` (pinned top),
|
|
13
13
|
* `CenteredLayout.Body` (which grows), and `CenteredLayout.Footer` (pinned
|
|
14
14
|
* bottom). Consumers whose host requires an exact height can merge `h-full`
|
|
15
|
-
* via `className
|
|
15
|
+
* via `className`. `cx` is tailwind-merge-backed, so the override is
|
|
16
16
|
* deterministic.
|
|
17
17
|
*
|
|
18
18
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
@@ -37,22 +37,22 @@ import { ComponentProps } from "react";
|
|
|
37
37
|
*/
|
|
38
38
|
declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
39
39
|
/**
|
|
40
|
-
* A full-window-width strip pinned above everything else in the layout
|
|
41
|
-
* including `CenteredLayout.Header`
|
|
40
|
+
* A full-window-width strip pinned above everything else in the layout
|
|
41
|
+
* (including `CenteredLayout.Header`) for maintenance notices, environment
|
|
42
42
|
* warnings, and similar app-wide messaging. Renders an unstyled `<div>`
|
|
43
43
|
* (`w-full shrink-0`): the notice content brings its own colors and layout,
|
|
44
44
|
* and the part collapses to nothing when empty, so it can stay mounted and
|
|
45
45
|
* conditionally render its contents. The same slot contract as
|
|
46
46
|
* `AppLayout.Notice`, so an app-wide banner composes identically across
|
|
47
47
|
* mantle's layouts. Deliberately
|
|
48
|
-
* not named Banner
|
|
48
|
+
* not named Banner: `CenteredLayout.Header` renders the page's `<header>`
|
|
49
49
|
* (the ARIA `banner` landmark), and this part is not that. Optional: omitting
|
|
50
50
|
* it is fine.
|
|
51
51
|
*
|
|
52
52
|
* On flows that scroll (checkout, plan pickers), the strip scrolls away with
|
|
53
53
|
* the page by default; merge `sticky top-0 z-20` via `className` to pin it to
|
|
54
54
|
* the window. To pin it alongside a sticky `Header`, wrap the two strips in
|
|
55
|
-
* a single `sticky top-0` container instead
|
|
55
|
+
* a single `sticky top-0` container instead. Two elements pinned at `top-0`
|
|
56
56
|
* overlap each other once the page scrolls.
|
|
57
57
|
*
|
|
58
58
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
@@ -73,7 +73,7 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...p
|
|
|
73
73
|
*/
|
|
74
74
|
declare const Notice: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
75
75
|
/**
|
|
76
|
-
* A utility strip at the top of the layout
|
|
76
|
+
* A utility strip at the top of the layout: an account chip, a close/dismiss
|
|
77
77
|
* button, and similar page furniture for focused flows (checkout, plan
|
|
78
78
|
* pickers). Renders a semantic `<header>` (a page-level frame, so it is
|
|
79
79
|
* exposed as a `banner` landmark when not nested inside a sectioning element)
|
|
@@ -82,7 +82,7 @@ declare const Notice: ({ asChild, children, className, "data-slot": dataSlot, ..
|
|
|
82
82
|
* omitting it is fine.
|
|
83
83
|
*
|
|
84
84
|
* To pin it to the window while the page scrolls (e.g. a close button that
|
|
85
|
-
* stays reachable), merge `sticky top-0 z-10` via `className
|
|
85
|
+
* stays reachable), merge `sticky top-0 z-10` via `className`. Prefer
|
|
86
86
|
* `sticky` over `fixed`, which removes the strip from flow and underlaps the
|
|
87
87
|
* content below it.
|
|
88
88
|
*
|
|
@@ -113,7 +113,7 @@ declare const Header: ({ asChild, children, className, "data-slot": dataSlot, ..
|
|
|
113
113
|
* clipping.
|
|
114
114
|
*
|
|
115
115
|
* By convention the brand mark (a fully-styled logo/wordmark anchor) is the
|
|
116
|
-
* **first child** of `Body
|
|
116
|
+
* **first child** of `Body`. There is deliberately no `Logo` part because it
|
|
117
117
|
* would own nothing: vertical spacing comes from `Body`'s `gap-6`, and the
|
|
118
118
|
* mark arrives as already-styled JSX.
|
|
119
119
|
*
|
|
@@ -139,11 +139,11 @@ declare const Header: ({ asChild, children, className, "data-slot": dataSlot, ..
|
|
|
139
139
|
*/
|
|
140
140
|
declare const Body: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
141
141
|
/**
|
|
142
|
-
* A pinned utility strip at the bottom of the layout
|
|
142
|
+
* A pinned utility strip at the bottom of the layout: a theme switcher,
|
|
143
143
|
* legal links, and similar page furniture. Renders a semantic `<footer>`
|
|
144
|
-
* (a page-level frame, so it is exposed as a `contentinfo` landmark
|
|
144
|
+
* (a page-level frame, so it is exposed as a `contentinfo` landmark, unlike
|
|
145
145
|
* `Card.Footer`'s generic div) with `flex shrink-0 items-center px-4 py-4`.
|
|
146
|
-
* It sits **outside** the centered `flex-1` region
|
|
146
|
+
* It sits **outside** the centered `flex-1` region. That is exactly why
|
|
147
147
|
* `Body` exists as a separate part. Optional: omitting it is fine.
|
|
148
148
|
*
|
|
149
149
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
@@ -169,7 +169,7 @@ declare const Body: ({ asChild, children, className, "data-slot": dataSlot, ...p
|
|
|
169
169
|
declare const Footer: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"footer"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
170
170
|
/**
|
|
171
171
|
* A viewport-filling centered page flow for sign-in, sign-up, onboarding,
|
|
172
|
-
* 404, checkout, and other focused full-page states. It owns structure only
|
|
172
|
+
* 404, checkout, and other focused full-page states. It owns structure only:
|
|
173
173
|
* the flex/overflow skeleton and region ordering. App state (routing,
|
|
174
174
|
* sessions) never enters it, and landmark semantics stay compositional:
|
|
175
175
|
* brand marks, links, and the `Main` landmark arrive as composed JSX.
|
|
@@ -239,16 +239,16 @@ declare const CenteredLayout: {
|
|
|
239
239
|
*/
|
|
240
240
|
readonly Root: typeof Root;
|
|
241
241
|
/**
|
|
242
|
-
* A full-window-width strip pinned above everything else in the layout
|
|
243
|
-
* including `Header`
|
|
242
|
+
* A full-window-width strip pinned above everything else in the layout
|
|
243
|
+
* (including `Header`) for maintenance notices and environment warnings.
|
|
244
244
|
* Renders an unstyled `<div>` (`w-full shrink-0`): the notice content
|
|
245
245
|
* brings its own colors, and the part collapses to nothing when empty. The
|
|
246
246
|
* same slot contract as `AppLayout.Notice`, so an app-wide banner
|
|
247
247
|
* composes identically across mantle's layouts. Merge
|
|
248
|
-
* `sticky top-0 z-20` via `className` to pin it while a long flow scrolls
|
|
249
|
-
*
|
|
250
|
-
* `sticky top-0` container instead
|
|
251
|
-
* overlap once the page scrolls
|
|
248
|
+
* `sticky top-0 z-20` via `className` to pin it while a long flow scrolls.
|
|
249
|
+
* To pin it alongside a sticky `Header`, wrap the two strips in a single
|
|
250
|
+
* `sticky top-0` container instead. Two elements pinned at `top-0`
|
|
251
|
+
* overlap once the page scrolls. Optional: omitting it is fine.
|
|
252
252
|
*
|
|
253
253
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
254
254
|
*
|
|
@@ -270,9 +270,9 @@ declare const CenteredLayout: {
|
|
|
270
270
|
/**
|
|
271
271
|
* A utility strip at the top of the layout (account chip, close button)
|
|
272
272
|
* rendered as a semantic `<header>` (`banner` landmark) outside the
|
|
273
|
-
* centered `flex-1` region
|
|
273
|
+
* centered `flex-1` region, the mirror of `Footer`. Merge
|
|
274
274
|
* `sticky top-0 z-10` via `className` to pin it to the window while the
|
|
275
|
-
* page scrolls. Optional
|
|
275
|
+
* page scrolls. Optional: omitting it is fine.
|
|
276
276
|
*
|
|
277
277
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
278
278
|
*
|
|
@@ -294,7 +294,7 @@ declare const CenteredLayout: {
|
|
|
294
294
|
readonly Header: typeof Header;
|
|
295
295
|
/**
|
|
296
296
|
* The growing, centered region of the layout. By convention the brand mark
|
|
297
|
-
* (a fully-styled logo/wordmark anchor) is its **first child
|
|
297
|
+
* (a fully-styled logo/wordmark anchor) is its **first child**. Spacing
|
|
298
298
|
* comes from `Body`'s `gap-6`, so no dedicated `Logo` part exists.
|
|
299
299
|
*
|
|
300
300
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
@@ -321,7 +321,7 @@ declare const CenteredLayout: {
|
|
|
321
321
|
/**
|
|
322
322
|
* A pinned utility strip (theme switcher, legal links) rendered as a
|
|
323
323
|
* semantic `<footer>` (`contentinfo` landmark) outside the centered
|
|
324
|
-
* `flex-1` region. Optional
|
|
324
|
+
* `flex-1` region. Optional: omitting it is fine.
|
|
325
325
|
*
|
|
326
326
|
* @see https://mantle.ngrok.com/layouts/centered-layout
|
|
327
327
|
*
|
package/dist/centered-layout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-
|
|
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";const a={Root:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex min-h-full flex-col`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Notice:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-notice`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`w-full shrink-0`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Header:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`header`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-header`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex shrink-0 items-center px-4 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Body:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-body`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-1 flex-col items-center justify-center gap-6 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Footer:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`footer`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-footer`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex shrink-0 items-center px-4 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as CenteredLayout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,h as t}from"./chart-
|
|
1
|
+
import{g as e,h as t}from"./chart-DtgZBAas.js";const n=5e3,r=2e4,i=(e,r)=>{let{color:i,surface:a,shape:o,totalPointCount:s,indexes:c,xAt:l,yAt:u,radiusAt:d}=r;if(e.fillStyle=i,s>2e4){e.beginPath();for(let t of c)d(t)<=0||e.rect(l(t)-1,u(t)-1,2,2);e.fill();return}let f=s<=n;e.strokeStyle=a,e.lineWidth=2;for(let n of c){let r=d(n);r<=0||(e.beginPath(),t(e,l(n),u(n),r,o),e.fill(),f&&e.stroke())}},a=1/510,o=[1e3,4e3,16e3];let s=null,c=null;const l=()=>(c??=import(`./chart-CUmSu9d7.js`).then(e=>(s=e.Scatter3d,e.Scatter3d),e=>{throw c=null,reportError(e),e}),c);var u=class{#e;#t=null;#n=!1;#r=0;#i=null;#a=null;#o=3;#s=null;constructor(e){this.#e=e}#c(){if(this.#t==null&&s!=null){this.#t=new s(this.#e,this.#o),this.#d();let e=this.#a;this.#a=null,e!=null&&this.#t.press(e)}return this.#t!=null||this.#n?this.#t:(this.#n=!0,this.#l(),null)}async#l(){try{await l()}catch{this.#n=!1,this.#u();return}this.#n=!1,this.#c(),this.#e.requestPaint()}#u(){let e=o[this.#r];e!=null&&this.#i==null&&(this.#r+=1,this.#i=setTimeout(()=>{this.#i=null,this.#e.requestPaint()},e))}#d(){this.#i!=null&&(clearTimeout(this.#i),this.#i=null),this.#r=0}setDimensions(e,t){this.#o=e,this.#t?.setDimensions(e,t)}settle(e){this.#o=e,this.#t?.settle(e)}tick(e){return this.#t?.tick(e)??!1}resetProjection(){this.#d(),this.#t?.resetProjection()}pressAt(e,t){if(!this.#e.is3d())return!1;this.#d();let n=this.#c();return n==null?this.#a={x:e,y:t,moved:!1}:n.press({x:e,y:t,moved:!1}),!0}dragTo(e,t){let n=this.#a;return n==null?this.#t?.dragTo(e,t)??`none`:(n.moved||=Math.abs(e-n.x)+Math.abs(t-n.y)>3,`held`)}release(){let e=this.#a;return e==null?this.#t?.release()??`none`:(this.#a=null,e.moved?`rotated`:`tap`)}paint(e){let t=this.#e,n=t.colors(),r=t.specs();if(n==null||t.rowCount()===0||r.length===0)return null;if(t.is3d())return this.#c()?.paint(e,n,r)??null;let a=t.xCoefficients(),o=t.yCoefficients(),s=t.xs(),c=t.columns(),l=this.#s;if(l==null||l.columns!==c||l.specs!==r){let e=r.map((e,n)=>t.definedIndexes(c[n]??/* @__PURE__ */ new Float64Array));l={columns:c,specs:r,indexes:e,total:e.reduce((e,t)=>e+t.length,0)},this.#s=l}let u=l.indexes,d=l.total;return r.forEach((r,c)=>{let l=t.reveal(r.dataKey);if(l<.00196078431372549)return;let f=t.paintedValues(r,c);e.save(),e.globalAlpha=l,i(e,{color:n.series.get(r.dataKey)??`currentColor`,surface:n.chrome.surface,shape:t.shape(r.dataKey),totalPointCount:d,indexes:u[c]??[],xAt:e=>(s[e]??0)*a.k+a.b,yAt:e=>(f[e]??0)*o.k+o.b,radiusAt:()=>4}),e.restore()}),null}paintLabels(e,t){this.#t?.paintLabels(e,t)}hitAt(t,n){let r=this.#e;if(r.is3d())return this.#t?.hitAt(t,n,24)??null;let i=r.specs(),a=576,o=null,s=r.xCoefficients(),c=r.yCoefficients(),l=r.xs(),u=r.rowCount(),d=e=>(l[e]??0)*s.k+s.b,f=s.k>0,p=f?e(u,e=>d(e)-t<=-24):0,m=f?e(u,e=>d(e)-t<24):u;for(let e of i){let i=r.columnOf(e.dataKey);if(i!=null)for(let r=p;r<m;r++){let s=i[r]??NaN;if(Number.isNaN(s))continue;let l=d(r),u=s*c.k+c.b,f=l-t,p=u-n,m=f*f+p*p;m<a&&(a=m,o={seriesKey:e.dataKey,index:r,screenX:l,screenY:u})}}return o}screenFor(e){let t=this.#e;if(t.is3d())return this.#t?.screenFor(e)??null;let n=t.xCoefficients(),r=t.yCoefficients();for(let i of t.specs()){let a=t.columnOf(i.dataKey)?.[e]??NaN;if(!Number.isNaN(a))return{x:(t.xs()[e]??0)*n.k+n.b,y:a*r.k+r.b}}return null}};const d=e=>new u(e);export{n as a,r as i,d as n,l as r,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,i as t,p as n,r}from"./chart-
|
|
1
|
+
import{f as e,i as t,p as n,r}from"./chart-DtgZBAas.js";import i from"tiny-invariant";const a=`http://www.w3.org/2000/svg`,o=e=>e?.namespaceURI===a,s=[`underlay`,`marks`,`overlay`],c={fillStyle:`#000`,strokeStyle:`#000`,lineWidth:1,globalAlpha:1,lineJoin:`miter`,lineCap:`butt`,dash:``,font:`10px sans-serif`,textAlign:`start`,textBaseline:`alphabetic`,clip:null},l=e=>String(Math.round(e*100)/100),u={start:`start`,left:`start`,center:`middle`,right:`end`,end:`end`},d={top:`text-before-edge`,hanging:`hanging`,middle:`central`,alphabetic:`alphabetic`,ideographic:`ideographic`,bottom:`text-after-edge`},f=/* @__PURE__ */ new WeakMap,p=e=>(f.has(e)||f.set(e,e.createElement(`canvas`).getContext(`2d`)),f.get(e)??null),m=e=>Number.parseFloat(e)||10,h=e=>e==null?``:`${l(e.x)},${l(e.y)},${l(e.width)},${l(e.height)}`,g=(e,t)=>{if(e==null)return t;let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y);return{x:n,y:r,width:Math.max(0,Math.min(e.x+e.width,t.x+t.width)-n),height:Math.max(0,Math.min(e.y+e.height,t.y+t.height)-r)}};var _=class{#e={...c};#t=[];#n=[];#r=null;#i=0;#a=!1;#o;layer=`overlay`;marks={underlay:[],marks:[],overlay:[]};constructor(e){this.#o=e}get fillStyle(){return this.#e.fillStyle}set fillStyle(e){i(typeof e==`string`,`The SVG chart backend fills with color strings only.`),this.#e.fillStyle=e}get strokeStyle(){return this.#e.strokeStyle}set strokeStyle(e){i(typeof e==`string`,`The SVG chart backend strokes with color strings only.`),this.#e.strokeStyle=e}get lineWidth(){return this.#e.lineWidth}set lineWidth(e){this.#e.lineWidth=e}get globalAlpha(){return this.#e.globalAlpha}set globalAlpha(e){this.#e.globalAlpha=e}get lineJoin(){return this.#e.lineJoin}set lineJoin(e){this.#e.lineJoin=e}get lineCap(){return this.#e.lineCap}set lineCap(e){this.#e.lineCap=e}get font(){return this.#e.font}set font(e){this.#e.font=e}get textAlign(){return this.#e.textAlign}set textAlign(e){this.#e.textAlign=e}get textBaseline(){return this.#e.textBaseline}set textBaseline(e){this.#e.textBaseline=e}reset(){this.#e={...c},this.#t=[],this.beginPath();for(let e of s)this.marks[e]=[];this.layer=`overlay`}save(){this.#t.push({...this.#e})}restore(){let e=this.#t.pop();e!=null&&(this.#e=e)}beginPath(){this.#n=[],this.#r=null,this.#i=0,this.#a=!1}closePath(){this.#n.push(`Z`)}moveTo(e,t){this.#n.push(`M${l(e)} ${l(t)}`),this.#i+=1,this.#r=null,this.#a=!0}lineTo(e,t){let n=this.#a?`L`:`M`;this.#n.push(`${n}${l(e)} ${l(t)}`),this.#r=null,this.#a=!0}bezierCurveTo(e,t,n,r,i,a){this.#n.push(`C${l(e)} ${l(t)} ${l(n)} ${l(r)} ${l(i)} ${l(a)}`),this.#r=null,this.#a=!0}rect(e,t,n,r){this.#n.push(`M${l(e)} ${l(t)}h${l(n)}v${l(r)}h${l(-n)}Z`),this.#i+=1,this.#r=this.#i===1?{x:e,y:t,width:n,height:r}:null,this.#a=!0}roundRect(e,t,n,r,i){let[a=0,o=0,s=0,c=0]=i,u=e+n,d=t+r,f=(e,t,n)=>e>0?`A${l(e)} ${l(e)} 0 0 1 ${l(t)} ${l(n)}`:`L${l(t)} ${l(n)}`;this.#n.push(`M${l(e+a)} ${l(t)}`,`L${l(u-o)} ${l(t)}`,f(o,u,t+o),`L${l(u)} ${l(d-s)}`,f(s,u-s,d),`L${l(e+c)} ${l(d)}`,f(c,e,d-c),`L${l(e)} ${l(t+a)}`,f(a,e+a,t),`Z`),this.#i+=1,this.#r=null,this.#a=!0}arc(e,t,n,r,i){let a=e+n*Math.cos(r),o=t+n*Math.sin(r);this.#n.push(`${this.#a?`L`:`M`}${l(a)} ${l(o)}`);let s=i-r,c=l(n);if(s>=Math.PI*2){let i=e-n*Math.cos(r),s=t-n*Math.sin(r);this.#n.push(`A${c} ${c} 0 1 1 ${l(i)} ${l(s)}`,`A${c} ${c} 0 1 1 ${l(a)} ${l(o)}`)}else{let r=e+n*Math.cos(i),a=t+n*Math.sin(i),o=+(s>Math.PI);this.#n.push(`A${c} ${c} 0 ${o} 1 ${l(r)} ${l(a)}`)}this.#r=null,this.#a=!0}fill(){this.#s(`fill`,this.#n.join(``))}stroke(){this.#s(`stroke`,this.#n.join(``))}fillRect(e,t,n,r){this.#s(`fill`,`M${l(e)} ${l(t)}h${l(n)}v${l(r)}h${l(-n)}Z`)}clip(){let e=this.#r;i(e!=null,`The SVG chart backend clips to one rectangle only.`),this.#e.clip=g(this.#e.clip,e)}setLineDash(e){this.#e.dash=e.join(` `)}fillText(e,t,n){this.marks[this.layer].push({type:`text`,text:e,x:t,y:n,state:{...this.#e}})}measureText(e){let t=p(this.#o);return t==null?{width:e.length*m(this.#e.font)*.6}:(t.font=this.#e.font,{width:t.measureText(e).width})}#s(e,t){if(t===``)return;let n=this.#e,r=e===`fill`?`f|${n.fillStyle}|${n.globalAlpha}|${h(n.clip)}`:`s|${n.strokeStyle}|${n.globalAlpha}|${n.lineWidth}|${n.lineJoin}|${n.lineCap}|${n.dash}|${h(n.clip)}`,i=this.marks[this.layer],a=i.at(-1);a?.type===`path`&&a.key===r?a.data+=t:i.push({type:`path`,key:r,data:t,paint:e,state:{...n}})}};const v=/* @__PURE__ */ new WeakMap,y=(e,t,n)=>{let r=v.get(e);r??(r=/* @__PURE__ */ new Map,v.set(e,r)),r.get(t)!==n&&(r.set(t,n),n===``?e.style.removeProperty(t):e.style.setProperty(t,n))},b=(e,t,n)=>{n==null?e.hasAttribute(t)&&e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)};let x=0;var S=class{svg;#e;#t;#n;#r;#i=/* @__PURE__ */ new Map;#a=0;#o=null;constructor(e,t){this.#e=e,x+=1,this.#r=`mantle-chart-${x}`;let n=this.#s(`svg`);n.setAttribute(`data-slot`,`${t}-svg`),n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`focusable`,`false`),n.style.position=`absolute`,n.style.inset=`0`,n.style.width=`100%`,n.style.height=`100%`,n.style.overflow=`hidden`,n.style.direction=`ltr`,this.#t=this.#s(`defs`),n.append(this.#t),this.#n={underlay:this.#s(`g`),marks:this.#s(`g`),overlay:this.#s(`g`)};for(let e of s)n.append(this.#n[e]);this.svg=n}#s(e){return this.#e.createElementNS(a,e)}id(e){return`${this.#r}-${e}`}define(e){let t=e.id===``?null:this.#t.querySelector(`#${e.id}`);t==null?this.#t.append(e):t.replaceWith(e)}undefine(e){for(let t of Array.from(this.#t.children))t.id.startsWith(e)&&t.remove()}write(e,t){let n=/* @__PURE__ */ new Set;for(let t of s)this.#c(this.#n[t],e.marks[t],n);for(let[e,t]of this.#i)n.has(e)||(t.remove(),this.#i.delete(e));this.#u(t)}#c(e,t,n){for(t.forEach((t,r)=>{let i=t.type===`path`?`path`:`text`,a=e.children[r],s;o(a)&&a.localName===i?s=a:(s=this.#s(i),a==null?e.append(s):a.replaceWith(s));let{state:c}=t,f=h(c.clip);b(s,`clip-path`,f===``?null:`url(#${this.#l(f,c.clip)})`),f!==``&&n.add(f),y(s,`opacity`,c.globalAlpha===1?``:String(c.globalAlpha)),t.type===`path`?(b(s,`d`,t.data),t.paint===`fill`?(y(s,`fill`,c.fillStyle),y(s,`stroke`,`none`),y(s,`stroke-width`,``),y(s,`stroke-linejoin`,``),y(s,`stroke-linecap`,``),y(s,`stroke-dasharray`,``)):(y(s,`fill`,`none`),y(s,`stroke`,c.strokeStyle),y(s,`stroke-width`,String(c.lineWidth)),y(s,`stroke-linejoin`,c.lineJoin),y(s,`stroke-linecap`,c.lineCap),y(s,`stroke-dasharray`,c.dash))):(b(s,`x`,l(t.x)),b(s,`y`,l(t.y)),y(s,`font`,c.font),y(s,`fill`,c.fillStyle),y(s,`text-anchor`,u[c.textAlign]),y(s,`dominant-baseline`,d[c.textBaseline]),s.textContent!==t.text&&(s.textContent=t.text))});e.children.length>t.length;)e.lastElementChild?.remove()}#l(e,t){let n=this.#i.get(e);if(n==null&&t!=null){n=this.#s(`clipPath`),this.#a+=1,n.id=this.id(`clip-${this.#a}`);let r=this.#s(`rect`);r.setAttribute(`x`,l(t.x)),r.setAttribute(`y`,l(t.y)),r.setAttribute(`width`,l(t.width)),r.setAttribute(`height`,l(t.height)),n.append(r),this.#t.append(n),this.#i.set(e,n)}return n?.id??``}#u(e){let t=this.#n.marks;if(e==null){b(t,`mask`,null);return}if(this.#o==null){let e=this.#s(`mask`);e.id=this.id(`fade`),e.setAttribute(`maskUnits`,`userSpaceOnUse`);let t=this.#s(`linearGradient`);t.id=this.id(`fade-ramp`),t.setAttribute(`gradientUnits`,`userSpaceOnUse`);let n=this.#s(`stop`);n.setAttribute(`offset`,`0`),n.setAttribute(`stop-color`,`white`);let r=this.#s(`stop`);r.setAttribute(`offset`,`1`),r.setAttribute(`stop-color`,`white`),t.append(n,r);let i=this.#s(`rect`);i.setAttribute(`x`,`0`),i.setAttribute(`y`,`0`),i.setAttribute(`width`,`100%`),i.setAttribute(`height`,`100%`),i.setAttribute(`fill`,`url(#${t.id})`),e.append(i),this.#t.append(t,e),this.#o={mask:e,gradient:t,rect:i}}let{gradient:n}=this.#o;b(n,`x1`,l(e.left)),b(n,`x2`,l(e.left+e.width)),n.firstElementChild?.setAttribute(`stop-opacity`,String(1-e.alpha)),b(t,`mask`,`url(#${this.#o.mask.id})`)}},C=class{kind=`svg`;element;#e;#t;#n;#r=null;#i=null;constructor({root:e,slotName:t}){this.#e=e;let n=e.ownerDocument;this.#t=new S(n,t),this.#n=new _(n),this.element=this.#t.svg}paintSignature({orientation:e}){return e}resolvePaint({series:e,orientation:n,signature:i}){this.#i=null;let a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=this.#t.id(`texture-`);return this.#t.undefine(c),e.forEach((e,t)=>{if(a.set(e.dataKey,e.color),o.set(e.dataKey,`${e.colorInput}|${e.texture}`),e.mark!==`bar`||e.texture===`solid`)return;let r=`${c}${t}`;this.#t.define(this.#o(r,e.texture,e.color,n)),s.set(e.dataKey,`url(#${r})`)}),{signature:i,series:a,inputs:o,barFills:s,chrome:r,fontFamily:this.#a,resolve:t}}#a=()=>{if(this.#i==null){let e=this.#e.ownerDocument.defaultView;this.#i=e?.getComputedStyle(this.#e).fontFamily||`sans-serif`}return this.#i};#o(t,r,i,o){let s=this.#e.ownerDocument,c=s.createElementNS(a,`pattern`);c.id=t,c.setAttribute(`patternUnits`,`userSpaceOnUse`),c.setAttribute(`width`,`8`),c.setAttribute(`height`,`8`);let l=new _(s);e(l,{texture:r,ground:n(i),ink:i,orientation:o});let u=s.createElementNS(a,`g`);for(let e of l.marks.overlay){if(e.type!==`path`)continue;let t=s.createElementNS(a,`path`);t.setAttribute(`d`,e.data),e.paint===`fill`?t.style.setProperty(`fill`,e.state.fillStyle):(t.style.setProperty(`fill`,`none`),t.style.setProperty(`stroke`,e.state.strokeStyle),t.style.setProperty(`stroke-width`,String(e.state.lineWidth)),t.style.setProperty(`stroke-linecap`,e.state.lineCap)),u.append(t)}return c.append(u),c}measureContext(){return this.#n}begin(){return this.#n.reset(),this.#r=null,this.#n}composite(e,t){let n=this.#n;n.layer=`underlay`,t.underlay(),n.layer=`marks`,t.marks(),n.layer=`overlay`,this.#r=t.fade}end(){this.#t.write(this.#n,this.#r),this.#n.reset()}release(){}destroy(){}};const w=Object.assign(e=>new C(e),{kind:`svg`});export{w as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,m as t}from"./chart-
|
|
1
|
+
import{h as e,m as t}from"./chart-DtgZBAas.js";import{a as n}from"./chart-BLCqzt56.js";const r=Math.PI/2-.05,i=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),a=(e,t,n,r)=>{let i=e*r.cosYaw+n*r.sinYaw,a=-e*r.sinYaw+n*r.cosYaw,o=t*r.cosPitch-a*r.sinPitch,s=t*r.sinPitch+a*r.cosPitch,c=4/(4+s);return{x:i*c,y:o*c,depth:s,scale:c}},o=e=>Math.min(r,Math.max(-r,e)),s=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},c=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],l=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],u=(t,r)=>{let{count:i,order:a,screenX:o,screenY:s,radius:c,colorAt:l,shapeAt:u,alphaAt:d,surface:f}=r;if(t.save(),i>2e4){let e=``,n=-1;for(let r of a){let i=l(r);i!==e&&(t.fillStyle=i,e=i);let a=d(r);a!==n&&(t.globalAlpha=a,n=a);let u=Math.max(1,(c[r]??0)/2);t.fillRect((o[r]??0)-u/2,(s[r]??0)-u/2,u,u)}t.restore();return}let p=i<=n;t.strokeStyle=f,t.lineWidth=2;let m=``,h=-1;for(let n of a){let r=l(n);r!==m&&(t.fillStyle=r,m=r);let i=d(n);i!==h&&(t.globalAlpha=i,h=i),t.beginPath(),e(t,o[n]??0,s[n]??0,c[n]??0,u(n)),t.fill(),p&&t.stroke()}t.restore()},d=(e,t)=>{let{gridColor:n,axisColor:r,corners:i,edges:a,cubeAlpha:o,axes:s}=t;if(e.save(),o>.01){e.globalAlpha=o,e.strokeStyle=n,e.lineWidth=1,e.beginPath();for(let[t,n]of a){let r=i[t],a=i[n];r!=null&&a!=null&&(e.moveTo(r.x,r.y),e.lineTo(a.x,a.y))}e.stroke()}e.strokeStyle=r;for(let{alpha:t,from:n,to:r}of s)t<=.01||(e.globalAlpha=t,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke());e.restore()},f=(e,t)=>{let{textColor:n,fontFamily:r,plot:i,center:a,axes:o}=t;e.save(),e.fillStyle=n,e.font=`11px ${r}`,e.textAlign=`center`,e.textBaseline=`middle`;for(let{label:t,alpha:n,from:r,to:s}of o){if(n<=.01)continue;let o=Math.hypot(r.x-a.x,r.y-a.y),c=Math.hypot(s.x-a.x,s.y-a.y),l=c>=o?s:r,u=c>=o?r:s,d=Math.max(1,Math.hypot(l.x-u.x,l.y-u.y)),f=(l.x-u.x)/d*16,p=(l.y-u.y)/d*16,m=Math.min(i.left+i.width-8,Math.max(i.left+8,l.x+f)),h=Math.min(i.top+i.height-6,Math.max(i.top+6,l.y+p));e.globalAlpha=n,e.fillText(t,m,h)}e.restore()},p=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},m=e=>[+(e>=2),+(e>=3)];var h=class{#e;#t=p(3);#n=new t({speed:.12});#r=new t({speed:.16});#i=null;#a=null;#o=/* @__PURE__ */ new Int32Array;constructor(e,t){this.#e=e,this.snap(t)}setDimensions(e,t){let n=p(e);if(!t.glide){this.snap(e);return}let r=n.yaw+Math.round((this.#t.yaw-n.yaw)/(Math.PI*2))*Math.PI*2,i=performance.now();this.#r.aim(m(e),i),this.#n.jump([this.#t.yaw,this.#t.pitch]),this.#n.aim([r,n.pitch],i)}snap(e){let t=p(e);this.#r.jump(m(e)),this.#t=t,this.#n.jump([t.yaw,t.pitch])}settle(e){this.#r.jump(m(e)),this.#n.active&&this.snap(e)}tick(e){let t=this.#r.tick(e);if(this.#n.tick(e)){t=!0;let e=this.#n.values();this.#t={yaw:e[0]??this.#t.yaw,pitch:e[1]??this.#t.pitch}}return t}resetProjection(){this.#a=null}press({x:e,y:t,moved:n}){this.#i={lastX:e,lastY:t,moved:n}}dragTo(e,t){let n=this.#i;if(n==null)return`none`;let r=e-n.lastX,i=t-n.lastY;return!n.moved&&Math.abs(r)+Math.abs(i)<=3?`held`:(n.moved=!0,this.#t={yaw:this.#t.yaw+r*.008,pitch:o(this.#t.pitch+i*.008)},this.#n.jump([this.#t.yaw,this.#t.pitch]),n.lastX=e,n.lastY=t,`rotated`)}release(){let e=this.#i;return this.#i=null,e==null?`none`:e.moved?`rotated`:`tap`}paintLabels(e,t){let n=this.#e.colors();n!=null&&f(e,{textColor:n.chrome.tickText,fontFamily:n.fontFamily(),plot:this.#e.plot(),center:t.center,axes:t.axes})}paint(e,t,n){let r=this.#e,o=r.plot(),f=r.rowCount(),p=r.xs(),m=r.zs(),h=i(this.#t),g=o.left+o.width/2,_=o.top+o.height/2,v=this.#r.values(),y=v[0]??1,b=v[1]??1,x=.85-.22*y-.11*b,S=Math.min(o.width,o.height)/2*x,C=r.domains(),w=n.map(e=>r.reveal(e.dataKey)),T=(e,t,n)=>{let r=a(e,t,n,h);return{x:g+r.x*S,y:_-r.y*S}},E=c.map(([e,t,n])=>T(e,t,n)),D=n[0],O=n.length===1&&D!=null?D.dataKey:`y`,k=[{label:r.xKey(),alpha:1,from:T(-1,-y,-b),to:T(1,-y,-b)},{label:O,alpha:y,from:T(-1,-1,-b),to:T(-1,1,-b)},{label:r.zKey()??`z`,alpha:b,from:T(-1,-y,-1),to:T(-1,-y,1)}];d(e,{gridColor:t.chrome.grid,axisColor:t.chrome.baseline,corners:E,edges:l,cubeAlpha:b,axes:k});let A=f*n.length,j=this.#a;(j==null||j.screenX.length<A)&&(j={screenX:new Float64Array(A),screenY:new Float64Array(A),radius:new Float64Array(A),seriesIndex:new Int32Array(A),pointIndex:new Int32Array(A),depths:new Float64Array(A),count:0});let M=j.depths,N=0;n.forEach((e,t)=>{let n=r.paintedValues(e,t);for(let e=0;e<f;e++){let r=n[e]??NaN,i=m[e]??NaN;if(Number.isNaN(r)||Number.isNaN(i))continue;let o=a(s(p[e]??0,C.x),s(r,C.y)*y,s(i,C.z)*b,h);j.screenX[N]=g+o.x*S,j.screenY[N]=_-o.y*S,j.radius[N]=4*o.scale,j.seriesIndex[N]=t,j.pointIndex[N]=e,M[N]=o.depth,N+=1}}),j.count=N,this.#a=j;let P={center:{x:g,y:_},axes:k};if(w.every(e=>e<.00196078431372549))return P;this.#o.length<N&&(this.#o=new Int32Array(A));let F=this.#o.subarray(0,N);for(let e=0;e<N;e++)F[e]=e;F.sort((e,t)=>(M[t]??0)-(M[e]??0));let I=n.map(e=>r.shape(e.dataKey));return u(e,{count:N,order:F,screenX:j.screenX,screenY:j.screenY,radius:j.radius,colorAt:e=>{let r=n[j.seriesIndex[e]??0];return r==null?`currentColor`:t.series.get(r.dataKey)??`currentColor`},shapeAt:e=>I[j.seriesIndex[e]??0]??`circle`,alphaAt:e=>w[j.seriesIndex[e]??0]??1,surface:t.chrome.surface}),P}hitAt(e,t,n){let r=this.#e.specs(),i=n*n,a=null,o=this.#a;if(o==null)return null;for(let n=0;n<o.count;n++){let s=(o.screenX[n]??0)-e,c=(o.screenY[n]??0)-t,l=s*s+c*c;if(l<i){let e=r[o.seriesIndex[n]??0];if(e==null)continue;i=l,a={seriesKey:e.dataKey,index:o.pointIndex[n]??0,screenX:o.screenX[n]??0,screenY:o.screenY[n]??0}}}return a}screenFor(e){let t=this.#a;if(t==null)return null;for(let n=0;n<t.count;n++)if((t.pointIndex[n]??-1)===e)return{x:t.screenX[n]??0,y:t.screenY[n]??0};return null}};export{h as Scatter3d};
|
|
@@ -1,11 +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
3
|
import { t as Color } from "./index-BZhHLrBi.js";
|
|
4
4
|
import { ComponentProps, ReactNode } from "react";
|
|
5
5
|
/**
|
|
6
6
|
* Shared types for the internal canvas chart engine.
|
|
7
7
|
*
|
|
8
|
-
* This module is internal shared implementation
|
|
8
|
+
* This module is internal shared implementation. It is not exported from the
|
|
9
9
|
* package. The public components built on it are `BarChart` (../bar-chart),
|
|
10
10
|
* `LineChart` (../line-chart), `AreaChart` (../area-chart), and
|
|
11
11
|
* `ScatterPlot` (../scatter-plot), mirroring how `dialog/primitive` backs
|
|
@@ -17,7 +17,7 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
17
17
|
*/
|
|
18
18
|
type XValue = string | number | Date;
|
|
19
19
|
/**
|
|
20
|
-
* A single row of chart data
|
|
20
|
+
* A single row of chart data: any object shape. Series read one numeric key
|
|
21
21
|
* per row; the x key identifies the row's position on the x axis. Missing
|
|
22
22
|
* keys and `null` values are rendered as gaps. Typed as `object` (not an
|
|
23
23
|
* index signature) so interface-typed rows compose without ceremony; reads
|
|
@@ -27,10 +27,10 @@ type ChartDatum = object;
|
|
|
27
27
|
/**
|
|
28
28
|
* How x values map onto the x axis:
|
|
29
29
|
*
|
|
30
|
-
* - `"band"
|
|
31
|
-
* - `"point"
|
|
32
|
-
* - `"linear"
|
|
33
|
-
* - `"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.
|
|
34
34
|
*/
|
|
35
35
|
type XScaleKind = "band" | "point" | "linear" | "time";
|
|
36
36
|
/**
|
|
@@ -86,12 +86,12 @@ type PointShape = "circle" | "square" | "triangle" | "diamond" | "triangle-down"
|
|
|
86
86
|
* The fill texture a bar series wears: solid color (the default), diagonal
|
|
87
87
|
* hatch lines at 45° (`"hatch"`), the 135° mirror (`"hatch-reverse"`), both
|
|
88
88
|
* (`"crosshatch"`), rungs perpendicular to the bar's length
|
|
89
|
-
* (`"perpendicular"
|
|
90
|
-
* it (`"parallel"
|
|
89
|
+
* (`"perpendicular"`: horizontal lines on vertical bars), rungs parallel to
|
|
90
|
+
* it (`"parallel"`: vertical lines on vertical bars), the orthogonal lattice
|
|
91
91
|
* of both rung directions (`"grid"`), or an offset dot field (`"dots"`).
|
|
92
92
|
*
|
|
93
93
|
* The two rung textures flip with `orientation`, in opposite senses. Every
|
|
94
|
-
* other value is direction-free, `"grid"` included
|
|
94
|
+
* other value is direction-free, `"grid"` included. It is the orthogonal
|
|
95
95
|
* lattice against `"crosshatch"`'s diagonal one.
|
|
96
96
|
*
|
|
97
97
|
* A textured series paints its marks in the full series color over a light
|
|
@@ -104,7 +104,7 @@ type BarTexture = "solid" | "hatch" | "hatch-reverse" | "crosshatch" | "perpendi
|
|
|
104
104
|
/**
|
|
105
105
|
* The direction a bar chart's bars run: vertical columns rising from a bottom
|
|
106
106
|
* baseline (the default), or horizontal bars growing rightward from a left
|
|
107
|
-
* baseline
|
|
107
|
+
* baseline: the layout for long category labels, which move into the left
|
|
108
108
|
* gutter at full width instead of colliding under the plot.
|
|
109
109
|
*/
|
|
110
110
|
type BarOrientation = "vertical" | "horizontal";
|
|
@@ -153,7 +153,7 @@ type YTickContext = {
|
|
|
153
153
|
};
|
|
154
154
|
/**
|
|
155
155
|
* The hover/keyboard snapshot published by the engine. One snapshot describes
|
|
156
|
-
* the active x position and every series' value at it
|
|
156
|
+
* the active x position and every series' value at it. The tooltip, the
|
|
157
157
|
* aria-live announcement, and `onDatumActivate` all read from it.
|
|
158
158
|
*/
|
|
159
159
|
type HoverSnapshot = {
|
|
@@ -229,17 +229,17 @@ type YDomain = [number | "auto", number | "auto"];
|
|
|
229
229
|
* can see, and a table of sparklines holds no hidden tables until a reader
|
|
230
230
|
* asks for one.
|
|
231
231
|
*
|
|
232
|
-
* This module is internal shared implementation
|
|
232
|
+
* This module is internal shared implementation. It is not exported from the
|
|
233
233
|
* package.
|
|
234
234
|
*/
|
|
235
235
|
/**
|
|
236
236
|
* Every interactive chart must have an accessible name: either a direct
|
|
237
237
|
* `aria-label` or an `aria-labelledby` reference to a visible title (preferred
|
|
238
|
-
* when the chart sits under a heading
|
|
238
|
+
* when the chart sits under a heading, so no duplicated text can drift).
|
|
239
239
|
* Enforced at the type level; the name lands on the interaction overlay (the
|
|
240
|
-
* chart's single named element
|
|
241
|
-
* announces the chart twice). Decorative charts are exempt
|
|
242
|
-
* {@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}.
|
|
243
243
|
*/
|
|
244
244
|
type ChartAccessibleName = {
|
|
245
245
|
"aria-label": string;
|
|
@@ -410,7 +410,7 @@ type ChartAccessibilityProps<TMode extends ChartMode = ChartMode> = {
|
|
|
410
410
|
/**
|
|
411
411
|
* The copy button part: copies the chart's data as a Markdown table.
|
|
412
412
|
*
|
|
413
|
-
* This module is internal shared implementation
|
|
413
|
+
* This module is internal shared implementation, not exported from the package.
|
|
414
414
|
*/
|
|
415
415
|
type CopyButtonPrimitiveProps = Omit<ComponentProps<"button">, "aria-label" | "children" | "type" | "onCopy"> & SelfClosingWithAsChild & WithDataSlot & {
|
|
416
416
|
/**
|
|
@@ -461,7 +461,7 @@ type XAxisPrimitiveProps = {
|
|
|
461
461
|
/**
|
|
462
462
|
* Target tick count (continuous scales only; a density-derived default
|
|
463
463
|
* otherwise). Approximate: ticks land on human-friendly steps, and a linear
|
|
464
|
-
* axis whose x values are all integers never renders fractional ticks
|
|
464
|
+
* axis whose x values are all integers never renders fractional ticks:
|
|
465
465
|
* the integer step wins over the requested count.
|
|
466
466
|
*/
|
|
467
467
|
tickCount?: number;
|
|
@@ -495,7 +495,7 @@ type ReferenceLinePrimitiveProps = {
|
|
|
495
495
|
/**
|
|
496
496
|
* Root props shared by every chart kind, WITHOUT the accessibility/interaction
|
|
497
497
|
* union or the data/x props. Public wrappers `Omit` from this base and
|
|
498
|
-
* re-intersect `ChartAccessibilityProps
|
|
498
|
+
* re-intersect `ChartAccessibilityProps`: `Omit` over a union type flattens
|
|
499
499
|
* it, which would silently make the required accessible name optional and
|
|
500
500
|
* erase the `mode` discriminant.
|
|
501
501
|
*/
|
|
@@ -512,8 +512,8 @@ type ChartRootBaseProps = Omit<ComponentProps<"div">, "aria-label" | "aria-label
|
|
|
512
512
|
/** Animate enter/update transitions. `prefers-reduced-motion` always wins. */
|
|
513
513
|
animate?: boolean;
|
|
514
514
|
/**
|
|
515
|
-
* Hold the previous render at reduced opacity while fresh data loads
|
|
516
|
-
*
|
|
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
517
|
*/
|
|
518
518
|
pending?: boolean;
|
|
519
519
|
};
|