@jfrader/ui 0.3.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/theme-root-BbTBuLMQ.js +46 -0
- package/dist/theme-root.js +1 -1
- package/dist/theme-scope-t7nAKc2c.js +27 -0
- 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/theme-root/theme-root.d.ts +9 -3
- 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/overlay-portal.d.ts +7 -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-scope.d.ts +19 -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-DrmjBbo7.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-ClUYBIBh.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-DU60SMdt.js +0 -216
- package/dist/popover-BtN_0ejj.js +0 -113
- package/dist/select-BCS0-LVW.js +0 -286
- package/dist/theme-root-BiXXvQvr.js +0 -42
- package/dist/toast-iqelR-r0.js +0 -282
- package/dist/tooltip-CB-HC1js.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-efeqppiw.js +0 -19
package/dist/select-BCS0-LVW.js
DELETED
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { t as n } from "./use-controlled-state-CVXDa-qM.js";
|
|
4
|
-
import { a as r, c as i, d as a, f as o, l as s, o as c, r as l, s as u, t as d, u as f } from "./collection-registry-BTYi6zGh.js";
|
|
5
|
-
import { t as p } from "./trigger-style-B1KVC8O1.js";
|
|
6
|
-
import { t as m } from "./use-overlay-floating-efeqppiw.js";
|
|
7
|
-
import { createContext as h, useContext as g, useId as _, useLayoutEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
8
|
-
import { vars as S } from "@jfrader/tokens/vars";
|
|
9
|
-
import { jsx as C, jsxs as w } from "@emotion/react/jsx-runtime";
|
|
10
|
-
import { FloatingList as T, FloatingPortal as E, useClick as D, useDismiss as O, useInteractions as k, useListNavigation as A, useMergeRefs as j, useRole as M } from "@floating-ui/react";
|
|
11
|
-
//#region src/components/select/select.tsx
|
|
12
|
-
var N = 500, P = new Intl.Collator(void 0, {
|
|
13
|
-
usage: "search",
|
|
14
|
-
sensitivity: "base"
|
|
15
|
-
}), F = "✓", I = h(null), L = h(!1);
|
|
16
|
-
function R(e) {
|
|
17
|
-
let t = g(I);
|
|
18
|
-
if (!t) throw Error(`Select.${e} must be rendered inside <Select>.`);
|
|
19
|
-
return t;
|
|
20
|
-
}
|
|
21
|
-
function z() {
|
|
22
|
-
let e = R("Item");
|
|
23
|
-
if (!g(L)) throw Error("Select.Item must be rendered inside <Select.Content>.");
|
|
24
|
-
return e;
|
|
25
|
-
}
|
|
26
|
-
var B = e({
|
|
27
|
-
justifyContent: "flex-start",
|
|
28
|
-
minInlineSize: "180px",
|
|
29
|
-
"&[aria-expanded=\"true\"]": { backgroundColor: S.color.surfaceHover }
|
|
30
|
-
}), V = e({
|
|
31
|
-
overflow: "hidden",
|
|
32
|
-
textOverflow: "ellipsis",
|
|
33
|
-
whiteSpace: "nowrap",
|
|
34
|
-
"&[data-placeholder]": { color: S.color.textMuted }
|
|
35
|
-
});
|
|
36
|
-
function H({ value: e, defaultValue: t, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, placement: c = "bottom-start", disabled: l = !1, name: u, children: d }) {
|
|
37
|
-
let f = _(), [p, h] = n(e, t, i), [g = !1, v] = n(a, o, s), [S, T] = x(null), [E, j] = x(!1), [N, F] = r(), [L, R] = x(null), z = b([]), B = b([]), V = b(null);
|
|
38
|
-
!g && E && (j(!1), T(null));
|
|
39
|
-
let { valuesByIndex: H, disabledIndices: U } = y(() => {
|
|
40
|
-
let e = [], t = /* @__PURE__ */ new Set();
|
|
41
|
-
return N.forEach((n, r) => {
|
|
42
|
-
n.index !== -1 && (e[n.index] = r, n.disabled && t.add(n.index));
|
|
43
|
-
}), {
|
|
44
|
-
valuesByIndex: e,
|
|
45
|
-
disabledIndices: t
|
|
46
|
-
};
|
|
47
|
-
}, [N]), W = p === void 0 ? void 0 : N.get(p), G = W && W.index !== -1 ? W.index : null, { refs: K, floatingStyles: q, context: J } = m({
|
|
48
|
-
open: g,
|
|
49
|
-
placement: c,
|
|
50
|
-
onOpenChange: (e) => v(e)
|
|
51
|
-
}), Y = D(J), X = M(J, { role: "listbox" }), ee = O(J, {
|
|
52
|
-
escapeKey: !0,
|
|
53
|
-
outsidePress: !0
|
|
54
|
-
}), te = A(J, {
|
|
55
|
-
listRef: z,
|
|
56
|
-
activeIndex: S,
|
|
57
|
-
onNavigate: T,
|
|
58
|
-
virtual: !0,
|
|
59
|
-
virtualItemRef: V,
|
|
60
|
-
loop: !0,
|
|
61
|
-
focusItemOnOpen: !0,
|
|
62
|
-
selectedIndex: E ? null : G,
|
|
63
|
-
disabledIndices: (e) => U.has(e)
|
|
64
|
-
}), { getReferenceProps: Z, getFloatingProps: Q, getItemProps: $ } = k([
|
|
65
|
-
Y,
|
|
66
|
-
X,
|
|
67
|
-
ee,
|
|
68
|
-
te
|
|
69
|
-
]), ne = y(() => {
|
|
70
|
-
let e = (e) => {
|
|
71
|
-
h(e), v(!1);
|
|
72
|
-
};
|
|
73
|
-
return {
|
|
74
|
-
baseId: f,
|
|
75
|
-
open: g,
|
|
76
|
-
disabled: l,
|
|
77
|
-
selectedValue: p,
|
|
78
|
-
activeIndex: S,
|
|
79
|
-
options: N,
|
|
80
|
-
triggerLabelling: L,
|
|
81
|
-
refs: K,
|
|
82
|
-
floatingStyles: q,
|
|
83
|
-
elementsRef: z,
|
|
84
|
-
labelsRef: B,
|
|
85
|
-
getReferenceProps: Z,
|
|
86
|
-
getFloatingProps: Q,
|
|
87
|
-
getItemProps: $,
|
|
88
|
-
selectValue: e,
|
|
89
|
-
matchTypeahead: (e) => {
|
|
90
|
-
let t = B.current, n = S ?? -1;
|
|
91
|
-
for (let r = 1; r <= t.length; r += 1) {
|
|
92
|
-
let i = (n + r) % t.length, a = t[i];
|
|
93
|
-
if (!(a == null || U.has(i)) && P.compare(a.slice(0, e.length), e) === 0) {
|
|
94
|
-
T(i), g || (j(!0), v(!0));
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
selectIndex: (t) => {
|
|
100
|
-
let n = H[t];
|
|
101
|
-
n === void 0 || U.has(t) || e(n);
|
|
102
|
-
},
|
|
103
|
-
requestOpenChange: v,
|
|
104
|
-
registration: F,
|
|
105
|
-
setTriggerLabelling: R
|
|
106
|
-
};
|
|
107
|
-
}, [
|
|
108
|
-
f,
|
|
109
|
-
g,
|
|
110
|
-
l,
|
|
111
|
-
p,
|
|
112
|
-
S,
|
|
113
|
-
N,
|
|
114
|
-
L,
|
|
115
|
-
K,
|
|
116
|
-
q,
|
|
117
|
-
Z,
|
|
118
|
-
Q,
|
|
119
|
-
$,
|
|
120
|
-
H,
|
|
121
|
-
U,
|
|
122
|
-
h,
|
|
123
|
-
v,
|
|
124
|
-
F
|
|
125
|
-
]);
|
|
126
|
-
return /* @__PURE__ */ w(I.Provider, {
|
|
127
|
-
value: ne,
|
|
128
|
-
children: [d, u !== void 0 && /* @__PURE__ */ C("input", {
|
|
129
|
-
type: "hidden",
|
|
130
|
-
name: u,
|
|
131
|
-
value: p ?? "",
|
|
132
|
-
disabled: l
|
|
133
|
-
})]
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
H.displayName = "Select";
|
|
137
|
-
function U({ ref: e, id: n, disabled: r, onKeyDown: i, className: a, sx: o, ...s }) {
|
|
138
|
-
let { baseId: c, open: l, disabled: u, activeIndex: d, refs: f, getReferenceProps: m, selectIndex: h, matchTypeahead: g, requestOpenChange: _, setTriggerLabelling: y } = R("Trigger"), x = j([f.setReference, e]), S = b({
|
|
139
|
-
search: "",
|
|
140
|
-
lastKeyAt: 0
|
|
141
|
-
}), w = n ?? `${c}-trigger`, T = s["aria-labelledby"], E = s["aria-label"];
|
|
142
|
-
v(() => (y({
|
|
143
|
-
id: w,
|
|
144
|
-
labelledBy: T,
|
|
145
|
-
label: E
|
|
146
|
-
}), () => y(null)), [
|
|
147
|
-
w,
|
|
148
|
-
T,
|
|
149
|
-
E,
|
|
150
|
-
y
|
|
151
|
-
]);
|
|
152
|
-
let D = (e) => {
|
|
153
|
-
if (i?.(e), !(e.defaultPrevented || u || r)) {
|
|
154
|
-
if (e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
|
155
|
-
let t = performance.now(), n = S.current, r = (t - n.lastKeyAt > N ? "" : n.search) + e.key;
|
|
156
|
-
S.current = {
|
|
157
|
-
search: r,
|
|
158
|
-
lastKeyAt: t
|
|
159
|
-
}, g(r);
|
|
160
|
-
} else l && (e.key === "Tab" ? _(!1) : (e.key === "Enter" || e.key === " ") && d !== null && (e.preventDefault(), h(d)));
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
return /* @__PURE__ */ C(t, {
|
|
164
|
-
className: a,
|
|
165
|
-
styles: [p, B],
|
|
166
|
-
sx: o,
|
|
167
|
-
children: (e) => /* @__PURE__ */ C("button", {
|
|
168
|
-
type: "button",
|
|
169
|
-
...m({
|
|
170
|
-
...s,
|
|
171
|
-
id: w,
|
|
172
|
-
disabled: u || r,
|
|
173
|
-
onKeyDown: D
|
|
174
|
-
}),
|
|
175
|
-
ref: x,
|
|
176
|
-
"data-state": l ? "open" : "closed",
|
|
177
|
-
"data-ui": "select-trigger",
|
|
178
|
-
className: e
|
|
179
|
-
})
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
U.displayName = "Select.Trigger";
|
|
183
|
-
function W({ ref: e, placeholder: n, className: r, sx: i, ...a }) {
|
|
184
|
-
let { selectedValue: o, options: s } = R("Value"), c = o === void 0 ? void 0 : s.get(o)?.label, l = c === void 0;
|
|
185
|
-
return /* @__PURE__ */ C(t, {
|
|
186
|
-
className: r,
|
|
187
|
-
styles: V,
|
|
188
|
-
sx: i,
|
|
189
|
-
children: (t) => /* @__PURE__ */ C("span", {
|
|
190
|
-
...a,
|
|
191
|
-
ref: e,
|
|
192
|
-
"data-placeholder": l || void 0,
|
|
193
|
-
"data-ui": "select-value",
|
|
194
|
-
className: t,
|
|
195
|
-
children: l ? n : c
|
|
196
|
-
})
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
W.displayName = "Select.Value";
|
|
200
|
-
function G({ ref: e, style: n, onMouseDown: r, children: i, className: s, sx: c, ...l }) {
|
|
201
|
-
let { open: u, triggerLabelling: d, refs: f, floatingStyles: p, elementsRef: m, getFloatingProps: h } = R("Content"), g = j([u ? f.setFloating : null, e]), _ = l["aria-labelledby"] !== void 0 || l["aria-label"] !== void 0 ? {} : d?.labelledBy === void 0 ? d?.label === void 0 ? { "aria-labelledby": d?.id } : { "aria-label": d.label } : { "aria-labelledby": d.labelledBy }, v = (e) => {
|
|
202
|
-
r?.(e), e.preventDefault();
|
|
203
|
-
};
|
|
204
|
-
return /* @__PURE__ */ C(E, { children: /* @__PURE__ */ C(t, {
|
|
205
|
-
className: s,
|
|
206
|
-
styles: [o, a],
|
|
207
|
-
sx: c,
|
|
208
|
-
children: (e) => /* @__PURE__ */ C("div", {
|
|
209
|
-
...h({
|
|
210
|
-
..._,
|
|
211
|
-
...l,
|
|
212
|
-
onMouseDown: v
|
|
213
|
-
}),
|
|
214
|
-
ref: g,
|
|
215
|
-
hidden: !u,
|
|
216
|
-
"data-state": u ? "open" : "closed",
|
|
217
|
-
"data-ui": "select-listbox",
|
|
218
|
-
style: {
|
|
219
|
-
...n,
|
|
220
|
-
...p
|
|
221
|
-
},
|
|
222
|
-
className: e,
|
|
223
|
-
children: /* @__PURE__ */ C(T, {
|
|
224
|
-
elementsRef: m,
|
|
225
|
-
children: /* @__PURE__ */ C(L.Provider, {
|
|
226
|
-
value: !0,
|
|
227
|
-
children: i
|
|
228
|
-
})
|
|
229
|
-
})
|
|
230
|
-
})
|
|
231
|
-
}) });
|
|
232
|
-
}
|
|
233
|
-
G.displayName = "Select.Content";
|
|
234
|
-
function K({ ref: e, value: n, disabled: r = !1, onClick: a, children: o, className: p, sx: m, ...h }) {
|
|
235
|
-
let { baseId: g, selectedValue: _, activeIndex: v, labelsRef: y, getItemProps: x, selectValue: S, registration: T } = z(), E = b(null), { ref: D, index: O } = l(n, T, E, (e, t) => ({
|
|
236
|
-
index: e,
|
|
237
|
-
label: t,
|
|
238
|
-
disabled: r
|
|
239
|
-
}), {
|
|
240
|
-
labelsRef: y,
|
|
241
|
-
include: !r
|
|
242
|
-
}), k = j([D, e]), A = O !== -1 && v === O, M = _ === n, N = (e) => {
|
|
243
|
-
a?.(e), !(r || e.defaultPrevented) && S(n);
|
|
244
|
-
};
|
|
245
|
-
return /* @__PURE__ */ C(t, {
|
|
246
|
-
className: p,
|
|
247
|
-
styles: [
|
|
248
|
-
u,
|
|
249
|
-
c,
|
|
250
|
-
s
|
|
251
|
-
],
|
|
252
|
-
sx: m,
|
|
253
|
-
children: (e) => /* @__PURE__ */ w("div", {
|
|
254
|
-
...x({
|
|
255
|
-
id: d(g, n),
|
|
256
|
-
...h,
|
|
257
|
-
onClick: N
|
|
258
|
-
}),
|
|
259
|
-
ref: k,
|
|
260
|
-
role: "option",
|
|
261
|
-
"aria-selected": M,
|
|
262
|
-
"aria-disabled": r || void 0,
|
|
263
|
-
"data-active": A || void 0,
|
|
264
|
-
"data-ui": "select-item",
|
|
265
|
-
className: e,
|
|
266
|
-
children: [/* @__PURE__ */ C("span", {
|
|
267
|
-
ref: E,
|
|
268
|
-
css: f,
|
|
269
|
-
children: o
|
|
270
|
-
}), M && /* @__PURE__ */ C("span", {
|
|
271
|
-
"aria-hidden": "true",
|
|
272
|
-
css: i,
|
|
273
|
-
children: F
|
|
274
|
-
})]
|
|
275
|
-
})
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
K.displayName = "Select.Item";
|
|
279
|
-
var q = Object.assign(H, {
|
|
280
|
-
Trigger: U,
|
|
281
|
-
Value: W,
|
|
282
|
-
Content: G,
|
|
283
|
-
Item: K
|
|
284
|
-
});
|
|
285
|
-
//#endregion
|
|
286
|
-
export { q as t };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { a as e, n as t, r as n, t as r } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { vars as i } from "@jfrader/tokens/vars";
|
|
4
|
-
import { jsx as a } from "@emotion/react/jsx-runtime";
|
|
5
|
-
//#region src/styling/theme.ts
|
|
6
|
-
var o = i;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/components/theme-provider/theme-provider.tsx
|
|
9
|
-
function s({ theme: e = o, children: n }) {
|
|
10
|
-
return /* @__PURE__ */ a(t, {
|
|
11
|
-
theme: e,
|
|
12
|
-
children: n
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
s.displayName = "ThemeProvider";
|
|
16
|
-
function c() {
|
|
17
|
-
return e();
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/components/theme-root/theme-root.tsx
|
|
21
|
-
var l = n({
|
|
22
|
-
color: i.color.text,
|
|
23
|
-
colorScheme: "dark",
|
|
24
|
-
"&[data-theme=\"light\"]": { colorScheme: "light" }
|
|
25
|
-
});
|
|
26
|
-
function u({ ref: e, theme: t, className: n, sx: i, ...o }) {
|
|
27
|
-
return /* @__PURE__ */ a(s, { children: /* @__PURE__ */ a(r, {
|
|
28
|
-
className: n,
|
|
29
|
-
styles: l,
|
|
30
|
-
sx: i,
|
|
31
|
-
children: (n) => /* @__PURE__ */ a("div", {
|
|
32
|
-
"data-ui": "theme-root",
|
|
33
|
-
"data-theme": t ?? "dark",
|
|
34
|
-
...o,
|
|
35
|
-
ref: e,
|
|
36
|
-
className: n
|
|
37
|
-
})
|
|
38
|
-
}) });
|
|
39
|
-
}
|
|
40
|
-
u.displayName = "ThemeRoot";
|
|
41
|
-
//#endregion
|
|
42
|
-
export { o as i, s as n, c as r, u as t };
|
package/dist/toast-iqelR-r0.js
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { n } from "./media-D_eA_I-e.js";
|
|
4
|
-
import { t as r } from "./renderable-DzcIj1Lo.js";
|
|
5
|
-
import { t as i } from "./button-P2e7_44z.js";
|
|
6
|
-
import { createContext as a, useCallback as o, useContext as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
7
|
-
import { vars as p } from "@jfrader/tokens/vars";
|
|
8
|
-
import { Fragment as m, jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
|
|
9
|
-
import { createPortal as _ } from "react-dom";
|
|
10
|
-
//#region src/components/toast/toast.tsx
|
|
11
|
-
var v = 4, y = 5e3, b = "Dismiss", x = 100, S = "min(380px, calc(100vw - 32px))", C = "3px", w = a(null), T = a(null), E = e({
|
|
12
|
-
position: "fixed",
|
|
13
|
-
insetBlockEnd: 0,
|
|
14
|
-
insetInlineEnd: 0,
|
|
15
|
-
display: "flex",
|
|
16
|
-
flexDirection: "column",
|
|
17
|
-
gap: p.space[2],
|
|
18
|
-
inlineSize: S,
|
|
19
|
-
margin: 0,
|
|
20
|
-
paddingInlineEnd: p.space[4],
|
|
21
|
-
paddingBlockEnd: p.space[4],
|
|
22
|
-
pointerEvents: "none",
|
|
23
|
-
fontFamily: p.font.sans
|
|
24
|
-
}), D = e({
|
|
25
|
-
boxSizing: "border-box",
|
|
26
|
-
display: "grid",
|
|
27
|
-
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
28
|
-
alignItems: "start",
|
|
29
|
-
gap: p.space[2],
|
|
30
|
-
backgroundColor: p.color.surfaceRaised,
|
|
31
|
-
border: `1px solid ${p.color.border}`,
|
|
32
|
-
borderRadius: p.radius.lg,
|
|
33
|
-
boxShadow: p.shadow.floating,
|
|
34
|
-
padding: p.space[3],
|
|
35
|
-
color: p.color.text,
|
|
36
|
-
lineHeight: p.lineHeight.base,
|
|
37
|
-
pointerEvents: "auto",
|
|
38
|
-
transitionProperty: "opacity, transform",
|
|
39
|
-
transitionDuration: p.motion.duration.base,
|
|
40
|
-
transitionTimingFunction: p.motion.easeStandard,
|
|
41
|
-
"&[data-populated=\"false\"]": { opacity: 0 },
|
|
42
|
-
"&[data-state=\"closing\"]": {
|
|
43
|
-
opacity: 0,
|
|
44
|
-
transform: `translateY(${p.space[2]})`,
|
|
45
|
-
pointerEvents: "none"
|
|
46
|
-
},
|
|
47
|
-
[n]: { transitionDuration: "0s" }
|
|
48
|
-
}), O = {
|
|
49
|
-
neutral: e({ borderInlineStart: `${C} solid ${p.color.borderStrong}` }),
|
|
50
|
-
success: e({ borderInlineStart: `${C} solid ${p.color.success}` }),
|
|
51
|
-
danger: e({ borderInlineStart: `${C} solid ${p.color.danger}` })
|
|
52
|
-
}, k = e({
|
|
53
|
-
display: "grid",
|
|
54
|
-
gap: p.space[1],
|
|
55
|
-
alignSelf: "center",
|
|
56
|
-
minInlineSize: 0
|
|
57
|
-
}), A = e({
|
|
58
|
-
margin: 0,
|
|
59
|
-
fontSize: p.textSize.sm,
|
|
60
|
-
fontWeight: p.fontWeight.semibold
|
|
61
|
-
}), j = e({
|
|
62
|
-
margin: 0,
|
|
63
|
-
fontSize: p.textSize.sm,
|
|
64
|
-
color: p.color.textMuted
|
|
65
|
-
}), M = e({
|
|
66
|
-
gridColumn: 2,
|
|
67
|
-
gridRow: 1,
|
|
68
|
-
inlineSize: "32px",
|
|
69
|
-
paddingInline: 0
|
|
70
|
-
}), N = e({ display: "contents" }), P = e({
|
|
71
|
-
gridColumn: "1 / -1",
|
|
72
|
-
display: "flex",
|
|
73
|
-
gap: p.space[2]
|
|
74
|
-
});
|
|
75
|
-
function F(e) {
|
|
76
|
-
let t = s(T);
|
|
77
|
-
if (!t) throw Error(`Toast.${e} must be rendered inside <Toast.Provider>.`);
|
|
78
|
-
return t;
|
|
79
|
-
}
|
|
80
|
-
function I() {
|
|
81
|
-
let e = s(w);
|
|
82
|
-
if (!e) throw Error("useToast() must be called inside <Toast.Provider>.");
|
|
83
|
-
return e;
|
|
84
|
-
}
|
|
85
|
-
function L({ children: e, max: t = v, duration: n = y, dismissLabel: r = b }) {
|
|
86
|
-
let i = l(), a = d(0), [s, c] = f([]), p = d([]), m = d(/* @__PURE__ */ new Map()), g = Math.max(1, Math.floor(Number.isFinite(t) ? t : v)), _ = o((e, t) => {
|
|
87
|
-
t ? m.current.set(e, t) : m.current.delete(e);
|
|
88
|
-
}, []), x = o((e, t) => {
|
|
89
|
-
let n = new Set(t.filter((e) => e.state === "open").map((e) => m.current.get(e.id)));
|
|
90
|
-
for (let t of e) {
|
|
91
|
-
let e = m.current.get(t.id);
|
|
92
|
-
if (e?.contains(e.ownerDocument.activeElement)) {
|
|
93
|
-
Array.from(e.parentElement?.querySelectorAll("[data-ui=\"toast\"]") ?? []).find((e) => n.has(e))?.querySelector("[data-toast-dismiss]")?.focus();
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}, []), S = o((e) => {
|
|
98
|
-
a.current += 1;
|
|
99
|
-
let t = `${i}toast-${a.current}`, r = {
|
|
100
|
-
id: t,
|
|
101
|
-
options: {
|
|
102
|
-
...e,
|
|
103
|
-
duration: e.duration === void 0 ? n : e.duration
|
|
104
|
-
},
|
|
105
|
-
state: "open"
|
|
106
|
-
}, o = p.current, s = [...o, r].slice(-g);
|
|
107
|
-
return x(o.filter((e) => !s.includes(e)), s), p.current = s, c(s), t;
|
|
108
|
-
}, [
|
|
109
|
-
i,
|
|
110
|
-
g,
|
|
111
|
-
n,
|
|
112
|
-
x
|
|
113
|
-
]), C = o((e) => {
|
|
114
|
-
let t = p.current;
|
|
115
|
-
x(t.filter((t) => t.id === e), t.filter((t) => t.id !== e));
|
|
116
|
-
let n = t.map((t) => t.id === e && t.state === "open" ? {
|
|
117
|
-
...t,
|
|
118
|
-
state: "closing"
|
|
119
|
-
} : t);
|
|
120
|
-
p.current = n, c(n);
|
|
121
|
-
}, [x]), E = o((e) => {
|
|
122
|
-
let t = p.current, n = t.filter((t) => t.id !== e);
|
|
123
|
-
x(t.filter((t) => t.id === e), n), p.current = n, c(n);
|
|
124
|
-
}, [x]), D = u(() => ({
|
|
125
|
-
toast: S,
|
|
126
|
-
dismiss: C
|
|
127
|
-
}), [S, C]), O = u(() => ({
|
|
128
|
-
toasts: s,
|
|
129
|
-
dismiss: C,
|
|
130
|
-
remove: E,
|
|
131
|
-
registerRoot: _,
|
|
132
|
-
dismissLabel: r
|
|
133
|
-
}), [
|
|
134
|
-
s,
|
|
135
|
-
C,
|
|
136
|
-
E,
|
|
137
|
-
_,
|
|
138
|
-
r
|
|
139
|
-
]);
|
|
140
|
-
return /* @__PURE__ */ h(w.Provider, {
|
|
141
|
-
value: D,
|
|
142
|
-
children: /* @__PURE__ */ h(T.Provider, {
|
|
143
|
-
value: O,
|
|
144
|
-
children: e
|
|
145
|
-
})
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
L.displayName = "Toast.Provider";
|
|
149
|
-
function R({ ref: e, className: n, sx: r, ...i }) {
|
|
150
|
-
let { toasts: a } = F("Viewport"), o = d(null), [s, l] = f(null);
|
|
151
|
-
return c(() => {
|
|
152
|
-
l(o.current?.ownerDocument.body ?? null);
|
|
153
|
-
}, []), /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
154
|
-
hidden: !0,
|
|
155
|
-
ref: o
|
|
156
|
-
}), s && _(/* @__PURE__ */ h(t, {
|
|
157
|
-
className: n,
|
|
158
|
-
styles: E,
|
|
159
|
-
sx: r,
|
|
160
|
-
children: (t) => /* @__PURE__ */ h("div", {
|
|
161
|
-
...i,
|
|
162
|
-
ref: e,
|
|
163
|
-
"data-ui": "toast-viewport",
|
|
164
|
-
className: t,
|
|
165
|
-
children: a.map((e) => /* @__PURE__ */ h(z, { record: e }, e.id))
|
|
166
|
-
})
|
|
167
|
-
}), s)] });
|
|
168
|
-
}
|
|
169
|
-
R.displayName = "Toast.Viewport";
|
|
170
|
-
function z({ record: e }) {
|
|
171
|
-
let { dismiss: t, remove: n, registerRoot: a, dismissLabel: s } = F("Viewport"), { id: l, options: u, state: p } = e, { title: _, description: v, tone: y = "neutral", action: b } = u, S = u.duration, C = d(null), w = o((e) => {
|
|
172
|
-
C.current = e, a(l, e);
|
|
173
|
-
}, [l, a]), [T, E] = f(!1), [I, L] = f(!1), [R, z] = f(!1), V = d(S ?? 0);
|
|
174
|
-
c(() => {
|
|
175
|
-
let e = setTimeout(() => E(!0), x);
|
|
176
|
-
return () => clearTimeout(e);
|
|
177
|
-
}, []);
|
|
178
|
-
let H = T && p === "open" && S !== null && !I && !R;
|
|
179
|
-
return c(() => {
|
|
180
|
-
if (!H) return;
|
|
181
|
-
let e = performance.now(), n = setTimeout(() => t(l), V.current);
|
|
182
|
-
return () => {
|
|
183
|
-
clearTimeout(n), V.current -= performance.now() - e;
|
|
184
|
-
};
|
|
185
|
-
}, [
|
|
186
|
-
H,
|
|
187
|
-
t,
|
|
188
|
-
l
|
|
189
|
-
]), c(() => {
|
|
190
|
-
if (p !== "closing") return;
|
|
191
|
-
let e = C.current, t = e && typeof e.getAnimations == "function" ? e.getAnimations() : [], r = !1;
|
|
192
|
-
return Promise.allSettled(t.map((e) => e.finished)).then(() => {
|
|
193
|
-
r || n(l);
|
|
194
|
-
}), () => {
|
|
195
|
-
r = !0;
|
|
196
|
-
};
|
|
197
|
-
}, [
|
|
198
|
-
p,
|
|
199
|
-
n,
|
|
200
|
-
l
|
|
201
|
-
]), /* @__PURE__ */ g("div", {
|
|
202
|
-
ref: w,
|
|
203
|
-
inert: p === "closing",
|
|
204
|
-
"data-ui": "toast",
|
|
205
|
-
"data-tone": y,
|
|
206
|
-
"data-state": p,
|
|
207
|
-
"data-populated": T,
|
|
208
|
-
onPointerEnter: () => L(!0),
|
|
209
|
-
onPointerLeave: () => L(!1),
|
|
210
|
-
onFocus: () => z(!0),
|
|
211
|
-
onBlur: (e) => {
|
|
212
|
-
e.currentTarget.contains(e.relatedTarget) || z(!1);
|
|
213
|
-
},
|
|
214
|
-
css: [D, O[y]],
|
|
215
|
-
children: [/* @__PURE__ */ h("div", {
|
|
216
|
-
role: y === "danger" ? "alert" : "status",
|
|
217
|
-
"aria-atomic": "true",
|
|
218
|
-
css: k,
|
|
219
|
-
children: T && /* @__PURE__ */ g(m, { children: [r(_) && /* @__PURE__ */ h("div", {
|
|
220
|
-
css: A,
|
|
221
|
-
children: _
|
|
222
|
-
}), r(v) && /* @__PURE__ */ h("div", {
|
|
223
|
-
css: j,
|
|
224
|
-
children: v
|
|
225
|
-
})] })
|
|
226
|
-
}), T && /* @__PURE__ */ g("div", {
|
|
227
|
-
css: N,
|
|
228
|
-
children: [/* @__PURE__ */ h(i, {
|
|
229
|
-
variant: "ghost",
|
|
230
|
-
size: "sm",
|
|
231
|
-
"aria-label": s,
|
|
232
|
-
"data-toast-dismiss": "",
|
|
233
|
-
onClick: () => t(l),
|
|
234
|
-
css: M,
|
|
235
|
-
children: /* @__PURE__ */ h(B, {})
|
|
236
|
-
}), b && /* @__PURE__ */ h("div", {
|
|
237
|
-
css: P,
|
|
238
|
-
children: /* @__PURE__ */ h(i, {
|
|
239
|
-
variant: "outline",
|
|
240
|
-
size: "sm",
|
|
241
|
-
onClick: (e) => {
|
|
242
|
-
b?.onClick(e), e.defaultPrevented || t(l);
|
|
243
|
-
},
|
|
244
|
-
children: b.label
|
|
245
|
-
})
|
|
246
|
-
})]
|
|
247
|
-
})]
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
function B() {
|
|
251
|
-
return /* @__PURE__ */ g("svg", {
|
|
252
|
-
"aria-hidden": "true",
|
|
253
|
-
viewBox: "0 0 16 16",
|
|
254
|
-
width: "16",
|
|
255
|
-
height: "16",
|
|
256
|
-
fill: "none",
|
|
257
|
-
stroke: "currentColor",
|
|
258
|
-
strokeWidth: "2",
|
|
259
|
-
strokeLinecap: "round",
|
|
260
|
-
children: [/* @__PURE__ */ h("line", {
|
|
261
|
-
x1: "4",
|
|
262
|
-
y1: "4",
|
|
263
|
-
x2: "12",
|
|
264
|
-
y2: "12"
|
|
265
|
-
}), /* @__PURE__ */ h("line", {
|
|
266
|
-
x1: "12",
|
|
267
|
-
y1: "4",
|
|
268
|
-
x2: "4",
|
|
269
|
-
y2: "12"
|
|
270
|
-
})]
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
function V(e) {
|
|
274
|
-
return /* @__PURE__ */ h(L, { ...e });
|
|
275
|
-
}
|
|
276
|
-
V.displayName = "Toast";
|
|
277
|
-
var H = Object.assign(V, {
|
|
278
|
-
Provider: L,
|
|
279
|
-
Viewport: R
|
|
280
|
-
});
|
|
281
|
-
//#endregion
|
|
282
|
-
export { I as n, H as t };
|
package/dist/tooltip-CB-HC1js.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { t as n } from "./use-controlled-state-CVXDa-qM.js";
|
|
4
|
-
import { t as r } from "./trigger-style-B1KVC8O1.js";
|
|
5
|
-
import { t as i } from "./use-overlay-floating-efeqppiw.js";
|
|
6
|
-
import { createContext as a, useContext as o, useMemo as s } from "react";
|
|
7
|
-
import { vars as c } from "@jfrader/tokens/vars";
|
|
8
|
-
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
9
|
-
import { FloatingPortal as u, useDismiss as d, useFocus as f, useHover as p, useInteractions as m, useMergeRefs as h, useRole as g } from "@floating-ui/react";
|
|
10
|
-
//#region src/components/tooltip/tooltip.tsx
|
|
11
|
-
var _ = 300, v = 100, y = a(null);
|
|
12
|
-
function b(e) {
|
|
13
|
-
let t = o(y);
|
|
14
|
-
if (!t) throw Error(`Tooltip.${e} must be rendered inside <Tooltip>.`);
|
|
15
|
-
return t;
|
|
16
|
-
}
|
|
17
|
-
var x = e({
|
|
18
|
-
boxSizing: "border-box",
|
|
19
|
-
backgroundColor: c.color.bgSoft,
|
|
20
|
-
border: `1px solid ${c.color.border}`,
|
|
21
|
-
borderRadius: c.radius.sm,
|
|
22
|
-
boxShadow: c.shadow.raised,
|
|
23
|
-
padding: `${c.space[1]} ${c.space[2]}`,
|
|
24
|
-
maxInlineSize: "260px",
|
|
25
|
-
color: c.color.text,
|
|
26
|
-
fontFamily: c.font.sans,
|
|
27
|
-
fontSize: c.textSize.sm,
|
|
28
|
-
lineHeight: c.lineHeight.base
|
|
29
|
-
});
|
|
30
|
-
function S({ open: e, defaultOpen: t = !1, onOpenChange: r, placement: a = "top", openDelay: o = _, closeDelay: c = v, children: u }) {
|
|
31
|
-
let [h = !1, b] = n(e, t, r), { refs: x, floatingStyles: S, context: C } = i({
|
|
32
|
-
open: h,
|
|
33
|
-
placement: a,
|
|
34
|
-
onOpenChange: b
|
|
35
|
-
}), w = p(C, {
|
|
36
|
-
delay: {
|
|
37
|
-
open: o,
|
|
38
|
-
close: c
|
|
39
|
-
},
|
|
40
|
-
move: !1
|
|
41
|
-
}), T = f(C), E = d(C, { escapeKey: !0 }), D = g(C, { role: "tooltip" }), { getReferenceProps: O, getFloatingProps: k } = m([
|
|
42
|
-
w,
|
|
43
|
-
T,
|
|
44
|
-
E,
|
|
45
|
-
D
|
|
46
|
-
]), A = s(() => ({
|
|
47
|
-
open: h,
|
|
48
|
-
refs: x,
|
|
49
|
-
floatingStyles: S,
|
|
50
|
-
getReferenceProps: O,
|
|
51
|
-
getFloatingProps: k
|
|
52
|
-
}), [
|
|
53
|
-
h,
|
|
54
|
-
x,
|
|
55
|
-
S,
|
|
56
|
-
O,
|
|
57
|
-
k
|
|
58
|
-
]);
|
|
59
|
-
return /* @__PURE__ */ l(y.Provider, {
|
|
60
|
-
value: A,
|
|
61
|
-
children: u
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
S.displayName = "Tooltip";
|
|
65
|
-
function C({ ref: e, "aria-describedby": n, className: i, sx: a, ...o }) {
|
|
66
|
-
let { refs: s, getReferenceProps: c } = b("Trigger"), u = h([s.setReference, e]), d = c(o), f = [n, d["aria-describedby"]].filter(Boolean).join(" ") || void 0;
|
|
67
|
-
return /* @__PURE__ */ l(t, {
|
|
68
|
-
className: i,
|
|
69
|
-
styles: r,
|
|
70
|
-
sx: a,
|
|
71
|
-
children: (e) => /* @__PURE__ */ l("button", {
|
|
72
|
-
type: "button",
|
|
73
|
-
...d,
|
|
74
|
-
ref: u,
|
|
75
|
-
"aria-describedby": f,
|
|
76
|
-
"data-ui": "tooltip-trigger",
|
|
77
|
-
className: e
|
|
78
|
-
})
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
C.displayName = "Tooltip.Trigger";
|
|
82
|
-
function w({ ref: e, style: n, className: r, sx: i, ...a }) {
|
|
83
|
-
let { open: o, refs: s, floatingStyles: c, getFloatingProps: d } = b("Content"), f = h([s.setFloating, e]);
|
|
84
|
-
if (!o) return null;
|
|
85
|
-
let { tabIndex: p, ...m } = d(a);
|
|
86
|
-
return /* @__PURE__ */ l(u, { children: /* @__PURE__ */ l(t, {
|
|
87
|
-
className: r,
|
|
88
|
-
styles: x,
|
|
89
|
-
sx: i,
|
|
90
|
-
children: (e) => /* @__PURE__ */ l("div", {
|
|
91
|
-
...m,
|
|
92
|
-
ref: f,
|
|
93
|
-
"data-ui": "tooltip",
|
|
94
|
-
style: {
|
|
95
|
-
...n,
|
|
96
|
-
...c
|
|
97
|
-
},
|
|
98
|
-
className: e
|
|
99
|
-
})
|
|
100
|
-
}) });
|
|
101
|
-
}
|
|
102
|
-
w.displayName = "Tooltip.Content";
|
|
103
|
-
var T = Object.assign(S, {
|
|
104
|
-
Trigger: C,
|
|
105
|
-
Content: w
|
|
106
|
-
});
|
|
107
|
-
//#endregion
|
|
108
|
-
export { T as t };
|