@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://www.designtokens.org/schemas/2025.10/resolver.json",
|
|
3
|
+
"name": "@ngrok/mantle",
|
|
4
|
+
"version": "2025.10",
|
|
5
|
+
"description": "The design tokens of @ngrok/mantle with a light theme and a dark theme.",
|
|
6
|
+
"sets": {
|
|
7
|
+
"mantle": {
|
|
8
|
+
"sources": [
|
|
9
|
+
{
|
|
10
|
+
"$ref": "tokens.json"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"modifiers": {
|
|
16
|
+
"theme": {
|
|
17
|
+
"description": "The color theme. The light theme is the base set as it is.",
|
|
18
|
+
"contexts": {
|
|
19
|
+
"light": [],
|
|
20
|
+
"dark": [
|
|
21
|
+
{
|
|
22
|
+
"$ref": "tokens.dark.json"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"default": "light"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"resolutionOrder": [
|
|
30
|
+
{
|
|
31
|
+
"$ref": "#/sets/mantle"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"$ref": "#/modifiers/theme"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
2
2
|
import { ComponentProps, ComponentPropsWithoutRef } from "react";
|
|
3
|
-
import { Content, Provider, Root, Trigger } from "@radix-ui/react-tooltip";
|
|
3
|
+
import { Content as Content$1, Provider, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-tooltip";
|
|
4
4
|
/**
|
|
5
5
|
* Wraps your app to set shared global behavior for your tooltips, such
|
|
6
6
|
* as consistent delay and hover settings. Mount exactly one instance, preferably
|
|
@@ -57,7 +57,7 @@ declare const TooltipProvider: ({ delayDuration, ...props }: ComponentPropsWitho
|
|
|
57
57
|
* </Tooltip.Root>
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
declare function Root
|
|
60
|
+
declare function Root(props: ComponentProps<typeof Root$1>): import("react").JSX.Element;
|
|
61
61
|
/**
|
|
62
62
|
* The trigger button that opens the tooltip.
|
|
63
63
|
*
|
|
@@ -77,13 +77,13 @@ declare function Root$1(props: ComponentProps<typeof Root>): import("react").JSX
|
|
|
77
77
|
* </Tooltip.Root>
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
declare function Trigger
|
|
80
|
+
declare function Trigger({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Trigger$1> & WithDataSlot): import("react").JSX.Element;
|
|
81
81
|
/**
|
|
82
82
|
* Props for `Tooltip.Content`. `asChild` is omitted: the content renders its own
|
|
83
83
|
* arrow next to `children`, so a slot would receive more than one element and
|
|
84
84
|
* throw. A `data-slot` from a composing part joins ahead of `tooltip-content`.
|
|
85
85
|
*/
|
|
86
|
-
type TooltipContentProps = Omit<ComponentProps<typeof Content>, "asChild"> & WithDataSlot;
|
|
86
|
+
type TooltipContentProps = Omit<ComponentProps<typeof Content$1>, "asChild"> & WithDataSlot;
|
|
87
87
|
/**
|
|
88
88
|
* The content to render inside the tooltip.
|
|
89
89
|
*
|
|
@@ -128,13 +128,13 @@ type TooltipContentProps = Omit<ComponentProps<typeof Content>, "asChild"> & Wit
|
|
|
128
128
|
* </Tooltip.Root>
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
|
-
declare const Content
|
|
131
|
+
declare const Content: ({ children, className, "data-slot": dataSlot, onEscapeKeyDown, ref, sideOffset, ...props }: TooltipContentProps) => import("react").JSX.Element;
|
|
132
132
|
/**
|
|
133
133
|
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
134
134
|
*
|
|
135
135
|
* Use `Tooltip` to show a short, non-essential label or hint when the user
|
|
136
|
-
* hovers or focuses an element
|
|
137
|
-
* keyboard shortcut, or a brief explanation. Tooltips are NON-INTERACTIVE:
|
|
136
|
+
* hovers or focuses an element (e.g., the meaning of an icon button, a
|
|
137
|
+
* keyboard shortcut, or a brief explanation). Tooltips are NON-INTERACTIVE:
|
|
138
138
|
* do not put buttons, links, or form controls inside one. Per the WAI-ARIA
|
|
139
139
|
* tooltip pattern, tooltips never receive focus, so interactive content
|
|
140
140
|
* inside them is unreachable for keyboard users. For interactive overlay
|
|
@@ -151,6 +151,13 @@ declare const Content$1: ({ children, className, "data-slot": dataSlot, ref, sid
|
|
|
151
151
|
* (`z-60`). When sibling floats share a container, the most recently mounted
|
|
152
152
|
* float paints on top.
|
|
153
153
|
*
|
|
154
|
+
* @useWhen Show a short, non-interactive hint for an element on hover or focus, such as the meaning
|
|
155
|
+
* of an icon button.
|
|
156
|
+
*
|
|
157
|
+
* @siblings
|
|
158
|
+
* - `Popover`: the content is interactive, such as a form or a settings menu.
|
|
159
|
+
* - `HoverCard`: the content is a rich preview of a link.
|
|
160
|
+
*
|
|
154
161
|
* @see https://mantle.ngrok.com/components/overlays/tooltip
|
|
155
162
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/
|
|
156
163
|
*
|
|
@@ -206,7 +213,7 @@ declare const Tooltip: {
|
|
|
206
213
|
* </Tooltip.Root>
|
|
207
214
|
* ```
|
|
208
215
|
*/
|
|
209
|
-
readonly Root: typeof Root
|
|
216
|
+
readonly Root: typeof Root;
|
|
210
217
|
/**
|
|
211
218
|
* The content to render inside the tooltip.
|
|
212
219
|
*
|
|
@@ -251,7 +258,7 @@ declare const Tooltip: {
|
|
|
251
258
|
* </Tooltip.Root>
|
|
252
259
|
* ```
|
|
253
260
|
*/
|
|
254
|
-
readonly Content: typeof Content
|
|
261
|
+
readonly Content: typeof Content;
|
|
255
262
|
/**
|
|
256
263
|
* The trigger button that opens the tooltip.
|
|
257
264
|
*
|
|
@@ -271,6 +278,6 @@ declare const Tooltip: {
|
|
|
271
278
|
* </Tooltip.Root>
|
|
272
279
|
* ```
|
|
273
280
|
*/
|
|
274
|
-
readonly Trigger: typeof Trigger
|
|
281
|
+
readonly Trigger: typeof Trigger;
|
|
275
282
|
};
|
|
276
283
|
export { TooltipProvider as n, Tooltip as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{i as n,s as r}from"./layer-container-DL4yclOu.js";import{c as i}from"react/compiler-runtime";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Arrow as s,Content as c,Portal as l,Provider as u,Root as d,Trigger as f}from"@radix-ui/react-tooltip";const p=e=>{let t=i(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let o=(r===void 0?0:r)??0,s;return t[3]!==n||t[4]!==o?(s=/* @__PURE__ */ a(u,{delayDuration:o,...n}),t[3]=n,t[4]=o,t[5]=s):s=t[5],s};function m(e){let t=i(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ a(d,{...e}),t[0]=e,t[1]=n),n}function h(e){let n=i(8),r,o;n[0]===e?(r=n[1],o=n[2]):({"data-slot":r,...o}=e,n[0]=e,n[1]=r,n[2]=o);let s;n[3]===r?s=n[4]:(s=t(r,`tooltip-trigger`),n[3]=r,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=/* @__PURE__ */ a(f,{"data-slot":s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}const g={Root:m,Content:u=>{let d=i(26),f,p,m,h,g,_,v;d[0]===u?(f=d[1],p=d[2],m=d[3],h=d[4],g=d[5],_=d[6],v=d[7]):({children:f,className:p,"data-slot":m,onEscapeKeyDown:h,ref:_,sideOffset:v,...g}=u,d[0]=u,d[1]=f,d[2]=p,d[3]=m,d[4]=h,d[5]=g,d[6]=_,d[7]=v);let y=v===void 0?4:v,b=r(),x=n(h),S;d[8]===p?S=d[9]:(S=e(`bg-tooltip text-tooltip animate-in fade-in-0 zoom-in-95 data-side-bottom:slide-in-from-top-1 data-side-left:slide-in-from-right-1 data-side-right:slide-in-from-left-1 data-side-top:slide-in-from-bottom-1 data-side-bottom:slide-out-to-top-1 data-side-left:slide-out-to-right-1 data-side-right:slide-out-to-left-1 data-side-top:slide-out-to-bottom-1 duration-200 ease-out-strong data-state-closed:duration-150 motion-reduce:animate-none! data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 z-50 max-w-72 overflow-visible wrap-break-word rounded-md px-3 py-1.5 text-sm font-sans shadow`,p),d[8]=p,d[9]=S);let C;d[10]===m?C=d[11]:(C=t(m,`tooltip-content`),d[10]=m,d[11]=C);let w;d[12]===f?w=d[13]:(w=/* @__PURE__ */ a(`div`,{"data-slot":`tooltip-label`,className:`contents`,children:f}),d[12]=f,d[13]=w);let T;d[14]===Symbol.for(`react.memo_cache_sentinel`)?(T=/* @__PURE__ */ a(s,{asChild:!0,children:/* @__PURE__ */ a(`div`,{className:`bg-tooltip z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs`})}),d[14]=T):T=d[14];let E;d[15]!==x||d[16]!==g||d[17]!==_||d[18]!==y||d[19]!==S||d[20]!==C||d[21]!==w?(E=/* @__PURE__ */ o(c,{className:S,"data-slot":C,onEscapeKeyDown:x,ref:_,sideOffset:y,...g,children:[w,T]}),d[15]=x,d[16]=g,d[17]=_,d[18]=y,d[19]=S,d[20]=C,d[21]=w,d[22]=E):E=d[22];let D;return d[23]!==b||d[24]!==E?(D=/* @__PURE__ */ a(l,{container:b,children:E}),d[23]=b,d[24]=E,d[25]=D):D=d[25],D},Trigger:h};export{p as n,g as t};
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Tooltip component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip
|
|
5
|
+
*/
|
|
6
|
+
import { n as TooltipProvider, t as Tooltip } from "./tooltip-CstGDKwy.js";
|
|
2
7
|
export { Tooltip, TooltipProvider };
|
package/dist/tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as Tooltip,n as TooltipProvider}from"./tooltip-
|
|
1
|
+
export{t as Tooltip,n as TooltipProvider}from"./tooltip-DQO40Mrq.js";
|
package/dist/truncated-text.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the TruncatedText component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/data-display/truncated-text
|
|
5
|
+
*/
|
|
1
6
|
import { t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
7
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
3
8
|
import { ComponentProps } from "react";
|
|
4
9
|
/**
|
|
5
10
|
* Props for `TruncatedText`. The type omits `children`: `value` is the content,
|
|
@@ -71,15 +76,22 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
71
76
|
* a token reads left to right on an RTL page too; a `dir` prop wins. CSS draws
|
|
72
77
|
* the ellipsis, so a selection never contains it. The component sets no font,
|
|
73
78
|
* but it turns ligatures off, so a `//` or `=>` clips between its two
|
|
74
|
-
* characters.
|
|
75
|
-
*
|
|
79
|
+
* characters. The ellipsis sits flush against the tail in any font, and it
|
|
80
|
+
* stays flush while the container resizes.
|
|
76
81
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
82
|
+
* The server render reserves one `ch` per grapheme for the tail, which is
|
|
83
|
+
* exact in a monospace font. In another font the server paint of an
|
|
79
84
|
* overflowing value can be off by the difference: a tail of wide glyphs (CJK,
|
|
80
85
|
* emoji) can poke past the container, and a value that fits by less than the
|
|
81
|
-
* over-reserve of narrow glyphs can clip.
|
|
82
|
-
*
|
|
86
|
+
* over-reserve of narrow glyphs can clip. On the client, the measurement runs
|
|
87
|
+
* after the commit and before the browser paints.
|
|
88
|
+
*
|
|
89
|
+
* **Performance.** Each instance renders once on mount. One batch measures
|
|
90
|
+
* every instance that mounted in the commit: it reads all of them, then writes
|
|
91
|
+
* all of them, so the page lays out once for the batch. The tooltip mounts on
|
|
92
|
+
* the first hover or keyboard focus while the value overflows. One
|
|
93
|
+
* `ResizeObserver` serves every instance, and a resize renders no component.
|
|
94
|
+
* A table still lays out each cell it renders, so paginate a long table.
|
|
83
95
|
*
|
|
84
96
|
* **Head length.** Pass `head` to show at most that many graphemes before the
|
|
85
97
|
* ellipsis. A value longer than `head + tail` graphemes then always clips to
|
|
@@ -94,7 +106,9 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
94
106
|
* the head's color. A value no longer than `tail` has an empty head, so its
|
|
95
107
|
* tail draws the ellipsis in the tail's color. The two segments render when the
|
|
96
108
|
* value fits too. To color them only while the value overflows, add the
|
|
97
|
-
* `data-truncated:` variant first.
|
|
109
|
+
* `data-truncated:` variant first. Change the color of a segment, not its
|
|
110
|
+
* font: the measurement reads the whole value in the root's font. Set a font
|
|
111
|
+
* on the root.
|
|
98
112
|
*
|
|
99
113
|
* **Selection.** The root carries `user-select: all`, so one click selects the
|
|
100
114
|
* whole value across both segments, and a copy yields the full string. Pass
|
|
@@ -103,10 +117,10 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
103
117
|
* **Tooltip.** The tooltip shows the full value and opens only while the value
|
|
104
118
|
* overflows. The tooltip is up to 24rem wide, so a resource ID fits on one
|
|
105
119
|
* line. A longer value breaks into lines of near-equal length, and the tooltip
|
|
106
|
-
* narrows to the longest line. It
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
120
|
+
* narrows to the longest line. It needs a `TooltipProvider` ancestor, like
|
|
121
|
+
* every mantle tooltip, and throws without one when it first mounts. The
|
|
122
|
+
* server render and the first client render assume no overflow; the
|
|
123
|
+
* measurement after mount adds `data-truncated`.
|
|
110
124
|
* While the value overflows, the root is focusable, so Tab reaches it, a screen
|
|
111
125
|
* reader announces the whole value, and the tooltip opens. A value that fits is
|
|
112
126
|
* not a tab stop. A `tabIndex` prop wins in both states.
|
|
@@ -143,7 +157,7 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
143
157
|
* | `data-slot` | `"truncated-text-tail"` | On the `<span>` that stays visible. Holds the last `tail` graphemes. |
|
|
144
158
|
* | `data-slot` | `"truncated-text-value"` | On the visually hidden `<span>` that holds the whole value for assistive technology. |
|
|
145
159
|
* | `data-truncated` | present while the value overflows | Presence-only. Style with `data-truncated:`. Absent on the server render. |
|
|
146
|
-
* | `data-state` | `"closed"` \| `"delayed-open"` \| `"instant-open"` | The tooltip state
|
|
160
|
+
* | `data-state` | `"closed"` \| `"delayed-open"` \| `"instant-open"` | The tooltip state on the root. `"closed"` until the tooltip mounts. Absent inside a control. |
|
|
147
161
|
*
|
|
148
162
|
* @useWhen Show one long opaque value on one line, and keep its end visible when it clips.
|
|
149
163
|
*
|
|
@@ -182,5 +196,5 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
182
196
|
* </TruncatedText>
|
|
183
197
|
* ```
|
|
184
198
|
*/
|
|
185
|
-
declare const TruncatedText: ({ "aria-describedby": describedBy, asChild, children, className, "data-slot": dataSlot, onFocus, onPointerMove, ref, head, style, tabIndex, tail, translate, value, ...props }: TruncatedTextProps) => import("react").JSX.Element;
|
|
199
|
+
declare const TruncatedText: ({ "aria-describedby": describedBy, asChild, children, className, "data-slot": dataSlot, onBlur, onClick, onFocus, onPointerDown, onPointerLeave, onPointerMove, ref, head, style, tabIndex, tail, translate, value, ...props }: TruncatedTextProps) => import("react").JSX.Element;
|
|
186
200
|
export { TruncatedText, type TruncatedTextProps };
|
package/dist/truncated-text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./slot-DdYN1L1C.js";import{t as a}from"./css-properties-D85fCNV3.js";import{t as o}from"./tooltip-b6oiTaWq.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as ee,isValidElement as te,useRef as ne,useState as l}from"react";import u from"tiny-invariant";import{Fragment as re,jsx as d,jsxs as ie}from"react/jsx-runtime";import{Root as ae,Trigger as oe}from"@radix-ui/react-tooltip";let f;function se(e,{head:t,tail:n}){u(Number.isInteger(n)&&n>=0,`TruncatedText: \`tail\` must be a non-negative integer, received ${String(n)}.`),u(t==null||Number.isInteger(t)&&t>=0,`TruncatedText: \`head\` must be a non-negative integer, received ${String(t)}.`),f??=new Intl.Segmenter(void 0,{granularity:`grapheme`});let r=Array.from(f.segment(e),e=>e.segment);if(r.length<=n)return{head:``,lead:null,tail:e,tailGraphemes:r.length};let i=r.length-n,a=t!=null&&r.length>t+n;return{head:r.slice(0,i).join(``),lead:a?r.slice(0,t).join(``):null,tail:r.slice(i).join(``),tailGraphemes:n}}function p(e){let t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width}function m(e){let t=getComputedStyle(e),n=[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+(Number.parseFloat(t)||0),0);return e.getBoundingClientRect().width-n}function ce({root:e,head:t,tail:n,lead:r}){let i=p(t),a=p(n),o=i+a>m(e)+.5,s=t.firstChild;if(r==null||!(s instanceof Text))return{headCap:null,tailWidth:a,truncated:o};let c=document.createRange();return c.setStart(s,0),c.setEnd(s,Math.min(r.length,s.length)),{headCap:Math.min(c.getBoundingClientRect().width+p(r.ellipsis),i),tailWidth:a,truncated:o}}function le(e){if(e==null)return;e.style.width=``;let t=document.createRange();t.selectNodeContents(e);let n=Math.max(...Array.from(t.getClientRects(),e=>e.width)),r=e.getBoundingClientRect().width/Number.parseFloat(getComputedStyle(e).width);Number.isFinite(n)&&r>0&&(e.style.width=`${Math.ceil(n/r)}px`)}function ue(e){return e.parentElement?.closest(`a[href], button, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"], [role="checkbox"], [role="link"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="radio"], [role="switch"], [role="tab"], [role="treeitem"]`)!=null}const de=String.raw`inline-block overflow-hidden text-ellipsis whitespace-nowrap align-bottom before:content-['\200B'] max-w-[calc(100%_-_var(--_tail-width)_+_0.5px)] [[data-truncated]>&]:max-w-[max(1ch_+_0.5px,calc(round(down,100%_-_var(--_tail-width),1ch)_+_0.5px))]`,fe=e=>{let t=s(8),n,r,a;if(t[0]!==e){let{"aria-describedby":i,asChild:o,describedBy:s,...c}=e;a=o,n=s,r=c,t[0]=e,t[1]=n,t[2]=r,t[3]=a}else n=t[1],r=t[2],a=t[3];let o=a!==void 0&&a?i:`span`,c;return t[4]!==o||t[5]!==n||t[6]!==r?(c=/* @__PURE__ */ d(o,{"aria-describedby":n,...r}),t[4]=o,t[5]=n,t[6]=r,t[7]=c):c=t[7],c},h=i=>{let f=s(97),p,m,h,g,_,v,y,b,x,S,C,w,T,E,D;f[0]===i?(p=f[1],m=f[2],h=f[3],g=f[4],_=f[5],v=f[6],y=f[7],b=f[8],x=f[9],S=f[10],C=f[11],w=f[12],T=f[13],E=f[14],D=f[15]):({"aria-describedby":g,asChild:C,children:p,className:m,"data-slot":h,onFocus:v,onPointerMove:y,ref:x,head:_,style:S,tabIndex:E,tail:w,translate:T,value:D,...b}=i,f[0]=i,f[1]=p,f[2]=m,f[3]=h,f[4]=g,f[5]=_,f[6]=v,f[7]=y,f[8]=b,f[9]=x,f[10]=S,f[11]=C,f[12]=w,f[13]=T,f[14]=E,f[15]=D);let pe=C!==void 0&&C,O=w===void 0?8:w,k=T===void 0?`no`:T,me;f[16]!==_||f[17]!==O||f[18]!==D?(me=se(D,{head:_,tail:O}),f[16]=_,f[17]=O,f[18]=D,f[19]=me):me=f[19];let{head:he,lead:A,tail:ge,tailGraphemes:_e}=me,[j,ve]=l(null),ye=ne(null),be=ne(null),xe=ne(null),Se=t(x,ve),[M,Ce]=l(null),[we,Te]=l(!1),[N,Ee]=l(!1),P=M?.truncated===!0,De;f[20]===j?De=f[21]:(De=()=>{j?.isConnected&&Ee(ue(j))},f[20]=j,f[21]=De),e(De);let F;f[22]!==A||f[23]!==j?(F=()=>{let e=ye.current,t=be.current;if(j==null||e==null||t==null)return;let n=xe.current,r=()=>{let r=ce({root:j,head:e,tail:t,lead:A==null||n==null?null:{ellipsis:n,length:A.length}});Ce(e=>e!=null&&e.headCap===r.headCap&&e.tailWidth===r.tailWidth&&e.truncated===r.truncated?e:r),r.truncated||Te(!1)};r();let i=new ResizeObserver(r);return i.observe(j),i.observe(t),()=>{i.disconnect()}},f[22]=A,f[23]=j,f[24]=F):F=f[24];let Oe;f[25]!==A||f[26]!==j||f[27]!==O||f[28]!==D?(Oe=[j,A,D,O],f[25]=A,f[26]=j,f[27]=O,f[28]=D,f[29]=Oe):Oe=f[29],e(F,Oe);let ke=M==null?`${_e}ch`:`${M.tailWidth}px`,Ae=M?.headCap==null?`${(_??0)+1}ch`:`${M.headCap}px`,I;f[30]===D?I=f[31]:(I=/* @__PURE__ */ d(`span`,{"data-slot":`truncated-text-value`,className:`sr-only select-none`,children:D}),f[30]=D,f[31]=I);let L;f[32]===A?L=f[33]:(L=A!=null&&/* @__PURE__ */ d(`span`,{ref:xe,"aria-hidden":!0,className:`invisible absolute select-none`,children:`…`}),f[32]=A,f[33]=L);let je=A!=null&&`w-[calc(round(up,var(--_head-cap)-0.5px,1ch)+0.5px)]`,R;f[34]===je?R=f[35]:(R=n(de,je),f[34]=je,f[35]=R);let z;f[36]!==he||f[37]!==R?(z=/* @__PURE__ */ d(`span`,{ref:ye,"aria-hidden":!0,"data-slot":`truncated-text-head`,className:R,children:he}),f[36]=he,f[37]=R,f[38]=z):z=f[38];let B;f[39]===ge?B=f[40]:(B=/* @__PURE__ */ d(`span`,{ref:be,"aria-hidden":!0,"data-slot":`truncated-text-tail`,dir:`rtl`,className:`inline-block overflow-hidden whitespace-nowrap text-left align-bottom min-w-(--_tail-width) [[data-truncated]>&]:min-w-0 [[data-truncated]>&]:max-w-[calc(round(down,100%_-_1ch_-_var(--_tail-width),1ch)_+_var(--_tail-width))] [[data-truncated]>:empty+&]:max-w-[calc(round(down,100%_-_var(--_tail-width),1ch)_+_var(--_tail-width)_+_0.5px)] [[data-truncated]>:empty+&]:text-ellipsis`,children:/* @__PURE__ */ d(`span`,{dir:`ltr`,children:ge})}),f[39]=ge,f[40]=B);let V;f[41]!==z||f[42]!==B||f[43]!==I||f[44]!==L?(V=/* @__PURE__ */ ie(re,{children:[I,L,z,B]}),f[41]=z,f[42]=B,f[43]=I,f[44]=L,f[45]=V):V=f[45];let H=V,U;f[46]===h?U=f[47]:(U=r(h,`truncated-text`),f[46]=h,f[47]=U);let Me=P?``:void 0,W;f[48]===m?W=f[49]:(W=n(`inline-block min-w-0 max-w-full rounded whitespace-nowrap select-all [font-variant-ligatures:none] focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,m),f[48]=m,f[49]=W);let G;f[50]!==Ae||f[51]!==A||f[52]!==S||f[53]!==ke?(G=a({"--_tail-width":ke,...A!=null&&{"--_head-cap":Ae},...S}),f[50]=Ae,f[51]=A,f[52]=S,f[53]=ke,f[54]=G):G=f[54];let Ne=P&&!N?E??0:E,K;f[55]!==N||f[56]!==P||f[57]!==y?(K=e=>{y?.(e),!P&&!N&&e.preventDefault()},f[55]=N,f[56]=P,f[57]=y,f[58]=K):K=f[58];let q;f[59]!==N||f[60]!==P||f[61]!==v?(q=e=>{v?.(e),!P&&!N&&e.preventDefault()},f[59]=N,f[60]=P,f[61]=v,f[62]=q):q=f[62];let Pe;f[63]!==Se||f[64]!==b||f[65]!==U||f[66]!==Me||f[67]!==W||f[68]!==G||f[69]!==Ne||f[70]!==K||f[71]!==q||f[72]!==k?(Pe={ref:Se,"data-slot":U,"data-truncated":Me,dir:`ltr`,className:W,style:G,tabIndex:Ne,onPointerMove:K,onFocus:q,translate:k,...b},f[63]=Se,f[64]=b,f[65]=U,f[66]=Me,f[67]=W,f[68]=G,f[69]=Ne,f[70]=K,f[71]=q,f[72]=k,f[73]=Pe):Pe=f[73];let J=Pe,Y;if(pe){let e;if(f[74]!==p||f[75]!==g||f[76]!==J||f[77]!==H){let t=c.only(p);u(te(t),"When using `asChild`, TruncatedText must be passed a single child as a JSX tag."),u(t.props.children==null,"When using `asChild`, the child of TruncatedText must have no children of its own. `value` is the content."),e=/* @__PURE__ */ d(fe,{asChild:!0,describedBy:g,...J,children:ee(t,{},H)}),f[74]=p,f[75]=g,f[76]=J,f[77]=H,f[78]=e}else e=f[78];Y=e}else{let e;f[79]!==g||f[80]!==J||f[81]!==H?(e=/* @__PURE__ */ d(fe,{describedBy:g,...J,children:H}),f[79]=g,f[80]=J,f[81]=H,f[82]=e):e=f[82],Y=e}if(N)return Y;let Fe=P&&we,X;f[83]===P?X=f[84]:(X=e=>Te(P&&e),f[83]=P,f[84]=X);let Z;f[85]===Y?Z=f[86]:(Z=/* @__PURE__ */ d(oe,{asChild:!0,children:Y}),f[85]=Y,f[86]=Z);let Q;f[87]===D?Q=f[88]:(Q=/* @__PURE__ */ d(`span`,{ref:le,className:`block`,children:D},D),f[87]=D,f[88]=Q);let $;f[89]!==Q||f[90]!==k?($=/* @__PURE__ */ d(o.Content,{className:`max-w-[min(24rem,calc(100vw-2rem))] break-all text-balance`,translate:k,children:Q}),f[89]=Q,f[90]=k,f[91]=$):$=f[91];let Ie;return f[92]!==Fe||f[93]!==X||f[94]!==Z||f[95]!==$?(Ie=/* @__PURE__ */ ie(ae,{open:Fe,onOpenChange:X,children:[Z,$]}),f[92]=Fe,f[93]=X,f[94]=Z,f[95]=$,f[96]=Ie):Ie=f[96],Ie};export{h as TruncatedText};
|
|
1
|
+
"use client";import{t as e}from"./use-isomorphic-layout-effect-CL6iq0Bj.js";import{t}from"./css-properties-D85fCNV3.js";import{t as n}from"./use-composed-refs-DPYmLDSe.js";import{t as r}from"./cx-CK7o_rVv.js";import{t as i}from"./data-slot-EM6s2WEU.js";import{t as a}from"./slot-B7rwscwd.js";import{t as o}from"./tooltip-DQO40Mrq.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,isValidElement as u,useRef as d,useState as f}from"react";import p from"tiny-invariant";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{Root as ee,Trigger as te}from"@radix-ui/react-tooltip";let ne;const _=/^[\x20-\x7E]*$/;function re(e,{head:t,tail:n}){if(p(Number.isInteger(n)&&n>=0,`TruncatedText: \`tail\` must be a non-negative integer, received ${String(n)}.`),p(t==null||Number.isInteger(t)&&t>=0,`TruncatedText: \`head\` must be a non-negative integer, received ${String(t)}.`),_.test(e))return v(e.length,(t,n)=>e.slice(t,n),{head:t,tail:n});ne??=new Intl.Segmenter(void 0,{granularity:`grapheme`});let r=Array.from(ne.segment(e),e=>e.segment);return v(r.length,(e,t)=>r.slice(e,t).join(``),{head:t,tail:n})}function v(e,t,{head:n,tail:r}){if(e<=r)return{head:``,lead:null,tail:t(0),tailGraphemes:e};let i=e-r,a=n!=null&&e>n+r;return{head:t(0,i),lead:a?t(0,n):null,tail:t(i),tailGraphemes:r}}function y(e){return Math.round(e.getBoundingClientRect().width*64)/64}let b;function x(e){return b??=document.createRange(),b.selectNodeContents(e),b}function S(){b?.selectNodeContents(document)}function C(e){return y(x(e))}function w(e){return e>0&&Number.isFinite(e)&&Math.abs(e-1)>1e-4?e:1}function T(e){let t=getComputedStyle(e),n=[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+(Number.parseFloat(t)||0),0),r=e.getBoundingClientRect().width,i=w(r/(Number.parseFloat(t.width)+(n>0&&t.boxSizing===`content-box`?n:0)));return{width:r/i-n,scale:i}}function E(e,t=T(e.root)){let{ellipsis:n,leadLength:r}=e,{scale:i}=t,a=t.width*i,o=O(e),{headLength:s,tailLength:c,tailWidth:l,text:u}=o,d=a+.5*i,{headWidth:f}=o;c>0&&f+l<=d&&f+l+l/c>d&&(f=Math.max(f,C(e.head)));let p=f+l>d;if(u==null)return{headCap:null,headFit:null,tailWidth:l/i,truncated:p};if(e.font?.headWidth!==o.headWidth||e.font.tailWidth!==l){let t=C(n);e.font={headWidth:o.headWidth,tailWidth:l,ellipsisWidth:t,monospace:k({...o,ellipsisWidth:t})}}let{ellipsisWidth:m,monospace:h}=e.font,g=null;if(p&&!h){let t=j(u,{length:s,limit:a-l-m,hint:e.fitLength});e.fitLength=t.length,g=(t.width+m)/i}if(r==null)return{headCap:null,headFit:g,tailWidth:l/i,truncated:p};let ee=Math.min(r,s),te=h?ee*m:A(u,ee);return{headCap:Math.min(te+m,f)/i,headFit:g,tailWidth:l/i,truncated:p}}function D(e){return e?.nodeType===Node.TEXT_NODE}function O({copy:e,head:t,tail:n}){let r=t.firstChild,i=D(r)?r.length:0,a=n.textContent?.length??0,o=e.firstChild;if(!D(o)||o.length!==i+a)return{headWidth:C(t),headLength:i,tailWidth:C(n),tailLength:a,text:D(r)?r:null};let s=C(e),c=i===0?s:C(n);return{headWidth:s-c,headLength:i,tailWidth:c,tailLength:a,text:o}}function k({headLength:e,headWidth:t,tailLength:n,tailWidth:r,ellipsisWidth:i}){return[e>0?t/e:i,n>0?r/n:i].every(e=>Math.abs(e-i)<1/32)}function A(e,t){let n=x(e);return n.setEnd(e,t),y(n)}function j(e,{length:t,limit:n,hint:r}){let i=0,a=t;if(r!=null&&r>0&&r<=t){let o=A(e,r);if(o<=n){if(r===t||A(e,r+1)>n)return{length:r,width:o};i=r+1}else{a=r-1;let t=A(e,a);if(t<=n)return{length:a,width:t};--a}}for(;i<a;){let t=Math.ceil((i+a)/2);A(e,t)<=n?i=t:a=t-1}return{length:i,width:A(e,i)}}const ie=/* @__PURE__ */ new WeakSet;function M(e){e.ownsTabStop&&(e.written?.truncated===!0?(e.root.tabIndex=0,ie.add(e.root)):(e.root.removeAttribute(`tabindex`),ie.delete(e.root)))}function N(e,t,{deferWidths:n=!1}={}){let{root:r,head:i,tail:a,written:o}=e,s=o==null||o.tailWidth!==t.tailWidth||o.headCap!==t.headCap;if(s&&n)return`deferred`;if(s){let e=`${t.tailWidth}px`;i.style.setProperty(`--_tail-width`,e),a.style.setProperty(`--_tail-width`,e),t.headCap!=null&&i.style.setProperty(`--_head-cap`,`${t.headCap}px`)}return o?.headFit!==t.headFit&&(t.headFit==null?i.style.removeProperty(`--_head-fit`):i.style.setProperty(`--_head-fit`,`${t.headFit}px`)),o?.truncated!==t.truncated&&r.toggleAttribute(`data-truncated`,t.truncated),e.written=t,M(e),t.truncated||e.onFit(),s?`resized`:`written`}function P(e,{deferWidths:t=!1,settle:n=!0,contentBoxes:r}={}){let i=Array.from(e,e=>[e,E(e,r?.get(e))]);S();let a=[],o=[];for(let[e,n]of i){let r=N(e,n,{deferWidths:t});r===`deferred`?a.push(e):r===`resized`&&e.leadLength!=null&&o.push(e)}n&&o.length>0&&P(o,{deferWidths:t,settle:!1}),a.length>0&&requestAnimationFrame(()=>{P(a.filter(e=>e.root.isConnected&&I.get(e.root)===e))})}function ae(e){let t=e.getRootNode();return`activeElement`in t&&t.activeElement===e}function oe(e){return e.hasAttribute(`data-truncated`)}const F=/* @__PURE__ */ new Set;function se(e){F.size===0&&queueMicrotask(()=>{let e=[...F].filter(e=>e.root.isConnected);F.clear(),P(e)}),F.add(e)}const I=/* @__PURE__ */ new WeakMap;let L;function ce(e){L??=new ResizeObserver(e=>{let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;for(let r of e){let e=I.get(r.target);if(e==null)continue;t.add(e);let i=r.borderBoxSize?.[0]?.inlineSize;r.target===e.root&&i!=null&&n.set(e,{width:r.contentRect.width,scale:w(e.root.getBoundingClientRect().width/i)})}P(t,{deferWidths:!0,contentBoxes:n})}),I.set(e.root,e),I.set(e.tail,e),L.observe(e.root),L.observe(e.tail)}function le(e){F.delete(e);for(let t of[e.root,e.tail])I.get(t)===e&&(I.delete(t),L?.unobserve(t))}function ue(e){if(e==null)return;e.style.width=``;let t=e.getBoundingClientRect().width/Number.parseFloat(getComputedStyle(e).width);if(!(t>0))return;let n=R(e,t);if(n.length>1){let t=n.reduce((e,t)=>e+t,0),r=t/Math.max(e.textContent?.length??1,1);e.style.width=`${Math.ceil(t/n.length+r)}px`}let r=Math.max(...R(e,t));Number.isFinite(r)&&(e.style.width=`${Math.ceil(r)}px`)}function R(e,t){let n=document.createRange();return n.selectNodeContents(e),Array.from(n.getClientRects(),e=>e.width/t)}function de(e){return e.parentElement?.closest(`a[href], button, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"], [role="checkbox"], [role="link"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="radio"], [role="switch"], [role="tab"], [role="treeitem"]`)!=null}const fe=String.raw`inline-block overflow-hidden text-ellipsis whitespace-nowrap align-bottom before:content-['\200B'] max-w-[calc(100%_-_var(--_tail-width)_+_0.5px)] [[data-truncated]>&]:max-w-[max(1ch_+_0.5px,min(100%_-_var(--_tail-width),var(--_head-fit,round(down,100%_-_var(--_tail-width),1ch)))_+_0.5px)]`;function pe(t){let n=s(10),r,i,a,o;if(n[0]!==t){let{"aria-describedby":e,"data-state":s,onBind:c,ref:l,...u}=t;o=s,i=c,a=l,r=u,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=o}else r=n[1],i=n[2],a=n[3],o=n[4];let c;return n[5]!==r||n[6]!==i||n[7]!==a||n[8]!==o?(c=()=>{i({ref:a,handlers:r,state:o})},n[5]=r,n[6]=i,n[7]=a,n[8]=o,n[9]=c):c=n[9],e(c),null}function me(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}const z=ne=>{let _=s(112),v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I;_[0]===ne?(v=_[1],y=_[2],b=_[3],x=_[4],S=_[5],C=_[6],w=_[7],T=_[8],E=_[9],D=_[10],O=_[11],k=_[12],A=_[13],j=_[14],M=_[15],N=_[16],P=_[17],F=_[18],I=_[19]):({"aria-describedby":x,asChild:M,children:v,className:y,"data-slot":b,onBlur:C,onClick:w,onFocus:T,onPointerDown:E,onPointerLeave:D,onPointerMove:O,ref:A,head:S,style:j,tabIndex:F,tail:N,translate:P,value:I,...k}=ne,_[0]=ne,_[1]=v,_[2]=y,_[3]=b,_[4]=x,_[5]=S,_[6]=C,_[7]=w,_[8]=T,_[9]=E,_[10]=D,_[11]=O,_[12]=k,_[13]=A,_[14]=j,_[15]=M,_[16]=N,_[17]=P,_[18]=F,_[19]=I);let L=M!==void 0&&M,R=N===void 0?8:N,z=P===void 0?`no`:P,he;_[20]!==S||_[21]!==R||_[22]!==I?(he=re(I,{head:S,tail:R}),_[20]=S,_[21]=R,_[22]=I,_[23]=he):he=_[23];let{head:ge,lead:B,tail:_e,tailGraphemes:ve}=he,ye=d(null),be=d(null),xe=d(null),Se=d(null),V=d(null),H=d(null),Ce=d(null),we=d(!1),[U,Te]=f(!1),[Ee,De]=f(!1),[W,Oe]=f(!1),ke;_[24]!==L||_[25]!==v||_[26]!==F?(ke=F!=null||L&&u(v)&&v.props.tabIndex!=null,_[24]=L,_[25]=v,_[26]=F,_[27]=ke):ke=_[27];let Ae=ke,je=!Ae&&!W,Me;_[28]!==Ae||_[29]!==B?.length||_[30]!==je?(Me=e=>{let t=ye.current,n=be.current,r=xe.current,i=Se.current;if(e==null||t==null||n==null||r==null||i==null)return;!je&&ie.delete(e)&&!Ae&&e.removeAttribute(`tabindex`);let a={root:e,head:t,tail:n,copy:i,ellipsis:r,leadLength:B?.length??null,ownsTabStop:je,written:null,font:null,fitLength:null,onFit:()=>De(!1)};V.current=a,ce(a),se(a);let o=H.current;return o!=null&&me(o.ref,e),()=>{le(a),V.current=null}},_[28]=Ae,_[29]=B?.length,_[30]=je,_[31]=Me):Me=_[31];let Ne=n(A,Me),Pe;_[32]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=()=>{let e=V.current?.root;e?.isConnected&&Oe(de(e))},_[32]=Pe):Pe=_[32],e(Pe);let Fe;_[33]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=()=>{let e=V.current;e!=null&&(e.written=null,e.font=null,e.fitLength=null,se(e))},_[33]=Fe):Fe=_[33];let Ie;_[34]!==R||_[35]!==I?(Ie=[I,R],_[34]=R,_[35]=I,_[36]=Ie):Ie=_[36],e(Fe,Ie);let Le=`${ve}ch`,Re=`${(S??0)+1}ch`,G;_[37]===I?G=_[38]:(G=/* @__PURE__ */ h(`span`,{ref:Se,"data-slot":`truncated-text-value`,className:`sr-only select-none`,children:I}),_[37]=I,_[38]=G);let ze;_[39]===Symbol.for(`react.memo_cache_sentinel`)?(ze=/* @__PURE__ */ h(`span`,{ref:xe,"aria-hidden":!0,translate:`no`,className:`invisible absolute select-none`,children:`…`}),_[39]=ze):ze=_[39];let Be=B!=null&&`w-[calc(round(up,var(--_head-cap)-0.5px,1ch)+0.5px)]`,K;_[40]===Be?K=_[41]:(K=r(fe,Be),_[40]=Be,_[41]=K);let q;_[42]!==ge||_[43]!==K?(q=/* @__PURE__ */ h(`span`,{ref:ye,"aria-hidden":!0,"data-slot":`truncated-text-head`,className:K,children:ge}),_[42]=ge,_[43]=K,_[44]=q):q=_[44];let J;_[45]===_e?J=_[46]:(J=/* @__PURE__ */ h(`span`,{ref:be,"aria-hidden":!0,"data-slot":`truncated-text-tail`,dir:`rtl`,className:`inline-block overflow-hidden whitespace-nowrap text-left align-bottom min-w-(--_tail-width) [[data-truncated]>&]:min-w-0 [[data-truncated]>&]:max-w-[calc(round(down,100%_-_1ch_-_var(--_tail-width),1ch)_+_var(--_tail-width))] [[data-truncated]>:empty+&]:max-w-[calc(round(down,100%_-_var(--_tail-width),1ch)_+_var(--_tail-width)_+_0.5px)] [[data-truncated]>:empty+&]:text-ellipsis`,children:/* @__PURE__ */ h(`span`,{dir:`ltr`,children:_e})}),_[45]=_e,_[46]=J);let Ve;_[47]!==G||_[48]!==q||_[49]!==J?(Ve=/* @__PURE__ */ g(m,{children:[G,ze,q,J]}),_[47]=G,_[48]=q,_[49]=J,_[50]=Ve):Ve=_[50];let Y=Ve,He;_[51]===W?He=_[52]:(He=e=>oe(e)&&!W,_[51]=W,_[52]=He);let X=He,Ue;_[53]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=e=>{Ce.current=e,Te(!0)},_[53]=Ue):Ue=_[53];let We=Ue,Z;_[54]===b?Z=_[55]:(Z=i(b,`truncated-text`),_[54]=b,_[55]=Z);let Ge=W?void 0:`closed`,Q;_[56]===y?Q=_[57]:(Q=r(`inline-block min-w-0 max-w-full rounded whitespace-nowrap select-all [font-variant-ligatures:none] focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,y),_[56]=y,_[57]=Q);let Ke;_[58]!==Re||_[59]!==B||_[60]!==j||_[61]!==Le?(Ke=t({"--_tail-width":Le,...B!=null&&{"--_head-cap":Re},...j}),_[58]=Re,_[59]=B,_[60]=j,_[61]=Le,_[62]=Ke):Ke=_[62];let qe;_[63]!==U||_[64]!==X||_[65]!==O?(qe=e=>{O?.(e),e.pointerType!==`touch`&&X(e.currentTarget)&&(U?H.current?.handlers.onPointerMove?.(e):We({type:`pointermove`,event:e}))},_[63]=U,_[64]=X,_[65]=O,_[66]=qe):qe=_[66];let Je;_[67]===D?Je=_[68]:(Je=e=>{D?.(e),Ce.current?.type===`pointermove`&&(Ce.current=null),H.current?.handlers.onPointerLeave?.(e)},_[67]=D,_[68]=Je);let Ye;_[69]!==U||_[70]!==E?(Ye=e=>{if(E?.(e),U){H.current?.handlers.onPointerDown?.(e);return}we.current=!0;let t=e.currentTarget.ownerDocument,n=()=>{we.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)};t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)},_[69]=U,_[70]=E,_[71]=Ye):Ye=_[71];let Xe;_[72]!==U||_[73]!==X||_[74]!==T?(Xe=e=>{T?.(e),X(e.currentTarget)&&(U?H.current?.handlers.onFocus?.(e):we.current||We({type:`focus`,event:e}))},_[72]=U,_[73]=X,_[74]=T,_[75]=Xe):Xe=_[75];let Ze;_[76]===C?Ze=_[77]:(Ze=e=>{C?.(e),H.current?.handlers.onBlur?.(e)},_[76]=C,_[77]=Ze);let Qe;_[78]===w?Qe=_[79]:(Qe=e=>{w?.(e),H.current?.handlers.onClick?.(e)},_[78]=w,_[79]=Qe);let $e;_[80]!==Ne||_[81]!==x||_[82]!==k||_[83]!==Z||_[84]!==Ge||_[85]!==Q||_[86]!==Ke||_[87]!==qe||_[88]!==Je||_[89]!==Ye||_[90]!==Xe||_[91]!==Ze||_[92]!==Qe||_[93]!==F||_[94]!==z?($e={ref:Ne,"aria-describedby":x,"data-slot":Z,"data-state":Ge,dir:`ltr`,className:Q,style:Ke,tabIndex:F,onPointerMove:qe,onPointerLeave:Je,onPointerDown:Ye,onFocus:Xe,onBlur:Ze,onClick:Qe,translate:z,...k},_[80]=Ne,_[81]=x,_[82]=k,_[83]=Z,_[84]=Ge,_[85]=Q,_[86]=Ke,_[87]=qe,_[88]=Je,_[89]=Ye,_[90]=Xe,_[91]=Ze,_[92]=Qe,_[93]=F,_[94]=z,_[95]=$e):$e=_[95];let et=$e,tt;if(L){let e;if(_[96]!==v||_[97]!==et||_[98]!==Y){let t=c.only(v);p(u(t),"When using `asChild`, TruncatedText must be passed a single child as a JSX tag."),p(t.props.children==null,"When using `asChild`, the child of TruncatedText must have no children of its own. `value` is the content."),e=/* @__PURE__ */ h(a,{...et,children:l(t,{},Y)}),_[96]=v,_[97]=et,_[98]=Y,_[99]=e}else e=_[99];tt=e}else{let e;_[100]!==et||_[101]!==Y?(e=/* @__PURE__ */ h(`span`,{...et,children:Y}),_[100]=et,_[101]=Y,_[102]=e):e=_[102],tt=e}let $;_[103]!==U||_[104]!==W||_[105]!==Ee||_[106]!==z||_[107]!==I?($=U&&!W&&/* @__PURE__ */ g(ee,{open:Ee,onOpenChange:e=>{let t=V.current?.root;De(e&&t!=null&&oe(t))},children:[/* @__PURE__ */ h(te,{asChild:!0,children:/* @__PURE__ */ h(pe,{onBind:e=>{let t=H.current;H.current=e;let n=V.current?.root;if(n==null)return;t?.ref!==e.ref&&(me(t?.ref,null),me(e.ref,n)),e.state!=null&&n.setAttribute(`data-state`,e.state);let r=Ce.current;r!=null&&(Ce.current=null,queueMicrotask(()=>{let e=H.current?.handlers;r.type===`pointermove`?e?.onPointerMove?.(r.event):ae(n)&&e?.onFocus?.(r.event)}))}})}),/* @__PURE__ */ h(o.Content,{className:`max-w-[min(24rem,calc(100vw-2rem))] break-all text-balance`,translate:z,children:/* @__PURE__ */ h(`span`,{ref:ue,className:`block`,children:I},I)})]}),_[103]=U,_[104]=W,_[105]=Ee,_[106]=z,_[107]=I,_[108]=$):$=_[108];let nt;return _[109]!==tt||_[110]!==$?(nt=/* @__PURE__ */ g(m,{children:[tt,$]}),_[109]=tt,_[110]=$,_[111]=nt):nt=_[111],nt};export{z as TruncatedText};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
-
import { a as Booleanish, i as DeepNonNullable, n as CssProperties, o as parseBooleanish, r as VariantProps, t as $cssProperties } from "./index-
|
|
2
|
+
import { a as Booleanish, i as DeepNonNullable, n as CssProperties, o as parseBooleanish, r as VariantProps, t as $cssProperties } from "./index-KJ06KK6t.js";
|
|
3
3
|
import { t as WithStyleProps } from "./with-style-props-CuT30s0W.js";
|
|
4
4
|
export { $cssProperties, type Booleanish, type CssProperties, type DeepNonNullable, type VariantProps, type WithAsChild, type WithStyleProps, parseBooleanish };
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./
|
|
1
|
+
import{t as e}from"./booleanish-BfvnW6vy.js";import{t}from"./css-properties-D85fCNV3.js";export{t as $cssProperties,e as parseBooleanish};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{c as e}from"react/compiler-runtime";import{useSyncExternalStore as t}from"react";const n=[`2xl`,`xl`,`lg`,`md`,`sm`,`xs`,`2xs`],r=[`default`,...n];function i(){return t(b,x,a)}function a(){return`default`}function o(n){let r=e(4),i;r[0]===n?i=r[1]:(i=C(n),r[0]=n,r[1]=i);let a;return r[2]===n?a=r[3]:(a=T(n),r[2]=n,r[3]=a),t(i,a,s)}function s(){return!1}const c={"2xl":`(min-width: 96rem)`,xl:`(min-width: 80rem)`,lg:`(min-width: 64rem)`,md:`(min-width: 48rem)`,sm:`(min-width: 40rem)`,xs:`(min-width: 30rem)`,"2xs":`(min-width: 22.5rem)`},l={"2xl":`(max-width: 95.99rem)`,xl:`(max-width: 79.99rem)`,lg:`(max-width: 63.99rem)`,md:`(max-width: 47.99rem)`,sm:`(max-width: 39.99rem)`,xs:`(max-width: 29.99rem)`,"2xs":`(max-width: 22.49rem)`};let u=null,d=null;function f(){return u||={"2xl":window.matchMedia(c[`2xl`]),xl:window.matchMedia(c.xl),lg:window.matchMedia(c.lg),md:window.matchMedia(c.md),sm:window.matchMedia(c.sm),xs:window.matchMedia(c.xs),"2xs":window.matchMedia(c[`2xs`])},u}function p(e){return d||={"2xl":window.matchMedia(l[`2xl`]),xl:window.matchMedia(l.xl),lg:window.matchMedia(l.lg),md:window.matchMedia(l.md),sm:window.matchMedia(l.sm),xs:window.matchMedia(l.xs),"2xs":window.matchMedia(l[`2xs`])},d[e]}let m=`default`;const h=/* @__PURE__ */ new Set;let g=!1;function _(){let e=f();for(let t of n)if(e[t].matches)return t;return`default`}let v=!1;function y(){v||(v=!0,requestAnimationFrame(()=>{v=!1;let e=_();if(e!==m){m=e;for(let e of h)e()}}))}function b(e){if(h.add(e),!g){g=!0;let e=f();m=_();for(let t of Object.values(e))t.addEventListener(`change`,y)}return e(),()=>{if(h.delete(e),h.size===0&&g){g=!1;let e=f();for(let t of Object.values(e))t.removeEventListener(`change`,y)}}}function x(){return g||(m=_()),m}const S=/* @__PURE__ */ new Map;function C(e){let t=S.get(e);return t||(t=t=>{let n=p(e),r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1,t()}))};return n.addEventListener(`change`,i),()=>{n.removeEventListener(`change`,i)}},S.set(e,t),t)}const w=/* @__PURE__ */ new Map;function T(e){let t=w.get(e);return t||(t=()=>p(e).matches,w.set(e,t),t)}export{i as n,o as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{c as e}from"react/compiler-runtime";import{useEffect as t,useRef as n}from"react";function r(r){let i=e(3),a=n(r),o;i[0]===r?o=i[1]:(o=()=>{a.current=r},i[0]=r,i[1]=o),t(o);let s;return i[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(...e)=>{let t=e;return a.current?.(...t)},i[2]=s):s=i[2],s}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./compose-refs-BdRUneoc.js";import{c as t}from"react/compiler-runtime";function n(n,r,i){let a=t(4),o;return a[0]!==n||a[1]!==r||a[2]!==i?(o=t=>e(n,r,i)(t),a[0]=n,a[1]=r,a[2]=i,a[3]=o):o=a[3],o}export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./copy-to-clipboard-Dd83caRw.js";function t(){return e}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./alert-DO00UiQe.js";import{c as t}from"react/compiler-runtime";import{useEffect as n,useLayoutEffect as r}from"react";function i({tabStops:e,current:t,backwards:n}){let r=e[0],i=e[e.length-1];if(r==null||i==null)return null;let a=e.findIndex(e=>e===t);if(a!==-1)return n?a===0?i:null:a===e.length-1?r:null;if(t==null)return n?i:r;if(n){let n=e.filter(e=>(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)!==0);return n[n.length-1]??i}return e.find(e=>(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0)??r}function a(r,a){let o=t(6),s;o[0]===a?s=o[1]:(s=a===void 0?{}:a,o[0]=a,o[1]=s);let{active:c}=s,l=c===void 0||c,u,d;o[2]!==l||o[3]!==r?(u=()=>{let t=r.current;if(!l||t==null)return;let n=!t.hasAttribute(`tabindex`);n&&(t.tabIndex=-1);let a=0,o=60,s=()=>{if(t.contains(document.activeElement))return;let[n]=e(t);(n??t).focus(),--o,!t.contains(document.activeElement)&&o>0&&(a=requestAnimationFrame(s))};s();let c=n=>{if(n.key!==`Tab`||n.defaultPrevented||!(n.target instanceof Node)||!t.contains(n.target))return;let r=e(t);if(r.length===0){n.preventDefault();return}let a=i({tabStops:r,current:document.activeElement,backwards:n.shiftKey});a!=null&&(n.preventDefault(),a.focus())};return document.addEventListener(`keydown`,c),()=>{cancelAnimationFrame(a),document.removeEventListener(`keydown`,c),n&&t.removeAttribute(`tabindex`)}},d=[l,r],o[2]=l,o[3]=r,o[4]=u,o[5]=d):(u=o[4],d=o[5]),n(u,d)}function o(e,n){let i=t(6),a;i[0]===n?a=i[1]:(a=n===void 0?{}:n,i[0]=n,i[1]=a);let{active:o}=a,c=o===void 0||o,l,u;i[2]!==c||i[3]!==e?(l=()=>{let t=e.current;if(c&&t!=null)return s(t)},u=[c,e],i[2]=c,i[3]=e,i[4]=l,i[5]=u):(l=i[4],u=i[5]),r(l,u)}function s(e){let t=e.parentElement;if(t==null)return;let n=/* @__PURE__ */ new Set,r=()=>{for(let r of t.children)r!==e&&r instanceof HTMLElement&&!r.inert&&(r.inert=!0,n.add(r))};r();let i=new MutationObserver(r);return i.observe(t,{childList:!0}),()=>{i.disconnect();for(let e of n)e.inert=!1}}export{a as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./browser-only-ymFoM3Ya.js";import{useSyncExternalStore as t}from"react";function n(e){return`userAgentData`in e}function r(){if(!e())return!1;let t=``;return n(navigator)&&(t=navigator.userAgentData.platform??``),t||=navigator.platform||navigator.userAgent||``,/mac|iphone|ipad|ipod/i.test(t)}function i(){return()=>{}}function a(){return!1}function o(){return t(i,r,a)}export{r as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useSyncExternalStore as e}from"react";function t(){return()=>{}}function n(){return!0}function r(){return!1}function i(){return e(t,n,r)}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{c as e}from"react/compiler-runtime";import{useEffect as t,useState as n}from"react";function r(){let r=e(2),[i,a]=n(!1),o,s;return r[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=requestAnimationFrame(()=>{a(!0)});return()=>{cancelAnimationFrame(e)}},s=[],r[0]=o,r[1]=s):(o=r[0],s=r[1]),t(o,s),i}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./browser-only-ymFoM3Ya.js";import{useEffect as t,useLayoutEffect as n}from"react";const r=e()?n:t;export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{c as e}from"react/compiler-runtime";import{useRef as t,useSyncExternalStore as n}from"react";function r(r){let a=e(6),o=t(null),s;a[0]===r?s=a[1]:(s=()=>((o.current==null||o.current.query!==r)&&(o.current={query:r,list:window.matchMedia(r)}),o.current.list),a[0]=r,a[1]=s);let c=s,l;a[2]===c?l=a[3]:(l=e=>{let t=c();return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},a[2]=c,a[3]=l);let u=l,d;return a[4]===c?d=a[5]:(d=()=>c().matches,a[4]=c,a[5]=d),n(u,d,i)}function i(){return!1}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./browser-only-ymFoM3Ya.js";import{t}from"./use-matches-media-query-FfvtNKQe.js";const n=`(prefers-reduced-motion: no-preference)`;function r(){return!e()||!window.matchMedia(n).matches}function i(){return!t(n)}export{i as n,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{c as e}from"react/compiler-runtime";import{useEffect as t,useLayoutEffect as n,useRef as r}from"react";function i({offset:e,size:t,velocity:n,threshold:r,flickVelocity:i}){return e>0&&(e>=t*r||n>=i)}function a(e,t){return t<=0?0:(1-1/(.55*e/t+1))*t}function o(e,t){switch(t){case`right`:return e.clientX;case`left`:return-e.clientX;case`down`:return e.clientY;case`up`:return-e.clientY}}function s(e,t){return t===`left`||t===`right`?e.clientY:e.clientX}function c(e,t){switch(t){case`right`:return`${e}px`;case`left`:return`${-e}px`;case`down`:return`0 ${e}px`;case`up`:return`0 ${-e}px`}}function l(e,t,n){e.property===`flex-basis`?e.target.style.flexBasis=`${e.size-t}px`:e.target.style.translate=c(t,n)}function u(e){e.target.style.removeProperty(`transition`),e.target.style.removeProperty(e.property===`flex-basis`?`flex-basis`:`translate`)}function d(c,d){let f=e(5),p=r(d),m;f[0]===d?m=f[1]:(m=()=>{p.current=d},f[0]=d,f[1]=m),n(m);let h,g;f[2]===c?(h=f[3],g=f[4]):(h=()=>{let e=c.current;if(e==null)return;let t=null,n=!1,r=()=>{document.removeEventListener(`pointermove`,d),document.removeEventListener(`pointerup`,f),document.removeEventListener(`pointercancel`,f),t=null},d=e=>{let{direction:n}=p.current,i=n===void 0?`right`:n;if(t==null||e.pointerId!==t.pointerId)return;let c=o(e,i),u=c-t.start;if(!t.dragging){let n=Math.abs(s(e,i)-t.crossStart);if(n>=8&&n>Math.abs(u)){r();return}if(Math.abs(u)<8)return;t.dragging=!0,t.target.style.transition=`none`}let d=e.timeStamp-t.lastTime;d>0&&(t.velocity=(c-t.last)/d),t.last=c,t.lastTime=e.timeStamp,t.offset=Math.max(0,u);let f=u>=0?u:-a(-u,t.size);l(t,f,i)},f=e=>{let{onDismiss:a,threshold:o,flickVelocity:s}=p.current,c=o===void 0?.25:o,l=s===void 0?.4:s;if(t==null||e.pointerId!==t.pointerId)return;let d=t;if(r(),!d.dragging||(n=!0,window.setTimeout(()=>{n=!1},0),u(d),e.type===`pointercancel`))return;let f=e.timeStamp-d.lastTime>100?0:d.velocity;i({...d,velocity:f,threshold:c,flickVelocity:l})&&a()},m=n=>{let{active:r,direction:i,property:a,target:c}=p.current,l=r===void 0||r,u=i===void 0?`right`:i,m=a===void 0?`translate`:a;if(!(typeof l==`function`?l():l)||!n.isPrimary||n.button!==0||t!=null)return;let h=c?.current??e,g=h.getBoundingClientRect(),_=o(n,u);t={target:h,property:typeof m==`function`?m():m,pointerId:n.pointerId,start:_,crossStart:s(n,u),size:u===`left`||u===`right`?g.width:g.height,dragging:!1,last:_,lastTime:n.timeStamp,velocity:0,offset:0},document.addEventListener(`pointermove`,d),document.addEventListener(`pointerup`,f),document.addEventListener(`pointercancel`,f)},h=e=>{n&&(n=!1,e.preventDefault(),e.stopPropagation())};return e.addEventListener(`pointerdown`,m),e.addEventListener(`click`,h,!0),()=>{t?.dragging&&u(t),r(),e.removeEventListener(`pointerdown`,m),e.removeEventListener(`click`,h,!0)}},g=[c],f[2]=c,f[3]=h,f[4]=g),t(h,g)}export{d as n,a as t};
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { i as inView, n as MarginType, o as composeRefs, r as ViewChangeHandler, s as copyToClipboard, t as InViewOptions } from "./in-view-C_daNafg.js";
|
|
1
2
|
import { _ as timeSortingDirections, a as AlphanumericSortingDirection, c as TimeSortingDirection, d as isSortingDirection, f as isSortingMode, g as timeSortingByDirection, h as sortingModes, i as $timeSortingDirection, l as alphanumericSortingDirections, m as sortingDirections, n as $sortingDirection, o as SortingDirection, p as isTimeSortingDirection, r as $sortingMode, s as SortingMode, t as $alphanumericSortingDirection, u as isAlphanumericSortingDirection } from "./direction-CpRzTtZh.js";
|
|
2
|
-
import { a as composeRefs, i as inView, n as MarginType, r as ViewChangeHandler, s as copyToClipboard, t as InViewOptions } from "./in-view-B3nMAzfE.js";
|
|
3
3
|
/**
|
|
4
4
|
* Compare dates in newest-to-oldest (descending) order.
|
|
5
5
|
* Used for chronological sorting use cases.
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./
|
|
1
|
+
import{t as e}from"./copy-to-clipboard-Dd83caRw.js";import{t}from"./in-view-Dxv_GrUU.js";import{t as n}from"./compose-refs-BdRUneoc.js";import{a as r,c as i,d as a,f as o,i as s,l as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./direction-CvDpql3O.js";function g(e,t){return Math.sign(t.getTime()-e.getTime())}function _(e,t){return Math.sign(e.getTime()-t.getTime())}export{m as $alphanumericSortingDirection,l as $sortingDirection,f as $sortingMode,s as $timeSortingDirection,r as alphanumericSortingDirections,g as compareDatesNewestToOldest,_ as compareDatesOldestToNewest,n as composeRefs,e as copyToClipboard,t as inView,u as isAlphanumericSortingDirection,p as isSortingDirection,i as isSortingMode,c as isTimeSortingDirection,h as sortingDirections,a as sortingModes,o as timeSortingByDirection,d as timeSortingDirections};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the VisuallyHidden component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/primitives/visually-hidden
|
|
5
|
+
*/
|
|
1
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
7
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
3
8
|
import { ComponentProps } from "react";
|
|
4
9
|
/**
|
|
5
10
|
* Content for assistive technology only. Renders a native `<span>` clipped to
|
|
@@ -23,6 +28,14 @@ import { ComponentProps } from "react";
|
|
|
23
28
|
* | -------------- | ------------------- | ------------------------------------------------------------------------- |
|
|
24
29
|
* | `data-slot` | `"visually-hidden"` | Stamped on the rendered element, and joined onto the child via `asChild`. |
|
|
25
30
|
*
|
|
31
|
+
* @useWhen Give screen readers text that sighted users never see, such as "(opens in a new tab)" on
|
|
32
|
+
* an external link.
|
|
33
|
+
*
|
|
34
|
+
* @siblings
|
|
35
|
+
* - `LiveRegion`: screen readers must announce the text when it changes.
|
|
36
|
+
* - `IconButton`: the text names an icon-only button; pass it as the `label` prop.
|
|
37
|
+
* - `SkipToMainLink`: the hidden content is a skip link that shows on focus.
|
|
38
|
+
*
|
|
26
39
|
* @see https://mantle.ngrok.com/components/primitives/visually-hidden
|
|
27
40
|
* @see https://webaim.org/techniques/css/invisiblecontent/
|
|
28
41
|
*
|
package/dist/visually-hidden.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=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,asChild:s,className:c,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:`span`,p;o[6]===l?p=o[7]:(p=t(l,`visually-hidden`),o[6]=l,o[7]=p);let m;o[8]===c?m=o[9]:(m=e(`sr-only`,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 VisuallyHidden};
|
package/dist/well.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Well component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/structure/well
|
|
5
|
+
*/
|
|
1
6
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
7
|
+
import "./index-KJ06KK6t.js";
|
|
8
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
4
9
|
import { ComponentProps } from "react";
|
|
5
10
|
type WellProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
|
|
6
11
|
/**
|
package/dist/well.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=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":c,asChild:d,className:s,ref:u,...l}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=d!==void 0&&d?n:`div`,p;o[6]===c?p=o[7]:(p=t(c,`well`),o[6]=c,o[7]=p);let m;o[8]===s?m=o[9]:(m=e(`border-card-muted bg-base relative rounded-md border shadow-inner`,s),o[8]=s,o[9]=m);let h;return o[10]!==f||o[11]!==l||o[12]!==u||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{ref:u,"data-slot":p,className:m,...l}),o[10]=f,o[11]=l,o[12]=u,o[13]=p,o[14]=m,o[15]=h):h=o[15],h};export{a as Well};
|
package/package.json
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/mantle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.1",
|
|
4
4
|
"description": "mantle is ngrok's UI library and design system.",
|
|
5
5
|
"homepage": "https://mantle.ngrok.com",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "ngrok",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"react",
|
|
10
|
+
"design-system",
|
|
11
|
+
"component-library",
|
|
12
|
+
"ui",
|
|
13
|
+
"tailwindcss",
|
|
14
|
+
"radix-ui",
|
|
15
|
+
"accessibility",
|
|
16
|
+
"ngrok"
|
|
17
|
+
],
|
|
8
18
|
"repository": {
|
|
9
19
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/ngrok/mantle"
|
|
20
|
+
"url": "https://github.com/ngrok/mantle",
|
|
21
|
+
"directory": "packages/mantle"
|
|
11
22
|
},
|
|
12
23
|
"files": [
|
|
13
24
|
"dist",
|
|
14
|
-
"package.json"
|
|
25
|
+
"package.json",
|
|
26
|
+
"src/components/chart/d3-license.md"
|
|
15
27
|
],
|
|
16
28
|
"type": "module",
|
|
17
29
|
"sideEffects": [
|
|
@@ -29,6 +41,9 @@
|
|
|
29
41
|
"./package.json": "./package.json",
|
|
30
42
|
"./agent.json": "./dist/agent.json",
|
|
31
43
|
"./llms.txt": "./dist/llms.txt",
|
|
44
|
+
"./tokens.json": "./dist/tokens.json",
|
|
45
|
+
"./tokens.dark.json": "./dist/tokens.dark.json",
|
|
46
|
+
"./tokens.resolver.json": "./dist/tokens.resolver.json",
|
|
32
47
|
"./accordion": "./dist/accordion.js",
|
|
33
48
|
"./alert": "./dist/alert.js",
|
|
34
49
|
"./alert-center": "./dist/alert-center.js",
|
|
@@ -85,6 +100,7 @@
|
|
|
85
100
|
"./sandbar": "./dist/sandbar.js",
|
|
86
101
|
"./sandboxed-on-click": "./dist/sandboxed-on-click.js",
|
|
87
102
|
"./scatter-plot": "./dist/scatter-plot.js",
|
|
103
|
+
"./segmented-control": "./dist/segmented-control.js",
|
|
88
104
|
"./select": "./dist/select.js",
|
|
89
105
|
"./selectable-list": "./dist/selectable-list.js",
|
|
90
106
|
"./separator": "./dist/separator.js",
|
|
@@ -111,7 +127,7 @@
|
|
|
111
127
|
"./well": "./dist/well.js"
|
|
112
128
|
},
|
|
113
129
|
"dependencies": {
|
|
114
|
-
"@ariakit/react": "0.4.
|
|
130
|
+
"@ariakit/react": "0.4.43",
|
|
115
131
|
"@headlessui/react": "2.2.10",
|
|
116
132
|
"@radix-ui/react-dialog": "1.3.1",
|
|
117
133
|
"@radix-ui/react-dropdown-menu": "2.2.1",
|
|
@@ -125,11 +141,9 @@
|
|
|
125
141
|
"@radix-ui/react-tabs": "1.2.1",
|
|
126
142
|
"@radix-ui/react-tooltip": "1.4.1",
|
|
127
143
|
"@tanstack/react-table": "9.3.1",
|
|
128
|
-
"@tanstack/react-virtual": "3.14.
|
|
144
|
+
"@tanstack/react-virtual": "3.14.26",
|
|
129
145
|
"class-variance-authority": "0.7.1",
|
|
130
146
|
"cmdk": "1.1.1",
|
|
131
|
-
"d3-scale": "4.0.2",
|
|
132
|
-
"d3-shape": "3.2.0",
|
|
133
147
|
"input-otp": "1.5.0",
|
|
134
148
|
"react-day-picker": "10.0.2",
|
|
135
149
|
"sonner": "2.0.8",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# d3 license
|
|
2
|
+
|
|
3
|
+
These chart modules hold code ported from d3:
|
|
4
|
+
|
|
5
|
+
- `curve.ts`: the line and area generators and three curves of `d3-shape` 3.2.1
|
|
6
|
+
- `time-ticks.ts`: the local time intervals and the tick solver of `d3-time` 3.1.1, the tick label rule of `d3-scale` 4.0.3 with its eight formats of `d3-time-format` 4.1.1, and `tickStep` of `d3-array` 3.2.5
|
|
7
|
+
- `scales.ts`: `ticks`, `tickIncrement`, and `nice` of `d3-array` 3.2.4
|
|
8
|
+
|
|
9
|
+
The five packages share this license:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Copyright 2010-2026 Mike Bostock
|
|
13
|
+
|
|
14
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
15
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
16
|
+
and this permission notice appear in all copies.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
19
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
20
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
21
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
22
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
23
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
24
|
+
THIS SOFTWARE.
|
|
25
|
+
```
|
package/dist/alert-P9lwn25X.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./icon-BudQMD2S.js";import{t as a}from"./slot-DdYN1L1C.js";import{t as o}from"./css-properties-D85fCNV3.js";import{t as s}from"./button-Dge0D5bl.js";import{t as c}from"./button-B8k98Pby.js";import{n as l,r as u}from"./alert-DO00UiQe.js";import{c as d}from"react/compiler-runtime";import{CaretDownIcon as f}from"@phosphor-icons/react/CaretDown";import{createContext as p,useContext as m,useEffect as h,useRef as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{CheckCircleIcon as b}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as x}from"@phosphor-icons/react/Info";import{MegaphoneIcon as S}from"@phosphor-icons/react/Megaphone";import{WarningIcon as C}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as w}from"@phosphor-icons/react/WarningDiamond";import{XIcon as T}from"@phosphor-icons/react/X";import{cva as E}from"class-variance-authority";const D=p(null),O=/* @__PURE__ */ v(T,{});function k(){let e=m(D);return _(e,`useAlertContext hook used outside of Alert parent!`),e}const A=e=>{let t=d(6),{children:n,intent:r,redirectDismissFocus:i}=e,a=i===void 0||i,o;t[0]!==r||t[1]!==a?(o={intent:r,redirectDismissFocus:a},t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c;return t[3]!==n||t[4]!==s?(c=/* @__PURE__ */ v(D.Provider,{value:s,children:n}),t[3]=n,t[4]=s,t[5]=c):c=t[5],c},j=E(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{intent:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a:not([data-slot~=button])]:text-danger-700 [&_a:not([data-slot~=button])]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a:not([data-slot~=button])]:text-important-700 [&_a:not([data-slot~=button])]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a:not([data-slot~=button])]:text-info-700 [&_a:not([data-slot~=button])]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a:not([data-slot~=button])]:text-success-700 [&_a:not([data-slot~=button])]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a:not([data-slot~=button])]:text-warning-700 [&_a:not([data-slot~=button])]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}}}),M=e=>{let t=d(26),i,a,s,c,l,u,f;t[0]===e?(i=t[1],a=t[2],s=t[3],c=t[4],l=t[5],u=t[6],f=t[7]):({"data-slot":a,appearance:f,className:i,intent:s,ref:l,style:u,...c}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=f);let p=f===void 0?`default`:f,m;t[8]===a?m=t[9]:(m=r(a,`alert`),t[8]=a,t[9]=m);let h;t[10]!==p||t[11]!==i||t[12]!==s?(h=n(j({appearance:p,intent:s}),`has-data-alert-dismiss:pr-10`,`has-data-alert-expand:**:data-[slot~=alert-dismiss-icon-button]:right-16`,`md:has-data-alert-expand:**:data-[slot~=alert-dismiss-icon-button]:right-24`,`has-data-alert-expand:**:data-[slot~=alert-content]:pr-12`,`md:has-data-alert-expand:**:data-[slot~=alert-content]:pr-22`,i),t[10]=p,t[11]=i,t[12]=s,t[13]=h):h=t[13];let g;t[14]!==s||t[15]!==u?(g=o({"--alert-control-color":R(s),"--alert-control-hover-color":z(s),"--alert-control-hover-bg":B(s),...u}),t[14]=s,t[15]=u,t[16]=g):g=t[16];let _;t[17]!==c||t[18]!==l||t[19]!==m||t[20]!==h||t[21]!==g?(_=/* @__PURE__ */ v(`div`,{ref:l,"data-slot":m,className:h,style:g,...c}),t[17]=c,t[18]=l,t[19]=m,t[20]=h,t[21]=g,t[22]=_):_=t[22];let y;return t[23]!==s||t[24]!==_?(y=/* @__PURE__ */ v(A,{intent:s,children:_}),t[23]=s,t[24]=_,t[25]=y):y=t[25],y},N={danger:/* @__PURE__ */ v(C,{}),important:/* @__PURE__ */ v(S,{mirrored:!0}),info:/* @__PURE__ */ v(x,{}),success:/* @__PURE__ */ v(b,{}),warning:/* @__PURE__ */ v(w,{})},P=e=>{let t=d(16),a,o,s,c,l;t[0]===e?(a=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,className:a,ref:c,svg:l,...s}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=k(),f=N[u.intent],p;t[6]===o?p=t[7]:(p=r(o,`alert-icon`),t[6]=o,t[7]=p);let m;t[8]===a?m=t[9]:(m=n(`size-5`,a),t[8]=a,t[9]=m);let h=l??f,g;return t[10]!==s||t[11]!==c||t[12]!==p||t[13]!==m||t[14]!==h?(g=/* @__PURE__ */ v(i,{ref:c,"data-slot":p,className:m,svg:h,...s}),t[10]=s,t[11]=c,t[12]=p,t[13]=m,t[14]=h,t[15]=g):g=t[15],g},F=e=>{let t=d(14),i,a,o,s;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4]):({"data-slot":a,className:i,ref:s,...o}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s);let c;t[5]===a?c=t[6]:(c=r(a,`alert-content`),t[5]=a,t[6]=c);let l;t[7]===i?l=t[8]:(l=n(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,i),t[7]=i,t[8]=l);let u;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==l?(u=/* @__PURE__ */ v(`div`,{ref:s,"data-slot":c,className:l,...o}),t[9]=o,t[10]=s,t[11]=c,t[12]=l,t[13]=u):u=t[13],u},I=e=>{let t=d(16),i,o,s,c,l;t[0]===e?(i=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,asChild:l,className:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=l!==void 0&&l?a:`h5`,f;t[6]===o?f=t[7]:(f=r(o,`alert-title`),t[6]=o,t[7]=f);let p;t[8]===i?p=t[9]:(p=n(`font-medium`,i),t[8]=i,t[9]=p);let m;return t[10]!==u||t[11]!==s||t[12]!==c||t[13]!==f||t[14]!==p?(m=/* @__PURE__ */ v(u,{ref:c,"data-slot":f,className:p,...s}),t[10]=u,t[11]=s,t[12]=c,t[13]=f,t[14]=p,t[15]=m):m=t[15],m},L=e=>{let t=d(16),i,o,s,c,l;t[0]===e?(i=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,asChild:l,className:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=l!==void 0&&l?a:`div`,f;t[6]===o?f=t[7]:(f=r(o,`alert-description`),t[6]=o,t[7]=f);let p;t[8]===i?p=t[9]:(p=n(`text-sm`,i),t[8]=i,t[9]=p);let m;return t[10]!==u||t[11]!==s||t[12]!==c||t[13]!==f||t[14]!==p?(m=/* @__PURE__ */ v(u,{ref:c,"data-slot":f,className:p,...s}),t[10]=u,t[11]=s,t[12]=c,t[13]=f,t[14]=p,t[15]=m):m=t[15],m},R=e=>`var(--color-${e}-700)`,z=e=>`var(--color-${e}-800)`,B=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`;function V(t){let n=d(8),{buttonRef:r,enabled:i}=t,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],n[0]=a):a=n[0];let o=g(a),s,c;n[1]!==r||n[2]!==i?(s=()=>{if(i)return()=>{let e=r.current;if(e==null||document.activeElement!==e)return;let t=e.closest(`[data-slot~="alert"]`)??e;o.current=l(t)}},c=[r,i],n[1]=r,n[2]=i,n[3]=s,n[4]=c):(s=n[3],c=n[4]),e(s,c);let f,p;n[5]===i?(f=n[6],p=n[7]):(f=()=>{if(i)return()=>{let e=o.current;if(o.current=[],e.length===0)return;let{activeElement:t}=document;if(t==null||t===document.body){for(let t of e)if(t.isConnected&&u(t)&&(t.focus(),document.activeElement===t))return}}},p=[i],n[5]=i,n[6]=f,n[7]=p),h(f,p)}const H={Root:M,Content:F,ExpandButton:e=>{let t=d(25),i,a,o,c,l;t[0]===e?(i=t[1],a=t[2],o=t[3],c=t[4],l=t[5]):({"data-slot":o,count:a,expanded:c,className:i,...l}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=c,t[5]=l);let u=c?`Collapse additional alerts`:`Show ${a} more ${a===1?`alert`:`alerts`}`,p;t[6]===o?p=t[7]:(p=r(o,`alert-expand-button`),t[6]=o,t[7]=p);let m=c&&`-rotate-180`,h;t[8]===m?h=t[9]:(h=n(`size-4 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`,m),t[8]=m,t[9]=h);let g;t[10]===h?g=t[11]:(g=/* @__PURE__ */ v(f,{weight:`bold`,className:h}),t[10]=h,t[11]=g);let _;t[12]===i?_=t[13]:(_=n(`right-1.5 top-1.5 absolute gap-1 ps-1.5 pe-1`,`text-(--alert-control-color,currentColor)`,`not-disabled:hover:bg-(--alert-control-hover-bg,transparent) not-disabled:hover:text-(--alert-control-hover-color,currentColor)`,i),t[12]=i,t[13]=_);let b;t[14]===a?b=t[15]:(b=/* @__PURE__ */ y(`span`,{className:`min-w-[2ch] text-center tabular-nums`,children:[`+`,a]}),t[14]=a,t[15]=b);let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=/* @__PURE__ */ v(`span`,{className:`hidden md:inline`,children:`more`}),t[16]=x):x=t[16];let S;return t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==p||t[21]!==g||t[22]!==_||t[23]!==b?(S=/* @__PURE__ */ y(s,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"aria-expanded":c,"aria-label":u,"data-slot":p,"data-alert-expand":!0,icon:g,iconPlacement:`end`,className:_,...l,children:[b,x]}),t[17]=c,t[18]=l,t[19]=u,t[20]=p,t[21]=g,t[22]=_,t[23]=b,t[24]=S):S=t[24],S},Description:L,DismissIconButton:e=>{let i=d(26),a,o,s,l,u,f,p,h,_;i[0]===e?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],f=i[6],p=i[7],h=i[8],_=i[9]):({"data-slot":o,size:u,type:f,label:p,appearance:h,className:a,icon:_,ref:l,...s}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=f,i[7]=p,i[8]=h,i[9]=_);let y=u===void 0?`sm`:u,b=f===void 0?`button`:f,x=p===void 0?`Dismiss Alert`:p,S=h===void 0?`ghost`:h,C=_===void 0?O:_,w=m(D),T=g(null),E=t(T,l),k=w?.redirectDismissFocus??!0,A;i[10]===k?A=i[11]:(A={buttonRef:T,enabled:k},i[10]=k,i[11]=A),V(A);let j;i[12]===o?j=i[13]:(j=r(o,`alert-dismiss-icon-button`),i[12]=o,i[13]=j);let M;i[14]===a?M=i[15]:(M=n(`right-1.5 top-1.5 absolute`,`text-(--alert-control-color,currentColor)`,`not-disabled:hover:bg-(--alert-control-hover-bg,transparent) not-disabled:hover:text-(--alert-control-hover-color,currentColor)`,a),i[14]=a,i[15]=M);let N;return i[16]!==S||i[17]!==E||i[18]!==C||i[19]!==x||i[20]!==s||i[21]!==y||i[22]!==j||i[23]!==M||i[24]!==b?(N=/* @__PURE__ */ v(c,{ref:E,appearance:S,icon:C,intent:`neutral`,label:x,size:y,"data-slot":j,"data-alert-dismiss":!0,className:M,type:b,...s}),i[16]=S,i[17]=E,i[18]=C,i[19]=x,i[20]=s,i[21]=y,i[22]=j,i[23]=M,i[24]=b,i[25]=N):N=i[25],N},Icon:P,Title:I};export{A as n,H as t};
|
package/dist/anchor-CgcbWEUs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{t as r}from"./slot-DdYN1L1C.js";import{c as i}from"react/compiler-runtime";import{Children as a,cloneElement as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";const f=t=>e(`cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,t),p=e=>{let p=i(72),g,_,v,y,b,x,S,C,w;p[0]===e?(g=p[1],_=p[2],v=p[3],y=p[4],b=p[5],x=p[6],S=p[7],C=p[8],w=p[9]):({"data-slot":y,asChild:g,children:_,className:v,rel:x,icon:b,iconPlacement:w,ref:C,...S}=e,p[0]=e,p[1]=g,p[2]=_,p[3]=v,p[4]=y,p[5]=b,p[6]=x,p[7]=S,p[8]=C,p[9]=w);let T=w===void 0?`start`:w,E;p[10]===x?E=p[11]:(E=h(x),p[10]=x,p[11]=E);let D=E;if(g){let e,i,h,g,x,w,E;if(p[12]!==_||p[13]!==v||p[14]!==y||p[15]!==b||p[16]!==T||p[17]!==S||p[18]!==C||p[19]!==D){let O=a.only(_);c(s(O),"When using `asChild`, Anchor must be passed a single child as a JSX tag.");let k=O.props?.children,A=S.target===`_blank`||O.props?.target===`_blank`;e=r,p[27]===y?i=p[28]:(i=t(y,`anchor`),p[27]=y,p[28]=i),p[29]===v?h=p[30]:(h=f(v),p[29]=v,p[30]=h),g=C,p[31]!==A||p[32]!==D?(x=D??m(A),p[31]=A,p[32]=D,p[33]=x):x=p[33],w=S;let j;p[34]!==b||p[35]!==T?(j=b&&T===`start`&&/* @__PURE__ */ u(n,{className:`inline-block mr-1.5`,svg:b}),p[34]=b,p[35]=T,p[36]=j):j=p[36];let M;p[37]!==b||p[38]!==T?(M=b&&T===`end`&&/* @__PURE__ */ u(n,{className:`inline-block ml-1.5`,svg:b}),p[37]=b,p[38]=T,p[39]=M):M=p[39],E=o(O,{},/* @__PURE__ */ d(l,{children:[j,/* @__PURE__ */ u(`span`,{"data-slot":`anchor-label`,children:k}),M]})),p[12]=_,p[13]=v,p[14]=y,p[15]=b,p[16]=T,p[17]=S,p[18]=C,p[19]=D,p[20]=e,p[21]=i,p[22]=h,p[23]=g,p[24]=x,p[25]=w,p[26]=E}else e=p[20],i=p[21],h=p[22],g=p[23],x=p[24],w=p[25],E=p[26];let O;return p[40]!==e||p[41]!==i||p[42]!==h||p[43]!==g||p[44]!==x||p[45]!==w||p[46]!==E?(O=/* @__PURE__ */ u(e,{"data-slot":i,className:h,ref:g,rel:x,...w,children:E}),p[40]=e,p[41]=i,p[42]=h,p[43]=g,p[44]=x,p[45]=w,p[46]=E,p[47]=O):O=p[47],O}let O;p[48]===y?O=p[49]:(O=t(y,`anchor`),p[48]=y,p[49]=O);let k;p[50]===v?k=p[51]:(k=f(v),p[50]=v,p[51]=k);let A;p[52]!==S||p[53]!==D?(A=D??m(S.target===`_blank`),p[52]=S,p[53]=D,p[54]=A):A=p[54];let j;p[55]!==b||p[56]!==T?(j=b&&T===`start`&&/* @__PURE__ */ u(n,{className:`inline-block mr-1.5`,svg:b}),p[55]=b,p[56]=T,p[57]=j):j=p[57];let M;p[58]===_?M=p[59]:(M=/* @__PURE__ */ u(`span`,{"data-slot":`anchor-label`,children:_}),p[58]=_,p[59]=M);let N;p[60]!==b||p[61]!==T?(N=b&&T===`end`&&/* @__PURE__ */ u(n,{className:`inline-block ml-1.5`,svg:b}),p[60]=b,p[61]=T,p[62]=N):N=p[62];let P;return p[63]!==S||p[64]!==C||p[65]!==O||p[66]!==k||p[67]!==A||p[68]!==j||p[69]!==M||p[70]!==N?(P=/* @__PURE__ */ d(`a`,{"data-slot":O,className:k,ref:C,rel:A,...S,children:[j,M,N]}),p[63]=S,p[64]=C,p[65]=O,p[66]=k,p[67]=A,p[68]=j,p[69]=M,p[70]=N,p[71]=P):P=p[71],P};function m(e){return e?`noopener noreferrer`:void 0}function h(e){return Array.isArray(e)?[...new Set(e)].map(e=>e?.trim()).filter(Boolean).toSorted().join(` `)||void 0:e?.trim()||void 0}export{f as n,h as r,p as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSyncExternalStore as e}from"react";function t(){return()=>{}}function n(){return!0}function r(){return!1}function i(){return e(t,n,r)}function a(e){let{children:t,fallback:n}=e,r=n===void 0?null:n;return i()?t():r}function o(){return typeof window<`u`&&typeof document<`u`}export{o as n,i as r,a as t};
|
package/dist/button-69InNC_m.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(`border-form inline-flex items-center rounded-md`,{variants:{appearance:{panel:`bg-form gap-0.5 border p-0.75 [--icon-button-border-radius:0.125rem] [&>.separator]:mx-px`,ghost:`gap-0.5`,outlined:``}}}),s=a=>{let s=r(20),c,l,u,d,f,p,m;s[0]===a?(c=s[1],l=s[2],u=s[3],d=s[4],f=s[5],p=s[6],m=s[7]):({"data-slot":f,appearance:c,asChild:l,className:d,children:u,ref:m,...p}=a,s[0]=a,s[1]=c,s[2]=l,s[3]=u,s[4]=d,s[5]=f,s[6]=p,s[7]=m);let h=l?n:`div`,g;s[8]===f?g=s[9]:(g=t(f,`button-group`),s[8]=f,s[9]=g);let _;s[10]!==c||s[11]!==d?(_=e(o({appearance:c}),d),s[10]=c,s[11]=d,s[12]=_):_=s[12];let v;return s[13]!==h||s[14]!==u||s[15]!==p||s[16]!==m||s[17]!==g||s[18]!==_?(v=/* @__PURE__ */ i(h,{"data-slot":g,className:_,ref:m,...p,children:u}),s[13]=h,s[14]=u,s[15]=p,s[16]=m,s[17]=g,s[18]=_,s[19]=v):v=s[19],v};export{s as t};
|
package/dist/button-B8k98Pby.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{n as i,r as a}from"./button-Dge0D5bl.js";import{t as o}from"./button-BQZ6eoD3.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,isValidElement as u}from"react";import d from"tiny-invariant";import{jsx as f}from"react/jsx-runtime";import{CircleNotchIcon as p}from"@phosphor-icons/react/CircleNotch";const m=m=>{let h=s(58),g,_,v,y,b,x,S,C,w,T,E,D,O,k,A;h[0]===m?(g=h[1],_=h[2],v=h[3],y=h[4],b=h[5],x=h[6],S=h[7],C=h[8],w=h[9],T=h[10],E=h[11],D=h[12],O=h[13],k=h[14],A=h[15]):({"aria-disabled":g,"data-slot":x,appearance:v,asChild:D,children:y,className:b,disabled:_,icon:w,intent:S,isLoading:O,label:C,ref:E,size:k,type:A,...T}=m,h[0]=m,h[1]=g,h[2]=_,h[3]=v,h[4]=y,h[5]=b,h[6]=x,h[7]=S,h[8]=C,h[9]=w,h[10]=T,h[11]=E,h[12]=D,h[13]=O,h[14]=k,h[15]=A);let j=D!==void 0&&D,M=O!==void 0&&O,N=k===void 0?`md`:k,P;h[16]!==g||h[17]!==_||h[18]!==M?(P=r(_??M)||r(g),h[16]=g,h[17]=_,h[18]=M,h[19]=P):P=h[19];let F=P,I;h[20]===x?I=h[21]:(I=t(x,`icon-button`),h[20]=x,h[21]=I);let L;h[22]!==v||h[23]!==b||h[24]!==S||h[25]!==M||h[26]!==N?(L=e(o({appearance:v,intent:S,isLoading:M,size:N}),b),h[22]=v,h[23]=b,h[24]=S,h[25]=M,h[26]=N,h[27]=L):L=h[27];let R=F?``:void 0,z=M?``:void 0,B;h[28]!==v||h[29]!==F||h[30]!==S||h[31]!==C||h[32]!==T||h[33]!==E||h[34]!==N||h[35]!==I||h[36]!==L||h[37]!==R||h[38]!==z?(B={"aria-disabled":F,"data-slot":I,className:L,"data-appearance":v,"data-disabled":R,"data-icon-button":!0,"data-intent":S,"data-loading":z,"data-size":N,ref:E,...T,"aria-label":C},h[28]=v,h[29]=F,h[30]=S,h[31]=C,h[32]=T,h[33]=E,h[34]=N,h[35]=I,h[36]=L,h[37]=R,h[38]=z,h[39]=B):B=h[39];let V=B,H=M?`loading`:`idle`,U;h[40]===Symbol.for(`react.memo_cache_sentinel`)?(U=/* @__PURE__ */ f(p,{className:`animate-spin`}),h[40]=U):U=h[40];let W;h[41]===w?W=h[42]:(W={idle:w,loading:U},h[41]=w,h[42]=W);let G;h[43]!==H||h[44]!==W?(G=/* @__PURE__ */ f(a,{active:H,icons:W}),h[43]=H,h[44]=W,h[45]=G):G=h[45];let K=G;if(j){d(u(y)&&c.only(y),"When using `asChild`, IconButton must be passed a single child as a JSX tag.");let e;h[46]!==y||h[47]!==F||h[48]!==K?(e=l(y,F?i:{},K),h[46]=y,h[47]=F,h[48]=K,h[49]=e):e=h[49];let t;return h[50]!==V||h[51]!==e?(t=/* @__PURE__ */ f(n,{...V,children:e}),h[50]=V,h[51]=e,h[52]=t):t=h[52],t}let q=A??`button`,J;return h[53]!==V||h[54]!==F||h[55]!==K||h[56]!==q?(J=/* @__PURE__ */ f(`button`,{...V,disabled:F,type:q,children:K}),h[53]=V,h[54]=F,h[55]=K,h[56]=q,h[57]=J):J=h[57],J};export{m as t};
|