@jfrader/ui 0.4.0 → 0.5.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 +2 -0
- package/dist/accordion-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-Dlbq5-9D.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/avatar-group-M1opAQEG.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/bottom-sheet-DjZOPq4k.js +674 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/calendar-BzJdv_SZ.js +449 -0
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DjQ0_6Y9.js +290 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-B5we2lZa.js +293 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-DFFqOBCi.js +339 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/copy-button-DCSLcYS-.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-BiPN7yeK.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-rUATve0o.js +347 -0
- package/dist/expandable-card.js +2 -0
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-Cy5Hqur-.js +314 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-CoMJKg1g.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-BxY8Ykzt.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +84 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-DgWqyU75.js +802 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card--lVTz5Wn.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-DG1BCFX7.js +598 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-qEbpEtb8.js +78 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/radio-cards-Cu9cBssN.js +456 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-DUpQEpwG.js +520 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-DMvho0KQ.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-8ZUGnsZm.js +327 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-D5rhJ8gi.js +293 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-_bTeguN9.js +645 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-CYKT_Ng7.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-BCw4zZom.js +262 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-CBuJREU1.js +420 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-hU72iSVS.js} +20 -17
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/time-picker-CPlhW0tr.js +311 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-B0uAAVfT.js +624 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-B7wo3sX1.js +371 -0
- package/dist/toast-stack-B40VpS4M.js +197 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-j8qLqkb_.js +364 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +2 -2
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +68 -7
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +62 -0
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/overlay/overlay-layer.d.ts +53 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-Bx2jBKAA.js +33 -0
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +195 -3
- package/dist/accordion-Bd-j04hW.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/switch-Dr-qjmT4.js +0 -142
- package/dist/tabs-CK_g1RKa.js +0 -203
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { r } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as i } from "./use-controlled-state-DpeVQZNR.js";
|
|
5
|
+
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
6
|
+
import { t as o } from "./avatar-CaGJHy1N.js";
|
|
7
|
+
import { n as s } from "./surface-DZ4d-2aL.js";
|
|
8
|
+
import { t as c } from "./trigger-style-B1KVC8O1.js";
|
|
9
|
+
import { a as l, i as u } from "./overlay-layer-qEbpEtb8.js";
|
|
10
|
+
import { t as d } from "./overlay-portal-C4JZFq2M.js";
|
|
11
|
+
import { t as f } from "./use-overlay-floating-Bx2jBKAA.js";
|
|
12
|
+
import { createContext as p, useCallback as m, useContext as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
13
|
+
import { vars as b } from "@jfrader/tokens/vars";
|
|
14
|
+
import { jsx as x, jsxs as S } from "@emotion/react/jsx-runtime";
|
|
15
|
+
import { safePolygon as C, useFocus as ee, useHover as w, useInteractions as T, useMergeRefs as E, useRole as D } from "@floating-ui/react";
|
|
16
|
+
//#region src/components/hover-card/hover-card.tsx
|
|
17
|
+
var O = 500, k = 140, A = 300, j = 80, M = "18.5rem", N = p(null), P = p(null);
|
|
18
|
+
function F(e) {
|
|
19
|
+
let t = h(N);
|
|
20
|
+
if (!t) throw Error(`HoverCard.${e} must be rendered inside <HoverCard>.`);
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
var I = (e, t) => Number.isFinite(e) && e >= 0 ? e : t, L = (e) => e != null && e.ownerDocument.activeElement === e && e.matches(":focus-visible");
|
|
24
|
+
function R(e, t) {
|
|
25
|
+
let n = v(null);
|
|
26
|
+
return _(() => ({ reference: {
|
|
27
|
+
onPointerDown: (t) => {
|
|
28
|
+
n.current = t.pointerType === "touch" ? { wasOpen: e } : null;
|
|
29
|
+
},
|
|
30
|
+
onClick: (r) => {
|
|
31
|
+
let i = n.current;
|
|
32
|
+
n.current = null, !r.defaultPrevented && (i ? t(!i.wasOpen) : e || t(!0));
|
|
33
|
+
}
|
|
34
|
+
} }), [e, t]);
|
|
35
|
+
}
|
|
36
|
+
var z = b.space[1], B = e({
|
|
37
|
+
from: {
|
|
38
|
+
opacity: 0,
|
|
39
|
+
transform: "translate(var(--hover-card-enter-x, 0), var(--hover-card-enter-y, 0))"
|
|
40
|
+
},
|
|
41
|
+
to: {
|
|
42
|
+
opacity: 1,
|
|
43
|
+
transform: "none"
|
|
44
|
+
}
|
|
45
|
+
}), V = e({
|
|
46
|
+
from: { opacity: 0 },
|
|
47
|
+
to: { opacity: 1 }
|
|
48
|
+
}), H = t({
|
|
49
|
+
...s,
|
|
50
|
+
borderRadius: b.radius.lg,
|
|
51
|
+
boxShadow: b.shadow.floating,
|
|
52
|
+
padding: b.space[4],
|
|
53
|
+
inlineSize: `min(${M}, calc(100vw - 2 * ${b.space[4]}))`,
|
|
54
|
+
fontSize: b.textSize.sm,
|
|
55
|
+
textAlign: "start",
|
|
56
|
+
overflowWrap: "anywhere",
|
|
57
|
+
animation: `${B} ${b.motion.duration.base} ${b.motion.easeStandard}`,
|
|
58
|
+
"&[data-side=\"bottom\"]": { "--hover-card-enter-y": `calc(-1 * ${z})` },
|
|
59
|
+
"&[data-side=\"top\"]": { "--hover-card-enter-y": z },
|
|
60
|
+
"&[data-side=\"left\"]": { "--hover-card-enter-x": z },
|
|
61
|
+
"&[data-side=\"right\"]": { "--hover-card-enter-x": `calc(-1 * ${z})` },
|
|
62
|
+
"&[data-entry=\"warm\"]": { animation: `${V} ${b.motion.duration.fast} ${b.motion.easeStandard}` },
|
|
63
|
+
[r]: { "&, &[data-entry=\"warm\"]": { animation: "none" } }
|
|
64
|
+
});
|
|
65
|
+
function U({ value: e, defaultValue: t = null, onValueChange: n, skipDelay: r = A, intentDelay: a = j, children: o }) {
|
|
66
|
+
let [s = null, c] = i(e, t, n), l = I(r, A), u = v(/* @__PURE__ */ new Map()), [d, f] = y(() => ({
|
|
67
|
+
active: s,
|
|
68
|
+
warm: !1,
|
|
69
|
+
closedAt: -Infinity
|
|
70
|
+
}));
|
|
71
|
+
if (d.active !== s) {
|
|
72
|
+
let e = performance.now();
|
|
73
|
+
f({
|
|
74
|
+
active: s,
|
|
75
|
+
warm: d.active !== null || e - d.closedAt < l,
|
|
76
|
+
closedAt: s === null ? e : d.closedAt
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
let p = v(d);
|
|
80
|
+
g(() => {
|
|
81
|
+
p.current = d;
|
|
82
|
+
}, [d]);
|
|
83
|
+
let h = m(() => {
|
|
84
|
+
let { active: e, closedAt: t } = p.current;
|
|
85
|
+
return e !== null || performance.now() - t < l;
|
|
86
|
+
}, [l]), b = m((e) => {
|
|
87
|
+
let t = u.current;
|
|
88
|
+
return t.set(e, (t.get(e) ?? 0) + 1), () => {
|
|
89
|
+
let n = (t.get(e) ?? 1) - 1;
|
|
90
|
+
n > 0 ? t.set(e, n) : t.delete(e), queueMicrotask(() => {
|
|
91
|
+
!t.has(e) && p.current.active === e && c(null);
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
}, [c]), S = _(() => ({
|
|
95
|
+
active: s,
|
|
96
|
+
requestActive: c,
|
|
97
|
+
isWarm: h,
|
|
98
|
+
warmEntry: d.warm,
|
|
99
|
+
intentDelay: I(a, j),
|
|
100
|
+
register: b
|
|
101
|
+
}), [
|
|
102
|
+
s,
|
|
103
|
+
c,
|
|
104
|
+
h,
|
|
105
|
+
d.warm,
|
|
106
|
+
a,
|
|
107
|
+
b
|
|
108
|
+
]);
|
|
109
|
+
return /* @__PURE__ */ x(P.Provider, {
|
|
110
|
+
value: S,
|
|
111
|
+
children: o
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
U.displayName = "HoverCard.Group";
|
|
115
|
+
function W({ nodeId: e, open: t, defaultOpen: n, onOpenChange: r, value: a, placement: o = "bottom-start", openDelay: s = O, closeDelay: c = k, children: u }) {
|
|
116
|
+
let d = h(P);
|
|
117
|
+
if (d) {
|
|
118
|
+
if (t !== void 0 || n !== void 0 || r !== void 0) throw Error("HoverCard inside <HoverCard.Group> takes no open/defaultOpen/onOpenChange; the group owns state.");
|
|
119
|
+
if (a === void 0) throw Error("HoverCard inside <HoverCard.Group> requires a `value`.");
|
|
120
|
+
}
|
|
121
|
+
let [p = !1, v] = i(d ? void 0 : t, d ? !1 : n ?? !1, d ? void 0 : r), y = d ? a : void 0, b = d ? d.active === y : p, S = m((e) => {
|
|
122
|
+
d ? e ? d.requestActive(y) : d.active === y && d.requestActive(null) : v(e);
|
|
123
|
+
}, [
|
|
124
|
+
d,
|
|
125
|
+
y,
|
|
126
|
+
v
|
|
127
|
+
]), E = d?.register;
|
|
128
|
+
g(() => {
|
|
129
|
+
if (E && y !== void 0) return E(y);
|
|
130
|
+
}, [E, y]);
|
|
131
|
+
let A = f({
|
|
132
|
+
open: b,
|
|
133
|
+
placement: o,
|
|
134
|
+
nodeId: e,
|
|
135
|
+
onOpenChange: (e, t, n) => {
|
|
136
|
+
(e || n !== "hover" && n !== "safe-polygon" || !L(A.refs.domReference.current)) && (!e && n === "escape-key" && t?.preventDefault(), S(e));
|
|
137
|
+
}
|
|
138
|
+
}), { refs: j, floatingStyles: M, context: F, placement: z } = A, B = b && d?.warmEntry === !0, V = I(s, O), H = I(c, k), U = w(F, {
|
|
139
|
+
delay: () => ({
|
|
140
|
+
open: d?.isWarm() ? d.intentDelay : V,
|
|
141
|
+
close: H
|
|
142
|
+
}),
|
|
143
|
+
mouseOnly: !0,
|
|
144
|
+
move: !1,
|
|
145
|
+
handleClose: C()
|
|
146
|
+
}), W = ee(F, { visibleOnly: !0 }), G = l(F, "leaf"), K = D(F, { role: "tooltip" }), q = R(b, S), { getReferenceProps: J, getFloatingProps: Y } = T([
|
|
147
|
+
U,
|
|
148
|
+
W,
|
|
149
|
+
...G,
|
|
150
|
+
K,
|
|
151
|
+
q
|
|
152
|
+
]), X = z.split("-")[0], Z = _(() => ({
|
|
153
|
+
open: b,
|
|
154
|
+
side: X,
|
|
155
|
+
refs: j,
|
|
156
|
+
floatingStyles: M,
|
|
157
|
+
getReferenceProps: J,
|
|
158
|
+
getFloatingProps: Y,
|
|
159
|
+
warmEntry: B
|
|
160
|
+
}), [
|
|
161
|
+
b,
|
|
162
|
+
X,
|
|
163
|
+
j,
|
|
164
|
+
M,
|
|
165
|
+
J,
|
|
166
|
+
Y,
|
|
167
|
+
B
|
|
168
|
+
]);
|
|
169
|
+
return /* @__PURE__ */ x(N.Provider, {
|
|
170
|
+
value: Z,
|
|
171
|
+
children: u
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function G(e) {
|
|
175
|
+
return /* @__PURE__ */ x(u, { children: (t) => /* @__PURE__ */ x(W, {
|
|
176
|
+
...e,
|
|
177
|
+
nodeId: t
|
|
178
|
+
}) });
|
|
179
|
+
}
|
|
180
|
+
G.displayName = "HoverCard";
|
|
181
|
+
function K({ ref: e = null, render: t, "aria-describedby": r, className: i, sx: a, ...o }) {
|
|
182
|
+
let { refs: s, getReferenceProps: l } = F("Trigger"), u = E([s.setReference, e]), { "data-ui": d, ...f } = o, p = l(f), m = [r, p["aria-describedby"]].filter(Boolean).join(" ") || void 0, h = {
|
|
183
|
+
...p,
|
|
184
|
+
ref: u,
|
|
185
|
+
"aria-describedby": m,
|
|
186
|
+
"data-ui": t && d !== void 0 ? `${d} hover-card-trigger` : "hover-card-trigger"
|
|
187
|
+
};
|
|
188
|
+
return /* @__PURE__ */ x(n, {
|
|
189
|
+
className: i,
|
|
190
|
+
styles: t ? void 0 : c,
|
|
191
|
+
sx: a,
|
|
192
|
+
children: (e) => t ? t({
|
|
193
|
+
...h,
|
|
194
|
+
className: e
|
|
195
|
+
}) : /* @__PURE__ */ x("button", {
|
|
196
|
+
type: "button",
|
|
197
|
+
...h,
|
|
198
|
+
className: e
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
K.displayName = "HoverCard.Trigger";
|
|
203
|
+
function q({ ref: e, style: t, className: r, sx: i, ...a }) {
|
|
204
|
+
let { side: o, refs: s, floatingStyles: c, getFloatingProps: l, warmEntry: u } = F("Content"), [d] = y(() => {
|
|
205
|
+
let e = s.domReference.current;
|
|
206
|
+
return e?.ownerDocument.defaultView?.getComputedStyle(e).direction;
|
|
207
|
+
}), { tabIndex: f, ...p } = l(a);
|
|
208
|
+
return /* @__PURE__ */ x("div", {
|
|
209
|
+
ref: s.setFloating,
|
|
210
|
+
dir: d,
|
|
211
|
+
style: c,
|
|
212
|
+
children: /* @__PURE__ */ x(n, {
|
|
213
|
+
className: r,
|
|
214
|
+
styles: H,
|
|
215
|
+
sx: i,
|
|
216
|
+
children: (n) => /* @__PURE__ */ x("div", {
|
|
217
|
+
...p,
|
|
218
|
+
ref: e,
|
|
219
|
+
"data-ui": "hover-card",
|
|
220
|
+
"data-side": o,
|
|
221
|
+
"data-entry": u ? "warm" : "cold",
|
|
222
|
+
style: t,
|
|
223
|
+
className: n
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function J(e) {
|
|
229
|
+
let { open: t } = F("Content");
|
|
230
|
+
return t ? /* @__PURE__ */ x(d, { children: /* @__PURE__ */ x(q, { ...e }) }) : null;
|
|
231
|
+
}
|
|
232
|
+
J.displayName = "HoverCard.Content";
|
|
233
|
+
var Y = t({
|
|
234
|
+
display: "grid",
|
|
235
|
+
gap: b.space[3],
|
|
236
|
+
fontFamily: b.font.sans,
|
|
237
|
+
lineHeight: b.lineHeight.base,
|
|
238
|
+
color: b.color.text
|
|
239
|
+
}), X = t({
|
|
240
|
+
display: "flex",
|
|
241
|
+
alignItems: "center",
|
|
242
|
+
gap: b.space[3],
|
|
243
|
+
minInlineSize: 0
|
|
244
|
+
}), Z = t({
|
|
245
|
+
display: "inline-flex",
|
|
246
|
+
flexShrink: 0
|
|
247
|
+
}), te = t({
|
|
248
|
+
display: "grid",
|
|
249
|
+
minInlineSize: 0
|
|
250
|
+
}), ne = t({
|
|
251
|
+
fontSize: b.textSize.md,
|
|
252
|
+
fontWeight: b.fontWeight.medium
|
|
253
|
+
}), Q = t({
|
|
254
|
+
fontSize: b.textSize.sm,
|
|
255
|
+
color: b.color.textMuted
|
|
256
|
+
}), re = t({
|
|
257
|
+
display: "flex",
|
|
258
|
+
flexWrap: "wrap",
|
|
259
|
+
columnGap: b.space[6],
|
|
260
|
+
rowGap: b.space[2],
|
|
261
|
+
margin: 0
|
|
262
|
+
}), ie = t({ display: "grid" }), ae = t({
|
|
263
|
+
fontSize: b.textSize.xs,
|
|
264
|
+
color: b.color.textMuted
|
|
265
|
+
}), oe = t({
|
|
266
|
+
margin: 0,
|
|
267
|
+
fontSize: b.textSize.md,
|
|
268
|
+
fontWeight: b.fontWeight.medium,
|
|
269
|
+
fontVariantNumeric: "tabular-nums"
|
|
270
|
+
}), se = t({
|
|
271
|
+
paddingBlockStart: b.space[3],
|
|
272
|
+
borderBlockStart: `1px solid ${b.color.borderSubtle}`,
|
|
273
|
+
fontSize: b.textSize.xs,
|
|
274
|
+
color: b.color.textMuted
|
|
275
|
+
});
|
|
276
|
+
function $({ ref: e, name: t, subtitle: r, bio: i, src: s, avatar: c, stats: l = [], meta: u, locale: d, slotProps: f, className: p, sx: m, ...h }) {
|
|
277
|
+
let g = l.some((e) => typeof e.value == "number") ? new Intl.NumberFormat(d) : void 0;
|
|
278
|
+
return /* @__PURE__ */ x(n, {
|
|
279
|
+
className: p,
|
|
280
|
+
styles: Y,
|
|
281
|
+
sx: m,
|
|
282
|
+
children: (n) => /* @__PURE__ */ S("div", {
|
|
283
|
+
...h,
|
|
284
|
+
ref: e,
|
|
285
|
+
"data-ui": "hover-card-profile",
|
|
286
|
+
className: n,
|
|
287
|
+
children: [
|
|
288
|
+
/* @__PURE__ */ S("div", {
|
|
289
|
+
css: X,
|
|
290
|
+
children: [/* @__PURE__ */ x("span", {
|
|
291
|
+
...f?.avatar,
|
|
292
|
+
"aria-hidden": "true",
|
|
293
|
+
css: [Z, f?.avatar?.css],
|
|
294
|
+
children: a(c) ? c : /* @__PURE__ */ x(o, {
|
|
295
|
+
name: t,
|
|
296
|
+
src: s,
|
|
297
|
+
size: "lg"
|
|
298
|
+
})
|
|
299
|
+
}), /* @__PURE__ */ S("div", {
|
|
300
|
+
...f?.identity,
|
|
301
|
+
css: [te, f?.identity?.css],
|
|
302
|
+
children: [/* @__PURE__ */ x("div", {
|
|
303
|
+
css: ne,
|
|
304
|
+
children: t
|
|
305
|
+
}), a(r) && /* @__PURE__ */ x("div", {
|
|
306
|
+
css: Q,
|
|
307
|
+
children: r
|
|
308
|
+
})]
|
|
309
|
+
})]
|
|
310
|
+
}),
|
|
311
|
+
a(i) && /* @__PURE__ */ x("div", {
|
|
312
|
+
...f?.bio,
|
|
313
|
+
css: [Q, f?.bio?.css],
|
|
314
|
+
children: i
|
|
315
|
+
}),
|
|
316
|
+
l.length > 0 && /* @__PURE__ */ x("dl", {
|
|
317
|
+
...f?.stats,
|
|
318
|
+
css: [re, f?.stats?.css],
|
|
319
|
+
children: l.map((e) => /* @__PURE__ */ S("div", {
|
|
320
|
+
css: ie,
|
|
321
|
+
children: [/* @__PURE__ */ x("dt", {
|
|
322
|
+
css: ae,
|
|
323
|
+
children: e.label
|
|
324
|
+
}), /* @__PURE__ */ x("dd", {
|
|
325
|
+
css: oe,
|
|
326
|
+
children: typeof e.value == "number" ? g?.format(e.value) : e.value
|
|
327
|
+
})]
|
|
328
|
+
}, e.id))
|
|
329
|
+
}),
|
|
330
|
+
a(u) && /* @__PURE__ */ x("div", {
|
|
331
|
+
...f?.meta,
|
|
332
|
+
css: [se, f?.meta?.css],
|
|
333
|
+
children: u
|
|
334
|
+
})
|
|
335
|
+
]
|
|
336
|
+
})
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
$.displayName = "HoverCard.Profile";
|
|
340
|
+
var ce = Object.assign(G, {
|
|
341
|
+
Trigger: K,
|
|
342
|
+
Content: J,
|
|
343
|
+
Profile: $,
|
|
344
|
+
Group: U
|
|
345
|
+
});
|
|
346
|
+
//#endregion
|
|
347
|
+
export { ce as t };
|