@adamosuiteservices/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/accordion-rounded.cjs +6 -0
- package/dist/accordion-rounded.js +85 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.js +65 -0
- package/dist/alert.cjs +1 -0
- package/dist/alert.js +69 -0
- package/dist/avatar.cjs +17 -0
- package/dist/avatar.js +248 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.js +54 -0
- package/dist/button-BFK0LYE1.js +58 -0
- package/dist/button-BnuVhhWO.cjs +1 -0
- package/dist/button-group.cjs +1 -0
- package/dist/button-group.js +76 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +5 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.js +2852 -0
- package/dist/card.cjs +1 -0
- package/dist/card.js +112 -0
- package/dist/check-CLxNVljQ.cjs +6 -0
- package/dist/check-Ci0GjV-B.js +11 -0
- package/dist/checkbox-BlfeC4MI.js +271 -0
- package/dist/checkbox-uByYIkZe.cjs +1 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.js +4 -0
- package/dist/chevron-down-BqEHzml5.cjs +6 -0
- package/dist/chevron-down-CpVS2Z7w.js +11 -0
- package/dist/chevron-left-B8QsBNvc.cjs +6 -0
- package/dist/chevron-left-Eal-WYLp.js +11 -0
- package/dist/chevron-right-BpzggHsr.cjs +6 -0
- package/dist/chevron-right-Cnc2tB4-.js +11 -0
- package/dist/circle-CX7JIirj.cjs +6 -0
- package/dist/circle-DYv-7Qb9.js +11 -0
- package/dist/collapsible.cjs +1 -0
- package/dist/collapsible.js +34 -0
- package/dist/colors.css +1 -0
- package/dist/combobox.cjs +6 -0
- package/dist/combobox.js +515 -0
- package/dist/components/layout/sidebar/index.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.d.ts +17 -0
- package/dist/components/layout/sidebar/sidebar.stories.d.ts +6 -0
- package/dist/components/layout/toaster/index.d.ts +2 -0
- package/dist/components/layout/toaster/toaster.d.ts +26 -0
- package/dist/components/layout/toaster/toaster.stories.d.ts +15 -0
- package/dist/components/layout/toaster/use-toast.d.ts +1 -0
- package/dist/components/ui/accordion/accordion.d.ts +7 -0
- package/dist/components/ui/accordion/accordion.stories.d.ts +17 -0
- package/dist/components/ui/accordion/index.d.ts +1 -0
- package/dist/components/ui/accordion-rounded/accordion-rounded.d.ts +11 -0
- package/dist/components/ui/accordion-rounded/accordion-rounded.stories.d.ts +21 -0
- package/dist/components/ui/accordion-rounded/index.d.ts +1 -0
- package/dist/components/ui/alert/alert.d.ts +9 -0
- package/dist/components/ui/alert/alert.stories.d.ts +24 -0
- package/dist/components/ui/alert/index.d.ts +1 -0
- package/dist/components/ui/avatar/avatar.d.ts +6 -0
- package/dist/components/ui/avatar/avatar.stories.d.ts +14 -0
- package/dist/components/ui/avatar/index.d.ts +1 -0
- package/dist/components/ui/badge/badge.d.ts +10 -0
- package/dist/components/ui/badge/badge.stories.d.ts +41 -0
- package/dist/components/ui/badge/index.d.ts +1 -0
- package/dist/components/ui/button/button.d.ts +10 -0
- package/dist/components/ui/button/button.stories.d.ts +38 -0
- package/dist/components/ui/button/index.d.ts +1 -0
- package/dist/components/ui/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/button-group/button-group.stories.d.ts +19 -0
- package/dist/components/ui/button-group/index.d.ts +1 -0
- package/dist/components/ui/calendar/calendar.d.ts +8 -0
- package/dist/components/ui/calendar/calendar.stories.d.ts +27 -0
- package/dist/components/ui/calendar/index.d.ts +1 -0
- package/dist/components/ui/card/card.d.ts +13 -0
- package/dist/components/ui/card/card.stories.d.ts +18 -0
- package/dist/components/ui/card/index.d.ts +1 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox/checkbox.stories.d.ts +15 -0
- package/dist/components/ui/checkbox/index.d.ts +1 -0
- package/dist/components/ui/collapsible/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible/collapsible.stories.d.ts +12 -0
- package/dist/components/ui/collapsible/index.d.ts +1 -0
- package/dist/components/ui/combobox/combobox.d.ts +35 -0
- package/dist/components/ui/combobox/combobox.stories.d.ts +27 -0
- package/dist/components/ui/combobox/index.d.ts +1 -0
- package/dist/components/ui/command/command.d.ts +18 -0
- package/dist/components/ui/command/index.d.ts +1 -0
- package/dist/components/ui/context-menu/context-menu.d.ts +25 -0
- package/dist/components/ui/context-menu/context-menu.stories.d.ts +10 -0
- package/dist/components/ui/context-menu/index.d.ts +1 -0
- package/dist/components/ui/dialog/dialog.d.ts +17 -0
- package/dist/components/ui/dialog/dialog.stories.d.ts +13 -0
- package/dist/components/ui/dialog/index.d.ts +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.stories.d.ts +14 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/components/ui/field/field.d.ts +24 -0
- package/dist/components/ui/field/field.stories.d.ts +18 -0
- package/dist/components/ui/field/index.d.ts +1 -0
- package/dist/components/ui/hover-card/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card/hover-card.stories.d.ts +25 -0
- package/dist/components/ui/hover-card/index.d.ts +1 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/input.d.ts +3 -0
- package/dist/components/ui/input/input.stories.d.ts +23 -0
- package/dist/components/ui/input-group/Input-group.stories.d.ts +28 -0
- package/dist/components/ui/input-group/index.d.ts +1 -0
- package/dist/components/ui/input-group/input-group.d.ts +16 -0
- package/dist/components/ui/kbd/index.d.ts +1 -0
- package/dist/components/ui/kbd/kbd.d.ts +3 -0
- package/dist/components/ui/kbd/kbd.stories.d.ts +26 -0
- package/dist/components/ui/label/index.d.ts +1 -0
- package/dist/components/ui/label/label.d.ts +4 -0
- package/dist/components/ui/label/label.stories.d.ts +24 -0
- package/dist/components/ui/pagination/index.d.ts +1 -0
- package/dist/components/ui/pagination/pagination.d.ts +13 -0
- package/dist/components/ui/pagination/pagination.stories.d.ts +28 -0
- package/dist/components/ui/popover/index.d.ts +1 -0
- package/dist/components/ui/popover/popover.d.ts +7 -0
- package/dist/components/ui/popover/popover.stories.d.ts +26 -0
- package/dist/components/ui/progress/index.d.ts +1 -0
- package/dist/components/ui/progress/progress.d.ts +9 -0
- package/dist/components/ui/progress/progress.stories.d.ts +29 -0
- package/dist/components/ui/radio-group/index.d.ts +1 -0
- package/dist/components/ui/radio-group/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group/radio-group.stories.d.ts +18 -0
- package/dist/components/ui/select/index.d.ts +1 -0
- package/dist/components/ui/select/select.d.ts +15 -0
- package/dist/components/ui/select/select.stories.d.ts +19 -0
- package/dist/components/ui/separator/index.d.ts +1 -0
- package/dist/components/ui/separator/separator.d.ts +4 -0
- package/dist/components/ui/separator/separator.stories.d.ts +18 -0
- package/dist/components/ui/sheet/index.d.ts +1 -0
- package/dist/components/ui/sheet/sheet.d.ts +14 -0
- package/dist/components/ui/sheet/sheet.stories.d.ts +17 -0
- package/dist/components/ui/skeleton/index.d.ts +1 -0
- package/dist/components/ui/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton/skeleton.stories.d.ts +22 -0
- package/dist/components/ui/slider/index.d.ts +1 -0
- package/dist/components/ui/slider/slider.d.ts +7 -0
- package/dist/components/ui/slider/slider.stories.d.ts +21 -0
- package/dist/components/ui/spinner/index.d.ts +1 -0
- package/dist/components/ui/spinner/spinner.d.ts +2 -0
- package/dist/components/ui/spinner/spinner.stories.d.ts +20 -0
- package/dist/components/ui/switch/index.d.ts +1 -0
- package/dist/components/ui/switch/switch.d.ts +4 -0
- package/dist/components/ui/switch/switch.stories.d.ts +17 -0
- package/dist/components/ui/table/index.d.ts +1 -0
- package/dist/components/ui/table/table.d.ts +10 -0
- package/dist/components/ui/table/table.stories.d.ts +11 -0
- package/dist/components/ui/tabs/index.d.ts +1 -0
- package/dist/components/ui/tabs/tabs.d.ts +7 -0
- package/dist/components/ui/tabs/tabs.stories.d.ts +16 -0
- package/dist/components/ui/tabs-underline/index.d.ts +1 -0
- package/dist/components/ui/tabs-underline/tabs-underline.d.ts +7 -0
- package/dist/components/ui/tabs-underline/tabs-underline.stories.d.ts +16 -0
- package/dist/components/ui/textarea/index.d.ts +1 -0
- package/dist/components/ui/textarea/textarea.d.ts +3 -0
- package/dist/components/ui/textarea/textarea.stories.d.ts +21 -0
- package/dist/components/ui/toggle/index.d.ts +1 -0
- package/dist/components/ui/toggle/toggle.d.ts +9 -0
- package/dist/components/ui/toggle/toggle.stories.d.ts +21 -0
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip/tooltip.stories.d.ts +19 -0
- package/dist/components/ui/typography/index.d.ts +1 -0
- package/dist/components/ui/typography/typography.d.ts +8 -0
- package/dist/components/ui/typography/typography.stories.d.ts +33 -0
- package/dist/context-menu.cjs +1 -0
- package/dist/context-menu.js +427 -0
- package/dist/createLucideIcon-B_8CJpcQ.js +94 -0
- package/dist/createLucideIcon-CAtnV-yz.cjs +21 -0
- package/dist/custom-layered-styles.css +1 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.js +139 -0
- package/dist/dropdown-menu.cjs +1 -0
- package/dist/dropdown-menu.js +423 -0
- package/dist/field.cjs +1 -0
- package/dist/field.js +221 -0
- package/dist/fonts.css +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-portal-container.d.ts +31 -0
- package/dist/hover-card.cjs +1 -0
- package/dist/hover-card.js +210 -0
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/index-6oTEokEx.js +82 -0
- package/dist/index-B-NyefE0.js +243 -0
- package/dist/index-B-ZRqW0J.js +118 -0
- package/dist/index-B-cHTKrs.js +158 -0
- package/dist/index-BGQepRFJ.js +27 -0
- package/dist/index-BGiGvaq8.cjs +1 -0
- package/dist/index-BKbK2GzY.cjs +1 -0
- package/dist/index-BMitW9UR.cjs +1 -0
- package/dist/index-BRLtxFFr.cjs +1 -0
- package/dist/index-BWaO7kQK.cjs +1 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-BpvjJ_T6.cjs +5 -0
- package/dist/index-C0UREtMP.js +59 -0
- package/dist/index-C329e3yQ.js +134 -0
- package/dist/index-C5wjudc-.js +36 -0
- package/dist/index-C8ni3LLa.cjs +1 -0
- package/dist/index-CAOY367Y.js +1540 -0
- package/dist/index-CCKe-Mpx.js +6 -0
- package/dist/index-CQhYMnjT.js +34 -0
- package/dist/index-Ce3QBKyj.cjs +1 -0
- package/dist/index-CezwiPd_.js +615 -0
- package/dist/index-Cv867SGx.js +13 -0
- package/dist/index-CwUFT-GQ.js +228 -0
- package/dist/index-CzY-WZXL.cjs +1 -0
- package/dist/index-D02K8KOB.js +54 -0
- package/dist/index-D3S7dBDI.cjs +1 -0
- package/dist/index-D3wSWKST.cjs +1 -0
- package/dist/index-D7hQvndv.cjs +1 -0
- package/dist/index-DQvx1rG_.cjs +1 -0
- package/dist/index-DXQ-7kNJ.cjs +41 -0
- package/dist/index-DYxWvftI.cjs +1 -0
- package/dist/index-DnS_sBBe.cjs +1 -0
- package/dist/index-DulPG3F9.js +179 -0
- package/dist/index-EUea2gfp.js +70 -0
- package/dist/index-FxyLF8MY.js +68 -0
- package/dist/index-IKJMQref.cjs +1 -0
- package/dist/index-MQ0c3ZX_.cjs +1 -0
- package/dist/index-P1sVIHE3.js +32 -0
- package/dist/index-VIUqZjyP.cjs +1 -0
- package/dist/index-WIv2ndLu.cjs +1 -0
- package/dist/index-bSPhqlcX.cjs +1 -0
- package/dist/index-cwZN7ZY3.cjs +1 -0
- package/dist/index-gO_QEiaK.cjs +1 -0
- package/dist/index-iAvn1gzj.cjs +1 -0
- package/dist/index-o0sNTcKe.js +674 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/index-yR-v1A4G.js +15 -0
- package/dist/input-3MDa_DYk.cjs +1 -0
- package/dist/input-Cl7xmQYQ.js +22 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.js +152 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +4 -0
- package/dist/jsx-runtime-BB_1_6y_.cjs +22 -0
- package/dist/jsx-runtime-BzflLqGi.js +282 -0
- package/dist/kbd.cjs +1 -0
- package/dist/kbd.js +31 -0
- package/dist/label-MxqN87DQ.cjs +1 -0
- package/dist/label-hg_jN6Y8.js +35 -0
- package/dist/label.cjs +1 -0
- package/dist/label.js +4 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/minus-C0pHPx21.cjs +6 -0
- package/dist/minus-DE-onYs2.js +11 -0
- package/dist/pagination.cjs +6 -0
- package/dist/pagination.js +134 -0
- package/dist/popover-BBXe2myL.cjs +1 -0
- package/dist/popover-DNiRNCdn.js +263 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.js +7 -0
- package/dist/progress.cjs +6 -0
- package/dist/progress.js +137 -0
- package/dist/radio-group.cjs +1 -0
- package/dist/radio-group.js +271 -0
- package/dist/radius.css +1 -0
- package/dist/select.cjs +6 -0
- package/dist/select.js +987 -0
- package/dist/separator-C9kqOQR-.js +44 -0
- package/dist/separator-Dbx-SVIs.cjs +1 -0
- package/dist/separator.cjs +1 -0
- package/dist/separator.js +4 -0
- package/dist/sheet-0jRbqkzj.cjs +1 -0
- package/dist/sheet-RAbg4M5A.js +128 -0
- package/dist/sheet.cjs +1 -0
- package/dist/sheet.js +11 -0
- package/dist/sidebar.cjs +6 -0
- package/dist/sidebar.js +139 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.js +15 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.js +486 -0
- package/dist/space.css +1 -0
- package/dist/spinner.cjs +6 -0
- package/dist/spinner.js +24 -0
- package/dist/styles.css +1 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +154 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +115 -0
- package/dist/tabs-underline.cjs +1 -0
- package/dist/tabs-underline.js +68 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.js +68 -0
- package/dist/tailwind-animations.css +1 -0
- package/dist/tailwind-colors.css +1 -0
- package/dist/tailwind-fonts.css +1 -0
- package/dist/tailwind-radius.css +1 -0
- package/dist/tailwind-spacing.css +1 -0
- package/dist/tailwind-theme.css +1 -0
- package/dist/textarea-D76719tg.js +19 -0
- package/dist/textarea-UdELO_Jn.cjs +1 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.js +4 -0
- package/dist/themes.css +1 -0
- package/dist/toaster.cjs +1 -0
- package/dist/toaster.js +87 -0
- package/dist/toggle.cjs +1 -0
- package/dist/toggle.js +69 -0
- package/dist/tooltip.cjs +1 -0
- package/dist/tooltip.js +375 -0
- package/dist/types/theme.type.d.ts +2 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +34 -0
- package/dist/use-portal-container.cjs +1 -0
- package/dist/use-portal-container.js +21 -0
- package/dist/utils-CRiPKpXj.js +2743 -0
- package/dist/utils-DoxiiusW.cjs +1 -0
- package/dist/x-CBKgg4YL.cjs +6 -0
- package/dist/x-Dl66o_vF.js +14 -0
- package/package.json +275 -0
package/dist/toggle.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { u, c as g } from "./index-C0UREtMP.js";
|
|
4
|
+
import { P as f } from "./index-C5wjudc-.js";
|
|
5
|
+
import { c as v } from "./index-CQhYMnjT.js";
|
|
6
|
+
import { c as p } from "./utils-CRiPKpXj.js";
|
|
7
|
+
var s = "Toggle", n = c.forwardRef((a, e) => {
|
|
8
|
+
const { pressed: t, defaultPressed: d, onPressedChange: i, ...m } = a, [r, l] = u({
|
|
9
|
+
prop: t,
|
|
10
|
+
onChange: i,
|
|
11
|
+
defaultProp: d ?? !1,
|
|
12
|
+
caller: s
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ o.jsx(
|
|
15
|
+
f.button,
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
"aria-pressed": r,
|
|
19
|
+
"data-state": r ? "on" : "off",
|
|
20
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
21
|
+
...m,
|
|
22
|
+
ref: e,
|
|
23
|
+
onClick: g(a.onClick, () => {
|
|
24
|
+
a.disabled || l(!r);
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
n.displayName = s;
|
|
30
|
+
var b = n;
|
|
31
|
+
const x = v(
|
|
32
|
+
"adm:inline-flex adm:items-center adm:justify-center adm:gap-2 adm:rounded-md adm:text-sm adm:font-medium adm:hover:bg-muted adm:hover:text-muted-foreground adm:disabled:pointer-events-none adm:disabled:opacity-50 adm:data-[state=on]:bg-accent adm:data-[state=on]:text-accent-foreground adm:[&_svg]:pointer-events-none adm:[&_svg:not([class*=size-])]:size-4 adm:[&_svg]:shrink-0 adm:focus-visible:border-ring adm:focus-visible:ring-ring/50 adm:focus-visible:ring-[3px] adm:outline-none adm:transition-[color,box-shadow] adm:aria-invalid:ring-destructive/20 adm:dark:aria-invalid:ring-destructive/40 adm:aria-invalid:border-destructive adm:whitespace-nowrap",
|
|
33
|
+
{
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
default: "adm:bg-transparent",
|
|
37
|
+
outline: "adm:border adm:border-input adm:bg-transparent adm:shadow-xs adm:hover:bg-accent adm:hover:text-accent-foreground"
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
default: "adm:h-9 adm:px-2 adm:min-w-9",
|
|
41
|
+
sm: "adm:h-8 adm:px-1.5 adm:min-w-8",
|
|
42
|
+
lg: "adm:h-10 adm:px-2.5 adm:min-w-10"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: "default",
|
|
47
|
+
size: "default"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
function k({
|
|
52
|
+
className: a,
|
|
53
|
+
variant: e,
|
|
54
|
+
size: t,
|
|
55
|
+
...d
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ o.jsx(
|
|
58
|
+
b,
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "toggle",
|
|
61
|
+
className: p(x({ variant: e, size: t, className: a })),
|
|
62
|
+
...d
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
k as Toggle,
|
|
68
|
+
x as toggleVariants
|
|
69
|
+
};
|
package/dist/tooltip.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-BB_1_6y_.cjs"),K=require("react"),E=require("./index-BWaO7kQK.cjs"),k=require("./index-BKbK2GzY.cjs"),W=require("./index-cwZN7ZY3.cjs"),J=require("./index-VIUqZjyP.cjs"),Q=require("./index-WIv2ndLu.cjs"),R=require("./index-BGiGvaq8.cjs"),Z=require("./index-Ce3QBKyj.cjs"),I=require("./index-IKJMQref.cjs"),ee=require("./index-DQvx1rG_.cjs"),te=require("./index-gO_QEiaK.cjs"),oe=require("./utils-DoxiiusW.cjs");function re(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const s=re(K);var[O]=W.createContextScope("Tooltip",[R.createPopperScope]),D=R.createPopperScope(),q="TooltipProvider",ne=700,A="tooltip.open",[se,H]=O(q),$=e=>{const{__scopeTooltip:o,delayDuration:t=ne,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:l}=e,a=s.useRef(!0),f=s.useRef(!1),i=s.useRef(0);return s.useEffect(()=>{const p=i.current;return()=>window.clearTimeout(p)},[]),c.jsxRuntimeExports.jsx(se,{scope:o,isOpenDelayedRef:a,delayDuration:t,onOpen:s.useCallback(()=>{window.clearTimeout(i.current),a.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:s.useCallback(p=>{f.current=p},[]),disableHoverableContent:n,children:l})};$.displayName=q;var P="Tooltip",[ie,_]=O(P),G=e=>{const{__scopeTooltip:o,children:t,open:r,defaultOpen:n,onOpenChange:l,disableHoverableContent:a,delayDuration:f}=e,i=H(P,e.__scopeTooltip),p=D(o),[u,x]=s.useState(null),m=Q.useId(),d=s.useRef(0),v=a??i.disableHoverableContent,g=f??i.delayDuration,h=s.useRef(!1),[y,T]=E.useControllableState({prop:r,defaultProp:n??!1,onChange:N=>{N?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),l?.(N)},caller:P}),b=s.useMemo(()=>y?h.current?"delayed-open":"instant-open":"closed",[y]),j=s.useCallback(()=>{window.clearTimeout(d.current),d.current=0,h.current=!1,T(!0)},[T]),w=s.useCallback(()=>{window.clearTimeout(d.current),d.current=0,T(!1)},[T]),S=s.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{h.current=!0,T(!0),d.current=0},g)},[g,T]);return s.useEffect(()=>()=>{d.current&&(window.clearTimeout(d.current),d.current=0)},[]),c.jsxRuntimeExports.jsx(R.Root2,{...p,children:c.jsxRuntimeExports.jsx(ie,{scope:o,contentId:m,open:y,stateAttribute:b,trigger:u,onTriggerChange:x,onTriggerEnter:s.useCallback(()=>{i.isOpenDelayedRef.current?S():j()},[i.isOpenDelayedRef,S,j]),onTriggerLeave:s.useCallback(()=>{v?w():(window.clearTimeout(d.current),d.current=0)},[w,v]),onOpen:j,onClose:w,disableHoverableContent:v,children:t})})};G.displayName=P;var L="TooltipTrigger",z=s.forwardRef((e,o)=>{const{__scopeTooltip:t,...r}=e,n=_(L,t),l=H(L,t),a=D(t),f=s.useRef(null),i=k.useComposedRefs(o,f,n.onTriggerChange),p=s.useRef(!1),u=s.useRef(!1),x=s.useCallback(()=>p.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),c.jsxRuntimeExports.jsx(R.Anchor,{asChild:!0,...a,children:c.jsxRuntimeExports.jsx(ee.Primitive.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:E.composeEventHandlers(e.onPointerMove,m=>{m.pointerType!=="touch"&&!u.current&&!l.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:E.composeEventHandlers(e.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:E.composeEventHandlers(e.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:E.composeEventHandlers(e.onFocus,()=>{p.current||n.onOpen()}),onBlur:E.composeEventHandlers(e.onBlur,n.onClose),onClick:E.composeEventHandlers(e.onClick,n.onClose)})})});z.displayName=L;var M="TooltipPortal",[ae,le]=O(M,{forceMount:void 0}),F=e=>{const{__scopeTooltip:o,forceMount:t,children:r,container:n}=e,l=_(M,o);return c.jsxRuntimeExports.jsx(ae,{scope:o,forceMount:t,children:c.jsxRuntimeExports.jsx(I.Presence,{present:t||l.open,children:c.jsxRuntimeExports.jsx(Z.Portal,{asChild:!0,container:n,children:r})})})};F.displayName=M;var C="TooltipContent",B=s.forwardRef((e,o)=>{const t=le(C,e.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...l}=e,a=_(C,e.__scopeTooltip);return c.jsxRuntimeExports.jsx(I.Presence,{present:r||a.open,children:a.disableHoverableContent?c.jsxRuntimeExports.jsx(U,{side:n,...l,ref:o}):c.jsxRuntimeExports.jsx(ce,{side:n,...l,ref:o})})}),ce=s.forwardRef((e,o)=>{const t=_(C,e.__scopeTooltip),r=H(C,e.__scopeTooltip),n=s.useRef(null),l=k.useComposedRefs(o,n),[a,f]=s.useState(null),{trigger:i,onClose:p}=t,u=n.current,{onPointerInTransitChange:x}=r,m=s.useCallback(()=>{f(null),x(!1)},[x]),d=s.useCallback((v,g)=>{const h=v.currentTarget,y={x:v.clientX,y:v.clientY},T=xe(y,h.getBoundingClientRect()),b=fe(y,T),j=me(g.getBoundingClientRect()),w=he([...b,...j]);f(w),x(!0)},[x]);return s.useEffect(()=>()=>m(),[m]),s.useEffect(()=>{if(i&&u){const v=h=>d(h,u),g=h=>d(h,i);return i.addEventListener("pointerleave",v),u.addEventListener("pointerleave",g),()=>{i.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",g)}}},[i,u,d,m]),s.useEffect(()=>{if(a){const v=g=>{const h=g.target,y={x:g.clientX,y:g.clientY},T=i?.contains(h)||u?.contains(h),b=!ve(y,a);T?m():b&&(m(),p())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[i,u,a,p,m]),c.jsxRuntimeExports.jsx(U,{...e,ref:l})}),[ue,de]=O(P,{isInside:!1}),pe=k.createSlottable("TooltipContent"),U=s.forwardRef((e,o)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:l,onPointerDownOutside:a,...f}=e,i=_(C,t),p=D(t),{onClose:u}=i;return s.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),s.useEffect(()=>{if(i.trigger){const x=m=>{m.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[i.trigger,u]),c.jsxRuntimeExports.jsx(J.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:x=>x.preventDefault(),onDismiss:u,children:c.jsxRuntimeExports.jsxs(R.Content,{"data-state":i.stateAttribute,...p,...f,ref:o,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsxRuntimeExports.jsx(pe,{children:r}),c.jsxRuntimeExports.jsx(ue,{scope:t,isInside:!0,children:c.jsxRuntimeExports.jsx(te.Root,{id:i.contentId,role:"tooltip",children:n||r})})]})})});B.displayName=C;var V="TooltipArrow",Y=s.forwardRef((e,o)=>{const{__scopeTooltip:t,...r}=e,n=D(t);return de(V,t).isInside?null:c.jsxRuntimeExports.jsx(R.Arrow,{...n,...r,ref:o})});Y.displayName=V;function xe(e,o){const t=Math.abs(o.top-e.y),r=Math.abs(o.bottom-e.y),n=Math.abs(o.right-e.x),l=Math.abs(o.left-e.x);switch(Math.min(t,r,n,l)){case l:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function fe(e,o,t=5){const r=[];switch(o){case"top":r.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":r.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":r.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":r.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return r}function me(e){const{top:o,right:t,bottom:r,left:n}=e;return[{x:n,y:o},{x:t,y:o},{x:t,y:r},{x:n,y:r}]}function ve(e,o){const{x:t,y:r}=e;let n=!1;for(let l=0,a=o.length-1;l<o.length;a=l++){const f=o[l],i=o[a],p=f.x,u=f.y,x=i.x,m=i.y;u>r!=m>r&&t<(x-p)*(r-u)/(m-u)+p&&(n=!n)}return n}function he(e){const o=e.slice();return o.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),ge(o)}function ge(e){if(e.length<=1)return e.slice();const o=[];for(let r=0;r<e.length;r++){const n=e[r];for(;o.length>=2;){const l=o[o.length-1],a=o[o.length-2];if((l.x-a.x)*(n.y-a.y)>=(l.y-a.y)*(n.x-a.x))o.pop();else break}o.push(n)}o.pop();const t=[];for(let r=e.length-1;r>=0;r--){const n=e[r];for(;t.length>=2;){const l=t[t.length-1],a=t[t.length-2];if((l.x-a.x)*(n.y-a.y)>=(l.y-a.y)*(n.x-a.x))t.pop();else break}t.push(n)}return t.pop(),o.length===1&&t.length===1&&o[0].x===t[0].x&&o[0].y===t[0].y?o:o.concat(t)}var Te=$,ye=G,Ee=z,Ce=F,Re=B,be=Y;function X({delayDuration:e=0,...o}){return c.jsxRuntimeExports.jsx(Te,{"data-slot":"tooltip-provider",delayDuration:e,...o})}function je({...e}){return c.jsxRuntimeExports.jsx(X,{children:c.jsxRuntimeExports.jsx(ye,{"data-slot":"tooltip",...e})})}function we({...e}){return c.jsxRuntimeExports.jsx(Ee,{"data-slot":"tooltip-trigger",...e})}function Pe({className:e,sideOffset:o=0,children:t,...r}){return c.jsxRuntimeExports.jsx(Ce,{children:c.jsxRuntimeExports.jsxs(Re,{"data-slot":"tooltip-content",sideOffset:o,className:oe.cn("adm:bg-neutrals-800 adm:text-white adm:animate-in adm:fade-in-0 adm:zoom-in-95 adm:data-[state=closed]:animate-out adm:data-[state=closed]:fade-out-0 adm:data-[state=closed]:zoom-out-95 adm:data-[side=bottom]:slide-in-from-top-2 adm:data-[side=left]:slide-in-from-right-2 adm:data-[side=right]:slide-in-from-left-2 adm:data-[side=top]:slide-in-from-bottom-2 adm:z-50 adm:w-fit adm:origin-(--radix-tooltip-content-transform-origin) adm:rounded-md adm:px-3 adm:py-1.5 adm:text-xs adm:text-balance",e),...r,children:[t,c.jsxRuntimeExports.jsx(be,{className:"adm:bg-neutrals-800 adm:fill-neutrals-800 adm:z-50 adm:size-2.5 adm:translate-y-[calc(-50%_-_2px)] adm:rotate-45 adm:rounded-[2px]"})]})})}exports.Tooltip=je;exports.TooltipContent=Pe;exports.TooltipProvider=X;exports.TooltipTrigger=we;
|
package/dist/tooltip.js
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { j as c } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { u as X, c as C } from "./index-C0UREtMP.js";
|
|
4
|
+
import { u as N, b as K } from "./index-6oTEokEx.js";
|
|
5
|
+
import { c as W } from "./index-FxyLF8MY.js";
|
|
6
|
+
import { D as J } from "./index-C329e3yQ.js";
|
|
7
|
+
import { u as Q } from "./index-Cv867SGx.js";
|
|
8
|
+
import { c as H, R as Z, A as ee, a as te, C as oe } from "./index-CAOY367Y.js";
|
|
9
|
+
import { P as re } from "./index-yR-v1A4G.js";
|
|
10
|
+
import { P as S } from "./index-EUea2gfp.js";
|
|
11
|
+
import { P as ne } from "./index-C5wjudc-.js";
|
|
12
|
+
import { R as se } from "./index-P1sVIHE3.js";
|
|
13
|
+
import { c as ae } from "./utils-CRiPKpXj.js";
|
|
14
|
+
var [j] = W("Tooltip", [
|
|
15
|
+
H
|
|
16
|
+
]), O = H(), G = "TooltipProvider", ie = 700, D = "tooltip.open", [le, L] = j(G), F = (e) => {
|
|
17
|
+
const {
|
|
18
|
+
__scopeTooltip: o,
|
|
19
|
+
delayDuration: t = ie,
|
|
20
|
+
skipDelayDuration: r = 300,
|
|
21
|
+
disableHoverableContent: n = !1,
|
|
22
|
+
children: l
|
|
23
|
+
} = e, i = s.useRef(!0), m = s.useRef(!1), a = s.useRef(0);
|
|
24
|
+
return s.useEffect(() => {
|
|
25
|
+
const p = a.current;
|
|
26
|
+
return () => window.clearTimeout(p);
|
|
27
|
+
}, []), /* @__PURE__ */ c.jsx(
|
|
28
|
+
le,
|
|
29
|
+
{
|
|
30
|
+
scope: o,
|
|
31
|
+
isOpenDelayedRef: i,
|
|
32
|
+
delayDuration: t,
|
|
33
|
+
onOpen: s.useCallback(() => {
|
|
34
|
+
window.clearTimeout(a.current), i.current = !1;
|
|
35
|
+
}, []),
|
|
36
|
+
onClose: s.useCallback(() => {
|
|
37
|
+
window.clearTimeout(a.current), a.current = window.setTimeout(
|
|
38
|
+
() => i.current = !0,
|
|
39
|
+
r
|
|
40
|
+
);
|
|
41
|
+
}, [r]),
|
|
42
|
+
isPointerInTransitRef: m,
|
|
43
|
+
onPointerInTransitChange: s.useCallback((p) => {
|
|
44
|
+
m.current = p;
|
|
45
|
+
}, []),
|
|
46
|
+
disableHoverableContent: n,
|
|
47
|
+
children: l
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
F.displayName = G;
|
|
52
|
+
var R = "Tooltip", [ce, _] = j(R), z = (e) => {
|
|
53
|
+
const {
|
|
54
|
+
__scopeTooltip: o,
|
|
55
|
+
children: t,
|
|
56
|
+
open: r,
|
|
57
|
+
defaultOpen: n,
|
|
58
|
+
onOpenChange: l,
|
|
59
|
+
disableHoverableContent: i,
|
|
60
|
+
delayDuration: m
|
|
61
|
+
} = e, a = L(R, e.__scopeTooltip), p = O(o), [u, f] = s.useState(null), v = Q(), d = s.useRef(0), x = i ?? a.disableHoverableContent, T = m ?? a.delayDuration, h = s.useRef(!1), [y, g] = X({
|
|
62
|
+
prop: r,
|
|
63
|
+
defaultProp: n ?? !1,
|
|
64
|
+
onChange: (I) => {
|
|
65
|
+
I ? (a.onOpen(), document.dispatchEvent(new CustomEvent(D))) : a.onClose(), l?.(I);
|
|
66
|
+
},
|
|
67
|
+
caller: R
|
|
68
|
+
}), w = s.useMemo(() => y ? h.current ? "delayed-open" : "instant-open" : "closed", [y]), P = s.useCallback(() => {
|
|
69
|
+
window.clearTimeout(d.current), d.current = 0, h.current = !1, g(!0);
|
|
70
|
+
}, [g]), E = s.useCallback(() => {
|
|
71
|
+
window.clearTimeout(d.current), d.current = 0, g(!1);
|
|
72
|
+
}, [g]), M = s.useCallback(() => {
|
|
73
|
+
window.clearTimeout(d.current), d.current = window.setTimeout(() => {
|
|
74
|
+
h.current = !0, g(!0), d.current = 0;
|
|
75
|
+
}, T);
|
|
76
|
+
}, [T, g]);
|
|
77
|
+
return s.useEffect(() => () => {
|
|
78
|
+
d.current && (window.clearTimeout(d.current), d.current = 0);
|
|
79
|
+
}, []), /* @__PURE__ */ c.jsx(Z, { ...p, children: /* @__PURE__ */ c.jsx(
|
|
80
|
+
ce,
|
|
81
|
+
{
|
|
82
|
+
scope: o,
|
|
83
|
+
contentId: v,
|
|
84
|
+
open: y,
|
|
85
|
+
stateAttribute: w,
|
|
86
|
+
trigger: u,
|
|
87
|
+
onTriggerChange: f,
|
|
88
|
+
onTriggerEnter: s.useCallback(() => {
|
|
89
|
+
a.isOpenDelayedRef.current ? M() : P();
|
|
90
|
+
}, [a.isOpenDelayedRef, M, P]),
|
|
91
|
+
onTriggerLeave: s.useCallback(() => {
|
|
92
|
+
x ? E() : (window.clearTimeout(d.current), d.current = 0);
|
|
93
|
+
}, [E, x]),
|
|
94
|
+
onOpen: P,
|
|
95
|
+
onClose: E,
|
|
96
|
+
disableHoverableContent: x,
|
|
97
|
+
children: t
|
|
98
|
+
}
|
|
99
|
+
) });
|
|
100
|
+
};
|
|
101
|
+
z.displayName = R;
|
|
102
|
+
var A = "TooltipTrigger", $ = s.forwardRef(
|
|
103
|
+
(e, o) => {
|
|
104
|
+
const { __scopeTooltip: t, ...r } = e, n = _(A, t), l = L(A, t), i = O(t), m = s.useRef(null), a = N(o, m, n.onTriggerChange), p = s.useRef(!1), u = s.useRef(!1), f = s.useCallback(() => p.current = !1, []);
|
|
105
|
+
return s.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ c.jsx(ee, { asChild: !0, ...i, children: /* @__PURE__ */ c.jsx(
|
|
106
|
+
ne.button,
|
|
107
|
+
{
|
|
108
|
+
"aria-describedby": n.open ? n.contentId : void 0,
|
|
109
|
+
"data-state": n.stateAttribute,
|
|
110
|
+
...r,
|
|
111
|
+
ref: a,
|
|
112
|
+
onPointerMove: C(e.onPointerMove, (v) => {
|
|
113
|
+
v.pointerType !== "touch" && !u.current && !l.isPointerInTransitRef.current && (n.onTriggerEnter(), u.current = !0);
|
|
114
|
+
}),
|
|
115
|
+
onPointerLeave: C(e.onPointerLeave, () => {
|
|
116
|
+
n.onTriggerLeave(), u.current = !1;
|
|
117
|
+
}),
|
|
118
|
+
onPointerDown: C(e.onPointerDown, () => {
|
|
119
|
+
n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", f, { once: !0 });
|
|
120
|
+
}),
|
|
121
|
+
onFocus: C(e.onFocus, () => {
|
|
122
|
+
p.current || n.onOpen();
|
|
123
|
+
}),
|
|
124
|
+
onBlur: C(e.onBlur, n.onClose),
|
|
125
|
+
onClick: C(e.onClick, n.onClose)
|
|
126
|
+
}
|
|
127
|
+
) });
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
$.displayName = A;
|
|
131
|
+
var k = "TooltipPortal", [ue, de] = j(k, {
|
|
132
|
+
forceMount: void 0
|
|
133
|
+
}), B = (e) => {
|
|
134
|
+
const { __scopeTooltip: o, forceMount: t, children: r, container: n } = e, l = _(k, o);
|
|
135
|
+
return /* @__PURE__ */ c.jsx(ue, { scope: o, forceMount: t, children: /* @__PURE__ */ c.jsx(S, { present: t || l.open, children: /* @__PURE__ */ c.jsx(re, { asChild: !0, container: n, children: r }) }) });
|
|
136
|
+
};
|
|
137
|
+
B.displayName = k;
|
|
138
|
+
var b = "TooltipContent", U = s.forwardRef(
|
|
139
|
+
(e, o) => {
|
|
140
|
+
const t = de(b, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...l } = e, i = _(b, e.__scopeTooltip);
|
|
141
|
+
return /* @__PURE__ */ c.jsx(S, { present: r || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ c.jsx(V, { side: n, ...l, ref: o }) : /* @__PURE__ */ c.jsx(pe, { side: n, ...l, ref: o }) });
|
|
142
|
+
}
|
|
143
|
+
), pe = s.forwardRef((e, o) => {
|
|
144
|
+
const t = _(b, e.__scopeTooltip), r = L(b, e.__scopeTooltip), n = s.useRef(null), l = N(o, n), [i, m] = s.useState(null), { trigger: a, onClose: p } = t, u = n.current, { onPointerInTransitChange: f } = r, v = s.useCallback(() => {
|
|
145
|
+
m(null), f(!1);
|
|
146
|
+
}, [f]), d = s.useCallback(
|
|
147
|
+
(x, T) => {
|
|
148
|
+
const h = x.currentTarget, y = { x: x.clientX, y: x.clientY }, g = xe(y, h.getBoundingClientRect()), w = he(y, g), P = Te(T.getBoundingClientRect()), E = ye([...w, ...P]);
|
|
149
|
+
m(E), f(!0);
|
|
150
|
+
},
|
|
151
|
+
[f]
|
|
152
|
+
);
|
|
153
|
+
return s.useEffect(() => () => v(), [v]), s.useEffect(() => {
|
|
154
|
+
if (a && u) {
|
|
155
|
+
const x = (h) => d(h, u), T = (h) => d(h, a);
|
|
156
|
+
return a.addEventListener("pointerleave", x), u.addEventListener("pointerleave", T), () => {
|
|
157
|
+
a.removeEventListener("pointerleave", x), u.removeEventListener("pointerleave", T);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}, [a, u, d, v]), s.useEffect(() => {
|
|
161
|
+
if (i) {
|
|
162
|
+
const x = (T) => {
|
|
163
|
+
const h = T.target, y = { x: T.clientX, y: T.clientY }, g = a?.contains(h) || u?.contains(h), w = !ge(y, i);
|
|
164
|
+
g ? v() : w && (v(), p());
|
|
165
|
+
};
|
|
166
|
+
return document.addEventListener("pointermove", x), () => document.removeEventListener("pointermove", x);
|
|
167
|
+
}
|
|
168
|
+
}, [a, u, i, p, v]), /* @__PURE__ */ c.jsx(V, { ...e, ref: l });
|
|
169
|
+
}), [fe, me] = j(R, { isInside: !1 }), ve = K("TooltipContent"), V = s.forwardRef(
|
|
170
|
+
(e, o) => {
|
|
171
|
+
const {
|
|
172
|
+
__scopeTooltip: t,
|
|
173
|
+
children: r,
|
|
174
|
+
"aria-label": n,
|
|
175
|
+
onEscapeKeyDown: l,
|
|
176
|
+
onPointerDownOutside: i,
|
|
177
|
+
...m
|
|
178
|
+
} = e, a = _(b, t), p = O(t), { onClose: u } = a;
|
|
179
|
+
return s.useEffect(() => (document.addEventListener(D, u), () => document.removeEventListener(D, u)), [u]), s.useEffect(() => {
|
|
180
|
+
if (a.trigger) {
|
|
181
|
+
const f = (v) => {
|
|
182
|
+
v.target?.contains(a.trigger) && u();
|
|
183
|
+
};
|
|
184
|
+
return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
|
|
185
|
+
}
|
|
186
|
+
}, [a.trigger, u]), /* @__PURE__ */ c.jsx(
|
|
187
|
+
J,
|
|
188
|
+
{
|
|
189
|
+
asChild: !0,
|
|
190
|
+
disableOutsidePointerEvents: !1,
|
|
191
|
+
onEscapeKeyDown: l,
|
|
192
|
+
onPointerDownOutside: i,
|
|
193
|
+
onFocusOutside: (f) => f.preventDefault(),
|
|
194
|
+
onDismiss: u,
|
|
195
|
+
children: /* @__PURE__ */ c.jsxs(
|
|
196
|
+
oe,
|
|
197
|
+
{
|
|
198
|
+
"data-state": a.stateAttribute,
|
|
199
|
+
...p,
|
|
200
|
+
...m,
|
|
201
|
+
ref: o,
|
|
202
|
+
style: {
|
|
203
|
+
...m.style,
|
|
204
|
+
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
205
|
+
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
206
|
+
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
207
|
+
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
208
|
+
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
209
|
+
},
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ c.jsx(ve, { children: r }),
|
|
212
|
+
/* @__PURE__ */ c.jsx(fe, { scope: t, isInside: !0, children: /* @__PURE__ */ c.jsx(se, { id: a.contentId, role: "tooltip", children: n || r }) })
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
U.displayName = b;
|
|
221
|
+
var Y = "TooltipArrow", q = s.forwardRef(
|
|
222
|
+
(e, o) => {
|
|
223
|
+
const { __scopeTooltip: t, ...r } = e, n = O(t);
|
|
224
|
+
return me(
|
|
225
|
+
Y,
|
|
226
|
+
t
|
|
227
|
+
).isInside ? null : /* @__PURE__ */ c.jsx(te, { ...n, ...r, ref: o });
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
q.displayName = Y;
|
|
231
|
+
function xe(e, o) {
|
|
232
|
+
const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x), l = Math.abs(o.left - e.x);
|
|
233
|
+
switch (Math.min(t, r, n, l)) {
|
|
234
|
+
case l:
|
|
235
|
+
return "left";
|
|
236
|
+
case n:
|
|
237
|
+
return "right";
|
|
238
|
+
case t:
|
|
239
|
+
return "top";
|
|
240
|
+
case r:
|
|
241
|
+
return "bottom";
|
|
242
|
+
default:
|
|
243
|
+
throw new Error("unreachable");
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function he(e, o, t = 5) {
|
|
247
|
+
const r = [];
|
|
248
|
+
switch (o) {
|
|
249
|
+
case "top":
|
|
250
|
+
r.push(
|
|
251
|
+
{ x: e.x - t, y: e.y + t },
|
|
252
|
+
{ x: e.x + t, y: e.y + t }
|
|
253
|
+
);
|
|
254
|
+
break;
|
|
255
|
+
case "bottom":
|
|
256
|
+
r.push(
|
|
257
|
+
{ x: e.x - t, y: e.y - t },
|
|
258
|
+
{ x: e.x + t, y: e.y - t }
|
|
259
|
+
);
|
|
260
|
+
break;
|
|
261
|
+
case "left":
|
|
262
|
+
r.push(
|
|
263
|
+
{ x: e.x + t, y: e.y - t },
|
|
264
|
+
{ x: e.x + t, y: e.y + t }
|
|
265
|
+
);
|
|
266
|
+
break;
|
|
267
|
+
case "right":
|
|
268
|
+
r.push(
|
|
269
|
+
{ x: e.x - t, y: e.y - t },
|
|
270
|
+
{ x: e.x - t, y: e.y + t }
|
|
271
|
+
);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
return r;
|
|
275
|
+
}
|
|
276
|
+
function Te(e) {
|
|
277
|
+
const { top: o, right: t, bottom: r, left: n } = e;
|
|
278
|
+
return [
|
|
279
|
+
{ x: n, y: o },
|
|
280
|
+
{ x: t, y: o },
|
|
281
|
+
{ x: t, y: r },
|
|
282
|
+
{ x: n, y: r }
|
|
283
|
+
];
|
|
284
|
+
}
|
|
285
|
+
function ge(e, o) {
|
|
286
|
+
const { x: t, y: r } = e;
|
|
287
|
+
let n = !1;
|
|
288
|
+
for (let l = 0, i = o.length - 1; l < o.length; i = l++) {
|
|
289
|
+
const m = o[l], a = o[i], p = m.x, u = m.y, f = a.x, v = a.y;
|
|
290
|
+
u > r != v > r && t < (f - p) * (r - u) / (v - u) + p && (n = !n);
|
|
291
|
+
}
|
|
292
|
+
return n;
|
|
293
|
+
}
|
|
294
|
+
function ye(e) {
|
|
295
|
+
const o = e.slice();
|
|
296
|
+
return o.sort((t, r) => t.x < r.x ? -1 : t.x > r.x ? 1 : t.y < r.y ? -1 : t.y > r.y ? 1 : 0), Ce(o);
|
|
297
|
+
}
|
|
298
|
+
function Ce(e) {
|
|
299
|
+
if (e.length <= 1) return e.slice();
|
|
300
|
+
const o = [];
|
|
301
|
+
for (let r = 0; r < e.length; r++) {
|
|
302
|
+
const n = e[r];
|
|
303
|
+
for (; o.length >= 2; ) {
|
|
304
|
+
const l = o[o.length - 1], i = o[o.length - 2];
|
|
305
|
+
if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x)) o.pop();
|
|
306
|
+
else break;
|
|
307
|
+
}
|
|
308
|
+
o.push(n);
|
|
309
|
+
}
|
|
310
|
+
o.pop();
|
|
311
|
+
const t = [];
|
|
312
|
+
for (let r = e.length - 1; r >= 0; r--) {
|
|
313
|
+
const n = e[r];
|
|
314
|
+
for (; t.length >= 2; ) {
|
|
315
|
+
const l = t[t.length - 1], i = t[t.length - 2];
|
|
316
|
+
if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x)) t.pop();
|
|
317
|
+
else break;
|
|
318
|
+
}
|
|
319
|
+
t.push(n);
|
|
320
|
+
}
|
|
321
|
+
return t.pop(), o.length === 1 && t.length === 1 && o[0].x === t[0].x && o[0].y === t[0].y ? o : o.concat(t);
|
|
322
|
+
}
|
|
323
|
+
var be = F, we = z, Pe = $, Ee = B, Re = U, _e = q;
|
|
324
|
+
function je({
|
|
325
|
+
delayDuration: e = 0,
|
|
326
|
+
...o
|
|
327
|
+
}) {
|
|
328
|
+
return /* @__PURE__ */ c.jsx(
|
|
329
|
+
be,
|
|
330
|
+
{
|
|
331
|
+
"data-slot": "tooltip-provider",
|
|
332
|
+
delayDuration: e,
|
|
333
|
+
...o
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
function ze({
|
|
338
|
+
...e
|
|
339
|
+
}) {
|
|
340
|
+
return /* @__PURE__ */ c.jsx(je, { children: /* @__PURE__ */ c.jsx(we, { "data-slot": "tooltip", ...e }) });
|
|
341
|
+
}
|
|
342
|
+
function $e({
|
|
343
|
+
...e
|
|
344
|
+
}) {
|
|
345
|
+
return /* @__PURE__ */ c.jsx(Pe, { "data-slot": "tooltip-trigger", ...e });
|
|
346
|
+
}
|
|
347
|
+
function Be({
|
|
348
|
+
className: e,
|
|
349
|
+
sideOffset: o = 0,
|
|
350
|
+
children: t,
|
|
351
|
+
...r
|
|
352
|
+
}) {
|
|
353
|
+
return /* @__PURE__ */ c.jsx(Ee, { children: /* @__PURE__ */ c.jsxs(
|
|
354
|
+
Re,
|
|
355
|
+
{
|
|
356
|
+
"data-slot": "tooltip-content",
|
|
357
|
+
sideOffset: o,
|
|
358
|
+
className: ae(
|
|
359
|
+
"adm:bg-neutrals-800 adm:text-white adm:animate-in adm:fade-in-0 adm:zoom-in-95 adm:data-[state=closed]:animate-out adm:data-[state=closed]:fade-out-0 adm:data-[state=closed]:zoom-out-95 adm:data-[side=bottom]:slide-in-from-top-2 adm:data-[side=left]:slide-in-from-right-2 adm:data-[side=right]:slide-in-from-left-2 adm:data-[side=top]:slide-in-from-bottom-2 adm:z-50 adm:w-fit adm:origin-(--radix-tooltip-content-transform-origin) adm:rounded-md adm:px-3 adm:py-1.5 adm:text-xs adm:text-balance",
|
|
360
|
+
e
|
|
361
|
+
),
|
|
362
|
+
...r,
|
|
363
|
+
children: [
|
|
364
|
+
t,
|
|
365
|
+
/* @__PURE__ */ c.jsx(_e, { className: "adm:bg-neutrals-800 adm:fill-neutrals-800 adm:z-50 adm:size-2.5 adm:translate-y-[calc(-50%_-_2px)] adm:rotate-45 adm:rounded-[2px]" })
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
) });
|
|
369
|
+
}
|
|
370
|
+
export {
|
|
371
|
+
ze as Tooltip,
|
|
372
|
+
Be as TooltipContent,
|
|
373
|
+
je as TooltipProvider,
|
|
374
|
+
$e as TooltipTrigger
|
|
375
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-BB_1_6y_.cjs"),r=require("./utils-DoxiiusW.cjs"),d=require("./index-iAvn1gzj.cjs"),o=require("./index-BKbK2GzY.cjs"),m=d.cva("",{variants:{variant:{lg:"adm:text-lg adm:leading-1",md:"adm:text-base adm:leading-0.5",sm:"adm:text-sm adm:leading",xs:"adm:text-xs adm:leading-[20px]",caption:"adm:text-[11px] adm:leading-[18px]"}}});function p({className:t,variant:a,asChild:e=!1,...n}){const s=e?o.Slot:"p";return i.jsxRuntimeExports.jsx(s,{"data-slot":"typography",className:r.cn(m({variant:a,className:t})),...n})}exports.Typography=p;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { j as p } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { c as r } from "./utils-CRiPKpXj.js";
|
|
3
|
+
import { c as d } from "./index-CQhYMnjT.js";
|
|
4
|
+
import { S as e } from "./index-6oTEokEx.js";
|
|
5
|
+
const n = d("", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
lg: "adm:text-lg adm:leading-1",
|
|
9
|
+
md: "adm:text-base adm:leading-0.5",
|
|
10
|
+
sm: "adm:text-sm adm:leading",
|
|
11
|
+
xs: "adm:text-xs adm:leading-[20px]",
|
|
12
|
+
caption: "adm:text-[11px] adm:leading-[18px]"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
function c({
|
|
17
|
+
className: a,
|
|
18
|
+
variant: t,
|
|
19
|
+
asChild: m = !1,
|
|
20
|
+
...o
|
|
21
|
+
}) {
|
|
22
|
+
const s = m ? e : "p";
|
|
23
|
+
return /* @__PURE__ */ p.jsx(
|
|
24
|
+
s,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "typography",
|
|
27
|
+
className: r(n({ variant: t, className: a })),
|
|
28
|
+
...o
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
c as Typography
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react");function m(e,l={}){const{maxAttempts:t=100,logWarning:r=!0}=l,[s,c]=u.useState(null);return u.useEffect(()=>{let o=0,n;const a=()=>{const i=document.querySelector(e);if(i){c(i);return}o++,o<t?n=requestAnimationFrame(a):r&&console.warn(`Could not find element with selector "${e}" after ${t} attempts`)};return a(),()=>{n&&cancelAnimationFrame(n)}},[e,t,r]),s}exports.usePortalContainer=m;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useState as u, useEffect as c } from "react";
|
|
2
|
+
function d(t, m = {}) {
|
|
3
|
+
const { maxAttempts: e = 100, logWarning: r = !0 } = m, [l, s] = u(null);
|
|
4
|
+
return c(() => {
|
|
5
|
+
let o = 0, n;
|
|
6
|
+
const a = () => {
|
|
7
|
+
const i = document.querySelector(t);
|
|
8
|
+
if (i) {
|
|
9
|
+
s(i);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
o++, o < e ? n = requestAnimationFrame(a) : r && console.warn(`Could not find element with selector "${t}" after ${e} attempts`);
|
|
13
|
+
};
|
|
14
|
+
return a(), () => {
|
|
15
|
+
n && cancelAnimationFrame(n);
|
|
16
|
+
};
|
|
17
|
+
}, [t, e, r]), l;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
d as usePortalContainer
|
|
21
|
+
};
|