@jfrader/ui 0.5.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/dist/accordion-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{announcement-bar-B58xempt.js → announcement-bar-Dlbq5-9D.js} +1 -1
- package/dist/announcement-bar.js +1 -1
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/{avatar-group-DOQQuV51.js → avatar-group-M1opAQEG.js} +1 -1
- package/dist/avatar-group.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-DjZOPq4k.js} +10 -9
- package/dist/bottom-sheet.js +1 -1
- package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-BDK_LiwH.js} +10 -3
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-C92uYFJW.js → button-NLY0h6EJ.js} +7 -7
- package/dist/button.js +1 -1
- package/dist/{calendar-B3Svu0X2.js → calendar-BzJdv_SZ.js} +3 -1
- 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 +1 -1
- package/dist/{checkbox-cFquiSdy.js → checkbox-DKSzExj2.js} +16 -15
- package/dist/checkbox.js +1 -1
- package/dist/{chip-group-DTQd_M-G.js → chip-group-DjQ0_6Y9.js} +2 -1
- package/dist/chip-group.js +1 -1
- package/dist/{code-block-ahnRi-g8.js → code-block-B5we2lZa.js} +75 -74
- package/dist/code-block.js +1 -1
- package/dist/{combobox-Bhzvu9ma.js → combobox-DFFqOBCi.js} +114 -109
- 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-ByiA6D3R.js → copy-button-DCSLcYS-.js} +1 -1
- package/dist/copy-button.js +1 -1
- package/dist/{date-picker-5zKSSuFF.js → date-picker-BiPN7yeK.js} +4 -4
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{dialog-ciiv9H2b.js → dialog-BX1zYMs-.js} +2 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/{expandable-card-C-qJcZ14.js → expandable-card-rUATve0o.js} +8 -1
- package/dist/expandable-card.js +1 -1
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +1 -1
- package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-Cy5Hqur-.js} +4 -2
- package/dist/filter-toolbar.js +1 -1
- package/dist/{hover-card-B-nrCIy2.js → hover-card-CoMJKg1g.js} +7 -7
- package/dist/hover-card.js +1 -1
- package/dist/{image-compare-ciuhPtQZ.js → image-compare-BxY8Ykzt.js} +1 -1
- package/dist/image-compare.js +1 -1
- package/dist/index.js +81 -76
- package/dist/{json-viewer-BcySQfjZ.js → json-viewer-DgWqyU75.js} +7 -3
- package/dist/json-viewer.js +1 -1
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +1 -1
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/{metric-card-Bh9K4fZs.js → metric-card--lVTz5Wn.js} +2 -2
- package/dist/metric-card.js +1 -1
- package/dist/{multi-select-Pce_IYnz.js → multi-select-DG1BCFX7.js} +14 -6
- package/dist/multi-select.js +1 -1
- package/dist/{navigation-sP5fiuQS.js → navigation-CC26JDr-.js} +20 -14
- package/dist/navigation.js +1 -1
- package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
- package/dist/{pagination-DmXZ8E85.js → pagination-BfkeWbmP.js} +23 -22
- package/dist/pagination.js +1 -1
- 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-CbOWBUdA.js → progress-DAQkfhPd.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-cards-D2QZENI_.js → radio-cards-Cu9cBssN.js} +35 -34
- package/dist/radio-cards.js +1 -1
- package/dist/{radio-group-E6mMRgo7.js → radio-group-TIK0-iPX.js} +18 -15
- package/dist/radio-group.js +1 -1
- package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-DUpQEpwG.js} +3 -2
- package/dist/resizable-panels.js +1 -1
- package/dist/{search-field-IxF0IJXm.js → search-field-DMvho0KQ.js} +2 -2
- package/dist/search-field.js +1 -1
- package/dist/{segmented-control-yO1K1nbi.js → segmented-control-8ZUGnsZm.js} +2 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{select-n_H52W1Z.js → select-D5rhJ8gi.js} +3 -2
- package/dist/select.js +1 -1
- package/dist/{signature-pad-q2SAsrdD.js → signature-pad-_bTeguN9.js} +256 -251
- package/dist/signature-pad.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +1 -1
- package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-CYKT_Ng7.js} +2 -2
- package/dist/sortable-data-table.js +1 -1
- package/dist/{split-button-Cb3EHs64.js → split-button-BCw4zZom.js} +75 -81
- package/dist/split-button.js +1 -1
- package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-CBuJREU1.js} +4 -2
- package/dist/swipe-actions.js +1 -1
- 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/{text-field-C8TWG-tY.js → text-field-hU72iSVS.js} +15 -13
- package/dist/text-field.js +1 -1
- package/dist/{textarea-BrW0XcG_.js → textarea-3k4Y0QQ3.js} +18 -16
- 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-Db8D49cP.js → time-picker-CPlhW0tr.js} +26 -20
- package/dist/time-picker.js +1 -1
- package/dist/{timeline-k3nURuCP.js → timeline-B0uAAVfT.js} +8 -2
- package/dist/timeline.js +1 -1
- package/dist/{toast-BHxI32ZA.js → toast-B7wo3sX1.js} +98 -79
- package/dist/{toast-stack-DqrAzdg5.js → toast-stack-B40VpS4M.js} +18 -4
- package/dist/toast-stack.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-fcjzpifI.js → toggle-group-B2fpFZwV.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-C2liIxqy.js → tree-view-j8qLqkb_.js} +5 -1
- package/dist/tree-view.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- 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/date-range-picker/date-range-picker.d.ts +1 -1
- 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/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/menu/menu.d.ts +50 -7
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +2 -10
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/split-button/split-button.d.ts +2 -2
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- 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/tooltip/tooltip.d.ts +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/overlay/overlay-layer.d.ts +20 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
- package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +22 -2
- package/dist/accordion-xCI_u0BV.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/carousel-IvPqN-oM.js +0 -472
- package/dist/command-palette-BQ5LleGb.js +0 -384
- package/dist/date-range-picker-B5uFWsm-.js +0 -562
- package/dist/file-dropzone-pR4v7owg.js +0 -457
- package/dist/mention-input-BcQKX2EJ.js +0 -599
- package/dist/menu-xwOOUtWP.js +0 -275
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-QHcEvf9c.js +0 -119
- package/dist/slider-t0B5cecO.js +0 -477
- package/dist/switch-qwv8jQnR.js +0 -142
- package/dist/tabs-CAVJndX1.js +0 -203
- package/dist/tooltip-CkeiW9C1.js +0 -113
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as a } from "./use-latest-callback-cj1OOQL6.js";
|
|
5
|
+
import { t as o } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
+
import { t as s } from "./renderable-DzcIj1Lo.js";
|
|
7
|
+
import { t as c } from "./icon-wrapper-stN8sD7R.js";
|
|
8
|
+
import { t as l } from "./trigger-style-B1KVC8O1.js";
|
|
9
|
+
import { s as u } from "./listbox-style-WX-RASp1.js";
|
|
10
|
+
import { a as d, c as f, d as p, i as m, l as h, n as g, r as _, s as v, u as y } from "./menu-DDKgmK2F.js";
|
|
11
|
+
import { createContext as b, useCallback as x, useContext as S, useEffect as C, useId as w, useLayoutEffect as T, useMemo as ee, useRef as E, useState as D } from "react";
|
|
12
|
+
import { vars as O } from "@jfrader/tokens/vars";
|
|
13
|
+
import { Fragment as te, jsx as k, jsxs as A } from "@emotion/react/jsx-runtime";
|
|
14
|
+
import { useMergeRefs as j } from "@floating-ui/react";
|
|
15
|
+
import { isEventTargetWithin as ne } from "@floating-ui/react/utils";
|
|
16
|
+
//#region src/components/context-menu/context-menu.tsx
|
|
17
|
+
var M = "ContextMenu", N = "13rem", P = "300px", re = 4, F = "--context-menu-origin", I = "--context-menu-available-inline", L = "--context-menu-available-block", R = b(null);
|
|
18
|
+
function z(e) {
|
|
19
|
+
let t = S(R);
|
|
20
|
+
if (!t) throw Error(`${M}.${e} must be rendered inside <${M}>.`);
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
var B = (e) => {
|
|
24
|
+
let { x: t, y: n, width: r, height: i } = e.getBoundingClientRect();
|
|
25
|
+
return {
|
|
26
|
+
x: t,
|
|
27
|
+
y: n,
|
|
28
|
+
width: r,
|
|
29
|
+
height: i
|
|
30
|
+
};
|
|
31
|
+
}, V = (e) => getComputedStyle(e).direction === "rtl", H = (e) => {
|
|
32
|
+
let t = B(e);
|
|
33
|
+
return {
|
|
34
|
+
...t,
|
|
35
|
+
x: V(e) ? t.x + t.width : t.x,
|
|
36
|
+
width: 0
|
|
37
|
+
};
|
|
38
|
+
}, U = (e, t) => ({
|
|
39
|
+
x: e,
|
|
40
|
+
y: t,
|
|
41
|
+
width: 0,
|
|
42
|
+
height: 0
|
|
43
|
+
}), ie = (e) => e.nativeEvent.pointerType === "" || e.clientX === 0 && e.clientY === 0, ae = (e) => e.key === "ContextMenu" || e.key === "F10" && e.shiftKey, oe = (e) => e.key === "Enter" || e.key === " ", se = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWith("aria-"))), ce = e({
|
|
44
|
+
from: {
|
|
45
|
+
opacity: 0,
|
|
46
|
+
scale: "0.98"
|
|
47
|
+
},
|
|
48
|
+
to: {
|
|
49
|
+
opacity: 1,
|
|
50
|
+
scale: "1"
|
|
51
|
+
}
|
|
52
|
+
}), le = t({
|
|
53
|
+
label: "context-menu-target",
|
|
54
|
+
"&:focus-visible": {
|
|
55
|
+
outline: `2px solid ${O.color.focusRing}`,
|
|
56
|
+
outlineOffset: "2px"
|
|
57
|
+
}
|
|
58
|
+
}), ue = t({
|
|
59
|
+
label: "context-menu",
|
|
60
|
+
borderColor: O.color.borderControl,
|
|
61
|
+
inlineSize: N,
|
|
62
|
+
minInlineSize: 0,
|
|
63
|
+
maxInlineSize: `var(${I}, ${N})`,
|
|
64
|
+
maxBlockSize: `min(${P}, var(${L}, ${P}))`,
|
|
65
|
+
overflowY: "auto",
|
|
66
|
+
overscrollBehavior: "contain",
|
|
67
|
+
fontSize: O.textSize.sm,
|
|
68
|
+
transformOrigin: `var(${F}, top left)`,
|
|
69
|
+
animation: `${ce} ${O.motion.duration.base} ${O.motion.easeStandard}`,
|
|
70
|
+
"&:focus-visible": {
|
|
71
|
+
outline: `2px solid ${O.color.focusRing}`,
|
|
72
|
+
outlineOffset: "2px"
|
|
73
|
+
},
|
|
74
|
+
[i]: { animation: "none" },
|
|
75
|
+
[r]: { borderColor: "ButtonText" }
|
|
76
|
+
}), W = t({
|
|
77
|
+
gap: O.space[2],
|
|
78
|
+
lineHeight: O.lineHeight.base,
|
|
79
|
+
[r]: { "&[data-active]": {
|
|
80
|
+
outline: "2px solid Highlight",
|
|
81
|
+
outlineOffset: "-2px"
|
|
82
|
+
} }
|
|
83
|
+
}), de = t({
|
|
84
|
+
flex: 1,
|
|
85
|
+
minInlineSize: 0,
|
|
86
|
+
overflowWrap: "anywhere"
|
|
87
|
+
}), fe = t({
|
|
88
|
+
boxSizing: "border-box",
|
|
89
|
+
display: "inline-flex",
|
|
90
|
+
alignItems: "center",
|
|
91
|
+
justifyContent: "center",
|
|
92
|
+
flexShrink: 0,
|
|
93
|
+
inlineSize: "1rem",
|
|
94
|
+
blockSize: "1rem",
|
|
95
|
+
border: `1px solid ${O.color.borderControl}`,
|
|
96
|
+
borderRadius: O.radius.sm,
|
|
97
|
+
"& svg": {
|
|
98
|
+
inlineSize: "0.75rem",
|
|
99
|
+
blockSize: "0.75rem",
|
|
100
|
+
visibility: "hidden"
|
|
101
|
+
},
|
|
102
|
+
"&[data-state=\"checked\"] svg": { visibility: "visible" },
|
|
103
|
+
[r]: { borderColor: "ButtonText" }
|
|
104
|
+
}), pe = /* @__PURE__ */ k("svg", {
|
|
105
|
+
viewBox: "0 0 16 16",
|
|
106
|
+
fill: "none",
|
|
107
|
+
stroke: "currentColor",
|
|
108
|
+
strokeWidth: "2",
|
|
109
|
+
strokeLinecap: "round",
|
|
110
|
+
strokeLinejoin: "round",
|
|
111
|
+
children: /* @__PURE__ */ k("path", { d: "M3.5 8.5l3 3 6-7" })
|
|
112
|
+
});
|
|
113
|
+
function me({ available: e, children: t }) {
|
|
114
|
+
let { open: n, refs: r, requestOpen: i, requestClose: o } = p(M, "Root"), s = E(null), c = E(null), l = E(!1), [u, d] = D(null), [f, m] = D(), [h, g] = D(), _ = a(() => o(!1)), v = x((e, t) => {
|
|
115
|
+
r.setReference(e), r.setPositionReference({
|
|
116
|
+
getBoundingClientRect: () => DOMRect.fromRect(t),
|
|
117
|
+
contextElement: e
|
|
118
|
+
}), d(t), l.current = !0, queueMicrotask(() => l.current = !1);
|
|
119
|
+
}, [r]);
|
|
120
|
+
T(() => {
|
|
121
|
+
if (!n) return;
|
|
122
|
+
let e = s.current;
|
|
123
|
+
e && (m(V(e) ? "rtl" : "ltr"), l.current || v(e, H(e)));
|
|
124
|
+
}, [n, v]), C(() => {
|
|
125
|
+
let e = r.domReference.current;
|
|
126
|
+
if (!n || !e) return;
|
|
127
|
+
let t = e.ownerDocument, i = t.defaultView, a = !1, o = (e) => {
|
|
128
|
+
a || e.type === "scroll" && ne(e, r.floating.current) || (a = !0, _());
|
|
129
|
+
};
|
|
130
|
+
return t.addEventListener("scroll", o, {
|
|
131
|
+
capture: !0,
|
|
132
|
+
passive: !0
|
|
133
|
+
}), i?.addEventListener("resize", o), () => {
|
|
134
|
+
t.removeEventListener("scroll", o, { capture: !0 }), i?.removeEventListener("resize", o);
|
|
135
|
+
};
|
|
136
|
+
}, [
|
|
137
|
+
n,
|
|
138
|
+
r,
|
|
139
|
+
_
|
|
140
|
+
]);
|
|
141
|
+
let y = ee(() => ({
|
|
142
|
+
targetRef: s,
|
|
143
|
+
triggerRef: c,
|
|
144
|
+
anchorTo: v,
|
|
145
|
+
invoke: (e, t) => {
|
|
146
|
+
v(e, t), i();
|
|
147
|
+
},
|
|
148
|
+
anchor: u,
|
|
149
|
+
available: e,
|
|
150
|
+
direction: f,
|
|
151
|
+
targetLabel: h,
|
|
152
|
+
setTargetLabel: g
|
|
153
|
+
}), [
|
|
154
|
+
v,
|
|
155
|
+
i,
|
|
156
|
+
u,
|
|
157
|
+
e,
|
|
158
|
+
f,
|
|
159
|
+
h
|
|
160
|
+
]);
|
|
161
|
+
return /* @__PURE__ */ k(R.Provider, {
|
|
162
|
+
value: y,
|
|
163
|
+
children: t
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function G({ open: e, defaultOpen: t = !1, onOpenChange: n, children: r }) {
|
|
167
|
+
let [i, a] = D();
|
|
168
|
+
return /* @__PURE__ */ k(_, {
|
|
169
|
+
open: e,
|
|
170
|
+
defaultOpen: t,
|
|
171
|
+
onOpenChange: n,
|
|
172
|
+
placement: "bottom-start",
|
|
173
|
+
positioning: {
|
|
174
|
+
strategy: "fixed",
|
|
175
|
+
gap: re,
|
|
176
|
+
transform: !1,
|
|
177
|
+
onAvailableSize: (e) => a((t) => t?.width === e.width && t.height === e.height ? t : e)
|
|
178
|
+
},
|
|
179
|
+
children: /* @__PURE__ */ k(me, {
|
|
180
|
+
available: i,
|
|
181
|
+
children: r
|
|
182
|
+
})
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
G.displayName = "ContextMenu";
|
|
186
|
+
function K({ ref: e, id: t, openOnClick: r = !1, disabled: i = !1, "aria-labelledby": a, className: o, sx: s, ...c }) {
|
|
187
|
+
let l = z("Target"), { open: u, refs: d, requestClose: f, getReferenceProps: m } = p(M, "Target"), h = w(), g = t ?? h, _ = j([l.targetRef, e]), { setTargetLabel: y, triggerRef: b } = l;
|
|
188
|
+
T(() => (y(a ?? g), () => y(void 0)), [
|
|
189
|
+
a,
|
|
190
|
+
g,
|
|
191
|
+
y
|
|
192
|
+
]);
|
|
193
|
+
let x = (e) => b.current?.contains(e.target) ?? !1, S = i ? {} : {
|
|
194
|
+
...se(m()),
|
|
195
|
+
onContextMenu: (e) => {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
let t = e.currentTarget;
|
|
198
|
+
l.invoke(t, ie(e) ? H(t) : U(e.clientX, e.clientY));
|
|
199
|
+
},
|
|
200
|
+
onKeyDown: (e) => {
|
|
201
|
+
let t = r && oe(e) && e.target === e.currentTarget;
|
|
202
|
+
(ae(e) || t) && (e.preventDefault(), l.invoke(e.currentTarget, H(e.currentTarget)));
|
|
203
|
+
},
|
|
204
|
+
onMouseDown: (e) => {
|
|
205
|
+
u && e.button === 2 && e.preventDefault();
|
|
206
|
+
},
|
|
207
|
+
onPointerDown: (e) => {
|
|
208
|
+
!u || r || e.button !== 0 || e.ctrlKey || d.domReference.current !== e.currentTarget || x(e) || f(!1);
|
|
209
|
+
},
|
|
210
|
+
onClick: r ? (e) => {
|
|
211
|
+
e.detail === 0 || x(e) || l.invoke(e.currentTarget, U(e.clientX, e.clientY));
|
|
212
|
+
} : void 0
|
|
213
|
+
};
|
|
214
|
+
return /* @__PURE__ */ k(n, {
|
|
215
|
+
className: o,
|
|
216
|
+
styles: le,
|
|
217
|
+
sx: s,
|
|
218
|
+
children: (e) => /* @__PURE__ */ k("div", {
|
|
219
|
+
role: "group",
|
|
220
|
+
tabIndex: 0,
|
|
221
|
+
...v(c, (e) => ({
|
|
222
|
+
...e,
|
|
223
|
+
...S
|
|
224
|
+
})),
|
|
225
|
+
ref: _,
|
|
226
|
+
id: g,
|
|
227
|
+
"aria-labelledby": a,
|
|
228
|
+
"data-ui": "context-menu-target",
|
|
229
|
+
"data-disabled": i || void 0,
|
|
230
|
+
className: e
|
|
231
|
+
})
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
K.displayName = "ContextMenu.Target";
|
|
235
|
+
function q({ ref: e, id: t, className: r, sx: i, ...a }) {
|
|
236
|
+
let o = z("Trigger"), { open: s, getReferenceProps: c } = p(M, "Trigger"), u = w(), d = j([o.triggerRef, e]), f = (e) => (t) => {
|
|
237
|
+
s || o.anchorTo(t.currentTarget, B(t.currentTarget)), typeof e == "function" && e(t);
|
|
238
|
+
}, m = (e) => {
|
|
239
|
+
let t = c(e);
|
|
240
|
+
return {
|
|
241
|
+
...t,
|
|
242
|
+
onClick: f(t.onClick),
|
|
243
|
+
onKeyDown: f(t.onKeyDown)
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
return /* @__PURE__ */ k(n, {
|
|
247
|
+
className: r,
|
|
248
|
+
styles: l,
|
|
249
|
+
sx: i,
|
|
250
|
+
children: (e) => /* @__PURE__ */ k("button", {
|
|
251
|
+
type: "button",
|
|
252
|
+
...v(a, m),
|
|
253
|
+
ref: d,
|
|
254
|
+
id: t ?? u,
|
|
255
|
+
"data-ui": "context-menu-trigger",
|
|
256
|
+
className: e
|
|
257
|
+
})
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
q.displayName = "ContextMenu.Trigger";
|
|
261
|
+
function J({ ref: e, style: t, dir: n, onKeyDown: r, ...i }) {
|
|
262
|
+
let { anchor: a, available: o, direction: s, targetLabel: c } = z("Content"), { floatingContext: l, refs: d } = p(M, "Content"), [f, m] = D(null), h = j([m, e]);
|
|
263
|
+
C(() => {
|
|
264
|
+
f && !f.querySelector("[role^=\"menuitem\"]:not([aria-disabled=\"true\"])") && f.focus({ preventScroll: !0 });
|
|
265
|
+
}, [f]);
|
|
266
|
+
let { x: _, y: v, placement: y } = l, b = n ?? s, x = a && `${(b === "rtl" ? a.x + a.width : a.x) - _}px ${(y.startsWith("top") ? a.y : a.y + a.height) - v}px`, S = {
|
|
267
|
+
[F]: x || void 0,
|
|
268
|
+
[I]: o ? `${o.width}px` : void 0,
|
|
269
|
+
[L]: o ? `${o.height}px` : void 0
|
|
270
|
+
};
|
|
271
|
+
return /* @__PURE__ */ k(g, {
|
|
272
|
+
...i,
|
|
273
|
+
ref: h,
|
|
274
|
+
dir: b,
|
|
275
|
+
style: {
|
|
276
|
+
...t,
|
|
277
|
+
...S
|
|
278
|
+
},
|
|
279
|
+
onKeyDown: (e) => {
|
|
280
|
+
r?.(e);
|
|
281
|
+
let t = d.domReference.current;
|
|
282
|
+
!e.defaultPrevented && e.key === "Tab" && e.shiftKey && t && (e.preventDefault(), t.focus());
|
|
283
|
+
},
|
|
284
|
+
defaultLabelledBy: c,
|
|
285
|
+
family: M,
|
|
286
|
+
marker: "context-menu",
|
|
287
|
+
styles: [u, ue]
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
J.displayName = "ContextMenu.Content";
|
|
291
|
+
var Y = (e) => s(e) && e !== "";
|
|
292
|
+
function X({ icon: e, children: t }) {
|
|
293
|
+
return /* @__PURE__ */ A(te, { children: [Y(e) && /* @__PURE__ */ k("span", {
|
|
294
|
+
css: c,
|
|
295
|
+
"aria-hidden": !0,
|
|
296
|
+
"data-ui": "context-menu-item-icon",
|
|
297
|
+
children: e
|
|
298
|
+
}), Y(t) && /* @__PURE__ */ k("span", {
|
|
299
|
+
css: de,
|
|
300
|
+
children: t
|
|
301
|
+
})] });
|
|
302
|
+
}
|
|
303
|
+
function Z({ tone: e = "neutral", icon: t, children: n, ...r }) {
|
|
304
|
+
return z("Item"), /* @__PURE__ */ k(m, {
|
|
305
|
+
...r,
|
|
306
|
+
part: "Item",
|
|
307
|
+
family: M,
|
|
308
|
+
marker: "context-menu-item",
|
|
309
|
+
styles: [
|
|
310
|
+
f,
|
|
311
|
+
W,
|
|
312
|
+
h[e]
|
|
313
|
+
],
|
|
314
|
+
children: /* @__PURE__ */ k(X, {
|
|
315
|
+
icon: t,
|
|
316
|
+
children: n
|
|
317
|
+
})
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
Z.displayName = "ContextMenu.Item";
|
|
321
|
+
function Q({ value: e, defaultValue: t = !1, onValueChange: n, onSelect: r, closeOnSelect: i = !1, tone: a = "neutral", icon: s, children: c, ...l }) {
|
|
322
|
+
z("CheckboxItem");
|
|
323
|
+
let [u = !1, d] = o(e, t, n);
|
|
324
|
+
return /* @__PURE__ */ A(m, {
|
|
325
|
+
...l,
|
|
326
|
+
"aria-checked": u,
|
|
327
|
+
onSelect: () => {
|
|
328
|
+
d(!u), r?.();
|
|
329
|
+
},
|
|
330
|
+
itemRole: "menuitemcheckbox",
|
|
331
|
+
closeOnSelect: i,
|
|
332
|
+
part: "CheckboxItem",
|
|
333
|
+
family: M,
|
|
334
|
+
marker: "context-menu-checkbox-item",
|
|
335
|
+
styles: [
|
|
336
|
+
f,
|
|
337
|
+
W,
|
|
338
|
+
h[a]
|
|
339
|
+
],
|
|
340
|
+
children: [/* @__PURE__ */ k("span", {
|
|
341
|
+
css: fe,
|
|
342
|
+
"aria-hidden": !0,
|
|
343
|
+
"data-state": u ? "checked" : "unchecked",
|
|
344
|
+
"data-ui": "context-menu-check",
|
|
345
|
+
children: pe
|
|
346
|
+
}), /* @__PURE__ */ k(X, {
|
|
347
|
+
icon: s,
|
|
348
|
+
children: c
|
|
349
|
+
})]
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
Q.displayName = "ContextMenu.CheckboxItem";
|
|
353
|
+
function $(e) {
|
|
354
|
+
return z("Separator"), /* @__PURE__ */ k(d, {
|
|
355
|
+
...e,
|
|
356
|
+
marker: "context-menu-separator",
|
|
357
|
+
styles: y
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
$.displayName = "ContextMenu.Separator";
|
|
361
|
+
var he = Object.assign(G, {
|
|
362
|
+
Target: K,
|
|
363
|
+
Trigger: q,
|
|
364
|
+
Content: J,
|
|
365
|
+
Item: Z,
|
|
366
|
+
CheckboxItem: Q,
|
|
367
|
+
Separator: $
|
|
368
|
+
});
|
|
369
|
+
//#endregion
|
|
370
|
+
export { he as t };
|
|
@@ -5,7 +5,7 @@ import { t as r } from "./use-controlled-state-DpeVQZNR.js";
|
|
|
5
5
|
import { t as i } from "./visually-hidden-BJdvqqvn.js";
|
|
6
6
|
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
7
7
|
import { t as o } from "./loading-ring-B8-30Dl1.js";
|
|
8
|
-
import { t as ee } from "./button-
|
|
8
|
+
import { t as ee } from "./button-NLY0h6EJ.js";
|
|
9
9
|
import { useEffect as s, useRef as c, useState as l } from "react";
|
|
10
10
|
import { vars as u } from "@jfrader/tokens/vars";
|
|
11
11
|
import { Fragment as d, jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
|
package/dist/copy-button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as CopyButton } from "./copy-button-
|
|
2
|
+
export { t as CopyButton } from "./copy-button-DCSLcYS-.js";
|
|
@@ -3,11 +3,11 @@ import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
|
3
3
|
import { t as n } from "./use-controlled-state-DpeVQZNR.js";
|
|
4
4
|
import { t as r } from "./renderable-DzcIj1Lo.js";
|
|
5
5
|
import { n as i } from "./surface-DZ4d-2aL.js";
|
|
6
|
-
import { t as a } from "./overlay-layer-
|
|
7
|
-
import { t as o } from "./calendar-
|
|
6
|
+
import { t as a } from "./overlay-layer-qEbpEtb8.js";
|
|
7
|
+
import { t as o } from "./calendar-BzJdv_SZ.js";
|
|
8
8
|
import { t as s } from "./overlay-portal-C4JZFq2M.js";
|
|
9
|
-
import { t as c } from "./use-overlay-floating-
|
|
10
|
-
import { t as l } from "./text-field-
|
|
9
|
+
import { t as c } from "./use-overlay-floating-Bx2jBKAA.js";
|
|
10
|
+
import { t as l } from "./text-field-hU72iSVS.js";
|
|
11
11
|
import { createContext as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
12
12
|
import { vars as v } from "@jfrader/tokens/vars";
|
|
13
13
|
import { jsx as y, jsxs as b } from "@emotion/react/jsx-runtime";
|
package/dist/date-picker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as DatePicker } from "./date-picker-
|
|
2
|
+
export { t as DatePicker } from "./date-picker-BiPN7yeK.js";
|