@jfrader/ui 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{accordion-Bd-j04hW.js → accordion-xCI_u0BV.js} +2 -2
- 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-B58xempt.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-group-DOQQuV51.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/bottom-sheet-DPJBFkie.js +673 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-Cfw_hgt2.js} +1 -1
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-C92uYFJW.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-B3Svu0X2.js +447 -0
- package/dist/calendar.js +1 -1
- package/dist/carousel-IvPqN-oM.js +472 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-cFquiSdy.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DTQd_M-G.js +289 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-ahnRi-g8.js +292 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-Bhzvu9ma.js +334 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BQ5LleGb.js +384 -0
- package/dist/command-palette.js +1 -1
- package/dist/copy-button-ByiA6D3R.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-5zKSSuFF.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-B5uFWsm-.js +562 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-ciiv9H2b.js} +19 -19
- package/dist/dialog.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-C-qJcZ14.js +340 -0
- package/dist/expandable-card.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-pR4v7owg.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-D5KEKTSe.js +312 -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-B-nrCIy2.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-ciuhPtQZ.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +79 -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-BcySQfjZ.js +798 -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-BcQKX2EJ.js +599 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-xwOOUtWP.js +275 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card-Bh9K4fZs.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-Pce_IYnz.js +590 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-sP5fiuQS.js} +4 -4
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-SeUyyEPD.js +64 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-DmXZ8E85.js} +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/popover-QHcEvf9c.js +119 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-CbOWBUdA.js} +4 -4
- package/dist/progress.js +1 -1
- package/dist/radio-cards-D2QZENI_.js +455 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-E6mMRgo7.js} +4 -4
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-BhjUVXZZ.js +519 -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-IxF0IJXm.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-yO1K1nbi.js +326 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-n_H52W1Z.js +292 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-q2SAsrdD.js +640 -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-t0B5cecO.js +477 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-tirqlLY2.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-Cb3EHs64.js +268 -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-DiZC57-3.js +418 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/{switch-Dr-qjmT4.js → switch-qwv8jQnR.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tabs-CK_g1RKa.js → tabs-CAVJndX1.js} +2 -2
- 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-C8TWG-tY.js} +6 -5
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-BrW0XcG_.js} +6 -5
- package/dist/textarea.js +1 -1
- package/dist/time-picker-Db8D49cP.js +305 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-k3nURuCP.js +618 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-BHxI32ZA.js +352 -0
- package/dist/toast-stack-DqrAzdg5.js +183 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CkeiW9C1.js +113 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-C2liIxqy.js +360 -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/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 +1 -1
- 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/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/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 +23 -5
- 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/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/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.d.ts +70 -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/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -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 +1 -1
- 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 +40 -0
- package/dist/types/overlay/overlay-layer.d.ts +33 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
- 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-DvJifLpF.js +31 -0
- package/package.json +175 -3
- package/dist/calendar-C9Yad_-w.js +0 -394
- 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/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- 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
|
@@ -0,0 +1,275 @@
|
|
|
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 { t as o } from "./overlay-layer-SeUyyEPD.js";
|
|
8
|
+
import { s, t as c } from "./listbox-style-WX-RASp1.js";
|
|
9
|
+
import { i as l, n as u } from "./collection-registry-k6JcD3Jr.js";
|
|
10
|
+
import { t as d } from "./overlay-portal-C4JZFq2M.js";
|
|
11
|
+
import { t as f } from "./use-overlay-floating-DvJifLpF.js";
|
|
12
|
+
import { createContext as p, useContext as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
13
|
+
import { vars as y } from "@jfrader/tokens/vars";
|
|
14
|
+
import { jsx as b } from "@emotion/react/jsx-runtime";
|
|
15
|
+
import { FloatingFocusManager as x, FloatingList as S, useClick as C, useDismiss as w, useInteractions as T, useListNavigation as E, useMergeRefs as D, useRole as O, useTypeahead as k } from "@floating-ui/react";
|
|
16
|
+
//#region src/components/menu/menu.tsx
|
|
17
|
+
var A = 500, j = p(null), M = p(!1);
|
|
18
|
+
function N(e, t) {
|
|
19
|
+
let n = m(j);
|
|
20
|
+
if (!n) throw Error(`${e}.${t} must be rendered inside <${e}>.`);
|
|
21
|
+
return n;
|
|
22
|
+
}
|
|
23
|
+
function P(e) {
|
|
24
|
+
let t = N(e, "Item");
|
|
25
|
+
if (!m(M)) throw Error(`${e}.Item must be rendered inside <${e}.Content>.`);
|
|
26
|
+
return t;
|
|
27
|
+
}
|
|
28
|
+
var F = (e) => /^on[A-Z]/.test(e);
|
|
29
|
+
function I(e, t) {
|
|
30
|
+
let n = {}, r = {};
|
|
31
|
+
for (let [t, i] of Object.entries(e)) F(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 L = (...e) => e.filter(Boolean).join(" ") || void 0, R = e({
|
|
42
|
+
appearance: "none",
|
|
43
|
+
boxSizing: "border-box",
|
|
44
|
+
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
inlineSize: "100%",
|
|
47
|
+
minBlockSize: "32px",
|
|
48
|
+
border: 0,
|
|
49
|
+
borderRadius: y.radius.sm,
|
|
50
|
+
backgroundColor: "transparent",
|
|
51
|
+
paddingBlock: y.space[1],
|
|
52
|
+
paddingInline: y.space[2],
|
|
53
|
+
font: "inherit",
|
|
54
|
+
fontSize: y.textSize.sm,
|
|
55
|
+
color: y.color.text,
|
|
56
|
+
textAlign: "start",
|
|
57
|
+
cursor: "pointer",
|
|
58
|
+
transitionProperty: "background-color",
|
|
59
|
+
transitionDuration: y.motion.duration.fast,
|
|
60
|
+
transitionTimingFunction: y.motion.easeStandard,
|
|
61
|
+
"&:focus-visible": { ...n },
|
|
62
|
+
[r]: { transitionDuration: "0s" }
|
|
63
|
+
}), z = e({
|
|
64
|
+
blockSize: "1px",
|
|
65
|
+
marginBlock: y.space[1],
|
|
66
|
+
backgroundColor: y.color.border
|
|
67
|
+
}), B = [R, c], V = z;
|
|
68
|
+
function H({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: r = "bottom-start", children: a }) {
|
|
69
|
+
let [o = !1, s] = i(e, t, n), [c, l] = v(null), u = _([]), d = _([]), p = _(/* @__PURE__ */ new Set()), m = _(!1), { refs: y, floatingStyles: x, context: S } = f({
|
|
70
|
+
open: o,
|
|
71
|
+
placement: r,
|
|
72
|
+
onOpenChange: (e, t, n) => {
|
|
73
|
+
e || (m.current = n === "escape-key"), s(e);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
h(() => {
|
|
77
|
+
if (o || !m.current) return;
|
|
78
|
+
m.current = !1;
|
|
79
|
+
let e = y.domReference.current;
|
|
80
|
+
if (!e?.isConnected || e.closest("[inert]")) return;
|
|
81
|
+
let t = e.ownerDocument.activeElement;
|
|
82
|
+
t && t !== e.ownerDocument.body || e.focus();
|
|
83
|
+
}, [o, y]);
|
|
84
|
+
let D = C(S), M = O(S, { role: "menu" }), N = w(S, {
|
|
85
|
+
escapeKey: !0,
|
|
86
|
+
outsidePress: !0
|
|
87
|
+
}), P = E(S, {
|
|
88
|
+
listRef: u,
|
|
89
|
+
activeIndex: c,
|
|
90
|
+
onNavigate: l,
|
|
91
|
+
loop: !0,
|
|
92
|
+
orientation: "vertical",
|
|
93
|
+
disabledIndices: (e) => p.current.has(e),
|
|
94
|
+
focusItemOnOpen: !0
|
|
95
|
+
}), F = k(S, {
|
|
96
|
+
listRef: d,
|
|
97
|
+
activeIndex: c,
|
|
98
|
+
onMatch: o ? l : void 0,
|
|
99
|
+
resetMs: A
|
|
100
|
+
}), { getReferenceProps: I, getFloatingProps: L, getItemProps: R } = T([
|
|
101
|
+
D,
|
|
102
|
+
M,
|
|
103
|
+
N,
|
|
104
|
+
P,
|
|
105
|
+
F
|
|
106
|
+
]), z = g(() => ({
|
|
107
|
+
open: o,
|
|
108
|
+
requestClose: (e = !1) => {
|
|
109
|
+
e && (m.current = !0), s(!1);
|
|
110
|
+
},
|
|
111
|
+
activeIndex: c,
|
|
112
|
+
refs: y,
|
|
113
|
+
floatingContext: S,
|
|
114
|
+
floatingStyles: x,
|
|
115
|
+
elementsRef: u,
|
|
116
|
+
labelsRef: d,
|
|
117
|
+
disabledIndices: p.current,
|
|
118
|
+
getReferenceProps: I,
|
|
119
|
+
getFloatingProps: L,
|
|
120
|
+
getItemProps: R
|
|
121
|
+
}), [
|
|
122
|
+
o,
|
|
123
|
+
s,
|
|
124
|
+
c,
|
|
125
|
+
y,
|
|
126
|
+
S,
|
|
127
|
+
x,
|
|
128
|
+
I,
|
|
129
|
+
L,
|
|
130
|
+
R
|
|
131
|
+
]);
|
|
132
|
+
return /* @__PURE__ */ b(j.Provider, {
|
|
133
|
+
value: z,
|
|
134
|
+
children: a
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function U(e) {
|
|
138
|
+
return /* @__PURE__ */ b(o, { children: /* @__PURE__ */ b(H, { ...e }) });
|
|
139
|
+
}
|
|
140
|
+
U.displayName = "Menu";
|
|
141
|
+
function W({ family: e, marker: n, styles: r, ref: i, className: a, sx: o, ...s }) {
|
|
142
|
+
let { refs: c, getReferenceProps: l } = N(e, "Trigger"), u = D([c.setReference, i]);
|
|
143
|
+
return /* @__PURE__ */ b(t, {
|
|
144
|
+
className: a,
|
|
145
|
+
styles: r,
|
|
146
|
+
sx: o,
|
|
147
|
+
children: (e) => /* @__PURE__ */ b("button", {
|
|
148
|
+
type: "button",
|
|
149
|
+
...I(s, l),
|
|
150
|
+
ref: u,
|
|
151
|
+
"data-ui": n,
|
|
152
|
+
className: e
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function G(e) {
|
|
157
|
+
return /* @__PURE__ */ b(W, {
|
|
158
|
+
...e,
|
|
159
|
+
family: "Menu",
|
|
160
|
+
marker: "menu-trigger",
|
|
161
|
+
styles: a
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
G.displayName = "Menu.Trigger";
|
|
165
|
+
function K({ family: e, marker: n, styles: r, ref: i, style: a, children: o, className: s, sx: c, "aria-label": l, "aria-labelledby": u, ...f }) {
|
|
166
|
+
let { open: p, refs: m, floatingContext: h, floatingStyles: g, elementsRef: _, labelsRef: v, getFloatingProps: y } = N(e, "Content"), C = D([m.setFloating, i]);
|
|
167
|
+
if (!p) return null;
|
|
168
|
+
let w = y(f), T = w["aria-labelledby"], E = u === void 0 ? l === void 0 ? T : void 0 : L(u, T);
|
|
169
|
+
return /* @__PURE__ */ b(d, { children: /* @__PURE__ */ b(x, {
|
|
170
|
+
context: h,
|
|
171
|
+
modal: !1,
|
|
172
|
+
initialFocus: -1,
|
|
173
|
+
returnFocus: !1,
|
|
174
|
+
restoreFocus: !0,
|
|
175
|
+
children: /* @__PURE__ */ b(t, {
|
|
176
|
+
className: s,
|
|
177
|
+
styles: r,
|
|
178
|
+
sx: c,
|
|
179
|
+
children: (e) => /* @__PURE__ */ b("div", {
|
|
180
|
+
...w,
|
|
181
|
+
"aria-label": l,
|
|
182
|
+
"aria-labelledby": E,
|
|
183
|
+
ref: C,
|
|
184
|
+
"data-ui": n,
|
|
185
|
+
style: {
|
|
186
|
+
...a,
|
|
187
|
+
...g
|
|
188
|
+
},
|
|
189
|
+
className: e,
|
|
190
|
+
children: /* @__PURE__ */ b(S, {
|
|
191
|
+
elementsRef: _,
|
|
192
|
+
labelsRef: v,
|
|
193
|
+
children: /* @__PURE__ */ b(M.Provider, {
|
|
194
|
+
value: !0,
|
|
195
|
+
children: o
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
})
|
|
199
|
+
})
|
|
200
|
+
}) });
|
|
201
|
+
}
|
|
202
|
+
function q(e) {
|
|
203
|
+
return /* @__PURE__ */ b(K, {
|
|
204
|
+
...e,
|
|
205
|
+
family: "Menu",
|
|
206
|
+
marker: "menu",
|
|
207
|
+
styles: s
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
q.displayName = "Menu.Content";
|
|
211
|
+
function J({ family: e, marker: n, styles: r, ref: i, onSelect: a, disabled: o = !1, onClick: s, className: c, sx: d, ...f }) {
|
|
212
|
+
let { activeIndex: p, requestClose: m, disabledIndices: h, getItemProps: g } = P(e), { ref: _, index: v } = l({ label: o ? null : void 0 }), y = D([_, i]), x = v !== -1 && p === v;
|
|
213
|
+
u(v, o, h);
|
|
214
|
+
let S = (e) => {
|
|
215
|
+
o || (s?.(e), a?.(), e.defaultPrevented || m(!0));
|
|
216
|
+
};
|
|
217
|
+
return /* @__PURE__ */ b(t, {
|
|
218
|
+
className: c,
|
|
219
|
+
styles: r,
|
|
220
|
+
sx: d,
|
|
221
|
+
children: (e) => /* @__PURE__ */ b("button", {
|
|
222
|
+
type: "button",
|
|
223
|
+
...g({
|
|
224
|
+
...f,
|
|
225
|
+
onClick: S
|
|
226
|
+
}),
|
|
227
|
+
ref: y,
|
|
228
|
+
role: "menuitem",
|
|
229
|
+
tabIndex: x ? 0 : -1,
|
|
230
|
+
"aria-disabled": o || void 0,
|
|
231
|
+
"data-active": x || void 0,
|
|
232
|
+
"data-ui": n,
|
|
233
|
+
className: e
|
|
234
|
+
})
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function Y(e) {
|
|
238
|
+
return /* @__PURE__ */ b(J, {
|
|
239
|
+
...e,
|
|
240
|
+
family: "Menu",
|
|
241
|
+
marker: "menu-item",
|
|
242
|
+
styles: B
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
Y.displayName = "Menu.Item";
|
|
246
|
+
function X({ marker: e, styles: n, ref: r, className: i, sx: a, ...o }) {
|
|
247
|
+
return /* @__PURE__ */ b(t, {
|
|
248
|
+
className: i,
|
|
249
|
+
styles: n,
|
|
250
|
+
sx: a,
|
|
251
|
+
children: (t) => /* @__PURE__ */ b("div", {
|
|
252
|
+
...o,
|
|
253
|
+
ref: r,
|
|
254
|
+
role: "separator",
|
|
255
|
+
"data-ui": e,
|
|
256
|
+
className: t
|
|
257
|
+
})
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function Z(e) {
|
|
261
|
+
return /* @__PURE__ */ b(X, {
|
|
262
|
+
...e,
|
|
263
|
+
marker: "menu-separator",
|
|
264
|
+
styles: z
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
Z.displayName = "Menu.Separator";
|
|
268
|
+
var Q = Object.assign(U, {
|
|
269
|
+
Trigger: G,
|
|
270
|
+
Content: q,
|
|
271
|
+
Item: Y,
|
|
272
|
+
Separator: Z
|
|
273
|
+
});
|
|
274
|
+
//#endregion
|
|
275
|
+
export { W as a, X as i, K as n, B as o, J as r, V as s, Q as t };
|
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-xwOOUtWP.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-D-aI2QHx.js";
|
|
6
|
+
import { t as a } from "./pill-DO2gHzMb.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 };
|