@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
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as a } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
+
import { t as o } from "./visually-hidden-BJdvqqvn.js";
|
|
7
|
+
import { t as s } from "./renderable-DzcIj1Lo.js";
|
|
8
|
+
import { n as c, t as l } from "./surface-DZ4d-2aL.js";
|
|
9
|
+
import { t as u } from "./trigger-style-B1KVC8O1.js";
|
|
10
|
+
import { n as d, r as f } from "./overlay-layer-SeUyyEPD.js";
|
|
11
|
+
import { i as p, r as m, t as h } from "./use-native-dialog-DWpIUVO1.js";
|
|
12
|
+
import { createContext as g, useCallback as _, useContext as v, useEffect as y, useId as b, useMemo as x, useRef as S, useState as C } from "react";
|
|
13
|
+
import { vars as w } from "@jfrader/tokens/vars";
|
|
14
|
+
import { jsx as T, jsxs as E } from "@emotion/react/jsx-runtime";
|
|
15
|
+
import { useFloating as D, useFloatingTree as O, useInteractions as k, useMergeRefs as A } from "@floating-ui/react";
|
|
16
|
+
import { getDeepestNode as j } from "@floating-ui/react/utils";
|
|
17
|
+
import { MotionConfig as M, animate as N, useMotionValue as P, useReducedMotion as F } from "motion/react";
|
|
18
|
+
//#region src/components/bottom-sheet/bottom-sheet.tsx
|
|
19
|
+
var I = [.45, .92], L = "36rem", R = {
|
|
20
|
+
type: "spring",
|
|
21
|
+
stiffness: 400,
|
|
22
|
+
damping: 40,
|
|
23
|
+
mass: 1
|
|
24
|
+
}, z = .2, ee = 320, B = 80, V = 120, H = 8, U = [
|
|
25
|
+
"button:not([data-ui=\"bottom-sheet-handle\"])",
|
|
26
|
+
"a[href]",
|
|
27
|
+
"input",
|
|
28
|
+
"select",
|
|
29
|
+
"textarea",
|
|
30
|
+
"label",
|
|
31
|
+
"[contenteditable]:not([contenteditable=\"false\"])",
|
|
32
|
+
"[data-ui=\"bottom-sheet-title\"]",
|
|
33
|
+
"[data-ui=\"bottom-sheet-description\"]"
|
|
34
|
+
].join(", "), te = "button, a[href], input, select, textarea, [contenteditable]:not([contenteditable=\"false\"])", ne = e({
|
|
35
|
+
...l,
|
|
36
|
+
position: "fixed",
|
|
37
|
+
inset: 0,
|
|
38
|
+
margin: 0,
|
|
39
|
+
inlineSize: "100%",
|
|
40
|
+
blockSize: "100dvh",
|
|
41
|
+
maxInlineSize: "none",
|
|
42
|
+
maxBlockSize: "none",
|
|
43
|
+
overflow: "hidden",
|
|
44
|
+
"&::backdrop": { backgroundColor: "transparent" }
|
|
45
|
+
}), re = e({
|
|
46
|
+
position: "absolute",
|
|
47
|
+
inset: 0,
|
|
48
|
+
backgroundColor: w.color.scrim,
|
|
49
|
+
pointerEvents: "none",
|
|
50
|
+
opacity: "var(--sheet-scrim, 1)"
|
|
51
|
+
}), ie = e({
|
|
52
|
+
...c,
|
|
53
|
+
position: "absolute",
|
|
54
|
+
insetBlockStart: 0,
|
|
55
|
+
insetInline: 0,
|
|
56
|
+
marginInline: "auto",
|
|
57
|
+
inlineSize: "100%",
|
|
58
|
+
maxInlineSize: L,
|
|
59
|
+
blockSize: "var(--sheet-height, 45dvh)",
|
|
60
|
+
display: "flex",
|
|
61
|
+
flexDirection: "column",
|
|
62
|
+
minBlockSize: 0,
|
|
63
|
+
borderStartStartRadius: w.radius.lg,
|
|
64
|
+
borderStartEndRadius: w.radius.lg,
|
|
65
|
+
boxShadow: w.shadow.floating,
|
|
66
|
+
paddingBlockEnd: "env(safe-area-inset-bottom, 0px)",
|
|
67
|
+
"&:focus-visible": n,
|
|
68
|
+
[r]: {
|
|
69
|
+
boxShadow: "none",
|
|
70
|
+
borderColor: "CanvasText"
|
|
71
|
+
}
|
|
72
|
+
}), ae = e({
|
|
73
|
+
flexShrink: 0,
|
|
74
|
+
display: "grid",
|
|
75
|
+
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
76
|
+
gap: w.space[2],
|
|
77
|
+
paddingInline: w.space[6],
|
|
78
|
+
paddingBlock: w.space[2],
|
|
79
|
+
"& > [data-ui=\"bottom-sheet-handle\"]": {
|
|
80
|
+
gridColumn: "1 / -1",
|
|
81
|
+
justifySelf: "center",
|
|
82
|
+
touchAction: "none"
|
|
83
|
+
},
|
|
84
|
+
"& > [data-ui=\"bottom-sheet-close\"]": {
|
|
85
|
+
gridColumn: 2,
|
|
86
|
+
gridRow: 2
|
|
87
|
+
}
|
|
88
|
+
}), oe = e({
|
|
89
|
+
flex: "1 1 auto",
|
|
90
|
+
minBlockSize: 0,
|
|
91
|
+
overflow: "auto",
|
|
92
|
+
overscrollBehavior: "contain",
|
|
93
|
+
paddingInline: w.space[6],
|
|
94
|
+
paddingBlock: w.space[4],
|
|
95
|
+
fontSize: w.textSize.sm,
|
|
96
|
+
"&:focus-visible": n
|
|
97
|
+
}), se = e({
|
|
98
|
+
flexShrink: 0,
|
|
99
|
+
display: "flex",
|
|
100
|
+
flexWrap: "wrap",
|
|
101
|
+
gap: w.space[2],
|
|
102
|
+
paddingInline: w.space[6],
|
|
103
|
+
paddingBlock: w.space[4],
|
|
104
|
+
borderBlockStart: `1px solid ${w.color.border}`
|
|
105
|
+
}), ce = e({
|
|
106
|
+
margin: 0,
|
|
107
|
+
fontSize: w.textSize.lg,
|
|
108
|
+
lineHeight: w.lineHeight.tight,
|
|
109
|
+
fontWeight: w.fontWeight.semibold
|
|
110
|
+
}), le = e({
|
|
111
|
+
margin: 0,
|
|
112
|
+
color: w.color.textMuted,
|
|
113
|
+
fontSize: w.textSize.sm
|
|
114
|
+
}), W = e({
|
|
115
|
+
appearance: "none",
|
|
116
|
+
minInlineSize: w.space[8],
|
|
117
|
+
minBlockSize: w.space[8],
|
|
118
|
+
display: "inline-flex",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
justifyContent: "center",
|
|
121
|
+
paddingInline: w.space[3],
|
|
122
|
+
paddingBlock: w.space[1],
|
|
123
|
+
border: "1px solid transparent",
|
|
124
|
+
borderRadius: w.radius.md,
|
|
125
|
+
color: w.color.textMuted,
|
|
126
|
+
backgroundColor: "transparent",
|
|
127
|
+
font: "inherit",
|
|
128
|
+
cursor: "pointer",
|
|
129
|
+
"&:focus-visible": n,
|
|
130
|
+
"&:disabled": { cursor: "not-allowed" },
|
|
131
|
+
[r]: { borderColor: "ButtonText" },
|
|
132
|
+
[i]: { transition: "none" }
|
|
133
|
+
}), ue = e({
|
|
134
|
+
"&::after": {
|
|
135
|
+
content: "\"\"",
|
|
136
|
+
inlineSize: w.space[10],
|
|
137
|
+
blockSize: w.space[1],
|
|
138
|
+
borderRadius: w.radius.full,
|
|
139
|
+
backgroundColor: w.color.borderControl
|
|
140
|
+
},
|
|
141
|
+
[r]: { "&::after": {
|
|
142
|
+
backgroundColor: "ButtonText",
|
|
143
|
+
outline: "1px solid ButtonText"
|
|
144
|
+
} }
|
|
145
|
+
}), G = o, K = g(null), q = g(null);
|
|
146
|
+
function J(e) {
|
|
147
|
+
let t = v(K);
|
|
148
|
+
if (!t) throw Error(`BottomSheet.${e} must be rendered inside <BottomSheet>.`);
|
|
149
|
+
return t;
|
|
150
|
+
}
|
|
151
|
+
function de(e) {
|
|
152
|
+
if (!e.length || e.some((t, n) => !Number.isFinite(t) || t <= 0 || t > 1 || n > 0 && t <= e[n - 1])) throw Error("BottomSheet.detents must be nonempty, finite, strictly ascending unique fractions in (0, 1].");
|
|
153
|
+
}
|
|
154
|
+
function fe({ nodeId: e, open: t, defaultOpen: n = !1, onOpenChange: r, detents: i = I, value: o, defaultValue: s = 0, onValueChange: c, locale: l, getValueText: u, children: d }) {
|
|
155
|
+
de(i);
|
|
156
|
+
let m = S([...i]);
|
|
157
|
+
if (i.length !== m.current.length || i.some((e, t) => e !== m.current[t])) throw Error("BottomSheet.detents numeric contents require remount to change.");
|
|
158
|
+
let [h = 0, g] = a(o, s, c);
|
|
159
|
+
if (!Number.isInteger(h) || h < 0 || h >= i.length || !Number.isInteger(s) || s < 0 || s >= i.length) throw Error("BottomSheet value/defaultValue must be valid detent indices.");
|
|
160
|
+
let [v = !1, w] = a(t, n, r), E = p(v, w), [O, A] = C(null), [j, M] = C(!1), N = _((e) => {
|
|
161
|
+
E.setDialogElement(e), A(e);
|
|
162
|
+
}, [E.setDialogElement]);
|
|
163
|
+
y(() => {
|
|
164
|
+
let e = () => M(O?.open ?? !1);
|
|
165
|
+
if (e(), !O) return;
|
|
166
|
+
let t = O.ownerDocument.defaultView?.MutationObserver;
|
|
167
|
+
if (!t) return;
|
|
168
|
+
let n = new t(e);
|
|
169
|
+
return n.observe(O, {
|
|
170
|
+
attributes: !0,
|
|
171
|
+
attributeFilter: ["open"]
|
|
172
|
+
}), () => n.disconnect();
|
|
173
|
+
}, [O]);
|
|
174
|
+
let P = D({
|
|
175
|
+
nodeId: e,
|
|
176
|
+
open: v && j,
|
|
177
|
+
onOpenChange: (e) => e ? E.setOpen(!0) : E.requestClose()
|
|
178
|
+
}), F = f(P.context, "container"), L = k(F), R = b(), [z, ee] = C(!1), [B, V] = C(!1), H = x(() => {
|
|
179
|
+
let e = m.current[h];
|
|
180
|
+
return u?.(e, h) ?? new Intl.NumberFormat(l, { style: "percent" }).format(e);
|
|
181
|
+
}, [
|
|
182
|
+
u,
|
|
183
|
+
l,
|
|
184
|
+
h
|
|
185
|
+
]), U = x(() => ({
|
|
186
|
+
...E,
|
|
187
|
+
setDialogElement: N,
|
|
188
|
+
open: v,
|
|
189
|
+
detents: m.current,
|
|
190
|
+
value: h,
|
|
191
|
+
requestValue: g,
|
|
192
|
+
valueText: H,
|
|
193
|
+
panelId: `${R}-panel`,
|
|
194
|
+
valueTextId: `${R}-value`,
|
|
195
|
+
titleId: `${R}-title`,
|
|
196
|
+
descriptionId: `${R}-description`,
|
|
197
|
+
hasTitle: z,
|
|
198
|
+
hasDescription: B,
|
|
199
|
+
setHasTitle: ee,
|
|
200
|
+
setHasDescription: V,
|
|
201
|
+
floating: P,
|
|
202
|
+
interactions: L
|
|
203
|
+
}), [
|
|
204
|
+
E.setOpen,
|
|
205
|
+
E.requestClose,
|
|
206
|
+
E.repairToken,
|
|
207
|
+
N,
|
|
208
|
+
v,
|
|
209
|
+
h,
|
|
210
|
+
g,
|
|
211
|
+
H,
|
|
212
|
+
R,
|
|
213
|
+
z,
|
|
214
|
+
B,
|
|
215
|
+
P,
|
|
216
|
+
L
|
|
217
|
+
]);
|
|
218
|
+
return /* @__PURE__ */ T(K.Provider, {
|
|
219
|
+
value: U,
|
|
220
|
+
children: d
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function Y(e) {
|
|
224
|
+
return /* @__PURE__ */ T(M, {
|
|
225
|
+
reducedMotion: "user",
|
|
226
|
+
children: /* @__PURE__ */ T(d, { children: (t) => /* @__PURE__ */ T(fe, {
|
|
227
|
+
...e,
|
|
228
|
+
nodeId: t
|
|
229
|
+
}) })
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
Y.displayName = "BottomSheet";
|
|
233
|
+
function X({ ref: e, onClick: n, className: r, sx: i, ...a }) {
|
|
234
|
+
let o = J("Trigger"), s = A([e, o.floating.refs.setReference]);
|
|
235
|
+
return /* @__PURE__ */ T(t, {
|
|
236
|
+
className: r,
|
|
237
|
+
styles: u,
|
|
238
|
+
sx: i,
|
|
239
|
+
children: (e) => /* @__PURE__ */ T("button", {
|
|
240
|
+
type: "button",
|
|
241
|
+
...a,
|
|
242
|
+
ref: s,
|
|
243
|
+
"data-ui": "bottom-sheet-trigger",
|
|
244
|
+
"aria-haspopup": "dialog",
|
|
245
|
+
"aria-expanded": o.open,
|
|
246
|
+
className: e,
|
|
247
|
+
onClick: (e) => {
|
|
248
|
+
n?.(e), e.defaultPrevented || o.setOpen(!0);
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
X.displayName = "BottomSheet.Trigger";
|
|
254
|
+
function pe(e, t) {
|
|
255
|
+
let n = S(null), r = S(null), i = P(0), a = S(0), o = S(0), s = S(null), c = S(null), l = S(!1), u = F(), d = S({
|
|
256
|
+
context: e,
|
|
257
|
+
reduced: u
|
|
258
|
+
});
|
|
259
|
+
d.current = {
|
|
260
|
+
context: e,
|
|
261
|
+
reduced: u
|
|
262
|
+
};
|
|
263
|
+
let f = () => a.current * (1 - d.current.context.detents[d.current.context.value]), p = _(() => {
|
|
264
|
+
s.current?.stop(), d.current.reduced ? i.set(f()) : s.current = N(i, f(), R);
|
|
265
|
+
}, [i]), m = _(() => {
|
|
266
|
+
let e = c.current;
|
|
267
|
+
return e ? (c.current = null, e.capture?.hasPointerCapture(e.id) && e.capture.releasePointerCapture(e.id), l.current = !0, p(), !0) : !1;
|
|
268
|
+
}, [p]);
|
|
269
|
+
y(() => {
|
|
270
|
+
let e = t.current, r = n.current, l = e?.ownerDocument.defaultView;
|
|
271
|
+
if (!e || !r || !l) return;
|
|
272
|
+
let u = (t) => {
|
|
273
|
+
r.style.transform = `translateY(${t}px)`, r.style.setProperty("--sheet-height", `${Math.max(0, a.current - t) + o.current}px`), e.style.setProperty("--sheet-scrim", String(Math.min(1, Math.max(0, (a.current - t) / Math.max(1, a.current)))));
|
|
274
|
+
}, d = () => {
|
|
275
|
+
let t = l.visualViewport;
|
|
276
|
+
m();
|
|
277
|
+
let n = t?.height ?? l.innerHeight;
|
|
278
|
+
o.current = Number.parseFloat(l.getComputedStyle(r).paddingBottom) || 0, a.current = Math.max(1, n - o.current), e.style.blockSize = `${n}px`, e.style.insetBlockStart = `${t?.offsetTop ?? 0}px`, s.current?.stop(), c.current = null, i.set(f()), u(i.get());
|
|
279
|
+
};
|
|
280
|
+
d();
|
|
281
|
+
let p = i.on("change", u), h = (e) => {
|
|
282
|
+
c.current && c.current.id !== e.pointerId && m();
|
|
283
|
+
};
|
|
284
|
+
return l.addEventListener("pointerdown", h, !0), l.addEventListener("resize", d), l.visualViewport?.addEventListener("resize", d), l.visualViewport?.addEventListener("scroll", d), () => {
|
|
285
|
+
p(), s.current?.stop();
|
|
286
|
+
let e = c.current;
|
|
287
|
+
c.current = null, e?.capture?.hasPointerCapture(e.id) && e.capture.releasePointerCapture(e.id), l.removeEventListener("pointerdown", h, !0), l.removeEventListener("resize", d), l.visualViewport?.removeEventListener("resize", d), l.visualViewport?.removeEventListener("scroll", d);
|
|
288
|
+
};
|
|
289
|
+
}, [
|
|
290
|
+
t,
|
|
291
|
+
i,
|
|
292
|
+
m
|
|
293
|
+
]), y(() => {
|
|
294
|
+
m(), p();
|
|
295
|
+
}, [
|
|
296
|
+
e.value,
|
|
297
|
+
e.open,
|
|
298
|
+
p,
|
|
299
|
+
u,
|
|
300
|
+
m
|
|
301
|
+
]);
|
|
302
|
+
let h = (e, t, n, r = null) => {
|
|
303
|
+
s.current?.stop(), l.current = !1, c.current = {
|
|
304
|
+
id: e,
|
|
305
|
+
start: t,
|
|
306
|
+
origin: i.get(),
|
|
307
|
+
samples: [{
|
|
308
|
+
position: t,
|
|
309
|
+
time: n
|
|
310
|
+
}],
|
|
311
|
+
moved: !1,
|
|
312
|
+
capture: r
|
|
313
|
+
};
|
|
314
|
+
}, g = (e, t) => {
|
|
315
|
+
let n = c.current;
|
|
316
|
+
if (!n) return;
|
|
317
|
+
let r = e - n.start;
|
|
318
|
+
n.moved ||= Math.abs(r) > H;
|
|
319
|
+
let o = n.origin + r, s = a.current * (1 - d.current.context.detents.at(-1)), l = s - o;
|
|
320
|
+
i.set(o < s ? d.current.reduced ? s : s - V * l / (V + l) : o), n.samples = [...n.samples, {
|
|
321
|
+
position: e,
|
|
322
|
+
time: t
|
|
323
|
+
}].filter((e) => t - e.time <= B);
|
|
324
|
+
}, v = (e, t) => {
|
|
325
|
+
let n = c.current;
|
|
326
|
+
if (!n) return;
|
|
327
|
+
c.current = null, l.current = n.moved;
|
|
328
|
+
let r = [...n.samples, {
|
|
329
|
+
position: e,
|
|
330
|
+
time: t
|
|
331
|
+
}].filter((e) => t - e.time <= B)[0], o = r ? (t - r.time) / 1e3 : 0, s = r && o > 0 ? (e - r.position) / o : 0, u = i.get() + s * z, { detents: f, requestClose: m, requestValue: h } = d.current.context, g = a.current * f[0], _ = a.current - g / 2;
|
|
332
|
+
n.moved && (u > _ || s >= ee && i.get() > a.current * (1 - f[0])) ? m() : n.moved && h(f.reduce((e, t, n) => Math.abs(a.current * (1 - t) - u) < Math.abs(a.current * (1 - f[e]) - u) ? n : e, 0)), p();
|
|
333
|
+
};
|
|
334
|
+
return y(() => {
|
|
335
|
+
let e = r.current, t = e?.ownerDocument.defaultView;
|
|
336
|
+
if (!e || !t) return;
|
|
337
|
+
let n = null, i = !1, a = () => {
|
|
338
|
+
e.removeEventListener("touchmove", o), i = !1;
|
|
339
|
+
}, o = (t) => {
|
|
340
|
+
if (!n || t.touches.length !== 1) {
|
|
341
|
+
m(), a();
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
let r = t.touches[0], i = r.clientX - n.x, o = r.clientY - n.y;
|
|
345
|
+
if (Math.abs(i) > Math.abs(o)) {
|
|
346
|
+
a(), n = null;
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
if (Math.abs(o) < H) return;
|
|
350
|
+
if (c.current) {
|
|
351
|
+
t.cancelable && t.preventDefault(), g(r.clientY, t.timeStamp);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
let s = d.current.context;
|
|
355
|
+
s.value < s.detents.length - 1 ? (s.requestValue(s.detents.length - 1), a()) : o > 0 && e.scrollTop <= 0 && (h(n.id, n.y, t.timeStamp), t.cancelable && t.preventDefault(), g(r.clientY, t.timeStamp));
|
|
356
|
+
}, s = (r) => {
|
|
357
|
+
if (a(), r.touches.length !== 1) {
|
|
358
|
+
m();
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
let s = r.target;
|
|
362
|
+
if (s.closest(te) || t.getSelection()?.toString()) return;
|
|
363
|
+
for (let n = s; n && n !== e; n = n.parentElement) {
|
|
364
|
+
let e = t.getComputedStyle(n);
|
|
365
|
+
if (n.scrollWidth > n.clientWidth && /auto|scroll/.test(e.overflowX) || n.scrollHeight > n.clientHeight && /auto|scroll/.test(e.overflowY)) return;
|
|
366
|
+
}
|
|
367
|
+
let c = r.touches[0];
|
|
368
|
+
n = {
|
|
369
|
+
x: c.clientX,
|
|
370
|
+
y: c.clientY,
|
|
371
|
+
id: c.identifier,
|
|
372
|
+
target: s
|
|
373
|
+
}, e.addEventListener("touchmove", o, { passive: !1 }), i = !0;
|
|
374
|
+
}, l = (e) => {
|
|
375
|
+
let t = e.changedTouches[0];
|
|
376
|
+
c.current && t && v(t.clientY, e.timeStamp), a(), n = null;
|
|
377
|
+
}, u = () => {
|
|
378
|
+
m(), a(), n = null;
|
|
379
|
+
};
|
|
380
|
+
return e.addEventListener("touchstart", s, { passive: !0 }), e.addEventListener("touchend", l), e.addEventListener("touchcancel", u), () => {
|
|
381
|
+
i && a(), e.removeEventListener("touchstart", s), e.removeEventListener("touchend", l), e.removeEventListener("touchcancel", u);
|
|
382
|
+
};
|
|
383
|
+
}, [m]), {
|
|
384
|
+
panelRef: n,
|
|
385
|
+
bodyRef: r,
|
|
386
|
+
gesture: {
|
|
387
|
+
onPointerDown: (e) => {
|
|
388
|
+
c.current || !e.isPrimary ? m() : e.button !== 0 || e.defaultPrevented || e.target.closest(U) || (h(e.pointerId, e.clientY, e.timeStamp, e.currentTarget), e.currentTarget.setPointerCapture?.(e.pointerId));
|
|
389
|
+
},
|
|
390
|
+
onPointerMove: (e) => {
|
|
391
|
+
c.current?.id === e.pointerId && g(e.clientY, e.timeStamp);
|
|
392
|
+
},
|
|
393
|
+
onPointerUp: (e) => {
|
|
394
|
+
c.current?.id === e.pointerId && (v(e.clientY, e.timeStamp), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
395
|
+
},
|
|
396
|
+
onPointerCancel: (e) => {
|
|
397
|
+
c.current?.id === e.pointerId && m();
|
|
398
|
+
},
|
|
399
|
+
onLostPointerCapture: (e) => {
|
|
400
|
+
c.current?.id === e.pointerId && m();
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
cancelDrag: m,
|
|
404
|
+
suppressClick: l
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function Z({ ref: e, sx: n, className: r, ...i }) {
|
|
408
|
+
let { children: a, withDescription: o = !0, onCancel: s, onClose: c, onClick: l, onKeyDownCapture: u, onPointerDownCapture: d, "aria-labelledby": f, "aria-describedby": p, ...g } = h(i), _ = J("Content"), v = S(null), b = pe(_, v), x = O(), w = S(!1), D = m(_, {
|
|
409
|
+
onCancel: s,
|
|
410
|
+
onClick: (e) => {
|
|
411
|
+
l?.(e), w.current && (w.current = !1, e.preventDefault());
|
|
412
|
+
},
|
|
413
|
+
onClose: c
|
|
414
|
+
}, e, v), k = A([D.ref, _.floating.refs.setFloating]), M = S(_.value), [N, P] = C("");
|
|
415
|
+
y(() => {
|
|
416
|
+
M.current !== _.value && (M.current = _.value, P(_.valueText));
|
|
417
|
+
}, [_.value, _.valueText]);
|
|
418
|
+
let F = {
|
|
419
|
+
...g,
|
|
420
|
+
...D,
|
|
421
|
+
onCancel: (e) => {
|
|
422
|
+
e.target === v.current ? D.onCancel(e) : s?.(e);
|
|
423
|
+
},
|
|
424
|
+
onClose: (e) => {
|
|
425
|
+
e.target === v.current ? D.onClose(e) : c?.(e);
|
|
426
|
+
},
|
|
427
|
+
onPointerDownCapture: (e) => {
|
|
428
|
+
d?.(e);
|
|
429
|
+
let t = x && j(x.nodesRef.current, _.floating.context.nodeId);
|
|
430
|
+
w.current = !!(t && t.id !== _.floating.context.nodeId);
|
|
431
|
+
},
|
|
432
|
+
onKeyDownCapture: (e) => {
|
|
433
|
+
if (u?.(e), e.key !== "Escape" || e.defaultPrevented || e.nativeEvent.isComposing) return;
|
|
434
|
+
e.preventDefault();
|
|
435
|
+
let t = x && j(x.nodesRef.current, _.floating.context.nodeId);
|
|
436
|
+
(!t || t.id === _.floating.context.nodeId) && b.cancelDrag() && e.stopPropagation();
|
|
437
|
+
}
|
|
438
|
+
}, I = _.interactions.getFloatingProps(F);
|
|
439
|
+
return /* @__PURE__ */ T(t, {
|
|
440
|
+
className: r,
|
|
441
|
+
styles: ne,
|
|
442
|
+
sx: n,
|
|
443
|
+
children: (e) => /* @__PURE__ */ E("dialog", {
|
|
444
|
+
...I,
|
|
445
|
+
ref: k,
|
|
446
|
+
className: e,
|
|
447
|
+
"data-ui": "bottom-sheet",
|
|
448
|
+
"aria-modal": "true",
|
|
449
|
+
"aria-labelledby": [f, _.hasTitle && _.titleId].filter(Boolean).join(" ") || void 0,
|
|
450
|
+
"aria-describedby": [p, o && _.hasDescription && _.descriptionId].filter(Boolean).join(" ") || void 0,
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ T("div", {
|
|
453
|
+
css: re,
|
|
454
|
+
"aria-hidden": "true"
|
|
455
|
+
}),
|
|
456
|
+
/* @__PURE__ */ T(q.Provider, {
|
|
457
|
+
value: b,
|
|
458
|
+
children: a
|
|
459
|
+
}),
|
|
460
|
+
/* @__PURE__ */ T("span", {
|
|
461
|
+
css: G,
|
|
462
|
+
role: "status",
|
|
463
|
+
"aria-live": "polite",
|
|
464
|
+
"aria-atomic": "true",
|
|
465
|
+
children: N
|
|
466
|
+
}),
|
|
467
|
+
/* @__PURE__ */ T("span", {
|
|
468
|
+
css: G,
|
|
469
|
+
id: _.valueTextId,
|
|
470
|
+
children: _.valueText
|
|
471
|
+
})
|
|
472
|
+
]
|
|
473
|
+
})
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
Z.displayName = "BottomSheet.Content";
|
|
477
|
+
function Q({ ref: e, sx: n, className: r, autoFocus: i = !0, ...a }) {
|
|
478
|
+
let o = J("Panel"), s = v(q), c = _((e) => {
|
|
479
|
+
i && e && !e.querySelector("[autofocus]") && e.setAttribute("autofocus", "");
|
|
480
|
+
}, [i]), l = A([
|
|
481
|
+
e,
|
|
482
|
+
s?.panelRef,
|
|
483
|
+
c
|
|
484
|
+
]);
|
|
485
|
+
return /* @__PURE__ */ T(t, {
|
|
486
|
+
className: r,
|
|
487
|
+
styles: ie,
|
|
488
|
+
sx: n,
|
|
489
|
+
children: (e) => /* @__PURE__ */ T("div", {
|
|
490
|
+
tabIndex: -1,
|
|
491
|
+
...a,
|
|
492
|
+
ref: l,
|
|
493
|
+
id: o.panelId,
|
|
494
|
+
"data-ui": "bottom-sheet-panel",
|
|
495
|
+
className: e
|
|
496
|
+
})
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
Q.displayName = "BottomSheet.Panel";
|
|
500
|
+
function $({ ref: e, sx: n, className: r, ...i }) {
|
|
501
|
+
J("Header");
|
|
502
|
+
let a = v(q), o = Object.fromEntries(Object.entries(a?.gesture ?? {}).map(([e, t]) => [e, (n) => {
|
|
503
|
+
i[e]?.(n), n.defaultPrevented || t?.(n);
|
|
504
|
+
}]));
|
|
505
|
+
return /* @__PURE__ */ T(t, {
|
|
506
|
+
className: r,
|
|
507
|
+
styles: ae,
|
|
508
|
+
sx: n,
|
|
509
|
+
children: (t) => /* @__PURE__ */ T("div", {
|
|
510
|
+
...i,
|
|
511
|
+
...o,
|
|
512
|
+
ref: e,
|
|
513
|
+
"data-ui": "bottom-sheet-header",
|
|
514
|
+
className: t
|
|
515
|
+
})
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
$.displayName = "BottomSheet.Header";
|
|
519
|
+
function me({ ref: e, sx: n, className: r, onKeyDown: i, onFocusCapture: a, ...o }) {
|
|
520
|
+
let s = J("Body"), c = v(q), l = A([e, c?.bodyRef]), u = S(null);
|
|
521
|
+
return y(() => () => {
|
|
522
|
+
let e = u.current;
|
|
523
|
+
e && e.window.cancelAnimationFrame(e.id);
|
|
524
|
+
}, []), /* @__PURE__ */ T(t, {
|
|
525
|
+
className: r,
|
|
526
|
+
styles: oe,
|
|
527
|
+
sx: n,
|
|
528
|
+
children: (e) => /* @__PURE__ */ T("div", {
|
|
529
|
+
...o,
|
|
530
|
+
ref: l,
|
|
531
|
+
"data-ui": "bottom-sheet-body",
|
|
532
|
+
className: e,
|
|
533
|
+
onKeyDown: (e) => {
|
|
534
|
+
i?.(e), !e.defaultPrevented && e.target === e.currentTarget && (e.key === "PageDown" || e.key === " " && !e.shiftKey) && s.value < s.detents.length - 1 && (e.preventDefault(), s.requestValue(s.detents.length - 1));
|
|
535
|
+
},
|
|
536
|
+
onFocusCapture: (e) => {
|
|
537
|
+
if (a?.(e), e.defaultPrevented || e.target === e.currentTarget) return;
|
|
538
|
+
s.requestValue(s.detents.length - 1);
|
|
539
|
+
let t = e.target, n = e.currentTarget, r = n.ownerDocument.defaultView;
|
|
540
|
+
if (!r) return;
|
|
541
|
+
let i = u.current;
|
|
542
|
+
i && i.window.cancelAnimationFrame(i.id), u.current = {
|
|
543
|
+
window: r,
|
|
544
|
+
id: r.requestAnimationFrame(() => {
|
|
545
|
+
if (u.current = null, !t.isConnected) return;
|
|
546
|
+
let e = n.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
547
|
+
r.top < e.top ? n.scrollTop += r.top - e.top : r.bottom > e.bottom && (n.scrollTop += r.bottom - e.bottom);
|
|
548
|
+
})
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
})
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
me.displayName = "BottomSheet.Body";
|
|
555
|
+
function he({ ref: e, sx: n, className: r, ...i }) {
|
|
556
|
+
return J("Footer"), /* @__PURE__ */ T(t, {
|
|
557
|
+
className: r,
|
|
558
|
+
styles: se,
|
|
559
|
+
sx: n,
|
|
560
|
+
children: (t) => /* @__PURE__ */ T("div", {
|
|
561
|
+
...i,
|
|
562
|
+
ref: e,
|
|
563
|
+
"data-ui": "bottom-sheet-footer",
|
|
564
|
+
className: t
|
|
565
|
+
})
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
he.displayName = "BottomSheet.Footer";
|
|
569
|
+
function ge({ ref: e, sx: n, className: r, children: i, ...a }) {
|
|
570
|
+
let { titleId: o, setHasTitle: c } = J("Title"), l = s(i) && i !== "";
|
|
571
|
+
return y(() => {
|
|
572
|
+
if (l) return c(!0), () => c(!1);
|
|
573
|
+
}, [l, c]), l ? /* @__PURE__ */ T(t, {
|
|
574
|
+
className: r,
|
|
575
|
+
styles: ce,
|
|
576
|
+
sx: n,
|
|
577
|
+
children: (t) => /* @__PURE__ */ T("h2", {
|
|
578
|
+
...a,
|
|
579
|
+
ref: e,
|
|
580
|
+
id: o,
|
|
581
|
+
"data-ui": "bottom-sheet-title",
|
|
582
|
+
className: t,
|
|
583
|
+
children: i
|
|
584
|
+
})
|
|
585
|
+
}) : null;
|
|
586
|
+
}
|
|
587
|
+
ge.displayName = "BottomSheet.Title";
|
|
588
|
+
function _e({ ref: e, sx: n, className: r, children: i, ...a }) {
|
|
589
|
+
let { descriptionId: o, setHasDescription: c } = J("Description"), l = s(i) && i !== "";
|
|
590
|
+
return y(() => {
|
|
591
|
+
if (l) return c(!0), () => c(!1);
|
|
592
|
+
}, [l, c]), l ? /* @__PURE__ */ T(t, {
|
|
593
|
+
className: r,
|
|
594
|
+
styles: le,
|
|
595
|
+
sx: n,
|
|
596
|
+
children: (t) => /* @__PURE__ */ T("p", {
|
|
597
|
+
...a,
|
|
598
|
+
ref: e,
|
|
599
|
+
id: o,
|
|
600
|
+
"data-ui": "bottom-sheet-description",
|
|
601
|
+
className: t,
|
|
602
|
+
children: i
|
|
603
|
+
})
|
|
604
|
+
}) : null;
|
|
605
|
+
}
|
|
606
|
+
_e.displayName = "BottomSheet.Description";
|
|
607
|
+
function ve({ ref: e, sx: n, className: r, onClick: i, onKeyDown: a, "aria-describedby": o, ...s }) {
|
|
608
|
+
let c = J("Handle"), l = v(q), u = c.detents.length - 1;
|
|
609
|
+
return /* @__PURE__ */ T(t, {
|
|
610
|
+
className: r,
|
|
611
|
+
styles: [W, ue],
|
|
612
|
+
sx: n,
|
|
613
|
+
children: (t) => /* @__PURE__ */ T("button", {
|
|
614
|
+
type: "button",
|
|
615
|
+
...s,
|
|
616
|
+
ref: e,
|
|
617
|
+
disabled: s.disabled || u === 0,
|
|
618
|
+
className: t,
|
|
619
|
+
"data-ui": "bottom-sheet-handle",
|
|
620
|
+
"aria-controls": c.panelId,
|
|
621
|
+
"aria-expanded": c.value === u,
|
|
622
|
+
"aria-describedby": [o, c.valueTextId].filter(Boolean).join(" "),
|
|
623
|
+
onClick: (e) => {
|
|
624
|
+
i?.(e), l?.suppressClick.current ? l.suppressClick.current = !1 : e.defaultPrevented || c.requestValue(c.value === u ? 0 : u);
|
|
625
|
+
},
|
|
626
|
+
onKeyDown: (e) => {
|
|
627
|
+
if (a?.(e), e.defaultPrevented) return;
|
|
628
|
+
(e.key === "Enter" || e.key === " ") && l && (l.suppressClick.current = !1);
|
|
629
|
+
let t = {
|
|
630
|
+
ArrowUp: Math.min(u, c.value + 1),
|
|
631
|
+
ArrowDown: Math.max(0, c.value - 1),
|
|
632
|
+
Home: u,
|
|
633
|
+
End: 0
|
|
634
|
+
}[e.key];
|
|
635
|
+
t !== void 0 && (e.preventDefault(), c.requestValue(t));
|
|
636
|
+
}
|
|
637
|
+
})
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
ve.displayName = "BottomSheet.Handle";
|
|
641
|
+
function ye({ ref: e, sx: n, className: r, onClick: i, ...a }) {
|
|
642
|
+
let o = J("Close");
|
|
643
|
+
return /* @__PURE__ */ T(t, {
|
|
644
|
+
className: r,
|
|
645
|
+
styles: W,
|
|
646
|
+
sx: n,
|
|
647
|
+
children: (t) => /* @__PURE__ */ T("button", {
|
|
648
|
+
type: "button",
|
|
649
|
+
...a,
|
|
650
|
+
ref: e,
|
|
651
|
+
"data-ui": "bottom-sheet-close",
|
|
652
|
+
className: t,
|
|
653
|
+
onClick: (e) => {
|
|
654
|
+
i?.(e), e.defaultPrevented || o.requestClose();
|
|
655
|
+
}
|
|
656
|
+
})
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
ye.displayName = "BottomSheet.Close";
|
|
660
|
+
var be = Object.assign(Y, {
|
|
661
|
+
Trigger: X,
|
|
662
|
+
Content: Z,
|
|
663
|
+
Panel: Q,
|
|
664
|
+
Header: $,
|
|
665
|
+
Body: me,
|
|
666
|
+
Footer: he,
|
|
667
|
+
Title: ge,
|
|
668
|
+
Description: _e,
|
|
669
|
+
Handle: ve,
|
|
670
|
+
Close: ye
|
|
671
|
+
});
|
|
672
|
+
//#endregion
|
|
673
|
+
export { be as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
3
|
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
-
import {
|
|
4
|
+
import { r } from "./media-8yrN85VT.js";
|
|
5
5
|
import { createContext as i, useCallback as a, useContext as o, useId as s, useImperativeHandle as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
6
6
|
import { vars as p } from "@jfrader/tokens/vars";
|
|
7
7
|
import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
|
package/dist/breadcrumbs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Breadcrumbs } from "./breadcrumbs-
|
|
2
|
+
export { t as Breadcrumbs } from "./breadcrumbs-Cfw_hgt2.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
3
|
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
-
import {
|
|
4
|
+
import { r } from "./media-8yrN85VT.js";
|
|
5
5
|
import { t as i } from "./icon-wrapper-stN8sD7R.js";
|
|
6
6
|
import { n as a, t as o } from "./loading-ring-B8-30Dl1.js";
|
|
7
7
|
import "react";
|
package/dist/button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Button } from "./button-
|
|
2
|
+
export { t as Button } from "./button-C92uYFJW.js";
|