@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,295 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { r } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as i } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
+
import { t as a } from "./trigger-style-B1KVC8O1.js";
|
|
7
|
+
import { a as o, n as s, r as c } from "./overlay-layer-qEbpEtb8.js";
|
|
8
|
+
import { o as l, s as u, t as d } from "./listbox-style-WX-RASp1.js";
|
|
9
|
+
import { i as f, n as p } from "./collection-registry-k6JcD3Jr.js";
|
|
10
|
+
import { t as m } from "./overlay-portal-C4JZFq2M.js";
|
|
11
|
+
import { t as h } from "./use-overlay-floating-Bx2jBKAA.js";
|
|
12
|
+
import { createContext as g, useContext as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
13
|
+
import { vars as S } from "@jfrader/tokens/vars";
|
|
14
|
+
import { jsx as C } from "@emotion/react/jsx-runtime";
|
|
15
|
+
import { FloatingFocusManager as w, FloatingList as T, useClick as E, useInteractions as D, useListNavigation as O, useMergeRefs as k, useRole as A, useTypeahead as j } from "@floating-ui/react";
|
|
16
|
+
//#region src/components/menu/menu.tsx
|
|
17
|
+
var M = 500, N = g(null), P = g(!1);
|
|
18
|
+
function F(e, t) {
|
|
19
|
+
let n = _(N);
|
|
20
|
+
if (!n) throw Error(`${e}.${t} must be rendered inside <${e}>.`);
|
|
21
|
+
return n;
|
|
22
|
+
}
|
|
23
|
+
function I(e, t) {
|
|
24
|
+
let n = F(e, t);
|
|
25
|
+
if (!_(P)) throw Error(`${e}.${t} must be rendered inside <${e}.Content>.`);
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
var L = (e) => /^on[A-Z]/.test(e);
|
|
29
|
+
function R(e, t) {
|
|
30
|
+
let n = {}, r = {};
|
|
31
|
+
for (let [t, i] of Object.entries(e)) L(t) && typeof i == "function" ? n[t] = i : r[t] = i;
|
|
32
|
+
let i = t(r);
|
|
33
|
+
for (let [e, t] of Object.entries(n)) {
|
|
34
|
+
let n = i[e];
|
|
35
|
+
i[e] = (e) => {
|
|
36
|
+
t(e), e.defaultPrevented || n?.(e);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return i;
|
|
40
|
+
}
|
|
41
|
+
var z = (...e) => e.filter(Boolean).join(" ") || void 0, B = e({
|
|
42
|
+
appearance: "none",
|
|
43
|
+
boxSizing: "border-box",
|
|
44
|
+
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
inlineSize: "100%",
|
|
47
|
+
minBlockSize: "32px",
|
|
48
|
+
flexShrink: 0,
|
|
49
|
+
border: 0,
|
|
50
|
+
borderRadius: S.radius.sm,
|
|
51
|
+
backgroundColor: "transparent",
|
|
52
|
+
paddingBlock: S.space[1],
|
|
53
|
+
paddingInline: S.space[2],
|
|
54
|
+
font: "inherit",
|
|
55
|
+
fontSize: S.textSize.sm,
|
|
56
|
+
color: S.color.text,
|
|
57
|
+
textAlign: "start",
|
|
58
|
+
cursor: "pointer",
|
|
59
|
+
transitionProperty: "background-color",
|
|
60
|
+
transitionDuration: S.motion.duration.fast,
|
|
61
|
+
transitionTimingFunction: S.motion.easeStandard,
|
|
62
|
+
"&:focus-visible": { ...n },
|
|
63
|
+
[r]: { transitionDuration: "0s" }
|
|
64
|
+
}), V = e({
|
|
65
|
+
blockSize: "1px",
|
|
66
|
+
marginBlock: S.space[1],
|
|
67
|
+
backgroundColor: S.color.border
|
|
68
|
+
}), H = [B, d], U = V, ee = {
|
|
69
|
+
neutral: e({}),
|
|
70
|
+
danger: e({
|
|
71
|
+
color: S.color.dangerText,
|
|
72
|
+
"&:hover:not([aria-disabled=\"true\"]), &[data-active]:not([aria-disabled=\"true\"])": { backgroundColor: S.color.dangerSoft }
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
function te({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: r = "bottom-start", positioning: a, nodeId: s, children: c }) {
|
|
76
|
+
let [l = !1, u] = i(e, t, n), [d, f] = x(null), p = b([]), m = b([]), g = b(/* @__PURE__ */ new Set()), _ = b(!1), { refs: S, floatingStyles: w, context: T } = h({
|
|
77
|
+
...a,
|
|
78
|
+
open: l,
|
|
79
|
+
placement: r,
|
|
80
|
+
nodeId: s,
|
|
81
|
+
onOpenChange: (e, t, n) => {
|
|
82
|
+
_.current = !e && n === "escape-key", u(e);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
v(() => {
|
|
86
|
+
if (l || !_.current) return;
|
|
87
|
+
_.current = !1;
|
|
88
|
+
let e = S.domReference.current;
|
|
89
|
+
if (!e?.isConnected || e.closest("[inert]")) return;
|
|
90
|
+
let t = e.ownerDocument.activeElement;
|
|
91
|
+
t && t !== e.ownerDocument.body || e.focus();
|
|
92
|
+
}, [l, S]);
|
|
93
|
+
let k = E(T), P = A(T, { role: "menu" }), F = o(T, "container"), I = O(T, {
|
|
94
|
+
listRef: p,
|
|
95
|
+
activeIndex: d,
|
|
96
|
+
onNavigate: f,
|
|
97
|
+
loop: !0,
|
|
98
|
+
orientation: "vertical",
|
|
99
|
+
disabledIndices: (e) => g.current.has(e),
|
|
100
|
+
focusItemOnOpen: !0
|
|
101
|
+
}), L = j(T, {
|
|
102
|
+
listRef: m,
|
|
103
|
+
activeIndex: d,
|
|
104
|
+
onMatch: l ? f : void 0,
|
|
105
|
+
resetMs: M
|
|
106
|
+
}), { getReferenceProps: R, getFloatingProps: z, getItemProps: B } = D([
|
|
107
|
+
k,
|
|
108
|
+
P,
|
|
109
|
+
...F,
|
|
110
|
+
I,
|
|
111
|
+
L
|
|
112
|
+
]), V = y(() => ({
|
|
113
|
+
open: l,
|
|
114
|
+
nodeId: s,
|
|
115
|
+
requestOpen: () => {
|
|
116
|
+
_.current = !1, u(!0);
|
|
117
|
+
},
|
|
118
|
+
requestClose: (e = !1) => {
|
|
119
|
+
_.current = e, u(!1);
|
|
120
|
+
},
|
|
121
|
+
activeIndex: d,
|
|
122
|
+
refs: S,
|
|
123
|
+
floatingContext: T,
|
|
124
|
+
floatingStyles: w,
|
|
125
|
+
elementsRef: p,
|
|
126
|
+
labelsRef: m,
|
|
127
|
+
disabledIndices: g.current,
|
|
128
|
+
getReferenceProps: R,
|
|
129
|
+
getFloatingProps: z,
|
|
130
|
+
getItemProps: B
|
|
131
|
+
}), [
|
|
132
|
+
l,
|
|
133
|
+
s,
|
|
134
|
+
u,
|
|
135
|
+
d,
|
|
136
|
+
S,
|
|
137
|
+
T,
|
|
138
|
+
w,
|
|
139
|
+
R,
|
|
140
|
+
z,
|
|
141
|
+
B
|
|
142
|
+
]);
|
|
143
|
+
return /* @__PURE__ */ C(N.Provider, {
|
|
144
|
+
value: V,
|
|
145
|
+
children: c
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function W(e) {
|
|
149
|
+
return /* @__PURE__ */ C(c, { children: (t) => /* @__PURE__ */ C(te, {
|
|
150
|
+
...e,
|
|
151
|
+
nodeId: t
|
|
152
|
+
}) });
|
|
153
|
+
}
|
|
154
|
+
function G(e) {
|
|
155
|
+
return /* @__PURE__ */ C(W, { ...e });
|
|
156
|
+
}
|
|
157
|
+
G.displayName = "Menu";
|
|
158
|
+
function K({ family: e, marker: n, styles: r, ref: i, className: a, sx: o, ...s }) {
|
|
159
|
+
let { refs: c, getReferenceProps: l } = F(e, "Trigger"), u = k([c.setReference, i]);
|
|
160
|
+
return /* @__PURE__ */ C(t, {
|
|
161
|
+
className: a,
|
|
162
|
+
styles: r,
|
|
163
|
+
sx: o,
|
|
164
|
+
children: (e) => /* @__PURE__ */ C("button", {
|
|
165
|
+
type: "button",
|
|
166
|
+
...R(s, l),
|
|
167
|
+
ref: u,
|
|
168
|
+
"data-ui": n,
|
|
169
|
+
className: e
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function q(e) {
|
|
174
|
+
return /* @__PURE__ */ C(K, {
|
|
175
|
+
...e,
|
|
176
|
+
family: "Menu",
|
|
177
|
+
marker: "menu-trigger",
|
|
178
|
+
styles: a
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
q.displayName = "Menu.Trigger";
|
|
182
|
+
function J({ family: e, marker: n, styles: r, ref: i, style: a, children: o, className: c, sx: l, "aria-label": u, "aria-labelledby": d, defaultLabelledBy: f, ...p }) {
|
|
183
|
+
let { open: h, nodeId: g, refs: _, floatingContext: v, floatingStyles: y, elementsRef: b, labelsRef: x, getFloatingProps: S } = F(e, "Content"), E = k([_.setFloating, i]);
|
|
184
|
+
if (!h) return null;
|
|
185
|
+
let D = S(p), O = f ?? D["aria-labelledby"], A = d === void 0 ? u === void 0 ? O : void 0 : z(d, O);
|
|
186
|
+
return /* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(w, {
|
|
187
|
+
context: v,
|
|
188
|
+
modal: !1,
|
|
189
|
+
initialFocus: -1,
|
|
190
|
+
returnFocus: !1,
|
|
191
|
+
restoreFocus: !0,
|
|
192
|
+
children: /* @__PURE__ */ C(t, {
|
|
193
|
+
className: c,
|
|
194
|
+
styles: r,
|
|
195
|
+
sx: l,
|
|
196
|
+
children: (e) => /* @__PURE__ */ C("div", {
|
|
197
|
+
...D,
|
|
198
|
+
"aria-label": u,
|
|
199
|
+
"aria-labelledby": A,
|
|
200
|
+
ref: E,
|
|
201
|
+
"data-ui": n,
|
|
202
|
+
style: {
|
|
203
|
+
...a,
|
|
204
|
+
...y
|
|
205
|
+
},
|
|
206
|
+
className: e,
|
|
207
|
+
children: /* @__PURE__ */ C(T, {
|
|
208
|
+
elementsRef: b,
|
|
209
|
+
labelsRef: x,
|
|
210
|
+
children: /* @__PURE__ */ C(P.Provider, {
|
|
211
|
+
value: !0,
|
|
212
|
+
children: /* @__PURE__ */ C(s, {
|
|
213
|
+
nodeId: g,
|
|
214
|
+
children: o
|
|
215
|
+
})
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
|
+
})
|
|
220
|
+
}) });
|
|
221
|
+
}
|
|
222
|
+
function Y(e) {
|
|
223
|
+
return /* @__PURE__ */ C(J, {
|
|
224
|
+
...e,
|
|
225
|
+
family: "Menu",
|
|
226
|
+
marker: "menu",
|
|
227
|
+
styles: [u, l]
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
Y.displayName = "Menu.Content";
|
|
231
|
+
function X({ family: e, marker: n, styles: r, ref: i, onSelect: a, disabled: o = !1, part: s = "Item", itemRole: c = "menuitem", closeOnSelect: l = !0, onClick: u, className: d, sx: m, ...h }) {
|
|
232
|
+
let { activeIndex: g, requestClose: _, disabledIndices: v, getItemProps: y } = I(e, s), { ref: b, index: x } = f({ label: o ? null : void 0 }), S = k([b, i]), w = x !== -1 && g === x;
|
|
233
|
+
p(x, o, v);
|
|
234
|
+
let T = (e) => {
|
|
235
|
+
o || (u?.(e), a?.(), l && !e.defaultPrevented && _(!0));
|
|
236
|
+
};
|
|
237
|
+
return /* @__PURE__ */ C(t, {
|
|
238
|
+
className: d,
|
|
239
|
+
styles: r,
|
|
240
|
+
sx: m,
|
|
241
|
+
children: (e) => /* @__PURE__ */ C("button", {
|
|
242
|
+
type: "button",
|
|
243
|
+
...y({
|
|
244
|
+
...h,
|
|
245
|
+
onClick: T
|
|
246
|
+
}),
|
|
247
|
+
ref: S,
|
|
248
|
+
role: c,
|
|
249
|
+
tabIndex: w ? 0 : -1,
|
|
250
|
+
"aria-disabled": o || void 0,
|
|
251
|
+
"data-active": w || void 0,
|
|
252
|
+
"data-ui": n,
|
|
253
|
+
className: e
|
|
254
|
+
})
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
function Z(e) {
|
|
258
|
+
return /* @__PURE__ */ C(X, {
|
|
259
|
+
...e,
|
|
260
|
+
family: "Menu",
|
|
261
|
+
marker: "menu-item",
|
|
262
|
+
styles: H
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
Z.displayName = "Menu.Item";
|
|
266
|
+
function Q({ marker: e, styles: n, ref: r, className: i, sx: a, ...o }) {
|
|
267
|
+
return /* @__PURE__ */ C(t, {
|
|
268
|
+
className: i,
|
|
269
|
+
styles: n,
|
|
270
|
+
sx: a,
|
|
271
|
+
children: (t) => /* @__PURE__ */ C("div", {
|
|
272
|
+
...o,
|
|
273
|
+
ref: r,
|
|
274
|
+
role: "separator",
|
|
275
|
+
"data-ui": e,
|
|
276
|
+
className: t
|
|
277
|
+
})
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
function $(e) {
|
|
281
|
+
return /* @__PURE__ */ C(Q, {
|
|
282
|
+
...e,
|
|
283
|
+
marker: "menu-separator",
|
|
284
|
+
styles: V
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
$.displayName = "Menu.Separator";
|
|
288
|
+
var ne = Object.assign(G, {
|
|
289
|
+
Trigger: q,
|
|
290
|
+
Content: Y,
|
|
291
|
+
Item: Z,
|
|
292
|
+
Separator: $
|
|
293
|
+
});
|
|
294
|
+
//#endregion
|
|
295
|
+
export { Q as a, H as c, F as d, X as i, ee as l, J as n, K as o, W as r, R as s, ne as t, U as u };
|
package/dist/menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Menu } from "./menu-
|
|
2
|
+
export { t as Menu } from "./menu-DDKgmK2F.js";
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as r } from "./renderable-DzcIj1Lo.js";
|
|
5
|
+
import { t as i } from "./card-Ca4KQKYQ.js";
|
|
6
|
+
import { t as a } from "./pill-BaS-uIbn.js";
|
|
7
|
+
import { useId as o } from "react";
|
|
8
|
+
import { vars as s } from "@jfrader/tokens/vars";
|
|
9
|
+
import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
|
|
10
|
+
//#region src/components/metric-card/metric-card.tsx
|
|
11
|
+
var u = e({ minInlineSize: 0 }), d = e({
|
|
12
|
+
display: "grid",
|
|
13
|
+
gap: s.space[2],
|
|
14
|
+
overflowWrap: "anywhere"
|
|
15
|
+
}), f = e({
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexWrap: "wrap",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "space-between",
|
|
20
|
+
gap: s.space[2],
|
|
21
|
+
minInlineSize: 0
|
|
22
|
+
}), p = e({
|
|
23
|
+
margin: 0,
|
|
24
|
+
minInlineSize: 0,
|
|
25
|
+
fontSize: s.textSize.sm,
|
|
26
|
+
fontWeight: s.fontWeight.semibold,
|
|
27
|
+
lineHeight: s.lineHeight.base,
|
|
28
|
+
color: s.color.text
|
|
29
|
+
}), m = e({
|
|
30
|
+
minInlineSize: 0,
|
|
31
|
+
fontFamily: s.font.sans,
|
|
32
|
+
fontSize: s.textSize["3xl"],
|
|
33
|
+
fontWeight: s.fontWeight.semibold,
|
|
34
|
+
lineHeight: s.lineHeight.tight,
|
|
35
|
+
fontVariantNumeric: "tabular-nums"
|
|
36
|
+
}), h = e({
|
|
37
|
+
gap: s.space[1],
|
|
38
|
+
minInlineSize: 0,
|
|
39
|
+
maxInlineSize: "100%",
|
|
40
|
+
blockSize: "auto",
|
|
41
|
+
minBlockSize: s.space[5],
|
|
42
|
+
paddingBlock: s.space[1],
|
|
43
|
+
whiteSpace: "normal",
|
|
44
|
+
lineHeight: s.lineHeight.base,
|
|
45
|
+
border: "1px solid transparent",
|
|
46
|
+
[n]: { borderColor: "CanvasText" }
|
|
47
|
+
}), g = e({
|
|
48
|
+
margin: 0,
|
|
49
|
+
minInlineSize: 0,
|
|
50
|
+
fontSize: s.textSize.sm,
|
|
51
|
+
lineHeight: s.lineHeight.base,
|
|
52
|
+
color: s.color.textMuted
|
|
53
|
+
});
|
|
54
|
+
function _({ ref: e, label: n, value: s, description: _, headingLevel: v = 3, variant: y = "raised", locale: b, formatOptions: x, unitLabel: S, delta: C, deltaFormatOptions: w, deltaTone: T = "neutral", deltaDescription: E, loading: D = !1, missingValueLabel: O = "Unavailable", slotProps: k, className: A, sx: j, role: M, "aria-labelledby": N, "aria-describedby": P, "aria-busy": F, ...I }) {
|
|
55
|
+
let L = `${o()}-label`, R = `${o()}-description`, z = r(n) && n !== "", B = r(_) && _ !== "", V = C !== void 0 && Number.isFinite(C) ? C === 0 ? 0 : C : void 0, H = V === 0 ? "unchanged" : V !== void 0 && V > 0 ? "up" : "down", U = `h${v}`, W = s !== null && Number.isFinite(s), G = W ? new Intl.NumberFormat(b, x).format(s) : O, K = V === void 0 ? void 0 : new Intl.NumberFormat(b, {
|
|
56
|
+
...w,
|
|
57
|
+
signDisplay: V === 0 ? "exceptZero" : "always"
|
|
58
|
+
}).format(V);
|
|
59
|
+
return /* @__PURE__ */ c(t, {
|
|
60
|
+
className: A,
|
|
61
|
+
styles: u,
|
|
62
|
+
sx: j,
|
|
63
|
+
children: (t) => /* @__PURE__ */ c("div", {
|
|
64
|
+
...I,
|
|
65
|
+
ref: e,
|
|
66
|
+
role: M,
|
|
67
|
+
className: t,
|
|
68
|
+
"data-ui": "metric-card",
|
|
69
|
+
"aria-busy": D || F,
|
|
70
|
+
"aria-labelledby": [N, M === "region" && z && L].filter(Boolean).join(" ") || void 0,
|
|
71
|
+
"aria-describedby": [P, B && R].filter(Boolean).join(" ") || void 0,
|
|
72
|
+
children: /* @__PURE__ */ l(i, {
|
|
73
|
+
variant: y,
|
|
74
|
+
className: k?.surface?.className,
|
|
75
|
+
css: [d, k?.surface?.css],
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ l("div", {
|
|
78
|
+
"data-ui": "metric-card-header",
|
|
79
|
+
className: k?.header?.className,
|
|
80
|
+
css: [f, k?.header?.css],
|
|
81
|
+
children: [z && /* @__PURE__ */ c(U, {
|
|
82
|
+
id: L,
|
|
83
|
+
"data-ui": "metric-card-label",
|
|
84
|
+
className: k?.label?.className,
|
|
85
|
+
css: [p, k?.label?.css],
|
|
86
|
+
children: n
|
|
87
|
+
}), V !== void 0 && /* @__PURE__ */ l(a, {
|
|
88
|
+
tone: T,
|
|
89
|
+
"data-direction": H,
|
|
90
|
+
className: k?.delta?.className,
|
|
91
|
+
css: [h, k?.delta?.css],
|
|
92
|
+
children: [/* @__PURE__ */ c("span", {
|
|
93
|
+
"aria-hidden": "true",
|
|
94
|
+
children: V === 0 ? "↔" : V > 0 ? "↑" : "↓"
|
|
95
|
+
}), /* @__PURE__ */ l("span", { children: [K, E ? ` ${E}` : ""] })]
|
|
96
|
+
})]
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ l("div", {
|
|
99
|
+
"data-ui": "metric-card-value",
|
|
100
|
+
className: k?.value?.className,
|
|
101
|
+
css: [m, k?.value?.css],
|
|
102
|
+
children: [G, W && S ? ` ${S}` : ""]
|
|
103
|
+
}),
|
|
104
|
+
B && /* @__PURE__ */ c("p", {
|
|
105
|
+
id: R,
|
|
106
|
+
"data-ui": "metric-card-description",
|
|
107
|
+
className: k?.description?.className,
|
|
108
|
+
css: [g, k?.description?.css],
|
|
109
|
+
children: _
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
_.displayName = "MetricCard";
|
|
117
|
+
//#endregion
|
|
118
|
+
export { _ as t };
|