@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,120 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./use-controlled-state-DpeVQZNR.js";
|
|
4
|
+
import { t as r } from "./trigger-style-B1KVC8O1.js";
|
|
5
|
+
import { t as i } from "./overlay-layer-qEbpEtb8.js";
|
|
6
|
+
import { t as a } from "./overlay-portal-C4JZFq2M.js";
|
|
7
|
+
import { t as o } from "./use-overlay-floating-Bx2jBKAA.js";
|
|
8
|
+
import { createContext as s, useContext as c, useMemo as l, useState as u } from "react";
|
|
9
|
+
import { vars as d } from "@jfrader/tokens/vars";
|
|
10
|
+
import { jsx as f } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { useDismiss as p, useFocus as m, useHover as h, useInteractions as g, useMergeRefs as _, useRole as v } from "@floating-ui/react";
|
|
12
|
+
//#region src/components/tooltip/tooltip.tsx
|
|
13
|
+
var y = 300, b = 100, x = s(null);
|
|
14
|
+
function S(e) {
|
|
15
|
+
let t = c(x);
|
|
16
|
+
if (!t) throw Error(`Tooltip.${e} must be rendered inside <Tooltip>.`);
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
var C = e({
|
|
20
|
+
boxSizing: "border-box",
|
|
21
|
+
backgroundColor: d.color.bgSoft,
|
|
22
|
+
border: `1px solid ${d.color.border}`,
|
|
23
|
+
borderRadius: d.radius.sm,
|
|
24
|
+
boxShadow: d.shadow.raised,
|
|
25
|
+
padding: `${d.space[1]} ${d.space[2]}`,
|
|
26
|
+
maxInlineSize: `min(260px, calc(100vw - 2 * ${d.space[4]}))`,
|
|
27
|
+
overflowWrap: "anywhere",
|
|
28
|
+
color: d.color.text,
|
|
29
|
+
fontFamily: d.font.sans,
|
|
30
|
+
fontSize: d.textSize.sm,
|
|
31
|
+
lineHeight: d.lineHeight.base
|
|
32
|
+
});
|
|
33
|
+
function w({ open: e, defaultOpen: t = !1, onOpenChange: r, placement: i = "top", openDelay: a = y, closeDelay: s = b, children: c }) {
|
|
34
|
+
let [u = !1, d] = n(e, t, r), { refs: _, floatingStyles: S, context: C } = o({
|
|
35
|
+
open: u,
|
|
36
|
+
placement: i,
|
|
37
|
+
onOpenChange: d
|
|
38
|
+
}), w = h(C, {
|
|
39
|
+
delay: {
|
|
40
|
+
open: a,
|
|
41
|
+
close: s
|
|
42
|
+
},
|
|
43
|
+
move: !1
|
|
44
|
+
}), T = m(C), E = p(C, { escapeKey: !0 }), D = v(C, { role: "tooltip" }), { getReferenceProps: O, getFloatingProps: k } = g([
|
|
45
|
+
w,
|
|
46
|
+
T,
|
|
47
|
+
E,
|
|
48
|
+
D
|
|
49
|
+
]), A = l(() => ({
|
|
50
|
+
open: u,
|
|
51
|
+
refs: _,
|
|
52
|
+
floatingStyles: S,
|
|
53
|
+
getReferenceProps: O,
|
|
54
|
+
getFloatingProps: k
|
|
55
|
+
}), [
|
|
56
|
+
u,
|
|
57
|
+
_,
|
|
58
|
+
S,
|
|
59
|
+
O,
|
|
60
|
+
k
|
|
61
|
+
]);
|
|
62
|
+
return /* @__PURE__ */ f(x.Provider, {
|
|
63
|
+
value: A,
|
|
64
|
+
children: c
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function T(e) {
|
|
68
|
+
return /* @__PURE__ */ f(i, { children: /* @__PURE__ */ f(w, { ...e }) });
|
|
69
|
+
}
|
|
70
|
+
T.displayName = "Tooltip";
|
|
71
|
+
function E({ ref: e, "aria-describedby": n, className: i, sx: a, ...o }) {
|
|
72
|
+
let { refs: s, getReferenceProps: c } = S("Trigger"), l = _([s.setReference, e]), u = c(o), d = [n, u["aria-describedby"]].filter(Boolean).join(" ") || void 0;
|
|
73
|
+
return /* @__PURE__ */ f(t, {
|
|
74
|
+
className: i,
|
|
75
|
+
styles: r,
|
|
76
|
+
sx: a,
|
|
77
|
+
children: (e) => /* @__PURE__ */ f("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
...u,
|
|
80
|
+
ref: l,
|
|
81
|
+
"aria-describedby": d,
|
|
82
|
+
"data-ui": "tooltip-trigger",
|
|
83
|
+
className: e
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
E.displayName = "Tooltip.Trigger";
|
|
88
|
+
function D({ ref: e, style: n, className: r, sx: i, dir: a, ...o }) {
|
|
89
|
+
let { refs: s, floatingStyles: c, getFloatingProps: l } = S("Content"), d = _([s.setFloating, e]), [p] = u(() => {
|
|
90
|
+
let e = s.domReference.current;
|
|
91
|
+
return e?.ownerDocument.defaultView?.getComputedStyle(e).direction;
|
|
92
|
+
}), { tabIndex: m, ...h } = l(o);
|
|
93
|
+
return /* @__PURE__ */ f(t, {
|
|
94
|
+
className: r,
|
|
95
|
+
styles: C,
|
|
96
|
+
sx: i,
|
|
97
|
+
children: (e) => /* @__PURE__ */ f("div", {
|
|
98
|
+
...h,
|
|
99
|
+
ref: d,
|
|
100
|
+
dir: a ?? p,
|
|
101
|
+
"data-ui": "tooltip",
|
|
102
|
+
style: {
|
|
103
|
+
...n,
|
|
104
|
+
...c
|
|
105
|
+
},
|
|
106
|
+
className: e
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function O(e) {
|
|
111
|
+
let { open: t } = S("Content");
|
|
112
|
+
return t ? /* @__PURE__ */ f(a, { children: /* @__PURE__ */ f(D, { ...e }) }) : null;
|
|
113
|
+
}
|
|
114
|
+
O.displayName = "Tooltip.Content";
|
|
115
|
+
var k = Object.assign(T, {
|
|
116
|
+
Trigger: E,
|
|
117
|
+
Content: O
|
|
118
|
+
});
|
|
119
|
+
//#endregion
|
|
120
|
+
export { k as t };
|
package/dist/tooltip.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Tooltip } from "./tooltip-
|
|
2
|
+
export { t as Tooltip } from "./tooltip-BvgVTCTN.js";
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./disclosure-caret-C5T3fcl6.js";
|
|
4
|
+
import { t as r } from "./focus-ring-BK5W5_NY.js";
|
|
5
|
+
import { n as i, r as a } from "./media-8yrN85VT.js";
|
|
6
|
+
import { t as o } from "./use-controlled-state-DpeVQZNR.js";
|
|
7
|
+
import { t as s } from "./renderable-DzcIj1Lo.js";
|
|
8
|
+
import { useEffect as c, useId as ee, useLayoutEffect as te, useMemo as ne, useRef as l, useState as u } from "react";
|
|
9
|
+
import { vars as d } from "@jfrader/tokens/vars";
|
|
10
|
+
import { jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
|
|
11
|
+
//#region src/components/tree-view/tree-view.tsx
|
|
12
|
+
var re = 500, ie = {
|
|
13
|
+
loading: (e) => `Loading ${e}…`,
|
|
14
|
+
error: (e) => `Could not load ${e}. Press Enter to retry.`,
|
|
15
|
+
empty: "No items"
|
|
16
|
+
}, ae = e({
|
|
17
|
+
minInlineSize: 0,
|
|
18
|
+
background: d.color.surface,
|
|
19
|
+
color: d.color.text,
|
|
20
|
+
borderRadius: d.radius.md,
|
|
21
|
+
fontFamily: d.font.sans,
|
|
22
|
+
fontSize: d.textSize.sm,
|
|
23
|
+
lineHeight: d.lineHeight.base
|
|
24
|
+
}), oe = e({
|
|
25
|
+
listStyle: "none",
|
|
26
|
+
margin: 0,
|
|
27
|
+
padding: d.space[1],
|
|
28
|
+
overflowX: "auto",
|
|
29
|
+
"&:focus-visible": r
|
|
30
|
+
}), se = e({
|
|
31
|
+
outline: "none",
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
flex: 1,
|
|
35
|
+
minInlineSize: 0,
|
|
36
|
+
minBlockSize: d.space[8]
|
|
37
|
+
}), ce = e({
|
|
38
|
+
display: "flex",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
gap: d.space[2],
|
|
41
|
+
minBlockSize: d.space[8],
|
|
42
|
+
paddingInline: d.space[2],
|
|
43
|
+
paddingInlineStart: `calc(var(--tree-level) * ${d.space[4]} + ${d.space[2]})`,
|
|
44
|
+
borderInlineStart: "2px solid transparent",
|
|
45
|
+
borderRadius: d.radius.sm,
|
|
46
|
+
cursor: "pointer",
|
|
47
|
+
transitionProperty: "background-color, color",
|
|
48
|
+
transitionDuration: d.motion.duration.fast,
|
|
49
|
+
transitionTimingFunction: d.motion.easeStandard,
|
|
50
|
+
"&:hover": { background: d.color.surfaceHover },
|
|
51
|
+
"&:has(> [aria-selected=\"true\"])": {
|
|
52
|
+
borderInlineStartColor: d.color.accentText,
|
|
53
|
+
background: d.color.surfaceHover
|
|
54
|
+
},
|
|
55
|
+
"&:has(> [aria-disabled=\"true\"])": {
|
|
56
|
+
color: d.color.textMuted,
|
|
57
|
+
cursor: "default"
|
|
58
|
+
},
|
|
59
|
+
"&:has(> [role=\"treeitem\"]:focus-visible)": r,
|
|
60
|
+
[a]: { transitionDuration: "0s" },
|
|
61
|
+
[i]: {
|
|
62
|
+
borderInlineStartColor: "Canvas",
|
|
63
|
+
"&:has(> [aria-selected=\"true\"])": { borderInlineStartColor: "Highlight" }
|
|
64
|
+
}
|
|
65
|
+
}), le = e({
|
|
66
|
+
minInlineSize: 0,
|
|
67
|
+
overflowWrap: "anywhere"
|
|
68
|
+
}), ue = e({
|
|
69
|
+
display: "inline-flex",
|
|
70
|
+
flexShrink: 0,
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
justifyContent: "center"
|
|
73
|
+
}), de = e({
|
|
74
|
+
display: "inline-flex",
|
|
75
|
+
flexShrink: 0,
|
|
76
|
+
inlineSize: d.space[8],
|
|
77
|
+
blockSize: d.space[8],
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
justifyContent: "center",
|
|
80
|
+
color: "currentColor",
|
|
81
|
+
"&[data-branch=\"true\"]::after": {
|
|
82
|
+
...n,
|
|
83
|
+
transitionDuration: d.motion.duration.fast
|
|
84
|
+
},
|
|
85
|
+
"&[data-open=\"true\"]::after": { transform: "rotate(90deg)" },
|
|
86
|
+
"&:dir(rtl)[data-open=\"true\"]::after": { transform: "rotate(-90deg)" },
|
|
87
|
+
[a]: { "&[data-branch=\"true\"]::after": { transitionDuration: "0s" } },
|
|
88
|
+
[i]: { "&[data-branch=\"true\"]::after": {
|
|
89
|
+
forcedColorAdjust: "none",
|
|
90
|
+
color: "CanvasText"
|
|
91
|
+
} }
|
|
92
|
+
}), fe = e({
|
|
93
|
+
listStyle: "none",
|
|
94
|
+
margin: 0,
|
|
95
|
+
padding: 0,
|
|
96
|
+
position: "relative",
|
|
97
|
+
"&::before": {
|
|
98
|
+
content: "\"\"",
|
|
99
|
+
position: "absolute",
|
|
100
|
+
insetBlock: 0,
|
|
101
|
+
insetInlineStart: `calc(var(--tree-level) * ${d.space[4]})`,
|
|
102
|
+
borderInlineStart: `1px solid ${d.color.border}`,
|
|
103
|
+
pointerEvents: "none"
|
|
104
|
+
}
|
|
105
|
+
}), m = e({
|
|
106
|
+
margin: 0,
|
|
107
|
+
paddingInline: d.space[2],
|
|
108
|
+
"&:empty": { padding: 0 }
|
|
109
|
+
});
|
|
110
|
+
function h({ nodes: e, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: d = [], onOpenChange: h, loadChildren: g, onLoadError: pe, label: me = "Tree", messages: he, empty: _, treeRef: v, locale: y, slotProps: b, ref: ge, className: _e, sx: ve, onKeyDown: ye, onClick: be, onBlur: xe, "aria-label": Se, "aria-labelledby": x, "aria-describedby": Ce, ...we }) {
|
|
111
|
+
let S = ee(), C = l(null), w = l(/* @__PURE__ */ new Map()), T = l(null), E = l(/* @__PURE__ */ new Map()), D = l(/* @__PURE__ */ new Map()), [Te, Ee] = u(/* @__PURE__ */ new Map()), [O, k] = u(/* @__PURE__ */ new Set()), [A, j] = u(/* @__PURE__ */ new Set()), [M, De] = o(n, r, i), [N = [], P] = o(a, d, h), [F, I] = u(n ?? r), L = l({
|
|
112
|
+
text: "",
|
|
113
|
+
time: 0
|
|
114
|
+
}), R = ne(() => new Intl.Collator(y, {
|
|
115
|
+
usage: "search",
|
|
116
|
+
sensitivity: "base"
|
|
117
|
+
}), [y]), z = {
|
|
118
|
+
...ie,
|
|
119
|
+
...he
|
|
120
|
+
}, B = /* @__PURE__ */ new Map(), V = [], H = new Set(N), U = (e, t, n = 1, r = !0) => {
|
|
121
|
+
e.forEach((i, a) => {
|
|
122
|
+
let o = i.children ?? Te.get(i.id), s = {
|
|
123
|
+
node: i,
|
|
124
|
+
children: o,
|
|
125
|
+
parent: t,
|
|
126
|
+
level: n,
|
|
127
|
+
position: a + 1,
|
|
128
|
+
size: e.length,
|
|
129
|
+
branch: o === void 0 ? i.hasChildren === !0 : o.length > 0
|
|
130
|
+
};
|
|
131
|
+
B.set(i.id, s), r && V.push(s), o && U(o, i.id, n + 1, r && H.has(i.id));
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
U(e);
|
|
135
|
+
let W = V.filter((e) => !e.node.disabled), G = (e) => {
|
|
136
|
+
let t = /* @__PURE__ */ new Set();
|
|
137
|
+
for (; e != null && !t.has(e);) {
|
|
138
|
+
if (t.add(e), W.some((t) => t.node.id === e)) return e;
|
|
139
|
+
e = B.get(e)?.parent ?? E.current.get(e)?.parent;
|
|
140
|
+
}
|
|
141
|
+
return W[0]?.node.id ?? null;
|
|
142
|
+
}, K = G(F ?? M), q = (e) => {
|
|
143
|
+
I(e);
|
|
144
|
+
let t = e === null ? C.current : w.current.get(e);
|
|
145
|
+
t?.focus(), t?.scrollIntoView({
|
|
146
|
+
block: "nearest",
|
|
147
|
+
inline: "nearest"
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
te(() => {
|
|
151
|
+
if (F !== K) {
|
|
152
|
+
let e = T.current, t = C.current?.ownerDocument, n = e && t && (t.activeElement === e || !e.isConnected && t.activeElement === t.body);
|
|
153
|
+
I(K), n && q(K);
|
|
154
|
+
}
|
|
155
|
+
E.current = B;
|
|
156
|
+
}), c(() => () => {
|
|
157
|
+
for (let e of D.current.values()) e.controller.abort();
|
|
158
|
+
D.current.clear();
|
|
159
|
+
}, []), c(() => {
|
|
160
|
+
let e = new Map(V.filter((e) => H.has(e.node.id) && e.branch && !e.node.disabled && e.children === void 0).map((e) => [e.node.id, e.node]));
|
|
161
|
+
for (let [t, n] of D.current) (!e.has(t) || !g) && (n.controller.abort(), D.current.delete(t), j((e) => {
|
|
162
|
+
let n = new Set(e);
|
|
163
|
+
return n.delete(t), n;
|
|
164
|
+
}));
|
|
165
|
+
if (g) for (let [t, n] of e) {
|
|
166
|
+
if (D.current.has(t) || O.has(t)) continue;
|
|
167
|
+
let e = { controller: new AbortController() };
|
|
168
|
+
D.current.set(t, e), j((e) => new Set(e).add(t)), Promise.resolve().then(() => {
|
|
169
|
+
if (!e.controller.signal.aborted) return g(n, { signal: e.controller.signal });
|
|
170
|
+
}).then((n) => {
|
|
171
|
+
e.controller.signal.aborted || D.current.get(t) !== e || n === void 0 || (D.current.delete(t), Ee((e) => new Map(e).set(t, n)), j((e) => {
|
|
172
|
+
let n = new Set(e);
|
|
173
|
+
return n.delete(t), n;
|
|
174
|
+
}));
|
|
175
|
+
}, (r) => {
|
|
176
|
+
e.controller.signal.aborted || D.current.get(t) !== e || (D.current.delete(t), k((e) => new Set(e).add(t)), j((e) => {
|
|
177
|
+
let n = new Set(e);
|
|
178
|
+
return n.delete(t), n;
|
|
179
|
+
}), pe?.(r, n));
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
let J = (e) => k((t) => {
|
|
184
|
+
let n = new Set(t);
|
|
185
|
+
return n.delete(e), n;
|
|
186
|
+
}), Y = (e) => {
|
|
187
|
+
let t = e.node.id;
|
|
188
|
+
if (!e.branch || e.node.disabled) return;
|
|
189
|
+
if (H.has(t) && O.has(t)) {
|
|
190
|
+
J(t);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
let n = new Set(N);
|
|
194
|
+
n.has(t) ? n.delete(t) : n.add(t), (n.size !== H.size || [...n].some((e) => !H.has(e))) && P([...n]);
|
|
195
|
+
}, X = (e) => {
|
|
196
|
+
e.node.disabled || De(e.node.id);
|
|
197
|
+
}, Oe = (e, t) => {
|
|
198
|
+
if (t.node.disabled || e.defaultPrevented || e.nativeEvent.isComposing || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
199
|
+
let n = t.node.id, r = W.findIndex((e) => e.node.id === n), i = {
|
|
200
|
+
ArrowDown: () => q(W[Math.min(r + 1, W.length - 1)]?.node.id ?? null),
|
|
201
|
+
ArrowUp: () => q(W[Math.max(r - 1, 0)]?.node.id ?? null),
|
|
202
|
+
Home: () => q(W[0]?.node.id ?? null),
|
|
203
|
+
End: () => q(W.at(-1)?.node.id ?? null),
|
|
204
|
+
ArrowRight: () => {
|
|
205
|
+
if (t.branch && !A.has(n)) {
|
|
206
|
+
if (!H.has(n)) Y(t);
|
|
207
|
+
else if (O.has(n)) J(n);
|
|
208
|
+
else {
|
|
209
|
+
let e = t.children?.find((e) => !e.disabled);
|
|
210
|
+
e && q(e.id);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
ArrowLeft: () => {
|
|
215
|
+
t.branch && H.has(n) ? P([...H].filter((e) => e !== n)) : t.parent && q(G(t.parent));
|
|
216
|
+
},
|
|
217
|
+
Enter: () => H.has(n) && O.has(n) ? J(n) : X(t),
|
|
218
|
+
" ": () => X(t)
|
|
219
|
+
};
|
|
220
|
+
if (i[e.key]) {
|
|
221
|
+
e.preventDefault(), i[e.key]();
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (e.key.length !== 1 || e.key === "*") return;
|
|
225
|
+
let a = Date.now(), o = a - L.current.time < re ? L.current.text + e.key : e.key;
|
|
226
|
+
L.current = {
|
|
227
|
+
text: o,
|
|
228
|
+
time: a
|
|
229
|
+
};
|
|
230
|
+
let s = [...o].every((e) => R.compare(e, o[0]) === 0) ? o[0] : o;
|
|
231
|
+
for (let t = +(s.length === 1); t < W.length + 1; t++) {
|
|
232
|
+
let n = W[(r + t) % W.length];
|
|
233
|
+
if (R.compare(n.node.label.slice(0, s.length), s) === 0) {
|
|
234
|
+
e.preventDefault(), q(n.node.id);
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}, Z = (e) => `${S}-${Array.from(e, (e) => e.codePointAt(0).toString(16)).join("-")}`, Q = (e) => e.map((e) => {
|
|
239
|
+
let t = B.get(e.id), n = `${Z(e.id)}-error`, r = `${Z(e.id)}-label`, i = t.branch && H.has(e.id);
|
|
240
|
+
return /* @__PURE__ */ p("li", {
|
|
241
|
+
role: "none",
|
|
242
|
+
children: [/* @__PURE__ */ p("div", {
|
|
243
|
+
"data-ui": "tree-view-row",
|
|
244
|
+
className: b?.row?.className,
|
|
245
|
+
css: [ce, b?.row?.css],
|
|
246
|
+
style: { "--tree-level": t.level - 1 },
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ f("span", {
|
|
249
|
+
"data-ui": "tree-view-disclosure",
|
|
250
|
+
"aria-hidden": "true",
|
|
251
|
+
"data-branch": t.branch,
|
|
252
|
+
"data-open": i,
|
|
253
|
+
className: b?.disclosure?.className,
|
|
254
|
+
css: [de, b?.disclosure?.css]
|
|
255
|
+
}),
|
|
256
|
+
s(e.icon) && /* @__PURE__ */ f("span", {
|
|
257
|
+
"data-ui": "tree-view-icon",
|
|
258
|
+
"aria-hidden": "true",
|
|
259
|
+
className: b?.icon?.className,
|
|
260
|
+
css: [ue, b?.icon?.css],
|
|
261
|
+
children: e.icon
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ f("div", {
|
|
264
|
+
ref: (t) => {
|
|
265
|
+
t ? w.current.set(e.id, t) : w.current.delete(e.id);
|
|
266
|
+
},
|
|
267
|
+
role: "treeitem",
|
|
268
|
+
css: se,
|
|
269
|
+
tabIndex: !e.disabled && K === e.id ? 0 : -1,
|
|
270
|
+
"aria-labelledby": r,
|
|
271
|
+
"aria-level": t.level,
|
|
272
|
+
"aria-posinset": t.position,
|
|
273
|
+
"aria-setsize": t.size,
|
|
274
|
+
"aria-expanded": t.branch ? i : void 0,
|
|
275
|
+
"aria-selected": e.disabled ? void 0 : M === e.id,
|
|
276
|
+
"aria-disabled": e.disabled || void 0,
|
|
277
|
+
"aria-busy": A.has(e.id) || void 0,
|
|
278
|
+
"aria-describedby": O.has(e.id) && i ? n : void 0,
|
|
279
|
+
"aria-owns": i && t.children && t.children.length > 0 ? `${Z(e.id)}-group` : void 0,
|
|
280
|
+
onFocus: (t) => {
|
|
281
|
+
t.target === t.currentTarget && (T.current = t.currentTarget, I(e.id));
|
|
282
|
+
},
|
|
283
|
+
children: /* @__PURE__ */ f("span", {
|
|
284
|
+
id: r,
|
|
285
|
+
"data-ui": "tree-view-label",
|
|
286
|
+
className: b?.label?.className,
|
|
287
|
+
css: [le, b?.label?.css],
|
|
288
|
+
children: e.label
|
|
289
|
+
})
|
|
290
|
+
})
|
|
291
|
+
]
|
|
292
|
+
}), i && t.children && t.children.length > 0 && /* @__PURE__ */ f("ul", {
|
|
293
|
+
id: `${Z(e.id)}-group`,
|
|
294
|
+
role: "group",
|
|
295
|
+
"data-ui": "tree-view-group",
|
|
296
|
+
className: b?.group?.className,
|
|
297
|
+
css: [fe, b?.group?.css],
|
|
298
|
+
style: { "--tree-level": t.level },
|
|
299
|
+
children: Q(t.children)
|
|
300
|
+
})]
|
|
301
|
+
}, e.id);
|
|
302
|
+
}), $ = _ === void 0 ? z.empty : _;
|
|
303
|
+
return /* @__PURE__ */ f(t, {
|
|
304
|
+
className: _e,
|
|
305
|
+
styles: [ae],
|
|
306
|
+
sx: ve,
|
|
307
|
+
children: (t) => /* @__PURE__ */ p("div", {
|
|
308
|
+
...we,
|
|
309
|
+
ref: ge,
|
|
310
|
+
className: t,
|
|
311
|
+
"data-ui": "tree-view",
|
|
312
|
+
onClick: (e) => {
|
|
313
|
+
if (be?.(e), e.defaultPrevented) return;
|
|
314
|
+
let t = e.target, n = t.closest("[data-ui=\"tree-view-row\"]"), r = W.find((e) => w.current.get(e.node.id)?.parentElement === n);
|
|
315
|
+
r && (q(r.node.id), t.closest("[data-ui=\"tree-view-disclosure\"]") ? Y(r) : X(r));
|
|
316
|
+
},
|
|
317
|
+
onKeyDown: (e) => {
|
|
318
|
+
if (ye?.(e), e.defaultPrevented) return;
|
|
319
|
+
let t = W.find((t) => w.current.get(t.node.id) === e.target);
|
|
320
|
+
t && Oe(e, t);
|
|
321
|
+
},
|
|
322
|
+
onBlur: (e) => {
|
|
323
|
+
xe?.(e), e.currentTarget.contains(e.relatedTarget) || I(G(M));
|
|
324
|
+
},
|
|
325
|
+
children: [
|
|
326
|
+
/* @__PURE__ */ f("ul", {
|
|
327
|
+
role: "tree",
|
|
328
|
+
"data-ui": "tree-view-tree",
|
|
329
|
+
ref: (e) => {
|
|
330
|
+
if (C.current = e, typeof v == "function") return v(e);
|
|
331
|
+
v && (v.current = e);
|
|
332
|
+
},
|
|
333
|
+
className: b?.tree?.className,
|
|
334
|
+
css: [oe, b?.tree?.css],
|
|
335
|
+
tabIndex: W.length ? void 0 : 0,
|
|
336
|
+
"aria-label": Se ?? (x ? void 0 : me),
|
|
337
|
+
"aria-labelledby": x,
|
|
338
|
+
"aria-describedby": [Ce, W.length ? void 0 : `${S}-empty`].filter(Boolean).join(" ") || void 0,
|
|
339
|
+
children: Q(e)
|
|
340
|
+
}),
|
|
341
|
+
!W.length && /* @__PURE__ */ f("p", {
|
|
342
|
+
id: `${S}-empty`,
|
|
343
|
+
css: m,
|
|
344
|
+
children: e.length ? z.empty : s($) ? $ : null
|
|
345
|
+
}),
|
|
346
|
+
/* @__PURE__ */ f("div", {
|
|
347
|
+
role: "status",
|
|
348
|
+
"aria-live": "polite",
|
|
349
|
+
"aria-atomic": "true",
|
|
350
|
+
"data-ui": "tree-view-status",
|
|
351
|
+
className: b?.status?.className,
|
|
352
|
+
css: [m, b?.status?.css],
|
|
353
|
+
children: V.filter((e) => H.has(e.node.id)).map(({ node: e }) => A.has(e.id) ? /* @__PURE__ */ f("p", { children: z.loading(e.label) }, e.id) : O.has(e.id) ? /* @__PURE__ */ f("p", {
|
|
354
|
+
id: `${Z(e.id)}-error`,
|
|
355
|
+
children: z.error(e.label)
|
|
356
|
+
}, e.id) : null)
|
|
357
|
+
})
|
|
358
|
+
]
|
|
359
|
+
})
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
h.displayName = "TreeView";
|
|
363
|
+
//#endregion
|
|
364
|
+
export { h as t };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type MouseEvent, type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
import { type CountdownProps } from '../countdown';
|
|
5
|
+
export interface Announcement {
|
|
6
|
+
id: string;
|
|
7
|
+
message: ReactNode;
|
|
8
|
+
action?: {
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
href?: string;
|
|
11
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
12
|
+
};
|
|
13
|
+
countdown?: Pick<CountdownProps, 'target' | 'label' | 'completeLabel' | 'units' | 'clock'>;
|
|
14
|
+
}
|
|
15
|
+
export type AnnouncementBarVariant = 'subtle' | 'inverted';
|
|
16
|
+
export type AnnouncementBarTone = 'neutral' | 'info' | 'warning' | 'danger';
|
|
17
|
+
export interface AnnouncementBarLabels {
|
|
18
|
+
previous: string;
|
|
19
|
+
next: string;
|
|
20
|
+
pause: string;
|
|
21
|
+
resume: string;
|
|
22
|
+
dismiss: string;
|
|
23
|
+
slide: string;
|
|
24
|
+
carousel: string;
|
|
25
|
+
}
|
|
26
|
+
type Slot<E extends 'section' | 'div' | 'span' | 'button' | 'a'> = Omit<ComponentPropsWithRef<E>, 'ref' | 'children' | 'dangerouslySetInnerHTML'> & {
|
|
27
|
+
css?: Interpolation<Theme>;
|
|
28
|
+
};
|
|
29
|
+
export interface AnnouncementBarProps extends Omit<ComponentPropsWithRef<'section'>, 'children' | 'dangerouslySetInnerHTML'>, SxProps {
|
|
30
|
+
messages: readonly Announcement[];
|
|
31
|
+
open?: boolean;
|
|
32
|
+
defaultOpen?: boolean;
|
|
33
|
+
onOpenChange?: (open: boolean) => void;
|
|
34
|
+
value?: number;
|
|
35
|
+
defaultValue?: number;
|
|
36
|
+
onValueChange?: (index: number) => void;
|
|
37
|
+
autoPlay?: boolean;
|
|
38
|
+
paused?: boolean;
|
|
39
|
+
defaultPaused?: boolean;
|
|
40
|
+
onPausedChange?: (paused: boolean) => void;
|
|
41
|
+
interval?: number;
|
|
42
|
+
controls?: boolean;
|
|
43
|
+
dismissible?: boolean;
|
|
44
|
+
variant?: AnnouncementBarVariant;
|
|
45
|
+
tone?: AnnouncementBarTone;
|
|
46
|
+
label?: string;
|
|
47
|
+
live?: 'off' | 'polite';
|
|
48
|
+
locale?: Intl.LocalesArgument;
|
|
49
|
+
labels?: Partial<AnnouncementBarLabels>;
|
|
50
|
+
getMessageLabel?: (index: number, total: number) => string;
|
|
51
|
+
onAction?: (announcement: Announcement) => void;
|
|
52
|
+
onCountdownEnd?: (announcement: Announcement) => void;
|
|
53
|
+
dismissFocusRef?: RefObject<HTMLElement | null>;
|
|
54
|
+
slotProps?: {
|
|
55
|
+
root?: Slot<'section'>;
|
|
56
|
+
content?: Slot<'div'>;
|
|
57
|
+
message?: Slot<'span'>;
|
|
58
|
+
action?: Omit<Slot<'a'> & Slot<'button'>, 'onClick'> & {
|
|
59
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
60
|
+
};
|
|
61
|
+
previous?: Slot<'button'>;
|
|
62
|
+
next?: Slot<'button'>;
|
|
63
|
+
rotation?: Slot<'button'>;
|
|
64
|
+
dismiss?: Slot<'button'>;
|
|
65
|
+
countdown?: Omit<Slot<'div'>, 'onClick'>;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** APG basic carousel: native Tab/Enter/Space; focus stops rotation until Resume. No custom arrow/Escape keys.
|
|
69
|
+
* State modes must not change during an instance. The app owns persistence and keyboard dismissal destinations.
|
|
70
|
+
*/
|
|
71
|
+
export declare function AnnouncementBar({ ref, messages, open: openProp, defaultOpen, onOpenChange, value, defaultValue, onValueChange, autoPlay, paused: pausedProp, defaultPaused, onPausedChange, interval, controls, dismissible, variant, tone, label, live, locale, labels: labelsProp, getMessageLabel, onAction, onCountdownEnd, dismissFocusRef, slotProps, className, sx, ...rest }: AnnouncementBarProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
72
|
+
export declare namespace AnnouncementBar {
|
|
73
|
+
var displayName: string;
|
|
74
|
+
}
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
import { type AvatarProps, type AvatarSize, type AvatarStatus } from '../avatar';
|
|
5
|
+
export interface AvatarGroupMember {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
src?: string;
|
|
9
|
+
status?: AvatarStatus;
|
|
10
|
+
statusLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AvatarGroupPartProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
css?: Interpolation<Theme>;
|
|
15
|
+
}
|
|
16
|
+
export interface AvatarGroupProps extends Omit<ComponentPropsWithRef<'div'>, 'children' | 'role'>, SxProps {
|
|
17
|
+
/** Stable display order of people; immutable input. */
|
|
18
|
+
members: readonly AvatarGroupMember[];
|
|
19
|
+
/** Maximum number of visible people; overflow does not consume a person slot. Defaults to 4. */
|
|
20
|
+
max?: number;
|
|
21
|
+
/** Size for avatars and the overflow count circle. Defaults to 'md'. */
|
|
22
|
+
size?: AvatarSize;
|
|
23
|
+
/** Fallback accessible name for the group landmark. Defaults to 'Team members'. */
|
|
24
|
+
label?: string;
|
|
25
|
+
/** Locale for formatting count numerals; pin for deterministic SSR. Defaults to ambient Intl locale. */
|
|
26
|
+
locale?: Intl.LocalesArgument;
|
|
27
|
+
/** Formats the accessible name of the overflow image. Defaults to English plural wording. */
|
|
28
|
+
getOverflowLabel?: (hidden: number, formatted: string) => string;
|
|
29
|
+
/** Formats the total count summary description. Defaults to English plural wording. */
|
|
30
|
+
getSummaryLabel?: (total: number, formatted: string) => string;
|
|
31
|
+
/** Style overrides for internal parts. */
|
|
32
|
+
slotProps?: {
|
|
33
|
+
member?: AvatarGroupPartProps;
|
|
34
|
+
overflow?: AvatarGroupPartProps;
|
|
35
|
+
summary?: AvatarGroupPartProps;
|
|
36
|
+
};
|
|
37
|
+
/** Shared styling overrides passed down to each child Avatar. Cannot override id/name/status. */
|
|
38
|
+
avatarProps?: Pick<AvatarProps, 'slotProps' | 'sx' | 'className'>;
|
|
39
|
+
}
|
|
40
|
+
export declare function AvatarGroup({ ref, members, max, size, label, locale, getOverflowLabel, getSummaryLabel, slotProps, avatarProps, className, sx, ...rest }: AvatarGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare namespace AvatarGroup {
|
|
42
|
+
var displayName: string;
|
|
43
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type SxProps } from '../../styling/sx';
|
|
3
|
+
export interface BottomSheetProps {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
/** Nonempty ascending unique fractions in (0, 1]. Numeric contents require remount to change. */
|
|
8
|
+
detents?: readonly number[];
|
|
9
|
+
value?: number;
|
|
10
|
+
defaultValue?: number;
|
|
11
|
+
onValueChange?: (index: number) => void;
|
|
12
|
+
locale?: Intl.LocalesArgument;
|
|
13
|
+
getValueText?: (fraction: number, index: number) => string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface BottomSheetTriggerProps extends ComponentPropsWithRef<'button'>, SxProps {
|
|
17
|
+
}
|
|
18
|
+
export interface BottomSheetContentProps extends Omit<ComponentPropsWithRef<'dialog'>, 'open'>, SxProps {
|
|
19
|
+
withDescription?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface BottomSheetPanelProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
22
|
+
}
|
|
23
|
+
export interface BottomSheetHeaderProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
24
|
+
}
|
|
25
|
+
export interface BottomSheetBodyProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
26
|
+
}
|
|
27
|
+
export interface BottomSheetFooterProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
28
|
+
}
|
|
29
|
+
export interface BottomSheetTitleProps extends ComponentPropsWithRef<'h2'>, SxProps {
|
|
30
|
+
}
|
|
31
|
+
export interface BottomSheetDescriptionProps extends ComponentPropsWithRef<'p'>, SxProps {
|
|
32
|
+
}
|
|
33
|
+
export interface BottomSheetHandleProps extends ComponentPropsWithRef<'button'>, SxProps {
|
|
34
|
+
}
|
|
35
|
+
export interface BottomSheetCloseProps extends ComponentPropsWithRef<'button'>, SxProps {
|
|
36
|
+
}
|
|
37
|
+
declare function BottomSheetRoot(props: BottomSheetProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare function BottomSheetTrigger({ ref, onClick, className, sx, ...props }: BottomSheetTriggerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare function BottomSheetContent({ ref, sx, className, ...props }: BottomSheetContentProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare function BottomSheetPanel({ ref, sx, className, autoFocus, ...props }: BottomSheetPanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare function BottomSheetHeader({ ref, sx, className, ...props }: BottomSheetHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
42
|
+
declare function BottomSheetBody({ ref, sx, className, onKeyDown, onFocusCapture, ...props }: BottomSheetBodyProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare function BottomSheetFooter({ ref, sx, className, ...props }: BottomSheetFooterProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function BottomSheetTitle({ ref, sx, className, children, ...props }: BottomSheetTitleProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
45
|
+
declare function BottomSheetDescription({ ref, sx, className, children, ...props }: BottomSheetDescriptionProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
46
|
+
declare function BottomSheetHandle({ ref, sx, className, onClick, onKeyDown, 'aria-describedby': described, ...props }: BottomSheetHandleProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare function BottomSheetClose({ ref, sx, className, onClick, ...props }: BottomSheetCloseProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare const BottomSheet: typeof BottomSheetRoot & {
|
|
49
|
+
Trigger: typeof BottomSheetTrigger;
|
|
50
|
+
Content: typeof BottomSheetContent;
|
|
51
|
+
Panel: typeof BottomSheetPanel;
|
|
52
|
+
Header: typeof BottomSheetHeader;
|
|
53
|
+
Body: typeof BottomSheetBody;
|
|
54
|
+
Footer: typeof BottomSheetFooter;
|
|
55
|
+
Title: typeof BottomSheetTitle;
|
|
56
|
+
Description: typeof BottomSheetDescription;
|
|
57
|
+
Handle: typeof BottomSheetHandle;
|
|
58
|
+
Close: typeof BottomSheetClose;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { BottomSheet } from './bottom-sheet';
|
|
2
|
+
export type { BottomSheetProps, BottomSheetTriggerProps, BottomSheetContentProps, BottomSheetPanelProps, BottomSheetHeaderProps, BottomSheetBodyProps, BottomSheetFooterProps, BottomSheetTitleProps, BottomSheetDescriptionProps, BottomSheetHandleProps, BottomSheetCloseProps, } from './bottom-sheet';
|