@jfrader/ui 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/accordion-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-Dlbq5-9D.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/avatar-group-M1opAQEG.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/bottom-sheet-DjZOPq4k.js +674 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/calendar-BzJdv_SZ.js +449 -0
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DjQ0_6Y9.js +290 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-B5we2lZa.js +293 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-DFFqOBCi.js +339 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/copy-button-DCSLcYS-.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-BiPN7yeK.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-rUATve0o.js +347 -0
- package/dist/expandable-card.js +2 -0
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-Cy5Hqur-.js +314 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-CoMJKg1g.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-BxY8Ykzt.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +84 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-DgWqyU75.js +802 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card--lVTz5Wn.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-DG1BCFX7.js +598 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-qEbpEtb8.js +78 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/radio-cards-Cu9cBssN.js +456 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-DUpQEpwG.js +520 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-DMvho0KQ.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-8ZUGnsZm.js +327 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-D5rhJ8gi.js +293 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-_bTeguN9.js +645 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-CYKT_Ng7.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-BCw4zZom.js +262 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-CBuJREU1.js +420 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-hU72iSVS.js} +20 -17
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/time-picker-CPlhW0tr.js +311 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-B0uAAVfT.js +624 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-B7wo3sX1.js +371 -0
- package/dist/toast-stack-B40VpS4M.js +197 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-j8qLqkb_.js +364 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +2 -2
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +68 -7
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +62 -0
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/overlay/overlay-layer.d.ts +53 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-Bx2jBKAA.js +33 -0
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +195 -3
- package/dist/accordion-Bd-j04hW.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/switch-Dr-qjmT4.js +0 -142
- package/dist/tabs-CK_g1RKa.js +0 -203
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n, r } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as i } from "./renderable-DzcIj1Lo.js";
|
|
5
|
+
import { t as a } from "./button-NLY0h6EJ.js";
|
|
6
|
+
import { i as o, t as s } from "./theme-scope-t7nAKc2c.js";
|
|
7
|
+
import { t as c } from "./spinner-DtxvDPdM.js";
|
|
8
|
+
import { createContext as l, useCallback as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
9
|
+
import { vars as v } from "@jfrader/tokens/vars";
|
|
10
|
+
import { Fragment as y, jsx as b, jsxs as x } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { createPortal as S } from "react-dom";
|
|
12
|
+
//#region src/components/toast/toast.tsx
|
|
13
|
+
var C = 4, w = 5e3, T = "Dismiss", E = 100, D = "min(380px, calc(100vw - 32px))", O = "3px", k = l(null), A = l(null), j = e({
|
|
14
|
+
position: "fixed",
|
|
15
|
+
insetBlockEnd: 0,
|
|
16
|
+
insetInlineEnd: 0,
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
gap: v.space[2],
|
|
20
|
+
inlineSize: D,
|
|
21
|
+
margin: 0,
|
|
22
|
+
paddingInlineEnd: v.space[4],
|
|
23
|
+
paddingBlockEnd: v.space[4],
|
|
24
|
+
pointerEvents: "none",
|
|
25
|
+
fontFamily: v.font.sans
|
|
26
|
+
}), M = e({
|
|
27
|
+
boxSizing: "border-box",
|
|
28
|
+
display: "grid",
|
|
29
|
+
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
30
|
+
alignItems: "start",
|
|
31
|
+
gap: v.space[2],
|
|
32
|
+
backgroundColor: v.color.surfaceRaised,
|
|
33
|
+
border: `1px solid ${v.color.border}`,
|
|
34
|
+
borderRadius: v.radius.lg,
|
|
35
|
+
boxShadow: v.shadow.floating,
|
|
36
|
+
padding: v.space[3],
|
|
37
|
+
color: v.color.text,
|
|
38
|
+
lineHeight: v.lineHeight.base,
|
|
39
|
+
pointerEvents: "auto",
|
|
40
|
+
transitionProperty: "opacity, transform",
|
|
41
|
+
transitionDuration: v.motion.duration.base,
|
|
42
|
+
transitionTimingFunction: v.motion.easeStandard,
|
|
43
|
+
"&[data-populated=\"false\"][data-exposed=\"true\"]": { opacity: 0 },
|
|
44
|
+
"&[data-state=\"closing\"]": {
|
|
45
|
+
opacity: 0,
|
|
46
|
+
transform: `translateY(${v.space[2]})`,
|
|
47
|
+
pointerEvents: "none"
|
|
48
|
+
},
|
|
49
|
+
[r]: {
|
|
50
|
+
transitionDuration: "0s",
|
|
51
|
+
"&[data-state=\"closing\"]": { transform: "none" }
|
|
52
|
+
},
|
|
53
|
+
[n]: {
|
|
54
|
+
backgroundColor: "Canvas",
|
|
55
|
+
color: "CanvasText",
|
|
56
|
+
borderColor: "CanvasText"
|
|
57
|
+
}
|
|
58
|
+
}), N = {
|
|
59
|
+
neutral: e({ borderInlineStart: `${O} solid ${v.color.borderStrong}` }),
|
|
60
|
+
success: e({ borderInlineStart: `${O} solid ${v.color.success}` }),
|
|
61
|
+
danger: e({ borderInlineStart: `${O} solid ${v.color.danger}` }),
|
|
62
|
+
info: e({ borderInlineStart: `${O} solid ${v.color.info}` }),
|
|
63
|
+
warning: e({ borderInlineStart: `${O} solid ${v.color.warning}` })
|
|
64
|
+
}, P = e({
|
|
65
|
+
display: "grid",
|
|
66
|
+
gap: v.space[1],
|
|
67
|
+
alignSelf: "center",
|
|
68
|
+
minInlineSize: 0,
|
|
69
|
+
overflowWrap: "anywhere"
|
|
70
|
+
}), F = e({
|
|
71
|
+
margin: 0,
|
|
72
|
+
fontSize: v.textSize.sm,
|
|
73
|
+
fontWeight: v.fontWeight.semibold
|
|
74
|
+
}), I = e({
|
|
75
|
+
margin: 0,
|
|
76
|
+
fontSize: v.textSize.sm,
|
|
77
|
+
color: v.color.textMuted
|
|
78
|
+
}), L = e({
|
|
79
|
+
gridColumn: 2,
|
|
80
|
+
gridRow: 1,
|
|
81
|
+
inlineSize: "32px",
|
|
82
|
+
paddingInline: 0
|
|
83
|
+
}), R = e({ display: "contents" }), z = e({
|
|
84
|
+
gridColumn: "1 / -1",
|
|
85
|
+
display: "flex",
|
|
86
|
+
gap: v.space[2]
|
|
87
|
+
}), B = e({
|
|
88
|
+
minInlineSize: 0,
|
|
89
|
+
maxInlineSize: "100%",
|
|
90
|
+
blockSize: "auto",
|
|
91
|
+
minBlockSize: "32px",
|
|
92
|
+
paddingBlock: v.space[2],
|
|
93
|
+
whiteSpace: "normal",
|
|
94
|
+
overflowWrap: "anywhere"
|
|
95
|
+
});
|
|
96
|
+
function V(e) {
|
|
97
|
+
let t = d(A);
|
|
98
|
+
if (!t) throw Error(`Toast.${e} must be rendered inside <Toast.Provider>.`);
|
|
99
|
+
return t;
|
|
100
|
+
}
|
|
101
|
+
function H() {
|
|
102
|
+
let e = d(k);
|
|
103
|
+
if (!e) throw Error("useToast() must be called inside <Toast.Provider>.");
|
|
104
|
+
return e;
|
|
105
|
+
}
|
|
106
|
+
function U({ children: e, max: t = C, duration: n = w, dismissLabel: r = T }) {
|
|
107
|
+
let i = p(), a = g(0), [o, s] = _([]), c = g([]), l = g(!0), d = g(/* @__PURE__ */ new Map()), f = g(null), v = g(0);
|
|
108
|
+
m(() => (l.current = !0, () => {
|
|
109
|
+
l.current = !1;
|
|
110
|
+
}), []);
|
|
111
|
+
let y = u(() => (v.current += 1, process.env.NODE_ENV !== "production" && v.current > 1 && console.warn("Mount only one Toast queue renderer per provider."), () => {
|
|
112
|
+
--v.current;
|
|
113
|
+
}), []), x = Math.max(1, Math.floor(Number.isFinite(t) ? t : C)), S = u((e, t) => {
|
|
114
|
+
t ? d.current.set(e, t) : d.current.delete(e);
|
|
115
|
+
}, []), E = u((e, t) => {
|
|
116
|
+
for (let n of e) {
|
|
117
|
+
let e = d.current.get(n.id);
|
|
118
|
+
if (!e?.contains(e.ownerDocument.activeElement)) continue;
|
|
119
|
+
let r = e.closest("[data-ui=\"toast-stack-list\"], [data-ui=\"toast-viewport\"]") ?? e.parentElement;
|
|
120
|
+
r && (f.current = {
|
|
121
|
+
container: r,
|
|
122
|
+
ids: new Set(t.filter((e) => e.state === "open").map((e) => e.id))
|
|
123
|
+
});
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}, []);
|
|
127
|
+
m(() => {
|
|
128
|
+
let e = f.current;
|
|
129
|
+
e && (f.current = null, Array.from(e.container.querySelectorAll("[data-ui=\"toast\"]")).find((t) => e.ids.has(t.dataset.toastId))?.querySelector("[data-toast-dismiss]")?.focus());
|
|
130
|
+
}, [o]);
|
|
131
|
+
let D = u((e) => {
|
|
132
|
+
a.current += 1;
|
|
133
|
+
let t = `${i}toast-${a.current}`;
|
|
134
|
+
if (!l.current) return t;
|
|
135
|
+
let r = {
|
|
136
|
+
id: t,
|
|
137
|
+
options: {
|
|
138
|
+
...e,
|
|
139
|
+
duration: e.duration === void 0 ? e.loading ? null : n : e.duration
|
|
140
|
+
},
|
|
141
|
+
state: "open"
|
|
142
|
+
}, o = c.current, u = [...o, r].slice(-x);
|
|
143
|
+
return E(o.filter((e) => !u.includes(e)), u), c.current = u, s(u), t;
|
|
144
|
+
}, [
|
|
145
|
+
i,
|
|
146
|
+
x,
|
|
147
|
+
n,
|
|
148
|
+
E
|
|
149
|
+
]), O = u((e, t) => {
|
|
150
|
+
if (!l.current) return;
|
|
151
|
+
let r = c.current.map((r) => {
|
|
152
|
+
if (r.id !== e || r.state !== "open") return r;
|
|
153
|
+
let i = {
|
|
154
|
+
...r.options,
|
|
155
|
+
...t
|
|
156
|
+
};
|
|
157
|
+
return i.duration = t.duration === void 0 ? t.loading === void 0 ? r.options.duration : t.loading ? null : n : t.duration, {
|
|
158
|
+
...r,
|
|
159
|
+
options: i
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
c.current = r, s(r);
|
|
163
|
+
}, [n]), j = u((e) => {
|
|
164
|
+
if (!l.current) return;
|
|
165
|
+
let t = c.current;
|
|
166
|
+
E(t.filter((t) => t.id === e), t.filter((t) => t.id !== e));
|
|
167
|
+
let n = t.map((t) => t.id === e && t.state === "open" ? {
|
|
168
|
+
...t,
|
|
169
|
+
state: "closing"
|
|
170
|
+
} : t);
|
|
171
|
+
c.current = n, s(n);
|
|
172
|
+
}, [E]), M = u((e) => {
|
|
173
|
+
if (!l.current) return;
|
|
174
|
+
let t = c.current, n = t.filter((t) => t.id !== e);
|
|
175
|
+
E(t.filter((t) => t.id === e), n), c.current = n, s(n);
|
|
176
|
+
}, [E]), N = h(() => ({
|
|
177
|
+
toast: D,
|
|
178
|
+
dismiss: j,
|
|
179
|
+
update: O
|
|
180
|
+
}), [
|
|
181
|
+
D,
|
|
182
|
+
j,
|
|
183
|
+
O
|
|
184
|
+
]), P = h(() => ({
|
|
185
|
+
toasts: o,
|
|
186
|
+
dismiss: j,
|
|
187
|
+
remove: M,
|
|
188
|
+
registerRoot: S,
|
|
189
|
+
dismissLabel: r,
|
|
190
|
+
registerRenderer: y
|
|
191
|
+
}), [
|
|
192
|
+
o,
|
|
193
|
+
j,
|
|
194
|
+
M,
|
|
195
|
+
S,
|
|
196
|
+
r,
|
|
197
|
+
y
|
|
198
|
+
]);
|
|
199
|
+
return /* @__PURE__ */ b(k.Provider, {
|
|
200
|
+
value: N,
|
|
201
|
+
children: /* @__PURE__ */ b(A.Provider, {
|
|
202
|
+
value: P,
|
|
203
|
+
children: e
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
U.displayName = "Toast.Provider";
|
|
208
|
+
function W({ ref: e, className: n, sx: r, ...i }) {
|
|
209
|
+
let { toasts: a, registerRenderer: o } = V("Viewport");
|
|
210
|
+
return f(o, [o]), /* @__PURE__ */ b(G, { children: /* @__PURE__ */ b(t, {
|
|
211
|
+
className: n,
|
|
212
|
+
styles: j,
|
|
213
|
+
sx: r,
|
|
214
|
+
children: (t) => /* @__PURE__ */ b("div", {
|
|
215
|
+
...i,
|
|
216
|
+
ref: e,
|
|
217
|
+
"data-ui": "toast-viewport",
|
|
218
|
+
className: t,
|
|
219
|
+
children: a.map((e) => /* @__PURE__ */ b(K, { record: e }, e.id))
|
|
220
|
+
})
|
|
221
|
+
}) });
|
|
222
|
+
}
|
|
223
|
+
function G({ children: e, contained: t = !1 }) {
|
|
224
|
+
let n = g(null), [r, i] = _(null), a = o()?.portalContainer, c = a === void 0 ? r : a;
|
|
225
|
+
return f(() => {
|
|
226
|
+
i(n.current?.ownerDocument.body ?? null);
|
|
227
|
+
}, []), /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
|
|
228
|
+
hidden: !0,
|
|
229
|
+
ref: n
|
|
230
|
+
}), t ? e : c && S(/* @__PURE__ */ b(s, { children: e }), c)] });
|
|
231
|
+
}
|
|
232
|
+
W.displayName = "Toast.Viewport";
|
|
233
|
+
function K({ record: e, exposed: t = !0, paused: n = !1, style: r, className: o, escapeDismiss: s = !1 }) {
|
|
234
|
+
let { dismiss: l, remove: d, registerRoot: p, dismissLabel: m } = V("Viewport"), { id: h, options: v, state: S } = e, { title: C, description: w, tone: T = "neutral", action: D, loading: O } = v, k = v.duration, A = g(null), j = u((e) => {
|
|
235
|
+
A.current = e, p(h, e);
|
|
236
|
+
}, [h, p]), [H, U] = _(!1), [W, G] = _(!1), [K, J] = _(!1), Y = g(k ?? 0), [X, Z] = _(!1);
|
|
237
|
+
f(() => {
|
|
238
|
+
let e = A.current?.ownerDocument;
|
|
239
|
+
if (!e) return;
|
|
240
|
+
let t = () => Z(e.hidden);
|
|
241
|
+
return t(), e.addEventListener("visibilitychange", t), () => e.removeEventListener("visibilitychange", t);
|
|
242
|
+
}, []), f(() => {
|
|
243
|
+
Y.current = k ?? 0;
|
|
244
|
+
}, [k]), f(() => {
|
|
245
|
+
if (!t || H) return;
|
|
246
|
+
let e = setTimeout(() => U(!0), E);
|
|
247
|
+
return () => clearTimeout(e);
|
|
248
|
+
}, [t, H]);
|
|
249
|
+
let Q = H && t && !n && !X && S === "open" && k !== null && !W && !K;
|
|
250
|
+
return f(() => {
|
|
251
|
+
if (!Q) return;
|
|
252
|
+
let e = performance.now(), t = setTimeout(() => l(h), Y.current);
|
|
253
|
+
return () => {
|
|
254
|
+
clearTimeout(t), Y.current -= performance.now() - e;
|
|
255
|
+
};
|
|
256
|
+
}, [
|
|
257
|
+
Q,
|
|
258
|
+
l,
|
|
259
|
+
h,
|
|
260
|
+
k
|
|
261
|
+
]), f(() => {
|
|
262
|
+
if (S !== "closing") return;
|
|
263
|
+
let e = A.current, t = e && typeof e.getAnimations == "function" ? e.getAnimations() : [], n = !1;
|
|
264
|
+
return Promise.allSettled(t.map((e) => e.finished)).then(() => {
|
|
265
|
+
n || d(h);
|
|
266
|
+
}), () => {
|
|
267
|
+
n = !0;
|
|
268
|
+
};
|
|
269
|
+
}, [
|
|
270
|
+
S,
|
|
271
|
+
d,
|
|
272
|
+
h
|
|
273
|
+
]), /* @__PURE__ */ x("div", {
|
|
274
|
+
ref: j,
|
|
275
|
+
inert: S === "closing" || !t,
|
|
276
|
+
"aria-hidden": S === "closing" || !t || void 0,
|
|
277
|
+
"data-toast-id": h,
|
|
278
|
+
style: r,
|
|
279
|
+
className: o,
|
|
280
|
+
onKeyDown: (e) => {
|
|
281
|
+
s && e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), e.stopPropagation(), l(h));
|
|
282
|
+
},
|
|
283
|
+
"data-ui": "toast",
|
|
284
|
+
"data-tone": T,
|
|
285
|
+
"data-state": S,
|
|
286
|
+
"data-populated": H,
|
|
287
|
+
"data-exposed": t,
|
|
288
|
+
onPointerEnter: () => G(!0),
|
|
289
|
+
onPointerLeave: () => G(!1),
|
|
290
|
+
onFocus: () => J(!0),
|
|
291
|
+
onBlur: (e) => {
|
|
292
|
+
e.currentTarget.contains(e.relatedTarget) || J(!1);
|
|
293
|
+
},
|
|
294
|
+
css: [M, N[T]],
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ b("div", {
|
|
297
|
+
role: T === "danger" ? "alert" : "status",
|
|
298
|
+
"aria-atomic": "true",
|
|
299
|
+
css: P,
|
|
300
|
+
children: H && /* @__PURE__ */ x(y, { children: [i(C) && /* @__PURE__ */ b("div", {
|
|
301
|
+
css: F,
|
|
302
|
+
children: C
|
|
303
|
+
}), i(w) && /* @__PURE__ */ b("div", {
|
|
304
|
+
css: I,
|
|
305
|
+
children: w
|
|
306
|
+
})] })
|
|
307
|
+
}),
|
|
308
|
+
O && /* @__PURE__ */ b(c, {
|
|
309
|
+
"aria-hidden": "true",
|
|
310
|
+
label: "",
|
|
311
|
+
size: "sm"
|
|
312
|
+
}),
|
|
313
|
+
(H || s && t) && /* @__PURE__ */ x("div", {
|
|
314
|
+
css: R,
|
|
315
|
+
children: [/* @__PURE__ */ b(a, {
|
|
316
|
+
variant: "ghost",
|
|
317
|
+
size: "sm",
|
|
318
|
+
"aria-label": m,
|
|
319
|
+
"data-toast-dismiss": "",
|
|
320
|
+
onClick: () => l(h),
|
|
321
|
+
css: L,
|
|
322
|
+
children: /* @__PURE__ */ b(q, {})
|
|
323
|
+
}), D && /* @__PURE__ */ b("div", {
|
|
324
|
+
css: z,
|
|
325
|
+
children: /* @__PURE__ */ b(a, {
|
|
326
|
+
variant: "outline",
|
|
327
|
+
size: "sm",
|
|
328
|
+
onClick: (e) => {
|
|
329
|
+
D?.onClick(e), e.defaultPrevented || l(h);
|
|
330
|
+
},
|
|
331
|
+
css: B,
|
|
332
|
+
children: D.label
|
|
333
|
+
})
|
|
334
|
+
})]
|
|
335
|
+
})
|
|
336
|
+
]
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
function q() {
|
|
340
|
+
return /* @__PURE__ */ x("svg", {
|
|
341
|
+
"aria-hidden": "true",
|
|
342
|
+
viewBox: "0 0 16 16",
|
|
343
|
+
width: "16",
|
|
344
|
+
height: "16",
|
|
345
|
+
fill: "none",
|
|
346
|
+
stroke: "currentColor",
|
|
347
|
+
strokeWidth: "2",
|
|
348
|
+
strokeLinecap: "round",
|
|
349
|
+
children: [/* @__PURE__ */ b("line", {
|
|
350
|
+
x1: "4",
|
|
351
|
+
y1: "4",
|
|
352
|
+
x2: "12",
|
|
353
|
+
y2: "12"
|
|
354
|
+
}), /* @__PURE__ */ b("line", {
|
|
355
|
+
x1: "12",
|
|
356
|
+
y1: "4",
|
|
357
|
+
x2: "4",
|
|
358
|
+
y2: "12"
|
|
359
|
+
})]
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
function J(e) {
|
|
363
|
+
return /* @__PURE__ */ b(U, { ...e });
|
|
364
|
+
}
|
|
365
|
+
J.displayName = "Toast";
|
|
366
|
+
var Y = Object.assign(J, {
|
|
367
|
+
Provider: U,
|
|
368
|
+
Viewport: W
|
|
369
|
+
});
|
|
370
|
+
//#endregion
|
|
371
|
+
export { H as a, G as i, Y as n, V as o, K as r, D as t };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { r as n } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as r } from "./button-NLY0h6EJ.js";
|
|
5
|
+
import { i, o as a, r as o, t as s } from "./toast-B7wo3sX1.js";
|
|
6
|
+
import { useEffect as c, useId as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
7
|
+
import { vars as p } from "@jfrader/tokens/vars";
|
|
8
|
+
import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
|
|
9
|
+
//#region src/components/toast-stack/toast-stack.tsx
|
|
10
|
+
var g = e({
|
|
11
|
+
position: "fixed",
|
|
12
|
+
insetBlockEnd: p.space[4],
|
|
13
|
+
insetInlineEnd: p.space[4],
|
|
14
|
+
inlineSize: s,
|
|
15
|
+
fontFamily: p.font.sans,
|
|
16
|
+
display: "grid",
|
|
17
|
+
gap: p.space[2],
|
|
18
|
+
maxBlockSize: `calc(100dvh - ${p.space[8]})`,
|
|
19
|
+
overflowY: "auto",
|
|
20
|
+
pointerEvents: "auto",
|
|
21
|
+
"&[data-empty=\"true\"]": { pointerEvents: "none" },
|
|
22
|
+
"&[data-contained=\"true\"]": {
|
|
23
|
+
position: "absolute",
|
|
24
|
+
maxInlineSize: `calc(100% - ${p.space[8]})`,
|
|
25
|
+
maxBlockSize: `calc(100% - ${p.space[8]})`
|
|
26
|
+
},
|
|
27
|
+
"&[data-position=\"bottom-start\"]": {
|
|
28
|
+
insetInlineEnd: "auto",
|
|
29
|
+
insetInlineStart: p.space[4]
|
|
30
|
+
},
|
|
31
|
+
"&[data-position=\"bottom-center\"]": {
|
|
32
|
+
insetInline: p.space[4],
|
|
33
|
+
marginInline: "auto"
|
|
34
|
+
},
|
|
35
|
+
"@media (max-width: 30rem)": { "&[data-position]": {
|
|
36
|
+
insetInline: p.space[4],
|
|
37
|
+
marginInline: "auto"
|
|
38
|
+
} }
|
|
39
|
+
}), _ = e({
|
|
40
|
+
position: "relative",
|
|
41
|
+
blockSize: "var(--toast-stack-height, 0px)",
|
|
42
|
+
pointerEvents: "auto",
|
|
43
|
+
transitionProperty: "block-size",
|
|
44
|
+
transitionDuration: p.motion.duration.base,
|
|
45
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
46
|
+
[n]: { transitionDuration: "0s" }
|
|
47
|
+
}), v = e({
|
|
48
|
+
position: "absolute",
|
|
49
|
+
insetInline: 0,
|
|
50
|
+
insetBlockEnd: "var(--toast-stack-offset, 0px)",
|
|
51
|
+
zIndex: "var(--toast-stack-order)",
|
|
52
|
+
transitionProperty: "opacity, inset-block-end",
|
|
53
|
+
transitionDuration: p.motion.duration.base,
|
|
54
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
55
|
+
"&[data-stack-visible=\"false\"]": { visibility: "hidden" },
|
|
56
|
+
[n]: { transitionDuration: "0s" }
|
|
57
|
+
}), y = e({
|
|
58
|
+
pointerEvents: "auto",
|
|
59
|
+
justifySelf: "end",
|
|
60
|
+
minBlockSize: p.space[8]
|
|
61
|
+
});
|
|
62
|
+
function b({ ref: e, className: n, sx: i, variant: s = "stacked", position: b = "bottom-end", contained: x = !1, maxVisible: S = 3, label: C = "Notifications", hotkey: w = !1, expandLabel: T = "Expand notifications", collapseLabel: E = "Collapse notifications", slotProps: D, onPointerEnter: O, onPointerLeave: ee, onFocus: te, onBlur: ne, onKeyDown: k, ...A }) {
|
|
63
|
+
let { toasts: j, registerRenderer: M } = a("Stack"), N = d(null), P = d(null), F = l(), [I, L] = f(!1), [R, z] = f(!1), [B, V] = f(!1), [H, U] = f({}), W = d(/* @__PURE__ */ new Map()), G = [...j].reverse(), K = G.filter((e) => e.state === "open"), q = Math.max(1, Math.floor(Number.isFinite(S) ? S : 3)), J = s === "list" || I || R || B, Y = I || R || B;
|
|
64
|
+
c(M, [M]), c(() => {
|
|
65
|
+
K.length || V(!1);
|
|
66
|
+
}, [K.length]), u(() => {
|
|
67
|
+
let e = N.current;
|
|
68
|
+
R && e && !e.contains(e.ownerDocument.activeElement) && z(!1);
|
|
69
|
+
}, [j, R]), u(() => {
|
|
70
|
+
let e = P.current;
|
|
71
|
+
if (!e) return;
|
|
72
|
+
let t = () => {
|
|
73
|
+
let t = {};
|
|
74
|
+
e.querySelectorAll("[data-toast-id]").forEach((e) => {
|
|
75
|
+
t[e.dataset.toastId] = e.getBoundingClientRect().height;
|
|
76
|
+
}), U((e) => JSON.stringify(e) === JSON.stringify(t) ? e : t);
|
|
77
|
+
}, n = new ResizeObserver(t);
|
|
78
|
+
return Array.from(e.children).forEach((e) => n.observe(e)), t(), () => n.disconnect();
|
|
79
|
+
}, [j]), c(() => {
|
|
80
|
+
let e = N.current;
|
|
81
|
+
if (!e) return;
|
|
82
|
+
let t = e.ownerDocument, n = (t) => {
|
|
83
|
+
e.contains(t.target) || V(!1);
|
|
84
|
+
}, r = (t) => {
|
|
85
|
+
let n = t.target;
|
|
86
|
+
if (!w || !t.altKey || t.ctrlKey || t.metaKey || t.key.toLowerCase() !== "t" || t.defaultPrevented || n.closest("input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])")) return;
|
|
87
|
+
let r = e.querySelector("[data-state=\"open\"] [data-toast-dismiss]");
|
|
88
|
+
r && (t.preventDefault(), V(!0), r.focus());
|
|
89
|
+
};
|
|
90
|
+
return t.addEventListener("pointerdown", n), t.addEventListener("keydown", r), () => {
|
|
91
|
+
t.removeEventListener("pointerdown", n), t.removeEventListener("keydown", r);
|
|
92
|
+
};
|
|
93
|
+
}, [w, j]);
|
|
94
|
+
let X = "0px", Z = /* @__PURE__ */ new Map(), Q = 0;
|
|
95
|
+
K.forEach((e, t) => {
|
|
96
|
+
Z.set(e.id, J ? `calc(${Q}px + ${t} * ${p.space[2]})` : `calc(${t} * ${p.space[3]})`), Q += H[e.id] ?? 0;
|
|
97
|
+
}), u(() => {
|
|
98
|
+
Z.forEach((e, t) => W.current.set(t, e));
|
|
99
|
+
for (let e of W.current.keys()) G.some((t) => t.id === e) || W.current.delete(e);
|
|
100
|
+
}), K.length && (X = J ? `calc(${Q}px + ${K.length - 1} * ${p.space[2]})` : `calc(${H[K[0].id] ?? 0}px + ${Math.min(K.length, q) - 1} * ${p.space[3]})`);
|
|
101
|
+
let $ = Math.max(0, K.length - q), re = K[0]?.id;
|
|
102
|
+
return c(() => {
|
|
103
|
+
let e = N.current, t = P.current;
|
|
104
|
+
if (!e || !t || R) return;
|
|
105
|
+
let n = !1, r = typeof t.getAnimations == "function" ? t.getAnimations() : [];
|
|
106
|
+
return Promise.allSettled(r.map((e) => e.finished)).then(() => {
|
|
107
|
+
n || (e.scrollTop = e.scrollHeight);
|
|
108
|
+
}), () => {
|
|
109
|
+
n = !0;
|
|
110
|
+
};
|
|
111
|
+
}, [
|
|
112
|
+
X,
|
|
113
|
+
re,
|
|
114
|
+
J,
|
|
115
|
+
R
|
|
116
|
+
]), /* @__PURE__ */ m(t, {
|
|
117
|
+
className: n,
|
|
118
|
+
styles: g,
|
|
119
|
+
sx: i,
|
|
120
|
+
children: (t) => /* @__PURE__ */ h("div", {
|
|
121
|
+
...A,
|
|
122
|
+
role: "region",
|
|
123
|
+
"aria-label": A["aria-label"] ?? (A["aria-labelledby"] ? void 0 : C),
|
|
124
|
+
className: t,
|
|
125
|
+
"data-ui": "toast-stack",
|
|
126
|
+
"data-empty": !K.length,
|
|
127
|
+
"data-contained": x,
|
|
128
|
+
"data-position": b,
|
|
129
|
+
"data-expanded": J,
|
|
130
|
+
ref: (t) => {
|
|
131
|
+
if (N.current = t, typeof e == "function") return e(t);
|
|
132
|
+
e && (e.current = t);
|
|
133
|
+
},
|
|
134
|
+
onPointerEnter: (e) => {
|
|
135
|
+
O?.(e), !e.defaultPrevented && e.pointerType !== "touch" && L(!0);
|
|
136
|
+
},
|
|
137
|
+
onPointerLeave: (e) => {
|
|
138
|
+
ee?.(e), e.defaultPrevented || L(!1);
|
|
139
|
+
},
|
|
140
|
+
onFocus: (e) => {
|
|
141
|
+
te?.(e), e.defaultPrevented || z(!0);
|
|
142
|
+
},
|
|
143
|
+
onBlur: (e) => {
|
|
144
|
+
ne?.(e), e.currentTarget.contains(e.relatedTarget) || z(!1);
|
|
145
|
+
},
|
|
146
|
+
onKeyDownCapture: (e) => {
|
|
147
|
+
A.onKeyDownCapture?.(e), k?.(e);
|
|
148
|
+
},
|
|
149
|
+
children: [s === "stacked" && K.length > 1 && /* @__PURE__ */ h(r, {
|
|
150
|
+
variant: "outline",
|
|
151
|
+
size: "sm",
|
|
152
|
+
"data-ui": "toast-stack-toggle",
|
|
153
|
+
"aria-expanded": J,
|
|
154
|
+
"aria-controls": F,
|
|
155
|
+
"aria-label": J ? E : T,
|
|
156
|
+
className: D?.toggle?.className,
|
|
157
|
+
css: [y, D?.toggle?.css],
|
|
158
|
+
onClick: () => V((e) => !e),
|
|
159
|
+
children: [J ? E : T, $ > 0 && ` (+${new Intl.NumberFormat().format($)})`]
|
|
160
|
+
}), /* @__PURE__ */ m("div", {
|
|
161
|
+
id: F,
|
|
162
|
+
ref: P,
|
|
163
|
+
"data-ui": "toast-stack-list",
|
|
164
|
+
className: D?.list?.className,
|
|
165
|
+
css: [_, D?.list?.css],
|
|
166
|
+
style: { "--toast-stack-height": X },
|
|
167
|
+
children: G.map((e) => {
|
|
168
|
+
let t = K.indexOf(e), n = e.state === "closing" || t >= 0 && (J || t < q);
|
|
169
|
+
return /* @__PURE__ */ m("div", {
|
|
170
|
+
"data-stack-visible": n,
|
|
171
|
+
css: v,
|
|
172
|
+
style: {
|
|
173
|
+
"--toast-stack-offset": Z.get(e.id) ?? W.current.get(e.id) ?? "0px",
|
|
174
|
+
"--toast-stack-order": G.length - G.indexOf(e)
|
|
175
|
+
},
|
|
176
|
+
children: /* @__PURE__ */ m(o, {
|
|
177
|
+
record: e,
|
|
178
|
+
exposed: t >= 0 && (J || t === 0),
|
|
179
|
+
paused: Y,
|
|
180
|
+
escapeDismiss: !0,
|
|
181
|
+
style: !J && t > 0 ? { minBlockSize: H[K[0].id] } : void 0
|
|
182
|
+
})
|
|
183
|
+
}, e.id);
|
|
184
|
+
})
|
|
185
|
+
})]
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function x(e) {
|
|
190
|
+
return /* @__PURE__ */ m(i, {
|
|
191
|
+
contained: e.contained,
|
|
192
|
+
children: /* @__PURE__ */ m(b, { ...e })
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
x.displayName = "ToastStack";
|
|
196
|
+
//#endregion
|
|
197
|
+
export { x as t };
|
package/dist/toast.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export {
|
|
2
|
+
export { n as Toast, a as useToast } from "./toast-B7wo3sX1.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
3
|
import { t as n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
-
import { n as r,
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
5
|
import { n as a, r as o, t as s } from "./roving-focus-CYlo_Kf8.js";
|
|
6
|
-
import { t as c } from "./use-controlled-state-
|
|
6
|
+
import { t as c } from "./use-controlled-state-DpeVQZNR.js";
|
|
7
7
|
import { createContext as l, useContext as u, useEffect as d, useImperativeHandle as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
8
8
|
import { vars as g } from "@jfrader/tokens/vars";
|
|
9
9
|
import { jsx as _ } from "@emotion/react/jsx-runtime";
|
|
@@ -72,8 +72,8 @@ var b = [], x = (e, t) => {
|
|
|
72
72
|
cursor: "not-allowed"
|
|
73
73
|
},
|
|
74
74
|
"&:focus-visible": { ...n },
|
|
75
|
-
[
|
|
76
|
-
[
|
|
75
|
+
[i]: { transitionDuration: "0s" },
|
|
76
|
+
[r]: { "&[aria-pressed=\"true\"]": {
|
|
77
77
|
backgroundColor: "SelectedItem",
|
|
78
78
|
borderColor: "SelectedItem",
|
|
79
79
|
color: "SelectedItemText"
|
|
@@ -123,7 +123,7 @@ function D({ ref: e, type: n = "single", value: r, defaultValue: i, onValueChang
|
|
|
123
123
|
ref: P,
|
|
124
124
|
role: "group",
|
|
125
125
|
"aria-label": b ?? C,
|
|
126
|
-
"aria-disabled": g
|
|
126
|
+
"aria-disabled": g ? !0 : k["aria-disabled"],
|
|
127
127
|
"data-ui": "toggle-group-root",
|
|
128
128
|
"data-type": n,
|
|
129
129
|
"data-orientation": u,
|
package/dist/toggle-group.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as ToggleGroup } from "./toggle-group-
|
|
2
|
+
export { t as ToggleGroup } from "./toggle-group-B2fpFZwV.js";
|